Skip to content

Commit

Permalink
Refactor/2318/remove some obsolete angularjs services (#3005)
Browse files Browse the repository at this point in the history
* refactor: remove obsolete isPresentationModeService and showOnlyBuildingsWithEdgesService

ref #2318
  • Loading branch information
shaman-apprentice committed Sep 5, 2022
1 parent ac7e182 commit 6ea5399
Show file tree
Hide file tree
Showing 8 changed files with 5 additions and 215 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/)
### Chore 👨‍💻 👩‍💻

- Migrate tool bar component to Angular [#3020](https://github.com/MaibornWolff/codecharta/pull/3020)
- Remove obsolete AngularJS IsPresentationModeService and ShowOnlyBuildingsWithEdgesService [#3005](https://github.com/MaibornWolff/codecharta/pull/3005)

## [1.104.1] - 2022-08-31

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 @@ -6,7 +6,6 @@ import { IsAttributeSideBarVisibleService } from "./store/appSettings/isAttribut
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 { ScalingService } from "./store/appSettings/scaling/scaling.service"
import { MarkedPackagesService } from "./store/fileSettings/markedPackages/markedPackages.service"
Expand All @@ -15,7 +14,6 @@ import { AttributeTypesService } from "./store/fileSettings/attributeTypes/attri
import { EdgeMetricService } from "./store/dynamicSettings/edgeMetric/edgeMetric.service"
import { FocusedNodePathService } from "./store/dynamicSettings/focusedNodePath/focusedNodePath.service"
import { BlacklistService } from "./store/fileSettings/blacklist/blacklist.service"
import { IsPresentationModeService } from "./store/appSettings/isPresentationMode/isPresentationMode.service"
import { MetricDataService } from "./store/metricData/metricData.service"
import { ExperimentalFeaturesEnabledService } from "./store/appSettings/enableExperimentalFeatures/experimentalFeaturesEnabled.service"
import { LayoutAlgorithmService } from "./store/appSettings/layoutAlgorithm/layoutAlgorithm.service"
Expand All @@ -31,7 +29,6 @@ export class InjectorService {
private isLoadingFileService: IsLoadingFileService,
private filesService: FilesService,
private mapSizeService: MapSizeService,
private showOnlyBuildingsWithEdgesService: ShowOnlyBuildingsWithEdgesService,
private isWhiteBackgroundService: IsWhiteBackgroundService,
private scalingService: ScalingService,
private markedPackagesService: MarkedPackagesService,
Expand All @@ -40,7 +37,6 @@ export class InjectorService {
private edgeMetricService: EdgeMetricService,
private focusedNodePathService: FocusedNodePathService,
private blacklistService: BlacklistService,
private isPresentationModeService: IsPresentationModeService,
private layoutAlgorithmService: LayoutAlgorithmService,
private sharpnessModeService: SharpnessModeService,
private experimentalFeaturesEnabledService: ExperimentalFeaturesEnabledService,
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
Expand Up @@ -4,7 +4,6 @@ import { IsAttributeSideBarVisibleService } from "./store/appSettings/isAttribut
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 { ScalingService } from "./store/appSettings/scaling/scaling.service"
import { MarkedPackagesService } from "./store/fileSettings/markedPackages/markedPackages.service"
Expand All @@ -17,7 +16,6 @@ import { InjectorService } from "./injector.service"
import { StoreService } from "./store.service"
import "../codeCharta.module"
import camelCase from "lodash.camelcase"
import { IsPresentationModeService } from "./store/appSettings/isPresentationMode/isPresentationMode.service"
import { EdgeMetricDataService } from "./store/metricData/edgeMetricData/edgeMetricData.service"
import { MetricDataService } from "./store/metricData/metricData.service"
import { ExperimentalFeaturesEnabledService } from "./store/appSettings/enableExperimentalFeatures/experimentalFeaturesEnabled.service"
Expand All @@ -33,15 +31,13 @@ angular
.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(ScalingService.name), ScalingService)
.service(camelCase(MarkedPackagesService.name), MarkedPackagesService)
.service(camelCase(EdgesService.name), EdgesService)
.service(camelCase(AttributeTypesService.name), AttributeTypesService)
.service(camelCase(EdgeMetricService.name), EdgeMetricService)
.service(camelCase(FocusedNodePathService.name), FocusedNodePathService)
.service(camelCase(IsPresentationModeService.name), IsPresentationModeService)
.service(camelCase(BlacklistService.name), BlacklistService)
.service(camelCase(InjectorService.name), InjectorService)
.service(camelCase(StoreService.name), StoreService)
Expand Down

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -115,20 +115,20 @@ describe("CodeMapArrowService", () => {
threeSceneService.selectBuilding(CODE_MAP_BUILDING_WITH_OUTGOING_EDGE_NODE)
codeMapArrowService.onBuildingHovered(CODE_MAP_BUILDING_WITH_OUTGOING_EDGE_NODE)

await wait(codeMapArrowService["HIGHLIGHT_BUILDING_DELAY"] + 1)
await wait(codeMapArrowService["HIGHLIGHT_BUILDING_DELAY"])

expect(threeSceneService["highlighted"]).toMatchSnapshot()
expect(threeSceneService["selected"]).toMatchSnapshot()
})
it("should debounce the edge reset of buildings to improve perfomance", async () => {
it("should debounce the edge reset of buildings to improve performance", async () => {
codeMapArrowService["resetEdgesOfBuildings"] = () => {}
const resetEdgesOfBuildingMock = jest.fn().mockImplementation()
codeMapArrowService["resetEdgesOfBuildings"] = resetEdgesOfBuildingMock
codeMapArrowService.onBuildingHovered(CODE_MAP_BUILDING_WITH_OUTGOING_EDGE_NODE)

expect(resetEdgesOfBuildingMock).not.toHaveBeenCalled()

await wait(codeMapArrowService["HIGHLIGHT_BUILDING_DELAY"] + 1)
await wait(codeMapArrowService["HIGHLIGHT_BUILDING_DELAY"])

expect(resetEdgesOfBuildingMock).toHaveBeenCalled()
})
Expand All @@ -153,7 +153,7 @@ describe("CodeMapArrowService", () => {
it("should call clearArrows and showEdgesOfBuildings through BuildingHovered", async () => {
codeMapArrowService.onBuildingHovered(CODE_MAP_BUILDING)

await wait(codeMapArrowService["HIGHLIGHT_BUILDING_DELAY"] + 1)
await wait(codeMapArrowService["HIGHLIGHT_BUILDING_DELAY"])

expect(codeMapArrowService.clearArrows).toHaveBeenCalled()
expect(codeMapArrowService["showEdgesOfBuildings"]).toHaveBeenCalled()
Expand Down

0 comments on commit 6ea5399

Please sign in to comment.