mirror of
https://github.com/awatertrevi/infisical.git
synced 2026-10-11 12:29:26 +00:00
Update DropZone.tsx
This commit is contained in:
@@ -6,6 +6,8 @@ import { faUpload } from "@fortawesome/free-solid-svg-icons";
|
|||||||
import { FontAwesomeIcon } from "@fortawesome/react-fontawesome";
|
import { FontAwesomeIcon } from "@fortawesome/react-fontawesome";
|
||||||
import { parseDocument, Scalar, YAMLMap } from "yaml";
|
import { parseDocument, Scalar, YAMLMap } from "yaml";
|
||||||
|
|
||||||
|
import { SecretType } from "@app/hooks/api/types";
|
||||||
|
|
||||||
import Button from "../basic/buttons/Button";
|
import Button from "../basic/buttons/Button";
|
||||||
import Error from "../basic/Error";
|
import Error from "../basic/Error";
|
||||||
import { createNotification } from "../notifications";
|
import { createNotification } from "../notifications";
|
||||||
@@ -34,7 +36,6 @@ const DropZone = ({
|
|||||||
}: DropZoneProps) => {
|
}: DropZoneProps) => {
|
||||||
const { t } = useTranslation();
|
const { t } = useTranslation();
|
||||||
|
|
||||||
|
|
||||||
const handleDragEnter = (e: DragEvent) => {
|
const handleDragEnter = (e: DragEvent) => {
|
||||||
e.preventDefault();
|
e.preventDefault();
|
||||||
e.stopPropagation();
|
e.stopPropagation();
|
||||||
@@ -66,7 +67,7 @@ const DropZone = ({
|
|||||||
key,
|
key,
|
||||||
value: keyPairs[key as keyof typeof keyPairs].value,
|
value: keyPairs[key as keyof typeof keyPairs].value,
|
||||||
comment: keyPairs[key as keyof typeof keyPairs].comments.join("\n"),
|
comment: keyPairs[key as keyof typeof keyPairs].comments.join("\n"),
|
||||||
type: "shared",
|
type: SecretType.Shared,
|
||||||
tags: []
|
tags: []
|
||||||
}));
|
}));
|
||||||
break;
|
break;
|
||||||
@@ -79,7 +80,7 @@ const DropZone = ({
|
|||||||
key,
|
key,
|
||||||
value: keyPairs[key as keyof typeof keyPairs],
|
value: keyPairs[key as keyof typeof keyPairs],
|
||||||
comment: "",
|
comment: "",
|
||||||
type: "shared",
|
type: SecretType.Shared,
|
||||||
tags: []
|
tags: []
|
||||||
}));
|
}));
|
||||||
break;
|
break;
|
||||||
@@ -102,7 +103,7 @@ const DropZone = ({
|
|||||||
key,
|
key,
|
||||||
value: keyPairs[key as keyof typeof keyPairs]?.toString() ?? "",
|
value: keyPairs[key as keyof typeof keyPairs]?.toString() ?? "",
|
||||||
comment,
|
comment,
|
||||||
type: "shared",
|
type: SecretType.Shared,
|
||||||
tags: []
|
tags: []
|
||||||
};
|
};
|
||||||
});
|
});
|
||||||
@@ -132,7 +133,7 @@ const DropZone = ({
|
|||||||
if (file === undefined) {
|
if (file === undefined) {
|
||||||
createNotification({
|
createNotification({
|
||||||
text: "You can't inject files from VS Code. Click 'Reveal in finder', and drag your file directly from the directory where it's located.",
|
text: "You can't inject files from VS Code. Click 'Reveal in finder', and drag your file directly from the directory where it's located.",
|
||||||
type: "error",
|
type: "error"
|
||||||
});
|
});
|
||||||
setLoading(false);
|
setLoading(false);
|
||||||
return;
|
return;
|
||||||
|
|||||||
Reference in New Issue
Block a user