Skip to content

Conversation

@myieye
Copy link
Collaborator

@myieye myieye commented Nov 11, 2025

I've got a surprising number of beta requests from editors who don't need it and probably requested it more or less out of curiosity.
So, this disables the "Request beta access" button for them.
Now only site admins and users who manage at least 1 project can request access.

Potentially org admins should also be able to request beta access, but nah. There's been no need for that so far and open beta will come soon enough.

image

UPDATE: changed text and hid button for non-managers:
image

@github-actions github-actions bot added the 📦 Lexbox issues related to any server side code, fw-headless included label Nov 11, 2025
@coderabbitai
Copy link

coderabbitai bot commented Nov 11, 2025

📝 Walkthrough

Walkthrough

A new localization string is added for beta access permission messaging, and the wheresMyProject page is updated to disable the beta request button for non-manager users while displaying a restriction notice.

Changes

Cohort / File(s) Summary
Localization additions
frontend/src/lib/i18n/locales/en.json
Added new translation key only_managers_can_request_beta with value "Only project managers can request early access to FieldWorks Lite." under where_is_my_project object.
Beta access permission gating
frontend/src/routes/(authenticated)/wheresMyProject/+page.svelte
Updated component to import ProjectRole, derive managesProjects from user roles via Props interface, disable beta request button for non-managers, and display inline restriction message using new i18n key.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

  • Verify conditional logic correctly identifies manager vs. non-manager users
  • Confirm managesProjects derivation from user roles is accurate
  • Check UI state transitions when button is disabled and message is shown

Possibly related PRs

  • sillsdev/languageforge-lexbox#1650: Directly updates the same wheresMyProject +page.svelte file with identical role checks, ProjectRole import, button disabling logic, and i18n key introduction.

Suggested reviewers

  • hahn-kev

Poem

🐰 A manager's privilege, now made plain,
With gentle guards to help explain,
Beta access gated tight and fair,
Only keepers of projects may dare!
Hop hop!

Pre-merge checks and finishing touches

✅ Passed checks (3 passed)
Check name Status Explanation
Title check ✅ Passed The title directly and clearly describes the main change: preventing editors from requesting beta access, which is the core objective of the PR.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Description check ✅ Passed The PR description clearly explains the motivation (too many unnecessary beta requests from editors), the implementation (disables button for non-managers), and the scope (only site admins and project managers can request access).
✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch prevent-editors-from-requesting-beta-access

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@github-actions
Copy link

github-actions bot commented Nov 11, 2025

UI unit Tests

 1 files  ±  0   3 suites   - 42   0s ⏱️ -19s
10 tests  - 101  10 ✅  - 101  0 💤 ±0  0 ❌ ±0 
10 runs   - 150  10 ✅  - 150  0 💤 ±0  0 ❌ ±0 

Results for commit 95b5a5b. ± Comparison against base commit 846d917.

This pull request removes 111 and adds 10 tests. Note that renamed tests count towards both.
src/lib/components/stomp/stomp-guard.svelte.test.ts ‑ StompGuard > accepts parent values when not dirty
src/lib/components/stomp/stomp-guard.svelte.test.ts ‑ StompGuard > does NOT guard against stomping deep changes, because StompGuard can't detect them
src/lib/components/stomp/stomp-guard.svelte.test.ts ‑ StompGuard > ignores parent values when dirty
src/lib/components/stomp/stomp-guard.svelte.test.ts ‑ StompGuard > initializes with the parent value
src/lib/components/stomp/stomp-guard.svelte.test.ts ‑ StompGuard > keeps subscribers up to date when it becomes dirty
src/lib/components/stomp/stomp-guard.svelte.test.ts ‑ StompGuard > pushs changes to parent
src/lib/components/stomp/stomp-guard.svelte.test.ts ‑ StompGuard > reverts new parent values when ignored
src/lib/components/stomp/stomp-guard.svelte.test.ts ‑ StompGuard > starts accepting parent changes again after a flush
src/lib/components/ui/format/format-duration.test.ts ‑ formatDuration > formats durations
src/lib/components/ui/format/format-duration.test.ts ‑ formatDuration > formats durations with smallest unit
…
src/index.test.ts ‑ password hashing > can hash a pw using sha1
src/lib/i18n/i18n.test.ts ‑ buildRegionalLocaleRegex > should find all regional locales for available locales
src/lib/i18n/i18n.test.ts ‑ pickBestLocale > should return en by default
src/lib/i18n/i18n.test.ts ‑ pickBestLocale > should return en if no user locale is provided and acceptLanguageHeader does not have any supported locales
src/lib/i18n/i18n.test.ts ‑ pickBestLocale > should return regional locale from acceptLanguageHeader if it has a higher quality rating than the regionless locale
src/lib/i18n/i18n.test.ts ‑ pickBestLocale > should return supported locale from acceptLanguageHeader with highest quality rating if no user locale is provided
src/lib/i18n/i18n.test.ts ‑ pickBestLocale > should return user locale if acceptLanguageHeader does not provide a regional/more specific locale
src/lib/i18n/i18n.test.ts ‑ pickBestLocale > should return user locale if acceptLanguageHeader does not provide a regional/more specific locale with a higher quality rating
src/lib/i18n/i18n.test.ts ‑ pickBestLocale > should return user locale if acceptLanguageHeader is not provided
src/lib/user.test.ts ‑ jwtToUser > should convert a jwt token to a LexAuthUser

♻️ This comment has been updated with latest results.

@github-actions
Copy link

github-actions bot commented Nov 11, 2025

C# Unit Tests

130 tests   130 ✅  19s ⏱️
 20 suites    0 💤
  1 files      0 ❌

Results for commit 95b5a5b.

♻️ This comment has been updated with latest results.

@myieye
Copy link
Collaborator Author

myieye commented Nov 11, 2025

@copilot remove "text-sm" from the new message

Copy link
Contributor

Copilot AI commented Nov 11, 2025

@myieye I've opened a new pull request, #2100, to work on those changes. Once the pull request is ready, I'll request review from you.

@myieye myieye force-pushed the prevent-editors-from-requesting-beta-access branch from 00b161f to eba698a Compare November 11, 2025 12:05
@myieye myieye marked this pull request as ready for review November 11, 2025 12:13
@myieye myieye requested a review from rmunn November 19, 2025 14:32
Copy link
Contributor

@rmunn rmunn left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Would it make sense to just hide the early-access page entirely from people who can't join it yet? Alternatively, I think that a different user_not_in_beta message should be presented to people who can't click the button, because telling them "Click the button below" and then further down saying "You can't click this button" feels a bit rude.

@myieye
Copy link
Collaborator Author

myieye commented Nov 21, 2025

@rmunn I changed it to:

image

@myieye myieye merged commit 2a71277 into develop Nov 21, 2025
23 checks passed
@myieye myieye deleted the prevent-editors-from-requesting-beta-access branch November 21, 2025 11:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

📦 Lexbox issues related to any server side code, fw-headless included

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants