From 12e16b4a03072094424909d855a663789bb55d5c Mon Sep 17 00:00:00 2001 From: Sheen Date: Sat, 15 Apr 2023 11:21:35 +0800 Subject: [PATCH 1/6] [Adjustment][Sheen] removed additional prompt when deleting secret --- .../components/dashboard/DeleteActionButton.tsx | 16 +++------------- 1 file changed, 3 insertions(+), 13 deletions(-) diff --git a/frontend/src/components/dashboard/DeleteActionButton.tsx b/frontend/src/components/dashboard/DeleteActionButton.tsx index 91819b43c..48b81eaee 100644 --- a/frontend/src/components/dashboard/DeleteActionButton.tsx +++ b/frontend/src/components/dashboard/DeleteActionButton.tsx @@ -1,10 +1,9 @@ -import React, { useState } from 'react' +import React from 'react' import { useTranslation } from 'react-i18next'; import { faXmark } from '@fortawesome/free-solid-svg-icons'; import { FontAwesomeIcon } from '@fortawesome/react-fontawesome'; import Button from '../basic/buttons/Button'; -import { DeleteEnvVar } from '../basic/dialog/DeleteEnvVar'; type Props = { onSubmit: () => void; @@ -13,7 +12,6 @@ type Props = { export const DeleteActionButton = ({ onSubmit, isPlain }: Props) => { const { t } = useTranslation(); - const [open, setOpen] = useState(false) return (
{ onKeyDown={() => null} role="button" tabIndex={0} - onClick={() => setOpen(true)} + onClick={onSubmit} className="invisible group-hover:visible" >
: diff --git a/frontend/src/views/Settings/OrgSettingsPage/OrgSettingsPage.tsx b/frontend/src/views/Settings/OrgSettingsPage/OrgSettingsPage.tsx index d5d8687b7..33b94eafe 100644 --- a/frontend/src/views/Settings/OrgSettingsPage/OrgSettingsPage.tsx +++ b/frontend/src/views/Settings/OrgSettingsPage/OrgSettingsPage.tsx @@ -62,7 +62,10 @@ export const OrgSettingsPage = () => { (orgUsers || []).length >= 5 && subscriptionPlan === plans.starter && host === 'https://app.infisical.com' && - currentWorkspace?._id !== '63ea8121b6e2b0543ba79616'; + currentWorkspace?._id !== '63ea8121b6e2b0543ba79616' && + currentWorkspace?._id !== '634870246fd2e26f28e76996' && + currentWorkspace?._id !== '63d823cef9e728a0a961255a' && + currentWorkspace?._id !== '6412ec319db25595ac00b8c6'; const onRenameOrg = async (name: string) => { if (!currentOrg?._id) return; From 48cd2bddfea15522e92a4581bb5777cf13a308a0 Mon Sep 17 00:00:00 2001 From: Vladyslav Matsiiako Date: Mon, 17 Apr 2023 12:08:23 -0700 Subject: [PATCH 6/6] Rolled back the dashboard --- frontend/src/pages/dashboard/[id].tsx | 16 +++++++--------- 1 file changed, 7 insertions(+), 9 deletions(-) diff --git a/frontend/src/pages/dashboard/[id].tsx b/frontend/src/pages/dashboard/[id].tsx index bd43c85b1..55cfaca8f 100644 --- a/frontend/src/pages/dashboard/[id].tsx +++ b/frontend/src/pages/dashboard/[id].tsx @@ -19,8 +19,8 @@ import { } from '@fortawesome/free-solid-svg-icons'; import { FontAwesomeIcon } from '@fortawesome/react-fontawesome'; import { Tag } from 'public/data/frequentInterfaces'; -import queryString from 'query-string'; +// import queryString from 'query-string'; import Button from '@app/components/basic/buttons/Button'; import BottonRightPopup from '@app/components/basic/popups/BottomRightPopup'; import { useNotificationContext } from '@app/components/context/Notifications/NotificationProvider'; @@ -173,7 +173,7 @@ export default function Dashboard() { const { createNotification } = useNotificationContext(); const router = useRouter(); - const envInURL = queryString.parse(router.asPath.split('?')[1])?.env; + // const envInURL = queryString.parse(router.asPath.split('?')[1])?.env; const workspaceId = router.query.id as string; const [workspaceEnvs, setWorkspaceEnvs] = useState([]); @@ -240,12 +240,10 @@ export default function Dashboard() { setWorkspaceEnvs(accessibleEnvironments || []); // set env - console.log(1, accessibleEnvironments, envInURL) - const env = accessibleEnvironments?.find((ae: WorkspaceEnv) => ae.slug === envInURL) || { + const env = accessibleEnvironments[0] || { name: 'unknown', slug: 'unknown' }; - console.log(1, env) setSelectedEnv(env); setSelectedSnapshotEnv(env); @@ -281,7 +279,7 @@ export default function Dashboard() { setData(undefined); } })(); - }, [workspaceId, envInURL]); + }, [workspaceId]); useEffect(() => { (async () => { @@ -292,7 +290,7 @@ export default function Dashboard() { let dataToSort; if (selectedEnv) { dataToSort = await getSecretsForProject({ - env: String(envInURL), + env: selectedEnv.slug, setIsKeyAvailable, setData, workspaceId @@ -818,7 +816,7 @@ export default function Dashboard() { }; return
- {!envInURL + {false ? : (data ? (
@@ -848,7 +846,7 @@ export default function Dashboard() {
envir.slug === envInURL)[0].name || ''} + currentEnv={selectedEnv?.name || ''} isProjectRelated userAvailableEnvs={workspaceEnvs} onEnvChange={handleOnEnvironmentChange}