admin: change path behaviour for the billionth time

URLs are made with app.ExternalURI (now included in window.pages), which
itself should include Base. Also fixed the subfolder being removed from
the url after login.
This commit is contained in:
Harvey Tindall
2025-05-27 15:40:08 +01:00
parent d8e624ad22
commit 42d1abe130
7 changed files with 32 additions and 13 deletions
+7 -1
View File
@@ -4,6 +4,12 @@ import { reloadProfileNames } from "../modules/profiles.js";
declare var window: GlobalWindow;
export const generateCodeLink = (code: string): string => {
// let codeLink = window.pages.Base + window.pages.Form + "/" + code;
let codeLink = window.pages.ExternalURI + window.pages.Form + "/" + code;
return codeLink;
}
class DOMInvite implements Invite {
updateNotify = (checkbox: HTMLInputElement) => {
let state: { [code: string]: { [type: string]: boolean } } = {};
@@ -63,7 +69,7 @@ class DOMInvite implements Invite {
get code(): string { return this._code; }
set code(code: string) {
this._code = code;
this._codeLink = window.pages.Base + window.pages.Form + "/" + code;
this._codeLink = generateCodeLink(code);
const linkEl = this._codeArea.querySelector("a") as HTMLAnchorElement;
if (this.label == "") {
linkEl.textContent = code.replace(/-/g, '-');