- Delete old Vite+Svelte frontend - Initialize new SvelteKit project with TypeScript - Configure Tailwind CSS v4 + DaisyUI - Implement JWT authentication with auto-refresh - Create login page with form validation (Zod) - Add protected route guards - Update Docker configuration for single-stage build - Add E2E tests with Playwright (6/11 passing) - Fix Svelte 5 reactivity with $state() runes Known issues: - 5 E2E tests failing (timing/async issues) - Token refresh implementation needs debugging - Validation error display timing
43 lines
2.3 KiB
JavaScript
43 lines
2.3 KiB
JavaScript
import { s as store_get, e as escape_html, u as unsubscribe_stores, a as slot } from "../../chunks/root.js";
|
|
import { u as user } from "../../chunks/auth.js";
|
|
import "@sveltejs/kit/internal";
|
|
import "../../chunks/exports.js";
|
|
import "../../chunks/utils.js";
|
|
import "clsx";
|
|
import "@sveltejs/kit/internal/server";
|
|
import "../../chunks/state.svelte.js";
|
|
function Navigation($$renderer, $$props) {
|
|
$$renderer.component(($$renderer2) => {
|
|
var $$store_subs;
|
|
$$renderer2.push(`<nav class="navbar bg-base-100 shadow-lg"><div class="flex-1"><a href="/" class="btn btn-ghost normal-case text-xl">Headroom</a></div> <div class="flex-none gap-2">`);
|
|
if (store_get($$store_subs ??= {}, "$user", user)) {
|
|
$$renderer2.push("<!--[-->");
|
|
$$renderer2.push(`<div class="dropdown dropdown-end"><label tabindex="0" class="btn btn-ghost btn-circle avatar"><div class="w-10 rounded-full bg-primary"><span class="text-xl">${escape_html(store_get($$store_subs ??= {}, "$user", user).email?.charAt(0).toUpperCase())}</span></div></label> <ul tabindex="0" class="mt-3 p-2 shadow menu menu-compact dropdown-content bg-base-100 rounded-box w-52"><li><a href="/dashboard" class="justify-between">Dashboard</a></li> `);
|
|
if (store_get($$store_subs ??= {}, "$user", user).role === "superuser" || store_get($$store_subs ??= {}, "$user", user).role === "manager") {
|
|
$$renderer2.push("<!--[-->");
|
|
$$renderer2.push(`<li><a href="/team-members">Team Members</a></li> <li><a href="/projects">Projects</a></li>`);
|
|
} else {
|
|
$$renderer2.push("<!--[!-->");
|
|
}
|
|
$$renderer2.push(`<!--]--> <li><a href="/reports">Reports</a></li> <div class="divider"></div> <li><button class="text-error">Logout</button></li></ul></div>`);
|
|
} else {
|
|
$$renderer2.push("<!--[!-->");
|
|
$$renderer2.push(`<a href="/login" class="btn btn-primary btn-sm">Login</a>`);
|
|
}
|
|
$$renderer2.push(`<!--]--></div></nav>`);
|
|
if ($$store_subs) unsubscribe_stores($$store_subs);
|
|
});
|
|
}
|
|
function _layout($$renderer, $$props) {
|
|
$$renderer.component(($$renderer2) => {
|
|
$$renderer2.push(`<div class="min-h-screen bg-base-200">`);
|
|
Navigation($$renderer2);
|
|
$$renderer2.push(`<!----> <main class="container mx-auto px-4 py-6"><!--[-->`);
|
|
slot($$renderer2, $$props, "default", {});
|
|
$$renderer2.push(`<!--]--></main></div>`);
|
|
});
|
|
}
|
|
export {
|
|
_layout as default
|
|
};
|