spring-cloud / spring-cloud-dataflow-ui

Compare de71a2f ... +0 ... 0cbc44f

Coverage Reach
app/streams/components/flo/editor.service.ts app/streams/components/flo/support/view-helper.ts app/streams/components/flo/support/utils.ts app/streams/components/flo/support/node-helper.ts app/streams/components/flo/support/layout.ts app/streams/components/flo/support/shapes.ts app/streams/components/flo/text-to-graph.ts app/streams/components/flo/graph-to-text.ts app/streams/components/flo/render.service.ts app/streams/components/flo/metamodel.service.ts app/streams/components/flo/properties/stream-properties-dialog.component.ts app/streams/components/flo/properties/stream-properties-source.ts app/streams/components/flo/node/node.component.ts app/streams/components/flo/message-rate/message-rate.component.ts app/streams/components/flo/content-assist.service.ts app/streams/components/flo/instance-dot/instance-dot.component.ts app/streams/components/stream-graph-definition/stream-graph-definition.component.ts app/streams/components/stream-status/stream-status.component.ts app/streams/components/stream-history-status/stream-status.component.ts app/streams/stream-deploy/builder/builder.component.ts app/streams/stream-deploy/builder/errors/errors.component.ts app/streams/stream-deploy/stream-deploy.component.ts app/streams/stream-deploy/stream-deploy.service.ts app/streams/stream-deploy/stream-deploy.validator.ts app/streams/stream-deploy/free-text/free-text.component.ts app/streams/stream-deploy/app-properties/app-properties.component.ts app/streams/streams/streams.component.ts app/streams/streams/deployment-properties/deployment-properties.component.ts app/streams/streams/deployment-properties-info/deployment-properties-info.component.ts app/streams/stream-create/create-dialog/create-dialog.component.ts app/streams/stream-create/stream-create.component.ts app/streams/stream/stream.component.ts app/streams/stream/history/stream-history.component.ts app/streams/stream/graph/stream-graph.component.ts app/streams/stream/summary/stream-summary.component.ts app/streams/streams.service.ts app/streams/model/stream-metrics.ts app/streams/model/stream-history.ts app/streams/model/stream-definition.ts app/streams/model/stream-deploy-config.ts app/streams/streams-destroy/streams-destroy.component.ts app/streams/streams-deploy/streams-deploy.component.ts app/streams/streams-undeploy/streams-undeploy.component.ts app/shared/services/parser.ts app/shared/services/tokenizer.ts app/shared/services/shared-about.service.ts app/shared/services/shared-apps.service.ts app/shared/services/routing-state.service.ts app/shared/services/group-route.service.ts app/shared/services/logger.service.ts app/shared/services/notification.service.ts app/shared/services/parser.service.ts app/shared/components/truncator/truncator.component.ts app/shared/components/truncator/truncator-width-provider.directive.ts app/shared/components/truncator/trail-position-type.model.ts app/shared/components/list/list-bar.component.ts app/shared/components/list/list-row-actions.component.ts app/shared/components/list/list-pagination.component.ts app/shared/components/list/list-empty.component.ts app/shared/components/list/list-no-result.component.ts app/shared/components/list/list.component.ts app/shared/components/kv-rich-text/kv-rich-text.component.ts app/shared/components/kv-rich-text/kv-rich-text.validator.ts app/shared/components/http-loader/http-loader.service.ts app/shared/components/http-loader/http-loader.interceptor.ts app/shared/components/http-loader/http-loader.component.ts app/shared/components/page/page-head-back.component.ts app/shared/components/page/page.component.ts app/shared/components/page/page-actions.component.ts app/shared/components/page/page-head-actions.component.ts app/shared/components/page/page-head.component.ts app/shared/components/page/page-head-subtitle.component.ts app/shared/components/page/page-head-title.component.ts app/shared/components/pager/pager.component.ts app/shared/components/confirm/confirm.service.ts app/shared/components/confirm/confirm.component.ts app/shared/components/master-checkbox.component.ts app/shared/components/sort/sort.component.ts app/shared/components/tabs.component.ts app/shared/components/blocker/blocker.service.ts app/shared/components/blocker/blocker.component.ts app/shared/components/modal/modal-abstract.ts app/shared/components/shared.interface.ts app/shared/components/loader/loader.component.ts app/shared/components/dsl/dsl.component.ts app/shared/model/about/security-info.model.ts app/shared/model/about/feature-info.model.ts app/shared/model/about/about-info.model.ts app/shared/model/about/runtime-environment-details.model.ts app/shared/model/about/grafana.model.ts app/shared/model/about/dependency.model.ts app/shared/model/about/runtime-environment.model.ts app/shared/model/about/version-info.model.ts app/shared/model/audit-record.model.ts app/shared/model/detailed-app-registration.model.ts app/shared/model/page.ts app/shared/model/app-registration.model.ts app/shared/model/error-handler.ts app/shared/model/platform.ts app/shared/model/error.model.ts app/shared/model/app-version.ts app/shared/model/application-type.ts app/shared/model/index.ts app/shared/model/pagination/page-request.model.ts app/shared/flo/support/app-metadata.ts app/shared/flo/support/properties-group-model.ts app/shared/flo/support/shared-shapes.ts app/shared/flo/support/graph-node-properties-source.ts app/shared/flo/support/utils.ts app/shared/flo/support/shape-component.ts app/shared/flo/properties-groups/properties-groups-dialog.component.ts app/shared/flo/properties/properties-dialog.component.ts app/shared/flo/handle/handle.component.ts app/shared/flo/graph-view/graph-view.component.ts app/shared/flo/decoration/decoration.component.ts app/shared/directives/auto-resize.directive.ts app/shared/directives/layout-type.directive.ts app/shared/directives/focus.directive.ts app/shared/pipes/orderby.pipe.ts app/shared/pipes/search-filter.pipe.ts app/shared/pipes/dataflow-date-time.pipe.ts app/shared/pipes/truncate.pipe.ts app/shared/pipes/dataflow-duration.pipe.ts app/shared/pipes/capitalize.pipe.ts app/shared/shared.module.ts app/shared/grafana/grafana.service.ts app/shared/grafana/grafana.module.ts app/shared/support/encoder.utils.ts app/shared/support/object.utils.ts app/shared/support/http.utils.ts app/shared/support/date-time.utils.ts app/tasks/components/flo/editor.service.ts app/tasks/components/flo/render.service.ts app/tasks/components/flo/metamodel.service.ts app/tasks/components/flo/support/layout.ts app/tasks/components/flo/support/shapes.ts app/tasks/components/flo/tools.service.ts app/tasks/components/flo/properties/task-properties-dialog-component.ts app/tasks/components/flo/properties/task-properties-source.ts app/tasks/components/flo/node/node.component.ts app/tasks/components/flo/model/models.ts app/tasks/components/flo/task-graph-view/task-graph-view.component.ts app/tasks/components/flo/content-assist.service.ts app/tasks/components/tasks-tabulation/tasks-tabulation.component.ts app/tasks/components/task-status/task-status.component.ts app/tasks/task-definition/schedules/task-definition-schedules.component.ts app/tasks/task-definition/task-definition.component.ts app/tasks/task-definition/executions/task-definition-executions.component.ts app/tasks/task-definition/summary/task-summary.component.ts app/tasks/task-definitions/task-definitions.component.ts app/tasks/task-definition-create/task-definition-create.component.ts app/tasks/task-definition-create/create-dialog/create-dialog.component.ts app/tasks/task-schedules/task-schedules.component.ts app/tasks/task-schedules/task-schedules.filter.ts app/tasks/tasks.service.ts app/tasks/task-schedule-create/task-schedule-create.component.ts app/tasks/task-schedule-create/task-schedule-create.validator.ts app/tasks/task-launch/task-launch.component.ts app/tasks/task-launch/task-launch.validator.ts app/tasks/task-executions/task-executions.component.ts app/tasks/model/task-execution.ts app/tasks/model/task-schedule.ts app/tasks/model/task-definition.ts app/tasks/task-schedule/task-schedule.component.ts app/tasks/task-schedule/summary/task-schedule-summary.component.ts app/tasks/task-definitions-destroy/task-definitions-destroy.component.ts app/tasks/task-schedules-destroy/task-schedules-destroy.component.ts app/tasks/task-execution/task-execution.component.ts app/tasks/tasks/tasks.components.ts app/apps/apps-add/register/apps-register.component.ts app/apps/apps-add/register/apps-register.validator.ts app/apps/apps-add/properties/apps-bulk-import-properties.component.ts app/apps/apps-add/uri/apps-bulk-import-uri.component.ts app/apps/apps-add/apps-add.validator.ts app/apps/apps-add/apps-add.component.ts app/apps/apps/apps.component.ts app/apps/components/app-list-bar/app-list-bar.component.ts app/apps/components/app-versions-label/app-versions-label.component.ts app/apps/components/app-type/app-type.component.ts app/apps/apps.workaround.service.ts app/apps/app-details/app-details.component.ts app/apps/app-versions/app-versions.component.ts app/apps/apps.service.ts app/apps/apps-unregister/apps-unregister.component.ts app/tests/mocks/about.ts app/tests/mocks/apps.ts app/tests/mocks/jobs.ts app/tests/mocks/tasks.ts app/tests/mocks/streams.ts app/tests/mocks/notification.ts app/tests/mocks/shared-app.ts app/tests/mocks/audit.ts app/tests/mocks/group-route.ts app/tests/mocks/shared-about.ts app/tests/mocks/mock-data.ts app/tests/mocks/auth.ts app/tests/mocks/activated-route.ts app/tests/mocks/mock-tools.ts app/tests/mocks/runtime.ts app/tests/mocks/confirm.ts app/tests/mocks/mock-component.ts app/tests/mocks/modal.ts app/tests/mocks/routing-state.ts app/jobs/model/job-execution.model.ts app/jobs/model/step-execution.model.ts app/jobs/model/step-execution-progress.model.ts app/jobs/model/step-execution-resource.model.ts app/jobs/model/execution-context.model.ts app/jobs/jobs/jobs.component.ts app/jobs/step-execution-details/step-execution-details.component.ts app/jobs/components/job-execution-status.component.ts app/jobs/components/definition-status.component.ts app/jobs/jobs.service.ts app/jobs/step-execution-progress/step-execution-progress.component.ts app/jobs/job-execution-details/job-execution-details.component.ts app/audit/components/audit-record-list-bar/audit-record-list-bar.component.ts app/audit/components/audit-record-action/audit-record-action.component.ts app/audit/components/audit-record-operation/audit-record-operation.component.ts app/audit/audit-record/audit-record.component.ts app/audit/audit-record.service.ts app/audit/audit-record-details/audit-record-details.component.ts app/layout/navigation/search/search.component.ts app/layout/navigation/navigation.component.ts app/layout/sidebar/sidebar.component.ts app/layout/body/body.component.ts app/layout/logo/logo.component.ts app/runtime/runtime-apps/runtime-apps.component.ts app/runtime/runtime-app/runtime-app.component.ts app/runtime/model/runtime-app.ts app/runtime/model/runtime-app-instance.ts app/runtime/components/runtime-app-state/runtime-app-state.component.ts app/runtime/runtime-apps.service.ts app/auth/auth.service.ts app/auth/logout.component.ts app/auth/directives/roles.directive.ts app/auth/feature-disabled.component.ts app/auth/authentication-required.component.ts app/about/components/about-more/about-details.component.ts app/about/about.service.ts app/about/about/about.component.ts app/app.component.ts polyfills.ts test.ts environments/environment.ts

