From 7b25c071db2957f985881f69bf751769755b3524 Mon Sep 17 00:00:00 2001
From: djuarezgf
Date: Wed, 22 Jan 2025 11:12:31 +0100
Subject: [PATCH] ADDED: Results already sent button
---
CHANGELOG.md | 3 ++-
src/components/ResultsBox.vue | 47 +++++++++++++++++++++++++----------
2 files changed, 36 insertions(+), 14 deletions(-)
diff --git a/CHANGELOG.md b/CHANGELOG.md
index 10fa253..8cff8da 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -4,7 +4,7 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](http://keepachangelog.com/)
and this project adheres to [Semantic Versioning](http://semver.org/).
-## [1.1.0 - 2025-01-21]
+## [1.1.0 - 2025-01-22]
### Added
- Dockerfile
- Single Spa
@@ -90,6 +90,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/).
- Fetch email message and subject
- Generate eml and html files for Password Sharing Tool
- Results URL in project
+- Results already sent button
### Changed
- Rename accept and reject bridgehead state buttons (authorize/revoke)
diff --git a/src/components/ResultsBox.vue b/src/components/ResultsBox.vue
index 5cd34ab..7a33d90 100644
--- a/src/components/ResultsBox.vue
+++ b/src/components/ResultsBox.vue
@@ -32,6 +32,8 @@ export default class ResultsBox extends Vue {
@Prop() readonly currentUsers!: User[];
@Prop() readonly projectRoles!: ProjectRole[];
+ readonly RESULTS_ALREADY_SENT = 'Results already sent';
+
resultsUrl = "";
projectResults: Results | undefined = undefined;
projectBridgeheadResults: Results[] | undefined = undefined;
@@ -46,6 +48,7 @@ export default class ResultsBox extends Vue {
// Reactive property to control the visibility of the long message
isExpanded = false;
+
// Method to toggle the visibility
toggleReadMore() {
this.isExpanded = !this.isExpanded;
@@ -204,6 +207,14 @@ export default class ResultsBox extends Vue {
}
}
+ sendResults(resultsUrl: string){
+ if (this.canSendProjectResults){
+ this.sendProjectResults(resultsUrl);
+ } else if (this.canSendProjectBridgheadResults){
+ this.sendProjectBridgeheadResults(resultsUrl);
+ }
+ }
+
sendProjectResults(resultsUrl: string) {
if (resultsUrl && this.canSendProjectResults) {
this.projectManagerBackendService.fetchData(Module.PROJECT_RESULTS_MODULE, Action.ADD_PROJECT_RESULTS_URL_ACTION, this.context, new Map([['results-url', resultsUrl]])).then(response => {
@@ -225,7 +236,7 @@ export default class ResultsBox extends Vue {
}
isButtonVisible(actionButton: ActionButton, results: Results): boolean {
- if (!this.isUrl(results?.url)) {
+ if (!this.isUrl(results?.url) && results?.url != this.RESULTS_ALREADY_SENT) {
return false;
}
if (results.creatorState === 'ACCEPTED' && actionButton.action.includes('ACCEPT')) {
@@ -259,6 +270,10 @@ export default class ResultsBox extends Vue {
return this.projectRoles.includes(ProjectRole.FINAL);
}
+ areResultsAlreadyMarkedAsSent(): boolean{
+ return this.resultsToShow?.length > 0 && this.resultsToShow[0].url == this.RESULTS_ALREADY_SENT;
+ }
+
}
@@ -275,19 +290,20 @@ export default class ResultsBox extends Vue {
request creator, either through this interface or, if necessary, via other communication methods such as email
or messaging.
-
-
-
+
+
+
+
+
@@ -512,4 +528,9 @@ p {
color: #0056b3;
}
+.results-url-sender{
+ display: flex;
+ gap: 10px; /* Adds space between buttons */
+}
+