mirror of
https://github.com/awatertrevi/infisical.git
synced 2026-10-20 21:18:18 +00:00
requested changes
This commit is contained in:
+23
-12
@@ -1,7 +1,7 @@
|
||||
import { ClipboardEvent, useRef } from "react";
|
||||
import { Controller, useForm } from "react-hook-form";
|
||||
import { subject } from "@casl/ability";
|
||||
import { faTriangleExclamation } from "@fortawesome/free-solid-svg-icons";
|
||||
import { faTriangleExclamation, faWarning } from "@fortawesome/free-solid-svg-icons";
|
||||
import { FontAwesomeIcon } from "@fortawesome/react-fontawesome";
|
||||
import { zodResolver } from "@hookform/resolvers/zod";
|
||||
import { z } from "zod";
|
||||
@@ -12,7 +12,8 @@ import {
|
||||
FilterableSelect,
|
||||
FormControl,
|
||||
Input,
|
||||
PasswordGenerator
|
||||
PasswordGenerator,
|
||||
Tooltip
|
||||
} from "@app/components/v2";
|
||||
import { CreatableSelect } from "@app/components/v2/CreatableSelect";
|
||||
import { InfisicalSecretInput } from "@app/components/v2/InfisicalSecretInput";
|
||||
@@ -217,17 +218,27 @@ export const CreateSecretForm = ({ secretPath = "/", onClose }: Props) => {
|
||||
// @ts-expect-error this is for multiple ref single component
|
||||
secretKeyInputRef.current = e;
|
||||
}}
|
||||
warningMessage={
|
||||
warning={
|
||||
secretKey?.includes(" ") ? (
|
||||
<div>
|
||||
Secret key contains whitespaces.
|
||||
<br />
|
||||
<br /> If this is the desired format, you need to provide it as{" "}
|
||||
<code className="rounded-md bg-mineshaft-500 px-1 py-0.5">
|
||||
{secretKey.trim().replaceAll(" ", "%20")}
|
||||
</code>{" "}
|
||||
when making API requests.
|
||||
</div>
|
||||
<Tooltip
|
||||
className={"w-full max-w-72"}
|
||||
content={
|
||||
<div>
|
||||
Secret key contains whitespaces.
|
||||
<br />
|
||||
<br /> If this is the desired format, you need to provide it as{" "}
|
||||
<code className="rounded-md bg-mineshaft-500 px-1 py-0.5">
|
||||
{encodeURIComponent(secretKey.trim())}
|
||||
</code>{" "}
|
||||
when making API requests.
|
||||
</div>
|
||||
}
|
||||
>
|
||||
<FontAwesomeIcon
|
||||
icon={faWarning}
|
||||
className="absolute right-0 mr-3 text-yellow-600"
|
||||
/>
|
||||
</Tooltip>
|
||||
) : undefined
|
||||
}
|
||||
placeholder="Type your secret name"
|
||||
|
||||
+22
-12
@@ -1,12 +1,12 @@
|
||||
import { ClipboardEvent, useRef } from "react";
|
||||
import { Controller, useForm } from "react-hook-form";
|
||||
import { faTriangleExclamation } from "@fortawesome/free-solid-svg-icons";
|
||||
import { faTriangleExclamation, faWarning } from "@fortawesome/free-solid-svg-icons";
|
||||
import { FontAwesomeIcon } from "@fortawesome/react-fontawesome";
|
||||
import { zodResolver } from "@hookform/resolvers/zod";
|
||||
import { z } from "zod";
|
||||
|
||||
import { createNotification } from "@app/components/notifications";
|
||||
import { Button, FormControl, Input, PasswordGenerator } from "@app/components/v2";
|
||||
import { Button, FormControl, Input, PasswordGenerator, Tooltip } from "@app/components/v2";
|
||||
import { CreatableSelect } from "@app/components/v2/CreatableSelect";
|
||||
import { InfisicalSecretInput } from "@app/components/v2/InfisicalSecretInput";
|
||||
import { ProjectPermissionActions, ProjectPermissionSub, useProjectPermission } from "@app/context";
|
||||
@@ -178,17 +178,27 @@ export const CreateSecretForm = ({
|
||||
// @ts-expect-error this is for multiple ref single component
|
||||
secretKeyInputRef.current = e;
|
||||
}}
|
||||
warningMessage={
|
||||
warning={
|
||||
secretKey?.includes(" ") ? (
|
||||
<div>
|
||||
Secret key contains whitespaces.
|
||||
<br />
|
||||
<br /> If this is the desired format, you need to provide it as{" "}
|
||||
<code className="rounded-md bg-mineshaft-500 px-1 py-0.5">
|
||||
{secretKey.trim().replaceAll(" ", "%20")}
|
||||
</code>{" "}
|
||||
when making API requests.
|
||||
</div>
|
||||
<Tooltip
|
||||
className={"w-full max-w-72"}
|
||||
content={
|
||||
<div>
|
||||
Secret key contains whitespaces.
|
||||
<br />
|
||||
<br /> If this is the desired format, you need to provide it as{" "}
|
||||
<code className="rounded-md bg-mineshaft-500 px-1 py-0.5">
|
||||
{encodeURIComponent(secretKey.trim())}
|
||||
</code>{" "}
|
||||
when making API requests.
|
||||
</div>
|
||||
}
|
||||
>
|
||||
<FontAwesomeIcon
|
||||
icon={faWarning}
|
||||
className="absolute right-0 mr-3 text-yellow-600"
|
||||
/>
|
||||
</Tooltip>
|
||||
) : undefined
|
||||
}
|
||||
placeholder="Type your secret name"
|
||||
|
||||
+21
-11
@@ -43,7 +43,7 @@ import { twMerge } from "tailwind-merge";
|
||||
import { ProjectPermissionSecretActions } from "@app/context/ProjectPermissionContext/types";
|
||||
import { hasSecretReadValueOrDescribePermission } from "@app/lib/fn/permission";
|
||||
import { FontAwesomeIcon } from "@fortawesome/react-fontawesome";
|
||||
import { faEyeSlash, faKey, faRotate } from "@fortawesome/free-solid-svg-icons";
|
||||
import { faEyeSlash, faKey, faRotate, faWarning } from "@fortawesome/free-solid-svg-icons";
|
||||
import { PendingAction } from "@app/hooks/api/secretFolders/types";
|
||||
import { format } from "date-fns";
|
||||
import { CreateReminderForm } from "@app/pages/secret-manager/SecretDashboardPage/components/SecretListView/CreateReminderForm";
|
||||
@@ -487,17 +487,27 @@ export const SecretItem = memo(
|
||||
placeholder={error?.message}
|
||||
isError={Boolean(error)}
|
||||
onKeyUp={() => trigger("key")}
|
||||
warningMessage={
|
||||
warning={
|
||||
field.value?.includes(" ") ? (
|
||||
<div>
|
||||
Secret key contains whitespaces.
|
||||
<br />
|
||||
<br /> If this is the desired format, you need to provide it as{" "}
|
||||
<code className="rounded-md bg-mineshaft-500 px-1 py-0.5">
|
||||
{field.value.trim().replaceAll(" ", "%20")}
|
||||
</code>{" "}
|
||||
when making API requests.
|
||||
</div>
|
||||
<Tooltip
|
||||
className={"w-full max-w-72"}
|
||||
content={
|
||||
<div>
|
||||
Secret key contains whitespaces.
|
||||
<br />
|
||||
<br /> If this is the desired format, you need to provide it as{" "}
|
||||
<code className="rounded-md bg-mineshaft-500 px-1 py-0.5">
|
||||
{encodeURIComponent(field.value.trim())}
|
||||
</code>{" "}
|
||||
when making API requests.
|
||||
</div>
|
||||
}
|
||||
>
|
||||
<FontAwesomeIcon
|
||||
icon={faWarning}
|
||||
className="absolute right-0 mr-3 text-yellow-600 opacity-60"
|
||||
/>
|
||||
</Tooltip>
|
||||
) : undefined
|
||||
}
|
||||
{...field}
|
||||
|
||||
Reference in New Issue
Block a user