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