Merge branch 'dev' — resolve getApiBase conflicts (take dev version)
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
commit
a01c5fc267
|
|
@ -354,8 +354,8 @@ class FolkCalendarView extends HTMLElement {
|
|||
|
||||
private getApiBase(): string {
|
||||
// When on the rcal page directly, extract from URL
|
||||
const match = window.location.pathname.match(/^\/([^/]+)\/rcal/);
|
||||
if (match) return `/${match[1]}/rcal`;
|
||||
const match = window.location.pathname.match(/^(\/[^/]+)?\/rcal/);
|
||||
if (match) return match[0];
|
||||
// When embedded as a canvas shape, use the space attribute
|
||||
if (this.space) return `/${this.space}/rcal`;
|
||||
return "";
|
||||
|
|
|
|||
|
|
@ -183,10 +183,9 @@ class FolkCartShop extends HTMLElement {
|
|||
}
|
||||
|
||||
private getApiBase(): string {
|
||||
const match = window.location.pathname.match(/^\/([^/]+)\/rcart/);
|
||||
if (match) return `/${match[1]}/rcart`;
|
||||
if (this.space) return `/${this.space}/rcart`;
|
||||
return "/demo/rcart";
|
||||
const path = window.location.pathname;
|
||||
const match = path.match(/^(\/[^/]+)?\/rcart/);
|
||||
return match ? match[0] : "/rcart";
|
||||
}
|
||||
|
||||
private async loadData() {
|
||||
|
|
|
|||
|
|
@ -42,10 +42,9 @@ class FolkChoicesDashboard extends HTMLElement {
|
|||
}
|
||||
|
||||
private getApiBase(): string {
|
||||
const match = window.location.pathname.match(/^\/([^/]+)\/rchoices/);
|
||||
if (match) return `/${match[1]}/rchoices`;
|
||||
if (this.space) return `/${this.space}/rchoices`;
|
||||
return "/demo/rchoices";
|
||||
const path = window.location.pathname;
|
||||
const match = path.match(/^(\/[^/]+)?\/rchoices/);
|
||||
return match ? match[0] : "/rchoices";
|
||||
}
|
||||
|
||||
private async loadChoices() {
|
||||
|
|
|
|||
|
|
@ -160,10 +160,9 @@ class FolkFileBrowser extends HTMLElement {
|
|||
}
|
||||
|
||||
private getApiBase(): string {
|
||||
const match = window.location.pathname.match(/^\/([^/]+)\/rfiles/);
|
||||
if (match) return `/${match[1]}/rfiles`;
|
||||
if (this.space) return `/${this.space}/rfiles`;
|
||||
return "";
|
||||
const path = window.location.pathname;
|
||||
const match = path.match(/^(\/[^/]+)?\/rfiles/);
|
||||
return match ? match[0] : "";
|
||||
}
|
||||
|
||||
private formatSize(bytes: number): string {
|
||||
|
|
|
|||
|
|
@ -42,10 +42,9 @@ class FolkForumDashboard extends HTMLElement {
|
|||
}
|
||||
|
||||
private getApiBase(): string {
|
||||
const match = window.location.pathname.match(/^\/([^/]+)\/rforum/);
|
||||
if (match) return `/${match[1]}/rforum`;
|
||||
if (this.space) return `/${this.space}/rforum`;
|
||||
return "";
|
||||
const path = window.location.pathname;
|
||||
const match = path.match(/^(\/[^/]+)?\/rforum/);
|
||||
return match ? match[0] : "";
|
||||
}
|
||||
|
||||
private getAuthHeaders(): Record<string, string> {
|
||||
|
|
|
|||
|
|
@ -131,10 +131,10 @@ class FolkFundsApp extends HTMLElement {
|
|||
}
|
||||
|
||||
private getApiBase(): string {
|
||||
const match = window.location.pathname.match(/^\/([^/]+)\/rfunds/);
|
||||
if (match) return `/${match[1]}/rfunds`;
|
||||
if (this.space) return `/${this.space}/rfunds`;
|
||||
return "";
|
||||
const path = window.location.pathname;
|
||||
// Subdomain: /rfunds/... or Direct: /{space}/rfunds/...
|
||||
const match = path.match(/^(\/[^/]+)?\/rfunds/);
|
||||
return match ? `${match[0]}` : "";
|
||||
}
|
||||
|
||||
private async loadFlows() {
|
||||
|
|
@ -222,7 +222,7 @@ class FolkFundsApp extends HTMLElement {
|
|||
// ─── Landing page ──────────────────────────────────────
|
||||
|
||||
private renderLanding(): string {
|
||||
const demoUrl = this.getApiBase() ? `${this.getApiBase().replace(/\/funds$/, "")}/funds/demo` : "/demo";
|
||||
const demoUrl = this.getApiBase() ? `${this.getApiBase()}/demo` : "/rfunds/demo";
|
||||
const authed = isAuthenticated();
|
||||
const username = getUsername();
|
||||
|
||||
|
|
@ -326,8 +326,8 @@ class FolkFundsApp extends HTMLElement {
|
|||
|
||||
private renderFlowCard(f: FlowSummary): string {
|
||||
const detailUrl = this.getApiBase()
|
||||
? `${this.getApiBase().replace(/\/funds$/, "")}/funds/flow/${encodeURIComponent(f.id)}`
|
||||
: `/flow/${encodeURIComponent(f.id)}`;
|
||||
? `${this.getApiBase()}/flow/${encodeURIComponent(f.id)}`
|
||||
: `/rfunds/flow/${encodeURIComponent(f.id)}`;
|
||||
const value = f.totalValue != null ? `$${Math.floor(f.totalValue).toLocaleString()}` : "";
|
||||
|
||||
return `
|
||||
|
|
@ -346,8 +346,8 @@ class FolkFundsApp extends HTMLElement {
|
|||
|
||||
private renderDetail(): string {
|
||||
const backUrl = this.getApiBase()
|
||||
? `${this.getApiBase().replace(/\/funds$/, "")}/funds/`
|
||||
: "/";
|
||||
? `${this.getApiBase()}/`
|
||||
: "/rfunds/";
|
||||
|
||||
return `
|
||||
<div class="funds-detail">
|
||||
|
|
@ -2269,8 +2269,8 @@ class FolkFundsApp extends HTMLElement {
|
|||
// Navigate to the new flow
|
||||
if (flowId) {
|
||||
const detailUrl = this.getApiBase()
|
||||
? `${this.getApiBase().replace(/\/funds$/, "")}/funds/flow/${encodeURIComponent(flowId)}`
|
||||
: `/flow/${encodeURIComponent(flowId)}`;
|
||||
? `${this.getApiBase()}/flow/${encodeURIComponent(flowId)}`
|
||||
: `/rfunds/flow/${encodeURIComponent(flowId)}`;
|
||||
window.location.href = detailUrl;
|
||||
return;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -773,10 +773,9 @@ class FolkMapViewer extends HTMLElement {
|
|||
}
|
||||
|
||||
private getApiBase(): string {
|
||||
const match = window.location.pathname.match(/^\/([^/]+)\/rmaps/);
|
||||
if (match) return `/${match[1]}/rmaps`;
|
||||
if (this.space) return `/${this.space}/rmaps`;
|
||||
return "";
|
||||
const path = window.location.pathname;
|
||||
const match = path.match(/^(\/[^/]+)?\/rmaps/);
|
||||
return match ? match[0] : "";
|
||||
}
|
||||
|
||||
private async checkSyncHealth() {
|
||||
|
|
|
|||
|
|
@ -106,10 +106,9 @@ class FolkGraphViewer extends HTMLElement {
|
|||
}
|
||||
|
||||
private getApiBase(): string {
|
||||
const match = window.location.pathname.match(/^\/([^/]+)\/rnetwork/);
|
||||
if (match) return `/${match[1]}/rnetwork`;
|
||||
if (this.space) return `/${this.space}/rnetwork`;
|
||||
return "";
|
||||
const path = window.location.pathname;
|
||||
const match = path.match(/^(\/[^/]+)?\/rnetwork/);
|
||||
return match ? match[0] : "";
|
||||
}
|
||||
|
||||
private async loadData() {
|
||||
|
|
|
|||
|
|
@ -632,10 +632,9 @@ Gear: EUR 400 (10%)</code></pre><p><em>Maya is tracking expenses in rF
|
|||
// ── REST (notebook list + search) ──
|
||||
|
||||
private getApiBase(): string {
|
||||
const match = window.location.pathname.match(/^\/([^/]+)\/rnotes/);
|
||||
if (match) return `/${match[1]}/rnotes`;
|
||||
if (this.space) return `/${this.space}/rnotes`;
|
||||
return "";
|
||||
const path = window.location.pathname;
|
||||
const match = path.match(/^(\/[^/]+)?\/rnotes/);
|
||||
return match ? match[0] : "";
|
||||
}
|
||||
|
||||
private async loadNotebooks() {
|
||||
|
|
|
|||
|
|
@ -113,12 +113,12 @@ class FolkPhotoGallery extends HTMLElement {
|
|||
|
||||
private getApiBase(): string {
|
||||
const path = window.location.pathname;
|
||||
const match = path.match(/^\/([^/]+)\/rphotos/);
|
||||
return match ? `/${match[1]}/rphotos` : "";
|
||||
const match = path.match(/^(\/[^/]+)?\/rphotos/);
|
||||
return match ? match[0] : "";
|
||||
}
|
||||
|
||||
private getImmichUrl(): string {
|
||||
return `/${this.space}/rphotos/album`;
|
||||
return `${this.getApiBase()}/album`;
|
||||
}
|
||||
|
||||
private async loadGallery() {
|
||||
|
|
|
|||
|
|
@ -183,10 +183,9 @@ class FolkSwagDesigner extends HTMLElement {
|
|||
}
|
||||
|
||||
private getApiBase(): string {
|
||||
const match = window.location.pathname.match(/^\/([^/]+)\/rswag/);
|
||||
if (match) return `/${match[1]}/rswag`;
|
||||
if (this.space) return `/${this.space}/rswag`;
|
||||
return "/demo/rswag";
|
||||
const path = window.location.pathname;
|
||||
const match = path.match(/^(\/[^/]+)?\/rswag/);
|
||||
return match ? match[0] : "/rswag";
|
||||
}
|
||||
|
||||
private getDemoProduct(): DemoProduct {
|
||||
|
|
|
|||
|
|
@ -41,10 +41,9 @@ class FolkRoutePlanner extends HTMLElement {
|
|||
}
|
||||
|
||||
private getApiBase(): string {
|
||||
const match = window.location.pathname.match(/^\/([^/]+)\/rtrips/);
|
||||
if (match) return `/${match[1]}/rtrips`;
|
||||
if (this.space) return `/${this.space}/rtrips`;
|
||||
return "/demo/rtrips";
|
||||
const path = window.location.pathname;
|
||||
const match = path.match(/^(\/[^/]+)?\/rtrips/);
|
||||
return match ? match[0] : "/rtrips";
|
||||
}
|
||||
|
||||
private async fetchRoute(input: RouteInput): Promise<FittedRoute> {
|
||||
|
|
|
|||
|
|
@ -291,10 +291,9 @@ class FolkTripsPlanner extends HTMLElement {
|
|||
}
|
||||
|
||||
private getApiBase(): string {
|
||||
const match = window.location.pathname.match(/^\/([^/]+)\/rtrips/);
|
||||
if (match) return `/${match[1]}/rtrips`;
|
||||
if (this.space) return `/${this.space}/rtrips`;
|
||||
return "";
|
||||
const path = window.location.pathname;
|
||||
const match = path.match(/^(\/[^/]+)?\/rtrips/);
|
||||
return match ? match[0] : "";
|
||||
}
|
||||
|
||||
private async loadTrips() {
|
||||
|
|
|
|||
|
|
@ -132,10 +132,9 @@ class FolkVoteDashboard extends HTMLElement {
|
|||
}
|
||||
|
||||
private getApiBase(): string {
|
||||
const match = window.location.pathname.match(/^\/([^/]+)\/rvote/);
|
||||
if (match) return `/${match[1]}/rvote`;
|
||||
if (this.space) return `/${this.space}/rvote`;
|
||||
return "";
|
||||
const path = window.location.pathname;
|
||||
const match = path.match(/^(\/[^/]+)?\/rvote/);
|
||||
return match ? match[0] : "";
|
||||
}
|
||||
|
||||
private async loadSpaces() {
|
||||
|
|
|
|||
|
|
@ -85,10 +85,9 @@ class FolkWalletViewer extends HTMLElement {
|
|||
}
|
||||
|
||||
private getApiBase(): string {
|
||||
const match = window.location.pathname.match(/^\/([^/]+)\/rwallet/);
|
||||
if (match) return `/${match[1]}/rwallet`;
|
||||
if (this.space) return `/${this.space}/rwallet`;
|
||||
return "";
|
||||
const path = window.location.pathname;
|
||||
const match = path.match(/^(\/[^/]+)?\/rwallet/);
|
||||
return match ? match[0] : "";
|
||||
}
|
||||
|
||||
private async detectChains() {
|
||||
|
|
|
|||
|
|
@ -55,10 +55,9 @@ class FolkWorkBoard extends HTMLElement {
|
|||
}
|
||||
|
||||
private getApiBase(): string {
|
||||
const match = window.location.pathname.match(/^\/([^/]+)\/rwork/);
|
||||
if (match) return `/${match[1]}/rwork`;
|
||||
if (this.space) return `/${this.space}/rwork`;
|
||||
return "";
|
||||
const path = window.location.pathname;
|
||||
const match = path.match(/^(\/[^/]+)?\/rwork/);
|
||||
return match ? match[0] : "";
|
||||
}
|
||||
|
||||
private async loadWorkspaces() {
|
||||
|
|
|
|||
Loading…
Reference in New Issue