Skip to content

Commit

Permalink
MWPW-155425: [CAAS Authoring] ability to add multiple event states (#…
Browse files Browse the repository at this point in the history
…3503)

* Revert "MWPW-140452 - Icon authoring in milo using the federal repo a… (#3357)

Revert "MWPW-140452 - Icon authoring in milo using the federal repo and individual SVG assets (#3259)"

This reverts commit 81a5770.

* [Release] Stage to Main (#3497)

MWPW-165774 [Mobile-GNAV] page is not scrollable in live page (#3495)

* check for new nav when disabling ios scroll

* shortened the check from the previous commit

Co-authored-by: Raghav Sharma <[email protected]>

* MWPW-155425: ability to add multiple event states

* MWPW-155425: adjusting the order of the filter messages

* MWPW-155425: unit tests

---------

Co-authored-by: milo-pr-merge[bot] <169241390+milo-pr-merge[bot]@users.noreply.github.com>
Co-authored-by: Okan Sahin <[email protected]>
Co-authored-by: Raghav Sharma <[email protected]>
Co-authored-by: Sheridan Sunier <[email protected]>
Co-authored-by: Sheridan Sunier <[email protected]>
  • Loading branch information
6 people authored Feb 4, 2025
1 parent 63fcdd5 commit 9d63c21
Show file tree
Hide file tree
Showing 5 changed files with 8 additions and 9 deletions.
3 changes: 1 addition & 2 deletions libs/blocks/caas-config/caas-config.js
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,6 @@ const defaultOptions = {
custom: 'Custom',
},
filterEvent: {
'': 'All',
live: 'Live',
upcoming: 'Upcoming',
'on-demand': 'On Demand',
Expand Down Expand Up @@ -585,7 +584,6 @@ const FilterPanel = ({ tagsData }) => {
<${Input} label="Show Empty Filters" prop="filtersShowEmpty" type="checkbox" />
<${Select} label="Filter Location" prop="filterLocation" options=${defaultOptions.filterLocation} />
<${Select} label="Filter logic within each tag panel" prop="filterLogic" options=${defaultOptions.filterLogic} />
<${Select} label="Event Filter" prop="filterEvent" options=${defaultOptions.filterEvent} />
<${Select} label="Automatic or Custom Panel" prop="filterBuildPanel" options=${defaultOptions.filterBuildPanel} />
`;

Expand Down Expand Up @@ -642,6 +640,7 @@ const FilterPanel = ({ tagsData }) => {
&& (state.filterBuildPanel === 'custom'
? FilterCustomBuildPanel
: FilterBuildPanel)}
<${DropdownSelect} id="filterEvent" options=${defaultOptions.filterEvent} prop="filterEvent" label="Event Filters" />
`;
};

Expand Down
4 changes: 2 additions & 2 deletions libs/blocks/caas/utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -657,7 +657,7 @@ export const getConfig = async (originalState, strs = {}) => {
featuredCards: featuredCards.split(URL_ENCODED_COMMA),
filterPanel: {
enabled: state.showFilters,
eventFilter: state.filterEvent,
eventFilter: state.filterEvent || [],
type: state.showFilters ? state.filterLocation : 'left',
showEmptyFilters: state.filtersShowEmpty,
filters: await getFilterArray(state, country, language, strs),
Expand Down Expand Up @@ -824,7 +824,7 @@ export const defaultState = {
excludeTags: [],
fallbackEndpoint: '',
featuredCards: [],
filterEvent: '',
filterEvent: [],
filterBuildPanel: 'automatic',
filterLocation: 'left',
filterLogic: 'or',
Expand Down
2 changes: 1 addition & 1 deletion test/blocks/caas-config/caas-config.test.html
Original file line number Diff line number Diff line change
Expand Up @@ -286,7 +286,7 @@
showFiltersCb.dispatchEvent(new Event('change'));
await delay(50);

expect(findByLabel('Event Filter')).to.not.be.null;
expect(findByLabel('Show Empty Filters')).to.not.be.null;

// Verify adding of filter tag
const addBtn = configPanelEl.querySelector('.filters.multifield-add');
Expand Down
2 changes: 1 addition & 1 deletion test/blocks/caas-config/expectedConfigs/defaultConfig.js
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@ const defaultConfig = {
},
],
enabled: false,
eventFilter: '',
eventFilter: [],
type: 'left',
showEmptyFilters: false,
filters: [],
Expand Down
6 changes: 3 additions & 3 deletions test/blocks/caas/utils.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -212,7 +212,7 @@ describe('getConfig', () => {
hideCtaTags: [],
filterPanel: {
enabled: true,
eventFilter: '',
eventFilter: [],
type: 'left',
showEmptyFilters: false,
categories: [
Expand Down Expand Up @@ -481,7 +481,7 @@ describe('getConfig', () => {
hideCtaTags: [],
filterPanel: {
enabled: true,
eventFilter: '',
eventFilter: [],
type: 'left',
showEmptyFilters: false,
categories: [
Expand Down Expand Up @@ -846,7 +846,7 @@ describe('getFloodgateCaasConfig', () => {
hideCtaTags: [],
filterPanel: {
enabled: true,
eventFilter: '',
eventFilter: [],
type: 'left',
showEmptyFilters: false,
categories: [
Expand Down

0 comments on commit 9d63c21

Please sign in to comment.