Hacktoberfest 2026: những issue maintainer đã đánh dấu cho tháng Mười, đang mở và phù hợp người mới. Xem issue Hacktoberfest

Cloud admin: user and access management panel

Đang mở
#790 0 bình luận 0 reaction 0 người được giao Xem trên GitHub

Chưa có ai nhận issue này.

Đánh giá

Độ khó
5/5
Thời gian dự kiến
Hơn một tuần
Mức phù hợp với người mới
35/100
Loại issue
Tính năng
Độ rõ ràng
Khá rõ ràng
Mức độ hoạt động
Sôi nổi
Công nghệ
firebase, typescript

Hướng nghiên cứu

Start by reading src/App.tsx and src/App.test.tsx for route registration and MemoryRouter tests, then inspect the GlyphDebug route, AddWorkspaceDialog, ConfirmDialog, and the existing config/defaults and security-rule paths. The work is done when the /admin flow covers the listed allowlist, domain, user, quota, account, and defaults operations, with visible errors, confirmations, mutation coverage, and a clean TypeScript check.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Mô tả

enhancement

Summary

Admin panel for managing who may sign in and what limits they get. All operations are plain
Firestore writes gated by isAdmin() in the security rules — no Cloud Functions required.

Scope

  • New /admin route registered in src/App.tsx. Must be declared before the * catch-all,
    which currently redirects everything unmatched to /editor. Lazy-loaded, following the existing
    src/routes/GlyphDebug.tsx pattern (that route plus its CSS module are the only members of
    src/routes/ today).
  • Guarded on role === 'admin'; non-admins are redirected to /editor. The route guard is
    convenience only — the security rules are the actual enforcement.
  • Manage the email allowlist: add, remove, list. Emails normalised to lowercase on write.
  • Manage allowed domains: add, remove, list (e.g. adventuresinlua.com), so a whole
    organisation can be admitted without listing individuals.
  • Manage users: set per-user quotaBytes (default 25 MB) and maxFiles (default 2000),
    disable/enable an account, promote/demote admin.
  • Editing config/defaults so new users get a different default quota and file cap.

Acceptance criteria

  • /admin route added before the * catch-all in App.tsx, lazy-loaded
  • Non-admins cannot reach the panel and are redirected
  • Allowlist entries can be added, listed, and removed; emails are lowercased
  • Allowed domains can be added, listed, and removed
  • Per-user quotaBytes and maxFiles are editable and take effect without the user re-signing-in
  • Accounts can be disabled and re-enabled; a disabled user loses access
  • Admin can be granted and revoked; an admin cannot demote themselves into lockout
  • config/defaults is editable from the panel
  • Destructive actions (remove user, revoke admin, disable) confirm first
  • Errors surface visibly rather than failing silently
  • Route wiring tested with the MemoryRouter pattern in src/App.test.tsx
  • npx tsc -p lua-learning-website/tsconfig.app.json --noEmit clean
  • Scoped mutation coverage >= 80%

Implementation notes

  • src/App.test.tsx is the template for route tests: <MemoryRouter initialEntries={[...]}>
    with the heavy component vi.mocked to a stub.
  • There is no shared UI primitives directory in this repo. Reuse
    src/components/AddWorkspaceDialog/AddWorkspaceDialog.tsx as the form pattern (controlled
    inputs with <label htmlFor>, role="alert" errors, isFormValid gating a disabled submit)
    and src/components/ConfirmDialog/ for destructive confirmations.
  • Use theme custom properties from src/styles/themes.css.
  • Keep business logic in hooks, not components — CLAUDE.md requires UI components stay pure.
    Watch the 400-line-per-file lint cap; split the panel into sub-components early.
  • e2e/tab-persistence.spec.ts:233 navigates to /docs, which is not a declared route and
    silently redirects. Harmless, but a reminder that route order matters here.

Depends on

  • #789

Branching

This issue is part of the Cloud Accounts & Storage
milestone, which uses feat/cloud as its integration branch.

Branch from feat/cloud, and open the PR against feat/cloud. Never against main.

Create the branch (the --base flag also sets the default PR target for this branch):

gh issue develop <number> --base feat/cloud --checkout

Open the PR:

python3 scripts/issue-review.py <number> --base feat/cloud \
  --summary "<summary>" --test-plan "<test-plan>"

feat/cloud merges to main in a single PR once the milestone is complete.

Why both flags are required: gh issue develop without --base branches from the repository
default branch (main), and scripts/issue-review.py falls back to main when --base is
omitted — both for the gh pr create target and for the changed-file list in the PR body.

Ngôn ngữ chính
TypeScript
Star
1
Fork
0
Chỉ số merge pull request
Không có pull request nào được merge trong 30 ngày

Chuẩn bị môi trường

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Issue khác của jcollard/LuaInTheWeb

Tất cả issue của jcollard/LuaInTheWeb

Issue tương tự

Thêm issue về TypeScript

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.