From 0bf2445b8f92b8ac7e798a500699f23cebe875a1 Mon Sep 17 00:00:00 2001 From: Tilo Villwock Date: Tue, 19 Nov 2024 12:24:45 +0100 Subject: [PATCH 1/6] #3216 Added additional checks for existing releases when saving --- .../views/analysis-package-edit-or-create.controller.js | 5 ++++- .../views/data-set-edit-or-create.controller.js | 5 ++++- .../views/instrument-edit-or-create.controller.js | 5 ++++- .../views/survey-edit-or-create.controller.js | 5 ++++- 4 files changed, 16 insertions(+), 4 deletions(-) diff --git a/mdm-frontend/src/app/legacy/analysispackagemanagement/views/analysis-package-edit-or-create.controller.js b/mdm-frontend/src/app/legacy/analysispackagemanagement/views/analysis-package-edit-or-create.controller.js index bec525ee56..604cbf7d7f 100644 --- a/mdm-frontend/src/app/legacy/analysispackagemanagement/views/analysis-package-edit-or-create.controller.js +++ b/mdm-frontend/src/app/legacy/analysispackagemanagement/views/analysis-package-edit-or-create.controller.js @@ -485,7 +485,10 @@ angular.module('metadatamanagementApp') ctrl.saveAnalysisPackage = function() { if ($scope.analysisPackageForm.$valid) { - if (CurrentProjectService.getCurrentProject().release.isPreRelease) { + if (CurrentProjectService.getCurrentProject() && + CurrentProjectService.getCurrentProject().release && + CurrentProjectService.getCurrentProject().release.isPreRelease + ) { CommonDialogsService.showConfirmEditPreReleaseDialog( 'global.common-dialogs' + '.confirm-edit-pre-released-project.title', diff --git a/mdm-frontend/src/app/legacy/datasetmanagement/views/data-set-edit-or-create.controller.js b/mdm-frontend/src/app/legacy/datasetmanagement/views/data-set-edit-or-create.controller.js index 289f5641fa..709765052f 100644 --- a/mdm-frontend/src/app/legacy/datasetmanagement/views/data-set-edit-or-create.controller.js +++ b/mdm-frontend/src/app/legacy/datasetmanagement/views/data-set-edit-or-create.controller.js @@ -348,7 +348,10 @@ angular.module('metadatamanagementApp') ctrl.saveDataSet = function() { if ($scope.dataSetForm.$valid) { - if (CurrentProjectService.getCurrentProject().release.isPreRelease) { + if (CurrentProjectService.getCurrentProject() && + CurrentProjectService.getCurrentProject().release && + CurrentProjectService.getCurrentProject().release.isPreRelease + ) { CommonDialogsService.showConfirmEditPreReleaseDialog( 'global.common-dialogs' + '.confirm-edit-pre-released-project.title', diff --git a/mdm-frontend/src/app/legacy/instrumentmanagement/views/instrument-edit-or-create.controller.js b/mdm-frontend/src/app/legacy/instrumentmanagement/views/instrument-edit-or-create.controller.js index 01643821a1..e4f12f07e4 100644 --- a/mdm-frontend/src/app/legacy/instrumentmanagement/views/instrument-edit-or-create.controller.js +++ b/mdm-frontend/src/app/legacy/instrumentmanagement/views/instrument-edit-or-create.controller.js @@ -268,7 +268,10 @@ angular.module('metadatamanagementApp') ctrl.saveInstrument = function() { if ($scope.instrumentForm.$valid) { - if (CurrentProjectService.getCurrentProject().release.isPreRelease) { + if (CurrentProjectService.getCurrentProject() && + CurrentProjectService.getCurrentProject().release && + CurrentProjectService.getCurrentProject().release.isPreRelease + ) { CommonDialogsService.showConfirmEditPreReleaseDialog( 'global.common-dialogs' + '.confirm-edit-pre-released-project.title', diff --git a/mdm-frontend/src/app/legacy/surveymanagement/views/survey-edit-or-create.controller.js b/mdm-frontend/src/app/legacy/surveymanagement/views/survey-edit-or-create.controller.js index a3b0b3faaa..47ba831b5d 100644 --- a/mdm-frontend/src/app/legacy/surveymanagement/views/survey-edit-or-create.controller.js +++ b/mdm-frontend/src/app/legacy/surveymanagement/views/survey-edit-or-create.controller.js @@ -244,7 +244,10 @@ angular.module('metadatamanagementApp') ctrl.saveSurvey = function() { if ($scope.surveyForm.$valid) { - if (CurrentProjectService.getCurrentProject().release.isPreRelease) { + if (CurrentProjectService.getCurrentProject() && + CurrentProjectService.getCurrentProject().release && + CurrentProjectService.getCurrentProject().release.isPreRelease + ) { CommonDialogsService.showConfirmEditPreReleaseDialog( 'global.common-dialogs' + '.confirm-edit-pre-released-project.title', From d29c68b7be6cc25755139e71f7a36ef17d1c84b4 Mon Sep 17 00:00:00 2001 From: theresa Date: Thu, 28 Nov 2024 12:43:36 +0100 Subject: [PATCH 2/6] #3216: added projectID to messageBus onDataPackageChange for public users to ensure correct display of details page --- .../views/data-package-detail.controller.js | 3 ++- .../datasetmanagement/views/dataSet-detail.controller.js | 3 ++- .../views/instrument-detail.controller.js | 3 ++- .../components/data-package-configurator.controller.js | 5 +++++ .../surveymanagement/views/survey-detail.controller.js | 3 ++- .../variablemanagement/views/variable-detail.controller.js | 3 ++- 6 files changed, 15 insertions(+), 5 deletions(-) diff --git a/mdm-frontend/src/app/legacy/datapackagemanagement/views/data-package-detail.controller.js b/mdm-frontend/src/app/legacy/datapackagemanagement/views/data-package-detail.controller.js index be7d9e5fa3..80b7f8fcf4 100644 --- a/mdm-frontend/src/app/legacy/datapackagemanagement/views/data-package-detail.controller.js +++ b/mdm-frontend/src/app/legacy/datapackagemanagement/views/data-package-detail.controller.js @@ -180,7 +180,8 @@ angular.module('metadatamanagementApp') if (!Principal.isAuthenticated()) { MessageBus.set('onDataPackageChange', { - masterId: result.masterId + masterId: result.masterId, + projectId: result.dataAcquisitionProjectId }); MessageBus.set('onDetailViewLoaded', {type: 'dataPackage'}); } else { diff --git a/mdm-frontend/src/app/legacy/datasetmanagement/views/dataSet-detail.controller.js b/mdm-frontend/src/app/legacy/datasetmanagement/views/dataSet-detail.controller.js index e5967d30a7..eac2178c00 100644 --- a/mdm-frontend/src/app/legacy/datasetmanagement/views/dataSet-detail.controller.js +++ b/mdm-frontend/src/app/legacy/datasetmanagement/views/dataSet-detail.controller.js @@ -82,7 +82,8 @@ angular.module('metadatamanagementApp') if (!Principal.isAuthenticated()) { MessageBus.set('onDataPackageChange', { - masterId: result.dataPackage.masterId + masterId: result.dataPackage.masterId, + projectId: result.dataAcquisitionProjectId }); } diff --git a/mdm-frontend/src/app/legacy/instrumentmanagement/views/instrument-detail.controller.js b/mdm-frontend/src/app/legacy/instrumentmanagement/views/instrument-detail.controller.js index 684e58855c..990f33d064 100644 --- a/mdm-frontend/src/app/legacy/instrumentmanagement/views/instrument-detail.controller.js +++ b/mdm-frontend/src/app/legacy/instrumentmanagement/views/instrument-detail.controller.js @@ -94,7 +94,8 @@ angular.module('metadatamanagementApp') if (!Principal.isAuthenticated()) { MessageBus.set('onDataPackageChange', { - masterId: result.dataPackage.masterId + masterId: result.dataPackage.masterId, + projectId: result.dataAcquisitionProjectId }); } PageMetadataService.setPageTitle('instrument-management.' + diff --git a/mdm-frontend/src/app/legacy/ordermanagement/components/data-package-configurator.controller.js b/mdm-frontend/src/app/legacy/ordermanagement/components/data-package-configurator.controller.js index 1379491985..08a12ce281 100644 --- a/mdm-frontend/src/app/legacy/ordermanagement/components/data-package-configurator.controller.js +++ b/mdm-frontend/src/app/legacy/ordermanagement/components/data-package-configurator.controller.js @@ -135,6 +135,11 @@ function loadDataPackage(id, version) { $rootScope.$broadcast('start-ignoring-404'); + // sometimes on init there is no project id, because it is loaded later on + if (id === undefined) { + console.debug("No project ID provided to search by.") + return; + } $ctrl.noFinalRelease = false; var excludes = ['nested*','variables','questions', 'surveys','instruments', 'relatedPublications', diff --git a/mdm-frontend/src/app/legacy/surveymanagement/views/survey-detail.controller.js b/mdm-frontend/src/app/legacy/surveymanagement/views/survey-detail.controller.js index ef66dc214c..5ae8ebd060 100644 --- a/mdm-frontend/src/app/legacy/surveymanagement/views/survey-detail.controller.js +++ b/mdm-frontend/src/app/legacy/surveymanagement/views/survey-detail.controller.js @@ -90,7 +90,8 @@ angular.module('metadatamanagementApp') if (!Principal.isAuthenticated()) { MessageBus.set('onDataPackageChange', { - masterId: survey.dataPackage.masterId + masterId: survey.dataPackage.masterId, + projectId: survey.dataAcquisitionProjectId }); } BreadcrumbService.updateToolbarHeader({ diff --git a/mdm-frontend/src/app/legacy/variablemanagement/views/variable-detail.controller.js b/mdm-frontend/src/app/legacy/variablemanagement/views/variable-detail.controller.js index 98e5e994f8..f45ecdae33 100644 --- a/mdm-frontend/src/app/legacy/variablemanagement/views/variable-detail.controller.js +++ b/mdm-frontend/src/app/legacy/variablemanagement/views/variable-detail.controller.js @@ -127,7 +127,8 @@ angular.module('metadatamanagementApp') if (!Principal.isAuthenticated()) { MessageBus.set('onDataPackageChange', { - masterId: result.dataPackage.masterId + masterId: result.dataPackage.masterId, + projectId: result.dataAcquisitionProjectId }); } if (result.repeatedMeasurementIdentifier) { From 72eb6196117c50e47ab520e8847ec2197d79cba2 Mon Sep 17 00:00:00 2001 From: theresa Date: Thu, 28 Nov 2024 14:28:48 +0100 Subject: [PATCH 3/6] #3216: added confirm dialog on adding attachments to pre-released dataPackages --- .../dialogs/services/commonDialogs.service.js | 13 ++++++++++++ .../i18n/configuration/translations-de.js | 6 +++++- .../i18n/configuration/translations-en.js | 6 +++++- .../data-package-edit-or-create.controller.js | 20 ++++++++++++++++++- 4 files changed, 42 insertions(+), 3 deletions(-) diff --git a/mdm-frontend/src/app/legacy/common/dialogs/services/commonDialogs.service.js b/mdm-frontend/src/app/legacy/common/dialogs/services/commonDialogs.service.js index 036643e28a..3048463abe 100644 --- a/mdm-frontend/src/app/legacy/common/dialogs/services/commonDialogs.service.js +++ b/mdm-frontend/src/app/legacy/common/dialogs/services/commonDialogs.service.js @@ -102,6 +102,18 @@ angular.module('metadatamanagementApp').factory('CommonDialogsService', ['$mdDia return $mdDialog.show(confirmDialog); }; + var showConfirmAddAttachmentPreReleaseDialog = function(titleKey, titleParams, contentKey, + contentParams, targetEvent) { + var confirmDialog = $mdDialog.confirm({ + onComplete: focusCancelButton + }).title($translate.instant(titleKey, titleParams)).textContent( + $translate.instant(contentKey, contentParams)) + .ok($translate.instant('global.common-dialogs.confirm-edit-pre-released-project.attachment-yes')) + .cancel($translate.instant('global.common-dialogs.confirm-edit-pre-released-project.attachment-no')) + .targetEvent(targetEvent); + return $mdDialog.show(confirmDialog); + }; + /** * Shows an info dialog with title and content and only one action * button to close the dialog. @@ -128,6 +140,7 @@ angular.module('metadatamanagementApp').factory('CommonDialogsService', ['$mdDia showConfirmFilenameChangedDialog: showConfirmFilenameChangedDialog, showConfirmDeletionDialog: showConfirmDeletionDialog, showConfirmEditPreReleaseDialog: showConfirmEditPreReleaseDialog, + showConfirmAddAttachmentPreReleaseDialog: showConfirmAddAttachmentPreReleaseDialog, showInfoDialog: showInfoDialog }; }]); diff --git a/mdm-frontend/src/app/legacy/common/i18n/configuration/translations-de.js b/mdm-frontend/src/app/legacy/common/i18n/configuration/translations-de.js index 1bccdbce49..21a71b4300 100644 --- a/mdm-frontend/src/app/legacy/common/i18n/configuration/translations-de.js +++ b/mdm-frontend/src/app/legacy/common/i18n/configuration/translations-de.js @@ -471,7 +471,11 @@ angular.module('metadatamanagementApp').config([ 'title': 'Änderungen freigeben?', 'content': 'Dieses Projekt ist aktuell vorläufig freigegeben. Jede gespeicherte Änderung ist unmittelbar öffentlich einsehbar. Bitte bestätigen Sie, dass Sie die Änderung speichern möchten.', 'yes': 'Änderungen freigeben', - 'no': 'Bearbeitung fortsetzen' + 'no': 'Bearbeitung fortsetzen', + 'attachment-title': 'Materialien freigeben?', + 'attachment-content': 'Dieses Projekt ist aktuell vorläufig freigegeben. Hinzugefügte Anhänge sind unmittelbar öffentlich einsehbar. Möchten Sie fortfahren?', + 'attachment-yes': 'Ja', + 'attachment-no': 'Abbrechen' }, 'confirm-edit-embargo-date': { 'title': 'Embargodatum ändern?', diff --git a/mdm-frontend/src/app/legacy/common/i18n/configuration/translations-en.js b/mdm-frontend/src/app/legacy/common/i18n/configuration/translations-en.js index 2e3f25030c..b68ae2a7a8 100644 --- a/mdm-frontend/src/app/legacy/common/i18n/configuration/translations-en.js +++ b/mdm-frontend/src/app/legacy/common/i18n/configuration/translations-en.js @@ -471,7 +471,11 @@ angular.module('metadatamanagementApp').config([ 'title': 'Publish changes?', 'content': 'This project is currently preliminarly released. Every saved change is immediately visible to the public. Please confirm that you want to save the changes.', 'yes': 'Publish changes', - 'no': 'Continue editing' + 'no': 'Continue editing', + 'attachment-title': 'Publish documents?', + 'attachment-content': 'This project is currently preliminarly released. Added documents are immediatly visible to the public. Do you want to continue?', + 'attachment-yes': 'Yes', + 'attachment-no': 'Cancel' }, 'confirm-edit-embargo-date': { 'title': 'Change embargo date?', diff --git a/mdm-frontend/src/app/legacy/datapackagemanagement/views/data-package-edit-or-create.controller.js b/mdm-frontend/src/app/legacy/datapackagemanagement/views/data-package-edit-or-create.controller.js index 511bca8e01..02aad018f9 100644 --- a/mdm-frontend/src/app/legacy/datapackagemanagement/views/data-package-edit-or-create.controller.js +++ b/mdm-frontend/src/app/legacy/datapackagemanagement/views/data-package-edit-or-create.controller.js @@ -828,11 +828,29 @@ angular.module('metadatamanagementApp') labels: getDialogLabels() }; - AttachmentDialogService + if (CurrentProjectService.getCurrentProject().release.isPreRelease) { + CommonDialogsService.showConfirmAddAttachmentPreReleaseDialog( + 'global.common-dialogs' + + '.confirm-edit-pre-released-project.attachment-title', + {}, + 'global.common-dialogs' + + '.confirm-edit-pre-released-project.attachment-content', + {}, + null + ).then(function success() { + AttachmentDialogService + .showDialog(dialogConfig, event) + .then(function() { + ctrl.loadAttachments(true); + }); + }); + } else { + AttachmentDialogService .showDialog(dialogConfig, event) .then(function() { ctrl.loadAttachments(true); }); + } }; ctrl.moveAttachmentUp = function() { From a2c4efae590b7ae6b68432a7e7e66e422128579d Mon Sep 17 00:00:00 2001 From: theresa Date: Thu, 28 Nov 2024 14:47:26 +0100 Subject: [PATCH 4/6] #3216: fixed adding attachments for surveys because they do not have attachements types specified --- .../common/dialogs/attachment/attachmentDialog.controller.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mdm-frontend/src/app/legacy/common/dialogs/attachment/attachmentDialog.controller.js b/mdm-frontend/src/app/legacy/common/dialogs/attachment/attachmentDialog.controller.js index c5cff8ad2c..c4e76de923 100644 --- a/mdm-frontend/src/app/legacy/common/dialogs/attachment/attachmentDialog.controller.js +++ b/mdm-frontend/src/app/legacy/common/dialogs/attachment/attachmentDialog.controller.js @@ -147,7 +147,7 @@ angular.module('metadatamanagementApp').controller('AttachmentDialogController', if ($scope.attachmentForm.$valid) { // before saving, remove empty author array entries; we assume that entry is null if 'firstName' // is null because it is one of the mandatory fields - if (ctrl.attachmentMetadata.type.en === "Questionnaire" || ctrl.attachmentMetadata.type.en === "Variable Questionnaire") { + if (ctrl.attachmentMetadata.type != null && (ctrl.attachmentMetadata.type.en === "Questionnaire" || ctrl.attachmentMetadata.type.en === "Variable Questionnaire")) { ctrl.attachmentMetadata.citationDetails.authors = ctrl.attachmentMetadata.citationDetails.authors.filter( author => author.firstName && author.firstName.trim() !== ""); } From 875b0515d7a66aac156642e89fa765dcfd735059 Mon Sep 17 00:00:00 2001 From: theresa Date: Thu, 28 Nov 2024 14:48:36 +0100 Subject: [PATCH 5/6] #3216: added confirm dialogs on adding attachments to pre-released projects for analysis packages, concepts, datasets, instruments and surveys --- ...lysis-package-edit-or-create.controller.js | 20 ++++++++++++- .../concept-edit-or-create.controller.js | 23 +++++++++++++-- .../data-set-edit-or-create.controller.js | 28 +++++++++++++++---- .../instrument-edit-or-create.controller.js | 28 +++++++++++++++---- .../views/survey-edit-or-create.controller.js | 20 ++++++++++++- 5 files changed, 105 insertions(+), 14 deletions(-) diff --git a/mdm-frontend/src/app/legacy/analysispackagemanagement/views/analysis-package-edit-or-create.controller.js b/mdm-frontend/src/app/legacy/analysispackagemanagement/views/analysis-package-edit-or-create.controller.js index 604cbf7d7f..cb0e545cc5 100644 --- a/mdm-frontend/src/app/legacy/analysispackagemanagement/views/analysis-package-edit-or-create.controller.js +++ b/mdm-frontend/src/app/legacy/analysispackagemanagement/views/analysis-package-edit-or-create.controller.js @@ -790,11 +790,29 @@ angular.module('metadatamanagementApp') labels: getDialogLabels() }; - AttachmentDialogService + if (CurrentProjectService.getCurrentProject().release.isPreRelease) { + CommonDialogsService.showConfirmAddAttachmentPreReleaseDialog( + 'global.common-dialogs' + + '.confirm-edit-pre-released-project.attachment-title', + {}, + 'global.common-dialogs' + + '.confirm-edit-pre-released-project.attachment-content', + {}, + null + ).then(function success() { + AttachmentDialogService + .showDialog(dialogConfig, event) + .then(function() { + ctrl.loadAttachments(true); + }); + }); + } else { + AttachmentDialogService .showDialog(dialogConfig, event) .then(function() { ctrl.loadAttachments(true); }); + } }; ctrl.moveAttachmentUp = function() { diff --git a/mdm-frontend/src/app/legacy/conceptmanagement/views/concept-edit-or-create.controller.js b/mdm-frontend/src/app/legacy/conceptmanagement/views/concept-edit-or-create.controller.js index 81443bb07e..adcc91af28 100644 --- a/mdm-frontend/src/app/legacy/conceptmanagement/views/concept-edit-or-create.controller.js +++ b/mdm-frontend/src/app/legacy/conceptmanagement/views/concept-edit-or-create.controller.js @@ -26,6 +26,7 @@ angular.module('metadatamanagementApp') 'ChoosePreviousVersionService', 'ConceptVersionsResource', '$mdDialog', + 'CurrentProjectService', function(entity, PageMetadataService, $timeout, $state, BreadcrumbService, Principal, SimpleMessageToastService, ConceptResource, ConceptSearchService, $scope, $q, @@ -33,7 +34,7 @@ angular.module('metadatamanagementApp') CommonDialogsService, LanguageService, ConceptAttachmentUploadService, ConceptAttachmentResource, AttachmentDialogService, ConceptAttachmentVersionsResource, ChoosePreviousVersionService, - ConceptVersionsResource, $mdDialog) { + ConceptVersionsResource, $mdDialog, CurrentProjectService) { var ctrl = this; @@ -363,11 +364,29 @@ angular.module('metadatamanagementApp') labels: getDialogLabels() }; - AttachmentDialogService + if (CurrentProjectService.getCurrentProject().release.isPreRelease) { + CommonDialogsService.showConfirmAddAttachmentPreReleaseDialog( + 'global.common-dialogs' + + '.confirm-edit-pre-released-project.attachment-title', + {}, + 'global.common-dialogs' + + '.confirm-edit-pre-released-project.attachment-content', + {}, + null + ).then(function success() { + AttachmentDialogService + .showDialog(dialogConfig, event) + .then(function() { + ctrl.loadAttachments(true); + }); + }); + } else { + AttachmentDialogService .showDialog(dialogConfig, event) .then(function() { ctrl.loadAttachments(true); }); + } }; ctrl.moveAttachmentUp = function() { diff --git a/mdm-frontend/src/app/legacy/datasetmanagement/views/data-set-edit-or-create.controller.js b/mdm-frontend/src/app/legacy/datasetmanagement/views/data-set-edit-or-create.controller.js index 709765052f..a675f6aa93 100644 --- a/mdm-frontend/src/app/legacy/datasetmanagement/views/data-set-edit-or-create.controller.js +++ b/mdm-frontend/src/app/legacy/datasetmanagement/views/data-set-edit-or-create.controller.js @@ -591,11 +591,29 @@ angular.module('metadatamanagementApp') labels: getDialogLabels() }; - AttachmentDialogService - .showDialog(dialogConfig, event) - .then(function() { - ctrl.loadAttachments(true); - }); + if (CurrentProjectService.getCurrentProject().release.isPreRelease) { + CommonDialogsService.showConfirmAddAttachmentPreReleaseDialog( + 'global.common-dialogs' + + '.confirm-edit-pre-released-project.attachment-title', + {}, + 'global.common-dialogs' + + '.confirm-edit-pre-released-project.attachment-content', + {}, + null + ).then(function success() { + AttachmentDialogService + .showDialog(dialogConfig, event) + .then(function() { + ctrl.loadAttachments(true); + }); + }); + } else { + AttachmentDialogService + .showDialog(dialogConfig, event) + .then(function() { + ctrl.loadAttachments(true); + }); + } }; ctrl.moveAttachmentUp = function() { diff --git a/mdm-frontend/src/app/legacy/instrumentmanagement/views/instrument-edit-or-create.controller.js b/mdm-frontend/src/app/legacy/instrumentmanagement/views/instrument-edit-or-create.controller.js index e4f12f07e4..efc99027e4 100644 --- a/mdm-frontend/src/app/legacy/instrumentmanagement/views/instrument-edit-or-create.controller.js +++ b/mdm-frontend/src/app/legacy/instrumentmanagement/views/instrument-edit-or-create.controller.js @@ -520,11 +520,29 @@ angular.module('metadatamanagementApp') exclude: ['title'] }; - AttachmentDialogService - .showDialog(dialogConfig, event) - .then(function() { - ctrl.loadAttachments(true); - }); + if (CurrentProjectService.getCurrentProject().release.isPreRelease) { + CommonDialogsService.showConfirmAddAttachmentPreReleaseDialog( + 'global.common-dialogs' + + '.confirm-edit-pre-released-project.attachment-title', + {}, + 'global.common-dialogs' + + '.confirm-edit-pre-released-project.attachment-content', + {}, + null + ).then(function success() { + AttachmentDialogService + .showDialog(dialogConfig, event) + .then(function() { + ctrl.loadAttachments(true); + }); + }); + } else { + AttachmentDialogService + .showDialog(dialogConfig, event) + .then(function() { + ctrl.loadAttachments(true); + }); + } }; /** diff --git a/mdm-frontend/src/app/legacy/surveymanagement/views/survey-edit-or-create.controller.js b/mdm-frontend/src/app/legacy/surveymanagement/views/survey-edit-or-create.controller.js index 47ba831b5d..b5e41d3950 100644 --- a/mdm-frontend/src/app/legacy/surveymanagement/views/survey-edit-or-create.controller.js +++ b/mdm-frontend/src/app/legacy/surveymanagement/views/survey-edit-or-create.controller.js @@ -487,11 +487,29 @@ angular.module('metadatamanagementApp') labels: getDialogLabels() }; - AttachmentDialogService + if (CurrentProjectService.getCurrentProject().release.isPreRelease) { + CommonDialogsService.showConfirmAddAttachmentPreReleaseDialog( + 'global.common-dialogs' + + '.confirm-edit-pre-released-project.attachment-title', + {}, + 'global.common-dialogs' + + '.confirm-edit-pre-released-project.attachment-content', + {}, + null + ).then(function success() { + AttachmentDialogService + .showDialog(dialogConfig, event) + .then(function() { + ctrl.loadAttachments(true); + }); + }); + } else { + AttachmentDialogService .showDialog(dialogConfig, event) .then(function() { ctrl.loadAttachments(true); }); + } }; ctrl.moveAttachmentUp = function() { From 8e2b15ef03dfa8aab9eb71b68d9ce08bff39095a Mon Sep 17 00:00:00 2001 From: theresa Date: Fri, 29 Nov 2024 08:38:18 +0100 Subject: [PATCH 6/6] #3216: fixed loading of project data to display embargo warning right away --- .../components/analysis-package-configurator.html.tmpl | 2 +- .../components/data-package-configurator.html.tmpl | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/mdm-frontend/src/app/legacy/ordermanagement/components/analysis-package-configurator.html.tmpl b/mdm-frontend/src/app/legacy/ordermanagement/components/analysis-package-configurator.html.tmpl index 58adf9fc0c..6a17ffb3be 100644 --- a/mdm-frontend/src/app/legacy/ordermanagement/components/analysis-package-configurator.html.tmpl +++ b/mdm-frontend/src/app/legacy/ordermanagement/components/analysis-package-configurator.html.tmpl @@ -1,5 +1,5 @@ - + diff --git a/mdm-frontend/src/app/legacy/ordermanagement/components/data-package-configurator.html.tmpl b/mdm-frontend/src/app/legacy/ordermanagement/components/data-package-configurator.html.tmpl index b09d733dc4..71964927f7 100644 --- a/mdm-frontend/src/app/legacy/ordermanagement/components/data-package-configurator.html.tmpl +++ b/mdm-frontend/src/app/legacy/ordermanagement/components/data-package-configurator.html.tmpl @@ -1,4 +1,4 @@ - +