misc changes

This commit is contained in:
Braydon 2024-09-20 03:22:54 -04:00
parent 365ffb0e87
commit 71079fb9a6
5 changed files with 23 additions and 14 deletions

@ -18,7 +18,7 @@ const UserBillingPage = (): ReactElement => (
<Separator className="opacity-65" /> <Separator className="opacity-65" />
<p className="opacity-75 select-none pointer-events-none"> <p className="opacity-75 select-none pointer-events-none">
Billing is not yet available, this will be available to cloud Billing is not yet available, this will be available to cloud
environments. environments in the future.
</p> </p>
</div> </div>
</main> </main>

@ -43,7 +43,7 @@ const OrganizationSelector = (): ReactElement => {
// Set the selected organization // Set the selected organization
useEffect(() => { useEffect(() => {
const toSelect: Organization | undefined = organizations.find( const toSelect: Organization | undefined = organizations?.find(
(organization: Organization) => { (organization: Organization) => {
return organization.snowflake === selectedOrganization; return organization.snowflake === selectedOrganization;
} }
@ -51,11 +51,11 @@ const OrganizationSelector = (): ReactElement => {
// Update the state for this page // Update the state for this page
setSelected( setSelected(
toSelect || toSelect ||
(organizations.length > 0 ? organizations[0] : undefined) (organizations?.length > 0 ? organizations[0] : undefined)
); );
// Update the state for all pages // Update the state for all pages
if (!toSelect && organizations.length > 0) { if (!toSelect && organizations?.length > 0) {
setSelectedOrganization(organizations[0].snowflake); setSelectedOrganization(organizations[0].snowflake);
} }
}, [organizations, selectedOrganization, setSelectedOrganization]); }, [organizations, selectedOrganization, setSelectedOrganization]);
@ -101,7 +101,7 @@ const OrganizationSelector = (): ReactElement => {
<CommandList> <CommandList>
<CommandEmpty>No organizations found.</CommandEmpty> <CommandEmpty>No organizations found.</CommandEmpty>
<CommandGroup> <CommandGroup>
{organizations.map( {organizations?.map(
(organization: Organization, index: number) => ( (organization: Organization, index: number) => (
<CommandItem <CommandItem
key={index} key={index}

@ -10,6 +10,7 @@ import {
ClipboardIcon, ClipboardIcon,
Cog6ToothIcon, Cog6ToothIcon,
FireIcon, FireIcon,
HomeIcon,
PencilSquareIcon, PencilSquareIcon,
WrenchIcon, WrenchIcon,
} from "@heroicons/react/24/outline"; } from "@heroicons/react/24/outline";
@ -18,35 +19,40 @@ import { OrganizationState } from "@/app/store/organization-store";
import { usePathname } from "next/navigation"; import { usePathname } from "next/navigation";
const links: SidebarLink[] = [ const links: SidebarLink[] = [
{
name: "Home",
icon: <HomeIcon />,
href: "/dashboard",
},
{ {
name: "Status Pages", name: "Status Pages",
icon: <ClipboardIcon />, icon: <ClipboardIcon />,
href: "/status-pages", href: "/dashboard/{org}/status-pages",
}, },
{ {
name: "Automations", name: "Automations",
icon: <WrenchIcon />, icon: <WrenchIcon />,
href: "/automations", href: "/dashboard/{org}/automations",
}, },
{ {
name: "Incidents", name: "Incidents",
icon: <FireIcon />, icon: <FireIcon />,
href: "/incidents", href: "/dashboard/{org}/incidents",
}, },
{ {
name: "Insights", name: "Insights",
icon: <ChartBarSquareIcon />, icon: <ChartBarSquareIcon />,
href: "/insights", href: "/dashboard/{org}/insights",
}, },
{ {
name: "Audit Logs", name: "Audit Logs",
icon: <PencilSquareIcon />, icon: <PencilSquareIcon />,
href: "/audit", href: "/dashboard/{org}/audit",
}, },
{ {
name: "Settings", name: "Settings",
icon: <Cog6ToothIcon />, icon: <Cog6ToothIcon />,
href: "/settings", href: "/dashboard/{org}/settings",
}, },
]; ];
@ -64,7 +70,10 @@ const Links = (): ReactElement => {
return ( return (
<div className="mt-3.5 w-full flex flex-col gap-0.5 select-none"> <div className="mt-3.5 w-full flex flex-col gap-0.5 select-none">
{links.map((link: SidebarLink, index: number) => { {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); const active: boolean = path.startsWith(href);
return ( return (
<SimpleTooltip <SimpleTooltip

@ -75,6 +75,7 @@ const Device = ({
className="p-0 w-5 h-5 text-red-500 hover:bg-transparent hover:text-red-500/75" className="p-0 w-5 h-5 text-red-500 hover:bg-transparent hover:text-red-500/75"
size="icon" size="icon"
variant="ghost" variant="ghost"
disabled
> >
<ArrowLeftEndOnRectangleIcon /> <ArrowLeftEndOnRectangleIcon />
</Button> </Button>

@ -107,8 +107,7 @@ const TFASetting = (): ReactElement => {
<h1 className="text-lg font-bold">Two-Factor Auth</h1> <h1 className="text-lg font-bold">Two-Factor Auth</h1>
<p className="max-w-64 text-sm opacity-75"> <p className="max-w-64 text-sm opacity-75">
Enhance your account security with an extra layer of Enhance your account security with an extra layer of
protection. Enable Two-Factor Authentication for safer protection.
access!
</p> </p>
</div> </div>