web: remove manually URL encoded paths

Signed-off-by: Jens Langhammer <jens.langhammer@beryju.org>
This commit is contained in:
Jens Langhammer 2021-11-18 21:33:49 +01:00
parent 465898c7d0
commit e6638afa3c
4 changed files with 14 additions and 4 deletions

View File

@ -167,7 +167,9 @@ export class AdminInterface extends LitElement {
return html`<ak-sidebar-item
?highlight=${true}
?isAbsoluteLink=${true}
path=${`/-/impersonation/end/?back=${window.location.pathname}%23${window.location.hash}`}
path=${`/-/impersonation/end/?back=${encodeURIComponent(
`${window.location.pathname}#${window.location.hash}`,
)}`}
>
<span slot="label"
>${t`You're currently impersonating ${u.user.username}. Click to stop.`}</span

View File

@ -222,7 +222,9 @@ export class UserInterface extends LitElement {
<div class="pf-c-page__header-tools-group">
<a
class="pf-c-button pf-m-warning pf-m-small"
href=${`/-/impersonation/end/?back=${window.location.pathname}%23${window.location.hash}`}
href=${`/-/impersonation/end/?back=${encodeURIComponent(
`${window.location.pathname}#${window.location.hash}`,
)}`}
>
${t`Stop impersonation`}
</a>

View File

@ -114,7 +114,9 @@ export class FlowListPage extends TablePage<Flow> {
})
.then((link) => {
window.open(
`${link.link}?inspector&next=/%23${window.location.href}`,
`${link.link}?inspector&next=${encodeURIComponent(
`/#${window.location.href}`,
)}`,
);
});
}}

View File

@ -119,7 +119,11 @@ export class FlowViewPage extends LitElement {
slug: this.flow.slug,
})
.then((link) => {
const finalURL = `${link.link}?inspector&next=/%23${window.location.hash}`;
const finalURL = `${
link.link
}?${encodeURI(
`inspector&next=/#${window.location.hash}`,
)}`;
window.open(finalURL, "_blank");
});
}}