codecharta-visualization 1.86.0 → 1.89.0

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 (217) hide show
  1. package/Dockerfile +1 -1
  2. package/app/app.module.ts +30 -6
  3. package/app/codeCharta/codeCharta.component.html +0 -2
  4. package/app/codeCharta/codeCharta.component.ts +2 -0
  5. package/app/codeCharta/codeCharta.model.ts +8 -5
  6. package/app/codeCharta/codeCharta.service.spec.ts +41 -50
  7. package/app/codeCharta/codeCharta.service.ts +33 -32
  8. package/app/codeCharta/e2e/url.e2e.ts +1 -1
  9. package/app/codeCharta/services/ajs-upgraded-providers.ts +13 -0
  10. package/app/codeCharta/state/angular-redux/effects/createEffect.spec.ts +37 -0
  11. package/app/codeCharta/state/angular-redux/effects/createEffect.ts +25 -0
  12. package/app/codeCharta/state/angular-redux/effects/effects.module.ts +36 -0
  13. package/app/codeCharta/state/angular-redux/ofType.ts +11 -0
  14. package/app/codeCharta/state/angular-redux/state.ts +12 -0
  15. package/app/codeCharta/state/angular-redux/store.ts +1 -1
  16. package/app/codeCharta/state/effects/addBlacklistItemsIfNotResultsInEmptyMap/addBlacklistItemsIfNotResultsInEmptyMap.effect.spec.ts +60 -0
  17. package/app/codeCharta/state/effects/addBlacklistItemsIfNotResultsInEmptyMap/addBlacklistItemsIfNotResultsInEmptyMap.effect.ts +56 -0
  18. package/app/codeCharta/state/effects/addBlacklistItemsIfNotResultsInEmptyMap/resultsInEmptyMap.ts +22 -0
  19. package/app/codeCharta/state/effects/nodeContextMenu/excludeButton/excludeButton.component.html +3 -0
  20. package/app/codeCharta/state/effects/nodeContextMenu/excludeButton/excludeButton.component.ts +26 -0
  21. package/app/codeCharta/state/effects/nodeContextMenu/flattenButtons/flattenButtons.component.html +13 -0
  22. package/app/codeCharta/state/effects/nodeContextMenu/flattenButtons/flattenButtons.component.spec.ts +55 -0
  23. package/app/codeCharta/state/effects/nodeContextMenu/flattenButtons/flattenButtons.component.ts +34 -0
  24. package/app/codeCharta/state/effects/nodeContextMenu/flattenButtons/flattenButtons.module.ts +11 -0
  25. package/app/codeCharta/state/effects/nodeContextMenu/focusButtons/focusButtons.component.html +24 -0
  26. package/app/codeCharta/state/effects/nodeContextMenu/focusButtons/focusButtons.component.spec.ts +55 -0
  27. package/app/codeCharta/state/effects/nodeContextMenu/focusButtons/focusButtons.component.ts +38 -0
  28. package/app/codeCharta/state/effects/nodeContextMenu/focusButtons/focusButtons.module.ts +13 -0
  29. package/app/codeCharta/state/effects/nodeContextMenu/focusButtons/isNodeFocused.pipe.spec.ts +31 -0
  30. package/app/codeCharta/state/effects/nodeContextMenu/focusButtons/isNodeFocused.pipe.ts +25 -0
  31. package/app/codeCharta/state/effects/nodeContextMenu/highlightButtons/highlightButtons.component.html +6 -0
  32. package/app/codeCharta/state/effects/nodeContextMenu/highlightButtons/highlightButtons.component.spec.ts +64 -0
  33. package/app/codeCharta/state/effects/nodeContextMenu/highlightButtons/highlightButtons.component.ts +39 -0
  34. package/app/codeCharta/state/effects/nodeContextMenu/highlightButtons/highlightButtons.module.ts +11 -0
  35. package/app/codeCharta/state/effects/nodeContextMenu/markFolderRow/markFolderRow.component.html +22 -0
  36. package/app/codeCharta/state/effects/nodeContextMenu/markFolderRow/markFolderRow.component.scss +31 -0
  37. package/app/codeCharta/state/effects/nodeContextMenu/markFolderRow/markFolderRow.component.spec.ts +35 -0
  38. package/app/codeCharta/state/effects/nodeContextMenu/markFolderRow/markFolderRow.component.ts +30 -0
  39. package/app/codeCharta/state/effects/nodeContextMenu/markFolderRow/markFolderRow.module.ts +11 -0
  40. package/app/codeCharta/state/effects/nodeContextMenu/markFolderRow/selectors/markFolderItems.selector.spec.ts +17 -0
  41. package/app/codeCharta/state/effects/nodeContextMenu/markFolderRow/selectors/markFolderItems.selector.ts +29 -0
  42. package/app/codeCharta/{ui → state/effects}/nodeContextMenu/nodeContextMenu.e2e.ts +4 -16
  43. package/app/codeCharta/{ui → state/effects}/nodeContextMenu/nodeContextMenu.po.ts +1 -1
  44. package/app/codeCharta/state/effects/nodeContextMenu/nodeContextMenu.service.spec.ts +78 -0
  45. package/app/codeCharta/state/effects/nodeContextMenu/nodeContextMenu.service.ts +72 -0
  46. package/app/codeCharta/state/effects/nodeContextMenu/nodeContextMenuCard/lastPartOfNodePath.pipe.spec.ts +11 -0
  47. package/app/codeCharta/state/effects/nodeContextMenu/nodeContextMenuCard/lastPartOfNodePath.pipe.ts +8 -0
  48. package/app/codeCharta/state/effects/nodeContextMenu/nodeContextMenuCard/nodeContextMenuCard.component.html +17 -0
  49. package/app/codeCharta/state/effects/nodeContextMenu/nodeContextMenuCard/nodeContextMenuCard.component.scss +34 -0
  50. package/app/codeCharta/state/effects/nodeContextMenu/nodeContextMenuCard/nodeContextMenuCard.component.spec.ts +49 -0
  51. package/app/codeCharta/state/effects/nodeContextMenu/nodeContextMenuCard/nodeContextMenuCard.component.ts +19 -0
  52. package/app/codeCharta/state/effects/nodeContextMenu/nodeContextMenuCard/nodeContextMenuCard.module.ts +18 -0
  53. package/app/codeCharta/state/effects/nodeContextMenu/openNodeContextMenu.effect.spec.ts +32 -0
  54. package/app/codeCharta/state/effects/nodeContextMenu/openNodeContextMenu.effect.ts +33 -0
  55. package/app/codeCharta/state/effects/nodeContextMenu/rightClickedCodeMapNode.selector.ts +8 -0
  56. package/app/codeCharta/state/effects/unfocusNodesOnLoadingMap.effect.spec.ts +47 -0
  57. package/app/codeCharta/state/effects/unfocusNodesOnLoadingMap.effect.ts +18 -0
  58. package/app/codeCharta/state/selectors/allNecessaryRenderDataAvailable/areAllNecessaryRenderDataAvailable.selector.ts +30 -0
  59. package/app/codeCharta/state/selectors/allNecessaryRenderDataAvailable/utils/areDynamicSettingsAvailable.spec.ts +36 -0
  60. package/app/codeCharta/state/selectors/allNecessaryRenderDataAvailable/utils/areDynamicSettingsAvailable.ts +10 -0
  61. package/app/codeCharta/state/selectors/allNecessaryRenderDataAvailable/utils/areMetricsAvailable.spec.ts +13 -0
  62. package/app/codeCharta/state/selectors/allNecessaryRenderDataAvailable/utils/areMetricsAvailable.ts +8 -0
  63. package/app/codeCharta/state/store/appSettings/appSettings.actions.ts +2 -0
  64. package/app/codeCharta/state/store/appSettings/appSettings.reducer.ts +2 -0
  65. package/app/codeCharta/state/store/appSettings/invertArea/invertArea.actions.ts +32 -0
  66. package/app/codeCharta/state/store/appSettings/invertArea/invertArea.reducer.spec.ts +26 -0
  67. package/app/codeCharta/state/store/appSettings/invertArea/invertArea.reducer.ts +12 -0
  68. package/app/codeCharta/state/store/appSettings/invertArea/invertArea.selector.ts +3 -0
  69. package/app/codeCharta/state/store/appSettings/isLoadingMap/isLoadingMap.reducer.spec.ts +14 -3
  70. package/app/codeCharta/state/store/appSettings/isLoadingMap/isLoadingMap.reducer.ts +41 -6
  71. package/app/codeCharta/state/store/appStatus/appStatus.reducer.ts +3 -1
  72. package/app/codeCharta/state/store/appStatus/appStatus.selector.ts +3 -0
  73. package/app/codeCharta/state/store/appStatus/rightClickedNodeData/rightClickedNodeData.actions.ts +23 -0
  74. package/app/codeCharta/state/store/appStatus/rightClickedNodeData/rightClickedNodeData.reducer.ts +15 -0
  75. package/app/codeCharta/state/store/appStatus/rightClickedNodeData/rightClickedNodeData.selector.ts +4 -0
  76. package/app/codeCharta/state/store/dynamicSettings/dynamicSettings.splitter.ts +2 -2
  77. package/app/codeCharta/state/store/dynamicSettings/focusedNodePath/currentFocused.selector.ts +8 -0
  78. package/app/codeCharta/state/store/dynamicSettings/focusedNodePath/focusedNodePath.actions.ts +27 -7
  79. package/app/codeCharta/state/store/dynamicSettings/focusedNodePath/focusedNodePath.reducer.spec.ts +27 -11
  80. package/app/codeCharta/state/store/dynamicSettings/focusedNodePath/focusedNodePath.reducer.ts +11 -5
  81. package/app/codeCharta/state/store/dynamicSettings/focusedNodePath/focusedNodePath.selector.ts +4 -0
  82. package/app/codeCharta/state/store/dynamicSettings/focusedNodePath/focusedNodePath.service.spec.ts +2 -2
  83. package/app/codeCharta/state/store/dynamicSettings/focusedNodePath/focusedNodePath.service.ts +1 -1
  84. package/app/codeCharta/state/store/fileSettings/blacklist/blacklist.actions.ts +33 -2
  85. package/app/codeCharta/state/store/fileSettings/blacklist/blacklist.reducer.spec.ts +17 -1
  86. package/app/codeCharta/state/store/fileSettings/blacklist/blacklist.reducer.ts +3 -1
  87. package/app/codeCharta/state/store/fileSettings/blacklist/blacklist.service.spec.ts +1 -19
  88. package/app/codeCharta/state/store/fileSettings/blacklist/blacklist.service.ts +5 -28
  89. package/app/codeCharta/state/store/fileSettings/markedPackages/markedPackages.actions.ts +9 -10
  90. package/app/codeCharta/state/store/fileSettings/markedPackages/markedPackages.reducer.spec.ts +37 -7
  91. package/app/codeCharta/state/store/fileSettings/markedPackages/markedPackages.reducer.ts +7 -3
  92. package/app/codeCharta/state/store/fileSettings/markedPackages/util/findIndexOfMarkedPackageOrParent.spec.ts +39 -0
  93. package/app/codeCharta/state/store/fileSettings/markedPackages/util/findIndexOfMarkedPackageOrParent.ts +19 -0
  94. package/app/codeCharta/state/store/lookUp/idToNode/idToNode.selector.ts +4 -0
  95. package/app/codeCharta/state/store/lookUp/lookUp.selector.ts +3 -0
  96. package/app/codeCharta/state/store/metricData/nodeMetricData/nodeMetricData.service.ts +0 -4
  97. package/app/codeCharta/state/store/state.actions.ts +3 -1
  98. package/app/codeCharta/state/store/state.splitter.spec.ts +4 -4
  99. package/app/codeCharta/state/store/store.ts +5 -1
  100. package/app/codeCharta/state/store.service.spec.ts +21 -8
  101. package/app/codeCharta/state/store.service.ts +3 -31
  102. package/app/codeCharta/ui/areaSettingsPanel/areaSettingsPanel.component.html +3 -1
  103. package/app/codeCharta/ui/areaSettingsPanel/areaSettingsPanel.component.scss +6 -2
  104. package/app/codeCharta/ui/areaSettingsPanel/areaSettingsPanel.component.ts +1 -1
  105. package/app/codeCharta/ui/areaSettingsPanel/areaSettingsPanel.module.ts +3 -0
  106. package/app/codeCharta/ui/areaSettingsPanel/areaSettingsPanel.po.ts +4 -4
  107. package/app/codeCharta/ui/areaSettingsPanel/invertAreaOption/invertAreaOption.component.html +1 -0
  108. package/app/codeCharta/ui/areaSettingsPanel/invertAreaOption/invertAreaOption.component.scss +26 -0
  109. package/app/codeCharta/ui/areaSettingsPanel/invertAreaOption/invertAreaOption.component.spec.ts +29 -0
  110. package/app/codeCharta/ui/areaSettingsPanel/invertAreaOption/invertAreaOption.component.ts +24 -0
  111. package/app/codeCharta/ui/artificialIntelligence/__snapshots__/artificialIntelligence.component.spec.ts.snap +13 -16
  112. package/app/codeCharta/ui/artificialIntelligence/artificialIntelligence.component.html +4 -4
  113. package/app/codeCharta/ui/artificialIntelligence/artificialIntelligence.component.scss +0 -4
  114. package/app/codeCharta/ui/artificialIntelligence/artificialIntelligence.component.spec.ts +82 -52
  115. package/app/codeCharta/ui/artificialIntelligence/artificialIntelligence.component.ts +41 -101
  116. package/app/codeCharta/ui/attributeSideBar/attributeTypeSelector/aggregationType.pipe.spec.ts +19 -0
  117. package/app/codeCharta/ui/attributeSideBar/attributeTypeSelector/{aggregationSymbol.pipe.ts → aggregationType.pipe.ts} +4 -4
  118. package/app/codeCharta/ui/attributeSideBar/attributeTypeSelector/attributeTypeSelector.component.html +4 -12
  119. package/app/codeCharta/ui/attributeSideBar/attributeTypeSelector/attributeTypeSelector.component.scss +11 -20
  120. package/app/codeCharta/ui/attributeSideBar/attributeTypeSelector/attributeTypeSelector.component.spec.ts +8 -15
  121. package/app/codeCharta/ui/attributeSideBar/attributeTypeSelector/attributeTypeSelector.module.ts +2 -2
  122. package/app/codeCharta/ui/codeMap/__snapshots__/codeMap.arrow.service.spec.ts.snap +2 -2
  123. package/app/codeCharta/ui/codeMap/codeMap.actions.service.ts +1 -40
  124. package/app/codeCharta/ui/codeMap/codeMap.mouseEvent.service.ts +8 -16
  125. package/app/codeCharta/ui/codeMap/codeMap.preRender.service.spec.ts +1 -9
  126. package/app/codeCharta/ui/codeMap/codeMap.preRender.service.ts +9 -32
  127. package/app/codeCharta/ui/codeMap/rendering/codeMapMesh.ts +1 -0
  128. package/app/codeCharta/ui/colorPicker/colorPicker.component.html +16 -7
  129. package/app/codeCharta/ui/colorPicker/colorPicker.component.spec.ts +55 -16
  130. package/app/codeCharta/ui/colorPicker/colorPicker.component.ts +32 -1
  131. package/app/codeCharta/ui/colorPicker/colorPicker.module.ts +3 -1
  132. package/app/codeCharta/ui/customConfigs/customConfigs.component.html +29 -11
  133. package/app/codeCharta/ui/customConfigs/customConfigs.component.scss +1 -0
  134. package/app/codeCharta/ui/customConfigs/customConfigs.component.spec.ts +123 -2
  135. package/app/codeCharta/ui/customConfigs/customConfigs.component.ts +56 -2
  136. package/app/codeCharta/ui/dialog/dialog.addCustomConfigSettings.component.html +2 -2
  137. package/app/codeCharta/ui/dialog/dialog.changelog.component.html +1 -1
  138. package/app/codeCharta/ui/dialog/dialog.changelog.component.scss +15 -0
  139. package/app/codeCharta/ui/dialog/dialog.changelog.component.spec.ts +15 -15
  140. package/app/codeCharta/ui/dialog/dialog.changelog.component.ts +2 -1
  141. package/app/codeCharta/ui/dialog/dialog.globalSettings.e2e.ts +1 -1
  142. package/app/codeCharta/ui/dialog/dialog.globalSettings.po.ts +1 -1
  143. package/app/codeCharta/ui/dialog/dialog.service.spec.ts +68 -0
  144. package/app/codeCharta/ui/dialog/dialog.service.ts +38 -17
  145. package/app/codeCharta/ui/dialogs/dialogs.ts +3 -0
  146. package/app/codeCharta/ui/dialogs/errorDialog/errorDialog.component.html +7 -0
  147. package/app/codeCharta/ui/dialogs/errorDialog/errorDialog.component.ts +9 -0
  148. package/app/codeCharta/ui/edgeChooser/edgeChooser.e2e.ts +3 -2
  149. package/app/codeCharta/ui/fileChooser/fileChooser.e2e.ts +5 -6
  150. package/app/codeCharta/ui/filePanel/filePanel.component.html +24 -106
  151. package/app/codeCharta/ui/filePanel/filePanel.component.scss +12 -57
  152. package/app/codeCharta/ui/filePanel/filePanel.component.spec.ts +40 -72
  153. package/app/codeCharta/ui/filePanel/filePanel.component.ts +29 -81
  154. package/app/codeCharta/ui/filePanel/filePanel.module.ts +13 -1
  155. package/app/codeCharta/ui/filePanel/filePanel.po.ts +6 -24
  156. package/app/codeCharta/ui/filePanel/filePanelDeltaSelector/filePanelDeltaSelector.component.html +23 -0
  157. package/app/codeCharta/ui/filePanel/filePanelDeltaSelector/filePanelDeltaSelector.component.ts +18 -0
  158. package/app/codeCharta/ui/filePanel/filePanelFileSelector/filePanelFileSelector.component.html +18 -0
  159. package/app/codeCharta/ui/filePanel/filePanelFileSelector/filePanelFileSelector.component.ts +16 -0
  160. package/app/codeCharta/ui/filePanel/filePanelStateButtons/filePanelStateButtons.component.html +18 -0
  161. package/app/codeCharta/ui/filePanel/filePanelStateButtons/filePanelStateButtons.component.ts +11 -0
  162. package/app/codeCharta/ui/labelledColorPicker/labelledColorPicker.component.html +21 -13
  163. package/app/codeCharta/ui/labelledColorPicker/labelledColorPicker.component.spec.ts +11 -24
  164. package/app/codeCharta/ui/labelledColorPicker/labelledColorPicker.component.ts +1 -40
  165. package/app/codeCharta/ui/labelledColorPicker/labelledColorPicker.module.ts +1 -2
  166. package/app/codeCharta/ui/legendPanel/legendMarkedPackages/legendMarkedPackages.component.ts +2 -2
  167. package/app/codeCharta/ui/mapTreeView/mapTreeView.level.e2e.ts +8 -6
  168. package/app/codeCharta/ui/mapTreeView/mapTreeView.level.po.ts +1 -1
  169. package/app/codeCharta/ui/mapTreeView/mapTreeViewLevel/mapTreeViewLevel.component.html +1 -1
  170. package/app/codeCharta/ui/mapTreeView/mapTreeViewLevel/mapTreeViewLevel.component.spec.ts +6 -16
  171. package/app/codeCharta/ui/mapTreeView/mapTreeViewLevel/mapTreeViewLevel.component.ts +15 -11
  172. package/app/codeCharta/ui/ribbonBar/ribbonBar.component.html +3 -3
  173. package/app/codeCharta/ui/ribbonBar/ribbonBar.e2e.ts +3 -3
  174. package/app/codeCharta/ui/searchBar/searchBar.component.html +5 -0
  175. package/app/codeCharta/ui/searchBar/searchBar.component.scss +11 -0
  176. package/app/codeCharta/ui/searchBar/searchBar.component.spec.ts +10 -0
  177. package/app/codeCharta/ui/searchBar/searchBar.component.ts +1 -1
  178. package/app/codeCharta/ui/sortingOption/sortingOption.component.spec.ts +1 -1
  179. package/app/codeCharta/ui/toolBar/toolBar.component.html +1 -1
  180. package/app/codeCharta/ui/toolBar/toolBar.component.scss +1 -1
  181. package/app/codeCharta/ui/ui.ts +2 -6
  182. package/app/codeCharta/util/algorithm/streetLayout/strip/strip.ts +2 -2
  183. package/app/codeCharta/util/algorithm/streetLayout/treeMap.ts +1 -1
  184. package/app/codeCharta/util/algorithm/treeMapLayout/treeMapGenerator.spec.ts +2 -2
  185. package/app/codeCharta/util/algorithm/treeMapLayout/treeMapGenerator.ts +14 -7
  186. package/app/codeCharta/util/algorithm/treeMapLayout/treeMapHelper.spec.ts +2 -2
  187. package/app/codeCharta/util/algorithm/treeMapLayout/treeMapHelper.ts +1 -1
  188. package/app/codeCharta/util/customConfigBuilder.ts +2 -1
  189. package/app/codeCharta/util/customConfigHelper.spec.ts +155 -60
  190. package/app/codeCharta/util/customConfigHelper.ts +33 -3
  191. package/app/codeCharta/util/dataMocks.ts +8 -4
  192. package/app/codeCharta/util/fileExtensionCalculator.ts +1 -1
  193. package/app/codeCharta/util/fileValidator.spec.ts +69 -182
  194. package/app/codeCharta/util/fileValidator.ts +61 -37
  195. package/app/codeCharta/util/reduxHelper.ts +11 -0
  196. package/app/material/material.module.ts +17 -1
  197. package/conf/webpack.loaders.js +4 -1
  198. package/dist/webpack/bundle.js +5925 -1896
  199. package/dist/webpack/bundle.js.map +1 -1
  200. package/package.json +7 -6
  201. package/app/codeCharta/state/store/dynamicSettings/focusedNodePath/focusedNodePath.splitter.ts +0 -8
  202. package/app/codeCharta/ui/attributeSideBar/attributeTypeSelector/aggregationSymbol.pipe.spec.ts +0 -19
  203. package/app/codeCharta/ui/codeMap/codeMap.actions.service.spec.ts +0 -147
  204. package/app/codeCharta/ui/nodeContextMenu/markFolderColorPicker/markFolderColorPicker.component.html +0 -5
  205. package/app/codeCharta/ui/nodeContextMenu/markFolderColorPicker/markFolderColorPicker.component.scss +0 -13
  206. package/app/codeCharta/ui/nodeContextMenu/markFolderColorPicker/markFolderColorPicker.component.ts +0 -30
  207. package/app/codeCharta/ui/nodeContextMenu/markFolderColorPicker/markFolderColorPicker.module.ts +0 -13
  208. package/app/codeCharta/ui/nodeContextMenu/nodeContextMenu.component.html +0 -68
  209. package/app/codeCharta/ui/nodeContextMenu/nodeContextMenu.component.scss +0 -52
  210. package/app/codeCharta/ui/nodeContextMenu/nodeContextMenu.component.spec.ts +0 -571
  211. package/app/codeCharta/ui/nodeContextMenu/nodeContextMenu.component.ts +0 -318
  212. package/app/codeCharta/ui/nodeContextMenu/nodeContextMenu.module.ts +0 -13
  213. package/app/codeCharta/ui/unfocusButton/unfocusButton.component.html +0 -15
  214. package/app/codeCharta/ui/unfocusButton/unfocusButton.component.scss +0 -5
  215. package/app/codeCharta/ui/unfocusButton/unfocusButton.component.spec.ts +0 -106
  216. package/app/codeCharta/ui/unfocusButton/unfocusButton.component.ts +0 -62
  217. package/app/codeCharta/ui/unfocusButton/unfocusButton.module.ts +0 -7
