dmp authz changes
This commit is contained in:
parent
1a3aa18d35
commit
500503ad37
|
@ -403,12 +403,6 @@ permissions:
|
|||
allowAuthenticated: false
|
||||
# Dmp
|
||||
BrowseDmp:
|
||||
roles:
|
||||
- TenantAdmin
|
||||
clients: [ ]
|
||||
allowAnonymous: false
|
||||
allowAuthenticated: false
|
||||
EditDmp:
|
||||
roles:
|
||||
- TenantAdmin
|
||||
dmp:
|
||||
|
@ -420,7 +414,7 @@ permissions:
|
|||
clients: [ ]
|
||||
allowAnonymous: false
|
||||
allowAuthenticated: false
|
||||
ReviewDmp:
|
||||
EditDmp:
|
||||
roles:
|
||||
- TenantAdmin
|
||||
dmp:
|
||||
|
|
|
@ -71,7 +71,6 @@ export enum AppPermission {
|
|||
//Dmp
|
||||
BrowseDmp = "BrowseDmp",
|
||||
EditDmp = "EditDmp",
|
||||
ReviewDmp = "ReviewDmp",
|
||||
NewDmp = "NewDmp",
|
||||
DepositDmp = "DepositDmp",
|
||||
DeleteDmp = "DeleteDmp",
|
||||
|
|
|
@ -17,7 +17,7 @@
|
|||
<button [disabled]="saving" *ngIf="isNew" mat-raised-button type="button" (click)="formSubmit()" class="save-btn">
|
||||
{{'DMP-EDITOR.ACTIONS.SAVE' | translate}}
|
||||
</button>
|
||||
<div *ngIf="!isNew && formGroup.enabled && !lockStatus">
|
||||
<div *ngIf="!isNew && formGroup.enabled && !lockStatus && canSave">
|
||||
<button [disabled]="saving" *ngIf="!isFinalized" mat-raised-button (click)="formSubmit()" class="save-btn">
|
||||
{{'DMP-EDITOR.ACTIONS.SAVE' | translate}}
|
||||
</button>
|
||||
|
@ -162,7 +162,7 @@
|
|||
</mat-form-field>
|
||||
</div>
|
||||
<div *ngIf="field.systemFieldType == dmpBlueprintSystemFieldTypeEnum.Description">
|
||||
<rich-text-editor-component [form]="formGroup.get('description')" [placeholder]="field.placeholder ?? 'DMP-EDITOR.PLACEHOLDER.DESCRIPTION'" [required]="field.required">
|
||||
<rich-text-editor-component [form]="formGroup.get('description')" [editable]="formGroup.get('description').status !== 'DISABLED'" [placeholder]="field.placeholder ?? 'DMP-EDITOR.PLACEHOLDER.DESCRIPTION'" [required]="field.required">
|
||||
</rich-text-editor-component>
|
||||
</div>
|
||||
<div *ngIf="field.systemFieldType == dmpBlueprintSystemFieldTypeEnum.Language">
|
||||
|
@ -228,8 +228,8 @@
|
|||
</ng-container>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-12 col-xl-auto">
|
||||
<button [disabled]="formGroup.disabled" mat-icon-button class="action-list-icon" matTooltip="{{'DMP-EDITOR.ACTIONS.REMOVE-CONTACT' | translate}}" (click)="removeContact(contactIndex)" [disabled]="formGroup.disabled">
|
||||
<div *ngIf="canSave" class="col-12 col-xl-auto">
|
||||
<button [disabled]="!this.canSave" mat-icon-button class="action-list-icon" matTooltip="{{'DMP-EDITOR.ACTIONS.REMOVE-CONTACT' | translate}}" (click)="removeContact(contactIndex)" [disabled]="formGroup.disabled">
|
||||
<mat-icon>delete</mat-icon>
|
||||
</button>
|
||||
</div>
|
||||
|
@ -239,7 +239,7 @@
|
|||
</div>
|
||||
<div class="row">
|
||||
<div class="col">
|
||||
<button mat-icon-button (click)="addContact()" [disabled]="formGroup.disabled">
|
||||
<button mat-icon-button (click)="addContact()" [disabled]="!this.canSave">
|
||||
<mat-icon>add</mat-icon>
|
||||
</button>
|
||||
</div>
|
||||
|
@ -263,6 +263,7 @@
|
|||
</div>
|
||||
</div>
|
||||
<div *ngIf="field.category === dmpBlueprintSectionFieldCategoryEnum.ReferenceType">
|
||||
{{formGroup.get('properties').get('dmpBlueprintValues').get(field.id)?.get('reference')?.status }}
|
||||
<ng-container *ngIf="field.multipleSelect">
|
||||
<app-reference-field-component [form]="formGroup.get('properties').get('dmpBlueprintValues').get(field.id).get('references')" [dependencies]="formGroup.get('properties').get('dmpBlueprintValues')" [label]= "field.label" [placeholder]="field.placeholder ?? field.label" [referenceType]="field.referenceType" [multiple]="true"></app-reference-field-component>
|
||||
</ng-container>
|
||||
|
|
|
@ -224,7 +224,7 @@ export class DmpEditorComponent extends BaseEditor<DmpEditorModel, Dmp> implemen
|
|||
.pipe(takeUntil(this._destroyed)).subscribe(
|
||||
complete => {
|
||||
this.permissionPerSection = complete,
|
||||
this.buildForm();
|
||||
this.buildForm();
|
||||
},
|
||||
error => this.onCallbackError(error)
|
||||
);
|
||||
|
|
|
@ -87,7 +87,8 @@ export class DmpEditorModel extends BaseEditorModel implements DmpPersist {
|
|||
label: [{ value: this.label, disabled: disabled }, context.getValidation('label').validators],
|
||||
status: [{ value: this.status, disabled: disabled }, context.getValidation('status').validators],
|
||||
properties: this.properties.buildForm({
|
||||
rootPath: `properties.`
|
||||
rootPath: `properties.`,
|
||||
disabled: disabled
|
||||
}),
|
||||
users: this.formBuilder.array(
|
||||
(this.users ?? []).map(
|
||||
|
@ -242,7 +243,8 @@ export class DmpPropertiesEditorModel implements DmpPropertiesPersist {
|
|||
contacts: this.formBuilder.array(
|
||||
(this.contacts ?? []).map(
|
||||
(item, index) => item.buildForm({
|
||||
rootPath: `${rootPath}contacts[${index}].`
|
||||
rootPath: `${rootPath}contacts[${index}].`,
|
||||
disabled: disabled
|
||||
})
|
||||
), context.getValidation('contacts').validators
|
||||
),
|
||||
|
@ -252,7 +254,8 @@ export class DmpPropertiesEditorModel implements DmpPropertiesPersist {
|
|||
|
||||
const dmpBlueprintValuesFormGroup = this.formBuilder.group({});
|
||||
this.dmpBlueprintValues.forEach((value, key) => dmpBlueprintValuesFormGroup.addControl(key.toString(), value.buildForm({
|
||||
rootPath: `${rootPath}dmpBlueprintValues[${key}].`
|
||||
rootPath: `${rootPath}dmpBlueprintValues[${key}].`,
|
||||
disabled: disabled
|
||||
})), context.getValidation('dmpBlueprintValues')
|
||||
)
|
||||
formGroup.addControl('dmpBlueprintValues', dmpBlueprintValuesFormGroup);
|
||||
|
@ -734,7 +737,7 @@ export class DmpDescriptionTemplateEditorModel implements DmpDescriptionTemplate
|
|||
}
|
||||
|
||||
export class DmpFieldIndicator {
|
||||
|
||||
|
||||
private _fieldControlNames;
|
||||
|
||||
get fieldControlNames(): string[] {
|
||||
|
@ -747,7 +750,7 @@ export class DmpFieldIndicator {
|
|||
if (section.hasTemplates) {
|
||||
this._fieldControlNames.push(`descriptionTemplates.${section.id}`);
|
||||
} else {
|
||||
section.fields.forEach((field: FieldInSection) => {
|
||||
section.fields.forEach((field: FieldInSection) => {
|
||||
switch (field.category) {
|
||||
case DmpBlueprintFieldCategory.System:
|
||||
this.buildSystemField(field as SystemFieldInSection);
|
||||
|
@ -785,7 +788,7 @@ export class DmpFieldIndicator {
|
|||
break;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
buildReferenceTypeField(field: ReferenceTypeFieldInSection): void {
|
||||
if (field.multipleSelect) {
|
||||
this._fieldControlNames.push(`properties.dmpBlueprintValues.${field.id}.references`);
|
||||
|
@ -793,7 +796,7 @@ export class DmpFieldIndicator {
|
|||
this._fieldControlNames.push(`properties.dmpBlueprintValues.${field.id}.reference`);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
buildExtraField(field: ExtraFieldInSection): void {
|
||||
this._fieldControlNames.push(`properties.dmpBlueprintValues.${field.id}.fieldValue`);
|
||||
}
|
||||
|
|
|
@ -43,9 +43,9 @@
|
|||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row" *ngIf="(canEditDmp() && !isLocked) || canCloneDmp() || (canDeleteDmp() && !isLocked)">
|
||||
<div class="row" *ngIf="(isDraftDmp(dmp) && !lockStatus) || canCloneDmp() || (canDeleteDmp() && !isLocked)">
|
||||
<!-- <button *ngIf="isDraftDmp(dmp) && isDmpOwner(dmp) && !isLocked" (click)="editClicked(dmp)" mat-mini-fab class="mr-3 d-flex justify-content-center align-items-center" matTooltip="{{'DMP-OVERVIEW.ACTIONS.EDIT' | translate}}" matTooltipPosition="above"> -->
|
||||
<div *ngIf="canEditDmp() && !isLocked" class="col-auto pr-0">
|
||||
<div *ngIf="isDraftDmp(dmp) && !lockStatus" class="col-auto pr-0">
|
||||
<button (click)="editClicked()" mat-mini-fab class="d-flex justify-content-center align-items-center" matTooltip="{{'DMP-OVERVIEW.ACTIONS.EDIT' | translate}}" matTooltipPosition="above">
|
||||
<mat-icon class="mat-mini-fab-icon">create</mat-icon>
|
||||
</button>
|
||||
|
|
Loading…
Reference in New Issue