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
|
@@ -13,6 +13,7 @@ import { CustomConfigHelper } from "../../util/customConfigHelper"
|
|
|
13
13
|
import { setState } from "../../state/store/state.actions"
|
|
14
14
|
import { CustomConfig, ExportCustomConfig } from "../../model/customConfig/customConfig.api.model"
|
|
15
15
|
import { ThreeCameraService } from "../codeMap/threeViewer/threeCameraService"
|
|
16
|
+
import { klona } from "klona"
|
|
16
17
|
|
|
17
18
|
describe("CustomConfigsController", () => {
|
|
18
19
|
let customConfigsController: CustomConfigsController
|
|
@@ -133,12 +134,60 @@ describe("CustomConfigsController", () => {
|
|
|
133
134
|
|
|
134
135
|
describe("removeCustomConfig", () => {
|
|
135
136
|
it("should call deleteCustomConfig", () => {
|
|
137
|
+
CustomConfigHelper.getCustomConfigItemGroups = jest.fn().mockReturnValue(klona(CUSTOM_CONFIG_ITEM_GROUPS))
|
|
138
|
+
CustomConfigHelper.getCustomConfigs = jest.fn().mockReturnValue(new Map())
|
|
139
|
+
customConfigsController.initView()
|
|
140
|
+
CustomConfigHelper.deleteCustomConfig = jest.fn()
|
|
141
|
+
const configIdToRemove = "SINGLEfileASampleMap View #1"
|
|
142
|
+
|
|
143
|
+
customConfigsController.removeCustomConfig(configIdToRemove, 0, 0)
|
|
144
|
+
|
|
145
|
+
expect(CustomConfigHelper.deleteCustomConfig).toHaveBeenCalledWith(configIdToRemove)
|
|
146
|
+
})
|
|
147
|
+
|
|
148
|
+
it("should delete element from customConfigItemGroup in dropDownCustomConfigItemGroups when removing a custom config", () => {
|
|
149
|
+
const testDropDownConfigItemGroup = [klona(CUSTOM_CONFIG_ITEM_GROUPS.get("fileAfileBSINGLE"))]
|
|
150
|
+
const configIdToRemove = "SINGLEfileASampleMap View #1"
|
|
151
|
+
|
|
152
|
+
CustomConfigHelper.getCustomConfigItemGroups = jest.fn().mockReturnValue(testDropDownConfigItemGroup)
|
|
153
|
+
CustomConfigHelper.getCustomConfigs = jest.fn().mockReturnValue(new Map())
|
|
154
|
+
customConfigsController.initView()
|
|
155
|
+
CustomConfigHelper.deleteCustomConfig = jest.fn()
|
|
156
|
+
|
|
157
|
+
expect(customConfigsController["_viewModel"].dropDownCustomConfigItemGroups).toHaveLength(1)
|
|
158
|
+
expect(customConfigsController["_viewModel"].dropDownCustomConfigItemGroups[0].customConfigItems).toHaveLength(2)
|
|
159
|
+
expect(customConfigsController["_viewModel"].showNonApplicableButton).toBeTruthy()
|
|
160
|
+
|
|
161
|
+
customConfigsController.removeCustomConfig(configIdToRemove, 0, 0)
|
|
162
|
+
|
|
163
|
+
expect(CustomConfigHelper.deleteCustomConfig).toHaveBeenCalledWith(configIdToRemove)
|
|
164
|
+
expect(customConfigsController["_viewModel"].dropDownCustomConfigItemGroups).toHaveLength(1)
|
|
165
|
+
expect(customConfigsController["_viewModel"].dropDownCustomConfigItemGroups[0].customConfigItems).toHaveLength(1)
|
|
166
|
+
expect(customConfigsController["_viewModel"].showNonApplicableButton).toBeTruthy()
|
|
167
|
+
})
|
|
168
|
+
|
|
169
|
+
it("should delete element from dropDownCustomConfigItemGroups when removing a custom config", () => {
|
|
170
|
+
const testDropDownConfigItemGroup = [klona(CUSTOM_CONFIG_ITEM_GROUPS.get("fileAfileBMultiple"))]
|
|
171
|
+
testDropDownConfigItemGroup[0].customConfigItems.pop()
|
|
172
|
+
const configIdToRemove = "MULTIPLEfileESampleMap View #1"
|
|
173
|
+
|
|
174
|
+
CustomConfigHelper.getCustomConfigItemGroups = jest.fn().mockReturnValue([testDropDownConfigItemGroup])
|
|
175
|
+
CustomConfigHelper.getCustomConfigItemGroups = jest.fn().mockReturnValue(testDropDownConfigItemGroup)
|
|
176
|
+
CustomConfigHelper.getCustomConfigs = jest.fn().mockReturnValue(new Map())
|
|
177
|
+
customConfigsController.initView()
|
|
136
178
|
CustomConfigHelper.deleteCustomConfig = jest.fn()
|
|
137
179
|
|
|
138
|
-
|
|
139
|
-
customConfigsController.
|
|
180
|
+
expect(customConfigsController["_viewModel"].dropDownCustomConfigItemGroups).toHaveLength(1)
|
|
181
|
+
expect(customConfigsController["_viewModel"].dropDownCustomConfigItemGroups[0].customConfigItems).toHaveLength(1)
|
|
182
|
+
expect(customConfigsController["_viewModel"].visibleEntries).toBe(1)
|
|
183
|
+
expect(customConfigsController["_viewModel"].showNonApplicableButton).toBeFalsy()
|
|
184
|
+
|
|
185
|
+
customConfigsController.removeCustomConfig(configIdToRemove, 0, 0)
|
|
140
186
|
|
|
141
187
|
expect(CustomConfigHelper.deleteCustomConfig).toHaveBeenCalledWith(configIdToRemove)
|
|
188
|
+
expect(customConfigsController["_viewModel"].dropDownCustomConfigItemGroups).toHaveLength(0)
|
|
189
|
+
expect(customConfigsController["_viewModel"].visibleEntries).toBe(0)
|
|
190
|
+
expect(customConfigsController["_viewModel"].showNonApplicableButton).toBeFalsy()
|
|
142
191
|
})
|
|
143
192
|
})
|
|
144
193
|
|
|
@@ -214,4 +263,76 @@ describe("CustomConfigsController", () => {
|
|
|
214
263
|
expect(customConfigsController["_viewModel"].hasDownloadableConfigs).toBe(true)
|
|
215
264
|
})
|
|
216
265
|
})
|
|
266
|
+
|
|
267
|
+
describe("collapse and expand non applicable custom configs", () => {
|
|
268
|
+
it("should not show configs that are not applicable by default", () => {
|
|
269
|
+
const testConfigItemGroups = [[...CUSTOM_CONFIG_ITEM_GROUPS][0], [...CUSTOM_CONFIG_ITEM_GROUPS][2]]
|
|
270
|
+
CustomConfigHelper.getCustomConfigItemGroups = jest.fn().mockReturnValue(testConfigItemGroups)
|
|
271
|
+
CustomConfigHelper.getCustomConfigs = jest.fn().mockReturnValue(new Map())
|
|
272
|
+
|
|
273
|
+
customConfigsController.initView()
|
|
274
|
+
|
|
275
|
+
expect(customConfigsController["_viewModel"].dropDownCustomConfigItemGroups).toHaveLength(2)
|
|
276
|
+
expect(customConfigsController["_viewModel"].visibleEntries).toBe(0)
|
|
277
|
+
expect(customConfigsController["_viewModel"].showNonApplicableButton).toBeTruthy()
|
|
278
|
+
})
|
|
279
|
+
|
|
280
|
+
it("should show all configs that are applicable by default", () => {
|
|
281
|
+
CustomConfigHelper.getCustomConfigItemGroups = jest.fn().mockReturnValue(CUSTOM_CONFIG_ITEM_GROUPS)
|
|
282
|
+
CustomConfigHelper.getCustomConfigs = jest.fn().mockReturnValue(new Map())
|
|
283
|
+
|
|
284
|
+
customConfigsController.initView()
|
|
285
|
+
|
|
286
|
+
expect(customConfigsController["_viewModel"].dropDownCustomConfigItemGroups).toHaveLength(3)
|
|
287
|
+
expect(customConfigsController["_viewModel"].visibleEntries).toBe(1)
|
|
288
|
+
expect(customConfigsController["_viewModel"].showNonApplicableButton).toBeTruthy()
|
|
289
|
+
})
|
|
290
|
+
|
|
291
|
+
it("should hide expand button when only applicable custom configs are loaded", () => {
|
|
292
|
+
const testConfigItemGroup = [CUSTOM_CONFIG_ITEM_GROUPS.get("fileAfileBMultiple")]
|
|
293
|
+
CustomConfigHelper.getCustomConfigItemGroups = jest.fn().mockReturnValue(testConfigItemGroup)
|
|
294
|
+
CustomConfigHelper.getCustomConfigs = jest.fn().mockReturnValue(new Map())
|
|
295
|
+
|
|
296
|
+
customConfigsController.initView()
|
|
297
|
+
|
|
298
|
+
expect(customConfigsController["_viewModel"].dropDownCustomConfigItemGroups).toHaveLength(1)
|
|
299
|
+
expect(customConfigsController["_viewModel"].visibleEntries).toBe(1)
|
|
300
|
+
expect(customConfigsController["_viewModel"].showNonApplicableButton).toBeFalsy()
|
|
301
|
+
})
|
|
302
|
+
|
|
303
|
+
it("should show all custom configs when 'show non-applicable CustomConfigs' button is clicked", () => {
|
|
304
|
+
CustomConfigHelper.getCustomConfigItemGroups = jest.fn().mockReturnValue(CUSTOM_CONFIG_ITEM_GROUPS)
|
|
305
|
+
CustomConfigHelper.getCustomConfigs = jest.fn().mockReturnValue(new Map())
|
|
306
|
+
|
|
307
|
+
customConfigsController.initView()
|
|
308
|
+
|
|
309
|
+
expect(customConfigsController["_viewModel"].dropDownCustomConfigItemGroups).toHaveLength(3)
|
|
310
|
+
expect(customConfigsController["_viewModel"].visibleEntries).toBe(1)
|
|
311
|
+
expect(customConfigsController["_viewModel"].showNonApplicableButton).toBeTruthy()
|
|
312
|
+
|
|
313
|
+
customConfigsController.toggleNonApplicableItems()
|
|
314
|
+
|
|
315
|
+
expect(customConfigsController["_viewModel"].dropDownCustomConfigItemGroups).toHaveLength(3)
|
|
316
|
+
expect(customConfigsController["_viewModel"].visibleEntries).toBe(3)
|
|
317
|
+
expect(customConfigsController["_viewModel"].showNonApplicableButton).toBeTruthy()
|
|
318
|
+
})
|
|
319
|
+
|
|
320
|
+
it("should hide all configs that are not applicable when 'show non-applicable CustomConfigs' button is clicked", () => {
|
|
321
|
+
CustomConfigHelper.getCustomConfigItemGroups = jest.fn().mockReturnValue(CUSTOM_CONFIG_ITEM_GROUPS)
|
|
322
|
+
CustomConfigHelper.getCustomConfigs = jest.fn().mockReturnValue(new Map())
|
|
323
|
+
|
|
324
|
+
customConfigsController.initView()
|
|
325
|
+
|
|
326
|
+
expect(customConfigsController["_viewModel"].dropDownCustomConfigItemGroups).toHaveLength(3)
|
|
327
|
+
expect(customConfigsController["_viewModel"].visibleEntries).toBe(1)
|
|
328
|
+
expect(customConfigsController["_viewModel"].showNonApplicableButton).toBeTruthy()
|
|
329
|
+
|
|
330
|
+
customConfigsController.toggleNonApplicableItems()
|
|
331
|
+
customConfigsController.toggleNonApplicableItems()
|
|
332
|
+
|
|
333
|
+
expect(customConfigsController["_viewModel"].dropDownCustomConfigItemGroups).toHaveLength(3)
|
|
334
|
+
expect(customConfigsController["_viewModel"].visibleEntries).toBe(1)
|
|
335
|
+
expect(customConfigsController["_viewModel"].showNonApplicableButton).toBeTruthy()
|
|
336
|
+
})
|
|
337
|
+
})
|
|
217
338
|
})
|
|
@@ -29,13 +29,19 @@ export class CustomConfigsController implements FilesSelectionSubscriber {
|
|
|
29
29
|
private _viewModel: {
|
|
30
30
|
dropDownCustomConfigItemGroups: CustomConfigItemGroup[]
|
|
31
31
|
hasDownloadableConfigs: boolean
|
|
32
|
+
showNonApplicableButton: boolean
|
|
33
|
+
visibleEntries: number
|
|
32
34
|
} = {
|
|
33
35
|
dropDownCustomConfigItemGroups: [],
|
|
34
|
-
hasDownloadableConfigs: false
|
|
36
|
+
hasDownloadableConfigs: false,
|
|
37
|
+
showNonApplicableButton: false,
|
|
38
|
+
visibleEntries: 0
|
|
35
39
|
}
|
|
36
40
|
|
|
37
41
|
private customConfigFileStateConnector: CustomConfigFileStateConnector
|
|
38
42
|
private downloadableConfigs: Map<string, ExportCustomConfig> = new Map()
|
|
43
|
+
private previousEntries
|
|
44
|
+
private applicableEntries = 0
|
|
39
45
|
|
|
40
46
|
constructor(
|
|
41
47
|
private $rootScope: IRootScopeService,
|
|
@@ -57,6 +63,7 @@ export class CustomConfigsController implements FilesSelectionSubscriber {
|
|
|
57
63
|
initView() {
|
|
58
64
|
this.loadCustomConfigs()
|
|
59
65
|
this.preloadDownloadableConfigs()
|
|
66
|
+
this.initVisibleEntries()
|
|
60
67
|
}
|
|
61
68
|
|
|
62
69
|
loadCustomConfigs() {
|
|
@@ -74,8 +81,41 @@ export class CustomConfigsController implements FilesSelectionSubscriber {
|
|
|
74
81
|
CustomConfigHelper.applyCustomConfig(configId, this.storeService, this.threeCameraService, this.threeOrbitControlsService)
|
|
75
82
|
}
|
|
76
83
|
|
|
77
|
-
removeCustomConfig(configId) {
|
|
84
|
+
removeCustomConfig(configId, customConfigItemIndex, dropDownCustomConfigItemGroupIndex) {
|
|
85
|
+
const { dropDownCustomConfigItemGroups } = this._viewModel
|
|
86
|
+
|
|
78
87
|
CustomConfigHelper.deleteCustomConfig(configId)
|
|
88
|
+
dropDownCustomConfigItemGroups[dropDownCustomConfigItemGroupIndex].customConfigItems.splice(customConfigItemIndex, 1)
|
|
89
|
+
|
|
90
|
+
if (dropDownCustomConfigItemGroups[dropDownCustomConfigItemGroupIndex].customConfigItems.length === 0) {
|
|
91
|
+
if (dropDownCustomConfigItemGroups[dropDownCustomConfigItemGroupIndex].hasApplicableItems) {
|
|
92
|
+
this.applicableEntries--
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
dropDownCustomConfigItemGroups.splice(dropDownCustomConfigItemGroupIndex, 1)
|
|
96
|
+
this._viewModel.visibleEntries--
|
|
97
|
+
this.previousEntries--
|
|
98
|
+
this.updateButtonVisibility()
|
|
99
|
+
}
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
private initVisibleEntries() {
|
|
103
|
+
this.applicableEntries = 0
|
|
104
|
+
while (this._viewModel.dropDownCustomConfigItemGroups[this.applicableEntries]?.hasApplicableItems) {
|
|
105
|
+
this.applicableEntries++
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
this._viewModel.visibleEntries = this.applicableEntries
|
|
109
|
+
this.updateButtonVisibility()
|
|
110
|
+
}
|
|
111
|
+
|
|
112
|
+
toggleNonApplicableItems() {
|
|
113
|
+
if (!this.isExpanded()) {
|
|
114
|
+
this.previousEntries = this._viewModel.visibleEntries
|
|
115
|
+
this._viewModel.visibleEntries = this._viewModel.dropDownCustomConfigItemGroups.length
|
|
116
|
+
} else {
|
|
117
|
+
this._viewModel.visibleEntries = this.previousEntries
|
|
118
|
+
}
|
|
79
119
|
}
|
|
80
120
|
|
|
81
121
|
downloadPreloadedCustomConfigs() {
|
|
@@ -109,6 +149,20 @@ export class CustomConfigsController implements FilesSelectionSubscriber {
|
|
|
109
149
|
}
|
|
110
150
|
return false
|
|
111
151
|
}
|
|
152
|
+
|
|
153
|
+
private isExpanded(): boolean {
|
|
154
|
+
return this._viewModel.visibleEntries === this._viewModel.dropDownCustomConfigItemGroups.length
|
|
155
|
+
}
|
|
156
|
+
|
|
157
|
+
private updateButtonVisibility() {
|
|
158
|
+
if (this._viewModel.dropDownCustomConfigItemGroups.length === 0) {
|
|
159
|
+
this._viewModel.showNonApplicableButton = false
|
|
160
|
+
} else if (this.applicableEntries < this._viewModel.dropDownCustomConfigItemGroups.length) {
|
|
161
|
+
this._viewModel.showNonApplicableButton = true
|
|
162
|
+
} else {
|
|
163
|
+
this._viewModel.showNonApplicableButton = false
|
|
164
|
+
}
|
|
165
|
+
}
|
|
112
166
|
}
|
|
113
167
|
|
|
114
168
|
export const customConfigsComponent = {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
<md-dialog class="custom-config-dialog">
|
|
2
2
|
<md-toolbar>
|
|
3
3
|
<div class="md-toolbar-tools">
|
|
4
|
-
<h2>Add Custom
|
|
4
|
+
<h2>Add Custom View</h2>
|
|
5
5
|
</div>
|
|
6
6
|
</md-toolbar>
|
|
7
7
|
|
|
@@ -34,7 +34,7 @@
|
|
|
34
34
|
<md-button
|
|
35
35
|
ng-click="$ctrl.showPurgeConfirmDialog()"
|
|
36
36
|
class="md-warn"
|
|
37
|
-
title="Download old unused
|
|
37
|
+
title="Download old unused Custom Views as a backup file and then delete them in the browser."
|
|
38
38
|
>Download & Purge ...</md-button
|
|
39
39
|
>
|
|
40
40
|
</span>
|
|
@@ -15,7 +15,7 @@
|
|
|
15
15
|
</md-dialog-content>
|
|
16
16
|
|
|
17
17
|
<md-dialog-actions>
|
|
18
|
-
<a href="https://maibornwolff.github.io/codecharta/news/"
|
|
18
|
+
<a class="md-primary" href="https://maibornwolff.github.io/codecharta/news/" target="_blank" rel="noopener noreferrer">Know more</a>
|
|
19
19
|
<md-button ng-click="$ctrl.hide()" class="md-secondary">Close</md-button>
|
|
20
20
|
</md-dialog-actions>
|
|
21
21
|
</md-dialog>
|
|
@@ -33,11 +33,11 @@ describe("DialogChangelogController", () => {
|
|
|
33
33
|
expect(dialogChangelogController["_viewModel"].changes).not.toBeNull()
|
|
34
34
|
expect(dialogChangelogController["_viewModel"].changes[added]).toBeUndefined()
|
|
35
35
|
expect(dialogChangelogController["_viewModel"].changes[fixed]).toBe(
|
|
36
|
-
'<li>3 (<a href="">#3</a>)</li>\n' + '<li>4 (<a href="">#4</a>)</li>\n' + '<li>5 (<a href="">#5</a>)</li>'
|
|
36
|
+
'<li>3 (<a href="">#3</a>)</li><br>\n' + '<li>4 (<a href="">#4</a>)</li><br>\n' + '<li>5 (<a href="">#5</a>)</li><br>'
|
|
37
37
|
)
|
|
38
38
|
expect(dialogChangelogController["_viewModel"].changes[removed]).toBeUndefined()
|
|
39
39
|
expect(dialogChangelogController["_viewModel"].changes[changed]).toBeUndefined()
|
|
40
|
-
expect(dialogChangelogController["_viewModel"].changes[chore]).toBe('<li>6 (<a href="">#6</a>)</li>')
|
|
40
|
+
expect(dialogChangelogController["_viewModel"].changes[chore]).toBe('<li>6 (<a href="">#6</a>)</li><br>')
|
|
41
41
|
})
|
|
42
42
|
|
|
43
43
|
it("should extract the changes from changelog for 2 versions", () => {
|
|
@@ -47,24 +47,24 @@ describe("DialogChangelogController", () => {
|
|
|
47
47
|
|
|
48
48
|
expect(dialogChangelogController["_viewModel"].changes).not.toBeNull()
|
|
49
49
|
expect(dialogChangelogController["_viewModel"].changes[added]).toBe(
|
|
50
|
-
'<li>7 (<a href="">#7</a>)</li>\n' + '<li>8 (<a href="">#8</a>)</li>'
|
|
50
|
+
'<li>7 (<a href="">#7</a>)</li><br>\n' + '<li>8 (<a href="">#8</a>)</li><br>'
|
|
51
51
|
)
|
|
52
52
|
expect(dialogChangelogController["_viewModel"].changes[fixed]).toBe(
|
|
53
|
-
'<li>3 (<a href="">#3</a>)</li>\n' + '<li>4 (<a href="">#4</a>)</li>\n' + '<li>5 (<a href="">#5</a>)</li>'
|
|
53
|
+
'<li>3 (<a href="">#3</a>)</li><br>\n' + '<li>4 (<a href="">#4</a>)</li><br>\n' + '<li>5 (<a href="">#5</a>)</li><br>'
|
|
54
54
|
)
|
|
55
|
-
expect(dialogChangelogController["_viewModel"].changes[chore]).toBe('<li>6 (<a href="">#6</a>)</li>')
|
|
55
|
+
expect(dialogChangelogController["_viewModel"].changes[chore]).toBe('<li>6 (<a href="">#6</a>)</li><br>')
|
|
56
56
|
// Expect nested list to be correctly parsed
|
|
57
57
|
expect(dialogChangelogController["_viewModel"].changes[changed]).toBe(
|
|
58
|
-
"<li>\n" +
|
|
59
|
-
'<p>9 (<a href="">#9</a>)</p>\n' +
|
|
60
|
-
"</li>\n" +
|
|
61
|
-
"<li>\n" +
|
|
62
|
-
'<p>10 (<a href="">#10</a>)</p>\n' +
|
|
63
|
-
"<ul>\n" +
|
|
64
|
-
"<li>10.1</li>\n" +
|
|
65
|
-
"<li>10.2</li>\n" +
|
|
66
|
-
"</ul>\n" +
|
|
67
|
-
"</li>"
|
|
58
|
+
"<li><br>\n" +
|
|
59
|
+
'<p>9 (<a href="">#9</a>)</p><br>\n' +
|
|
60
|
+
"</li><br>\n" +
|
|
61
|
+
"<li><br>\n" +
|
|
62
|
+
'<p>10 (<a href="">#10</a>)</p><br>\n' +
|
|
63
|
+
"<ul><br>\n" +
|
|
64
|
+
"<li>10.1</li><br>\n" +
|
|
65
|
+
"<li>10.2</li><br>\n" +
|
|
66
|
+
"</ul><br>\n" +
|
|
67
|
+
"</li><br>"
|
|
68
68
|
)
|
|
69
69
|
expect(dialogChangelogController["_viewModel"].changes[removed]).toBeUndefined()
|
|
70
70
|
})
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import markdownFile from "../../../../../CHANGELOG.md"
|
|
2
2
|
import packageJson from "../../../../package.json"
|
|
3
|
+
import "./dialog.changelog.component.scss"
|
|
3
4
|
|
|
4
5
|
export class DialogChangelogController {
|
|
5
6
|
private _viewModel: {
|
|
@@ -35,7 +36,7 @@ export class DialogChangelogController {
|
|
|
35
36
|
const start = lineIndex + 2
|
|
36
37
|
const end = this.findEndChangesLine(changelogLines, lineIndex)
|
|
37
38
|
for (const changeLine of changelogLines.slice(start, end)) {
|
|
38
|
-
changelogTypes.push(changeLine)
|
|
39
|
+
changelogTypes.push(`${changeLine}<br>`)
|
|
39
40
|
}
|
|
40
41
|
}
|
|
41
42
|
if (changelogTypes.length > 0) changes[title] = changelogTypes.join("\n")
|
|
@@ -49,7 +49,7 @@ describe("DialogGlobalSettings", () => {
|
|
|
49
49
|
await globalSettingsPageObject.isTreeMapFilesComponentVisible()
|
|
50
50
|
})
|
|
51
51
|
|
|
52
|
-
it("should change the display quality to
|
|
52
|
+
it("should change the display quality to Low Setting", async () => {
|
|
53
53
|
await globalSettingsPageObject.changedDisplayQuality()
|
|
54
54
|
|
|
55
55
|
const layout = await globalSettingsPageObject.getDisplayQuality()
|
|
@@ -35,7 +35,7 @@ export class DialogGlobalSettingsPageObject {
|
|
|
35
35
|
await clickButtonOnPageElement("div.md-dialog-content sharpness-mode-selector-component div md-input-container md-select", {
|
|
36
36
|
visible: true
|
|
37
37
|
})
|
|
38
|
-
await clickButtonOnPageElement('md-select-menu md-content [value="
|
|
38
|
+
await clickButtonOnPageElement('md-select-menu md-content [value="Low"]', { visible: true })
|
|
39
39
|
await page.waitForSelector(".md-select-menu-container.md-active", { visible: false })
|
|
40
40
|
}
|
|
41
41
|
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
import "./dialog.module.ts"
|
|
2
|
+
import { getService, instantiateModule } from "../../../../mocks/ng.mockhelper"
|
|
3
|
+
import { DialogService } from "./dialog.service"
|
|
4
|
+
import { CCFileValidationResult } from "../../util/fileValidator"
|
|
5
|
+
|
|
6
|
+
describe("DialogService", () => {
|
|
7
|
+
let dialogService: DialogService
|
|
8
|
+
let $mdDialog
|
|
9
|
+
|
|
10
|
+
beforeEach(() => {
|
|
11
|
+
restartSystem()
|
|
12
|
+
rebuildController()
|
|
13
|
+
dialogService.showCustomDialog = jest.fn()
|
|
14
|
+
dialogService.showErrorDialog = jest.fn()
|
|
15
|
+
})
|
|
16
|
+
|
|
17
|
+
function restartSystem() {
|
|
18
|
+
instantiateModule("app.codeCharta.ui.dialog")
|
|
19
|
+
$mdDialog = getService("$mdDialog")
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
function rebuildController() {
|
|
23
|
+
dialogService = new DialogService($mdDialog)
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
it("should show AddCustomConfigSettings", function () {
|
|
27
|
+
dialogService.showAddCustomConfigSettings()
|
|
28
|
+
|
|
29
|
+
expect(dialogService.showCustomDialog).toHaveBeenCalled()
|
|
30
|
+
})
|
|
31
|
+
|
|
32
|
+
it("should show DownloadDialog", function () {
|
|
33
|
+
dialogService.showDownloadDialog()
|
|
34
|
+
|
|
35
|
+
expect(dialogService.showCustomDialog).toHaveBeenCalled()
|
|
36
|
+
})
|
|
37
|
+
|
|
38
|
+
it("should show AddScenarioSettings", function () {
|
|
39
|
+
dialogService.showAddScenarioSettings()
|
|
40
|
+
|
|
41
|
+
expect(dialogService.showCustomDialog).toHaveBeenCalled()
|
|
42
|
+
})
|
|
43
|
+
|
|
44
|
+
it("should show GlobalSettingsDialog", function () {
|
|
45
|
+
dialogService.showGlobalSettingsDialog()
|
|
46
|
+
|
|
47
|
+
expect(dialogService.showCustomDialog).toHaveBeenCalled()
|
|
48
|
+
})
|
|
49
|
+
|
|
50
|
+
it("should show ChangelogDialog", function () {
|
|
51
|
+
dialogService.showChangelogDialog()
|
|
52
|
+
|
|
53
|
+
expect(dialogService.showCustomDialog).toHaveBeenCalled()
|
|
54
|
+
})
|
|
55
|
+
|
|
56
|
+
it("should show ValidationDialog", function () {
|
|
57
|
+
const fileValidationResults: CCFileValidationResult[] = [
|
|
58
|
+
{ fileName: "file_1", errors: ["Error"], warnings: [] },
|
|
59
|
+
{ fileName: "file_2", errors: [], warnings: ["Warning"] }
|
|
60
|
+
]
|
|
61
|
+
dialogService.showValidationDialog(fileValidationResults)
|
|
62
|
+
|
|
63
|
+
expect(dialogService.showErrorDialog).toHaveBeenCalledWith(
|
|
64
|
+
`<h2>Errors</h2><p><strong>file_1:</strong> <p><i class="fa fa-exclamation-circle"></i> Error</p></p><h2>Warnings</h2><p><strong>file_2:</strong> <p><i class="fa fa-exclamation-triangle"></i> Warning</p></p>`,
|
|
65
|
+
"Something is wrong with the uploaded file(s)"
|
|
66
|
+
)
|
|
67
|
+
})
|
|
68
|
+
})
|
|
@@ -2,7 +2,7 @@ import { dialogDownloadComponent } from "./dialog.download.component"
|
|
|
2
2
|
import { dialogGlobalSettingsComponent } from "./dialog.globalSettings.component"
|
|
3
3
|
import { addScenarioSettingsComponent } from "./dialog.addScenarioSettings.component"
|
|
4
4
|
import { addCustomConfigSettingsComponent } from "./dialog.addCustomConfigSettings.component"
|
|
5
|
-
import {
|
|
5
|
+
import { CCFileValidationResult } from "../../util/fileValidator"
|
|
6
6
|
import { dialogChangelogComponent } from "./dialog.changelog.component"
|
|
7
7
|
|
|
8
8
|
export class DialogService {
|
|
@@ -38,26 +38,47 @@ export class DialogService {
|
|
|
38
38
|
await this.$mdDialog.show(this.$mdDialog.alert().clickOutsideToClose(true).title(title).htmlContent(message).ok(button))
|
|
39
39
|
}
|
|
40
40
|
|
|
41
|
-
async
|
|
42
|
-
const
|
|
43
|
-
|
|
44
|
-
|
|
41
|
+
async showValidationDialog(fileValidationResults: CCFileValidationResult[]) {
|
|
42
|
+
const htmlMessages = []
|
|
43
|
+
|
|
44
|
+
const filesWithErrors = fileValidationResults.filter(validationResult => {
|
|
45
|
+
return validationResult.errors.length > 0
|
|
46
|
+
})
|
|
47
|
+
if (filesWithErrors.length > 0) {
|
|
48
|
+
htmlMessages.push("<h2>Errors</h2>")
|
|
49
|
+
for (const fileWithErrors of filesWithErrors) {
|
|
50
|
+
const fileErrorMessage = this.buildFileErrorMessage(fileWithErrors)
|
|
51
|
+
htmlMessages.push(fileErrorMessage)
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
const filesWithWarnings = fileValidationResults.filter(validationResult => {
|
|
56
|
+
return validationResult.warnings.length > 0
|
|
57
|
+
})
|
|
58
|
+
if (filesWithWarnings.length > 0) {
|
|
59
|
+
htmlMessages.push("<h2>Warnings</h2>")
|
|
60
|
+
for (const fileWithWarnings of filesWithWarnings) {
|
|
61
|
+
const fileWarningMessage = this.buildFileWarningMessage(fileWithWarnings)
|
|
62
|
+
htmlMessages.push(fileWarningMessage)
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
|
+
await this.showErrorDialog(htmlMessages.join(""), "Something is wrong with the uploaded file(s)")
|
|
45
66
|
}
|
|
46
67
|
|
|
47
|
-
|
|
48
|
-
const warningSymbol = '<i class="fa fa-exclamation-triangle"></i> '
|
|
49
|
-
|
|
50
|
-
const htmlMessage = this.buildHtmlMessage(warningSymbol, validationResult.warning)
|
|
51
|
-
|
|
52
|
-
await this.showErrorDialog(htmlMessage, "Validation Warning")
|
|
53
|
-
}
|
|
54
|
-
|
|
55
|
-
async showValidationErrorDialog(validationResult: CCValidationResult) {
|
|
68
|
+
private buildFileErrorMessage(fileValidationResult) {
|
|
56
69
|
const errorSymbol = '<i class="fa fa-exclamation-circle"></i> '
|
|
70
|
+
return `<p><strong>${fileValidationResult.fileName}:</strong> ${this.buildHtmlMessage(
|
|
71
|
+
errorSymbol,
|
|
72
|
+
fileValidationResult.errors
|
|
73
|
+
)}</p>`
|
|
74
|
+
}
|
|
57
75
|
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
76
|
+
private buildFileWarningMessage(fileValidationResult) {
|
|
77
|
+
const warningSymbol = '<i class="fa fa-exclamation-triangle"></i> '
|
|
78
|
+
return `<p><strong>${fileValidationResult.fileName}:</strong> ${this.buildHtmlMessage(
|
|
79
|
+
warningSymbol,
|
|
80
|
+
fileValidationResult.warnings
|
|
81
|
+
)}</p>`
|
|
61
82
|
}
|
|
62
83
|
|
|
63
84
|
private buildHtmlMessage(symbol: string, validationResult: string[]) {
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { Component, Inject } from "@angular/core"
|
|
2
|
+
import { MAT_DIALOG_DATA } from "@angular/material/dialog"
|
|
3
|
+
|
|
4
|
+
@Component({
|
|
5
|
+
template: require("./errorDialog.component.html")
|
|
6
|
+
})
|
|
7
|
+
export class ErrorDialogComponent {
|
|
8
|
+
constructor(@Inject(MAT_DIALOG_DATA) public data: { title: string; message: string }) {}
|
|
9
|
+
}
|
|
@@ -43,8 +43,9 @@ describe("MapTreeViewLevel", () => {
|
|
|
43
43
|
|
|
44
44
|
it("should not display the amount of incoming and outgoing edges of buildings for the none metric", async () => {
|
|
45
45
|
await searchPanel.toggle()
|
|
46
|
-
await mapTreeViewLevel.openFolder("/root/
|
|
47
|
-
await mapTreeViewLevel.
|
|
46
|
+
await mapTreeViewLevel.openFolder("/root/sample1.cc.json")
|
|
47
|
+
await mapTreeViewLevel.openFolder("/root/sample1.cc.json/ParentLeaf")
|
|
48
|
+
await mapTreeViewLevel.hoverNode("/root/sample1.cc.json/ParentLeaf/smallLeaf.html")
|
|
48
49
|
|
|
49
50
|
expect(await edgeChooser.isEdgeCountAvailable()).toBeFalsy()
|
|
50
51
|
})
|
|
@@ -50,7 +50,7 @@ describe("FileChooser", () => {
|
|
|
50
50
|
|
|
51
51
|
it("should open an invalid file, close the dialog and open a valid file", async () => {
|
|
52
52
|
await fileChooser.openFiles(["./app/codeCharta/assets/empty.png"])
|
|
53
|
-
expect(await dialogError.getMessage()).
|
|
53
|
+
expect(await dialogError.getMessage()).toContain(` ${ERROR_MESSAGES.fileIsInvalid}`)
|
|
54
54
|
|
|
55
55
|
await dialogError.clickOk()
|
|
56
56
|
|
|
@@ -61,7 +61,7 @@ describe("FileChooser", () => {
|
|
|
61
61
|
|
|
62
62
|
it("should open an valid and an invalid file, close the dialog and open a valid file", async () => {
|
|
63
63
|
await fileChooser.openFiles(["./app/codeCharta/assets/empty.png", "./app/codeCharta/assets/sample3.cc.json"])
|
|
64
|
-
expect(await dialogError.getMessage()).
|
|
64
|
+
expect(await dialogError.getMessage()).toContain(` ${ERROR_MESSAGES.fileIsInvalid}`)
|
|
65
65
|
|
|
66
66
|
await dialogError.clickOk()
|
|
67
67
|
|
|
@@ -73,10 +73,9 @@ describe("FileChooser", () => {
|
|
|
73
73
|
it("should not load a map and show error, when loading a map with warning and a map with error", async () => {
|
|
74
74
|
await fileChooser.openFiles(["./app/codeCharta/resources/sample1_with_api_warning.cc.json", "./app/codeCharta/assets/empty.png"])
|
|
75
75
|
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
expect(await dialogError.getMessage()).toEqual(` ${ERROR_MESSAGES.fileIsInvalid}`)
|
|
76
|
+
const dialogMessage = await dialogError.getMessage()
|
|
77
|
+
expect(dialogMessage).toContain(` ${ERROR_MESSAGES.minorApiVersionOutdated} Found: 1.5`)
|
|
78
|
+
expect(dialogMessage).toContain(` ${ERROR_MESSAGES.fileIsInvalid}`)
|
|
80
79
|
await dialogError.clickOk()
|
|
81
80
|
|
|
82
81
|
await fileChooser.openFiles(["./app/codeCharta/assets/sample3.cc.json"])
|