@@ -67,6 +67,8 @@ export type PageFilterOptions = {
6767 contentFilterType ?: number ,
6868 startDate ?: string
6969 endDate ?: string
70+ hideSortFilter ?: boolean
71+ hideOrderFilter ?: boolean
7072 showAllArticles ?: boolean
7173 showAllArticlesOption ?: boolean
7274 includeArchived ?: boolean
@@ -92,7 +94,7 @@ function parseDateTimeString(dateStr: string | undefined) {
9294
9395export default function PageFilters ( props : PageFilterProps ) {
9496 const { options, onChange} = props ;
95- const { sortFields, defaultSortValue, asc, hideContentTypeFilter, contentFilterType, startDate, endDate, showAllArticles, showAllArticlesOption, includeArchived, includeArchivedOption} = options ;
97+ const { sortFields, defaultSortValue, asc, hideContentTypeFilter, contentFilterType, startDate, endDate, hideSortFilter , hideOrderFilter , showAllArticles, showAllArticlesOption, includeArchived, includeArchivedOption} = options ;
9698 const [ pickerAnchorEl , setPickerAnchorEl ] = React . useState ( null ) ;
9799 const parsedStart = parseDateTimeString ( startDate ) ;
98100 const parsedEnd = parseDateTimeString ( endDate ) ;
@@ -227,8 +229,8 @@ export default function PageFilters(props: PageFilterProps) {
227229 const contentLabel = contentLabelMap [ contentFilterType || 0 ] ;
228230 const sortLabel = getSortLabel ( defaultSortValue ) ;
229231 const orderLabel = asc ? t ( 'page:sortOldest' ) : t ( 'page:sortNewest' ) ;
230- const showSort = sortFields . length > 1 || isPhone ;
231- const showOrder = defaultSortValue !== 'VOTE_SCORE' ;
232+ const showSort = ! hideSortFilter && ( sortFields . length > 1 || isPhone ) ;
233+ const showOrder = ! hideOrderFilter && defaultSortValue !== 'VOTE_SCORE' ;
232234 const hasFilterChanges = ! isDeepEqual ( initialOptionsRef . current , options ) ;
233235
234236 function handleSortByChange ( event , value ) {
0 commit comments