Skip to content

Commit

Permalink
Udate config (#1030)
Browse files Browse the repository at this point in the history
  • Loading branch information
thecalcc authored Aug 19, 2024
1 parent a06a335 commit e4a8aa6
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 2 deletions.
1 change: 1 addition & 0 deletions assets/globals.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,7 @@ interface IClientConfig {
}
};
agenda_sort_events_with_coverage_on_top?: boolean;
collapsed_search_by_default?: boolean;
show_user_register?: boolean;
multimedia_website_search_url?: string;
}
Expand Down
5 changes: 3 additions & 2 deletions assets/search/components/SearchResultsBar/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import {connect} from 'react-redux';

import {IAgendaState, IFilterGroup, INavigation, ISearchFields, ISearchParams, ITopic, IUser, ISearchSortValue} from 'interfaces';

import {gettext} from 'utils';
import {COLLAPSED_SEARCH_BY_DEFAULT, gettext} from 'utils';
import {searchParamsSelector, navigationsByIdSelector, filterGroupsByIdSelector} from '../../selectors';
import {getAdvancedSearchFields} from '../../utils';
import {
Expand Down Expand Up @@ -105,8 +105,9 @@ class SearchResultsBarComponent extends React.Component<IProps, IState> {
super(props);

this.topicNotNull = new URLSearchParams(window.location.search).get('topic') != null;

this.state = {
isTagSectionShown: this.props.initiallyOpen || this.topicNotNull,
isTagSectionShown: COLLAPSED_SEARCH_BY_DEFAULT === true ? false : (this.props.initiallyOpen || this.topicNotNull),
};

this.toggleTagSection = this.toggleTagSection.bind(this);
Expand Down
1 change: 1 addition & 0 deletions assets/utils.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,7 @@ 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_SORT_EVENTS_WITH_COVERAGE_ON_TOP = getConfig('agenda_sort_events_with_coverage_on_top', false);
export const COLLAPSED_SEARCH_BY_DEFAULT = getConfig('collapsed_search_by_default', false);
export const DISPLAY_AUTHOR_ROLE = getConfig('display_author_role', 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);
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 @@ -398,6 +398,7 @@
},
},
"agenda_sort_events_with_coverage_on_top": False,
"collapsed_search_by_default": False,
}

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

0 comments on commit e4a8aa6

Please sign in to comment.