diff --git a/backend/core/src/main/java/org/opencdmp/model/persist/CloneDmpPersist.java b/backend/core/src/main/java/org/opencdmp/model/persist/CloneDmpPersist.java index 5b65b942f..957485c6c 100644 --- a/backend/core/src/main/java/org/opencdmp/model/persist/CloneDmpPersist.java +++ b/backend/core/src/main/java/org/opencdmp/model/persist/CloneDmpPersist.java @@ -94,10 +94,7 @@ public class CloneDmpPersist { .failOn(CloneDmpPersist._label).failWith(messageSource.getMessage("Validation_Required", new Object[]{CloneDmpPersist._label}, LocaleContextHolder.getLocale())), this.spec() .must(() -> !this.isEmpty(item.getDescription())) - .failOn(CloneDmpPersist._description).failWith(messageSource.getMessage("Validation_Required", new Object[]{CloneDmpPersist._description}, LocaleContextHolder.getLocale())), - this.spec() - .must(() -> !this.isNull(item.getDescriptions())) - .failOn(CloneDmpPersist._descriptions).failWith(messageSource.getMessage("Validation_Required", new Object[]{CloneDmpPersist._descriptions}, LocaleContextHolder.getLocale())) + .failOn(CloneDmpPersist._description).failWith(messageSource.getMessage("Validation_Required", new Object[]{CloneDmpPersist._description}, LocaleContextHolder.getLocale())) ); } } diff --git a/backend/core/src/main/java/org/opencdmp/service/dmp/DmpServiceImpl.java b/backend/core/src/main/java/org/opencdmp/service/dmp/DmpServiceImpl.java index cd8f818d0..413212986 100644 --- a/backend/core/src/main/java/org/opencdmp/service/dmp/DmpServiceImpl.java +++ b/backend/core/src/main/java/org/opencdmp/service/dmp/DmpServiceImpl.java @@ -580,6 +580,11 @@ public class DmpServiceImpl implements DmpService { this.annotationEntityTouchedIntegrationEventHandler.handleDmp(newDmp.getId()); DmpEntity resultingDmpEntity = this.queryFactory.query(DmpQuery.class).ids(newDmp.getId()).firstAs(fields); + if (!this.conventionService.isListNullOrEmpty(model.getDescriptions())){ + for (UUID description: model.getDescriptions()) { + descriptionService.clone(newDmp.getId(), description); + } + } return this.builderFactory.builder(DmpBuilder.class).build(fields, resultingDmpEntity); } 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 772872c2f..812617bff 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 @@ -628,7 +628,6 @@ export class DescriptionEditorComponent extends BaseEditor this.prepareForm(data)); - this.tocValidationService.validateForm(); } refreshOnNavigateToData(id?: Guid): void { @@ -649,7 +648,8 @@ export class DescriptionEditorComponent extends BaseEditor { - onSuccess ? onSuccess(complete) : this.onCallbackSuccess(complete); + onSuccess ? onSuccess(complete) : this.onCallbackSuccess(complete, this.isNew); + this.tocValidationService.validateForm(); this.descriptionIsOnceSaved = true; if (this.formGroup.get('status').value == DescriptionStatus.Finalized) this.isFinalized = true; }, @@ -1099,10 +1099,11 @@ export class DescriptionEditorComponent extends BaseEditor { let fieldsets = this.getNestedSectionFieldsets(section); - let sectionIds = this.getNestedSectionIds(section); let fieldsBySection: DescriptionFieldIndicator[] = fieldsets?.flatMap((fieldset: DescriptionTemplateFieldSet) => - fieldset.fields?.flatMap((field: DescriptionTemplateField) => - new DescriptionFieldIndicator(page.id, sectionIds, fieldset.id, field.id, field.data.fieldType, field.data.multipleSelect) + fieldset.fields?.flatMap((field: DescriptionTemplateField) => { + let sectionIds = this.getNestedSectionIdsByField(section, fieldset.id); + return new DescriptionFieldIndicator(page.id, sectionIds, fieldset.id, field.id, field.data.fieldType, field.data.multipleSelect) + } )); fieldsByPage.push(...fieldsBySection); @@ -1119,12 +1120,14 @@ export class DescriptionEditorComponent extends BaseEditor this.getNestedSectionIds(subsection))]; + return [section.id, ...section.sections.flatMap((subsection: DescriptionTemplateSection) => this.getNestedSectionIdsByField(subsection, fieldSetId))]; } - else return [section.id]; + else if (section.fieldSets.find(fieldSet => fieldSet.id == fieldSetId)) return [section.id]; + + else return []; } // // this._listenersSubscription.add(dmpSubscription); diff --git a/dmp-frontend/src/app/ui/description/editor/description-editor.model.ts b/dmp-frontend/src/app/ui/description/editor/description-editor.model.ts index 698f3745f..9f60d43af 100644 --- a/dmp-frontend/src/app/ui/description/editor/description-editor.model.ts +++ b/dmp-frontend/src/app/ui/description/editor/description-editor.model.ts @@ -36,7 +36,7 @@ export class DescriptionEditorModel extends BaseEditorModel implements Descripti this.descriptionTemplateId = item.descriptionTemplate?.id; this.status = item.status ?? DescriptionStatus.Draft; this.description = item.description; - this.tags = item.descriptionTags?.map(x => x.tag?.label); + this.tags = item.descriptionTags?.filter(x => x.isActive === IsActive.Active).map(x => x.tag?.label); this.properties = new DescriptionPropertyDefinitionEditorModel(this.validationErrorModel).fromModel(item.properties, descriptionTemplate, item.descriptionReferences); } return this; diff --git a/dmp-frontend/src/app/ui/description/editor/description-editor.resolver.ts b/dmp-frontend/src/app/ui/description/editor/description-editor.resolver.ts index f64fe419c..8b3c93762 100644 --- a/dmp-frontend/src/app/ui/description/editor/description-editor.resolver.ts +++ b/dmp-frontend/src/app/ui/description/editor/description-editor.resolver.ts @@ -75,6 +75,7 @@ export class DescriptionEditorResolver extends BaseEditorResolver { [nameof(x => x.descriptionTags), nameof(x => x.id),].join('.'), [nameof(x => x.descriptionTags), nameof(x => x.tag), nameof(x => x.label)].join('.'), + [nameof(x => x.descriptionTags), nameof(x => x.tag), nameof(x => x.isActive)].join('.'), [nameof(x => x.descriptionReferences), nameof(x => x.data), nameof(x => x.fieldId)].join('.'), [nameof(x => x.descriptionReferences), nameof(x => x.reference), nameof(x => x.id)].join('.'), diff --git a/dmp-frontend/src/app/ui/dmp/dmp-editor-blueprint/form-progress-indication/dmp-form-progress-indication.component.scss b/dmp-frontend/src/app/ui/dmp/dmp-editor-blueprint/form-progress-indication/dmp-form-progress-indication.component.scss index a15510639..b3aa2b404 100644 --- a/dmp-frontend/src/app/ui/dmp/dmp-editor-blueprint/form-progress-indication/dmp-form-progress-indication.component.scss +++ b/dmp-frontend/src/app/ui/dmp/dmp-editor-blueprint/form-progress-indication/dmp-form-progress-indication.component.scss @@ -1,16 +1,39 @@ -.percentage { - color: #212121; - opacity: 0.7; - font-weight: 400; - font-size: 0.875rem; -} +// .percentage { +// color: #212121; +// opacity: 0.7; +// font-weight: 400; +// font-size: 0.875rem; +// } +// .progress-bar { +// border-radius: 20px; +// height: 11px; + +// } + +// ::ng-deep .mat-progress-bar .mat-progress-bar-fill::after { +// border-radius: 20px !important; +// } + + +// Bar container .progress-bar { + --mdc-linear-progress-active-indicator-height: 11px !important; border-radius: 20px; - height: 11px; - } -::ng-deep .mat-progress-bar .mat-progress-bar-fill::after { +//Progress bar +::ng-deep .mdc-linear-progress__bar-inner { + --mdc-linear-progress-active-indicator-color: var(--primary-color) !important; border-radius: 20px !important; } + +// Buffer bar +::ng-deep .mdc-linear-progress__buffer { + --mdc-linear-progress-track-height: 11px !important; + --mdc-linear-progress-active-indicator-color: var(--secondary-color) !important; +} + +::ng-deep .mdc-linear-progress__buffer-bar { + --mdc-linear-progress-track-color: var(--secondary-color) !important; +} diff --git a/dmp-frontend/src/app/ui/tag/tags-field/tags-field.component.ts b/dmp-frontend/src/app/ui/tag/tags-field/tags-field.component.ts index 4a0eb444b..c9bf5bd8f 100644 --- a/dmp-frontend/src/app/ui/tag/tags-field/tags-field.component.ts +++ b/dmp-frontend/src/app/ui/tag/tags-field/tags-field.component.ts @@ -63,6 +63,7 @@ export class TagsComponent extends BaseComponent implements OnInit { if (index >= 0) { this.tags.splice(index, 1); + this.form.setValue(this.tags); } } diff --git a/dmp-frontend/src/common/base/base-editor.ts b/dmp-frontend/src/common/base/base-editor.ts index c66599d13..bdb75ae82 100644 --- a/dmp-frontend/src/common/base/base-editor.ts +++ b/dmp-frontend/src/common/base/base-editor.ts @@ -109,12 +109,12 @@ export abstract class BaseEditor