mirror of
https://github.com/awatertrevi/infisical.git
synced 2026-10-08 17:28:18 +00:00
misc: added auto redirect to workflow settings tab
This commit is contained in:
@@ -262,7 +262,7 @@ export const registerSlackRouter = async (server: FastifyZodProvider) => {
|
|||||||
orgId: string;
|
orgId: string;
|
||||||
};
|
};
|
||||||
|
|
||||||
return res.redirect(`${appCfg.SITE_URL}/org/${metadata.orgId}/settings`);
|
return res.redirect(`${appCfg.SITE_URL}/org/${metadata.orgId}/settings?selectedTab=workflow-integrations`);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,4 +1,5 @@
|
|||||||
import { Fragment } from "react";
|
import { Fragment, useEffect, useState } from "react";
|
||||||
|
import { useRouter } from "next/router";
|
||||||
import { Tab } from "@headlessui/react";
|
import { Tab } from "@headlessui/react";
|
||||||
|
|
||||||
import { AuditLogStreamsTab } from "../AuditLogStreamTab";
|
import { AuditLogStreamsTab } from "../AuditLogStreamTab";
|
||||||
@@ -15,8 +16,21 @@ const tabs = [
|
|||||||
{ name: "Audit Log Streams", key: "tag-audit-log-streams" }
|
{ name: "Audit Log Streams", key: "tag-audit-log-streams" }
|
||||||
];
|
];
|
||||||
export const OrgTabGroup = () => {
|
export const OrgTabGroup = () => {
|
||||||
|
const { query } = useRouter();
|
||||||
|
const [selectedTabIndex, setSelectedTabIndex] = useState(0);
|
||||||
|
const selectedTab = query.selectedTab as string;
|
||||||
|
|
||||||
|
useEffect(() => {
|
||||||
|
if (selectedTab) {
|
||||||
|
const index = tabs.findIndex((tab) => tab.key === selectedTab);
|
||||||
|
if (index !== -1) {
|
||||||
|
setSelectedTabIndex(index);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}, [selectedTab]);
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<Tab.Group>
|
<Tab.Group selectedIndex={selectedTabIndex} onChange={setSelectedTabIndex}>
|
||||||
<Tab.List className="mb-6 w-full border-b-2 border-mineshaft-800">
|
<Tab.List className="mb-6 w-full border-b-2 border-mineshaft-800">
|
||||||
{tabs.map((tab) => (
|
{tabs.map((tab) => (
|
||||||
<Tab as={Fragment} key={tab.key}>
|
<Tab as={Fragment} key={tab.key}>
|
||||||
|
|||||||
+1
-1
@@ -99,7 +99,7 @@ export const WorkflowIntegrationTab = () => {
|
|||||||
|
|
||||||
return !slackIntegrations?.length ? (
|
return !slackIntegrations?.length ? (
|
||||||
<EmptyState title="You do not have any integrations configured.">
|
<EmptyState title="You do not have any integrations configured.">
|
||||||
<Link href={`/org/${currentWorkspace?.orgId}/settings?tab=workflowIntegrations`}>
|
<Link href={`/org/${currentWorkspace?.orgId}/settings?selectedTab=workflow-integrations`}>
|
||||||
<div className="mt-2 underline decoration-primary-800 underline-offset-4 duration-200 hover:cursor-pointer hover:text-mineshaft-100 hover:decoration-primary-600">
|
<div className="mt-2 underline decoration-primary-800 underline-offset-4 duration-200 hover:cursor-pointer hover:text-mineshaft-100 hover:decoration-primary-600">
|
||||||
Create one now
|
Create one now
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
Reference in New Issue
Block a user