-
Notifications
You must be signed in to change notification settings - Fork 1.8k
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
Add the options panel to role editor #49801
Conversation
Can you add a story for this UI? will make it easy for reviewers to play around without spinning the dev UI and setting up all the dependencies. |
Also tightens some constraints about standard role editor conformance.
4d4eaa6
to
0bacc2f
Compare
7b4bd84
to
a1b1c2e
Compare
@flyinghermit It's already there, just go to https://localhost:9002/?path=/story/teleport-roles-role-editor--new-role and go to the Options panel. |
Thanks for the link, that is helpful. Can you also put that link to storybook in your PR description? Its hard to guess otherwise when the PR itself does not touch on the story :) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good but please remove the commented code before merging this PR.
<H4 | ||
css={` | ||
grid-column: 1/3; | ||
border-top: ${theme.borders[1]} | ||
${theme.colors.interactive.tonal.neutral[0]}; | ||
padding-top: ${theme.space[3]}px; | ||
`} | ||
> | ||
SSH | ||
</H4> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Seeing this H4 grid repeated with only the text values (SSH,Database, Desktop etc) being unique, I think you will gain by programmatically creating each row instead of with hand. Given the scope of our role option, this will likely grow a larger list and I think will be cleaner that way.
desktopClipboard: true, | ||
createDesktopUser: false, | ||
desktopDirectorySharing: true, | ||
}, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The SAML IdP option is not included this time?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We are supporting an arbitrary subset of options for now, so no, it's not included.
<Box | ||
border={1} | ||
borderColor={theme.colors.interactive.tonal.neutral[0]} | ||
borderRadius={3} | ||
p={3} | ||
css={` | ||
display: grid; | ||
grid-template-columns: 1fr 1fr; | ||
align-items: baseline; | ||
row-gap: ${theme.space[3]}px; | ||
`} | ||
> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There is a lot of mixing of Styled components, style prop, css attributes, and then standard css in the css
prop? Is there a particular reason you used all 4 instead of picking one? I know genreally the css attributes are used for 1 offs or what not, but this seems to be all over the place.
I think the preferred way is a styled component (at least, I've received comments as such), but I don't care which way you do it here as long as its consistent.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh, this one. Yes, that was just me being lazy, I forgot to refactor it before submitting.
grid-column: 1/3; | ||
border-top: ${theme.borders[1]} | ||
${theme.colors.interactive.tonal.neutral[0]}; | ||
padding-top: ${theme.space[3]}px; | ||
`} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This style seems to match the other H4 in the component, lets move it to a single styled component so we don't risk missing style updates if we need to change it
* Add admin rule tab to the role editor Also tightens some constraints about standard role editor conformance. * Add a way to delete an admin rule * Add the options panel to role editor * Review * Review
To turn on the new UI, go to developer tools -> Application -> Local storage and add a
grv_teleport_use_new_role_editor
key set totrue
. This will be lifted once UI is good to be released.Figma
Story: https://localhost:9002/?path=/story/teleport-roles-role-editor--new-role
Deviations from the design:
Requires #49764
Contributes to #46612