From 6689a274beb84531780c1d7dac7ffe6d7a47d6b0 Mon Sep 17 00:00:00 2001 From: djuarezgf Date: Mon, 20 Jan 2025 13:47:58 +0100 Subject: [PATCH 1/3] Changed: Improvements in results box (II) --- src/components/BridgeheadOverview.vue | 12 +++-- src/components/ProjectView.vue | 14 +++--- src/components/ResultsBox.vue | 49 ++++++++++++++------ src/services/projectManagerBackendService.ts | 12 ++--- 4 files changed, 56 insertions(+), 31 deletions(-) diff --git a/src/components/BridgeheadOverview.vue b/src/components/BridgeheadOverview.vue index 59e6b15..00c3248 100644 --- a/src/components/BridgeheadOverview.vue +++ b/src/components/BridgeheadOverview.vue @@ -194,16 +194,20 @@ export default class BridgeheadOverview extends Vue { if (this.project?.creatorState === 'REJECTED'){ return [0, 1]; } - const isFinished = this.bridgeheads.filter((bridgehead) => bridgehead?.creatorState === 'ACCEPTED'); - const notFinished = this.bridgeheads.filter((bridgehead) => bridgehead?.queryState !== 'ACCEPTED'); + const isFinished = this.bridgeheads.filter((bridgehead) => this.isBridgeheadAcceptedByCreator(bridgehead)); + const notFinished = this.bridgeheads.filter((bridgehead) => !this.isBridgeheadAcceptedByCreator(bridgehead)); return [isFinished.length, notFinished.length] } - getCreatorStatusForBridgehead(bridgehead: Bridgehead): string { + isBridgeheadAcceptedByCreator(bridgehead: Bridgehead): boolean{ + return bridgehead?.state === 'ACCEPTED' && bridgehead?.creatorState === 'ACCEPTED'; + } + + getCreatorStatusForBridgehead(bridgehead: Bridgehead): string | null | undefined { if (this.project?.creatorState === 'ACCEPTED' || this.project?.creatorState === 'REJECTED'){ return this.project?.creatorState; } - return bridgehead?.creatorState; + return (bridgehead?.state === 'ACCEPTED') ? bridgehead?.creatorState : 'CREATED'; } } diff --git a/src/components/ProjectView.vue b/src/components/ProjectView.vue index 26c52a6..5e25859 100644 --- a/src/components/ProjectView.vue +++ b/src/components/ProjectView.vue @@ -59,8 +59,8 @@ {{ project ? project.code : '' }} -
-
+
+
@@ -126,7 +126,6 @@ /> -

