Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

feat: add resource-action pills to custom roles table#14354

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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Merged
jaaydenh merged 11 commits intomainfromjaaydenh/add-custom-role-pills
Sep 3, 2024

Conversation

jaaydenh
Copy link
Contributor

resolves#14247

  1. Change permissions column from a number of resource actions to one pill for each resource that list the actions for that resource
  2. Create new colors for the custom role pills. These could be eventually be incorporated into other pill designs if there is agreement on this design.
  3. Use vertical layout for the overflow pills
Screenshot 2024-08-19 at 1 58 09 PMScreenshot 2024-08-19 at 1 57 51 PMScreenshot 2024-08-19 at 1 57 28 PM

@alwaysmeticulousalwaysmeticulous
Copy link

alwaysmeticulousbot commentedAug 19, 2024
edited
Loading

🤖 Meticulous spotted visual differences in 91 of 1477 screens tested:view and approve differences detected.

Meticulous tested111/112 of the executable lines edited in this PR1.

1. These lines will likely automatically gain test coverage over the coming days, however if you wish to increase coverage immediately you can do so by interacting with your feature on localhost.

Last updated for commitd21771f. This comment will update as new commits are pushed.

background:colors.zinc[200],
outline:colors.zinc[300],
text:colors.zinc[700],
}satisfiesPermission;
Copy link
Collaborator

Choose a reason for hiding this comment

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

I'm wondering ifpermission should be treated as a theme or not as a design token in this case, but I'm okay with it for now. Perhaps having a 'muted' pill variant could be better. 🤔 Wdyt@aslilac ?

Copy link
Collaborator

@BrunoQuaresmaBrunoQuaresma left a comment

Choose a reason for hiding this comment

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

I'm missing tests for this PR. I would also extract the permission pills into a PermissionsList component to test how it behaves when there isn’t much space available, when it shows the '+n' button, and what happens when this button/pill is hovered.

@BrunoQuaresma
Copy link
Collaborator

BrunoQuaresma commentedAug 19, 2024
edited
Loading

I have reviewed this pull request, and it is functioning as expected. It looks great! Good work. However, it still requires tests and another review for usage permissions as a design token.

Copy link
Member

@aslilacaslilac left a comment
edited
Loading

Choose a reason for hiding this comment

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

I'd really like to avoid the changes to theTheme type, but otherwise this looks great! I think this design strikes a great balance between compactness and clearness.

Comment on lines 1 to 5
exportinterfacePermission{
background:string;
outline:string;
text:string;
}
Copy link
Member

Choose a reason for hiding this comment

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

Imho, this is way too specific of a thing to add to the theme. We've been missing a clear "neutral"role choice for a while, and I've been meaning to resolve that for a while but it just hasn't come up recently. That being said, you got me thinking about it again today and I have proposed a fix in#14356. If that PR gets merged, I'd much rather usetheme.roles.info colors for these than complicate the globalTheme for this one specific use case.

Copy link
ContributorAuthor

@jaaydenhjaaydenhAug 20, 2024
edited
Loading

Choose a reason for hiding this comment

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

I really just added the Permission theme to have a short discussion about it. I was originally going to use or modify role but semantically permissions are not roles (roles are assigned permissions) and if we are using a feature concept such as roles in the theme it would make sense to add permissions as well. And this will also make it more likely for others in the future to have the idea to add theming for features (like I did) then adding theming for UI concepts. For example, this could happen with other elements that have a lot of variations such as avatars, buttons, cards, status indicators, etc.

The other way to do it is more like in mui.ts where its about UI elements and tags. If we following that line of thinking then we could use the name pills in the theme instead of roles. In this case we are thinking more about the UI component itself than the feature it is used for.

Copy link
Member

@aslilacaslilacAug 20, 2024
edited
Loading

Choose a reason for hiding this comment

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

Sorry about the confusion. Thetheme.roles property is entirely unrelated to the "Roles" feature in the product. 😄#14356 has been merged now though, sotheme.roles.info is there to use as a neutral color set.

Copy link
ContributorAuthor