@@ -1,12 +1,4 @@
1
- <div class="small-action-button transparent">
2
- <button mat-button [matMenuTriggerFor]="menu" title="Select attribute type" class="menu-button">
3
- <span class="symbol">{{ metricName | aggregationSymbolPipe: (getAttributeTypeOfNodesByMetric$ | async) }}</span>
4
- </button>
5
- </div>
6
-
7
- <mat-menu #menu>
8
- <div class="menu-header" mat-menu-item disabled>Set global aggregation for rloc</div>
9
- <mat-divider></mat-divider>
10
- <button mat-menu-item (click)="setToAbsolute()">Σ Sum</button>
11
- <button mat-menu-item (click)="setToRelative()">x͂ Median</button>
12
- </mat-menu>
1
+ <mat-button-toggle-group [value]="metricName | aggregationTypePipe: (getAttributeTypeOfNodesByMetric$ | async)">
2
+ <mat-button-toggle title="Select Sum" (click)="setToAbsolute()" value="sum">Σ</mat-button-toggle>
3
+ <mat-button-toggle title="Select Median" (click)="setToRelative()" value="median">x͂</mat-button-toggle>
4
+ </mat-button-toggle-group>
@@ -1,25 +1,16 @@
1
1
  cc-attribute-type-selector {
2
- display: inline-block;
3
- background-color: white;
4
- border-radius: 12px;
5
-
6
- .menu-button {
7
- height: 24px;
8
- width: 24px;
9
- min-width: 0;
10
- padding: 0;
11
- border-radius: 12px;
12
- vertical-align: top;
13
- transition: background-color 0.4s cubic-bezier(0.25, 0.8, 0.25, 1);
2
+ .mat-button-toggle-group {
3
+ height: 18px;
4
+ align-items: center;
5
+ justify-content: space-evenly;
6
+ }
14
7
 
15
- &:hover {
16
- background-color: #c8c8c8;
17
- }
8
+ .mat-button-toggle-appearance-standard .mat-button-toggle-label-content {
9
+ padding: 0 7px 0 7px;
10
+ }
18
11
 
19
- .symbol {
20
- position: absolute;
21
- top: -5px;
22
- left: 8px;
23
- }
12
+ .mat-button-toggle-standalone.mat-button-toggle-appearance-standard,
13
+ .mat-button-toggle-group-appearance-standard {
14
+ border: 0.1px solid darkgrey;
24
15
  }
25
16
  }
@@ -1,5 +1,5 @@
1
1
  import { TestBed } from "@angular/core/testing"
2
- import { render, screen, fireEvent, waitForElementToBeRemoved } from "@testing-library/angular"
2
+ import { render, screen, fireEvent } from "@testing-library/angular"
3
3
 
4
4
  import { AttributeTypeSelectorModule } from "./attributeTypeSelector.module"
5
5
  import { Store } from "../../../state/store/store"
@@ -27,20 +27,12 @@ describe("attributeTypeSelector", () => {
27
27
  excludeComponentDeclaration: true
28
28
  })
29
29
 
30
- const initialDisplayedElement = await screen.findByText("Σ")
31
- expect(initialDisplayedElement).toBeTruthy()
30
+ const initialDisplayedElement = await screen.getByRole("button", { pressed: true })
31
+ expect(initialDisplayedElement.textContent).toBe("Σ")
32
32
 
33
- fireEvent.click(initialDisplayedElement)
34
- const medianMenuItem = await screen.findByText("x͂ Median")
35
- expect(medianMenuItem).toBeTruthy()
36
-
37
- fireEvent.click(medianMenuItem)
38
- await waitForElementToBeRemoved(() => {
39
- const medianMenuItem = screen.queryByText("x͂ Median")
40
- return medianMenuItem
41
- })
42
- const updatedDisplayedElement = await screen.findByText("x͂")
43
- expect(updatedDisplayedElement).toBeTruthy()
33
+ fireEvent.click(screen.getByText("x͂"))
34
+ const medianMenuItem = await screen.getByRole("button", { pressed: true })
35
+ expect(medianMenuItem.textContent).toBe("x͂")
44
36
  })
