mirror of
https://github.com/DSpace/dspace-angular.git
synced 2025-10-07 01:54:15 +00:00
Update item-status.component.ts
Fix initialOperations typo and return ops with register doi op
(cherry picked from commit e77898eaac
)
This commit is contained in:

committed by
github-actions[bot]
![github-actions[bot]](/assets/img/avatar_default.png)
parent
972c1098cb
commit
9f99555c64
@@ -117,7 +117,7 @@ export class ItemStatusComponent implements OnInit {
|
||||
* The value is supposed to be a href for the button
|
||||
*/
|
||||
const currentUrl = this.getCurrentUrl(item);
|
||||
const inititalOperations: ItemOperation[] = [
|
||||
const initialOperations: ItemOperation[] = [
|
||||
new ItemOperation('authorizations', `${currentUrl}/authorizations`, FeatureID.CanManagePolicies, true),
|
||||
new ItemOperation('mappedCollections', `${currentUrl}/mapper`, FeatureID.CanManageMappings, true),
|
||||
item.isWithdrawn
|
||||
@@ -130,7 +130,7 @@ export class ItemStatusComponent implements OnInit {
|
||||
new ItemOperation('delete', `${currentUrl}/delete`, FeatureID.CanDelete, true)
|
||||
];
|
||||
|
||||
this.operations$.next(inititalOperations);
|
||||
this.operations$.next(initialOperations);
|
||||
|
||||
/**
|
||||
* When the identifier data stream changes, determine whether the register DOI button should be shown or not.
|
||||
@@ -170,12 +170,12 @@ export class ItemStatusComponent implements OnInit {
|
||||
}),
|
||||
// Switch map pushes the register DOI operation onto a copy of the base array then returns to the pipe
|
||||
switchMap((showDoi: boolean) => {
|
||||
const ops = [...inititalOperations];
|
||||
const ops = [...initialOperations];
|
||||
if (showDoi) {
|
||||
const op = new ItemOperation('register-doi', `${currentUrl}/register-doi`, FeatureID.CanRegisterDOI, true);
|
||||
ops.splice(ops.length - 1, 0, op); // Add item before last
|
||||
}
|
||||
return inititalOperations;
|
||||
return ops;
|
||||
}),
|
||||
concatMap((op: ItemOperation) => {
|
||||
if (hasValue(op.featureID)) {
|
||||
|
Reference in New Issue
Block a user