Fix: Add tooltip for clarity and fix wording

This commit is contained in:
Daniel Hougaard
2024-05-07 17:30:35 +02:00
parent c7d2dfd351
commit 44370d49e3
@@ -344,6 +344,11 @@ export const SpecificPrivilegeSecretForm = ({
render={({ field }) => { render={({ field }) => {
if (policies) { if (policies) {
return ( return (
<Tooltip
isDisabled={!!selectablePaths.length}
content="The selected environment doesn't have any policies."
>
<div>
<FormControl label="Secret Path"> <FormControl label="Secret Path">
<Select <Select
{...field} {...field}
@@ -358,6 +363,8 @@ export const SpecificPrivilegeSecretForm = ({
))} ))}
</Select> </Select>
</FormControl> </FormControl>
</div>
</Tooltip>
); );
} }
return ( return (
@@ -515,8 +522,9 @@ export const SpecificPrivilegeSecretForm = ({
); );
}} }}
> >
{temporaryAccessField.isTemporary ? "Restart" : "Grant"} {temporaryAccessField.isTemporary && !policies ? "Restart" : "Grant"}
</Button> </Button>
{temporaryAccessField.isTemporary && ( {temporaryAccessField.isTemporary && (
<Button <Button
size="xs" size="xs"
@@ -528,7 +536,7 @@ export const SpecificPrivilegeSecretForm = ({
}); });
}} }}
> >
Revoke Access Cancel
</Button> </Button>
)} )}
</div> </div>