Skip to content

Commit

Permalink
cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
abailly-akamai committed Oct 23, 2024
1 parent 13d7c0f commit 7f608f9
Show file tree
Hide file tree
Showing 36 changed files with 238 additions and 236 deletions.
185 changes: 14 additions & 171 deletions packages/manager/src/routes/account/AccountRoute.tsx
Original file line number Diff line number Diff line change
@@ -1,171 +1,14 @@
import { createRoute } from '@tanstack/react-router';

import { rootRoute } from '../root';
import { AccountRoutes } from './index';

const accountRoute = createRoute({
component: AccountRoutes,
getParentRoute: () => rootRoute,
path: 'account',
});

const accountIndexRoute = createRoute({
getParentRoute: () => accountRoute,
path: '/',
}).lazy(() =>
import('src/features/Account/AccountLanding').then(
(m) => m.accountLandingLazyRoute
)
);

const accountBillingRoute = createRoute({
getParentRoute: () => accountRoute,
path: 'billing',
}).lazy(() =>
import('src/features/Account/AccountLanding').then(
(m) => m.accountLandingLazyRoute
)
);

const accountUsersRoute = createRoute({
getParentRoute: () => accountRoute,
path: '/users',
}).lazy(() =>
import('src/features/Account/AccountLanding').then(
(m) => m.accountLandingLazyRoute
)
);

const accountLoginHistoryRoute = createRoute({
getParentRoute: () => accountRoute,
path: '/login-history',
}).lazy(() =>
import('src/features/Account/AccountLanding').then(
(m) => m.accountLandingLazyRoute
)
);

const accountServiceTransfersRoute = createRoute({
getParentRoute: () => accountRoute,
path: '/service-transfers',
}).lazy(() =>
import('src/features/Account/AccountLanding').then(
(m) => m.accountLandingLazyRoute
)
);

const accountMaintenanceRoute = createRoute({
getParentRoute: () => accountRoute,
path: '/maintenance',
}).lazy(() =>
import('src/features/Account/AccountLanding').then(
(m) => m.accountLandingLazyRoute
)
);

const accountSettingsRoute = createRoute({
getParentRoute: () => accountRoute,
path: '/settings',
}).lazy(() =>
import('src/features/Account/AccountLanding').then(
(m) => m.accountLandingLazyRoute
)
);

const accountUsersUsernameRoute = createRoute({
getParentRoute: () => accountRoute,
path: 'users/$username',
}).lazy(() =>
import('src/features/Users/UserDetail').then((m) => m.userDetailLazyRoute)
);

const accountUsersUsernameProfileRoute = createRoute({
getParentRoute: () => accountUsersUsernameRoute,
path: 'profile',
}).lazy(() =>
import('src/features/Users/UserDetail').then((m) => m.userDetailLazyRoute)
);

const accountUsersUsernamePermissionsRoute = createRoute({
getParentRoute: () => accountUsersUsernameRoute,
path: 'permissions',
}).lazy(() =>
import('src/features/Users/UserDetail').then((m) => m.userDetailLazyRoute)
);

const accountBillingMakePaymentRoute = createRoute({
getParentRoute: () => accountRoute,
path: 'billing/make-payment',
}).lazy(() =>
import('src/features/Account/AccountLanding').then(
(m) => m.accountLandingLazyRoute
)
);

const accountBillingPaymentMethodsRoute = createRoute({
getParentRoute: () => accountRoute,
path: 'billing/add-payment-method',
}).lazy(() =>
import('src/features/Account/AccountLanding').then(
(m) => m.accountLandingLazyRoute
)
);

const accountBillingEditRoute = createRoute({
getParentRoute: () => accountRoute,
path: 'billing/edit',
}).lazy(() =>
import('src/features/Account/AccountLanding').then(
(m) => m.accountLandingLazyRoute
)
);

