-
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
Support more fields to the role editor #51458
base: bl-nero/fieldinput-labelsinput
Are you sure you want to change the base?
Support more fields to the role editor #51458
Conversation
e946468
to
4ebf9db
Compare
<Text typography="body3" mb={1}> | ||
Labels | ||
</Text> | ||
<FieldSelectCreatable |
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 inputs placeholder says Select...
, are we supposed to have a list of users to select? or maybe replace with Start typing a user and press enter
?
/> | ||
</Box> | ||
<LabelsInput | ||
legend="Labels" |
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.
should we also add a tooltip explaining labels as well?
/> | ||
<LabelsInput | ||
legend="Database Service Labels" | ||
tooltipContent="The database service labels have no influence on which databases' access is controlled by this role. Instead, they control which database services are discoverable while enrolling a new database." |
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.
@@ -112,6 +115,26 @@ const AccessRule = memo(function AccessRule({ | |||
value={verbs} | |||
onChange={v => setRule({ ...value, verbs: v })} | |||
rule={precomputed(validation.fields.verbs)} | |||
/> | |||
<FieldInput | |||
label="Condition" |
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.
personally i think it's okay to label it this way, but i'd also double check with product team because we try to teach users consistent wording
Additional condition, expressed using the{' '} | ||
<Text | ||
as="a" | ||
href="https://goteleport.com/docs/reference/predicate-language/" | ||
target="_blank" | ||
color={theme.colors.interactive.solid.accent.default} | ||
> | ||
Teleport predicate language | ||
</Text> |
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.
what about something like: Optional condition further limiting the scope for this rule expressed using the ....
This PR adds the following fields:
where
clause in access rules. I took liberty to call it "Condition" in the UI, so please voice your opinion on whether this is a good choice. My line of reasoning is that without understanding the underlying YAML model, the name "Where" would be confusing.The intent behind this PR was to fully support the
access
role in the rich UI, but it turned out that one more field was added to it, so we still miss the target. However, I added warnings to the Go codebase now, so hopefully, this will make it easier to prevent these situations in future.Requires #51457