From 4bf02e1bae3eeb78e318a9bfddde594a85a3586e Mon Sep 17 00:00:00 2001 From: amentis Date: Mon, 8 Jul 2024 11:28:37 +0300 Subject: [PATCH 01/11] rename dmp to plan notification type enum --- .../core/enum/notification-type.enum.ts | 10 +++++----- .../core/formatting/enum-utils.service.ts | 10 +++++----- 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/dmp-frontend/src/notification-service/core/enum/notification-type.enum.ts b/dmp-frontend/src/notification-service/core/enum/notification-type.enum.ts index d134f90cc..f0419b9f6 100644 --- a/dmp-frontend/src/notification-service/core/enum/notification-type.enum.ts +++ b/dmp-frontend/src/notification-service/core/enum/notification-type.enum.ts @@ -1,15 +1,15 @@ export enum NotificationType { - dmpInvitationExternalUserType = '065deecd-21bb-44af-9983-e660fdf24bc4', - dmpInvitationExistingUserType = '4904dea2-5079-46d3-83be-3a19c9ab45dc', + planInvitationExternalUserType = '065deecd-21bb-44af-9983-e660fdf24bc4', + planInvitationExistingUserType = '4904dea2-5079-46d3-83be-3a19c9ab45dc', descriptionCreatedType = '8965b1d5-99a6-4acf-9016-c0d0ce341364', - dmpModifiedType = '4542262a-22f8-4baa-9db6-1c8e70ac1dbb', - dmpFinalisedType = '90db0b46-42de-bd89-aebf-6f27efeb256e', + planModifiedType = '4542262a-22f8-4baa-9db6-1c8e70ac1dbb', + planFinalisedType = '90db0b46-42de-bd89-aebf-6f27efeb256e', descriptionAnnotationCreated = 'db1e99d2-a240-4e75-9bb2-ef25b234c1f0', descriptionModifiedType = '4fdbfa80-7a71-4a69-b854-67cbb70648f1', descriptionFinalisedType = '33790bad-94d4-488a-8ee2-7f6295ca18ea', mergeAccountConfirmationType = 'bfe68845-cb05-4c5a-a03d-29161a7c9660', removeCredentialConfirmationType = 'c9bc3f16-057e-4bba-8a5f-36bd835e5604', - dmpDepositType = '55736f7a-83ab-4190-af43-9d031a6f9612', + planDepositType = '55736f7a-83ab-4190-af43-9d031a6f9612', descriptionTemplateInvitationType = '223bb607-efa1-4ce7-99ec-4beabfef9a8b', contactSupportType = '5b1d6c52-88f9-418b-9b8a-6f1f963d9ead', publicContactSupportType = 'b542b606-acc6-4629-adef-4d8ee2f01222', diff --git a/dmp-frontend/src/notification-service/core/formatting/enum-utils.service.ts b/dmp-frontend/src/notification-service/core/formatting/enum-utils.service.ts index 2b104228e..5c83bd856 100644 --- a/dmp-frontend/src/notification-service/core/formatting/enum-utils.service.ts +++ b/dmp-frontend/src/notification-service/core/formatting/enum-utils.service.ts @@ -28,17 +28,17 @@ export class NotificationServiceEnumUtils extends BaseEnumUtilsService { public toNotificationTypeString(value: NotificationType): string { switch (value) { - case NotificationType.dmpInvitationExternalUserType: return this.language.instant('TYPES.NOTIFICATION-TEMPLATE-NOTIFICATION-TYPE.PLAN-INVITATION-EXTERNAL-USER'); - case NotificationType.dmpInvitationExistingUserType: return this.language.instant('TYPES.NOTIFICATION-TEMPLATE-NOTIFICATION-TYPE.PLAN-INVITATION-EXISTING-USER'); - case NotificationType.dmpModifiedType: return this.language.instant('TYPES.NOTIFICATION-TEMPLATE-NOTIFICATION-TYPE.PLAN-MODIFIED'); - case NotificationType.dmpFinalisedType: return this.language.instant('TYPES.NOTIFICATION-TEMPLATE-NOTIFICATION-TYPE.PLAN-FINALISED'); + case NotificationType.planInvitationExternalUserType: return this.language.instant('TYPES.NOTIFICATION-TEMPLATE-NOTIFICATION-TYPE.PLAN-INVITATION-EXTERNAL-USER'); + case NotificationType.planInvitationExistingUserType: return this.language.instant('TYPES.NOTIFICATION-TEMPLATE-NOTIFICATION-TYPE.PLAN-INVITATION-EXISTING-USER'); + case NotificationType.planModifiedType: return this.language.instant('TYPES.NOTIFICATION-TEMPLATE-NOTIFICATION-TYPE.PLAN-MODIFIED'); + case NotificationType.planFinalisedType: return this.language.instant('TYPES.NOTIFICATION-TEMPLATE-NOTIFICATION-TYPE.PLAN-FINALISED'); case NotificationType.descriptionCreatedType: return this.language.instant('TYPES.NOTIFICATION-TEMPLATE-NOTIFICATION-TYPE.DESCRIPTION-CREATED'); case NotificationType.descriptionModifiedType: return this.language.instant('TYPES.NOTIFICATION-TEMPLATE-NOTIFICATION-TYPE.DESCRIPTION-MODIFIED'); case NotificationType.descriptionFinalisedType: return this.language.instant('TYPES.NOTIFICATION-TEMPLATE-NOTIFICATION-TYPE.DESCRIPTION-FINALISED'); case NotificationType.descriptionAnnotationCreated: return this.language.instant('TYPES.NOTIFICATION-TEMPLATE-NOTIFICATION-TYPE.DESCRIPTION-ANNOTATION-CREATED'); case NotificationType.mergeAccountConfirmationType: return this.language.instant('TYPES.NOTIFICATION-TEMPLATE-NOTIFICATION-TYPE.MERGE-ACCOUNT-CONFIRMATION'); case NotificationType.removeCredentialConfirmationType: return this.language.instant('TYPES.NOTIFICATION-TEMPLATE-NOTIFICATION-TYPE.REMOVE-CREDENTIAL-CONFIRMATION'); - case NotificationType.dmpDepositType: return this.language.instant('TYPES.NOTIFICATION-TEMPLATE-NOTIFICATION-TYPE.PLAN-DEPOSIT'); + case NotificationType.planDepositType: return this.language.instant('TYPES.NOTIFICATION-TEMPLATE-NOTIFICATION-TYPE.PLAN-DEPOSIT'); case NotificationType.descriptionTemplateInvitationType: return this.language.instant('TYPES.NOTIFICATION-TEMPLATE-NOTIFICATION-TYPE.DESCRIPTION-TEMPLATE-INVITATION'); case NotificationType.contactSupportType: return this.language.instant('TYPES.NOTIFICATION-TEMPLATE-NOTIFICATION-TYPE.CONTACT-SUPPORT'); case NotificationType.publicContactSupportType: return this.language.instant('TYPES.NOTIFICATION-TEMPLATE-NOTIFICATION-TYPE.PUBLIC-CONTACT-SUPPORT'); From 74c7d892cb662c3fe9408b216668a7997dc74944 Mon Sep 17 00:00:00 2001 From: amentis Date: Mon, 8 Jul 2024 11:49:29 +0300 Subject: [PATCH 02/11] rename dmp to plan for scss files and html classes --- .../plan-blueprint-editor.component.html | 2 +- .../plan-blueprint-editor.component.scss | 2 +- ...n-blueprint-listing-filters.component.scss | 2 +- .../plan-blueprint-listing.component.html | 2 +- .../plan-blueprint-listing.component.scss | 2 +- .../app/ui/dashboard/dashboard.component.scss | 16 +++++++------- .../recent-edited-activity.component.html | 2 +- .../recent-edited-activity.component.scss | 14 ++++++------ ...cription-base-fields-editor.component.scss | 4 ++-- .../editor/description-editor.component.html | 10 ++++----- .../editor/description-editor.component.scss | 10 ++++----- .../description-listing.component.scss | 2 +- .../description-filter.component.html | 2 +- .../description-listing-item.component.html | 4 ++-- .../description-listing-item.component.scss | 18 +++++++-------- .../description-overview.component.html | 4 ++-- .../description-overview.component.scss | 10 ++++----- ...tart-new-description-dialog.component.html | 2 +- ...tart-new-description-dialog.component.scss | 6 ++--- .../src/app/ui/navbar/navbar.component.html | 2 +- .../src/app/ui/navbar/navbar.component.scss | 2 +- .../plan-invitation-dialog.component.html | 2 +- .../plan-invitation-dialog.component.scss | 2 +- .../filtering/plan-filter.component.html | 2 +- .../filtering/plan-filter.component.scss | 2 +- .../plan-listing-item.component.html | 16 +++++++------- .../plan-listing-item.component.scss | 22 +++++++++---------- .../plan/listing/plan-listing.component.html | 4 ++-- .../plan/listing/plan-listing.component.scss | 4 ++-- .../start-new-plan-dialog.component.html | 4 ++-- .../start-new-plan-dialog.component.scss | 2 +- .../overview/plan-overview.component.html | 10 ++++----- .../overview/plan-overview.component.scss | 12 +++++----- ...plan-contact-prefill-dialog.component.html | 2 +- ...plan-contact-prefill-dialog.component.scss | 2 +- .../plan-delete-dialog.component.html | 2 +- .../plan-delete-dialog.component.scss | 2 +- .../plan-editor.component.html | 4 ++-- .../plan-editor.component.scss | 6 ++--- .../plan-finalize-dialog.component.html | 2 +- .../plan-finalize-dialog.component.scss | 2 +- .../src/app/ui/sidebar/sidebar.component.html | 2 +- 42 files changed, 112 insertions(+), 112 deletions(-) diff --git a/dmp-frontend/src/app/ui/admin/plan-blueprint/editor/plan-blueprint-editor.component.html b/dmp-frontend/src/app/ui/admin/plan-blueprint/editor/plan-blueprint-editor.component.html index 7306495d2..f4d183ae9 100644 --- a/dmp-frontend/src/app/ui/admin/plan-blueprint/editor/plan-blueprint-editor.component.html +++ b/dmp-frontend/src/app/ui/admin/plan-blueprint/editor/plan-blueprint-editor.component.html @@ -1,5 +1,5 @@
-
+
diff --git a/dmp-frontend/src/app/ui/admin/plan-blueprint/editor/plan-blueprint-editor.component.scss b/dmp-frontend/src/app/ui/admin/plan-blueprint/editor/plan-blueprint-editor.component.scss index ebd157447..b43ea4488 100644 --- a/dmp-frontend/src/app/ui/admin/plan-blueprint/editor/plan-blueprint-editor.component.scss +++ b/dmp-frontend/src/app/ui/admin/plan-blueprint/editor/plan-blueprint-editor.component.scss @@ -4,7 +4,7 @@ margin-bottom: 0 !important; } -.dmp-blueprint-editor { +.plan-blueprint-editor { // margin-top: 1.3rem; // margin-left: 1em; // margin-right: 3em; diff --git a/dmp-frontend/src/app/ui/admin/plan-blueprint/listing/filters/plan-blueprint-listing-filters.component.scss b/dmp-frontend/src/app/ui/admin/plan-blueprint/listing/filters/plan-blueprint-listing-filters.component.scss index 8f945e48d..e595d43ee 100644 --- a/dmp-frontend/src/app/ui/admin/plan-blueprint/listing/filters/plan-blueprint-listing-filters.component.scss +++ b/dmp-frontend/src/app/ui/admin/plan-blueprint/listing/filters/plan-blueprint-listing-filters.component.scss @@ -1,4 +1,4 @@ -.dmp-blueprint-listing-filters { +.plan-blueprint-listing-filters { } diff --git a/dmp-frontend/src/app/ui/admin/plan-blueprint/listing/plan-blueprint-listing.component.html b/dmp-frontend/src/app/ui/admin/plan-blueprint/listing/plan-blueprint-listing.component.html index 20ade4205..acb0e0059 100644 --- a/dmp-frontend/src/app/ui/admin/plan-blueprint/listing/plan-blueprint-listing.component.html +++ b/dmp-frontend/src/app/ui/admin/plan-blueprint/listing/plan-blueprint-listing.component.html @@ -1,5 +1,5 @@
-
+
diff --git a/dmp-frontend/src/app/ui/admin/plan-blueprint/listing/plan-blueprint-listing.component.scss b/dmp-frontend/src/app/ui/admin/plan-blueprint/listing/plan-blueprint-listing.component.scss index 24a1e3c86..2ddbff158 100644 --- a/dmp-frontend/src/app/ui/admin/plan-blueprint/listing/plan-blueprint-listing.component.scss +++ b/dmp-frontend/src/app/ui/admin/plan-blueprint/listing/plan-blueprint-listing.component.scss @@ -3,7 +3,7 @@ border-radius: 4px; } -.dmp-blueprint-listing { +.plan-blueprint-listing { // margin-top: 1.3rem; // margin-left: 1rem; // margin-right: 2rem; diff --git a/dmp-frontend/src/app/ui/dashboard/dashboard.component.scss b/dmp-frontend/src/app/ui/dashboard/dashboard.component.scss index b9f877ef7..3de8e3f3c 100644 --- a/dmp-frontend/src/app/ui/dashboard/dashboard.component.scss +++ b/dmp-frontend/src/app/ui/dashboard/dashboard.component.scss @@ -155,7 +155,7 @@ padding-left: 3rem; } -.dmp-card, +.plan-card, .description-card { min-width: 712px; /* min-height: 308px; */ @@ -182,7 +182,7 @@ input[type="text"] { padding-left: 15px; } -.dmp-label { +.plan-label { background: var(--primary-color) 0% 0% no-repeat padding-box; border-radius: 4px 0px; opacity: 1; @@ -213,7 +213,7 @@ input[type="text"] { // padding-bottom: 0.4rem; } -.dmp-subtitle, +.plan-subtitle, .description-subtitle { .icon-align { @@ -225,7 +225,7 @@ input[type="text"] { } .description-card-actions, -.dmp-card-actions { +.plan-card-actions { display: flex; flex-direction: row; border-top: 1px solid #dbdbdb; @@ -234,24 +234,24 @@ input[type="text"] { } .description-card-actions a, -.dmp-card-actions a { +.plan-card-actions a { color: #848484 !important; text-decoration: none !important; } .description-card-actions a:hover, -.dmp-card-actions a:hover { +.plan-card-actions a:hover { color: var(--primary-color) !important; } -.dmp-description-descriptions-title { +.plan-description-descriptions-title { color: #000000; opacity: 0.6; padding-top: 1.5rem; padding-bottom: 0.8rem; } -.dmp-description-descriptions-name { +.plan-description-descriptions-name { color: #000000; opacity: 0.6; font-weight: 700; diff --git a/dmp-frontend/src/app/ui/dashboard/recent-edited-activity/recent-edited-activity.component.html b/dmp-frontend/src/app/ui/dashboard/recent-edited-activity/recent-edited-activity.component.html index 3258dff80..29d91afb9 100644 --- a/dmp-frontend/src/app/ui/dashboard/recent-edited-activity/recent-edited-activity.component.html +++ b/dmp-frontend/src/app/ui/dashboard/recent-edited-activity/recent-edited-activity.component.html @@ -31,7 +31,7 @@
- +
diff --git a/dmp-frontend/src/app/ui/dashboard/recent-edited-activity/recent-edited-activity.component.scss b/dmp-frontend/src/app/ui/dashboard/recent-edited-activity/recent-edited-activity.component.scss index 62bf4a122..183b977f0 100644 --- a/dmp-frontend/src/app/ui/dashboard/recent-edited-activity/recent-edited-activity.component.scss +++ b/dmp-frontend/src/app/ui/dashboard/recent-edited-activity/recent-edited-activity.component.scss @@ -13,7 +13,7 @@ input[type="text"] { padding-left: 15px; } -.dmp-label { +.plan-label { background: var(--primary-color) 0% 0% no-repeat padding-box; border-radius: 4px 0px; opacity: 1; @@ -31,7 +31,7 @@ input[type="text"] { } .description-card-actions, -.dmp-card-actions { +.plan-card-actions { display: flex; flex-direction: row; border-top: 1px solid #dbdbdb; @@ -40,7 +40,7 @@ input[type="text"] { } .description-card-actions, -.dmp-card-actions { +.plan-card-actions { display: flex; flex-direction: row; border-top: 1px solid #dbdbdb; @@ -49,24 +49,24 @@ input[type="text"] { } .description-card-actions a, -.dmp-card-actions a { +.plan-card-actions a { color: #848484 !important; text-decoration: none !important; } .description-card-actions a:hover, -.dmp-card-actions a:hover { +.plan-card-actions a:hover { color: var(--primary-color) !important; } -.dmp-description-descriptions-title { +.plan-description-descriptions-title { color: #000000; opacity: 0.6; padding-top: 1.5rem; padding-bottom: 0.8rem; } -.dmp-description-descriptions-name { +.plan-description-descriptions-name { color: #000000; opacity: 0.6; font-weight: 700; diff --git a/dmp-frontend/src/app/ui/description/editor/description-base-fields-editor/description-base-fields-editor.component.scss b/dmp-frontend/src/app/ui/description/editor/description-base-fields-editor/description-base-fields-editor.component.scss index 099fc0049..61e967700 100644 --- a/dmp-frontend/src/app/ui/description/editor/description-base-fields-editor/description-base-fields-editor.component.scss +++ b/dmp-frontend/src/app/ui/description/editor/description-base-fields-editor/description-base-fields-editor.component.scss @@ -57,14 +57,14 @@ color: var(--primary-color-3) !important; } - .dmp-link { + .plan-link { color: #3fafac; font-weight: 400; font-size: 16px; cursor: pointer; } - .dmp-link:hover { + .plan-link:hover { text-decoration: underline; } } diff --git a/dmp-frontend/src/app/ui/description/editor/description-editor.component.html b/dmp-frontend/src/app/ui/description/editor/description-editor.component.html index 6d9d1b337..730b4c3fe 100644 --- a/dmp-frontend/src/app/ui/description/editor/description-editor.component.html +++ b/dmp-frontend/src/app/ui/description/editor/description-editor.component.html @@ -15,9 +15,9 @@
{{'DESCRIPTION-EDITOR.TITLE-PREVIEW-DESCRIPTION' | translate}}
-
-
{{'DESCRIPTION-EDITOR.TO-PLAN' | translate}}
-
: {{ item?.plan?.label }}
+
+
{{'DESCRIPTION-EDITOR.TO-PLAN' | translate}}
+
: {{ item?.plan?.label }}
open_in_new @@ -86,11 +86,11 @@
-
+
chevron_left {{'DESCRIPTION-EDITOR.ACTIONS.BACK-TO' | translate}}
-
{{'DESCRIPTION-EDITOR.PLAN' | translate}}
+
{{'DESCRIPTION-EDITOR.PLAN' | translate}}
{{'DESCRIPTION-EDITOR.TOC.TITLE' | translate}}
diff --git a/dmp-frontend/src/app/ui/description/editor/description-editor.component.scss b/dmp-frontend/src/app/ui/description/editor/description-editor.component.scss index d3e4b63f0..8603d2aff 100644 --- a/dmp-frontend/src/app/ui/description/editor/description-editor.component.scss +++ b/dmp-frontend/src/app/ui/description/editor/description-editor.component.scss @@ -202,7 +202,7 @@ align-items: center; } - .description-to-dmp { + .description-to-plan { display: flex; align-items: center; padding: 0; @@ -213,11 +213,11 @@ line-height: 25px; } - .dmp-info { + .plan-info { padding-top: 0.75rem; } - .dmp-label { + .plan-label { min-width: 67px; height: 37px; background: var(--primary-color) 0% 0% no-repeat padding-box; @@ -229,7 +229,7 @@ justify-content: center; } - .dmp-title { + .plan-title { text-align: left; font-weight: 700; font-size: 1rem; @@ -345,7 +345,7 @@ } } - .back-to-dmp:hover { + .back-to-plan:hover { background: #ececec; border-radius: 6px; } diff --git a/dmp-frontend/src/app/ui/description/listing/description-listing.component.scss b/dmp-frontend/src/app/ui/description/listing/description-listing.component.scss index 0092defe6..053d11082 100644 --- a/dmp-frontend/src/app/ui/description/listing/description-listing.component.scss +++ b/dmp-frontend/src/app/ui/description/listing/description-listing.component.scss @@ -16,7 +16,7 @@ padding-bottom: 2em; } -.explore-dmp-content { +.explore-plan-content { padding: 30px 15px; } diff --git a/dmp-frontend/src/app/ui/description/listing/filtering/description-filter.component.html b/dmp-frontend/src/app/ui/description/listing/filtering/description-filter.component.html index 42f34d4b8..58adc8ad1 100644 --- a/dmp-frontend/src/app/ui/description/listing/filtering/description-filter.component.html +++ b/dmp-frontend/src/app/ui/description/listing/filtering/description-filter.component.html @@ -1,5 +1,5 @@ -
+
diff --git a/dmp-frontend/src/app/ui/description/listing/listing-item/description-listing-item.component.html b/dmp-frontend/src/app/ui/description/listing/listing-item/description-listing-item.component.html index 21d083e01..2f62c7252 100644 --- a/dmp-frontend/src/app/ui/description/listing/listing-item/description-listing-item.component.html +++ b/dmp-frontend/src/app/ui/description/listing/listing-item/description-listing-item.component.html @@ -18,9 +18,9 @@
{{'DESCRIPTION-LISTING.PART-OF' | translate}} -
{{'DESCRIPTION-LISTING.PLAN' | translate}}
+
{{'DESCRIPTION-LISTING.PLAN' | translate}}
-
{{description.plan?.label}}
+
{{description.plan?.label}}
diff --git a/dmp-frontend/src/app/ui/description/listing/listing-item/description-listing-item.component.scss b/dmp-frontend/src/app/ui/description/listing/listing-item/description-listing-item.component.scss index 3b5125266..62c47e2af 100644 --- a/dmp-frontend/src/app/ui/description/listing/listing-item/description-listing-item.component.scss +++ b/dmp-frontend/src/app/ui/description/listing/listing-item/description-listing-item.component.scss @@ -77,7 +77,7 @@ p { color: #08bd63; } -.dmp-card, +.plan-card, .description-card { min-width: 712px; /* min-height: 308px; */ @@ -112,7 +112,7 @@ input[type="text"] { opacity: 0.6; } -.dmp-label { +.plan-label { background: var(--primary-color) 0% 0% no-repeat padding-box; border-radius: 4px 0px; opacity: 1; @@ -135,7 +135,7 @@ input[type="text"] { color: #212121; } -.dmp-title, +.plan-title, .description-title { text-align: left; font-weight: 600; @@ -174,7 +174,7 @@ input[type="text"] { // padding-bottom: 0.4rem; } -.dmp-subtitle, +.plan-subtitle, .description-subtitle { .icon-align { @@ -186,7 +186,7 @@ input[type="text"] { } .description-card-actions, -.dmp-card-actions { +.plan-card-actions { display: flex; flex-direction: row; border-top: 1px solid #dbdbdb; @@ -195,24 +195,24 @@ input[type="text"] { } .description-card-actions a, -.dmp-card-actions a { +.plan-card-actions a { color: #848484 !important; text-decoration: none !important; } .description-card-actions a:hover, -.dmp-card-actions a:hover { +.plan-card-actions a:hover { color: var(--primary-color) !important; } -.dmp-description-descriptions-title { +.plan-description-descriptions-title { color: #000000; opacity: 0.6; padding-top: 1.5rem; padding-bottom: 0.8rem; } -.dmp-description-descriptions-name { +.plan-description-descriptions-name { color: #000000; opacity: 0.6; font-weight: 700; diff --git a/dmp-frontend/src/app/ui/description/overview/description-overview.component.html b/dmp-frontend/src/app/ui/description/overview/description-overview.component.html index a9e455393..72babf3c2 100644 --- a/dmp-frontend/src/app/ui/description/overview/description-overview.component.html +++ b/dmp-frontend/src/app/ui/description/overview/description-overview.component.html @@ -72,8 +72,8 @@
-
diff --git a/dmp-frontend/src/app/ui/navbar/navbar.component.scss b/dmp-frontend/src/app/ui/navbar/navbar.component.scss index 99ce3843e..288243814 100644 --- a/dmp-frontend/src/app/ui/navbar/navbar.component.scss +++ b/dmp-frontend/src/app/ui/navbar/navbar.component.scss @@ -146,7 +146,7 @@ $mat-card-header-size: 40px !default; border-radius: 6px; } -.new-dmp-dialog { +.new-plan-dialog { padding: 0em .5em 0em 0em; } ::ng-deep .mat-option-text { diff --git a/dmp-frontend/src/app/ui/plan/invitation/dialog/plan-invitation-dialog.component.html b/dmp-frontend/src/app/ui/plan/invitation/dialog/plan-invitation-dialog.component.html index 2c2dc6d6e..e81e922ae 100644 --- a/dmp-frontend/src/app/ui/plan/invitation/dialog/plan-invitation-dialog.component.html +++ b/dmp-frontend/src/app/ui/plan/invitation/dialog/plan-invitation-dialog.component.html @@ -1,4 +1,4 @@ -
+

{{'PLAN-USER-INVITATION-DIALOG.TITLE' | translate}}

diff --git a/dmp-frontend/src/app/ui/plan/invitation/dialog/plan-invitation-dialog.component.scss b/dmp-frontend/src/app/ui/plan/invitation/dialog/plan-invitation-dialog.component.scss index 2e0d5a2a7..3c69d0307 100644 --- a/dmp-frontend/src/app/ui/plan/invitation/dialog/plan-invitation-dialog.component.scss +++ b/dmp-frontend/src/app/ui/plan/invitation/dialog/plan-invitation-dialog.component.scss @@ -1,4 +1,4 @@ -.dmp-invitation-dialog { +.plan-invitation-dialog { padding: 2.5rem; .form-container { diff --git a/dmp-frontend/src/app/ui/plan/listing/filtering/plan-filter.component.html b/dmp-frontend/src/app/ui/plan/listing/filtering/plan-filter.component.html index 1a0ff11ca..a16a0e42d 100644 --- a/dmp-frontend/src/app/ui/plan/listing/filtering/plan-filter.component.html +++ b/dmp-frontend/src/app/ui/plan/listing/filtering/plan-filter.component.html @@ -1,4 +1,4 @@ -
+
diff --git a/dmp-frontend/src/app/ui/plan/listing/filtering/plan-filter.component.scss b/dmp-frontend/src/app/ui/plan/listing/filtering/plan-filter.component.scss index ae611c7b9..53df6bb9a 100644 --- a/dmp-frontend/src/app/ui/plan/listing/filtering/plan-filter.component.scss +++ b/dmp-frontend/src/app/ui/plan/listing/filtering/plan-filter.component.scss @@ -1,4 +1,4 @@ -.dmp-criteria { +.plan-criteria { mat-form-field { padding-bottom: 5px; width: 100%; diff --git a/dmp-frontend/src/app/ui/plan/listing/listing-item/plan-listing-item.component.html b/dmp-frontend/src/app/ui/plan/listing/listing-item/plan-listing-item.component.html index ad2f578d3..27401a5ef 100644 --- a/dmp-frontend/src/app/ui/plan/listing/listing-item/plan-listing-item.component.html +++ b/dmp-frontend/src/app/ui/plan/listing/listing-item/plan-listing-item.component.html @@ -1,12 +1,12 @@ -
+
-
{{ 'PLAN-LISTING.PLAN' | translate }}
+
{{ 'PLAN-LISTING.PLAN' | translate }}
{{ 'PLAN-LISTING.EDITED' | translate }}: {{ dmp.updatedAt | dateTimeFormatter: "d MMMM y" }}
{{ 'PLAN-LISTING.PUBLISHED' | translate }}: {{ dmp.finalizedAt | dateTimeFormatter: "d MMMM y" }}
-
{{dmp.label}}
-
+
{{dmp.label}}
+
{{ enumUtils.toPlanUserRolesString(planService.getCurrentUserRolesInPlan(dmp?.planUsers)) }} . public{{'TYPES.PLAN-VISIBILITY.PUBLIC' | translate}} @@ -17,17 +17,17 @@ . {{ 'PLAN-LISTING.GRANT' | translate }}: {{referenceService.getReferencesForTypesFirstSafe(dmp?.planReferences, [this.referenceTypeService.getGrantReferenceType()])?.reference?.label}}
-
{{'PLAN-LISTING.CONTAINED-DESCRIPTIONS' | translate}}: ({{ dmp.descriptions?.length }}) +
{{'PLAN-LISTING.CONTAINED-DESCRIPTIONS' | translate}}: ({{ dmp.descriptions?.length }})
-
{{description.label}},
-
{{description.label}}
+
{{description.label}},
+
{{description.label}}
{{'GENERAL.ACTIONS.SHOW-MORE' | translate}}
-
+
open_in_new{{'PLAN-LISTING.ACTIONS.EXPORT' | translate}} add{{'PLAN-LISTING.ACTIONS.ADD-DESCRIPTION-SHORT' | translate}} group_add{{'PLAN-LISTING.ACTIONS.INVITE-SHORT' | translate}} diff --git a/dmp-frontend/src/app/ui/plan/listing/listing-item/plan-listing-item.component.scss b/dmp-frontend/src/app/ui/plan/listing/listing-item/plan-listing-item.component.scss index 65d3459eb..56c3ed07d 100644 --- a/dmp-frontend/src/app/ui/plan/listing/listing-item/plan-listing-item.component.scss +++ b/dmp-frontend/src/app/ui/plan/listing/listing-item/plan-listing-item.component.scss @@ -111,7 +111,7 @@ p { min-width: 74px; } -.dmp-card, +.plan-card, .description-card { min-width: 712px; /* min-height: 308px; */ @@ -147,7 +147,7 @@ input[type="text"] { opacity: 0.6; } -.dmp-label { +.plan-label { background: var(--primary-color) 0% 0% no-repeat padding-box; border-radius: 4px 0px; opacity: 1; @@ -157,7 +157,7 @@ input[type="text"] { line-height: 2.4; } -.dmp-title, +.plan-title, .description-title { text-align: left; font-weight: 600; @@ -169,7 +169,7 @@ input[type="text"] { } .description-subtitle, -.dmp-subtitle { +.plan-subtitle { display: flex; flex-direction: row; text-align: left; @@ -180,7 +180,7 @@ input[type="text"] { color: #848484; } -.dmp-title-draft, +.plan-title-draft, .description-title-draft { text-align: left; font-weight: 600; @@ -196,7 +196,7 @@ input[type="text"] { vertical-align: middle; } -.dmp-subtitle, +.plan-subtitle, .description-subtitle { .icon-align { @@ -208,7 +208,7 @@ input[type="text"] { } .description-card-actions, -.dmp-card-actions { +.plan-card-actions { display: flex; flex-direction: row; border-top: 1px solid #dbdbdb; @@ -217,24 +217,24 @@ input[type="text"] { } .description-card-actions a, -.dmp-card-actions a { +.plan-card-actions a { color: #848484 !important; text-decoration: none !important; } .description-card-actions a:hover, -.dmp-card-actions a:hover { +.plan-card-actions a:hover { color: var(--primary-color) !important; } -.dmp-description-descriptions-title { +.plan-description-descriptions-title { color: #000000; opacity: 0.6; padding-top: 1.5rem; padding-bottom: 0.8rem; } -.dmp-description-descriptions-name { +.plan-description-descriptions-name { color: #000000; opacity: 0.6; font-weight: 700; diff --git a/dmp-frontend/src/app/ui/plan/listing/plan-listing.component.html b/dmp-frontend/src/app/ui/plan/listing/plan-listing.component.html index 4f366d3ad..66c37cc6b 100644 --- a/dmp-frontend/src/app/ui/plan/listing/plan-listing.component.html +++ b/dmp-frontend/src/app/ui/plan/listing/plan-listing.component.html @@ -4,7 +4,7 @@

{{'PLAN-LISTING.TEXT-INFO' | translate}}

-

{{'PLAN-LISTING.TEXT-INFO-QUESTION' | translate}} {{'PLAN-LISTING.LINK-ZENODO' | translate}} {{'PLAN-LISTING.GET-IDEA' | translate}}

+

{{'PLAN-LISTING.TEXT-INFO-QUESTION' | translate}} {{'PLAN-LISTING.LINK-ZENODO' | translate}} {{'PLAN-LISTING.GET-IDEA' | translate}}

{{ 'GENERAL.ACTIONS.TAKE-A-TOUR'| translate }}
@@ -62,7 +62,7 @@
- +
diff --git a/dmp-frontend/src/app/ui/plan/listing/plan-listing.component.scss b/dmp-frontend/src/app/ui/plan/listing/plan-listing.component.scss index 0deed311d..c0165f04c 100644 --- a/dmp-frontend/src/app/ui/plan/listing/plan-listing.component.scss +++ b/dmp-frontend/src/app/ui/plan/listing/plan-listing.component.scss @@ -42,7 +42,7 @@ color: #999999 !important; } -.dmp-label { +.plan-label { color: #089dbb !important; } @@ -78,7 +78,7 @@ padding-bottom: 2em; } -.explore-dmp-content { +.explore-plan-content { padding: 30px 15px; } diff --git a/dmp-frontend/src/app/ui/plan/new/start-new-plan-dialogue/start-new-plan-dialog.component.html b/dmp-frontend/src/app/ui/plan/new/start-new-plan-dialogue/start-new-plan-dialog.component.html index dfc7c5794..82d659f4f 100644 --- a/dmp-frontend/src/app/ui/plan/new/start-new-plan-dialogue/start-new-plan-dialog.component.html +++ b/dmp-frontend/src/app/ui/plan/new/start-new-plan-dialogue/start-new-plan-dialog.component.html @@ -1,6 +1,6 @@ -
+
-
+
close
diff --git a/dmp-frontend/src/app/ui/plan/new/start-new-plan-dialogue/start-new-plan-dialog.component.scss b/dmp-frontend/src/app/ui/plan/new/start-new-plan-dialogue/start-new-plan-dialog.component.scss index bc7d5d102..44f81f6c8 100644 --- a/dmp-frontend/src/app/ui/plan/new/start-new-plan-dialogue/start-new-plan-dialog.component.scss +++ b/dmp-frontend/src/app/ui/plan/new/start-new-plan-dialogue/start-new-plan-dialog.component.scss @@ -3,7 +3,7 @@ padding: 24px; } -.start-new-dmp-dialog-wrapper { +.start-new-plan-dialog-wrapper { width: 33.0rem; min-height: 14rem; padding: 0.28rem 0.34rem 0.875rem 0.625rem; diff --git a/dmp-frontend/src/app/ui/plan/overview/plan-overview.component.html b/dmp-frontend/src/app/ui/plan/overview/plan-overview.component.html index 890ea27a6..b22dcce4c 100644 --- a/dmp-frontend/src/app/ui/plan/overview/plan-overview.component.html +++ b/dmp-frontend/src/app/ui/plan/overview/plan-overview.component.html @@ -1,4 +1,4 @@ -
+
@@ -15,8 +15,8 @@
-
-
{{ dmp.label }}
+
+
{{ dmp.label }}
.
{{'PLAN-OVERVIEW.GRANT' | translate}}
-
{{referenceService.getReferencesForTypesFirstSafe(dmp?.planReferences, [this.referenceTypeService.getGrantReferenceType()])?.reference?.label}}
+
{{referenceService.getReferencesForTypesFirstSafe(dmp?.planReferences, [this.referenceTypeService.getGrantReferenceType()])?.reference?.label}}
{{'DESCRIPTION-OVERVIEW.RESEARCHERS' | translate}}
@@ -117,7 +117,7 @@
- @@ -100,7 +100,7 @@
-
+
{{'PLAN-EDITOR.FIELDS.BLUEPRINT' | translate}} *
{{'PLAN-EDITOR.FIELDS.BLUEPRINT' | translate}} diff --git a/dmp-frontend/src/app/ui/plan/plan-editor-blueprint/plan-editor.component.scss b/dmp-frontend/src/app/ui/plan/plan-editor-blueprint/plan-editor.component.scss index 83661dd7d..faea73a01 100644 --- a/dmp-frontend/src/app/ui/plan/plan-editor-blueprint/plan-editor.component.scss +++ b/dmp-frontend/src/app/ui/plan/plan-editor-blueprint/plan-editor.component.scss @@ -61,7 +61,7 @@ white-space: nowrap; } -.save-btn, .dmp-export-btn { +.save-btn, .plan-export-btn { background: #ffffff 0% 0% no-repeat padding-box !important; border-radius: 30px; opacity: 1; @@ -74,7 +74,7 @@ color: var(--primary-color); } -.dmp-stepper { +.plan-stepper { position: fixed; // height: 100%; display: flex; @@ -315,7 +315,7 @@ a:hover { margin-top: -80px; } -.dmp-blueprint-form { +.plan-blueprint-form { text-align: left; font-weight: 400; font-size: 16px; diff --git a/dmp-frontend/src/app/ui/plan/plan-finalize-dialog/plan-finalize-dialog.component.html b/dmp-frontend/src/app/ui/plan/plan-finalize-dialog/plan-finalize-dialog.component.html index 753699b23..d66d60ea2 100644 --- a/dmp-frontend/src/app/ui/plan/plan-finalize-dialog/plan-finalize-dialog.component.html +++ b/dmp-frontend/src/app/ui/plan/plan-finalize-dialog/plan-finalize-dialog.component.html @@ -13,7 +13,7 @@ {{ 'PLAN-FINALISE-DIALOG.PLAN' | translate }} - + {{ dmp.label }} diff --git a/dmp-frontend/src/app/ui/plan/plan-finalize-dialog/plan-finalize-dialog.component.scss b/dmp-frontend/src/app/ui/plan/plan-finalize-dialog/plan-finalize-dialog.component.scss index 30161d75a..091af3c57 100644 --- a/dmp-frontend/src/app/ui/plan/plan-finalize-dialog/plan-finalize-dialog.component.scss +++ b/dmp-frontend/src/app/ui/plan/plan-finalize-dialog/plan-finalize-dialog.component.scss @@ -59,7 +59,7 @@ padding: 0; } -.dmp-title { +.plan-title { font-weight: 500; color: black; } diff --git a/dmp-frontend/src/app/ui/sidebar/sidebar.component.html b/dmp-frontend/src/app/ui/sidebar/sidebar.component.html index f60085aed..3aef5e1d1 100644 --- a/dmp-frontend/src/app/ui/sidebar/sidebar.component.html +++ b/dmp-frontend/src/app/ui/sidebar/sidebar.component.html @@ -6,7 +6,7 @@ -
+ {{ groupMenuRoute.icon }} person {{groupMenuRoute.title | translate}} From 2712a3d20ef6e76196851dc85201915d67505827 Mon Sep 17 00:00:00 2001 From: Thomas Georgios Giannos Date: Mon, 8 Jul 2024 12:23:15 +0300 Subject: [PATCH 03/11] Swagger fixes and additions --- .../controllers/PrincipalController.java | 141 ++++++----- .../controllers/ReferenceController.java | 28 ++- .../opencdmp/controllers/UserController.java | 34 ++- .../controllers/swagger/SwaggerHelpers.java | 235 ++++++++++++++++++ 4 files changed, 357 insertions(+), 81 deletions(-) diff --git a/backend/web/src/main/java/org/opencdmp/controllers/PrincipalController.java b/backend/web/src/main/java/org/opencdmp/controllers/PrincipalController.java index 641f5bcfd..295c60999 100644 --- a/backend/web/src/main/java/org/opencdmp/controllers/PrincipalController.java +++ b/backend/web/src/main/java/org/opencdmp/controllers/PrincipalController.java @@ -14,7 +14,7 @@ import io.swagger.v3.oas.annotations.tags.Tag; import org.opencdmp.audit.AuditableAction; import org.opencdmp.controllers.swagger.SwaggerHelpers; import org.opencdmp.controllers.swagger.annotation.OperationWithTenantHeader; -import org.opencdmp.model.Lock; +import org.opencdmp.controllers.swagger.annotation.SwaggerCommonErrorResponses; import org.opencdmp.model.Tenant; import org.opencdmp.models.Account; import org.opencdmp.models.AccountBuilder; @@ -32,84 +32,89 @@ import java.util.List; @RestController @RequestMapping("/api/principal/") @Tag(name = "Principal", description = "Get user account information") +@SwaggerCommonErrorResponses public class PrincipalController { - private static final LoggerService logger = new LoggerService(LoggerFactory.getLogger(PrincipalController.class)); - private final AuditService auditService; - private final CurrentPrincipalResolver currentPrincipalResolver; - private final AccountBuilder accountBuilder; - private final TenantService tenantService; + private static final LoggerService logger = new LoggerService(LoggerFactory.getLogger(PrincipalController.class)); - @Autowired - public PrincipalController( - CurrentPrincipalResolver currentPrincipalResolver, - AccountBuilder accountBuilder, - AuditService auditService, TenantService tenantService) { - this.currentPrincipalResolver = currentPrincipalResolver; - this.accountBuilder = accountBuilder; - this.auditService = auditService; - this.tenantService = tenantService; - } + private final AuditService auditService; - @RequestMapping(path = "me", method = RequestMethod.GET ) - @OperationWithTenantHeader(summary = "Fetch auth information of the logged in user", description = "", - responses = @ApiResponse(description = "OK", responseCode = "200", content = @Content( - schema = @Schema( - implementation = Account.class - )) - )) - public Account me( - @Parameter(name = "fieldSet", description = SwaggerHelpers.Commons.fieldset_description, required = true) FieldSet fieldSet - ) throws InvalidApplicationException { - logger.debug("me"); + private final CurrentPrincipalResolver currentPrincipalResolver; - if (fieldSet == null || fieldSet.isEmpty()) { - fieldSet = new BaseFieldSet( - Account._isAuthenticated, - BaseFieldSet.asIndexer(Account._principal, Account.PrincipalInfo._subject), - BaseFieldSet.asIndexer(Account._principal, Account.PrincipalInfo._userId), - BaseFieldSet.asIndexer(Account._principal, Account.PrincipalInfo._name), - BaseFieldSet.asIndexer(Account._principal, Account.PrincipalInfo._scope), - BaseFieldSet.asIndexer(Account._principal, Account.PrincipalInfo._client), - BaseFieldSet.asIndexer(Account._principal, Account.PrincipalInfo._issuedAt), - BaseFieldSet.asIndexer(Account._principal, Account.PrincipalInfo._notBefore), - BaseFieldSet.asIndexer(Account._principal, Account.PrincipalInfo._authenticatedAt), - BaseFieldSet.asIndexer(Account._principal, Account.PrincipalInfo._expiresAt), - BaseFieldSet.asIndexer(Account._principal, Account.PrincipalInfo._more), - BaseFieldSet.asIndexer(Account._profile, Account.UserProfileInfo._avatarUrl), - BaseFieldSet.asIndexer(Account._profile, Account.UserProfileInfo._language), - BaseFieldSet.asIndexer(Account._profile, Account.UserProfileInfo._culture), - BaseFieldSet.asIndexer(Account._profile, Account.UserProfileInfo._timezone), - Account._permissions, - BaseFieldSet.asIndexer(Account._selectedTenant, Tenant._id), - BaseFieldSet.asIndexer(Account._selectedTenant, Tenant._name), - BaseFieldSet.asIndexer(Account._selectedTenant, Tenant._code)); - } + private final AccountBuilder accountBuilder; - MyPrincipal principal = this.currentPrincipalResolver.currentPrincipal(); + private final TenantService tenantService; - Account me = this.accountBuilder.build(fieldSet, principal); + @Autowired + public PrincipalController( + CurrentPrincipalResolver currentPrincipalResolver, + AccountBuilder accountBuilder, + AuditService auditService, TenantService tenantService) { + this.currentPrincipalResolver = currentPrincipalResolver; + this.accountBuilder = accountBuilder; + this.auditService = auditService; + this.tenantService = tenantService; + } - this.auditService.track(AuditableAction.Principal_Lookup); - //auditService.trackIdentity(AuditableAction.IdentityTracking_Action); + @RequestMapping(path = "me", method = RequestMethod.GET) + @OperationWithTenantHeader(summary = "Fetch auth information of the logged in user", description = "", + responses = @ApiResponse(description = "OK", responseCode = "200", content = @Content( + schema = @Schema( + implementation = Account.class + )) + )) + public Account me( + @Parameter(name = "fieldSet", description = SwaggerHelpers.Commons.fieldset_description, required = true) FieldSet fieldSet + ) throws InvalidApplicationException { + logger.debug("me"); - return me; - } + if (fieldSet == null || fieldSet.isEmpty()) { + fieldSet = new BaseFieldSet( + Account._isAuthenticated, + BaseFieldSet.asIndexer(Account._principal, Account.PrincipalInfo._subject), + BaseFieldSet.asIndexer(Account._principal, Account.PrincipalInfo._userId), + BaseFieldSet.asIndexer(Account._principal, Account.PrincipalInfo._name), + BaseFieldSet.asIndexer(Account._principal, Account.PrincipalInfo._scope), + BaseFieldSet.asIndexer(Account._principal, Account.PrincipalInfo._client), + BaseFieldSet.asIndexer(Account._principal, Account.PrincipalInfo._issuedAt), + BaseFieldSet.asIndexer(Account._principal, Account.PrincipalInfo._notBefore), + BaseFieldSet.asIndexer(Account._principal, Account.PrincipalInfo._authenticatedAt), + BaseFieldSet.asIndexer(Account._principal, Account.PrincipalInfo._expiresAt), + BaseFieldSet.asIndexer(Account._principal, Account.PrincipalInfo._more), + BaseFieldSet.asIndexer(Account._profile, Account.UserProfileInfo._avatarUrl), + BaseFieldSet.asIndexer(Account._profile, Account.UserProfileInfo._language), + BaseFieldSet.asIndexer(Account._profile, Account.UserProfileInfo._culture), + BaseFieldSet.asIndexer(Account._profile, Account.UserProfileInfo._timezone), + Account._permissions, + BaseFieldSet.asIndexer(Account._selectedTenant, Tenant._id), + BaseFieldSet.asIndexer(Account._selectedTenant, Tenant._name), + BaseFieldSet.asIndexer(Account._selectedTenant, Tenant._code)); + } - @GetMapping("my-tenants") - @OperationWithTenantHeader(summary = "Fetch a list with the tenants the user belongs to", description = "", - responses = @ApiResponse(description = "OK", responseCode = "200")) - public List myTenants( - @Parameter(name = "fieldSet", description = SwaggerHelpers.Commons.fieldset_description, required = true) FieldSet fieldSet - ) { - logger.debug("my-tenants"); + MyPrincipal principal = this.currentPrincipalResolver.currentPrincipal(); - List models = this.tenantService.myTenants(fieldSet); + Account me = this.accountBuilder.build(fieldSet, principal); - this.auditService.track(AuditableAction.Principal_MyTenants); - //auditService.trackIdentity(AuditableAction.IdentityTracking_Action); - - return models; - } + this.auditService.track(AuditableAction.Principal_Lookup); + //auditService.trackIdentity(AuditableAction.IdentityTracking_Action); + + return me; + } + + @GetMapping("my-tenants") + @OperationWithTenantHeader(summary = "Fetch a list with the tenants the user belongs to", description = "", + responses = @ApiResponse(description = "OK", responseCode = "200")) + public List myTenants( + @Parameter(name = "fieldSet", description = SwaggerHelpers.Commons.fieldset_description, required = true) FieldSet fieldSet + ) { + logger.debug("my-tenants"); + + List models = this.tenantService.myTenants(fieldSet); + + this.auditService.track(AuditableAction.Principal_MyTenants); + //auditService.trackIdentity(AuditableAction.IdentityTracking_Action); + + return models; + } } diff --git a/backend/web/src/main/java/org/opencdmp/controllers/ReferenceController.java b/backend/web/src/main/java/org/opencdmp/controllers/ReferenceController.java index 94707022a..0085dc0bb 100644 --- a/backend/web/src/main/java/org/opencdmp/controllers/ReferenceController.java +++ b/backend/web/src/main/java/org/opencdmp/controllers/ReferenceController.java @@ -12,7 +12,6 @@ import gr.cite.tools.fieldset.FieldSet; import gr.cite.tools.logging.LoggerService; import gr.cite.tools.logging.MapLogEntry; import gr.cite.tools.validation.ValidationFilterAnnotation; -import io.swagger.v3.oas.annotations.Hidden; import io.swagger.v3.oas.annotations.Parameter; import io.swagger.v3.oas.annotations.media.ArraySchema; import io.swagger.v3.oas.annotations.media.Content; @@ -33,7 +32,6 @@ import org.opencdmp.data.ReferenceEntity; import org.opencdmp.model.builder.reference.ReferenceBuilder; import org.opencdmp.model.censorship.reference.ReferenceCensor; import org.opencdmp.model.persist.ReferencePersist; -import org.opencdmp.model.planblueprint.PlanBlueprint; import org.opencdmp.model.reference.Reference; import org.opencdmp.model.result.QueryResult; import org.opencdmp.query.ReferenceQuery; @@ -74,7 +72,6 @@ public class ReferenceController { private final MessageSource messageSource; - @Autowired public ReferenceController( BuilderFactory builderFactory, @@ -126,10 +123,27 @@ public class ReferenceController { return new QueryResult<>(models, count); } - @PostMapping("search") - @Hidden - //TODO thgiannos add swagger docs + @OperationWithTenantHeader(summary = "Query all references including results from external APIs", description = SwaggerHelpers.Reference.endpoint_search, requestBody = @io.swagger.v3.oas.annotations.parameters.RequestBody(description = SwaggerHelpers.Reference.endpoint_search_request_body, content = @Content( + examples = { + @ExampleObject( + name = "Pagination and projection", + description = "Simple paginated request using a property projection list and pagination info", + value = SwaggerHelpers.Reference.endpoint_search_request_body_example + ) + } + )), responses = @ApiResponse(description = "OK", responseCode = "200", content = @Content( + array = @ArraySchema( + schema = @Schema( + implementation = Reference.class + ) + ), + examples = @ExampleObject( + name = "First page", + description = "Example with the first page of paginated results", + value = SwaggerHelpers.Reference.endpoint_search_response_example + )))) + @Swagger404 public List searchReferenceWithDefinition(@RequestBody ReferenceSearchLookup lookup) throws MyNotFoundException, InvalidApplicationException { logger.debug("search with db definition {}", Reference.class.getSimpleName()); @@ -138,7 +152,7 @@ public class ReferenceController { List references = this.referenceService.searchReferenceData(lookup); this.auditService.track(AuditableAction.Reference_Search, "lookup", lookup); - + return references; } diff --git a/backend/web/src/main/java/org/opencdmp/controllers/UserController.java b/backend/web/src/main/java/org/opencdmp/controllers/UserController.java index 0683fd296..908e8df14 100644 --- a/backend/web/src/main/java/org/opencdmp/controllers/UserController.java +++ b/backend/web/src/main/java/org/opencdmp/controllers/UserController.java @@ -12,7 +12,6 @@ import gr.cite.tools.fieldset.FieldSet; import gr.cite.tools.logging.LoggerService; import gr.cite.tools.logging.MapLogEntry; import gr.cite.tools.validation.ValidationFilterAnnotation; -import io.swagger.v3.oas.annotations.Hidden; import io.swagger.v3.oas.annotations.Parameter; import io.swagger.v3.oas.annotations.media.ArraySchema; import io.swagger.v3.oas.annotations.media.Content; @@ -37,9 +36,11 @@ import org.opencdmp.model.builder.PlanAssociatedUserBuilder; import org.opencdmp.model.builder.UserBuilder; import org.opencdmp.model.censorship.PlanAssociatedUserCensor; import org.opencdmp.model.censorship.UserCensor; -import org.opencdmp.model.persist.*; +import org.opencdmp.model.persist.UserMergeRequestPersist; +import org.opencdmp.model.persist.UserPersist; +import org.opencdmp.model.persist.UserRolePatchPersist; +import org.opencdmp.model.persist.UserTenantUsersInviteRequest; import org.opencdmp.model.persist.actionconfirmation.RemoveCredentialRequestPersist; -import org.opencdmp.model.plan.Plan; import org.opencdmp.model.result.QueryResult; import org.opencdmp.model.user.User; import org.opencdmp.query.UserQuery; @@ -143,7 +144,25 @@ public class UserController { } @PostMapping("plan-associated/query") - @Hidden + @OperationWithTenantHeader(summary = "Query all plan associated users", description = SwaggerHelpers.User.endpoint_query_plan_associated, requestBody = @io.swagger.v3.oas.annotations.parameters.RequestBody(description = SwaggerHelpers.User.endpoint_query_request_body, content = @Content( + examples = { + @ExampleObject( + name = "Pagination and projection", + description = "Simple paginated request using a property projection list and pagination info", + value = SwaggerHelpers.User.endpoint_query_plan_associated_request_body_example + ) + } + )), responses = @ApiResponse(description = "OK", responseCode = "200", content = @Content( + array = @ArraySchema( + schema = @Schema( + implementation = PlanAssociatedUser.class + ) + ), + examples = @ExampleObject( + name = "First page", + description = "Example with the first page of paginated results", + value = SwaggerHelpers.User.endpoint_query_plan_associated_response_example + )))) public QueryResult queryPlanAssociated(@RequestBody UserLookup lookup) throws MyApplicationException, MyForbiddenException { logger.debug("querying {}", User.class.getSimpleName()); @@ -219,8 +238,11 @@ public class UserController { } @GetMapping("/export/csv/{hasTenantAdminMode}") - @Hidden - public ResponseEntity exportCsv(@PathVariable("hasTenantAdminMode") Boolean hasTenantAdminMode) throws MyApplicationException, MyForbiddenException, MyNotFoundException, IOException, InvalidApplicationException { + @OperationWithTenantHeader(summary = "Export users in a .csv file", description = "", + responses = @ApiResponse(description = "OK", responseCode = "200")) + public ResponseEntity exportCsv( + @Parameter(name = "hasTenantAdminMode", description = "Controls whether to fetch users as a tenant admin or not", example = "false", required = true) @PathVariable("hasTenantAdminMode") Boolean hasTenantAdminMode + ) throws MyApplicationException, MyForbiddenException, MyNotFoundException, IOException, InvalidApplicationException { logger.debug(new MapLogEntry("export" + User.class.getSimpleName()).And("hasTenantAdminMode", hasTenantAdminMode)); // this.censorFactory.censor(UserCensor.class).censor(fieldSet, null); diff --git a/backend/web/src/main/java/org/opencdmp/controllers/swagger/SwaggerHelpers.java b/backend/web/src/main/java/org/opencdmp/controllers/swagger/SwaggerHelpers.java index e3ba6bc6b..34cc0a938 100644 --- a/backend/web/src/main/java/org/opencdmp/controllers/swagger/SwaggerHelpers.java +++ b/backend/web/src/main/java/org/opencdmp/controllers/swagger/SwaggerHelpers.java @@ -3346,6 +3346,190 @@ public final class SwaggerHelpers { } """; + public static final String endpoint_search = + """ + This endpoint is used to fetch all the available references.
+ It also allows to restrict the results using a query object passed in the request body.
+ """; + + public static final String endpoint_search_request_body = + """ + Let's explore the options this object gives us. + + ### General query parameters: + +
    +
  • page: + This is an object controlling the pagination of the results. It contains two properties. +
  • +
      +
    • offset: + How many records to omit. +
    • +
    • size: + How many records to include in each page. +
    • +
    +
+ + For example, if we want the third page, and our pages to contain 15 elements, we would pass the following object: + + ```JSON + { + "offset": 30, + "size": 15 + } + ``` + +
    +
  • order: + This is an object controlling the ordering of the results. + It contains a list of strings called items with the names of the properties to use. +
    If the name of the property is prefixed with a '-', the ordering direction is DESC. Otherwise, it is ASC. +
  • +
+ + For example, if we wanted to order based on the field 'createdAt' in descending order, we would pass the following object: + + ```JSON + { + "items": [ + "-createdAt" + ], + } + ``` + +
    +
  • metadata: + This is an object containing metadata for the request. There is only one available option. +
      +
    • countAll: + If this is set to true, the count property included in the response will account for all the records regardless the pagination, + with all the rest of filtering options applied of course. + Otherwise, if it is set to false or not present, only the returned results will be counted. +
      The first option is useful for the UI clients to calculate how many result pages are available. +
    • +
    +
  • +
  • project: + This is an object controlling the data projection of the results. + It contains a list of strings called fields with the names of the properties to project. +
    You can also include properties that are deeper in the object tree by prefixing them with dots. +
  • +
+ + ### Reference specific query parameters: + +
    +
  • like: + If there is a like parameter present in the query, only the reference entities that include the contents of the parameter either in their labels, descriptions or the references will be in the response. +
  • +
  • typeId: + This is the type id of the references we want in the response.
    If empty, every record is included. +
  • +
  • key: + This is the id of the external source (API) we want results from. +
    If not present, no external reference is included. +
  • +
  • dependencyReferences: + This is a list and determines which records we want to include in the response, based on the references they depend on. +
    If not present, every record is included. +
  • +
+ """; + + public static final String endpoint_search_request_body_example = + """ + { + "project":{ + "fields":[ + "id", + "hash", + "label", + "type", + "type.id", + "description", + "definition.fields.code", + "definition.fields.dataType", + "definition.fields.value", + "reference", + "abbreviation", + "source", + "sourceType" + ] + }, + "page":{ + "size":100, + "offset":0 + }, + "typeId":"5b9c284f-f041-4995-96cc-fad7ad13289c", + "dependencyReferences":[ + \s + ], + "order":{ + "items":[ + "label" + ] + } + } + """; + + public static final String endpoint_search_response_example = + """ + [ + { + "label": "A Randomized, Double-Blind, Placebo-Controlled, Multi-Center Study to Evaluate the Efficacy of ManNAc in Subjects with GNE Myopathy (nih_________::5U01AR070498-04)", + "type": { + "id": "5b9c284f-f041-4995-96cc-fad7ad13289c" + }, + "description": "A Randomized, Double-Blind, Placebo-Controlled, Multi-Center Study to Evaluate the Efficacy of ManNAc in Subjects with GNE Myopathy", + "definition": { + "fields": [ + { + "code": "referenceType", + "dataType": 0, + "value": "Grants" + }, + { + "code": "key", + "dataType": 0, + "value": "openaire" + } + ] + }, + "reference": "nih_________::5U01AR070498-04", + "source": "openaire", + "sourceType": 1, + "hash": "" + }, + { + "label": "A genome scale census of virulence factors in the major mould pathogen of human lungs, Aspergillus fumigatus (ukri________::1640253)", + "type": { + "id": "5b9c284f-f041-4995-96cc-fad7ad13289c" + }, + "description": "A genome scale census of virulence factors in the major mould pathogen of human lungs, Aspergillus fumigatus", + "definition": { + "fields": [ + { + "code": "referenceType", + "dataType": 0, + "value": "Grants" + }, + { + "code": "key", + "dataType": 0, + "value": "openaire" + } + ] + }, + "reference": "ukri________::1640253", + "source": "openaire", + "sourceType": 1, + "hash": "" + } + ] + """; + } public static final class ReferenceType { @@ -3779,6 +3963,12 @@ public final class SwaggerHelpers { It also allows to restrict the results using a query object passed in the request body.
"""; + public static final String endpoint_query_plan_associated = + """ + This endpoint is used to fetch all the available users.
+ It also allows to restrict the results using a query object passed in the request body.
+ """; + public static final String endpoint_query_request_body = """ Let's explore the options this object gives us. @@ -3908,6 +4098,32 @@ public final class SwaggerHelpers { } """; + public static final String endpoint_query_plan_associated_request_body_example = + """ + { + "project":{ + "fields":[ + "id", + "name", + "email" + ] + }, + "page":{ + "size":100, + "offset":0 + }, + "isActive":[ + 1 + ], + "order":{ + "items":[ + "name" + ] + }, + "like":"user%" + } + """; + public static final String endpoint_query_response_example = """ { @@ -4241,6 +4457,25 @@ public final class SwaggerHelpers { } """; + public static final String endpoint_query_plan_associated_response_example = + """ + { + "items":[ + { + "id":"d26916c6-8763-450e-9048-b06e1114d0b4", + "name":"user3 user3", + "email":"user3@dmp.gr" + }, + { + "id":"02832fb6-0b12-469f-a886-7685406959d4", + "name":"user4", + "email":"user4@dmp.gr" + } + ], + "count":2 + } + """; + } public static final class Principal { From d0fccbfcd2c257e1f0956f1d48e4ec548f667374 Mon Sep 17 00:00:00 2001 From: amentis Date: Mon, 8 Jul 2024 12:42:46 +0300 Subject: [PATCH 04/11] rename dmp to plan frontend changes --- .../plan-blueprint-editor.component.html | 12 +- .../editor/plan-blueprint-editor.component.ts | 32 ++--- .../app/ui/dashboard/dashboard.component.html | 4 +- .../app/ui/dashboard/dashboard.component.ts | 6 +- .../recent-edited-activity.component.html | 2 +- .../listing/description-listing.component.ts | 4 +- .../description-filter.component.html | 8 +- .../filtering/description-filter.component.ts | 2 +- .../description-listing-item.component.ts | 2 +- .../description-overview.component.ts | 10 +- .../plan-clone-dialog.component.html | 2 +- .../plan-clone-dialog.component.ts | 12 +- .../plan-listing-item.component.html | 46 +++---- .../plan-listing-item.component.ts | 68 +++++----- .../plan/listing/plan-listing.component.html | 2 +- .../ui/plan/listing/plan-listing.component.ts | 10 +- .../overview/plan-overview.component.html | 52 ++++---- .../plan/overview/plan-overview.component.ts | 120 +++++++++--------- .../plan-editor.model.ts | 4 +- .../forms/validation/custom-validator.ts | 2 +- 20 files changed, 200 insertions(+), 200 deletions(-) diff --git a/dmp-frontend/src/app/ui/admin/plan-blueprint/editor/plan-blueprint-editor.component.html b/dmp-frontend/src/app/ui/admin/plan-blueprint/editor/plan-blueprint-editor.component.html index f4d183ae9..c65b55ca4 100644 --- a/dmp-frontend/src/app/ui/admin/plan-blueprint/editor/plan-blueprint-editor.component.html +++ b/dmp-frontend/src/app/ui/admin/plan-blueprint/editor/plan-blueprint-editor.component.html @@ -41,7 +41,7 @@

{{'PLAN-BLUEPRINT-EDITOR.FIELDS.SECTIONS' | translate}} - {{'PLAN-BLUEPRINT-EDITOR.SYSTEM-FIELDS-REQUIRED' | translate}} + {{'PLAN-BLUEPRINT-EDITOR.SYSTEM-FIELDS-REQUIRED' | translate}}

@@ -109,13 +109,13 @@ {{'PLAN-BLUEPRINT-EDITOR.FIELDS.CATEGORY' | translate}} - {{enumUtils.toPlanBlueprintFieldCategoryString(fieldCategory)}} + {{enumUtils.toPlanBlueprintFieldCategoryString(fieldCategory)}} {{field.get('category').getError('backendError').message}} {{'GENERAL.VALIDATION.REQUIRED' | translate}}
-
+
{{'PLAN-BLUEPRINT-EDITOR.FIELDS.SYSTEM-FIELD-TYPE' | translate}} @@ -125,7 +125,7 @@ {{'GENERAL.VALIDATION.REQUIRED' | translate}}
-
+
{{'PLAN-BLUEPRINT-EDITOR.FIELDS.DATA-TYPE' | translate}} @@ -137,7 +137,7 @@ {{'GENERAL.VALIDATION.REQUIRED' | translate}}
-
+
{{'PLAN-BLUEPRINT-EDITOR.FIELDS.REFERENCE-TYPE' | translate}} @@ -184,7 +184,7 @@ {{'GENERAL.VALIDATION.REQUIRED' | translate}}
-
+
{{'PLAN-BLUEPRINT-EDITOR.FIELDS.FIELD-MULTIPLE-SELECT' | translate}} {{field.get('multipleSelect')?.getError('backendError').message}} {{'GENERAL.VALIDATION.REQUIRED' | translate}} diff --git a/dmp-frontend/src/app/ui/admin/plan-blueprint/editor/plan-blueprint-editor.component.ts b/dmp-frontend/src/app/ui/admin/plan-blueprint/editor/plan-blueprint-editor.component.ts index f5d919578..db73cdb61 100644 --- a/dmp-frontend/src/app/ui/admin/plan-blueprint/editor/plan-blueprint-editor.component.ts +++ b/dmp-frontend/src/app/ui/admin/plan-blueprint/editor/plan-blueprint-editor.component.ts @@ -65,12 +65,12 @@ export class PlanBlueprintEditorComponent extends BaseEditor(PlanBlueprintSystemFieldType); - dmpBlueprintExtraFieldDataType = PlanBlueprintExtraFieldDataType; + planBlueprintExtraFieldDataType = PlanBlueprintExtraFieldDataType; public planBlueprintExtraFieldDataTypeEnum = this.enumUtils.getEnumValues(PlanBlueprintExtraFieldDataType); - public dmpBlueprintFieldCategoryEnum = this.enumUtils.getEnumValues(PlanBlueprintFieldCategory); + public planBlueprintFieldCategoryEnum = this.enumUtils.getEnumValues(PlanBlueprintFieldCategory); descriptionTempalteGroupSingleAutocompleteConfiguration: SingleAutoCompleteConfiguration = { initialItems: (data?: any) => this.descriptionTemplateService.query(this.descriptionTemplateService.buildDescriptionTempalteGroupAutocompleteLookup([IsActive.Active], null, null, null, this.getUsedDescriptionTemplateGroupIds())).pipe(map(x => x.items)), filterFn: (searchQuery: string, data?: any) => this.descriptionTemplateService.query(this.descriptionTemplateService.buildDescriptionTempalteGroupAutocompleteLookup([IsActive.Active], searchQuery, null, null, this.getUsedDescriptionTemplateGroupIds() ? this.getUsedDescriptionTemplateGroupIds() : null)).pipe(map(x => x.items)), @@ -126,7 +126,7 @@ export class PlanBlueprintEditorComponent extends BaseEditor section.fields.some(field => (field.category == PlanBlueprintFieldCategory.System) && (field as SystemFieldInSection).systemFieldType === PlanBlueprintSystemFieldType.Title)); + const planBlueprint: PlanBlueprintPersist = this.formGroup.value; + return planBlueprint.definition.sections.some(section => section.fields.some(field => (field.category == PlanBlueprintFieldCategory.System) && (field as SystemFieldInSection).systemFieldType === PlanBlueprintSystemFieldType.Title)); } hasDescription(): boolean { - const dmpBlueprint: PlanBlueprintPersist = this.formGroup.value; - return dmpBlueprint.definition.sections.some(section => section.fields.some(field => (field.category == PlanBlueprintFieldCategory.System) && (field as SystemFieldInSection).systemFieldType === PlanBlueprintSystemFieldType.Description)); + const planBlueprint: PlanBlueprintPersist = this.formGroup.value; + return planBlueprint.definition.sections.some(section => section.fields.some(field => (field.category == PlanBlueprintFieldCategory.System) && (field as SystemFieldInSection).systemFieldType === PlanBlueprintSystemFieldType.Description)); } hasLanguage(): boolean { - const dmpBlueprint: PlanBlueprintPersist = this.formGroup.value; - return dmpBlueprint.definition.sections.some(section => section.fields.some(field => (field.category == PlanBlueprintFieldCategory.System) && (field as SystemFieldInSection).systemFieldType === PlanBlueprintSystemFieldType.Language)); + const planBlueprint: PlanBlueprintPersist = this.formGroup.value; + return planBlueprint.definition.sections.some(section => section.fields.some(field => (field.category == PlanBlueprintFieldCategory.System) && (field as SystemFieldInSection).systemFieldType === PlanBlueprintSystemFieldType.Language)); } hasAccess(): boolean { - const dmpBlueprint: PlanBlueprintPersist = this.formGroup.value; - return dmpBlueprint.definition.sections.some(section => section.fields.some(field => (field.category == PlanBlueprintFieldCategory.System) && (field as SystemFieldInSection).systemFieldType === PlanBlueprintSystemFieldType.AccessRights)); + const planBlueprint: PlanBlueprintPersist = this.formGroup.value; + return planBlueprint.definition.sections.some(section => section.fields.some(field => (field.category == PlanBlueprintFieldCategory.System) && (field as SystemFieldInSection).systemFieldType === PlanBlueprintSystemFieldType.AccessRights)); } hasDescriptionTemplates(): boolean { - const dmpBlueprint: PlanBlueprintPersist = this.formGroup.value; - return dmpBlueprint.definition.sections.some(section => section.hasTemplates == true); + const planBlueprint: PlanBlueprintPersist = this.formGroup.value; + return planBlueprint.definition.sections.some(section => section.hasTemplates == true); } private showValidationErrorsDialog(projectOnly?: boolean, errmess?: string[]) { diff --git a/dmp-frontend/src/app/ui/dashboard/dashboard.component.html b/dmp-frontend/src/app/ui/dashboard/dashboard.component.html index af18077c4..48a6df501 100644 --- a/dmp-frontend/src/app/ui/dashboard/dashboard.component.html +++ b/dmp-frontend/src/app/ui/dashboard/dashboard.component.html @@ -64,8 +64,8 @@ > - - + + diff --git a/dmp-frontend/src/app/ui/dashboard/dashboard.component.ts b/dmp-frontend/src/app/ui/dashboard/dashboard.component.ts index bd49dd73e..3f27d9928 100644 --- a/dmp-frontend/src/app/ui/dashboard/dashboard.component.ts +++ b/dmp-frontend/src/app/ui/dashboard/dashboard.component.ts @@ -57,7 +57,7 @@ export class DashboardComponent extends BaseComponent implements OnInit { ngOnInit() { this.route.queryParams.subscribe(params => { let type = params['type']; - if (type || type == "recent" || (type == "drafts" && this.isAuthenticated()) || type == "dmps" || type == "descriptions") { + if (type || type == "recent" || (type == "drafts" && this.isAuthenticated()) || type == "plans" || type == "descriptions") { this.currentType = type; } else { this.currentType = "recent"; @@ -98,7 +98,7 @@ export class DashboardComponent extends BaseComponent implements OnInit { if (this.currentType == "drafts") { return 1; } - if (this.currentType == "dmps") { + if (this.currentType == "plans") { return this.isAuthenticated() ? 2 : 1; } if (this.currentType == "descriptions") { @@ -167,7 +167,7 @@ export class DashboardComponent extends BaseComponent implements OnInit { useOrb: true, steps: [ { - selector: '.new-dmp-dialog', + selector: '.new-plan-dialog', content: 'Step 1', orientation: Orientation.BottomRight, isStepUnique: false, diff --git a/dmp-frontend/src/app/ui/dashboard/recent-edited-activity/recent-edited-activity.component.html b/dmp-frontend/src/app/ui/dashboard/recent-edited-activity/recent-edited-activity.component.html index 29d91afb9..00d037165 100644 --- a/dmp-frontend/src/app/ui/dashboard/recent-edited-activity/recent-edited-activity.component.html +++ b/dmp-frontend/src/app/ui/dashboard/recent-edited-activity/recent-edited-activity.component.html @@ -31,7 +31,7 @@
- +
diff --git a/dmp-frontend/src/app/ui/description/listing/description-listing.component.ts b/dmp-frontend/src/app/ui/description/listing/description-listing.component.ts index 53d134a41..0aeb9f274 100644 --- a/dmp-frontend/src/app/ui/description/listing/description-listing.component.ts +++ b/dmp-frontend/src/app/ui/description/listing/description-listing.component.ts @@ -392,12 +392,12 @@ export class DescriptionListingComponent extends BaseListingComponent 0; + let plans = formGroup.get("associatedDmpIds")?.value ?? null; let addDmps = plans && plans?.length > 0; let roles = formGroup.get("role")?.value !== null ? [formGroup.get("role")?.value] : null; let addRoles = roles && roles?.length > 0; if (addDmps || addRoles) { lookup.planSubQuery = DescriptionFilterService.initializePlanLookup(); - if (addDmps) lookup.planSubQuery.ids = dmps?.length > 0 ? dmps : null; + if (addDmps) lookup.planSubQuery.ids = plans?.length > 0 ? plans : null; if (addRoles) { lookup.planSubQuery.planUserSubQuery = DescriptionFilterService.initializePlanUserLookup(); diff --git a/dmp-frontend/src/app/ui/description/listing/filtering/description-filter.component.html b/dmp-frontend/src/app/ui/description/listing/filtering/description-filter.component.html index 58adc8ad1..f333be6f5 100644 --- a/dmp-frontend/src/app/ui/description/listing/filtering/description-filter.component.html +++ b/dmp-frontend/src/app/ui/description/listing/filtering/description-filter.component.html @@ -57,10 +57,10 @@
{{'DESCRIPTION-LISTING.FILTERS.ROLE.NAME' | translate }}
{{ 'DESCRIPTION-LISTING.FILTERS.ROLE.TYPES.ANY' | translate }} - {{ 'DESCRIPTION-LISTING.FILTERS.ROLE.TYPES.OWNER' | translate }} - {{ 'DESCRIPTION-LISTING.FILTERS.ROLE.TYPES.VIEWER' | translate }} - {{ 'DESCRIPTION-LISTING.FILTERS.ROLE.TYPES.DESCRIPTION-CONTRIBUTOR' | translate }} - {{ 'DESCRIPTION-LISTING.FILTERS.ROLE.TYPES.REVIEWER' | translate }} + {{ 'DESCRIPTION-LISTING.FILTERS.ROLE.TYPES.OWNER' | translate }} + {{ 'DESCRIPTION-LISTING.FILTERS.ROLE.TYPES.VIEWER' | translate }} + {{ 'DESCRIPTION-LISTING.FILTERS.ROLE.TYPES.DESCRIPTION-CONTRIBUTOR' | translate }} + {{ 'DESCRIPTION-LISTING.FILTERS.ROLE.TYPES.REVIEWER' | translate }}
diff --git a/dmp-frontend/src/app/ui/description/listing/filtering/description-filter.component.ts b/dmp-frontend/src/app/ui/description/listing/filtering/description-filter.component.ts index aef670e8b..485d2e407 100644 --- a/dmp-frontend/src/app/ui/description/listing/filtering/description-filter.component.ts +++ b/dmp-frontend/src/app/ui/description/listing/filtering/description-filter.component.ts @@ -41,7 +41,7 @@ export class DescriptionFilterComponent extends BaseCriteriaComponent implements public filteringTagsAsync = false; statuses = DescriptionStatus; - dmpRole = PlanUserRole; + planRole = PlanUserRole; options: UntypedFormGroup; descriptionTemplateAutoCompleteConfiguration: MultipleAutoCompleteConfiguration; diff --git a/dmp-frontend/src/app/ui/description/listing/listing-item/description-listing-item.component.ts b/dmp-frontend/src/app/ui/description/listing/listing-item/description-listing-item.component.ts index 7cc21320c..1943a4292 100644 --- a/dmp-frontend/src/app/ui/description/listing/listing-item/description-listing-item.component.ts +++ b/dmp-frontend/src/app/ui/description/listing/listing-item/description-listing-item.component.ts @@ -135,7 +135,7 @@ export class DescriptionListingItemComponent extends BaseComponent implements On restoreFocus: false, data: { planId: this.description.plan.id, - dmpName: this.description.plan.label, + planName: this.description.plan.label, blueprint: this.description.plan.blueprint } }); diff --git a/dmp-frontend/src/app/ui/description/overview/description-overview.component.ts b/dmp-frontend/src/app/ui/description/overview/description-overview.component.ts index e7cb105ad..574dc6072 100644 --- a/dmp-frontend/src/app/ui/description/overview/description-overview.component.ts +++ b/dmp-frontend/src/app/ui/description/overview/description-overview.component.ts @@ -248,16 +248,16 @@ export class DescriptionOverviewComponent extends BaseComponent implements OnIni } else return false; } - focusOnAuthor(dmpUserId: Guid, order: number): void { - this.authorFocus = `${dmpUserId}-${order}`; + focusOnAuthor(planUserId: Guid, order: number): void { + this.authorFocus = `${planUserId}-${order}`; } resetAuthorFocus(): void { this.authorFocus = null; } - isFocusedOnUser(dmpUserId: Guid, order: number): boolean { - return `${dmpUserId}-${order}` == this.authorFocus; + isFocusedOnUser(planUserId: Guid, order: number): boolean { + return `${planUserId}-${order}` == this.authorFocus; } openShareDialog() { @@ -266,7 +266,7 @@ export class DescriptionOverviewComponent extends BaseComponent implements OnIni restoreFocus: false, data: { planId: this.description.plan.id, - dmpName: this.description.plan.label, + planName: this.description.plan.label, blueprint: this.description.plan.blueprint } }); diff --git a/dmp-frontend/src/app/ui/plan/clone-dialog/plan-clone-dialog.component.html b/dmp-frontend/src/app/ui/plan/clone-dialog/plan-clone-dialog.component.html index 47183831a..1d76a5575 100644 --- a/dmp-frontend/src/app/ui/plan/clone-dialog/plan-clone-dialog.component.html +++ b/dmp-frontend/src/app/ui/plan/clone-dialog/plan-clone-dialog.component.html @@ -40,7 +40,7 @@ {{ 'PLAN-CLONE-DIALOG.ACTIONS.TOGGLE-DESCRIPTIONS' | translate }} - + {{description.label}} diff --git a/dmp-frontend/src/app/ui/plan/clone-dialog/plan-clone-dialog.component.ts b/dmp-frontend/src/app/ui/plan/clone-dialog/plan-clone-dialog.component.ts index a1afac437..e7a524b64 100644 --- a/dmp-frontend/src/app/ui/plan/clone-dialog/plan-clone-dialog.component.ts +++ b/dmp-frontend/src/app/ui/plan/clone-dialog/plan-clone-dialog.component.ts @@ -19,7 +19,7 @@ import { HttpErrorResponse } from '@angular/common/http'; }) export class ClonePlanDialogComponent extends BaseComponent { - dmp: Plan; + plan: Plan; editorModel: PlanCloneDialogEditorModel; formGroup: UntypedFormGroup; @@ -32,12 +32,12 @@ export class ClonePlanDialogComponent extends BaseComponent { @Inject(MAT_DIALOG_DATA) public data: any ) { super(); - this.dmp = data.plan; + this.plan = data.plan; } get allDescriptionsNo(): number{ - return this.dmp.descriptions?.length ?? 0; + return this.plan.descriptions?.length ?? 0; } get checkedDescrionsNo(): number { @@ -58,7 +58,7 @@ export class ClonePlanDialogComponent extends BaseComponent { } hasDescriptions() { - return this.dmp.descriptions?.length > 0; + return this.plan.descriptions?.length > 0; } close() { @@ -73,14 +73,14 @@ export class ClonePlanDialogComponent extends BaseComponent { if (!this.formGroup.valid) { return; } const value: ClonePlanPersist = this.formGroup.value; this.planService.clone(value, PlanEditorEntityResolver.lookupFields()).pipe(takeUntil(this._destroyed)).subscribe( - dmp => this.dialogRef.close(dmp), + plan => this.dialogRef.close(plan), error => this.onCallbackError(error) ); } toggleAllDescriptions(event: any) { if (event === true) { - this.formGroup.get('descriptions')?.setValue(this.dmp.descriptions?.map(d=> d.id)); + this.formGroup.get('descriptions')?.setValue(this.plan.descriptions?.map(d=> d.id)); } else { this.formGroup.get('descriptions')?.setValue([]); } diff --git a/dmp-frontend/src/app/ui/plan/listing/listing-item/plan-listing-item.component.html b/dmp-frontend/src/app/ui/plan/listing/listing-item/plan-listing-item.component.html index 27401a5ef..6148cdd9d 100644 --- a/dmp-frontend/src/app/ui/plan/listing/listing-item/plan-listing-item.component.html +++ b/dmp-frontend/src/app/ui/plan/listing/listing-item/plan-listing-item.component.html @@ -1,56 +1,56 @@
- +
{{ 'PLAN-LISTING.PLAN' | translate }}
-
{{ 'PLAN-LISTING.EDITED' | translate }}: {{ dmp.updatedAt | dateTimeFormatter: "d MMMM y" }}
-
{{ 'PLAN-LISTING.PUBLISHED' | translate }}: {{ dmp.finalizedAt | dateTimeFormatter: "d MMMM y" }}
+
{{ 'PLAN-LISTING.EDITED' | translate }}: {{ plan.updatedAt | dateTimeFormatter: "d MMMM y" }}
+
{{ 'PLAN-LISTING.PUBLISHED' | translate }}: {{ plan.finalizedAt | dateTimeFormatter: "d MMMM y" }}
-
{{dmp.label}}
+
{{plan.label}}
- {{ enumUtils.toPlanUserRolesString(planService.getCurrentUserRolesInPlan(dmp?.planUsers)) }} + {{ enumUtils.toPlanUserRolesString(planService.getCurrentUserRolesInPlan(plan?.planUsers)) }} . - public{{'TYPES.PLAN-VISIBILITY.PUBLIC' | translate}} - done{{ enumUtils.toPlanStatusString(dmp.status) }} - create{{ enumUtils.toPlanStatusString(dmp.status) }} + public{{'TYPES.PLAN-VISIBILITY.PUBLIC' | translate}} + done{{ enumUtils.toPlanStatusString(plan.status) }} + create{{ enumUtils.toPlanStatusString(plan.status) }} . - {{'PLAN-LISTING.VERSION' | translate}} {{dmp.version}} + {{'PLAN-LISTING.VERSION' | translate}} {{plan.version}} . - {{ 'PLAN-LISTING.GRANT' | translate }}: {{referenceService.getReferencesForTypesFirstSafe(dmp?.planReferences, [this.referenceTypeService.getGrantReferenceType()])?.reference?.label}} + {{ 'PLAN-LISTING.GRANT' | translate }}: {{referenceService.getReferencesForTypesFirstSafe(plan?.planReferences, [this.referenceTypeService.getGrantReferenceType()])?.reference?.label}}
-
{{'PLAN-LISTING.CONTAINED-DESCRIPTIONS' | translate}}: ({{ dmp.descriptions?.length }}) +
{{'PLAN-LISTING.CONTAINED-DESCRIPTIONS' | translate}}: ({{ plan.descriptions?.length }})
-
+
{{description.label}},
{{description.label}}
-
{{'GENERAL.ACTIONS.SHOW-MORE' | translate}} + {{'GENERAL.ACTIONS.SHOW-MORE' | translate}} - - - - diff --git a/dmp-frontend/src/app/ui/plan/listing/listing-item/plan-listing-item.component.ts b/dmp-frontend/src/app/ui/plan/listing/listing-item/plan-listing-item.component.ts index c54056058..7e545da9f 100644 --- a/dmp-frontend/src/app/ui/plan/listing/listing-item/plan-listing-item.component.ts +++ b/dmp-frontend/src/app/ui/plan/listing/listing-item/plan-listing-item.component.ts @@ -33,13 +33,13 @@ import { HttpErrorHandlingService } from '@common/modules/errors/error-handling/ import { RouterUtilsService } from '@app/core/services/router/router-utils.service'; @Component({ - selector: 'app-dmp-listing-item-component', + selector: 'app-plan-listing-item-component', templateUrl: './plan-listing-item.component.html', styleUrls: ['./plan-listing-item.component.scss'], }) export class PlanListingItemComponent extends BaseComponent implements OnInit { - @Input() dmp: Plan; + @Input() plan: Plan; @Input() showDivider: boolean = true; @Input() isPublic: boolean; @Output() onClick: EventEmitter = new EventEmitter(); @@ -75,16 +75,16 @@ export class PlanListingItemComponent extends BaseComponent implements OnInit { ngOnInit() { this.analyticsService.trackPageView(AnalyticsService.PlanListingItem); - if (this.dmp.status == PlanStatus.Draft) { + if (this.plan.status == PlanStatus.Draft) { this.isDraft = true; this.isFinalized = false; this.isPublished = false; } - else if (this.dmp.status == PlanStatus.Finalized) { + else if (this.plan.status == PlanStatus.Finalized) { this.isDraft = false; this.isFinalized = true; this.isPublished = false; - if (this.dmp.status === PlanStatus.Finalized && this.dmp.accessType === PlanAccessType.Public) { this.isPublished = true } + if (this.plan.status === PlanStatus.Finalized && this.plan.accessType === PlanAccessType.Public) { this.isPublished = true } } } @@ -99,26 +99,26 @@ export class PlanListingItemComponent extends BaseComponent implements OnInit { autoFocus: false, restoreFocus: false, data: { - planId: this.dmp.id, - dmpName: this.dmp.label, - blueprint: this.dmp.blueprint + planId: this.plan.id, + planName: this.plan.label, + blueprint: this.plan.blueprint } }); } - viewVersions(dmp: Plan) { - if (dmp.accessType == PlanAccessType.Public && dmp.status == PlanStatus.Finalized && !this.dmp.authorizationFlags?.some(x => x === AppPermission.EditPlan)) { - let url = this.router.createUrlTree(['/explore-plans/versions/', dmp.groupId]); + viewVersions(plan: Plan) { + if (plan.accessType == PlanAccessType.Public && plan.status == PlanStatus.Finalized && !this.plan.authorizationFlags?.some(x => x === AppPermission.EditPlan)) { + let url = this.router.createUrlTree(['/explore-plans/versions/', plan.groupId]); window.open(url.toString(), '_blank'); } else { - let url = this.router.createUrlTree(['/plans/versions/', dmp.groupId]); + let url = this.router.createUrlTree(['/plans/versions/', plan.groupId]); window.open(url.toString(), '_blank'); } } isUserPlanRelated() { const principalId: Guid = this.authentication.userId(); - return this.dmp.planUsers?.some(x => (x.user.id === principalId)); + return this.plan.planUsers?.some(x => (x.user.id === principalId)); } cloneClicked() { @@ -126,7 +126,7 @@ export class PlanListingItemComponent extends BaseComponent implements OnInit { maxWidth: '700px', maxHeight: '80vh', data: { - plan: this.dmp + plan: this.plan } }); dialogRef.afterClosed().pipe(takeUntil(this._destroyed)).subscribe((result: Plan) => { @@ -142,7 +142,7 @@ export class PlanListingItemComponent extends BaseComponent implements OnInit { maxWidth: '700px', maxHeight: '80vh', data: { - plan: this.dmp + plan: this.plan } }); dialogRef.afterClosed().pipe(takeUntil(this._destroyed)).subscribe((result: Plan) => { @@ -168,11 +168,11 @@ export class PlanListingItemComponent extends BaseComponent implements OnInit { openDeleteDialog(id: Guid) { let dialogRef: any; - if (this.dmp.descriptions && this.dmp.descriptions.length > 0){ + if (this.plan.descriptions && this.plan.descriptions.length > 0){ dialogRef = this.dialog.open(PlanDeleteDialogComponent, { maxWidth: '300px', data: { - descriptions: this.dmp.descriptions, + descriptions: this.plan.descriptions, } }); } else { @@ -210,7 +210,7 @@ export class PlanListingItemComponent extends BaseComponent implements OnInit { }); } - isDraftDmp(activity: Plan) { + isDraftPlan(activity: Plan) { return activity.status == PlanStatus.Draft; } @@ -230,35 +230,35 @@ export class PlanListingItemComponent extends BaseComponent implements OnInit { this.uiNotificationService.snackBarNotification(error.error.message ? error.error.message : this.language.instant('GENERAL.SNACK-BAR.UNSUCCESSFUL-DELETE'), SnackBarNotificationLevel.Error); } - canEditPlan(dmp: Plan): boolean { - return (this.dmp.authorizationFlags?.some(x => x === AppPermission.EditPlan) || this.authentication.hasPermission(AppPermission.EditPlan)) && this.isPublic == false && this.dmp.belongsToCurrentTenant != false; + canEditPlan(): boolean { + return (this.plan.authorizationFlags?.some(x => x === AppPermission.EditPlan) || this.authentication.hasPermission(AppPermission.EditPlan)) && this.isPublic == false && this.plan.belongsToCurrentTenant != false; } - canCreateNewVersion(dmp: Plan): boolean { - return (this.dmp.authorizationFlags?.some(x => x === AppPermission.CreateNewVersionPlan) || this.authentication.hasPermission(AppPermission.CreateNewVersionPlan)) && this.dmp.versionStatus === PlanVersionStatus.Current && this.isPublic == false && this.dmp.belongsToCurrentTenant != false; + canCreateNewVersion(): boolean { + return (this.plan.authorizationFlags?.some(x => x === AppPermission.CreateNewVersionPlan) || this.authentication.hasPermission(AppPermission.CreateNewVersionPlan)) && this.plan.versionStatus === PlanVersionStatus.Current && this.isPublic == false && this.plan.belongsToCurrentTenant != false; } - canDeletePlan(dmp: Plan): boolean { - return (this.dmp.authorizationFlags?.some(x => x === AppPermission.DeletePlan) || this.authentication.hasPermission(AppPermission.DeletePlan)) && this.isPublic == false && this.dmp.belongsToCurrentTenant != false; + canDeletePlan(): boolean { + return (this.plan.authorizationFlags?.some(x => x === AppPermission.DeletePlan) || this.authentication.hasPermission(AppPermission.DeletePlan)) && this.isPublic == false && this.plan.belongsToCurrentTenant != false; } - canClonePlan(dmp: Plan): boolean { - return this.dmp.authorizationFlags?.some(x => x === AppPermission.ClonePlan) || this.authentication.hasPermission(AppPermission.ClonePlan); + canClonePlan(): boolean { + return this.plan.authorizationFlags?.some(x => x === AppPermission.ClonePlan) || this.authentication.hasPermission(AppPermission.ClonePlan); } - canFinalizePlan(dmp: Plan): boolean { - return (this.dmp.authorizationFlags?.some(x => x === AppPermission.FinalizePlan) || this.authentication.hasPermission(AppPermission.FinalizePlan)) && this.isPublic == false && this.dmp.belongsToCurrentTenant != false; + canFinalizePlan(): boolean { + return (this.plan.authorizationFlags?.some(x => x === AppPermission.FinalizePlan) || this.authentication.hasPermission(AppPermission.FinalizePlan)) && this.isPublic == false && this.plan.belongsToCurrentTenant != false; } - canExportPlan(dmp: Plan): boolean { - return this.dmp.authorizationFlags?.some(x => x === AppPermission.ExportPlan) || this.authentication.hasPermission(AppPermission.ExportPlan); + canExportPlan(): boolean { + return this.plan.authorizationFlags?.some(x => x === AppPermission.ExportPlan) || this.authentication.hasPermission(AppPermission.ExportPlan); } - canInvitePlanUsers(dmp: Plan): boolean { - return (this.dmp.authorizationFlags?.some(x => x === AppPermission.InvitePlanUsers) || this.authentication.hasPermission(AppPermission.InvitePlanUsers)) && this.isPublic == false && this.dmp.belongsToCurrentTenant != false; + canInvitePlanUsers(): boolean { + return (this.plan.authorizationFlags?.some(x => x === AppPermission.InvitePlanUsers) || this.authentication.hasPermission(AppPermission.InvitePlanUsers)) && this.isPublic == false && this.plan.belongsToCurrentTenant != false; } - canAssignPlanUsers(dmp: Plan): boolean { - return (this.dmp.authorizationFlags?.some(x => x === AppPermission.AssignPlanUsers) || this.authentication.hasPermission(AppPermission.AssignPlanUsers)) && this.isPublic == false && this.dmp.belongsToCurrentTenant != false; + canAssignPlanUsers(): boolean { + return (this.plan.authorizationFlags?.some(x => x === AppPermission.AssignPlanUsers) || this.authentication.hasPermission(AppPermission.AssignPlanUsers)) && this.isPublic == false && this.plan.belongsToCurrentTenant != false; } } diff --git a/dmp-frontend/src/app/ui/plan/listing/plan-listing.component.html b/dmp-frontend/src/app/ui/plan/listing/plan-listing.component.html index 66c37cc6b..3815e1970 100644 --- a/dmp-frontend/src/app/ui/plan/listing/plan-listing.component.html +++ b/dmp-frontend/src/app/ui/plan/listing/plan-listing.component.html @@ -62,7 +62,7 @@
- +
diff --git a/dmp-frontend/src/app/ui/plan/listing/plan-listing.component.ts b/dmp-frontend/src/app/ui/plan/listing/plan-listing.component.ts index b5ecf8809..b6ccafef8 100644 --- a/dmp-frontend/src/app/ui/plan/listing/plan-listing.component.ts +++ b/dmp-frontend/src/app/ui/plan/listing/plan-listing.component.ts @@ -194,8 +194,8 @@ export class PlanListingComponent extends BaseListingComponent { + private _filterDmp(plans: BasePlan[]): BasePlan[] { + plans.forEach((dmp: BasePlan) => { dmp.descriptions = dmp.descriptions?.filter(d => d.isActive == IsActive.Active) ?? []; }) - return dmps; + return plans; } private get _lookupFields(): string[] { diff --git a/dmp-frontend/src/app/ui/plan/overview/plan-overview.component.html b/dmp-frontend/src/app/ui/plan/overview/plan-overview.component.html index b22dcce4c..a6e134e61 100644 --- a/dmp-frontend/src/app/ui/plan/overview/plan-overview.component.html +++ b/dmp-frontend/src/app/ui/plan/overview/plan-overview.component.html @@ -1,6 +1,6 @@
-
+
@@ -16,19 +16,19 @@
-
{{ dmp.label }}
+
{{ plan.label }}
.
- +
-

{{ enumUtils.toPlanUserRolesString(planService.getCurrentUserRolesInPlan(dmp?.planUsers)) }} +

{{ enumUtils.toPlanUserRolesString(planService.getCurrentUserRolesInPlan(plan?.planUsers)) }}

.
@@ -41,17 +41,17 @@ {{'PLAN-OVERVIEW.LOCKED' | translate}}
{{'PLAN-OVERVIEW.EDITED' | translate}} : - {{dmp.updatedAt | dateTimeFormatter: "d MMMM y"}} + {{plan.updatedAt | dateTimeFormatter: "d MMMM y"}}
-
+
check {{'PLAN-OVERVIEW.FINALISED' | translate}}
-
+
@@ -74,9 +74,9 @@
- +
{{'PLAN-OVERVIEW.GRANT' | translate}}
-
{{referenceService.getReferencesForTypesFirstSafe(dmp?.planReferences, [this.referenceTypeService.getGrantReferenceType()])?.reference?.label}}
+
{{referenceService.getReferencesForTypesFirstSafe(plan?.planReferences, [this.referenceTypeService.getGrantReferenceType()])?.reference?.label}}
{{'DESCRIPTION-OVERVIEW.RESEARCHERS' | translate}}
@@ -102,19 +102,19 @@
horizontal_rule
{{'PLAN-OVERVIEW.DESCRIPTION' | translate}}
-
+
-

+

-
+
horizontal_rule
{{'PLAN-OVERVIEW.DESCRIPTIONS' | translate}}
- + -
+
horizontal_rule
- +
{{'PLAN-OVERVIEW.DOI-PROVIDED' | translate}}:
- + {{entityDoi.repositoryId}} @@ -147,7 +147,7 @@
- +
@@ -173,8 +173,8 @@
- -
+ +
- - + +
--> - @@ -244,7 +244,7 @@

{{ 'PLAN-OVERVIEW.PLAN-AUTHORS' | translate }}

-
+
-
+
@@ -274,7 +274,7 @@
- diff --git a/dmp-frontend/src/app/ui/plan/overview/plan-overview.component.ts b/dmp-frontend/src/app/ui/plan/overview/plan-overview.component.ts index 77199e589..e07855876 100644 --- a/dmp-frontend/src/app/ui/plan/overview/plan-overview.component.ts +++ b/dmp-frontend/src/app/ui/plan/overview/plan-overview.component.ts @@ -52,15 +52,15 @@ import { NewVersionPlanDialogComponent } from '../new-version-dialog/plan-new-ve import { RouterUtilsService } from '@app/core/services/router/router-utils.service'; @Component({ - selector: 'app-dmp-overview', + selector: 'app-plan-overview', templateUrl: './plan-overview.component.html', styleUrls: ['./plan-overview.component.scss'] }) export class PlanOverviewComponent extends BaseComponent implements OnInit { - dmp: any; + plan: any; selectedBlueprint: PlanBlueprint; - selectedDmpVersion: any; + selectedPlanVersion: any; researchers: PlanReference[] = []; isNew = true; isFinalized = false; @@ -114,7 +114,7 @@ export class PlanOverviewComponent extends BaseComponent implements OnInit { ngOnInit() { this.analyticsService.trackPageView(AnalyticsService.PlanOverview); - // Gets dmp data using parameter id + // Gets plan data using parameter id this.route.params .pipe(takeUntil(this._destroyed)) .subscribe((params: Params) => { @@ -128,28 +128,28 @@ export class PlanOverviewComponent extends BaseComponent implements OnInit { .subscribe(data => { this.breadcrumbService.addIdResolvedValue(data.id?.toString(), data.label); - this.dmp = data; - this.dmp.planUsers = data.planUsers.filter(x => x.isActive === IsActive.Active); - this.dmp.otherPlanVersions = data.otherPlanVersions?.filter(x => x.isActive === IsActive.Active) || null; - if (this.dmp.descriptions) { - if (this.dmp.status == PlanStatus.Finalized) { - this.dmp.descriptions = data.descriptions.filter(x => x.isActive === IsActive.Active && x.status === DescriptionStatus.Finalized); + this.plan = data; + this.plan.planUsers = data.planUsers.filter(x => x.isActive === IsActive.Active); + this.plan.otherPlanVersions = data.otherPlanVersions?.filter(x => x.isActive === IsActive.Active) || null; + if (this.plan.descriptions) { + if (this.plan.status == PlanStatus.Finalized) { + this.plan.descriptions = data.descriptions.filter(x => x.isActive === IsActive.Active && x.status === DescriptionStatus.Finalized); } else { - this.dmp.descriptions = data.descriptions.filter(x => x.isActive === IsActive.Active && x.status !== DescriptionStatus.Canceled); + this.plan.descriptions = data.descriptions.filter(x => x.isActive === IsActive.Active && x.status !== DescriptionStatus.Canceled); } } - if (data.entityDois && data.entityDois.length > 0) this.dmp.entityDois = data.entityDois.filter(x => x.isActive === IsActive.Active); + if (data.entityDois && data.entityDois.length > 0) this.plan.entityDois = data.entityDois.filter(x => x.isActive === IsActive.Active); this.selectedBlueprint = data.blueprint; - this.researchers = this.referenceService.getReferencesForTypes(this.dmp?.planReferences, [this.referenceTypeService.getResearcherReferenceType()]); + this.researchers = this.referenceService.getReferencesForTypes(this.plan?.planReferences, [this.referenceTypeService.getResearcherReferenceType()]); if (!this.hasDoi()) { - this.selectedModel = this.dmp.entityDois[0]; + this.selectedModel = this.plan.entityDois[0]; } - this.selectedDmpVersion = this.dmp; - this.checkLockStatus(this.dmp.id); + this.selectedPlanVersion = this.plan; + this.checkLockStatus(this.plan.id); // this.setIsUserOwner(); // const breadCrumbs = []; // breadCrumbs.push({ parentComponentName: null, label: this.language.instant('NAV-BAR.MY-PLANS'), url: "/plans" }); - // breadCrumbs.push({ parentComponentName: 'PlanListingComponent', label: this.dmp.label, url: '/plans/overview/' + this.dmp.id }); + // breadCrumbs.push({ parentComponentName: 'PlanListingComponent', label: this.plan.label, url: '/plans/overview/' + this.plan.id }); // this.breadCrumbs = observableOf(breadCrumbs); }, (error: any) => { this.httpErrorHandlingService.handleBackedRequestError(error); @@ -172,12 +172,12 @@ export class PlanOverviewComponent extends BaseComponent implements OnInit { this.breadcrumbService.addExcludedParam('public', true); this.breadcrumbService.addIdResolvedValue(data.id?.toString(), data.label); - this.dmp = data; - this.researchers = this.referenceService.getReferencesForTypes(this.dmp?.planReferences, [this.referenceTypeService.getResearcherReferenceType()]); + this.plan = data; + this.researchers = this.referenceService.getReferencesForTypes(this.plan?.planReferences, [this.referenceTypeService.getResearcherReferenceType()]); if (!this.hasDoi()) { - this.selectedModel = this.dmp.entityDois[0]; + this.selectedModel = this.plan.entityDois[0]; } - this.selectedDmpVersion = this.dmp; + this.selectedPlanVersion = this.plan; }, (error: any) => { this.httpErrorHandlingService.handleBackedRequestError(error); @@ -235,57 +235,57 @@ export class PlanOverviewComponent extends BaseComponent implements OnInit { } else return false; } - focusOnAuthor(dmpUserId: Guid, order: number): void { - this.authorFocus = `${dmpUserId}-${order}`; + focusOnAuthor(planUserId: Guid, order: number): void { + this.authorFocus = `${planUserId}-${order}`; } resetAuthorFocus(): void { this.authorFocus = null; } - isFocusedOnUser(dmpUserId: Guid, order: number): boolean { - return `${dmpUserId}-${order}` == this.authorFocus; + isFocusedOnUser(planUserId: Guid, order: number): boolean { + return `${planUserId}-${order}` == this.authorFocus; } canEditPlan(): boolean { - return (this.isDraftDmp()) && (this.dmp.authorizationFlags?.some(x => x === AppPermission.EditPlan) || this.authentication.hasPermission(AppPermission.EditPlan)) && this.isPublicView == false && this.dmp.belongsToCurrentTenant != false; + return (this.isDraftPlan()) && (this.plan.authorizationFlags?.some(x => x === AppPermission.EditPlan) || this.authentication.hasPermission(AppPermission.EditPlan)) && this.isPublicView == false && this.plan.belongsToCurrentTenant != false; } canCreateNewVersion(): boolean { - return (this.dmp.authorizationFlags?.some(x => x === AppPermission.CreateNewVersionPlan) || this.authentication.hasPermission(AppPermission.CreateNewVersionPlan)) && this.dmp.versionStatus === PlanVersionStatus.Current && this.isPublicView == false && this.dmp.belongsToCurrentTenant != false; + return (this.plan.authorizationFlags?.some(x => x === AppPermission.CreateNewVersionPlan) || this.authentication.hasPermission(AppPermission.CreateNewVersionPlan)) && this.plan.versionStatus === PlanVersionStatus.Current && this.isPublicView == false && this.plan.belongsToCurrentTenant != false; } canDeletePlan(): boolean { - return (this.dmp.authorizationFlags?.some(x => x === AppPermission.DeletePlan) || this.authentication.hasPermission(AppPermission.DeletePlan)) && this.isPublicView == false && this.dmp.belongsToCurrentTenant != false; + return (this.plan.authorizationFlags?.some(x => x === AppPermission.DeletePlan) || this.authentication.hasPermission(AppPermission.DeletePlan)) && this.isPublicView == false && this.plan.belongsToCurrentTenant != false; } canClonePlan(): boolean { - return (this.dmp.authorizationFlags?.some(x => x === AppPermission.ClonePlan) || this.authentication.hasPermission(AppPermission.ClonePlan)); + return (this.plan.authorizationFlags?.some(x => x === AppPermission.ClonePlan) || this.authentication.hasPermission(AppPermission.ClonePlan)); } canFinalizePlan(): boolean { - return (this.dmp.authorizationFlags?.some(x => x === AppPermission.FinalizePlan) || this.authentication.hasPermission(AppPermission.FinalizePlan)) && this.isPublicView == false && this.dmp.belongsToCurrentTenant != false; + return (this.plan.authorizationFlags?.some(x => x === AppPermission.FinalizePlan) || this.authentication.hasPermission(AppPermission.FinalizePlan)) && this.isPublicView == false && this.plan.belongsToCurrentTenant != false; } canExportPlan(): boolean { - return (this.dmp.authorizationFlags?.some(x => x === AppPermission.ExportPlan) || this.authentication.hasPermission(AppPermission.ExportPlan)); + return (this.plan.authorizationFlags?.some(x => x === AppPermission.ExportPlan) || this.authentication.hasPermission(AppPermission.ExportPlan)); } canInvitePlanUsers(): boolean { - return (this.dmp.authorizationFlags?.some(x => x === AppPermission.InvitePlanUsers) || this.authentication.hasPermission(AppPermission.InvitePlanUsers)) && this.isPublicView == false && this.dmp.belongsToCurrentTenant != false; + return (this.plan.authorizationFlags?.some(x => x === AppPermission.InvitePlanUsers) || this.authentication.hasPermission(AppPermission.InvitePlanUsers)) && this.isPublicView == false && this.plan.belongsToCurrentTenant != false; } canAssignPlanUsers(): boolean { - return (this.dmp.authorizationFlags?.some(x => x === AppPermission.AssignPlanUsers) || this.authentication.hasPermission(AppPermission.AssignPlanUsers)) && this.isPublicView == false && this.dmp.belongsToCurrentTenant != false; + return (this.plan.authorizationFlags?.some(x => x === AppPermission.AssignPlanUsers) || this.authentication.hasPermission(AppPermission.AssignPlanUsers)) && this.isPublicView == false && this.plan.belongsToCurrentTenant != false; } canDepositPlan(): boolean { - return (this.dmp.authorizationFlags?.some(x => x === AppPermission.DepositPlan) || this.authentication.hasPermission(AppPermission.DepositPlan)) && this.isPublicView == false && this.dmp.belongsToCurrentTenant != false; + return (this.plan.authorizationFlags?.some(x => x === AppPermission.DepositPlan) || this.authentication.hasPermission(AppPermission.DepositPlan)) && this.isPublicView == false && this.plan.belongsToCurrentTenant != false; } editClicked() { - this.router.navigate([this.routerUtils.generateUrl(['/plans/edit', this.dmp.id], '/')]); + this.router.navigate([this.routerUtils.generateUrl(['/plans/edit', this.plan.id], '/')]); } cloneClicked() { @@ -293,7 +293,7 @@ export class PlanOverviewComponent extends BaseComponent implements OnInit { maxWidth: '700px', maxHeight: '80vh', data: { - plan: this.dmp + plan: this.plan } }); dialogRef.afterClosed().pipe(takeUntil(this._destroyed)).subscribe((result: Plan) => { @@ -309,7 +309,7 @@ export class PlanOverviewComponent extends BaseComponent implements OnInit { maxWidth: '700px', maxHeight: '80vh', data: { - plan: this.dmp + plan: this.plan } }); dialogRef.afterClosed().pipe(takeUntil(this._destroyed)).subscribe((result: Plan) => { @@ -322,11 +322,11 @@ export class PlanOverviewComponent extends BaseComponent implements OnInit { deleteClicked() { let dialogRef: any; - if (this.dmp.descriptions && this.dmp.descriptions.length > 0) { + if (this.plan.descriptions && this.plan.descriptions.length > 0) { dialogRef = this.dialog.open(PlanDeleteDialogComponent, { maxWidth: '300px', data: { - descriptions: this.dmp.descriptions, + descriptions: this.plan.descriptions, } }); } else { @@ -343,7 +343,7 @@ export class PlanOverviewComponent extends BaseComponent implements OnInit { dialogRef.afterClosed().pipe(takeUntil(this._destroyed)).subscribe(result => { if (result) { - this.planService.delete(this.dmp.id) + this.planService.delete(this.plan.id) .pipe(takeUntil(this._destroyed)) .subscribe( complete => { this.onDeleteCallbackSuccess() }, @@ -373,38 +373,38 @@ export class PlanOverviewComponent extends BaseComponent implements OnInit { isUserDmpRelated(): boolean { const principalId: Guid = this.authentication.userId(); - return this.dmp.planUsers?.some(x => (x.user.id === principalId)); + return this.plan.planUsers?.some(x => (x.user.id === principalId)); } - isDraftDmp() { - return this.dmp.status == PlanStatus.Draft; + isDraftPlan() { + return this.plan.status == PlanStatus.Draft; } - isFinalizedDmp(dmp: Plan) { - return dmp.status == PlanStatus.Finalized; + isFinalizedDmp(plan: Plan) { + return plan.status == PlanStatus.Finalized; } isPublishedDmp() { - return (this.dmp.status == PlanStatus.Finalized && this.dmp.accessType === PlanAccessType.Public); + return (this.plan.status == PlanStatus.Finalized && this.plan.accessType === PlanAccessType.Public); } hasDoi() { - return (this.dmp.entityDois == null || this.dmp.entityDois.length == 0); + return (this.plan.entityDois == null || this.plan.entityDois.length == 0); } afterDeposit(result: EntityDoi[]) { if (result.length > 0) { - this.dmp.entityDois = result; - this.selectedModel = this.dmp.entityDois[this.dmp.entityDois.length - 1]; + this.plan.entityDois = result; + this.selectedModel = this.plan.entityDois[this.plan.entityDois.length - 1]; } } get inputRepos() { - return this.depositRepos.filter(repo => !this.dmp.entityDois?.find(doi => doi.repositoryId === repo.repositoryId)); + return this.depositRepos.filter(repo => !this.plan.entityDois?.find(doi => doi.repositoryId === repo.repositoryId)); } moreDeposit() { - return (this.dmp.entityDois.length < this.depositRepos.length); + return (this.plan.entityDois.length < this.depositRepos.length); } finalize() { @@ -413,13 +413,13 @@ export class PlanOverviewComponent extends BaseComponent implements OnInit { restoreFocus: false, autoFocus: false, data: { - plan: this.dmp + plan: this.plan } }); dialogRef.afterClosed().pipe(takeUntil(this._destroyed)).subscribe((result: PlanFinalizeDialogOutput) => { if (result && !result.cancelled) { - this.planService.finalize(this.dmp.id, result.descriptionsToBeFinalized) + this.planService.finalize(this.plan.id, result.descriptionsToBeFinalized) .pipe(takeUntil(this._destroyed)) .subscribe(data => { this.reloadPage(); @@ -452,7 +452,7 @@ export class PlanOverviewComponent extends BaseComponent implements OnInit { restoreFocus: false, data: { planId: rowId, - dmpName: rowName, + planName: rowName, blueprint: this.selectedBlueprint } }); @@ -460,9 +460,9 @@ export class PlanOverviewComponent extends BaseComponent implements OnInit { selectDoi(entityDoi: EntityDoi) { this.selectedModel = entityDoi; - const foundIdx = this.dmp.entityDois.findIndex(el => el.id == entityDoi.id); - this.dmp.entityDois.splice(foundIdx, 1); - this.dmp.entityDois.unshift(entityDoi); + const foundIdx = this.plan.entityDois.findIndex(el => el.id == entityDoi.id); + this.plan.entityDois.splice(foundIdx, 1); + this.plan.entityDois.unshift(entityDoi); } createDoiLink(doiModel: any): string { @@ -488,7 +488,7 @@ export class PlanOverviewComponent extends BaseComponent implements OnInit { }); dialogRef.afterClosed().pipe(takeUntil(this._destroyed)).subscribe(result => { if (result) { - this.planService.undoFinalize(this.dmp.id, PlanEditorEntityResolver.lookupFields()).pipe(takeUntil(this._destroyed)) + this.planService.undoFinalize(this.plan.id, PlanEditorEntityResolver.lookupFields()).pipe(takeUntil(this._destroyed)) .subscribe(data => { this.reloadPage(); this.onUpdateCallbackSuccess() @@ -523,7 +523,7 @@ export class PlanOverviewComponent extends BaseComponent implements OnInit { if (result) { const dmpUserRemovePersist: PlanUserRemovePersist = { id: dmpUser.id, - planId: this.dmp.id, + planId: this.plan.id, role: dmpUser.role }; this.planService.removeUser(dmpUserRemovePersist).pipe(takeUntil(this._destroyed)) @@ -566,7 +566,7 @@ export class PlanOverviewComponent extends BaseComponent implements OnInit { getSectionNameById(sectionId: Guid): string { if (sectionId == null) return ''; - let sections: PlanBlueprintDefinitionSection[] = this.dmp?.blueprint?.definition?.sections?.filter((section: PlanBlueprintDefinitionSection) => sectionId === section.id); + let sections: PlanBlueprintDefinitionSection[] = this.plan?.blueprint?.definition?.sections?.filter((section: PlanBlueprintDefinitionSection) => sectionId === section.id); return sections == null ? '' : sections[0].label; } diff --git a/dmp-frontend/src/app/ui/plan/plan-editor-blueprint/plan-editor.model.ts b/dmp-frontend/src/app/ui/plan/plan-editor-blueprint/plan-editor.model.ts index 93a967781..6b495d1cf 100644 --- a/dmp-frontend/src/app/ui/plan/plan-editor-blueprint/plan-editor.model.ts +++ b/dmp-frontend/src/app/ui/plan/plan-editor-blueprint/plan-editor.model.ts @@ -208,10 +208,10 @@ export class PlanPropertiesEditorModel implements PlanPropertiesPersist { public validationErrorModel: ValidationErrorModel = new ValidationErrorModel() ) { } - fromModel(item: PlanProperties, planReferences: PlanReference[], dmpBlueprint: PlanBlueprint): PlanPropertiesEditorModel { + fromModel(item: PlanProperties, planReferences: PlanReference[], planBlueprint: PlanBlueprint): PlanPropertiesEditorModel { - dmpBlueprint.definition.sections.forEach(section => { + planBlueprint.definition.sections.forEach(section => { section.fields?.forEach(field => { if (field.category !== PlanBlueprintFieldCategory.System) { this.planBlueprintValues.set(field.id, new PlanBlueprintValueEditorModel(this.validationErrorModel).fromModel( diff --git a/dmp-frontend/src/common/forms/validation/custom-validator.ts b/dmp-frontend/src/common/forms/validation/custom-validator.ts index ab75b8cf2..1b15a4a4a 100644 --- a/dmp-frontend/src/common/forms/validation/custom-validator.ts +++ b/dmp-frontend/src/common/forms/validation/custom-validator.ts @@ -187,7 +187,7 @@ export function PlanBlueprintSystemFieldRequiredValidator(): ValidatorFn { } }); } - return foundTitle && foundDescription && foundAccess && foundLanguage ? null : { 'dmpBlueprintSystemFieldRequired': true }; + return foundTitle && foundDescription && foundAccess && foundLanguage ? null : { 'planBlueprintSystemFieldRequired': true }; }; } From fe26af8055bc700f385f262f2e2440c620b8203b Mon Sep 17 00:00:00 2001 From: amentis Date: Mon, 8 Jul 2024 13:11:29 +0300 Subject: [PATCH 05/11] rename dmp to plan frontend changes --- dmp-frontend/src/app/app.component.ts | 2 +- .../core/common/enum/respone-error-code.ts | 32 ++++++++--------- dmp-frontend/src/app/core/model/user/user.ts | 2 +- .../app/core/services/user/user.service.ts | 22 ++++++------ .../annotation-dialog.component.ts | 4 +-- .../app/ui/dashboard/dashboard.component.html | 32 ++++++++--------- .../app/ui/dashboard/dashboard.component.ts | 10 +++--- .../recent-edited-activity.component.html | 2 +- .../recent-edited-activity.component.ts | 10 +++--- .../description-copy-dialog.component.html | 2 +- .../description-copy-dialog.component.ts | 11 +++--- .../editor/description-editor.component.html | 2 +- .../editor/description-editor.component.ts | 4 +-- .../form-field-set.component.ts | 4 +-- .../form-section/form-section.component.html | 2 +- .../form-section/form-section.component.ts | 2 +- .../description-form.component.html | 2 +- .../description-form.component.ts | 2 +- .../prefill-description.component.ts | 8 ++--- .../description-editor-entity.resolver.ts | 16 ++++----- ...description-editor-permissions.resolver.ts | 12 +++---- .../listing/description-listing.component.ts | 10 +++--- .../listing/description-listing.routing.ts | 2 +- .../description-filter.component.html | 2 +- .../filtering/description-filter.component.ts | 4 +-- .../description-overview.component.ts | 6 ++-- .../plan-deposit-dropdown.component.ts | 16 ++++----- .../plan-invitation-accepted.component.ts | 6 ++-- .../ui/plan/listing/plan-listing.component.ts | 16 ++++----- .../plan-new-version-dialog.component.html | 2 +- .../plan-new-version-dialog.component.ts | 16 ++++----- .../plan-new-version-dialog.editor.model.ts | 2 +- ...plan-contact-prefill-dialog.component.html | 2 +- .../plan-contact-prefill-dialog.component.ts | 20 +++++------ ...lan-contact-prefill-dialog.editor.model.ts | 4 +-- .../plan-editor.component.ts | 6 ++-- .../plan-finalize-dialog.component.html | 24 ++++++------- .../plan-finalize-dialog.component.ts | 34 +++++++++---------- .../plan-user-field.component.html | 2 +- 39 files changed, 178 insertions(+), 179 deletions(-) diff --git a/dmp-frontend/src/app/app.component.ts b/dmp-frontend/src/app/app.component.ts index d584f1716..16ce315cb 100644 --- a/dmp-frontend/src/app/app.component.ts +++ b/dmp-frontend/src/app/app.component.ts @@ -252,7 +252,7 @@ export class AppComponent implements OnInit, AfterViewInit { return this.authentication.currentAccountIsAuthenticated(); } - goToDMPs() { //not used + goToPlans() { //not used this.router.navigate(['/plans'], { queryParams: { /*refresh : Math.random() ,returnUrl: this.state.url*/ } }); } diff --git a/dmp-frontend/src/app/core/common/enum/respone-error-code.ts b/dmp-frontend/src/app/core/common/enum/respone-error-code.ts index 5d2364b6f..8391bdcd7 100644 --- a/dmp-frontend/src/app/core/common/enum/respone-error-code.ts +++ b/dmp-frontend/src/app/core/common/enum/respone-error-code.ts @@ -13,11 +13,11 @@ export enum ResponseErrorCode { DescriptionTemplateNewVersionConflict = 113, DescriptionTemplateIsNotFinalized = 114, MultipleDescriptionTemplateVersionsNotSupported = 115, - DmpNewVersionConflict = 116, - DmpIsNotFinalized = 117, - MultipleDmpVersionsNotSupported = 118, - DmpIsFinalized = 119, - DmpCanNotChange = 120, + PlanNewVersionConflict = 116, + PlanIsNotFinalized = 117, + MultiplePlanVersionsNotSupported = 118, + PlanIsFinalized = 119, + PlanCanNotChange = 120, PlanDescriptionTemplateCanNotChange = 121, InvalidDescriptionTemplate = 122, DescriptionIsFinalized = 123, @@ -28,11 +28,11 @@ export enum ResponseErrorCode { TenantConfigurationTypeCanNotChange = 128, MultipleTenantConfigurationTypeNotAllowed = 129, TenantCodeExists = 130, - DmpNewVersionAlreadyCreatedDraft = 131, + PlanNewVersionAlreadyCreatedDraft = 131, DescriptionTemplateInactiveUser = 132, DescriptionTemplateMissingUserContactInfo = 133, - DmpInactiveUser = 134, - DmpMissingUserContactInfo = 135, + PlanInactiveUser = 134, + PlanMissingUserContactInfo = 135, ImportDescriptionWithoutPlanDescriptionTemplate = 136, DuplicatePlanUser = 137, DescriptionTemplateNewVersionAlreadyCreatedDraft = 138, @@ -79,15 +79,15 @@ export class ResponseErrorCodeHelper { return language.instant("GENERAL.BACKEND-ERRORS.DESCRIPTION-TEMPLATE-IS-NOT-FINALIZED"); case ResponseErrorCode.MultipleDescriptionTemplateVersionsNotSupported: return language.instant("GENERAL.BACKEND-ERRORS.MULTIPLE-DESCRIPTION-TEMPLATE-VERSIONS-NOT-SUPPORTED"); - case ResponseErrorCode.DmpNewVersionConflict: + case ResponseErrorCode.PlanNewVersionConflict: return language.instant("GENERAL.BACKEND-ERRORS.PLAN-NEW-VERSION-CONFLICT"); - case ResponseErrorCode.DmpIsNotFinalized: + case ResponseErrorCode.PlanIsNotFinalized: return language.instant("GENERAL.BACKEND-ERRORS.PLAN-IS-NOT-FINALIZED"); - case ResponseErrorCode.MultipleDmpVersionsNotSupported: + case ResponseErrorCode.MultiplePlanVersionsNotSupported: return language.instant("GENERAL.BACKEND-ERRORS.MULTIPLE-PLAN-VERSIONS-NOT-SUPPORTED"); - case ResponseErrorCode.DmpIsFinalized: + case ResponseErrorCode.PlanIsFinalized: return language.instant("GENERAL.BACKEND-ERRORS.PLAN-IS-FINALIZED"); - case ResponseErrorCode.DmpCanNotChange: + case ResponseErrorCode.PlanCanNotChange: return language.instant("GENERAL.BACKEND-ERRORS.PLAN-CAN-NOT-CHANGE"); case ResponseErrorCode.PlanDescriptionTemplateCanNotChange: return language.instant("GENERAL.BACKEND-ERRORS.PLAN-DESCRIPTION-TEMPLATE-CAN-NOT-CHANGE"); @@ -109,15 +109,15 @@ export class ResponseErrorCodeHelper { return language.instant("GENERAL.BACKEND-ERRORS.MULTIPLE-TENANT-CONFIGURATION-TYPE-NOT-ALLOWED"); case ResponseErrorCode.TenantCodeExists: return language.instant("GENERAL.BACKEND-ERRORS.TENANT-CODE-EXISTS"); - case ResponseErrorCode.DmpNewVersionAlreadyCreatedDraft: + case ResponseErrorCode.PlanNewVersionAlreadyCreatedDraft: return language.instant("GENERAL.BACKEND-ERRORS.PLAN-NEW-VERSION-ALREADY-CREATED-DRAFT"); case ResponseErrorCode.DescriptionTemplateInactiveUser: return language.instant("GENERAL.BACKEND-ERRORS.DESCRIPTION-TEMPLATE-INACTIVE-USER"); case ResponseErrorCode.DescriptionTemplateMissingUserContactInfo: return language.instant("GENERAL.BACKEND-ERRORS.DESCRIPTION-TEMPLATE-MISSING-USER-CONTACT-INFO"); - case ResponseErrorCode.DmpInactiveUser: + case ResponseErrorCode.PlanInactiveUser: return language.instant("GENERAL.BACKEND-ERRORS.PLAN-INACTIVE-USER"); - case ResponseErrorCode.DmpMissingUserContactInfo: + case ResponseErrorCode.PlanMissingUserContactInfo: return language.instant("GENERAL.BACKEND-ERRORS.PLAN-MISSING-USER-CONTACT-INFO"); case ResponseErrorCode.ImportDescriptionWithoutPlanDescriptionTemplate: return language.instant("GENERAL.BACKEND-ERRORS.IMPORT-DESCRIPTION-WITHOUT-PLAN-DESCRIPTION-TEMPLATE"); diff --git a/dmp-frontend/src/app/core/model/user/user.ts b/dmp-frontend/src/app/core/model/user/user.ts index 4521dab8b..769f1eb54 100644 --- a/dmp-frontend/src/app/core/model/user/user.ts +++ b/dmp-frontend/src/app/core/model/user/user.ts @@ -72,7 +72,7 @@ export interface UserCredentialData { email: String; } -export interface DmpAssociatedUser { +export interface PlanAssociatedUser { id: Guid; name: string; email: string; diff --git a/dmp-frontend/src/app/core/services/user/user.service.ts b/dmp-frontend/src/app/core/services/user/user.service.ts index 818d40ac0..9797c6f98 100644 --- a/dmp-frontend/src/app/core/services/user/user.service.ts +++ b/dmp-frontend/src/app/core/services/user/user.service.ts @@ -1,7 +1,7 @@ import { HttpClient, HttpHeaders, HttpResponse } from '@angular/common/http'; import { Injectable } from '@angular/core'; import { IsActive } from '@app/core/common/enum/is-active.enum'; -import { DmpAssociatedUser, RemoveCredentialRequestPersist, User, UserMergeRequestPersist, UserPersist, UserRolePatchPersist, UserTenantUsersInviteRequest } from '@app/core/model/user/user'; +import { PlanAssociatedUser, RemoveCredentialRequestPersist, User, UserMergeRequestPersist, UserPersist, UserRolePatchPersist, UserTenantUsersInviteRequest } from '@app/core/model/user/user'; import { UserLookup } from '@app/core/query/user.lookup'; import { MultipleAutoCompleteConfiguration } from '@app/library/auto-complete/multiple/multiple-auto-complete-configuration'; import { SingleAutoCompleteConfiguration } from '@app/library/auto-complete/single/single-auto-complete-configuration'; @@ -31,9 +31,9 @@ export class UserService { return this.http.post>(url, q).pipe(catchError((error: any) => throwError(error))); } - queryDmpAssociated(q: UserLookup): Observable> { + queryPlanAssociated(q: UserLookup): Observable> { const url = `${this.apiBase}/plan-associated/query`; - return this.http.post>(url, q).pipe(catchError((error: any) => throwError(error))); + return this.http.post>(url, q).pipe(catchError((error: any) => throwError(error))); } getSingle(id: Guid, reqFields: string[] = []): Observable { @@ -178,14 +178,14 @@ export class UserService { valueAssign: (item: User) => item.id, }; - singleAutoCompleteDmpAssociatedUserConfiguration: SingleAutoCompleteConfiguration = { - initialItems: (data?: any) => this.queryDmpAssociated(this.buildAutocompleteLookup()).pipe(map(x => x.items)), - filterFn: (searchQuery: string, data?: any) => this.queryDmpAssociated(this.buildAutocompleteLookup(searchQuery)).pipe(map(x => x.items)), - getSelectedItem: (selectedItem: any) => this.queryDmpAssociated(this.buildAutocompleteLookup(null, null, [selectedItem])).pipe(map(x => x.items[0])), - displayFn: (item: DmpAssociatedUser) => item.name, - subtitleFn: (item: DmpAssociatedUser) => item.email, - titleFn: (item: DmpAssociatedUser) => item.name, - valueAssign: (item: DmpAssociatedUser) => item.id, + singleAutoCompletePlanAssociatedUserConfiguration: SingleAutoCompleteConfiguration = { + initialItems: (data?: any) => this.queryPlanAssociated(this.buildAutocompleteLookup()).pipe(map(x => x.items)), + filterFn: (searchQuery: string, data?: any) => this.queryPlanAssociated(this.buildAutocompleteLookup(searchQuery)).pipe(map(x => x.items)), + getSelectedItem: (selectedItem: any) => this.queryPlanAssociated(this.buildAutocompleteLookup(null, null, [selectedItem])).pipe(map(x => x.items[0])), + displayFn: (item: PlanAssociatedUser) => item.name, + subtitleFn: (item: PlanAssociatedUser) => item.email, + titleFn: (item: PlanAssociatedUser) => item.name, + valueAssign: (item: PlanAssociatedUser) => item.id, }; public buildAutocompleteLookup(like?: string, excludedIds?: Guid[], ids?: Guid[]): UserLookup { diff --git a/dmp-frontend/src/app/ui/annotations/annotation-dialog-component/annotation-dialog.component.ts b/dmp-frontend/src/app/ui/annotations/annotation-dialog-component/annotation-dialog.component.ts index 176e0e0ea..157dfafef 100644 --- a/dmp-frontend/src/app/ui/annotations/annotation-dialog-component/annotation-dialog.component.ts +++ b/dmp-frontend/src/app/ui/annotations/annotation-dialog-component/annotation-dialog.component.ts @@ -53,7 +53,7 @@ export class AnnotationDialogComponent extends BaseComponent { private formBuilder: FormBuilder = new FormBuilder(); public annotationStatusFormGroup: UntypedFormGroup; public listingStatuses: Status[] = []; - public dmpUsersMentionNames: string[] = []; + public planUsersMentionNames: string[] = []; @ViewChild('annotationStatus') annotationStatus: MatSelectionList; @@ -76,7 +76,7 @@ export class AnnotationDialogComponent extends BaseComponent { this.entityId = data.entityId; this.anchor = data.anchor; this.entityType = data.entityType; - this.dmpUsersMentionNames = data.planUsers.map(x => x.user.name); + this.planUsersMentionNames = data.planUsers.map(x => x.user.name); dialogRef.backdropClick().pipe(takeUntil(this._destroyed)).subscribe(() => dialogRef.close(this.changesMade)); } diff --git a/dmp-frontend/src/app/ui/dashboard/dashboard.component.html b/dmp-frontend/src/app/ui/dashboard/dashboard.component.html index 48a6df501..4156c1481 100644 --- a/dmp-frontend/src/app/ui/dashboard/dashboard.component.html +++ b/dmp-frontend/src/app/ui/dashboard/dashboard.component.html @@ -25,26 +25,26 @@
- clear + clear -

{{'DASHBOARD.PLAN-QUESTION' | translate}}

-

{{'DASHBOARD.INFO-PLAN-TEXT' | translate}}

+

{{'DASHBOARD.PLAN-QUESTION' | translate}}

+

{{'DASHBOARD.INFO-PLAN-TEXT' | translate}}

-

+

{{'DASHBOARD.NEW-QUESTION' | translate}} {{'DASHBOARD.OPEN-AIR-GUIDE' | translate}} {{'DASHBOARD.LEARN-MORE' | translate}}

-

{{'DASHBOARD.PLAN-ABOUT-BEG' | translate}} +

{{'DASHBOARD.PLAN-ABOUT-BEG' | translate}} {{'DASHBOARD.DESCRIPTIONS-DASHBOARD-TEXT' | translate}} {{'DASHBOARD.PLAN-ABOUT-END' | translate}}

-
+
-
+
@@ -55,26 +55,26 @@
-
+
{{'DASHBOARD.LATEST-ACTIVITY' | translate}}
- + - + > - + - +
-
+
@@ -101,7 +101,7 @@
-
+
{{'DASHBOARD.PERSONAL-USAGE' | translate}}
@@ -162,7 +162,7 @@
-
+
{{'DASHBOARD.PUBLIC-USAGE' | translate}}
@@ -184,7 +184,7 @@
-
+
{{'DASHBOARD.PUBLIC-USAGE' | translate}}
diff --git a/dmp-frontend/src/app/ui/dashboard/dashboard.component.ts b/dmp-frontend/src/app/ui/dashboard/dashboard.component.ts index 3f27d9928..b779007bb 100644 --- a/dmp-frontend/src/app/ui/dashboard/dashboard.component.ts +++ b/dmp-frontend/src/app/ui/dashboard/dashboard.component.ts @@ -126,7 +126,7 @@ export class DashboardComponent extends BaseComponent implements OnInit { } } - public hasDmps(): boolean { + public hasPlans(): boolean { if (this.dashboardStatistics) { return this.dashboardStatistics.planCount !== 0 || this.dashboardStatistics.descriptionCount !== 0 @@ -199,10 +199,10 @@ export class DashboardComponent extends BaseComponent implements OnInit { ] }; - public setDashboardTourDmpText(): void { - const dmpText = this.language.instant('DASHBOARD.TOUR-GUIDE.PLAN') + '\n\n' + + public setDashboardTourPlanText(): void { + const planText = this.language.instant('DASHBOARD.TOUR-GUIDE.PLAN') + '\n\n' + this.language.instant('DASHBOARD.TOUR-GUIDE.START-NEW'); - this.dashboardTour.steps[0].title = dmpText; + this.dashboardTour.steps[0].title = planText; } public setDashboardImportFileText(): void { @@ -222,7 +222,7 @@ export class DashboardComponent extends BaseComponent implements OnInit { } openDashboardTour() { - this.setDashboardTourDmpText(); + this.setDashboardTourPlanText(); this.setDashboardImportFileText(); this.setDashboardStartWizardText(); this.setDescriptionText(); diff --git a/dmp-frontend/src/app/ui/dashboard/recent-edited-activity/recent-edited-activity.component.html b/dmp-frontend/src/app/ui/dashboard/recent-edited-activity/recent-edited-activity.component.html index 00d037165..56d77c783 100644 --- a/dmp-frontend/src/app/ui/dashboard/recent-edited-activity/recent-edited-activity.component.html +++ b/dmp-frontend/src/app/ui/dashboard/recent-edited-activity/recent-edited-activity.component.html @@ -38,7 +38,7 @@ {{'GENERAL.ACTIONS.NO-MORE-AVAILABLE' | translate}}
-
+
diff --git a/dmp-frontend/src/app/ui/dashboard/recent-edited-activity/recent-edited-activity.component.ts b/dmp-frontend/src/app/ui/dashboard/recent-edited-activity/recent-edited-activity.component.ts index 143c5cc9c..0dbab076b 100644 --- a/dmp-frontend/src/app/ui/dashboard/recent-edited-activity/recent-edited-activity.component.ts +++ b/dmp-frontend/src/app/ui/dashboard/recent-edited-activity/recent-edited-activity.component.ts @@ -44,18 +44,18 @@ export class RecentEditedActivityComponent extends BaseComponent implements OnIn @Input() type: string; @Input() selectedType: string; @Input() includeDescriptions: boolean = false; - @Input() includeDmps: boolean = false; + @Input() includePlans: boolean = false; @Input() onlyDrafts: boolean = false; - @Input() hasDmps: boolean = false; + @Input() hasPlans: boolean = false; @Output() addNewDescription: BehaviorSubject = new BehaviorSubject(false); get onlyPlans(): boolean { - return this.includeDmps && !this.includeDescriptions; + return this.includePlans && !this.includeDescriptions; } get onlyDescriptions(): boolean { - return !this.includeDmps && this.includeDescriptions; + return !this.includePlans && this.includeDescriptions; } pageLessSize= this.pageSize; @@ -166,7 +166,7 @@ export class RecentEditedActivityComponent extends BaseComponent implements OnIn this.lookup.like = this.formGroup.get('like').value; this.lookup.project = { fields : [ - ...(this.includeDmps ? this._getPlanLookup() : []), + ...(this.includePlans ? this._getPlanLookup() : []), ...(this.includeDescriptions ? this._getDescriptionLookup() : []) ] }; diff --git a/dmp-frontend/src/app/ui/description/description-copy-dialog/description-copy-dialog.component.html b/dmp-frontend/src/app/ui/description/description-copy-dialog/description-copy-dialog.component.html index 2547e3f44..7fe92037c 100644 --- a/dmp-frontend/src/app/ui/description/description-copy-dialog/description-copy-dialog.component.html +++ b/dmp-frontend/src/app/ui/description/description-copy-dialog/description-copy-dialog.component.html @@ -7,7 +7,7 @@
- +
diff --git a/dmp-frontend/src/app/ui/description/description-copy-dialog/description-copy-dialog.component.ts b/dmp-frontend/src/app/ui/description/description-copy-dialog/description-copy-dialog.component.ts index 68d19441f..e7b17ea8e 100644 --- a/dmp-frontend/src/app/ui/description/description-copy-dialog/description-copy-dialog.component.ts +++ b/dmp-frontend/src/app/ui/description/description-copy-dialog/description-copy-dialog.component.ts @@ -26,10 +26,9 @@ import { DescriptionTemplatesInSection, PlanBlueprint, PlanBlueprintDefinition, }) export class DescriptionCopyDialogComponent { - dmpModel: Plan; sections: PlanBlueprintDefinitionSection[] = []; descriptionDescriptionTemplateLabel: String; - dmpAutoCompleteConfiguration: SingleAutoCompleteConfiguration = { //TODO: add filter to only get DMPs that have connection with the same Description Template group. + planAutoCompleteConfiguration: SingleAutoCompleteConfiguration = { //TODO: add filter to only get DMPs that have connection with the same Description Template group. initialItems: (data?: any) => this.planService.query(this.buildPlanLookup(null,null,null, this.planDescriptionTemplateLookup)).pipe(map(x => x.items)), filterFn: (searchQuery: string, data?: any) => this.planService.query(this.buildPlanLookup(searchQuery, null, null, this.planDescriptionTemplateLookup)).pipe(map(x => x.items)), getSelectedItem: (selectedItem: any) => this.planService.query(this.buildPlanLookup(null, null, [selectedItem])).pipe(map(x => x.items[0])), @@ -83,16 +82,16 @@ export class DescriptionCopyDialogComponent { ngOnInit() { } - findSection(dmp: Plan){ - const availableSectionIds = dmp.planDescriptionTemplates?.filter(x => x.descriptionTemplateGroupId === this.data.descriptionTemplate.groupId && x.isActive == IsActive.Active).map(y => y.sectionId); - this.sections = dmp.blueprint.definition.sections.filter(x => x.hasTemplates == true && availableSectionIds?.includes(x.id)) || []; + findSection(plan: Plan){ + const availableSectionIds = plan.planDescriptionTemplates?.filter(x => x.descriptionTemplateGroupId === this.data.descriptionTemplate.groupId && x.isActive == IsActive.Active).map(y => y.sectionId); + this.sections = plan.blueprint.definition.sections.filter(x => x.hasTemplates == true && availableSectionIds?.includes(x.id)) || []; if(this.sections.length == 1){ this.data.formGroup.get('sectionId').setValue(this.sections[0].id); }else { this.data.formGroup.get('sectionId').setValue(null); } - return dmp.id + return plan.id } cancel() { diff --git a/dmp-frontend/src/app/ui/description/editor/description-editor.component.html b/dmp-frontend/src/app/ui/description/editor/description-editor.component.html index 730b4c3fe..d76fa1808 100644 --- a/dmp-frontend/src/app/ui/description/editor/description-editor.component.html +++ b/dmp-frontend/src/app/ui/description/editor/description-editor.component.html @@ -178,7 +178,7 @@ [validationErrorModel]="editorModel.validationErrorModel" [isNew]="isNew || isCopy" [canReview]="canReview" - [dmpUsers]="item?.plan?.planUsers ?? []" + [planUsers]="item?.plan?.planUsers ?? []" >
diff --git a/dmp-frontend/src/app/ui/description/editor/description-editor.component.ts b/dmp-frontend/src/app/ui/description/editor/description-editor.component.ts index cb2ddb7ae..d202d8b77 100644 --- a/dmp-frontend/src/app/ui/description/editor/description-editor.component.ts +++ b/dmp-frontend/src/app/ui/description/editor/description-editor.component.ts @@ -140,7 +140,7 @@ export class DescriptionEditorComponent extends BaseEditor { diff --git a/dmp-frontend/src/app/ui/description/editor/description-form/components/form-section/form-section.component.html b/dmp-frontend/src/app/ui/description/editor/description-form/components/form-section/form-section.component.html index a22461f6c..88f405b18 100644 --- a/dmp-frontend/src/app/ui/description/editor/description-form/components/form-section/form-section.component.html +++ b/dmp-frontend/src/app/ui/description/editor/description-form/components/form-section/form-section.component.html @@ -25,7 +25,7 @@ [isChild]="false" [hideAnnotations]="isNew" [canReview]="canReview" - [dmpUsers]="dmpUsers" + [planUsers]="planUsers" >
diff --git a/dmp-frontend/src/app/ui/description/editor/description-form/components/form-section/form-section.component.ts b/dmp-frontend/src/app/ui/description/editor/description-form/components/form-section/form-section.component.ts index 2e397ca2f..bbbe82951 100644 --- a/dmp-frontend/src/app/ui/description/editor/description-form/components/form-section/form-section.component.ts +++ b/dmp-frontend/src/app/ui/description/editor/description-form/components/form-section/form-section.component.ts @@ -26,7 +26,7 @@ export class DescriptionFormSectionComponent extends BaseComponent implements On @Input() visibilityRulesService: VisibilityRulesService; @Input() path: string; @Input() descriptionId: Guid; - @Input() dmpUsers: PlanUser[] = []; + @Input() planUsers: PlanUser[] = []; // @Input() descriptionTemplateId: String; diff --git a/dmp-frontend/src/app/ui/description/editor/description-form/description-form.component.html b/dmp-frontend/src/app/ui/description/editor/description-form/description-form.component.html index f29f4c18e..b1119a46b 100644 --- a/dmp-frontend/src/app/ui/description/editor/description-form/description-form.component.html +++ b/dmp-frontend/src/app/ui/description/editor/description-form/description-form.component.html @@ -15,7 +15,7 @@
- +
diff --git a/dmp-frontend/src/app/ui/description/editor/description-form/description-form.component.ts b/dmp-frontend/src/app/ui/description/editor/description-form/description-form.component.ts index 7dcce55ff..4490a1ebe 100644 --- a/dmp-frontend/src/app/ui/description/editor/description-form/description-form.component.ts +++ b/dmp-frontend/src/app/ui/description/editor/description-form/description-form.component.ts @@ -27,7 +27,7 @@ export class DescriptionFormComponent extends BaseComponent implements OnInit, O @Input() datasetDescription: String; @Input() linkToScroll: LinkToScroll; @Input() validationErrorModel: ValidationErrorModel; - @Input() dmpUsers: PlanUser[] = []; + @Input() planUsers: PlanUser[] = []; @Output() formChanged: EventEmitter = new EventEmitter(); diff --git a/dmp-frontend/src/app/ui/description/editor/prefill-description/prefill-description.component.ts b/dmp-frontend/src/app/ui/description/editor/prefill-description/prefill-description.component.ts index 4564a4acf..2584edc63 100644 --- a/dmp-frontend/src/app/ui/description/editor/prefill-description/prefill-description.component.ts +++ b/dmp-frontend/src/app/ui/description/editor/prefill-description/prefill-description.component.ts @@ -31,7 +31,7 @@ export class PrefillDescriptionDialogComponent extends BaseComponent implements prefillSelected: boolean = false; prefillForm: UntypedFormGroup; - dmp: Plan; + plan: Plan; planSectionId: Guid; availableDescriptionTemplates: DescriptionTemplate[] = []; @@ -43,13 +43,13 @@ export class PrefillDescriptionDialogComponent extends BaseComponent implements @Inject(MAT_DIALOG_DATA) public data: any) { super(); - this.dmp = data.plan; + this.plan = data.plan; this.planSectionId = data.planSectionId; - this.availableDescriptionTemplates = this.dmp.planDescriptionTemplates.filter(x => x.sectionId == this.planSectionId && x.isActive == IsActive.Active).map(x => x.currentDescriptionTemplate); + this.availableDescriptionTemplates = this.plan.planDescriptionTemplates.filter(x => x.sectionId == this.planSectionId && x.isActive == IsActive.Active).map(x => x.currentDescriptionTemplate); } ngOnInit() { - const availablePrefillingSourcesIds = this.dmp.blueprint.definition.sections.filter(x => x.id === this.planSectionId)[0].prefillingSources?.map(x => x.id) || null; + const availablePrefillingSourcesIds = this.plan.blueprint.definition.sections.filter(x => x.id === this.planSectionId)[0].prefillingSources?.map(x => x.id) || null; this.singlePrefillingSourceAutoCompleteConfiguration = this.prefillingSourceService.getSingleAutocompleteConfiguration(availablePrefillingSourcesIds); this.progressIndicationService.getProgressIndicationObservable().pipe(takeUntil(this._destroyed)).subscribe(x => { diff --git a/dmp-frontend/src/app/ui/description/editor/resolvers/description-editor-entity.resolver.ts b/dmp-frontend/src/app/ui/description/editor/resolvers/description-editor-entity.resolver.ts index ee9f5478e..bc97377fa 100644 --- a/dmp-frontend/src/app/ui/description/editor/resolvers/description-editor-entity.resolver.ts +++ b/dmp-frontend/src/app/ui/description/editor/resolvers/description-editor-entity.resolver.ts @@ -34,7 +34,7 @@ export class DescriptionEditorEntityResolver extends BaseEditorResolver { public static lookupFields(): string[] { return [ ...DescriptionEditorEntityResolver.descriptionLookupFields(), - ...DescriptionEditorEntityResolver.dmpLookupFields(nameof(x => x.plan)), + ...DescriptionEditorEntityResolver.planLookupFields(nameof(x => x.plan)), ...DescriptionEditorEntityResolver.descriptionTemplateLookupFieldsForDescrption(), ] } @@ -115,7 +115,7 @@ export class DescriptionEditorEntityResolver extends BaseEditorResolver { ] } - public static dmpLookupFields(prefix?: string): string[] { + public static planLookupFields(prefix?: string): string[] { return [ (prefix ? prefix + '.' : '') + [nameof(x => x.id)].join('.'), (prefix ? prefix + '.' : '') + [nameof(x => x.label)].join('.'), @@ -176,20 +176,20 @@ export class DescriptionEditorEntityResolver extends BaseEditorResolver { } return this.descriptionService.getSingle(Guid.parse(id), fields).pipe(tap(d => this.breadcrumbService.addIdResolvedValue(d.id.toString(), d.label))); } else if (planId != null && planSectionId != null && copyPlanId == null) { - return this.planService.getSingle(Guid.parse(planId), DescriptionEditorEntityResolver.dmpLookupFields()) + return this.planService.getSingle(Guid.parse(planId), DescriptionEditorEntityResolver.planLookupFields()) .pipe(tap(x => { this.breadcrumbService.addExcludedParam(planId, true); this.breadcrumbService.addIdResolvedValue(planSectionId, this.language.instant("DESCRIPTION-EDITOR.TITLE-NEW")); - }), takeUntil(this._destroyed), map(dmp => { + }), takeUntil(this._destroyed), map(plan => { const description: Description = {}; - description.plan = dmp; + description.plan = plan; description.planDescriptionTemplate = { sectionId: Guid.parse(planSectionId) } return description; })); } else if (copyPlanId != null && id != null && planSectionId != null) { - return this.planService.getSingle(Guid.parse(copyPlanId), DescriptionEditorEntityResolver.dmpLookupFields()).pipe(tap(x => this.breadcrumbService.addIdResolvedValue(x.id?.toString(), x.label)), takeUntil(this._destroyed), concatMap(dmp => { + return this.planService.getSingle(Guid.parse(copyPlanId), DescriptionEditorEntityResolver.planLookupFields()).pipe(tap(x => this.breadcrumbService.addIdResolvedValue(x.id?.toString(), x.label)), takeUntil(this._destroyed), concatMap(plan => { return this.descriptionService.getSingle(Guid.parse(id), DescriptionEditorEntityResolver.cloneLookupFields()) .pipe(tap(x => { this.breadcrumbService.addExcludedParam(copyPlanId, true) @@ -200,9 +200,9 @@ export class DescriptionEditorEntityResolver extends BaseEditorResolver { description.id = null; description.hash = null; description.status = DescriptionStatus.Draft; - description.plan = dmp; + description.plan = plan; description.planDescriptionTemplate = { - id: dmp.planDescriptionTemplates.filter(x => x.sectionId == Guid.parse(planSectionId) && x.descriptionTemplateGroupId == description.descriptionTemplate.groupId)[0].id, + id: plan.planDescriptionTemplates.filter(x => x.sectionId == Guid.parse(planSectionId) && x.descriptionTemplateGroupId == description.descriptionTemplate.groupId)[0].id, sectionId: Guid.parse(planSectionId) } return description; diff --git a/dmp-frontend/src/app/ui/description/editor/resolvers/description-editor-permissions.resolver.ts b/dmp-frontend/src/app/ui/description/editor/resolvers/description-editor-permissions.resolver.ts index 9ee56ca30..5aa34d07f 100644 --- a/dmp-frontend/src/app/ui/description/editor/resolvers/description-editor-permissions.resolver.ts +++ b/dmp-frontend/src/app/ui/description/editor/resolvers/description-editor-permissions.resolver.ts @@ -46,13 +46,13 @@ export class DescriptionEditorPermissionsResolver extends BaseEditorResolver { })); } else if (planId != null && planSectionId != null && copyPlanId == null) { - return this.planService.getSingle(Guid.parse(planId), DescriptionEditorEntityResolver.dmpLookupFields()) + return this.planService.getSingle(Guid.parse(planId), DescriptionEditorEntityResolver.planLookupFields()) .pipe(tap(x => { this.breadcrumbService.addExcludedParam(planId, true); this.breadcrumbService.addIdResolvedValue(planSectionId, this.language.instant("DESCRIPTION-EDITOR.TITLE-NEW")); - }), takeUntil(this._destroyed), map(dmp => { + }), takeUntil(this._destroyed), map(plan => { const description: Description = {}; - description.plan = dmp; + description.plan = plan; description.planDescriptionTemplate = { sectionId: Guid.parse(planSectionId) } @@ -67,7 +67,7 @@ export class DescriptionEditorPermissionsResolver extends BaseEditorResolver { return this.descriptionService.getDescriptionSectionPermissions(descriptionSectionPermissionResolverModel).pipe(takeUntil(this._destroyed)); })); } else if (copyPlanId != null && id != null && planSectionId != null) { - return this.planService.getSingle(Guid.parse(copyPlanId), DescriptionEditorEntityResolver.dmpLookupFields()).pipe(tap(x => this.breadcrumbService.addIdResolvedValue(x.id?.toString(), x.label)), takeUntil(this._destroyed), concatMap(dmp => { + return this.planService.getSingle(Guid.parse(copyPlanId), DescriptionEditorEntityResolver.planLookupFields()).pipe(tap(x => this.breadcrumbService.addIdResolvedValue(x.id?.toString(), x.label)), takeUntil(this._destroyed), concatMap(plan => { //TODO return this.descriptionService.getSingle(Guid.parse(id), DescriptionEditorEntityResolver.cloneLookupFields()) .pipe(tap(x => { @@ -79,9 +79,9 @@ export class DescriptionEditorPermissionsResolver extends BaseEditorResolver { description.id = null; description.hash = null; description.status = DescriptionStatus.Draft; - description.plan = dmp; + description.plan = plan; description.planDescriptionTemplate = { - id: dmp.planDescriptionTemplates.filter(x => x.sectionId == Guid.parse(planSectionId) && x.descriptionTemplateGroupId == description.descriptionTemplate.groupId)[0].id, + id: plan.planDescriptionTemplates.filter(x => x.sectionId == Guid.parse(planSectionId) && x.descriptionTemplateGroupId == description.descriptionTemplate.groupId)[0].id, sectionId: Guid.parse(planSectionId) } return description; diff --git a/dmp-frontend/src/app/ui/description/listing/description-listing.component.ts b/dmp-frontend/src/app/ui/description/listing/description-listing.component.ts index 0aeb9f274..b54ad498e 100644 --- a/dmp-frontend/src/app/ui/description/listing/description-listing.component.ts +++ b/dmp-frontend/src/app/ui/description/listing/description-listing.component.ts @@ -207,7 +207,7 @@ export class DescriptionListingComponent extends BaseListingComponent 0; + let plans = formGroup.get("associatedPlanIds")?.value ?? null; let addDmps = plans && plans?.length > 0; let roles = formGroup.get("role")?.value !== null ? [formGroup.get("role")?.value] : null; let addRoles = roles && roles?.length > 0; if (addDmps || addRoles) { lookup.planSubQuery = DescriptionFilterService.initializePlanLookup(); @@ -434,7 +434,7 @@ export class DescriptionListingComponent extends BaseListingComponent 0 ? lookup.statuses[0] : null], role: lookup.planSubQuery?.planUserSubQuery?.userRoles ? lookup.planSubQuery?.planUserSubQuery?.userRoles[0] : [], descriptionTemplates: lookup.descriptionTemplateSubQuery?.ids ? [lookup.descriptionTemplateSubQuery?.ids] : [], - associatedDmpIds: lookup.planSubQuery?.ids ? [lookup.planSubQuery?.ids] : [], + associatedPlanIds: lookup.planSubQuery?.ids ? [lookup.planSubQuery?.ids] : [], tags: lookup.descriptionTagSubQuery?.tagIds ? [lookup.descriptionTagSubQuery?.tagIds] : [], }); } diff --git a/dmp-frontend/src/app/ui/description/listing/description-listing.routing.ts b/dmp-frontend/src/app/ui/description/listing/description-listing.routing.ts index a4c49e5e9..5df456f55 100644 --- a/dmp-frontend/src/app/ui/description/listing/description-listing.routing.ts +++ b/dmp-frontend/src/app/ui/description/listing/description-listing.routing.ts @@ -13,7 +13,7 @@ const routes: Routes = [ }, }, { - path: 'dmp/:planId', + path: 'plan/:planId', component: DescriptionListingComponent, canActivate: [AuthGuard], data: { diff --git a/dmp-frontend/src/app/ui/description/listing/filtering/description-filter.component.html b/dmp-frontend/src/app/ui/description/listing/filtering/description-filter.component.html index f333be6f5..f19b2df65 100644 --- a/dmp-frontend/src/app/ui/description/listing/filtering/description-filter.component.html +++ b/dmp-frontend/src/app/ui/description/listing/filtering/description-filter.component.html @@ -37,7 +37,7 @@
{{'DESCRIPTION-LISTING.FILTERS.ASSOCIATED-PLANS.NAME' | translate}}
{{'DESCRIPTION-LISTING.FILTERS.ASSOCIATED-PLANS.PLACEHOLDER' | translate }} - +
diff --git a/dmp-frontend/src/app/ui/description/listing/filtering/description-filter.component.ts b/dmp-frontend/src/app/ui/description/listing/filtering/description-filter.component.ts index 485d2e407..3cb6fb33a 100644 --- a/dmp-frontend/src/app/ui/description/listing/filtering/description-filter.component.ts +++ b/dmp-frontend/src/app/ui/description/listing/filtering/description-filter.component.ts @@ -45,7 +45,7 @@ export class DescriptionFilterComponent extends BaseCriteriaComponent implements options: UntypedFormGroup; descriptionTemplateAutoCompleteConfiguration: MultipleAutoCompleteConfiguration; - dmpAutoCompleteConfiguration: MultipleAutoCompleteConfiguration; + planAutoCompleteConfiguration: MultipleAutoCompleteConfiguration; tagAutoCompleteConfiguration: MultipleAutoCompleteConfiguration; referenceTypeAutocompleteConfiguration: SingleAutoCompleteConfiguration; referenceAutocompleteConfiguration: Map; @@ -71,7 +71,7 @@ export class DescriptionFilterComponent extends BaseCriteriaComponent implements if (changes['filterFormGroup']) { this.descriptionTemplateAutoCompleteConfiguration = this.descriptionTemplateService.buildMultipleAutocompleteConfiguration(); - this.dmpAutoCompleteConfiguration = this.planService.multipleAutocompleteConfiguration; + this.planAutoCompleteConfiguration = this.planService.multipleAutocompleteConfiguration; this.tagAutoCompleteConfiguration = this.tagService.multipleAutocompleteConfiguration; this.referenceTypeAutocompleteConfiguration = this.getReferenceTypeAutocompleteConfiguration(); this.referenceAutocompleteConfiguration = new Map(); diff --git a/dmp-frontend/src/app/ui/description/overview/description-overview.component.ts b/dmp-frontend/src/app/ui/description/overview/description-overview.component.ts index 574dc6072..e56dd79d9 100644 --- a/dmp-frontend/src/app/ui/description/overview/description-overview.component.ts +++ b/dmp-frontend/src/app/ui/description/overview/description-overview.component.ts @@ -308,11 +308,11 @@ export class DescriptionOverviewComponent extends BaseComponent implements OnIni }); } - dmpClicked(dmp: Plan) { + dmpClicked(plan: Plan) { if (this.isPublicView) { - this.router.navigate([this.routerUtils.generateUrl(['/explore-plans/overview/public/', dmp.id.toString()])]); + this.router.navigate([this.routerUtils.generateUrl(['/explore-plans/overview/public/', plan.id.toString()])]); } else { - this.router.navigate([this.routerUtils.generateUrl(['/plans/overview/', dmp.id.toString()])]); + this.router.navigate([this.routerUtils.generateUrl(['/plans/overview/', plan.id.toString()])]); } } diff --git a/dmp-frontend/src/app/ui/plan/editor/plan-deposit-dropdown/plan-deposit-dropdown.component.ts b/dmp-frontend/src/app/ui/plan/editor/plan-deposit-dropdown/plan-deposit-dropdown.component.ts index 2db6265d2..677573dc4 100644 --- a/dmp-frontend/src/app/ui/plan/editor/plan-deposit-dropdown/plan-deposit-dropdown.component.ts +++ b/dmp-frontend/src/app/ui/plan/editor/plan-deposit-dropdown/plan-deposit-dropdown.component.ts @@ -26,7 +26,7 @@ import { nameof } from 'ts-simple-nameof'; }) export class PlanDepositDropdown extends BaseComponent implements OnInit { @Input() inputRepos: DepositConfiguration[]; - @Input() dmp: Plan; + @Input() plan: Plan; outputRepos = []; logos: Map = new Map(); @Output() outputReposEmitter: EventEmitter = new EventEmitter(); @@ -49,8 +49,8 @@ export class PlanDepositDropdown extends BaseComponent implements OnInit { } ngOnInit(): void { - for (var i = 0; i < this.dmp?.entityDois?.length; i++) { - this.inputRepos = this.inputRepos.filter(r => this.hasDoi(r, this.dmp.entityDois, i)); + for (var i = 0; i < this.plan?.entityDois?.length; i++) { + this.inputRepos = this.inputRepos.filter(r => this.hasDoi(r, this.plan.entityDois, i)); } this.inputRepos.forEach(repo => { if (repo.hasLogo) { @@ -76,12 +76,12 @@ export class PlanDepositDropdown extends BaseComponent implements OnInit { dialogRef.afterClosed().pipe(takeUntil(this._destroyed)).subscribe(result => { switch (result) { case 0: - this.showOauth2Dialog(this.depositOauth2DialogService.getLoginUrl(repo), repo, this.dmp); + this.showOauth2Dialog(this.depositOauth2DialogService.getLoginUrl(repo), repo, this.plan); break; case 1: const depositRequest: DepositRequest = { repositoryId: repo.repositoryId, - planId: this.dmp.id, + planId: this.plan.id, authorizationCode: null, project: this.EntityDoiFields() }; @@ -99,7 +99,7 @@ export class PlanDepositDropdown extends BaseComponent implements OnInit { } else if (repo.depositType == DepositConfigurationStatus.System) { const depositRequest: DepositRequest = { repositoryId: repo.repositoryId, - planId: this.dmp.id, + planId: this.plan.id, authorizationCode: null, project: this.EntityDoiFields() }; @@ -121,14 +121,14 @@ export class PlanDepositDropdown extends BaseComponent implements OnInit { this.uiNotificationService.snackBarNotification(error.error.message ? error.error.message : this.language.instant('PLAN-EDITOR.SNACK-BAR.UNSUCCESSFUL-DOI'), SnackBarNotificationLevel.Error); } - showOauth2Dialog(url: string, repo: DepositConfiguration, dmp: Plan) { + showOauth2Dialog(url: string, repo: DepositConfiguration, plan: Plan) { this.depositOauth2DialogService.login(url) .pipe(takeUntil(this._destroyed)) .subscribe(code => { if (code !== undefined) { const depositRequest: DepositRequest = { repositoryId: repo.repositoryId, - planId: dmp.id, + planId: plan.id, authorizationCode: code, project: this.EntityDoiFields() }; diff --git a/dmp-frontend/src/app/ui/plan/invitation/accepted/plan-invitation-accepted.component.ts b/dmp-frontend/src/app/ui/plan/invitation/accepted/plan-invitation-accepted.component.ts index 7df3f42ca..1058e79d8 100644 --- a/dmp-frontend/src/app/ui/plan/invitation/accepted/plan-invitation-accepted.component.ts +++ b/dmp-frontend/src/app/ui/plan/invitation/accepted/plan-invitation-accepted.component.ts @@ -1,13 +1,13 @@ import { Component, OnInit } from '@angular/core'; import { ActivatedRoute, Router } from '@angular/router'; import { AuthService } from '@app/core/services/auth/auth.service'; -import { DmpInvitationService } from '@app/core/services/plan/dmp-invitation.service'; +import { DmpInvitationService } from '@app/core/services/plan/plan-invitation.service'; import { BaseComponent } from '@common/base/base.component'; import { takeUntil } from 'rxjs/operators'; @Component({ - selector: 'app-dmp-invitation-accepted-component', - templateUrl: 'dmp-invitation-accepted.component.html', + selector: 'app-plan-invitation-accepted-component', + templateUrl: 'plan-invitation-accepted.component.html', }) export class InvitationAcceptedComponent extends BaseComponent implements OnInit { diff --git a/dmp-frontend/src/app/ui/plan/listing/plan-listing.component.ts b/dmp-frontend/src/app/ui/plan/listing/plan-listing.component.ts index b6ccafef8..1e3eeb663 100644 --- a/dmp-frontend/src/app/ui/plan/listing/plan-listing.component.ts +++ b/dmp-frontend/src/app/ui/plan/listing/plan-listing.component.ts @@ -150,11 +150,11 @@ export class PlanListingComponent extends BaseListingComponent document.documentElement.clientHeight } - public setDashboardTourDmpText(): void { - const dmpText = this.language.instant('PLAN-LISTING.TEXT-INFO') + '\n\n' + + public setDashboardTourPlanText(): void { + const planText = this.language.instant('PLAN-LISTING.TEXT-INFO') + '\n\n' + this.language.instant('PLAN-LISTING.TEXT-INFO-QUESTION') + ' ' + this.language.instant('PLAN-LISTING.LINK-ZENODO') + ' ' + this.language.instant('PLAN-LISTING.GET-IDEA'); - this.dashboardTour.steps[0].title = dmpText; + this.dashboardTour.steps[0].title = planText; } public setDashboardTourDescriptionText(): void { @@ -315,7 +315,7 @@ export class PlanListingComponent extends BaseListingComponent { - dmp.descriptions = dmp.descriptions?.filter(d => d.isActive == IsActive.Active) ?? []; + plans.forEach((plan: BasePlan) => { + plan.descriptions = plan.descriptions?.filter(d => d.isActive == IsActive.Active) ?? []; }) return plans; } diff --git a/dmp-frontend/src/app/ui/plan/new-version-dialog/plan-new-version-dialog.component.html b/dmp-frontend/src/app/ui/plan/new-version-dialog/plan-new-version-dialog.component.html index 42800b902..a2e06a47d 100644 --- a/dmp-frontend/src/app/ui/plan/new-version-dialog/plan-new-version-dialog.component.html +++ b/dmp-frontend/src/app/ui/plan/new-version-dialog/plan-new-version-dialog.component.html @@ -52,7 +52,7 @@ {{ 'PLAN-NEW-VERSION-DIALOG.ACTIONS.TOGGLE-DESCRIPTIONS' | translate }} - +
diff --git a/dmp-frontend/src/app/ui/plan/new-version-dialog/plan-new-version-dialog.component.ts b/dmp-frontend/src/app/ui/plan/new-version-dialog/plan-new-version-dialog.component.ts index 10957ebef..4ea67392d 100644 --- a/dmp-frontend/src/app/ui/plan/new-version-dialog/plan-new-version-dialog.component.ts +++ b/dmp-frontend/src/app/ui/plan/new-version-dialog/plan-new-version-dialog.component.ts @@ -32,7 +32,7 @@ import { Description } from '@app/core/model/description/description'; }) export class NewVersionPlanDialogComponent extends BaseComponent { - dmp: Plan; + plan: Plan; editorModel: DmpNewVersionDialogEditorModel; formGroup: UntypedFormGroup; selectedBlueprintSections: PlanBlueprintDefinitionSection[]; @@ -83,8 +83,8 @@ export class NewVersionPlanDialogComponent extends BaseComponent { @Inject(MAT_DIALOG_DATA) public data: any ) { super(); - this.dmp = data.plan; - this.dmp.planDescriptionTemplates = this.dmp.planDescriptionTemplates?.filter(x => x.isActive === IsActive.Active); + this.plan = data.plan; + this.plan.planDescriptionTemplates = this.plan.planDescriptionTemplates?.filter(x => x.isActive === IsActive.Active); } get allDescriptionsNo(): number{ @@ -109,15 +109,15 @@ export class NewVersionPlanDialogComponent extends BaseComponent { ngOnInit() { - this.selectedBlueprintSections = this.dmp.blueprint?.definition?.sections?.filter(x => x.hasTemplates) || null; - this.editorModel = new DmpNewVersionDialogEditorModel().fromModel(this.dmp, this.dmp.blueprint); + this.selectedBlueprintSections = this.plan.blueprint?.definition?.sections?.filter(x => x.hasTemplates) || null; + this.editorModel = new DmpNewVersionDialogEditorModel().fromModel(this.plan, this.plan.blueprint); this.formGroup = this.editorModel.buildForm(); } selectedBlueprintChanged(item: PlanBlueprint): void{ this.selectedBlueprintSections = item.definition?.sections?.filter(x => x.hasTemplates) || null; if(this.selectedBlueprintSections && this.hasDescriptions()) { - this.formGroup = this.editorModel.fromModel(this.dmp, item, this.formGroup.get('label').value, this.formGroup.get('description').value).buildForm(); + this.formGroup = this.editorModel.fromModel(this.plan, item, this.formGroup.get('label').value, this.formGroup.get('description').value).buildForm(); } } @@ -170,7 +170,7 @@ export class NewVersionPlanDialogComponent extends BaseComponent { } hasDescriptions() { - return this.dmp.descriptions?.length > 0; + return this.plan.descriptions?.length > 0; } close() { @@ -188,7 +188,7 @@ export class NewVersionPlanDialogComponent extends BaseComponent { formData.descriptions = formData.descriptions.filter(x => x.blueprintSectionId != null) } this.planService.newVersion(formData, PlanEditorEntityResolver.lookupFields()).pipe(takeUntil(this._destroyed)).subscribe( - dmp => this.dialogRef.close(dmp), + plan => this.dialogRef.close(plan), error => this.onCallbackError(error) ); diff --git a/dmp-frontend/src/app/ui/plan/new-version-dialog/plan-new-version-dialog.editor.model.ts b/dmp-frontend/src/app/ui/plan/new-version-dialog/plan-new-version-dialog.editor.model.ts index c3ea907f9..57378fdd4 100644 --- a/dmp-frontend/src/app/ui/plan/new-version-dialog/plan-new-version-dialog.editor.model.ts +++ b/dmp-frontend/src/app/ui/plan/new-version-dialog/plan-new-version-dialog.editor.model.ts @@ -32,7 +32,7 @@ export class DmpNewVersionDialogEditorModel implements NewVersionPlanPersist { // initialize because blueprint changed this.descriptions = []; - if (item.planDescriptionTemplates?.length > 0 && blueprint.id === item.blueprint.id) { // dmp's first blueprint + if (item.planDescriptionTemplates?.length > 0 && blueprint.id === item.blueprint.id) { // plan's first blueprint item.descriptions.forEach(description => { this.descriptions.push(new NewVersionDmpDescriptionEditorModel(this.validationErrorModel).fromModel(description.id, description.planDescriptionTemplate.sectionId)); }) diff --git a/dmp-frontend/src/app/ui/plan/plan-contact-prefill-dialog/plan-contact-prefill-dialog.component.html b/dmp-frontend/src/app/ui/plan/plan-contact-prefill-dialog/plan-contact-prefill-dialog.component.html index 065419046..7cf86b325 100644 --- a/dmp-frontend/src/app/ui/plan/plan-contact-prefill-dialog/plan-contact-prefill-dialog.component.html +++ b/dmp-frontend/src/app/ui/plan/plan-contact-prefill-dialog/plan-contact-prefill-dialog.component.html @@ -13,7 +13,7 @@
{{'PLAN-CONTACT-PREFILL-DIALOG.FIELDS.USER' | translate}} - +
diff --git a/dmp-frontend/src/app/ui/plan/plan-contact-prefill-dialog/plan-contact-prefill-dialog.component.ts b/dmp-frontend/src/app/ui/plan/plan-contact-prefill-dialog/plan-contact-prefill-dialog.component.ts index 5c264d7fa..b43358ed7 100644 --- a/dmp-frontend/src/app/ui/plan/plan-contact-prefill-dialog/plan-contact-prefill-dialog.component.ts +++ b/dmp-frontend/src/app/ui/plan/plan-contact-prefill-dialog/plan-contact-prefill-dialog.component.ts @@ -4,7 +4,7 @@ import { BaseComponent } from '@common/base/base.component'; import { UserService } from '@app/core/services/user/user.service'; import { SingleAutoCompleteConfiguration } from '@app/library/auto-complete/single/single-auto-complete-configuration'; import { map } from 'rxjs'; -import { DmpAssociatedUser } from '@app/core/model/user/user'; +import { PlanAssociatedUser } from '@app/core/model/user/user'; import { UntypedFormGroup } from '@angular/forms'; import { PlanContactPrefillDialogEditorModel } from './plan-contact-prefill-dialog.editor.model'; import { FormService } from '@common/forms/form-service'; @@ -22,15 +22,15 @@ export class PlanContactPrefillDialogComponent extends BaseComponent { contactFormGroup: UntypedFormGroup; label: string; - singleAutoCompleteDmpAssociatedUserConfiguration: SingleAutoCompleteConfiguration = { - initialItems: (data?: any) => this.userService.queryDmpAssociated(this.userService.buildAutocompleteLookup()).pipe(map(x => x.items)), - filterFn: (searchQuery: string, data?: any) => this.userService.queryDmpAssociated(this.userService.buildAutocompleteLookup(searchQuery)).pipe(map(x => x.items)), - getSelectedItem: (selectedItem: any) => this.userService.queryDmpAssociated(this.userService.buildAutocompleteLookup(null, null, [selectedItem.id])).pipe(map(x => x.items[0])), - displayFn: (item: DmpAssociatedUser) => item.name, - subtitleFn: (item: DmpAssociatedUser) => item.email, - titleFn: (item: DmpAssociatedUser) => item.name, - valueAssign: (item: DmpAssociatedUser) => item, - uniqueAssign: (item: DmpAssociatedUser) => item.id + singleAutoCompletePlanAssociatedUserConfiguration: SingleAutoCompleteConfiguration = { + initialItems: (data?: any) => this.userService.queryPlanAssociated(this.userService.buildAutocompleteLookup()).pipe(map(x => x.items)), + filterFn: (searchQuery: string, data?: any) => this.userService.queryPlanAssociated(this.userService.buildAutocompleteLookup(searchQuery)).pipe(map(x => x.items)), + getSelectedItem: (selectedItem: any) => this.userService.queryPlanAssociated(this.userService.buildAutocompleteLookup(null, null, [selectedItem.id])).pipe(map(x => x.items[0])), + displayFn: (item: PlanAssociatedUser) => item.name, + subtitleFn: (item: PlanAssociatedUser) => item.email, + titleFn: (item: PlanAssociatedUser) => item.name, + valueAssign: (item: PlanAssociatedUser) => item, + uniqueAssign: (item: PlanAssociatedUser) => item.id }; constructor( private userService: UserService, diff --git a/dmp-frontend/src/app/ui/plan/plan-contact-prefill-dialog/plan-contact-prefill-dialog.editor.model.ts b/dmp-frontend/src/app/ui/plan/plan-contact-prefill-dialog/plan-contact-prefill-dialog.editor.model.ts index 266c2ff0f..01f2d0906 100644 --- a/dmp-frontend/src/app/ui/plan/plan-contact-prefill-dialog/plan-contact-prefill-dialog.editor.model.ts +++ b/dmp-frontend/src/app/ui/plan/plan-contact-prefill-dialog/plan-contact-prefill-dialog.editor.model.ts @@ -1,11 +1,11 @@ import { UntypedFormBuilder, UntypedFormGroup, Validators } from "@angular/forms"; -import { DmpAssociatedUser } from "@app/core/model/user/user"; +import { PlanAssociatedUser } from "@app/core/model/user/user"; import { BackendErrorValidator } from '@common/forms/validation/custom-validator'; import { ValidationErrorModel } from '@common/forms/validation/error-model/validation-error-model'; import { Validation, ValidationContext } from '@common/forms/validation/validation-context'; import { Guid } from "@common/types/guid"; -export class PlanContactPrefillDialogEditorModel implements DmpAssociatedUser { +export class PlanContactPrefillDialogEditorModel implements PlanAssociatedUser { id: Guid; name: string; email: string; diff --git a/dmp-frontend/src/app/ui/plan/plan-editor-blueprint/plan-editor.component.ts b/dmp-frontend/src/app/ui/plan/plan-editor-blueprint/plan-editor.component.ts index 1394ca79c..d7fed6815 100644 --- a/dmp-frontend/src/app/ui/plan/plan-editor-blueprint/plan-editor.component.ts +++ b/dmp-frontend/src/app/ui/plan/plan-editor-blueprint/plan-editor.component.ts @@ -250,7 +250,7 @@ export class PlanEditorComponent extends BaseEditor imple this.checkLock(this.item.id, LockTargetType.Plan, 'PLAN-EDITOR.LOCKED-DIALOG.TITLE', 'PLAN-EDITOR.LOCKED-DIALOG.MESSAGE'); } } catch (error) { - this.logger.error('Could not parse Dmp item: ' + data + error); + this.logger.error('Could not parse Plan item: ' + data + error); this.uiNotificationService.snackBarNotification(this.language.instant('COMMONS.ERRORS.DEFAULT'), SnackBarNotificationLevel.Error); } } @@ -532,14 +532,14 @@ export class PlanEditorComponent extends BaseEditor imple } private buildFormAfterBlueprintSelection() { - const dmp: Plan = { + const plan: Plan = { label: this.formGroup.get('label').value, description: this.formGroup.get('description').value, blueprint: this.selectedBlueprint, status: PlanStatus.Draft } - this.prepareForm(dmp); + this.prepareForm(plan); } // diff --git a/dmp-frontend/src/app/ui/plan/plan-finalize-dialog/plan-finalize-dialog.component.html b/dmp-frontend/src/app/ui/plan/plan-finalize-dialog/plan-finalize-dialog.component.html index d66d60ea2..f6058c171 100644 --- a/dmp-frontend/src/app/ui/plan/plan-finalize-dialog/plan-finalize-dialog.component.html +++ b/dmp-frontend/src/app/ui/plan/plan-finalize-dialog/plan-finalize-dialog.component.html @@ -14,20 +14,20 @@ {{ 'PLAN-FINALISE-DIALOG.PLAN' | translate }} - {{ dmp.label }} + {{ plan.label }} - {{ dmp.description }} + {{ plan.description }} - + {{ 'PLAN-FINALISE-DIALOG.DESCRPIPTIONS' | translate }} -
-
+
+
bookmark bookmark

@@ -42,7 +42,7 @@

{{ description.label }}

-
{{ 'PLAN-FINALISE-DIALOG.EMPTY' | translate }}
+
{{ 'PLAN-FINALISE-DIALOG.EMPTY' | translate }}
@@ -56,11 +56,11 @@
- + {{ 'PLAN-FINALISE-DIALOG.VALIDATION.INVALID-PLAN' | translate }} - +
{{error}} @@ -68,7 +68,7 @@
- + {{'PLAN-FINALISE-DIALOG.VALIDATION.AT-LEAST-ONE-DESCRPIPTION-FINALISED' | translate}}
@@ -77,10 +77,10 @@
{{ 'PLAN-FINALISE-DIALOG.IMPACT' | translate }}
-
+
{{ 'PLAN-FINALISE-DIALOG.PUBLIC-PLAN-MESSAGE' | translate }}
-
+
{{ 'PLAN-FINALISE-DIALOG.RESTRICTED-PLAN-MESSAGE' | translate }}
@@ -90,7 +90,7 @@
- +
diff --git a/dmp-frontend/src/app/ui/plan/plan-finalize-dialog/plan-finalize-dialog.component.ts b/dmp-frontend/src/app/ui/plan/plan-finalize-dialog/plan-finalize-dialog.component.ts index 74de3b32f..0e3817307 100644 --- a/dmp-frontend/src/app/ui/plan/plan-finalize-dialog/plan-finalize-dialog.component.ts +++ b/dmp-frontend/src/app/ui/plan/plan-finalize-dialog/plan-finalize-dialog.component.ts @@ -19,9 +19,9 @@ import { takeUntil } from 'rxjs/operators'; }) export class PlanFinalizeDialogComponent extends BaseComponent implements OnInit { - dmp: Plan; - isDmpValid: boolean; - dmpErrors: string[]; + plan: Plan; + isPlanValid: boolean; + planErrors: string[]; planAccessTypeEnum = PlanAccessType; descriptionStatusEnum = DescriptionStatus; descriptionValidationOutputEnum = DescriptionValidationOutput; @@ -38,18 +38,18 @@ export class PlanFinalizeDialogComponent extends BaseComponent implements OnInit @Inject(MAT_DIALOG_DATA) public data: any ) { super(); - this.dmp = data.plan; + this.plan = data.plan; } ngOnInit(): void { - this.planService.validate(this.dmp.id).pipe(takeUntil(this._destroyed),) + this.planService.validate(this.plan.id).pipe(takeUntil(this._destroyed),) .subscribe(result => { if (result.result === PlanValidationOutput.Valid){ - this.validateDescriptions(this.dmp); - this.isDmpValid = true; + this.validateDescriptions(this.plan); + this.isPlanValid = true; }else{ - this.isDmpValid = false; - this.dmpErrors = result.errors; + this.isPlanValid = false; + this.planErrors = result.errors; } }, error => { @@ -73,8 +73,8 @@ export class PlanFinalizeDialogComponent extends BaseComponent implements OnInit } getFinalizedDescriptions() { - if (!this.dmp.descriptions) return []; - const finalizedDescriptions = this.dmp.descriptions.filter(x => x.status === DescriptionStatus.Finalized); + if (!this.plan.descriptions) return []; + const finalizedDescriptions = this.plan.descriptions.filter(x => x.status === DescriptionStatus.Finalized); if (finalizedDescriptions?.length > 0){ finalizedDescriptions.forEach(finalize => { this.descriptionValidationOutputMap.set(finalize.id, DescriptionValidationOutput.Valid); @@ -87,17 +87,17 @@ export class PlanFinalizeDialogComponent extends BaseComponent implements OnInit this.dialogRef.close({ cancelled: true } as PlanFinalizeDialogOutput); } - validateDescriptions(dmp: Plan) { - if (!dmp.descriptions?.some(x => x.status == DescriptionStatus.Draft)) return; + validateDescriptions(plan: Plan) { + if (!plan.descriptions?.some(x => x.status == DescriptionStatus.Draft)) return; - const draftDescriptions = this.dmp.descriptions.filter(x => x.status == DescriptionStatus.Draft) || []; + const draftDescriptions = this.plan.descriptions.filter(x => x.status == DescriptionStatus.Draft) || []; if ( draftDescriptions.length > 0){ draftDescriptions.forEach(draft => { this.descriptionValidationOutputMap.set(draft.id, DescriptionValidationOutput.Pending); }); } - this.descriptionService.validate(dmp.descriptions.filter(x => x.status == DescriptionStatus.Draft).map(x => x.id)).pipe(takeUntil(this._destroyed),) + this.descriptionService.validate(plan.descriptions.filter(x => x.status == DescriptionStatus.Draft).map(x => x.id)).pipe(takeUntil(this._destroyed),) .subscribe(result => { this.validationResults = result; }, @@ -108,8 +108,8 @@ export class PlanFinalizeDialogComponent extends BaseComponent implements OnInit } get validDraftDescriptions() { - if (!this.dmp.descriptions) return []; - return this.dmp.descriptions.filter(x => this.validationResults.some(y => y.descriptionId == x.id && y.result == DescriptionValidationOutput.Valid)); + if (!this.plan.descriptions) return []; + return this.plan.descriptions.filter(x => this.validationResults.some(y => y.descriptionId == x.id && y.result == DescriptionValidationOutput.Valid)); } } diff --git a/dmp-frontend/src/app/ui/plan/plan-user-field/plan-user-field.component.html b/dmp-frontend/src/app/ui/plan/plan-user-field/plan-user-field.component.html index 9b7a441a9..19312ffb6 100644 --- a/dmp-frontend/src/app/ui/plan/plan-user-field/plan-user-field.component.html +++ b/dmp-frontend/src/app/ui/plan/plan-user-field/plan-user-field.component.html @@ -44,7 +44,7 @@
{{'PLAN-EDITOR.FIELDS.USER' | translate}} - + {{user.get('user').getError('backendError').message}} {{'GENERAL.VALIDATION.REQUIRED' | translate}} From d44d4207638f2dc4d11baf7855f4b7427a00c181 Mon Sep 17 00:00:00 2001 From: Thomas Georgios Giannos Date: Mon, 8 Jul 2024 13:33:08 +0300 Subject: [PATCH 06/11] Swagger common strings refactoring --- .../controllers/DescriptionController.java | 8 ++++---- .../DescriptionTemplateController.java | 8 ++++---- .../DescriptionTemplateTypeController.java | 8 ++++---- .../controllers/EntityDoiController.java | 8 ++++---- .../opencdmp/controllers/LockController.java | 8 ++++---- .../controllers/PlanBlueprintController.java | 8 ++++---- .../opencdmp/controllers/PlanController.java | 8 ++++---- .../controllers/ReferenceController.java | 16 +++++++-------- .../controllers/ReferenceTypeController.java | 8 ++++---- .../opencdmp/controllers/TagController.java | 8 ++++---- .../opencdmp/controllers/UserController.java | 16 +++++++-------- .../controllers/swagger/SwaggerHelpers.java | 20 +++++++++++++++++++ 12 files changed, 72 insertions(+), 52 deletions(-) diff --git a/backend/web/src/main/java/org/opencdmp/controllers/DescriptionController.java b/backend/web/src/main/java/org/opencdmp/controllers/DescriptionController.java index 6e73adec2..a42c2599e 100644 --- a/backend/web/src/main/java/org/opencdmp/controllers/DescriptionController.java +++ b/backend/web/src/main/java/org/opencdmp/controllers/DescriptionController.java @@ -165,8 +165,8 @@ public class DescriptionController { @OperationWithTenantHeader(summary = "Query all descriptions", description = SwaggerHelpers.Description.endpoint_query, requestBody = @io.swagger.v3.oas.annotations.parameters.RequestBody(description = SwaggerHelpers.Description.endpoint_query_request_body, content = @Content( examples = { @ExampleObject( - name = "Pagination and projection", - description = "Simple paginated request using a property projection list and pagination info", + name = SwaggerHelpers.Commons.pagination_example, + description = SwaggerHelpers.Commons.pagination_example_description, value = SwaggerHelpers.Description.endpoint_query_request_body_example ) } @@ -177,8 +177,8 @@ public class DescriptionController { ) ), examples = @ExampleObject( - name = "First page", - description = "Example with the first page of paginated results", + name = SwaggerHelpers.Commons.pagination_response_example, + description = SwaggerHelpers.Commons.pagination_response_example_description, value = SwaggerHelpers.Description.endpoint_query_response_example )))) public QueryResult query(@RequestBody DescriptionLookup lookup) throws MyApplicationException, MyForbiddenException { diff --git a/backend/web/src/main/java/org/opencdmp/controllers/DescriptionTemplateController.java b/backend/web/src/main/java/org/opencdmp/controllers/DescriptionTemplateController.java index dc82bdf75..77d2eee27 100644 --- a/backend/web/src/main/java/org/opencdmp/controllers/DescriptionTemplateController.java +++ b/backend/web/src/main/java/org/opencdmp/controllers/DescriptionTemplateController.java @@ -101,8 +101,8 @@ public class DescriptionTemplateController { @OperationWithTenantHeader(summary = "Query all description templates", description = SwaggerHelpers.DescriptionTemplate.endpoint_query, requestBody = @io.swagger.v3.oas.annotations.parameters.RequestBody(description = SwaggerHelpers.DescriptionTemplate.endpoint_query_request_body, content = @Content( examples = { @ExampleObject( - name = "Pagination and projection", - description = "Simple paginated request using a property projection list and pagination info", + name = SwaggerHelpers.Commons.pagination_example, + description = SwaggerHelpers.Commons.pagination_example_description, value = SwaggerHelpers.DescriptionTemplate.endpoint_query_request_body_example ) } @@ -113,8 +113,8 @@ public class DescriptionTemplateController { ) ), examples = @ExampleObject( - name = "First page", - description = "Example with the first page of paginated results", + name = SwaggerHelpers.Commons.pagination_response_example, + description = SwaggerHelpers.Commons.pagination_response_example_description, value = SwaggerHelpers.DescriptionTemplate.endpoint_query_response_example )))) public QueryResult query(@RequestBody DescriptionTemplateLookup lookup) throws MyApplicationException, MyForbiddenException { diff --git a/backend/web/src/main/java/org/opencdmp/controllers/DescriptionTemplateTypeController.java b/backend/web/src/main/java/org/opencdmp/controllers/DescriptionTemplateTypeController.java index dabe332c1..44944a3a2 100644 --- a/backend/web/src/main/java/org/opencdmp/controllers/DescriptionTemplateTypeController.java +++ b/backend/web/src/main/java/org/opencdmp/controllers/DescriptionTemplateTypeController.java @@ -82,8 +82,8 @@ public class DescriptionTemplateTypeController { @OperationWithTenantHeader(summary = "Query all description template types", description = SwaggerHelpers.DescriptionTemplateType.endpoint_query, requestBody = @io.swagger.v3.oas.annotations.parameters.RequestBody(description = SwaggerHelpers.DescriptionTemplateType.endpoint_query_request_body, content = @Content( examples = { @ExampleObject( - name = "Pagination and projection", - description = "Simple paginated request using a property projection list and pagination info", + name = SwaggerHelpers.Commons.pagination_example, + description = SwaggerHelpers.Commons.pagination_example_description, value = SwaggerHelpers.DescriptionTemplateType.endpoint_query_request_body_example ) } @@ -94,8 +94,8 @@ public class DescriptionTemplateTypeController { ) ), examples = @ExampleObject( - name = "First page", - description = "Example with the first page of paginated results", + name = SwaggerHelpers.Commons.pagination_response_example, + description = SwaggerHelpers.Commons.pagination_response_example_description, value = SwaggerHelpers.DescriptionTemplateType.endpoint_query_response_example )))) public QueryResult Query(@RequestBody DescriptionTemplateTypeLookup lookup) throws MyApplicationException, MyForbiddenException { diff --git a/backend/web/src/main/java/org/opencdmp/controllers/EntityDoiController.java b/backend/web/src/main/java/org/opencdmp/controllers/EntityDoiController.java index 742e091d5..ac5902d99 100644 --- a/backend/web/src/main/java/org/opencdmp/controllers/EntityDoiController.java +++ b/backend/web/src/main/java/org/opencdmp/controllers/EntityDoiController.java @@ -82,8 +82,8 @@ public class EntityDoiController { @OperationWithTenantHeader(summary = "Query all entity dois", description = SwaggerHelpers.EntityDoi.endpoint_query, requestBody = @io.swagger.v3.oas.annotations.parameters.RequestBody(description = SwaggerHelpers.EntityDoi.endpoint_query_request_body, content = @Content( examples = { @ExampleObject( - name = "Pagination and projection", - description = "Simple paginated request using a property projection list and pagination info", + name = SwaggerHelpers.Commons.pagination_example, + description = SwaggerHelpers.Commons.pagination_example_description, value = SwaggerHelpers.EntityDoi.endpoint_query_request_body_example ) } @@ -94,8 +94,8 @@ public class EntityDoiController { ) ), examples = @ExampleObject( - name = "First page", - description = "Example with the first page of paginated results", + name = SwaggerHelpers.Commons.pagination_response_example, + description = SwaggerHelpers.Commons.pagination_response_example_description, value = SwaggerHelpers.EntityDoi.endpoint_query_response_example )))) public QueryResult query(@RequestBody EntityDoiLookup lookup) throws MyApplicationException, MyForbiddenException { diff --git a/backend/web/src/main/java/org/opencdmp/controllers/LockController.java b/backend/web/src/main/java/org/opencdmp/controllers/LockController.java index ee78a1498..8966f6f92 100644 --- a/backend/web/src/main/java/org/opencdmp/controllers/LockController.java +++ b/backend/web/src/main/java/org/opencdmp/controllers/LockController.java @@ -105,8 +105,8 @@ public class LockController { @OperationWithTenantHeader(summary = "Query all locked entities", description = SwaggerHelpers.Lock.endpoint_query, requestBody = @io.swagger.v3.oas.annotations.parameters.RequestBody(description = SwaggerHelpers.Lock.endpoint_query_request_body, content = @Content( examples = { @ExampleObject( - name = "Pagination and projection", - description = "Simple paginated request using a property projection list and pagination info", + name = SwaggerHelpers.Commons.pagination_example, + description = SwaggerHelpers.Commons.pagination_example_description, value = SwaggerHelpers.Lock.endpoint_query_request_body_example ) } @@ -117,8 +117,8 @@ public class LockController { ) ), examples = @ExampleObject( - name = "First page", - description = "Example with the first page of paginated results", + name = SwaggerHelpers.Commons.pagination_response_example, + description = SwaggerHelpers.Commons.pagination_response_example_description, value = SwaggerHelpers.Lock.endpoint_query_response_example )))) public QueryResult query(@RequestBody LockLookup lookup) throws MyApplicationException, MyForbiddenException, InvalidAlgorithmParameterException, NoSuchPaddingException, IllegalBlockSizeException, NoSuchAlgorithmException, BadPaddingException, InvalidKeyException { diff --git a/backend/web/src/main/java/org/opencdmp/controllers/PlanBlueprintController.java b/backend/web/src/main/java/org/opencdmp/controllers/PlanBlueprintController.java index 8ec72dc52..44937bdbb 100644 --- a/backend/web/src/main/java/org/opencdmp/controllers/PlanBlueprintController.java +++ b/backend/web/src/main/java/org/opencdmp/controllers/PlanBlueprintController.java @@ -94,8 +94,8 @@ public class PlanBlueprintController { @OperationWithTenantHeader(summary = "Query all plan blueprints", description = SwaggerHelpers.PlanBlueprint.endpoint_query, requestBody = @io.swagger.v3.oas.annotations.parameters.RequestBody(description = SwaggerHelpers.PlanBlueprint.endpoint_query_request_body, content = @Content( examples = { @ExampleObject( - name = "Pagination and projection", - description = "Simple paginated request using a property projection list and pagination info", + name = SwaggerHelpers.Commons.pagination_example, + description = SwaggerHelpers.Commons.pagination_example_description, value = SwaggerHelpers.PlanBlueprint.endpoint_query_request_body_example ) } @@ -106,8 +106,8 @@ public class PlanBlueprintController { ) ), examples = @ExampleObject( - name = "First page", - description = "Example with the first page of paginated results", + name = SwaggerHelpers.Commons.pagination_response_example, + description = SwaggerHelpers.Commons.pagination_response_example_description, value = SwaggerHelpers.PlanBlueprint.endpoint_query_response_example )))) public QueryResult query(@RequestBody PlanBlueprintLookup lookup) throws MyApplicationException, MyForbiddenException { diff --git a/backend/web/src/main/java/org/opencdmp/controllers/PlanController.java b/backend/web/src/main/java/org/opencdmp/controllers/PlanController.java index 08404887f..3a8ce31aa 100644 --- a/backend/web/src/main/java/org/opencdmp/controllers/PlanController.java +++ b/backend/web/src/main/java/org/opencdmp/controllers/PlanController.java @@ -147,8 +147,8 @@ public class PlanController { @PostMapping("query") @OperationWithTenantHeader(summary = "Query all plans", description = SwaggerHelpers.Plan.endpoint_query, requestBody = @io.swagger.v3.oas.annotations.parameters.RequestBody(description = SwaggerHelpers.Plan.endpoint_query_request_body, content = @Content(examples = @ExampleObject( - name = "Pagination and projection", - description = "Simple paginated request using a property projection list and pagination info", + name = SwaggerHelpers.Commons.pagination_example, + description = SwaggerHelpers.Commons.pagination_example_description, value = SwaggerHelpers.Plan.endpoint_query_request_body_example ))), responses = @ApiResponse(description = "OK", responseCode = "200", content = @Content( array = @ArraySchema( @@ -157,8 +157,8 @@ public class PlanController { ) ), examples = @ExampleObject( - name = "First page", - description = "Example with the first page of paginated results", + name = SwaggerHelpers.Commons.pagination_response_example, + description = SwaggerHelpers.Commons.pagination_response_example_description, value = SwaggerHelpers.Plan.endpoint_query_response_example )))) public QueryResult Query(@RequestBody PlanLookup lookup) throws MyApplicationException, MyForbiddenException { diff --git a/backend/web/src/main/java/org/opencdmp/controllers/ReferenceController.java b/backend/web/src/main/java/org/opencdmp/controllers/ReferenceController.java index 0085dc0bb..50154041e 100644 --- a/backend/web/src/main/java/org/opencdmp/controllers/ReferenceController.java +++ b/backend/web/src/main/java/org/opencdmp/controllers/ReferenceController.java @@ -92,8 +92,8 @@ public class ReferenceController { @OperationWithTenantHeader(summary = "Query all references", description = SwaggerHelpers.Reference.endpoint_query, requestBody = @io.swagger.v3.oas.annotations.parameters.RequestBody(description = SwaggerHelpers.Reference.endpoint_query_request_body, content = @Content( examples = { @ExampleObject( - name = "Pagination and projection", - description = "Simple paginated request using a property projection list and pagination info", + name = SwaggerHelpers.Commons.pagination_example, + description = SwaggerHelpers.Commons.pagination_example_description, value = SwaggerHelpers.Reference.endpoint_query_request_body_example ) } @@ -104,8 +104,8 @@ public class ReferenceController { ) ), examples = @ExampleObject( - name = "First page", - description = "Example with the first page of paginated results", + name = SwaggerHelpers.Commons.pagination_response_example, + description = SwaggerHelpers.Commons.pagination_response_example_description, value = SwaggerHelpers.Reference.endpoint_query_response_example )))) public QueryResult query(@RequestBody ReferenceLookup lookup) throws MyApplicationException, MyForbiddenException { @@ -127,8 +127,8 @@ public class ReferenceController { @OperationWithTenantHeader(summary = "Query all references including results from external APIs", description = SwaggerHelpers.Reference.endpoint_search, requestBody = @io.swagger.v3.oas.annotations.parameters.RequestBody(description = SwaggerHelpers.Reference.endpoint_search_request_body, content = @Content( examples = { @ExampleObject( - name = "Pagination and projection", - description = "Simple paginated request using a property projection list and pagination info", + name = SwaggerHelpers.Commons.pagination_example, + description = SwaggerHelpers.Commons.pagination_example_description, value = SwaggerHelpers.Reference.endpoint_search_request_body_example ) } @@ -139,8 +139,8 @@ public class ReferenceController { ) ), examples = @ExampleObject( - name = "First page", - description = "Example with the first page of paginated results", + name = SwaggerHelpers.Commons.pagination_response_example, + description = SwaggerHelpers.Commons.pagination_response_example_description, value = SwaggerHelpers.Reference.endpoint_search_response_example )))) @Swagger404 diff --git a/backend/web/src/main/java/org/opencdmp/controllers/ReferenceTypeController.java b/backend/web/src/main/java/org/opencdmp/controllers/ReferenceTypeController.java index 6c500aac8..f47d022aa 100644 --- a/backend/web/src/main/java/org/opencdmp/controllers/ReferenceTypeController.java +++ b/backend/web/src/main/java/org/opencdmp/controllers/ReferenceTypeController.java @@ -94,8 +94,8 @@ public class ReferenceTypeController{ @OperationWithTenantHeader(summary = "Query all reference types", description = SwaggerHelpers.ReferenceType.endpoint_query, requestBody = @io.swagger.v3.oas.annotations.parameters.RequestBody(description = SwaggerHelpers.ReferenceType.endpoint_query_request_body, content = @Content( examples = { @ExampleObject( - name = "Pagination and projection", - description = "Simple paginated request using a property projection list and pagination info", + name = SwaggerHelpers.Commons.pagination_example, + description = SwaggerHelpers.Commons.pagination_example_description, value = SwaggerHelpers.ReferenceType.endpoint_query_request_body_example ) } @@ -106,8 +106,8 @@ public class ReferenceTypeController{ ) ), examples = @ExampleObject( - name = "First page", - description = "Example with the first page of paginated results", + name = SwaggerHelpers.Commons.pagination_response_example, + description = SwaggerHelpers.Commons.pagination_response_example_description, value = SwaggerHelpers.ReferenceType.endpoint_query_response_example )))) public QueryResult query(@RequestBody ReferenceTypeLookup lookup) throws MyApplicationException, MyForbiddenException { diff --git a/backend/web/src/main/java/org/opencdmp/controllers/TagController.java b/backend/web/src/main/java/org/opencdmp/controllers/TagController.java index 5bde81889..c4069a02b 100644 --- a/backend/web/src/main/java/org/opencdmp/controllers/TagController.java +++ b/backend/web/src/main/java/org/opencdmp/controllers/TagController.java @@ -81,8 +81,8 @@ public class TagController { @OperationWithTenantHeader(summary = "Query all tags", description = SwaggerHelpers.Tag.endpoint_query, requestBody = @io.swagger.v3.oas.annotations.parameters.RequestBody(description = SwaggerHelpers.Tag.endpoint_query_request_body, content = @Content( examples = { @ExampleObject( - name = "Pagination and projection", - description = "Simple paginated request using a property projection list and pagination info", + name = SwaggerHelpers.Commons.pagination_example, + description = SwaggerHelpers.Commons.pagination_example_description, value = SwaggerHelpers.Tag.endpoint_query_request_body_example ) } @@ -93,8 +93,8 @@ public class TagController { ) ), examples = @ExampleObject( - name = "First page", - description = "Example with the first page of paginated results", + name = SwaggerHelpers.Commons.pagination_response_example, + description = SwaggerHelpers.Commons.pagination_response_example_description, value = SwaggerHelpers.Tag.endpoint_query_response_example )))) public QueryResult Query(@RequestBody TagLookup lookup) throws MyApplicationException, MyForbiddenException { diff --git a/backend/web/src/main/java/org/opencdmp/controllers/UserController.java b/backend/web/src/main/java/org/opencdmp/controllers/UserController.java index 908e8df14..23ad6e1d8 100644 --- a/backend/web/src/main/java/org/opencdmp/controllers/UserController.java +++ b/backend/web/src/main/java/org/opencdmp/controllers/UserController.java @@ -111,8 +111,8 @@ public class UserController { @OperationWithTenantHeader(summary = "Query all users", description = SwaggerHelpers.User.endpoint_query, requestBody = @io.swagger.v3.oas.annotations.parameters.RequestBody(description = SwaggerHelpers.User.endpoint_query_request_body, content = @Content( examples = { @ExampleObject( - name = "Pagination and projection", - description = "Simple paginated request using a property projection list and pagination info", + name = SwaggerHelpers.Commons.pagination_example, + description = SwaggerHelpers.Commons.pagination_example_description, value = SwaggerHelpers.User.endpoint_query_request_body_example ) } @@ -123,8 +123,8 @@ public class UserController { ) ), examples = @ExampleObject( - name = "First page", - description = "Example with the first page of paginated results", + name = SwaggerHelpers.Commons.pagination_response_example, + description = SwaggerHelpers.Commons.pagination_response_example_description, value = SwaggerHelpers.User.endpoint_query_response_example )))) public QueryResult query(@RequestBody UserLookup lookup) throws MyApplicationException, MyForbiddenException { @@ -147,8 +147,8 @@ public class UserController { @OperationWithTenantHeader(summary = "Query all plan associated users", description = SwaggerHelpers.User.endpoint_query_plan_associated, requestBody = @io.swagger.v3.oas.annotations.parameters.RequestBody(description = SwaggerHelpers.User.endpoint_query_request_body, content = @Content( examples = { @ExampleObject( - name = "Pagination and projection", - description = "Simple paginated request using a property projection list and pagination info", + name = SwaggerHelpers.Commons.pagination_example, + description = SwaggerHelpers.Commons.pagination_example_description, value = SwaggerHelpers.User.endpoint_query_plan_associated_request_body_example ) } @@ -159,8 +159,8 @@ public class UserController { ) ), examples = @ExampleObject( - name = "First page", - description = "Example with the first page of paginated results", + name = SwaggerHelpers.Commons.pagination_response_example, + description = SwaggerHelpers.Commons.pagination_response_example_description, value = SwaggerHelpers.User.endpoint_query_plan_associated_response_example )))) public QueryResult queryPlanAssociated(@RequestBody UserLookup lookup) throws MyApplicationException, MyForbiddenException { diff --git a/backend/web/src/main/java/org/opencdmp/controllers/swagger/SwaggerHelpers.java b/backend/web/src/main/java/org/opencdmp/controllers/swagger/SwaggerHelpers.java index 34cc0a938..a01110aaf 100644 --- a/backend/web/src/main/java/org/opencdmp/controllers/swagger/SwaggerHelpers.java +++ b/backend/web/src/main/java/org/opencdmp/controllers/swagger/SwaggerHelpers.java @@ -8,6 +8,26 @@ public final class SwaggerHelpers { """ This is an object containing a list of the properties you wish to include in the response, similar to the 'project' attribute on queries. """; + + public static final String pagination_example = + """ + Pagination and projection + """; + + public static final String pagination_example_description = + """ + Simple paginated request using a property projection list and pagination info + """; + + public static final String pagination_response_example = + """ + Pagination and projection + """; + + public static final String pagination_response_example_description = + """ + Simple paginated request using a property projection list and pagination info + """; } public static final class Errors { From 26be07fb17a94c80f3c2b6e478ddf98e32d33c0d Mon Sep 17 00:00:00 2001 From: amentis Date: Mon, 8 Jul 2024 14:11:23 +0300 Subject: [PATCH 07/11] rename dmp to plan frontend changes --- dmp-frontend/src/app/app-routing.module.ts | 4 ++-- .../core/services/matomo/analytics-service.ts | 2 +- .../maintenance-tasks.component.ts | 4 ++-- .../editor/plan-blueprint-editor.component.ts | 2 +- .../description-copy-dialog.component.ts | 2 +- .../editor/description-editor.component.html | 2 +- .../editor/description-editor.component.ts | 8 ++++---- .../listing/description-listing.component.ts | 10 +++++----- .../description-listing-item.component.html | 8 ++++---- .../description-listing-item.component.ts | 6 +++--- .../description-overview.component.html | 6 +++--- .../overview/description-overview.component.ts | 18 +++++++++--------- .../user-dialog/user-dialog.component.html | 2 +- .../user-dialog/user-dialog.component.ts | 2 +- .../plan-invitation-accepted.component.ts | 6 +++--- .../filtering/plan-filter.component.html | 6 +++--- .../listing/filtering/plan-filter.component.ts | 4 ++-- .../plan-listing-item.component.html | 2 +- .../plan-listing-item.component.ts | 2 +- .../ui/plan/listing/plan-listing.component.ts | 14 +++++++------- .../plan-new-version-dialog.component.ts | 6 +++--- .../plan-new-version-dialog.editor.model.ts | 16 ++++++++-------- .../start-new-plan-dialog.component.ts | 4 ++-- .../start-new-plan-dialog.module.ts | 4 ++-- .../plan-common-model-config.editor.model.ts | 4 ++-- .../plan-upload-dialog.component.ts | 14 +++++++------- .../plan-upload-dialog.module.ts | 8 ++++---- .../plan/overview/plan-overview.component.html | 18 +++++++++--------- .../plan/overview/plan-overview.component.ts | 16 ++++++++-------- .../plan-form-progress-indication.component.ts | 2 +- .../plan-form-progress-indication.module.ts | 8 ++++---- .../plan-editor.component.ts | 10 +++++----- .../plan-editor-blueprint/plan-editor.model.ts | 12 ++++++------ .../plan-editor.module.ts | 4 ++-- .../plan-editor.routing.ts | 2 +- .../plan-user-field.component.ts | 4 ++-- dmp-frontend/src/app/ui/plan/plan.module.ts | 10 +++++----- dmp-frontend/src/app/ui/plan/plan.routing.ts | 4 ++-- .../src/app/ui/sidebar/sidebar.component.ts | 10 +++++----- dmp-frontend/src/assets/i18n/baq.json | 2 +- dmp-frontend/src/assets/i18n/de.json | 2 +- dmp-frontend/src/assets/i18n/en.json | 2 +- dmp-frontend/src/assets/i18n/es.json | 2 +- dmp-frontend/src/assets/i18n/gr.json | 2 +- dmp-frontend/src/assets/i18n/hr.json | 2 +- dmp-frontend/src/assets/i18n/pl.json | 2 +- dmp-frontend/src/assets/i18n/pt.json | 2 +- dmp-frontend/src/assets/i18n/sk.json | 2 +- dmp-frontend/src/assets/i18n/sr.json | 2 +- dmp-frontend/src/assets/i18n/tr.json | 2 +- 50 files changed, 144 insertions(+), 144 deletions(-) diff --git a/dmp-frontend/src/app/app-routing.module.ts b/dmp-frontend/src/app/app-routing.module.ts index f3a7c4a16..3c3d55883 100644 --- a/dmp-frontend/src/app/app-routing.module.ts +++ b/dmp-frontend/src/app/app-routing.module.ts @@ -45,7 +45,7 @@ const appRoutes: Routes = [ }, { path: 'plans', - loadChildren: () => import('./ui/plan/plan.module').then(m => m.DmpModule), + loadChildren: () => import('./ui/plan/plan.module').then(m => m.PlanModule), data: { authContext: { permissions: [AppPermission.ViewMyPlanPage] @@ -59,7 +59,7 @@ const appRoutes: Routes = [ }, { path: 'explore-plans', - loadChildren: () => import('./ui/plan/plan.module').then(m => m.PublicDmpModule), + loadChildren: () => import('./ui/plan/plan.module').then(m => m.PublicPlanModule), data: { breadcrumb: true, ...BreadcrumbService.generateRouteDataConfiguration({ diff --git a/dmp-frontend/src/app/core/services/matomo/analytics-service.ts b/dmp-frontend/src/app/core/services/matomo/analytics-service.ts index db77d373d..fc1f0b250 100644 --- a/dmp-frontend/src/app/core/services/matomo/analytics-service.ts +++ b/dmp-frontend/src/app/core/services/matomo/analytics-service.ts @@ -34,7 +34,7 @@ export class AnalyticsService { public static PlanFilterDialog: string = 'DMP Criteria'; public static PlanListingItem: string = 'DMP Listing Item'; public static StartNewPlanDialog: string = 'Start New DMP Dialog'; - public static DmpUploadDialog: string = 'DMP Upload Dialog'; + public static PlanUploadDialog: string = 'DMP Upload Dialog'; public static PlanOverview: string = 'DMP Overview'; public static FAQ: string = 'FAQ'; public static Glossary: string = 'Glossary'; diff --git a/dmp-frontend/src/app/ui/admin/maintenance-tasks/maintenance-tasks.component.ts b/dmp-frontend/src/app/ui/admin/maintenance-tasks/maintenance-tasks.component.ts index 48bc49c94..6b03fecc1 100644 --- a/dmp-frontend/src/app/ui/admin/maintenance-tasks/maintenance-tasks.component.ts +++ b/dmp-frontend/src/app/ui/admin/maintenance-tasks/maintenance-tasks.component.ts @@ -167,12 +167,12 @@ export class MaintenanceTasksComponent extends BaseComponent implements OnInit { .afterClosed() .subscribe(confirm => { if (confirm) { - this.doSendDmpTouchEvents(ev); + this.doSendPlanTouchEvents(ev); } }); } - private doSendDmpTouchEvents(ev: Event) { + private doSendPlanTouchEvents(ev: Event) { (ev.target as HTMLButtonElement).disabled = true; this.maintenanceService.sendPlanTouchEvents().pipe(takeUntil(this._destroyed)).subscribe( _ => { diff --git a/dmp-frontend/src/app/ui/admin/plan-blueprint/editor/plan-blueprint-editor.component.ts b/dmp-frontend/src/app/ui/admin/plan-blueprint/editor/plan-blueprint-editor.component.ts index db73cdb61..f5b4b4067 100644 --- a/dmp-frontend/src/app/ui/admin/plan-blueprint/editor/plan-blueprint-editor.component.ts +++ b/dmp-frontend/src/app/ui/admin/plan-blueprint/editor/plan-blueprint-editor.component.ts @@ -190,7 +190,7 @@ export class PlanBlueprintEditorComponent extends BaseEditor this.planService.query(this.buildPlanLookup(null,null,null, this.planDescriptionTemplateLookup)).pipe(map(x => x.items)), filterFn: (searchQuery: string, data?: any) => this.planService.query(this.buildPlanLookup(searchQuery, null, null, this.planDescriptionTemplateLookup)).pipe(map(x => x.items)), getSelectedItem: (selectedItem: any) => this.planService.query(this.buildPlanLookup(null, null, [selectedItem])).pipe(map(x => x.items[0])), diff --git a/dmp-frontend/src/app/ui/description/editor/description-editor.component.html b/dmp-frontend/src/app/ui/description/editor/description-editor.component.html index d76fa1808..057b03d8f 100644 --- a/dmp-frontend/src/app/ui/description/editor/description-editor.component.html +++ b/dmp-frontend/src/app/ui/description/editor/description-editor.component.html @@ -86,7 +86,7 @@
-
+
chevron_left {{'DESCRIPTION-EDITOR.ACTIONS.BACK-TO' | translate}}
diff --git a/dmp-frontend/src/app/ui/description/editor/description-editor.component.ts b/dmp-frontend/src/app/ui/description/editor/description-editor.component.ts index d202d8b77..bade72910 100644 --- a/dmp-frontend/src/app/ui/description/editor/description-editor.component.ts +++ b/dmp-frontend/src/app/ui/description/editor/description-editor.component.ts @@ -333,7 +333,7 @@ export class DescriptionEditorComponent extends BaseEditor { if (result) { - const dmpUserRemovePersist: DescriptionStatusPersist = { + const planUserRemovePersist: DescriptionStatusPersist = { id: this.formGroup.get('id').value, status: DescriptionStatus.Draft, hash: this.formGroup.get('hash').value }; - this.descriptionService.persistStatus(dmpUserRemovePersist, DescriptionEditorEntityResolver.lookupFields()).pipe(takeUntil(this._destroyed)) + this.descriptionService.persistStatus(planUserRemovePersist, DescriptionEditorEntityResolver.lookupFields()).pipe(takeUntil(this._destroyed)) .subscribe(data => { this.isFinalized = false; this.refreshData(); diff --git a/dmp-frontend/src/app/ui/description/listing/description-listing.component.ts b/dmp-frontend/src/app/ui/description/listing/description-listing.component.ts index b54ad498e..fee1ac61d 100644 --- a/dmp-frontend/src/app/ui/description/listing/description-listing.component.ts +++ b/dmp-frontend/src/app/ui/description/listing/description-listing.component.ts @@ -54,7 +54,7 @@ export class DescriptionListingComponent extends BaseListingComponent 0; + // Plans + let plans = formGroup.get("associatedPlanIds")?.value ?? null; let addPlans = plans && plans?.length > 0; let roles = formGroup.get("role")?.value !== null ? [formGroup.get("role")?.value] : null; let addRoles = roles && roles?.length > 0; - if (addDmps || addRoles) { + if (addPlans || addRoles) { lookup.planSubQuery = DescriptionFilterService.initializePlanLookup(); - if (addDmps) lookup.planSubQuery.ids = plans?.length > 0 ? plans : null; + if (addPlans) lookup.planSubQuery.ids = plans?.length > 0 ? plans : null; if (addRoles) { lookup.planSubQuery.planUserSubQuery = DescriptionFilterService.initializePlanUserLookup(); diff --git a/dmp-frontend/src/app/ui/description/listing/listing-item/description-listing-item.component.html b/dmp-frontend/src/app/ui/description/listing/listing-item/description-listing-item.component.html index 2f62c7252..454d28922 100644 --- a/dmp-frontend/src/app/ui/description/listing/listing-item/description-listing-item.component.html +++ b/dmp-frontend/src/app/ui/description/listing/listing-item/description-listing-item.component.html @@ -8,8 +8,8 @@
{{description.label}}
{{description.label}}
- {{ enumUtils.toPlanUserRolesString(planService.getCurrentUserRolesInPlan(description?.plan?.planUsers)) }} - . + {{ enumUtils.toPlanUserRolesString(planService.getCurrentUserRolesInPlan(description?.plan?.planUsers)) }} + . public{{'DESCRIPTION-LISTING.STATES.PUBLIC' | translate}} done{{ enumUtils.toDescriptionStatusString(description.status) }} create{{ enumUtils.toDescriptionStatusString(description.status) }} @@ -26,11 +26,11 @@ -
-
@@ -72,7 +72,7 @@
-
-
diff --git a/dmp-frontend/src/app/ui/description/overview/description-overview.component.ts b/dmp-frontend/src/app/ui/description/overview/description-overview.component.ts index e56dd79d9..34b8fb480 100644 --- a/dmp-frontend/src/app/ui/description/overview/description-overview.component.ts +++ b/dmp-frontend/src/app/ui/description/overview/description-overview.component.ts @@ -308,7 +308,7 @@ export class DescriptionOverviewComponent extends BaseComponent implements OnIni }); } - dmpClicked(plan: Plan) { + planClicked(plan: Plan) { if (this.isPublicView) { this.router.navigate([this.routerUtils.generateUrl(['/explore-plans/overview/public/', plan.id.toString()])]); } else { @@ -360,7 +360,7 @@ export class DescriptionOverviewComponent extends BaseComponent implements OnIni return sections == null ? '' : sections[0].label; } - openCopyToDmpDialog() { + openCopyToPlanDialog() { const formGroup = this.fb.group({ planId: this.fb.control(null, Validators.required), sectionId: this.fb.control(null, Validators.required), @@ -387,7 +387,7 @@ export class DescriptionOverviewComponent extends BaseComponent implements OnIni }); } - removeUserFromDmp(dmpUser: PlanUser) { + removeUserFromPlan(planUser: PlanUser) { const dialogRef = this.dialog.open(ConfirmationDialogComponent, { data: { message: this.language.instant('GENERAL.CONFIRMATION-DIALOG.DELETE-USER'), @@ -398,12 +398,12 @@ export class DescriptionOverviewComponent extends BaseComponent implements OnIni }); dialogRef.afterClosed().subscribe(result => { if (result) { - const dmpUserRemovePersist: PlanUserRemovePersist = { - id: dmpUser.id, + const planUserRemovePersist: PlanUserRemovePersist = { + id: planUser.id, planId: this.description.plan.id, - role: dmpUser.role + role: planUser.role }; - this.planService.removeUser(dmpUserRemovePersist).pipe(takeUntil(this._destroyed)) + this.planService.removeUser(planUserRemovePersist).pipe(takeUntil(this._destroyed)) .subscribe(data => { this.reloadPage(); }, (error: any) => this.httpErrorHandlingService.handleBackedRequestError(error)); @@ -465,12 +465,12 @@ export class DescriptionOverviewComponent extends BaseComponent implements OnIni }); dialogRef.afterClosed().pipe(takeUntil(this._destroyed)).subscribe(result => { if (result) { - const dmpUserRemovePersist: DescriptionStatusPersist = { + const planUserRemovePersist: DescriptionStatusPersist = { id: description.id, status: DescriptionStatus.Draft, hash: description.hash }; - this.descriptionService.persistStatus(dmpUserRemovePersist).pipe(takeUntil(this._destroyed)) + this.descriptionService.persistStatus(planUserRemovePersist).pipe(takeUntil(this._destroyed)) .subscribe(data => { this.reloadPage(); this.onUpdateCallbackSuccess() diff --git a/dmp-frontend/src/app/ui/navbar/user-dialog/user-dialog.component.html b/dmp-frontend/src/app/ui/navbar/user-dialog/user-dialog.component.html index 1fcc4f6ef..d33a4a52b 100644 --- a/dmp-frontend/src/app/ui/navbar/user-dialog/user-dialog.component.html +++ b/dmp-frontend/src/app/ui/navbar/user-dialog/user-dialog.component.html @@ -5,7 +5,7 @@
diff --git a/dmp-frontend/src/app/ui/navbar/user-dialog/user-dialog.component.ts b/dmp-frontend/src/app/ui/navbar/user-dialog/user-dialog.component.ts index 7fd28bcac..dfe5988ca 100644 --- a/dmp-frontend/src/app/ui/navbar/user-dialog/user-dialog.component.ts +++ b/dmp-frontend/src/app/ui/navbar/user-dialog/user-dialog.component.ts @@ -68,7 +68,7 @@ export class UserDialogComponent implements OnInit, OnDestroy { this.router.navigate([this.routerUtils.generateUrl('/profile')]); } - public navigateToMyDmps() { + public navigateToMyPlans() { this.dialogRef.close(); this.router.navigate([this.routerUtils.generateUrl('/plans')]); } diff --git a/dmp-frontend/src/app/ui/plan/invitation/accepted/plan-invitation-accepted.component.ts b/dmp-frontend/src/app/ui/plan/invitation/accepted/plan-invitation-accepted.component.ts index 1058e79d8..9a3f37a45 100644 --- a/dmp-frontend/src/app/ui/plan/invitation/accepted/plan-invitation-accepted.component.ts +++ b/dmp-frontend/src/app/ui/plan/invitation/accepted/plan-invitation-accepted.component.ts @@ -1,7 +1,7 @@ import { Component, OnInit } from '@angular/core'; import { ActivatedRoute, Router } from '@angular/router'; import { AuthService } from '@app/core/services/auth/auth.service'; -import { DmpInvitationService } from '@app/core/services/plan/plan-invitation.service'; +import { PlanInvitationService } from '@app/core/services/plan/plan-invitation.service'; import { BaseComponent } from '@common/base/base.component'; import { takeUntil } from 'rxjs/operators'; @@ -12,7 +12,7 @@ import { takeUntil } from 'rxjs/operators'; }) export class InvitationAcceptedComponent extends BaseComponent implements OnInit { constructor( - private dmpInvitationService: DmpInvitationService, + private planInvitationService: PlanInvitationService, private route: ActivatedRoute, private router: Router, private authentication: AuthService, @@ -27,7 +27,7 @@ export class InvitationAcceptedComponent extends BaseComponent implements OnInit const id = params['id']; if(this.isAuthenticated()){ - this.dmpInvitationService.exchange(id) + this.planInvitationService.exchange(id) .pipe(takeUntil(this._destroyed)) .subscribe(result => { this.router.navigate(['plans/edit/' + result]); diff --git a/dmp-frontend/src/app/ui/plan/listing/filtering/plan-filter.component.html b/dmp-frontend/src/app/ui/plan/listing/filtering/plan-filter.component.html index a16a0e42d..3d21ccb58 100644 --- a/dmp-frontend/src/app/ui/plan/listing/filtering/plan-filter.component.html +++ b/dmp-frontend/src/app/ui/plan/listing/filtering/plan-filter.component.html @@ -29,16 +29,16 @@
- +
{{ 'PLAN-LISTING.FILTERS.ASSOCIATED-PLAN-BLUEPRINTS.NAME' | translate}}
{{ 'PLAN-LISTING.FILTERS.ASSOCIATED-PLAN-BLUEPRINTS.PLACEHOLDER' | translate }} - +
- +
diff --git a/dmp-frontend/src/app/ui/plan/listing/filtering/plan-filter.component.ts b/dmp-frontend/src/app/ui/plan/listing/filtering/plan-filter.component.ts index 9bfab5d2b..b0306b955 100644 --- a/dmp-frontend/src/app/ui/plan/listing/filtering/plan-filter.component.ts +++ b/dmp-frontend/src/app/ui/plan/listing/filtering/plan-filter.component.ts @@ -41,7 +41,7 @@ export class PlanFilterComponent extends BaseCriteriaComponent implements OnInit maxFileSize: number = 1048576; descriptionTemplateAutoCompleteConfiguration: MultipleAutoCompleteConfiguration; - dmpBlueprintAutoCompleteConfiguration: MultipleAutoCompleteConfiguration; + planBlueprintAutoCompleteConfiguration: MultipleAutoCompleteConfiguration; referenceTypeAutocompleteConfiguration: SingleAutoCompleteConfiguration; referenceAutocompleteConfiguration: Map; @@ -65,7 +65,7 @@ export class PlanFilterComponent extends BaseCriteriaComponent implements OnInit if (changes['filterFormGroup']) { this.descriptionTemplateAutoCompleteConfiguration = this.descriptionTemplateService.buildDescriptionTempalteGroupMultipleAutocompleteConfiguration(); - this.dmpBlueprintAutoCompleteConfiguration = this.planBlueprintService.multipleAutocompleteConfiguration; + this.planBlueprintAutoCompleteConfiguration = this.planBlueprintService.multipleAutocompleteConfiguration; this.referenceTypeAutocompleteConfiguration = this.getReferenceTypeAutocompleteConfiguration(); this.referenceAutocompleteConfiguration = new Map(); diff --git a/dmp-frontend/src/app/ui/plan/listing/listing-item/plan-listing-item.component.html b/dmp-frontend/src/app/ui/plan/listing/listing-item/plan-listing-item.component.html index 6148cdd9d..72506c325 100644 --- a/dmp-frontend/src/app/ui/plan/listing/listing-item/plan-listing-item.component.html +++ b/dmp-frontend/src/app/ui/plan/listing/listing-item/plan-listing-item.component.html @@ -30,7 +30,7 @@
open_in_new{{'PLAN-LISTING.ACTIONS.EXPORT' | translate}} add{{'PLAN-LISTING.ACTIONS.ADD-DESCRIPTION-SHORT' | translate}} - group_add{{'PLAN-LISTING.ACTIONS.INVITE-SHORT' | translate}} + group_add{{'PLAN-LISTING.ACTIONS.INVITE-SHORT' | translate}} filter_none{{'PLAN-LISTING.ACTIONS.CLONE' | translate}} library_books{{'PLAN-LISTING.ACTIONS.VIEW-VERSION' | translate}} diff --git a/dmp-frontend/src/app/ui/plan/listing/listing-item/plan-listing-item.component.ts b/dmp-frontend/src/app/ui/plan/listing/listing-item/plan-listing-item.component.ts index 7e545da9f..fa3659bb3 100644 --- a/dmp-frontend/src/app/ui/plan/listing/listing-item/plan-listing-item.component.ts +++ b/dmp-frontend/src/app/ui/plan/listing/listing-item/plan-listing-item.component.ts @@ -92,7 +92,7 @@ export class PlanListingItemComponent extends BaseComponent implements OnInit { return this.authentication.currentAccountIsAuthenticated(); } - inviteToDmp() { + inviteToPlan() { const dialogRef = this.dialog.open(PlanInvitationDialogComponent, { // height: '250px', // width: '700px', diff --git a/dmp-frontend/src/app/ui/plan/listing/plan-listing.component.ts b/dmp-frontend/src/app/ui/plan/listing/plan-listing.component.ts index 1e3eeb663..fb9c7b2f4 100644 --- a/dmp-frontend/src/app/ui/plan/listing/plan-listing.component.ts +++ b/dmp-frontend/src/app/ui/plan/listing/plan-listing.component.ts @@ -194,7 +194,7 @@ export class PlanListingComponent extends BaseListingComponent 0) { + let planBlueprints = formGroup.get("planBlueprints")?.value ?? null; + if (planBlueprints && planBlueprints?.length > 0) { lookup.planBlueprintSubQuery = PlanFilterService.initializePlanBlueprintLookup(); - lookup.planBlueprintSubQuery.ids = dmpBlueprints; + lookup.planBlueprintSubQuery.ids = planBlueprints; } else lookup.planBlueprintSubQuery = null; - // Dmps + // plans let roles = formGroup.get("role")?.value !== null ? [formGroup.get("role")?.value] : null; if (roles && roles?.length > 0) { lookup.planUserSubQuery = PlanFilterService.initializePlanUserLookup(); @@ -399,7 +399,7 @@ export class PlanListingComponent extends BaseListingComponent 0 ? lookup.statuses[0] : null], descriptionTemplates: lookup.planDescriptionTemplateSubQuery?.descriptionTemplateGroupIds ? [lookup.planDescriptionTemplateSubQuery?.descriptionTemplateGroupIds] : [], - dmpBlueprints: lookup.planBlueprintSubQuery?.ids ? [lookup.planBlueprintSubQuery?.ids]: [], + planBlueprints: lookup.planBlueprintSubQuery?.ids ? [lookup.planBlueprintSubQuery?.ids]: [], role: lookup.planUserSubQuery?.userRoles ? lookup.planUserSubQuery?.userRoles[0] : null, }); } @@ -416,7 +416,7 @@ export class PlanListingComponent extends BaseListingComponent { plan.descriptions = plan.descriptions?.filter(d => d.isActive == IsActive.Active) ?? []; }) diff --git a/dmp-frontend/src/app/ui/plan/new-version-dialog/plan-new-version-dialog.component.ts b/dmp-frontend/src/app/ui/plan/new-version-dialog/plan-new-version-dialog.component.ts index 4ea67392d..0aa9a84b2 100644 --- a/dmp-frontend/src/app/ui/plan/new-version-dialog/plan-new-version-dialog.component.ts +++ b/dmp-frontend/src/app/ui/plan/new-version-dialog/plan-new-version-dialog.component.ts @@ -7,7 +7,7 @@ import { SnackBarNotificationLevel, UiNotificationService } from '@app/core/serv import { BaseComponent } from '@common/base/base.component'; import { TranslateService } from '@ngx-translate/core'; import { map, takeUntil } from 'rxjs/operators'; -import { DmpNewVersionDialogEditorModel } from './plan-new-version-dialog.editor.model'; +import { PlanNewVersionDialogEditorModel } from './plan-new-version-dialog.editor.model'; import { PlanBlueprintService } from '@app/core/services/plan/plan-blueprint.service'; import { PlanEditorEntityResolver } from '../plan-editor-blueprint/resolvers/plan-editor-enitity.resolver'; import { SingleAutoCompleteConfiguration } from '@app/library/auto-complete/single/single-auto-complete-configuration'; @@ -33,7 +33,7 @@ import { Description } from '@app/core/model/description/description'; export class NewVersionPlanDialogComponent extends BaseComponent { plan: Plan; - editorModel: DmpNewVersionDialogEditorModel; + editorModel: PlanNewVersionDialogEditorModel; formGroup: UntypedFormGroup; selectedBlueprintSections: PlanBlueprintDefinitionSection[]; @@ -110,7 +110,7 @@ export class NewVersionPlanDialogComponent extends BaseComponent { ngOnInit() { this.selectedBlueprintSections = this.plan.blueprint?.definition?.sections?.filter(x => x.hasTemplates) || null; - this.editorModel = new DmpNewVersionDialogEditorModel().fromModel(this.plan, this.plan.blueprint); + this.editorModel = new PlanNewVersionDialogEditorModel().fromModel(this.plan, this.plan.blueprint); this.formGroup = this.editorModel.buildForm(); } diff --git a/dmp-frontend/src/app/ui/plan/new-version-dialog/plan-new-version-dialog.editor.model.ts b/dmp-frontend/src/app/ui/plan/new-version-dialog/plan-new-version-dialog.editor.model.ts index 57378fdd4..1aaf46709 100644 --- a/dmp-frontend/src/app/ui/plan/new-version-dialog/plan-new-version-dialog.editor.model.ts +++ b/dmp-frontend/src/app/ui/plan/new-version-dialog/plan-new-version-dialog.editor.model.ts @@ -6,12 +6,12 @@ import { ValidationErrorModel } from '@common/forms/validation/error-model/valid import { Validation, ValidationContext } from '@common/forms/validation/validation-context'; import { Guid } from "@common/types/guid"; -export class DmpNewVersionDialogEditorModel implements NewVersionPlanPersist { +export class PlanNewVersionDialogEditorModel implements NewVersionPlanPersist { id: Guid; label: string; description: String; blueprintId: Guid; - descriptions: NewVersionDmpDescriptionEditorModel[] = []; + descriptions: NewVersionPlanDescriptionEditorModel[] = []; hash?: string; public validationErrorModel: ValidationErrorModel = new ValidationErrorModel(); @@ -19,7 +19,7 @@ export class DmpNewVersionDialogEditorModel implements NewVersionPlanPersist { constructor() { } - public fromModel(item: Plan, blueprint: PlanBlueprint, label?: string, description?: string): DmpNewVersionDialogEditorModel { + public fromModel(item: Plan, blueprint: PlanBlueprint, label?: string, description?: string): PlanNewVersionDialogEditorModel { if (item) { this.id = item.id; this.label = label != undefined ? label : item.label; @@ -34,14 +34,14 @@ export class DmpNewVersionDialogEditorModel implements NewVersionPlanPersist { if (item.planDescriptionTemplates?.length > 0 && blueprint.id === item.blueprint.id) { // plan's first blueprint item.descriptions.forEach(description => { - this.descriptions.push(new NewVersionDmpDescriptionEditorModel(this.validationErrorModel).fromModel(description.id, description.planDescriptionTemplate.sectionId)); + this.descriptions.push(new NewVersionPlanDescriptionEditorModel(this.validationErrorModel).fromModel(description.id, description.planDescriptionTemplate.sectionId)); }) } else { // in case the user changes the blueprint from the dropdown and the new blueprint has prefilled templates const selectedBlueprintSections = blueprint.definition?.sections?.filter(x => x.hasTemplates) || null; if (selectedBlueprintSections != null){ item.descriptions.forEach(description => { const matchingSection = selectedBlueprintSections.find(blueprintSection => blueprintSection.descriptionTemplates != null && blueprintSection.descriptionTemplates.map(y => y.descriptionTemplateGroupId).includes(description.descriptionTemplate.groupId)) || null; - this.descriptions.push(new NewVersionDmpDescriptionEditorModel(this.validationErrorModel).fromModel(description.id, matchingSection != null ? matchingSection.id : null)); + this.descriptions.push(new NewVersionPlanDescriptionEditorModel(this.validationErrorModel).fromModel(description.id, matchingSection != null ? matchingSection.id : null)); }) } } @@ -86,7 +86,7 @@ export class DmpNewVersionDialogEditorModel implements NewVersionPlanPersist { } } -export class NewVersionDmpDescriptionEditorModel implements NewVersionPlanDescriptionPersist { +export class NewVersionPlanDescriptionEditorModel implements NewVersionPlanDescriptionPersist { descriptionId: Guid; blueprintSectionId: Guid; @@ -96,7 +96,7 @@ export class NewVersionDmpDescriptionEditorModel implements NewVersionPlanDescri public validationErrorModel: ValidationErrorModel = new ValidationErrorModel() ) { } - fromModel(descriptionId: Guid, blueprintSectionId: Guid): NewVersionDmpDescriptionEditorModel { + fromModel(descriptionId: Guid, blueprintSectionId: Guid): NewVersionPlanDescriptionEditorModel { this.descriptionId = descriptionId; this.blueprintSectionId = blueprintSectionId; @@ -110,7 +110,7 @@ export class NewVersionDmpDescriptionEditorModel implements NewVersionPlanDescri }): UntypedFormGroup { let { context = null, disabled = false, rootPath } = params ?? {} if (context == null) { - context = NewVersionDmpDescriptionEditorModel.createValidationContext({ + context = NewVersionPlanDescriptionEditorModel.createValidationContext({ validationErrorModel: this.validationErrorModel, rootPath }); diff --git a/dmp-frontend/src/app/ui/plan/new/start-new-plan-dialogue/start-new-plan-dialog.component.ts b/dmp-frontend/src/app/ui/plan/new/start-new-plan-dialogue/start-new-plan-dialog.component.ts index cde901968..bbb11b974 100644 --- a/dmp-frontend/src/app/ui/plan/new/start-new-plan-dialogue/start-new-plan-dialog.component.ts +++ b/dmp-frontend/src/app/ui/plan/new/start-new-plan-dialogue/start-new-plan-dialog.component.ts @@ -7,7 +7,7 @@ import { SnackBarNotificationLevel, UiNotificationService } from '@app/core/serv import { BaseComponent } from '@common/base/base.component'; import { TranslateService } from '@ngx-translate/core'; import { takeUntil } from 'rxjs/operators'; -import { DmpUploadDialogComponent } from '../upload-dialogue/plan-upload-dialog.component'; +import { PlanUploadDialogComponent } from '../upload-dialogue/plan-upload-dialog.component'; import { AnalyticsService } from '@app/core/services/matomo/analytics-service'; import { RouterUtilsService } from '@app/core/services/router/router-utils.service'; @@ -58,7 +58,7 @@ export class StartNewPlanDialogComponent extends BaseComponent { } uploadFile(event) { - const dialogRef = this.dialog.open(DmpUploadDialogComponent, { + const dialogRef = this.dialog.open(PlanUploadDialogComponent, { width: '528px', data: { fileList: FileList, diff --git a/dmp-frontend/src/app/ui/plan/new/start-new-plan-dialogue/start-new-plan-dialog.module.ts b/dmp-frontend/src/app/ui/plan/new/start-new-plan-dialogue/start-new-plan-dialog.module.ts index c7078aec9..8d83a43c8 100644 --- a/dmp-frontend/src/app/ui/plan/new/start-new-plan-dialogue/start-new-plan-dialog.module.ts +++ b/dmp-frontend/src/app/ui/plan/new/start-new-plan-dialogue/start-new-plan-dialog.module.ts @@ -2,7 +2,7 @@ import { NgModule } from '@angular/core'; import { FormattingModule } from '@app/core/formatting.module'; import { CommonFormsModule } from '@common/forms/common-forms.module'; import { CommonUiModule } from '@common/ui/common-ui.module'; -import { DmpUploadDialogModule } from '../upload-dialogue/plan-upload-dialog.module'; +import { PlanUploadDialogModule } from '../upload-dialogue/plan-upload-dialog.module'; import { StartNewPlanDialogComponent } from './start-new-plan-dialog.component'; @NgModule({ @@ -10,7 +10,7 @@ import { StartNewPlanDialogComponent } from './start-new-plan-dialog.component'; CommonUiModule, CommonFormsModule, FormattingModule, - DmpUploadDialogModule + PlanUploadDialogModule ], declarations: [ StartNewPlanDialogComponent, diff --git a/dmp-frontend/src/app/ui/plan/new/upload-dialogue/plan-common-model-config.editor.model.ts b/dmp-frontend/src/app/ui/plan/new/upload-dialogue/plan-common-model-config.editor.model.ts index e903b2c1a..5f6a4129b 100644 --- a/dmp-frontend/src/app/ui/plan/new/upload-dialogue/plan-common-model-config.editor.model.ts +++ b/dmp-frontend/src/app/ui/plan/new/upload-dialogue/plan-common-model-config.editor.model.ts @@ -6,7 +6,7 @@ import { Guid } from "@common/types/guid"; import { PlanCommonModelConfig, PreprocessingPlanModel } from "@app/core/model/plan/plan-import"; import { DescriptionCommonModelConfig, PreprocessingDescriptionModel } from "@app/core/model/description/description-import"; -export class DmpImportRdaConfigEditorModel implements PlanCommonModelConfig{ +export class PlanImportRdaConfigEditorModel implements PlanCommonModelConfig{ fileId: Guid; label: string; blueprintId: Guid; @@ -18,7 +18,7 @@ export class DmpImportRdaConfigEditorModel implements PlanCommonModelConfig{ constructor() { } - fromModel(item: PreprocessingPlanModel, fileId: Guid): DmpImportRdaConfigEditorModel { + fromModel(item: PreprocessingPlanModel, fileId: Guid): PlanImportRdaConfigEditorModel { this.fileId = fileId; if (item){ this.label = item.label + '.json'; diff --git a/dmp-frontend/src/app/ui/plan/new/upload-dialogue/plan-upload-dialog.component.ts b/dmp-frontend/src/app/ui/plan/new/upload-dialogue/plan-upload-dialog.component.ts index 600bde1b4..ce9d25507 100644 --- a/dmp-frontend/src/app/ui/plan/new/upload-dialogue/plan-upload-dialog.component.ts +++ b/dmp-frontend/src/app/ui/plan/new/upload-dialogue/plan-upload-dialog.component.ts @@ -8,7 +8,7 @@ import { PlanService } from '@app/core/services/plan/plan.service'; import { AnalyticsService } from '@app/core/services/matomo/analytics-service'; import { BaseComponent } from '@common/base/base.component'; import { map, takeUntil } from 'rxjs/operators'; -import { DmpImportRdaConfigEditorModel } from './plan-common-model-config.editor.model'; +import { PlanImportRdaConfigEditorModel } from './plan-common-model-config.editor.model'; import { UntypedFormArray, UntypedFormGroup } from '@angular/forms'; import { DescriptionTemplateService } from '@app/core/services/description-template/description-template.service'; import { FormService } from '@common/forms/form-service'; @@ -24,9 +24,9 @@ import { TranslateService } from '@ngx-translate/core'; templateUrl: './plan-upload-dialog.component.html', styleUrls: ['./plan-upload-dialog.component.scss'] }) -export class DmpUploadDialogComponent extends BaseComponent { +export class PlanUploadDialogComponent extends BaseComponent { planTitle: string; - dmpBlueprints: any[] = []; + planBlueprints: any[] = []; files: File[] = []; selectedBlueprintSections: PlanBlueprintDefinitionSection[]; formGroup: UntypedFormGroup; @@ -44,7 +44,7 @@ export class DmpUploadDialogComponent extends BaseComponent { constructor( - public dialogRef: MatDialogRef, + public dialogRef: MatDialogRef, private _service: PlanService, private dialog: MatDialog, private httpClient: HttpClient, @@ -63,7 +63,7 @@ export class DmpUploadDialogComponent extends BaseComponent { } ngOnInit() { - this.analyticsService.trackPageView(AnalyticsService.DmpUploadDialog); + this.analyticsService.trackPageView(AnalyticsService.PlanUploadDialog); } cancel() { @@ -78,7 +78,7 @@ export class DmpUploadDialogComponent extends BaseComponent { confirm() { this.data.success = true; this.data.planTitle = this.planTitle; - this.data.planBlueprints = this.dmpBlueprints; + this.data.planBlueprint = this.planBlueprints; if (this.files.length > 0 && this.files[0].type.includes('/json') && this.formGroup){ this.formService.removeAllBackEndErrors(this.formGroup); @@ -121,7 +121,7 @@ export class DmpUploadDialogComponent extends BaseComponent { .pipe(takeUntil(this._destroyed)) .subscribe( (preprocessingData) => { - this.formGroup = new DmpImportRdaConfigEditorModel().fromModel(preprocessingData, storageFile[0].id,).buildForm(); + this.formGroup = new PlanImportRdaConfigEditorModel().fromModel(preprocessingData, storageFile[0].id,).buildForm(); }, (error) => this.onCallbackEror(error.error) ); diff --git a/dmp-frontend/src/app/ui/plan/new/upload-dialogue/plan-upload-dialog.module.ts b/dmp-frontend/src/app/ui/plan/new/upload-dialogue/plan-upload-dialog.module.ts index ebf21f138..addada799 100644 --- a/dmp-frontend/src/app/ui/plan/new/upload-dialogue/plan-upload-dialog.module.ts +++ b/dmp-frontend/src/app/ui/plan/new/upload-dialogue/plan-upload-dialog.module.ts @@ -3,7 +3,7 @@ import { FormattingModule } from '@app/core/formatting.module'; import { CommonFormsModule } from '@common/forms/common-forms.module'; import { CommonUiModule } from '@common/ui/common-ui.module'; import { NgxDropzoneModule } from 'ngx-dropzone'; -import { DmpUploadDialogComponent } from './plan-upload-dialog.component'; +import { PlanUploadDialogComponent } from './plan-upload-dialog.component'; import { ReactiveFormsModule } from '@angular/forms'; import { AutoCompleteModule } from '@app/library/auto-complete/auto-complete.module'; @@ -17,10 +17,10 @@ import { AutoCompleteModule } from '@app/library/auto-complete/auto-complete.mod NgxDropzoneModule ], declarations: [ - DmpUploadDialogComponent, + PlanUploadDialogComponent, ], exports: [ - DmpUploadDialogComponent, + PlanUploadDialogComponent, ] }) -export class DmpUploadDialogModule { } +export class PlanUploadDialogModule { } diff --git a/dmp-frontend/src/app/ui/plan/overview/plan-overview.component.html b/dmp-frontend/src/app/ui/plan/overview/plan-overview.component.html index a6e134e61..7233e46b1 100644 --- a/dmp-frontend/src/app/ui/plan/overview/plan-overview.component.html +++ b/dmp-frontend/src/app/ui/plan/overview/plan-overview.component.html @@ -27,15 +27,15 @@
-
+

{{ enumUtils.toPlanUserRolesString(planService.getCurrentUserRolesInPlan(plan?.planUsers)) }}

-
.
-
+
.
+
public {{'PLAN-OVERVIEW.PUBLIC' | translate}}
-
.
+
.
lock_outline {{'PLAN-OVERVIEW.LOCKED' | translate}} @@ -190,8 +190,8 @@
- - + +
- +
-
diff --git a/dmp-frontend/src/app/ui/plan/overview/plan-overview.component.ts b/dmp-frontend/src/app/ui/plan/overview/plan-overview.component.ts index e07855876..473a0d3ec 100644 --- a/dmp-frontend/src/app/ui/plan/overview/plan-overview.component.ts +++ b/dmp-frontend/src/app/ui/plan/overview/plan-overview.component.ts @@ -371,7 +371,7 @@ export class PlanOverviewComponent extends BaseComponent implements OnInit { this.httpErrorHandlingService.handleBackedRequestError(error); } - isUserDmpRelated(): boolean { + isUserPlanRelated(): boolean { const principalId: Guid = this.authentication.userId(); return this.plan.planUsers?.some(x => (x.user.id === principalId)); } @@ -380,11 +380,11 @@ export class PlanOverviewComponent extends BaseComponent implements OnInit { return this.plan.status == PlanStatus.Draft; } - isFinalizedDmp(plan: Plan) { + isFinalizedPlan(plan: Plan) { return plan.status == PlanStatus.Finalized; } - isPublishedDmp() { + isPublishedPlan() { return (this.plan.status == PlanStatus.Finalized && this.plan.accessType === PlanAccessType.Public); } @@ -510,7 +510,7 @@ export class PlanOverviewComponent extends BaseComponent implements OnInit { }); } - removeUserFromDmp(dmpUser: PlanUser) { + removeUserFromPlan(planUser: PlanUser) { const dialogRef = this.dialog.open(ConfirmationDialogComponent, { data: { message: this.language.instant('GENERAL.CONFIRMATION-DIALOG.DELETE-USER'), @@ -521,12 +521,12 @@ export class PlanOverviewComponent extends BaseComponent implements OnInit { }); dialogRef.afterClosed().subscribe(result => { if (result) { - const dmpUserRemovePersist: PlanUserRemovePersist = { - id: dmpUser.id, + const planUserRemovePersist: PlanUserRemovePersist = { + id: planUser.id, planId: this.plan.id, - role: dmpUser.role + role: planUser.role }; - this.planService.removeUser(dmpUserRemovePersist).pipe(takeUntil(this._destroyed)) + this.planService.removeUser(planUserRemovePersist).pipe(takeUntil(this._destroyed)) .subscribe(data => { this.reloadPage(); this.onUpdateCallbackSuccess() diff --git a/dmp-frontend/src/app/ui/plan/plan-editor-blueprint/form-progress-indication/plan-form-progress-indication.component.ts b/dmp-frontend/src/app/ui/plan/plan-editor-blueprint/form-progress-indication/plan-form-progress-indication.component.ts index 6dbe6d775..1c6858265 100644 --- a/dmp-frontend/src/app/ui/plan/plan-editor-blueprint/form-progress-indication/plan-form-progress-indication.component.ts +++ b/dmp-frontend/src/app/ui/plan/plan-editor-blueprint/form-progress-indication/plan-form-progress-indication.component.ts @@ -9,7 +9,7 @@ import { takeUntil } from 'rxjs/operators'; templateUrl: './plan-form-progress-indication.component.html', styleUrls: ['./plan-form-progress-indication.component.scss'] }) -export class DmpFormProgressIndicationComponent extends BaseComponent implements OnInit, OnChanges { +export class PlanFormProgressIndicationComponent extends BaseComponent implements OnInit, OnChanges { @Input() formGroup: UntypedFormGroup; @Input() public progressValueAccuracy = 2; diff --git a/dmp-frontend/src/app/ui/plan/plan-editor-blueprint/form-progress-indication/plan-form-progress-indication.module.ts b/dmp-frontend/src/app/ui/plan/plan-editor-blueprint/form-progress-indication/plan-form-progress-indication.module.ts index 117f46a83..467aeb399 100644 --- a/dmp-frontend/src/app/ui/plan/plan-editor-blueprint/form-progress-indication/plan-form-progress-indication.module.ts +++ b/dmp-frontend/src/app/ui/plan/plan-editor-blueprint/form-progress-indication/plan-form-progress-indication.module.ts @@ -1,7 +1,7 @@ import { NgModule } from '@angular/core'; import { CommonFormsModule } from '@common/forms/common-forms.module'; import { CommonUiModule } from '@common/ui/common-ui.module'; -import { DmpFormProgressIndicationComponent } from './plan-form-progress-indication.component'; +import { PlanFormProgressIndicationComponent } from './plan-form-progress-indication.component'; @NgModule({ imports: [ @@ -9,10 +9,10 @@ import { DmpFormProgressIndicationComponent } from './plan-form-progress-indicat CommonFormsModule ], declarations: [ - DmpFormProgressIndicationComponent + PlanFormProgressIndicationComponent ], exports: [ - DmpFormProgressIndicationComponent + PlanFormProgressIndicationComponent ] }) -export class DmpFormProgressIndicationModule { } +export class PlanFormProgressIndicationModule { } diff --git a/dmp-frontend/src/app/ui/plan/plan-editor-blueprint/plan-editor.component.ts b/dmp-frontend/src/app/ui/plan/plan-editor-blueprint/plan-editor.component.ts index d7fed6815..128024480 100644 --- a/dmp-frontend/src/app/ui/plan/plan-editor-blueprint/plan-editor.component.ts +++ b/dmp-frontend/src/app/ui/plan/plan-editor-blueprint/plan-editor.component.ts @@ -49,7 +49,7 @@ import { Guid } from '@common/types/guid'; import { TranslateService } from '@ngx-translate/core'; import { map, takeUntil } from 'rxjs/operators'; import { PlanContactPrefillDialogComponent } from '../plan-contact-prefill-dialog/plan-contact-prefill-dialog.component'; -import { PlanEditorModel, DmpFieldIndicator } from './plan-editor.model'; +import { PlanEditorModel, PlanFieldIndicator } from './plan-editor.model'; import { PlanEditorEntityResolver } from './resolvers/plan-editor-enitity.resolver'; import { PlanEditorService } from './plan-editor.service'; import { RouterUtilsService } from '@app/core/services/router/router-utils.service'; @@ -113,7 +113,7 @@ export class PlanEditorComponent extends BaseEditor imple } }; - sectionToFieldsMap: Map = new Map(); + sectionToFieldsMap: Map = new Map(); protected get canDelete(): boolean { return !this.isDeleted && !this.isNew && (this.hasPermission(this.authService.permissionEnum.DeletePlan) || this.item?.authorizationFlags?.some(x => x === AppPermission.DeletePlan)); @@ -269,12 +269,12 @@ export class PlanEditorComponent extends BaseEditor imple } } - prepareErrorIndication(): Map { + prepareErrorIndication(): Map { if (this.selectedBlueprint?.definition == null) return; - const sectionToFieldsMap: Map = new Map(); + const sectionToFieldsMap: Map = new Map(); this.selectedBlueprint.definition.sections.forEach((section: PlanBlueprintDefinitionSection) => { - let value: DmpFieldIndicator = new DmpFieldIndicator(section); + let value: PlanFieldIndicator = new PlanFieldIndicator(section); sectionToFieldsMap.set(section.id.toString(), value); }); diff --git a/dmp-frontend/src/app/ui/plan/plan-editor-blueprint/plan-editor.model.ts b/dmp-frontend/src/app/ui/plan/plan-editor-blueprint/plan-editor.model.ts index 6b495d1cf..49b7f87f9 100644 --- a/dmp-frontend/src/app/ui/plan/plan-editor-blueprint/plan-editor.model.ts +++ b/dmp-frontend/src/app/ui/plan/plan-editor-blueprint/plan-editor.model.ts @@ -47,10 +47,10 @@ export class PlanEditorModel extends BaseEditorModel implements PlanPersist { item.blueprint.definition.sections.forEach(section => { if (section.hasTemplates) { - const sectionTempaltesFromDmp = item.planDescriptionTemplates?.filter(x => x.sectionId == section.id && x.isActive == IsActive.Active) || []; + const sectionTemplatesFromPlan = item.planDescriptionTemplates?.filter(x => x.sectionId == section.id && x.isActive == IsActive.Active) || []; - if (sectionTempaltesFromDmp.length > 0) { - sectionTempaltesFromDmp?.filter(x => x.sectionId == section.id).forEach(planDescriptionTemplate => { + if (sectionTemplatesFromPlan.length > 0) { + sectionTemplatesFromPlan?.filter(x => x.sectionId == section.id).forEach(planDescriptionTemplate => { this.descriptionTemplates.push(new PlanDescriptionTemplateEditorModel(this.validationErrorModel).fromModel( { sectionId: section.id, @@ -132,7 +132,7 @@ export class PlanEditorModel extends BaseEditorModel implements PlanPersist { baseValidationArray.push({ key: 'accessType', validators: [Validators.required, BackendErrorValidator(this.validationErrorModel, 'accessType')] }); baseValidationArray.push({ key: 'descriptionTemplates', validators: [Validators.required, BackendErrorValidator(this.validationErrorModel, 'descriptionTemplates')] }); - baseValidationArray.push({ key: 'dmpDescriptionValidator', validators: [] }); + baseValidationArray.push({ key: 'planDescriptionValidator', validators: [] }); baseValidationArray.push({ key: 'users', validators: [BackendErrorValidator(this.validationErrorModel, `users`)] }); baseValidationArray.push({ key: 'hash', validators: [] }); @@ -233,7 +233,7 @@ export class PlanPropertiesEditorModel implements PlanPropertiesPersist { context?: ValidationContext, disabled?: boolean, rootPath?: string - }, planReferences?: PlanReference[], dmpBlueprint?: PlanBlueprint): UntypedFormGroup { + }, planReferences?: PlanReference[], planBlueprint?: PlanBlueprint): UntypedFormGroup { let { context = null, disabled = false, rootPath } = params ?? {} if (context == null) { context = PlanPropertiesEditorModel.createValidationContext({ @@ -738,7 +738,7 @@ export class PlanDescriptionTemplateEditorModel implements PlanDescriptionTempla } } -export class DmpFieldIndicator { +export class PlanFieldIndicator { private _fieldControlNames; diff --git a/dmp-frontend/src/app/ui/plan/plan-editor-blueprint/plan-editor.module.ts b/dmp-frontend/src/app/ui/plan/plan-editor-blueprint/plan-editor.module.ts index b76f04232..a8ab9b1d1 100644 --- a/dmp-frontend/src/app/ui/plan/plan-editor-blueprint/plan-editor.module.ts +++ b/dmp-frontend/src/app/ui/plan/plan-editor-blueprint/plan-editor.module.ts @@ -10,7 +10,7 @@ import { CommonUiModule } from '@common/ui/common-ui.module'; import { PlanUserFieldModule } from '../plan-user-field/plan-user-field.module'; import { PlanEditorComponent } from './plan-editor.component'; import { PlanEditorRoutingModule } from './plan-editor.routing'; -import { DmpFormProgressIndicationModule } from './form-progress-indication/plan-form-progress-indication.module'; +import { PlanFormProgressIndicationModule } from './form-progress-indication/plan-form-progress-indication.module'; import { PlanDeleteDialogModule } from '../plan-delete-dialog/plan-delete-dialog.module'; import { PlanContactPrefillDialogModule } from '../plan-contact-prefill-dialog/plan-contact-prefill-dialog.module'; @@ -27,7 +27,7 @@ import { PlanContactPrefillDialogModule } from '../plan-contact-prefill-dialog/p ReferenceFieldModule, DragDropModule, PlanUserFieldModule, - DmpFormProgressIndicationModule, + PlanFormProgressIndicationModule, PlanContactPrefillDialogModule ], declarations: [ diff --git a/dmp-frontend/src/app/ui/plan/plan-editor-blueprint/plan-editor.routing.ts b/dmp-frontend/src/app/ui/plan/plan-editor-blueprint/plan-editor.routing.ts index 3b6591e67..c97414474 100644 --- a/dmp-frontend/src/app/ui/plan/plan-editor-blueprint/plan-editor.routing.ts +++ b/dmp-frontend/src/app/ui/plan/plan-editor-blueprint/plan-editor.routing.ts @@ -1,6 +1,6 @@ import { NgModule } from '@angular/core'; import { RouterModule, Routes } from '@angular/router'; -// import { DmpWizardComponent } from './description-wizard/description-wizard.component'; +// import { PlanWizardComponent } from './description-wizard/description-wizard.component'; import { AppPermission } from '@app/core/common/enum/permission.enum'; import { PendingChangesGuard } from '@common/forms/pending-form-changes/pending-form-changes-guard.service'; // import { PlanOverviewComponent } from './overview/description-overview.component'; diff --git a/dmp-frontend/src/app/ui/plan/plan-user-field/plan-user-field.component.ts b/dmp-frontend/src/app/ui/plan/plan-user-field/plan-user-field.component.ts index e9240b8af..d63665019 100644 --- a/dmp-frontend/src/app/ui/plan/plan-user-field/plan-user-field.component.ts +++ b/dmp-frontend/src/app/ui/plan/plan-user-field/plan-user-field.component.ts @@ -53,8 +53,8 @@ export class PlanUserFieldComponent extends BaseComponent implements OnInit { addUser(): void { const userArray = this.form.get('users') as FormArray; - const dmpUser: PlanUserEditorModel = new PlanUserEditorModel(this.validationErrorModel); - userArray.push(dmpUser.buildForm({ rootPath: "users[" + userArray.length + "]." })); + const planUser: PlanUserEditorModel = new PlanUserEditorModel(this.validationErrorModel); + userArray.push(planUser.buildForm({ rootPath: "users[" + userArray.length + "]." })); } removeUser(userIndex: number): void { diff --git a/dmp-frontend/src/app/ui/plan/plan.module.ts b/dmp-frontend/src/app/ui/plan/plan.module.ts index 520bda4bc..08abac917 100644 --- a/dmp-frontend/src/app/ui/plan/plan.module.ts +++ b/dmp-frontend/src/app/ui/plan/plan.module.ts @@ -1,6 +1,6 @@ import { NgModule } from '@angular/core'; import { FormattingModule } from '@app/core/formatting.module'; -import { DmpRoutingModule, PublicDmpRoutingModule } from '@app/ui/plan/plan.routing'; +import { PlanRoutingModule, PublicPlanRoutingModule } from '@app/ui/plan/plan.routing'; import { CommonFormsModule } from '@common/forms/common-forms.module'; import { CommonUiModule } from '@common/ui/common-ui.module'; @@ -9,25 +9,25 @@ import { CommonUiModule } from '@common/ui/common-ui.module'; CommonUiModule, CommonFormsModule, FormattingModule, - DmpRoutingModule, + PlanRoutingModule, ], declarations: [ ], exports: [ ] }) -export class DmpModule { } +export class PlanModule { } @NgModule({ imports: [ CommonUiModule, CommonFormsModule, FormattingModule, - PublicDmpRoutingModule, + PublicPlanRoutingModule, ], declarations: [ ], exports: [ ] }) -export class PublicDmpModule { } +export class PublicPlanModule { } diff --git a/dmp-frontend/src/app/ui/plan/plan.routing.ts b/dmp-frontend/src/app/ui/plan/plan.routing.ts index ac758b19c..08ce9f9ef 100644 --- a/dmp-frontend/src/app/ui/plan/plan.routing.ts +++ b/dmp-frontend/src/app/ui/plan/plan.routing.ts @@ -74,10 +74,10 @@ const publicRoutes: Routes = [ imports: [RouterModule.forChild(routes)], exports: [RouterModule] }) -export class DmpRoutingModule { } +export class PlanRoutingModule { } @NgModule({ imports: [RouterModule.forChild(publicRoutes)], exports: [RouterModule] }) -export class PublicDmpRoutingModule { } +export class PublicPlanRoutingModule { } diff --git a/dmp-frontend/src/app/ui/sidebar/sidebar.component.ts b/dmp-frontend/src/app/ui/sidebar/sidebar.component.ts index 97a15cdb6..27c57ca32 100644 --- a/dmp-frontend/src/app/ui/sidebar/sidebar.component.ts +++ b/dmp-frontend/src/app/ui/sidebar/sidebar.component.ts @@ -36,7 +36,7 @@ class GroupMenuItem { }) export class SidebarComponent implements OnInit { generalItems: GroupMenuItem; - dmpItems: GroupMenuItem; + planItems: GroupMenuItem; adminItems: GroupMenuItem; descriptionItems: GroupMenuItem; grantItems: GroupMenuItem; @@ -81,14 +81,14 @@ export class SidebarComponent implements OnInit { this.groupMenuItems.push(this.generalItems); - this.dmpItems = { + this.planItems = { title: 'SIDE-BAR.PLAN', routes: [], } - if (this.authentication.hasPermission(AppPermission.ViewMyPlanPage)) this.dmpItems.routes.push({ path: '/plans', title: 'SIDE-BAR.MY-PLANS', icon: 'library_books', routeType: RouteType.System }); - if (this.authentication.hasPermission(AppPermission.ViewMyDescriptionPage)) this.dmpItems.routes.push({ path: '/descriptions', title: 'SIDE-BAR.MY-DESCRIPTIONS', icon: 'dns', routeType: RouteType.System }); - this.groupMenuItems.push(this.dmpItems); + if (this.authentication.hasPermission(AppPermission.ViewMyPlanPage)) this.planItems.routes.push({ path: '/plans', title: 'SIDE-BAR.MY-PLANS', icon: 'library_books', routeType: RouteType.System }); + if (this.authentication.hasPermission(AppPermission.ViewMyDescriptionPage)) this.planItems.routes.push({ path: '/descriptions', title: 'SIDE-BAR.MY-DESCRIPTIONS', icon: 'dns', routeType: RouteType.System }); + this.groupMenuItems.push(this.planItems); this.descriptionItems = { title: 'SIDE-BAR.DESCRIPTIONS', diff --git a/dmp-frontend/src/assets/i18n/baq.json b/dmp-frontend/src/assets/i18n/baq.json index 6278575b4..9cdf547d4 100644 --- a/dmp-frontend/src/assets/i18n/baq.json +++ b/dmp-frontend/src/assets/i18n/baq.json @@ -355,7 +355,7 @@ "ACTIONS": { "SEND-USER-TOUCH": "Send user touch events", "SEND-TENANT-TOUCH": "Send tenant touch events", - "SEND-PLAN-TOUCH": "Send dmp touch events", + "SEND-PLAN-TOUCH": "Send plan touch events", "SEND-DESCRIPTION-TOUCH": "Send description touch events" } } diff --git a/dmp-frontend/src/assets/i18n/de.json b/dmp-frontend/src/assets/i18n/de.json index 57ef3cdfe..0fcefd31b 100644 --- a/dmp-frontend/src/assets/i18n/de.json +++ b/dmp-frontend/src/assets/i18n/de.json @@ -355,7 +355,7 @@ "ACTIONS": { "SEND-USER-TOUCH": "Send user touch events", "SEND-TENANT-TOUCH": "Send tenant touch events", - "SEND-PLAN-TOUCH": "Send dmp touch events", + "SEND-PLAN-TOUCH": "Send plan touch events", "SEND-DESCRIPTION-TOUCH": "Send description touch events" } } diff --git a/dmp-frontend/src/assets/i18n/en.json b/dmp-frontend/src/assets/i18n/en.json index b7c93e80a..41f79585c 100644 --- a/dmp-frontend/src/assets/i18n/en.json +++ b/dmp-frontend/src/assets/i18n/en.json @@ -355,7 +355,7 @@ "ACTIONS": { "SEND-USER-TOUCH": "Send user touch events", "SEND-TENANT-TOUCH": "Send tenant touch events", - "SEND-PLAN-TOUCH": "Send dmp touch events", + "SEND-PLAN-TOUCH": "Send plan touch events", "SEND-DESCRIPTION-TOUCH": "Send description touch events" } } diff --git a/dmp-frontend/src/assets/i18n/es.json b/dmp-frontend/src/assets/i18n/es.json index 801e60533..400f6c59f 100644 --- a/dmp-frontend/src/assets/i18n/es.json +++ b/dmp-frontend/src/assets/i18n/es.json @@ -355,7 +355,7 @@ "ACTIONS": { "SEND-USER-TOUCH": "Send user touch events", "SEND-TENANT-TOUCH": "Send tenant touch events", - "SEND-PLAN-TOUCH": "Send dmp touch events", + "SEND-PLAN-TOUCH": "Send plan touch events", "SEND-DESCRIPTION-TOUCH": "Send description touch events" } } diff --git a/dmp-frontend/src/assets/i18n/gr.json b/dmp-frontend/src/assets/i18n/gr.json index 3b015f7de..29b03d9d0 100644 --- a/dmp-frontend/src/assets/i18n/gr.json +++ b/dmp-frontend/src/assets/i18n/gr.json @@ -355,7 +355,7 @@ "ACTIONS": { "SEND-USER-TOUCH": "Send user touch events", "SEND-TENANT-TOUCH": "Send tenant touch events", - "SEND-PLAN-TOUCH": "Send dmp touch events", + "SEND-PLAN-TOUCH": "Send plan touch events", "SEND-DESCRIPTION-TOUCH": "Send description touch events" } } diff --git a/dmp-frontend/src/assets/i18n/hr.json b/dmp-frontend/src/assets/i18n/hr.json index 576a6134f..d5289f660 100644 --- a/dmp-frontend/src/assets/i18n/hr.json +++ b/dmp-frontend/src/assets/i18n/hr.json @@ -355,7 +355,7 @@ "ACTIONS": { "SEND-USER-TOUCH": "Send user touch events", "SEND-TENANT-TOUCH": "Send tenant touch events", - "SEND-PLAN-TOUCH": "Send dmp touch events", + "SEND-PLAN-TOUCH": "Send plan touch events", "SEND-DESCRIPTION-TOUCH": "Send description touch events" } } diff --git a/dmp-frontend/src/assets/i18n/pl.json b/dmp-frontend/src/assets/i18n/pl.json index 830a06de6..548d957a3 100644 --- a/dmp-frontend/src/assets/i18n/pl.json +++ b/dmp-frontend/src/assets/i18n/pl.json @@ -355,7 +355,7 @@ "ACTIONS": { "SEND-USER-TOUCH": "Send user touch events", "SEND-TENANT-TOUCH": "Send tenant touch events", - "SEND-PLAN-TOUCH": "Send dmp touch events", + "SEND-PLAN-TOUCH": "Send plan touch events", "SEND-DESCRIPTION-TOUCH": "Send description touch events" } } diff --git a/dmp-frontend/src/assets/i18n/pt.json b/dmp-frontend/src/assets/i18n/pt.json index 48220ced2..f235b5f6c 100644 --- a/dmp-frontend/src/assets/i18n/pt.json +++ b/dmp-frontend/src/assets/i18n/pt.json @@ -355,7 +355,7 @@ "ACTIONS": { "SEND-USER-TOUCH": "Send user touch events", "SEND-TENANT-TOUCH": "Send tenant touch events", - "SEND-PLAN-TOUCH": "Send dmp touch events", + "SEND-PLAN-TOUCH": "Send plan touch events", "SEND-DESCRIPTION-TOUCH": "Send description touch events" } } diff --git a/dmp-frontend/src/assets/i18n/sk.json b/dmp-frontend/src/assets/i18n/sk.json index 8a4f149c6..b1f8a4f81 100644 --- a/dmp-frontend/src/assets/i18n/sk.json +++ b/dmp-frontend/src/assets/i18n/sk.json @@ -355,7 +355,7 @@ "ACTIONS": { "SEND-USER-TOUCH": "Send user touch events", "SEND-TENANT-TOUCH": "Send tenant touch events", - "SEND-PLAN-TOUCH": "Send dmp touch events", + "SEND-PLAN-TOUCH": "Send plan touch events", "SEND-DESCRIPTION-TOUCH": "Send description touch events" } } diff --git a/dmp-frontend/src/assets/i18n/sr.json b/dmp-frontend/src/assets/i18n/sr.json index e3dcc2dcf..e75806d15 100644 --- a/dmp-frontend/src/assets/i18n/sr.json +++ b/dmp-frontend/src/assets/i18n/sr.json @@ -355,7 +355,7 @@ "ACTIONS": { "SEND-USER-TOUCH": "Send user touch events", "SEND-TENANT-TOUCH": "Send tenant touch events", - "SEND-PLAN-TOUCH": "Send dmp touch events", + "SEND-PLAN-TOUCH": "Send plan touch events", "SEND-DESCRIPTION-TOUCH": "Send description touch events" } } diff --git a/dmp-frontend/src/assets/i18n/tr.json b/dmp-frontend/src/assets/i18n/tr.json index 76b5d54c1..6adcecc68 100644 --- a/dmp-frontend/src/assets/i18n/tr.json +++ b/dmp-frontend/src/assets/i18n/tr.json @@ -355,7 +355,7 @@ "ACTIONS": { "SEND-USER-TOUCH": "Send user touch events", "SEND-TENANT-TOUCH": "Send tenant touch events", - "SEND-PLAN-TOUCH": "Send dmp touch events", + "SEND-PLAN-TOUCH": "Send plan touch events", "SEND-DESCRIPTION-TOUCH": "Send description touch events" } } From 3e294fa5890a1c38315bbed54d97e241e338ad93 Mon Sep 17 00:00:00 2001 From: amentis Date: Mon, 8 Jul 2024 14:37:13 +0300 Subject: [PATCH 08/11] rename dmp to plan frontend changes --- .../src/app/core/common/enum/annotation-entity-type.ts | 2 +- .../src/app/core/common/enum/file-transformer-entity-type.ts | 2 +- .../services/file-transformer/file-transformer.service.ts | 2 +- .../listing/filtering/description-filter.component.html | 4 ++-- .../listing/listing-item/plan-listing-item.component.html | 4 ++-- .../src/app/ui/plan/overview/plan-overview.component.html | 4 ++-- .../ui/plan/plan-editor-blueprint/plan-editor.component.html | 2 +- 7 files changed, 10 insertions(+), 10 deletions(-) diff --git a/dmp-frontend/src/app/core/common/enum/annotation-entity-type.ts b/dmp-frontend/src/app/core/common/enum/annotation-entity-type.ts index ae1df923f..9c1d0bfdb 100644 --- a/dmp-frontend/src/app/core/common/enum/annotation-entity-type.ts +++ b/dmp-frontend/src/app/core/common/enum/annotation-entity-type.ts @@ -1,4 +1,4 @@ export enum AnnotationEntityType { Description = "description", - Dmp = "dmp" + Plan = "plan" } diff --git a/dmp-frontend/src/app/core/common/enum/file-transformer-entity-type.ts b/dmp-frontend/src/app/core/common/enum/file-transformer-entity-type.ts index 5330267b0..ac8d5f013 100644 --- a/dmp-frontend/src/app/core/common/enum/file-transformer-entity-type.ts +++ b/dmp-frontend/src/app/core/common/enum/file-transformer-entity-type.ts @@ -1,4 +1,4 @@ export enum FileTransformerEntityType { - Dmp = 0, + Plan = 0, Description = 1 } diff --git a/dmp-frontend/src/app/core/services/file-transformer/file-transformer.service.ts b/dmp-frontend/src/app/core/services/file-transformer/file-transformer.service.ts index 7748bc475..894d5983f 100644 --- a/dmp-frontend/src/app/core/services/file-transformer/file-transformer.service.ts +++ b/dmp-frontend/src/app/core/services/file-transformer/file-transformer.service.ts @@ -30,7 +30,7 @@ export class FileTransformerService extends BaseService { private _loading: boolean = false; private xmlExportRepo: RepositoryFileFormat = { - entityTypes: [FileTransformerEntityType.Description, FileTransformerEntityType.Dmp], + entityTypes: [FileTransformerEntityType.Description, FileTransformerEntityType.Plan], format: "xml", hasLogo: true, icon: "fa-file-code-o", diff --git a/dmp-frontend/src/app/ui/description/listing/filtering/description-filter.component.html b/dmp-frontend/src/app/ui/description/listing/filtering/description-filter.component.html index f19b2df65..8ec8a0feb 100644 --- a/dmp-frontend/src/app/ui/description/listing/filtering/description-filter.component.html +++ b/dmp-frontend/src/app/ui/description/listing/filtering/description-filter.component.html @@ -32,7 +32,7 @@
- +
{{'DESCRIPTION-LISTING.FILTERS.ASSOCIATED-PLANS.NAME' | translate}}
@@ -41,7 +41,7 @@
- + diff --git a/dmp-frontend/src/app/ui/plan/listing/listing-item/plan-listing-item.component.html b/dmp-frontend/src/app/ui/plan/listing/listing-item/plan-listing-item.component.html index 72506c325..96b635f3b 100644 --- a/dmp-frontend/src/app/ui/plan/listing/listing-item/plan-listing-item.component.html +++ b/dmp-frontend/src/app/ui/plan/listing/listing-item/plan-listing-item.component.html @@ -28,7 +28,7 @@ {{'GENERAL.ACTIONS.SHOW-MORE' | translate}} - diff --git a/dmp-frontend/src/app/ui/plan/overview/plan-overview.component.html b/dmp-frontend/src/app/ui/plan/overview/plan-overview.component.html index 7233e46b1..b0017ded6 100644 --- a/dmp-frontend/src/app/ui/plan/overview/plan-overview.component.html +++ b/dmp-frontend/src/app/ui/plan/overview/plan-overview.component.html @@ -203,7 +203,7 @@
- +
- diff --git a/dmp-frontend/src/app/ui/plan/plan-editor-blueprint/plan-editor.component.html b/dmp-frontend/src/app/ui/plan/plan-editor-blueprint/plan-editor.component.html index f039e8106..aa09802c3 100644 --- a/dmp-frontend/src/app/ui/plan/plan-editor-blueprint/plan-editor.component.html +++ b/dmp-frontend/src/app/ui/plan/plan-editor-blueprint/plan-editor.component.html @@ -17,7 +17,7 @@ expand_more - From 88c0677a8a6dfe73836b6560dbef6b2ecc4816bb Mon Sep 17 00:00:00 2001 From: amentis Date: Mon, 8 Jul 2024 14:38:44 +0300 Subject: [PATCH 09/11] rename dmp to plan frontend changes --- .../description-template-editor-field-set.component.html | 4 ++-- .../field/description-template-editor-field.component.html | 4 ++-- .../editor/components/field/view-style-enum.ts | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/dmp-frontend/src/app/ui/admin/description-template/editor/components/field-set/description-template-editor-field-set.component.html b/dmp-frontend/src/app/ui/admin/description-template/editor/components/field-set/description-template-editor-field-set.component.html index 056258b70..797c6119e 100644 --- a/dmp-frontend/src/app/ui/admin/description-template/editor/components/field-set/description-template-editor-field-set.component.html +++ b/dmp-frontend/src/app/ui/admin/description-template/editor/components/field-set/description-template-editor-field-set.component.html @@ -225,11 +225,11 @@
-
+
- +
diff --git a/dmp-frontend/src/app/ui/plan/plan-editor-blueprint/plan-editor.component.ts b/dmp-frontend/src/app/ui/plan/plan-editor-blueprint/plan-editor.component.ts index 128024480..74f6ec141 100644 --- a/dmp-frontend/src/app/ui/plan/plan-editor-blueprint/plan-editor.component.ts +++ b/dmp-frontend/src/app/ui/plan/plan-editor-blueprint/plan-editor.component.ts @@ -227,6 +227,7 @@ export class PlanEditorComponent extends BaseEditor imple if (data.planDescriptionTemplates) { data.planDescriptionTemplates = data.planDescriptionTemplates.filter(x => x.isActive === IsActive.Active); } + if (data.entityDois && data.entityDois.length > 0) data.entityDois = data.entityDois.filter(x => x.isActive === IsActive.Active); } this.item = data; @@ -400,6 +401,10 @@ export class PlanEditorComponent extends BaseEditor imple }); } + hasNotDoi() { + return (this.item.entityDois == null || this.item.entityDois.length == 0); + } + finalize() { const dialogRef = this.dialog.open(PlanFinalizeDialogComponent, { maxWidth: '500px', diff --git a/dmp-frontend/src/app/ui/plan/plan-editor-blueprint/resolvers/plan-editor-enitity.resolver.ts b/dmp-frontend/src/app/ui/plan/plan-editor-blueprint/resolvers/plan-editor-enitity.resolver.ts index cec94bd7c..68f1aaee9 100644 --- a/dmp-frontend/src/app/ui/plan/plan-editor-blueprint/resolvers/plan-editor-enitity.resolver.ts +++ b/dmp-frontend/src/app/ui/plan/plan-editor-blueprint/resolvers/plan-editor-enitity.resolver.ts @@ -14,6 +14,7 @@ import { BaseEditorResolver } from '@common/base/base-editor.resolver'; import { Guid } from '@common/types/guid'; import { takeUntil, tap } from 'rxjs/operators'; import { nameof } from 'ts-simple-nameof'; +import { EntityDoi } from '@app/core/model/entity-doi/entity-doi'; @Injectable() export class PlanEditorEntityResolver extends BaseEditorResolver { @@ -84,6 +85,10 @@ export class PlanEditorEntityResolver extends BaseEditorResolver { [nameof(x => x.planDescriptionTemplates), nameof(x => x.descriptionTemplateGroupId)].join('.'), [nameof(x => x.planDescriptionTemplates), nameof(x => x.isActive)].join('.'), + [nameof(x => x.entityDois), nameof(x => x.id)].join('.'), + [nameof(x => x.entityDois), nameof(x => x.repositoryId)].join('.'), + [nameof(x => x.entityDois), nameof(x => x.doi)].join('.'), + [nameof(x => x.entityDois), nameof(x => x.isActive)].join('.'), ...PlanEditorEntityResolver.blueprintLookupFields(nameof(x => x.blueprint)),