codecharta-visualization 1.115.0 → 1.115.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (31) hide show
  1. package/app/codeCharta/ui/attributeSideBar/attributeSideBar.component.html +0 -2
  2. package/app/codeCharta/ui/attributeSideBar/attributeSideBar.component.scss +48 -27
  3. package/app/codeCharta/ui/attributeSideBar/attributeSideBar.component.spec.ts +6 -11
  4. package/app/codeCharta/ui/attributeSideBar/attributeSideBarPrimaryMetrics/attributeSideBarPrimaryMetric/attributeSideBarPrimaryMetric.component.html +13 -13
  5. package/app/codeCharta/ui/attributeSideBar/attributeSideBarPrimaryMetrics/attributeSideBarPrimaryMetrics.component.html +17 -16
  6. package/app/codeCharta/ui/attributeSideBar/attributeSideBarSecondaryMetrics/attributeSideBarSecondaryMetrics.component.html +9 -11
  7. package/app/codeCharta/ui/attributeSideBar/attributeTypeSelector/attributeTypeSelector.component.scss +18 -8
  8. package/app/codeCharta/ui/attributeSideBar/metricDeltaSelected/metricDeltaSelected.component.html +1 -1
  9. package/app/codeCharta/ui/dialogs/changelogDialog/changelogDialog.component.ts +10 -4
  10. package/app/codeCharta/ui/dialogs/changelogDialog/changelogDialog.e2e.ts +26 -0
  11. package/app/codeCharta/ui/filePanel/filePanelFileSelector/filePanelFileSelector.component.html +4 -4
  12. package/app/codeCharta/ui/filePanel/filePanelFileSelector/filePanelFileSelector.component.scss +37 -0
  13. package/app/codeCharta/ui/filePanel/filePanelFileSelector/removeFileButton/removeFileButton.component.html +1 -1
  14. package/app/codeCharta/ui/filePanel/filePanelFileSelector/removeFileButton/removeFileButton.component.ts +0 -1
  15. package/app/codeCharta/ui/legendPanel/legendPanel.component.html +0 -2
  16. package/app/codeCharta/ui/legendPanel/legendPanel.component.scss +7 -0
  17. package/app/codeCharta/ui/ribbonBar/artificialIntelligence/selectors/artificialIntelligence.selector.spec.ts +6 -0
  18. package/app/codeCharta/ui/ribbonBar/artificialIntelligence/selectors/artificialIntelligence.selector.ts +4 -0
  19. package/app/codeCharta/ui/ribbonBar/ribbonBar.component.scss +0 -1
  20. package/app/codeCharta/ui/ribbonBar/ribbonBar.e2e.ts +20 -1
  21. package/app/codeCharta/util/customConfigHelper.ts +1 -29
  22. package/app/codeCharta/util/testUtils/markdown-transformer.js +11 -0
  23. package/conf/jestE2E.config.json +7 -6
  24. package/conf/webpack.config.js +1 -14
  25. package/dist/webpack/3rdpartylicenses.txt +48 -30
  26. package/dist/webpack/index.html +1 -1
  27. package/dist/webpack/main.f697cbc91786388c.js +1 -0
  28. package/package.json +5 -6
  29. package/app/codeCharta/ui/attributeSideBar/metricDeltaSelected/metricDeltaSelected.component.scss +0 -5
  30. package/app/codeCharta/ui/filePanel/filePanelFileSelector/removeFileButton/removeFileButton.component.scss +0 -9
  31. package/dist/webpack/main.bc36f7880e897bab.js +0 -1
@@ -3,8 +3,6 @@
3
3
  [node]="selectedNode$ | async"
4
4
  [fileName]="fileName$ | async"
5
5
  ></cc-attribute-side-bar-header-section>
6
-
7
6
  <cc-attribute-side-bar-primary-metrics></cc-attribute-side-bar-primary-metrics>
8
-
9
7
  <cc-attribute-side-bar-secondary-metrics></cc-attribute-side-bar-secondary-metrics>
10
8
  </div>
@@ -46,6 +46,10 @@ cc-attribute-side-bar {
46
46
  }
47
47
 
