mirror of
https://github.com/DSpace/dspace-angular.git
synced 2025-10-07 01:54:15 +00:00
Merge pull request #2143 from CrisGuzmanS/issues/2140
disabled the posibility to change the collection for workflow items to prevent errors
This commit is contained in:
@@ -5,5 +5,6 @@
|
||||
[submissionDefinition]="submissionDefinition"
|
||||
[submissionErrors]="submissionErrors"
|
||||
[item]="item"
|
||||
[collectionModifiable]="collectionModifiable"
|
||||
[submissionId]="submissionId"></ds-submission-form>
|
||||
</div>
|
||||
|
@@ -36,6 +36,13 @@ export class SubmissionEditComponent implements OnDestroy, OnInit {
|
||||
*/
|
||||
public collectionId: string;
|
||||
|
||||
/**
|
||||
* Checks if the collection can be modifiable by the user
|
||||
* @type {booelan}
|
||||
*/
|
||||
public collectionModifiable: boolean | null = null;
|
||||
|
||||
|
||||
/**
|
||||
* The list of submission's sections
|
||||
* @type {WorkspaceitemSectionsObject}
|
||||
@@ -109,6 +116,9 @@ export class SubmissionEditComponent implements OnDestroy, OnInit {
|
||||
* Retrieve workspaceitem/workflowitem from server and initialize all instance variables
|
||||
*/
|
||||
ngOnInit() {
|
||||
|
||||
this.collectionModifiable = this.route.snapshot.data?.collectionModifiable ?? null;
|
||||
|
||||
this.subs.push(
|
||||
this.route.paramMap.pipe(
|
||||
switchMap((params: ParamMap) => this.submissionService.retrieveSubmission(params.get('id'))),
|
||||
|
@@ -25,7 +25,7 @@
|
||||
class="btn btn-outline-primary"
|
||||
(blur)="onClose()"
|
||||
(click)="onClose()"
|
||||
[disabled]="(processingChange$ | async)"
|
||||
[disabled]="(processingChange$ | async) || collectionModifiable == false"
|
||||
ngbDropdownToggle>
|
||||
<span *ngIf="(processingChange$ | async)"><i class='fas fa-circle-notch fa-spin'></i></span>
|
||||
<span *ngIf="!(processingChange$ | async)">{{ selectedCollectionName$ | async }}</span>
|
||||
|
@@ -52,6 +52,12 @@ export class SubmissionFormCollectionComponent implements OnChanges, OnInit {
|
||||
*/
|
||||
@Input() currentDefinition: string;
|
||||
|
||||
/**
|
||||
* Checks if the collection can be modifiable by the user
|
||||
* @type {booelan}
|
||||
*/
|
||||
@Input() collectionModifiable: boolean | null = null;
|
||||
|
||||
/**
|
||||
* The submission id
|
||||
* @type {string}
|
||||
|
@@ -11,6 +11,7 @@
|
||||
<ds-submission-form-collection [currentCollectionId]="collectionId"
|
||||
[currentDefinition]="definitionId"
|
||||
[submissionId]="submissionId"
|
||||
[collectionModifiable]="collectionModifiable"
|
||||
(collectionChange)="onCollectionChange($event)">
|
||||
</ds-submission-form-collection>
|
||||
</div>
|
||||
|
@@ -34,8 +34,16 @@ export class SubmissionFormComponent implements OnChanges, OnDestroy {
|
||||
* @type {string}
|
||||
*/
|
||||
@Input() collectionId: string;
|
||||
|
||||
@Input() item: Item;
|
||||
|
||||
/**
|
||||
* Checks if the collection can be modifiable by the user
|
||||
* @type {booelan}
|
||||
*/
|
||||
@Input() collectionModifiable: boolean | null = null;
|
||||
|
||||
|
||||
/**
|
||||
* The list of submission's sections
|
||||
* @type {WorkspaceitemSectionsObject}
|
||||
|
@@ -34,7 +34,11 @@ import {
|
||||
resolve: {
|
||||
breadcrumb: I18nBreadcrumbResolver
|
||||
},
|
||||
data: { title: 'workflow-item.edit.title', breadcrumbKey: 'workflow-item.edit' }
|
||||
data: {
|
||||
title: 'workflow-item.edit.title',
|
||||
breadcrumbKey: 'workflow-item.edit',
|
||||
collectionModifiable: false
|
||||
}
|
||||
},
|
||||
{
|
||||
canActivate: [AuthenticatedGuard],
|
||||
|
Reference in New Issue
Block a user