codecharta-visualization 1.89.0 → 1.90.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/app/app.module.ts +16 -2
- package/app/codeCharta/assets/gameObjectsFile.json +75 -0
- package/app/codeCharta/codeCharta.model.ts +1 -10
- package/app/codeCharta/services/idToBuilding/idToBuilding.service.ts +17 -0
- package/app/codeCharta/state/effects/nodeContextMenu/highlightButtons/highlightButtons.component.spec.ts +14 -23
- package/app/codeCharta/state/effects/nodeContextMenu/highlightButtons/highlightButtons.component.ts +7 -5
- package/app/codeCharta/state/effects/nodeContextMenu/nodeContextMenuCard/nodeContextMenuCard.component.spec.ts +3 -1
- package/app/codeCharta/state/effects/nodeContextMenu/rightClickedCodeMapNode.selector.ts +1 -1
- package/app/codeCharta/state/effects/trackEventUsageData/trackEventUsageData.effect.spec.ts +56 -0
- package/app/codeCharta/state/effects/trackEventUsageData/trackEventUsageData.effect.ts +49 -0
- package/app/codeCharta/state/effects/unfocusNodesOnLoadingMap.effect.ts +2 -1
- package/app/codeCharta/state/injector.service.ts +0 -4
- package/app/codeCharta/state/selectors/accumulatedData/idToNode.selector.spec.ts +15 -0
- package/app/codeCharta/state/selectors/accumulatedData/idToNode.selector.ts +16 -0
- package/app/codeCharta/state/selectors/selectedNode.selector.ts +5 -2
- package/app/codeCharta/state/state.module.ts +0 -4
- package/app/codeCharta/state/store/appSettings/isLoadingMap/isLoadingMap.reducer.ts +1 -5
- package/app/codeCharta/state/store/state.actions.ts +0 -2
- package/app/codeCharta/state/store/state.reducer.ts +0 -2
- package/app/codeCharta/state/store/state.splitter.ts +0 -10
- package/app/codeCharta/state/store.service.ts +0 -16
- package/app/codeCharta/ui/attributeSideBar/attributeSideBar.component.spec.ts +5 -1
- package/app/codeCharta/ui/attributeSideBar/attributeSideBar.component.ts +2 -2
- package/app/codeCharta/ui/attributeSideBar/attributeSideBarHeaderSection/attributeSideBarHeaderSection.component.html +0 -1
- package/app/codeCharta/ui/attributeSideBar/attributeSideBarHeaderSection/attributeSideBarHeaderSection.component.spec.ts +3 -45
- package/app/codeCharta/ui/attributeSideBar/attributeSideBarHeaderSection/attributeSideBarHeaderSection.component.ts +2 -8
- package/app/codeCharta/ui/attributeSideBar/attributeSideBarHeaderSection/nodePath/nodePath.component.html +1 -1
- package/app/codeCharta/ui/attributeSideBar/attributeSideBarHeaderSection/nodePath/nodePath.component.spec.ts +3 -2
- package/app/codeCharta/ui/attributeSideBar/attributeSideBarHeaderSection/nodePath/nodePath.component.ts +2 -2
- package/app/codeCharta/ui/attributeSideBar/attributeSideBarSecondaryMetrics/secondaryMetrics.selector.ts +2 -2
- package/app/codeCharta/ui/attributeSideBar/metricDeltaSelected/metricDeltaSelected.component.spec.ts +26 -23
- package/app/codeCharta/ui/attributeSideBar/metricDeltaSelected/metricDeltaSelected.component.ts +2 -2
- package/app/codeCharta/ui/attributeSideBar/util/showAttributeTypeSelector.selector.spec.ts +2 -2
- package/app/codeCharta/ui/attributeSideBar/util/showAttributeTypeSelector.selector.ts +2 -2
- package/app/codeCharta/ui/codeMap/codeMap.mouseEvent.service.spec.ts +28 -45
- package/app/codeCharta/ui/codeMap/codeMap.mouseEvent.service.ts +7 -11
- package/app/codeCharta/ui/codeMap/codeMap.preRender.service.ts +4 -46
- package/app/codeCharta/ui/codeMap/threeViewer/threeSceneService.spec.ts +26 -19
- package/app/codeCharta/ui/codeMap/threeViewer/threeSceneService.ts +13 -25
- package/app/codeCharta/ui/codeMap/threeViewer/threeViewer.module.ts +3 -0
- package/app/codeCharta/ui/dialog/dialog.globalSettings.component.ts +3 -5
- package/app/codeCharta/ui/dialog/dialog.globalSettings.e2e.ts +1 -1
- package/app/codeCharta/ui/fileChooser/fileChooser.component.spec.ts +1 -0
- package/app/codeCharta/ui/fileChooser/fileChooser.component.ts +6 -1
- package/app/codeCharta/ui/fileChooser/fileChooser.e2e.ts +5 -0
- package/app/codeCharta/ui/filePanel/filePanel.component.html +1 -0
- package/app/codeCharta/ui/filePanel/filePanel.component.spec.ts +7 -0
- package/app/codeCharta/ui/filePanel/filePanel.component.ts +1 -2
- package/app/codeCharta/ui/filePanel/filePanel.module.ts +2 -0
- package/app/codeCharta/ui/filePanel/filePanelFileSelector/filePanelFileSelector.component.html +7 -1
- package/app/codeCharta/ui/filePanel/filePanelFileSelector/filePanelFileSelector.component.scss +6 -0
- package/app/codeCharta/ui/filePanel/filePanelFileSelector/filePanelFileSelector.component.ts +2 -1
- package/app/codeCharta/ui/filePanel/filePanelFileSelector/removeFileButton/removeFileButton.component.html +3 -0
- package/app/codeCharta/ui/filePanel/filePanelFileSelector/removeFileButton/removeFileButton.component.scss +9 -0
- package/app/codeCharta/ui/filePanel/filePanelFileSelector/removeFileButton/removeFileButton.component.ts +11 -0
- package/app/codeCharta/ui/rangeSlider/rangeSlider.component.ts +9 -33
- package/app/codeCharta/util/__snapshots__/usageDataTracker.spec.ts.snap +1 -16
- package/app/codeCharta/util/codeMapHelper.ts +3 -2
- package/app/codeCharta/util/customConfigHelper.ts +4 -16
- package/app/codeCharta/util/dataMocks.ts +0 -8
- package/app/codeCharta/util/envDetector.ts +0 -4
- package/app/codeCharta/util/gameObjectsParser/__snapshots__/gameObjectsImporter.spec.ts.snap +121 -0
- package/app/codeCharta/util/gameObjectsParser/gameObjectsImporter.spec.ts +11 -0
- package/app/codeCharta/util/gameObjectsParser/gameObjectsImporter.ts +170 -0
- package/app/codeCharta/util/gameObjectsParser/gameObjectsMocks.ts +75 -0
- package/app/codeCharta/util/gameObjectsParser/gameObjectsSchema.json +271 -0
- package/app/codeCharta/util/gameObjectsParser/gameObjectsValidator.spec.ts +18 -0
- package/app/codeCharta/util/gameObjectsParser/gameObjectsValidator.ts +7 -0
- package/app/codeCharta/util/nodeDecorator.ts +1 -0
- package/app/codeCharta/util/usageDataTracker.spec.ts +36 -76
- package/app/codeCharta/util/usageDataTracker.ts +20 -31
- package/conf/webpack.config.js +7 -7
- package/dist/webpack/bundle.js +871 -1260
- package/dist/webpack/bundle.js.map +1 -1
- package/package.json +10 -11
- package/app/codeCharta/state/selectors/selectedBuilding.selector.ts +0 -8
- package/app/codeCharta/state/store/lookUp/idToBuilding/idToBuilding.actions.ts +0 -22
- package/app/codeCharta/state/store/lookUp/idToBuilding/idToBuilding.reducer.spec.ts +0 -33
- package/app/codeCharta/state/store/lookUp/idToBuilding/idToBuilding.reducer.ts +0 -14
- package/app/codeCharta/state/store/lookUp/idToBuilding/idToBuilding.selector.ts +0 -3
- package/app/codeCharta/state/store/lookUp/idToBuilding/idToBuilding.service.spec.ts +0 -40
- package/app/codeCharta/state/store/lookUp/idToBuilding/idToBuilding.service.ts +0 -23
- package/app/codeCharta/state/store/lookUp/idToBuilding/idToBuilding.splitter.ts +0 -6
- package/app/codeCharta/state/store/lookUp/idToNode/idToNode.actions.ts +0 -22
- package/app/codeCharta/state/store/lookUp/idToNode/idToNode.reducer.spec.ts +0 -39
- package/app/codeCharta/state/store/lookUp/idToNode/idToNode.reducer.ts +0 -11
- package/app/codeCharta/state/store/lookUp/idToNode/idToNode.selector.ts +0 -4
- package/app/codeCharta/state/store/lookUp/idToNode/idToNode.service.spec.ts +0 -57
- package/app/codeCharta/state/store/lookUp/idToNode/idToNode.service.ts +0 -23
- package/app/codeCharta/state/store/lookUp/idToNode/idToNode.splitter.ts +0 -6
- package/app/codeCharta/state/store/lookUp/lookUp.actions.ts +0 -27
- package/app/codeCharta/state/store/lookUp/lookUp.reducer.ts +0 -10
- package/app/codeCharta/state/store/lookUp/lookUp.selector.ts +0 -3
- package/app/codeCharta/state/store/lookUp/lookUp.splitter.ts +0 -19
- package/app/codeCharta/ui/removeFileButton/removeFileButton.component.html +0 -5
- package/app/codeCharta/ui/removeFileButton/removeFileButton.component.scss +0 -41
- package/app/codeCharta/ui/removeFileButton/removeFileButton.component.ts +0 -18
- package/app/codeCharta/ui/removeFileButton/removeFileButton.module.ts +0 -7
- package/app/codeCharta/util/codeChartaFileStorage.spec.ts +0 -73
- package/app/codeCharta/util/codeChartaStorage.ts +0 -62
- package/app/codeCharta/util/lazyLoader.spec.ts +0 -33
- package/app/codeCharta/util/lazyLoader.ts +0 -50
- package/dist/webpack/vendors-node_modules_open_index_js.bundle.js +0 -1036
- package/dist/webpack/vendors-node_modules_open_index_js.bundle.js.map +0 -1
|
@@ -1,62 +0,0 @@
|
|
|
1
|
-
"use strict"
|
|
2
|
-
|
|
3
|
-
import fs from "fs"
|
|
4
|
-
import { isStandalone } from "./envDetector"
|
|
5
|
-
|
|
6
|
-
export class CodeChartaStorage implements Storage {
|
|
7
|
-
private storageEngine: Storage = isStandalone() ? new CodeChartaFileStorageEngine() : localStorage
|
|
8
|
-
readonly length = -1
|
|
9
|
-
|
|
10
|
-
clear(): void {
|
|
11
|
-
this.storageEngine.clear()
|
|
12
|
-
}
|
|
13
|
-
|
|
14
|
-
getItem(key: string): string | null {
|
|
15
|
-
return this.storageEngine.getItem(key)
|
|
16
|
-
}
|
|
17
|
-
|
|
18
|
-
key(index: number): string | null {
|
|
19
|
-
return this.storageEngine.key(index)
|
|
20
|
-
}
|
|
21
|
-
|
|
22
|
-
removeItem(key: string): void {
|
|
23
|
-
this.storageEngine.removeItem(key)
|
|
24
|
-
}
|
|
25
|
-
|
|
26
|
-
setItem(key: string, value: string): void {
|
|
27
|
-
try {
|
|
28
|
-
this.storageEngine.setItem(key, value)
|
|
29
|
-
} catch {
|
|
30
|
-
alert("Browser local storage memory limit exceeded. Some functions of the application may not longer work.")
|
|
31
|
-
}
|
|
32
|
-
}
|
|
33
|
-
}
|
|
34
|
-
|
|
35
|
-
export class CodeChartaFileStorageEngine implements Storage {
|
|
36
|
-
private fileStoragePath = `${fs.realpathSync(".")}/app/codeCharta/resources/fileStorage/`
|
|
37
|
-
|
|
38
|
-
// TODO: Find out, how to implement this.
|
|
39
|
-
readonly length = -1
|
|
40
|
-
|
|
41
|
-
clear(): void {
|
|
42
|
-
for (const file of fs.readdirSync(this.fileStoragePath)) {
|
|
43
|
-
fs.unlinkSync(this.fileStoragePath + file)
|
|
44
|
-
}
|
|
45
|
-
}
|
|
46
|
-
|
|
47
|
-
getItem(key: string): string | null {
|
|
48
|
-
return fs.readFileSync(this.fileStoragePath + key).toString()
|
|
49
|
-
}
|
|
50
|
-
|
|
51
|
-
key(index: number): string | null {
|
|
52
|
-
return fs.readdirSync(this.fileStoragePath)[index] ?? null
|
|
53
|
-
}
|
|
54
|
-
|
|
55
|
-
removeItem(key: string): void {
|
|
56
|
-
fs.unlinkSync(this.fileStoragePath + key)
|
|
57
|
-
}
|
|
58
|
-
|
|
59
|
-
setItem(key: string, value: string): void {
|
|
60
|
-
fs.writeFileSync(this.fileStoragePath + key, value, { encoding: "utf-8" })
|
|
61
|
-
}
|
|
62
|
-
}
|
|
@@ -1,33 +0,0 @@
|
|
|
1
|
-
import { LazyLoader } from "./lazyLoader"
|
|
2
|
-
|
|
3
|
-
describe("LazyLoader", () => {
|
|
4
|
-
beforeEach(() => {
|
|
5
|
-
process.env.STANDALONE = "true"
|
|
6
|
-
})
|
|
7
|
-
|
|
8
|
-
it("should return from openFile if app mode is not standalone", () => {
|
|
9
|
-
process.env.STANDALONE = "false"
|
|
10
|
-
LazyLoader.openFile("file", "path")
|
|
11
|
-
expect(LazyLoader["_filePath"]).toBeUndefined()
|
|
12
|
-
expect(LazyLoader["_nodePath"]).toBeUndefined()
|
|
13
|
-
})
|
|
14
|
-
|
|
15
|
-
it("should call setDirectory if not yet set in localStorage", () => {
|
|
16
|
-
localStorage.getItem = jest.fn().mockReturnValue(null)
|
|
17
|
-
localStorage.setItem = jest.fn()
|
|
18
|
-
LazyLoader["setDirectory"] = jest.fn()
|
|
19
|
-
window.prompt = jest.fn().mockReturnValue("path")
|
|
20
|
-
|
|
21
|
-
LazyLoader.openFile("file", "path")
|
|
22
|
-
expect(LazyLoader["setDirectory"]).toHaveBeenCalled()
|
|
23
|
-
})
|
|
24
|
-
|
|
25
|
-
it("should call setDirectory if root is wrong", () => {
|
|
26
|
-
localStorage.getItem = jest.fn()
|
|
27
|
-
LazyLoader["checkDirExists"] = jest.fn().mockReturnValue(false)
|
|
28
|
-
LazyLoader["setDirectory"] = jest.fn()
|
|
29
|
-
|
|
30
|
-
LazyLoader.openFile("file", "path")
|
|
31
|
-
expect(LazyLoader["setDirectory"]).toHaveBeenCalled()
|
|
32
|
-
})
|
|
33
|
-
})
|
|
@@ -1,50 +0,0 @@
|
|
|
1
|
-
import { isStandalone } from "./envDetector"
|
|
2
|
-
|
|
3
|
-
export class LazyLoader {
|
|
4
|
-
private static _fileName: string
|
|
5
|
-
private static _nodePath: string
|
|
6
|
-
|
|
7
|
-
static async openFile(fileName: string = LazyLoader._fileName, nodePath: string = LazyLoader._nodePath) {
|
|
8
|
-
if (!isStandalone()) {
|
|
9
|
-
return
|
|
10
|
-
}
|
|
11
|
-
LazyLoader._fileName = fileName
|
|
12
|
-
LazyLoader._nodePath = nodePath
|
|
13
|
-
const directory = localStorage.getItem(LazyLoader._fileName)
|
|
14
|
-
//replace '/root' with directory
|
|
15
|
-
const path = `/${directory}${nodePath.slice(nodePath.indexOf("/", 1))}`
|
|
16
|
-
if (directory === null) {
|
|
17
|
-
return LazyLoader.setDirectory()
|
|
18
|
-
}
|
|
19
|
-
//check if root still exists
|
|
20
|
-
const exists = await LazyLoader.checkDirExists(directory)
|
|
21
|
-
if (!exists) {
|
|
22
|
-
alert(`Unknown or non-existent directory: ${directory}`)
|
|
23
|
-
return LazyLoader.setDirectory()
|
|
24
|
-
}
|
|
25
|
-
const open = await import("open")
|
|
26
|
-
try {
|
|
27
|
-
await open.default(`file:///${path}`)
|
|
28
|
-
} catch (error) {
|
|
29
|
-
alert(error)
|
|
30
|
-
}
|
|
31
|
-
}
|
|
32
|
-
|
|
33
|
-
private static async setDirectory() {
|
|
34
|
-
let _default = "\\Users\\"
|
|
35
|
-
if (navigator.userAgent.includes("Windows")) {
|
|
36
|
-
_default = `C:${_default}`
|
|
37
|
-
}
|
|
38
|
-
let directoryName = prompt("Please enter a root directory path of the project", _default)
|
|
39
|
-
if (directoryName) {
|
|
40
|
-
directoryName = directoryName.replace(/\\/g, "/")
|
|
41
|
-
localStorage.setItem(LazyLoader._fileName, directoryName)
|
|
42
|
-
await LazyLoader.openFile()
|
|
43
|
-
}
|
|
44
|
-
}
|
|
45
|
-
|
|
46
|
-
private static async checkDirExists(path: string) {
|
|
47
|
-
const fs = await import("fs")
|
|
48
|
-
return fs.existsSync(path)
|
|
49
|
-
}
|
|
50
|
-
}
|