const accountInvoicesInvoiceIdRoute = createRoute({
getParentRoute: () => accountRoute,
parseParams: (params) => ({
invoiceId: Number(params.invoiceId),
}),
path: 'billing/invoices/$invoiceId',
}).lazy(() =>
import('src/features/Billing/InvoiceDetail/InvoiceDetail').then(
(m) => m.invoiceDetailLazyRoute
)
);

const accountEntityTransfersCreateRoute = createRoute({
getParentRoute: () => accountRoute,
path: 'service-transfers/create',
}).lazy(() =>
import(
'src/features/EntityTransfers/EntityTransfersCreate/EntityTransfersCreate'
).then((m) => m.entityTransfersCreateLazyRoute)
);

const accountActivationLandingRoute = createRoute({
getParentRoute: () => rootRoute,
path: 'account-activation',
}).lazy(() =>
import('src/components/AccountActivation/AccountActivationLanding').then(
(m) => m.accountActivationLandingLazyRoute
)
);

export const accountRouteTree = accountRoute.addChildren([
accountIndexRoute,
accountUsersRoute,
accountLoginHistoryRoute,
accountServiceTransfersRoute,
accountMaintenanceRoute,
accountSettingsRoute,
accountUsersUsernameRoute.addChildren([
accountUsersUsernameProfileRoute,
accountUsersUsernamePermissionsRoute,
]),
accountActivationLandingRoute,
accountBillingRoute,
accountBillingMakePaymentRoute,
accountBillingPaymentMethodsRoute,
accountBillingEditRoute,
accountInvoicesInvoiceIdRoute,
accountEntityTransfersCreateRoute,
]);
import { Outlet } from '@tanstack/react-router';
import React from 'react';

import { ProductInformationBanner } from 'src/components/ProductInformationBanner/ProductInformationBanner';
import { SuspenseLoader } from 'src/components/SuspenseLoader';

export const AccountRoute = () => {
return (
<React.Suspense fallback={<SuspenseLoader />}>
<ProductInformationBanner bannerLocation="Account" />
<Outlet />
</React.Suspense>
);
};
171 changes: 171 additions & 0 deletions packages/manager/src/routes/account/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,171 @@
import { createRoute } from '@tanstack/react-router';

import { rootRoute } from '../root';
import { AccountRoute } from './AccountRoute';

const accountRoute = createRoute({
component: AccountRoute,
getParentRoute: () => rootRoute,
path: 'account',
});

const accountIndexRoute = createRoute({
getParentRoute: () => accountRoute,
path: '/',
}).lazy(() =>
import('src/features/Account/AccountLanding').then(
(m) => m.accountLandingLazyRoute
)
);

const accountBillingRoute = createRoute({
getParentRoute: () => accountRoute,
path: 'billing',
}).lazy(() =>
import('src/features/Account/AccountLanding').then(
(m) => m.accountLandingLazyRoute
)
);

const accountUsersRoute = createRoute({
getParentRoute: () => accountRoute,
path: '/users',
}).lazy(() =>
import('src/features/Account/AccountLanding').then(
(m) => m.accountLandingLazyRoute
)
);

const accountLoginHistoryRoute = createRoute({
getParentRoute: () => accountRoute,
path: '/login-history',
}).lazy(() =>
import('src/features/Account/AccountLanding').then(
(m) => m.accountLandingLazyRoute
)
);

const accountServiceTransfersRoute = createRoute({
getParentRoute: () => accountRoute,
path: '/service-transfers',
}).lazy(() =>
import('src/features/Account/AccountLanding').then(
(m) => m.accountLandingLazyRoute
)
);

const accountMaintenanceRoute = createRoute({
getParentRoute: () => accountRoute,
path: '/maintenance',
}).lazy(() =>
import('src/features/Account/AccountLanding').then(
(m) => m.accountLandingLazyRoute
)
);

