mirror of
https://github.com/awatertrevi/infisical.git
synced 2026-10-06 17:27:16 +00:00
feat(ui): changed to a better toast for ui and a global error handler for all server error messages
This commit is contained in:
Generated
+40
-19
@@ -85,6 +85,7 @@
|
|||||||
"react-markdown": "^8.0.3",
|
"react-markdown": "^8.0.3",
|
||||||
"react-redux": "^8.0.2",
|
"react-redux": "^8.0.2",
|
||||||
"react-table": "^7.8.0",
|
"react-table": "^7.8.0",
|
||||||
|
"react-toastify": "^9.1.3",
|
||||||
"sanitize-html": "^2.12.1",
|
"sanitize-html": "^2.12.1",
|
||||||
"set-cookie-parser": "^2.5.1",
|
"set-cookie-parser": "^2.5.1",
|
||||||
"sharp": "^0.33.2",
|
"sharp": "^0.33.2",
|
||||||
@@ -9913,13 +9914,13 @@
|
|||||||
"dev": true
|
"dev": true
|
||||||
},
|
},
|
||||||
"node_modules/body-parser": {
|
"node_modules/body-parser": {
|
||||||
"version": "1.20.1",
|
"version": "1.20.2",
|
||||||
"resolved": "https://registry.npmjs.org/body-parser/-/body-parser-1.20.1.tgz",
|
"resolved": "https://registry.npmjs.org/body-parser/-/body-parser-1.20.2.tgz",
|
||||||
"integrity": "sha512-jWi7abTbYwajOytWCQc37VulmWiRae5RyTpaCyDcS5/lMdtwSz5lOpDE67srw/HYe35f1z3fDQw+3txg7gNtWw==",
|
"integrity": "sha512-ml9pReCu3M61kGlqoTm2umSXTlRTuGTx0bfYj+uIUKKYycG5NtSbeetV3faSU6R7ajOPw0g/J1PvK4qNy7s5bA==",
|
||||||
"dev": true,
|
"dev": true,
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"bytes": "3.1.2",
|
"bytes": "3.1.2",
|
||||||
"content-type": "~1.0.4",
|
"content-type": "~1.0.5",
|
||||||
"debug": "2.6.9",
|
"debug": "2.6.9",
|
||||||
"depd": "2.0.0",
|
"depd": "2.0.0",
|
||||||
"destroy": "1.2.0",
|
"destroy": "1.2.0",
|
||||||
@@ -9927,7 +9928,7 @@
|
|||||||
"iconv-lite": "0.4.24",
|
"iconv-lite": "0.4.24",
|
||||||
"on-finished": "2.4.1",
|
"on-finished": "2.4.1",
|
||||||
"qs": "6.11.0",
|
"qs": "6.11.0",
|
||||||
"raw-body": "2.5.1",
|
"raw-body": "2.5.2",
|
||||||
"type-is": "~1.6.18",
|
"type-is": "~1.6.18",
|
||||||
"unpipe": "1.0.0"
|
"unpipe": "1.0.0"
|
||||||
},
|
},
|
||||||
@@ -10876,9 +10877,9 @@
|
|||||||
"integrity": "sha512-ASFBup0Mz1uyiIjANan1jzLQami9z1PoYSZCiiYW2FczPbenXc45FZdBZLzOT+r6+iciuEModtmCti+hjaAk0A=="
|
"integrity": "sha512-ASFBup0Mz1uyiIjANan1jzLQami9z1PoYSZCiiYW2FczPbenXc45FZdBZLzOT+r6+iciuEModtmCti+hjaAk0A=="
|
||||||
},
|
},
|
||||||
"node_modules/cookie": {
|
"node_modules/cookie": {
|
||||||
"version": "0.5.0",
|
"version": "0.6.0",
|
||||||
"resolved": "https://registry.npmjs.org/cookie/-/cookie-0.5.0.tgz",
|
"resolved": "https://registry.npmjs.org/cookie/-/cookie-0.6.0.tgz",
|
||||||
"integrity": "sha512-YZ3GUyn/o8gfKJlnlX7g7xq4gyO6OSuhGPKaaGssGB2qgDUS0gPgtTvoyZLTt9Ab6dC4hfc9dV5arkvc/OCmrw==",
|
"integrity": "sha512-U71cyTamuh1CRNCfpGY6to28lxvNwPG4Guz/EVjgf3Jmzv0vlDp1atT9eS5dDjMYHucpHbWns6Lwf3BKz6svdw==",
|
||||||
"dev": true,
|
"dev": true,
|
||||||
"engines": {
|
"engines": {
|
||||||
"node": ">= 0.6"
|
"node": ">= 0.6"
|
||||||
@@ -13262,17 +13263,17 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/express": {
|
"node_modules/express": {
|
||||||
"version": "4.18.2",
|
"version": "4.19.2",
|
||||||
"resolved": "https://registry.npmjs.org/express/-/express-4.18.2.tgz",
|
"resolved": "https://registry.npmjs.org/express/-/express-4.19.2.tgz",
|
||||||
"integrity": "sha512-5/PsL6iGPdfQ/lKM1UuielYgv3BUoJfz1aUwU9vHZ+J7gyvwdQXFEBIEIaxeGf0GIcreATNyBExtalisDbuMqQ==",
|
"integrity": "sha512-5T6nhjsT+EOMzuck8JjBHARTHfMht0POzlA60WV2pMD3gyXw2LZnZ+ueGdNxG+0calOJcWKbpFcuzLZ91YWq9Q==",
|
||||||
"dev": true,
|
"dev": true,
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"accepts": "~1.3.8",
|
"accepts": "~1.3.8",
|
||||||
"array-flatten": "1.1.1",
|
"array-flatten": "1.1.1",
|
||||||
"body-parser": "1.20.1",
|
"body-parser": "1.20.2",
|
||||||
"content-disposition": "0.5.4",
|
"content-disposition": "0.5.4",
|
||||||
"content-type": "~1.0.4",
|
"content-type": "~1.0.4",
|
||||||
"cookie": "0.5.0",
|
"cookie": "0.6.0",
|
||||||
"cookie-signature": "1.0.6",
|
"cookie-signature": "1.0.6",
|
||||||
"debug": "2.6.9",
|
"debug": "2.6.9",
|
||||||
"depd": "2.0.0",
|
"depd": "2.0.0",
|
||||||
@@ -19793,9 +19794,9 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/raw-body": {
|
"node_modules/raw-body": {
|
||||||
"version": "2.5.1",
|
"version": "2.5.2",
|
||||||
"resolved": "https://registry.npmjs.org/raw-body/-/raw-body-2.5.1.tgz",
|
"resolved": "https://registry.npmjs.org/raw-body/-/raw-body-2.5.2.tgz",
|
||||||
"integrity": "sha512-qqJBtEyVgS0ZmPGdCFPWJ3FreoqvG4MVQln/kCgF7Olq95IbOp0/BWyMwbdtn4VTvkM8Y7khCQ2Xgk/tcrCXig==",
|
"integrity": "sha512-8zGqypfENjCIqGhgXToC8aB2r7YrBX+AQAfIPs/Mlk+BtPTztOvTS01NRW/3Eh60J+a48lt8qsCzirQ6loCVfA==",
|
||||||
"dev": true,
|
"dev": true,
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"bytes": "3.1.2",
|
"bytes": "3.1.2",
|
||||||
@@ -20300,6 +20301,26 @@
|
|||||||
"react": "^16.8.3 || ^17.0.0-0 || ^18.0.0"
|
"react": "^16.8.3 || ^17.0.0-0 || ^18.0.0"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"node_modules/react-toastify": {
|
||||||
|
"version": "9.1.3",
|
||||||
|
"resolved": "https://registry.npmjs.org/react-toastify/-/react-toastify-9.1.3.tgz",
|
||||||
|
"integrity": "sha512-fPfb8ghtn/XMxw3LkxQBk3IyagNpF/LIKjOBflbexr2AWxAH1MJgvnESwEwBn9liLFXgTKWgBSdZpw9m4OTHTg==",
|
||||||
|
"dependencies": {
|
||||||
|
"clsx": "^1.1.1"
|
||||||
|
},
|
||||||
|
"peerDependencies": {
|
||||||
|
"react": ">=16",
|
||||||
|
"react-dom": ">=16"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"node_modules/react-toastify/node_modules/clsx": {
|
||||||
|
"version": "1.2.1",
|
||||||
|
"resolved": "https://registry.npmjs.org/clsx/-/clsx-1.2.1.tgz",
|
||||||
|
"integrity": "sha512-EcR6r5a8bj6pu3ycsa/E/cKVGuTgZJZdsyUYHOksG/UHIiKfjxzRxYJpyVBwYaQeOvghal9fcc4PidlgzugAQg==",
|
||||||
|
"engines": {
|
||||||
|
"node": ">=6"
|
||||||
|
}
|
||||||
|
},
|
||||||
"node_modules/read-cache": {
|
"node_modules/read-cache": {
|
||||||
"version": "1.0.0",
|
"version": "1.0.0",
|
||||||
"resolved": "https://registry.npmjs.org/read-cache/-/read-cache-1.0.0.tgz",
|
"resolved": "https://registry.npmjs.org/read-cache/-/read-cache-1.0.0.tgz",
|
||||||
@@ -23701,9 +23722,9 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/webpack-dev-middleware": {
|
"node_modules/webpack-dev-middleware": {
|
||||||
"version": "6.1.1",
|
"version": "6.1.2",
|
||||||
"resolved": "https://registry.npmjs.org/webpack-dev-middleware/-/webpack-dev-middleware-6.1.1.tgz",
|
"resolved": "https://registry.npmjs.org/webpack-dev-middleware/-/webpack-dev-middleware-6.1.2.tgz",
|
||||||
"integrity": "sha512-y51HrHaFeeWir0YO4f0g+9GwZawuigzcAdRNon6jErXy/SqV/+O6eaVAzDqE6t3e3NpGeR5CS+cCDaTC+V3yEQ==",
|
"integrity": "sha512-Wu+EHmX326YPYUpQLKmKbTyZZJIB8/n6R09pTmB03kJmnMsVPTo9COzHZFr01txwaCAuZvfBJE4ZCHRcKs5JaQ==",
|
||||||
"dev": true,
|
"dev": true,
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"colorette": "^2.0.10",
|
"colorette": "^2.0.10",
|
||||||
|
|||||||
@@ -92,6 +92,7 @@
|
|||||||
"react-markdown": "^8.0.3",
|
"react-markdown": "^8.0.3",
|
||||||
"react-redux": "^8.0.2",
|
"react-redux": "^8.0.2",
|
||||||
"react-table": "^7.8.0",
|
"react-table": "^7.8.0",
|
||||||
|
"react-toastify": "^9.1.3",
|
||||||
"sanitize-html": "^2.12.1",
|
"sanitize-html": "^2.12.1",
|
||||||
"set-cookie-parser": "^2.5.1",
|
"set-cookie-parser": "^2.5.1",
|
||||||
"sharp": "^0.33.2",
|
"sharp": "^0.33.2",
|
||||||
|
|||||||
@@ -1,66 +0,0 @@
|
|||||||
import { useEffect, useRef } from "react";
|
|
||||||
import { faXmark } from "@fortawesome/free-solid-svg-icons";
|
|
||||||
import { FontAwesomeIcon } from "@fortawesome/react-fontawesome";
|
|
||||||
|
|
||||||
type NotificationType = "success" | "error" | "info";
|
|
||||||
|
|
||||||
export type TNotification = {
|
|
||||||
text: string;
|
|
||||||
type?: NotificationType;
|
|
||||||
timeoutMs?: number;
|
|
||||||
};
|
|
||||||
|
|
||||||
interface NotificationProps {
|
|
||||||
notification: Required<TNotification>;
|
|
||||||
clearNotification: (text: string) => void;
|
|
||||||
}
|
|
||||||
|
|
||||||
const Notification = ({ notification, clearNotification }: NotificationProps) => {
|
|
||||||
const timeout = useRef<number>();
|
|
||||||
|
|
||||||
const handleClearNotification = () => clearNotification(notification.text);
|
|
||||||
|
|
||||||
const setNotifTimeout = () => {
|
|
||||||
timeout.current = window.setTimeout(handleClearNotification, notification.timeoutMs);
|
|
||||||
};
|
|
||||||
|
|
||||||
const cancelNotifTimeout = () => {
|
|
||||||
clearTimeout(timeout.current);
|
|
||||||
};
|
|
||||||
|
|
||||||
useEffect(() => {
|
|
||||||
setNotifTimeout();
|
|
||||||
|
|
||||||
return cancelNotifTimeout;
|
|
||||||
}, []);
|
|
||||||
|
|
||||||
return (
|
|
||||||
<div
|
|
||||||
className="pointer-events-auto relative right-3 mb-3 flex w-full items-center justify-between rounded-md border border-bunker-500 bg-mineshaft-700 px-6 py-4"
|
|
||||||
role="alert"
|
|
||||||
>
|
|
||||||
{notification.type === "error" && (
|
|
||||||
<div className="absolute top-0 left-0 h-1 w-full rounded-t-md bg-red" />
|
|
||||||
)}
|
|
||||||
{notification.type === "success" && (
|
|
||||||
<div className="absolute top-0 left-0 h-1 w-full rounded-t-md bg-green" />
|
|
||||||
)}
|
|
||||||
{notification.type === "info" && (
|
|
||||||
<div className="absolute top-0 left-0 h-1 w-full rounded-t-md bg-yellow" />
|
|
||||||
)}
|
|
||||||
<p className="text-md font-base mt-0.5 text-bunker-200">{notification.text}</p>
|
|
||||||
<button
|
|
||||||
type="button"
|
|
||||||
className="rounded-lg"
|
|
||||||
onClick={() => clearNotification(notification.text)}
|
|
||||||
>
|
|
||||||
<FontAwesomeIcon
|
|
||||||
className="absolute right-2 top-3 h-4 w-4 pl-2 text-bunker-300 hover:text-white"
|
|
||||||
icon={faXmark}
|
|
||||||
/>
|
|
||||||
</button>
|
|
||||||
</div>
|
|
||||||
);
|
|
||||||
};
|
|
||||||
|
|
||||||
export default Notification;
|
|
||||||
@@ -1,52 +0,0 @@
|
|||||||
import { createContext, ReactNode, useCallback, useContext, useMemo, useState } from "react";
|
|
||||||
|
|
||||||
import { TNotification } from "./Notification";
|
|
||||||
import Notifications from "./Notifications";
|
|
||||||
|
|
||||||
type NotificationContextState = {
|
|
||||||
createNotification: (newNotification: TNotification) => void;
|
|
||||||
};
|
|
||||||
|
|
||||||
const NotificationContext = createContext<NotificationContextState>({
|
|
||||||
createNotification: () => console.log("createNotification not set!")
|
|
||||||
});
|
|
||||||
|
|
||||||
export const useNotificationContext = () => useContext(NotificationContext);
|
|
||||||
|
|
||||||
interface NotificationProviderProps {
|
|
||||||
children: ReactNode;
|
|
||||||
}
|
|
||||||
|
|
||||||
// TODO: Migration to radix toast
|
|
||||||
const NotificationProvider = ({ children }: NotificationProviderProps) => {
|
|
||||||
const [notifications, setNotifications] = useState<Required<TNotification>[]>([]);
|
|
||||||
|
|
||||||
const clearNotification = (text: string) =>
|
|
||||||
setNotifications((state) => state.filter((notif) => notif.text !== text));
|
|
||||||
|
|
||||||
const createNotification = useCallback(
|
|
||||||
({ text, type = "success", timeoutMs = 4000 }: TNotification) => {
|
|
||||||
const doesNotifExist = notifications.some((notif) => notif.text === text);
|
|
||||||
|
|
||||||
if (doesNotifExist) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
const newNotification: Required<TNotification> = { text, type, timeoutMs };
|
|
||||||
|
|
||||||
setNotifications((state) => [...state, newNotification]);
|
|
||||||
},
|
|
||||||
[notifications]
|
|
||||||
);
|
|
||||||
|
|
||||||
const value = useMemo(() => ({ createNotification }), [createNotification]);
|
|
||||||
|
|
||||||
return (
|
|
||||||
<NotificationContext.Provider value={value}>
|
|
||||||
<Notifications notifications={notifications} clearNotification={clearNotification} />
|
|
||||||
{children}
|
|
||||||
</NotificationContext.Provider>
|
|
||||||
);
|
|
||||||
};
|
|
||||||
|
|
||||||
export default NotificationProvider;
|
|
||||||
@@ -1,22 +0,0 @@
|
|||||||
import Notification, { TNotification } from "./Notification";
|
|
||||||
|
|
||||||
interface NoticationsProps {
|
|
||||||
notifications: Required<TNotification>[];
|
|
||||||
clearNotification: (text: string) => void;
|
|
||||||
}
|
|
||||||
|
|
||||||
const Notifications = ({ notifications, clearNotification }: NoticationsProps) => {
|
|
||||||
if (!notifications.length) {
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
|
|
||||||
return (
|
|
||||||
<div className="pointer-events-none fixed right-2 bottom-2 z-[100] hidden h-full w-96 gap-y-2 md:flex md:flex-col-reverse">
|
|
||||||
{notifications.map((notif) => (
|
|
||||||
<Notification key={notif.text} notification={notif} clearNotification={clearNotification} />
|
|
||||||
))}
|
|
||||||
</div>
|
|
||||||
);
|
|
||||||
};
|
|
||||||
|
|
||||||
export default Notifications;
|
|
||||||
@@ -8,7 +8,7 @@ import { parseDocument, Scalar, YAMLMap } from "yaml";
|
|||||||
|
|
||||||
import Button from "../basic/buttons/Button";
|
import Button from "../basic/buttons/Button";
|
||||||
import Error from "../basic/Error";
|
import Error from "../basic/Error";
|
||||||
import { useNotificationContext } from "../context/Notifications/NotificationProvider";
|
import { createNotification } from "../notifications";
|
||||||
import { parseDotEnv } from "../utilities/parseDotEnv";
|
import { parseDotEnv } from "../utilities/parseDotEnv";
|
||||||
import guidGenerator from "../utilities/randomId";
|
import guidGenerator from "../utilities/randomId";
|
||||||
|
|
||||||
@@ -33,7 +33,7 @@ const DropZone = ({
|
|||||||
numCurrentRows
|
numCurrentRows
|
||||||
}: DropZoneProps) => {
|
}: DropZoneProps) => {
|
||||||
const { t } = useTranslation();
|
const { t } = useTranslation();
|
||||||
const { createNotification } = useNotificationContext();
|
|
||||||
|
|
||||||
const handleDragEnter = (e: DragEvent) => {
|
const handleDragEnter = (e: DragEvent) => {
|
||||||
e.preventDefault();
|
e.preventDefault();
|
||||||
@@ -133,7 +133,6 @@ const DropZone = ({
|
|||||||
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",
|
||||||
timeoutMs: 10000
|
|
||||||
});
|
});
|
||||||
setLoading(false);
|
setLoading(false);
|
||||||
return;
|
return;
|
||||||
|
|||||||
@@ -0,0 +1,29 @@
|
|||||||
|
import { ReactNode } from "react";
|
||||||
|
import { Id, toast, ToastContainer, ToastOptions, TypeOptions } from "react-toastify";
|
||||||
|
|
||||||
|
export type TNotification = {
|
||||||
|
title?: string;
|
||||||
|
text: ReactNode;
|
||||||
|
};
|
||||||
|
|
||||||
|
export const NotificationContent = ({ title, text }: TNotification) => {
|
||||||
|
return (
|
||||||
|
<div className="msg-container">
|
||||||
|
{title && <div className="text-md mb-1 font-medium">{title}</div>}
|
||||||
|
<div className={title ? "text-sm" : "text-md"}>{text}</div>
|
||||||
|
</div>
|
||||||
|
);
|
||||||
|
};
|
||||||
|
|
||||||
|
export const createNotification = (
|
||||||
|
myProps: TNotification & { type?: TypeOptions },
|
||||||
|
toastProps: ToastOptions = {}
|
||||||
|
): Id =>
|
||||||
|
toast(<NotificationContent {...myProps} />, {
|
||||||
|
position: "bottom-right",
|
||||||
|
...toastProps,
|
||||||
|
theme: "dark",
|
||||||
|
type: myProps?.type || "info"
|
||||||
|
});
|
||||||
|
|
||||||
|
export const NotificationContainer = () => <ToastContainer hideProgressBar />;
|
||||||
@@ -0,0 +1 @@
|
|||||||
|
export { createNotification, NotificationContainer } from "./Notifications";
|
||||||
@@ -5,7 +5,7 @@ import { FontAwesomeIcon } from "@fortawesome/react-fontawesome";
|
|||||||
import { useToggle } from "@app/hooks";
|
import { useToggle } from "@app/hooks";
|
||||||
import { generateUserBackupKey } from "@app/lib/crypto";
|
import { generateUserBackupKey } from "@app/lib/crypto";
|
||||||
|
|
||||||
import { useNotificationContext } from "../context/Notifications/NotificationProvider";
|
import { createNotification } from "../notifications";
|
||||||
import { generateBackupPDFAsync } from "../utilities/generateBackupPDF";
|
import { generateBackupPDFAsync } from "../utilities/generateBackupPDF";
|
||||||
import { Button } from "../v2";
|
import { Button } from "../v2";
|
||||||
|
|
||||||
@@ -32,7 +32,7 @@ export default function DonwloadBackupPDFStep({
|
|||||||
name
|
name
|
||||||
}: DownloadBackupPDFStepProps): JSX.Element {
|
}: DownloadBackupPDFStepProps): JSX.Element {
|
||||||
const { t } = useTranslation();
|
const { t } = useTranslation();
|
||||||
const { createNotification } = useNotificationContext();
|
|
||||||
const [isLoading, setIsLoading] = useToggle();
|
const [isLoading, setIsLoading] = useToggle();
|
||||||
|
|
||||||
const handleBackupKeyGenerate = async () => {
|
const handleBackupKeyGenerate = async () => {
|
||||||
|
|||||||
@@ -3,7 +3,7 @@ import { useTranslation } from "react-i18next";
|
|||||||
import Link from "next/link";
|
import Link from "next/link";
|
||||||
import axios from "axios";
|
import axios from "axios";
|
||||||
|
|
||||||
import { useNotificationContext } from "@app/components/context/Notifications/NotificationProvider";
|
import { createNotification } from "@app/components/notifications";
|
||||||
import { useSendVerificationEmail } from "@app/hooks/api";
|
import { useSendVerificationEmail } from "@app/hooks/api";
|
||||||
|
|
||||||
import { Button, Input } from "../v2";
|
import { Button, Input } from "../v2";
|
||||||
@@ -27,7 +27,7 @@ export default function EnterEmailStep({
|
|||||||
setEmail,
|
setEmail,
|
||||||
incrementStep
|
incrementStep
|
||||||
}: DownloadBackupPDFStepProps): JSX.Element {
|
}: DownloadBackupPDFStepProps): JSX.Element {
|
||||||
const { createNotification } = useNotificationContext();
|
|
||||||
const { mutateAsync, isLoading } = useSendVerificationEmail();
|
const { mutateAsync, isLoading } = useSendVerificationEmail();
|
||||||
const [emailError, setEmailError] = useState(false);
|
const [emailError, setEmailError] = useState(false);
|
||||||
const { t } = useTranslation();
|
const { t } = useTranslation();
|
||||||
|
|||||||
@@ -5,7 +5,7 @@ import { FontAwesomeIcon } from "@fortawesome/react-fontawesome";
|
|||||||
import { zodResolver } from "@hookform/resolvers/zod";
|
import { zodResolver } from "@hookform/resolvers/zod";
|
||||||
import { z } from "zod";
|
import { z } from "zod";
|
||||||
|
|
||||||
import { useNotificationContext } from "@app/components/context/Notifications/NotificationProvider";
|
import { createNotification } from "@app/components/notifications";
|
||||||
import {
|
import {
|
||||||
Button,
|
Button,
|
||||||
FormControl,
|
FormControl,
|
||||||
@@ -110,7 +110,7 @@ export const CreateTagModal = ({ isOpen, onToggle }: Props): JSX.Element => {
|
|||||||
} = useForm<FormData>({
|
} = useForm<FormData>({
|
||||||
resolver: zodResolver(createTagSchema)
|
resolver: zodResolver(createTagSchema)
|
||||||
});
|
});
|
||||||
const { createNotification } = useNotificationContext();
|
|
||||||
const { currentWorkspace } = useWorkspace();
|
const { currentWorkspace } = useWorkspace();
|
||||||
const workspaceId = currentWorkspace?.id || "";
|
const workspaceId = currentWorkspace?.id || "";
|
||||||
|
|
||||||
|
|||||||
@@ -5,7 +5,7 @@ import { faWarning } from "@fortawesome/free-solid-svg-icons";
|
|||||||
import { FontAwesomeIcon } from "@fortawesome/react-fontawesome";
|
import { FontAwesomeIcon } from "@fortawesome/react-fontawesome";
|
||||||
import { twMerge } from "tailwind-merge";
|
import { twMerge } from "tailwind-merge";
|
||||||
|
|
||||||
import { useNotificationContext } from "@app/components/context/Notifications/NotificationProvider";
|
import { createNotification } from "@app/components/notifications";
|
||||||
import { useProjectPermission } from "@app/context";
|
import { useProjectPermission } from "@app/context";
|
||||||
import { useGetUpgradeProjectStatus, useUpgradeProject } from "@app/hooks/api";
|
import { useGetUpgradeProjectStatus, useUpgradeProject } from "@app/hooks/api";
|
||||||
import { Workspace } from "@app/hooks/api/types";
|
import { Workspace } from "@app/hooks/api/types";
|
||||||
@@ -25,7 +25,7 @@ export const UpgradeProjectAlert = ({
|
|||||||
project,
|
project,
|
||||||
transparent
|
transparent
|
||||||
}: UpgradeProjectAlertProps): JSX.Element | null => {
|
}: UpgradeProjectAlertProps): JSX.Element | null => {
|
||||||
const { createNotification } = useNotificationContext();
|
|
||||||
const router = useRouter();
|
const router = useRouter();
|
||||||
const { membership } = useProjectPermission();
|
const { membership } = useProjectPermission();
|
||||||
const upgradeProject = useUpgradeProject();
|
const upgradeProject = useUpgradeProject();
|
||||||
|
|||||||
@@ -1,3 +1,5 @@
|
|||||||
|
import { ZodIssue } from "zod";
|
||||||
|
|
||||||
export type { GetAuthTokenAPI } from "./auth/types";
|
export type { GetAuthTokenAPI } from "./auth/types";
|
||||||
export type { IncidentContact } from "./incidentContacts/types";
|
export type { IncidentContact } from "./incidentContacts/types";
|
||||||
export type { IntegrationAuth } from "./integrationAuth/types";
|
export type { IntegrationAuth } from "./integrationAuth/types";
|
||||||
@@ -36,3 +38,23 @@ export type {
|
|||||||
WorkspaceEnv,
|
WorkspaceEnv,
|
||||||
WorkspaceTag
|
WorkspaceTag
|
||||||
} from "./workspace/types";
|
} from "./workspace/types";
|
||||||
|
|
||||||
|
export enum ApiErrorTypes {
|
||||||
|
ValidationError = "ValidationFailure",
|
||||||
|
BadRequestError = "BadRequest",
|
||||||
|
UnauthorizedError = "UnauthorizedError",
|
||||||
|
ForbiddenError = "PermissionDenied"
|
||||||
|
}
|
||||||
|
|
||||||
|
export type TApiErrors =
|
||||||
|
| {
|
||||||
|
error: ApiErrorTypes.ValidationError;
|
||||||
|
message: ZodIssue[];
|
||||||
|
statusCode: 403;
|
||||||
|
}
|
||||||
|
| { error: ApiErrorTypes.ForbiddenError; message: string; statusCode: 401 }
|
||||||
|
| {
|
||||||
|
statusCode: 400;
|
||||||
|
message: string;
|
||||||
|
error: ApiErrorTypes.BadRequestError;
|
||||||
|
};
|
||||||
|
|||||||
@@ -31,7 +31,7 @@ import { DropdownMenuTrigger } from "@radix-ui/react-dropdown-menu";
|
|||||||
import { twMerge } from "tailwind-merge";
|
import { twMerge } from "tailwind-merge";
|
||||||
import * as yup from "yup";
|
import * as yup from "yup";
|
||||||
|
|
||||||
import { useNotificationContext } from "@app/components/context/Notifications/NotificationProvider";
|
import { createNotification } from "@app/components/notifications";
|
||||||
import { OrgPermissionCan } from "@app/components/permissions";
|
import { OrgPermissionCan } from "@app/components/permissions";
|
||||||
import { tempLocalStorage } from "@app/components/utilities/checks/tempLocalStorage";
|
import { tempLocalStorage } from "@app/components/utilities/checks/tempLocalStorage";
|
||||||
import {
|
import {
|
||||||
@@ -115,7 +115,7 @@ type TAddProjectFormData = yup.InferType<typeof formSchema>;
|
|||||||
|
|
||||||
export const AppLayout = ({ children }: LayoutProps) => {
|
export const AppLayout = ({ children }: LayoutProps) => {
|
||||||
const router = useRouter();
|
const router = useRouter();
|
||||||
const { createNotification } = useNotificationContext();
|
|
||||||
const { mutateAsync } = useGetOrgTrialUrl();
|
const { mutateAsync } = useGetOrgTrialUrl();
|
||||||
|
|
||||||
const { workspaces, currentWorkspace } = useWorkspace();
|
const { workspaces, currentWorkspace } = useWorkspace();
|
||||||
|
|||||||
+30
-31
@@ -12,7 +12,7 @@ import { config } from "@fortawesome/fontawesome-svg-core";
|
|||||||
import { QueryClientProvider } from "@tanstack/react-query";
|
import { QueryClientProvider } from "@tanstack/react-query";
|
||||||
import NProgress from "nprogress";
|
import NProgress from "nprogress";
|
||||||
|
|
||||||
import NotificationProvider from "@app/components/context/Notifications/NotificationProvider";
|
import { NotificationContainer } from "@app/components/notifications";
|
||||||
import Telemetry from "@app/components/utilities/telemetry/Telemetry";
|
import Telemetry from "@app/components/utilities/telemetry/Telemetry";
|
||||||
import { TooltipProvider } from "@app/components/v2";
|
import { TooltipProvider } from "@app/components/v2";
|
||||||
import { publicPaths } from "@app/const";
|
import { publicPaths } from "@app/const";
|
||||||
@@ -30,6 +30,7 @@ import { AppLayout } from "@app/layouts";
|
|||||||
import { queryClient } from "@app/reactQuery";
|
import { queryClient } from "@app/reactQuery";
|
||||||
|
|
||||||
import "nprogress/nprogress.css";
|
import "nprogress/nprogress.css";
|
||||||
|
import "react-toastify/dist/ReactToastify.css";
|
||||||
import "@fortawesome/fontawesome-svg-core/styles.css";
|
import "@fortawesome/fontawesome-svg-core/styles.css";
|
||||||
import "react-day-picker/dist/style.css";
|
import "react-day-picker/dist/style.css";
|
||||||
import "../styles/globals.css";
|
import "../styles/globals.css";
|
||||||
@@ -85,15 +86,14 @@ const App = ({ Component, pageProps, ...appProps }: NextAppProp): JSX.Element =>
|
|||||||
) {
|
) {
|
||||||
return (
|
return (
|
||||||
<QueryClientProvider client={queryClient}>
|
<QueryClientProvider client={queryClient}>
|
||||||
<NotificationProvider>
|
<NotificationContainer />
|
||||||
<ServerConfigProvider>
|
<ServerConfigProvider>
|
||||||
<UserProvider>
|
<UserProvider>
|
||||||
<AuthProvider>
|
<AuthProvider>
|
||||||
<Component {...pageProps} />
|
<Component {...pageProps} />
|
||||||
</AuthProvider>
|
</AuthProvider>
|
||||||
</UserProvider>
|
</UserProvider>
|
||||||
</ServerConfigProvider>
|
</ServerConfigProvider>
|
||||||
</NotificationProvider>
|
|
||||||
</QueryClientProvider>
|
</QueryClientProvider>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
@@ -103,27 +103,26 @@ const App = ({ Component, pageProps, ...appProps }: NextAppProp): JSX.Element =>
|
|||||||
return (
|
return (
|
||||||
<QueryClientProvider client={queryClient}>
|
<QueryClientProvider client={queryClient}>
|
||||||
<TooltipProvider>
|
<TooltipProvider>
|
||||||
<NotificationProvider>
|
<NotificationContainer />
|
||||||
<ServerConfigProvider>
|
<ServerConfigProvider>
|
||||||
<AuthProvider>
|
<AuthProvider>
|
||||||
<OrgProvider>
|
<OrgProvider>
|
||||||
<OrgPermissionProvider>
|
<OrgPermissionProvider>
|
||||||
<WorkspaceProvider>
|
<WorkspaceProvider>
|
||||||
<ProjectPermissionProvider>
|
<ProjectPermissionProvider>
|
||||||
<SubscriptionProvider>
|
<SubscriptionProvider>
|
||||||
<UserProvider>
|
<UserProvider>
|
||||||
<Layout>
|
<Layout>
|
||||||
<Component {...pageProps} />
|
<Component {...pageProps} />
|
||||||
</Layout>
|
</Layout>
|
||||||
</UserProvider>
|
</UserProvider>
|
||||||
</SubscriptionProvider>
|
</SubscriptionProvider>
|
||||||
</ProjectPermissionProvider>
|
</ProjectPermissionProvider>
|
||||||
</WorkspaceProvider>
|
</WorkspaceProvider>
|
||||||
</OrgPermissionProvider>
|
</OrgPermissionProvider>
|
||||||
</OrgProvider>
|
</OrgProvider>
|
||||||
</AuthProvider>
|
</AuthProvider>
|
||||||
</ServerConfigProvider>
|
</ServerConfigProvider>
|
||||||
</NotificationProvider>
|
|
||||||
</TooltipProvider>
|
</TooltipProvider>
|
||||||
</QueryClientProvider>
|
</QueryClientProvider>
|
||||||
);
|
);
|
||||||
|
|||||||
@@ -3,7 +3,7 @@ import { useRouter } from "next/router";
|
|||||||
import axios from "axios";
|
import axios from "axios";
|
||||||
import queryString from "query-string";
|
import queryString from "query-string";
|
||||||
|
|
||||||
import { useNotificationContext } from "@app/components/context/Notifications/NotificationProvider";
|
import { createNotification } from "@app/components/notifications";
|
||||||
import { useCreateIntegration, useGetWorkspaceById } from "@app/hooks/api";
|
import { useCreateIntegration, useGetWorkspaceById } from "@app/hooks/api";
|
||||||
|
|
||||||
import {
|
import {
|
||||||
@@ -27,7 +27,7 @@ const cloudflareEnvironments = [
|
|||||||
export default function CloudflarePagesIntegrationPage() {
|
export default function CloudflarePagesIntegrationPage() {
|
||||||
const router = useRouter();
|
const router = useRouter();
|
||||||
const { mutateAsync } = useCreateIntegration();
|
const { mutateAsync } = useCreateIntegration();
|
||||||
const { createNotification } = useNotificationContext();
|
|
||||||
|
|
||||||
const { integrationAuthId } = queryString.parse(router.asPath.split("?")[1]);
|
const { integrationAuthId } = queryString.parse(router.asPath.split("?")[1]);
|
||||||
const [secretPath, setSecretPath] = useState("/");
|
const [secretPath, setSecretPath] = useState("/");
|
||||||
|
|||||||
@@ -3,7 +3,7 @@ import { useRouter } from "next/router";
|
|||||||
import axios from "axios";
|
import axios from "axios";
|
||||||
import queryString from "query-string";
|
import queryString from "query-string";
|
||||||
|
|
||||||
import { useNotificationContext } from "@app/components/context/Notifications/NotificationProvider";
|
import { createNotification } from "@app/components/notifications";
|
||||||
import { useCreateIntegration, useGetWorkspaceById } from "@app/hooks/api";
|
import { useCreateIntegration, useGetWorkspaceById } from "@app/hooks/api";
|
||||||
|
|
||||||
import {
|
import {
|
||||||
@@ -23,7 +23,7 @@ import {
|
|||||||
export default function CloudflareWorkersIntegrationPage() {
|
export default function CloudflareWorkersIntegrationPage() {
|
||||||
const router = useRouter();
|
const router = useRouter();
|
||||||
const { mutateAsync } = useCreateIntegration();
|
const { mutateAsync } = useCreateIntegration();
|
||||||
const { createNotification } = useNotificationContext();
|
|
||||||
|
|
||||||
const { integrationAuthId } = queryString.parse(router.asPath.split("?")[1]);
|
const { integrationAuthId } = queryString.parse(router.asPath.split("?")[1]);
|
||||||
const { data: workspace } = useGetWorkspaceById(localStorage.getItem("projectData.id") ?? "");
|
const { data: workspace } = useGetWorkspaceById(localStorage.getItem("projectData.id") ?? "");
|
||||||
|
|||||||
@@ -20,7 +20,7 @@ import queryString from "query-string";
|
|||||||
import { twMerge } from "tailwind-merge";
|
import { twMerge } from "tailwind-merge";
|
||||||
import * as yup from "yup";
|
import * as yup from "yup";
|
||||||
|
|
||||||
import { useNotificationContext } from "@app/components/context/Notifications/NotificationProvider";
|
import { createNotification } from "@app/components/notifications";
|
||||||
import {
|
import {
|
||||||
Button,
|
Button,
|
||||||
Card,
|
Card,
|
||||||
@@ -98,7 +98,7 @@ type FormData = yup.InferType<typeof schema>;
|
|||||||
export default function GitHubCreateIntegrationPage() {
|
export default function GitHubCreateIntegrationPage() {
|
||||||
const router = useRouter();
|
const router = useRouter();
|
||||||
const { mutateAsync } = useCreateIntegration();
|
const { mutateAsync } = useCreateIntegration();
|
||||||
const { createNotification } = useNotificationContext();
|
|
||||||
|
|
||||||
const integrationAuthId =
|
const integrationAuthId =
|
||||||
(queryString.parse(router.asPath.split("?")[1]).integrationAuthId as string) ?? "";
|
(queryString.parse(router.asPath.split("?")[1]).integrationAuthId as string) ?? "";
|
||||||
|
|||||||
@@ -9,7 +9,7 @@ import { FontAwesomeIcon } from "@fortawesome/react-fontawesome";
|
|||||||
import axios from "axios";
|
import axios from "axios";
|
||||||
import jwt_decode from "jwt-decode";
|
import jwt_decode from "jwt-decode";
|
||||||
|
|
||||||
import { useNotificationContext } from "@app/components/context/Notifications/NotificationProvider";
|
import { createNotification } from "@app/components/notifications";
|
||||||
import { IsCliLoginSuccessful } from "@app/components/utilities/attemptCliLogin";
|
import { IsCliLoginSuccessful } from "@app/components/utilities/attemptCliLogin";
|
||||||
import { Button, Spinner } from "@app/components/v2";
|
import { Button, Spinner } from "@app/components/v2";
|
||||||
import { useUser } from "@app/context";
|
import { useUser } from "@app/context";
|
||||||
@@ -35,7 +35,7 @@ export default function LoginPage() {
|
|||||||
const selectOrg = useSelectOrganization();
|
const selectOrg = useSelectOrganization();
|
||||||
const { user, isLoading: userLoading } = useUser();
|
const { user, isLoading: userLoading } = useUser();
|
||||||
|
|
||||||
const { createNotification } = useNotificationContext();
|
|
||||||
|
|
||||||
const queryParams = new URLSearchParams(window.location.search);
|
const queryParams = new URLSearchParams(window.location.search);
|
||||||
|
|
||||||
|
|||||||
@@ -28,7 +28,7 @@ import { yupResolver } from "@hookform/resolvers/yup";
|
|||||||
import * as Tabs from "@radix-ui/react-tabs";
|
import * as Tabs from "@radix-ui/react-tabs";
|
||||||
import * as yup from "yup";
|
import * as yup from "yup";
|
||||||
|
|
||||||
import { useNotificationContext } from "@app/components/context/Notifications/NotificationProvider";
|
import { createNotification } from "@app/components/notifications";
|
||||||
import { OrgPermissionCan } from "@app/components/permissions";
|
import { OrgPermissionCan } from "@app/components/permissions";
|
||||||
import onboardingCheck from "@app/components/utilities/checks/OnboardingCheck";
|
import onboardingCheck from "@app/components/utilities/checks/OnboardingCheck";
|
||||||
import {
|
import {
|
||||||
@@ -477,7 +477,7 @@ const OrganizationPage = withPermission(
|
|||||||
const { currentOrg } = useOrganization();
|
const { currentOrg } = useOrganization();
|
||||||
const routerOrgId = String(router.query.id);
|
const routerOrgId = String(router.query.id);
|
||||||
const orgWorkspaces = workspaces?.filter((workspace) => workspace.orgId === routerOrgId) || [];
|
const orgWorkspaces = workspaces?.filter((workspace) => workspace.orgId === routerOrgId) || [];
|
||||||
const { createNotification } = useNotificationContext();
|
|
||||||
const addUsersToProject = useAddUserToWsNonE2EE();
|
const addUsersToProject = useAddUserToWsNonE2EE();
|
||||||
|
|
||||||
const { popUp, handlePopUpOpen, handlePopUpClose, handlePopUpToggle } = usePopUp([
|
const { popUp, handlePopUpOpen, handlePopUpClose, handlePopUpToggle } = usePopUp([
|
||||||
|
|||||||
@@ -1,4 +1,9 @@
|
|||||||
import { QueryClient } from "@tanstack/react-query";
|
import { MutationCache, QueryClient } from "@tanstack/react-query";
|
||||||
|
import axios from "axios";
|
||||||
|
|
||||||
|
import { createNotification } from "@app/components/notifications";
|
||||||
|
|
||||||
|
import { ApiErrorTypes, TApiErrors } from "./hooks/api/types";
|
||||||
|
|
||||||
// this is saved in react-query cache
|
// this is saved in react-query cache
|
||||||
export const SIGNUP_TEMP_TOKEN_CACHE_KEY = ["infisical__signup-temp-token"];
|
export const SIGNUP_TEMP_TOKEN_CACHE_KEY = ["infisical__signup-temp-token"];
|
||||||
@@ -6,6 +11,40 @@ export const MFA_TEMP_TOKEN_CACHE_KEY = ["infisical__mfa-temp-token"];
|
|||||||
export const AUTH_TOKEN_CACHE_KEY = ["infisical__auth-token"];
|
export const AUTH_TOKEN_CACHE_KEY = ["infisical__auth-token"];
|
||||||
|
|
||||||
export const queryClient = new QueryClient({
|
export const queryClient = new QueryClient({
|
||||||
|
mutationCache: new MutationCache({
|
||||||
|
onError: (error) => {
|
||||||
|
if (axios.isAxiosError(error)) {
|
||||||
|
const serverResponse = error.response?.data as TApiErrors;
|
||||||
|
if (serverResponse?.error === ApiErrorTypes.ValidationError) {
|
||||||
|
createNotification({
|
||||||
|
title: "Validation Error",
|
||||||
|
type: "error",
|
||||||
|
text: (
|
||||||
|
<div>
|
||||||
|
{serverResponse.message?.map(({ message, path }) => (
|
||||||
|
<div className="flex space-y-2" key={path.join(".")}>
|
||||||
|
<div>
|
||||||
|
Field <i>{path.join(".")}</i> {message.toLowerCase()}
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
))}
|
||||||
|
</div>
|
||||||
|
)
|
||||||
|
});
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
if (serverResponse.statusCode === 401) {
|
||||||
|
createNotification({
|
||||||
|
title: "Forbidden Access",
|
||||||
|
type: "error",
|
||||||
|
text: serverResponse.message
|
||||||
|
});
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
createNotification({ title: "Bad Request", type: "error", text: serverResponse.message });
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}),
|
||||||
defaultOptions: {
|
defaultOptions: {
|
||||||
queries: {
|
queries: {
|
||||||
refetchOnWindowFocus: false,
|
refetchOnWindowFocus: false,
|
||||||
@@ -5,6 +5,10 @@ html {
|
|||||||
@apply overflow-hidden;
|
@apply overflow-hidden;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
:root {
|
||||||
|
--toastify-color-dark: theme(colors.mineshaft.700);
|
||||||
|
}
|
||||||
|
|
||||||
.rdp-day,
|
.rdp-day,
|
||||||
.rdp-nav_button {
|
.rdp-nav_button {
|
||||||
@apply rounded-md hover:text-mineshaft-500;
|
@apply rounded-md hover:text-mineshaft-500;
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
import { useCallback, useEffect } from "react";
|
import { useCallback, useEffect } from "react";
|
||||||
import { useTranslation } from "react-i18next";
|
import { useTranslation } from "react-i18next";
|
||||||
|
|
||||||
import { useNotificationContext } from "@app/components/context/Notifications/NotificationProvider";
|
import { createNotification } from "@app/components/notifications";
|
||||||
import { Button, Modal, ModalContent } from "@app/components/v2";
|
import { Button, Modal, ModalContent } from "@app/components/v2";
|
||||||
import { ProjectPermissionActions, ProjectPermissionSub, useWorkspace } from "@app/context";
|
import { ProjectPermissionActions, ProjectPermissionSub, useWorkspace } from "@app/context";
|
||||||
import { withProjectPermission } from "@app/hoc";
|
import { withProjectPermission } from "@app/hoc";
|
||||||
@@ -31,7 +31,7 @@ type Props = {
|
|||||||
export const IntegrationsPage = withProjectPermission(
|
export const IntegrationsPage = withProjectPermission(
|
||||||
({ frameworkIntegrations }: Props) => {
|
({ frameworkIntegrations }: Props) => {
|
||||||
const { t } = useTranslation();
|
const { t } = useTranslation();
|
||||||
const { createNotification } = useNotificationContext();
|
|
||||||
|
|
||||||
const { currentWorkspace } = useWorkspace();
|
const { currentWorkspace } = useWorkspace();
|
||||||
const workspaceId = currentWorkspace?.id || "";
|
const workspaceId = currentWorkspace?.id || "";
|
||||||
|
|||||||
+2
-2
@@ -2,7 +2,7 @@ import { useTranslation } from "react-i18next";
|
|||||||
import { faCheck, faXmark } from "@fortawesome/free-solid-svg-icons";
|
import { faCheck, faXmark } from "@fortawesome/free-solid-svg-icons";
|
||||||
import { FontAwesomeIcon } from "@fortawesome/react-fontawesome";
|
import { FontAwesomeIcon } from "@fortawesome/react-fontawesome";
|
||||||
|
|
||||||
import { useNotificationContext } from "@app/components/context/Notifications/NotificationProvider";
|
import { createNotification } from "@app/components/notifications";
|
||||||
import { DeleteActionModal, Skeleton, Tooltip } from "@app/components/v2";
|
import { DeleteActionModal, Skeleton, Tooltip } from "@app/components/v2";
|
||||||
import { ProjectPermissionActions, ProjectPermissionSub, useProjectPermission } from "@app/context";
|
import { ProjectPermissionActions, ProjectPermissionSub, useProjectPermission } from "@app/context";
|
||||||
import { usePopUp } from "@app/hooks";
|
import { usePopUp } from "@app/hooks";
|
||||||
@@ -31,7 +31,7 @@ export const CloudIntegrationSection = ({
|
|||||||
"deleteConfirmation"
|
"deleteConfirmation"
|
||||||
] as const);
|
] as const);
|
||||||
const { permission } = useProjectPermission();
|
const { permission } = useProjectPermission();
|
||||||
const { createNotification } = useNotificationContext();
|
|
||||||
|
|
||||||
const isEmpty = !isLoading && !cloudIntegrations?.length;
|
const isEmpty = !isLoading && !cloudIntegrations?.length;
|
||||||
|
|
||||||
|
|||||||
@@ -7,7 +7,7 @@ import { faLock } from "@fortawesome/free-solid-svg-icons";
|
|||||||
import { FontAwesomeIcon } from "@fortawesome/react-fontawesome";
|
import { FontAwesomeIcon } from "@fortawesome/react-fontawesome";
|
||||||
|
|
||||||
import Error from "@app/components/basic/Error";
|
import Error from "@app/components/basic/Error";
|
||||||
import { useNotificationContext } from "@app/components/context/Notifications/NotificationProvider";
|
import { createNotification } from "@app/components/notifications";
|
||||||
import attemptCliLogin from "@app/components/utilities/attemptCliLogin";
|
import attemptCliLogin from "@app/components/utilities/attemptCliLogin";
|
||||||
import attemptLogin from "@app/components/utilities/attemptLogin";
|
import attemptLogin from "@app/components/utilities/attemptLogin";
|
||||||
import { Button, Input } from "@app/components/v2";
|
import { Button, Input } from "@app/components/v2";
|
||||||
@@ -25,7 +25,7 @@ type Props = {
|
|||||||
|
|
||||||
export const InitialStep = ({ setStep, email, setEmail, password, setPassword }: Props) => {
|
export const InitialStep = ({ setStep, email, setEmail, password, setPassword }: Props) => {
|
||||||
const router = useRouter();
|
const router = useRouter();
|
||||||
const { createNotification } = useNotificationContext();
|
|
||||||
const { t } = useTranslation();
|
const { t } = useTranslation();
|
||||||
const [isLoading, setIsLoading] = useState(false);
|
const [isLoading, setIsLoading] = useState(false);
|
||||||
const [loginError, setLoginError] = useState(false);
|
const [loginError, setLoginError] = useState(false);
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
import { useState } from "react";
|
import { useState } from "react";
|
||||||
import { useTranslation } from "react-i18next";
|
import { useTranslation } from "react-i18next";
|
||||||
|
|
||||||
import { useNotificationContext } from "@app/components/context/Notifications/NotificationProvider";
|
import { createNotification } from "@app/components/notifications";
|
||||||
import { Button, Input } from "@app/components/v2";
|
import { Button, Input } from "@app/components/v2";
|
||||||
import { loginLDAPRedirect } from "@app/hooks/api/auth/queries";
|
import { loginLDAPRedirect } from "@app/hooks/api/auth/queries";
|
||||||
|
|
||||||
@@ -10,7 +10,7 @@ type Props = {
|
|||||||
};
|
};
|
||||||
|
|
||||||
export const LDAPStep = ({ setStep }: Props) => {
|
export const LDAPStep = ({ setStep }: Props) => {
|
||||||
const { createNotification } = useNotificationContext();
|
|
||||||
const [organizationSlug, setOrganizationSlug] = useState("");
|
const [organizationSlug, setOrganizationSlug] = useState("");
|
||||||
const [username, setUsername] = useState("");
|
const [username, setUsername] = useState("");
|
||||||
const [password, setPassword] = useState("");
|
const [password, setPassword] = useState("");
|
||||||
|
|||||||
@@ -6,7 +6,7 @@ import axios from "axios";
|
|||||||
import jwt_decode from "jwt-decode";
|
import jwt_decode from "jwt-decode";
|
||||||
|
|
||||||
import Error from "@app/components/basic/Error"; // which to notification
|
import Error from "@app/components/basic/Error"; // which to notification
|
||||||
import { useNotificationContext } from "@app/components/context/Notifications/NotificationProvider";
|
import { createNotification } from "@app/components/notifications";
|
||||||
import attemptCliLoginMfa from "@app/components/utilities/attemptCliLoginMfa";
|
import attemptCliLoginMfa from "@app/components/utilities/attemptCliLoginMfa";
|
||||||
import attemptLoginMfa from "@app/components/utilities/attemptLoginMfa";
|
import attemptLoginMfa from "@app/components/utilities/attemptLoginMfa";
|
||||||
import { Button } from "@app/components/v2";
|
import { Button } from "@app/components/v2";
|
||||||
@@ -59,7 +59,7 @@ interface VerifyMfaTokenError {
|
|||||||
}
|
}
|
||||||
|
|
||||||
export const MFAStep = ({ email, password, providerAuthToken }: Props) => {
|
export const MFAStep = ({ email, password, providerAuthToken }: Props) => {
|
||||||
const { createNotification } = useNotificationContext();
|
|
||||||
const router = useRouter();
|
const router = useRouter();
|
||||||
const [isLoading, setIsLoading] = useState(false);
|
const [isLoading, setIsLoading] = useState(false);
|
||||||
const [isLoadingResend, setIsLoadingResend] = useState(false);
|
const [isLoadingResend, setIsLoadingResend] = useState(false);
|
||||||
|
|||||||
@@ -5,7 +5,7 @@ import { useRouter } from "next/router";
|
|||||||
import axios from "axios";
|
import axios from "axios";
|
||||||
import jwt_decode from "jwt-decode";
|
import jwt_decode from "jwt-decode";
|
||||||
|
|
||||||
import { useNotificationContext } from "@app/components/context/Notifications/NotificationProvider";
|
import { createNotification } from "@app/components/notifications";
|
||||||
import attemptCliLogin from "@app/components/utilities/attemptCliLogin";
|
import attemptCliLogin from "@app/components/utilities/attemptCliLogin";
|
||||||
import attemptLogin from "@app/components/utilities/attemptLogin";
|
import attemptLogin from "@app/components/utilities/attemptLogin";
|
||||||
import { Button, Input } from "@app/components/v2";
|
import { Button, Input } from "@app/components/v2";
|
||||||
@@ -31,7 +31,7 @@ export const PasswordStep = ({
|
|||||||
setPassword,
|
setPassword,
|
||||||
setStep
|
setStep
|
||||||
}: Props) => {
|
}: Props) => {
|
||||||
const { createNotification } = useNotificationContext();
|
|
||||||
const [isLoading, setIsLoading] = useState(false);
|
const [isLoading, setIsLoading] = useState(false);
|
||||||
const { t } = useTranslation();
|
const { t } = useTranslation();
|
||||||
const router = useRouter();
|
const router = useRouter();
|
||||||
|
|||||||
+2
-2
@@ -3,7 +3,7 @@ import { Controller, useForm } from "react-hook-form";
|
|||||||
import { yupResolver } from "@hookform/resolvers/yup";
|
import { yupResolver } from "@hookform/resolvers/yup";
|
||||||
import * as yup from "yup";
|
import * as yup from "yup";
|
||||||
|
|
||||||
import { useNotificationContext } from "@app/components/context/Notifications/NotificationProvider";
|
import { createNotification } from "@app/components/notifications";
|
||||||
import {
|
import {
|
||||||
Button,
|
Button,
|
||||||
FormControl,
|
FormControl,
|
||||||
@@ -41,7 +41,7 @@ type Props = {
|
|||||||
};
|
};
|
||||||
|
|
||||||
export const IdentityModal = ({ popUp, /* handlePopUpOpen, */ handlePopUpToggle }: Props) => {
|
export const IdentityModal = ({ popUp, /* handlePopUpOpen, */ handlePopUpToggle }: Props) => {
|
||||||
const { createNotification } = useNotificationContext();
|
|
||||||
|
|
||||||
const { currentOrg } = useOrganization();
|
const { currentOrg } = useOrganization();
|
||||||
const orgId = currentOrg?.id || "";
|
const orgId = currentOrg?.id || "";
|
||||||
|
|||||||
+2
-2
@@ -2,7 +2,7 @@ import Link from "next/link";
|
|||||||
import { faArrowUpRightFromSquare, faPlus } from "@fortawesome/free-solid-svg-icons";
|
import { faArrowUpRightFromSquare, faPlus } from "@fortawesome/free-solid-svg-icons";
|
||||||
import { FontAwesomeIcon } from "@fortawesome/react-fontawesome";
|
import { FontAwesomeIcon } from "@fortawesome/react-fontawesome";
|
||||||
|
|
||||||
import { useNotificationContext } from "@app/components/context/Notifications/NotificationProvider";
|
import { createNotification } from "@app/components/notifications";
|
||||||
import { OrgPermissionCan } from "@app/components/permissions";
|
import { OrgPermissionCan } from "@app/components/permissions";
|
||||||
import { Button, DeleteActionModal } from "@app/components/v2";
|
import { Button, DeleteActionModal } from "@app/components/v2";
|
||||||
import { OrgPermissionActions, OrgPermissionSubjects, useOrganization } from "@app/context";
|
import { OrgPermissionActions, OrgPermissionSubjects, useOrganization } from "@app/context";
|
||||||
@@ -20,7 +20,7 @@ export const IdentitySection = withPermission(
|
|||||||
const { currentOrg } = useOrganization();
|
const { currentOrg } = useOrganization();
|
||||||
const orgId = currentOrg?.id || "";
|
const orgId = currentOrg?.id || "";
|
||||||
|
|
||||||
const { createNotification } = useNotificationContext();
|
|
||||||
const { mutateAsync: deleteMutateAsync } = useDeleteIdentity();
|
const { mutateAsync: deleteMutateAsync } = useDeleteIdentity();
|
||||||
const { popUp, handlePopUpOpen, handlePopUpClose, handlePopUpToggle } = usePopUp([
|
const { popUp, handlePopUpOpen, handlePopUpClose, handlePopUpToggle } = usePopUp([
|
||||||
"identity",
|
"identity",
|
||||||
|
|||||||
+2
-2
@@ -1,7 +1,7 @@
|
|||||||
import { faKey, faLock, faPencil, faServer, faXmark } from "@fortawesome/free-solid-svg-icons";
|
import { faKey, faLock, faPencil, faServer, faXmark } from "@fortawesome/free-solid-svg-icons";
|
||||||
import { FontAwesomeIcon } from "@fortawesome/react-fontawesome";
|
import { FontAwesomeIcon } from "@fortawesome/react-fontawesome";
|
||||||
|
|
||||||
import { useNotificationContext } from "@app/components/context/Notifications/NotificationProvider";
|
import { createNotification } from "@app/components/notifications";
|
||||||
import { OrgPermissionCan } from "@app/components/permissions";
|
import { OrgPermissionCan } from "@app/components/permissions";
|
||||||
import {
|
import {
|
||||||
EmptyState,
|
EmptyState,
|
||||||
@@ -44,7 +44,7 @@ type Props = {
|
|||||||
};
|
};
|
||||||
|
|
||||||
export const IdentityTable = ({ handlePopUpOpen }: Props) => {
|
export const IdentityTable = ({ handlePopUpOpen }: Props) => {
|
||||||
const { createNotification } = useNotificationContext();
|
|
||||||
const { currentOrg } = useOrganization();
|
const { currentOrg } = useOrganization();
|
||||||
const orgId = currentOrg?.id || "";
|
const orgId = currentOrg?.id || "";
|
||||||
|
|
||||||
|
|||||||
+2
-2
@@ -7,7 +7,7 @@ import { yupResolver } from "@hookform/resolvers/yup";
|
|||||||
import { format } from "date-fns";
|
import { format } from "date-fns";
|
||||||
import * as yup from "yup";
|
import * as yup from "yup";
|
||||||
|
|
||||||
import { useNotificationContext } from "@app/components/context/Notifications/NotificationProvider";
|
import { createNotification } from "@app/components/notifications";
|
||||||
import {
|
import {
|
||||||
Button,
|
Button,
|
||||||
DeleteActionModal,
|
DeleteActionModal,
|
||||||
@@ -66,7 +66,7 @@ export const IdentityUniversalAuthClientSecretModal = ({
|
|||||||
handlePopUpToggle
|
handlePopUpToggle
|
||||||
}: Props) => {
|
}: Props) => {
|
||||||
const { t } = useTranslation();
|
const { t } = useTranslation();
|
||||||
const { createNotification } = useNotificationContext();
|
|
||||||
const [token, setToken] = useState("");
|
const [token, setToken] = useState("");
|
||||||
const [isClientSecretCopied, setIsClientSecretCopied] = useToggle(false);
|
const [isClientSecretCopied, setIsClientSecretCopied] = useToggle(false);
|
||||||
const [isClientIdCopied, setIsClientIdCopied] = useToggle(false);
|
const [isClientIdCopied, setIsClientIdCopied] = useToggle(false);
|
||||||
|
|||||||
+2
-2
@@ -5,7 +5,7 @@ import { FontAwesomeIcon } from "@fortawesome/react-fontawesome";
|
|||||||
import { yupResolver } from "@hookform/resolvers/yup";
|
import { yupResolver } from "@hookform/resolvers/yup";
|
||||||
import * as yup from "yup";
|
import * as yup from "yup";
|
||||||
|
|
||||||
import { useNotificationContext } from "@app/components/context/Notifications/NotificationProvider";
|
import { createNotification } from "@app/components/notifications";
|
||||||
import { Button, FormControl, IconButton, Input } from "@app/components/v2";
|
import { Button, FormControl, IconButton, Input } from "@app/components/v2";
|
||||||
import { useOrganization, useSubscription } from "@app/context";
|
import { useOrganization, useSubscription } from "@app/context";
|
||||||
import {
|
import {
|
||||||
@@ -63,7 +63,7 @@ export const IdentityUniversalAuthForm = ({
|
|||||||
handlePopUpToggle,
|
handlePopUpToggle,
|
||||||
identityAuthMethodData
|
identityAuthMethodData
|
||||||
}: Props) => {
|
}: Props) => {
|
||||||
const { createNotification } = useNotificationContext();
|
|
||||||
const { currentOrg } = useOrganization();
|
const { currentOrg } = useOrganization();
|
||||||
const orgId = currentOrg?.id || "";
|
const orgId = currentOrg?.id || "";
|
||||||
const { subscription } = useSubscription();
|
const { subscription } = useSubscription();
|
||||||
|
|||||||
+2
-2
@@ -4,7 +4,7 @@ import { FontAwesomeIcon } from "@fortawesome/react-fontawesome";
|
|||||||
import { yupResolver } from "@hookform/resolvers/yup";
|
import { yupResolver } from "@hookform/resolvers/yup";
|
||||||
import * as yup from "yup";
|
import * as yup from "yup";
|
||||||
|
|
||||||
import { useNotificationContext } from "@app/components/context/Notifications/NotificationProvider";
|
import { createNotification } from "@app/components/notifications";
|
||||||
import { Button, FormControl, IconButton, Input, Modal, ModalContent } from "@app/components/v2";
|
import { Button, FormControl, IconButton, Input, Modal, ModalContent } from "@app/components/v2";
|
||||||
import { useOrganization } from "@app/context";
|
import { useOrganization } from "@app/context";
|
||||||
import { useToggle } from "@app/hooks";
|
import { useToggle } from "@app/hooks";
|
||||||
@@ -30,7 +30,7 @@ export const AddOrgMemberModal = ({
|
|||||||
completeInviteLink,
|
completeInviteLink,
|
||||||
setCompleteInviteLink
|
setCompleteInviteLink
|
||||||
}: Props) => {
|
}: Props) => {
|
||||||
const { createNotification } = useNotificationContext();
|
|
||||||
const { currentOrg } = useOrganization();
|
const { currentOrg } = useOrganization();
|
||||||
|
|
||||||
const { data: serverDetails } = useFetchServerStatus();
|
const { data: serverDetails } = useFetchServerStatus();
|
||||||
|
|||||||
+2
-2
@@ -2,7 +2,7 @@ import { useState } from "react";
|
|||||||
import { faPlus } from "@fortawesome/free-solid-svg-icons";
|
import { faPlus } from "@fortawesome/free-solid-svg-icons";
|
||||||
import { FontAwesomeIcon } from "@fortawesome/react-fontawesome";
|
import { FontAwesomeIcon } from "@fortawesome/react-fontawesome";
|
||||||
|
|
||||||
import { useNotificationContext } from "@app/components/context/Notifications/NotificationProvider";
|
import { createNotification } from "@app/components/notifications";
|
||||||
import { OrgPermissionCan } from "@app/components/permissions";
|
import { OrgPermissionCan } from "@app/components/permissions";
|
||||||
import {
|
import {
|
||||||
Button,
|
Button,
|
||||||
@@ -23,7 +23,7 @@ import { AddOrgMemberModal } from "./AddOrgMemberModal";
|
|||||||
import { OrgMembersTable } from "./OrgMembersTable";
|
import { OrgMembersTable } from "./OrgMembersTable";
|
||||||
|
|
||||||
export const OrgMembersSection = () => {
|
export const OrgMembersSection = () => {
|
||||||
const { createNotification } = useNotificationContext();
|
|
||||||
const { subscription } = useSubscription();
|
const { subscription } = useSubscription();
|
||||||
const { currentOrg } = useOrganization();
|
const { currentOrg } = useOrganization();
|
||||||
const orgId = currentOrg?.id ?? "";
|
const orgId = currentOrg?.id ?? "";
|
||||||
|
|||||||
+2
-2
@@ -2,7 +2,7 @@ import { useCallback, useMemo, useState } from "react";
|
|||||||
import { faMagnifyingGlass, faUsers, faXmark } from "@fortawesome/free-solid-svg-icons";
|
import { faMagnifyingGlass, faUsers, faXmark } from "@fortawesome/free-solid-svg-icons";
|
||||||
import { FontAwesomeIcon } from "@fortawesome/react-fontawesome";
|
import { FontAwesomeIcon } from "@fortawesome/react-fontawesome";
|
||||||
|
|
||||||
import { useNotificationContext } from "@app/components/context/Notifications/NotificationProvider";
|
import { createNotification } from "@app/components/notifications";
|
||||||
import { OrgPermissionCan } from "@app/components/permissions";
|
import { OrgPermissionCan } from "@app/components/permissions";
|
||||||
import {
|
import {
|
||||||
Button,
|
Button,
|
||||||
@@ -49,7 +49,7 @@ type Props = {
|
|||||||
};
|
};
|
||||||
|
|
||||||
export const OrgMembersTable = ({ handlePopUpOpen, setCompleteInviteLink }: Props) => {
|
export const OrgMembersTable = ({ handlePopUpOpen, setCompleteInviteLink }: Props) => {
|
||||||
const { createNotification } = useNotificationContext();
|
|
||||||
const { subscription } = useSubscription();
|
const { subscription } = useSubscription();
|
||||||
const { currentOrg } = useOrganization();
|
const { currentOrg } = useOrganization();
|
||||||
const { user } = useUser();
|
const { user } = useUser();
|
||||||
|
|||||||
+2
-2
@@ -13,7 +13,7 @@ import {
|
|||||||
import { FontAwesomeIcon } from "@fortawesome/react-fontawesome";
|
import { FontAwesomeIcon } from "@fortawesome/react-fontawesome";
|
||||||
import { zodResolver } from "@hookform/resolvers/zod";
|
import { zodResolver } from "@hookform/resolvers/zod";
|
||||||
|
|
||||||
import { useNotificationContext } from "@app/components/context/Notifications/NotificationProvider";
|
import { createNotification } from "@app/components/notifications";
|
||||||
import { Button, FormControl, Input } from "@app/components/v2";
|
import { Button, FormControl, Input } from "@app/components/v2";
|
||||||
import { useOrganization } from "@app/context";
|
import { useOrganization } from "@app/context";
|
||||||
import { useCreateOrgRole, useUpdateOrgRole } from "@app/hooks/api";
|
import { useCreateOrgRole, useUpdateOrgRole } from "@app/hooks/api";
|
||||||
@@ -100,7 +100,7 @@ export const OrgRoleModifySection = ({ role, onGoBack }: Props) => {
|
|||||||
const isNonEditable = ["owner", "admin", "member", "no-access"].includes(role?.slug || "");
|
const isNonEditable = ["owner", "admin", "member", "no-access"].includes(role?.slug || "");
|
||||||
const isNewRole = !role?.slug;
|
const isNewRole = !role?.slug;
|
||||||
|
|
||||||
const { createNotification } = useNotificationContext();
|
|
||||||
const { currentOrg } = useOrganization();
|
const { currentOrg } = useOrganization();
|
||||||
const orgId = currentOrg?.id || "";
|
const orgId = currentOrg?.id || "";
|
||||||
const {
|
const {
|
||||||
|
|||||||
@@ -2,7 +2,7 @@ import { useState } from "react";
|
|||||||
import { faEdit, faMagnifyingGlass, faPlus, faTrash } from "@fortawesome/free-solid-svg-icons";
|
import { faEdit, faMagnifyingGlass, faPlus, faTrash } from "@fortawesome/free-solid-svg-icons";
|
||||||
import { FontAwesomeIcon } from "@fortawesome/react-fontawesome";
|
import { FontAwesomeIcon } from "@fortawesome/react-fontawesome";
|
||||||
|
|
||||||
import { useNotificationContext } from "@app/components/context/Notifications/NotificationProvider";
|
import { createNotification } from "@app/components/notifications";
|
||||||
import { OrgPermissionCan } from "@app/components/permissions";
|
import { OrgPermissionCan } from "@app/components/permissions";
|
||||||
import {
|
import {
|
||||||
Button,
|
Button,
|
||||||
@@ -31,7 +31,7 @@ export const OrgRoleTable = ({ onSelectRole }: Props) => {
|
|||||||
const [searchRoles, setSearchRoles] = useState("");
|
const [searchRoles, setSearchRoles] = useState("");
|
||||||
const { currentOrg } = useOrganization();
|
const { currentOrg } = useOrganization();
|
||||||
const orgId = currentOrg?.id || "";
|
const orgId = currentOrg?.id || "";
|
||||||
const { createNotification } = useNotificationContext();
|
|
||||||
const { popUp, handlePopUpOpen, handlePopUpClose } = usePopUp(["deleteRole"] as const);
|
const { popUp, handlePopUpOpen, handlePopUpClose } = usePopUp(["deleteRole"] as const);
|
||||||
|
|
||||||
const { data: roles, isLoading: isRolesLoading } = useGetOrgRoles(orgId);
|
const { data: roles, isLoading: isRolesLoading } = useGetOrgRoles(orgId);
|
||||||
|
|||||||
@@ -4,7 +4,7 @@ import { useRouter } from "next/router";
|
|||||||
import { zodResolver } from "@hookform/resolvers/zod";
|
import { zodResolver } from "@hookform/resolvers/zod";
|
||||||
import z from "zod";
|
import z from "zod";
|
||||||
|
|
||||||
import { useNotificationContext } from "@app/components/context/Notifications/NotificationProvider";
|
import { createNotification } from "@app/components/notifications";
|
||||||
import { Button, FormControl, Input, Modal, ModalContent } from "@app/components/v2";
|
import { Button, FormControl, Input, Modal, ModalContent } from "@app/components/v2";
|
||||||
import { useCreateOrg, useSelectOrganization } from "@app/hooks/api";
|
import { useCreateOrg, useSelectOrganization } from "@app/hooks/api";
|
||||||
|
|
||||||
@@ -22,7 +22,7 @@ interface CreateOrgModalProps {
|
|||||||
}
|
}
|
||||||
|
|
||||||
export const CreateOrgModal: FC<CreateOrgModalProps> = ({ isOpen, onClose }) => {
|
export const CreateOrgModal: FC<CreateOrgModalProps> = ({ isOpen, onClose }) => {
|
||||||
const { createNotification } = useNotificationContext();
|
|
||||||
const router = useRouter();
|
const router = useRouter();
|
||||||
|
|
||||||
const {
|
const {
|
||||||
|
|||||||
@@ -3,7 +3,7 @@ import { Controller, useForm } from "react-hook-form";
|
|||||||
import { yupResolver } from "@hookform/resolvers/yup";
|
import { yupResolver } from "@hookform/resolvers/yup";
|
||||||
import * as yup from "yup";
|
import * as yup from "yup";
|
||||||
|
|
||||||
import { useNotificationContext } from "@app/components/context/Notifications/NotificationProvider";
|
import { createNotification } from "@app/components/notifications";
|
||||||
import { Button, FormControl, Input, Modal, ModalContent } from "@app/components/v2";
|
import { Button, FormControl, Input, Modal, ModalContent } from "@app/components/v2";
|
||||||
import { useWorkspace } from "@app/context";
|
import { useWorkspace } from "@app/context";
|
||||||
import { useAddTrustedIp, useGetMyIp, useUpdateTrustedIp } from "@app/hooks/api";
|
import { useAddTrustedIp, useGetMyIp, useUpdateTrustedIp } from "@app/hooks/api";
|
||||||
@@ -25,7 +25,7 @@ type Props = {
|
|||||||
};
|
};
|
||||||
|
|
||||||
export const IPAllowlistModal = ({ popUp, handlePopUpClose, handlePopUpToggle }: Props) => {
|
export const IPAllowlistModal = ({ popUp, handlePopUpClose, handlePopUpToggle }: Props) => {
|
||||||
const { createNotification } = useNotificationContext();
|
|
||||||
const { data, isLoading } = useGetMyIp();
|
const { data, isLoading } = useGetMyIp();
|
||||||
|
|
||||||
const { currentWorkspace } = useWorkspace();
|
const { currentWorkspace } = useWorkspace();
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
import { faPlus } from "@fortawesome/free-solid-svg-icons";
|
import { faPlus } from "@fortawesome/free-solid-svg-icons";
|
||||||
import { FontAwesomeIcon } from "@fortawesome/react-fontawesome";
|
import { FontAwesomeIcon } from "@fortawesome/react-fontawesome";
|
||||||
|
|
||||||
import { useNotificationContext } from "@app/components/context/Notifications/NotificationProvider";
|
import { createNotification } from "@app/components/notifications";
|
||||||
import { ProjectPermissionCan } from "@app/components/permissions";
|
import { ProjectPermissionCan } from "@app/components/permissions";
|
||||||
import { Button, DeleteActionModal, UpgradePlanModal } from "@app/components/v2";
|
import { Button, DeleteActionModal, UpgradePlanModal } from "@app/components/v2";
|
||||||
import {
|
import {
|
||||||
@@ -17,7 +17,7 @@ import { IPAllowlistModal } from "./IPAllowlistModal";
|
|||||||
import { IPAllowlistTable } from "./IPAllowlistTable";
|
import { IPAllowlistTable } from "./IPAllowlistTable";
|
||||||
|
|
||||||
export const IPAllowlistSection = () => {
|
export const IPAllowlistSection = () => {
|
||||||
const { createNotification } = useNotificationContext();
|
|
||||||
const { mutateAsync } = useDeleteTrustedIp();
|
const { mutateAsync } = useDeleteTrustedIp();
|
||||||
const { subscription } = useSubscription();
|
const { subscription } = useSubscription();
|
||||||
const { currentWorkspace } = useWorkspace();
|
const { currentWorkspace } = useWorkspace();
|
||||||
|
|||||||
+2
-2
@@ -4,7 +4,7 @@ import Link from "next/link";
|
|||||||
import { yupResolver } from "@hookform/resolvers/yup";
|
import { yupResolver } from "@hookform/resolvers/yup";
|
||||||
import * as yup from "yup";
|
import * as yup from "yup";
|
||||||
|
|
||||||
import { useNotificationContext } from "@app/components/context/Notifications/NotificationProvider";
|
import { createNotification } from "@app/components/notifications";
|
||||||
import { Button, FormControl, Modal, ModalContent, Select, SelectItem } from "@app/components/v2";
|
import { Button, FormControl, Modal, ModalContent, Select, SelectItem } from "@app/components/v2";
|
||||||
import { useOrganization, useWorkspace } from "@app/context";
|
import { useOrganization, useWorkspace } from "@app/context";
|
||||||
import {
|
import {
|
||||||
@@ -30,7 +30,7 @@ type Props = {
|
|||||||
};
|
};
|
||||||
|
|
||||||
export const IdentityModal = ({ popUp, handlePopUpToggle }: Props) => {
|
export const IdentityModal = ({ popUp, handlePopUpToggle }: Props) => {
|
||||||
const { createNotification } = useNotificationContext();
|
|
||||||
const { currentOrg } = useOrganization();
|
const { currentOrg } = useOrganization();
|
||||||
const { currentWorkspace } = useWorkspace();
|
const { currentWorkspace } = useWorkspace();
|
||||||
|
|
||||||
|
|||||||
+2
-2
@@ -6,7 +6,7 @@ import { zodResolver } from "@hookform/resolvers/zod";
|
|||||||
import { twMerge } from "tailwind-merge";
|
import { twMerge } from "tailwind-merge";
|
||||||
import { z } from "zod";
|
import { z } from "zod";
|
||||||
|
|
||||||
import { useNotificationContext } from "@app/components/context/Notifications/NotificationProvider";
|
import { createNotification } from "@app/components/notifications";
|
||||||
import {
|
import {
|
||||||
Button,
|
Button,
|
||||||
Checkbox,
|
Checkbox,
|
||||||
@@ -207,7 +207,7 @@ export const IdentityRoles = ({
|
|||||||
identityId
|
identityId
|
||||||
}: TMemberRolesProp) => {
|
}: TMemberRolesProp) => {
|
||||||
const { currentWorkspace } = useWorkspace();
|
const { currentWorkspace } = useWorkspace();
|
||||||
const { createNotification } = useNotificationContext();
|
|
||||||
const { popUp, handlePopUpToggle } = usePopUp(["editRole"] as const);
|
const { popUp, handlePopUpToggle } = usePopUp(["editRole"] as const);
|
||||||
const [searchRoles, setSearchRoles] = useState("");
|
const [searchRoles, setSearchRoles] = useState("");
|
||||||
|
|
||||||
|
|||||||
+2
-2
@@ -2,7 +2,7 @@ import Link from "next/link";
|
|||||||
import { faArrowUpRightFromSquare, faPlus } from "@fortawesome/free-solid-svg-icons";
|
import { faArrowUpRightFromSquare, faPlus } from "@fortawesome/free-solid-svg-icons";
|
||||||
import { FontAwesomeIcon } from "@fortawesome/react-fontawesome";
|
import { FontAwesomeIcon } from "@fortawesome/react-fontawesome";
|
||||||
|
|
||||||
import { useNotificationContext } from "@app/components/context/Notifications/NotificationProvider";
|
import { createNotification } from "@app/components/notifications";
|
||||||
import { ProjectPermissionCan } from "@app/components/permissions";
|
import { ProjectPermissionCan } from "@app/components/permissions";
|
||||||
import { Button, DeleteActionModal } from "@app/components/v2";
|
import { Button, DeleteActionModal } from "@app/components/v2";
|
||||||
import { ProjectPermissionActions, ProjectPermissionSub, useWorkspace } from "@app/context";
|
import { ProjectPermissionActions, ProjectPermissionSub, useWorkspace } from "@app/context";
|
||||||
@@ -15,7 +15,7 @@ import { IdentityTable } from "./IdentityTable";
|
|||||||
|
|
||||||
export const IdentitySection = withProjectPermission(
|
export const IdentitySection = withProjectPermission(
|
||||||
() => {
|
() => {
|
||||||
const { createNotification } = useNotificationContext();
|
|
||||||
const { currentWorkspace } = useWorkspace();
|
const { currentWorkspace } = useWorkspace();
|
||||||
|
|
||||||
const workspaceId = currentWorkspace?.id ?? "";
|
const workspaceId = currentWorkspace?.id ?? "";
|
||||||
|
|||||||
@@ -7,7 +7,7 @@ import { FontAwesomeIcon } from "@fortawesome/react-fontawesome";
|
|||||||
import { zodResolver } from "@hookform/resolvers/zod";
|
import { zodResolver } from "@hookform/resolvers/zod";
|
||||||
import { z } from "zod";
|
import { z } from "zod";
|
||||||
|
|
||||||
import { useNotificationContext } from "@app/components/context/Notifications/NotificationProvider";
|
import { createNotification } from "@app/components/notifications";
|
||||||
import { ProjectPermissionCan } from "@app/components/permissions";
|
import { ProjectPermissionCan } from "@app/components/permissions";
|
||||||
import {
|
import {
|
||||||
Button,
|
Button,
|
||||||
@@ -57,7 +57,7 @@ const addMemberFormSchema = z.object({
|
|||||||
type TAddMemberForm = z.infer<typeof addMemberFormSchema>;
|
type TAddMemberForm = z.infer<typeof addMemberFormSchema>;
|
||||||
|
|
||||||
export const MemberListTab = () => {
|
export const MemberListTab = () => {
|
||||||
const { createNotification } = useNotificationContext();
|
|
||||||
const { t } = useTranslation();
|
const { t } = useTranslation();
|
||||||
|
|
||||||
const { currentOrg } = useOrganization();
|
const { currentOrg } = useOrganization();
|
||||||
|
|||||||
@@ -6,7 +6,7 @@ import { zodResolver } from "@hookform/resolvers/zod";
|
|||||||
import { twMerge } from "tailwind-merge";
|
import { twMerge } from "tailwind-merge";
|
||||||
import { z } from "zod";
|
import { z } from "zod";
|
||||||
|
|
||||||
import { useNotificationContext } from "@app/components/context/Notifications/NotificationProvider";
|
import { createNotification } from "@app/components/notifications";
|
||||||
import {
|
import {
|
||||||
Button,
|
Button,
|
||||||
Checkbox,
|
Checkbox,
|
||||||
@@ -209,7 +209,7 @@ export const MemberRoles = ({
|
|||||||
onOpenUpgradeModal
|
onOpenUpgradeModal
|
||||||
}: TMemberRolesProp) => {
|
}: TMemberRolesProp) => {
|
||||||
const { currentWorkspace } = useWorkspace();
|
const { currentWorkspace } = useWorkspace();
|
||||||
const { createNotification } = useNotificationContext();
|
|
||||||
const { popUp, handlePopUpToggle } = usePopUp(["editRole"] as const);
|
const { popUp, handlePopUpToggle } = usePopUp(["editRole"] as const);
|
||||||
const [searchRoles, setSearchRoles] = useState("");
|
const [searchRoles, setSearchRoles] = useState("");
|
||||||
const { subscription } = useSubscription();
|
const { subscription } = useSubscription();
|
||||||
|
|||||||
+2
-2
@@ -2,7 +2,7 @@ import { useState } from "react";
|
|||||||
import { faEdit, faMagnifyingGlass, faPlus, faTrash } from "@fortawesome/free-solid-svg-icons";
|
import { faEdit, faMagnifyingGlass, faPlus, faTrash } from "@fortawesome/free-solid-svg-icons";
|
||||||
import { FontAwesomeIcon } from "@fortawesome/react-fontawesome";
|
import { FontAwesomeIcon } from "@fortawesome/react-fontawesome";
|
||||||
|
|
||||||
import { useNotificationContext } from "@app/components/context/Notifications/NotificationProvider";
|
import { createNotification } from "@app/components/notifications";
|
||||||
import { ProjectPermissionCan } from "@app/components/permissions";
|
import { ProjectPermissionCan } from "@app/components/permissions";
|
||||||
import {
|
import {
|
||||||
Button,
|
Button,
|
||||||
@@ -29,7 +29,7 @@ type Props = {
|
|||||||
|
|
||||||
export const ProjectRoleList = ({ onSelectRole }: Props) => {
|
export const ProjectRoleList = ({ onSelectRole }: Props) => {
|
||||||
const [searchRoles, setSearchRoles] = useState("");
|
const [searchRoles, setSearchRoles] = useState("");
|
||||||
const { createNotification } = useNotificationContext();
|
|
||||||
const { popUp, handlePopUpOpen, handlePopUpClose } = usePopUp(["deleteRole"] as const);
|
const { popUp, handlePopUpOpen, handlePopUpClose } = usePopUp(["deleteRole"] as const);
|
||||||
const { currentWorkspace } = useWorkspace();
|
const { currentWorkspace } = useWorkspace();
|
||||||
const workspaceId = currentWorkspace?.id || "";
|
const workspaceId = currentWorkspace?.id || "";
|
||||||
|
|||||||
+2
-2
@@ -18,7 +18,7 @@ import {
|
|||||||
import { FontAwesomeIcon } from "@fortawesome/react-fontawesome";
|
import { FontAwesomeIcon } from "@fortawesome/react-fontawesome";
|
||||||
import { zodResolver } from "@hookform/resolvers/zod";
|
import { zodResolver } from "@hookform/resolvers/zod";
|
||||||
|
|
||||||
import { useNotificationContext } from "@app/components/context/Notifications/NotificationProvider";
|
import { createNotification } from "@app/components/notifications";
|
||||||
import { Button, FormControl, Input } from "@app/components/v2";
|
import { Button, FormControl, Input } from "@app/components/v2";
|
||||||
import { ProjectPermissionSub, useWorkspace } from "@app/context";
|
import { ProjectPermissionSub, useWorkspace } from "@app/context";
|
||||||
import { useCreateProjectRole, useUpdateProjectRole } from "@app/hooks/api";
|
import { useCreateProjectRole, useUpdateProjectRole } from "@app/hooks/api";
|
||||||
@@ -119,7 +119,7 @@ export const ProjectRoleModifySection = ({ role, onGoBack }: Props) => {
|
|||||||
const isNonEditable = ["admin", "member", "viewer", "no-access"].includes(role?.slug || "");
|
const isNonEditable = ["admin", "member", "viewer", "no-access"].includes(role?.slug || "");
|
||||||
const isNewRole = !role?.slug;
|
const isNewRole = !role?.slug;
|
||||||
|
|
||||||
const { createNotification } = useNotificationContext();
|
|
||||||
const { currentWorkspace } = useWorkspace();
|
const { currentWorkspace } = useWorkspace();
|
||||||
const workspaceId = currentWorkspace?.id || "";
|
const workspaceId = currentWorkspace?.id || "";
|
||||||
|
|
||||||
|
|||||||
+2
-2
@@ -9,7 +9,7 @@ import { yupResolver } from "@hookform/resolvers/yup";
|
|||||||
import { AxiosError } from "axios";
|
import { AxiosError } from "axios";
|
||||||
import * as yup from "yup";
|
import * as yup from "yup";
|
||||||
|
|
||||||
import { useNotificationContext } from "@app/components/context/Notifications/NotificationProvider";
|
import { createNotification } from "@app/components/notifications";
|
||||||
import {
|
import {
|
||||||
decryptAssymmetric,
|
decryptAssymmetric,
|
||||||
encryptSymmetric
|
encryptSymmetric
|
||||||
@@ -79,7 +79,7 @@ type Props = {
|
|||||||
|
|
||||||
export const AddServiceTokenModal = ({ popUp, handlePopUpToggle }: Props) => {
|
export const AddServiceTokenModal = ({ popUp, handlePopUpToggle }: Props) => {
|
||||||
const { t } = useTranslation();
|
const { t } = useTranslation();
|
||||||
const { createNotification } = useNotificationContext();
|
|
||||||
const { currentWorkspace } = useWorkspace();
|
const { currentWorkspace } = useWorkspace();
|
||||||
const {
|
const {
|
||||||
control,
|
control,
|
||||||
|
|||||||
+2
-2
@@ -2,7 +2,7 @@ import { useTranslation } from "react-i18next";
|
|||||||
import { faPlus } from "@fortawesome/free-solid-svg-icons";
|
import { faPlus } from "@fortawesome/free-solid-svg-icons";
|
||||||
import { FontAwesomeIcon } from "@fortawesome/react-fontawesome";
|
import { FontAwesomeIcon } from "@fortawesome/react-fontawesome";
|
||||||
|
|
||||||
import { useNotificationContext } from "@app/components/context/Notifications/NotificationProvider";
|
import { createNotification } from "@app/components/notifications";
|
||||||
import { ProjectPermissionCan } from "@app/components/permissions";
|
import { ProjectPermissionCan } from "@app/components/permissions";
|
||||||
import { Button, DeleteActionModal } from "@app/components/v2";
|
import { Button, DeleteActionModal } from "@app/components/v2";
|
||||||
import { ProjectPermissionActions, ProjectPermissionSub } from "@app/context";
|
import { ProjectPermissionActions, ProjectPermissionSub } from "@app/context";
|
||||||
@@ -18,7 +18,7 @@ type DeleteModalData = { name: string; id: string };
|
|||||||
export const ServiceTokenSection = withProjectPermission(
|
export const ServiceTokenSection = withProjectPermission(
|
||||||
() => {
|
() => {
|
||||||
const { t } = useTranslation();
|
const { t } = useTranslation();
|
||||||
const { createNotification } = useNotificationContext();
|
|
||||||
const deleteServiceToken = useDeleteServiceToken();
|
const deleteServiceToken = useDeleteServiceToken();
|
||||||
|
|
||||||
const { popUp, handlePopUpToggle, handlePopUpClose, handlePopUpOpen } = usePopUp([
|
const { popUp, handlePopUpToggle, handlePopUpClose, handlePopUpOpen } = usePopUp([
|
||||||
|
|||||||
+2
-2
@@ -1,7 +1,7 @@
|
|||||||
import { faFileShield, faPlus } from "@fortawesome/free-solid-svg-icons";
|
import { faFileShield, faPlus } from "@fortawesome/free-solid-svg-icons";
|
||||||
import { FontAwesomeIcon } from "@fortawesome/react-fontawesome";
|
import { FontAwesomeIcon } from "@fortawesome/react-fontawesome";
|
||||||
|
|
||||||
import { useNotificationContext } from "@app/components/context/Notifications/NotificationProvider";
|
import { createNotification } from "@app/components/notifications";
|
||||||
import { ProjectPermissionCan } from "@app/components/permissions";
|
import { ProjectPermissionCan } from "@app/components/permissions";
|
||||||
import {
|
import {
|
||||||
Button,
|
Button,
|
||||||
@@ -46,7 +46,7 @@ export const SecretApprovalPolicyList = ({ workspaceId }: Props) => {
|
|||||||
] as const);
|
] as const);
|
||||||
const { permission } = useProjectPermission();
|
const { permission } = useProjectPermission();
|
||||||
const { subscription } = useSubscription();
|
const { subscription } = useSubscription();
|
||||||
const { createNotification } = useNotificationContext();
|
|
||||||
|
|
||||||
const { data: members } = useGetWorkspaceUsers(workspaceId);
|
const { data: members } = useGetWorkspaceUsers(workspaceId);
|
||||||
const { data: policies, isLoading: isPoliciesLoading } = useGetSecretApprovalPolicies({
|
const { data: policies, isLoading: isPoliciesLoading } = useGetSecretApprovalPolicies({
|
||||||
|
|||||||
+2
-2
@@ -5,7 +5,7 @@ import { FontAwesomeIcon } from "@fortawesome/react-fontawesome";
|
|||||||
import { zodResolver } from "@hookform/resolvers/zod";
|
import { zodResolver } from "@hookform/resolvers/zod";
|
||||||
import { z } from "zod";
|
import { z } from "zod";
|
||||||
|
|
||||||
import { useNotificationContext } from "@app/components/context/Notifications/NotificationProvider";
|
import { createNotification } from "@app/components/notifications";
|
||||||
import {
|
import {
|
||||||
Button,
|
Button,
|
||||||
DropdownMenu,
|
DropdownMenu,
|
||||||
@@ -65,7 +65,7 @@ export const SecretPolicyForm = ({
|
|||||||
values: editValues ? { ...editValues, environment: editValues.environment.slug } : undefined
|
values: editValues ? { ...editValues, environment: editValues.environment.slug } : undefined
|
||||||
});
|
});
|
||||||
const { currentWorkspace } = useWorkspace();
|
const { currentWorkspace } = useWorkspace();
|
||||||
const { createNotification } = useNotificationContext();
|
|
||||||
|
|
||||||
const environments = currentWorkspace?.environments || [];
|
const environments = currentWorkspace?.environments || [];
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
|
|||||||
+2
-2
@@ -9,7 +9,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 { useNotificationContext } from "@app/components/context/Notifications/NotificationProvider";
|
import { createNotification } from "@app/components/notifications";
|
||||||
import { Button } from "@app/components/v2";
|
import { Button } from "@app/components/v2";
|
||||||
import {
|
import {
|
||||||
usePerformSecretApprovalRequestMerge,
|
usePerformSecretApprovalRequestMerge,
|
||||||
@@ -37,7 +37,7 @@ export const SecretApprovalRequestAction = ({
|
|||||||
workspaceId,
|
workspaceId,
|
||||||
canApprove
|
canApprove
|
||||||
}: Props) => {
|
}: Props) => {
|
||||||
const { createNotification } = useNotificationContext();
|
|
||||||
const { mutateAsync: performSecretApprovalMerge, isLoading: isMerging } =
|
const { mutateAsync: performSecretApprovalMerge, isLoading: isMerging } =
|
||||||
usePerformSecretApprovalRequestMerge();
|
usePerformSecretApprovalRequestMerge();
|
||||||
|
|
||||||
|
|||||||
+2
-2
@@ -11,7 +11,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 { useNotificationContext } from "@app/components/context/Notifications/NotificationProvider";
|
import { createNotification } from "@app/components/notifications";
|
||||||
import { Button, ContentLoader, EmptyState, IconButton, Tooltip } from "@app/components/v2";
|
import { Button, ContentLoader, EmptyState, IconButton, Tooltip } from "@app/components/v2";
|
||||||
import { useUser } from "@app/context";
|
import { useUser } from "@app/context";
|
||||||
import {
|
import {
|
||||||
@@ -83,7 +83,7 @@ export const SecretApprovalRequestChanges = ({
|
|||||||
workspaceId,
|
workspaceId,
|
||||||
members = {}
|
members = {}
|
||||||
}: Props) => {
|
}: Props) => {
|
||||||
const { createNotification } = useNotificationContext();
|
|
||||||
const { user } = useUser();
|
const { user } = useUser();
|
||||||
const { data: decryptFileKey } = useGetUserWsKey(workspaceId);
|
const { data: decryptFileKey } = useGetUserWsKey(workspaceId);
|
||||||
const {
|
const {
|
||||||
|
|||||||
@@ -5,8 +5,8 @@ import { subject } from "@casl/ability";
|
|||||||
import { faArrowDown, faArrowUp } from "@fortawesome/free-solid-svg-icons";
|
import { faArrowDown, faArrowUp } from "@fortawesome/free-solid-svg-icons";
|
||||||
import { FontAwesomeIcon } from "@fortawesome/react-fontawesome";
|
import { FontAwesomeIcon } from "@fortawesome/react-fontawesome";
|
||||||
|
|
||||||
import { useNotificationContext } from "@app/components/context/Notifications/NotificationProvider";
|
|
||||||
import NavHeader from "@app/components/navigation/NavHeader";
|
import NavHeader from "@app/components/navigation/NavHeader";
|
||||||
|
import { createNotification } from "@app/components/notifications";
|
||||||
import { PermissionDeniedBanner } from "@app/components/permissions";
|
import { PermissionDeniedBanner } from "@app/components/permissions";
|
||||||
import { ContentLoader } from "@app/components/v2";
|
import { ContentLoader } from "@app/components/v2";
|
||||||
import {
|
import {
|
||||||
@@ -53,7 +53,7 @@ export const SecretMainPage = () => {
|
|||||||
const { currentWorkspace, isLoading: isWorkspaceLoading } = useWorkspace();
|
const { currentWorkspace, isLoading: isWorkspaceLoading } = useWorkspace();
|
||||||
const router = useRouter();
|
const router = useRouter();
|
||||||
const { permission } = useProjectPermission();
|
const { permission } = useProjectPermission();
|
||||||
const { createNotification } = useNotificationContext();
|
|
||||||
|
|
||||||
const [isVisible, setIsVisible] = useState(false);
|
const [isVisible, setIsVisible] = useState(false);
|
||||||
const [sortDir, setSortDir] = useState<SortDir>(SortDir.ASC);
|
const [sortDir, setSortDir] = useState<SortDir>(SortDir.ASC);
|
||||||
|
|||||||
@@ -20,7 +20,7 @@ import { FontAwesomeIcon } from "@fortawesome/react-fontawesome";
|
|||||||
import FileSaver from "file-saver";
|
import FileSaver from "file-saver";
|
||||||
import { twMerge } from "tailwind-merge";
|
import { twMerge } from "tailwind-merge";
|
||||||
|
|
||||||
import { useNotificationContext } from "@app/components/context/Notifications/NotificationProvider";
|
import { createNotification } from "@app/components/notifications";
|
||||||
import { ProjectPermissionCan } from "@app/components/permissions";
|
import { ProjectPermissionCan } from "@app/components/permissions";
|
||||||
import {
|
import {
|
||||||
Button,
|
Button,
|
||||||
@@ -105,7 +105,6 @@ export const ActionBar = ({
|
|||||||
"upgradePlan"
|
"upgradePlan"
|
||||||
] as const);
|
] as const);
|
||||||
const { subscription } = useSubscription();
|
const { subscription } = useSubscription();
|
||||||
const { createNotification } = useNotificationContext();
|
|
||||||
const { openPopUp } = usePopUpAction();
|
const { openPopUp } = usePopUpAction();
|
||||||
|
|
||||||
const { mutateAsync: createFolder } = useCreateFolder();
|
const { mutateAsync: createFolder } = useCreateFolder();
|
||||||
|
|||||||
@@ -3,7 +3,7 @@ import { zodResolver } from "@hookform/resolvers/zod";
|
|||||||
import { AxiosError } from "axios";
|
import { AxiosError } from "axios";
|
||||||
import { z } from "zod";
|
import { z } from "zod";
|
||||||
|
|
||||||
import { useNotificationContext } from "@app/components/context/Notifications/NotificationProvider";
|
import { createNotification } from "@app/components/notifications";
|
||||||
import {
|
import {
|
||||||
Button,
|
Button,
|
||||||
FormControl,
|
FormControl,
|
||||||
@@ -55,7 +55,7 @@ export const CreateSecretImportForm = ({
|
|||||||
const { currentWorkspace } = useWorkspace();
|
const { currentWorkspace } = useWorkspace();
|
||||||
const environments = currentWorkspace?.environments || [];
|
const environments = currentWorkspace?.environments || [];
|
||||||
|
|
||||||
const { createNotification } = useNotificationContext();
|
|
||||||
|
|
||||||
const { mutateAsync: createSecretImport } = useCreateSecretImport();
|
const { mutateAsync: createSecretImport } = useCreateSecretImport();
|
||||||
|
|
||||||
|
|||||||
@@ -2,7 +2,7 @@ import { Controller, useForm } from "react-hook-form";
|
|||||||
import { zodResolver } from "@hookform/resolvers/zod";
|
import { zodResolver } from "@hookform/resolvers/zod";
|
||||||
import { z } from "zod";
|
import { z } from "zod";
|
||||||
|
|
||||||
import { useNotificationContext } from "@app/components/context/Notifications/NotificationProvider";
|
import { createNotification } from "@app/components/notifications";
|
||||||
import { Button, FormControl, Input, Modal, ModalContent, SecretInput } from "@app/components/v2";
|
import { Button, FormControl, Input, Modal, ModalContent, SecretInput } from "@app/components/v2";
|
||||||
import { useCreateSecretV3 } from "@app/hooks/api";
|
import { useCreateSecretV3 } from "@app/hooks/api";
|
||||||
import { UserWsKeyPair } from "@app/hooks/api/types";
|
import { UserWsKeyPair } from "@app/hooks/api/types";
|
||||||
@@ -44,7 +44,7 @@ export const CreateSecretForm = ({
|
|||||||
const { isOpen } = usePopUpState(PopUpNames.CreateSecretForm);
|
const { isOpen } = usePopUpState(PopUpNames.CreateSecretForm);
|
||||||
const { closePopUp, togglePopUp } = usePopUpAction();
|
const { closePopUp, togglePopUp } = usePopUpAction();
|
||||||
|
|
||||||
const { createNotification } = useNotificationContext();
|
|
||||||
|
|
||||||
const { mutateAsync: createSecretV3 } = useCreateSecretV3();
|
const { mutateAsync: createSecretV3 } = useCreateSecretV3();
|
||||||
|
|
||||||
|
|||||||
@@ -3,7 +3,7 @@ import { subject } from "@casl/ability";
|
|||||||
import { faClose, faFolder, faPencilSquare } from "@fortawesome/free-solid-svg-icons";
|
import { faClose, faFolder, faPencilSquare } from "@fortawesome/free-solid-svg-icons";
|
||||||
import { FontAwesomeIcon } from "@fortawesome/react-fontawesome";
|
import { FontAwesomeIcon } from "@fortawesome/react-fontawesome";
|
||||||
|
|
||||||
import { useNotificationContext } from "@app/components/context/Notifications/NotificationProvider";
|
import { createNotification } from "@app/components/notifications";
|
||||||
import { ProjectPermissionCan } from "@app/components/permissions";
|
import { ProjectPermissionCan } from "@app/components/permissions";
|
||||||
import { DeleteActionModal, IconButton, Modal, ModalContent } from "@app/components/v2";
|
import { DeleteActionModal, IconButton, Modal, ModalContent } from "@app/components/v2";
|
||||||
import { ProjectPermissionActions, ProjectPermissionSub } from "@app/context";
|
import { ProjectPermissionActions, ProjectPermissionSub } from "@app/context";
|
||||||
@@ -35,7 +35,7 @@ export const FolderListView = ({
|
|||||||
] as const);
|
] as const);
|
||||||
const router = useRouter();
|
const router = useRouter();
|
||||||
|
|
||||||
const { createNotification } = useNotificationContext();
|
|
||||||
|
|
||||||
const { mutateAsync: updateFolder } = useUpdateFolder();
|
const { mutateAsync: updateFolder } = useUpdateFolder();
|
||||||
const { mutateAsync: deleteFolder } = useDeleteFolder();
|
const { mutateAsync: deleteFolder } = useDeleteFolder();
|
||||||
|
|||||||
@@ -6,7 +6,7 @@ import { FontAwesomeIcon } from "@fortawesome/react-fontawesome";
|
|||||||
import { useQueryClient } from "@tanstack/react-query";
|
import { useQueryClient } from "@tanstack/react-query";
|
||||||
import { twMerge } from "tailwind-merge";
|
import { twMerge } from "tailwind-merge";
|
||||||
|
|
||||||
import { useNotificationContext } from "@app/components/context/Notifications/NotificationProvider";
|
import { createNotification } from "@app/components/notifications";
|
||||||
import { ProjectPermissionCan } from "@app/components/permissions";
|
import { ProjectPermissionCan } from "@app/components/permissions";
|
||||||
// TODO:(akhilmhdh) convert all the util functions like this into a lib folder grouped by functionality
|
// TODO:(akhilmhdh) convert all the util functions like this into a lib folder grouped by functionality
|
||||||
import { parseDotEnv } from "@app/components/utilities/parseDotEnv";
|
import { parseDotEnv } from "@app/components/utilities/parseDotEnv";
|
||||||
@@ -60,7 +60,7 @@ export const SecretDropzone = ({
|
|||||||
const { t } = useTranslation();
|
const { t } = useTranslation();
|
||||||
const [isDragActive, setDragActive] = useToggle();
|
const [isDragActive, setDragActive] = useToggle();
|
||||||
const [isLoading, setIsLoading] = useToggle();
|
const [isLoading, setIsLoading] = useToggle();
|
||||||
const { createNotification } = useNotificationContext();
|
|
||||||
const { popUp, handlePopUpToggle, handlePopUpOpen, handlePopUpClose } = usePopUp([
|
const { popUp, handlePopUpToggle, handlePopUpOpen, handlePopUpClose } = usePopUp([
|
||||||
"importSecEnv",
|
"importSecEnv",
|
||||||
"overlapKeyWarning"
|
"overlapKeyWarning"
|
||||||
@@ -119,8 +119,7 @@ export const SecretDropzone = ({
|
|||||||
if (!file) {
|
if (!file) {
|
||||||
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"
|
||||||
timeoutMs: 10000
|
|
||||||
});
|
});
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|||||||
+2
-2
@@ -12,7 +12,7 @@ import {
|
|||||||
import { restrictToVerticalAxis } from "@dnd-kit/modifiers";
|
import { restrictToVerticalAxis } from "@dnd-kit/modifiers";
|
||||||
import { arrayMove, SortableContext, verticalListSortingStrategy } from "@dnd-kit/sortable";
|
import { arrayMove, SortableContext, verticalListSortingStrategy } from "@dnd-kit/sortable";
|
||||||
|
|
||||||
import { useNotificationContext } from "@app/components/context/Notifications/NotificationProvider";
|
import { createNotification } from "@app/components/notifications";
|
||||||
import { DeleteActionModal } from "@app/components/v2";
|
import { DeleteActionModal } from "@app/components/v2";
|
||||||
import { usePopUp } from "@app/hooks";
|
import { usePopUp } from "@app/hooks";
|
||||||
import { useDeleteSecretImport, useUpdateSecretImport } from "@app/hooks/api";
|
import { useDeleteSecretImport, useUpdateSecretImport } from "@app/hooks/api";
|
||||||
@@ -90,7 +90,7 @@ export const SecretImportListView = ({
|
|||||||
const { popUp, handlePopUpOpen, handlePopUpClose, handlePopUpToggle } = usePopUp([
|
const { popUp, handlePopUpOpen, handlePopUpClose, handlePopUpToggle } = usePopUp([
|
||||||
"deleteSecretImport"
|
"deleteSecretImport"
|
||||||
] as const);
|
] as const);
|
||||||
const { createNotification } = useNotificationContext();
|
|
||||||
const sensors = useSensors(
|
const sensors = useSensors(
|
||||||
useSensor(MouseSensor, {}),
|
useSensor(MouseSensor, {}),
|
||||||
useSensor(TouchSensor, {}),
|
useSensor(TouchSensor, {}),
|
||||||
|
|||||||
@@ -13,7 +13,7 @@ import { FontAwesomeIcon } from "@fortawesome/react-fontawesome";
|
|||||||
import { zodResolver } from "@hookform/resolvers/zod";
|
import { zodResolver } from "@hookform/resolvers/zod";
|
||||||
import { format } from "date-fns";
|
import { format } from "date-fns";
|
||||||
|
|
||||||
import { useNotificationContext } from "@app/components/context/Notifications/NotificationProvider";
|
import { createNotification } from "@app/components/notifications";
|
||||||
import { ProjectPermissionCan } from "@app/components/permissions";
|
import { ProjectPermissionCan } from "@app/components/permissions";
|
||||||
import {
|
import {
|
||||||
Button,
|
Button,
|
||||||
@@ -71,7 +71,7 @@ export const SecretDetailSidebar = ({
|
|||||||
environment,
|
environment,
|
||||||
secretPath
|
secretPath
|
||||||
}: Props) => {
|
}: Props) => {
|
||||||
const { createNotification } = useNotificationContext();
|
|
||||||
const {
|
const {
|
||||||
register,
|
register,
|
||||||
control,
|
control,
|
||||||
|
|||||||
@@ -2,7 +2,7 @@ import { useCallback } from "react";
|
|||||||
import { useQueryClient } from "@tanstack/react-query";
|
import { useQueryClient } from "@tanstack/react-query";
|
||||||
import { twMerge } from "tailwind-merge";
|
import { twMerge } from "tailwind-merge";
|
||||||
|
|
||||||
import { useNotificationContext } from "@app/components/context/Notifications/NotificationProvider";
|
import { createNotification } from "@app/components/notifications";
|
||||||
import { CreateTagModal } from "@app/components/tags/CreateTagModal";
|
import { CreateTagModal } from "@app/components/tags/CreateTagModal";
|
||||||
import { DeleteActionModal } from "@app/components/v2";
|
import { DeleteActionModal } from "@app/components/v2";
|
||||||
import { usePopUp } from "@app/hooks";
|
import { usePopUp } from "@app/hooks";
|
||||||
@@ -89,7 +89,7 @@ export const SecretListView = ({
|
|||||||
isVisible,
|
isVisible,
|
||||||
isProtectedBranch = false
|
isProtectedBranch = false
|
||||||
}: Props) => {
|
}: Props) => {
|
||||||
const { createNotification } = useNotificationContext();
|
|
||||||
const queryClient = useQueryClient();
|
const queryClient = useQueryClient();
|
||||||
const { popUp, handlePopUpToggle, handlePopUpOpen, handlePopUpClose } = usePopUp([
|
const { popUp, handlePopUpToggle, handlePopUpOpen, handlePopUpClose } = usePopUp([
|
||||||
"deleteSecret",
|
"deleteSecret",
|
||||||
|
|||||||
@@ -9,7 +9,7 @@ import {
|
|||||||
} from "@fortawesome/free-solid-svg-icons";
|
} from "@fortawesome/free-solid-svg-icons";
|
||||||
import { FontAwesomeIcon } from "@fortawesome/react-fontawesome";
|
import { FontAwesomeIcon } from "@fortawesome/react-fontawesome";
|
||||||
|
|
||||||
import { useNotificationContext } from "@app/components/context/Notifications/NotificationProvider";
|
import { createNotification } from "@app/components/notifications";
|
||||||
import { ProjectPermissionCan } from "@app/components/permissions";
|
import { ProjectPermissionCan } from "@app/components/permissions";
|
||||||
import { Button, ContentLoader, Input, Tag, Tooltip } from "@app/components/v2";
|
import { Button, ContentLoader, Input, Tag, Tooltip } from "@app/components/v2";
|
||||||
import { ProjectPermissionActions, ProjectPermissionSub } from "@app/context";
|
import { ProjectPermissionActions, ProjectPermissionSub } from "@app/context";
|
||||||
@@ -52,7 +52,7 @@ export const SnapshotView = ({
|
|||||||
snapshotCount,
|
snapshotCount,
|
||||||
onClickListSnapshot
|
onClickListSnapshot
|
||||||
}: Props) => {
|
}: Props) => {
|
||||||
const { createNotification } = useNotificationContext();
|
|
||||||
const [search, setSearch] = useState("");
|
const [search, setSearch] = useState("");
|
||||||
const { mutateAsync: performRollback, isLoading: isRollingBack } = usePerformSecretRollback();
|
const { mutateAsync: performRollback, isLoading: isRollingBack } = usePerformSecretRollback();
|
||||||
|
|
||||||
|
|||||||
@@ -16,8 +16,8 @@ import {
|
|||||||
} from "@fortawesome/free-solid-svg-icons";
|
} from "@fortawesome/free-solid-svg-icons";
|
||||||
import { FontAwesomeIcon } from "@fortawesome/react-fontawesome";
|
import { FontAwesomeIcon } from "@fortawesome/react-fontawesome";
|
||||||
|
|
||||||
import { useNotificationContext } from "@app/components/context/Notifications/NotificationProvider";
|
|
||||||
import NavHeader from "@app/components/navigation/NavHeader";
|
import NavHeader from "@app/components/navigation/NavHeader";
|
||||||
|
import { createNotification } from "@app/components/notifications";
|
||||||
import { ProjectPermissionCan } from "@app/components/permissions";
|
import { ProjectPermissionCan } from "@app/components/permissions";
|
||||||
import {
|
import {
|
||||||
Button,
|
Button,
|
||||||
@@ -71,7 +71,7 @@ import { SecretOverviewTableRow } from "./components/SecretOverviewTableRow";
|
|||||||
|
|
||||||
export const SecretOverviewPage = () => {
|
export const SecretOverviewPage = () => {
|
||||||
const { t } = useTranslation();
|
const { t } = useTranslation();
|
||||||
const { createNotification } = useNotificationContext();
|
|
||||||
const router = useRouter();
|
const router = useRouter();
|
||||||
|
|
||||||
// this is to set expandable table width
|
// this is to set expandable table width
|
||||||
|
|||||||
+2
-2
@@ -4,7 +4,7 @@ import { FontAwesomeIcon } from "@fortawesome/react-fontawesome";
|
|||||||
import { zodResolver } from "@hookform/resolvers/zod";
|
import { zodResolver } from "@hookform/resolvers/zod";
|
||||||
import { z } from "zod";
|
import { z } from "zod";
|
||||||
|
|
||||||
import { useNotificationContext } from "@app/components/context/Notifications/NotificationProvider";
|
import { createNotification } from "@app/components/notifications";
|
||||||
import {
|
import {
|
||||||
Button,
|
Button,
|
||||||
Checkbox,
|
Checkbox,
|
||||||
@@ -64,7 +64,7 @@ export const CreateSecretForm = ({
|
|||||||
const workspaceId = currentWorkspace?.id || "";
|
const workspaceId = currentWorkspace?.id || "";
|
||||||
const environments = currentWorkspace?.environments || [];
|
const environments = currentWorkspace?.environments || [];
|
||||||
|
|
||||||
const { createNotification } = useNotificationContext();
|
|
||||||
|
|
||||||
const { mutateAsync: createSecretV3 } = useCreateSecretV3();
|
const { mutateAsync: createSecretV3 } = useCreateSecretV3();
|
||||||
const { mutateAsync: updateSecretV3 } = useUpdateSecretV3();
|
const { mutateAsync: updateSecretV3 } = useUpdateSecretV3();
|
||||||
|
|||||||
+2
-2
@@ -4,7 +4,7 @@ import { faCheck, faCopy, faTrash, faXmark } from "@fortawesome/free-solid-svg-i
|
|||||||
import { FontAwesomeIcon } from "@fortawesome/react-fontawesome";
|
import { FontAwesomeIcon } from "@fortawesome/react-fontawesome";
|
||||||
import { twMerge } from "tailwind-merge";
|
import { twMerge } from "tailwind-merge";
|
||||||
|
|
||||||
import { useNotificationContext } from "@app/components/context/Notifications/NotificationProvider";
|
import { createNotification } from "@app/components/notifications";
|
||||||
import { ProjectPermissionCan } from "@app/components/permissions";
|
import { ProjectPermissionCan } from "@app/components/permissions";
|
||||||
import { IconButton, SecretInput, Tooltip } from "@app/components/v2";
|
import { IconButton, SecretInput, Tooltip } from "@app/components/v2";
|
||||||
import { ProjectPermissionActions, ProjectPermissionSub } from "@app/context";
|
import { ProjectPermissionActions, ProjectPermissionSub } from "@app/context";
|
||||||
@@ -49,7 +49,7 @@ export const SecretEditRow = ({
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
const [isDeleting, setIsDeleting] = useToggle();
|
const [isDeleting, setIsDeleting] = useToggle();
|
||||||
const { createNotification } = useNotificationContext();
|
|
||||||
|
|
||||||
const handleFormReset = () => {
|
const handleFormReset = () => {
|
||||||
reset();
|
reset();
|
||||||
|
|||||||
+2
-2
@@ -8,7 +8,7 @@ import { AnimatePresence, motion } from "framer-motion";
|
|||||||
import { twMerge } from "tailwind-merge";
|
import { twMerge } from "tailwind-merge";
|
||||||
import { z } from "zod";
|
import { z } from "zod";
|
||||||
|
|
||||||
import { useNotificationContext } from "@app/components/context/Notifications/NotificationProvider";
|
import { createNotification } from "@app/components/notifications";
|
||||||
import { IconButton, Input, Spinner, Tooltip } from "@app/components/v2";
|
import { IconButton, Input, Spinner, Tooltip } from "@app/components/v2";
|
||||||
import {
|
import {
|
||||||
ProjectPermissionActions,
|
ProjectPermissionActions,
|
||||||
@@ -37,7 +37,7 @@ type TFormSchema = z.infer<typeof formSchema>;
|
|||||||
function SecretRenameRow({ environments, getSecretByKey, secretKey, secretPath }: Props) {
|
function SecretRenameRow({ environments, getSecretByKey, secretKey, secretPath }: Props) {
|
||||||
const { currentWorkspace } = useWorkspace();
|
const { currentWorkspace } = useWorkspace();
|
||||||
const { permission } = useProjectPermission();
|
const { permission } = useProjectPermission();
|
||||||
const { createNotification } = useNotificationContext();
|
|
||||||
|
|
||||||
const secrets = environments.map((env) => getSecretByKey(env.slug, secretKey));
|
const secrets = environments.map((env) => getSecretByKey(env.slug, secretKey));
|
||||||
|
|
||||||
|
|||||||
@@ -13,7 +13,7 @@ import {
|
|||||||
import { FontAwesomeIcon } from "@fortawesome/react-fontawesome";
|
import { FontAwesomeIcon } from "@fortawesome/react-fontawesome";
|
||||||
import { formatDistance } from "date-fns";
|
import { formatDistance } from "date-fns";
|
||||||
|
|
||||||
import { useNotificationContext } from "@app/components/context/Notifications/NotificationProvider";
|
import { createNotification } from "@app/components/notifications";
|
||||||
import { ProjectPermissionCan } from "@app/components/permissions";
|
import { ProjectPermissionCan } from "@app/components/permissions";
|
||||||
import {
|
import {
|
||||||
Button,
|
Button,
|
||||||
@@ -63,7 +63,7 @@ export const SecretRotationPage = withProjectPermission(
|
|||||||
const { currentWorkspace } = useWorkspace();
|
const { currentWorkspace } = useWorkspace();
|
||||||
const { t } = useTranslation();
|
const { t } = useTranslation();
|
||||||
const { permission } = useProjectPermission();
|
const { permission } = useProjectPermission();
|
||||||
const { createNotification } = useNotificationContext();
|
|
||||||
const { popUp, handlePopUpOpen, handlePopUpToggle, handlePopUpClose } = usePopUp([
|
const { popUp, handlePopUpOpen, handlePopUpToggle, handlePopUpClose } = usePopUp([
|
||||||
"createRotation",
|
"createRotation",
|
||||||
"activeBot",
|
"activeBot",
|
||||||
|
|||||||
+2
-2
@@ -1,7 +1,7 @@
|
|||||||
import { useRef, useState } from "react";
|
import { useRef, useState } from "react";
|
||||||
import { AnimatePresence, motion } from "framer-motion";
|
import { AnimatePresence, motion } from "framer-motion";
|
||||||
|
|
||||||
import { useNotificationContext } from "@app/components/context/Notifications/NotificationProvider";
|
import { createNotification } from "@app/components/notifications";
|
||||||
import { Modal, ModalContent, Step, Stepper } from "@app/components/v2";
|
import { Modal, ModalContent, Step, Stepper } from "@app/components/v2";
|
||||||
import { useCreateSecretRotation } from "@app/hooks/api";
|
import { useCreateSecretRotation } from "@app/hooks/api";
|
||||||
import { TSecretRotationProviderTemplate } from "@app/hooks/api/types";
|
import { TSecretRotationProviderTemplate } from "@app/hooks/api/types";
|
||||||
@@ -43,7 +43,7 @@ export const CreateRotationForm = ({
|
|||||||
input?: Record<string, string>;
|
input?: Record<string, string>;
|
||||||
output?: TRotationOutputSchema;
|
output?: TRotationOutputSchema;
|
||||||
}>({});
|
}>({});
|
||||||
const { createNotification } = useNotificationContext();
|
|
||||||
|
|
||||||
const { mutateAsync: createSecretRotation } = useCreateSecretRotation();
|
const { mutateAsync: createSecretRotation } = useCreateSecretRotation();
|
||||||
|
|
||||||
|
|||||||
+2
-2
@@ -3,7 +3,7 @@ import { Controller, useForm } from "react-hook-form";
|
|||||||
import { yupResolver } from "@hookform/resolvers/yup";
|
import { yupResolver } from "@hookform/resolvers/yup";
|
||||||
import * as yup from "yup";
|
import * as yup from "yup";
|
||||||
|
|
||||||
import { useNotificationContext } from "@app/components/context/Notifications/NotificationProvider";
|
import { createNotification } from "@app/components/notifications";
|
||||||
import { OrgPermissionCan } from "@app/components/permissions";
|
import { OrgPermissionCan } from "@app/components/permissions";
|
||||||
import { Button, FormControl, Input } from "@app/components/v2";
|
import { Button, FormControl, Input } from "@app/components/v2";
|
||||||
import { OrgPermissionActions, OrgPermissionSubjects, useOrganization } from "@app/context";
|
import { OrgPermissionActions, OrgPermissionSubjects, useOrganization } from "@app/context";
|
||||||
@@ -16,7 +16,7 @@ const schema = yup
|
|||||||
.required();
|
.required();
|
||||||
|
|
||||||
export const CompanyNameSection = () => {
|
export const CompanyNameSection = () => {
|
||||||
const { createNotification } = useNotificationContext();
|
|
||||||
const { currentOrg } = useOrganization();
|
const { currentOrg } = useOrganization();
|
||||||
const { reset, control, handleSubmit } = useForm({
|
const { reset, control, handleSubmit } = useForm({
|
||||||
defaultValues: {
|
defaultValues: {
|
||||||
|
|||||||
+2
-2
@@ -3,7 +3,7 @@ import { Controller, useForm } from "react-hook-form";
|
|||||||
import { yupResolver } from "@hookform/resolvers/yup";
|
import { yupResolver } from "@hookform/resolvers/yup";
|
||||||
import * as yup from "yup";
|
import * as yup from "yup";
|
||||||
|
|
||||||
import { useNotificationContext } from "@app/components/context/Notifications/NotificationProvider";
|
import { createNotification } from "@app/components/notifications";
|
||||||
import { OrgPermissionCan } from "@app/components/permissions";
|
import { OrgPermissionCan } from "@app/components/permissions";
|
||||||
import { Button, FormControl, Input } from "@app/components/v2";
|
import { Button, FormControl, Input } from "@app/components/v2";
|
||||||
import { OrgPermissionActions, OrgPermissionSubjects, useOrganization } from "@app/context";
|
import { OrgPermissionActions, OrgPermissionSubjects, useOrganization } from "@app/context";
|
||||||
@@ -16,7 +16,7 @@ const schema = yup
|
|||||||
.required();
|
.required();
|
||||||
|
|
||||||
export const InvoiceEmailSection = () => {
|
export const InvoiceEmailSection = () => {
|
||||||
const { createNotification } = useNotificationContext();
|
|
||||||
const { currentOrg } = useOrganization();
|
const { currentOrg } = useOrganization();
|
||||||
const { reset, control, handleSubmit } = useForm({
|
const { reset, control, handleSubmit } = useForm({
|
||||||
defaultValues: {
|
defaultValues: {
|
||||||
|
|||||||
+2
-2
@@ -2,7 +2,7 @@ import { Controller, useForm } from "react-hook-form";
|
|||||||
import { yupResolver } from "@hookform/resolvers/yup";
|
import { yupResolver } from "@hookform/resolvers/yup";
|
||||||
import * as yup from "yup";
|
import * as yup from "yup";
|
||||||
|
|
||||||
import { useNotificationContext } from "@app/components/context/Notifications/NotificationProvider";
|
import { createNotification } from "@app/components/notifications";
|
||||||
import {
|
import {
|
||||||
Button,
|
Button,
|
||||||
FormControl,
|
FormControl,
|
||||||
@@ -85,7 +85,7 @@ type Props = {
|
|||||||
};
|
};
|
||||||
|
|
||||||
export const TaxIDModal = ({ popUp, handlePopUpClose, handlePopUpToggle }: Props) => {
|
export const TaxIDModal = ({ popUp, handlePopUpClose, handlePopUpToggle }: Props) => {
|
||||||
const { createNotification } = useNotificationContext();
|
|
||||||
const { currentOrg } = useOrganization();
|
const { currentOrg } = useOrganization();
|
||||||
const addOrgTaxId = useAddOrgTaxId();
|
const addOrgTaxId = useAddOrgTaxId();
|
||||||
|
|
||||||
|
|||||||
@@ -3,7 +3,7 @@ import { Controller, useForm } from "react-hook-form";
|
|||||||
import { zodResolver } from "@hookform/resolvers/zod";
|
import { zodResolver } from "@hookform/resolvers/zod";
|
||||||
import { z } from "zod";
|
import { z } from "zod";
|
||||||
|
|
||||||
import { useNotificationContext } from "@app/components/context/Notifications/NotificationProvider";
|
import { createNotification } from "@app/components/notifications";
|
||||||
import { Button, FormControl, Input, Modal, ModalContent, TextArea } from "@app/components/v2";
|
import { Button, FormControl, Input, Modal, ModalContent, TextArea } from "@app/components/v2";
|
||||||
import { useOrganization } from "@app/context";
|
import { useOrganization } from "@app/context";
|
||||||
import { useCreateLDAPConfig, useGetLDAPConfig, useUpdateLDAPConfig } from "@app/hooks/api";
|
import { useCreateLDAPConfig, useGetLDAPConfig, useUpdateLDAPConfig } from "@app/hooks/api";
|
||||||
@@ -27,7 +27,7 @@ type Props = {
|
|||||||
|
|
||||||
export const LDAPModal = ({ popUp, handlePopUpClose, handlePopUpToggle }: Props) => {
|
export const LDAPModal = ({ popUp, handlePopUpClose, handlePopUpToggle }: Props) => {
|
||||||
const { currentOrg } = useOrganization();
|
const { currentOrg } = useOrganization();
|
||||||
const { createNotification } = useNotificationContext();
|
|
||||||
const { mutateAsync: createMutateAsync, isLoading: createIsLoading } = useCreateLDAPConfig();
|
const { mutateAsync: createMutateAsync, isLoading: createIsLoading } = useCreateLDAPConfig();
|
||||||
const { mutateAsync: updateMutateAsync, isLoading: updateIsLoading } = useUpdateLDAPConfig();
|
const { mutateAsync: updateMutateAsync, isLoading: updateIsLoading } = useUpdateLDAPConfig();
|
||||||
const { data } = useGetLDAPConfig(currentOrg?.id ?? "");
|
const { data } = useGetLDAPConfig(currentOrg?.id ?? "");
|
||||||
|
|||||||
+2
-2
@@ -1,4 +1,4 @@
|
|||||||
import { useNotificationContext } from "@app/components/context/Notifications/NotificationProvider";
|
import { createNotification } from "@app/components/notifications";
|
||||||
import { OrgPermissionCan } from "@app/components/permissions";
|
import { OrgPermissionCan } from "@app/components/permissions";
|
||||||
import { Switch, UpgradePlanModal } from "@app/components/v2";
|
import { Switch, UpgradePlanModal } from "@app/components/v2";
|
||||||
import {
|
import {
|
||||||
@@ -11,7 +11,7 @@ import { useLogoutUser, useUpdateOrg } from "@app/hooks/api";
|
|||||||
import { usePopUp } from "@app/hooks/usePopUp";
|
import { usePopUp } from "@app/hooks/usePopUp";
|
||||||
|
|
||||||
export const OrgGeneralAuthSection = () => {
|
export const OrgGeneralAuthSection = () => {
|
||||||
const { createNotification } = useNotificationContext();
|
|
||||||
const { currentOrg } = useOrganization();
|
const { currentOrg } = useOrganization();
|
||||||
const { subscription } = useSubscription();
|
const { subscription } = useSubscription();
|
||||||
const { popUp, handlePopUpOpen, handlePopUpToggle } = usePopUp(["upgradePlan"] as const);
|
const { popUp, handlePopUpOpen, handlePopUpToggle } = usePopUp(["upgradePlan"] as const);
|
||||||
|
|||||||
+2
-2
@@ -1,4 +1,4 @@
|
|||||||
import { useNotificationContext } from "@app/components/context/Notifications/NotificationProvider";
|
import { createNotification } from "@app/components/notifications";
|
||||||
import { OrgPermissionCan } from "@app/components/permissions";
|
import { OrgPermissionCan } from "@app/components/permissions";
|
||||||
import { Button, Switch, UpgradePlanModal } from "@app/components/v2";
|
import { Button, Switch, UpgradePlanModal } from "@app/components/v2";
|
||||||
import {
|
import {
|
||||||
@@ -15,7 +15,7 @@ import { LDAPModal } from "./LDAPModal";
|
|||||||
export const OrgLDAPSection = (): JSX.Element => {
|
export const OrgLDAPSection = (): JSX.Element => {
|
||||||
const { currentOrg } = useOrganization();
|
const { currentOrg } = useOrganization();
|
||||||
const { subscription } = useSubscription();
|
const { subscription } = useSubscription();
|
||||||
const { createNotification } = useNotificationContext();
|
|
||||||
const { data } = useGetLDAPConfig(currentOrg?.id ?? "");
|
const { data } = useGetLDAPConfig(currentOrg?.id ?? "");
|
||||||
const { mutateAsync } = useUpdateLDAPConfig();
|
const { mutateAsync } = useUpdateLDAPConfig();
|
||||||
const { popUp, handlePopUpOpen, handlePopUpClose, handlePopUpToggle } = usePopUp([
|
const { popUp, handlePopUpOpen, handlePopUpClose, handlePopUpToggle } = usePopUp([
|
||||||
|
|||||||
+2
-2
@@ -1,4 +1,4 @@
|
|||||||
import { useNotificationContext } from "@app/components/context/Notifications/NotificationProvider";
|
import { createNotification } from "@app/components/notifications";
|
||||||
import { OrgPermissionCan } from "@app/components/permissions";
|
import { OrgPermissionCan } from "@app/components/permissions";
|
||||||
import { Button, Switch, UpgradePlanModal } from "@app/components/v2";
|
import { Button, Switch, UpgradePlanModal } from "@app/components/v2";
|
||||||
import {
|
import {
|
||||||
@@ -13,7 +13,7 @@ import { usePopUp } from "@app/hooks/usePopUp";
|
|||||||
import { ScimTokenModal } from "./ScimTokenModal";
|
import { ScimTokenModal } from "./ScimTokenModal";
|
||||||
|
|
||||||
export const OrgScimSection = () => {
|
export const OrgScimSection = () => {
|
||||||
const { createNotification } = useNotificationContext();
|
|
||||||
const { currentOrg } = useOrganization();
|
const { currentOrg } = useOrganization();
|
||||||
const { subscription } = useSubscription();
|
const { subscription } = useSubscription();
|
||||||
const { popUp, handlePopUpOpen, handlePopUpToggle } = usePopUp([
|
const { popUp, handlePopUpOpen, handlePopUpToggle } = usePopUp([
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
import { useNotificationContext } from "@app/components/context/Notifications/NotificationProvider";
|
import { createNotification } from "@app/components/notifications";
|
||||||
import { OrgPermissionCan } from "@app/components/permissions";
|
import { OrgPermissionCan } from "@app/components/permissions";
|
||||||
import { Button, Switch, UpgradePlanModal } from "@app/components/v2";
|
import { Button, Switch, UpgradePlanModal } from "@app/components/v2";
|
||||||
import {
|
import {
|
||||||
@@ -15,7 +15,7 @@ import { SSOModal } from "./SSOModal";
|
|||||||
export const OrgSSOSection = (): JSX.Element => {
|
export const OrgSSOSection = (): JSX.Element => {
|
||||||
const { currentOrg } = useOrganization();
|
const { currentOrg } = useOrganization();
|
||||||
const { subscription } = useSubscription();
|
const { subscription } = useSubscription();
|
||||||
const { createNotification } = useNotificationContext();
|
|
||||||
const { data, isLoading } = useGetSSOConfig(currentOrg?.id ?? "");
|
const { data, isLoading } = useGetSSOConfig(currentOrg?.id ?? "");
|
||||||
const { mutateAsync } = useUpdateSSOConfig();
|
const { mutateAsync } = useUpdateSSOConfig();
|
||||||
const { popUp, handlePopUpOpen, handlePopUpClose, handlePopUpToggle } = usePopUp([
|
const { popUp, handlePopUpOpen, handlePopUpClose, handlePopUpToggle } = usePopUp([
|
||||||
|
|||||||
@@ -3,7 +3,7 @@ import { Controller, useForm } from "react-hook-form";
|
|||||||
import { zodResolver } from "@hookform/resolvers/zod";
|
import { zodResolver } from "@hookform/resolvers/zod";
|
||||||
import { z } from "zod";
|
import { z } from "zod";
|
||||||
|
|
||||||
import { useNotificationContext } from "@app/components/context/Notifications/NotificationProvider";
|
import { createNotification } from "@app/components/notifications";
|
||||||
import {
|
import {
|
||||||
Button,
|
Button,
|
||||||
FormControl,
|
FormControl,
|
||||||
@@ -51,7 +51,7 @@ type Props = {
|
|||||||
|
|
||||||
export const SSOModal = ({ popUp, handlePopUpClose, handlePopUpToggle }: Props) => {
|
export const SSOModal = ({ popUp, handlePopUpClose, handlePopUpToggle }: Props) => {
|
||||||
const { currentOrg } = useOrganization();
|
const { currentOrg } = useOrganization();
|
||||||
const { createNotification } = useNotificationContext();
|
|
||||||
const { mutateAsync: createMutateAsync, isLoading: createIsLoading } = useCreateSSOConfig();
|
const { mutateAsync: createMutateAsync, isLoading: createIsLoading } = useCreateSSOConfig();
|
||||||
const { mutateAsync: updateMutateAsync, isLoading: updateIsLoading } = useUpdateSSOConfig();
|
const { mutateAsync: updateMutateAsync, isLoading: updateIsLoading } = useUpdateSSOConfig();
|
||||||
const { data } = useGetSSOConfig(currentOrg?.id ?? "");
|
const { data } = useGetSSOConfig(currentOrg?.id ?? "");
|
||||||
|
|||||||
+2
-2
@@ -7,7 +7,7 @@ import { yupResolver } from "@hookform/resolvers/yup";
|
|||||||
import { format } from "date-fns";
|
import { format } from "date-fns";
|
||||||
import * as yup from "yup";
|
import * as yup from "yup";
|
||||||
|
|
||||||
import { useNotificationContext } from "@app/components/context/Notifications/NotificationProvider";
|
import { createNotification } from "@app/components/notifications";
|
||||||
import {
|
import {
|
||||||
Button,
|
Button,
|
||||||
DeleteActionModal,
|
DeleteActionModal,
|
||||||
@@ -55,7 +55,7 @@ type Props = {
|
|||||||
export const ScimTokenModal = ({ popUp, handlePopUpOpen, handlePopUpToggle }: Props) => {
|
export const ScimTokenModal = ({ popUp, handlePopUpOpen, handlePopUpToggle }: Props) => {
|
||||||
const { currentOrg } = useOrganization();
|
const { currentOrg } = useOrganization();
|
||||||
const { t } = useTranslation();
|
const { t } = useTranslation();
|
||||||
const { createNotification } = useNotificationContext();
|
|
||||||
const [token, setToken] = useState("");
|
const [token, setToken] = useState("");
|
||||||
|
|
||||||
const [isScimUrlCopied, setIsScimUrlCopied] = useToggle(false);
|
const [isScimUrlCopied, setIsScimUrlCopied] = useToggle(false);
|
||||||
|
|||||||
+2
-2
@@ -1,6 +1,6 @@
|
|||||||
import { useRouter } from "next/router";
|
import { useRouter } from "next/router";
|
||||||
|
|
||||||
import { useNotificationContext } from "@app/components/context/Notifications/NotificationProvider";
|
import { createNotification } from "@app/components/notifications";
|
||||||
import { Button, DeleteActionModal } from "@app/components/v2";
|
import { Button, DeleteActionModal } from "@app/components/v2";
|
||||||
import { useOrganization, useOrgPermission } from "@app/context";
|
import { useOrganization, useOrgPermission } from "@app/context";
|
||||||
import { useDeleteOrgById } from "@app/hooks/api";
|
import { useDeleteOrgById } from "@app/hooks/api";
|
||||||
@@ -10,7 +10,7 @@ import { navigateUserToOrg } from "@app/views/Login/Login.utils";
|
|||||||
export const OrgDeleteSection = () => {
|
export const OrgDeleteSection = () => {
|
||||||
const router = useRouter();
|
const router = useRouter();
|
||||||
const { currentOrg } = useOrganization();
|
const { currentOrg } = useOrganization();
|
||||||
const { createNotification } = useNotificationContext();
|
|
||||||
const { membership } = useOrgPermission();
|
const { membership } = useOrgPermission();
|
||||||
|
|
||||||
const { popUp, handlePopUpOpen, handlePopUpClose, handlePopUpToggle } = usePopUp([
|
const { popUp, handlePopUpOpen, handlePopUpClose, handlePopUpToggle } = usePopUp([
|
||||||
|
|||||||
+2
-2
@@ -2,7 +2,7 @@ import { Controller, useForm } from "react-hook-form";
|
|||||||
import { yupResolver } from "@hookform/resolvers/yup";
|
import { yupResolver } from "@hookform/resolvers/yup";
|
||||||
import * as yup from "yup";
|
import * as yup from "yup";
|
||||||
|
|
||||||
import { useNotificationContext } from "@app/components/context/Notifications/NotificationProvider";
|
import { createNotification } from "@app/components/notifications";
|
||||||
import { Button, FormControl, Input, Modal, ModalContent } from "@app/components/v2";
|
import { Button, FormControl, Input, Modal, ModalContent } from "@app/components/v2";
|
||||||
import { useOrganization } from "@app/context";
|
import { useOrganization } from "@app/context";
|
||||||
import { useAddIncidentContact } from "@app/hooks/api";
|
import { useAddIncidentContact } from "@app/hooks/api";
|
||||||
@@ -26,7 +26,7 @@ export const AddOrgIncidentContactModal = ({
|
|||||||
handlePopUpClose,
|
handlePopUpClose,
|
||||||
handlePopUpToggle
|
handlePopUpToggle
|
||||||
}: Props) => {
|
}: Props) => {
|
||||||
const { createNotification } = useNotificationContext();
|
|
||||||
const { currentOrg } = useOrganization();
|
const { currentOrg } = useOrganization();
|
||||||
const { data: serverDetails } = useFetchServerStatus();
|
const { data: serverDetails } = useFetchServerStatus();
|
||||||
const { control, handleSubmit, reset } = useForm<TAddContactForm>({
|
const { control, handleSubmit, reset } = useForm<TAddContactForm>({
|
||||||
|
|||||||
+2
-2
@@ -2,7 +2,7 @@ import { useState } from "react";
|
|||||||
import { faContactBook, faMagnifyingGlass, faTrash } from "@fortawesome/free-solid-svg-icons";
|
import { faContactBook, faMagnifyingGlass, faTrash } from "@fortawesome/free-solid-svg-icons";
|
||||||
import { FontAwesomeIcon } from "@fortawesome/react-fontawesome";
|
import { FontAwesomeIcon } from "@fortawesome/react-fontawesome";
|
||||||
|
|
||||||
import { useNotificationContext } from "@app/components/context/Notifications/NotificationProvider";
|
import { createNotification } from "@app/components/notifications";
|
||||||
import { OrgPermissionCan } from "@app/components/permissions";
|
import { OrgPermissionCan } from "@app/components/permissions";
|
||||||
import {
|
import {
|
||||||
DeleteActionModal,
|
DeleteActionModal,
|
||||||
@@ -23,7 +23,7 @@ import { usePopUp } from "@app/hooks";
|
|||||||
import { useDeleteIncidentContact, useGetOrgIncidentContact } from "@app/hooks/api";
|
import { useDeleteIncidentContact, useGetOrgIncidentContact } from "@app/hooks/api";
|
||||||
|
|
||||||
export const OrgIncidentContactsTable = () => {
|
export const OrgIncidentContactsTable = () => {
|
||||||
const { createNotification } = useNotificationContext();
|
|
||||||
const { currentOrg } = useOrganization();
|
const { currentOrg } = useOrganization();
|
||||||
const { data: contacts, isLoading } = useGetOrgIncidentContact(currentOrg?.id ?? "");
|
const { data: contacts, isLoading } = useGetOrgIncidentContact(currentOrg?.id ?? "");
|
||||||
const [searchContact, setSearchContact] = useState("");
|
const [searchContact, setSearchContact] = useState("");
|
||||||
|
|||||||
+2
-2
@@ -3,7 +3,7 @@ import { Controller, useForm } from "react-hook-form";
|
|||||||
import { yupResolver } from "@hookform/resolvers/yup";
|
import { yupResolver } from "@hookform/resolvers/yup";
|
||||||
import * as yup from "yup";
|
import * as yup from "yup";
|
||||||
|
|
||||||
import { useNotificationContext } from "@app/components/context/Notifications/NotificationProvider";
|
import { createNotification } from "@app/components/notifications";
|
||||||
import { OrgPermissionCan } from "@app/components/permissions";
|
import { OrgPermissionCan } from "@app/components/permissions";
|
||||||
import { Button, FormControl, Input } from "@app/components/v2";
|
import { Button, FormControl, Input } from "@app/components/v2";
|
||||||
import { OrgPermissionActions, OrgPermissionSubjects, useOrganization } from "@app/context";
|
import { OrgPermissionActions, OrgPermissionSubjects, useOrganization } from "@app/context";
|
||||||
@@ -26,7 +26,7 @@ type FormData = yup.InferType<typeof formSchema>;
|
|||||||
|
|
||||||
export const OrgNameChangeSection = (): JSX.Element => {
|
export const OrgNameChangeSection = (): JSX.Element => {
|
||||||
const { currentOrg } = useOrganization();
|
const { currentOrg } = useOrganization();
|
||||||
const { createNotification } = useNotificationContext();
|
|
||||||
const { handleSubmit, control, reset } = useForm<FormData>({
|
const { handleSubmit, control, reset } = useForm<FormData>({
|
||||||
resolver: yupResolver(formSchema)
|
resolver: yupResolver(formSchema)
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -2,7 +2,7 @@ import { faKey, faXmark } from "@fortawesome/free-solid-svg-icons";
|
|||||||
import { FontAwesomeIcon } from "@fortawesome/react-fontawesome";
|
import { FontAwesomeIcon } from "@fortawesome/react-fontawesome";
|
||||||
import { format } from "date-fns";
|
import { format } from "date-fns";
|
||||||
|
|
||||||
import { useNotificationContext } from "@app/components/context/Notifications/NotificationProvider";
|
import { createNotification } from "@app/components/notifications";
|
||||||
import {
|
import {
|
||||||
EmptyState,
|
EmptyState,
|
||||||
IconButton,
|
IconButton,
|
||||||
@@ -18,7 +18,7 @@ import {
|
|||||||
import { useDeleteAPIKey, useGetMyAPIKeys } from "@app/hooks/api";
|
import { useDeleteAPIKey, useGetMyAPIKeys } from "@app/hooks/api";
|
||||||
|
|
||||||
export const APIKeyTable = () => {
|
export const APIKeyTable = () => {
|
||||||
const { createNotification } = useNotificationContext();
|
|
||||||
const { data, isLoading } = useGetMyAPIKeys();
|
const { data, isLoading } = useGetMyAPIKeys();
|
||||||
const { mutateAsync } = useDeleteAPIKey();
|
const { mutateAsync } = useDeleteAPIKey();
|
||||||
|
|
||||||
|
|||||||
@@ -5,7 +5,7 @@ import { FontAwesomeIcon } from "@fortawesome/react-fontawesome";
|
|||||||
import { yupResolver } from "@hookform/resolvers/yup";
|
import { yupResolver } from "@hookform/resolvers/yup";
|
||||||
import * as yup from "yup";
|
import * as yup from "yup";
|
||||||
|
|
||||||
import { useNotificationContext } from "@app/components/context/Notifications/NotificationProvider";
|
import { createNotification } from "@app/components/notifications";
|
||||||
import {
|
import {
|
||||||
Button,
|
Button,
|
||||||
FormControl,
|
FormControl,
|
||||||
@@ -53,7 +53,7 @@ type Props = {
|
|||||||
export const AddAPIKeyModal = ({ popUp, handlePopUpToggle }: Props) => {
|
export const AddAPIKeyModal = ({ popUp, handlePopUpToggle }: Props) => {
|
||||||
const [newAPIKey, setNewAPIKey] = useState("");
|
const [newAPIKey, setNewAPIKey] = useState("");
|
||||||
const [isAPIKeyCopied, setIsAPIKeyCopied] = useToggle(false);
|
const [isAPIKeyCopied, setIsAPIKeyCopied] = useToggle(false);
|
||||||
const { createNotification } = useNotificationContext();
|
|
||||||
const { mutateAsync, isLoading } = useCreateAPIKey();
|
const { mutateAsync, isLoading } = useCreateAPIKey();
|
||||||
|
|
||||||
const { control, handleSubmit, reset } = useForm<FormData>({
|
const { control, handleSubmit, reset } = useForm<FormData>({
|
||||||
|
|||||||
+2
-2
@@ -6,7 +6,7 @@ import { FontAwesomeIcon } from "@fortawesome/react-fontawesome";
|
|||||||
import { yupResolver } from "@hookform/resolvers/yup";
|
import { yupResolver } from "@hookform/resolvers/yup";
|
||||||
import * as yup from "yup";
|
import * as yup from "yup";
|
||||||
|
|
||||||
import { useNotificationContext } from "@app/components/context/Notifications/NotificationProvider";
|
import { createNotification } from "@app/components/notifications";
|
||||||
import { Switch } from "@app/components/v2";
|
import { Switch } from "@app/components/v2";
|
||||||
import { useUser } from "@app/context";
|
import { useUser } from "@app/context";
|
||||||
import { useUpdateUserAuthMethods } from "@app/hooks/api";
|
import { useUpdateUserAuthMethods } from "@app/hooks/api";
|
||||||
@@ -32,7 +32,7 @@ const schema = yup.object({
|
|||||||
export type FormData = yup.InferType<typeof schema>;
|
export type FormData = yup.InferType<typeof schema>;
|
||||||
|
|
||||||
export const AuthMethodSection = () => {
|
export const AuthMethodSection = () => {
|
||||||
const { createNotification } = useNotificationContext();
|
|
||||||
const { user } = useUser();
|
const { user } = useUser();
|
||||||
const { mutateAsync } = useUpdateUserAuthMethods();
|
const { mutateAsync } = useUpdateUserAuthMethods();
|
||||||
|
|
||||||
|
|||||||
+2
-2
@@ -6,7 +6,7 @@ import { FontAwesomeIcon } from "@fortawesome/react-fontawesome";
|
|||||||
import { yupResolver } from "@hookform/resolvers/yup";
|
import { yupResolver } from "@hookform/resolvers/yup";
|
||||||
import * as yup from "yup";
|
import * as yup from "yup";
|
||||||
|
|
||||||
import { useNotificationContext } from "@app/components/context/Notifications/NotificationProvider";
|
import { createNotification } from "@app/components/notifications";
|
||||||
import attemptChangePassword from "@app/components/utilities/attemptChangePassword";
|
import attemptChangePassword from "@app/components/utilities/attemptChangePassword";
|
||||||
import checkPassword from "@app/components/utilities/checks/password/checkPassword";
|
import checkPassword from "@app/components/utilities/checks/password/checkPassword";
|
||||||
import { Button, FormControl, Input } from "@app/components/v2";
|
import { Button, FormControl, Input } from "@app/components/v2";
|
||||||
@@ -34,7 +34,7 @@ export type FormData = yup.InferType<typeof schema>;
|
|||||||
|
|
||||||
export const ChangePasswordSection = () => {
|
export const ChangePasswordSection = () => {
|
||||||
const { t } = useTranslation();
|
const { t } = useTranslation();
|
||||||
const { createNotification } = useNotificationContext();
|
|
||||||
const { user } = useUser();
|
const { user } = useUser();
|
||||||
const { reset, control, handleSubmit } = useForm({
|
const { reset, control, handleSubmit } = useForm({
|
||||||
defaultValues: {
|
defaultValues: {
|
||||||
|
|||||||
+2
-2
@@ -1,13 +1,13 @@
|
|||||||
import { useRouter } from "next/router";
|
import { useRouter } from "next/router";
|
||||||
|
|
||||||
import { useNotificationContext } from "@app/components/context/Notifications/NotificationProvider";
|
import { createNotification } from "@app/components/notifications";
|
||||||
import { Button, DeleteActionModal } from "@app/components/v2";
|
import { Button, DeleteActionModal } from "@app/components/v2";
|
||||||
import { useDeleteUser } from "@app/hooks/api";
|
import { useDeleteUser } from "@app/hooks/api";
|
||||||
import { usePopUp } from "@app/hooks/usePopUp";
|
import { usePopUp } from "@app/hooks/usePopUp";
|
||||||
|
|
||||||
export const DeleteAccountSection = () => {
|
export const DeleteAccountSection = () => {
|
||||||
const router = useRouter();
|
const router = useRouter();
|
||||||
const { createNotification } = useNotificationContext();
|
|
||||||
const { popUp, handlePopUpOpen, handlePopUpClose, handlePopUpToggle } = usePopUp([
|
const { popUp, handlePopUpOpen, handlePopUpClose, handlePopUpToggle } = usePopUp([
|
||||||
"deleteAccount"
|
"deleteAccount"
|
||||||
] as const);
|
] as const);
|
||||||
|
|||||||
+2
-2
@@ -2,7 +2,7 @@ import { Controller, useForm } from "react-hook-form";
|
|||||||
import { yupResolver } from "@hookform/resolvers/yup";
|
import { yupResolver } from "@hookform/resolvers/yup";
|
||||||
import * as yup from "yup";
|
import * as yup from "yup";
|
||||||
|
|
||||||
import { useNotificationContext } from "@app/components/context/Notifications/NotificationProvider";
|
import { createNotification } from "@app/components/notifications";
|
||||||
import issueBackupKey from "@app/components/utilities/cryptography/issueBackupKey";
|
import issueBackupKey from "@app/components/utilities/cryptography/issueBackupKey";
|
||||||
import { Button, FormControl, Input } from "@app/components/v2";
|
import { Button, FormControl, Input } from "@app/components/v2";
|
||||||
import { useUser } from "@app/context";
|
import { useUser } from "@app/context";
|
||||||
@@ -16,7 +16,7 @@ const schema = yup
|
|||||||
export type FormData = yup.InferType<typeof schema>;
|
export type FormData = yup.InferType<typeof schema>;
|
||||||
|
|
||||||
export const EmergencyKitSection = () => {
|
export const EmergencyKitSection = () => {
|
||||||
const { createNotification } = useNotificationContext();
|
|
||||||
const { user } = useUser();
|
const { user } = useUser();
|
||||||
const { reset, control, handleSubmit } = useForm({
|
const { reset, control, handleSubmit } = useForm({
|
||||||
defaultValues: {
|
defaultValues: {
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
import { useNotificationContext } from "@app/components/context/Notifications/NotificationProvider";
|
import { createNotification } from "@app/components/notifications";
|
||||||
import { Checkbox, EmailServiceSetupModal } from "@app/components/v2";
|
import { Checkbox, EmailServiceSetupModal } from "@app/components/v2";
|
||||||
import { useGetUser, useUpdateMfaEnabled } from "@app/hooks/api";
|
import { useGetUser, useUpdateMfaEnabled } from "@app/hooks/api";
|
||||||
import { useFetchServerStatus } from "@app/hooks/api/serverDetails";
|
import { useFetchServerStatus } from "@app/hooks/api/serverDetails";
|
||||||
@@ -8,7 +8,7 @@ import { usePopUp } from "@app/hooks/usePopUp";
|
|||||||
export const MFASection = () => {
|
export const MFASection = () => {
|
||||||
const { data: user } = useGetUser();
|
const { data: user } = useGetUser();
|
||||||
const { mutateAsync } = useUpdateMfaEnabled();
|
const { mutateAsync } = useUpdateMfaEnabled();
|
||||||
const { createNotification } = useNotificationContext();
|
|
||||||
const { handlePopUpToggle, popUp, handlePopUpOpen } = usePopUp(["setUpEmail"] as const);
|
const { handlePopUpToggle, popUp, handlePopUpOpen } = usePopUp(["setUpEmail"] as const);
|
||||||
|
|
||||||
const { data: serverDetails } = useFetchServerStatus();
|
const { data: serverDetails } = useFetchServerStatus();
|
||||||
|
|||||||
+2
-2
@@ -3,7 +3,7 @@ import { Controller, useForm } from "react-hook-form";
|
|||||||
import { yupResolver } from "@hookform/resolvers/yup";
|
import { yupResolver } from "@hookform/resolvers/yup";
|
||||||
import * as yup from "yup";
|
import * as yup from "yup";
|
||||||
|
|
||||||
import { useNotificationContext } from "@app/components/context/Notifications/NotificationProvider";
|
import { createNotification } from "@app/components/notifications";
|
||||||
import { Button, FormControl, Input } from "@app/components/v2";
|
import { Button, FormControl, Input } from "@app/components/v2";
|
||||||
import { useUser } from "@app/context";
|
import { useUser } from "@app/context";
|
||||||
import { useRenameUser } from "@app/hooks/api/users/queries";
|
import { useRenameUser } from "@app/hooks/api/users/queries";
|
||||||
@@ -16,7 +16,7 @@ type FormData = yup.InferType<typeof formSchema>;
|
|||||||
|
|
||||||
export const UserNameSection = (): JSX.Element => {
|
export const UserNameSection = (): JSX.Element => {
|
||||||
const { user } = useUser();
|
const { user } = useUser();
|
||||||
const { createNotification } = useNotificationContext();
|
|
||||||
const { handleSubmit, control, reset } = useForm<FormData>({ resolver: yupResolver(formSchema) });
|
const { handleSubmit, control, reset } = useForm<FormData>({ resolver: yupResolver(formSchema) });
|
||||||
const { mutateAsync, isLoading } = useRenameUser();
|
const { mutateAsync, isLoading } = useRenameUser();
|
||||||
|
|
||||||
|
|||||||
+2
-2
@@ -1,6 +1,6 @@
|
|||||||
import { useTranslation } from "react-i18next";
|
import { useTranslation } from "react-i18next";
|
||||||
|
|
||||||
import { useNotificationContext } from "@app/components/context/Notifications/NotificationProvider";
|
import { createNotification } from "@app/components/notifications";
|
||||||
import { ProjectPermissionCan } from "@app/components/permissions";
|
import { ProjectPermissionCan } from "@app/components/permissions";
|
||||||
import { Checkbox } from "@app/components/v2";
|
import { Checkbox } from "@app/components/v2";
|
||||||
import { ProjectPermissionActions, ProjectPermissionSub, useWorkspace } from "@app/context";
|
import { ProjectPermissionActions, ProjectPermissionSub, useWorkspace } from "@app/context";
|
||||||
@@ -8,7 +8,7 @@ import { useToggleAutoCapitalization } from "@app/hooks/api";
|
|||||||
|
|
||||||
export const AutoCapitalizationSection = () => {
|
export const AutoCapitalizationSection = () => {
|
||||||
const { t } = useTranslation();
|
const { t } = useTranslation();
|
||||||
const { createNotification } = useNotificationContext();
|
|
||||||
const { currentWorkspace } = useWorkspace();
|
const { currentWorkspace } = useWorkspace();
|
||||||
const { mutateAsync } = useToggleAutoCapitalization();
|
const { mutateAsync } = useToggleAutoCapitalization();
|
||||||
|
|
||||||
|
|||||||
+2
-2
@@ -1,6 +1,6 @@
|
|||||||
import { useRouter } from "next/router";
|
import { useRouter } from "next/router";
|
||||||
|
|
||||||
import { useNotificationContext } from "@app/components/context/Notifications/NotificationProvider";
|
import { createNotification } from "@app/components/notifications";
|
||||||
import { ProjectPermissionCan } from "@app/components/permissions";
|
import { ProjectPermissionCan } from "@app/components/permissions";
|
||||||
import { Button, DeleteActionModal } from "@app/components/v2";
|
import { Button, DeleteActionModal } from "@app/components/v2";
|
||||||
import {
|
import {
|
||||||
@@ -15,7 +15,7 @@ import { usePopUp } from "@app/hooks/usePopUp";
|
|||||||
|
|
||||||
export const DeleteProjectSection = () => {
|
export const DeleteProjectSection = () => {
|
||||||
const router = useRouter();
|
const router = useRouter();
|
||||||
const { createNotification } = useNotificationContext();
|
|
||||||
const { popUp, handlePopUpOpen, handlePopUpClose, handlePopUpToggle } = usePopUp([
|
const { popUp, handlePopUpOpen, handlePopUpClose, handlePopUpToggle } = usePopUp([
|
||||||
"deleteWorkspace"
|
"deleteWorkspace"
|
||||||
] as const);
|
] as const);
|
||||||
|
|||||||
+2
-2
@@ -2,7 +2,7 @@ import { Controller, useForm } from "react-hook-form";
|
|||||||
import { yupResolver } from "@hookform/resolvers/yup";
|
import { yupResolver } from "@hookform/resolvers/yup";
|
||||||
import * as yup from "yup";
|
import * as yup from "yup";
|
||||||
|
|
||||||
import { useNotificationContext } from "@app/components/context/Notifications/NotificationProvider";
|
import { createNotification } from "@app/components/notifications";
|
||||||
import { Button, FormControl, Input, Modal, ModalContent } from "@app/components/v2";
|
import { Button, FormControl, Input, Modal, ModalContent } from "@app/components/v2";
|
||||||
import { useWorkspace } from "@app/context";
|
import { useWorkspace } from "@app/context";
|
||||||
import { useCreateWsEnvironment } from "@app/hooks/api";
|
import { useCreateWsEnvironment } from "@app/hooks/api";
|
||||||
@@ -22,7 +22,7 @@ const schema = yup.object({
|
|||||||
export type FormData = yup.InferType<typeof schema>;
|
export type FormData = yup.InferType<typeof schema>;
|
||||||
|
|
||||||
export const AddEnvironmentModal = ({ popUp, handlePopUpClose, handlePopUpToggle }: Props) => {
|
export const AddEnvironmentModal = ({ popUp, handlePopUpClose, handlePopUpToggle }: Props) => {
|
||||||
const { createNotification } = useNotificationContext();
|
|
||||||
const { currentWorkspace } = useWorkspace();
|
const { currentWorkspace } = useWorkspace();
|
||||||
const { mutateAsync, isLoading } = useCreateWsEnvironment();
|
const { mutateAsync, isLoading } = useCreateWsEnvironment();
|
||||||
const { control, handleSubmit, reset } = useForm<FormData>({
|
const { control, handleSubmit, reset } = useForm<FormData>({
|
||||||
|
|||||||
+2
-2
@@ -1,7 +1,7 @@
|
|||||||
import { faPlus } from "@fortawesome/free-solid-svg-icons";
|
import { faPlus } from "@fortawesome/free-solid-svg-icons";
|
||||||
import { FontAwesomeIcon } from "@fortawesome/react-fontawesome";
|
import { FontAwesomeIcon } from "@fortawesome/react-fontawesome";
|
||||||
|
|
||||||
import { useNotificationContext } from "@app/components/context/Notifications/NotificationProvider";
|
import { createNotification } from "@app/components/notifications";
|
||||||
import { PermissionDeniedBanner, ProjectPermissionCan } from "@app/components/permissions";
|
import { PermissionDeniedBanner, ProjectPermissionCan } from "@app/components/permissions";
|
||||||
import { Button, DeleteActionModal, UpgradePlanModal } from "@app/components/v2";
|
import { Button, DeleteActionModal, UpgradePlanModal } from "@app/components/v2";
|
||||||
import {
|
import {
|
||||||
@@ -19,7 +19,7 @@ import { EnvironmentTable } from "./EnvironmentTable";
|
|||||||
import { UpdateEnvironmentModal } from "./UpdateEnvironmentModal";
|
import { UpdateEnvironmentModal } from "./UpdateEnvironmentModal";
|
||||||
|
|
||||||
export const EnvironmentSection = () => {
|
export const EnvironmentSection = () => {
|
||||||
const { createNotification } = useNotificationContext();
|
|
||||||
const { subscription } = useSubscription();
|
const { subscription } = useSubscription();
|
||||||
const { currentWorkspace } = useWorkspace();
|
const { currentWorkspace } = useWorkspace();
|
||||||
const { permission } = useProjectPermission();
|
const { permission } = useProjectPermission();
|
||||||
|
|||||||
+2
-2
@@ -1,7 +1,7 @@
|
|||||||
import { faArrowDown, faArrowUp, faPencil, faXmark } from "@fortawesome/free-solid-svg-icons";
|
import { faArrowDown, faArrowUp, faPencil, faXmark } from "@fortawesome/free-solid-svg-icons";
|
||||||
import { FontAwesomeIcon } from "@fortawesome/react-fontawesome";
|
import { FontAwesomeIcon } from "@fortawesome/react-fontawesome";
|
||||||
|
|
||||||
import { useNotificationContext } from "@app/components/context/Notifications/NotificationProvider";
|
import { createNotification } from "@app/components/notifications";
|
||||||
import { ProjectPermissionCan } from "@app/components/permissions";
|
import { ProjectPermissionCan } from "@app/components/permissions";
|
||||||
import {
|
import {
|
||||||
EmptyState,
|
EmptyState,
|
||||||
@@ -36,7 +36,7 @@ type Props = {
|
|||||||
|
|
||||||
export const EnvironmentTable = ({ handlePopUpOpen }: Props) => {
|
export const EnvironmentTable = ({ handlePopUpOpen }: Props) => {
|
||||||
const { currentWorkspace, isLoading } = useWorkspace();
|
const { currentWorkspace, isLoading } = useWorkspace();
|
||||||
const { createNotification } = useNotificationContext();
|
|
||||||
const updateEnvironment = useUpdateWsEnvironment();
|
const updateEnvironment = useUpdateWsEnvironment();
|
||||||
|
|
||||||
const handleReorderEnv = async (id: string, position: number) => {
|
const handleReorderEnv = async (id: string, position: number) => {
|
||||||
|
|||||||
+2
-2
@@ -2,7 +2,7 @@ import { Controller, useForm } from "react-hook-form";
|
|||||||
import { yupResolver } from "@hookform/resolvers/yup";
|
import { yupResolver } from "@hookform/resolvers/yup";
|
||||||
import * as yup from "yup";
|
import * as yup from "yup";
|
||||||
|
|
||||||
import { useNotificationContext } from "@app/components/context/Notifications/NotificationProvider";
|
import { createNotification } from "@app/components/notifications";
|
||||||
import { Button, FormControl, Input, Modal, ModalContent } from "@app/components/v2";
|
import { Button, FormControl, Input, Modal, ModalContent } from "@app/components/v2";
|
||||||
import { useWorkspace } from "@app/context";
|
import { useWorkspace } from "@app/context";
|
||||||
import { useUpdateWsEnvironment } from "@app/hooks/api";
|
import { useUpdateWsEnvironment } from "@app/hooks/api";
|
||||||
@@ -22,7 +22,7 @@ const schema = yup.object({
|
|||||||
export type FormData = yup.InferType<typeof schema>;
|
export type FormData = yup.InferType<typeof schema>;
|
||||||
|
|
||||||
export const UpdateEnvironmentModal = ({ popUp, handlePopUpClose, handlePopUpToggle }: Props) => {
|
export const UpdateEnvironmentModal = ({ popUp, handlePopUpClose, handlePopUpToggle }: Props) => {
|
||||||
const { createNotification } = useNotificationContext();
|
|
||||||
const { currentWorkspace } = useWorkspace();
|
const { currentWorkspace } = useWorkspace();
|
||||||
const { mutateAsync, isLoading } = useUpdateWsEnvironment();
|
const { mutateAsync, isLoading } = useUpdateWsEnvironment();
|
||||||
const { control, handleSubmit, reset } = useForm<FormData>({
|
const { control, handleSubmit, reset } = useForm<FormData>({
|
||||||
|
|||||||
+2
-2
@@ -2,7 +2,7 @@ import { useCallback } from "react";
|
|||||||
import { faCheck, faCopy } from "@fortawesome/free-solid-svg-icons";
|
import { faCheck, faCopy } from "@fortawesome/free-solid-svg-icons";
|
||||||
import { FontAwesomeIcon } from "@fortawesome/react-fontawesome";
|
import { FontAwesomeIcon } from "@fortawesome/react-fontawesome";
|
||||||
|
|
||||||
import { useNotificationContext } from "@app/components/context/Notifications/NotificationProvider";
|
import { createNotification } from "@app/components/notifications";
|
||||||
import { Button } from "@app/components/v2";
|
import { Button } from "@app/components/v2";
|
||||||
import { useToggle } from "@app/hooks";
|
import { useToggle } from "@app/hooks";
|
||||||
|
|
||||||
@@ -15,7 +15,7 @@ type Props = {
|
|||||||
|
|
||||||
export const CopyButton = ({ value, children, hoverText, notificationText }: Props) => {
|
export const CopyButton = ({ value, children, hoverText, notificationText }: Props) => {
|
||||||
const [isProjectIdCopied, setIsProjectIdCopied] = useToggle(false);
|
const [isProjectIdCopied, setIsProjectIdCopied] = useToggle(false);
|
||||||
const { createNotification } = useNotificationContext();
|
|
||||||
|
|
||||||
const copyToClipboard = useCallback(() => {
|
const copyToClipboard = useCallback(() => {
|
||||||
if (isProjectIdCopied) {
|
if (isProjectIdCopied) {
|
||||||
|
|||||||
+2
-2
@@ -3,7 +3,7 @@ import { Controller, useForm } from "react-hook-form";
|
|||||||
import { yupResolver } from "@hookform/resolvers/yup";
|
import { yupResolver } from "@hookform/resolvers/yup";
|
||||||
import * as yup from "yup";
|
import * as yup from "yup";
|
||||||
|
|
||||||
import { useNotificationContext } from "@app/components/context/Notifications/NotificationProvider";
|
import { createNotification } from "@app/components/notifications";
|
||||||
import { ProjectPermissionCan } from "@app/components/permissions";
|
import { ProjectPermissionCan } from "@app/components/permissions";
|
||||||
import { Button, FormControl, Input } from "@app/components/v2";
|
import { Button, FormControl, Input } from "@app/components/v2";
|
||||||
import { ProjectPermissionActions, ProjectPermissionSub, useWorkspace } from "@app/context";
|
import { ProjectPermissionActions, ProjectPermissionSub, useWorkspace } from "@app/context";
|
||||||
@@ -22,7 +22,7 @@ const formSchema = yup.object({
|
|||||||
type FormData = yup.InferType<typeof formSchema>;
|
type FormData = yup.InferType<typeof formSchema>;
|
||||||
|
|
||||||
export const ProjectNameChangeSection = () => {
|
export const ProjectNameChangeSection = () => {
|
||||||
const { createNotification } = useNotificationContext();
|
|
||||||
const { currentWorkspace } = useWorkspace();
|
const { currentWorkspace } = useWorkspace();
|
||||||
const { mutateAsync, isLoading } = useRenameWorkspace();
|
const { mutateAsync, isLoading } = useRenameWorkspace();
|
||||||
|
|
||||||
|
|||||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user