feat(team): role name/slug, shifts tab, and scanner outline icons - #262
Draft
iDorgham wants to merge 3 commits into
Draft
feat(team): role name/slug, shifts tab, and scanner outline icons#262iDorgham wants to merge 3 commits into
iDorgham wants to merge 3 commits into
Conversation
Give each role a spaced display name and a stable slug, add a Shifts tab with editable gate assignments, polish settings chrome, and replace scanner emoji with outline icons. Co-authored-by: Cursor <cursoragent@cursor.com>
Prisma OrganizationType is a string union, which TypeScript will not assign to the types-package enum used by filterVisibleTeamRoles. Co-authored-by: Cursor <cursoragent@cursor.com>
Login now includes the API origin in fetch failures so the existing assertion matches the operator-facing message. Co-authored-by: Cursor <cursoragent@cursor.com>
Contributor
|
Important Review skippedDraft detected. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Plus Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Type of change
feat— New featurefix— Bug fixperf— Performance improvementrefactor— Code refactor (no behaviour change)chore— Tooling, deps, CIdocs— Documentation onlysecurity— Security fixPlan reference
Plan: settings/team polish + scanner icon pass (not a numbered Active plan phase)
Checklist
Code
feat(scope): description)console.logleft in production codeTests
pnpm preflight)Database
schema.prismachanged → migrations added (mustChangePassword,Role.slug)prisma migrate deploy/db executestill needs a reachable Postgres (localhost:5432was down during implementation)Env & Config
scripts/check-env.jsmanifest.env.exampleRelease
pnpm docs:changelog add)Breaking changes
Role matching now uses slug (
ORG_ADMIN,SCHOOL_TEACHER). Display names may contain spaces. Apply both Prisma migrations before deploying:20260814230000_add_user_must_change_password20260815120000_add_role_slugScreenshots / recordings
Settings → Team: Members / Invitations / Roles / Gate Access / Shifts / Activity. Role editor shows Name + Slug. Scanner bottom nav and overlays use outline icons only.
Test plan
pnpm exec tsx src/seed-roles.tsfrompackages/dbSCHOOL_TEACHER)/change-passwordon first loginMade with Cursor
Summary by cubic
Standardizes team roles around a canonical slug and spaced display name, adds a Shifts tab to Team settings, and replaces scanner emoji with outline icons. Old behavior matched roles by display name; new behavior matches by slug (for example ORG_ADMIN), and first-login flow now redirects members with must-change-password to a change-password screen.
Review
Role.slugandUser.mustChangePasswordwith backfill and indexes; seeschema.prismaand the two Prisma migrations.@gate-access/types(roleSlug,formatRoleLabel, visibility filters); built-in roles and seeds now use slug identifiers; UI and API useformatRoleLabelfor display.SettingsSectionHeader; gate assignment edit controls are always visible.mustChangePassword; adds/change-passwordroute and action to complete forced password change.DEVICE_PIN_KEY,SUPERVISOR_PIN_KEY) with tests; biometry stays in-app without device fallback; network errors include the API origin.Rollout
20260814230000_add_user_must_change_passwordand20260815120000_add_role_slug.pnpm exec tsx packages/db/src/seed-roles.ts.slug(for exampleORG_ADMIN,GATE_OPERATOR) instead of displayname.mustChangePassword = true; confirm redirect to/{locale}/change-passwordafter login.Written for commit 7fd0a2f. Summary will update on new commits.