Skip to content

Commit

Permalink
110889: Added recently added section to community page
Browse files Browse the repository at this point in the history
  • Loading branch information
alexandrevryghem committed Jan 8, 2024
1 parent 130fefd commit f649283
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 8 deletions.
6 changes: 6 additions & 0 deletions src/app/community-page/community-page-routing.module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ import { SubComColSectionComponent } from './sections/sub-com-col-section/sub-co
import { BrowseByI18nBreadcrumbResolver } from '../browse-by/browse-by-i18n-breadcrumb.resolver';
import { BrowseByGuard } from '../browse-by/browse-by-guard';
import { ComcolBrowseByComponent } from '../shared/comcol/sections/comcol-browse-by/comcol-browse-by.component';
import { ComcolRecentlyAddedComponent } from '../shared/comcol/sections/comcol-recently-added/comcol-recently-added.component';

@NgModule({
imports: [
Expand Down Expand Up @@ -56,6 +57,11 @@ import { ComcolBrowseByComponent } from '../shared/comcol/sections/comcol-browse
{
path: '',
pathMatch: 'full',
component: ComcolRecentlyAddedComponent,
},
{
path: 'subcoms-cols',
pathMatch: 'full',
component: SubComColSectionComponent,
},
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ export class SubComColSectionComponent implements OnInit {
}

ngOnInit(): void {
this.community$ = this.route.data.pipe(
this.community$ = this.route.parent.data.pipe(
map((data: Data) => (data.dso as RemoteData<Community>).payload),
);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -54,17 +54,21 @@ export class ComcolPageBrowseByComponent implements OnDestroy, OnInit {
let comColRoute: string;
if (this.contentType === 'collection') {
comColRoute = getCollectionPageRoute(this.id);
allOptions.push({
id: 'recent_submissions',
label: 'collection.page.browse.recent.head',
routerLink: comColRoute,
});
} else if (this.contentType === 'community') {
comColRoute = getCommunityPageRoute(this.id);
}

allOptions.push({
id: 'recent_submissions',
label: 'collection.page.browse.recent.head',
routerLink: comColRoute,
});

if (this.contentType === 'community') {
allOptions.push({
id: 'comcols',
label: 'community.all-lists.head',
routerLink: comColRoute,
routerLink: `${comColRoute}/subcoms-cols`,
});
}

Expand Down
2 changes: 1 addition & 1 deletion src/assets/i18n/en.json5
Original file line number Diff line number Diff line change
Expand Up @@ -1298,7 +1298,7 @@

"community.page.news": "News",

"community.all-lists.head": "Subcommunities and Collections",
"community.all-lists.head": "Subcommunities & Collections",

"community.sub-collection-list.head": "Collections in this Community",

Expand Down

0 comments on commit f649283

Please sign in to comment.