mirror of
https://github.com/DSpace/dspace-angular.git
synced 2025-10-16 22:43:03 +00:00
[CST-9636] Added access control components in community, item and collection edit page
This commit is contained in:
@@ -0,0 +1,3 @@
|
||||
<div class="container">
|
||||
Access control page!!!
|
||||
</div>
|
@@ -0,0 +1,25 @@
|
||||
import { ComponentFixture, TestBed } from '@angular/core/testing';
|
||||
|
||||
import { CollectionAccessControlComponent } from './collection-access-control.component';
|
||||
|
||||
describe('CollectionAccessControlComponent', () => {
|
||||
let component: CollectionAccessControlComponent;
|
||||
let fixture: ComponentFixture<CollectionAccessControlComponent>;
|
||||
|
||||
beforeEach(async () => {
|
||||
await TestBed.configureTestingModule({
|
||||
declarations: [ CollectionAccessControlComponent ]
|
||||
})
|
||||
.compileComponents();
|
||||
});
|
||||
|
||||
beforeEach(() => {
|
||||
fixture = TestBed.createComponent(CollectionAccessControlComponent);
|
||||
component = fixture.componentInstance;
|
||||
fixture.detectChanges();
|
||||
});
|
||||
|
||||
it('should create', () => {
|
||||
expect(component).toBeTruthy();
|
||||
});
|
||||
});
|
@@ -0,0 +1,37 @@
|
||||
import { Component, OnInit } from '@angular/core';
|
||||
import { Observable } from 'rxjs';
|
||||
import { RemoteData } from '../../../core/data/remote-data';
|
||||
import { ActivatedRoute } from '@angular/router';
|
||||
import { first, map } from 'rxjs/operators';
|
||||
import { DSpaceObject } from '../../../core/shared/dspace-object.model';
|
||||
|
||||
@Component({
|
||||
selector: 'ds-collection-access-control',
|
||||
templateUrl: './collection-access-control.component.html',
|
||||
styleUrls: ['./collection-access-control.component.scss']
|
||||
})
|
||||
export class CollectionAccessControlComponent<TDomain extends DSpaceObject> implements OnInit {
|
||||
|
||||
/**
|
||||
* The initial DSO object
|
||||
*/
|
||||
public dsoRD$: Observable<RemoteData<TDomain>>;
|
||||
|
||||
/**
|
||||
* Initialize instance variables
|
||||
*
|
||||
* @param {ActivatedRoute} route
|
||||
*/
|
||||
constructor(
|
||||
private route: ActivatedRoute
|
||||
) {
|
||||
}
|
||||
|
||||
/**
|
||||
* Initialize the component, setting up the collection
|
||||
*/
|
||||
ngOnInit(): void {
|
||||
this.dsoRD$ = this.route.parent.parent.data.pipe(first(), map((data) => data.dso));
|
||||
}
|
||||
|
||||
}
|
@@ -13,6 +13,7 @@ import { CollectionSourceControlsComponent } from './collection-source/collectio
|
||||
import { ResourcePoliciesModule } from '../../shared/resource-policies/resource-policies.module';
|
||||
import { FormModule } from '../../shared/form/form.module';
|
||||
import { ComcolModule } from '../../shared/comcol/comcol.module';
|
||||
import { CollectionAccessControlComponent } from './collection-access-control/collection-access-control.component';
|
||||
|
||||
/**
|
||||
* Module that contains all components related to the Edit Collection page administrator functionality
|
||||
@@ -33,7 +34,7 @@ import { ComcolModule } from '../../shared/comcol/comcol.module';
|
||||
CollectionRolesComponent,
|
||||
CollectionCurateComponent,
|
||||
CollectionSourceComponent,
|
||||
|
||||
CollectionAccessControlComponent,
|
||||
CollectionSourceControlsComponent,
|
||||
CollectionAuthorizationsComponent
|
||||
]
|
||||
|
@@ -13,6 +13,7 @@ import { ResourcePolicyCreateComponent } from '../../shared/resource-policies/cr
|
||||
import { ResourcePolicyResolver } from '../../shared/resource-policies/resolvers/resource-policy.resolver';
|
||||
import { ResourcePolicyEditComponent } from '../../shared/resource-policies/edit/resource-policy-edit.component';
|
||||
import { CollectionAdministratorGuard } from '../../core/data/feature-authorization/feature-authorization-guard/collection-administrator.guard';
|
||||
import { CollectionAccessControlComponent } from './collection-access-control/collection-access-control.component';
|
||||
|
||||
/**
|
||||
* Routing module that handles the routing for the Edit Collection page administrator functionality
|
||||
@@ -58,6 +59,11 @@ import { CollectionAdministratorGuard } from '../../core/data/feature-authorizat
|
||||
component: CollectionCurateComponent,
|
||||
data: { title: 'collection.edit.tabs.curate.title', showBreadcrumbs: true }
|
||||
},
|
||||
{
|
||||
path: 'access-control',
|
||||
component: CollectionAccessControlComponent,
|
||||
data: { title: 'collection.edit.tabs.access-control.title', showBreadcrumbs: true }
|
||||
},
|
||||
/* {
|
||||
path: 'authorizations',
|
||||
component: CollectionAuthorizationsComponent,
|
||||
|
@@ -0,0 +1 @@
|
||||
<p>community-access-control works!</p>
|
@@ -0,0 +1,25 @@
|
||||
import { ComponentFixture, TestBed } from '@angular/core/testing';
|
||||
|
||||
import { CommunityAccessControlComponent } from './community-access-control.component';
|
||||
|
||||
describe('CommunityAccessControlComponent', () => {
|
||||
let component: CommunityAccessControlComponent;
|
||||
let fixture: ComponentFixture<CommunityAccessControlComponent>;
|
||||
|
||||
beforeEach(async () => {
|
||||
await TestBed.configureTestingModule({
|
||||
declarations: [ CommunityAccessControlComponent ]
|
||||
})
|
||||
.compileComponents();
|
||||
});
|
||||
|
||||
beforeEach(() => {
|
||||
fixture = TestBed.createComponent(CommunityAccessControlComponent);
|
||||
component = fixture.componentInstance;
|
||||
fixture.detectChanges();
|
||||
});
|
||||
|
||||
it('should create', () => {
|
||||
expect(component).toBeTruthy();
|
||||
});
|
||||
});
|
@@ -0,0 +1,15 @@
|
||||
import { Component, OnInit } from '@angular/core';
|
||||
|
||||
@Component({
|
||||
selector: 'ds-community-access-control',
|
||||
templateUrl: './community-access-control.component.html',
|
||||
styleUrls: ['./community-access-control.component.scss']
|
||||
})
|
||||
export class CommunityAccessControlComponent implements OnInit {
|
||||
|
||||
constructor() { }
|
||||
|
||||
ngOnInit(): void {
|
||||
}
|
||||
|
||||
}
|
@@ -10,6 +10,7 @@ import { CommunityAuthorizationsComponent } from './community-authorizations/com
|
||||
import { CommunityFormModule } from '../community-form/community-form.module';
|
||||
import { ResourcePoliciesModule } from '../../shared/resource-policies/resource-policies.module';
|
||||
import { ComcolModule } from '../../shared/comcol/comcol.module';
|
||||
import { CommunityAccessControlComponent } from './community-access-control/community-access-control.component';
|
||||
|
||||
/**
|
||||
* Module that contains all components related to the Edit Community page administrator functionality
|
||||
@@ -28,7 +29,8 @@ import { ComcolModule } from '../../shared/comcol/comcol.module';
|
||||
CommunityCurateComponent,
|
||||
CommunityMetadataComponent,
|
||||
CommunityRolesComponent,
|
||||
CommunityAuthorizationsComponent
|
||||
CommunityAuthorizationsComponent,
|
||||
CommunityAccessControlComponent
|
||||
]
|
||||
})
|
||||
export class EditCommunityPageModule {
|
||||
|
@@ -11,6 +11,7 @@ import { ResourcePolicyCreateComponent } from '../../shared/resource-policies/cr
|
||||
import { ResourcePolicyResolver } from '../../shared/resource-policies/resolvers/resource-policy.resolver';
|
||||
import { ResourcePolicyEditComponent } from '../../shared/resource-policies/edit/resource-policy-edit.component';
|
||||
import { CommunityAdministratorGuard } from '../../core/data/feature-authorization/feature-authorization-guard/community-administrator.guard';
|
||||
import { CommunityAccessControlComponent } from './community-access-control/community-access-control.component';
|
||||
|
||||
/**
|
||||
* Routing module that handles the routing for the Edit Community page administrator functionality
|
||||
@@ -51,6 +52,11 @@ import { CommunityAdministratorGuard } from '../../core/data/feature-authorizati
|
||||
component: CommunityCurateComponent,
|
||||
data: { title: 'community.edit.tabs.curate.title', showBreadcrumbs: true }
|
||||
},
|
||||
{
|
||||
path: 'access-control',
|
||||
component: CommunityAccessControlComponent,
|
||||
data: { title: 'collection.edit.tabs.access-control.title', showBreadcrumbs: true }
|
||||
},
|
||||
/*{
|
||||
path: 'authorizations',
|
||||
component: CommunityAuthorizationsComponent,
|
||||
|
@@ -38,6 +38,7 @@ import { IdentifierDataService } from '../../core/data/identifier-data.service';
|
||||
import { IdentifierDataComponent } from '../../shared/object-list/identifier-data/identifier-data.component';
|
||||
import { ItemRegisterDoiComponent } from './item-register-doi/item-register-doi.component';
|
||||
import { DsoSharedModule } from '../../dso-shared/dso-shared.module';
|
||||
import { ItemAccessControlComponent } from './item-access-control/item-access-control.component';
|
||||
|
||||
|
||||
/**
|
||||
@@ -81,7 +82,8 @@ import { DsoSharedModule } from '../../dso-shared/dso-shared.module';
|
||||
VirtualMetadataComponent,
|
||||
ItemAuthorizationsComponent,
|
||||
IdentifierDataComponent,
|
||||
ItemRegisterDoiComponent
|
||||
ItemRegisterDoiComponent,
|
||||
ItemAccessControlComponent
|
||||
],
|
||||
providers: [
|
||||
BundleDataService,
|
||||
|
@@ -41,6 +41,7 @@ import { ItemPageVersionHistoryGuard } from './item-page-version-history.guard';
|
||||
import { ItemPageCollectionMapperGuard } from './item-page-collection-mapper.guard';
|
||||
import { ThemedDsoEditMetadataComponent } from '../../dso-shared/dso-edit-metadata/themed-dso-edit-metadata.component';
|
||||
import { ItemPageRegisterDoiGuard } from './item-page-register-doi.guard';
|
||||
import { ItemAccessControlComponent } from './item-access-control/item-access-control.component';
|
||||
|
||||
/**
|
||||
* Routing module that handles the routing for the Edit Item page administrator functionality
|
||||
@@ -106,6 +107,11 @@ import { ItemPageRegisterDoiGuard } from './item-page-register-doi.guard';
|
||||
data: { title: 'item.edit.tabs.versionhistory.title', showBreadcrumbs: true },
|
||||
canActivate: [ItemPageVersionHistoryGuard]
|
||||
},
|
||||
{
|
||||
path: 'access-control',
|
||||
component: ItemAccessControlComponent,
|
||||
data: { title: 'item.edit.tabs.access-control.title', showBreadcrumbs: true }
|
||||
},
|
||||
{
|
||||
path: 'mapper',
|
||||
component: ItemCollectionMapperComponent,
|
||||
|
@@ -0,0 +1 @@
|
||||
<p>item-access-control works!</p>
|
@@ -0,0 +1,25 @@
|
||||
import { ComponentFixture, TestBed } from '@angular/core/testing';
|
||||
|
||||
import { ItemAccessControlComponent } from './item-access-control.component';
|
||||
|
||||
describe('ItemAccessControlComponent', () => {
|
||||
let component: ItemAccessControlComponent;
|
||||
let fixture: ComponentFixture<ItemAccessControlComponent>;
|
||||
|
||||
beforeEach(async () => {
|
||||
await TestBed.configureTestingModule({
|
||||
declarations: [ ItemAccessControlComponent ]
|
||||
})
|
||||
.compileComponents();
|
||||
});
|
||||
|
||||
beforeEach(() => {
|
||||
fixture = TestBed.createComponent(ItemAccessControlComponent);
|
||||
component = fixture.componentInstance;
|
||||
fixture.detectChanges();
|
||||
});
|
||||
|
||||
it('should create', () => {
|
||||
expect(component).toBeTruthy();
|
||||
});
|
||||
});
|
@@ -0,0 +1,15 @@
|
||||
import { Component, OnInit } from '@angular/core';
|
||||
|
||||
@Component({
|
||||
selector: 'ds-item-access-control',
|
||||
templateUrl: './item-access-control.component.html',
|
||||
styleUrls: ['./item-access-control.component.scss']
|
||||
})
|
||||
export class ItemAccessControlComponent implements OnInit {
|
||||
|
||||
constructor() { }
|
||||
|
||||
ngOnInit(): void {
|
||||
}
|
||||
|
||||
}
|
@@ -965,6 +965,10 @@
|
||||
"collection.edit.return": "Back",
|
||||
|
||||
|
||||
"collection.edit.tabs.access-control.head": "Access Control",
|
||||
|
||||
"collection.edit.tabs.access-control.title": "Collection Edit - Access Control",
|
||||
|
||||
|
||||
"collection.edit.tabs.curate.head": "Curate",
|
||||
|
||||
@@ -1201,6 +1205,10 @@
|
||||
|
||||
"community.edit.tabs.curate.title": "Community Edit - Curate",
|
||||
|
||||
"community.edit.tabs.access-control.head": "Access Control",
|
||||
|
||||
"community.edit.tabs.access-control.title": "Community Edit - Access Control",
|
||||
|
||||
"community.edit.tabs.metadata.head": "Edit Metadata",
|
||||
|
||||
"community.edit.tabs.metadata.title": "Community Edit - Metadata",
|
||||
@@ -2292,6 +2300,10 @@
|
||||
|
||||
"item.edit.tabs.curate.title": "Item Edit - Curate",
|
||||
|
||||
"item.edit.tabs.access-control.head": "Access Control",
|
||||
|
||||
"item.edit.tabs.access-control.title": "Item Edit - Access Control",
|
||||
|
||||
"item.edit.tabs.metadata.head": "Metadata",
|
||||
|
||||
"item.edit.tabs.metadata.title": "Item Edit - Metadata",
|
||||
|
Reference in New Issue
Block a user