Rename "terms and guestbook" based on the permission#923
Open
ChengShi-1 wants to merge 2 commits intodevelopfrom
Open
Rename "terms and guestbook" based on the permission#923ChengShi-1 wants to merge 2 commits intodevelopfrom
ChengShi-1 wants to merge 2 commits intodevelopfrom
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
This pull request implements role-based tab naming for the Dataset Terms section and fixes a bug with duplicate tab rendering during dataset publishing. Users with dataset update permissions will see "Terms and Guestbook" while read-only users will see just "Terms", addressing user feedback about confusing terminology for those who cannot access the guestbook functionality.
Changes:
- Dynamic Terms tab title based on user permissions (update permission shows "Terms and Guestbook", read-only shows "Terms")
- Fixed duplicate tabs rendering during publish flow by making skeleton and content mutually exclusive
- Refactored test factories to use reusable permission helper methods
Reviewed changes
Copilot reviewed 6 out of 6 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| src/sections/dataset/Dataset.tsx | Implements dynamic tab title based on permissions and fixes publish flow conditional logic |
| public/locales/en/dataset.json | Adds new translation key for read-only terms tab title |
| tests/component/sections/dataset/Dataset.spec.tsx | Adds test for read-only tab title and updates existing tests with flexible regex patterns |
| tests/component/dataset/domain/models/DatasetMother.ts | Adds reusable test factory methods for permissions and refactors existing factories |
| tests/e2e-integration/e2e/sections/edit-dataset-terms/EditDatasetTerms.spec.tsx | Updates E2E test to use flexible regex pattern for dynamic tab name |
| CHANGELOG.md | Documents both the permission-based tab naming and duplicate tabs fix |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
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.
What this PR does / why we need it:
It can change the tab name based on the user’s permission level. If a user has permission to edit the dataset, the tab will be labeled “Terms and Guestbook.” Otherwise, it will be labeled “Terms.”
Also, I notice a bug when the dataset is publishing, there is a loading state, two tabs component exist at the same time, and then the "files" components loads again. (the screen recording about this bug: https://github.com/user-attachments/assets/55410881-8f1a-404a-89f7-f3bb79b35c98
Which issue(s) this PR closes:
Special notes for your reviewer:
Terms and Guestbook, and read-only users seeTerms.Suggestions on how to test this:
Test the dataset page tab name and edit tab name based on the permission
Does this PR introduce a user interface change? If mockups are available, please link/include them here:
Is there a release notes or changelog update needed for this change?:
Yes
Additional documentation: