mirror of
https://github.com/DSpace/dspace-angular.git
synced 2025-10-07 01:54:15 +00:00
Update community-roles.component to align with collection-roles
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
<ds-comcol-role
|
||||
*ngFor="let comcolRole of getComcolRoles$() | async"
|
||||
*ngFor="let comcolRole of comcolRoles$ | async"
|
||||
[dso]="community$ | async"
|
||||
[comcolRole]="comcolRole"
|
||||
>
|
||||
|
@@ -78,8 +78,9 @@ describe('CommunityRolesComponent', () => {
|
||||
fixture.detectChanges();
|
||||
});
|
||||
|
||||
it('should display a community admin role component', () => {
|
||||
it('should display a community admin role component', (done) => {
|
||||
expect(de.query(By.css('ds-comcol-role .community-admin')))
|
||||
.toBeTruthy();
|
||||
done();
|
||||
});
|
||||
});
|
||||
|
@@ -19,28 +19,14 @@ export class CommunityRolesComponent implements OnInit {
|
||||
dsoRD$: Observable<RemoteData<Community>>;
|
||||
|
||||
/**
|
||||
* The community to manage, as an observable.
|
||||
* The different roles for the community, as an observable.
|
||||
*/
|
||||
get community$(): Observable<Community> {
|
||||
return this.dsoRD$.pipe(
|
||||
getFirstSucceededRemoteData(),
|
||||
getRemoteDataPayload(),
|
||||
);
|
||||
}
|
||||
comcolRoles$: Observable<HALLink[]>;
|
||||
|
||||
/**
|
||||
* The different roles for the community.
|
||||
* The community to manage, as an observable.
|
||||
*/
|
||||
getComcolRoles$(): Observable<HALLink[]> {
|
||||
return this.community$.pipe(
|
||||
map((community) => [
|
||||
{
|
||||
name: 'community-admin',
|
||||
href: community._links.adminGroup.href,
|
||||
},
|
||||
]),
|
||||
);
|
||||
}
|
||||
community$: Observable<Community>;
|
||||
|
||||
constructor(
|
||||
protected route: ActivatedRoute,
|
||||
@@ -52,5 +38,22 @@ export class CommunityRolesComponent implements OnInit {
|
||||
first(),
|
||||
map((data) => data.dso),
|
||||
);
|
||||
|
||||
this.community$ = this.dsoRD$.pipe(
|
||||
getFirstSucceededRemoteData(),
|
||||
getRemoteDataPayload(),
|
||||
);
|
||||
|
||||
/**
|
||||
* The different roles for the community.
|
||||
*/
|
||||
this.comcolRoles$ = this.community$.pipe(
|
||||
map((community) => [
|
||||
{
|
||||
name: 'community-admin',
|
||||
href: community._links.adminGroup.href,
|
||||
},
|
||||
]),
|
||||
);
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user