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
|
@@ -1,22 +1,16 @@
|
|
|
1
1
|
import "./filePanel.component.scss"
|
|
2
2
|
import { IRootScopeService } from "angular"
|
|
3
3
|
import { StoreService } from "../../state/store.service"
|
|
4
|
-
import { removeFile, setDeltaByNames, setMultipleByNames
|
|
4
|
+
import { removeFile, setDeltaByNames, setMultipleByNames } from "../../state/store/files/files.actions"
|
|
5
5
|
import { FilesSelectionSubscriber, FilesService } from "../../state/store/files/files.service"
|
|
6
|
-
import {
|
|
7
|
-
fileStatesAvailable,
|
|
8
|
-
getFileNameOf,
|
|
9
|
-
getVisibleFileStates,
|
|
10
|
-
isDeltaState,
|
|
11
|
-
isPartialState,
|
|
12
|
-
isSingleState
|
|
13
|
-
} from "../../model/files/files.helper"
|
|
6
|
+
import { fileStatesAvailable, getFileNameOf, getVisibleFileStates, isDeltaState, isPartialState } from "../../model/files/files.helper"
|
|
14
7
|
import { FileSelectionState, FileState } from "../../model/files/files"
|
|
15
8
|
import { CodeChartaService } from "../../codeCharta.service"
|
|
16
9
|
import { removeRecentFile } from "../../state/store/dynamicSettings/recentFiles/recentFiles.actions"
|
|
10
|
+
import { MapColorsService, MapColorsSubscriber } from "../../state/store/appSettings/mapColors/mapColors.service"
|
|
11
|
+
import { MapColors } from "../../codeCharta.model"
|
|
17
12
|
|
|
18
13
|
interface SelectedFileNames {
|
|
19
|
-
single: string
|
|
20
14
|
delta: {
|
|
21
15
|
reference: string
|
|
22
16
|
comparison: string
|
|
@@ -24,34 +18,29 @@ interface SelectedFileNames {
|
|
|
24
18
|
partial: string[]
|
|
25
19
|
}
|
|
26
20
|
|
|
27
|
-
export class FilePanelController implements FilesSelectionSubscriber {
|
|
21
|
+
export class FilePanelController implements FilesSelectionSubscriber, MapColorsSubscriber {
|
|
28
22
|
private lastRenderState: FileSelectionState
|
|
29
23
|
|
|
30
24
|
private _viewModel: {
|
|
31
|
-
isSingleState: boolean
|
|
32
25
|
isPartialState: boolean
|
|
33
26
|
isDeltaState: boolean
|
|
34
27
|
files: FileState[]
|
|
35
28
|
renderState: FileSelectionState
|
|
36
29
|
selectedFileNames: SelectedFileNames
|
|
37
|
-
pictogramFirstFileColor: string
|
|
38
30
|
pictogramUpperColor: string
|
|
39
31
|
pictogramLowerColor: string
|
|
40
32
|
} = {
|
|
41
|
-
isSingleState: null,
|
|
42
33
|
isPartialState: null,
|
|
43
34
|
isDeltaState: null,
|
|
44
35
|
files: null,
|
|
45
36
|
renderState: null,
|
|
46
37
|
selectedFileNames: {
|
|
47
|
-
single: null,
|
|
48
38
|
delta: {
|
|
49
39
|
reference: null,
|
|
50
40
|
comparison: null
|
|
51
41
|
},
|
|
52
42
|
partial: []
|
|
53
43
|
},
|
|
54
|
-
pictogramFirstFileColor: null,
|
|
55
44
|
pictogramUpperColor: null,
|
|
56
45
|
pictogramLowerColor: null
|
|
57
46
|
}
|
|
@@ -59,41 +48,25 @@ export class FilePanelController implements FilesSelectionSubscriber {
|
|
|
59
48
|
constructor(private $rootScope: IRootScopeService, private storeService: StoreService) {
|
|
60
49
|
"ngInject"
|
|
61
50
|
FilesService.subscribe(this.$rootScope, this)
|
|
51
|
+
MapColorsService.subscribe(this.$rootScope, this)
|
|
62
52
|
}
|
|
63
53
|
|
|
64
|
-
|
|
54
|
+
onMapColorsChanged(mapColors: MapColors) {
|
|
55
|
+
this._viewModel.pictogramUpperColor = mapColors.positiveDelta
|
|
56
|
+
this._viewModel.pictogramLowerColor = mapColors.negativeDelta
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
onRemoveFile(filename, $event): void {
|
|
65
60
|
this.storeService.dispatch(removeFile(filename))
|
|
66
61
|
this.storeService.dispatch(removeRecentFile(filename))
|
|
67
62
|
|
|
68
63
|
const files = this.storeService.getState().files
|
|
69
|
-
|
|
70
|
-
this.singleStateFileRemove(files)
|
|
71
|
-
} else {
|
|
72
|
-
this.partialStateFileRemove(files)
|
|
73
|
-
}
|
|
64
|
+
this.partialStateFileRemove(files)
|
|
74
65
|
|
|
75
66
|
$event.stopPropagation()
|
|
76
67
|
$event.preventDefault()
|
|
77
68
|
}
|
|
78
69
|
|
|
79
|
-
singleStateFileRemove(files: FileState[]) {
|
|
80
|
-
if (!isSingleState(files)) {
|
|
81
|
-
this.selectRemainingFile(files)
|
|
82
|
-
} else {
|
|
83
|
-
this.keepSelection()
|
|
84
|
-
}
|
|
85
|
-
}
|
|
86
|
-
|
|
87
|
-
private keepSelection() {
|
|
88
|
-
const selectedFile = this.storeService.getState().files.find(fileState => fileState.selectedAs === FileSelectionState.Single)
|
|
89
|
-
this.onSingleFileChange(getFileNameOf(selectedFile))
|
|
90
|
-
}
|
|
91
|
-
|
|
92
|
-
private selectRemainingFile(files: FileState[]) {
|
|
93
|
-
const remainingFile = files[files.length - 1]
|
|
94
|
-
this.onSingleFileChange(getFileNameOf(remainingFile))
|
|
95
|
-
}
|
|
96
|
-
|
|
97
70
|
private partialStateFileRemove(files: FileState[]) {
|
|
98
71
|
const selectedFiles = files.filter(x => x.selectedAs === FileSelectionState.Partial).map(fileState => getFileNameOf(fileState))
|
|
99
72
|
|
|
@@ -106,31 +79,20 @@ export class FilePanelController implements FilesSelectionSubscriber {
|
|
|
106
79
|
|
|
107
80
|
onFilesSelectionChanged(files: FileState[]) {
|
|
108
81
|
this._viewModel.files = files
|
|
109
|
-
this._viewModel.isSingleState = isSingleState(files)
|
|
110
82
|
this._viewModel.isPartialState = isPartialState(files)
|
|
111
83
|
this._viewModel.isDeltaState = isDeltaState(files)
|
|
112
|
-
this.setPictogramColor()
|
|
113
84
|
this.updateSelectedFileNamesInViewModel()
|
|
114
85
|
this.lastRenderState = this._viewModel.renderState
|
|
115
86
|
}
|
|
116
87
|
|
|
117
|
-
onPartialSelectionClosed() {
|
|
88
|
+
onPartialSelectionClosed = () => {
|
|
118
89
|
this.updateSelectedFileNamesInViewModel()
|
|
119
90
|
}
|
|
120
91
|
|
|
121
|
-
private setPictogramColor() {
|
|
122
|
-
this._viewModel.pictogramFirstFileColor = "#808080"
|
|
123
|
-
this._viewModel.pictogramUpperColor = this.storeService.getState().appSettings.mapColors.positiveDelta
|
|
124
|
-
this._viewModel.pictogramLowerColor = this.storeService.getState().appSettings.mapColors.negativeDelta
|
|
125
|
-
}
|
|
126
|
-
|
|
127
92
|
private updateSelectedFileNamesInViewModel() {
|
|
128
93
|
const visibleFileStates = getVisibleFileStates(this._viewModel.files)
|
|
129
94
|
|
|
130
|
-
if (this._viewModel.
|
|
131
|
-
this._viewModel.renderState = FileSelectionState.Single
|
|
132
|
-
this._viewModel.selectedFileNames.single = visibleFileStates[0].file.fileMeta.fileName
|
|
133
|
-
} else if (this._viewModel.isDeltaState) {
|
|
95
|
+
if (this._viewModel.isDeltaState) {
|
|
134
96
|
this._viewModel.renderState = FileSelectionState.Comparison
|
|
135
97
|
|
|
136
98
|
let reference = visibleFileStates[0].file.fileMeta.fileName
|
|
@@ -148,26 +110,24 @@ export class FilePanelController implements FilesSelectionSubscriber {
|
|
|
148
110
|
}
|
|
149
111
|
}
|
|
150
112
|
|
|
151
|
-
|
|
152
|
-
this.
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
onDeltaReferenceFileChange(referenceFileName: string) {
|
|
158
|
-
const rootName = this._viewModel.files.find(x => x.file.fileMeta.fileName === referenceFileName).file.map.name
|
|
113
|
+
onDeltaReferenceFileChange = (referenceFileName: string) => {
|
|
114
|
+
const rootFile = this._viewModel.files.find(x => x.file.fileMeta.fileName === referenceFileName)
|
|
115
|
+
if (!rootFile) {
|
|
116
|
+
return
|
|
117
|
+
}
|
|
118
|
+
const rootName = rootFile.file.map.name
|
|
159
119
|
CodeChartaService.updateRootData(rootName)
|
|
160
120
|
this.storeService.dispatch(setDeltaByNames(referenceFileName, this._viewModel.selectedFileNames.delta.comparison))
|
|
161
121
|
}
|
|
162
122
|
|
|
163
|
-
onDeltaComparisonFileChange(comparisonFileName: string) {
|
|
123
|
+
onDeltaComparisonFileChange = (comparisonFileName: string) => {
|
|
164
124
|
const referenceFileName = this._viewModel.selectedFileNames.delta.reference
|
|
165
125
|
const rootName = this._viewModel.files.find(x => x.file.fileMeta.fileName === referenceFileName).file.map.name
|
|
166
126
|
CodeChartaService.updateRootData(rootName)
|
|
167
127
|
this.storeService.dispatch(setDeltaByNames(referenceFileName, comparisonFileName))
|
|
168
128
|
}
|
|
169
129
|
|
|
170
|
-
onPartialFilesChange(partialFileNames: string[]) {
|
|
130
|
+
onPartialFilesChange = (partialFileNames: string[]) => {
|
|
171
131
|
if (partialFileNames.length > 0) {
|
|
172
132
|
this.storeService.dispatch(setMultipleByNames(partialFileNames))
|
|
173
133
|
} else {
|
|
@@ -175,26 +135,17 @@ export class FilePanelController implements FilesSelectionSubscriber {
|
|
|
175
135
|
}
|
|
176
136
|
}
|
|
177
137
|
|
|
178
|
-
|
|
179
|
-
this._viewModel.selectedFileNames.single = this.getLastVisibleFileName()
|
|
180
|
-
this.onSingleFileChange(this._viewModel.selectedFileNames.single)
|
|
181
|
-
}
|
|
182
|
-
|
|
183
|
-
onPartialStateSelected() {
|
|
184
|
-
this.selectRecentPartialFiles()
|
|
185
|
-
}
|
|
186
|
-
|
|
187
|
-
onDeltaStateSelected() {
|
|
138
|
+
onDeltaStateSelected = () => {
|
|
188
139
|
this._viewModel.selectedFileNames.delta.reference = this.getLastVisibleFileName()
|
|
189
140
|
this.onDeltaComparisonFileChange(null)
|
|
190
141
|
}
|
|
191
142
|
|
|
192
|
-
selectAllPartialFiles() {
|
|
143
|
+
selectAllPartialFiles = () => {
|
|
193
144
|
const allFileNames = this._viewModel.files.map(x => x.file.fileMeta.fileName)
|
|
194
145
|
this.onPartialFilesChange(allFileNames)
|
|
195
146
|
}
|
|
196
147
|
|
|
197
|
-
selectRecentPartialFiles() {
|
|
148
|
+
selectRecentPartialFiles = () => {
|
|
198
149
|
const recentFileNames = this.storeService.getState().dynamicSettings.recentFiles
|
|
199
150
|
if (recentFileNames.length > 0) {
|
|
200
151
|
this.onPartialFilesChange(recentFileNames)
|
|
@@ -203,11 +154,11 @@ export class FilePanelController implements FilesSelectionSubscriber {
|
|
|
203
154
|
}
|
|
204
155
|
}
|
|
205
156
|
|
|
206
|
-
selectZeroPartialFiles() {
|
|
157
|
+
selectZeroPartialFiles = () => {
|
|
207
158
|
this.onPartialFilesChange([])
|
|
208
159
|
}
|
|
209
160
|
|
|
210
|
-
invertPartialFileSelection() {
|
|
161
|
+
invertPartialFileSelection = () => {
|
|
211
162
|
const invertedFileNames: string[] = []
|
|
212
163
|
const partialFileNames = new Set(this._viewModel.selectedFileNames.partial)
|
|
213
164
|
|
|
@@ -225,9 +176,6 @@ export class FilePanelController implements FilesSelectionSubscriber {
|
|
|
225
176
|
}
|
|
226
177
|
|
|
227
178
|
private getLastVisibleFileName() {
|
|
228
|
-
if (this.lastRenderState === FileSelectionState.Single) {
|
|
229
|
-
return this._viewModel.selectedFileNames.single
|
|
230
|
-
}
|
|
231
179
|
if (this.lastRenderState === FileSelectionState.Partial) {
|
|
232
180
|
const visibleFileStates = getVisibleFileStates(this._viewModel.files)
|
|
233
181
|
if (fileStatesAvailable(this._viewModel.files)) {
|
|
@@ -242,7 +190,7 @@ export class FilePanelController implements FilesSelectionSubscriber {
|
|
|
242
190
|
}
|
|
243
191
|
|
|
244
192
|
export const filePanelComponent = {
|
|
245
|
-
selector: "
|
|
193
|
+
selector: "ccFilePanel",
|
|
246
194
|
template: require("./filePanel.component.html"),
|
|
247
195
|
controller: FilePanelController
|
|
248
196
|
}
|
|
@@ -1,6 +1,18 @@
|
|
|
1
1
|
import angular from "angular"
|
|
2
|
+
|
|
2
3
|
import "../../state/state.module"
|
|
4
|
+
|
|
3
5
|
import "../dialog/dialog.module"
|
|
6
|
+
|
|
4
7
|
import { filePanelComponent } from "./filePanel.component"
|
|
8
|
+
import { downgradeComponent } from "@angular/upgrade/static"
|
|
9
|
+
import { FilePanelFileSelectorComponent } from "./filePanelFileSelector/filePanelFileSelector.component"
|
|
10
|
+
import { FilePanelStateButtonsComponent } from "./filePanelStateButtons/filePanelStateButtons.component"
|
|
11
|
+
import { FilePanelDeltaSelectorComponent } from "./filePanelDeltaSelector/filePanelDeltaSelector.component"
|
|
5
12
|
|
|
6
|
-
angular
|
|
13
|
+
angular
|
|
14
|
+
.module("app.codeCharta.ui.filePanel", ["app.codeCharta.state"])
|
|
15
|
+
.component(filePanelComponent.selector, filePanelComponent)
|
|
16
|
+
.directive("ccFilePanelFileSelector", downgradeComponent({ component: FilePanelFileSelectorComponent }))
|
|
17
|
+
.directive("ccFilePanelStateButtons", downgradeComponent({ component: FilePanelStateButtonsComponent }))
|
|
18
|
+
.directive("ccFilePanelDeltaSelector", downgradeComponent({ component: FilePanelDeltaSelectorComponent }))
|
|
@@ -2,32 +2,14 @@ import { clickButtonOnPageElement } from "../../../puppeteer.helper"
|
|
|
2
2
|
|
|
3
3
|
export class FilePanelPageObject {
|
|
4
4
|
async getSelectedName() {
|
|
5
|
-
await page.waitForSelector("file-panel
|
|
6
|
-
return page.$eval("file-panel
|
|
7
|
-
}
|
|
8
|
-
|
|
9
|
-
async getSelectedChangedName(oldName: string) {
|
|
10
|
-
await page.waitForSelector("file-panel-component md-select .md-text")
|
|
11
|
-
await this.waitUntilNameChange(oldName)
|
|
12
|
-
return page.$eval("file-panel-component md-select .md-text", element => element["innerText"])
|
|
13
|
-
}
|
|
14
|
-
|
|
15
|
-
private async waitUntilNameChange(oldName: string) {
|
|
16
|
-
await page.waitForFunction(
|
|
17
|
-
names => {
|
|
18
|
-
return document.querySelector(`file-panel-component md-select .md-text md-truncate`).textContent !== names
|
|
19
|
-
},
|
|
20
|
-
{},
|
|
21
|
-
oldName
|
|
22
|
-
)
|
|
5
|
+
await page.waitForSelector("cc-file-panel cc-file-panel-file-selector .mat-select-value-text span")
|
|
6
|
+
return page.$eval("cc-file-panel cc-file-panel-file-selector .mat-select-value-text span", element => element["innerText"])
|
|
23
7
|
}
|
|
24
8
|
|
|
25
9
|
async getAllNames() {
|
|
26
|
-
await clickButtonOnPageElement("file-panel-
|
|
27
|
-
await page.waitForSelector(".
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
return content.split("\n")
|
|
10
|
+
await clickButtonOnPageElement("cc-file-panel cc-file-panel-file-selector mat-select")
|
|
11
|
+
await page.waitForSelector(".mat-select-panel")
|
|
12
|
+
const content = await page.$$eval(".mat-select-panel .mat-option-text", element => element.map(item => item["innerText"]))
|
|
13
|
+
return content
|
|
32
14
|
}
|
|
33
15
|
}
|
package/app/codeCharta/ui/filePanel/filePanelDeltaSelector/filePanelDeltaSelector.component.html
ADDED
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
<mat-select
|
|
2
|
+
class="delta-select"
|
|
3
|
+
placeholder="select reference file"
|
|
4
|
+
[(ngModel)]="selectedDeltaReferenceFile"
|
|
5
|
+
(selectionChange)="handleDeltaReferenceFileChange(selectedDeltaReferenceFile)"
|
|
6
|
+
>
|
|
7
|
+
<mat-option *ngFor="let file of files" [value]="file.file.fileMeta.fileName">
|
|
8
|
+
{{ file.file.fileMeta.fileName }}
|
|
9
|
+
</mat-option>
|
|
10
|
+
</mat-select>
|
|
11
|
+
|
|
12
|
+
<div class="pictogram" [style.background]="'linear-gradient(' + pictogramUpperColor + ' 50%, ' + pictogramLowerColor + ' 50%)'"></div>
|
|
13
|
+
|
|
14
|
+
<mat-select
|
|
15
|
+
class="delta-select"
|
|
16
|
+
placeholder="select comparison file"
|
|
17
|
+
[(ngModel)]="selectedDeltaComparisonFile"
|
|
18
|
+
(selectionChange)="handleDeltaComparisonFileChange(selectedDeltaComparisonFile)"
|
|
19
|
+
>
|
|
20
|
+
<mat-option *ngFor="let file of files" [value]="file.file.fileMeta.fileName">
|
|
21
|
+
{{ file.file.fileMeta.fileName }}
|
|
22
|
+
</mat-option>
|
|
23
|
+
</mat-select>
|
package/app/codeCharta/ui/filePanel/filePanelDeltaSelector/filePanelDeltaSelector.component.ts
ADDED
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { Component, Input } from "@angular/core"
|
|
2
|
+
import { FileState } from "../../../model/files/files"
|
|
3
|
+
|
|
4
|
+
@Component({
|
|
5
|
+
selector: "cc-file-panel-delta-selector",
|
|
6
|
+
template: require("./filePanelDeltaSelector.component.html")
|
|
7
|
+
})
|
|
8
|
+
export class FilePanelDeltaSelectorComponent {
|
|
9
|
+
@Input() files: FileState[]
|
|
10
|
+
@Input() pictogramFirstColor: string
|
|
11
|
+
@Input() pictogramUpperColor: string
|
|
12
|
+
@Input() pictogramLowerColor: string
|
|
13
|
+
@Input() handleDeltaReferenceFileChange: (referenceFileName: string) => void
|
|
14
|
+
@Input() handleDeltaComparisonFileChange: (comparisonFileName: string) => void
|
|
15
|
+
|
|
16
|
+
selectedDeltaReferenceFile: string
|
|
17
|
+
selectedDeltaComparisonFile: string
|
|
18
|
+
}
|
package/app/codeCharta/ui/filePanel/filePanelFileSelector/filePanelFileSelector.component.html
ADDED
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
<mat-select
|
|
2
|
+
class="standard-select"
|
|
3
|
+
[(ngModel)]="selectedFileNames"
|
|
4
|
+
(selectionChange)="handleSelectedFilesChanged(selectedFileNames)"
|
|
5
|
+
name="recentFiles"
|
|
6
|
+
[placeholder]="selectedFileNames"
|
|
7
|
+
multiple
|
|
8
|
+
(closed)="handleOnSelectionClosed()"
|
|
9
|
+
>
|
|
10
|
+
<div class="actions">
|
|
11
|
+
<button mat-button (click)="handleSelectAllPartialFiles()">All</button>
|
|
12
|
+
<button mat-button (click)="handleSelectZeroPartialFiles()">None</button>
|
|
13
|
+
<button mat-button (click)="handleInvertSelectedPartialFiles()">Invert</button>
|
|
14
|
+
</div>
|
|
15
|
+
<mat-option *ngFor="let file of files" [value]="file.file.fileMeta.fileName">
|
|
16
|
+
{{ file.file.fileMeta.fileName }}
|
|
17
|
+
</mat-option>
|
|
18
|
+
</mat-select>
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { Component, Input } from "@angular/core"
|
|
2
|
+
import { FileState } from "../../../model/files/files"
|
|
3
|
+
|
|
4
|
+
@Component({
|
|
5
|
+
selector: "cc-file-panel-file-selector",
|
|
6
|
+
template: require("./filePanelFileSelector.component.html")
|
|
7
|
+
})
|
|
8
|
+
export class FilePanelFileSelectorComponent {
|
|
9
|
+
@Input() files: FileState[]
|
|
10
|
+
@Input() selectedFileNames: string[]
|
|
11
|
+
@Input() handleSelectedFilesChanged: (selectedFileNames: string[]) => void
|
|
12
|
+
@Input() handleSelectAllPartialFiles: () => void
|
|
13
|
+
@Input() handleSelectZeroPartialFiles: () => void
|
|
14
|
+
@Input() handleInvertSelectedPartialFiles: () => void
|
|
15
|
+
@Input() handleOnSelectionClosed: () => void
|
|
16
|
+
}
|
package/app/codeCharta/ui/filePanel/filePanelStateButtons/filePanelStateButtons.component.html
ADDED
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
<div class="mode-chooser">
|
|
2
|
+
<button
|
|
3
|
+
mat-button
|
|
4
|
+
class="state-selector-button mode-selector left"
|
|
5
|
+
(click)="handleStandardButtonClicked()"
|
|
6
|
+
[class.current]="!isDeltaState"
|
|
7
|
+
>
|
|
8
|
+
<span class="text">Standard</span>
|
|
9
|
+
</button>
|
|
10
|
+
<button
|
|
11
|
+
mat-button
|
|
12
|
+
class="state-selector-button mode-selector right"
|
|
13
|
+
(click)="handleDeltaButtonClicked()"
|
|
14
|
+
[class.current]="isDeltaState"
|
|
15
|
+
>
|
|
16
|
+
<span class="text">Delta</span>
|
|
17
|
+
</button>
|
|
18
|
+
</div>
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { Component, Input } from "@angular/core"
|
|
2
|
+
|
|
3
|
+
@Component({
|
|
4
|
+
selector: "cc-file-panel-state-buttons",
|
|
5
|
+
template: require("./filePanelStateButtons.component.html")
|
|
6
|
+
})
|
|
7
|
+
export class FilePanelStateButtonsComponent {
|
|
8
|
+
@Input() isDeltaState: boolean
|
|
9
|
+
@Input() handleStandardButtonClicked: () => void
|
|
10
|
+
@Input() handleDeltaButtonClicked: () => void
|
|
11
|
+
}
|
|
@@ -1,15 +1,23 @@
|
|
|
1
|
-
<
|
|
1
|
+
<cc-color-picker
|
|
2
|
+
[hexColor]="hexColor"
|
|
3
|
+
(onColorChange)="handleColorChange($event)"
|
|
4
|
+
[openXPosition]="'before'"
|
|
5
|
+
[triggerTemplate]="colorPickerTriggerTemplate"
|
|
6
|
+
></cc-color-picker>
|
|
2
7
|
|
|
3
|
-
<
|
|
4
|
-
<div class="cc-color-
|
|
5
|
-
<
|
|
6
|
-
|
|
8
|
+
<ng-template #colorPickerTriggerTemplate let-isOpen="isOpen" let-isHovered="isHovered">
|
|
9
|
+
<div class="cc-labelled-color-picker-container">
|
|
10
|
+
<div class="cc-color-swatch-container">
|
|
11
|
+
<span class="cc-color-swatch" [style.background-color]="hexColor"></span>
|
|
12
|
+
<span
|
|
13
|
+
class="cc-color-brush fa fa-paint-brush"
|
|
14
|
+
[style.color]="hexColor | readableColorForBackground"
|
|
15
|
+
[style.opacity]="isHovered || isOpen ? '1' : '0'"
|
|
16
|
+
>
|
|
17
|
+
</span>
|
|
18
|
+
</div>
|
|
19
|
+
<div>
|
|
20
|
+
<span *ngFor="let label of labels"> {{ label }} <br *ngIf="!last" /></span>
|
|
21
|
+
</div>
|
|
7
22
|
</div>
|
|
8
|
-
|
|
9
|
-
<span *ngFor="let label of labels"> {{ label }} <br *ngIf="!last" /></span>
|
|
10
|
-
</div>
|
|
11
|
-
</div>
|
|
12
|
-
|
|
13
|
-
<mat-menu #menu="matMenu" xPosition="before" [hasBackdrop]="false" class="cc-color-picker-menu">
|
|
14
|
-
<cc-color-picker [hexColor]="hexColor" (onColorChange)="handleColorChange($event)"></cc-color-picker>
|
|
15
|
-
</mat-menu>
|
|
23
|
+
</ng-template>
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { EventEmitter } from "@angular/core"
|
|
2
2
|
import { TestBed } from "@angular/core/testing"
|
|
3
|
-
import { render, fireEvent, screen, waitForElementToBeRemoved
|
|
3
|
+
import { render, fireEvent, screen, waitForElementToBeRemoved } from "@testing-library/angular"
|
|
4
4
|
|
|
5
5
|
import { LabelledColorPickerComponent } from "./labelledColorPicker.component"
|
|
6
6
|
import { LabelledColorPickerModule } from "./labelledColorPicker.module"
|
|
@@ -15,7 +15,7 @@ describe("labelledColorPicker", () => {
|
|
|
15
15
|
})
|
|
16
16
|
})
|
|
17
17
|
|
|
18
|
-
it("should
|
|
18
|
+
it("should display label and handle brush visibility", async () => {
|
|
19
19
|
const { container } = await render(LabelledColorPickerComponent, {
|
|
20
20
|
excludeComponentDeclaration: true,
|
|
21
21
|
componentProperties: {
|
|
@@ -24,41 +24,28 @@ describe("labelledColorPicker", () => {
|
|
|
24
24
|
onColorChange: { emit: handleColorChange } as unknown as EventEmitter<string>
|
|
25
25
|
}
|
|
26
26
|
})
|
|
27
|
+
const colorPickerTrigger = container.querySelector("cc-color-picker")
|
|
27
28
|
|
|
28
29
|
expect(container.textContent).toMatch("pretty color")
|
|
29
30
|
|
|
30
|
-
fireEvent.
|
|
31
|
-
|
|
31
|
+
fireEvent.mouseEnter(colorPickerTrigger)
|
|
32
|
+
expectBrushVisibility(container, true)
|
|
33
|
+
|
|
34
|
+
fireEvent.click(colorPickerTrigger)
|
|
35
|
+
const colorPicker = screen.getByRole("colorpicker")
|
|
32
36
|
expectBrushVisibility(container, true)
|
|
33
37
|
|
|
34
38
|
// @ts-ignore
|
|
35
39
|
ng.probe(colorPicker).componentInstance.onChangeComplete.emit({ $event: {}, color: { hex: "#ffffff" } })
|
|
36
40
|
expect(handleColorChange).toHaveBeenCalledWith("#ffffff")
|
|
37
41
|
|
|
38
|
-
fireEvent.
|
|
42
|
+
fireEvent.mouseLeave(colorPickerTrigger)
|
|
43
|
+
expectBrushVisibility(container, true) // still true as color picker is still open
|
|
39
44
|
|
|
45
|
+
fireEvent.click(document)
|
|
40
46
|
await waitForElementToBeRemoved(screen.getByRole("colorpicker"))
|
|
41
47
|
expectBrushVisibility(container, false)
|
|
42
48
|
})
|
|
43
|
-
|
|
44
|
-
it("should add/remove brush on mouseenter/mouseleave", async () => {
|
|
45
|
-
const { container } = await render(LabelledColorPickerComponent, {
|
|
46
|
-
excludeComponentDeclaration: true,
|
|
47
|
-
componentProperties: {
|
|
48
|
-
hexColor: "#000000",
|
|
49
|
-
labels: ["pretty color"],
|
|
50
|
-
onColorChange: { emit: handleColorChange } as unknown as EventEmitter<string>
|
|
51
|
-
}
|
|
52
|
-
})
|
|
53
|
-
|
|
54
|
-
expectBrushVisibility(container, false)
|
|
55
|
-
|
|
56
|
-
fireEvent.mouseEnter(container)
|
|
57
|
-
expectBrushVisibility(container, true)
|
|
58
|
-
|
|
59
|
-
fireEvent.mouseLeave(container)
|
|
60
|
-
expectBrushVisibility(container, false)
|
|
61
|
-
})
|
|
62
49
|
})
|
|
63
50
|
|
|
64
51
|
function expectBrushVisibility(container: Element, isVisible: boolean) {
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import "./labelledColorPicker.component.scss"
|
|
2
|
-
import { Component,
|
|
3
|
-
import { MatMenuTrigger } from "@angular/material/menu"
|
|
2
|
+
import { Component, EventEmitter, Input, Output } from "@angular/core"
|
|
4
3
|
|
|
5
4
|
@Component({
|
|
6
5
|
selector: "cc-labelled-color-picker",
|
|
@@ -12,44 +11,6 @@ export class LabelledColorPickerComponent {
|
|
|
12
11
|
|
|
13
12
|
@Output() onColorChange = new EventEmitter<string>()
|
|
14
13
|
|
|
15
|
-
@ViewChild("colorPickerMenuTrigger") colorPickerMenuTrigger: MatMenuTrigger
|
|
16
|
-
@ViewChild("brush") brush: ElementRef
|
|
17
|
-
|
|
18
|
-
private isClickInside = false
|
|
19
|
-
|
|
20
|
-
@HostListener("mouseenter") onMouseEnter() {
|
|
21
|
-
this.brush.nativeElement.style.opacity = "1"
|
|
22
|
-
}
|
|
23
|
-
|
|
24
|
-
@HostListener("mouseleave") onMouseLeave() {
|
|
25
|
-
if (!this.colorPickerMenuTrigger.menuOpen) this.brush.nativeElement.style.opacity = "0"
|
|
26
|
-
}
|
|
27
|
-
|
|
28
|
-
@HostListener("click")
|
|
29
|
-
onClick() {
|
|
30
|
-
this.isClickInside = true
|
|
31
|
-
|
|
32
|
-
const menuOpenedSubscription = this.colorPickerMenuTrigger.menuOpened.subscribe(() => {
|
|
33
|
-
this.brush.nativeElement.style.opacity = "1"
|
|
34
|
-
menuOpenedSubscription.unsubscribe()
|
|
35
|
-
})
|
|
36
|
-
const menuClosedSubscription = this.colorPickerMenuTrigger.menuClosed.subscribe(() => {
|
|
37
|
-
this.brush.nativeElement.style.opacity = "0"
|
|
38
|
-
menuClosedSubscription.unsubscribe()
|
|
39
|
-
})
|
|
40
|
-
|
|
41
|
-
this.colorPickerMenuTrigger.openMenu()
|
|
42
|
-
}
|
|
43
|
-
|
|
44
|
-
@HostListener("document:click")
|
|
45
|
-
handleDocumentClick() {
|
|
46
|
-
if (!this.isClickInside && this.colorPickerMenuTrigger && this.colorPickerMenuTrigger.menuOpen) {
|
|
47
|
-
this.colorPickerMenuTrigger.closeMenu()
|
|
48
|
-
}
|
|
49
|
-
|
|
50
|
-
this.isClickInside = false
|
|
51
|
-
}
|
|
52
|
-
|
|
53
14
|
handleColorChange(hexColor: string) {
|
|
54
15
|
this.onColorChange.emit(hexColor)
|
|
55
16
|
}
|
|
@@ -1,13 +1,12 @@
|
|
|
1
1
|
import { CommonModule } from "@angular/common"
|
|
2
2
|
import { NgModule } from "@angular/core"
|
|
3
3
|
|
|
4
|
-
import { MaterialModule } from "../../../material/material.module"
|
|
5
4
|
import { ColorPickerModule } from "../colorPicker/colorPicker.module"
|
|
6
5
|
import { LabelledColorPickerComponent } from "./labelledColorPicker.component"
|
|
7
6
|
import { ReadableColorForBackgroundPipe } from "./readableColorForBackground.pipe"
|
|
8
7
|
|
|
9
8
|
@NgModule({
|
|
10
|
-
imports: [CommonModule, ColorPickerModule
|
|
9
|
+
imports: [CommonModule, ColorPickerModule],
|
|
11
10
|
declarations: [LabelledColorPickerComponent, ReadableColorForBackgroundPipe],
|
|
12
11
|
exports: [LabelledColorPickerComponent]
|
|
13
12
|
})
|
package/app/codeCharta/ui/legendPanel/legendMarkedPackages/legendMarkedPackages.component.ts
CHANGED
|
@@ -5,7 +5,7 @@ import { KeyValue } from "@angular/common"
|
|
|
5
5
|
|
|
6
6
|
import { Store } from "../../../state/angular-redux/store"
|
|
7
7
|
import { legendMarkedPackagesSelector, MarkedPackagesMap } from "./legendMarkedPackages.selector"
|
|
8
|
-
import {
|
|
8
|
+
import { markPackages } from "../../../state/store/fileSettings/markedPackages/markedPackages.actions"
|
|
9
9
|
|
|
10
10
|
type MarkedPackagesMapKeyValue = KeyValue<keyof MarkedPackagesMap, MarkedPackagesMap[keyof MarkedPackagesMap]>
|
|
11
11
|
|
|
@@ -24,7 +24,7 @@ export class LegendMarkedPackagesComponent {
|
|
|
24
24
|
|
|
25
25
|
handleColorChange(newHexColor: string, paths: string[]) {
|
|
26
26
|
this.store.dispatch(
|
|
27
|
-
|
|
27
|
+
markPackages(
|
|
28
28
|
paths.map(path => ({
|
|
29
29
|
color: newHexColor,
|
|
30
30
|
path
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { goto } from "../../../puppeteer.helper"
|
|
2
2
|
import { MapTreeViewLevelPageObject } from "./mapTreeView.level.po"
|
|
3
3
|
import { SearchPanelModeSelectorPageObject } from "../searchPanelModeSelector/searchPanelModeSelector.po"
|
|
4
|
-
import { NodeContextMenuPageObject } from "
|
|
4
|
+
import { NodeContextMenuPageObject } from "../../state/effects/nodeContextMenu/nodeContextMenu.po"
|
|
5
5
|
|
|
6
6
|
describe("MapTreeViewLevel", () => {
|
|
7
7
|
let mapTreeViewLevel: MapTreeViewLevelPageObject
|
|
@@ -18,10 +18,11 @@ describe("MapTreeViewLevel", () => {
|
|
|
18
18
|
|
|
19
19
|
describe("Blacklist", () => {
|
|
20
20
|
it("excluding a building should exclude it from the tree-view as well", async () => {
|
|
21
|
-
const filePath = "/root/ParentLeaf/smallLeaf.html"
|
|
21
|
+
const filePath = "/root/sample1.cc.json/ParentLeaf/smallLeaf.html"
|
|
22
22
|
|
|
23
23
|
await searchPanelModeSelector.toggleTreeView()
|
|
24
|
-
await mapTreeViewLevel.openFolder("/root/
|
|
24
|
+
await mapTreeViewLevel.openFolder("/root/sample1.cc.json")
|
|
25
|
+
await mapTreeViewLevel.openFolder("/root/sample1.cc.json/ParentLeaf")
|
|
25
26
|
await mapTreeViewLevel.openContextMenu(filePath)
|
|
26
27
|
await nodeContextMenu.exclude()
|
|
27
28
|
|
|
@@ -31,12 +32,13 @@ describe("MapTreeViewLevel", () => {
|
|
|
31
32
|
|
|
32
33
|
describe("NodeContextMenu", () => {
|
|
33
34
|
it("NodeContextMenu path should remain marked when hovering over another mapTreeView Element", async () => {
|
|
34
|
-
const filePath = "/root/ParentLeaf/smallLeaf.html"
|
|
35
|
+
const filePath = "/root/sample1.cc.json/ParentLeaf/smallLeaf.html"
|
|
35
36
|
|
|
36
37
|
await searchPanelModeSelector.toggleTreeView()
|
|
37
|
-
await mapTreeViewLevel.openFolder("/root/
|
|
38
|
+
await mapTreeViewLevel.openFolder("/root/sample1.cc.json")
|
|
39
|
+
await mapTreeViewLevel.openFolder("/root/sample1.cc.json/ParentLeaf")
|
|
38
40
|
await mapTreeViewLevel.openContextMenu(filePath)
|
|
39
|
-
await mapTreeViewLevel.hoverNode("/root/sample1OnlyLeaf.scss")
|
|
41
|
+
await mapTreeViewLevel.hoverNode("/root/sample1.cc.json/sample1OnlyLeaf.scss")
|
|
40
42
|
|
|
41
43
|
expect(await mapTreeViewLevel.isNodeMarked(filePath)).toBeTruthy()
|
|
42
44
|
})
|
|
@@ -3,7 +3,7 @@ import { clickButtonOnPageElement } from "../../../puppeteer.helper"
|
|
|
3
3
|
export class MapTreeViewLevelPageObject {
|
|
4
4
|
async openContextMenu(path: string) {
|
|
5
5
|
await clickButtonOnPageElement(`[id='${path}']`, { button: "right" })
|
|
6
|
-
await page.waitForSelector("
|
|
6
|
+
await page.waitForSelector("#codemap-context-menu", { visible: true })
|
|
7
7
|
await page.waitForSelector(".tree-element-label.marked")
|
|
8
8
|
}
|
|
9
9
|
|