Skip to content

Commit

Permalink
Added: Votum for all
Browse files Browse the repository at this point in the history
  • Loading branch information
djuarezgf committed Jan 22, 2025
1 parent 9efd8a7 commit 03ab1a6
Show file tree
Hide file tree
Showing 4 changed files with 50 additions and 0 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/).
- Results URL in project
- Results already sent button
- Votum in project view overview with only one bridgehead
- Votum for all

### Changed
- Rename accept and reject bridgehead state buttons (authorize/revoke)
Expand Down
15 changes: 15 additions & 0 deletions src/components/BridgeheadOverview.vue
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,17 @@
:action="Action.DOWNLOAD_VOTUM_ACTION"
/>
</div>
<div v-else-if="existsVotumForAllBridgeheads" class="states-circle-container">
<div class="state_circle green"></div>
<DownloadButton
:context="fetchContext(bridgehead)"
:project-manager-backend-service="projectManagerBackendService"
icon-class="bi bi-download"
button-class="download-button"
:module="Module.PROJECT_DOCUMENTS_MODULE"
:action="Action.DOWNLOAD_VOTUM_FOR_ALL_BRIDGEHEADS_ACTION"
/>
</div>
<div v-else class="states-circle-container"><div class="state_circle red"></div></div>
</div>
<div v-else-if="header === 'Teiler'" class="states-circle-container">
Expand Down Expand Up @@ -100,6 +111,7 @@ export default class BridgeheadOverview extends Vue {
@Prop() readonly projectManagerBackendService!: ProjectManagerBackendService;
@Prop() readonly bridgeheads!: Bridgehead[];
@Prop() readonly project!: Project;
@Prop() readonly existsVotumForAllBridgeheads!: boolean;
@Prop({type: Function, required: true}) readonly callUpdateActiveBridgehead!: (param: Bridgehead) => void;
Expand Down Expand Up @@ -189,6 +201,9 @@ export default class BridgeheadOverview extends Vue {
getVotumStatus(): number[] {
const hasVotum = this.existsVotums.filter((votum) => votum);
const noVotum = this.existsVotums.filter((votum) => !votum);
if (this.existsVotumForAllBridgeheads && hasVotum.length == 0){
return [1, 0];
}
return [hasVotum.length, noVotum.length]
}
getBridgeheadStatus(): number[] {
Expand Down
30 changes: 30 additions & 0 deletions src/components/ProjectView.vue
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@
:call-update-active-bridgehead="updateActiveBridgehead"
:context="context"
:project="project"
:exists-votum-for-all-bridgeheads="existsVotumForAllBridgeheads"
:bridgeheads="visibleBridgeheads"
:activeBridgehead="activeBridgehead"/>
<br/>
Expand Down Expand Up @@ -74,6 +75,17 @@
:action="Action.DOWNLOAD_VOTUM_ACTION"
/>
</div>
<div v-else-if="existsVotumForAllBridgeheads" class="states-circle-container">
<div class="state_circle green"></div>
<DownloadButton
:context="context"
:project-manager-backend-service="projectManagerBackendService"
icon-class="bi bi-download"
button-class="download-button"
:module="Module.PROJECT_DOCUMENTS_MODULE"
:action="Action.DOWNLOAD_VOTUM_FOR_ALL_BRIDGEHEADS_ACTION"
/>
</div>
<div v-else class="states-circle-container"><div class="state_circle red"/></div>
</div>
</td>
Expand Down Expand Up @@ -418,6 +430,7 @@ export default defineComponent({
showExplanations: true,
showRightPanel: true,
existsVotum: false,
existsVotumForAllBridgeheads: false,
existsAuthenticationScript: false,
existsApplicationForm: false,
existsScript: false,
Expand All @@ -431,6 +444,7 @@ export default defineComponent({
applicationFormDescription: {} as ProjectDocument,
scriptDescription: {} as ProjectDocument,
votumDescription: {} as ProjectDocument,
votumForAllBridgeheadsDescription: {} as ProjectDocument,
existInvitedUsers: false,
areExportFilesTransferredToResearchEnvironment: false,
explanations: new Map() as Explanations,
Expand Down Expand Up @@ -601,6 +615,12 @@ export default defineComponent({
this.initializeData(Module.PROJECT_DOCUMENTS_MODULE, Action.FETCH_VOTUM_DESCRIPTION_ACTION, new Map(), 'votumDescription');
}
}),
this.initializeDataInCallback(Module.PROJECT_DOCUMENTS_MODULE, Action.EXISTS_VOTUM_FOR_ALL_BRIDGEHEADS_ACTION, new Map(), async (result: boolean) => {
this.existsVotumForAllBridgeheads = result;
if (this.existsVotumForAllBridgeheads) {
this.initializeData(Module.PROJECT_DOCUMENTS_MODULE, Action.FETCH_VOTUM_FOR_ALL_BRIDGEHEADS_DESCRIPTION_ACTION, new Map(), 'votumForAllBridgeheadsDescription');
}
}),
this.initializeDataInCallback(Module.PROJECT_DOCUMENTS_MODULE, Action.EXISTS_APPLICATION_FORM_ACTION, new Map(), async (result: boolean) => {
this.existsApplicationForm = result;
if (this.existsApplicationForm) {
Expand Down Expand Up @@ -924,6 +944,16 @@ export default defineComponent({
downloadModule: this.Module.PROJECT_DOCUMENTS_MODULE,
visibilityCondition: !this.existsDraftDialog || this.draftDialogStepper.currentStep === DialogStep.SUMMARY
},
{
fieldKey: "Votum for all bridgeheads",
fieldValue: [this.votumForAllBridgeheadsDescription.label, this.votumForAllBridgeheadsDescription.originalFilename],
isEditable: true,
existFile: this.existsVotumForAllBridgeheads,
uploadAction: this.Action.UPLOAD_VOTUM_FOR_ALL_BRIDGEHEADS_ACTION,
downloadAction: this.Action.DOWNLOAD_VOTUM_FOR_ALL_BRIDGEHEADS_ACTION,
downloadModule: this.Module.PROJECT_DOCUMENTS_MODULE,
visibilityCondition: !this.existsDraftDialog || this.draftDialogStepper.currentStep === DialogStep.SUMMARY
},
{
fieldKey: "Script",
fieldValue: [this.scriptDescription.label, this.scriptDescription.originalFilename],
Expand Down
4 changes: 4 additions & 0 deletions src/services/projectManagerBackendService.ts
Original file line number Diff line number Diff line change
Expand Up @@ -63,14 +63,17 @@ export enum Action {
FETCH_QUERY_FORMATS_ACTION = "FETCH_QUERY_FORMATS",
FETCH_OUTPUT_FORMATS_ACTION = "FETCH_OUTPUT_FORMATS",
UPLOAD_VOTUM_ACTION = "UPLOAD_VOTUM",
UPLOAD_VOTUM_FOR_ALL_BRIDGEHEADS_ACTION = "UPLOAD_VOTUM_FOR_ALL_BRIDGEHEADS",
UPLOAD_APPLICATION_FORM_ACTION = "UPLOAD_APPLICATION_FORM",
UPLOAD_PUBLICATION_ACTION = "UPLOAD_PUBLICATION",
UPLOAD_SCRIPT_ACTION = "UPLOAD_SCRIPT",
UPLOAD_OTHER_DOCUMENT_ACTION = "UPLOAD_OTHER_DOCUMENT",
ADD_PUBLICATION_URL_ACTION = "ADD_PUBLICATION_URL",
ADD_OTHER_DOCUMENT_URL_ACTION = "ADD_OTHER_DOCUMENT_URL",
DOWNLOAD_VOTUM_ACTION = "DOWNLOAD_VOTUM",
DOWNLOAD_VOTUM_FOR_ALL_BRIDGEHEADS_ACTION = "DOWNLOAD_VOTUM_FOR_ALL_BRIDGEHEADS",
EXISTS_VOTUM_ACTION = "EXISTS_VOTUM",
EXISTS_VOTUM_FOR_ALL_BRIDGEHEADS_ACTION = "EXISTS_VOTUM_FOR_ALL_BRIDGEHEADS",
EXISTS_APPLICATION_FORM_ACTION = "EXISTS_APPLICATION_FORM",
DOWNLOAD_APPLICATION_FORM_ACTION = "DOWNLOAD_APPLICATION_FORM",
DOWNLOAD_PUBLICATION_ACTION = "DOWNLOAD_PUBLICATION",
Expand Down Expand Up @@ -107,6 +110,7 @@ export enum Action {
FETCH_PROJECT_ROLES_ACTION = "FETCH_PROJECT_ROLES",
FETCH_APPLICATION_FORM_DESCRIPTION_ACTION = "FETCH_APPLICATION_FORM_DESCRIPTION",
FETCH_VOTUM_DESCRIPTION_ACTION = "FETCH_VOTUM_DESCRIPTION",
FETCH_VOTUM_FOR_ALL_BRIDGEHEADS_DESCRIPTION_ACTION = "FETCH_VOTUM_FOR_ALL_BRIDGEHEADS_DESCRIPTION",
FETCH_SCRIPT_DESCRIPTION_ACTION = "FETCH_SCRIPT_DESCRIPTION",
EXIST_INVITED_USERS_ACTION = "EXIST_INVITED_USERS",
ACCEPT_PROJECT_ANALYSIS_ACTION = "ACCEPT_PROJECT_ANALYSIS",
Expand Down

0 comments on commit 03ab1a6

Please sign in to comment.