Skip to content

Commit

Permalink
fix(mwpw-129085): fixes search issue for certain substrings for gated…
Browse files Browse the repository at this point in the history
… content for Trust Center
  • Loading branch information
sanrai committed Mar 31, 2023
1 parent 1452b1a commit 95ea0ed
Show file tree
Hide file tree
Showing 11 changed files with 24,539 additions and 2,140 deletions.
4 changes: 2 additions & 2 deletions dist/app.css

Large diffs are not rendered by default.

57 changes: 34 additions & 23 deletions dist/main.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*!
* Chimera UI Libraries - Build 3/29/2023, 23:14:48
* Chimera UI Libraries - Build 3/31/2023, 15:52:30
*
*/
/******/ (function(modules) { // webpackBootstrap
Expand Down Expand Up @@ -49845,7 +49845,8 @@ Object.defineProperty(exports, "__esModule", {

var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; };

var _slicedToArray = function () { function sliceIterator(arr, i) { var _arr = []; var _n = true; var _d = false; var _e = undefined; try { for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i["return"]) _i["return"](); } finally { if (_d) throw _e; } } return _arr; } return function (arr, i) { if (Array.isArray(arr)) { return arr; } else if (Symbol.iterator in Object(arr)) { return sliceIterator(arr, i); } else { throw new TypeError("Invalid attempt to destructure non-iterable instance"); } }; }();
var _slicedToArray = function () { function sliceIterator(arr, i) { var _arr = []; var _n = true; var _d = false; var _e = undefined; try { for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i["return"]) _i["return"](); } finally { if (_d) throw _e; } } return _arr; } return function (arr, i) { if (Array.isArray(arr)) { return arr; } else if (Symbol.iterator in Object(arr)) { return sliceIterator(arr, i); } else { throw new TypeError("Invalid attempt to destructure non-iterable instance"); } }; }(); /* eslint-disable */


var _react = __webpack_require__(0);