48
48
  table {
49
+ th {
50
+ text-align: left;
51
+ }
52
+
49
53
  &.primary-metrics {
50
54
  table-layout: fixed;
51
55
  width: 100%;
@@ -63,54 +67,71 @@ cc-attribute-side-bar {
63
67
  }
64
68
  }
65
69
 
70
+ .primary-metric-box {
71
+ display: flex;
72
+ flex-direction: column;
73
+ height: 100%;
74
+ width: 100%;
75
+ }
76
+
77
+ .metric-name {
78
+ margin-top: 5px;
79
+ }
80
+
81
+ .primary-metric-value {
82
+ margin-right: -5px;
83
+ }
84
+
66
85
  i.fa {
67
86
  font-size: 12pt;
68
87
  min-width: 17px;
69
88
  text-align: center;
70
89
  }
71
-
72
- .metric-name {
73
- margin: 5px 0 0 0;
74
- }
75
90
  }
76
91
 
77
- th {
78
- text-align: left;
79
- }
92
+ &.secondary-metrics {
93
+ td {
94
+ padding-left: 5px;
80
95
 
81
- td {
82
- text-align: left;
83
- vertical-align: initial;
84
- margin: 0;
85
- }
96
+ &:first-child {
97
+ padding-left: 4px;
98
+ }
99
+ }
100
+
101
+ .secondary-metric-box {
102
+ border-radius: 3px;
103
+ padding: 4px 4px;
104
+ vertical-align: middle;
105
+ background: #d5d5d5;
106
+ }
86
107
 
87
- .metric-summary,
88
- .metric-delta {
89
- border-radius: 3px;
90
- padding: 4px 4px;
108
+ .secondary-metric-row {
109
+ flex-wrap: nowrap;
110
+ }
91
111
  }
92
112
 
93
- .metric-summary {
94
- align-content: flex-end;
95
- background: #d5d5d5;
113
+ .primary-metric-row,
114
+ .secondary-metric-row {
96
115
  display: flex;
97
- flex-direction: row;
98
- gap: 4px;
99
- justify-content: space-between;
100
- text-align: right;
101
- vertical-align: center;
116
+ align-items: center;
117
+ flex-wrap: wrap;
118
+ gap: 5px;
102
119
  }
103
120
 
104
121
  .metric-name {
105
122
  color: grey;
106
123
  word-break: break-word;
124
+ vertical-align: middle;
107
125
  }
108
126
 
109
- .metric-value {
110
- display: inline-block;
111
- margin-left: 4px;
127
+ .delta-value-box {
128
+ vertical-align: middle;
112
129
  }
113
130
  }
131
+
132
+ cc-metric-delta-selected:has(span) {
133
+ margin-top: 5px;
134
+ }
114
135
  }
115
136
  }
116
137
  }