45
37
 
46
38
  it("should set aggregation symbol to absolute if attributeType is not available", async () => {
@@ -48,6 +40,7 @@ describe("attributeTypeSelector", () => {
48
40
  componentProperties: { metricName: "non-existing" },
49
41
  excludeComponentDeclaration: true
50
42
  })
51
- expect(await screen.findByText("Σ")).toBeTruthy()
43
+ const initialDisplayedElement = await screen.getByRole("button", { pressed: true })
44
+ expect(initialDisplayedElement.textContent).toBe("Σ")
52
45
  })
53
46
  })
@@ -3,11 +3,11 @@ import { CommonModule } from "@angular/common"
3
3
 
4
4
  import { AttributeTypeSelectorComponent } from "./attributeTypeSelector.component"
5
5
  import { MaterialModule } from "../../../../material/material.module"
6
- import { AggregationSymbolPipe } from "./aggregationSymbol.pipe"
6
+ import { AggregationTypePipePipe } from "./aggregationType.pipe"
7
7
 
8
8
  @NgModule({
9
9
  imports: [CommonModule, MaterialModule],
10
- declarations: [AttributeTypeSelectorComponent, AggregationSymbolPipe],
10
+ declarations: [AttributeTypeSelectorComponent, AggregationTypePipePipe],
11
11
  exports: [AttributeTypeSelectorComponent]
12
12
  })
