Skip to content

[permissions][FE] followup design fixes 4 #12737

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 12 commits into from
Jun 20, 2025
Merged

Conversation

Weiko
Copy link
Member

@Weiko Weiko commented Jun 19, 2025

Context

  • Whole row is now clickable
  • Fix padding on role tables
  • Fix tab being persistant between roles
  • Change various texts/descriptions
  • Add un/check all on settings permissions
  • Fix flash between role detail and roles
  • Add "Granted for X object(s)"
  • Swap permissions and assignment tabs position
  • add tooltip for object level permission actions
  • Add the inherited info on object-level permissions

Copy link
Contributor

@greptile-apps greptile-apps bot left a comment

Choose a reason for hiding this comment

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

PR Summary

Major UI/UX improvements to the role permissions interface focused on clarity and usability.

  • Changed crucial descriptions for better clarity: 'Actions you can perform on all objects' → 'Actions users can perform on all objects', and similar changes throughout permission sections
  • Introduced distinct permission tracking with new 'grantedBy' field to show 'Granted on X objects' status alongside existing 'Revoked on X objects'
  • Fixed component instance IDs by appending roleId to prevent tab state sharing between different roles
  • Added comprehensive select-all functionality for settings permissions with proper state management
  • Made UI more robust by adding proper null checks and fallbacks, like defaulting to IconUserPin when role icon is undefined

17 files reviewed, 7 comments
Edit PR Review Bot Settings | Greptile

Comment on lines 302 to 308
<TabList
tabs={tabs}
className="tab-list"
componentInstanceId={SETTINGS_ROLE_DETAIL_TABS.COMPONENT_INSTANCE_ID}
componentInstanceId={
SETTINGS_ROLE_DETAIL_TABS.COMPONENT_INSTANCE_ID + '-' + roleId
}
/>
Copy link
Contributor

Choose a reason for hiding this comment

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

style: Extract COMPONENT_INSTANCE_ID + '-' + roleId into a constant or memoized value to avoid string concatenation in render

Comment on lines +39 to 45
grantedBy:
objectPermissions?.filter(
(permission) =>
permission.canReadObjectRecords === true &&
settingsDraftRole.canReadAllObjectRecords === false,
)?.length ?? 0,
revokedBy:
Copy link
Contributor

Choose a reason for hiding this comment

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

style: Consider extracting the permission filter logic into a utility function since it's repeated for each permission type

Copy link
Contributor

github-actions bot commented Jun 19, 2025

🚀 Preview Environment Ready!

Your preview environment is available at: http://bore.pub:25972

This environment will automatically shut down when the PR is closed or after 5 hours.

Copy link
Collaborator

@ijreilly ijreilly left a comment

Choose a reason for hiding this comment

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

cool !!

@@ -19,7 +19,7 @@ export const SettingsRolesContainer = () => {
const settingsAllRoles = useRecoilValue(settingsAllRolesSelector);
const settingsRolesIsLoading = useRecoilValue(settingsRolesIsLoadingState);

if (settingsRolesIsLoading) {
if (settingsRolesIsLoading && !settingsAllRoles) {
Copy link
Collaborator

Choose a reason for hiding this comment

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

Nit but im a bit confused by the settings prefix here. what is settingsAllRoles ? roles ?

Copy link
Member Author

Choose a reason for hiding this comment

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

Ah, that's because every component in the setting module seemed to be prefixed with Settings and I did the same with states. Now I guess it's a bit confusing because we have settings tab in our roles so we have SettingsRoleSettings or even settings permissions (which is probably the most confusing one)

anchorSelect={`#${containerId}`}
content={
permissionValue === false
? t`${roleLabel} can't ${humanReadableAction} ${objectLabel} records`
Copy link
Collaborator

Choose a reason for hiding this comment

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

im curious about how translations work with interpolations

Copy link
Member Author

Choose a reason for hiding this comment

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

it should work fine, we already have it in other places I believe 🤔 (but to double check indeed)

canDestroyObjectRecords: t`destroy`,
};

return permissionAction[objectPermissionKey] ?? t`see`;
Copy link
Collaborator

Choose a reason for hiding this comment

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

can this happen?

Copy link
Member Author

Choose a reason for hiding this comment

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

No you are right, this is unnecessary as it should never happen, I'll change that

);

return (
<TableRow gridAutoColumns="3fr 4fr 24px">
Copy link
Collaborator

Choose a reason for hiding this comment

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

does this work with every screen size ?

Copy link
Member Author

@Weiko Weiko Jun 20, 2025

Choose a reason for hiding this comment

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

It should yes, I tested on different sizes with smaller ones and seems fine

@Weiko Weiko enabled auto-merge (squash) June 20, 2025 11:49
@Weiko Weiko merged commit 7687f4f into main Jun 20, 2025
54 checks passed
@Weiko Weiko deleted the c--permissions-fe-followup-4 branch June 20, 2025 11:53
ijreilly pushed a commit that referenced this pull request Jun 20, 2025
## Context
- Whole row is now clickable
- Fix padding on role tables
- Fix tab being persistant between roles
- Change various texts/descriptions
- Add un/check all on settings permissions
- Fix flash between role detail and roles
- Add "Granted for X object(s)"
- Swap permissions and assignment tabs position
- add tooltip for object level permission actions
- Add the inherited info on object-level permissions
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants