Skip to content

Commit

Permalink
Add sort direction to highlighted communities
Browse files Browse the repository at this point in the history
  • Loading branch information
abelgomez committed May 23, 2024
1 parent e770f00 commit 38b070f
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 1 deletion.
3 changes: 3 additions & 0 deletions src/config/default-app-config.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import { SortDirection } from 'src/app/core/cache/models/sort-options.model';

Check failure on line 1 in src/config/default-app-config.ts

View workflow job for this annotation

GitHub Actions / tests (18.x)

Run autofix to sort these imports!

Check failure on line 1 in src/config/default-app-config.ts

View workflow job for this annotation

GitHub Actions / tests (20.x)

Run autofix to sort these imports!
import { AdminNotifyMetricsRow } from '../app/admin/admin-notify-dashboard/admin-notify-metrics/admin-notify-metrics.model';
import { RestRequestMethod } from '../app/core/data/rest-request-method';
import { NotificationAnimationsType } from '../app/shared/notifications/models/notification-animations-type';
Expand Down Expand Up @@ -597,6 +598,8 @@ export class DefaultAppConfig implements AppConfig {
pageSize:5,
// sort record of highlighted submissions
sortField: 'dc.title',
// sort direction of highlighted submissions
sortDirection: SortDirection.DESC,
// Show communities whose title contains the current year
query: 'dc.title:' + new Date().getFullYear(),
},
Expand Down
2 changes: 2 additions & 0 deletions src/environments/environment.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import { BuildConfig } from 'src/config/build-config.interface';

import { RestRequestMethod } from '../app/core/data/rest-request-method';
import { NotificationAnimationsType } from '../app/shared/notifications/models/notification-animations-type';
import { SortDirection } from 'src/app/core/cache/models/sort-options.model';

export const environment: BuildConfig = {
production: false,
Expand Down Expand Up @@ -426,6 +427,7 @@ export const environment: BuildConfig = {
highlightedCommunities: {
pageSize:5,
sortField: 'dc.title',
sortDirection: SortDirection.DESC,
query: 'dc.title:' + new Date().getFullYear(),
}

Check failure on line 432 in src/environments/environment.test.ts

View workflow job for this annotation

GitHub Actions / tests (18.x)

Missing trailing comma

Check failure on line 432 in src/environments/environment.test.ts

View workflow job for this annotation

GitHub Actions / tests (20.x)

Missing trailing comma
}

Check failure on line 433 in src/environments/environment.test.ts

View workflow job for this annotation

GitHub Actions / tests (18.x)

Missing trailing comma

Check failure on line 433 in src/environments/environment.test.ts

View workflow job for this annotation

GitHub Actions / tests (20.x)

Missing trailing comma
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ export class HighlightedCommunitiesListComponent implements OnInit {
currentPage: 1,
maxSize: 1,
});
this.sortConfig = new SortOptions(environment.sistedes.highlightedCommunities.sortField, SortDirection.ASC);
this.sortConfig = new SortOptions(environment.sistedes.highlightedCommunities.sortField, environment.sistedes.highlightedCommunities.sortDirection);
}
ngOnInit(): void {
const linksToFollow: FollowLinkConfig<Item>[] = [];
Expand Down
6 changes: 6 additions & 0 deletions src/themes/sistedes/sistedes-config.interface.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import { SortDirection } from 'src/app/core/cache/models/sort-options.model';
import { Config } from 'src/config/config.interface';

/**
Expand All @@ -15,6 +16,11 @@ export interface SistedesConfig extends Config {
*/
sortField: string;

/**
* sort direction of recent submission
*/
sortDirection: SortDirection;

/**
* query used to retrieve the recent communities
*/
Expand Down

0 comments on commit 38b070f

Please sign in to comment.