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

MWPW-153580: Add Opt-In Feature for CaaS Badge Display #2625

Merged
merged 27 commits into from
Jul 29, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
27 commits
Select commit Hold shift + click to select a range
be90c7d
[Release] Stage to Main (#2359)
milo-pr-merge[bot] Jun 3, 2024
d9af238
[Release] Stage to Main (#2409)
milo-pr-merge[bot] Jun 4, 2024
b07f1a5
[Release] Stage to Main (#2414)
milo-pr-merge[bot] Jun 5, 2024
e5bff30
[Release] Stage to Main (#2423)
milo-pr-merge[bot] Jun 6, 2024
81d0085
[Release] Stage to Main (#2432)
milo-pr-merge[bot] Jun 10, 2024
e8300af
[Release] Stage to Main (#2447)
milo-pr-merge[bot] Jun 11, 2024
2350bd0
[Release] Stage to Main (#2462)
milo-pr-merge[bot] Jun 12, 2024
931fa67
[Release] Stage to Main (#2470)
milo-pr-merge[bot] Jun 13, 2024
ead382f
[Release] Stage to Main (#2472)
milo-pr-merge[bot] Jun 17, 2024
ddbdf7a
[Release] Stage to Main (#2479)
milo-pr-merge[bot] Jun 18, 2024
02bf1a6
[Release] Stage to Main (#2482)
milo-pr-merge[bot] Jun 19, 2024
f6fc4bf
[Release] Stage to Main (#2489)
milo-pr-merge[bot] Jun 20, 2024
47aaef0
[Release] Stage to Main (#2495)
milo-pr-merge[bot] Jun 24, 2024
03578fb
[Release] Stage to Main (#2503)
milo-pr-merge[bot] Jun 25, 2024
32f61f0
[Release] Stage to Main (#2515)
milo-pr-merge[bot] Jun 26, 2024
2217784
[Release] Stage to Main (#2520)
milo-pr-merge[bot] Jun 27, 2024
862fdab
[Release] Stage to Main (#2528)
milo-pr-merge[bot] Jul 8, 2024
88577c7
[Release] Stage to Main (#2540)
milo-pr-merge[bot] Jul 10, 2024
830f7e1
[Release] Stage to Main (#2556)
milo-pr-merge[bot] Jul 15, 2024
bc210e6
[Release] Stage to Main (#2568)
milo-pr-merge[bot] Jul 16, 2024
04e211c
[Release] Stage to Main (#2571)
milo-pr-merge[bot] Jul 17, 2024
4e99424
[Release] Stage to Main (#2580)
milo-pr-merge[bot] Jul 18, 2024
61f8c81
[Release] Stage to Main (#2592)
milo-pr-merge[bot] Jul 22, 2024
3365940
[Release] Stage to Main (#2602)
milo-pr-merge[bot] Jul 23, 2024
e89908c
[Release] Stage to Main (#2609)
milo-pr-merge[bot] Jul 24, 2024
931531b
Add Opt-In Feature for CaaS Badge Display
sanrai Jul 24, 2024
547e097
Updates for unit tests
sanrai Jul 25, 2024
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
1 change: 1 addition & 0 deletions libs/blocks/caas-config/caas-config.js
Original file line number Diff line number Diff line change
Expand Up @@ -364,6 +364,7 @@ const UiPanel = () => html`
<${Input} label="Use Overlay Links" prop="useOverlayLinks" type="checkbox" />
<${Input} label="Show total card count at top" prop="showTotalResults" type="checkbox" />
<${Input} label="Hide date for on-demand content" prop="hideDateInterval" type="checkbox" />
<${Input} label="Enable showing card badges (by default hidden)" prop="showCardBadges" type="checkbox" />
<${Select} label="Card Style" prop="cardStyle" options=${defaultOptions.cardStyle} />
<${Select} options=${defaultOptions.cardTitleAccessibilityLevel} prop="cardTitleAccessibilityLevel" label="Card Accessibility Title Level" />
<${Select} label="Layout" prop="container" options=${defaultOptions.container} />
Expand Down
2 changes: 2 additions & 0 deletions libs/blocks/caas/utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -580,6 +580,7 @@ export const getConfig = async (originalState, strs = {}) => {
}&size=${state.collectionSize || state.totalCardsToShow}${localesQueryParam}${debug}${flatFile}`,
fallbackEndpoint: state.fallbackEndpoint,
totalCardsToShow: state.totalCardsToShow,
showCardBadges: state.showCardBadges,
cardStyle: state.cardStyle,
showTotalResults: state.showTotalResults,
i18n: {
Expand Down Expand Up @@ -818,6 +819,7 @@ export const defaultState = {
secondaryTags: [],
secondarySource: [],
setCardBorders: false,
showCardBadges: false,
showFooterDivider: false,
showBookmarksFilter: false,
showBookmarksOnCards: false,
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 @@ -312,7 +312,7 @@
// The header is the part before the first / in the hash
// Due to this we only compare the characters after the header value

const hashWithoutHeader = 'bNhD9Lzw7Wafb9qDb2ruLGPBm3diLHoqgGJMjiTDFUcmhvUrR/16Q+nacm/TecL74ZvivAKU0a7JgvuI/AT3vwEHlRfbXt4UAC6ZhLf2ajEEZ7b5AhSITYkIeHMjTpqodeq/JiiwH4zEaqC0VWh6g6P0FpjUFy67Zgi0GyyPRqQJ32kiye4yR2hBT/M36CSPBqT03JuZSgsk/lKiLkjvmoNngg5QxoaM2mpstntGI7PeFkEMpK7a9i9rpClwjpvRY6Yglx9fgXn8fMMugLTqRiU+/LJcv8P6nVlx2FFo+NDWO/ZBtL0QmJIDPut+74OOB4JmqNTjV+WZ4SOFEJv72aHKxEIq+EG/he7MlUEM3lfZwNLgCa9H5EXaQ8+Nx+EeratI2NvRyuXwERUf8KKm6k6Wu0MEHqPXdWKWIJ87aka3QdreA79IEhSpm2ZXUQWONORhzBHl6GsOJhcgROLjZyVwbRvd0Hry3wCpoo3Zg4/UlAVXAWg70liR0XTGY8wQvtBSZIDdAszh+nfo7g/YlXZ6qmpuhR0VgTrf567tYiBJBDW5KrXDNsFHz/7HwCDwC48YyujOYwam2Vy0yYIsABfY66P/vMHbdQEMhCSfmEeoIEagXcnhTwZb4auzImibWturGaWh7lxC5qwM1FNqmtj5YXaWPIQ4UqMTU5MlGtY3yG5k/AljWnGLbG3xXUwekmxrJN4+HEiu8Hw8akFiSUejenGk14tAHw36Hbpca+NtCeAQny2eNpr8aj5KsAteMFQ7QnoKT2IMcG7Mip6aD40u6PBMxukd91irqYcL0TfXPSUS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9eNGAxJKMQvfmTNsjDn0w7HfodknA3xbCIzhZPms0fWk8SrIKXDNmOEB7Ck5iD3IUZkVOTQfHl3RJOKgC5/AzEaN71GetYptMmF5r/5x66zb3aueFSCb7Xp1gm6sz+5TiDDoQxxWe1BgJchxb8MHLH7BHvAG+kNK5nhQzEZhDMHEoVX+vJdrK76gO9exCi38Fq6jaQ1UbPdn16UAc8j05nqHP3U6YgX1E1yn0+A9ptG7nEHp0Z9JuR2RE9mm5XF4RKUoU2X2Lt+/HleEEXrnrekeUcDl58W0hGArfNufPd2o8I+JRVyDHnX7WceWIAbueKI5zEBdcfOLQxyWnkEEbf8B3fq27/ae6Oi0Ex1A/Iyhti+7lE+V9JGKXpJ47UJzKKMZCBI/baDpaG5wGj69ndAaarbansacm72dgphsLKHh0G5tTHKr//gcEWd70YggAAA==';

const hash = copyTextArea.value.split('#')[1].trim();

Expand Down
1 change: 1 addition & 0 deletions test/blocks/caas-config/expectedConfigs/defaultConfig.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ const defaultConfig = {
},
detailsTextOption: 'default',
setCardBorders: false,
showCardBadges: false,
showFooterDivider: false,
useOverlayLinks: false,
banner: {
Expand Down
3 changes: 3 additions & 0 deletions test/blocks/caas/utils.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -186,6 +186,7 @@ describe('getConfig', () => {
titleHeadingLevel: 'h3',
},
setCardBorders: false,
showCardBadges: false,
showFooterDivider: false,
useOverlayLinks: false,
additionalRequestParams: {},
Expand Down Expand Up @@ -448,6 +449,7 @@ describe('getConfig', () => {
titleHeadingLevel: 'h3',
},
setCardBorders: false,
showCardBadges: false,
showFooterDivider: false,
useOverlayLinks: false,
additionalRequestParams: {},
Expand Down Expand Up @@ -771,6 +773,7 @@ describe('getFloodgateCaasConfig', () => {
titleHeadingLevel: 'h3',
},
setCardBorders: false,
showCardBadges: false,
showFooterDivider: false,
useOverlayLinks: false,
additionalRequestParams: {},
Expand Down