feat: implement permissions and actions management
CI / Lint, typecheck, test, build (push) Canceled after 0s
CI / End-to-end tests (push) Canceled after 0s

- Add permissions logic for status options in corrective actions.
- Create tests for permissions functionality.
- Implement queries for user authentication and actions management.
- Develop Actions page to display and manage corrective actions.
- Create authentication pages for login, setup, and password reset.
- Add IncidentDetail page to view incident details and associated actions.
- Implement Settings page for user management and password changes.
This commit is contained in:
jayjennings committed 2026-10-06 11:20:44 -07:00
1 parent 708da6b9f7
commit 3f6dff5f24
94 files changed
+7213 -643

No files matched your search

+26
View File
@@ -0,0 +1,26 @@
import { expect, type Page } from '@playwright/test'
export const PASSWORD = 'e2e test password'
export const users = {
admin: { name: 'Avery Admin', email: 'admin@e2e.test' },
supervisor: { name: 'Sam Supervisor', email: 'supervisor@e2e.test' },
reporter: { name: 'Riley Reporter', email: 'reporter@e2e.test' },
} as const
export async function signIn(page: Page, who: keyof typeof users) {
await page.goto('/login')
await page.getByLabel('Email').fill(users[who].email)
await page.getByLabel('Password').fill(PASSWORD)
await page.getByRole('button', { name: 'Sign in', exact: true }).click()
await expect(page.getByRole('heading', { level: 1 })).toContainText(users[who].name.split(' ')[0])
}
/** A unique title so parallel tests (and the desktop/mobile projects) never collide. */
export const unique = (title: string) => `${title} ${Math.random().toString(36).slice(2, 7)}`
/** 1×1 PNG. */
export const photo = {
name: 'scene.png',
mimeType: 'image/png',
buffer: Buffer.from('iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAADUlEQVR42mP8z8BQDwAEhQGAhKmMIQAAAABJRU5ErkJggg==', 'base64'),
}