fix(client): remove url parameters from forum href (#44157)
* fix(client): remove url parameters from forum href * add tests for removeUrlParamters * use URL API, Shaun's preferred method
This commit is contained in:
@ -38,8 +38,10 @@ function createQuestionEpic(action$, state$, { window }) {
|
|||||||
challengeMetaSelector(state);
|
challengeMetaSelector(state);
|
||||||
const {
|
const {
|
||||||
navigator: { userAgent },
|
navigator: { userAgent },
|
||||||
location: { href }
|
location: { pathname, origin }
|
||||||
} = window;
|
} = window;
|
||||||
|
// Removes query params
|
||||||
|
const challengeUrl = new URL(pathname, origin).href;
|
||||||
const projectFormValues = Object.entries(
|
const projectFormValues = Object.entries(
|
||||||
projectFormValuesSelector(state)
|
projectFormValuesSelector(state)
|
||||||
);
|
);
|
||||||
@ -51,7 +53,7 @@ function createQuestionEpic(action$, state$, { window }) {
|
|||||||
'forum-help.challenge'
|
'forum-help.challenge'
|
||||||
)} ${challengeTitle}\n\n${i18next.t(
|
)} ${challengeTitle}\n\n${i18next.t(
|
||||||
'forum-help.challenge-link'
|
'forum-help.challenge-link'
|
||||||
)}\n${href}`
|
)}\n${challengeUrl}`
|
||||||
);
|
);
|
||||||
|
|
||||||
let textMessage = dedent(`${i18next.t(
|
let textMessage = dedent(`${i18next.t(
|
||||||
|
Reference in New Issue
Block a user