Merge remote-tracking branch 'remotes/origin/master' into #601-resource-policies

This commit is contained in:
Giuseppe Digilio
2020-04-23 17:05:38 +02:00
25 changed files with 26153 additions and 5390 deletions

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@@ -761,11 +761,59 @@
"community.edit.tabs.roles.title": "Community Edit - Roles",
"community.edit.tabs.roles.none": "None",
"community.edit.tabs.roles.admin.name": "Administrators",
"community.edit.tabs.roles.admin.description": "Community administrators can create sub-communities or collections, and manage or assign management for those sub-communities or collections. In addition, they decide who can submit items to any sub-collections, edit item metadata (after submission), and add (map) existing items from other collections (subject to authorization).",
"comcol-role.edit.no-group": "None",
"comcol-role.edit.create": "Create",
"comcol-role.edit.restrict": "Restrict",
"comcol-role.edit.delete": "Delete",
"comcol-role.edit.community-admin.name": "Administrators",
"comcol-role.edit.collection-admin.name": "Administrators",
"comcol-role.edit.community-admin.description": "Community administrators can create sub-communities or collections, and manage or assign management for those sub-communities or collections. In addition, they decide who can submit items to any sub-collections, edit item metadata (after submission), and add (map) existing items from other collections (subject to authorization).",
"comcol-role.edit.collection-admin.description": "Collection administrators decide who can submit items to the collection, edit item metadata (after submission), and add (map) existing items from other collections to this collection (subject to authorization for that collection).",
"comcol-role.edit.submitters.name": "Submitters",
"comcol-role.edit.submitters.description": "The E-People and Groups that have permission to submit new items to this collection.",
"comcol-role.edit.item_read.name": "Default item read access",
"comcol-role.edit.item_read.description": "E-People and Groups that can read new items submitted to this collection. Changes to this role are not retroactive. Existing items in the system will still be viewable by those who had read access at the time of their addition.",
"comcol-role.edit.item_read.anonymous-group": "Default read for incoming items is currently set to Anonymous.",
"comcol-role.edit.bitstream_read.name": "Default bitstream read access",
"comcol-role.edit.bitstream_read.description": "Community administrators can create sub-communities or collections, and manage or assign management for those sub-communities or collections. In addition, they decide who can submit items to any sub-collections, edit item metadata (after submission), and add (map) existing items from other collections (subject to authorization).",
"comcol-role.edit.bitstream_read.anonymous-group": "Default read for incoming bitstreams is currently set to Anonymous.",
"comcol-role.edit.editor.name": "Editors",
"comcol-role.edit.editor.description": "Editors are able to edit the metadata of incoming submissions, and then accept or reject them.",
"comcol-role.edit.finaleditor.name": "Final editors",
"comcol-role.edit.finaleditor.description": "Final editors are able to edit the metadata of incoming submissions, but will not be able to reject them.",
"comcol-role.edit.reviewer.name": "Reviewers",
"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.",

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@@ -56,7 +56,8 @@
// "admin.registries.bitstream-formats.edit.extensions.label": "File extensions",
"admin.registries.bitstream-formats.edit.extensions.label": "Faila paplašinājums",
// "admin.registries.bitstream-formats.edit.extensions.placeholder": "Enter a file extenstion without the dot",
// "admin.registries.bitstream-formats.edit.extensions.placeholder": "Enter a file extension without the dot",
// TODO Source message changed - Revise the translation
"admin.registries.bitstream-formats.edit.extensions.placeholder": "Ievadiet faila paplašinājumu bez punkta",
// "admin.registries.bitstream-formats.edit.failure.content": "An error occurred while editing the bitstream format.",
@@ -260,15 +261,16 @@
// "admin.access-control.epeople.search.head": "Search",
"admin.access-control.epeople.search.head": "Meklēt",
// "admin.access-control.epeople.search.scope.name": "Name",
"admin.access-control.epeople.search.scope.name": "Vārds",
// "admin.access-control.epeople.search.scope.email": "E-mail (exact)",
"admin.access-control.epeople.search.scope.email": "E-pasts (pilns)",
// "admin.access-control.epeople.button.see-all": "Browse All",
// TODO New key - Add a translation
"admin.access-control.epeople.button.see-all": "Browse All",
// "admin.access-control.epeople.search.scope.metadata": "Metadata",
"admin.access-control.epeople.search.scope.metadata": "Metadati",
// "admin.access-control.epeople.search.scope.email": "E-mail (exact)",
"admin.access-control.epeople.search.scope.email": "E-pasts (pilns)",
// "admin.access-control.epeople.search.button": "Search",
"admin.access-control.epeople.search.button": "Meklēt",
@@ -281,17 +283,20 @@
// "admin.access-control.epeople.table.name": "Name",
"admin.access-control.epeople.table.name": "Lietotājs",
// "admin.access-control.epeople.table.email": "E-mail",
// "admin.access-control.epeople.table.email": "E-mail (exact)",
// TODO Source message changed - Revise the translation
"admin.access-control.epeople.table.email": "E-pasts",
// "admin.access-control.epeople.table.edit": "Edit",
"admin.access-control.epeople.table.edit": "Rediģēt",
// "item.access-control.epeople.table.edit.buttons.edit": "Edit",
"item.access-control.epeople.table.edit.buttons.edit": "Rediģēt",
// "admin.access-control.epeople.table.edit.buttons.edit": "Edit \"{{name}}\"",
// TODO New key - Add a translation
"admin.access-control.epeople.table.edit.buttons.edit": "Edit \"{{name}}\"",
// "item.access-control.epeople.table.edit.buttons.remove": "Remove",
"item.access-control.epeople.table.edit.buttons.remove": "Dzēst",
// "admin.access-control.epeople.table.edit.buttons.remove": "Delete \"{{name}}\"",
// TODO New key - Add a translation
"admin.access-control.epeople.table.edit.buttons.remove": "Delete \"{{name}}\"",
// "admin.access-control.epeople.no-items": "No EPeople to show.",
"admin.access-control.epeople.no-items": "Nav pieejamas EPersonas.",
@@ -338,6 +343,26 @@
// "admin.access-control.epeople.form.notification.edited.failure": "Failed to edit EPerson \"{{name}}\"",
"admin.access-control.epeople.form.notification.edited.failure": "Neizdevās rediģēt EPerosnu \"{{name}}\"",
// "admin.access-control.epeople.form.groupsEPersonIsMemberOf": "Member of these groups:",
// TODO New key - Add a translation
"admin.access-control.epeople.form.groupsEPersonIsMemberOf": "Member of these groups:",
// "admin.access-control.epeople.form.table.id": "ID",
// TODO New key - Add a translation
"admin.access-control.epeople.form.table.id": "ID",
// "admin.access-control.epeople.form.table.name": "Name",
// TODO New key - Add a translation
"admin.access-control.epeople.form.table.name": "Name",
// "admin.access-control.epeople.form.memberOfNoGroups": "This EPerson is not a member of any groups",
// TODO New key - Add a translation
"admin.access-control.epeople.form.memberOfNoGroups": "This EPerson is not a member of any groups",
// "admin.access-control.epeople.form.goToGroups": "Add to groups",
// TODO New key - Add a translation
"admin.access-control.epeople.form.goToGroups": "Add to groups",
// "admin.access-control.epeople.notification.deleted.failure": "Failed to delete EPerson: \"{{name}}\"",
"admin.access-control.epeople.notification.deleted.failure": "Neizdevās dzēst EPersonu: \"{{name}}\"",
@@ -346,6 +371,257 @@
// "admin.access-control.groups.title": "DSpace Angular :: Groups",
// TODO New key - Add a translation
"admin.access-control.groups.title": "DSpace Angular :: Groups",
// "admin.access-control.groups.head": "Groups",
// TODO New key - Add a translation
"admin.access-control.groups.head": "Groups",
// "admin.access-control.groups.button.add": "Add group",
// TODO New key - Add a translation
"admin.access-control.groups.button.add": "Add group",
// "admin.access-control.groups.search.head": "Search groups",
// TODO New key - Add a translation
"admin.access-control.groups.search.head": "Search groups",
// "admin.access-control.groups.button.see-all": "Browse all",
// TODO New key - Add a translation
"admin.access-control.groups.button.see-all": "Browse all",
// "admin.access-control.groups.search.button": "Search",
// TODO New key - Add a translation
"admin.access-control.groups.search.button": "Search",
// "admin.access-control.groups.table.id": "ID",
// TODO New key - Add a translation
"admin.access-control.groups.table.id": "ID",
// "admin.access-control.groups.table.name": "Name",
// TODO New key - Add a translation
"admin.access-control.groups.table.name": "Name",
// "admin.access-control.groups.table.members": "Members",
// TODO New key - Add a translation
"admin.access-control.groups.table.members": "Members",
// "admin.access-control.groups.table.comcol": "Community / Collection",
// TODO New key - Add a translation
"admin.access-control.groups.table.comcol": "Community / Collection",
// "admin.access-control.groups.table.edit": "Edit",
// TODO New key - Add a translation
"admin.access-control.groups.table.edit": "Edit",
// "admin.access-control.groups.table.edit.buttons.edit": "Edit \"{{name}}\"",
// TODO New key - Add a translation
"admin.access-control.groups.table.edit.buttons.edit": "Edit \"{{name}}\"",
// "admin.access-control.groups.table.edit.buttons.remove": "Delete \"{{name}}\"",
// TODO New key - Add a translation
"admin.access-control.groups.table.edit.buttons.remove": "Delete \"{{name}}\"",
// "admin.access-control.groups.no-items": "No groups found with this in their name or this as UUID",
// TODO New key - Add a translation
"admin.access-control.groups.no-items": "No groups found with this in their name or this as UUID",
// "admin.access-control.groups.notification.deleted.success": "Successfully deleted group \"{{name}}\"",
// TODO New key - Add a translation
"admin.access-control.groups.notification.deleted.success": "Successfully deleted group \"{{name}}\"",
// "admin.access-control.groups.notification.deleted.failure": "Failed to delete group \"{{name}}\"",
// TODO New key - Add a translation
"admin.access-control.groups.notification.deleted.failure": "Failed to delete group \"{{name}}\"",
// "admin.access-control.groups.form.head.create": "Create group",
// TODO New key - Add a translation
"admin.access-control.groups.form.head.create": "Create group",
// "admin.access-control.groups.form.head.edit": "Edit group",
// TODO New key - Add a translation
"admin.access-control.groups.form.head.edit": "Edit group",
// "admin.access-control.groups.form.groupName": "Group name",
// TODO New key - Add a translation
"admin.access-control.groups.form.groupName": "Group name",
// "admin.access-control.groups.form.groupDescription": "Description",
// TODO New key - Add a translation
"admin.access-control.groups.form.groupDescription": "Description",
// "admin.access-control.groups.form.notification.created.success": "Successfully created Group \"{{name}}\"",
// TODO New key - Add a translation
"admin.access-control.groups.form.notification.created.success": "Successfully created Group \"{{name}}\"",
// "admin.access-control.groups.form.notification.created.failure": "Failed to create Group \"{{name}}\"",
// TODO New key - Add a translation
"admin.access-control.groups.form.notification.created.failure": "Failed to create Group \"{{name}}\"",
// "admin.access-control.groups.form.notification.created.failure.groupNameInUse": "Failed to create Group with name: \"{{name}}\", make sure the name is not already in use.",
// TODO New key - Add a translation
"admin.access-control.groups.form.notification.created.failure.groupNameInUse": "Failed to create Group with name: \"{{name}}\", make sure the name is not already in use.",
// "admin.access-control.groups.form.members-list.head": "EPeople",
// TODO New key - Add a translation
"admin.access-control.groups.form.members-list.head": "EPeople",
// "admin.access-control.groups.form.members-list.search.head": "Add EPeople",
// TODO New key - Add a translation
"admin.access-control.groups.form.members-list.search.head": "Add EPeople",
// "admin.access-control.groups.form.members-list.button.see-all": "Browse All",
// TODO New key - Add a translation
"admin.access-control.groups.form.members-list.button.see-all": "Browse All",
// "admin.access-control.groups.form.members-list.headMembers": "Current Members",
// TODO New key - Add a translation
"admin.access-control.groups.form.members-list.headMembers": "Current Members",
// "admin.access-control.groups.form.members-list.search.scope.metadata": "Metadata",
// TODO New key - Add a translation
"admin.access-control.groups.form.members-list.search.scope.metadata": "Metadata",
// "admin.access-control.groups.form.members-list.search.scope.email": "E-mail (exact)",
// TODO New key - Add a translation
"admin.access-control.groups.form.members-list.search.scope.email": "E-mail (exact)",
// "admin.access-control.groups.form.members-list.search.button": "Search",
// TODO New key - Add a translation
"admin.access-control.groups.form.members-list.search.button": "Search",
// "admin.access-control.groups.form.members-list.table.id": "ID",
// TODO New key - Add a translation
"admin.access-control.groups.form.members-list.table.id": "ID",
// "admin.access-control.groups.form.members-list.table.name": "Name",
// TODO New key - Add a translation
"admin.access-control.groups.form.members-list.table.name": "Name",
// "admin.access-control.groups.form.members-list.table.edit": "Remove / Add",
// TODO New key - Add a translation
"admin.access-control.groups.form.members-list.table.edit": "Remove / Add",
// "admin.access-control.groups.form.members-list.table.edit.buttons.remove": "Remove member with name \"{{name}}\"",
// TODO New key - Add a translation
"admin.access-control.groups.form.members-list.table.edit.buttons.remove": "Remove member with name \"{{name}}\"",
// "admin.access-control.groups.form.members-list.notification.success.addMember": "Successfully added member: \"{{name}}\"",
// TODO New key - Add a translation
"admin.access-control.groups.form.members-list.notification.success.addMember": "Successfully added member: \"{{name}}\"",
// "admin.access-control.groups.form.members-list.notification.failure.addMember": "Failed to add member: \"{{name}}\"",
// TODO New key - Add a translation
"admin.access-control.groups.form.members-list.notification.failure.addMember": "Failed to add member: \"{{name}}\"",
// "admin.access-control.groups.form.members-list.notification.success.deleteMember": "Successfully deleted member: \"{{name}}\"",
// TODO New key - Add a translation
"admin.access-control.groups.form.members-list.notification.success.deleteMember": "Successfully deleted member: \"{{name}}\"",
// "admin.access-control.groups.form.members-list.notification.failure.deleteMember": "Failed to delete member: \"{{name}}\"",
// TODO New key - Add a translation
"admin.access-control.groups.form.members-list.notification.failure.deleteMember": "Failed to delete member: \"{{name}}\"",
// "admin.access-control.groups.form.members-list.table.edit.buttons.add": "Add member with name \"{{name}}\"",
// TODO New key - Add a translation
"admin.access-control.groups.form.members-list.table.edit.buttons.add": "Add member with name \"{{name}}\"",
// "admin.access-control.groups.form.members-list.notification.failure.noActiveGroup": "No current active group, submit a name first.",
// TODO New key - Add a translation
"admin.access-control.groups.form.members-list.notification.failure.noActiveGroup": "No current active group, submit a name first.",
// "admin.access-control.groups.form.members-list.no-members-yet": "No members in group yet, search and add.",
// TODO New key - Add a translation
"admin.access-control.groups.form.members-list.no-members-yet": "No members in group yet, search and add.",
// "admin.access-control.groups.form.members-list.no-items": "No EPeople found in that search",
// TODO New key - Add a translation
"admin.access-control.groups.form.members-list.no-items": "No EPeople found in that search",
// "admin.access-control.groups.form.subgroups-list.head": "Groups",
// TODO New key - Add a translation
"admin.access-control.groups.form.subgroups-list.head": "Groups",
// "admin.access-control.groups.form.subgroups-list.search.head": "Add Subgroup",
// TODO New key - Add a translation
"admin.access-control.groups.form.subgroups-list.search.head": "Add Subgroup",
// "admin.access-control.groups.form.subgroups-list.button.see-all": "Browse All",
// TODO New key - Add a translation
"admin.access-control.groups.form.subgroups-list.button.see-all": "Browse All",
// "admin.access-control.groups.form.subgroups-list.headSubgroups": "Current Subgroups",
// TODO New key - Add a translation
"admin.access-control.groups.form.subgroups-list.headSubgroups": "Current Subgroups",
// "admin.access-control.groups.form.subgroups-list.search.button": "Search",
// TODO New key - Add a translation
"admin.access-control.groups.form.subgroups-list.search.button": "Search",
// "admin.access-control.groups.form.subgroups-list.table.id": "ID",
// TODO New key - Add a translation
"admin.access-control.groups.form.subgroups-list.table.id": "ID",
// "admin.access-control.groups.form.subgroups-list.table.name": "Name",
// TODO New key - Add a translation
"admin.access-control.groups.form.subgroups-list.table.name": "Name",
// "admin.access-control.groups.form.subgroups-list.table.edit": "Remove / Add",
// TODO New key - Add a translation
"admin.access-control.groups.form.subgroups-list.table.edit": "Remove / Add",
// "admin.access-control.groups.form.subgroups-list.table.edit.buttons.remove": "Remove subgroup with name \"{{name}}\"",
// TODO New key - Add a translation
"admin.access-control.groups.form.subgroups-list.table.edit.buttons.remove": "Remove subgroup with name \"{{name}}\"",
// "admin.access-control.groups.form.subgroups-list.table.edit.buttons.add": "Add subgroup with name \"{{name}}\"",
// TODO New key - Add a translation
"admin.access-control.groups.form.subgroups-list.table.edit.buttons.add": "Add subgroup with name \"{{name}}\"",
// "admin.access-control.groups.form.subgroups-list.table.edit.currentGroup": "Current group",
// TODO New key - Add a translation
"admin.access-control.groups.form.subgroups-list.table.edit.currentGroup": "Current group",
// "admin.access-control.groups.form.subgroups-list.notification.success.addSubgroup": "Successfully added subgroup: \"{{name}}\"",
// TODO New key - Add a translation
"admin.access-control.groups.form.subgroups-list.notification.success.addSubgroup": "Successfully added subgroup: \"{{name}}\"",
// "admin.access-control.groups.form.subgroups-list.notification.failure.addSubgroup": "Failed to add subgroup: \"{{name}}\"",
// TODO New key - Add a translation
"admin.access-control.groups.form.subgroups-list.notification.failure.addSubgroup": "Failed to add subgroup: \"{{name}}\"",
// "admin.access-control.groups.form.subgroups-list.notification.success.deleteSubgroup": "Successfully deleted subgroup: \"{{name}}\"",
// TODO New key - Add a translation
"admin.access-control.groups.form.subgroups-list.notification.success.deleteSubgroup": "Successfully deleted subgroup: \"{{name}}\"",
// "admin.access-control.groups.form.subgroups-list.notification.failure.deleteSubgroup": "Failed to delete subgroup: \"{{name}}\"",
// TODO New key - Add a translation
"admin.access-control.groups.form.subgroups-list.notification.failure.deleteSubgroup": "Failed to delete subgroup: \"{{name}}\"",
// "admin.access-control.groups.form.subgroups-list.notification.failure.noActiveGroup": "No current active group, submit a name first.",
// TODO New key - Add a translation
"admin.access-control.groups.form.subgroups-list.notification.failure.noActiveGroup": "No current active group, submit a name first.",
// "admin.access-control.groups.form.subgroups-list.notification.failure.subgroupToAddIsActiveGroup": "This is the current group, can't be added.",
// TODO New key - Add a translation
"admin.access-control.groups.form.subgroups-list.notification.failure.subgroupToAddIsActiveGroup": "This is the current group, can't be added.",
// "admin.access-control.groups.form.subgroups-list.no-items": "No groups found with this in their name or this as UUID",
// TODO New key - Add a translation
"admin.access-control.groups.form.subgroups-list.no-items": "No groups found with this in their name or this as UUID",
// "admin.access-control.groups.form.subgroups-list.no-subgroups-yet": "No subgroups in group yet.",
// TODO New key - Add a translation
"admin.access-control.groups.form.subgroups-list.no-subgroups-yet": "No subgroups in group yet.",
// "admin.access-control.groups.form.return": "Return to groups",
// TODO New key - Add a translation
"admin.access-control.groups.form.return": "Return to groups",
// "admin.search.breadcrumbs": "Administrative Search",
"admin.search.breadcrumbs": "Administratīvā Meklēšana",
@@ -395,6 +671,76 @@
// "bitstream.edit.bitstream": "Bitstream: ",
// TODO New key - Add a translation
"bitstream.edit.bitstream": "Bitstream: ",
// "bitstream.edit.form.description.hint": "Optionally, provide a brief description of the file, for example \"<i>Main article</i>\" or \"<i>Experiment data readings</i>\".",
// TODO New key - Add a translation
"bitstream.edit.form.description.hint": "Optionally, provide a brief description of the file, for example \"<i>Main article</i>\" or \"<i>Experiment data readings</i>\".",
// "bitstream.edit.form.description.label": "Description",
// TODO New key - Add a translation
"bitstream.edit.form.description.label": "Description",
// "bitstream.edit.form.embargo.hint": "The first day from which access is allowed. <b>This date cannot be modified on this form.</b> To set an embargo date for a bitstream, go to the <i>Item Status</i> tab, click <i>Authorizations...</i>, create or edit the bitstream's <i>READ</i> policy, and set the <i>Start Date</i> as desired.",
// TODO New key - Add a translation
"bitstream.edit.form.embargo.hint": "The first day from which access is allowed. <b>This date cannot be modified on this form.</b> To set an embargo date for a bitstream, go to the <i>Item Status</i> tab, click <i>Authorizations...</i>, create or edit the bitstream's <i>READ</i> policy, and set the <i>Start Date</i> as desired.",
// "bitstream.edit.form.embargo.label": "Embargo until specific date",
// TODO New key - Add a translation
"bitstream.edit.form.embargo.label": "Embargo until specific date",
// "bitstream.edit.form.fileName.hint": "Change the filename for the bitstream. Note that this will change the display bitstream URL, but old links will still resolve as long as the sequence ID does not change.",
// TODO New key - Add a translation
"bitstream.edit.form.fileName.hint": "Change the filename for the bitstream. Note that this will change the display bitstream URL, but old links will still resolve as long as the sequence ID does not change.",
// "bitstream.edit.form.fileName.label": "Filename",
// TODO New key - Add a translation
"bitstream.edit.form.fileName.label": "Filename",
// "bitstream.edit.form.newFormat.label": "Describe new format",
// TODO New key - Add a translation
"bitstream.edit.form.newFormat.label": "Describe new format",
// "bitstream.edit.form.newFormat.hint": "The application you used to create the file, and the version number (for example, \"<i>ACMESoft SuperApp version 1.5</i>\").",
// TODO New key - Add a translation
"bitstream.edit.form.newFormat.hint": "The application you used to create the file, and the version number (for example, \"<i>ACMESoft SuperApp version 1.5</i>\").",
// "bitstream.edit.form.primaryBitstream.label": "Primary bitstream",
// TODO New key - Add a translation
"bitstream.edit.form.primaryBitstream.label": "Primary bitstream",
// "bitstream.edit.form.selectedFormat.hint": "If the format is not in the above list, <b>select \"format not in list\" above</b> and describe it under \"Describe new format\".",
// TODO New key - Add a translation
"bitstream.edit.form.selectedFormat.hint": "If the format is not in the above list, <b>select \"format not in list\" above</b> and describe it under \"Describe new format\".",
// "bitstream.edit.form.selectedFormat.label": "Selected Format",
// TODO New key - Add a translation
"bitstream.edit.form.selectedFormat.label": "Selected Format",
// "bitstream.edit.form.selectedFormat.unknown": "Format not in list",
// TODO New key - Add a translation
"bitstream.edit.form.selectedFormat.unknown": "Format not in list",
// "bitstream.edit.notifications.error.format.title": "An error occurred saving the bitstream's format",
// TODO New key - Add a translation
"bitstream.edit.notifications.error.format.title": "An error occurred saving the bitstream's format",
// "bitstream.edit.notifications.saved.content": "Your changes to this bitstream were saved.",
// TODO New key - Add a translation
"bitstream.edit.notifications.saved.content": "Your changes to this bitstream were saved.",
// "bitstream.edit.notifications.saved.title": "Bitstream saved",
// TODO New key - Add a translation
"bitstream.edit.notifications.saved.title": "Bitstream saved",
// "bitstream.edit.title": "Edit bitstream",
// TODO New key - Add a translation
"bitstream.edit.title": "Edit bitstream",
// "browse.comcol.by.author": "By Author",
"browse.comcol.by.author": "Pēc Autora",
@@ -932,6 +1278,10 @@
// "error.bitstream": "Error fetching bitstream",
// TODO New key - Add a translation
"error.bitstream": "Error fetching bitstream",
// "error.browse-by": "Error fetching items",
"error.browse-by": "Materiālu ielasīšanas kļūda",
@@ -1089,6 +1439,175 @@
// "item.bitstreams.upload.bundle": "Bundle",
// TODO New key - Add a translation
"item.bitstreams.upload.bundle": "Bundle",
// "item.bitstreams.upload.bundle.placeholder": "Select a bundle",
// TODO New key - Add a translation
"item.bitstreams.upload.bundle.placeholder": "Select a bundle",
// "item.bitstreams.upload.bundle.new": "Create bundle",
// TODO New key - Add a translation
"item.bitstreams.upload.bundle.new": "Create bundle",
// "item.bitstreams.upload.bundles.empty": "This item doesn\'t contain any bundles to upload a bitstream to.",
// TODO New key - Add a translation
"item.bitstreams.upload.bundles.empty": "This item doesn\'t contain any bundles to upload a bitstream to.",
// "item.bitstreams.upload.cancel": "Cancel",
// TODO New key - Add a translation
"item.bitstreams.upload.cancel": "Cancel",
// "item.bitstreams.upload.drop-message": "Drop a file to upload",
// TODO New key - Add a translation
"item.bitstreams.upload.drop-message": "Drop a file to upload",
// "item.bitstreams.upload.item": "Item: ",
// TODO New key - Add a translation
"item.bitstreams.upload.item": "Item: ",
// "item.bitstreams.upload.notifications.bundle.created.content": "Successfully created new bundle.",
// TODO New key - Add a translation
"item.bitstreams.upload.notifications.bundle.created.content": "Successfully created new bundle.",
// "item.bitstreams.upload.notifications.bundle.created.title": "Created bundle",
// TODO New key - Add a translation
"item.bitstreams.upload.notifications.bundle.created.title": "Created bundle",
// "item.bitstreams.upload.notifications.upload.failed": "Upload failed. Please verify the content before retrying.",
// TODO New key - Add a translation
"item.bitstreams.upload.notifications.upload.failed": "Upload failed. Please verify the content before retrying.",
// "item.bitstreams.upload.title": "Upload bitstream",
// TODO New key - Add a translation
"item.bitstreams.upload.title": "Upload bitstream",
// "item.edit.bitstreams.bundle.edit.buttons.upload": "Upload",
// TODO New key - Add a translation
"item.edit.bitstreams.bundle.edit.buttons.upload": "Upload",
// "item.edit.bitstreams.bundle.displaying": "Currently displaying {{ amount }} bitstreams of {{ total }}.",
// TODO New key - Add a translation
"item.edit.bitstreams.bundle.displaying": "Currently displaying {{ amount }} bitstreams of {{ total }}.",
// "item.edit.bitstreams.bundle.load.all": "Load all ({{ total }})",
// TODO New key - Add a translation
"item.edit.bitstreams.bundle.load.all": "Load all ({{ total }})",
// "item.edit.bitstreams.bundle.load.more": "Load more",
// TODO New key - Add a translation
"item.edit.bitstreams.bundle.load.more": "Load more",
// "item.edit.bitstreams.bundle.name": "BUNDLE: {{ name }}",
// TODO New key - Add a translation
"item.edit.bitstreams.bundle.name": "BUNDLE: {{ name }}",
// "item.edit.bitstreams.discard-button": "Discard",
// TODO New key - Add a translation
"item.edit.bitstreams.discard-button": "Discard",
// "item.edit.bitstreams.edit.buttons.download": "Download",
// TODO New key - Add a translation
"item.edit.bitstreams.edit.buttons.download": "Download",
// "item.edit.bitstreams.edit.buttons.drag": "Drag",
// TODO New key - Add a translation
"item.edit.bitstreams.edit.buttons.drag": "Drag",
// "item.edit.bitstreams.edit.buttons.edit": "Edit",
// TODO New key - Add a translation
"item.edit.bitstreams.edit.buttons.edit": "Edit",
// "item.edit.bitstreams.edit.buttons.remove": "Remove",
// TODO New key - Add a translation
"item.edit.bitstreams.edit.buttons.remove": "Remove",
// "item.edit.bitstreams.edit.buttons.undo": "Undo changes",
// TODO New key - Add a translation
"item.edit.bitstreams.edit.buttons.undo": "Undo changes",
// "item.edit.bitstreams.empty": "This item doesn't contain any bitstreams. Click the upload button to create one.",
// TODO New key - Add a translation
"item.edit.bitstreams.empty": "This item doesn't contain any bitstreams. Click the upload button to create one.",
// "item.edit.bitstreams.headers.actions": "Actions",
// TODO New key - Add a translation
"item.edit.bitstreams.headers.actions": "Actions",
// "item.edit.bitstreams.headers.bundle": "Bundle",
// TODO New key - Add a translation
"item.edit.bitstreams.headers.bundle": "Bundle",
// "item.edit.bitstreams.headers.description": "Description",
// TODO New key - Add a translation
"item.edit.bitstreams.headers.description": "Description",
// "item.edit.bitstreams.headers.format": "Format",
// TODO New key - Add a translation
"item.edit.bitstreams.headers.format": "Format",
// "item.edit.bitstreams.headers.name": "Name",
// TODO New key - Add a translation
"item.edit.bitstreams.headers.name": "Name",
// "item.edit.bitstreams.notifications.discarded.content": "Your changes were discarded. To reinstate your changes click the 'Undo' button",
// TODO New key - Add a translation
"item.edit.bitstreams.notifications.discarded.content": "Your changes were discarded. To reinstate your changes click the 'Undo' button",
// "item.edit.bitstreams.notifications.discarded.title": "Changes discarded",
// TODO New key - Add a translation
"item.edit.bitstreams.notifications.discarded.title": "Changes discarded",
// "item.edit.bitstreams.notifications.move.failed.title": "Error moving bitstreams",
// TODO New key - Add a translation
"item.edit.bitstreams.notifications.move.failed.title": "Error moving bitstreams",
// "item.edit.bitstreams.notifications.move.saved.content": "Your move changes to this item's bitstreams and bundles have been saved.",
// TODO New key - Add a translation
"item.edit.bitstreams.notifications.move.saved.content": "Your move changes to this item's bitstreams and bundles have been saved.",
// "item.edit.bitstreams.notifications.move.saved.title": "Move changes saved",
// TODO New key - Add a translation
"item.edit.bitstreams.notifications.move.saved.title": "Move changes saved",
// "item.edit.bitstreams.notifications.outdated.content": "The item you're currently working on has been changed by another user. Your current changes are discarded to prevent conflicts",
// TODO New key - Add a translation
"item.edit.bitstreams.notifications.outdated.content": "The item you're currently working on has been changed by another user. Your current changes are discarded to prevent conflicts",
// "item.edit.bitstreams.notifications.outdated.title": "Changes outdated",
// TODO New key - Add a translation
"item.edit.bitstreams.notifications.outdated.title": "Changes outdated",
// "item.edit.bitstreams.notifications.remove.failed.title": "Error deleting bitstream",
// TODO New key - Add a translation
"item.edit.bitstreams.notifications.remove.failed.title": "Error deleting bitstream",
// "item.edit.bitstreams.notifications.remove.saved.content": "Your removal changes to this item's bitstreams have been saved.",
// TODO New key - Add a translation
"item.edit.bitstreams.notifications.remove.saved.content": "Your removal changes to this item's bitstreams have been saved.",
// "item.edit.bitstreams.notifications.remove.saved.title": "Removal changes saved",
// TODO New key - Add a translation
"item.edit.bitstreams.notifications.remove.saved.title": "Removal changes saved",
// "item.edit.bitstreams.reinstate-button": "Undo",
// TODO New key - Add a translation
"item.edit.bitstreams.reinstate-button": "Undo",
// "item.edit.bitstreams.save-button": "Save",
// TODO New key - Add a translation
"item.edit.bitstreams.save-button": "Save",
// "item.edit.bitstreams.upload-button": "Upload",
// TODO New key - Add a translation
"item.edit.bitstreams.upload-button": "Upload",
// "item.edit.delete.cancel": "Cancel",
"item.edit.delete.cancel": "Atcelt",
@@ -1377,7 +1896,8 @@
// "item.edit.tabs.bitstreams.head": "Item Bitstreams",
// "item.edit.tabs.bitstreams.head": "Bitstreams",
// TODO Source message changed - Revise the translation
"item.edit.tabs.bitstreams.head": "Materiālu Bitstreams",
// "item.edit.tabs.bitstreams.title": "Item Edit - Bitstreams",
@@ -1389,13 +1909,15 @@
// "item.edit.tabs.curate.title": "Item Edit - Curate",
"item.edit.tabs.curate.title": "Rediģēt Materiālu - Pārvaldība",
// "item.edit.tabs.metadata.head": "Item Metadata",
// "item.edit.tabs.metadata.head": "Metadata",
// TODO Source message changed - Revise the translation
"item.edit.tabs.metadata.head": "Materiāla Metadati",
// "item.edit.tabs.metadata.title": "Item Edit - Metadata",
"item.edit.tabs.metadata.title": "Rediģēt Materiālu - Metadati",
// "item.edit.tabs.relationships.head": "Item Relationships",
// "item.edit.tabs.relationships.head": "Relationships",
// TODO Source message changed - Revise the translation
"item.edit.tabs.relationships.head": "Materiāla Attiecības",
// "item.edit.tabs.relationships.title": "Item Edit - Relationships",
@@ -1452,7 +1974,8 @@
// "item.edit.tabs.status.description": "Welcome to the item management page. From here you can withdraw, reinstate, move or delete the item. You may also update or add new metadata / bitstreams on the other tabs.",
"item.edit.tabs.status.description": "Laipni lūdzam vienumu pārvaldības lapā. Šeit jūs varat materiālu izņemt, atjaunot, pārvietot vai izdzēst. Citās cilnēs varat arī atjaunināt vai pievienot jaunus metadatus / bitu straumes.",
// "item.edit.tabs.status.head": "Item Status",
// "item.edit.tabs.status.head": "Status",
// TODO Source message changed - Revise the translation
"item.edit.tabs.status.head": "Materiāla Status",
// "item.edit.tabs.status.labels.handle": "Handle",
@@ -1587,7 +2110,8 @@
// "item.select.table.author": "Author",
"item.select.table.author": "Autors",
// "item.select.table.collection": "Collection",Research Projects
// "item.select.table.collection": "Collection",
// TODO Source message changed - Revise the translation
"item.select.table.collection": "Kolekcija",
// "item.select.table.title": "Title",
@@ -1697,6 +2221,14 @@
// "loading.bitstream": "Loading bitstream...",
// TODO New key - Add a translation
"loading.bitstream": "Loading bitstream...",
// "loading.bitstreams": "Loading bitstreams...",
// TODO New key - Add a translation
"loading.bitstreams": "Loading bitstreams...",
// "loading.browse-by": "Loading items...",
"loading.browse-by": "Notiek materiālu ielāde...",
@@ -1820,7 +2352,8 @@
// "menu.section.browse_community": "This Community",
"menu.section.browse_community": "Šī kategorija",
// "menu.section.browse_community_by_author": "Pēc Autora",
// "menu.section.browse_community_by_author": "By Author",
// TODO Source message changed - Revise the translation
"menu.section.browse_community_by_author": "Pēc Autora",
// "menu.section.browse_community_by_issue_date": "By Issue Date",
@@ -3205,6 +3738,10 @@
// "administrativeView.search.results.head": "Administrative Search",
"administrativeView.search.results.head": "Administratīvā meklēšana",
// "menu.section.admin_search": "Admin Search",
"menu.section.admin_search": "Administratora Meklēšana",
// "uploader.browse": "browse",
"uploader.browse": "pārlūkot",
@@ -3230,5 +3767,6 @@
// "virtual-metadata.delete-relationship.modal-head": "Select the items for which you want to save the virtual metadata as real metadata",
"virtual-metadata.delete-relationship.modal-head": "Izēlieties materiālus, kam vēlaties saglabāt virtuālos metadatus kā reālus metadatus",
}
}

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,6 @@
<ds-comcol-role
*ngFor="let comcolRole of getComcolRoles() | async"
[dso]="collection$ | async"
[comcolRole]="comcolRole"
>
</ds-comcol-role>