No flags found

Use flags to group coverage reports by test type, project and/or folders.
Then setup custom commit statuses and notifications for each flag.

e.g., #unittest #integration

#production #enterprise

#frontend #backend

Learn more about Codecov Flags here.


@@ -55,11 +55,29 @@
Loading
55 55
  }
56 56
57 57
  dagre.layout(g);
58 +
59 +
  let rankOffset: any = null;
60 +
61 +
  if (!(empty && start && end)) {
62 +
    const dagreOverlappingLinks = verticalLinksOverlapping(g, 2);
63 +
    if (dagreOverlappingLinks > 0) {
64 +
      rankOffset = centerAlignRanks(g);
65 +
      // Check the number of overlapping vertical links for rank centered version
66 +
      const rankCenteredOverlaps = verticalLinksOverlapping(g, 2, rankOffset);
67 +
      if (rankCenteredOverlaps >= dagreOverlappingLinks) {
68 +
        // If after ranks centering number of overlaps remains the same void rank offsets
69 +
        rankOffset = null;
70 +
      }
71 +
    }
72 +
  }
73 +
58 74
  g.nodes().forEach(v => {
59 75
    const node = <dia.Element> graph.getCell(v);
60 76
    if (node) {
77 +
      const graphNode = g.node(v);
61 78
      const bbox = node.getBBox();
62 -
      node.translate((g.node(v).x - g.node(v).width / 2) - bbox.x, (g.node(v).y - g.node(v).height / 2) - bbox.y);
79 +
      const offset = rankOffset && rankOffset[graphNode.y] ? rankOffset[graphNode.y] : 0;
80 +
      node.translate((graphNode.x + offset - graphNode.width / 2) - bbox.x, (graphNode.y - graphNode.height / 2) - bbox.y);
63 81
    }
64 82
  });
