Skip to content

fix: explain glossary creation permissions in the empty state - #4100

Open
vaibhavmashal wants to merge 1 commit into
tolgee:mainfrom
vaibhavmashal:fix/glossary-empty-state-permissions
Open

vaibhavmashal wants to merge 1 commit into
tolgee:mainfrom
vaibhavmashal:fix/glossary-empty-state-permissions

Conversation

@vaibhavmashal

@vaibhavmashal vaibhavmashal commented Nov 27, 2026 •

Copy link
Copy Markdown

Summary

Show a permission message in the empty Glossaries list when the organization member cannot create a glossary. The message tells them to ask an organization Owner or Maintainer. Users who can create glossaries still see the getting-started guidance and create button.

Verification

Compared the upstream and patched components locally. The upstream read-only state rendered the generic message. The patched state shows the permission guidance, and the create-enabled state keeps its callback and help link. Added regression coverage for both states.

Fixes #4066

Summary by CodeRabbit

  • New Features
    • Users without permission to create a glossary now see guidance to contact an organization Owner or Maintainer. Users with permission continue to see the existing getting-started message and creation button.

Signed-off-by: vaibhavmashal <vaibhavmashal098@gmail.com>
Copilot AI balanced review requested due to automatic review settings November 27, 2026 18:30

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Copilot was unable to review this pull request because the user who requested the review has insufficient remaining quota. Try requesting a review at a lower effort level.

An organization owner can choose the repository organization as the billing source for reviews requested by members with a paid Copilot license. Learn about Copilot code review billing.

@coderabbitai

coderabbitai Bot commented Nov 27, 2026 •

Copy link
Copy Markdown
Contributor

Explain Change →

No actionable comments were generated in the recent review.

Walkthrough

The glossary empty state now shows permission guidance when no create handler is provided. Tests cover that case and the existing getting-started message when a handler is provided.

Changes: Glossary empty-state message

Layer / File(s) Summary
Select and verify the empty-state message
webapp/src/ee/glossary/components/AddFirstGlossaryMessage.tsx, webapp/src/ee/glossary/components/AddFirstGlossaryMessage.test.tsx
The component selects its message based on whether onCreateClick is provided. Tests check permission guidance without a button and the existing getting-started message with a button.

Estimated code review effort: 2 (Simple) | ~10 minutes

Change: Bug fix · Severity of issue fixed: Low

Suggested reviewers: dkrizan

Merge Risk: Minimal · up to 1b8b9

Members who cannot create glossaries now see guidance to ask an Owner or Maintainer in the empty Glossaries list. Members who can create glossaries keep the existing getting-started message and create button. No merge-blocking risk remains.

Pre-merge checks: Passed 4

Check name Status Explanation
Description Check Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check Passed The title matches the main change. The summary and objectives show that the empty Glossaries state now explains glossary creation permissions to users who cannot create glossaries, and tells them to c…
Linked Issues check Passed [#4066] requests a permission message in the empty Glossaries state for users who cannot create glossaries, with a next step to ask an organization Owner or Maintainer. At the reviewed head, AddFirstG…
Out of Scope Changes check Passed The change set consists of AddFirstGlossaryMessage.tsx (message selection) and its test file AddFirstGlossaryMessage.test.tsx (regression coverage for both states). Both changes directly implement or …
Full details: Title check

Explanation

The title matches the main change. The summary and objectives show that the empty Glossaries state now explains glossary creation permissions to users who cannot create glossaries, and tells them to contact an Owner or Maintainer. Users who can create glossaries keep the getting-started message and button. The title is concise, uses the conventional fix: prefix, and names the changed behavior.

Full details: Linked Issues check

Explanation

[#4066] requests a permission message in the empty Glossaries state for users who cannot create glossaries, with a next step to ask an organization Owner or Maintainer. At the reviewed head, AddFirstGlossaryMessage.tsx selects the message by onCreateClick. When onCreateClick is absent, it renders the key glossaries_list_empty_no_create_permission with the text 'You need permission to create glossaries. Ask an organization Owner or Maintainer to create one or update your role.' When onCreateClick is present, it keeps the existing glossaries_list_empty_message with the best-practice link. The PR summary reports regression tests for both states in AddFirstGlossaryMessage.test.tsx, which assert the permission text and the absence of a button in the read-only state, and the getting-started text and button in the create state. The issue's coding requirement is met. The test file was not read directly; the test assertions rely on the PR summary.

Full details: Out of Scope Changes check

Explanation

The change set consists of AddFirstGlossaryMessage.tsx (message selection) and its test file AddFirstGlossaryMessage.test.tsx (regression coverage for both states). Both changes directly implement or verify the requirement in #4066. No unrelated changes appear in the summary. The new translation key carries a @tolgee-key annotation, which supports the message change and is not a separate scope item.

Finishing Touches

Generate unit tests (beta)

  • Create a new PR
Fix failing CI checks

  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts
Recent review info

Run configuration

Commits

Reviewing files that changed from the base of the PR and between eecf317 and 1b8b9a9.

Files selected for processing: 2

  • webapp/src/ee/glossary/components/AddFirstGlossaryMessage.test.tsx
  • webapp/src/ee/glossary/components/AddFirstGlossaryMessage.tsx

Included review availability: This review used your included allowance. Your plan provides up to 8 included reviews per hour; 7 remain after this review.

@Barush
Barush requested a review from Anty0 November 28, 2026 20:38
@Barush

Barush commented Nov 28, 2026

Copy link
Copy Markdown
Member

Hi @vaibhavmashal, thank you for this contribution! It is great to see you adressed the issue so fast. 💕

Our team still needs to review it. The main test run is also still waiting. The failed Snyk check comes from a limit on our side, so there is nothing for you to fix there. We will comment here if we need any changes.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Glossaries: tell users to contact Owner/Maintainer when they can’t create one

3 participants