View File

@@ -0,0 +1,121 @@
import { ComponentFixture, TestBed} from '@angular/core/testing';
import { TranslateModule } from '@ngx-translate/core';
import { ActivatedRoute } from '@angular/router';
import { of as observableOf } from 'rxjs/internal/observable/of';
import { DebugElement, NO_ERRORS_SCHEMA } from '@angular/core';
import { By } from '@angular/platform-browser';
import { RemoteData } from '../../../core/data/remote-data';
import { CollectionRolesComponent } from './collection-roles.component';
import { Collection } from '../../../core/shared/collection.model';
import { SharedModule } from '../../../shared/shared.module';
import { GroupDataService } from '../../../core/eperson/group-data.service';
import { RequestService } from '../../../core/data/request.service';
import { RouterTestingModule } from '@angular/router/testing';
describe('CollectionRolesComponent', () => {
let fixture: ComponentFixture<CollectionRolesComponent>;
let comp: CollectionRolesComponent;
let de: DebugElement;
beforeEach(() => {
const route = {
parent: {
data: observableOf({
dso: new RemoteData(
false,
false,
true,
undefined,
Object.assign(new Collection(), {
_links: {
'irrelevant': {
href: 'irrelevant link',
},
'adminGroup': {
href: 'adminGroup link',
},
'submittersGroup': {
href: 'submittersGroup link',
},
'itemReadGroup': {
href: 'itemReadGroup link',
},
'bitstreamReadGroup': {
href: 'bitstreamReadGroup link',
},
'workflowGroups/test': {
href: 'test workflow group link',
},
},
}),
),
})
}
};
const requestService = {
hasByHrefObservable: () => observableOf(true),
};
const groupDataService = {
findByHref: () => observableOf(new RemoteData(
false,
false,
true,
undefined,
{},
200,
)),
};
TestBed.configureTestingModule({
imports: [
SharedModule,
RouterTestingModule.withRoutes([]),
TranslateModule.forRoot(),
],
declarations: [
CollectionRolesComponent,
],
providers: [
{ provide: ActivatedRoute, useValue: route },
{ provide: RequestService, useValue: requestService },
{ provide: GroupDataService, useValue: groupDataService },
],
schemas: [NO_ERRORS_SCHEMA]
}).compileComponents();
fixture = TestBed.createComponent(CollectionRolesComponent);
comp = fixture.componentInstance;
de = fixture.debugElement;
fixture.detectChanges();
});
it('should display a collection admin role component', () => {
expect(de.query(By.css('ds-comcol-role .collection-admin')))
.toBeTruthy();
});
it('should display a submitters role component', () => {
expect(de.query(By.css('ds-comcol-role .submitters')))
.toBeTruthy();
});
it('should display a default item read role component', () => {
expect(de.query(By.css('ds-comcol-role .item_read')))
.toBeTruthy();
});
it('should display a default bitstream read role component', () => {
expect(de.query(By.css('ds-comcol-role .bitstream_read')))
.toBeTruthy();
});
it('should display a test workflow role component', () => {
expect(de.query(By.css('ds-comcol-role .test')))
.toBeTruthy();
});
});