65 83
@@ -72,3 +90,81 @@
Loading
72 90
  });
73 91
}
74 92
93 +
export function verticalLinksOverlapping(g: dagre.graphlib.Graph, tolerance: number, ranksOffset?: any): number {
94 +
  let numberOfOverlaps = 0;
95 +
96 +
  // Find all nearly vertical links within the tolerance value
97 +
  const verticalLinks = g.edges().filter(e => {
98 +
    const source = g.node(e.v);
99 +
    const target = g.node(e.w);
100 +
    const offsetSource = ranksOffset && ranksOffset[source.y] ? ranksOffset[source.y] : 0;
101 +
    const offsetTarget = ranksOffset && ranksOffset[target.y] ? ranksOffset[target.y] : 0;
102 +
    if (Math.abs((source.x + offsetSource) - (target.x + offsetTarget)) < 2 * tolerance) {
103 +
      return true;
104 +
    } else {
105 +
      return false;
106 +
    }
107 +
  });
108 +
109 +
  // Check if any parts of these links overlap
110 +
  for (let i = 0; i < verticalLinks.length - 1; i++) {
111 +
    const link = verticalLinks[i];
112 +
    const source = g.node(link.v);
113 +
    const target = g.node(link.w);
114 +
    const offsetSourceB = ranksOffset && ranksOffset[source.y] ? ranksOffset[source.y] : 0;
115 +
    const offsetTargetB = ranksOffset && ranksOffset[target.y] ? ranksOffset[target.y] : 0;
116 +
    const minX = Math.min(source.x + offsetSourceB, target.x + offsetTargetB) - tolerance;
117 +
    const maxX = Math.max(source.x + offsetSourceB, target.x + offsetTargetB) + tolerance;
118 +
    const minY = Math.min(source.y, target.y);
119 +
    const maxY = Math.max(source.y, target.y);
120 +
    for (let j = i + 1; j < verticalLinks.length; j++) {
121 +
      const otherLink = verticalLinks[j];
122 +
      const otherSource = g.node(otherLink.v);
123 +
      const otherTarget = g.node(otherLink.w);
124 +
      const offsetSourceC = ranksOffset && ranksOffset[otherSource.y] ? ranksOffset[otherSource.y] : 0;
125 +
      const offsetTargetC = ranksOffset && ranksOffset[otherTarget.y] ? ranksOffset[otherTarget.y] : 0;
126 +
      if ((minX < otherSource.x + offsetSourceC && otherSource.x + offsetSourceC < maxX && minY < otherSource.y && otherSource.y < maxY)
127 +
        || (minX < otherTarget.x + offsetTargetC && otherTarget.x + offsetTargetC < maxX && minY < otherTarget.y && otherTarget.y < maxY)) {
128 +
        numberOfOverlaps++;
129 +
      }
130 +
    }
131 +
  }
132 +
  return numberOfOverlaps;
133 +
}
134 +
135 +
export function centerAlignRanks(g: dagre.graphlib.Graph): any {
136 +
  let minX = Number.POSITIVE_INFINITY, maxX = Number.NEGATIVE_INFINITY, minY = Number.POSITIVE_INFINITY,
137 +
    maxY = Number.NEGATIVE_INFINITY;
138 +
  const ranks: any = {};
139 +
  g.nodes().forEach(v => {
140 +
    const graphNode = g.node(v);
141 +
    let rank = ranks[graphNode.y];
142 +
    if (!rank) {
143 +
      rank = [];
144 +
      ranks[graphNode.y] = rank;
145 +
    }
146 +
    rank.push(graphNode);
147 +
    minX = Math.min(minX, graphNode.x - graphNode.width / 2);
148 +
    minY = Math.min(minY, graphNode.y - graphNode.height / 2);
149 +
    maxX = Math.max(maxX, graphNode.x + graphNode.width / 2);
150 +
    maxY = Math.max(maxY, graphNode.y + graphNode.height / 2);
151 +
  });
152 +
153 +
  const graphWidth = maxX - minX;
154 +
155 +
  const rankOffset = {};
156 +
  Object.keys(ranks).forEach(key => {
157 +
    const rank = ranks[key];
158 +
    if (Array.isArray(rank) && rank.length) {
159 +
      let rankMinX = Number.POSITIVE_INFINITY, rankMaxX = Number.NEGATIVE_INFINITY;
160 +
      rank.forEach(n => {
161 +
        rankMinX = Math.min(rankMinX, n.x - n.width / 2);
162 +
        rankMaxX = Math.max(rankMaxX, n.x + n.width / 2);
163 +
      });
164 +
      rankOffset[key] = minX + (graphWidth - (rankMaxX - rankMinX)) / 2 - rankMinX;
165 +
    }
166 +
  });
167 +
168 +
  return rankOffset;
169 +
}
170 +

Learn more Showing 1 files with coverage changes found.

Changes in ui/src/app/tasks/components/flo/render.service.ts
-1
Loading file...
Files Coverage
Project Totals (244 files) 72.78%
Loading