From 457b3b5bfa8e5622f252742a70f7bbb0d1c3e7e8 Mon Sep 17 00:00:00 2001 From: Martin Etmajer Date: Fri, 3 Apr 2020 16:21:02 +0200 Subject: [PATCH] Improve WIP watermark Jira notification message (#181) --- src/org/ods/usecase/LeVADocumentUseCase.groovy | 6 +++--- src/org/ods/util/Project.groovy | 4 ++-- test/groovy/org/ods/util/ProjectSpec.groovy | 2 +- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/org/ods/usecase/LeVADocumentUseCase.groovy b/src/org/ods/usecase/LeVADocumentUseCase.groovy index 6a596719..65ed5559 100644 --- a/src/org/ods/usecase/LeVADocumentUseCase.groovy +++ b/src/org/ods/usecase/LeVADocumentUseCase.groovy @@ -60,9 +60,9 @@ class LeVADocumentUseCase extends DocGenUseCase { DocumentType.CFTR as String ] - private static String DEVELOPER_PREVIEW_WATERMARK = "Developer Preview" - private static String WORK_IN_PROGRESS_WATERMARK = "Work in Progress" - private static String WORK_IN_PROGRESS_DOCUMENT_MESSAGE = "Attention: this document is work in progress!" + public static String DEVELOPER_PREVIEW_WATERMARK = "Developer Preview" + public static String WORK_IN_PROGRESS_WATERMARK = "Work in Progress" + public static String WORK_IN_PROGRESS_DOCUMENT_MESSAGE = "Attention: this document is work in progress!" private JenkinsService jenkins private JiraUseCase jiraUseCase diff --git a/src/org/ods/util/Project.groovy b/src/org/ods/util/Project.groovy index b78269d8..cd602bcc 100644 --- a/src/org/ods/util/Project.groovy +++ b/src/org/ods/util/Project.groovy @@ -281,7 +281,7 @@ class Project { this.data.jira.undone.docChapters = [:] if (this.hasWipJiraIssues()) { - def message = "The following issues were detected to be work in progress:" + def message = "Pipeline-generated documents are watermarked '${LeVADocumentUseCase.WORK_IN_PROGRESS_WATERMARK}' since the following issues are work in progress:" this.getWipJiraIssues().each { type, keys -> def values = keys instanceof Map ? keys.values().flatten() : keys if (!values.isEmpty()) { @@ -1045,7 +1045,7 @@ class Project { if (!services?.jira && capabilities?.empty) { result.remove("jira") } - + // Don't serialize temporarily stored document artefacts result.metadata.repositories.each { repo -> repo.data?.remove("documents") diff --git a/test/groovy/org/ods/util/ProjectSpec.groovy b/test/groovy/org/ods/util/ProjectSpec.groovy index 3bec82eb..2cc8753d 100644 --- a/test/groovy/org/ods/util/ProjectSpec.groovy +++ b/test/groovy/org/ods/util/ProjectSpec.groovy @@ -731,7 +731,7 @@ class ProjectSpec extends SpecHelper { expected[type] = [ "${type}-1", "${type}-2" ] } - def expectedMessage = "The following issues were detected to be work in progress:" + def expectedMessage = "Pipeline-generated documents are watermarked '${LeVADocumentUseCase.WORK_IN_PROGRESS_WATERMARK}' since the following issues are work in progress:" Project.JiraDataItem.TYPES_WITH_STATUS.each { type -> expectedMessage += "\n\n${type.capitalize()}: ${type}-1, ${type}-2" }