View File

@@ -1,4 +1,11 @@
import { Component } from '@angular/core';
import { Component, OnInit } from '@angular/core';
import { ActivatedRoute } from '@angular/router';
import { Observable } from 'rxjs';
import { first, map } from 'rxjs/operators';
import { RemoteData } from '../../../core/data/remote-data';
import { Collection } from '../../../core/shared/collection.model';
import { getRemoteDataPayload, getSucceededRemoteData } from '../../../core/shared/operators';
import { ComcolRole } from '../../../shared/comcol-forms/edit-comcol-page/comcol-role/comcol-role';
/**
* Component for managing a collection's roles
@@ -7,6 +14,48 @@ import { Component } from '@angular/core';
selector: 'ds-collection-roles',
templateUrl: './collection-roles.component.html',
})
export class CollectionRolesComponent {
/* TODO: Implement Collection Edit - Roles */
export class CollectionRolesComponent implements OnInit {
dsoRD$: Observable<RemoteData<Collection>>;
/**
* The collection to manage, as an observable.
*/
get collection$(): Observable<Collection> {
return this.dsoRD$.pipe(
getSucceededRemoteData(),
getRemoteDataPayload(),
)
}
/**
* The different roles for the collection, as an observable.
*/
getComcolRoles(): Observable<ComcolRole[]> {
return this.collection$.pipe(
map((collection) =>
[
ComcolRole.COLLECTION_ADMIN,
ComcolRole.SUBMITTERS,
ComcolRole.ITEM_READ,
ComcolRole.BITSTREAM_READ,
...Object.keys(collection._links)
.filter((link) => link.startsWith('workflowGroups/'))
.map((link) => new ComcolRole(link.substr('workflowGroups/'.length), link)),
]
),
);
}
constructor(
protected route: ActivatedRoute,
) {
}
ngOnInit(): void {
this.dsoRD$ = this.route.parent.data.pipe(
first(),
map((data) => data.dso),
);
}
}

