Adds link on button "add dataset" on dmp cards
This commit is contained in:
parent
306dfa7346
commit
b2977df4e5
|
@ -6,9 +6,9 @@
|
||||||
<h4 class="col-auto heading">1.4 {{'DATASET-EDITOR.FIELDS.TAGS' | translate}}</h4>
|
<h4 class="col-auto heading">1.4 {{'DATASET-EDITOR.FIELDS.TAGS' | translate}}</h4>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<!-- <app-external-item-listing *ngIf="formGroup.get('tags') && tagsTemplate && externalSourcesConfiguration" [options]="externalSourcesConfiguration.tags" placeholder="{{'DATASET-EDITOR.FIELDS.TAGS' | translate}}" [parentTemplate]='tagsTemplate' [formArray]="formGroup.get('tags')" [autoCompleteConfiguration]="tagsAutoCompleteConfiguration" (onItemChange)="tagsOnItemChange($event)">
|
<app-external-item-listing *ngIf="formGroup.get('tags') && tagsTemplate && externalSourcesConfiguration" [options]="externalSourcesConfiguration.tags" placeholder="{{'DATASET-EDITOR.FIELDS.TAGS' | translate}}" [parentTemplate]='tagsTemplate' [formArray]="formGroup.get('tags')" [autoCompleteConfiguration]="tagsAutoCompleteConfiguration" (onItemChange)="tagsOnItemChange($event)">
|
||||||
</app-external-item-listing> -->
|
</app-external-item-listing>
|
||||||
<div class="tags-form">
|
<!-- <div class="tags-form">
|
||||||
<mat-form-field appearance="outline">
|
<mat-form-field appearance="outline">
|
||||||
<mat-chip-list #chipList [disabled]="viewOnly">
|
<mat-chip-list #chipList [disabled]="viewOnly">
|
||||||
<mat-chip *ngFor="let tag of formGroup.get('tags').value" [removable]="true" (removed)="removeTag(tag)">
|
<mat-chip *ngFor="let tag of formGroup.get('tags').value" [removable]="true" (removed)="removeTag(tag)">
|
||||||
|
@ -18,7 +18,7 @@
|
||||||
<input matInput [disabled]="viewOnly" placeholder="{{'DATASET-EDITOR.FIELDS.TAGS' | translate}}" [matChipInputFor]="chipList" [matChipInputSeparatorKeyCodes]="separatorKeysCodes" [matChipInputAddOnBlur]="true" (matChipInputTokenEnd)="addTag($event)">
|
<input matInput [disabled]="viewOnly" placeholder="{{'DATASET-EDITOR.FIELDS.TAGS' | translate}}" [matChipInputFor]="chipList" [matChipInputSeparatorKeyCodes]="separatorKeysCodes" [matChipInputAddOnBlur]="true" (matChipInputTokenEnd)="addTag($event)">
|
||||||
</mat-chip-list>
|
</mat-chip-list>
|
||||||
</mat-form-field>
|
</mat-form-field>
|
||||||
</div>
|
</div> -->
|
||||||
|
|
||||||
<ng-template #tagsTemplate let-suggestion let-i="index" let-callback="function">
|
<ng-template #tagsTemplate let-suggestion let-i="index" let-callback="function">
|
||||||
<div class="col-12 row align-items-center">
|
<div class="col-12 row align-items-center">
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
import { Component, Input, OnInit } from '@angular/core';
|
import { Component, Input, OnInit, Output, EventEmitter } from '@angular/core';
|
||||||
import { FormArray, FormGroup } from '@angular/forms';
|
import { FormArray, FormGroup } from '@angular/forms';
|
||||||
import { MatDialog } from '@angular/material/dialog';
|
import { MatDialog } from '@angular/material/dialog';
|
||||||
import { Router } from '@angular/router';
|
import { Router } from '@angular/router';
|
||||||
|
@ -39,6 +39,7 @@ export class DatasetExternalReferencesEditorComponent extends BaseComponent impl
|
||||||
|
|
||||||
@Input() formGroup: FormGroup = null;
|
@Input() formGroup: FormGroup = null;
|
||||||
@Input() viewOnly = false;
|
@Input() viewOnly = false;
|
||||||
|
@Output() formChanged: EventEmitter<any> = new EventEmitter();
|
||||||
|
|
||||||
readonly separatorKeysCodes: number[] = [ENTER, COMMA];
|
readonly separatorKeysCodes: number[] = [ENTER, COMMA];
|
||||||
|
|
||||||
|
@ -114,6 +115,12 @@ export class DatasetExternalReferencesEditorComponent extends BaseComponent impl
|
||||||
this.externalSourcesConfiguration.tags = [{ key: '', label: 'All' }];
|
this.externalSourcesConfiguration.tags = [{ key: '', label: 'All' }];
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
this.formGroup.valueChanges
|
||||||
|
.pipe(takeUntil(this._destroyed))
|
||||||
|
.subscribe(val => {
|
||||||
|
this.formChanged.emit(val);
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
public cancel(): void {
|
public cancel(): void {
|
||||||
|
|
|
@ -51,8 +51,8 @@
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<app-dataset-external-references-editor-component [formGroup]="formGroup" [viewOnly]="viewOnly"></app-dataset-external-references-editor-component>
|
<app-dataset-external-references-editor-component (formChanged)="onFormChanged($event)" [formGroup]="formGroup" [viewOnly]="viewOnly"></app-dataset-external-references-editor-component>
|
||||||
<app-dataset-description [form]="formGroup.get('datasetProfileDefinition')" [datasetProfileId]="formGroup.get('profile').value"></app-dataset-description>
|
<app-dataset-description [form]="formGroup.get('datasetProfileDefinition')" [datasetProfileId]="formGroup.get('profile').value" (formChanged)="onFormChanged($event)"></app-dataset-description>
|
||||||
<!-- <app-dataset-description [form]="formGroup.get('datasetProfileDefinition')" [visibilityRules]="formGroup.get('datasetProfileDefinition').get('rules')" [datasetProfileId]="formGroup.get('profile').value">
|
<!-- <app-dataset-description [form]="formGroup.get('datasetProfileDefinition')" [visibilityRules]="formGroup.get('datasetProfileDefinition').get('rules')" [datasetProfileId]="formGroup.get('profile').value">
|
||||||
</app-dataset-description> -->
|
</app-dataset-description> -->
|
||||||
|
|
||||||
|
|
|
@ -223,6 +223,10 @@ export class DatasetEditorDetailsComponent extends BaseComponent implements OnIn
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
onFormChanged(event) {
|
||||||
|
this.formChanged.emit(event);
|
||||||
|
}
|
||||||
|
|
||||||
getDefinition(profileId: string) {
|
getDefinition(profileId: string) {
|
||||||
// if (this.formGroup.invalid) { setTimeout(() => this.stepper.selectedIndex = 0); return; }
|
// if (this.formGroup.invalid) { setTimeout(() => this.stepper.selectedIndex = 0); return; }
|
||||||
this.datasetWizardService.getDefinition(profileId)
|
this.datasetWizardService.getDefinition(profileId)
|
||||||
|
|
|
@ -17,7 +17,7 @@ import { DmpProfileDefinition } from '@app/core/model/dmp-profile/dmp-profile';
|
||||||
import { DmpProfileService } from '@app/core/services/dmp/dmp-profile.service';
|
import { DmpProfileService } from '@app/core/services/dmp/dmp-profile.service';
|
||||||
import { AvailableProfilesComponent } from '../available-profiles/available-profiles.component';
|
import { AvailableProfilesComponent } from '../available-profiles/available-profiles.component';
|
||||||
import { DmpEditorModel } from '../dmp-editor.model';
|
import { DmpEditorModel } from '../dmp-editor.model';
|
||||||
import { Router } from '@angular/router';
|
import { Router, Params, ActivatedRoute } from '@angular/router';
|
||||||
import { RequestItem } from '@app/core/query/request-item';
|
import { RequestItem } from '@app/core/query/request-item';
|
||||||
import { DatasetWizardService } from '@app/core/services/dataset-wizard/dataset-wizard.service';
|
import { DatasetWizardService } from '@app/core/services/dataset-wizard/dataset-wizard.service';
|
||||||
import { DatasetDescriptionFormEditorModel } from '@app/ui/misc/dataset-description-form/dataset-description-form.model';
|
import { DatasetDescriptionFormEditorModel } from '@app/ui/misc/dataset-description-form/dataset-description-form.model';
|
||||||
|
@ -35,6 +35,7 @@ export class DatasetInfoComponent extends BaseComponent implements OnInit {
|
||||||
// @Input() datasetFormGroup: FormGroup = null;
|
// @Input() datasetFormGroup: FormGroup = null;
|
||||||
@Input() isUserOwner: boolean;
|
@Input() isUserOwner: boolean;
|
||||||
@Input() dmp: DmpEditorModel;
|
@Input() dmp: DmpEditorModel;
|
||||||
|
@Input() hasDmpId: boolean;
|
||||||
@Input() isPublic: boolean;
|
@Input() isPublic: boolean;
|
||||||
@Input() isFinalized: boolean;
|
@Input() isFinalized: boolean;
|
||||||
@Input() isNewVersion: boolean;
|
@Input() isNewVersion: boolean;
|
||||||
|
@ -57,7 +58,8 @@ export class DatasetInfoComponent extends BaseComponent implements OnInit {
|
||||||
private dialog: MatDialog,
|
private dialog: MatDialog,
|
||||||
private _service: DmpService,
|
private _service: DmpService,
|
||||||
private dmpProfileService: DmpProfileService,
|
private dmpProfileService: DmpProfileService,
|
||||||
private router: Router
|
private router: Router,
|
||||||
|
private route: ActivatedRoute
|
||||||
) {
|
) {
|
||||||
super();
|
super();
|
||||||
}
|
}
|
||||||
|
@ -85,6 +87,16 @@ export class DatasetInfoComponent extends BaseComponent implements OnInit {
|
||||||
this.formGroup.get('extraProperties').get('publicDate').patchValue(new Date());
|
this.formGroup.get('extraProperties').get('publicDate').patchValue(new Date());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (this.hasDmpId) {
|
||||||
|
this.loadDatasetProfiles();
|
||||||
|
this.profilesAutoCompleteConfiguration = {
|
||||||
|
filterFn: this.filterProfiles.bind(this),
|
||||||
|
initialItems: (excludedItems: any[]) => this.filterProfiles('').pipe(map(result => result.filter(resultItem => (excludedItems || []).map(x => x.id).indexOf(resultItem.id) === -1))),
|
||||||
|
displayFn: (item) => item['label'],
|
||||||
|
titleFn: (item) => item['label'],
|
||||||
|
subtitleFn: (item) => item['description']
|
||||||
|
};
|
||||||
|
}
|
||||||
if (this.formGroup.get('datasets')['controls'][0]) {
|
if (this.formGroup.get('datasets')['controls'][0]) {
|
||||||
this.formGroup.get('datasets')['controls'][0].get('dmp').valueChanges.pipe(takeUntil(this._destroyed))
|
this.formGroup.get('datasets')['controls'][0].get('dmp').valueChanges.pipe(takeUntil(this._destroyed))
|
||||||
.subscribe(x => {
|
.subscribe(x => {
|
||||||
|
|
|
@ -47,7 +47,8 @@
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="col info" *ngIf="isNewDataset">
|
<div class="col info" *ngIf="isNewDataset">
|
||||||
<div class="dataset-title">{{'DMP-EDITOR.TITLE.CREATE-DATASET' | translate}}</div>
|
<div *ngIf="!hasDmpId" class="dataset-title">{{'DMP-EDITOR.TITLE.CREATE-DATASET' | translate}}</div>
|
||||||
|
<div *ngIf="hasDmpId" class="dataset-title">{{'DMP-EDITOR.TITLE.ADD-DATASET' | translate}} {{formGroup.get('datasets')['controls'][0].get('dmp').value.label}}</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="row">
|
<div class="row">
|
||||||
<div class="col-auto d-flex align-items-center p-0">
|
<div class="col-auto d-flex align-items-center p-0">
|
||||||
|
@ -110,11 +111,11 @@
|
||||||
|
|
||||||
<funding-info *ngIf="!isNewDataset" [hidden]="this.step !== 1" [formGroup]="formGroup" [grantformGroup]="formGroup.get('grant')" [projectFormGroup]="formGroup.get('project')" [funderFormGroup]="formGroup.get('funder')" [isFinalized]="isFinalized || lockStatus" [isNew]="isNew" [isUserOwner]="isUserOwner" (onFormChanged)="formChanged()"></funding-info>
|
<funding-info *ngIf="!isNewDataset" [hidden]="this.step !== 1" [formGroup]="formGroup" [grantformGroup]="formGroup.get('grant')" [projectFormGroup]="formGroup.get('project')" [funderFormGroup]="formGroup.get('funder')" [isFinalized]="isFinalized || lockStatus" [isNew]="isNew" [isUserOwner]="isUserOwner" (onFormChanged)="formChanged()"></funding-info>
|
||||||
|
|
||||||
<dataset-info *ngIf="!isNewDataset" [hidden]="this.step !== 2" [formGroup]="formGroup" [dmp]="dmp" [isPublic]="isPublic" [isFinalized]="isFinalized || lockStatus" [isUserOwner]="isUserOwner" [isNewDataset]="isNewDataset" (onFormChanged)="formChanged()"></dataset-info>
|
<dataset-info *ngIf="!isNewDataset" [hidden]="this.step !== 2" [formGroup]="formGroup" [dmp]="dmp" [isPublic]="isPublic" [isFinalized]="isFinalized || lockStatus" [isUserOwner]="isUserOwner" [isNewDataset]="isNewDataset" [hasDmpId]="hasDmpId" (onFormChanged)="formChanged()"></dataset-info>
|
||||||
<dataset-info *ngIf="isNewDataset" [hidden]="this.step !== 1" [formGroup]="formGroup" [dmp]="dmp" [isPublic]="isPublic" [isFinalized]="isFinalized || lockStatus" [isUserOwner]="isUserOwner" [isNewDataset]="isNewDataset" (onFormChanged)="formChanged()"></dataset-info>
|
<dataset-info *ngIf="isNewDataset" [hidden]="this.step !== 1" [formGroup]="formGroup" [dmp]="dmp" [isPublic]="isPublic" [isFinalized]="isFinalized || lockStatus" [isUserOwner]="isUserOwner" [isNewDataset]="isNewDataset" [hasDmpId]="hasDmpId" (onFormChanged)="formChanged()"></dataset-info>
|
||||||
|
|
||||||
<div *ngFor="let dataset of datasets.controls; let i = index" [hidden]="this.step !== i + stepsBeforeDatasets">
|
<div *ngFor="let dataset of datasets.controls; let i = index" [hidden]="this.step !== i + stepsBeforeDatasets">
|
||||||
<dataset-editor-details [formGroup]="dataset" [isNewDataset]="isNewDataset" [dmpId]="formGroup.get('id').value" (formChanged)="datasetFormChanged($event)"></dataset-editor-details>
|
<dataset-editor-details [formGroup]="dataset" [isNewDataset]="isNewDataset" [dmpId]="formGroup.get('id').value" (formChanged)="formChanged($event)"></dataset-editor-details>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
|
|
||||||
import { Component, OnInit, SimpleChanges } from '@angular/core';
|
import { Component, OnInit, SimpleChanges } from '@angular/core';
|
||||||
import { FormGroup, AbstractControl, FormControl, FormArray } from '@angular/forms';
|
import { FormGroup, AbstractControl, FormControl, FormArray, FormBuilder } from '@angular/forms';
|
||||||
import { MatDialog } from '@angular/material/dialog';
|
import { MatDialog } from '@angular/material/dialog';
|
||||||
import { ActivatedRoute, Params, Router } from '@angular/router';
|
import { ActivatedRoute, Params, Router } from '@angular/router';
|
||||||
import { DmpStatus } from '@app/core/common/enum/dmp-status';
|
import { DmpStatus } from '@app/core/common/enum/dmp-status';
|
||||||
|
@ -65,6 +65,7 @@ export class DmpEditorComponent extends BaseComponent implements OnInit, IBreadC
|
||||||
hasChanges = false;
|
hasChanges = false;
|
||||||
isDiscarded = false;
|
isDiscarded = false;
|
||||||
isNewDataset = false;
|
isNewDataset = false;
|
||||||
|
hasDmpId = false;
|
||||||
isUserOwner: boolean = true;
|
isUserOwner: boolean = true;
|
||||||
|
|
||||||
dmp: DmpEditorModel;
|
dmp: DmpEditorModel;
|
||||||
|
@ -73,6 +74,7 @@ export class DmpEditorComponent extends BaseComponent implements OnInit, IBreadC
|
||||||
formGroupRawValue: any;
|
formGroupRawValue: any;
|
||||||
datasetId: string = null;
|
datasetId: string = null;
|
||||||
datasets = new FormArray([]);
|
datasets = new FormArray([]);
|
||||||
|
datasetWizardEditorModel: DatasetWizardEditorModel;
|
||||||
createNewVersion;
|
createNewVersion;
|
||||||
|
|
||||||
associatedUsers: Array<UserModel>;
|
associatedUsers: Array<UserModel>;
|
||||||
|
@ -108,7 +110,7 @@ export class DmpEditorComponent extends BaseComponent implements OnInit, IBreadC
|
||||||
}
|
}
|
||||||
|
|
||||||
ngOnInit() {
|
ngOnInit() {
|
||||||
if (this.router.url.toString().localeCompare('/new/dataset') === 0) {
|
if (this.router.url.toString().includes('/new/dataset')) {
|
||||||
this.isNewDataset = true;
|
this.isNewDataset = true;
|
||||||
this.stepsBeforeDatasets = 2;
|
this.stepsBeforeDatasets = 2;
|
||||||
this.maxStep = 2;
|
this.maxStep = 2;
|
||||||
|
@ -120,6 +122,7 @@ export class DmpEditorComponent extends BaseComponent implements OnInit, IBreadC
|
||||||
const publicId = params['publicId'];
|
const publicId = params['publicId'];
|
||||||
const queryParams = this.route.snapshot.queryParams;
|
const queryParams = this.route.snapshot.queryParams;
|
||||||
const tabToNav = queryParams['tab'];
|
const tabToNav = queryParams['tab'];
|
||||||
|
const dmpId = params['dmpId'];
|
||||||
this.datasetId = queryParams['dataset'];
|
this.datasetId = queryParams['dataset'];
|
||||||
// if (queryParams['step']) { this.step = queryParams['step']; }
|
// if (queryParams['step']) { this.step = queryParams['step']; }
|
||||||
|
|
||||||
|
@ -273,17 +276,34 @@ export class DmpEditorComponent extends BaseComponent implements OnInit, IBreadC
|
||||||
this.dmp.extraProperties = new ExtraPropertiesFormModel();
|
this.dmp.extraProperties = new ExtraPropertiesFormModel();
|
||||||
this.dmp.extraProperties.visible = false;
|
this.dmp.extraProperties.visible = false;
|
||||||
this.dmp.extraProperties.contact = this.authService.current().id;
|
this.dmp.extraProperties.contact = this.authService.current().id;
|
||||||
const datasetWizardEditorModel = new DatasetWizardEditorModel();
|
this.datasetWizardEditorModel = new DatasetWizardEditorModel();
|
||||||
// this.datasetFormGroup = datasetWizardEditorModel.buildForm();
|
|
||||||
|
|
||||||
// datasetWizardEditorModel.datasetProfileDefinition = new DatasetDescriptionFormEditorModel();
|
if (dmpId) {
|
||||||
this.dmp.datasets.push(datasetWizardEditorModel);
|
this.hasDmpId = true;
|
||||||
|
this.dmpService.getSingle(dmpId).pipe(map(data => data as DmpModel))
|
||||||
|
.pipe(takeUntil(this._destroyed))
|
||||||
|
.subscribe(data => {
|
||||||
|
setTimeout(() => {
|
||||||
|
this.datasetWizardEditorModel.dmp = data;
|
||||||
|
this.dmp.datasets.push(this.datasetWizardEditorModel);
|
||||||
this.formGroup = this.dmp.buildForm();
|
this.formGroup = this.dmp.buildForm();
|
||||||
|
this.formGroup.get('datasets')['controls'][0].get('dmp').disable();
|
||||||
|
|
||||||
this.datasets = this.formGroup.get('datasets') as FormArray;
|
this.datasets = this.formGroup.get('datasets') as FormArray;
|
||||||
this.formGroupRawValue = JSON.parse(JSON.stringify(this.formGroup.getRawValue()));
|
this.formGroupRawValue = JSON.parse(JSON.stringify(this.formGroup.getRawValue()));
|
||||||
// this.formGroupRawValue = JSON.parse(JSON.stringify(this.formGroup.get('datasets')['controls'][0].getRawValue()));
|
|
||||||
this.maxStep = this.formGroup.get('datasets') ? this.maxStep + this.formGroup.get('datasets').value.length - 1 : this.maxStep;
|
this.maxStep = this.formGroup.get('datasets') ? this.maxStep + this.formGroup.get('datasets').value.length - 1 : this.maxStep;
|
||||||
|
// this.loadDatasetProfiles();
|
||||||
|
// this.registerFormListeners();
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|
||||||
|
} else {
|
||||||
|
this.dmp.datasets.push(this.datasetWizardEditorModel);
|
||||||
|
this.formGroup = this.dmp.buildForm();
|
||||||
|
this.datasets = this.formGroup.get('datasets') as FormArray;
|
||||||
|
this.formGroupRawValue = JSON.parse(JSON.stringify(this.formGroup.getRawValue()));
|
||||||
|
this.maxStep = this.formGroup.get('datasets') ? this.maxStep + this.formGroup.get('datasets').value.length - 1 : this.maxStep;
|
||||||
|
}
|
||||||
|
|
||||||
this.registerFormEventsForNewItem();
|
this.registerFormEventsForNewItem();
|
||||||
} else {
|
} else {
|
||||||
|
@ -742,11 +762,20 @@ export class DmpEditorComponent extends BaseComponent implements OnInit, IBreadC
|
||||||
public discardChanges() {
|
public discardChanges() {
|
||||||
this.isDiscarded = true;
|
this.isDiscarded = true;
|
||||||
this.hasChanges = false;
|
this.hasChanges = false;
|
||||||
if (this.isNewDataset) {
|
if (this.isNewDataset && !this.hasDmpId) {
|
||||||
this.formGroup.get('datasets')['controls'].forEach(element => {
|
this.formGroup.get('datasets')['controls'].forEach(element => {
|
||||||
element.removeControl('datasetProfileDefinition');
|
element.removeControl('datasetProfileDefinition');
|
||||||
});
|
});
|
||||||
this.formGroup.reset();
|
this.formGroup.reset();
|
||||||
|
} else if (this.hasDmpId) {
|
||||||
|
Object.keys(this.formGroup.get('datasets')['controls'][0].controls).forEach((key: string) => {
|
||||||
|
if (key === 'datasetProfileDefinition') {
|
||||||
|
this.formGroup.get('datasets')['controls'][0].removeControl(key);
|
||||||
|
}
|
||||||
|
if (key !== 'dmp' && key !== 'datasetProfileDefinition') {
|
||||||
|
this.formGroup.get('datasets')['controls'][0].get(key).reset();
|
||||||
|
}
|
||||||
|
});
|
||||||
} else {
|
} else {
|
||||||
this.formGroup.patchValue(JSON.parse(JSON.stringify(this.formGroupRawValue)));
|
this.formGroup.patchValue(JSON.parse(JSON.stringify(this.formGroupRawValue)));
|
||||||
}
|
}
|
||||||
|
|
|
@ -29,7 +29,8 @@
|
||||||
</a>
|
</a>
|
||||||
<div class="dmp-card-actions">
|
<div class="dmp-card-actions">
|
||||||
<a class="col-auto border-right pointer" [matMenuTriggerFor]="exportMenu"><span class="material-icons icon-align pr-2">open_in_new</span>{{'DMP-LISTING.ACTIONS.EXPORT' | translate}}</a>
|
<a class="col-auto border-right pointer" [matMenuTriggerFor]="exportMenu"><span class="material-icons icon-align pr-2">open_in_new</span>{{'DMP-LISTING.ACTIONS.EXPORT' | translate}}</a>
|
||||||
<a class="col-auto border-right pointer" *ngIf="isDraftDmp(dmp)" [routerLink]="['/datasets/new/' + dmp.id]" target="_blank"><span class="material-icons icon-align">add</span>{{'DMP-LISTING.ACTIONS.ADD-DATASET-SHORT' | translate}}</a>
|
<a class="col-auto border-right pointer" *ngIf="isDraftDmp(dmp)" [routerLink]="['/new/dataset/' + dmp.id]" target="_blank"><span class="material-icons icon-align">add</span>{{'DMP-LISTING.ACTIONS.ADD-DATASET-SHORT' | translate}}</a>
|
||||||
|
<!-- <a class="col-auto border-right pointer" *ngIf="isDraftDmp(dmp)" [routerLink]="['/datasets/new/' + dmp.id]" target="_blank"><span class="material-icons icon-align">add</span>{{'DMP-LISTING.ACTIONS.ADD-DATASET-SHORT' | translate}}</a> -->
|
||||||
<a class="col-auto border-right pointer" *ngIf="isUserOwner(dmp)" (click)="openShareDialog(dmp.id, dmp.label)"><span class="material-icons icon-align pr-2">group_add</span>{{'DMP-LISTING.ACTIONS.INVITE-SHORT' | translate}}</a>
|
<a class="col-auto border-right pointer" *ngIf="isUserOwner(dmp)" (click)="openShareDialog(dmp.id, dmp.label)"><span class="material-icons icon-align pr-2">group_add</span>{{'DMP-LISTING.ACTIONS.INVITE-SHORT' | translate}}</a>
|
||||||
<a class="col-auto border-right pointer" *ngIf="isAuthenticated()" [routerLink]="['/plans/clone/' + dmp.id]" target="_blank"><span class="material-icons icon-align pr-2">filter_none</span>{{'DMP-LISTING.ACTIONS.CLONE' | translate}}</a>
|
<a class="col-auto border-right pointer" *ngIf="isAuthenticated()" [routerLink]="['/plans/clone/' + dmp.id]" target="_blank"><span class="material-icons icon-align pr-2">filter_none</span>{{'DMP-LISTING.ACTIONS.CLONE' | translate}}</a>
|
||||||
<a class="col-auto pointer" [matMenuTriggerFor]="actionsMenu"><span class="material-icons icon-align pl-2">more_horiz</span></a>
|
<a class="col-auto pointer" [matMenuTriggerFor]="actionsMenu"><span class="material-icons icon-align pl-2">more_horiz</span></a>
|
||||||
|
|
|
@ -29,6 +29,7 @@
|
||||||
[isChild]="true" [showDelete]="true"></app-form-composite-field>
|
[isChild]="true" [showDelete]="true"></app-form-composite-field>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
{{compositeFieldFormGroup.get('multiplicity').value | json}}
|
||||||
<div *ngIf="(compositeFieldFormGroup.get('multiplicity').value.max - 1) > (compositeFieldFormGroup.get('multiplicityItems').length)"
|
<div *ngIf="(compositeFieldFormGroup.get('multiplicity').value.max - 1) > (compositeFieldFormGroup.get('multiplicityItems').length)"
|
||||||
class="col-12 addOneFieldButton">
|
class="col-12 addOneFieldButton">
|
||||||
<button mat-icon-button color="primary" (click)="addMultipleField(i)" [disabled]="compositeFieldFormGroup.disabled" matTooltip="{{'DATASET-PROFILE-EDITOR.STEPS.FORM.COMPOSITE-FIELD.FIELDS.MULTIPLICITY-ADD-ONE-FIELD' | translate}}">
|
<button mat-icon-button color="primary" (click)="addMultipleField(i)" [disabled]="compositeFieldFormGroup.disabled" matTooltip="{{'DATASET-PROFILE-EDITOR.STEPS.FORM.COMPOSITE-FIELD.FIELDS.MULTIPLICITY-ADD-ONE-FIELD' | translate}}">
|
||||||
|
|
|
@ -1,10 +1,11 @@
|
||||||
import { AfterViewInit, Component, Input, OnChanges, OnInit, SimpleChanges, ViewChild } from '@angular/core';
|
import { AfterViewInit, Component, Input, OnChanges, OnInit, SimpleChanges, ViewChild, Output, EventEmitter } from '@angular/core';
|
||||||
import { FormGroup } from '@angular/forms';
|
import { FormGroup } from '@angular/forms';
|
||||||
import { MatHorizontalStepper } from '@angular/material/stepper';
|
import { MatHorizontalStepper } from '@angular/material/stepper';
|
||||||
import { Rule } from '@app/core/model/dataset-profile-definition/rule';
|
import { Rule } from '@app/core/model/dataset-profile-definition/rule';
|
||||||
import { LinkToScroll } from '@app/ui/misc/dataset-description-form/tableOfContentsMaterial/table-of-contents';
|
import { LinkToScroll } from '@app/ui/misc/dataset-description-form/tableOfContentsMaterial/table-of-contents';
|
||||||
import { VisibilityRulesService } from '@app/ui/misc/dataset-description-form/visibility-rules/visibility-rules.service';
|
import { VisibilityRulesService } from '@app/ui/misc/dataset-description-form/visibility-rules/visibility-rules.service';
|
||||||
import { BaseComponent } from '@common/base/base.component';
|
import { BaseComponent } from '@common/base/base.component';
|
||||||
|
import { takeUntil } from 'rxjs/operators';
|
||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
selector: 'app-dataset-description',
|
selector: 'app-dataset-description',
|
||||||
|
@ -19,6 +20,7 @@ export class DatasetDescriptionComponent extends BaseComponent implements OnInit
|
||||||
@Input() visibilityRules: Rule[] = [];
|
@Input() visibilityRules: Rule[] = [];
|
||||||
@Input() datasetProfileId: String;
|
@Input() datasetProfileId: String;
|
||||||
@Input() linkToScroll: LinkToScroll;
|
@Input() linkToScroll: LinkToScroll;
|
||||||
|
@Output() formChanged: EventEmitter<any> = new EventEmitter();
|
||||||
|
|
||||||
constructor(
|
constructor(
|
||||||
private visibilityRulesService: VisibilityRulesService,
|
private visibilityRulesService: VisibilityRulesService,
|
||||||
|
@ -28,6 +30,13 @@ export class DatasetDescriptionComponent extends BaseComponent implements OnInit
|
||||||
|
|
||||||
ngOnInit() {
|
ngOnInit() {
|
||||||
this.visibilityRulesService.buildVisibilityRules(this.visibilityRules, this.form);
|
this.visibilityRulesService.buildVisibilityRules(this.visibilityRules, this.form);
|
||||||
|
if (this.form) {
|
||||||
|
this.form.valueChanges
|
||||||
|
.pipe(takeUntil(this._destroyed))
|
||||||
|
.subscribe(val => {
|
||||||
|
this.formChanged.emit(val);
|
||||||
|
});
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
ngOnChanges(changes: SimpleChanges) {
|
ngOnChanges(changes: SimpleChanges) {
|
||||||
|
|
|
@ -691,6 +691,7 @@
|
||||||
"NEW": "Neuer Datenmanagementplan",
|
"NEW": "Neuer Datenmanagementplan",
|
||||||
"EDIT": "Bearbeiten",
|
"EDIT": "Bearbeiten",
|
||||||
"SUBTITLE": "DOI",
|
"SUBTITLE": "DOI",
|
||||||
|
"ADD-DATASET": "Adding dataset to ",
|
||||||
"EDIT-DATASET": "Editing Dataset",
|
"EDIT-DATASET": "Editing Dataset",
|
||||||
"CREATE-DATASET": "Creating Dataset Description"
|
"CREATE-DATASET": "Creating Dataset Description"
|
||||||
},
|
},
|
||||||
|
|
|
@ -760,6 +760,7 @@
|
||||||
"NEW": "New Data Management Plan",
|
"NEW": "New Data Management Plan",
|
||||||
"EDIT": "Edit",
|
"EDIT": "Edit",
|
||||||
"EDIT-DMP": "Editing DMP",
|
"EDIT-DMP": "Editing DMP",
|
||||||
|
"ADD-DATASET": "Adding dataset to ",
|
||||||
"EDIT-DATASET": "Editing Dataset",
|
"EDIT-DATASET": "Editing Dataset",
|
||||||
"CREATE-DATASET": "Creating Dataset Description",
|
"CREATE-DATASET": "Creating Dataset Description",
|
||||||
"SUBTITLE": "DOI"
|
"SUBTITLE": "DOI"
|
||||||
|
|
|
@ -760,6 +760,7 @@
|
||||||
"NEW": "Nuevo Plan de Gestión de Datos",
|
"NEW": "Nuevo Plan de Gestión de Datos",
|
||||||
"EDIT": "Editar",
|
"EDIT": "Editar",
|
||||||
"EDIT-DMP": "Editando PGD",
|
"EDIT-DMP": "Editando PGD",
|
||||||
|
"ADD-DATASET": "Adding dataset to ",
|
||||||
"EDIT-DATASET": "Editing Dataset",
|
"EDIT-DATASET": "Editing Dataset",
|
||||||
"CREATE-DATASET": "Creating Dataset Description",
|
"CREATE-DATASET": "Creating Dataset Description",
|
||||||
"SUBTITLE": "DOI"
|
"SUBTITLE": "DOI"
|
||||||
|
|
|
@ -755,6 +755,7 @@
|
||||||
"NEW": "Νέα Σχέδιο Διαχείρισης Δεδομένων",
|
"NEW": "Νέα Σχέδιο Διαχείρισης Δεδομένων",
|
||||||
"EDIT": "Επεξεργασία",
|
"EDIT": "Επεξεργασία",
|
||||||
"EDIT-DMP": "Editing DMP",
|
"EDIT-DMP": "Editing DMP",
|
||||||
|
"ADD-DATASET": "Adding dataset to ",
|
||||||
"EDIT-DATASET": "Editing Dataset",
|
"EDIT-DATASET": "Editing Dataset",
|
||||||
"SUBTITLE": "Μονοσήμαντο Αναγνωριστικό Ψηφιακού Αντικειμένου (DOI)"
|
"SUBTITLE": "Μονοσήμαντο Αναγνωριστικό Ψηφιακού Αντικειμένου (DOI)"
|
||||||
},
|
},
|
||||||
|
|
|
@ -749,6 +749,7 @@
|
||||||
"NEW": "Yeni Veri Yönetim Planı",
|
"NEW": "Yeni Veri Yönetim Planı",
|
||||||
"EDIT": "Düzenle",
|
"EDIT": "Düzenle",
|
||||||
"EDIT-DMP": " VYP'yi düzenleme",
|
"EDIT-DMP": " VYP'yi düzenleme",
|
||||||
|
"ADD-DATASET": "Adding dataset to ",
|
||||||
"SUBTITLE": "DOI"
|
"SUBTITLE": "DOI"
|
||||||
},
|
},
|
||||||
"FIELDS": {
|
"FIELDS": {
|
||||||
|
|
Loading…
Reference in New Issue