mirror of
https://github.com/awatertrevi/infisical.git
synced 2026-10-07 23:27:35 +00:00
improvement: address feedback on remove rule policy edit
This commit is contained in:
+27
-21
@@ -12,7 +12,7 @@ import {
|
|||||||
import { FontAwesomeIcon } from "@fortawesome/react-fontawesome";
|
import { FontAwesomeIcon } from "@fortawesome/react-fontawesome";
|
||||||
import { twMerge } from "tailwind-merge";
|
import { twMerge } from "tailwind-merge";
|
||||||
|
|
||||||
import { Button, Checkbox, Select, SelectItem, Tag, Tooltip } from "@app/components/v2";
|
import { Button, Checkbox, IconButton, Select, SelectItem, Tag, Tooltip } from "@app/components/v2";
|
||||||
import { ProjectPermissionSub } from "@app/context";
|
import { ProjectPermissionSub } from "@app/context";
|
||||||
import { useToggle } from "@app/hooks";
|
import { useToggle } from "@app/hooks";
|
||||||
|
|
||||||
@@ -241,16 +241,19 @@ export const GeneralPermissionPolicies = <T extends keyof NonNullable<TFormSchem
|
|||||||
/>
|
/>
|
||||||
</Tooltip>
|
</Tooltip>
|
||||||
{!isDisabled && (
|
{!isDisabled && (
|
||||||
<Button
|
<Tooltip content="Remove Rule">
|
||||||
leftIcon={<FontAwesomeIcon icon={faTrash} />}
|
<IconButton
|
||||||
variant="outline_bg"
|
ariaLabel="Remove rule"
|
||||||
size="xs"
|
colorSchema="danger"
|
||||||
className="ml-auto mr-3"
|
variant="plain"
|
||||||
onClick={() => remove(rootIndex)}
|
size="xs"
|
||||||
isDisabled={isDisabled}
|
className="ml-auto mr-3 rounded"
|
||||||
>
|
onClick={() => remove(rootIndex)}
|
||||||
Remove Rule
|
isDisabled={isDisabled}
|
||||||
</Button>
|
>
|
||||||
|
<FontAwesomeIcon icon={faTrash} />
|
||||||
|
</IconButton>
|
||||||
|
</Tooltip>
|
||||||
)}
|
)}
|
||||||
{!isDisabled && (
|
{!isDisabled && (
|
||||||
<Tooltip position="left" content="Drag to reorder permission">
|
<Tooltip position="left" content="Drag to reorder permission">
|
||||||
@@ -271,16 +274,19 @@ export const GeneralPermissionPolicies = <T extends keyof NonNullable<TFormSchem
|
|||||||
<div className="flex w-full justify-between">
|
<div className="flex w-full justify-between">
|
||||||
<div className="mb-2">Actions</div>
|
<div className="mb-2">Actions</div>
|
||||||
{!isDisabled && !isConditionalSubjects(subject) && (
|
{!isDisabled && !isConditionalSubjects(subject) && (
|
||||||
<Button
|
<Tooltip content="Remove Rule">
|
||||||
leftIcon={<FontAwesomeIcon icon={faTrash} />}
|
<IconButton
|
||||||
variant="outline_bg"
|
ariaLabel="Remove rule"
|
||||||
size="xs"
|
colorSchema="danger"
|
||||||
className="ml-auto"
|
variant="plain"
|
||||||
onClick={() => remove(rootIndex)}
|
size="xs"
|
||||||
isDisabled={isDisabled}
|
className="ml-auto rounded"
|
||||||
>
|
onClick={() => remove(rootIndex)}
|
||||||
Remove Rule
|
isDisabled={isDisabled}
|
||||||
</Button>
|
>
|
||||||
|
<FontAwesomeIcon icon={faTrash} />
|
||||||
|
</IconButton>
|
||||||
|
</Tooltip>
|
||||||
)}
|
)}
|
||||||
</div>
|
</div>
|
||||||
<div className="flex flex-grow flex-wrap justify-start gap-x-8 gap-y-4">
|
<div className="flex flex-grow flex-wrap justify-start gap-x-8 gap-y-4">
|
||||||
|
|||||||
Reference in New Issue
Block a user