View File

@@ -2,6 +2,5 @@
*ngFor="let comcolRole of getComcolRoles()"
[dso]="community$ | async"
[comcolRole]="comcolRole"
class="card {{comcolRole.name}}"
>
</ds-comcol-role>

View File

@@ -7,6 +7,10 @@ import { CommunityRolesComponent } from './community-roles.component';
import { Community } from '../../../core/shared/community.model';
import { By } from '@angular/platform-browser';
import { RemoteData } from '../../../core/data/remote-data';
import { RequestService } from '../../../core/data/request.service';
import { GroupDataService } from '../../../core/eperson/group-data.service';
import { SharedModule } from '../../../shared/shared.module';
import { RouterTestingModule } from '@angular/router/testing';
describe('CommunityRolesComponent', () => {
@@ -24,14 +28,40 @@ describe('CommunityRolesComponent', () => {
false,
true,
undefined,
new Community(),
)
Object.assign(new Community(), {
_links: {
irrelevant: {
href: 'irrelevant link',
},
adminGroup: {
href: 'adminGroup link',
},
},
}),
),
})
}
};
const requestService = {
hasByHrefObservable: () => observableOf(true),
};
const groupDataService = {
findByHref: () => observableOf(new RemoteData(
false,
false,
true,
undefined,
{},
200,
)),
};
TestBed.configureTestingModule({
imports: [
SharedModule,
RouterTestingModule.withRoutes([]),
TranslateModule.forRoot(),
],
declarations: [
@@ -39,6 +69,8 @@ describe('CommunityRolesComponent', () => {
],
providers: [
{ provide: ActivatedRoute, useValue: route },
{ provide: RequestService, useValue: requestService },
{ provide: GroupDataService, useValue: groupDataService },
],
schemas: [NO_ERRORS_SCHEMA]
}).compileComponents();
@@ -51,6 +83,7 @@ describe('CommunityRolesComponent', () => {
});
it('should display a community admin role component', () => {
expect(de.query(By.css('ds-comcol-role.admin'))).toBeDefined();
expect(de.query(By.css('ds-comcol-role .community-admin')))
.toBeTruthy();
});
});

