File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -15,6 +15,7 @@ import { LinkMenuItemModel } from '../shared/menu/menu-item/models/link.model';
1515import { ThemedCommunityPageComponent } from './themed-community-page.component' ;
1616import { MenuItemType } from '../shared/menu/menu-item-type.model' ;
1717import { DSOEditMenuResolver } from '../shared/dso-page/dso-edit-menu.resolver' ;
18+ import { SubComColSectionComponent } from './sections/sub-com-col-section/sub-com-col-section.component' ;
1819
1920@NgModule ( {
2021 imports : [
@@ -46,9 +47,15 @@ import { DSOEditMenuResolver } from '../shared/dso-page/dso-edit-menu.resolver';
4647 canActivate : [ AuthenticatedGuard ] ,
4748 } ,
4849 {
49- path : '' ,
50+ path : '** ' ,
5051 component : ThemedCommunityPageComponent ,
5152 pathMatch : 'full' ,
53+ children : [
54+ {
55+ path : '' ,
56+ component : SubComColSectionComponent ,
57+ } ,
58+ ] ,
5259 }
5360 ] ,
5461 data : {
Original file line number Diff line number Diff line change @@ -20,6 +20,7 @@ import {
2020 ThemedCollectionPageSubCollectionListComponent
2121} from './sections/sub-com-col-section/sub-collection-list/themed-community-page-sub-collection-list.component' ;
2222import { DsoPageModule } from '../shared/dso-page/dso-page.module' ;
23+ import { SubComColSectionComponent } from './sections/sub-com-col-section/sub-com-col-section.component' ;
2324
2425const DECLARATIONS = [ CommunityPageComponent ,
2526 ThemedCommunityPageComponent ,
@@ -28,7 +29,9 @@ const DECLARATIONS = [CommunityPageComponent,
2829 ThemedCollectionPageSubCollectionListComponent ,
2930 CommunityPageSubCommunityListComponent ,
3031 CreateCommunityPageComponent ,
31- DeleteCommunityPageComponent ] ;
32+ DeleteCommunityPageComponent ,
33+ SubComColSectionComponent ,
34+ ] ;
3235
3336@NgModule ( {
3437 imports : [
Original file line number Diff line number Diff line change 1+ < ng-container *ngIf ="(community$ | async) as community ">
2+ < ds-themed-community-page-sub-community-list
3+ [community] ="community ">
4+ </ ds-themed-community-page-sub-community-list >
5+ < ds-themed-community-page-sub-collection-list
6+ [community] ="community ">
7+ </ ds-themed-community-page-sub-collection-list >
8+ </ ng-container >
Original file line number Diff line number Diff line change 1+ import { ComponentFixture , TestBed } from '@angular/core/testing' ;
2+ import { SubComColSectionComponent } from './sub-com-col-section.component' ;
3+ import { ActivatedRoute } from '@angular/router' ;
4+ import { ActivatedRouteStub } from '../../../shared/testing/active-router.stub' ;
5+
6+ describe ( 'SubComColSectionComponent' , ( ) => {
7+ let component : SubComColSectionComponent ;
8+ let fixture : ComponentFixture < SubComColSectionComponent > ;
9+
10+ let activatedRoute : ActivatedRouteStub ;
11+
12+ beforeEach ( async ( ) => {
13+ activatedRoute = new ActivatedRouteStub ( ) ;
14+
15+ await TestBed . configureTestingModule ( {
16+ declarations : [
17+ SubComColSectionComponent ,
18+ ] ,
19+ providers : [
20+ { provide : ActivatedRoute , useValue : activatedRoute } ,
21+ ] ,
22+ } ) . compileComponents ( ) ;
23+
24+ fixture = TestBed . createComponent ( SubComColSectionComponent ) ;
25+ component = fixture . componentInstance ;
26+ fixture . detectChanges ( ) ;
27+ } ) ;
28+
29+ it ( 'should create' , ( ) => {
30+ expect ( component ) . toBeTruthy ( ) ;
31+ } ) ;
32+ } ) ;
Original file line number Diff line number Diff line change 1+ import { Component , OnInit } from '@angular/core' ;
2+ import { Observable } from 'rxjs' ;
3+ import { RemoteData } from '../../../core/data/remote-data' ;
4+ import { Community } from '../../../core/shared/community.model' ;
5+ import { ActivatedRoute , Data } from '@angular/router' ;
6+ import { map } from 'rxjs/operators' ;
7+
8+ @Component ( {
9+ selector : 'ds-sub-com-col-section' ,
10+ templateUrl : './sub-com-col-section.component.html' ,
11+ styleUrls : [ './sub-com-col-section.component.scss' ] ,
12+ } )
13+ export class SubComColSectionComponent implements OnInit {
14+
15+ community$ : Observable < Community > ;
16+
17+ constructor (
18+ private route : ActivatedRoute ,
19+ ) {
20+ }
21+
22+ ngOnInit ( ) : void {
23+ this . community$ = this . route . data . pipe (
24+ map ( ( data : Data ) => ( data . dso as RemoteData < Community > ) . payload ) ,
25+ ) ;
26+ }
27+
28+ }
You can’t perform that action at this time.
0 commit comments