Request
@@ -1143,6 +1142,7 @@ export default defineComponent({ border-radius: 10px; box-shadow: 0px 2px 1px -1px rgba(0,0,0,0.2),0px 1px 1px 0px rgba(0,0,0,0.14),0px 1px 3px 0px rgba(0,0,0,0.12); height: 100%; + margin-bottom: 1.5%; } .project-actions { background-color: white; @@ -1154,13 +1154,13 @@ export default defineComponent({ background-color: white; border-radius: 10px; box-shadow: 0px 2px 1px -1px rgba(0,0,0,0.2),0px 1px 1px 0px rgba(0,0,0,0.14),0px 1px 3px 0px rgba(0,0,0,0.12); - margin-top: 1.5%; + margin-bottom: 1.5%; } .documents { background-color: white; border-radius: 10px; box-shadow: 0px 2px 1px -1px rgba(0,0,0,0.2),0px 1px 1px 0px rgba(0,0,0,0.14),0px 1px 3px 0px rgba(0,0,0,0.12); - margin-top: 1.5%; + margin-bottom: 1.5%; } .main-container { display: flex; @@ -1175,7 +1175,7 @@ export default defineComponent({ min-height: 800px; margin-top: 1.5%; margin-left: 1.5%; - margin-bottom: 4%; + margin-bottom: 5%; background-color: white; border-radius: 10px; box-shadow: 0px 2px 1px -1px rgba(0,0,0,0.2),0px 1px 1px 0px rgba(0,0,0,0.14),0px 1px 3px 0px rgba(0,0,0,0.12); @@ -1310,7 +1310,7 @@ export default defineComponent({ border-radius: 10px; box-shadow: 0px 2px 1px -1px rgba(0,0,0,0.2),0px 1px 1px 0px rgba(0,0,0,0.14),0px 1px 3px 0px rgba(0,0,0,0.12); margin-top: 1.5%; - margin-bottom: 4%; + margin-bottom: 5%; margin-right: 0.5%; } .open-right-panel { diff --git a/src/components/ResultsBox.vue b/src/components/ResultsBox.vue index c992371..ef57191 100644 --- a/src/components/ResultsBox.vue +++ b/src/components/ResultsBox.vue @@ -3,7 +3,7 @@ import {Options, Vue} from "vue-class-component"; import {Prop, Watch} from "vue-property-decorator"; import { Action, - ActionButton, + ActionButton, Bridgehead, Module, Project, ProjectManagerBackendService, @@ -104,6 +104,8 @@ export default class ResultsBox extends Vue { } resetCanSend() { + this.canSendProjectResults = false; + this.canSendProjectBridgheadResults = false; this.projectManagerBackendService.isModuleActionActive(Module.PROJECT_RESULTS_MODULE, Action.ADD_PROJECT_RESULTS_URL_ACTION).then(condition => { this.canSendProjectResults = condition; }); @@ -113,10 +115,14 @@ export default class ResultsBox extends Vue { } resetCanAccept() { - this.projectManagerBackendService.isModuleActionActive(Module.PROJECT_RESULTS_MODULE, Action.ACCEPT_PROJECT_RESULTS_URL_ACTION).then(condition => { - this.canAcceptProjectResults = condition; - this.updateActionButtons(); - }); + this.canAcceptProjectResults = false; + this.canAcceptProjectBridgheadResults = false; + if (this.currentUsers.length > 0) { // It makes only sense if there are final users + this.projectManagerBackendService.isModuleActionActive(Module.PROJECT_RESULTS_MODULE, Action.ACCEPT_PROJECT_RESULTS_URL_ACTION).then(condition => { + this.canAcceptProjectResults = condition; + this.updateActionButtons(); + }); + } this.projectManagerBackendService.isModuleActionActive(Module.PROJECT_RESULTS_MODULE, Action.ACCEPT_PROJECT_BRIDGEHEAD_RESULTS_URL_ACTION).then(condition => { this.canAcceptProjectBridgheadResults = condition; this.updateActionButtons(); @@ -214,6 +220,24 @@ export default class ResultsBox extends Vue { return true; } + fetchButtonContext(results: Results){ + if (this.canAcceptProjectResults){ + return this.context; + } + if (this.canAcceptProjectBridgheadResults){ + const bridgehead: Bridgehead = {"bridgehead" : results.bridgehead, "projectCode" : this.context.projectCode, "creatorState" : null, "state": null, "queryState": null, "humanReadable": null, "modifiedAt": null}; + return new ProjectManagerContext(this.context.projectCode, bridgehead); + } + } + + fetchUserAccess(results: Results){ + return results.bridgeheadAdminState ? results.bridgeheadAdminState : results.finalUserState; + } + + fetchCreatorState(results: Results){ + return (this.fetchUserAccess(results) === 'ACCEPTED') ? results.creatorState : 'CREATED'; + } + } @@ -318,14 +342,11 @@ export default class ResultsBox extends Vue { - + - + @@ -346,20 +367,20 @@ export default class ResultsBox extends Vue { - - - - - + + + + + +
BridgeheadSite Bridgehead Admin Final User URL -
Final User Acceptance
-
Bridgehead Admin Acceptance
-
User Access Creator Acceptance Actions
+ :class="fetchUserAccess(result)?.toLowerCase()" + :title="fetchUserAccess(result)"/>
-
+
Date: Mon, 20 Jan 2025 14:17:07 +0100 Subject: [PATCH 2/3] Changed: Column order in Bridgehead Overview --- src/components/BridgeheadOverview.vue | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/components/BridgeheadOverview.vue b/src/components/BridgeheadOverview.vue index 00c3248..7ebf6c6 100644 --- a/src/components/BridgeheadOverview.vue +++ b/src/components/BridgeheadOverview.vue @@ -94,7 +94,7 @@ export default class BridgeheadOverview extends Vue { Action = Action; DATASHIELD_STATUS_HEADER = 'DataSHIELD Status'; - headers = ['Sites', 'Votum', 'User Access', 'Teiler', 'Creator Results Acceptance']; + headers = ['Sites', 'Votum', 'Teiler', 'User Access', 'Creator Results Acceptance']; existsVotums: boolean[] = []; dataShieldStatusArray: DataShieldProjectStatus[] = []; selectedBridgehead: number | null = null; From 1e49fb6702de202a52d43038323194c01c8e2894 Mon Sep 17 00:00:00 2001 From: djuarezgf Date: Mon, 20 Jan 2025 14:33:44 +0100 Subject: [PATCH 3/3] Changed: Refactoring Bridgehead Overview --- src/components/BridgeheadOverview.vue | 61 ++++++++++++++++++--------- 1 file changed, 40 insertions(+), 21 deletions(-) diff --git a/src/components/BridgeheadOverview.vue b/src/components/BridgeheadOverview.vue index 7ebf6c6..481f73e 100644 --- a/src/components/BridgeheadOverview.vue +++ b/src/components/BridgeheadOverview.vue @@ -9,24 +9,24 @@
{{ header }} {{ bridgeheads.length }}{{ getVotumStatus()[0] }}
/ {{ getVotumStatus()[1]}}
{{ getBridgeheadStatus()[0] }}
/ {{ getBridgeheadStatus()[1]}}
{{ getDatashieldStatus()[0] }}
/ {{ getDatashieldStatus()[1]}}
{{ getQueryStatus()[0] }}
/ {{ getQueryStatus()[1]}}
{{ getCreatorStatus()[0] }}
/ {{ getCreatorStatus()[1]}}
{{ getVotumStatus()[0] }}
/ {{ getVotumStatus()[1] }}
{{ getQueryStatus()[0] }}
/ {{ getQueryStatus()[1] }}
+ {{ getDatashieldStatus()[0] }}
/ {{ getDatashieldStatus()[1] }}
+
{{ getBridgeheadStatus()[0] }}
/ {{ getBridgeheadStatus()[1] }}
{{ getCreatorStatus()[0] }}
/ {{ getCreatorStatus()[1] }}
- -
{{ bridgehead.humanReadable }}
- -
+
+ {{ bridgehead.humanReadable }} +
+
+ :action="Action.DOWNLOAD_VOTUM_ACTION" + />
-
+
+
+
+
+
+
+
- -
-
-
-
-
+
+
+
+
+
+
+
+
+
@@ -116,7 +129,13 @@ export default class BridgeheadOverview extends Vue { this.existsVotums = await this.fetchExistsVotums(); if (this.project && this.project.type === 'DATASHIELD') { if (!this.headers.includes(this.DATASHIELD_STATUS_HEADER)) { - this.headers.push(this.DATASHIELD_STATUS_HEADER); // We assume that the DataSHIELD Status is the last header + const userAccessIndex = this.headers.indexOf('User Access'); + if (userAccessIndex !== -1) { + this.headers.splice(userAccessIndex, 0, this.DATASHIELD_STATUS_HEADER); + } else { + // If 'User Access' is not found, append the header as a fallback + this.headers.push(this.DATASHIELD_STATUS_HEADER); + } } this.dataShieldStatusArray = await this.fetchDataShieldStates(); }