Skip to content

Commit f16a03e

Browse files
authored
Merge pull request #4217 from kshepherd/rss-sort-link-fix
Several fixes to RSS component and object lists
2 parents 28f865e + 6cd88ec commit f16a03e

16 files changed

Lines changed: 153 additions & 65 deletions

src/app/app-routes.ts

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -109,14 +109,12 @@ export const APP_ROUTES: Route[] = [
109109
path: COMMUNITY_MODULE_PATH,
110110
loadChildren: () => import('./community-page/community-page-routes')
111111
.then((m) => m.ROUTES),
112-
data: { enableRSS: true },
113112
canActivate: [endUserAgreementCurrentUserGuard],
114113
},
115114
{
116115
path: COLLECTION_MODULE_PATH,
117116
loadChildren: () => import('./collection-page/collection-page-routes')
118117
.then((m) => m.ROUTES),
119-
data: { enableRSS: true },
120118
canActivate: [endUserAgreementCurrentUserGuard],
121119
},
122120
{

src/app/collection-page/collection-page-routes.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -100,6 +100,7 @@ export const ROUTES: Route[] = [
100100
data: {
101101
breadcrumbKey: 'collection.search',
102102
menuRoute: MenuRoute.COLLECTION_PAGE,
103+
enableRSS: true,
103104
},
104105
},
105106
{

src/app/community-page/community-page-routes.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -90,6 +90,7 @@ export const ROUTES: Route[] = [
9090
data: {
9191
breadcrumbKey: 'community.search',
9292
menuRoute: MenuRoute.COMMUNITY_PAGE,
93+
enableRSS: true,
9394
},
9495
},
9596
{

src/app/home-page/top-level-community-list/top-level-community-list.component.html

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ <h2>
88
<ds-viewable-collection
99
[config]="config"
1010
[sortConfig]="sortConfig"
11+
[showRSS]="rssSortConfig"
1112
[objects]="communitiesRD$ | async"
1213
[hideGear]="true">
1314
</ds-viewable-collection>

src/app/home-page/top-level-community-list/top-level-community-list.component.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,9 +65,10 @@ export class TopLevelCommunityListComponent implements OnInit, OnDestroy {
6565
pageId = 'tl';
6666

6767
/**
68-
* The sorting configuration
68+
* The sorting configuration for the community list itself, and the optional RSS feed button
6969
*/
7070
sortConfig: SortOptions;
71+
rssSortConfig: SortOptions;
7172

7273
/**
7374
* The subscription to the observable for the current page.
@@ -84,6 +85,7 @@ export class TopLevelCommunityListComponent implements OnInit, OnDestroy {
8485
this.config.pageSize = appConfig.homePage.topLevelCommunityList.pageSize;
8586
this.config.currentPage = 1;
8687
this.sortConfig = new SortOptions('dc.title', SortDirection.ASC);
88+
this.rssSortConfig = new SortOptions('dc.date.accessioned', SortDirection.DESC);
8789
}
8890

8991
ngOnInit() {

src/app/shared/object-collection/object-collection.component.html

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313
[linkType]="linkType"
1414
[context]="context"
1515
[hidePaginationDetail]="hidePaginationDetail"
16+
[showRSS]="showRSS"
1617
[showPaginator]="showPaginator"
1718
[showThumbnails]="showThumbnails"
1819
(paginationChange)="onPaginationChange($event)"
@@ -58,6 +59,7 @@
5859
[sortConfig]="sortConfig"
5960
[objects]="objects"
6061
[hideGear]="hideGear"
62+
[showRSS]="showRSS"
6163
[linkType]="linkType"
6264
[context]="context"
6365
[hidePaginationDetail]="hidePaginationDetail"

src/app/shared/object-collection/object-collection.component.ts

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -71,17 +71,22 @@ export class ObjectCollectionComponent implements OnInit {
7171
@Input() sortConfig: SortOptions;
7272

7373
/**
74-
* Whether or not the list elements have a border or not
74+
* Whether the list elements have a border or not
7575
*/
7676
@Input() hasBorder = false;
7777

7878
/**
79-
* Whether or not to hide the gear to change the sort and pagination configuration
79+
* Whether to hide the gear to change the sort and pagination configuration
8080
*/
8181
@Input() hideGear = false;
8282
@Input() selectable = false;
8383
@Input() selectionConfig: {repeatable: boolean, listId: string};
8484

85+
/**
86+
* Whether to show an RSS syndication button for the current search options
87+
*/
88+
@Input() showRSS: SortOptions | boolean = false;
89+
8590
/**
8691
* Emit custom event for listable object custom actions.
8792
*/

src/app/shared/object-detail/object-detail.component.html

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
[sortOptions]="sortConfig"
55
[objects]="objects"
66
[hideGear]="hideGear"
7+
[showRSS]="showRSS"
78
[hidePaginationDetail]="hidePaginationDetail"
89
[hidePagerWhenSinglePage]="hidePagerWhenSinglePage"
910
[showPaginator]="showPaginator"

src/app/shared/object-detail/object-detail.component.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -85,6 +85,11 @@ export class ObjectDetailComponent {
8585
*/
8686
@Input() showThumbnails;
8787

88+
/**
89+
* Whether to show the RSS syndication link. Either false, or valid SortOptions object
90+
*/
91+
@Input() showRSS: SortOptions | boolean = false;
92+
8893
/**
8994
* Emit when one of the listed object has changed.
9095
*/

src/app/shared/object-list/object-list.component.html

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
[objects]="objects"
55
[sortOptions]="sortConfig"
66
[hideGear]="hideGear"
7+
[showRSS]="showRSS"
78
[hidePagerWhenSinglePage]="hidePagerWhenSinglePage"
89
[hidePaginationDetail]="hidePaginationDetail"
910
[showPaginator]="showPaginator"

0 commit comments

Comments
 (0)