98376: Fixed collection-roles page for collections with single workflowGroup

This commit is contained in:
Alexandre Vryghem
2023-01-10 17:56:32 +01:00
parent 36891ef3bf
commit ef9373baec
2 changed files with 31 additions and 19 deletions

View File

@@ -6,6 +6,7 @@ import { RemoteData } from '../../../core/data/remote-data';
import { Collection } from '../../../core/shared/collection.model'; import { Collection } from '../../../core/shared/collection.model';
import { getRemoteDataPayload, getFirstSucceededRemoteData } from '../../../core/shared/operators'; import { getRemoteDataPayload, getFirstSucceededRemoteData } from '../../../core/shared/operators';
import { HALLink } from '../../../core/shared/hal-link.model'; import { HALLink } from '../../../core/shared/hal-link.model';
import { hasValue } from '../../../shared/empty.util';
/** /**
* Component for managing a collection's roles * Component for managing a collection's roles
@@ -45,25 +46,31 @@ export class CollectionRolesComponent implements OnInit {
); );
this.comcolRoles$ = this.collection$.pipe( this.comcolRoles$ = this.collection$.pipe(
map((collection) => [ map((collection) => {
{ let workflowGroups: HALLink[] | HALLink = hasValue(collection._links.workflowGroups) ? collection._links.workflowGroups : [];
name: 'collection-admin', if (!Array.isArray(workflowGroups)) {
href: collection._links.adminGroup.href, workflowGroups = [workflowGroups];
}, }
{ return [
name: 'submitters', {
href: collection._links.submittersGroup.href, name: 'collection-admin',
}, href: collection._links.adminGroup.href,
{ },
name: 'item_read', {
href: collection._links.itemReadGroup.href, name: 'submitters',
}, href: collection._links.submittersGroup.href,
{ },
name: 'bitstream_read', {
href: collection._links.bitstreamReadGroup.href, name: 'item_read',
}, href: collection._links.itemReadGroup.href,
...(collection._links.workflowGroups ? collection._links.workflowGroups : []), },
]), {
name: 'bitstream_read',
href: collection._links.bitstreamReadGroup.href,
},
...workflowGroups,
];
}),
); );
} }
} }

View File

@@ -1179,6 +1179,11 @@
"comcol-role.edit.reviewer.description": "Reviewers are able to accept or reject incoming submissions. However, they are not able to edit the submission's metadata.", "comcol-role.edit.reviewer.description": "Reviewers are able to accept or reject incoming submissions. However, they are not able to edit the submission's metadata.",
"comcol-role.edit.scorereviewers.name": "Score Reviewers",
"comcol-role.edit.scorereviewers.description": "Reviewers are able to give a score to incoming submissions, this will define whether the submission will be rejected or not.",
"community.form.abstract": "Short Description", "community.form.abstract": "Short Description",