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.
- package/Dockerfile +1 -1
- package/app/app.module.ts +30 -6
- package/app/codeCharta/codeCharta.component.html +0 -2
- package/app/codeCharta/codeCharta.component.ts +2 -0
- package/app/codeCharta/codeCharta.model.ts +8 -5
- package/app/codeCharta/codeCharta.service.spec.ts +41 -50
- package/app/codeCharta/codeCharta.service.ts +33 -32
- package/app/codeCharta/e2e/url.e2e.ts +1 -1
- package/app/codeCharta/services/ajs-upgraded-providers.ts +13 -0
- package/app/codeCharta/state/angular-redux/effects/createEffect.spec.ts +37 -0
- package/app/codeCharta/state/angular-redux/effects/createEffect.ts +25 -0
- package/app/codeCharta/state/angular-redux/effects/effects.module.ts +36 -0
- package/app/codeCharta/state/angular-redux/ofType.ts +11 -0
- package/app/codeCharta/state/angular-redux/state.ts +12 -0
- package/app/codeCharta/state/angular-redux/store.ts +1 -1
- package/app/codeCharta/state/effects/addBlacklistItemsIfNotResultsInEmptyMap/addBlacklistItemsIfNotResultsInEmptyMap.effect.spec.ts +60 -0
- package/app/codeCharta/state/effects/addBlacklistItemsIfNotResultsInEmptyMap/addBlacklistItemsIfNotResultsInEmptyMap.effect.ts +56 -0
- package/app/codeCharta/state/effects/addBlacklistItemsIfNotResultsInEmptyMap/resultsInEmptyMap.ts +22 -0
- package/app/codeCharta/state/effects/nodeContextMenu/excludeButton/excludeButton.component.html +3 -0
- package/app/codeCharta/state/effects/nodeContextMenu/excludeButton/excludeButton.component.ts +26 -0
- package/app/codeCharta/state/effects/nodeContextMenu/flattenButtons/flattenButtons.component.html +13 -0
- package/app/codeCharta/state/effects/nodeContextMenu/flattenButtons/flattenButtons.component.spec.ts +55 -0
- package/app/codeCharta/state/effects/nodeContextMenu/flattenButtons/flattenButtons.component.ts +34 -0
- package/app/codeCharta/state/effects/nodeContextMenu/flattenButtons/flattenButtons.module.ts +11 -0
- package/app/codeCharta/state/effects/nodeContextMenu/focusButtons/focusButtons.component.html +24 -0
- package/app/codeCharta/state/effects/nodeContextMenu/focusButtons/focusButtons.component.spec.ts +55 -0
- package/app/codeCharta/state/effects/nodeContextMenu/focusButtons/focusButtons.component.ts +38 -0
- package/app/codeCharta/state/effects/nodeContextMenu/focusButtons/focusButtons.module.ts +13 -0
- package/app/codeCharta/state/effects/nodeContextMenu/focusButtons/isNodeFocused.pipe.spec.ts +31 -0
- package/app/codeCharta/state/effects/nodeContextMenu/focusButtons/isNodeFocused.pipe.ts +25 -0
- package/app/codeCharta/state/effects/nodeContextMenu/highlightButtons/highlightButtons.component.html +6 -0
- package/app/codeCharta/state/effects/nodeContextMenu/highlightButtons/highlightButtons.component.spec.ts +64 -0
- package/app/codeCharta/state/effects/nodeContextMenu/highlightButtons/highlightButtons.component.ts +39 -0
- package/app/codeCharta/state/effects/nodeContextMenu/highlightButtons/highlightButtons.module.ts +11 -0
- package/app/codeCharta/state/effects/nodeContextMenu/markFolderRow/markFolderRow.component.html +22 -0
- package/app/codeCharta/state/effects/nodeContextMenu/markFolderRow/markFolderRow.component.scss +31 -0
- package/app/codeCharta/state/effects/nodeContextMenu/markFolderRow/markFolderRow.component.spec.ts +35 -0
- package/app/codeCharta/state/effects/nodeContextMenu/markFolderRow/markFolderRow.component.ts +30 -0
- package/app/codeCharta/state/effects/nodeContextMenu/markFolderRow/markFolderRow.module.ts +11 -0
- package/app/codeCharta/state/effects/nodeContextMenu/markFolderRow/selectors/markFolderItems.selector.spec.ts +17 -0
- package/app/codeCharta/state/effects/nodeContextMenu/markFolderRow/selectors/markFolderItems.selector.ts +29 -0
- package/app/codeCharta/{ui → state/effects}/nodeContextMenu/nodeContextMenu.e2e.ts +4 -16
- package/app/codeCharta/{ui → state/effects}/nodeContextMenu/nodeContextMenu.po.ts +1 -1
- package/app/codeCharta/state/effects/nodeContextMenu/nodeContextMenu.service.spec.ts +78 -0
- package/app/codeCharta/state/effects/nodeContextMenu/nodeContextMenu.service.ts +72 -0
- package/app/codeCharta/state/effects/nodeContextMenu/nodeContextMenuCard/lastPartOfNodePath.pipe.spec.ts +11 -0
- package/app/codeCharta/state/effects/nodeContextMenu/nodeContextMenuCard/lastPartOfNodePath.pipe.ts +8 -0
- package/app/codeCharta/state/effects/nodeContextMenu/nodeContextMenuCard/nodeContextMenuCard.component.html +17 -0
- package/app/codeCharta/state/effects/nodeContextMenu/nodeContextMenuCard/nodeContextMenuCard.component.scss +34 -0
- package/app/codeCharta/state/effects/nodeContextMenu/nodeContextMenuCard/nodeContextMenuCard.component.spec.ts +49 -0
- package/app/codeCharta/state/effects/nodeContextMenu/nodeContextMenuCard/nodeContextMenuCard.component.ts +19 -0
- package/app/codeCharta/state/effects/nodeContextMenu/nodeContextMenuCard/nodeContextMenuCard.module.ts +18 -0
- package/app/codeCharta/state/effects/nodeContextMenu/openNodeContextMenu.effect.spec.ts +32 -0
- package/app/codeCharta/state/effects/nodeContextMenu/openNodeContextMenu.effect.ts +33 -0
- package/app/codeCharta/state/effects/nodeContextMenu/rightClickedCodeMapNode.selector.ts +8 -0
- package/app/codeCharta/state/effects/unfocusNodesOnLoadingMap.effect.spec.ts +47 -0
- package/app/codeCharta/state/effects/unfocusNodesOnLoadingMap.effect.ts +18 -0
- package/app/codeCharta/state/selectors/allNecessaryRenderDataAvailable/areAllNecessaryRenderDataAvailable.selector.ts +30 -0
- package/app/codeCharta/state/selectors/allNecessaryRenderDataAvailable/utils/areDynamicSettingsAvailable.spec.ts +36 -0
- package/app/codeCharta/state/selectors/allNecessaryRenderDataAvailable/utils/areDynamicSettingsAvailable.ts +10 -0
- package/app/codeCharta/state/selectors/allNecessaryRenderDataAvailable/utils/areMetricsAvailable.spec.ts +13 -0
- package/app/codeCharta/state/selectors/allNecessaryRenderDataAvailable/utils/areMetricsAvailable.ts +8 -0
- package/app/codeCharta/state/store/appSettings/appSettings.actions.ts +2 -0
- package/app/codeCharta/state/store/appSettings/appSettings.reducer.ts +2 -0
- package/app/codeCharta/state/store/appSettings/invertArea/invertArea.actions.ts +32 -0
- package/app/codeCharta/state/store/appSettings/invertArea/invertArea.reducer.spec.ts +26 -0
- package/app/codeCharta/state/store/appSettings/invertArea/invertArea.reducer.ts +12 -0
- package/app/codeCharta/state/store/appSettings/invertArea/invertArea.selector.ts +3 -0
- package/app/codeCharta/state/store/appSettings/isLoadingMap/isLoadingMap.reducer.spec.ts +14 -3
- package/app/codeCharta/state/store/appSettings/isLoadingMap/isLoadingMap.reducer.ts +41 -6
- package/app/codeCharta/state/store/appStatus/appStatus.reducer.ts +3 -1
- package/app/codeCharta/state/store/appStatus/appStatus.selector.ts +3 -0
- package/app/codeCharta/state/store/appStatus/rightClickedNodeData/rightClickedNodeData.actions.ts +23 -0
- package/app/codeCharta/state/store/appStatus/rightClickedNodeData/rightClickedNodeData.reducer.ts +15 -0
- package/app/codeCharta/state/store/appStatus/rightClickedNodeData/rightClickedNodeData.selector.ts +4 -0
- package/app/codeCharta/state/store/dynamicSettings/dynamicSettings.splitter.ts +2 -2
- package/app/codeCharta/state/store/dynamicSettings/focusedNodePath/currentFocused.selector.ts +8 -0
- package/app/codeCharta/state/store/dynamicSettings/focusedNodePath/focusedNodePath.actions.ts +27 -7
- package/app/codeCharta/state/store/dynamicSettings/focusedNodePath/focusedNodePath.reducer.spec.ts +27 -11
- package/app/codeCharta/state/store/dynamicSettings/focusedNodePath/focusedNodePath.reducer.ts +11 -5
- package/app/codeCharta/state/store/dynamicSettings/focusedNodePath/focusedNodePath.selector.ts +4 -0
- package/app/codeCharta/state/store/dynamicSettings/focusedNodePath/focusedNodePath.service.spec.ts +2 -2
- package/app/codeCharta/state/store/dynamicSettings/focusedNodePath/focusedNodePath.service.ts +1 -1
- package/app/codeCharta/state/store/fileSettings/blacklist/blacklist.actions.ts +33 -2
- package/app/codeCharta/state/store/fileSettings/blacklist/blacklist.reducer.spec.ts +17 -1
- package/app/codeCharta/state/store/fileSettings/blacklist/blacklist.reducer.ts +3 -1
- package/app/codeCharta/state/store/fileSettings/blacklist/blacklist.service.spec.ts +1 -19
- package/app/codeCharta/state/store/fileSettings/blacklist/blacklist.service.ts +5 -28
- package/app/codeCharta/state/store/fileSettings/markedPackages/markedPackages.actions.ts +9 -10
- package/app/codeCharta/state/store/fileSettings/markedPackages/markedPackages.reducer.spec.ts +37 -7
- package/app/codeCharta/state/store/fileSettings/markedPackages/markedPackages.reducer.ts +7 -3
- package/app/codeCharta/state/store/fileSettings/markedPackages/util/findIndexOfMarkedPackageOrParent.spec.ts +39 -0
- package/app/codeCharta/state/store/fileSettings/markedPackages/util/findIndexOfMarkedPackageOrParent.ts +19 -0
- package/app/codeCharta/state/store/lookUp/idToNode/idToNode.selector.ts +4 -0
- package/app/codeCharta/state/store/lookUp/lookUp.selector.ts +3 -0
- package/app/codeCharta/state/store/metricData/nodeMetricData/nodeMetricData.service.ts +0 -4
- package/app/codeCharta/state/store/state.actions.ts +3 -1
- package/app/codeCharta/state/store/state.splitter.spec.ts +4 -4
- package/app/codeCharta/state/store/store.ts +5 -1
- package/app/codeCharta/state/store.service.spec.ts +21 -8
- package/app/codeCharta/state/store.service.ts +3 -31
- package/app/codeCharta/ui/areaSettingsPanel/areaSettingsPanel.component.html +3 -1
- package/app/codeCharta/ui/areaSettingsPanel/areaSettingsPanel.component.scss +6 -2
- package/app/codeCharta/ui/areaSettingsPanel/areaSettingsPanel.component.ts +1 -1
- package/app/codeCharta/ui/areaSettingsPanel/areaSettingsPanel.module.ts +3 -0
- package/app/codeCharta/ui/areaSettingsPanel/areaSettingsPanel.po.ts +4 -4
- package/app/codeCharta/ui/areaSettingsPanel/invertAreaOption/invertAreaOption.component.html +1 -0
- package/app/codeCharta/ui/areaSettingsPanel/invertAreaOption/invertAreaOption.component.scss +26 -0
- package/app/codeCharta/ui/areaSettingsPanel/invertAreaOption/invertAreaOption.component.spec.ts +29 -0
- package/app/codeCharta/ui/areaSettingsPanel/invertAreaOption/invertAreaOption.component.ts +24 -0
- package/app/codeCharta/ui/artificialIntelligence/__snapshots__/artificialIntelligence.component.spec.ts.snap +13 -16
- package/app/codeCharta/ui/artificialIntelligence/artificialIntelligence.component.html +4 -4
- package/app/codeCharta/ui/artificialIntelligence/artificialIntelligence.component.scss +0 -4
- package/app/codeCharta/ui/artificialIntelligence/artificialIntelligence.component.spec.ts +82 -52
- package/app/codeCharta/ui/artificialIntelligence/artificialIntelligence.component.ts +41 -101
- package/app/codeCharta/ui/attributeSideBar/attributeTypeSelector/aggregationType.pipe.spec.ts +19 -0
- package/app/codeCharta/ui/attributeSideBar/attributeTypeSelector/{aggregationSymbol.pipe.ts → aggregationType.pipe.ts} +4 -4
- package/app/codeCharta/ui/attributeSideBar/attributeTypeSelector/attributeTypeSelector.component.html +4 -12
- package/app/codeCharta/ui/attributeSideBar/attributeTypeSelector/attributeTypeSelector.component.scss +11 -20
- package/app/codeCharta/ui/attributeSideBar/attributeTypeSelector/attributeTypeSelector.component.spec.ts +8 -15
- package/app/codeCharta/ui/attributeSideBar/attributeTypeSelector/attributeTypeSelector.module.ts +2 -2
- package/app/codeCharta/ui/codeMap/__snapshots__/codeMap.arrow.service.spec.ts.snap +2 -2
- package/app/codeCharta/ui/codeMap/codeMap.actions.service.ts +1 -40
- package/app/codeCharta/ui/codeMap/codeMap.mouseEvent.service.ts +8 -16
- package/app/codeCharta/ui/codeMap/codeMap.preRender.service.spec.ts +1 -9
- package/app/codeCharta/ui/codeMap/codeMap.preRender.service.ts +9 -32
- package/app/codeCharta/ui/codeMap/rendering/codeMapMesh.ts +1 -0
- package/app/codeCharta/ui/colorPicker/colorPicker.component.html +16 -7
- package/app/codeCharta/ui/colorPicker/colorPicker.component.spec.ts +55 -16
- package/app/codeCharta/ui/colorPicker/colorPicker.component.ts +32 -1
- package/app/codeCharta/ui/colorPicker/colorPicker.module.ts +3 -1
- package/app/codeCharta/ui/customConfigs/customConfigs.component.html +29 -11
- package/app/codeCharta/ui/customConfigs/customConfigs.component.scss +1 -0
- package/app/codeCharta/ui/customConfigs/customConfigs.component.spec.ts +123 -2
- package/app/codeCharta/ui/customConfigs/customConfigs.component.ts +56 -2
- package/app/codeCharta/ui/dialog/dialog.addCustomConfigSettings.component.html +2 -2
- package/app/codeCharta/ui/dialog/dialog.changelog.component.html +1 -1
- package/app/codeCharta/ui/dialog/dialog.changelog.component.scss +15 -0
- package/app/codeCharta/ui/dialog/dialog.changelog.component.spec.ts +15 -15
- package/app/codeCharta/ui/dialog/dialog.changelog.component.ts +2 -1
- package/app/codeCharta/ui/dialog/dialog.globalSettings.e2e.ts +1 -1
- package/app/codeCharta/ui/dialog/dialog.globalSettings.po.ts +1 -1
- package/app/codeCharta/ui/dialog/dialog.service.spec.ts +68 -0
- package/app/codeCharta/ui/dialog/dialog.service.ts +38 -17
- package/app/codeCharta/ui/dialogs/dialogs.ts +3 -0
- package/app/codeCharta/ui/dialogs/errorDialog/errorDialog.component.html +7 -0
- package/app/codeCharta/ui/dialogs/errorDialog/errorDialog.component.ts +9 -0
- package/app/codeCharta/ui/edgeChooser/edgeChooser.e2e.ts +3 -2
- package/app/codeCharta/ui/fileChooser/fileChooser.e2e.ts +5 -6
- package/app/codeCharta/ui/filePanel/filePanel.component.html +24 -106
- package/app/codeCharta/ui/filePanel/filePanel.component.scss +12 -57
- package/app/codeCharta/ui/filePanel/filePanel.component.spec.ts +40 -72
- package/app/codeCharta/ui/filePanel/filePanel.component.ts +29 -81
- package/app/codeCharta/ui/filePanel/filePanel.module.ts +13 -1
- package/app/codeCharta/ui/filePanel/filePanel.po.ts +6 -24
- package/app/codeCharta/ui/filePanel/filePanelDeltaSelector/filePanelDeltaSelector.component.html +23 -0
- package/app/codeCharta/ui/filePanel/filePanelDeltaSelector/filePanelDeltaSelector.component.ts +18 -0
- package/app/codeCharta/ui/filePanel/filePanelFileSelector/filePanelFileSelector.component.html +18 -0
- package/app/codeCharta/ui/filePanel/filePanelFileSelector/filePanelFileSelector.component.ts +16 -0
- package/app/codeCharta/ui/filePanel/filePanelStateButtons/filePanelStateButtons.component.html +18 -0
- package/app/codeCharta/ui/filePanel/filePanelStateButtons/filePanelStateButtons.component.ts +11 -0
- package/app/codeCharta/ui/labelledColorPicker/labelledColorPicker.component.html +21 -13
- package/app/codeCharta/ui/labelledColorPicker/labelledColorPicker.component.spec.ts +11 -24
- package/app/codeCharta/ui/labelledColorPicker/labelledColorPicker.component.ts +1 -40
- package/app/codeCharta/ui/labelledColorPicker/labelledColorPicker.module.ts +1 -2
- package/app/codeCharta/ui/legendPanel/legendMarkedPackages/legendMarkedPackages.component.ts +2 -2
- package/app/codeCharta/ui/mapTreeView/mapTreeView.level.e2e.ts +8 -6
- package/app/codeCharta/ui/mapTreeView/mapTreeView.level.po.ts +1 -1
- package/app/codeCharta/ui/mapTreeView/mapTreeViewLevel/mapTreeViewLevel.component.html +1 -1
- package/app/codeCharta/ui/mapTreeView/mapTreeViewLevel/mapTreeViewLevel.component.spec.ts +6 -16
- package/app/codeCharta/ui/mapTreeView/mapTreeViewLevel/mapTreeViewLevel.component.ts +15 -11
- package/app/codeCharta/ui/ribbonBar/ribbonBar.component.html +3 -3
- package/app/codeCharta/ui/ribbonBar/ribbonBar.e2e.ts +3 -3
- package/app/codeCharta/ui/searchBar/searchBar.component.html +5 -0
- package/app/codeCharta/ui/searchBar/searchBar.component.scss +11 -0
- package/app/codeCharta/ui/searchBar/searchBar.component.spec.ts +10 -0
- package/app/codeCharta/ui/searchBar/searchBar.component.ts +1 -1
- package/app/codeCharta/ui/sortingOption/sortingOption.component.spec.ts +1 -1
- package/app/codeCharta/ui/toolBar/toolBar.component.html +1 -1
- package/app/codeCharta/ui/toolBar/toolBar.component.scss +1 -1
- package/app/codeCharta/ui/ui.ts +2 -6
- package/app/codeCharta/util/algorithm/streetLayout/strip/strip.ts +2 -2
- package/app/codeCharta/util/algorithm/streetLayout/treeMap.ts +1 -1
- package/app/codeCharta/util/algorithm/treeMapLayout/treeMapGenerator.spec.ts +2 -2
- package/app/codeCharta/util/algorithm/treeMapLayout/treeMapGenerator.ts +14 -7
- package/app/codeCharta/util/algorithm/treeMapLayout/treeMapHelper.spec.ts +2 -2
- package/app/codeCharta/util/algorithm/treeMapLayout/treeMapHelper.ts +1 -1
- package/app/codeCharta/util/customConfigBuilder.ts +2 -1
- package/app/codeCharta/util/customConfigHelper.spec.ts +155 -60
- package/app/codeCharta/util/customConfigHelper.ts +33 -3
- package/app/codeCharta/util/dataMocks.ts +8 -4
- package/app/codeCharta/util/fileExtensionCalculator.ts +1 -1
- package/app/codeCharta/util/fileValidator.spec.ts +69 -182
- package/app/codeCharta/util/fileValidator.ts +61 -37
- package/app/codeCharta/util/reduxHelper.ts +11 -0
- package/app/material/material.module.ts +17 -1
- package/conf/webpack.loaders.js +4 -1
- package/dist/webpack/bundle.js +5925 -1896
- package/dist/webpack/bundle.js.map +1 -1
- package/package.json +7 -6
- package/app/codeCharta/state/store/dynamicSettings/focusedNodePath/focusedNodePath.splitter.ts +0 -8
- package/app/codeCharta/ui/attributeSideBar/attributeTypeSelector/aggregationSymbol.pipe.spec.ts +0 -19
- package/app/codeCharta/ui/codeMap/codeMap.actions.service.spec.ts +0 -147
- package/app/codeCharta/ui/nodeContextMenu/markFolderColorPicker/markFolderColorPicker.component.html +0 -5
- package/app/codeCharta/ui/nodeContextMenu/markFolderColorPicker/markFolderColorPicker.component.scss +0 -13
- package/app/codeCharta/ui/nodeContextMenu/markFolderColorPicker/markFolderColorPicker.component.ts +0 -30
- package/app/codeCharta/ui/nodeContextMenu/markFolderColorPicker/markFolderColorPicker.module.ts +0 -13
- package/app/codeCharta/ui/nodeContextMenu/nodeContextMenu.component.html +0 -68
- package/app/codeCharta/ui/nodeContextMenu/nodeContextMenu.component.scss +0 -52
- package/app/codeCharta/ui/nodeContextMenu/nodeContextMenu.component.spec.ts +0 -571
- package/app/codeCharta/ui/nodeContextMenu/nodeContextMenu.component.ts +0 -318
- package/app/codeCharta/ui/nodeContextMenu/nodeContextMenu.module.ts +0 -13
- package/app/codeCharta/ui/unfocusButton/unfocusButton.component.html +0 -15
- package/app/codeCharta/ui/unfocusButton/unfocusButton.component.scss +0 -5
- package/app/codeCharta/ui/unfocusButton/unfocusButton.component.spec.ts +0 -106
- package/app/codeCharta/ui/unfocusButton/unfocusButton.component.ts +0 -62
- package/app/codeCharta/ui/unfocusButton/unfocusButton.module.ts +0 -7
|
@@ -22,7 +22,7 @@ describe("CustomConfigHelper", () => {
|
|
|
22
22
|
const customConfigStub = {
|
|
23
23
|
id: "invalid-md5-checksum",
|
|
24
24
|
name: "stubbedConfig1",
|
|
25
|
-
mapSelectionMode: CustomConfigMapSelectionMode.
|
|
25
|
+
mapSelectionMode: CustomConfigMapSelectionMode.MULTIPLE,
|
|
26
26
|
assignedMaps: ["test.cc.json"],
|
|
27
27
|
stateSettings: {}
|
|
28
28
|
} as CustomConfig
|
|
@@ -58,7 +58,7 @@ describe("CustomConfigHelper", () => {
|
|
|
58
58
|
const customConfigStub = {
|
|
59
59
|
id: "invalid-md5-checksum",
|
|
60
60
|
name: "stubbedConfig2",
|
|
61
|
-
mapSelectionMode: CustomConfigMapSelectionMode.
|
|
61
|
+
mapSelectionMode: CustomConfigMapSelectionMode.MULTIPLE,
|
|
62
62
|
assignedMaps: ["test.cc.json"],
|
|
63
63
|
stateSettings: {}
|
|
64
64
|
} as CustomConfig
|
|
@@ -81,6 +81,106 @@ describe("CustomConfigHelper", () => {
|
|
|
81
81
|
expect(localStorage.getItem).toHaveBeenCalledWith(CUSTOM_CONFIGS_LOCAL_STORAGE_ELEMENT)
|
|
82
82
|
expect(JSON.parse).toHaveBeenCalledWith(undefined, stateObjectReviver)
|
|
83
83
|
})
|
|
84
|
+
|
|
85
|
+
it("should load Custom Configs from local storage with version 1.0.0, update SINGLE mode in MULTIPLE and change version to 1.0.1 ", () => {
|
|
86
|
+
const customConfigStub1 = {
|
|
87
|
+
id: "invalid-md5-checksum1",
|
|
88
|
+
name: "stubbedConfig1",
|
|
89
|
+
mapSelectionMode: CustomConfigMapSelectionMode.SINGLE,
|
|
90
|
+
assignedMaps: ["test1.cc.json"],
|
|
91
|
+
stateSettings: {}
|
|
92
|
+
} as CustomConfig
|
|
93
|
+
|
|
94
|
+
const customConfigStub2 = {
|
|
95
|
+
id: "invalid-md5-checksum2",
|
|
96
|
+
name: "stubbedConfig2",
|
|
97
|
+
mapSelectionMode: CustomConfigMapSelectionMode.MULTIPLE,
|
|
98
|
+
assignedMaps: ["test2.cc.json"],
|
|
99
|
+
stateSettings: {}
|
|
100
|
+
} as CustomConfig
|
|
101
|
+
|
|
102
|
+
const customConfigStub3 = {
|
|
103
|
+
id: "invalid-md5-checksum3",
|
|
104
|
+
name: "stubbedConfig3",
|
|
105
|
+
mapSelectionMode: CustomConfigMapSelectionMode.DELTA,
|
|
106
|
+
assignedMaps: ["test3.cc.json"],
|
|
107
|
+
stateSettings: {}
|
|
108
|
+
} as CustomConfig
|
|
109
|
+
|
|
110
|
+
const localStorageCustomConfigs: LocalStorageCustomConfigs = {
|
|
111
|
+
version: "1.0.0",
|
|
112
|
+
customConfigs: [
|
|
113
|
+
[customConfigStub1.id, customConfigStub1],
|
|
114
|
+
[customConfigStub2.id, customConfigStub2],
|
|
115
|
+
[customConfigStub3.id, customConfigStub3]
|
|
116
|
+
]
|
|
117
|
+
}
|
|
118
|
+
|
|
119
|
+
CustomConfigHelper["customConfigs"].clear()
|
|
120
|
+
JSON["parse"] = jest.fn().mockImplementation(() => {
|
|
121
|
+
return localStorageCustomConfigs
|
|
122
|
+
})
|
|
123
|
+
|
|
124
|
+
const spyOnGetItem = spyOn(Storage.prototype, "getItem")
|
|
125
|
+
const spyOnRemoveItem = spyOn(Storage.prototype, "removeItem")
|
|
126
|
+
const spyOnSetItem = spyOn(Storage.prototype, "setItem")
|
|
127
|
+
const spyOnJSON = spyOn(JSON, "stringify")
|
|
128
|
+
|
|
129
|
+
const loadedCustomConfigs = CustomConfigHelper["loadCustomConfigs"]()
|
|
130
|
+
|
|
131
|
+
expect(spyOnGetItem).toHaveBeenCalledTimes(1)
|
|
132
|
+
expect(spyOnRemoveItem).toHaveBeenCalledTimes(1)
|
|
133
|
+
expect(spyOnSetItem).toHaveBeenCalledTimes(1)
|
|
134
|
+
expect(spyOnJSON).toHaveBeenCalledTimes(1)
|
|
135
|
+
expect(loadedCustomConfigs.size).toBe(3)
|
|
136
|
+
expect(loadedCustomConfigs.get("invalid-md5-checksum1").mapSelectionMode).toBe(CustomConfigMapSelectionMode.MULTIPLE)
|
|
137
|
+
expect(loadedCustomConfigs.get("invalid-md5-checksum2").mapSelectionMode).toBe(CustomConfigMapSelectionMode.MULTIPLE)
|
|
138
|
+
expect(loadedCustomConfigs.get("invalid-md5-checksum3").mapSelectionMode).toBe(CustomConfigMapSelectionMode.DELTA)
|
|
139
|
+
})
|
|
140
|
+
|
|
141
|
+
it("should load Custom Configs from local storage with version 1.0.1 and should not make any changes to them", () => {
|
|
142
|
+
const customConfigStub1 = {
|
|
143
|
+
id: "invalid-md5-checksum1",
|
|
144
|
+
name: "stubbedConfig1",
|
|
145
|
+
mapSelectionMode: CustomConfigMapSelectionMode.MULTIPLE,
|
|
146
|
+
assignedMaps: ["test1.cc.json"],
|
|
147
|
+
stateSettings: {}
|
|
148
|
+
} as CustomConfig
|
|
149
|
+
|
|
150
|
+
const customConfigStub2 = {
|
|
151
|
+
id: "invalid-md5-checksum2",
|
|
152
|
+
name: "stubbedConfig2",
|
|
153
|
+
mapSelectionMode: CustomConfigMapSelectionMode.DELTA,
|
|
154
|
+
assignedMaps: ["test2.cc.json"],
|
|
155
|
+
stateSettings: {}
|
|
156
|
+
} as CustomConfig
|
|
157
|
+
|
|
158
|
+
const localStorageCustomConfigs: LocalStorageCustomConfigs = {
|
|
159
|
+
version: "1.0.1",
|
|
160
|
+
customConfigs: [
|
|
161
|
+
[customConfigStub1.id, customConfigStub1],
|
|
162
|
+
[customConfigStub2.id, customConfigStub2]
|
|
163
|
+
]
|
|
164
|
+
}
|
|
165
|
+
|
|
166
|
+
CustomConfigHelper["customConfigs"].clear()
|
|
167
|
+
JSON["parse"] = jest.fn().mockImplementation(() => {
|
|
168
|
+
return localStorageCustomConfigs
|
|
169
|
+
})
|
|
170
|
+
|
|
171
|
+
const spyOnGetItem = spyOn(Storage.prototype, "getItem")
|
|
172
|
+
const spyOnRemoveItem = spyOn(Storage.prototype, "removeItem")
|
|
173
|
+
const spyOnSetItem = spyOn(Storage.prototype, "setItem")
|
|
174
|
+
|
|
175
|
+
const loadedCustomConfigs = CustomConfigHelper["loadCustomConfigs"]()
|
|
176
|
+
|
|
177
|
+
expect(spyOnGetItem).toHaveBeenCalledTimes(1)
|
|
178
|
+
expect(spyOnRemoveItem).toHaveBeenCalledTimes(0)
|
|
179
|
+
expect(spyOnSetItem).toHaveBeenCalledTimes(0)
|
|
180
|
+
expect(loadedCustomConfigs.size).toBe(2)
|
|
181
|
+
expect(loadedCustomConfigs.get("invalid-md5-checksum1").mapSelectionMode).toBe(CustomConfigMapSelectionMode.MULTIPLE)
|
|
182
|
+
expect(loadedCustomConfigs.get("invalid-md5-checksum2").mapSelectionMode).toBe(CustomConfigMapSelectionMode.DELTA)
|
|
183
|
+
})
|
|
84
184
|
})
|
|
85
185
|
|
|
86
186
|
describe("getCustomConfigsAmountByMapAndMode", () => {
|
|
@@ -88,7 +188,7 @@ describe("CustomConfigHelper", () => {
|
|
|
88
188
|
const customConfigStub1 = {
|
|
89
189
|
id: "1-invalid-md5-checksum",
|
|
90
190
|
name: "stubbedConfig3",
|
|
91
|
-
mapSelectionMode: CustomConfigMapSelectionMode.
|
|
191
|
+
mapSelectionMode: CustomConfigMapSelectionMode.MULTIPLE,
|
|
92
192
|
assignedMaps: ["testy.cc.json"],
|
|
93
193
|
mapChecksum: "123",
|
|
94
194
|
customConfigVersion: "1",
|
|
@@ -97,7 +197,7 @@ describe("CustomConfigHelper", () => {
|
|
|
97
197
|
const customConfigStub2 = {
|
|
98
198
|
id: "2-invalid-md5-checksum",
|
|
99
199
|
name: "stubbedConfig4",
|
|
100
|
-
mapSelectionMode: CustomConfigMapSelectionMode.
|
|
200
|
+
mapSelectionMode: CustomConfigMapSelectionMode.MULTIPLE,
|
|
101
201
|
assignedMaps: ["testy.cc.json"],
|
|
102
202
|
mapChecksum: "123",
|
|
103
203
|
customConfigVersion: "1",
|
|
@@ -106,7 +206,7 @@ describe("CustomConfigHelper", () => {
|
|
|
106
206
|
const customConfigStub3 = {
|
|
107
207
|
id: "3-invalid-md5-checksum",
|
|
108
208
|
name: "stubbedConfig5",
|
|
109
|
-
mapSelectionMode: CustomConfigMapSelectionMode.
|
|
209
|
+
mapSelectionMode: CustomConfigMapSelectionMode.MULTIPLE,
|
|
110
210
|
assignedMaps: ["another.cc.json"],
|
|
111
211
|
mapChecksum: "123",
|
|
112
212
|
customConfigVersion: "1",
|
|
@@ -130,19 +230,19 @@ describe("CustomConfigHelper", () => {
|
|
|
130
230
|
expect(
|
|
131
231
|
CustomConfigHelper.getCustomConfigsAmountByMapAndMode(
|
|
132
232
|
customConfigStub1.assignedMaps.join(" "),
|
|
133
|
-
CustomConfigMapSelectionMode.
|
|
233
|
+
CustomConfigMapSelectionMode.MULTIPLE
|
|
134
234
|
)
|
|
135
235
|
).toBe(2)
|
|
136
236
|
expect(
|
|
137
237
|
CustomConfigHelper.getCustomConfigsAmountByMapAndMode(
|
|
138
238
|
customConfigStub3.assignedMaps.join(" "),
|
|
139
|
-
CustomConfigMapSelectionMode.
|
|
239
|
+
CustomConfigMapSelectionMode.MULTIPLE
|
|
140
240
|
)
|
|
141
241
|
).toBe(1)
|
|
142
242
|
expect(
|
|
143
243
|
CustomConfigHelper.getCustomConfigsAmountByMapAndMode(
|
|
144
244
|
customConfigStub4.assignedMaps.join(" "),
|
|
145
|
-
CustomConfigMapSelectionMode.
|
|
245
|
+
CustomConfigMapSelectionMode.MULTIPLE
|
|
146
246
|
)
|
|
147
247
|
).toBe(1)
|
|
148
248
|
expect(
|
|
@@ -155,33 +255,6 @@ describe("CustomConfigHelper", () => {
|
|
|
155
255
|
})
|
|
156
256
|
|
|
157
257
|
describe("getConfigNameSuggestion", () => {
|
|
158
|
-
it("should return the right CustomConfig name suggestion for SINGLE mode", () => {
|
|
159
|
-
const customConfigStub1 = {
|
|
160
|
-
id: "invalid-md5-checksum",
|
|
161
|
-
name: "stubbedConfig7",
|
|
162
|
-
mapSelectionMode: CustomConfigMapSelectionMode.SINGLE,
|
|
163
|
-
assignedMaps: ["testy.cc.json"],
|
|
164
|
-
mapChecksum: "123",
|
|
165
|
-
customConfigVersion: "1",
|
|
166
|
-
stateSettings: {}
|
|
167
|
-
} as CustomConfig
|
|
168
|
-
|
|
169
|
-
jest.mock("../ui/customConfigs/customConfigFileStateConnector")
|
|
170
|
-
|
|
171
|
-
const getJointMapNameMock = jest.fn()
|
|
172
|
-
getJointMapNameMock.mockReturnValue(customConfigStub1.assignedMaps.join(" "))
|
|
173
|
-
|
|
174
|
-
CustomConfigFileStateConnector.prototype.getJointMapName = getJointMapNameMock
|
|
175
|
-
CustomConfigFileStateConnector.prototype.getMapSelectionMode = jest.fn().mockReturnValue(CustomConfigMapSelectionMode.SINGLE)
|
|
176
|
-
|
|
177
|
-
// Reset customConfigs in CustomConfigHelper
|
|
178
|
-
CustomConfigHelper["customConfigs"].clear()
|
|
179
|
-
expect(CustomConfigHelper.getConfigNameSuggestionByFileState(CustomConfigFileStateConnector.prototype)).toBe("testy.cc.json #1")
|
|
180
|
-
|
|
181
|
-
CustomConfigHelper["customConfigs"].set(customConfigStub1.id, customConfigStub1)
|
|
182
|
-
expect(CustomConfigHelper.getConfigNameSuggestionByFileState(CustomConfigFileStateConnector.prototype)).toBe("testy.cc.json #2")
|
|
183
|
-
})
|
|
184
|
-
|
|
185
258
|
it("should return the right CustomConfig name suggestion for MULTIPLE mode", () => {
|
|
186
259
|
const customConfigStub1 = {
|
|
187
260
|
id: "invalid-md5-checksum",
|
|
@@ -262,7 +335,7 @@ describe("CustomConfigHelper", () => {
|
|
|
262
335
|
const customConfigStub1 = {
|
|
263
336
|
id: "invalid-md5-checksum",
|
|
264
337
|
name: "stubbedConfig10",
|
|
265
|
-
mapSelectionMode: CustomConfigMapSelectionMode.
|
|
338
|
+
mapSelectionMode: CustomConfigMapSelectionMode.MULTIPLE,
|
|
266
339
|
assignedMaps: ["testy.cc.json"],
|
|
267
340
|
mapChecksum: "123",
|
|
268
341
|
customConfigVersion: "1",
|
|
@@ -309,15 +382,6 @@ describe("CustomConfigHelper", () => {
|
|
|
309
382
|
describe("sortCustomConfigDropDownList", () => {
|
|
310
383
|
it("should put applicable CustomConfigs Group at the beginning of the list and sort by mode afterwards", () => {
|
|
311
384
|
const customConfigItemGroups = new Map<string, CustomConfigItemGroup>([
|
|
312
|
-
[
|
|
313
|
-
"notApplicableSingle",
|
|
314
|
-
{
|
|
315
|
-
mapNames: "notApplicableSingle.cc.json",
|
|
316
|
-
mapSelectionMode: CustomConfigMapSelectionMode.SINGLE,
|
|
317
|
-
hasApplicableItems: false,
|
|
318
|
-
customConfigItems: []
|
|
319
|
-
}
|
|
320
|
-
],
|
|
321
385
|
[
|
|
322
386
|
"applicableMultiple",
|
|
323
387
|
{
|
|
@@ -363,7 +427,6 @@ describe("CustomConfigHelper", () => {
|
|
|
363
427
|
expect(customConfigItemGroupsDropDown[1].mapNames).toBe("notApplicableDelta.cc.json")
|
|
364
428
|
expect(customConfigItemGroupsDropDown[2].mapNames).toBe("notApplicableDelta2.cc.json notApplicableDelta2.1.cc.json")
|
|
365
429
|
expect(customConfigItemGroupsDropDown[3].mapNames).toBe("notApplicableMultiple1.cc.json notApplicableMultiple2.cc.json")
|
|
366
|
-
expect(customConfigItemGroupsDropDown[4].mapNames).toBe("notApplicableSingle.cc.json")
|
|
367
430
|
})
|
|
368
431
|
})
|
|
369
432
|
|
|
@@ -372,7 +435,7 @@ describe("CustomConfigHelper", () => {
|
|
|
372
435
|
const customConfigStub1 = {
|
|
373
436
|
id: "1-invalid-md5-checksum",
|
|
374
437
|
name: "config1",
|
|
375
|
-
mapSelectionMode: CustomConfigMapSelectionMode.
|
|
438
|
+
mapSelectionMode: CustomConfigMapSelectionMode.MULTIPLE,
|
|
376
439
|
assignedMaps: ["mocky.cc.json"],
|
|
377
440
|
mapChecksum: "123",
|
|
378
441
|
customConfigVersion: "1",
|
|
@@ -406,7 +469,7 @@ describe("CustomConfigHelper", () => {
|
|
|
406
469
|
|
|
407
470
|
const getMapSelectionModeMock = jest.fn()
|
|
408
471
|
getMapSelectionModeMock
|
|
409
|
-
.mockReturnValueOnce(CustomConfigMapSelectionMode.
|
|
472
|
+
.mockReturnValueOnce(CustomConfigMapSelectionMode.MULTIPLE)
|
|
410
473
|
.mockReturnValueOnce(CustomConfigMapSelectionMode.DELTA)
|
|
411
474
|
|
|
412
475
|
CustomConfigFileStateConnector.prototype.getJointMapName = getJointMapNameMock
|
|
@@ -415,7 +478,7 @@ describe("CustomConfigHelper", () => {
|
|
|
415
478
|
|
|
416
479
|
const customConfigItemGroups = CustomConfigHelper.getCustomConfigItemGroups(CustomConfigFileStateConnector.prototype)
|
|
417
480
|
|
|
418
|
-
const singleGroup = customConfigItemGroups.get("mocky.cc.
|
|
481
|
+
const singleGroup = customConfigItemGroups.get("mocky.cc.json_MULTIPLE")
|
|
419
482
|
expect(singleGroup.hasApplicableItems).toBe(true)
|
|
420
483
|
expect(singleGroup.customConfigItems[0].name).toBe("config1")
|
|
421
484
|
expect(singleGroup.customConfigItems[0].isApplicable).toBe(true)
|
|
@@ -429,7 +492,7 @@ describe("CustomConfigHelper", () => {
|
|
|
429
492
|
const customConfigStub1 = {
|
|
430
493
|
id: "1-invalid-md5-checksum",
|
|
431
494
|
name: "config1",
|
|
432
|
-
mapSelectionMode: CustomConfigMapSelectionMode.
|
|
495
|
+
mapSelectionMode: CustomConfigMapSelectionMode.MULTIPLE,
|
|
433
496
|
assignedMaps: ["mocky.cc.json"],
|
|
434
497
|
mapChecksum: "123",
|
|
435
498
|
customConfigVersion: "1",
|
|
@@ -438,7 +501,7 @@ describe("CustomConfigHelper", () => {
|
|
|
438
501
|
const customConfigStub2 = {
|
|
439
502
|
id: "2-invalid-md5-checksum",
|
|
440
503
|
name: "config2",
|
|
441
|
-
mapSelectionMode: CustomConfigMapSelectionMode.
|
|
504
|
+
mapSelectionMode: CustomConfigMapSelectionMode.MULTIPLE,
|
|
442
505
|
assignedMaps: ["another.mocky.cc.json"],
|
|
443
506
|
mapChecksum: "1234",
|
|
444
507
|
customConfigVersion: "1",
|
|
@@ -475,9 +538,9 @@ describe("CustomConfigHelper", () => {
|
|
|
475
538
|
|
|
476
539
|
const getMapSelectionModeMock = jest.fn()
|
|
477
540
|
getMapSelectionModeMock
|
|
478
|
-
.mockReturnValueOnce(CustomConfigMapSelectionMode.
|
|
479
|
-
.mockReturnValueOnce(CustomConfigMapSelectionMode.
|
|
480
|
-
.mockReturnValueOnce(CustomConfigMapSelectionMode.
|
|
541
|
+
.mockReturnValueOnce(CustomConfigMapSelectionMode.MULTIPLE)
|
|
542
|
+
.mockReturnValueOnce(CustomConfigMapSelectionMode.MULTIPLE)
|
|
543
|
+
.mockReturnValueOnce(CustomConfigMapSelectionMode.MULTIPLE)
|
|
481
544
|
|
|
482
545
|
CustomConfigFileStateConnector.prototype.getJointMapName = getJointMapNameMock
|
|
483
546
|
CustomConfigFileStateConnector.prototype.getChecksumOfAssignedMaps = getChecksumOfAssignedMapsMock
|
|
@@ -485,11 +548,11 @@ describe("CustomConfigHelper", () => {
|
|
|
485
548
|
|
|
486
549
|
const customConfigItemGroups = CustomConfigHelper.getCustomConfigItemGroups(CustomConfigFileStateConnector.prototype)
|
|
487
550
|
|
|
488
|
-
const singleGroup = customConfigItemGroups.get("mocky.cc.
|
|
551
|
+
const singleGroup = customConfigItemGroups.get("mocky.cc.json_MULTIPLE")
|
|
489
552
|
expect(singleGroup.customConfigItems[0].name).toBe("config1")
|
|
490
553
|
expect(singleGroup.customConfigItems[0].isApplicable).toBe(false)
|
|
491
554
|
|
|
492
|
-
const anotherSingleGroup = customConfigItemGroups.get("another.mocky.cc.
|
|
555
|
+
const anotherSingleGroup = customConfigItemGroups.get("another.mocky.cc.json_MULTIPLE")
|
|
493
556
|
expect(anotherSingleGroup.customConfigItems[0].name).toBe("config2")
|
|
494
557
|
expect(anotherSingleGroup.customConfigItems[0].isApplicable).toBe(false)
|
|
495
558
|
|
|
@@ -500,11 +563,42 @@ describe("CustomConfigHelper", () => {
|
|
|
500
563
|
})
|
|
501
564
|
|
|
502
565
|
describe("importCustomConfigs", () => {
|
|
566
|
+
it("should import Configs in SINGLE Mode and change mode to MULTIPLE", () => {
|
|
567
|
+
const configStub = {
|
|
568
|
+
id: "invalid-md5-checksum",
|
|
569
|
+
name: "to-be-imported",
|
|
570
|
+
mapSelectionMode: CustomConfigMapSelectionMode.SINGLE,
|
|
571
|
+
assignedMaps: ["exampleMap1.cc.json", "exampleMap2cc.json"]
|
|
572
|
+
} as ExportCustomConfig
|
|
573
|
+
|
|
574
|
+
const exportedCustomConfigs: Map<string, ExportCustomConfig> = new Map()
|
|
575
|
+
exportedCustomConfigs.set(configStub.id, configStub)
|
|
576
|
+
|
|
577
|
+
const mockedDownloadFile: CustomConfigsDownloadFile = {
|
|
578
|
+
downloadApiVersion: "",
|
|
579
|
+
timestamp: 0,
|
|
580
|
+
customConfigs: exportedCustomConfigs
|
|
581
|
+
}
|
|
582
|
+
|
|
583
|
+
spyOn(JSON, "parse")
|
|
584
|
+
JSON["parse"] = jest.fn().mockReturnValue(mockedDownloadFile)
|
|
585
|
+
|
|
586
|
+
// Mock first config to be already existent
|
|
587
|
+
CustomConfigHelper["customConfigs"].clear()
|
|
588
|
+
CustomConfigHelper.importCustomConfigs("not-relevant-json-string-due-to-mocking")
|
|
589
|
+
const customConfigs = CustomConfigHelper.getCustomConfigs()
|
|
590
|
+
|
|
591
|
+
expect(customConfigs.size).toBe(1)
|
|
592
|
+
expect(customConfigs.has(configStub.id)).toBeTruthy()
|
|
593
|
+
expect(customConfigs.get(configStub.id).name).toBe(configStub.name)
|
|
594
|
+
expect(customConfigs.get(configStub.id).mapSelectionMode).toBe(CustomConfigMapSelectionMode.MULTIPLE)
|
|
595
|
+
})
|
|
596
|
+
|
|
503
597
|
it("should import not existing Configs and prevent duplicate names, if any", () => {
|
|
504
598
|
const alreadyExistingConfigStub = {
|
|
505
599
|
id: "1-invalid-md5-checksum",
|
|
506
600
|
name: "already-existing-exported-config",
|
|
507
|
-
mapSelectionMode: CustomConfigMapSelectionMode.
|
|
601
|
+
mapSelectionMode: CustomConfigMapSelectionMode.MULTIPLE,
|
|
508
602
|
assignedMaps: ["exampleMap1.cc.json", "exampleMap2cc.json"]
|
|
509
603
|
} as ExportCustomConfig
|
|
510
604
|
|
|
@@ -516,7 +610,7 @@ describe("CustomConfigHelper", () => {
|
|
|
516
610
|
const exportCustomConfigDuplicateName = {
|
|
517
611
|
id: "3-invalid-md5-checksum-imported",
|
|
518
612
|
name: "already-existing-exported-config",
|
|
519
|
-
mapSelectionMode: CustomConfigMapSelectionMode.
|
|
613
|
+
mapSelectionMode: CustomConfigMapSelectionMode.MULTIPLE,
|
|
520
614
|
assignedMaps: ["exampleMap1.cc.json", "exampleMap2cc.json"],
|
|
521
615
|
// Timestamp of 2020-11-20_13-19
|
|
522
616
|
creationTime: 1_605_878_386_493
|
|
@@ -591,16 +685,17 @@ describe("CustomConfigHelper", () => {
|
|
|
591
685
|
)
|
|
592
686
|
})
|
|
593
687
|
})
|
|
688
|
+
|
|
594
689
|
describe("get custom config by name", () => {
|
|
595
690
|
it("should return null when config name is invalid", () => {
|
|
596
|
-
const result = CustomConfigHelper.getCustomConfigByName(CustomConfigMapSelectionMode.
|
|
691
|
+
const result = CustomConfigHelper.getCustomConfigByName(CustomConfigMapSelectionMode.MULTIPLE, [], "invalidConfig")
|
|
597
692
|
expect(result).toEqual(null)
|
|
598
693
|
})
|
|
599
694
|
it("should return custom config", () => {
|
|
600
695
|
const customConfigStub = {
|
|
601
696
|
id: "invalid-md5-checksum",
|
|
602
697
|
name: "stubbedConfig1",
|
|
603
|
-
mapSelectionMode: CustomConfigMapSelectionMode.
|
|
698
|
+
mapSelectionMode: CustomConfigMapSelectionMode.MULTIPLE,
|
|
604
699
|
assignedMaps: ["test.cc.json"],
|
|
605
700
|
stateSettings: {}
|
|
606
701
|
} as CustomConfig
|
|
@@ -22,8 +22,8 @@ import { ThreeOrbitControlsService } from "../ui/codeMap/threeViewer/threeOrbitC
|
|
|
22
22
|
import { CodeChartaStorage } from "./codeChartaStorage"
|
|
23
23
|
|
|
24
24
|
export const CUSTOM_CONFIG_FILE_EXTENSION = ".cc.config.json"
|
|
25
|
-
const CUSTOM_CONFIGS_LOCAL_STORAGE_VERSION = "1.0.
|
|
26
|
-
const CUSTOM_CONFIGS_DOWNLOAD_FILE_VERSION = "1.0.
|
|
25
|
+
const CUSTOM_CONFIGS_LOCAL_STORAGE_VERSION = "1.0.1"
|
|
26
|
+
const CUSTOM_CONFIGS_DOWNLOAD_FILE_VERSION = "1.0.1"
|
|
27
27
|
export const CUSTOM_CONFIGS_LOCAL_STORAGE_ELEMENT = "CodeCharta::customConfigs"
|
|
28
28
|
|
|
29
29
|
export class CustomConfigHelper {
|
|
@@ -90,11 +90,36 @@ export class CustomConfigHelper {
|
|
|
90
90
|
}
|
|
91
91
|
|
|
92
92
|
private static loadCustomConfigs() {
|
|
93
|
+
const ccLocalStorage = this.getCcLocalStorage()
|
|
94
|
+
return new Map(ccLocalStorage?.customConfigs)
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
// TODO [2022-08-01]: remove replace method for SINGLE mode when deadline is reached
|
|
98
|
+
private static getCcLocalStorage() {
|
|
93
99
|
const ccLocalStorage: LocalStorageCustomConfigs = JSON.parse(
|
|
94
100
|
CustomConfigHelper.getStorage().getItem(CUSTOM_CONFIGS_LOCAL_STORAGE_ELEMENT),
|
|
95
101
|
stateObjectReviver
|
|
96
102
|
)
|
|
97
|
-
|
|
103
|
+
if (ccLocalStorage?.version === "1.0.0") {
|
|
104
|
+
return this.replaceSingleModeInLocalStorage(ccLocalStorage)
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
return ccLocalStorage
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
// TODO [2022-08-01]: remove replace method for SINGLE mode when deadline is reached
|
|
111
|
+
private static replaceSingleModeInLocalStorage(ccLocalStorage: LocalStorageCustomConfigs) {
|
|
112
|
+
for (const [, customConfig] of ccLocalStorage?.customConfigs.values() ?? []) {
|
|
113
|
+
if (customConfig.mapSelectionMode === "SINGLE") {
|
|
114
|
+
customConfig.mapSelectionMode = CustomConfigMapSelectionMode.MULTIPLE
|
|
115
|
+
}
|
|
116
|
+
}
|
|
117
|
+
|
|
118
|
+
ccLocalStorage.version = CUSTOM_CONFIGS_LOCAL_STORAGE_VERSION
|
|
119
|
+
CustomConfigHelper.getStorage().removeItem(CUSTOM_CONFIGS_LOCAL_STORAGE_ELEMENT)
|
|
120
|
+
CustomConfigHelper.getStorage().setItem(CUSTOM_CONFIGS_LOCAL_STORAGE_ELEMENT, JSON.stringify(ccLocalStorage, stateObjectReviver))
|
|
121
|
+
|
|
122
|
+
return ccLocalStorage
|
|
98
123
|
}
|
|
99
124
|
|
|
100
125
|
static addCustomConfigs(newCustomConfigs: CustomConfig[]) {
|
|
@@ -153,6 +178,11 @@ export class CustomConfigHelper {
|
|
|
153
178
|
const importedCustomConfigsFile: CustomConfigsDownloadFile = JSON.parse(content, stateObjectReviver)
|
|
154
179
|
|
|
155
180
|
for (const exportedConfig of importedCustomConfigsFile.customConfigs.values()) {
|
|
181
|
+
// TODO [2022-08-01]: remove condition for SINGLE mode when deadline is reached
|
|
182
|
+
if (exportedConfig.mapSelectionMode === "SINGLE") {
|
|
183
|
+
exportedConfig.mapSelectionMode = CustomConfigMapSelectionMode.MULTIPLE
|
|
184
|
+
}
|
|
185
|
+
|
|
156
186
|
const alreadyExistingConfig = CustomConfigHelper.getCustomConfigSettings(exportedConfig.id)
|
|
157
187
|
|
|
158
188
|
// Check for a duplicate Config by matching checksums
|
|
@@ -1745,7 +1745,7 @@ export const STATE: State = {
|
|
|
1745
1745
|
colorMetric: "mcc",
|
|
1746
1746
|
distributionMetric: "mcc",
|
|
1747
1747
|
edgeMetric: "pairingRate",
|
|
1748
|
-
focusedNodePath: "/root/ParentLeaf",
|
|
1748
|
+
focusedNodePath: ["/root/ParentLeaf"],
|
|
1749
1749
|
searchPattern: "",
|
|
1750
1750
|
margin: 48,
|
|
1751
1751
|
colorRange: {
|
|
@@ -1772,6 +1772,7 @@ export const STATE: State = {
|
|
|
1772
1772
|
cameraTarget: new Vector3(177, 0, 299),
|
|
1773
1773
|
hideFlatBuildings: true,
|
|
1774
1774
|
invertHeight: true,
|
|
1775
|
+
invertArea: false,
|
|
1775
1776
|
dynamicMargin: true,
|
|
1776
1777
|
isWhiteBackground: false,
|
|
1777
1778
|
mapColors: {
|
|
@@ -1818,7 +1819,8 @@ export const STATE: State = {
|
|
|
1818
1819
|
},
|
|
1819
1820
|
appStatus: {
|
|
1820
1821
|
hoveredBuildingPath: null,
|
|
1821
|
-
selectedBuildingId: null
|
|
1822
|
+
selectedBuildingId: null,
|
|
1823
|
+
rightClickedNodeData: null
|
|
1822
1824
|
}
|
|
1823
1825
|
}
|
|
1824
1826
|
|
|
@@ -1837,6 +1839,7 @@ export const DEFAULT_STATE: State = {
|
|
|
1837
1839
|
dynamicMargin: true,
|
|
1838
1840
|
hideFlatBuildings: false,
|
|
1839
1841
|
invertHeight: false,
|
|
1842
|
+
invertArea: false,
|
|
1840
1843
|
isWhiteBackground: false,
|
|
1841
1844
|
mapColors: {
|
|
1842
1845
|
angularGreen: "#00BFA5",
|
|
@@ -1876,7 +1879,7 @@ export const DEFAULT_STATE: State = {
|
|
|
1876
1879
|
dynamicSettings: {
|
|
1877
1880
|
areaMetric: null,
|
|
1878
1881
|
colorMetric: null,
|
|
1879
|
-
focusedNodePath:
|
|
1882
|
+
focusedNodePath: [],
|
|
1880
1883
|
heightMetric: null,
|
|
1881
1884
|
distributionMetric: null,
|
|
1882
1885
|
edgeMetric: null,
|
|
@@ -1901,7 +1904,8 @@ export const DEFAULT_STATE: State = {
|
|
|
1901
1904
|
},
|
|
1902
1905
|
appStatus: {
|
|
1903
1906
|
hoveredBuildingPath: null,
|
|
1904
|
-
selectedBuildingId: null
|
|
1907
|
+
selectedBuildingId: null,
|
|
1908
|
+
rightClickedNodeData: null
|
|
1905
1909
|
}
|
|
1906
1910
|
}
|
|
1907
1911
|
|
|
@@ -97,7 +97,7 @@ export class FileExtensionCalculator {
|
|
|
97
97
|
static hashCode(fileExtension: string) {
|
|
98
98
|
let hash = 0
|
|
99
99
|
for (let index = 0; index < fileExtension.length; index++) {
|
|
100
|
-
hash = fileExtension.
|
|
100
|
+
hash = fileExtension.codePointAt(index) + ((hash << 5) - hash)
|
|
101
101
|
}
|
|
102
102
|
return hash
|
|
103
103
|
}
|