From b8564147d62483a3257d626bb95434ef7ccf6a80 Mon Sep 17 00:00:00 2001 From: djuarezgf Date: Tue, 12 Nov 2024 10:31:23 +0100 Subject: [PATCH] Changed: ProjectManagerContext bridgehead of type Bridghead instead of string --- src/components/BridgeheadOverview.vue | 2 +- src/components/DocumentsTable.vue | 2 +- src/components/ProjectView.vue | 4 ++-- src/components/UserInput.vue | 2 +- src/services/projectManagerBackendService.ts | 6 +++--- 5 files changed, 8 insertions(+), 8 deletions(-) diff --git a/src/components/BridgeheadOverview.vue b/src/components/BridgeheadOverview.vue index 758b1c0..22a66e6 100644 --- a/src/components/BridgeheadOverview.vue +++ b/src/components/BridgeheadOverview.vue @@ -125,7 +125,7 @@ export default class BridgeheadOverview extends Vue { } fetchContext(bridgehead: Bridgehead) { - return new ProjectManagerContext(this.context.projectCode, bridgehead.bridgehead); + return new ProjectManagerContext(this.context.projectCode, bridgehead); } async fetchExistsVotums(): Promise { diff --git a/src/components/DocumentsTable.vue b/src/components/DocumentsTable.vue index 0e2ea2f..4b90924 100644 --- a/src/components/DocumentsTable.vue +++ b/src/components/DocumentsTable.vue @@ -62,7 +62,7 @@ export default class DocumentsTable extends Vue { } createContext(bridgehead: Bridgehead) { - return new ProjectManagerContext(this.context.projectCode, bridgehead.bridgehead); + return new ProjectManagerContext(this.context.projectCode, bridgehead); } diff --git a/src/components/ProjectView.vue b/src/components/ProjectView.vue index 28c65dc..73479ee 100644 --- a/src/components/ProjectView.vue +++ b/src/components/ProjectView.vue @@ -30,7 +30,7 @@
- {{ context.bridgehead }} + {{ context.bridgehead.humanReadable }}
@@ -545,7 +545,7 @@ export default defineComponent({ watch: { activeBridgehead(newValue, oldValue) { this.activeBridgeheadIndex = this.visibleBridgeheads.findIndex(bridgehead => bridgehead === newValue); - this.context = new ProjectManagerContext(this.projectCode, newValue.bridgehead); + this.context = new ProjectManagerContext(this.projectCode, newValue); }, context(newValue, oldValue) { this.projectManagerBackendService = new ProjectManagerBackendService(newValue, Site.PROJECT_VIEW_SITE); diff --git a/src/components/UserInput.vue b/src/components/UserInput.vue index 25202a1..0b8cac2 100644 --- a/src/components/UserInput.vue +++ b/src/components/UserInput.vue @@ -111,7 +111,7 @@ export default class UserInput extends Vue { } createContext(bridgehead: Bridgehead | undefined) { - return (bridgehead) ? new ProjectManagerContext(this.context.projectCode, bridgehead.bridgehead) : this.context; + return (bridgehead) ? new ProjectManagerContext(this.context.projectCode, bridgehead) : this.context; } selectSuggestion(suggestion: User) { diff --git a/src/services/projectManagerBackendService.ts b/src/services/projectManagerBackendService.ts index 397bd91..d302222 100644 --- a/src/services/projectManagerBackendService.ts +++ b/src/services/projectManagerBackendService.ts @@ -226,9 +226,9 @@ function jsonToActionMetadata(json: any): ActionMetadata | undefined { export class ProjectManagerContext { projectCode: string | undefined; - bridgehead: string | undefined; + bridgehead: Bridgehead | undefined; - constructor(projectCode: string | undefined, bridgehead: string | undefined) { + constructor(projectCode: string | undefined, bridgehead: Bridgehead | undefined) { this.projectCode = projectCode; this.bridgehead = bridgehead; } @@ -340,7 +340,7 @@ export class ProjectManagerBackendService { public addContextToMap(map: Map, context: ProjectManagerContext): void { if (context.projectCode) map.set(projectCodeParam, context.projectCode); - if (context.bridgehead) map.set(bridgeheadParam, context.bridgehead); + if (context.bridgehead) map.set(bridgeheadParam, context.bridgehead.bridgehead); } public async downloadFile(