Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add a config option for top story sorting or default sorting #976

Merged
merged 3 commits into from
Jun 26, 2024
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions assets/agenda/components/AgendaList.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ import {getIntVersion} from 'wire/utils';
import {getPlanningItemsByGroup, getListItems, isTopStory} from 'agenda/utils';
import {searchNavigationSelector} from 'search/selectors';
import {previewConfigSelector, listConfigSelector} from 'ui/selectors';
import {AGENDA_DATE_FORMAT_LONG, AGENDA_DATE_FORMAT_SHORT} from '../../utils';
import {AGENDA_DATE_FORMAT_LONG, AGENDA_DATE_FORMAT_SHORT, AGENDA_TOP_STORY_SORTING_ONLY} from '../../utils';


const PREVIEW_TIMEOUT = 500; // time to preview an item after selecting using kb
Expand Down Expand Up @@ -64,7 +64,7 @@ const getItemIdsSorted = (
} else {
restIds.push(item._id);
}
} else if (hasCoverage) {
} else if (hasCoverage && AGENDA_TOP_STORY_SORTING_ONLY == false) {

// items with coverages are displayed after top stories
coveragesOnlyIds.push(item._id);
Expand Down Expand Up @@ -520,4 +520,4 @@ function getLastGroupWithItems(groupedItems: Array<IAgendaListGroup>): number {

// If no groups have items, return the last group
return groupedItems.length - 1;
}
}
1 change: 1 addition & 0 deletions assets/globals.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,7 @@ interface IClientConfig {
button_label: string;
}
};
agenda_top_story_sorting_only?: boolean;
show_user_register?: boolean;
multimedia_website_search_url?: string;
}
Expand Down
1 change: 1 addition & 0 deletions assets/utils.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,7 @@ export const SERVER_DATETIME_FORMAT = 'YYYY-MM-DDTHH:mm:ss+0000';
export const DAY_IN_MINUTES = 24 * 60 - 1;
export const LIST_ANIMATIONS = getConfig('list_animations', true);
export const DISPLAY_NEWS_ONLY = getConfig('display_news_only', true);
export const AGENDA_TOP_STORY_SORTING_ONLY = getConfig('agenda_top_story_sorting_only', true);
export const DISPLAY_AGENDA_FEATURED_STORIES_ONLY = getConfig('display_agenda_featured_stories_only', true);
export const DISPLAY_ALL_VERSIONS_TOGGLE = getConfig('display_all_versions_toggle', true);
export const DEFAULT_TIMEZONE = getConfig('default_timezone', 'Australia/Sydney');
Expand Down
1 change: 1 addition & 0 deletions newsroom/web/default_settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -396,6 +396,7 @@
"button_label": lazy_gettext("Completed"),
},
},
"agenda_top_story_sorting_only": True,
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

would call it probably agenda_sort_events_with_coverage_on_top or something to be more descriptive

}

# Enable rendering of the date in the base view
Expand Down
Loading