@@ -71,7 +71,7 @@ describe("AttributeSideBarComponent", () => {
71
71
  expect(pathName).toMatch("/root/big leaf")
72
72
 
73
73
  const firstPrimaryMetricEntry = container.querySelector("cc-attribute-side-bar-primary-metric").textContent
74
- const expectedPrimaryMetricTextContent = "20 a"
74
+ const expectedPrimaryMetricTextContent = "20a"
75
75
  expect(firstPrimaryMetricEntry).toMatch(expectedPrimaryMetricTextContent)
76
76
 
77
77
  const expectedSecondaryMetricTextContent = "15b"
@@ -79,7 +79,7 @@ describe("AttributeSideBarComponent", () => {
79
79
  .querySelector("cc-attribute-side-bar-primary-metric")
80
80
  .textContent.includes(expectedSecondaryMetricTextContent)
81
81
  expect(isSecondaryMetricInPrimaryMetricSection).toBe(false)
82
- const firstSecondaryMetricEntry = container.querySelector("cc-attribute-side-bar-secondary-metrics .metric-row").textContent
82
+ const firstSecondaryMetricEntry = container.querySelector("cc-attribute-side-bar-secondary-metrics").textContent
83
83
  expect(firstSecondaryMetricEntry).toMatch(expectedSecondaryMetricTextContent)
84
84
 
85
85
  expect(isAttributeTypeSelectorShown(container)).toBe(false)
@@ -88,13 +88,12 @@ describe("AttributeSideBarComponent", () => {
88
88
  it("should display deltas if node has delta values", async () => {
89
89
  mockedSelectedNodeSelector.mockImplementation(() => klona(TEST_NODE_LEAF))
90
90
  const { container } = await render(AttributeSideBarComponent, { excludeComponentDeclaration: true })
91
-
92
91
  const firstPrimaryMetricEntry = container.querySelector("cc-attribute-side-bar-primary-metric").textContent
93
92
  const expectedPrimaryMetricTextContent = /20\s+Δ1.0\s+a/
94
93
  expect(firstPrimaryMetricEntry).toMatch(expectedPrimaryMetricTextContent)
95
94
 
96
95
  const expectedSecondaryMetricTextContent = /15\s+Δ2.0\s+b/
97
- const firstSecondaryMetricEntry = container.querySelector("cc-attribute-side-bar-secondary-metrics .metric-row").textContent
96
+ const firstSecondaryMetricEntry = container.querySelector("cc-attribute-side-bar-secondary-metrics").textContent
98
97
  expect(firstSecondaryMetricEntry).toMatch(expectedSecondaryMetricTextContent)
99
98
  })
100
99
 
@@ -148,19 +147,15 @@ describe("AttributeSideBarComponent", () => {
148
147
  })
149
148
 
150
149
  const { container } = await render(AttributeSideBarComponent, { excludeComponentDeclaration: true })
151
-
152
150
  const attributeTypeSelectorWithinPrimaryMetrics = container.querySelectorAll("cc-attribute-side-bar-primary-metrics td")
153
- const attributeTypeSelectorWithinSecondaryMetrics = container.querySelectorAll(
154
- "cc-attribute-side-bar-secondary-metrics .metric-row"
155
- )
156
-
151
+ const attributeTypeSelectorWithinSecondaryMetrics = container.querySelectorAll("cc-attribute-side-bar-secondary-metrics tr")
157
152
  expect(attributeTypeSelectorWithinPrimaryMetrics[0].getAttribute("title")).toBe("a_testTitle (a):\na_testDescription")
158
153
  expect(attributeTypeSelectorWithinPrimaryMetrics[1].getAttribute("title")).toBe("b_testTitle (b)")
159
154
  expect(attributeTypeSelectorWithinPrimaryMetrics[2].getAttribute("title")).toBe("someColor")
160
155
  expect(attributeTypeSelectorWithinPrimaryMetrics[3].getAttribute("title")).toBe("someEdge")
161
156
 
162
- expect(attributeTypeSelectorWithinSecondaryMetrics[0].getAttribute("title")).toBe("c:\nc_testDescription")
163
- expect(attributeTypeSelectorWithinSecondaryMetrics.length).toBe(1)
157
+ expect(attributeTypeSelectorWithinSecondaryMetrics[1].getAttribute("title")).toBe("c:\nc_testDescription")
158
+ expect(attributeTypeSelectorWithinSecondaryMetrics.length).toBe(2)
164
159
  })
165
160
  })
166
161
 
@@ -1,14 +1,14 @@
1
- <i [class]="iconName"></i>
2
- <div class="metric-value">
3
- <cc-attribute-type-selector
4
- *ngIf="showAttributeTypeSelector$ | async"
5
- class="attribute-type-select"
6
- [metricName]="metric.name"
7
- [metricType]="'nodes'"
8
- ></cc-attribute-type-selector>
9
- <span>
10
- {{ metric.value | number: "1.0-0" }}
11
- </span>
1
+ <div class="primary-metric-box">
2
+ <div class="primary-metric-row">
3
+ <i [class]="iconName"></i>
4
+ <cc-attribute-type-selector
5
+ *ngIf="showAttributeTypeSelector$ | async"
6
+ class="attribute-type-select"
7
+ [metricName]="metric.name"
8
+ [metricType]="'nodes'"
9
+ ></cc-attribute-type-selector>
10
+ <span class="primary-metric-value">{{ metric.value | number: "1.0-0" }}</span>
11
+ </div>
12
+ <cc-metric-delta-selected [metricName]="metric.name"></cc-metric-delta-selected>
13
+ <span class="metric-name">{{ metric.name }}</span>
12
14
  </div>
13
- <cc-metric-delta-selected [metricName]="metric.name"></cc-metric-delta-selected>
14
- <p class="metric-name">{{ metric.name }}</p>
@@ -16,7 +16,6 @@
16
16
  ></cc-attribute-side-bar-primary-metric>
17
17
  </td>
18
18
  </tr>
19
-
20
19
  <tr>
21
20
  <td [title]="primaryMetrics.color.descriptors | metricDescriptorTitle">
22
21
  <cc-attribute-side-bar-primary-metric
@@ -26,26 +25,28 @@
26
25
  </td>
27
26
  <ng-container *ngIf="primaryMetrics.edge as edge; else sidebarPrimaryMetricsEdgeElse">
28
27
  <td [title]="edge.descriptors | metricDescriptorTitle">
29
- <i class="fa fa-exchange"></i>
30
- <div class="metric-value">
31
- <cc-attribute-type-selector
32
- *ngIf="showAttributeTypeSelector$ | async"
33
- class="attribute-type-select"
34
- [metricName]="edge.name"
35
- [metricType]="'edges'"
36
- ></cc-attribute-type-selector>
37
- <span class="metric-value">
38
- {{ edge.incoming | number: "1.0-0" }}
39
- <span>/</span>
40
- {{ edge.outgoing | number: "1.0-0" }}
41
- </span>
28
+ <div class="primary-metric-box">
29
+ <div class="primary-metric-row">
30
+ <i class="fa fa-exchange"></i>
31
+ <cc-attribute-type-selector
32
+ *ngIf="showAttributeTypeSelector$ | async"
33
+ class="attribute-type-select"
34
+ [metricName]="edge.name"
35
+ [metricType]="'edges'"
36
+ ></cc-attribute-type-selector>
37
+ <span>
38
+ {{ edge.incoming | number: "1.0-0" }}
39
+ <span>/</span>
40
+ {{ edge.outgoing | number: "1.0-0" }}
41
+ </span>
42
+ </div>
43
+ <span class="metric-name">{{ edge.name }} (in/out)</span>
42
44
  </div>
43
- <p class="metric-name">{{ edge.name }} (in/out)</p>
44
45
  </td>
45
46
  </ng-container>
46
47
  <ng-template #sidebarPrimaryMetricsEdgeElse>
47
48
  <td>
48
- <p class="metric-name">No edge metric available</p>
49
+ <span class="metric-name">No edge metric available</span>
49
50
  </td>
50
51
  </ng-template>
51
52
  </tr>
@@ -5,13 +5,9 @@
5
5
  <tr>
6
6
  <th scope="col" colspan="2">Secondary Metrics</th>
7
7
  </tr>
8
- <tr
9
- *ngFor="let secondaryMetric of secondaryMetrics$ | async"
10
- class="metric-row"
11
- [title]="secondaryMetric.descriptors | metricDescriptorTitle"
12
- >
13
- <td class="metric-summary">
14
- <span class="metric-type">
8
+ <tr *ngFor="let secondaryMetric of secondaryMetrics$ | async" [title]="secondaryMetric.descriptors | metricDescriptorTitle">
9
+ <td class="secondary-metric-box">
10
+ <div class="secondary-metric-row">
15
11
  <cc-attribute-type-selector
16
12
  *ngIf="showAttributeTypeSelector$ | async"
17
13
  class="attribute-type-select"
@@ -19,13 +15,15 @@
19
15
  [metricType]="'nodes'"
20
16
  >
21
17
  </cc-attribute-type-selector>
22
- </span>
23
- <span class="metric-value">{{ secondaryMetric.value | number: "1.0-0" }}</span>
18
+ <span class="metric-value">{{ secondaryMetric.value | number: "1.0-0" }}</span>
19
+ </div>
24
20
  </td>
25
- <td [hidden]="!(showDeltaValue$ | async)">
21
+ <td class="delta-value-box" [hidden]="!(showDeltaValue$ | async)">
26
22
  <cc-metric-delta-selected [metricName]="secondaryMetric.name"></cc-metric-delta-selected>
27
23
  </td>
28
- <td class="metric-name">{{ secondaryMetric.name }}</td>
24
+ <td>
25
+ <span class="metric-name">{{ secondaryMetric.name }}</span>
26
+ </td>
29
27
  </tr>
30
28
  </table>
31
29
  </div>
@@ -1,14 +1,24 @@
1
+ @use "../../../../material/theme";
1
2
  cc-attribute-type-selector {
2
- .mat-mdc-button-toggle-group {
3
- height: 18px;
3
+ .mat-button-toggle-appearance-standard .mat-button-toggle-label-content {
4
+ display: flex;
4
5
  align-items: center;
5
- justify-content: space-evenly;
6
+ height: 100%;
6
7
  }
7
- .mat-mdc-button-toggle-appearance-standard .mat-button-toggle-label-content {
8
- padding: 0 7px 0 7px;
8
+
9
+ button {
10
+ align-items: center;
11
+ height: 100%;
12
+
13
+ &:hover {
14
+ background-color: rgba(0, 0, 0, 0.05);
15
+ color: theme.$cc-primary-color;
16
+ }
9
17
  }
10
- .mat-mdc-button-toggle-standalone.mat-button-toggle-appearance-standard,
11
- .mat-mdc-button-toggle-group-appearance-standard {
12
- border: 0.1px solid darkgrey;
18
+
19
+ .mat-button-toggle-standalone.mat-button-toggle-appearance-standard:not([class*="mat-elevation-z"]),
20
+ .mat-button-toggle-group-appearance-standard:not([class*="mat-elevation-z"]) {
21
+ height: 22px;
22
+ border: 0.5px solid darkgrey;
13
23
  }
14
24
  }
@@ -1,5 +1,5 @@
1
1
  <ng-container *ngIf="(selectedNode$ | async )?.deltas?.[metricName] as deltaValue">
2
- <span [style.color]="(mapColors$ | async)[deltaValue > 0 ? 'positiveDelta' : 'negativeDelta']" class="metric-delta">
2
+ <span [style.color]="(mapColors$ | async)[deltaValue > 0 ? 'positiveDelta' : 'negativeDelta']">
3
3
  &Delta;{{ deltaValue | number: "1.1-2" }}
4
4
  </span>
5
5
  </ng-container>
@@ -1,6 +1,7 @@
1
1
  import markdownFile from "../../../../../../CHANGELOG.md"
2
2
  import { Component, Inject, ViewEncapsulation } from "@angular/core"
3
3
  import { MAT_DIALOG_DATA } from "@angular/material/dialog"
4
+ import { marked } from "marked"
4
5
 
5
6
  @Component({
6
7
  templateUrl: "./changelogDialog.component.html",
@@ -11,7 +12,12 @@ export class ChangelogDialogComponent {
11
12
  changes: Record<string, string>
12
13
 
13
14
  constructor(@Inject(MAT_DIALOG_DATA) public data: { previousVersion: string; currentVersion: string }) {
14
- let changelogLines = markdownFile.split("\n")
15
+ this.changes = this.getChangelogChanges()
16
+ }
17
+
18
+ private getChangelogChanges() {
19
+ const parsedMarkdownFile = marked.parse(markdownFile, { headerIds: false })
20
+ let changelogLines = parsedMarkdownFile.split("\n")
15
21
  const currentVersionFirstLine = this.findVersionLine(changelogLines, this.data.currentVersion)
16
22
  const lastOpenedVersionFirstLine = this.findVersionLine(changelogLines, this.data.previousVersion)
17
23
  //Add 1 to keep the version line so that it detects the end of the last set of changes
@@ -21,7 +27,7 @@ export class ChangelogDialogComponent {
21
27
  for (const title of titles) {
22
28
  const titlePattern = new RegExp(`<h3>${title}</h3>`)
23
29
  const titleLinesIndexes = this.getAllIndexes(changelogLines, titlePattern)
24
- const changelogTypes = []
30
+ const changelogTypes: string[] = []
25
31
  for (const lineIndex of titleLinesIndexes) {
26
32
  // Add 2 to remove the headline and the <ul> tag
27
33
  const start = lineIndex + 2
@@ -34,11 +40,11 @@ export class ChangelogDialogComponent {
34
40
  changes[title] = changelogTypes.join("\n")
35
41
  }
36
42
  }
37
- this.changes = changes
43
+ return changes
38
44
  }
39
45
 
40
46
  private getAllIndexes(titles: string[], pattern: RegExp) {
41
- return titles.reduce((matchingTitleIndexes, title, index) => {
47
+ return titles.reduce((matchingTitleIndexes: number[], title, index) => {
42
48
  if (pattern.test(title)) {
43
49
  matchingTitleIndexes.push(index)
44
50
  }
@@ -0,0 +1,26 @@
1
+ import { goto } from "../../../../puppeteer.helper"
2
+ import changelog from "../../../../../../CHANGELOG.md"
3
+
4
+ function getSecondLatestCodeChartaVersion() {
5
+ const versionPattern = /\[(\d+\.\d+\.\d+)]/g
6
+ const versions = changelog.match(versionPattern) || []
7
+ const secondLatestVersion = versions[1]?.slice(1, -1)
8
+ return secondLatestVersion
9
+ }
10
+
11
+ describe("changelogDialog", () => {
12
+ beforeEach(async () => {
13
+ const version = getSecondLatestCodeChartaVersion() ?? ""
14
+ await page.evaluateOnNewDocument(version => {
15
+ localStorage.setItem("codeChartaVersion", version)
16
+ }, version)
17
+ await goto()
18
+ })
19
+ it("should show entries between the last und newest release version", async () => {
20
+ const changelogDialog = await page.waitForSelector(".mat-mdc-dialog-container", { timeout: 6000 })
21
+ const contentElement = await changelogDialog?.waitForSelector(".content")
22
+ const changelogContent = await contentElement?.evaluate(element => element.textContent)
23
+
24
+ expect(changelogContent?.length).not.toBe(0)
25
+ })
26
+ })
@@ -6,10 +6,10 @@
6
6
  class="standard-select"
7
7
  multiple
8
8
  >
9
- <div class="actions">
10
- <button mat-button (click)="handleSelectAllFiles()">All</button>
11
- <button mat-button (click)="handleSelectZeroFiles()">None</button>
12
- <button mat-button (click)="handleInvertSelectedFiles()">Invert</button>
9
+ <div class="file-selection-actions">
10
+ <button class="file-select-action-button" (click)="handleSelectAllFiles()">All</button>
11
+ <button class="file-select-action-button" (click)="handleSelectZeroFiles()">None</button>
12
+ <button class="file-select-action-button" (click)="handleInvertSelectedFiles()">Invert</button>
13
13
  </div>
14
14
  <mat-option class="filenames" *ngFor="let file of fileStates" [value]="file.file">
15
15
  {{ file.file.fileMeta.fileName | removeExtension }}
@@ -1,5 +1,42 @@
1
+ @use "../../../../material/theme";
1
2
  .file-select {
2
3
  &.mat-mdc-select-panel {
3
4
  min-width: max-content;
5
+ padding: 0;
6
+
7
+ .mat-mdc-option .mdc-list-item__primary-text {
8
+ flex: 1;
9
+ display: flex;
10
+ justify-content: space-between;
11
+ align-items: center;
12
+ }
13
+
14
+ .file-selection-actions {
15
+ display: flex;
16
+ }
17
+
18
+ button {
19
+ width: 100%;
20
+ font-size: 16px;
21
+ margin: 0;
22
+ background-color: transparent;
23
+
24
+ &:hover {
25
+ background-color: rgba(0, 0, 0, 0.05);
26
+ color: theme.$cc-primary-color;
27
+ }
28
+
29
+ &.file-select-action-button {
30
+ padding: 15px 10px;
31
+ }
32
+
33
+ &.remove-button {
34
+ padding: 8px 10px;
35
+
36
+ &:hover {
37
+ border-radius: 50%;
38
+ }
39
+ }
40
+ }
4
41
  }
5
42
  }
@@ -1,3 +1,3 @@
1
- <button mat-button (click)="onRemoveFile(filename, $event)" title="Remove map">
1
+ <button class="remove-button" (click)="onRemoveFile(filename, $event)" title="Remove map">
2
2
  <i class="fa fa-trash delete-symbol"></i>
3
3
  </button>
@@ -5,7 +5,6 @@ import { removeFile } from "../../../../state/store/files/files.actions"
5
5
  @Component({
6
6
  selector: "cc-remove-file-button",
7
7
  templateUrl: "./removeFileButton.component.html",
8
- styleUrls: ["./removeFileButton.component.scss"],
9
8
  encapsulation: ViewEncapsulation.None
10
9
  })
11
10
  export class RemoveFileButtonComponent {
@@ -34,8 +34,6 @@
34
34
  </div>
35
35
 
36
36
  <button
37
- mat-button
38
- mat-raised-button
39
37
  color="primary"
40
38
  class="panel-button"
41
39
  (click)="toggleIsLegendVisible()"
@@ -1,3 +1,4 @@
1
+ @use "../../../material/theme";
1
2
  cc-legend-panel {
2
3
  $fixedHeight: 35;
3
4
 
@@ -10,6 +11,12 @@ cc-legend-panel {
10
11
  height: 36px;
11
12
  width: 88px;
12
13
  margin: 6px 8px;
14
+ color: white;
15
+ background-color: theme.$cc-primary-color;
16
+
17
+ &:hover {
18
+ background-color: theme.$cc-emphasized-color;
19
+ }
13
20
 
14
21
  &.isAttributeSideBarVisible {
15
22
  right: 316px;
@@ -3,6 +3,12 @@ import { VALID_NODE_JAVA } from "../../../../util/dataMocks"
3
3
  import { BlacklistItem, NodeType } from "../../../../codeCharta.model"
4
4
 
5
5
  describe("ArtificialIntelligenceSelector", () => {
6
+ it("should return undefined when no unifiedMapNode is available", () => {
7
+ const actual = calculate({ unifiedMapNode: undefined }, [])
8
+
9
+ expect(actual).toBeUndefined()
10
+ })
11
+
6
12
  it("should calculate suspicious metrics and risk profile when experimental features are enabled ", () => {
7
13
  const actual = calculate({ unifiedMapNode: VALID_NODE_JAVA }, [])
8
14
 
@@ -34,6 +34,10 @@ export const calculate = (
34
34
  accumulatedData: Pick<AccumulatedData, "unifiedMapNode">,
35
35
  blacklist: BlacklistItem[]
36
36
  ): ArtificialIntelligenceData | undefined => {
37
+ if (!accumulatedData.unifiedMapNode) {
38
+ return
39
+ }
40
+
37
41
  const artificialIntelligenceViewModel: ArtificialIntelligenceData = {
38
42
  analyzedProgrammingLanguage: undefined,
39
43
  suspiciousMetricSuggestionLinks: [],
@@ -83,7 +83,6 @@ cc-ribbon-bar {
83
83
  display: inline-block;
84
84
  height: 100%;
85
85
  width: 100%;
86
- border-right: $border;
87
86
  vertical-align: top;
88
87
  overflow: hidden;
89
88
 
@@ -1,10 +1,11 @@
1
- import { goto } from "../../../puppeteer.helper"
1
+ import { CC_URL, goto } from "../../../puppeteer.helper"
2
2
  import { RibbonBarPageObject } from "./ribbonBar.po"
3
3
  import { SearchPanelPageObject } from "../searchPanel/searchPanel.po"
4
4
 
5
5
  //Commented out flaky test
6
6
 
7
7
  describe("RibbonBar", () => {
8
+ const sampleMap = `sample3.cc.json`
8
9
  let searchPanel: SearchPanelPageObject
9
10
  //let searchPanelModeSelector: SearchPanelModeSelectorPageObject
10
11
  let ribbonBar: RibbonBarPageObject
@@ -49,4 +50,22 @@ describe("RibbonBar", () => {
49
50
  expect(isEdgeSettingsPanelOpen).toBeTruthy()
50
51
  expect(await ribbonBar.isPanelOpen("cc-area-settings-panel")).toBeFalsy()
51
52
  })
53
+
54
+ it("should open suspicious metrics and high risk profile menu ", async () => {
55
+ await page.goto(`${CC_URL}?file=codeCharta/assets/${sampleMap}`)
56
+ await page.click("cc-suspicious-metrics")
57
+ const suspiciousMetricsMenu = await page.waitForSelector(".mat-mdc-menu-panel.mat-mdc-menu-panel.ai-drop-down")
58
+ expect(suspiciousMetricsMenu).toBeTruthy()
59
+ let titleElement = await suspiciousMetricsMenu.waitForSelector(".title")
60
+ let titleContent = await titleElement.evaluate(element => element.textContent)
61
+ expect(titleContent).toBe("Suspicious Metrics")
62
+
63
+ await page.click("cc-code-charta #codeMap")
64
+ await page.click("cc-high-risk-profile")
65
+ const highRisProfileMenu = await page.waitForSelector(".mat-mdc-menu-panel.mat-mdc-menu-panel.ai-drop-down")
66
+ expect(highRisProfileMenu).toBeTruthy()
67
+ titleElement = await highRisProfileMenu.waitForSelector(".title")
68
+ titleContent = await titleElement.evaluate(element => element.textContent)
69
+ expect(titleContent).toBe("Risk Profile")
70
+ })
52
71
  })
@@ -38,23 +38,7 @@ export class CustomConfigHelper {
38
38
 
39
39
  static loadCustomConfigsFromLocalStorage() {
40
40
  const ccLocalStorage = this.getCcLocalStorage()
41
- const configs = new Map(ccLocalStorage?.customConfigs)
42
- this.mapOldConfigStructureToNew(configs)
43
- return configs
44
- }
45
-
46
- // TODO [2023-04-01] remove support
47
- private static mapOldConfigStructureToNew(configs: Map<string, CustomConfig>) {
48
- for (const config of configs.values()) {
49
- if (config["mapChecksum"]) {
50
- const checksums = config["mapChecksum"].split(";")
51
- config.assignedMaps = new Map(checksums.map((checksum, index) => [checksum, config["assignedMaps"][index]]))
52
- }
53
- // @ts-ignore
54
- if (config.mapSelectionMode === "MULTIPLE") {
55
- config.mapSelectionMode = CustomConfigMapSelectionMode.MULTIPLE
56
- }
57
- }
41
+ return new Map(ccLocalStorage?.customConfigs)
58
42
  }
59
43
 
60
44
  private static getCcLocalStorage() {
@@ -113,8 +97,6 @@ export class CustomConfigHelper {
113
97
  static importCustomConfigs(content: string) {
114
98
  const importedCustomConfigsFile: CustomConfigsDownloadFile = JSON.parse(content, stateObjectReviver)
115
99
 
116
- this.mapOldConfigStructureToNew(importedCustomConfigsFile.customConfigs)
117
-
118
100
  for (const exportedConfig of importedCustomConfigsFile.customConfigs.values()) {
119
101
  const alreadyExistingConfig = CustomConfigHelper.getCustomConfigSettings(exportedConfig.id)
120
102
 
@@ -215,8 +197,6 @@ export class CustomConfigHelper {
215
197
  threeOrbitControlsService: ThreeOrbitControlsService
216
198
  ) {
217
199
  const customConfig = this.getCustomConfigSettings(configId)
218
- CustomConfigHelper.deleteUnusedKeyPropsOfCustomConfig(customConfig)
219
-
220
200
  store.dispatch(setState(customConfig.stateSettings))
221
201
 
222
202
  // TODO: remove this dirty timeout and set camera settings properly
@@ -228,12 +208,4 @@ export class CustomConfigHelper {
228
208
  }, 100)
229
209
  }
230
210
  }
231
-
232
- // TODO [2023-04-01] remove support
233
- private static deleteUnusedKeyPropsOfCustomConfig(customConfig: any) {
234
- if (customConfig.stateSettings.treeMap || customConfig.stateSettings.fileSettings.attributeTypes) {
235
- delete customConfig.stateSettings.treeMap
236
- delete customConfig.stateSettings.fileSettings.attributeTypes
237
- }
238
- }
239
211
  }
@@ -0,0 +1,11 @@
1
+ const marked = require("marked")
2
+
3
+ module.exports = {
4
+ process(source) {
5
+ const html = marked.parse(source)
6
+ return {
7
+ module: "commonjs",
8
+ code: `module.exports = ${JSON.stringify(html)};`
9
+ }
10
+ }
11
+ }