From b912cd585c885c258a0c75da88e4fb094938949d Mon Sep 17 00:00:00 2001 From: Akhil Mohan Date: Tue, 26 Mar 2024 19:45:52 +0530 Subject: [PATCH] feat(ui): resolved dynamic secret merge conflict --- frontend/src/components/notifications/Notifications.tsx | 2 +- frontend/src/styles/globals.css | 4 ++++ .../CreateDynamicSecretForm/SqlDatabaseInputForm.tsx | 4 ++-- .../DynamicSecretListView/CreateDynamicSecretLease.tsx | 4 ++-- .../components/DynamicSecretListView/DynamicSecretLease.tsx | 4 ++-- .../DynamicSecretListView/DynamicSecretListView.tsx | 4 ++-- .../EditDynamicSecretSqlProviderForm.tsx | 4 ++-- .../DynamicSecretListView/RenewDynamicSecretLease.tsx | 4 ++-- 8 files changed, 17 insertions(+), 13 deletions(-) diff --git a/frontend/src/components/notifications/Notifications.tsx b/frontend/src/components/notifications/Notifications.tsx index 422a8faa3..0d6b0d061 100644 --- a/frontend/src/components/notifications/Notifications.tsx +++ b/frontend/src/components/notifications/Notifications.tsx @@ -23,7 +23,7 @@ export const createNotification = ( position: "bottom-right", ...toastProps, theme: "dark", - type: myProps?.type || "info" + type: myProps?.type || "info", }); export const NotificationContainer = () => ; diff --git a/frontend/src/styles/globals.css b/frontend/src/styles/globals.css index 3f1b20a16..9a1295d19 100644 --- a/frontend/src/styles/globals.css +++ b/frontend/src/styles/globals.css @@ -9,6 +9,10 @@ html { --toastify-color-dark: theme(colors.mineshaft.700); } +.Toastify__toast { + @apply rounded-md; +} + .rdp-day, .rdp-nav_button { @apply rounded-md hover:text-mineshaft-500; diff --git a/frontend/src/views/SecretMainPage/components/ActionBar/CreateDynamicSecretForm/SqlDatabaseInputForm.tsx b/frontend/src/views/SecretMainPage/components/ActionBar/CreateDynamicSecretForm/SqlDatabaseInputForm.tsx index ace717bd3..c0dff20f5 100644 --- a/frontend/src/views/SecretMainPage/components/ActionBar/CreateDynamicSecretForm/SqlDatabaseInputForm.tsx +++ b/frontend/src/views/SecretMainPage/components/ActionBar/CreateDynamicSecretForm/SqlDatabaseInputForm.tsx @@ -3,8 +3,8 @@ import { zodResolver } from "@hookform/resolvers/zod"; import ms from "ms"; import { z } from "zod"; -import { useNotificationContext } from "@app/components/context/Notifications/NotificationProvider"; import { TtlFormLabel } from "@app/components/features"; +import { createNotification } from "@app/components/notifications"; import { Accordion, AccordionContent, @@ -91,7 +91,7 @@ export const SqlDatabaseInputForm = ({ } } }); - const { createNotification } = useNotificationContext(); + const createDynamicSecret = useCreateDynamicSecret(); const handleCreateDynamicSecret = async ({ name, maxTTL, provider, defaultTTL }: TForm) => { diff --git a/frontend/src/views/SecretMainPage/components/DynamicSecretListView/CreateDynamicSecretLease.tsx b/frontend/src/views/SecretMainPage/components/DynamicSecretListView/CreateDynamicSecretLease.tsx index 552b2fb1f..3eb80c9b4 100644 --- a/frontend/src/views/SecretMainPage/components/DynamicSecretListView/CreateDynamicSecretLease.tsx +++ b/frontend/src/views/SecretMainPage/components/DynamicSecretListView/CreateDynamicSecretLease.tsx @@ -6,8 +6,8 @@ import { AnimatePresence, motion } from "framer-motion"; import ms from "ms"; import { z } from "zod"; -import { useNotificationContext } from "@app/components/context/Notifications/NotificationProvider"; import { TtlFormLabel } from "@app/components/features"; +import { createNotification } from "@app/components/notifications"; import { Button, FormControl, IconButton, Input, SecretInput, Tooltip } from "@app/components/v2"; import { useTimedReset } from "@app/hooks"; import { useCreateDynamicSecretLease } from "@app/hooks/api"; @@ -102,7 +102,7 @@ export const CreateDynamicSecretLease = ({ ttl: "1h" } }); - const { createNotification } = useNotificationContext(); + const createDynamicSecretLease = useCreateDynamicSecretLease(); diff --git a/frontend/src/views/SecretMainPage/components/DynamicSecretListView/DynamicSecretLease.tsx b/frontend/src/views/SecretMainPage/components/DynamicSecretListView/DynamicSecretLease.tsx index ae17e4851..49110c3bb 100644 --- a/frontend/src/views/SecretMainPage/components/DynamicSecretListView/DynamicSecretLease.tsx +++ b/frontend/src/views/SecretMainPage/components/DynamicSecretListView/DynamicSecretLease.tsx @@ -9,7 +9,7 @@ import { import { FontAwesomeIcon } from "@fortawesome/react-fontawesome"; import { format, 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 { Button, @@ -60,7 +60,7 @@ export const DynamicSecretLease = ({ path: secretPath, dynamicSecretName }); - const { createNotification } = useNotificationContext(); + const deleteDynamicSecretLease = useRevokeDynamicSecretLease(); diff --git a/frontend/src/views/SecretMainPage/components/DynamicSecretListView/DynamicSecretListView.tsx b/frontend/src/views/SecretMainPage/components/DynamicSecretListView/DynamicSecretListView.tsx index cfab8bfc2..6b133d945 100644 --- a/frontend/src/views/SecretMainPage/components/DynamicSecretListView/DynamicSecretListView.tsx +++ b/frontend/src/views/SecretMainPage/components/DynamicSecretListView/DynamicSecretListView.tsx @@ -7,7 +7,7 @@ import { } from "@fortawesome/free-solid-svg-icons"; 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 { Button, @@ -59,7 +59,7 @@ export const DynamicSecretListView = ({ "deleteDynamicSecret" ] as const); - const { createNotification } = useNotificationContext(); + const deleteDynamicSecret = useDeleteDynamicSecret(); const handleDynamicSecretDelete = async () => { diff --git a/frontend/src/views/SecretMainPage/components/DynamicSecretListView/EditDynamicSecretForm/EditDynamicSecretSqlProviderForm.tsx b/frontend/src/views/SecretMainPage/components/DynamicSecretListView/EditDynamicSecretForm/EditDynamicSecretSqlProviderForm.tsx index 7a91e0d3e..8207b1892 100644 --- a/frontend/src/views/SecretMainPage/components/DynamicSecretListView/EditDynamicSecretForm/EditDynamicSecretSqlProviderForm.tsx +++ b/frontend/src/views/SecretMainPage/components/DynamicSecretListView/EditDynamicSecretForm/EditDynamicSecretSqlProviderForm.tsx @@ -3,8 +3,8 @@ import { zodResolver } from "@hookform/resolvers/zod"; import ms from "ms"; import { z } from "zod"; -import { useNotificationContext } from "@app/components/context/Notifications/NotificationProvider"; import { TtlFormLabel } from "@app/components/features"; +import { createNotification } from "@app/components/notifications"; import { Accordion, AccordionContent, @@ -94,7 +94,7 @@ export const EditDynamicSecretSqlProviderForm = ({ } } }); - const { createNotification } = useNotificationContext(); + const updateDynamicSecret = useUpdateDynamicSecret(); const handleUpdateDynamicSecret = async ({ inputs, maxTTL, defaultTTL, newName }: TForm) => { diff --git a/frontend/src/views/SecretMainPage/components/DynamicSecretListView/RenewDynamicSecretLease.tsx b/frontend/src/views/SecretMainPage/components/DynamicSecretListView/RenewDynamicSecretLease.tsx index b307c181c..673c24a3c 100644 --- a/frontend/src/views/SecretMainPage/components/DynamicSecretListView/RenewDynamicSecretLease.tsx +++ b/frontend/src/views/SecretMainPage/components/DynamicSecretListView/RenewDynamicSecretLease.tsx @@ -3,8 +3,8 @@ import { zodResolver } from "@hookform/resolvers/zod"; import ms from "ms"; import { z } from "zod"; -import { useNotificationContext } from "@app/components/context/Notifications/NotificationProvider"; import { TtlFormLabel } from "@app/components/features"; +import { createNotification } from "@app/components/notifications"; import { Button, FormControl, Input } from "@app/components/v2"; import { useRenewDynamicSecretLease } from "@app/hooks/api"; @@ -48,7 +48,7 @@ export const RenewDynamicSecretLease = ({ ttl: "1h" } }); - const { createNotification } = useNotificationContext(); + const renewDynamicSecretLease = useRenewDynamicSecretLease();