View File

@@ -33,7 +33,7 @@ export class CommunityRolesComponent implements OnInit {
*/
getComcolRoles(): ComcolRole[] {
return [
ComcolRole.ADMIN,
ComcolRole.COMMUNITY_ADMIN,
];
}

View File

@@ -324,12 +324,11 @@ export class GroupDataService extends DataService<Group> {
* Create a group for a given role for a given community or collection.
*
* @param dso The community or collection for which to create a group
* @param comcolRole The role for which to create a group
* @param link The REST endpoint to create the group
*/
createComcolGroup(dso: Community|Collection, comcolRole: ComcolRole): Observable<RestResponse> {
createComcolGroup(dso: Community|Collection, link: string): Observable<RestResponse> {
const requestId = this.requestService.generateRequestId();
const link = comcolRole.getEndpoint(dso);
const group = Object.assign(new Group(), {
metadata: {
'dc.description': [
@@ -340,47 +339,37 @@ export class GroupDataService extends DataService<Group> {
},
});
return this.halService.getEndpoint(link).pipe(
distinctUntilChanged(),
take(1),
map((endpoint: string) =>
new CreateRequest(
requestId,
endpoint,
JSON.stringify(group),
)
),
configureRequest(this.requestService),
tap(() => this.requestService.removeByHrefSubstring(link)),
switchMap((restRequest) => this.requestService.getByUUID(restRequest.uuid)),
this.requestService.configure(
new CreateRequest(
requestId,
link,
JSON.stringify(group),
));
return this.requestService.getByUUID(requestId).pipe(
getResponseFromEntry(),
tap(() => this.requestService.removeByHrefSubstring(link)),
);
}
/**
* Delete the group for a given role for a given community or collection.
*
* @param dso The community or collection for which to delete the group
* @param comcolRole The role for which to delete the group
* @param link The REST endpoint to delete the group
*/
deleteComcolGroup(dso: Community|Collection, comcolRole: ComcolRole): Observable<RestResponse> {
deleteComcolGroup(link: string): Observable<RestResponse> {
const requestId = this.requestService.generateRequestId();
const link = comcolRole.getEndpoint(dso);
return this.halService.getEndpoint(link).pipe(
distinctUntilChanged(),
take(1),
map((endpoint: string) =>
new DeleteRequest(
requestId,
endpoint,
)
),
configureRequest(this.requestService),
tap(() => this.requestService.removeByHrefSubstring(link)),
switchMap((restRequest) => this.requestService.getByUUID(restRequest.uuid)),
this.requestService.configure(
new DeleteRequest(
requestId,
link,
));
return this.requestService.getByUUID(requestId).pipe(
getResponseFromEntry(),
tap(() => this.requestService.removeByHrefSubstring(link)),
);
}
}

View File

@@ -1,40 +1,50 @@
<div class="card p-2">
<div class="card p-2 m-3 {{comcolRole.name}}">
<div class="card-body d-flex flex-column">
<div class="card-body d-flex flex-column"
*ngVar="group$ | async as group">
<div class="d-flex flex-row justify-content-between">
<div class="d-flex flex-md-row flex-column">
<div>
<p>{{'community.edit.tabs.roles.' + comcolRole.name + '.name' | translate}}</p>
<h5 class="w-100 ">
{{'comcol-role.edit.' + comcolRole.name + '.name' | translate}}
</h5>
<div class="w-100">
<ds-loading *ngIf="!(groupRD$ | async)"></ds-loading>
<div *ngIf="hasNoGroup$() | async">
{{'comcol-role.edit.no-group' | translate}}
</div>
<div *ngIf="hasAnonymousGroup$() | async">
{{'comcol-role.edit.' + comcolRole.name + '.anonymous-group' | translate}}
</div>
<a *ngIf="hasCustomGroup$() | async"
routerLink="{{editGroupLink$ | async}}">
{{group.name}}
</a>
</div>
<ng-container *ngVar="group$ | async as group">
<div *ngIf="!group">
{{'community.edit.tabs.roles.none' | translate}}
</div>
<a *ngIf="group"
routerLink="{{editGroupLink$ | async}}">
{{group.name}}
</a>
<div *ngIf="!group"
class="btn btn-outline-dark create"
(click)="create()">create
</div>
<div *ngIf="group"
class="btn btn-outline-dark delete"
(click)="delete()">delete
</div>
</ng-container>
<div class="ml-md-auto pl-md-2 ml-0 pl-0 pt-2">
<div *ngIf="hasNoGroup$() | async"
class="btn btn-outline-dark create"
(click)="create()">
{{'comcol-role.edit.create' | translate}}
</div>
<div *ngIf="hasAnonymousGroup$() | async"
class="btn btn-outline-dark restrict"
(click)="create()">
{{'comcol-role.edit.restrict' | translate}}
</div>
<div *ngIf="hasCustomGroup$() | async"
class="btn btn-outline-dark delete"
(click)="delete()">
{{'comcol-role.edit.delete' | translate}}
</div>
</div>
</div>
<div class="mt-2">
{{'community.edit.tabs.roles.' + comcolRole.name + '.description' | translate}}
{{'comcol-role.edit.' + comcolRole.name + '.description' | translate}}
</div>
</div>

View File

@@ -6,33 +6,47 @@ import { SharedModule } from '../../../shared.module';
import { TranslateModule } from '@ngx-translate/core';
import { ChangeDetectorRef, DebugElement, NO_ERRORS_SCHEMA } from '@angular/core';
import { RequestService } from '../../../../core/data/request.service';
import { LinkService } from '../../../../core/cache/builders/link.service';
import { Community } from '../../../../core/shared/community.model';
import { ComcolRole } from './comcol-role';
import { of as observableOf } from 'rxjs/internal/observable/of';
import { RemoteData } from '../../../../core/data/remote-data';
import { Group } from '../../../../core/eperson/models/group.model';
import { RouterTestingModule } from '@angular/router/testing';
import { Collection } from '../../../../core/shared/collection.model';
describe('ComcolRoleComponent', () => {
let fixture: ComponentFixture<ComcolRoleComponent>;
let comp: ComcolRoleComponent;
let de: DebugElement;
let requestService;
let groupService;
let linkService;
let group;
let statusCode;
beforeEach(() => {
groupService = jasmine.createSpyObj('groupService', {
createComcolGroup: undefined,
deleteComcolGroup: undefined,
});
requestService = {hasByHrefObservable: () => observableOf(true)};
linkService = {
resolveLink: () => undefined,
groupService = {
findByHref: () => undefined,
createComcolGroup: jasmine.createSpy('createComcolGroup'),
deleteComcolGroup: jasmine.createSpy('deleteComcolGroup'),
};
spyOn(groupService, 'findByHref').and.callFake((link) => {
if (link === 'test role link') {
return observableOf(new RemoteData(
false,
false,
true,
undefined,
group,
statusCode,
));
}
});
TestBed.configureTestingModule({
imports: [
SharedModule,
@@ -41,9 +55,7 @@ describe('ComcolRoleComponent', () => {
],
providers: [
{ provide: GroupDataService, useValue: groupService },
{ provide: LinkService, useValue: linkService },
{ provide: ChangeDetectorRef, useValue: {} },
{ provide: RequestService, useValue: {} },
{ provide: RequestService, useValue: requestService },
], schemas: [
NO_ERRORS_SCHEMA
]
@@ -54,20 +66,38 @@ describe('ComcolRoleComponent', () => {
de = fixture.debugElement;
comp.comcolRole = new ComcolRole(
'test name',
'test link name',
'test role name',
'test role endpoint',
);
comp.dso = new Community();
comp.dso = Object.assign(
new Collection(), {
_links: {
'test role endpoint': {
href: 'test role link',
}
}
}
);
fixture.detectChanges();
});
describe('when there is no group yet', () => {
it('should have a create button but no delete button', () => {
expect(de.query(By.css('.btn.create'))).toBeDefined();
expect(de.query(By.css('.btn.delete'))).toBeNull();
beforeEach(() => {
group = null;
statusCode = 204;
fixture.detectChanges();
});
it('should have a create button but no restrict or delete button', () => {
expect(de.query(By.css('.btn.create')))
.toBeTruthy();
expect(de.query(By.css('.btn.restrict')))
.toBeNull();
expect(de.query(By.css('.btn.delete')))
.toBeNull();
});
describe('when the create button is pressed', () => {
@@ -82,25 +112,54 @@ describe('ComcolRoleComponent', () => {
});
});
describe('when there is a group yet', () => {
describe('when the related group is the Anonymous group', () => {
beforeEach(() => {
Object.assign(comp.dso, {
'test link name': observableOf(new RemoteData(
false,
false,
true,
undefined,
new Group(),
)),
});
group = {
name: 'Anonymous'
};
statusCode = 200;
fixture.detectChanges();
});
it('should have a delete button but no create button', () => {
expect(de.query(By.css('.btn.delete'))).toBeDefined();
expect(de.query(By.css('.btn.create'))).toBeNull();
it('should have a restrict button but no create or delete button', () => {
expect(de.query(By.css('.btn.create')))
.toBeNull();
expect(de.query(By.css('.btn.restrict')))
.toBeTruthy();
expect(de.query(By.css('.btn.delete')))
.toBeNull();
});
describe('when the restrict button is pressed', () => {
beforeEach(() => {
de.query(By.css('.btn.restrict')).nativeElement.click();
});
it('should call the groupService create method', () => {
expect(groupService.createComcolGroup).toHaveBeenCalledWith(comp.dso, 'test role link');
});
});
});
describe('when the related group is a custom group', () => {
beforeEach(() => {
group = {
name: 'custom group name'
};
statusCode = 200;
fixture.detectChanges();
});
it('should have a delete button but no create or restrict button', () => {
expect(de.query(By.css('.btn.create')))
.toBeNull();
expect(de.query(By.css('.btn.restrict')))
.toBeNull();
expect(de.query(By.css('.btn.delete')))
.toBeTruthy();
});
describe('when the delete button is pressed', () => {

View File

@@ -1,16 +1,15 @@
import { ChangeDetectorRef, Component, Input, OnInit } from '@angular/core';
import { Component, Input, OnInit } from '@angular/core';
import { Group } from '../../../../core/eperson/models/group.model';
import { Community } from '../../../../core/shared/community.model';
import { EMPTY, Observable } from 'rxjs';
import { Observable } from 'rxjs';
import { getGroupEditPath } from '../../../../+admin/admin-access-control/admin-access-control-routing.module';
import { GroupDataService } from '../../../../core/eperson/group-data.service';
import { Collection } from '../../../../core/shared/collection.model';
import { map } from 'rxjs/operators';
import { followLink } from '../../../utils/follow-link-config.model';
import { LinkService } from '../../../../core/cache/builders/link.service';
import { filter, map } from 'rxjs/operators';
import { getRemoteDataPayload, getSucceededRemoteData } from '../../../../core/shared/operators';
import { ComcolRole } from './comcol-role';
import { RequestService } from '../../../../core/data/request.service';
import { RemoteData } from '../../../../core/data/remote-data';
/**
* Component for managing a community or collection role.
@@ -35,24 +34,34 @@ export class ComcolRoleComponent implements OnInit {
comcolRole: ComcolRole;
constructor(
protected groupService: GroupDataService,
protected linkService: LinkService,
protected cdr: ChangeDetectorRef,
protected requestService: RequestService,
protected groupService: GroupDataService,
) {
}
/**
* The group for this role as an observable.
* The link to the related group.
*/
get groupLink(): string {
return this.dso._links[this.comcolRole.linkName].href;
}
/**
* The group for this role, as an observable remote data.
*/
get groupRD$(): Observable<RemoteData<Group>> {
return this.groupService.findByHref(this.groupLink).pipe(
filter((groupRD) => !!groupRD.statusCode),
);
}
/**
* The group for this role, as an observable.
*/
get group$(): Observable<Group> {
if (!this.dso[this.comcolRole.linkName]) {
return EMPTY;
}
return this.dso[this.comcolRole.linkName].pipe(
return this.groupRD$.pipe(
getSucceededRemoteData(),
filter((groupRD) => groupRD != null),
getRemoteDataPayload(),
);
}
@@ -66,29 +75,52 @@ export class ComcolRoleComponent implements OnInit {
);
}
/**
* Return true if there is no group for this ComcolRole, as an observable.
*/
hasNoGroup$(): Observable<boolean> {
return this.groupRD$.pipe(
map((groupRD) => groupRD.statusCode === 204),
)
}
/**
* Return true if the group for this ComcolRole is the Anonymous group, as an observable.
*/
hasAnonymousGroup$(): Observable<boolean> {
return this.group$.pipe(
map((group) => group.name === 'Anonymous'),
)
}
/**
* Return true if there is a group for this ComcolRole other than the Anonymous group, as an observable.
*/
hasCustomGroup$(): Observable<boolean> {
return this.hasAnonymousGroup$().pipe(
map((anonymous) => !anonymous),
)
}
/**
* Create a group for this community or collection role.
*/
create() {
this.groupService.createComcolGroup(this.dso, this.comcolRole)
.subscribe(() => {
this.linkService.resolveLink(this.dso, followLink(this.comcolRole.linkName));
this.cdr.detectChanges();
});
this.groupService.createComcolGroup(this.dso, this.groupLink).subscribe();
}
/**
* Delete the group for this community or collection role.
*/
delete() {
this.groupService.deleteComcolGroup(this.dso, this.comcolRole)
.subscribe(() => {
this.cdr.detectChanges();
})
this.groupService.deleteComcolGroup(this.groupLink).subscribe();
}
ngOnInit(): void {
this.linkService.resolveLink(this.dso, followLink(this.comcolRole.linkName));
this.requestService.hasByHrefObservable(this.groupLink)
.pipe(
filter((hasByHrefObservable) => !hasByHrefObservable),
)
.subscribe(() => this.groupRD$.subscribe());
}
}

View File

@@ -7,13 +7,45 @@ import { Collection } from '../../../../core/shared/collection.model';
export class ComcolRole {
/**
* The admin role.
* The community admin role.
*/
public static ADMIN = new ComcolRole(
'admin',
public static COMMUNITY_ADMIN = new ComcolRole(
'community-admin',
'adminGroup',
);
/**
* The collection admin role.
*/
public static COLLECTION_ADMIN = new ComcolRole(
'collection-admin',
'adminGroup',
);
/**
* The submitters role.
*/
public static SUBMITTERS = new ComcolRole(
'submitters',
'submittersGroup',
);
/**
* The default item read role.
*/
public static ITEM_READ = new ComcolRole(
'item_read',
'itemReadGroup',
);
/**
* The default bitstream read role.
*/
public static BITSTREAM_READ = new ComcolRole(
'bitstream_read',
'bitstreamReadGroup',
);
/**
* @param name The name for this community or collection role.
* @param linkName The path linking to this community or collection role.