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-135191 Hide caas link that has a query param #1114

Merged
merged 6 commits into from
Aug 17, 2023
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
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
12 changes: 8 additions & 4 deletions libs/blocks/caas-config/caas-config.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
/* eslint-disable react-hooks/exhaustive-deps */
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The code compat check currently fails: https://github.com/adobecom/milo/actions/runs/5881564701/job/15970376456?pr=1114#step:3:30

Looks like you need to explicitly add react-hooks to the plugins array in .eslintrc-code-compatibility.js (found in https://stackoverflow.com/questions/59611822/definition-for-rule-react-hooks-exhaustive-deps-was-not-found).

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍 Thx. I'm not actually sure we need to run this code compat step as it should be covered by the eslint pass, but will have to defer investigating for now.

/* global ClipboardItem */
import {
createContext,
Expand Down Expand Up @@ -564,7 +565,7 @@ const FilterPanel = ({ tagsData }) => {
<${TagSelect} id="customFilterTag" options=${allTags} label="Filter Tag" singleSelect />
<//>
<!-- End nested multifield -->
<${FormInput} label="Opened on load" name="openedOnLoad" type="checkbox" />
<//>
`;
Expand Down Expand Up @@ -739,8 +740,10 @@ const CopyBtn = () => {
};

const getUrl = () => {
const url = window.location.href.split('#')[0];
return `${url}#${utf8ToB64(JSON.stringify(state, fgKeyReplacer))}`;
const url = new URL(window.location.href);
url.search = '';
url.hash = utf8ToB64(JSON.stringify(state, fgKeyReplacer));
return url.href;
};

const copyConfig = () => {
Expand Down Expand Up @@ -893,7 +896,8 @@ const Configurator = ({ rootEl }) => {
setIsCaasLoaded(true);
})
.catch((e) => {
/* c8 ignore next */
/* c8 ignore next 2 */
// eslint-disable-next-line no-console
console.log('Error loading script: ', e);
});
}, []);
Expand Down
2 changes: 1 addition & 1 deletion libs/blocks/caas/caas.css
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
a[href*='/tools/caas#'] {
a[href*='/tools/caas#'], a[href*='/tools/caas?'] {
visibility: hidden !important;
}

Expand Down