Skip to content

Commit 395ca62

Browse files
authored
feat(frontend): demo mode adjustments (#45)
* feat(frontend): pre-fill credentials and disable signup in demo mode
1 parent 8c9cf80 commit 395ca62

4 files changed

Lines changed: 24 additions & 8 deletions

File tree

.gitignore

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,4 +18,7 @@ node_modules/
1818
dist/
1919

2020
# Auxiliary scripts
21-
reset_demo.sh
21+
reset_demo.sh
22+
23+
# LLM generated files
24+
pr_description.md

AI.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
## 🚦 Strict Workflow Protocol
1010
Before modifying, generating, or deleting any files, the agent MUST follow these steps in exact order:
1111
1. **Plan First:** Present a comprehensive architectural review, design summary, or pseudo-code strategy. Wait for explicit user greenlight.
12-
2. **Git Branching:** Checkout to a distinct feature or refactor branch from `main` using the Conventional Commits specification (e.g., `feat(backend): ...`, `refactor(frontend): ...`).
12+
2. **Git Branching:** Checkout to a distinct feature or refactor branch from `main` using the Conventional Commits specification (e.g., `feat(backend)/...`, `refactor(frontend)/...`).
1313
3. **Execution:** Apply the changes within the tightly scoped workspace directory.
1414
4. **Finalize:** Upon user validation, stage and commit changes with concise, structured commit messages.
1515
5. **Documentation:** Auto-generate a pull request summary titled `pr_description.md` in the project root adhering to the workspace markdown template.

frontend/src/modules/auth/components/LoginForm.vue

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,12 @@ const redirect = route.query.redirect as string | undefined
2424
2525
const { handleSubmit } = useForm<LoginFormValues>({
2626
validationSchema: toTypedSchema(loginSchema),
27+
initialValues: isDemo
28+
? {
29+
email: 'demo@evsy.dev',
30+
password: 'bestructured',
31+
}
32+
: undefined,
2733
})
2834
2935
const { mutate: runLogin, isPending: isLoading } = useMutation({
@@ -91,7 +97,7 @@ const onSubmit = handleSubmit(values => runLogin(values))
9197
<Button type="submit" class="w-full" :disabled="isLoading"> Log In </Button>
9298

9399
<!-- Link to signup -->
94-
<div class="text-center text-sm">
100+
<div v-if="!isDemo" class="text-center text-sm">
95101
Don’t have an account?
96102
<RouterLink
97103
:to="{ path: '/signup', query: { redirect } }"
Lines changed: 12 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,23 @@
11
import type { RouteRecordRaw } from 'vue-router'
22
import LoginPage from './pages/LoginPage.vue'
33
import SignupPage from './pages/SignupPage.vue'
4+
import { useAppConfig } from '@/shared/composables/useAppConfig'
5+
6+
const { isDemo } = useAppConfig()
47

58
export const authRoutes: RouteRecordRaw[] = [
69
{
710
path: '/login',
811
name: 'Login',
912
component: LoginPage,
1013
},
11-
{
12-
path: '/signup',
13-
name: 'Signup',
14-
component: SignupPage,
15-
},
14+
...(!isDemo
15+
? [
16+
{
17+
path: '/signup',
18+
name: 'Signup',
19+
component: SignupPage,
20+
},
21+
]
22+
: []),
1623
]

0 commit comments

Comments
 (0)