Expand Down Expand Up @@ -50076,25 +50077,28 @@ var OneHalfCard = function OneHalfCard(props) {
if (!data) return [];

return data.map(function (infobit) {
if (infobit.type === _constants.INFOBIT_TYPE.BOOKMARK) {
// MWPW-129085: Compiler wrongly compiles this object to private, read-only,
// Created copy so object instance has public methods and properties.
var copy = _extends({}, infobit);
if (copy.type === _constants.INFOBIT_TYPE.BOOKMARK) {
if (isGated) {
infobit.type = _constants.INFOBIT_TYPE.GATED;
copy.type = _constants.INFOBIT_TYPE.GATED;
}
return _extends({}, infobit, {
cardId: id,
disableBookmarkIco: disableBookmarkIco,
isBookmarked: isBookmarked,
onClick: onClick
});
} else if (infobit.type === _constants.INFOBIT_TYPE.DATE) {
return _extends({}, infobit, {
} else if (copy.type === _constants.INFOBIT_TYPE.DATE) {
return _extends({}, copy, {
dateFormat: dateFormat,
locale: locale
});
} else if (cardButtonStyle === 'link') {
infobit.type = _constants.INFOBIT_TYPE.LINK;
copy.type = _constants.INFOBIT_TYPE.LINK;
}
return _extends({}, infobit, {
return _extends({}, copy, {
isCta: true
});
});
Expand Down Expand Up @@ -52490,7 +52494,8 @@ Object.defineProperty(exports, "__esModule", {

var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; };

var _slicedToArray = function () { function sliceIterator(arr, i) { var _arr = []; var _n = true; var _d = false; var _e = undefined; try { for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i["return"]) _i["return"](); } finally { if (_d) throw _e; } } return _arr; } return function (arr, i) { if (Array.isArray(arr)) { return arr; } else if (Symbol.iterator in Object(arr)) { return sliceIterator(arr, i); } else { throw new TypeError("Invalid attempt to destructure non-iterable instance"); } }; }();
var _slicedToArray = function () { function sliceIterator(arr, i) { var _arr = []; var _n = true; var _d = false; var _e = undefined; try { for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i["return"]) _i["return"](); } finally { if (_d) throw _e; } } return _arr; } return function (arr, i) { if (Array.isArray(arr)) { return arr; } else if (Symbol.iterator in Object(arr)) { return sliceIterator(arr, i); } else { throw new TypeError("Invalid attempt to destructure non-iterable instance"); } }; }(); /* eslint-disable */


var _react = __webpack_require__(0);

Expand Down Expand Up @@ -52659,23 +52664,26 @@ var ProductCard = function ProductCard(props) {
if (!data) return [];

return data.map(function (infobit) {
if (infobit.type === _constants.INFOBIT_TYPE.BOOKMARK) {
return _extends({}, infobit, {
// MWPW-129085: Compiler wrongly compiles this object to private, read-only,
// Created copy so object instance has public methods and properties.
var copy = _extends({}, infobit);
if (copy.type === _constants.INFOBIT_TYPE.BOOKMARK) {
return _extends({}, copy, {
cardId: id,
disableBookmarkIco: disableBookmarkIco,
isBookmarked: isBookmarked,
onClick: onClick,
isProductCard: true
});
} else if (infobit.type === _constants.INFOBIT_TYPE.DATE) {
return _extends({}, infobit, {
} else if (copy.type === _constants.INFOBIT_TYPE.DATE) {
return _extends({}, copy, {
dateFormat: dateFormat,
locale: locale
});
} else if (cardButtonStyle === 'link') {
infobit.type = _constants.INFOBIT_TYPE.LINK;
copy.type = _constants.INFOBIT_TYPE.LINK;
}
return infobit;
return copy;
});
}

Expand Down Expand Up @@ -52721,7 +52729,7 @@ var ProductCard = function ProductCard(props) {
'p',
{
className: 'consonant-ProductCard-text' },
(0, _htmlReactParser2.default)(description)
description
),
!hideCTA && footer.map(function (footerItem) {
return _react2.default.createElement(_CardFooter2.default, {
Expand Down Expand Up @@ -52965,25 +52973,28 @@ var TextCard = function TextCard(props) {
if (!data) return [];

return data.map(function (infobit) {
if (infobit.type === _constants.INFOBIT_TYPE.BOOKMARK) {
// MWPW-129085: Compiler wrongly compiles this object to private, read-only,
// Created copy so object instance has public methods and properties.
var copy = _extends({}, infobit);
if (copy.type === _constants.INFOBIT_TYPE.BOOKMARK) {
if (isGated) {
infobit.type = _constants.INFOBIT_TYPE.GATED;
copy.type = _constants.INFOBIT_TYPE.GATED;
}
return _extends({}, infobit, {
return _extends({}, copy, {
cardId: id,
disableBookmarkIco: disableBookmarkIco,
isBookmarked: isBookmarked,
onClick: onClick
});
} else if (infobit.type === _constants.INFOBIT_TYPE.DATE) {
return _extends({}, infobit, {
} else if (copy.type === _constants.INFOBIT_TYPE.DATE) {
return _extends({}, copy, {
dateFormat: dateFormat,
locale: locale
});
} else if (cardButtonStyle === 'link') {
infobit.type = _constants.INFOBIT_TYPE.LINK;
copy.type = _constants.INFOBIT_TYPE.LINK;
}
return _extends({}, infobit, {
return _extends({}, copy, {
isCta: true
});
});
Expand Down
4 changes: 2 additions & 2 deletions dist/main.min.js

Large diffs are not rendered by default.

6 changes: 3 additions & 3 deletions dist/main.source.js

Large diffs are not rendered by default.

18 changes: 15 additions & 3 deletions e2e-tests/specs/all.e2e.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
const PORT = 5000;
const PORT = 8000;
const config = {
collection: {
mode: 'lightest', // Can be empty, "light", "dark", "darkest";
Expand All @@ -9,7 +9,7 @@ const config = {
},
lazyLoad: false,
button: {
style: 'call-to-action', // Can be "primary", "call-to-action";
style: 'call-to-action', // Can be "primary", "call-to-action", "hide-cta";
},
banner: {
upcoming: {
Expand Down Expand Up @@ -266,7 +266,7 @@ describe('MWPW-126169: Hide CTAs', async () => {
});
it('CTA should not exist', async () => {
const cloneConfig = { ...config };
cloneConfig.hideCtaIds = ['ac578dee-f01b-3ea0-a282-2116619e4251'];
cloneConfig.hideCtaIds = ['ac578dee-f01b-3ea0-a282-2116619e4251', 'ac578dee-f01b-3ea0-a282-2116619e4251'];
const state = btoa(JSON.stringify(cloneConfig));
const url = `${serverPath}/html/e2e/MWPW-126169.html?state=${state}`;
await browser.url(url);
Expand All @@ -275,6 +275,18 @@ describe('MWPW-126169: Hide CTAs', async () => {
const exists = await $('#ac578dee-f01b-3ea0-a282-2116619e4251 .consonant-BtnInfobit--cta').isDisplayed();
expect(exists).toEqual(false);
});
it('all ctas should be hidden', async () => {
const cloneConfig = { ...config };
cloneConfig.collection.collectionButtonStyle = 'hidden';
cloneConfig.collection.layout.container = '1200MaxWidth';
const state = btoa(JSON.stringify(cloneConfig));
const url = `${serverPath}/html/e2e/MWPW-126169.html?state=${state}`;
await browser.url(url);
await browser.setTimeout({ script: 50000 });
for await (const cta of $$('.consonant-Card .consonant-BtnInfobit--cta')) {
expect(cta.isDisplayed()).toEqual(false);
}
});
});
describe('Carousel', async () => {
const cloneConfig = { ...config };
Expand Down
8 changes: 4 additions & 4 deletions html/milo.html
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@

<div id="someDivId"></div>

<script type="text/javascript" src="../dist/main.js"></script>
<script type="text/javascript" src="../dist/main.source.js"></script>

<script type="text/javascript">
var config = {
Expand All @@ -45,10 +45,10 @@
description: "On Demand"
}
},
resultsPerPage: '5',
resultsPerPage: '12',
endpoint: location.hostname === "localhost" ? "../../mock-json/smoke.json" : "../../caas/mock-json/smoke.json",
totalCardsToShow: '55',
cardStyle: "1:2", // available options: "1:2", "3:4", "full-card", "half-height", "custom-card", "product", "double-wide";
totalCardsToShow: '200',
cardStyle: "product", // available options: "1:2", "3:4", "full-card", "half-height", "custom-card", "product", "double-wide";
showTotalResults: 'true',
i18n: {
prettyDateIntervalFormat: '{LLL} {dd} | {timeRange} {timeZone}',
Expand Down
8 changes: 4 additions & 4 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -73,8 +73,8 @@
description: "On Demand"
}
},
resultsPerPage: '5',
endpoint: location.hostname === "localhost" ? "../../mock-json/all-art-board-15-cards-show.json" : "../../caas/mock-json/all-art-board-15-cards-show.json",
resultsPerPage: '1',
endpoint: location.hostname === "localhost" ? "../../mock-json/smoke.json" : "../../caas/mock-json/all-art-board-15-cards-show.json",
totalCardsToShow: '55',
cardStyle: "1:2", // available options: "1:2", "3:4", "full-card", "half-height", "custom-card", "product", "double-wide";
showTotalResults: 'true',
Expand All @@ -91,10 +91,10 @@
setCardBorders: "true", // Can be true or false;
useOverlayLinks: "false", // Can be true or false;
},
featuredCards: ['c7d34f39-397c-3727-9dff-5d0d9d8cf731'],
featuredCards: ['24945b23-bfc7-3036-b552-2e44583b2d5b'],
filterPanel: {
enabled: 'true',
type: 'top',
type: 'left',
eventFilter: 'all',
showEmptyFilters: true,
filters: [
Expand Down
Loading

0 comments on commit 95ea0ed

Please sign in to comment.