mirror of
https://github.com/DSpace/dspace-angular.git
synced 2025-10-07 10:04:11 +00:00
Added component to edit and create a resource policy
This commit is contained in:
@@ -1667,15 +1667,51 @@
|
|||||||
|
|
||||||
"resource-policies.add.for.item": "Add a new Item policy",
|
"resource-policies.add.for.item": "Add a new Item policy",
|
||||||
|
|
||||||
|
"resource-policies.create.modal.head": "Create new resource policy",
|
||||||
|
|
||||||
|
"resource-policies.edit.modal.head": "Edit resource policy",
|
||||||
|
|
||||||
|
"resource-policies.form.action-type.label": "Select the action type",
|
||||||
|
|
||||||
|
"resource-policies.form.action-type.required": "You must select the resource policy action.",
|
||||||
|
|
||||||
|
"resource-policies.form.eperson-group-list.label": "Select the eperson or group that will be grant of the permission",
|
||||||
|
|
||||||
|
"resource-policies.form.eperson-group-list.select.btn": "Select",
|
||||||
|
|
||||||
|
"resource-policies.form.eperson-group-list.tab.eperson": "Search for a ePerson",
|
||||||
|
|
||||||
|
"resource-policies.form.eperson-group-list.tab.group": "Search for a group",
|
||||||
|
|
||||||
|
"resource-policies.form.eperson-group-list.table.headers.action": "Action",
|
||||||
|
|
||||||
|
"resource-policies.form.eperson-group-list.table.headers.id": "ID",
|
||||||
|
|
||||||
|
"resource-policies.form.eperson-group-list.table.headers.name": "Name",
|
||||||
|
|
||||||
|
"resource-policies.form.date.end.label": "End Date",
|
||||||
|
|
||||||
|
"resource-policies.form.date.start.label": "Start Date",
|
||||||
|
|
||||||
|
"resource-policies.form.description.label": "Description",
|
||||||
|
|
||||||
|
"resource-policies.form.name.label": "Name",
|
||||||
|
|
||||||
|
"resource-policies.form.policy-type.label": "Select the policy type",
|
||||||
|
|
||||||
|
"resource-policies.form.policy-type.required": "You must select the resource policy type.",
|
||||||
|
|
||||||
"resource-policies.table.headers.action": "Action",
|
"resource-policies.table.headers.action": "Action",
|
||||||
|
|
||||||
"resource-policies.table.headers.date.end": "End Date",
|
"resource-policies.table.headers.date.end": "End Date",
|
||||||
|
|
||||||
"resource-policies.table.headers.date.start": "Start Date",
|
"resource-policies.table.headers.date.start": "Start Date",
|
||||||
|
|
||||||
"resource-policies.table.headers.group": "Group",
|
"resource-policies.table.headers.edit": "Edit",
|
||||||
|
|
||||||
"resource-policies.table.headers.group.edit": "Edit",
|
"resource-policies.table.headers.eperson": "EPerson",
|
||||||
|
|
||||||
|
"resource-policies.table.headers.group": "Group",
|
||||||
|
|
||||||
"resource-policies.table.headers.name": "Name",
|
"resource-policies.table.headers.name": "Name",
|
||||||
|
|
||||||
|
@@ -15,6 +15,8 @@ import { ItemRelationshipsComponent } from './item-relationships/item-relationsh
|
|||||||
import { I18nBreadcrumbResolver } from '../../core/breadcrumbs/i18n-breadcrumb.resolver';
|
import { I18nBreadcrumbResolver } from '../../core/breadcrumbs/i18n-breadcrumb.resolver';
|
||||||
import { ItemVersionHistoryComponent } from './item-version-history/item-version-history.component';
|
import { ItemVersionHistoryComponent } from './item-version-history/item-version-history.component';
|
||||||
import { ItemAuthorizationsComponent } from './item-authorizations/item-authorizations.component';
|
import { ItemAuthorizationsComponent } from './item-authorizations/item-authorizations.component';
|
||||||
|
import { ResourcePolicyEditComponent } from '../../shared/resource-policies/edit/resource-policy-edit.component';
|
||||||
|
import { ResourcePolicyCreateComponent } from '../../shared/resource-policies/create/resource-policy-create.component';
|
||||||
|
|
||||||
export const ITEM_EDIT_WITHDRAW_PATH = 'withdraw';
|
export const ITEM_EDIT_WITHDRAW_PATH = 'withdraw';
|
||||||
export const ITEM_EDIT_REINSTATE_PATH = 'reinstate';
|
export const ITEM_EDIT_REINSTATE_PATH = 'reinstate';
|
||||||
@@ -116,8 +118,21 @@ export const ITEM_EDIT_AUTHORIZATIONS_PATH = 'authorizations';
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
path: ITEM_EDIT_AUTHORIZATIONS_PATH,
|
path: ITEM_EDIT_AUTHORIZATIONS_PATH,
|
||||||
component: ItemAuthorizationsComponent,
|
|
||||||
data: { title: 'item.edit.authorizations.title' },
|
data: { title: 'item.edit.authorizations.title' },
|
||||||
|
children: [
|
||||||
|
{
|
||||||
|
path: ':dso/create',
|
||||||
|
component: ResourcePolicyCreateComponent,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
path: ':dso/:policy/edit',
|
||||||
|
component: ResourcePolicyEditComponent,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
path: '',
|
||||||
|
component: ItemAuthorizationsComponent
|
||||||
|
}
|
||||||
|
]
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
|
@@ -0,0 +1,6 @@
|
|||||||
|
<div class="container">
|
||||||
|
<h4 class="mb-3">{{'resource-policies.create.modal.head' | translate}}</h4>
|
||||||
|
|
||||||
|
<ds-resource-policy-form (reset)="redirectToPreviousPage()"
|
||||||
|
(submit)="createResourcePolicy($event)"></ds-resource-policy-form>
|
||||||
|
</div>
|
@@ -0,0 +1,32 @@
|
|||||||
|
import { Component } from '@angular/core';
|
||||||
|
import { Router } from '@angular/router';
|
||||||
|
|
||||||
|
import { take } from 'rxjs/operators';
|
||||||
|
|
||||||
|
import { ResourcePolicyEvent } from '../form/resource-policy-form';
|
||||||
|
import { RouteService } from '../../../core/services/route.service';
|
||||||
|
import { ResourcePolicyService } from '../../../core/resource-policy/resource-policy.service';
|
||||||
|
|
||||||
|
@Component({
|
||||||
|
selector: 'ds-resource-policy-create',
|
||||||
|
templateUrl: './resource-policy-create.component.html'
|
||||||
|
})
|
||||||
|
export class ResourcePolicyCreateComponent {
|
||||||
|
|
||||||
|
constructor(
|
||||||
|
protected resourcePolicy: ResourcePolicyService,
|
||||||
|
protected router: Router,
|
||||||
|
protected routeService: RouteService) {
|
||||||
|
}
|
||||||
|
|
||||||
|
createResourcePolicy(event: ResourcePolicyEvent) {
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
redirectToPreviousPage() {
|
||||||
|
this.routeService.getPreviousUrl().pipe(take(1))
|
||||||
|
.subscribe((url) => {
|
||||||
|
this.router.navigateByUrl(url);
|
||||||
|
})
|
||||||
|
}
|
||||||
|
}
|
@@ -0,0 +1,5 @@
|
|||||||
|
<div class="container">
|
||||||
|
<h4 class="mb-3">{{'resource-policies.edit.modal.head' | translate}}</h4>
|
||||||
|
|
||||||
|
<ds-resource-policy-form></ds-resource-policy-form>
|
||||||
|
</div>
|
@@ -0,0 +1,9 @@
|
|||||||
|
import { Component } from '@angular/core';
|
||||||
|
|
||||||
|
@Component({
|
||||||
|
selector: 'ds-resource-policy-edit',
|
||||||
|
templateUrl: './resource-policy-edit.component.html'
|
||||||
|
})
|
||||||
|
export class ResourcePolicyEditComponent {
|
||||||
|
|
||||||
|
}
|
@@ -181,6 +181,10 @@ import { SortablejsModule } from 'ngx-sortablejs';
|
|||||||
import { MissingTranslationHelper } from './translate/missing-translation.helper';
|
import { MissingTranslationHelper } from './translate/missing-translation.helper';
|
||||||
import { ResourcePoliciesComponent } from './resource-policies/resource-policies.component';
|
import { ResourcePoliciesComponent } from './resource-policies/resource-policies.component';
|
||||||
import { NgForTrackByIdDirective } from './ng-for-track-by-id.directive';
|
import { NgForTrackByIdDirective } from './ng-for-track-by-id.directive';
|
||||||
|
import { ResourcePolicyFormComponent } from './resource-policies/form/resource-policy-form';
|
||||||
|
import { ResourcePolicyCreateComponent } from './resource-policies/create/resource-policy-create.component';
|
||||||
|
import { ResourcePolicyEditComponent } from './resource-policies/edit/resource-policy-edit.component';
|
||||||
|
import { EpersonGroupListComponent } from './resource-policies/form/eperson-group-list/eperson-group-list.component';
|
||||||
|
|
||||||
const MODULES = [
|
const MODULES = [
|
||||||
// Do NOT include UniversalModule, HttpModule, or JsonpModule here
|
// Do NOT include UniversalModule, HttpModule, or JsonpModule here
|
||||||
@@ -349,7 +353,11 @@ const COMPONENTS = [
|
|||||||
ExistingMetadataListElementComponent,
|
ExistingMetadataListElementComponent,
|
||||||
ItemVersionsComponent,
|
ItemVersionsComponent,
|
||||||
PublicationSearchResultListElementComponent,
|
PublicationSearchResultListElementComponent,
|
||||||
ResourcePoliciesComponent
|
ResourcePoliciesComponent,
|
||||||
|
ResourcePolicyFormComponent,
|
||||||
|
ResourcePolicyCreateComponent,
|
||||||
|
ResourcePolicyEditComponent,
|
||||||
|
EpersonGroupListComponent
|
||||||
];
|
];
|
||||||
|
|
||||||
const ENTRY_COMPONENTS = [
|
const ENTRY_COMPONENTS = [
|
||||||
@@ -414,6 +422,8 @@ const ENTRY_COMPONENTS = [
|
|||||||
DsDynamicLookupRelationExternalSourceTabComponent,
|
DsDynamicLookupRelationExternalSourceTabComponent,
|
||||||
ExternalSourceEntryImportModalComponent,
|
ExternalSourceEntryImportModalComponent,
|
||||||
ItemVersionsComponent,
|
ItemVersionsComponent,
|
||||||
|
ResourcePolicyCreateComponent,
|
||||||
|
ResourcePolicyEditComponent
|
||||||
];
|
];
|
||||||
|
|
||||||
const SHARED_ITEM_PAGE_COMPONENTS = [
|
const SHARED_ITEM_PAGE_COMPONENTS = [
|
||||||
|
Reference in New Issue
Block a user