Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Refactor/2318/rework custom dispatch #2880

Merged
merged 13 commits into from
Jul 29, 2022
Merged
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,10 @@ and this project adheres to [Semantic Versioning](http://semver.org/)

## [unreleased] (Added 🚀 | Changed | Removed 🗑 | Fixed 🐞 | Chore 👨‍💻 👩‍💻)

### Changed

- Changed storing format for camera position within custom views and scenarios. Loading of created custom views or scenarios in old format will stop working in 2023 [2880](https://github.com/MaibornWolff/codecharta/pull/2880)

### Added 🚀

- Add display of changed files in delta mode (changed := metric values changed or list of applied metrics
Expand Down
5 changes: 5 additions & 0 deletions visualization/app/codeCharta/codeCharta.api.model.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import { Vector3 } from "three"
import { AttributeTypes, AttributeTypeValue, CodeMapNode, Edge, MarkedPackage, RecursivePartial, Settings } from "./codeCharta.model"

export interface ExportCCFile {
Expand Down Expand Up @@ -38,6 +39,10 @@ export enum APIVersions {
export interface ExportScenario {
name: string
settings: RecursivePartial<Settings>
camera?: {
camera: Vector3
cameraTarget: Vector3
}
}

export interface OldAttributeTypes {
Expand Down
2 changes: 0 additions & 2 deletions visualization/app/codeCharta/codeCharta.model.ts
Original file line number Diff line number Diff line change
Expand Up @@ -135,8 +135,6 @@ export interface AppSettings {
amountOfEdgePreviews: number
edgeHeight: number
scaling: Vector3
camera: Vector3
cameraTarget: Vector3
hideFlatBuildings: boolean
invertHeight: boolean
invertArea: boolean
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import { Vector3 } from "three"
import { AppSettings, DynamicSettings, FileSettings, TreeMapSettings } from "../../codeCharta.model"

export enum CustomConfigMapSelectionMode {
Expand All @@ -21,6 +22,10 @@ export interface CustomConfig {
fileSettings: FileSettings
treeMap: TreeMapSettings
}
camera: {
camera: Vector3
cameraTarget: Vector3
}
}

export type ExportCustomConfig = CustomConfig
Expand Down
4 changes: 0 additions & 4 deletions visualization/app/codeCharta/state/injector.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,12 @@

import { EdgeMetricDataService } from "./store/metricData/edgeMetricData/edgeMetricData.service"
import { NodeMetricDataService } from "./store/metricData/nodeMetricData/nodeMetricData.service"
import { CameraTargetService } from "./store/appSettings/cameraTarget/cameraTarget.service"
import { IsAttributeSideBarVisibleService } from "./store/appSettings/isAttributeSideBarVisible/isAttributeSideBarVisible.service"
import { FilesService } from "./store/files/files.service"
import { IsLoadingFileService } from "./store/appSettings/isLoadingFile/isLoadingFile.service"
import { MapSizeService } from "./store/treeMap/mapSize/mapSize.service"
import { ShowOnlyBuildingsWithEdgesService } from "./store/appSettings/showOnlyBuildingsWithEdges/showOnlyBuildingsWithEdges.service"
import { IsWhiteBackgroundService } from "./store/appSettings/isWhiteBackground/isWhiteBackground.service"
import { CameraService } from "./store/appSettings/camera/camera.service"
import { ScalingService } from "./store/appSettings/scaling/scaling.service"
import { EdgeHeightService } from "./store/appSettings/edgeHeight/edgeHeight.service"
import { AmountOfEdgePreviewsService } from "./store/appSettings/amountOfEdgePreviews/amountOfEdgePreviews.service"
Expand All @@ -32,14 +30,12 @@ export class InjectorService {
private metricDataService: MetricDataService,
private edgeMetricDataService: EdgeMetricDataService,
private nodeMetricDataService: NodeMetricDataService,
private cameraTargetService: CameraTargetService,
private isAttributeSideBarVisibleService: IsAttributeSideBarVisibleService,
private isLoadingFileService: IsLoadingFileService,
private filesService: FilesService,
private mapSizeService: MapSizeService,
private showOnlyBuildingsWithEdgesService: ShowOnlyBuildingsWithEdgesService,
private isWhiteBackgroundService: IsWhiteBackgroundService,
private cameraService: CameraService,
private scalingService: ScalingService,
private edgeHeightService: EdgeHeightService,
private amountOfEdgePreviewsService: AmountOfEdgePreviewsService,
Expand Down
4 changes: 0 additions & 4 deletions visualization/app/codeCharta/state/state.module.ts
Original file line number Diff line number Diff line change
@@ -1,13 +1,11 @@
import angular from "angular"
import { NodeMetricDataService } from "./store/metricData/nodeMetricData/nodeMetricData.service"
import { CameraTargetService } from "./store/appSettings/cameraTarget/cameraTarget.service"
import { IsAttributeSideBarVisibleService } from "./store/appSettings/isAttributeSideBarVisible/isAttributeSideBarVisible.service"
import { IsLoadingFileService } from "./store/appSettings/isLoadingFile/isLoadingFile.service"
import { FilesService } from "./store/files/files.service"
import { MapSizeService } from "./store/treeMap/mapSize/mapSize.service"
import { ShowOnlyBuildingsWithEdgesService } from "./store/appSettings/showOnlyBuildingsWithEdges/showOnlyBuildingsWithEdges.service"
import { IsWhiteBackgroundService } from "./store/appSettings/isWhiteBackground/isWhiteBackground.service"
import { CameraService } from "./store/appSettings/camera/camera.service"
import { ScalingService } from "./store/appSettings/scaling/scaling.service"
import { EdgeHeightService } from "./store/appSettings/edgeHeight/edgeHeight.service"
import { AmountOfEdgePreviewsService } from "./store/appSettings/amountOfEdgePreviews/amountOfEdgePreviews.service"
Expand All @@ -34,14 +32,12 @@ angular
.service(camelCase(MetricDataService.name), MetricDataService)
.service(camelCase(EdgeMetricDataService.name), EdgeMetricDataService)
.service(camelCase(NodeMetricDataService.name), NodeMetricDataService)
.service(camelCase(CameraTargetService.name), CameraTargetService)
.service(camelCase(IsAttributeSideBarVisibleService.name), IsAttributeSideBarVisibleService)
.service(camelCase(IsLoadingFileService.name), IsLoadingFileService)
.service(camelCase(FilesService.name), FilesService)
.service(camelCase(MapSizeService.name), MapSizeService)
.service(camelCase(ShowOnlyBuildingsWithEdgesService.name), ShowOnlyBuildingsWithEdgesService)
.service(camelCase(IsWhiteBackgroundService.name), IsWhiteBackgroundService)
.service(camelCase(CameraService.name), CameraService)
.service(camelCase(ScalingService.name), ScalingService)
.service(camelCase(EdgeHeightService.name), EdgeHeightService)
.service(camelCase(AmountOfEdgePreviewsService.name), AmountOfEdgePreviewsService)
Expand Down
7 changes: 0 additions & 7 deletions visualization/app/codeCharta/state/store.service.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ import { DEFAULT_STATE, STATE, withMockedEventMethods } from "../util/dataMocks"
import { setState } from "./store/state.actions"
import { setDynamicSettings } from "./store/dynamicSettings/dynamicSettings.actions"
import { setMargin } from "./store/dynamicSettings/margin/margin.actions"
import { setCamera } from "./store/appSettings/camera/camera.actions"
import { setIsLoadingMap } from "./store/appSettings/isLoadingMap/isLoadingMap.actions"
import { toggleSortingOrderAscending } from "./store/appSettings/sortingOrderAscending/sortingOrderAscending.actions"

Expand Down Expand Up @@ -104,12 +103,6 @@ describe("StoreService", () => {
expect(storeService.getState()).toEqual(STATE)
})

it("should dispatch an action silently and not notify subscribers", () => {
storeService.dispatch(setCamera(), { silent: true })

expect($rootScope.$broadcast).not.toHaveBeenCalled()
})

it("should show not the loading-gif when an action is triggered, that doesn't change the loading-gif state", () => {
storeService.dispatch(setIsLoadingMap(false))
storeService.dispatch(toggleSortingOrderAscending())
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ import { defaultAmountOfEdgePreviews } from "./amountOfEdgePreviews/amountOfEdge
import { defaultAmountOfTopLabels } from "./amountOfTopLabels/amountOfTopLabels.actions"
import { defaultEdgeHeight } from "./edgeHeight/edgeHeight.actions"
import { defaultScaling } from "./scaling/scaling.actions"
import { defaultCamera } from "./camera/camera.actions"
import { defaultHideFlatBuildings } from "./hideFlatBuildings/hideFlatBuildings.actions"
import { defaultInvertHeight } from "./invertHeight/invertHeight.actions"
import { defaultDynamicMargin } from "./dynamicMargin/dynamicMargin.actions"
Expand All @@ -20,7 +19,6 @@ import { defaultResetIfNewFileIsLoaded } from "./resetCameraIfNewFileIsLoaded/re
import { defaultIsLoadingMap } from "./isLoadingMap/isLoadingMap.actions"
import { defaultIsLoadingFile } from "./isLoadingFile/isLoadingFile.actions"
import { defaultSortingOrderAscending } from "./sortingOrderAscending/sortingOrderAscending.actions"
import { defaultCameraTarget } from "./cameraTarget/cameraTarget.actions"
import { defaultExperimentalFeaturesEnabled } from "./enableExperimentalFeatures/experimentalFeaturesEnabled.actions"
import { defaultLayoutAlgorithm } from "./layoutAlgorithm/layoutAlgorithm.actions"
import { defaultMaxTreeMapFiles } from "./maxTreeMapFiles/maxTreeMapFiles.actions"
Expand Down Expand Up @@ -56,8 +54,6 @@ export const defaultAppSettings: AppSettings = {
amountOfEdgePreviews: defaultAmountOfEdgePreviews,
edgeHeight: defaultEdgeHeight,
scaling: defaultScaling,
camera: defaultCamera,
cameraTarget: defaultCameraTarget,
hideFlatBuildings: defaultHideFlatBuildings,
invertHeight: defaultInvertHeight,
invertArea: defaultInvertArea,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import { colorLabels } from "./colorLabels/colorLabels.reducer"
import { showMetricLabelNodeName } from "./showMetricLabelNodeName/showMetricLabelNodeName.reducer"
import { showMetricLabelNameValue } from "./showMetricLabelNameValue/showMetricLabelNameValue.reducer"
import { cameraTarget } from "./cameraTarget/cameraTarget.reducer"
import { isAttributeSideBarVisible } from "./isAttributeSideBarVisible/isAttributeSideBarVisible.reducer"
import { sortingOrderAscending } from "./sortingOrderAscending/sortingOrderAscending.reducer"
import { isLoadingFile } from "./isLoadingFile/isLoadingFile.reducer"
Expand All @@ -13,7 +12,6 @@ import { isWhiteBackground } from "./isWhiteBackground/isWhiteBackground.reducer
import { dynamicMargin } from "./dynamicMargin/dynamicMargin.reducer"
import { invertHeight } from "./invertHeight/invertHeight.reducer"
import { hideFlatBuildings } from "./hideFlatBuildings/hideFlatBuildings.reducer"
import { camera } from "./camera/camera.reducer"
import { scaling } from "./scaling/scaling.reducer"
import { edgeHeight } from "./edgeHeight/edgeHeight.reducer"
import { amountOfEdgePreviews } from "./amountOfEdgePreviews/amountOfEdgePreviews.reducer"
Expand All @@ -32,7 +30,6 @@ const appSettings = combineReducers({
colorLabels,
showMetricLabelNodeName,
showMetricLabelNameValue,
cameraTarget,
isAttributeSideBarVisible,
sortingOrderAscending,
isLoadingFile,
Expand All @@ -46,7 +43,6 @@ const appSettings = combineReducers({
invertHeight,
invertArea,
hideFlatBuildings,
camera,
scaling,
edgeHeight,
amountOfEdgePreviews,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ import { Vector3 } from "three"
import { splitColorLabelsAction } from "./colorLabels/colorLabels.splitter"
import { splitShowMetricLabelNodeNameAction } from "./showMetricLabelNodeName/showMetricLabelNodeName.splitter"
import { splitShowMetricLabelNameValueAction } from "./showMetricLabelNameValue/showMetricLabelNameValue.splitter"
import { splitCameraTargetAction } from "./cameraTarget/cameraTarget.splitter"
import { splitIsAttributeSideBarVisibleAction } from "./isAttributeSideBarVisible/isAttributeSideBarVisible.splitter"
import { splitSortingOrderAscendingAction } from "./sortingOrderAscending/sortingOrderAscending.splitter"
import { splitIsLoadingFileAction } from "./isLoadingFile/isLoadingFile.splitter"
Expand All @@ -16,7 +15,6 @@ import { splitIsWhiteBackgroundAction } from "./isWhiteBackground/isWhiteBackgro
import { splitDynamicMarginAction } from "./dynamicMargin/dynamicMargin.splitter"
import { splitInvertHeightAction } from "./invertHeight/invertHeight.splitter"
import { splitHideFlatBuildingsAction } from "./hideFlatBuildings/hideFlatBuildings.splitter"
import { splitCameraAction } from "./camera/camera.splitter"
import { splitScalingAction } from "./scaling/scaling.splitter"
import { splitEdgeHeightAction } from "./edgeHeight/edgeHeight.splitter"
import { splitAmountOfEdgePreviewsAction } from "./amountOfEdgePreviews/amountOfEdgePreviews.splitter"
Expand All @@ -38,10 +36,6 @@ export function splitAppSettingsActions(payload: RecursivePartial<AppSettings>)
actions.push(splitShowMetricLabelNameValueAction(payload.showMetricLabelNameValue))
}

if (payload.cameraTarget !== undefined) {
actions.push(splitCameraTargetAction(payload.cameraTarget as Vector3))
}

if (payload.isAttributeSideBarVisible !== undefined) {
actions.push(splitIsAttributeSideBarVisibleAction(payload.isAttributeSideBarVisible))
}
Expand Down Expand Up @@ -86,10 +80,6 @@ export function splitAppSettingsActions(payload: RecursivePartial<AppSettings>)
actions.push(splitHideFlatBuildingsAction(payload.hideFlatBuildings))
}

if (payload.camera !== undefined) {
actions.push(splitCameraAction(payload.camera as Vector3))
}

if (payload.scaling !== undefined) {
actions.push(splitScalingAction(payload.scaling as Vector3))
}
Expand Down

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

Loading