mirror of
https://github.com/awatertrevi/infisical.git
synced 2026-10-06 14:27:59 +00:00
Rolled back the dashboard
This commit is contained in:
@@ -19,8 +19,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 { Tag } from 'public/data/frequentInterfaces';
|
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 Button from '@app/components/basic/buttons/Button';
|
||||||
import BottonRightPopup from '@app/components/basic/popups/BottomRightPopup';
|
import BottonRightPopup from '@app/components/basic/popups/BottomRightPopup';
|
||||||
import { useNotificationContext } from '@app/components/context/Notifications/NotificationProvider';
|
import { useNotificationContext } from '@app/components/context/Notifications/NotificationProvider';
|
||||||
@@ -173,7 +173,7 @@ export default function Dashboard() {
|
|||||||
|
|
||||||
const { createNotification } = useNotificationContext();
|
const { createNotification } = useNotificationContext();
|
||||||
const router = useRouter();
|
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 workspaceId = router.query.id as string;
|
||||||
const [workspaceEnvs, setWorkspaceEnvs] = useState<WorkspaceEnv[]>([]);
|
const [workspaceEnvs, setWorkspaceEnvs] = useState<WorkspaceEnv[]>([]);
|
||||||
@@ -240,12 +240,10 @@ export default function Dashboard() {
|
|||||||
setWorkspaceEnvs(accessibleEnvironments || []);
|
setWorkspaceEnvs(accessibleEnvironments || []);
|
||||||
|
|
||||||
// set env
|
// set env
|
||||||
console.log(1, accessibleEnvironments, envInURL)
|
const env = accessibleEnvironments[0] || {
|
||||||
const env = accessibleEnvironments?.find((ae: WorkspaceEnv) => ae.slug === envInURL) || {
|
|
||||||
name: 'unknown',
|
name: 'unknown',
|
||||||
slug: 'unknown'
|
slug: 'unknown'
|
||||||
};
|
};
|
||||||
console.log(1, env)
|
|
||||||
setSelectedEnv(env);
|
setSelectedEnv(env);
|
||||||
setSelectedSnapshotEnv(env);
|
setSelectedSnapshotEnv(env);
|
||||||
|
|
||||||
@@ -281,7 +279,7 @@ export default function Dashboard() {
|
|||||||
setData(undefined);
|
setData(undefined);
|
||||||
}
|
}
|
||||||
})();
|
})();
|
||||||
}, [workspaceId, envInURL]);
|
}, [workspaceId]);
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
(async () => {
|
(async () => {
|
||||||
@@ -292,7 +290,7 @@ export default function Dashboard() {
|
|||||||
let dataToSort;
|
let dataToSort;
|
||||||
if (selectedEnv) {
|
if (selectedEnv) {
|
||||||
dataToSort = await getSecretsForProject({
|
dataToSort = await getSecretsForProject({
|
||||||
env: String(envInURL),
|
env: selectedEnv.slug,
|
||||||
setIsKeyAvailable,
|
setIsKeyAvailable,
|
||||||
setData,
|
setData,
|
||||||
workspaceId
|
workspaceId
|
||||||
@@ -818,7 +816,7 @@ export default function Dashboard() {
|
|||||||
};
|
};
|
||||||
|
|
||||||
return <div>
|
return <div>
|
||||||
{!envInURL
|
{false
|
||||||
? <DashboardEnvOverview />
|
? <DashboardEnvOverview />
|
||||||
: (data ? (
|
: (data ? (
|
||||||
<div className="bg-bunker-800 max-h-screen h-full relative flex flex-col justify-between text-white dark">
|
<div className="bg-bunker-800 max-h-screen h-full relative flex flex-col justify-between text-white dark">
|
||||||
@@ -848,7 +846,7 @@ export default function Dashboard() {
|
|||||||
<div className="w-full max-h-96 pb-2 dark:[color-scheme:dark]">
|
<div className="w-full max-h-96 pb-2 dark:[color-scheme:dark]">
|
||||||
<NavHeader
|
<NavHeader
|
||||||
pageName={t('dashboard:title')}
|
pageName={t('dashboard:title')}
|
||||||
currentEnv={workspaceEnvs?.filter(envir => envir.slug === envInURL)[0].name || ''}
|
currentEnv={selectedEnv?.name || ''}
|
||||||
isProjectRelated
|
isProjectRelated
|
||||||
userAvailableEnvs={workspaceEnvs}
|
userAvailableEnvs={workspaceEnvs}
|
||||||
onEnvChange={handleOnEnvironmentChange}
|
onEnvChange={handleOnEnvironmentChange}
|
||||||
|
|||||||
Reference in New Issue
Block a user