Merge branch 'dmp-refactoring' of https://code-repo.d4science.org/MaDgiK-CITE/argos into dmp-refactoring
This commit is contained in:
commit
8ee64a502b
|
@ -112,7 +112,7 @@
|
|||
<span class="material-icons">chevron_right</span>
|
||||
</div>
|
||||
<button [disabled]="saving" (click)="saveAndClose()" *ngIf="(step === maxStep) && !isLocked && formGroup.get('descriptionTemplateId').value && !viewOnly" mat-raised-button type="button" class="col-auto stepper-btn add-description-btn ml-auto">
|
||||
{{ 'DESCRIPTION-EDITOR.ACTIONS.SAVE' | translate }}
|
||||
{{ 'DESCRIPTION-EDITOR.ACTIONS.SAVE-AND-CLOSE' | translate }}
|
||||
</button>
|
||||
</div>
|
||||
<div class="col-auto pr-0">
|
||||
|
|
|
@ -61,6 +61,7 @@ export class DescriptionEditorComponent extends BaseEditor<DescriptionEditorMode
|
|||
|
||||
isNew = true;
|
||||
isDeleted = false;
|
||||
isCopy = false;
|
||||
item: Description;
|
||||
fieldsetIdWithFocus: string;
|
||||
fileTransformerEntityTypeEnum = FileTransformerEntityType;
|
||||
|
@ -126,10 +127,12 @@ export class DescriptionEditorComponent extends BaseEditor<DescriptionEditorMode
|
|||
|
||||
const itemId = params['id'];
|
||||
const dmpId = params['dmpId'];
|
||||
const copyDmpId = params['copyDmpId'];
|
||||
const dmpSectionId = params['dmpSectionId'];
|
||||
|
||||
const isPublicDescription = params['public'];
|
||||
const newDmpId = params['newDmpId'];
|
||||
if(copyDmpId && !dmpId && dmpSectionId) this.isCopy = true;
|
||||
|
||||
|
||||
|
||||
|
@ -631,7 +634,7 @@ export class DescriptionEditorComponent extends BaseEditor<DescriptionEditorMode
|
|||
refreshOnNavigateToData(id?: Guid): void {
|
||||
this.formGroup.markAsPristine();
|
||||
|
||||
if (this.isNew) {
|
||||
if (this.isNew || this.isCopy) {
|
||||
let route = [];
|
||||
route.push('/descriptions/edit/' + id);
|
||||
this.router.navigate(route, { queryParams: { 'lookup': this.queryParamsService.serializeLookup(this.lookupParams), 'lv': ++this.lv }, replaceUrl: true, relativeTo: this.route });
|
||||
|
|
|
@ -1,5 +1,6 @@
|
|||
import { Injectable } from '@angular/core';
|
||||
import { ActivatedRouteSnapshot, RouterStateSnapshot } from '@angular/router';
|
||||
import { DescriptionStatus } from '@app/core/common/enum/description-status';
|
||||
import { AppPermission } from '@app/core/common/enum/permission.enum';
|
||||
import { DescriptionTemplate, DescriptionTemplateBaseFieldData, DescriptionTemplateDefinition, DescriptionTemplateExternalDatasetData, DescriptionTemplateField, DescriptionTemplateFieldSet, DescriptionTemplateMultiplicity, DescriptionTemplatePage, DescriptionTemplateReferenceTypeData, DescriptionTemplateRule, DescriptionTemplateSection, DescriptionTemplateSelectData, DescriptionTemplateSelectOption, DescriptionTemplateUploadData, DescriptionTemplateUploadOption } from '@app/core/model/description-template/description-template';
|
||||
import { Description, DescriptionExternalIdentifier, DescriptionField, DescriptionPropertyDefinition, DescriptionPropertyDefinitionFieldSet, DescriptionPropertyDefinitionFieldSetItem, DescriptionReference, DescriptionReferenceData, DescriptionTag } from '@app/core/model/description/description';
|
||||
|
@ -203,8 +204,12 @@ export class DescriptionEditorResolver extends BaseEditorResolver {
|
|||
return this.dmpService.getSingle(Guid.parse(copyDmpId), DescriptionEditorResolver.dmpLookupFields()).pipe(tap(x => this.breadcrumbService.addIdResolvedValue(x.id?.toString(), x.label)), takeUntil(this._destroyed), concatMap(dmp => {
|
||||
return this.descriptionService.getSingle(Guid.parse(id), DescriptionEditorResolver.cloneLookupFields()).pipe(tap(x => this.breadcrumbService.addIdResolvedValue(x.id?.toString(), x.label)), takeUntil(this._destroyed), map(description => {
|
||||
|
||||
description.id = null;
|
||||
description.hash = null;
|
||||
description.status = DescriptionStatus.Draft;
|
||||
description.dmp = dmp;
|
||||
description.dmpDescriptionTemplate = {
|
||||
id: dmp.dmpDescriptionTemplates.filter(x => x.sectionId == Guid.parse(dmpSectionId) && x.descriptionTemplateGroupId == description.descriptionTemplate.groupId)[0].id,
|
||||
sectionId: Guid.parse(dmpSectionId)
|
||||
}
|
||||
return description;
|
||||
|
|
Loading…
Reference in New Issue