13
13
  export class AttributeTypeSelectorModule {}
@@ -149,8 +149,8 @@ CodeMapBuilding {
149
149
  },
150
150
  "_color": "#EB8319",
151
151
  "_defaultColor": "#ddcc00",
152
- "_defaultDeltaColor": "#000000",
153
- "_deltaColor": "#000000",
152
+ "_defaultDeltaColor": "#EB8319",
153
+ "_deltaColor": "#EB8319",
154
154
  "_id": 1,
155
155
  "_node": Object {
156
156
  "attributes": Object {
@@ -1,8 +1,6 @@
1
- import { CodeMapNode, EdgeVisibility, MarkedPackage } from "../../codeCharta.model"
1
+ import { EdgeVisibility } from "../../codeCharta.model"
2
2
  import { StoreService } from "../../state/store.service"
3
3
  import { setEdges } from "../../state/store/fileSettings/edges/edges.actions"
4
- import { unmarkPackage, setMarkedPackages } from "../../state/store/fileSettings/markedPackages/markedPackages.actions"
5
- import { addMarkedPackage } from "../../state/store/fileSettings/markedPackages/util/addMarkedPackage"
6
4
  import { EdgeMetricDataService } from "../../state/store/metricData/edgeMetricData/edgeMetricData.service"
7
5
 
8
6
  export class CodeMapActionsService {
@@ -10,26 +8,6 @@ export class CodeMapActionsService {
10
8
  "ngInject"
11
9
  }
12
10
 
13
- markFolder({ path }: { path?: string }, color: string) {
14
- const { markedPackages } = this.storeService.getState().fileSettings
15
- const markedPackagesMap = new Map(markedPackages.map(entry => [entry.path, entry]))
16
- addMarkedPackage(markedPackagesMap, { path, color })
17
-
18
- this.storeService.dispatch(setMarkedPackages([...markedPackagesMap.values()]))
19
- }
20
-
21
- unmarkFolder(node: CodeMapNode) {
22
- let index = this.storeService.getState().fileSettings.markedPackages.findIndex(mp => mp.path === node.path)
23
-
24
- if (index === -1) {
25
- index = this.getParentMarkedPackageIndex(node.path)
26
- }
27
-
28
- if (index !== -1) {
29
- this.storeService.dispatch(unmarkPackage(index))
30
- }
31
- }
32
-
33
11
  updateEdgePreviews() {
34
12
  const state = this.storeService.getState()
35
13
  const { edges } = state.fileSettings
@@ -58,21 +36,4 @@ export class CodeMapActionsService {
58
36
 
59
37
  this.storeService.dispatch(setEdges(edges))
60
38
  }
61
-
62
- getParentMarkedPackageIndex(path: string) {
63
- const markedPackages: MarkedPackage[] = this.storeService.getState().fileSettings.markedPackages
64
- let index = -1
65
- for (let loopIndex = 0; loopIndex < markedPackages.length; loopIndex++) {
66
- const markedPackage = markedPackages[loopIndex]
67
- if (
68
- path.startsWith(markedPackage.path) &&
69
- path !== markedPackage.path &&
70
- (index === -1 || markedPackages[index].path.length < markedPackage.path.length)
71
- ) {
72
- index = loopIndex
73
- }
74
- }
75
-
76
- return index
77
- }
78
39
  }
@@ -18,6 +18,7 @@ import { CodeMapPreRenderService } from "./codeMap.preRender.service"
18
18
  import { ThreeViewerService } from "./threeViewer/threeViewerService"
19
19
  import { setHoveredBuildingPath } from "../../state/store/appStatus/hoveredBuildingPath/hoveredBuildingPath.actions"
20
20
  import { hoveredBuildingPathSelector } from "../../state/store/appStatus/hoveredBuildingPath/hoveredBuildingPath.selector"
21
+ import { setRightClickedNodeData } from "../../state/store/appStatus/rightClickedNodeData/rightClickedNodeData.actions"
21
22
 
22
23
  interface Coordinates {
23
24
  x: number
@@ -32,10 +33,6 @@ export interface BuildingUnhoveredSubscriber {
32
33
  onBuildingUnhovered()
33
34
  }
34
35
 
35
- export interface BuildingRightClickedEventSubscriber {
36
- onBuildingRightClicked(building: CodeMapBuilding, x: number, y: number)
37
- }
38
-
39
36
  export enum ClickType {
40
37
  LeftClick = 0,
41
38
  RightClick = 2
@@ -51,7 +48,6 @@ export enum CursorType {
51
48
  export class CodeMapMouseEventService implements ViewCubeEventPropagationSubscriber, FilesSelectionSubscriber, BlacklistSubscriber {
52
49
  private static readonly BUILDING_HOVERED_EVENT = "building-hovered"
53
50
  private static readonly BUILDING_UNHOVERED_EVENT = "building-unhovered"
54
- private static readonly BUILDING_RIGHT_CLICKED_EVENT = "building-right-clicked"
55
51
  private readonly THRESHOLD_FOR_MOUSE_MOVEMENT_TRACKING = 3
56
52
 
57
53
  private highlightedInTreeView: CodeMapBuilding
@@ -115,12 +111,6 @@ export class CodeMapMouseEventService implements ViewCubeEventPropagationSubscri
115
111
  })
116
112
  }
117
113
 
118
- static subscribeToBuildingRightClickedEvents($rootScope: IRootScopeService, subscriber: BuildingRightClickedEventSubscriber) {
119
- $rootScope.$on(this.BUILDING_RIGHT_CLICKED_EVENT, (_event, data) => {
120
- subscriber.onBuildingRightClicked(data.building, data.x, data.y)
121
- })
122
- }
123
-
124
114
  start() {
125
115
  // TODO: Check if these event listeners should ever be removed again.
126
116
  this.threeRendererService.renderer.domElement.addEventListener("mousemove", event => this.onDocumentMouseMove(event))
@@ -365,11 +355,13 @@ export class CodeMapMouseEventService implements ViewCubeEventPropagationSubscri
365
355
  // Check if mouse moved to prevent the node context menu to show up
366
356
  // after moving the map, when the cursor ends on a building.
367
357
  if (building && !this.hasMouseMovedMoreThanThreePixels(this.mouseOnLastClick)) {
368
- this.$rootScope.$broadcast(CodeMapMouseEventService.BUILDING_RIGHT_CLICKED_EVENT, {
369
- building,
370
- x: this.mouse.x,
371
- y: this.mouse.y
372
- })
358
+ this.storeService.dispatch(
359
+ setRightClickedNodeData({
360
+ nodeId: building.node.id,
361
+ xPositionOfRightClickEvent: this.mouse.x,
362
+ yPositionOfRightClickEvent: this.mouse.y
363
+ })
364
+ )
373
365
  }
374
366
  this.threeUpdateCycleService.update()
375
367
  }
@@ -15,7 +15,6 @@ import { IsLoadingMapActions } from "../../state/store/appSettings/isLoadingMap/
15
15
  import { addFile, resetFiles, setDelta, setMultiple, setSingleByName } from "../../state/store/files/files.actions"
16
16
  import { addBlacklistItem, BlacklistActions, setBlacklist } from "../../state/store/fileSettings/blacklist/blacklist.actions"
17
17
  import { hierarchy } from "d3-hierarchy"
18
- import { NodeMetricDataService } from "../../state/store/metricData/nodeMetricData/nodeMetricData.service"
19
18
  import { MetricDataService } from "../../state/store/metricData/metricData.service"
20
19
  import { getCCFiles } from "../../model/files/files.helper"
21
20
  import { clone } from "../../util/clone"
@@ -29,7 +28,6 @@ describe("codeMapPreRenderService", () => {
29
28
  let codeMapPreRenderService: CodeMapPreRenderService
30
29
  let $rootScope: IRootScopeService
31
30
  let storeService: StoreService
32
- let nodeMetricDataService: NodeMetricDataService
33
31
  let codeMapRenderService: CodeMapRenderService
34
32
 
35
33
  let fileMeta: FileMeta
@@ -40,7 +38,6 @@ describe("codeMapPreRenderService", () => {
40
38
  rebuildService()
41
39
  withMockedEventMethods($rootScope)
42
40
  withMockedCodeMapRenderService()
43
- withMockedMetricService()
44
41
  withUnifiedMapAndFileMeta()
45
42
  storeService.dispatch(setDynamicSettings(STATE.dynamicSettings))
46
43
  })
@@ -50,7 +47,6 @@ describe("codeMapPreRenderService", () => {
50
47
 
51
48
  $rootScope = getService<IRootScopeService>("$rootScope")
52
49
  storeService = getService<StoreService>("storeService")
53
- nodeMetricDataService = getService<NodeMetricDataService>("nodeMetricDataService")
54
50
  codeMapRenderService = getService<CodeMapRenderService>("codeMapRenderService")
55
51
 
56
52
  fileMeta = clone(FILE_STATES[0].file.fileMeta)
@@ -73,7 +69,7 @@ describe("codeMapPreRenderService", () => {
73
69
  }
74
70
 
75
71
  function rebuildService() {
76
- codeMapPreRenderService = new CodeMapPreRenderService($rootScope, storeService, nodeMetricDataService, codeMapRenderService)
72
+ codeMapPreRenderService = new CodeMapPreRenderService($rootScope, storeService, codeMapRenderService)
77
73
  }
78
74
 
79
75
  function withMockedCodeMapRenderService() {
@@ -81,10 +77,6 @@ describe("codeMapPreRenderService", () => {
81
77
  codeMapRenderService.scaleMap = jest.fn()
82
78
  }
83
79
 
84
- function withMockedMetricService() {
85
- nodeMetricDataService.isMetricAvailable = jest.fn().mockReturnValue(true)
86
- }
87
-
88
80
  function withUnifiedMapAndFileMeta() {
89
81
  codeMapPreRenderService["unifiedMap"] = map
90
82
  codeMapPreRenderService["unifiedFileMeta"] = fileMeta
@@ -18,7 +18,6 @@ import { fileStatesAvailable } from "../../model/files/files.helper"
18
18
  import { PanelSelectionActions } from "../../state/store/appSettings/panelSelection/panelSelection.actions"
19
19
  import { PresentationModeActions } from "../../state/store/appSettings/isPresentationMode/isPresentationMode.actions"
20
20
  import { MetricDataService, MetricDataSubscriber } from "../../state/store/metricData/metricData.service"
21
- import { NodeMetricDataService } from "../../state/store/metricData/nodeMetricData/nodeMetricData.service"
22
21
  import { ExperimentalFeaturesEnabledActions } from "../../state/store/appSettings/enableExperimentalFeatures/experimentalFeaturesEnabled.actions"
23
22
  import { LayoutAlgorithmService, LayoutAlgorithmSubscriber } from "../../state/store/appSettings/layoutAlgorithm/layoutAlgorithm.service"
24
23
  import { trackEventUsageData, trackMapMetaData } from "../../util/usageDataTracker"
@@ -31,7 +30,8 @@ import { FocusedNodePathActions } from "../../state/store/dynamicSettings/focuse
31
30
  import { ColorRangeFromSubscriber, ColorRangeToSubscriber, RangeSliderController } from "../rangeSlider/rangeSlider.component"
32
31
  import { HoveredBuildingPathActions } from "../../state/store/appStatus/hoveredBuildingPath/hoveredBuildingPath.actions"
33
32
  import { accumulatedDataSelector } from "../../state/selectors/accumulatedData/accumulatedData.selector"
34
- import { nodeMetricDataSelector } from "../../state/selectors/accumulatedData/metricData/nodeMetricData.selector"
33
+ import { areAllNecessaryRenderDataAvailableSelector } from "../../state/selectors/allNecessaryRenderDataAvailable/areAllNecessaryRenderDataAvailable.selector"
34
+ import { RightClickedNodeDataActions } from "../../state/store/appStatus/rightClickedNodeData/rightClickedNodeData.actions"
35
35
 
36
36
  export interface CodeMapPreRenderServiceSubscriber {
37
37
  onRenderMapChanged(map: CodeMapNode)
@@ -59,7 +59,6 @@ export class CodeMapPreRenderService
59
59
  constructor(
60
60
  private $rootScope: IRootScopeService,
61
61
  private storeService: StoreService,
62
- private nodeMetricDataService: NodeMetricDataService,
63
62
  private codeMapRenderService: CodeMapRenderService
64
63
  ) {
65
64
  "ngInject"
@@ -89,13 +88,7 @@ export class CodeMapPreRenderService
89
88
  }
90
89
 
91
90
  onStoreChanged(actionType: string) {
92
- if (isActionOfType(actionType, HoveredBuildingPathActions)) {
93
- // temporary hack:
94
- // this.debounceRendering() leads to a new MapMesh, which leads to a new render, which would revert hover
95
- // TODO We definitely need to improve this
96
- return
97
- }
98
-
91
+ // TODO: Get rid of this if else block. Why do we sometimes call this.debounceRendering() and sometimes this.codeMapRenderService.update()?
99
92
  if (
100
93
  this.allNecessaryRenderDataAvailable() &&
101
94
  !isActionOfType(actionType, ScalingActions) &&
@@ -107,7 +100,9 @@ export class CodeMapPreRenderService
107
100
  !isActionOfType(actionType, IsAttributeSideBarVisibleActions) &&
108
101
  !isActionOfType(actionType, PanelSelectionActions) &&
109
102
  !isActionOfType(actionType, PresentationModeActions) &&
110
- !isActionOfType(actionType, ExperimentalFeaturesEnabledActions)
103
+ !isActionOfType(actionType, ExperimentalFeaturesEnabledActions) &&
104
+ !isActionOfType(actionType, HoveredBuildingPathActions) &&
105
+ !isActionOfType(actionType, RightClickedNodeDataActions)
111
106
  ) {
112
107
  this.debounceRendering()
113
108
  this.debounceTracking(actionType)
@@ -175,30 +170,12 @@ export class CodeMapPreRenderService
175
170
  }
176
171
 
177
172
  private allNecessaryRenderDataAvailable() {
178
- return (
179
- nodeMetricDataSelector(this.storeService.getState()) !== null &&
180
- fileStatesAvailable(this.storeService.getState().files) &&
181
- this.areChosenMetricsInMetricData() &&
182
- Object.values(this.storeService.getState().dynamicSettings).every(x => {
183
- return x !== null && Object.values(x).every(v => v !== null)
184
- })
185
- )
186
- }
187
-
188
- private areChosenMetricsInMetricData() {
189
- const { dynamicSettings } = this.storeService.getState()
190
- return (
191
- this.nodeMetricDataService.isMetricAvailable(dynamicSettings.areaMetric) &&
192
- this.nodeMetricDataService.isMetricAvailable(dynamicSettings.colorMetric) &&
193
- this.nodeMetricDataService.isMetricAvailable(dynamicSettings.heightMetric)
194
- )
173
+ return areAllNecessaryRenderDataAvailableSelector(this.storeService.getState())
195
174
  }
196
175
 
197
176
  private removeLoadingGifs() {
198
- if (this.storeService.getState().appSettings.isLoadingFile) {
199
- this.storeService.dispatch(setIsLoadingFile(false))
200
- }
201
- this.storeService.dispatch(setIsLoadingMap(false))
177
+ if (this.storeService.getState().appSettings.isLoadingFile) this.storeService.dispatch(setIsLoadingFile(false))
178
+ if (this.storeService.getState().appSettings.isLoadingMap) this.storeService.dispatch(setIsLoadingMap(false))
202
179
  }
203
180
 
204
181
  private showLoadingMapGif() {
@@ -47,6 +47,7 @@ export class CodeMapMesh {
47
47
 
48
48
  selectBuilding(building: CodeMapBuilding, color: string) {
49
49
  building.setColor(color)
50
+ building.setDeltaColor(color)
50
51
  this.setVertexColor(building.id, building.getColorVector(), building.getDefaultDeltaColorVector())
51
52
  this.updateVertices()
52
53
  }
@@ -1,7 +1,16 @@
1
- <color-chrome
2
- role="colorpicker"
3
- (click)="$event.stopPropagation()"
4
- [disableAlpha]="true"
5
- [color]="hexColor"
6
- (onChangeComplete)="handleChangeComplete($event.color.hex)"
7
- ></color-chrome>
1
+ <ng-container
2
+ [ngTemplateOutlet]="triggerTemplate"
3
+ [ngTemplateOutletContext]="{ isOpen: colorPickerMenuTrigger.menuOpen, isHovered: isHovered }"
4
+ >
5
+ </ng-container>
6
+
7
+ <span [matMenuTriggerFor]="menu" #colorPickerMenuTrigger="matMenuTrigger"></span>
8
+ <mat-menu #menu="matMenu" class="cc-color-picker-menu" [xPosition]="openXPosition" [hasBackdrop]="false">
9
+ <color-chrome
10
+ role="colorpicker"
11
+ (click)="$event.stopPropagation()"
12
+ [disableAlpha]="true"
13
+ [color]="hexColor"
14
+ (onChangeComplete)="handleChangeComplete($event.color.hex)"
15
+ ></color-chrome>
16
+ </mat-menu>
@@ -1,32 +1,71 @@
1
- import { EventEmitter } from "@angular/core"
1
+ import { Component } from "@angular/core"
2
2
  import { TestBed } from "@angular/core/testing"
3
- import { render, screen } from "@testing-library/angular"
3
+ import { fireEvent, render, screen, waitFor } from "@testing-library/angular"
4
4
 
5
- import { ColorPickerComponent } from "./colorPicker.component"
6
5
  import { ColorPickerModule } from "./colorPicker.module"
7
6
 
8
7
  describe("colorPicker", () => {
9
- const handleColorChange = jest.fn()
8
+ @Component({
9
+ selector: "test-color-picker",
10
+ template: `
11
+ <cc-color-picker
12
+ [hexColor]="hexColor"
13
+ (onColorChange)="hexColor = $event"
14
+ [triggerTemplate]="colorPickerTriggerTemplate"
15
+ ></cc-color-picker>
16
+ <ng-template #colorPickerTriggerTemplate let-isOpen="isOpen" let-isHovered="isHovered">
17
+ <div>isOpen: {{ isOpen }}</div>
18
+ <div>isHovered: {{ isHovered }}</div>
19
+ <div>color: {{ hexColor }}</div>
20
+ </ng-template>
21
+ `
22
+ })
23
+ class TestColorPicker {
24
+ hexColor = "#ffffff"
25
+ }
10
26
 
11
27
  beforeEach(() => {
12
- handleColorChange.mockReset()
13
28
  TestBed.configureTestingModule({
14
29
  imports: [ColorPickerModule]
15
30
  })
16
31
  })
17
32
 
18
- it("should let a user change a color", async () => {
19
- await render(ColorPickerComponent, {
20
- excludeComponentDeclaration: true,
21
- componentProperties: {
22
- hexColor: "#000000",
23
- onColorChange: { emit: handleColorChange } as unknown as EventEmitter<string>
24
- }
25
- })
33
+ it("should let a user change a color within a menu", async () => {
34
+ const { container } = await render(TestColorPicker)
35
+
36
+ expectColorPickerInDom(false)
37
+ expect(screen.queryByText("isOpen: false")).toBeTruthy()
38
+ expect(screen.queryByText("color: #ffffff")).toBeTruthy()
39
+
40
+ fireEvent.click(container.querySelector("cc-color-picker"))
41
+ expectColorPickerInDom(true)
42
+ expect(screen.queryByText("isOpen: true")).toBeTruthy()
26
43
 
27
- const colorPicker = screen.getByRole("colorpicker")
28
44
  // @ts-ignore
29
- ng.probe(colorPicker).componentInstance.onChangeComplete.emit({ $event: {}, color: { hex: "#ffffff" } })
30
- expect(handleColorChange).toHaveBeenCalledWith("#ffffff")
45
+ ng.probe(screen.queryByRole("colorpicker")).componentInstance.onChangeComplete.emit({ $event: {}, color: { hex: "#000000" } })
46
+ expect(await screen.findByText("color: #000000")).toBeTruthy()
47
+
48
+ fireEvent.click(document)
49
+ await waitFor(() => expectColorPickerInDom(false))
50
+ expect(screen.queryByText("isOpen: false")).toBeTruthy()
31
51
  })
52
+
53
+ it("should pass `isHovered` into template", async () => {
54
+ const { container } = await render(TestColorPicker)
55
+ const colorPicker = container.querySelector("cc-color-picker")
56
+
57
+ expect(screen.queryByText("isHovered: false")).toBeTruthy()
58
+
59
+ fireEvent.mouseEnter(colorPicker)
60
+ expect(screen.queryByText("isHovered: true")).toBeTruthy()
61
+
62
+ fireEvent.mouseLeave(colorPicker)
63
+ expect(screen.queryByText("isHovered: false")).toBeTruthy()
64
+ })
65
+
66
+ function expectColorPickerInDom(isOpen: boolean) {
67
+ const colorPickerElement = screen.queryByRole("colorpicker")
68
+ if (isOpen) expect(colorPickerElement).not.toBe(null)
69
+ else expect(colorPickerElement).toBe(null)
70
+ }
32
71
  })
@@ -1,4 +1,5 @@
1
- import { Component, EventEmitter, Input, Output } from "@angular/core"
1
+ import { Component, EventEmitter, HostListener, Input, Output, TemplateRef, ViewChild } from "@angular/core"
2
+ import { MatMenuTrigger, MenuPositionX } from "@angular/material/menu"
2
3
 
3
4
  @Component({
4
5
  selector: "cc-color-picker",
@@ -6,10 +7,40 @@ import { Component, EventEmitter, Input, Output } from "@angular/core"
6
7
  })
7
8
  export class ColorPickerComponent {
8
9
  @Input() hexColor: string
10
+ @Input() openXPosition: MenuPositionX = "after"
11
+ @Input() triggerTemplate: TemplateRef<unknown>
9
12
 
10
13
  @Output() onColorChange = new EventEmitter<string>()
11
14
 
15
+ @ViewChild("colorPickerMenuTrigger") colorPickerMenuTrigger: MatMenuTrigger
16
+
17
+ isHovered = false
18
+
19
+ private isClickInside = false
20
+
12
21
  handleChangeComplete(hexColor: string) {
13
22
  this.onColorChange.emit(hexColor)
14
23
  }
24
+
25
+ @HostListener("mouseenter") onMouseEnter() {
26
+ this.isHovered = true
27
+ }
28
+
29
+ @HostListener("mouseleave") onMouseLeave() {
30
+ this.isHovered = false
31
+ }
32
+
33
+ @HostListener("click") onClick() {
34
+ this.isClickInside = true
35
+ this.colorPickerMenuTrigger.openMenu()
36
+ }
37
+
38
+ @HostListener("document:click")
39
+ handleDocumentClick() {
40
+ if (!this.isClickInside && this.colorPickerMenuTrigger.menuOpen) {
41
+ this.colorPickerMenuTrigger.closeMenu()
42
+ }
43
+
44
+ this.isClickInside = false
45
+ }
15
46
  }
@@ -1,10 +1,12 @@
1
1
  import { CommonModule } from "@angular/common"
2
2
  import { NgModule } from "@angular/core"
3
3
  import { ColorChromeModule } from "ngx-color/chrome"
4
+
5
+ import { MaterialModule } from "../../../material/material.module"
4
6
  import { ColorPickerComponent } from "./colorPicker.component"
5
7
 
6
8
  @NgModule({
7
- imports: [CommonModule, ColorChromeModule],
9
+ imports: [CommonModule, ColorChromeModule, MaterialModule],
8
10
  declarations: [ColorPickerComponent],
9
11
  exports: [ColorPickerComponent]
10
12
  })
@@ -1,17 +1,17 @@
1
1
  <div class="custom-configs">
2
2
  <md-menu class="custom-configs-component">
3
- <md-button class="custom-configs-button" ng-click="$ctrl.initView(); $mdMenu.open($event);" title="Open your saved Custom Configs">
3
+ <md-button class="custom-configs-button" ng-click="$ctrl.initView(); $mdMenu.open($event);" title="Open your saved Custom Views">
4
4
  <i class="fa fa-cogs"></i>
5
5
  </md-button>
6
6
 
7
7
  <md-menu-content class="custom-configs-drop-down" width="7">
8
8
  <md-menu-item class="custom-configs-item">
9
- <md-button class="custom-configs-dialog-name" ng-disabled="true">Custom Configs</md-button>
9
+ <md-button class="custom-configs-dialog-name" ng-disabled="true">Custom Views</md-button>
10
10
 
11
11
  <md-button
12
12
  class="action-button"
13
13
  onclick="document.getElementById('input-file-id').click()"
14
- title="Upload Custom Configs (.cc.config.json file)."
14
+ title="Upload Custom View (.cc.config.json file)."
15
15
  >
16
16
  <i class="fa fa-folder-open" aria-hidden="true"></i>
17
17
  </md-button>
@@ -19,11 +19,11 @@
19
19
  ng-click="$ctrl.downloadPreloadedCustomConfigs()"
20
20
  ng-disabled="!$ctrl._viewModel.hasDownloadableConfigs"
21
21
  class="action-button"
22
- title="Download Custom Configs related to currently uploaded maps, if any."
22
+ title="Download Custom View related to currently uploaded maps, if any."
23
23
  >
24
24
  <i class="fa fa-download" aria-hidden="true"></i>
25
25
  </md-button>
26
- <md-button ng-click="$ctrl.showAddCustomConfigSettings()" class="action-button" title="Create new Custom Config">
26
+ <md-button ng-click="$ctrl.showAddCustomConfigSettings()" class="action-button" title="Create new Custom View">
27
27
  <i class="fa fa-plus" aria-hidden="true"></i>
28
28
  </md-button>
29
29
  </md-menu-item>
@@ -31,13 +31,22 @@
31
31
  <md-divider></md-divider>
32
32
 
33
33
  <md-menu-item ng-if="!$ctrl._viewModel.dropDownCustomConfigItemGroups.length" class="custom-configs-item">
34
- <md-button disabled>It is time to add your first CustomConfig.</md-button>
34
+ <md-button disabled>It is time to add your first Custom View.</md-button>
35
35
  </md-menu-item>
36
36
 
37
- <md-menu-item class="custom-configs-item" ng-repeat="customConfigItemGroup in $ctrl._viewModel.dropDownCustomConfigItemGroups">
38
- <md-button class="button-hovering" ng-click="collapsed=!collapsed" md-prevent-menu-close="md-prevent-menu-close">
37
+ <md-menu-item
38
+ class="custom-configs-item"
39
+ ng-repeat="customConfigItemGroup in $ctrl._viewModel.dropDownCustomConfigItemGroups |
40
+ limitTo: $ctrl._viewModel.visibleEntries"
41
+ >
42
+ <md-button
43
+ class="button-hovering"
44
+ ng-click="collapsed=!collapsed"
45
+ ng-style="!customConfigItemGroup.hasApplicableItems && { color: 'rgba(0,0,0,0.3)' }"
46
+ md-prevent-menu-close="md-prevent-menu-close"
47
+ >
39
48
  <span class="collapse-trigger">
40
- Custom Configs in <strong>{{ customConfigItemGroup.mapSelectionMode | lowercase }}</strong> mode for
49
+ Custom View(s) in <strong>{{ customConfigItemGroup.mapSelectionMode | lowercase }}</strong> mode for
41
50
  <strong>{{ customConfigItemGroup.mapNames }}</strong>
42
51
  </span>
43
52
  <i ng-show="!collapsed" class="collapse-icon fa fa-arrow-down"></i>
@@ -64,7 +73,8 @@
64
73
  </md-button>
65
74
 
66
75
  <md-button
67
- ng-click="$ctrl.removeCustomConfig(customConfig.id)"
76
+ ng-click="$ctrl.removeCustomConfig(customConfig.id, $index, $parent.$index)"
77
+ md-prevent-menu-close="md-prevent-menu-close"
68
78
  class="action-button remove button-hovering"
69
79
  title="Remove Custom Config"
70
80
  >
@@ -73,6 +83,14 @@
73
83
  </div>
74
84
  </div>
75
85
  </md-menu-item>
86
+ <button
87
+ ng-show="$ctrl._viewModel.showNonApplicableButton"
88
+ ng-click="$ctrl.toggleNonApplicableItems();"
89
+ md-prevent-menu-close="md-prevent-menu-close"
90
+ >
91
+ {{ $ctrl.isExpanded() ? "Hide non-applicable Custom Views" : "Show non-applicable Custom Views" }}
92
+ <i ng-class="$ctrl.isExpanded() ? 'fa fa-angle-up' : 'fa fa-angle-down'"></i>
93
+ </button>
76
94
  </md-menu-content>
77
95
  </md-menu>
78
96
 
@@ -80,7 +98,7 @@
80
98
  <md-button
81
99
  class="custom-configs-button plus"
82
100
  ng-click="$ctrl.showAddCustomConfigSettings();"
83
- title="Quick save current view as a Custom Config"
101
+ title="Quick save current view as a Custom View"
84
102
  >
85
103
  <i class="fa fa-plus"></i>
86
104
  </md-button>