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.
Files changed (104) hide show
  1. package/app/app.module.ts +16 -2
  2. package/app/codeCharta/assets/gameObjectsFile.json +75 -0
  3. package/app/codeCharta/codeCharta.model.ts +1 -10
  4. package/app/codeCharta/services/idToBuilding/idToBuilding.service.ts +17 -0
  5. package/app/codeCharta/state/effects/nodeContextMenu/highlightButtons/highlightButtons.component.spec.ts +14 -23
  6. package/app/codeCharta/state/effects/nodeContextMenu/highlightButtons/highlightButtons.component.ts +7 -5
  7. package/app/codeCharta/state/effects/nodeContextMenu/nodeContextMenuCard/nodeContextMenuCard.component.spec.ts +3 -1
  8. package/app/codeCharta/state/effects/nodeContextMenu/rightClickedCodeMapNode.selector.ts +1 -1
  9. package/app/codeCharta/state/effects/trackEventUsageData/trackEventUsageData.effect.spec.ts +56 -0
  10. package/app/codeCharta/state/effects/trackEventUsageData/trackEventUsageData.effect.ts +49 -0
  11. package/app/codeCharta/state/effects/unfocusNodesOnLoadingMap.effect.ts +2 -1
  12. package/app/codeCharta/state/injector.service.ts +0 -4
  13. package/app/codeCharta/state/selectors/accumulatedData/idToNode.selector.spec.ts +15 -0
  14. package/app/codeCharta/state/selectors/accumulatedData/idToNode.selector.ts +16 -0
  15. package/app/codeCharta/state/selectors/selectedNode.selector.ts +5 -2
  16. package/app/codeCharta/state/state.module.ts +0 -4
  17. package/app/codeCharta/state/store/appSettings/isLoadingMap/isLoadingMap.reducer.ts +1 -5
  18. package/app/codeCharta/state/store/state.actions.ts +0 -2
  19. package/app/codeCharta/state/store/state.reducer.ts +0 -2
  20. package/app/codeCharta/state/store/state.splitter.ts +0 -10
  21. package/app/codeCharta/state/store.service.ts +0 -16
  22. package/app/codeCharta/ui/attributeSideBar/attributeSideBar.component.spec.ts +5 -1
  23. package/app/codeCharta/ui/attributeSideBar/attributeSideBar.component.ts +2 -2
  24. package/app/codeCharta/ui/attributeSideBar/attributeSideBarHeaderSection/attributeSideBarHeaderSection.component.html +0 -1
  25. package/app/codeCharta/ui/attributeSideBar/attributeSideBarHeaderSection/attributeSideBarHeaderSection.component.spec.ts +3 -45
  26. package/app/codeCharta/ui/attributeSideBar/attributeSideBarHeaderSection/attributeSideBarHeaderSection.component.ts +2 -8
  27. package/app/codeCharta/ui/attributeSideBar/attributeSideBarHeaderSection/nodePath/nodePath.component.html +1 -1
  28. package/app/codeCharta/ui/attributeSideBar/attributeSideBarHeaderSection/nodePath/nodePath.component.spec.ts +3 -2
  29. package/app/codeCharta/ui/attributeSideBar/attributeSideBarHeaderSection/nodePath/nodePath.component.ts +2 -2
  30. package/app/codeCharta/ui/attributeSideBar/attributeSideBarSecondaryMetrics/secondaryMetrics.selector.ts +2 -2
  31. package/app/codeCharta/ui/attributeSideBar/metricDeltaSelected/metricDeltaSelected.component.spec.ts +26 -23
  32. package/app/codeCharta/ui/attributeSideBar/metricDeltaSelected/metricDeltaSelected.component.ts +2 -2
  33. package/app/codeCharta/ui/attributeSideBar/util/showAttributeTypeSelector.selector.spec.ts +2 -2
  34. package/app/codeCharta/ui/attributeSideBar/util/showAttributeTypeSelector.selector.ts +2 -2
  35. package/app/codeCharta/ui/codeMap/codeMap.mouseEvent.service.spec.ts +28 -45
  36. package/app/codeCharta/ui/codeMap/codeMap.mouseEvent.service.ts +7 -11
  37. package/app/codeCharta/ui/codeMap/codeMap.preRender.service.ts +4 -46
  38. package/app/codeCharta/ui/codeMap/threeViewer/threeSceneService.spec.ts +26 -19
  39. package/app/codeCharta/ui/codeMap/threeViewer/threeSceneService.ts +13 -25
  40. package/app/codeCharta/ui/codeMap/threeViewer/threeViewer.module.ts +3 -0
  41. package/app/codeCharta/ui/dialog/dialog.globalSettings.component.ts +3 -5
  42. package/app/codeCharta/ui/dialog/dialog.globalSettings.e2e.ts +1 -1
  43. package/app/codeCharta/ui/fileChooser/fileChooser.component.spec.ts +1 -0
  44. package/app/codeCharta/ui/fileChooser/fileChooser.component.ts +6 -1
  45. package/app/codeCharta/ui/fileChooser/fileChooser.e2e.ts +5 -0
  46. package/app/codeCharta/ui/filePanel/filePanel.component.html +1 -0
  47. package/app/codeCharta/ui/filePanel/filePanel.component.spec.ts +7 -0
  48. package/app/codeCharta/ui/filePanel/filePanel.component.ts +1 -2
  49. package/app/codeCharta/ui/filePanel/filePanel.module.ts +2 -0
  50. package/app/codeCharta/ui/filePanel/filePanelFileSelector/filePanelFileSelector.component.html +7 -1
  51. package/app/codeCharta/ui/filePanel/filePanelFileSelector/filePanelFileSelector.component.scss +6 -0
  52. package/app/codeCharta/ui/filePanel/filePanelFileSelector/filePanelFileSelector.component.ts +2 -1
  53. package/app/codeCharta/ui/filePanel/filePanelFileSelector/removeFileButton/removeFileButton.component.html +3 -0
  54. package/app/codeCharta/ui/filePanel/filePanelFileSelector/removeFileButton/removeFileButton.component.scss +9 -0
  55. package/app/codeCharta/ui/filePanel/filePanelFileSelector/removeFileButton/removeFileButton.component.ts +11 -0
  56. package/app/codeCharta/ui/rangeSlider/rangeSlider.component.ts +9 -33
  57. package/app/codeCharta/util/__snapshots__/usageDataTracker.spec.ts.snap +1 -16
  58. package/app/codeCharta/util/codeMapHelper.ts +3 -2
  59. package/app/codeCharta/util/customConfigHelper.ts +4 -16
  60. package/app/codeCharta/util/dataMocks.ts +0 -8
  61. package/app/codeCharta/util/envDetector.ts +0 -4
  62. package/app/codeCharta/util/gameObjectsParser/__snapshots__/gameObjectsImporter.spec.ts.snap +121 -0
  63. package/app/codeCharta/util/gameObjectsParser/gameObjectsImporter.spec.ts +11 -0
  64. package/app/codeCharta/util/gameObjectsParser/gameObjectsImporter.ts +170 -0
  65. package/app/codeCharta/util/gameObjectsParser/gameObjectsMocks.ts +75 -0
  66. package/app/codeCharta/util/gameObjectsParser/gameObjectsSchema.json +271 -0
  67. package/app/codeCharta/util/gameObjectsParser/gameObjectsValidator.spec.ts +18 -0
  68. package/app/codeCharta/util/gameObjectsParser/gameObjectsValidator.ts +7 -0
  69. package/app/codeCharta/util/nodeDecorator.ts +1 -0
  70. package/app/codeCharta/util/usageDataTracker.spec.ts +36 -76
  71. package/app/codeCharta/util/usageDataTracker.ts +20 -31
  72. package/conf/webpack.config.js +7 -7
  73. package/dist/webpack/bundle.js +871 -1260
  74. package/dist/webpack/bundle.js.map +1 -1
  75. package/package.json +10 -11
  76. package/app/codeCharta/state/selectors/selectedBuilding.selector.ts +0 -8
  77. package/app/codeCharta/state/store/lookUp/idToBuilding/idToBuilding.actions.ts +0 -22
  78. package/app/codeCharta/state/store/lookUp/idToBuilding/idToBuilding.reducer.spec.ts +0 -33
  79. package/app/codeCharta/state/store/lookUp/idToBuilding/idToBuilding.reducer.ts +0 -14
  80. package/app/codeCharta/state/store/lookUp/idToBuilding/idToBuilding.selector.ts +0 -3
  81. package/app/codeCharta/state/store/lookUp/idToBuilding/idToBuilding.service.spec.ts +0 -40
  82. package/app/codeCharta/state/store/lookUp/idToBuilding/idToBuilding.service.ts +0 -23
  83. package/app/codeCharta/state/store/lookUp/idToBuilding/idToBuilding.splitter.ts +0 -6
  84. package/app/codeCharta/state/store/lookUp/idToNode/idToNode.actions.ts +0 -22
  85. package/app/codeCharta/state/store/lookUp/idToNode/idToNode.reducer.spec.ts +0 -39
  86. package/app/codeCharta/state/store/lookUp/idToNode/idToNode.reducer.ts +0 -11
  87. package/app/codeCharta/state/store/lookUp/idToNode/idToNode.selector.ts +0 -4
  88. package/app/codeCharta/state/store/lookUp/idToNode/idToNode.service.spec.ts +0 -57
  89. package/app/codeCharta/state/store/lookUp/idToNode/idToNode.service.ts +0 -23
  90. package/app/codeCharta/state/store/lookUp/idToNode/idToNode.splitter.ts +0 -6
  91. package/app/codeCharta/state/store/lookUp/lookUp.actions.ts +0 -27
  92. package/app/codeCharta/state/store/lookUp/lookUp.reducer.ts +0 -10
  93. package/app/codeCharta/state/store/lookUp/lookUp.selector.ts +0 -3
  94. package/app/codeCharta/state/store/lookUp/lookUp.splitter.ts +0 -19
  95. package/app/codeCharta/ui/removeFileButton/removeFileButton.component.html +0 -5
  96. package/app/codeCharta/ui/removeFileButton/removeFileButton.component.scss +0 -41
  97. package/app/codeCharta/ui/removeFileButton/removeFileButton.component.ts +0 -18
  98. package/app/codeCharta/ui/removeFileButton/removeFileButton.module.ts +0 -7
  99. package/app/codeCharta/util/codeChartaFileStorage.spec.ts +0 -73
  100. package/app/codeCharta/util/codeChartaStorage.ts +0 -62
  101. package/app/codeCharta/util/lazyLoader.spec.ts +0 -33
  102. package/app/codeCharta/util/lazyLoader.ts +0 -50
  103. package/dist/webpack/vendors-node_modules_open_index_js.bundle.js +0 -1036
  104. 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
- }