Skip to content

Commit f33d2d3

Browse files
committed
#4172 Several fixes to RSS component and object lists
* RSS button displayed on search result pages * RSS button displayed on Recent Items component * RSS button NOT displayed in other components like top-level community, etc. * RSS component tracks sort option changes
1 parent 6a49cdb commit f33d2d3

13 files changed

Lines changed: 134 additions & 63 deletions

src/app/home-page/recent-item-list/recent-item-list.component.html

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
<div class="mt-4" [ngClass]="placeholderFontClass" @fadeIn>
44
<div class="d-flex flex-row border-bottom mb-4 pb-4"></div>
55
<h2> {{'home.recent-submissions.head' | translate}}</h2>
6+
<ds-rss [sortConfig]="sortConfig"></ds-rss>
67
@for (item of itemRD?.payload?.page; track item) {
78
<div class="my-4">
89
<ds-listable-object-component-loader [object]="item" [viewMode]="viewMode" class="pb-4">

src/app/home-page/recent-item-list/recent-item-list.component.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,7 @@ import {
4848
} from '../../shared/utils/follow-link-config.model';
4949
import { setPlaceHolderAttributes } from '../../shared/utils/object-list-utils';
5050
import { VarDirective } from '../../shared/utils/var.directive';
51+
import { RSSComponent } from '../../shared/rss-feed/rss.component';
5152

5253
@Component({
5354
selector: 'ds-recent-item-list',
@@ -59,7 +60,7 @@ import { VarDirective } from '../../shared/utils/var.directive';
5960
fadeInOut,
6061
],
6162
standalone: true,
62-
imports: [VarDirective, NgClass, ListableObjectComponentLoaderComponent, ErrorComponent, ThemedLoadingComponent, AsyncPipe, TranslateModule],
63+
imports: [VarDirective, NgClass, ListableObjectComponentLoaderComponent, ErrorComponent, ThemedLoadingComponent, AsyncPipe, TranslateModule, RSSComponent],
6364
})
6465
export class RecentItemListComponent implements OnInit, OnDestroy {
6566
itemRD$: Observable<RemoteData<PaginatedList<Item>>>;

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 = 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: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -85,6 +85,8 @@ export class ObjectDetailComponent {
8585
*/
8686
@Input() showThumbnails;
8787

88+
@Input() showRSS = false;
89+
8890
/**
8991
* Emit when one of the listed object has changed.
9092
*/

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"

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

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ import { SelectableListService } from './selectable-list/selectable-list.service
3939
})
4040
export class ObjectListComponent {
4141
/**
42-
* The view mode of the this component
42+
* The view mode of this component
4343
*/
4444
viewMode = ViewMode.ListElement;
4545

@@ -70,6 +70,11 @@ export class ObjectListComponent {
7070
@Input() selectable = false;
7171
@Input() selectionConfig: { repeatable: boolean, listId: string };
7272

73+
/**
74+
* Whether to show an RSS syndication button for the current search options
75+
*/
76+
@Input() showRSS = false;
77+
7378
/**
7479
* The link type of the listable elements
7580
*/

src/app/shared/object-list/themed-object-list.component.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,8 @@ export class ThemedObjectListComponent extends ThemedComponent<ObjectListCompone
5959

6060
@Input() selectionConfig: { repeatable: boolean, listId: string };
6161

62+
@Input() showRSS = false;
63+
6264
/**
6365
* The link type of the listable elements
6466
*/
@@ -163,6 +165,7 @@ export class ThemedObjectListComponent extends ThemedComponent<ObjectListCompone
163165
'sortConfig',
164166
'hasBorder',
165167
'hideGear',
168+
'showRSS',
166169
'hidePagerWhenSinglePage',
167170
'selectable',
168171
'selectionConfig',

src/app/shared/pagination/pagination.component.html

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,9 @@
4343
</ul>
4444
</div>
4545
}
46-
<ds-rss></ds-rss>
46+
@if (showRSS) {
47+
<ds-rss [sortConfig]="this.sortOptions"></ds-rss>
48+
}
4749
</div>
4850
</div>
4951
</div>

0 commit comments

Comments
 (0)