From 71079fb9a630cf06cc32c4f584cdab3146e8008f Mon Sep 17 00:00:00 2001 From: Rainnny7 Date: Fri, 20 Sep 2024 03:22:54 -0400 Subject: [PATCH] misc changes --- .../(pages)/dashboard/user/billing/page.tsx | 2 +- .../sidebar/organization-selector.tsx | 8 +++---- .../dashboard/sidebar/sidebar-links.tsx | 23 +++++++++++++------ .../dashboard/user/settings/device/device.tsx | 1 + .../user/settings/tfa/tfa-setting.tsx | 3 +-- 5 files changed, 23 insertions(+), 14 deletions(-) diff --git a/src/app/(pages)/dashboard/user/billing/page.tsx b/src/app/(pages)/dashboard/user/billing/page.tsx index e7a6fe2..11d5fac 100644 --- a/src/app/(pages)/dashboard/user/billing/page.tsx +++ b/src/app/(pages)/dashboard/user/billing/page.tsx @@ -18,7 +18,7 @@ const UserBillingPage = (): ReactElement => (

Billing is not yet available, this will be available to cloud - environments. + environments in the future.

diff --git a/src/components/dashboard/sidebar/organization-selector.tsx b/src/components/dashboard/sidebar/organization-selector.tsx index af0bd6f..30fe677 100644 --- a/src/components/dashboard/sidebar/organization-selector.tsx +++ b/src/components/dashboard/sidebar/organization-selector.tsx @@ -43,7 +43,7 @@ const OrganizationSelector = (): ReactElement => { // Set the selected organization useEffect(() => { - const toSelect: Organization | undefined = organizations.find( + const toSelect: Organization | undefined = organizations?.find( (organization: Organization) => { return organization.snowflake === selectedOrganization; } @@ -51,11 +51,11 @@ const OrganizationSelector = (): ReactElement => { // Update the state for this page setSelected( toSelect || - (organizations.length > 0 ? organizations[0] : undefined) + (organizations?.length > 0 ? organizations[0] : undefined) ); // Update the state for all pages - if (!toSelect && organizations.length > 0) { + if (!toSelect && organizations?.length > 0) { setSelectedOrganization(organizations[0].snowflake); } }, [organizations, selectedOrganization, setSelectedOrganization]); @@ -101,7 +101,7 @@ const OrganizationSelector = (): ReactElement => { No organizations found. - {organizations.map( + {organizations?.map( (organization: Organization, index: number) => ( , + href: "/dashboard", + }, { name: "Status Pages", icon: , - href: "/status-pages", + href: "/dashboard/{org}/status-pages", }, { name: "Automations", icon: , - href: "/automations", + href: "/dashboard/{org}/automations", }, { name: "Incidents", icon: , - href: "/incidents", + href: "/dashboard/{org}/incidents", }, { name: "Insights", icon: , - href: "/insights", + href: "/dashboard/{org}/insights", }, { name: "Audit Logs", icon: , - href: "/audit", + href: "/dashboard/{org}/audit", }, { name: "Settings", icon: , - href: "/settings", + href: "/dashboard/{org}/settings", }, ]; @@ -64,7 +70,10 @@ const Links = (): ReactElement => { return (
{links.map((link: SidebarLink, index: number) => { - const href: string = `/dashboard/org/${selectedOrganization}${link.href}`; + const href: string = link.href.replace( + "{org}", + selectedOrganization as string + ); const active: boolean = path.startsWith(href); return ( diff --git a/src/components/dashboard/user/settings/tfa/tfa-setting.tsx b/src/components/dashboard/user/settings/tfa/tfa-setting.tsx index 1599050..0b8f8ef 100644 --- a/src/components/dashboard/user/settings/tfa/tfa-setting.tsx +++ b/src/components/dashboard/user/settings/tfa/tfa-setting.tsx @@ -107,8 +107,7 @@ const TFASetting = (): ReactElement => {

Two-Factor Auth

Enhance your account security with an extra layer of - protection. Enable Two-Factor Authentication for safer - access! + protection.