Choose a reason for hiding this comment

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

theme.roles.info.background and theme.roles.info.outline are different than the colors I want to use. Where would you suggest placing the colors I wanted to use from theme.roles.default?

@jaaydenhjaaydenhforce-pushed thejaaydenh/add-custom-role-pills branch fromb3c3361 to9879c09CompareAugust 21, 2024 15:31
exportinterfaceRoles{
exportinterfaceColorRoles{
/** The default color role for general use */
default:ColorRole;
Copy link
Member

Choose a reason for hiding this comment

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

I'm gonna be defensive about this because I put a lot of thought into the design of this bit of our theme:default, the way that you are using it, is not a UI role. As a user, when the app uses theerror colors I can say "The UI is showing me something is wrong", but I can't say "The UI is showing me a default color role for general use". I think the intent of these roles is really important for consistency throughout the product.

I'm also not convinced thatColorRole is a better name. The colors they represent are a consequence, not the primary motivation. Otherwise they'd just be namedred,orange, etc. You're supposed to think about what you're trying to communicate with the color first, and then the colors come from that naturally. MaybeUiRole or something if you really think it needs to be changed.

default could potentially be an appropriate role name if it was identifying things in the UI as a default target. The default org, the default template version, so on. But there isn't anything about the permissions given to an org role that makes them "default" of that role, especially not when used to highlight all of them.

Copy link
ContributorAuthor

Choose a reason for hiding this comment

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

What I want is a way to define styles for a default pill, and although info can work, the name feels like its a special case and not the standard/default color. I would ideally like to keep defaults in palette or someplace outside of roles in case it doesn't fit into background, outline, text, or the fill colors.

@github-actionsgithub-actionsbot added staleThis issue is like stale bread. and removed staleThis issue is like stale bread. labelsAug 29, 2024
Copy link
Member

@aslilacaslilac left a comment

Choose a reason for hiding this comment

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

  • if you want to add new colors, you can add them toexperimental
  • I'd prefer if we reverted theColorRole changes and tackled that as its own thing, rather than pushing it through by tacking it on to another change

@jaaydenh
Copy link
ContributorAuthor

@aslilac If I add a color to experimental, do I just give it a descriptive name next to l1 and l2? or should it go inside l1 or l2? If l1 means primary and l2 means secondary, how do those colors get translated elsewhere once they leave experimental?

@aslilac
Copy link
Member

as long as it's insideexperimental I don't really have any strong feelings. 😄 when they leave, they get translated however we want them to, as long as there's a bit of consensus that they're worth promoting.

@jaaydenhjaaydenhforce-pushed thejaaydenh/add-custom-role-pills branch frome0542c9 tode5e171CompareSeptember 3, 2024 19:27
exportconstPermissionPillsList:FC<PermissionPillsListProps>=({
permissions,
})=>{
constresourceTypes:string[]=getUniqueResourceTypes(permissions);
Copy link
Member

Choose a reason for hiding this comment

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

is this type annotation here still necessary? maybe if TypeScript is having trouble inferring the type here you could add: string[] to the function declaration

jaaydenh reacted with thumbs up emoji
Copy link
ContributorAuthor

Choose a reason for hiding this comment

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

not necessary, just leftover from implementation work.

@jaaydenhjaaydenh merged commit093d243 intomainSep 3, 2024
28 checks passed
@jaaydenhjaaydenh deleted the jaaydenh/add-custom-role-pills branchSeptember 3, 2024 20:39
@github-actionsgithub-actionsbot locked and limited conversation to collaboratorsSep 3, 2024
Sign up for freeto subscribe to this conversation on GitHub. Already have an account?Sign in.

Reviewers

@BrunoQuaresmaBrunoQuaresmaBrunoQuaresma left review comments

@aslilacaslilacaslilac approved these changes

Assignees

@jaaydenhjaaydenh

Labels

None yet

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

Improve display for permissions column view on custom roles table

3 participants

@jaaydenh@BrunoQuaresma@aslilac

[8]ページ先頭

©2009-2025 Movatter.jp