const accountSettingsRoute = createRoute({
getParentRoute: () => accountRoute,
path: '/settings',
}).lazy(() =>
import('src/features/Account/AccountLanding').then(
(m) => m.accountLandingLazyRoute
)
);

const accountUsersUsernameRoute = createRoute({
getParentRoute: () => accountRoute,
path: 'users/$username',
}).lazy(() =>
import('src/features/Users/UserDetail').then((m) => m.userDetailLazyRoute)
);

const accountUsersUsernameProfileRoute = createRoute({
getParentRoute: () => accountUsersUsernameRoute,
path: 'profile',
}).lazy(() =>
import('src/features/Users/UserDetail').then((m) => m.userDetailLazyRoute)
);

const accountUsersUsernamePermissionsRoute = createRoute({
getParentRoute: () => accountUsersUsernameRoute,
path: 'permissions',
}).lazy(() =>
import('src/features/Users/UserDetail').then((m) => m.userDetailLazyRoute)
);

const accountBillingMakePaymentRoute = createRoute({
getParentRoute: () => accountRoute,
path: 'billing/make-payment',
}).lazy(() =>
import('src/features/Account/AccountLanding').then(
(m) => m.accountLandingLazyRoute
)
);

const accountBillingPaymentMethodsRoute = createRoute({
getParentRoute: () => accountRoute,
path: 'billing/add-payment-method',
}).lazy(() =>
import('src/features/Account/AccountLanding').then(
(m) => m.accountLandingLazyRoute
)
);

const accountBillingEditRoute = createRoute({
getParentRoute: () => accountRoute,
path: 'billing/edit',
}).lazy(() =>
import('src/features/Account/AccountLanding').then(
(m) => m.accountLandingLazyRoute
)
);

const accountInvoicesInvoiceIdRoute = createRoute({
getParentRoute: () => accountRoute,
parseParams: (params) => ({
invoiceId: Number(params.invoiceId),
}),
path: 'billing/invoices/$invoiceId',
}).lazy(() =>
import('src/features/Billing/InvoiceDetail/InvoiceDetail').then(
(m) => m.invoiceDetailLazyRoute
)
);

const accountEntityTransfersCreateRoute = createRoute({
getParentRoute: () => accountRoute,
path: 'service-transfers/create',
}).lazy(() =>
import(
'src/features/EntityTransfers/EntityTransfersCreate/EntityTransfersCreate'
).then((m) => m.entityTransfersCreateLazyRoute)
);

const accountActivationLandingRoute = createRoute({
getParentRoute: () => rootRoute,
path: 'account-activation',
}).lazy(() =>
import('src/components/AccountActivation/AccountActivationLanding').then(
(m) => m.accountActivationLandingLazyRoute
)
);

export const accountRouteTree = accountRoute.addChildren([
accountIndexRoute,
accountUsersRoute,
accountLoginHistoryRoute,
accountServiceTransfersRoute,
accountMaintenanceRoute,
accountSettingsRoute,
accountUsersUsernameRoute.addChildren([
accountUsersUsernameProfileRoute,
accountUsersUsernamePermissionsRoute,
]),
accountActivationLandingRoute,
accountBillingRoute,
accountBillingMakePaymentRoute,
accountBillingPaymentMethodsRoute,
accountBillingEditRoute,
accountInvoicesInvoiceIdRoute,
accountEntityTransfersCreateRoute,
]);
14 changes: 0 additions & 14 deletions packages/manager/src/routes/account/index.tsx

This file was deleted.

2 changes: 1 addition & 1 deletion packages/manager/src/routes/betas/BetasRoute.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import { NotFound } from 'src/components/NotFound';
import { SuspenseLoader } from 'src/components/SuspenseLoader';
import { useFlags } from 'src/hooks/useFlags';

export const BetaRoutes = () => {
export const BetasRoute = () => {
const flags = useFlags();
const { selfServeBetas } = flags;
return (
Expand Down
Loading

0 comments on commit 7f608f9

Please sign in to comment.