From a0355afb84ed69ccd80d3619fc9ae61c1a02bd53 Mon Sep 17 00:00:00 2001 From: Nate Kelley Date: Fri, 28 Feb 2025 16:01:31 -0700 Subject: [PATCH] update routing --- .../api/buster_socket/user/userRequests.ts | 24 ----- .../api/buster_socket/user/userResponses.ts | 9 -- .../api/request_interfaces/user/interfaces.ts | 13 --- .../app/app/(chat_experience)/home/page.tsx | 5 + web/src/app/app/(settings_layout)/layout.tsx | 4 +- .../settings/(permissions)/layout.tsx | 2 +- .../ListPermissionGroupsComponent.tsx | 2 +- .../PermissionAppSegments.tsx | 12 +-- .../PermissionBackButton.tsx | 3 +- .../UserPermissionGroupsListContainer.tsx | 2 +- .../(restricted-width)/billing/page.tsx | 2 +- .../[datasourceId]/_DatasourceFormContent.tsx | 2 +- .../[datasourceId]/page.tsx | 2 +- .../(admin-restricted-space)/add/page.tsx | 2 +- .../(admin-restricted-space)/layout.tsx | 2 +- .../datasources/_DatasourceList.tsx | 6 +- .../(restricted-width)/general/page.tsx | 12 --- .../settings/(restricted-width)/team/page.tsx | 2 +- .../app/(settings_layout)/settings/page.tsx | 2 +- web/src/app/app/layout.tsx | 2 - .../features/modal/NewDatasetModal.tsx | 2 +- .../features/sidebars/SidebarPrimary.tsx | 4 +- .../features/sidebars/SidebarSettings.tsx | 36 ++++++-- .../ui/breadcrumb/Breadcrumb.stories.tsx | 2 +- .../components/ui/sidebar/Sidebar.stories.tsx | 10 +- .../ui/sidebar/SidebarCollapsible.tsx | 10 +- .../BusterReactQueryAndApi.tsx | 2 +- .../useDatasourceCreate.ts | 2 +- web/src/context/RoutePrefetcher.tsx | 1 - web/src/controllers/AppSidebar/AppSidebar.tsx | 2 +- .../AppSidebar/AppSidebarSettings.tsx | 48 +++++----- .../AppSidebar/AppSidebarTopItems.tsx | 2 +- .../controllers/Sidebars/SettingsSidebar.tsx | 7 -- .../routes/busterRoutes/busterAppRoutes.ts | 91 ++++++++++--------- 34 files changed, 143 insertions(+), 186 deletions(-) create mode 100644 web/src/app/app/(chat_experience)/home/page.tsx delete mode 100644 web/src/app/app/(settings_layout)/settings/(restricted-width)/general/page.tsx delete mode 100644 web/src/controllers/Sidebars/SettingsSidebar.tsx diff --git a/web/src/api/buster_socket/user/userRequests.ts b/web/src/api/buster_socket/user/userRequests.ts index 91dd3074a..0c8964612 100644 --- a/web/src/api/buster_socket/user/userRequests.ts +++ b/web/src/api/buster_socket/user/userRequests.ts @@ -1,31 +1,11 @@ import type { BusterSocketRequestBase } from '../base_interfaces'; import type { - UserColorsCreatePayload, - UserColorsUpdatePayload, - UserColorsDeletePayload, UsersFavoritePostPayload, UserFavoriteDeletePayload, UserUpdateFavoritesPayload, UserRequestUserListPayload } from '@/api/request_interfaces/user/interfaces'; -export type UserColorsList = BusterSocketRequestBase<'/users/colors/list', {}>; - -export type UserColorsCreate = BusterSocketRequestBase< - '/users/colors/post', - UserColorsCreatePayload ->; - -export type UserColorsUpdate = BusterSocketRequestBase< - '/users/colors/update', - UserColorsUpdatePayload ->; - -export type UserColorsDelete = BusterSocketRequestBase< - '/users/colors/delete', - UserColorsDeletePayload ->; - export type UsersFavoritePost = BusterSocketRequestBase< '/users/favorites/post', UsersFavoritePostPayload @@ -49,10 +29,6 @@ export type UserRequestUserList = BusterSocketRequestBase< >; export type UserEmits = - | UserColorsList - | UserColorsCreate - | UserColorsUpdate - | UserColorsDelete | UsersFavoritePost | UsersFavoriteList | UserFavoriteDelete diff --git a/web/src/api/buster_socket/user/userResponses.ts b/web/src/api/buster_socket/user/userResponses.ts index a5a30cac9..8a3fca3d1 100644 --- a/web/src/api/buster_socket/user/userResponses.ts +++ b/web/src/api/buster_socket/user/userResponses.ts @@ -6,8 +6,6 @@ import type { } from '@/api/asset_interfaces'; export enum UserResponses { - '/users/colors/list:listUserColorPalettes' = '/users/colors/list:listUserColorPalettes', - '/users/colors/post:createUserColorPalette' = '/users/colors/post:createUserColorPalette', '/users/favorites/list:listFavorites' = '/users/favorites/list:listFavorites', '/users/favorites/post:createFavorite' = '/users/favorites/post:createFavorite', '/users/get:getUser' = '/users/get:getUser', @@ -16,12 +14,6 @@ export enum UserResponses { '/users/list:listUsers' = '/users/list:listUsers' } -export type UserColorsList_listUserColorPalettes = { - route: '/users/colors/list:listUserColorPalettes'; - callback: (d: BusterUserPalette[]) => void; - onError?: (d: unknown) => void; -}; - export type UserColorsPost_createUserColorPalette = { route: '/users/colors/post:createUserColorPalette'; callback: (d: BusterUserPalette[]) => void; @@ -59,7 +51,6 @@ export type UserList_getUserList = { }; export type UserResponsesTypes = - | UserColorsList_listUserColorPalettes | UserColorsPost_createUserColorPalette | UserFavoriteList_listFavorites | UserFavoritesPost_createFavorite diff --git a/web/src/api/request_interfaces/user/interfaces.ts b/web/src/api/request_interfaces/user/interfaces.ts index 1acafec59..5c28ff6b8 100644 --- a/web/src/api/request_interfaces/user/interfaces.ts +++ b/web/src/api/request_interfaces/user/interfaces.ts @@ -1,18 +1,5 @@ import type { ShareAssetType } from '@/api/asset_interfaces'; -export interface UserColorsCreatePayload { - color_palette: string[]; -} - -export interface UserColorsUpdatePayload { - id: string; - color_palette: string[]; -} - -export interface UserColorsDeletePayload { - id: string; -} - export interface UsersFavoritePostPayload { id: string; asset_type: ShareAssetType; diff --git a/web/src/app/app/(chat_experience)/home/page.tsx b/web/src/app/app/(chat_experience)/home/page.tsx new file mode 100644 index 000000000..f9618f18c --- /dev/null +++ b/web/src/app/app/(chat_experience)/home/page.tsx @@ -0,0 +1,5 @@ +import React from 'react'; + +export default function HomePage() { + return
HomePage TODO:
; +} diff --git a/web/src/app/app/(settings_layout)/layout.tsx b/web/src/app/app/(settings_layout)/layout.tsx index 2c625aecf..a72cdf90a 100644 --- a/web/src/app/app/(settings_layout)/layout.tsx +++ b/web/src/app/app/(settings_layout)/layout.tsx @@ -1,13 +1,13 @@ import { AppLayout } from '@/components/ui/layouts/AppLayout'; import { getAppSplitterLayout } from '@/components/ui/layouts/AppSplitter'; -import { SettingsSidebar } from '@/controllers/Sidebars/SettingsSidebar'; +import { SidebarSettings } from '@/components/features/sidebars/SidebarSettings'; import React from 'react'; export default async function Layout({ children }: { children: React.ReactNode }) { const defaultLayout = await getAppSplitterLayout('app-layout', ['230px', 'auto']); return ( - }> + }> {children} ); diff --git a/web/src/app/app/(settings_layout)/settings/(permissions)/layout.tsx b/web/src/app/app/(settings_layout)/settings/(permissions)/layout.tsx index cb59f4c20..60b7c5f22 100644 --- a/web/src/app/app/(settings_layout)/settings/(permissions)/layout.tsx +++ b/web/src/app/app/(settings_layout)/settings/(permissions)/layout.tsx @@ -9,7 +9,7 @@ export default async function Layout({ children }: { children: React.ReactNode } if (!isAdmin) { return redirect( createBusterRoute({ - route: BusterRoutes.SETTINGS_GENERAL + route: BusterRoutes.APP_SETTINGS_PROFILE }) ); } diff --git a/web/src/app/app/(settings_layout)/settings/(permissions)/permission-groups/ListPermissionGroupsComponent.tsx b/web/src/app/app/(settings_layout)/settings/(permissions)/permission-groups/ListPermissionGroupsComponent.tsx index 249eaa22a..e1abd92a1 100644 --- a/web/src/app/app/(settings_layout)/settings/(permissions)/permission-groups/ListPermissionGroupsComponent.tsx +++ b/web/src/app/app/(settings_layout)/settings/(permissions)/permission-groups/ListPermissionGroupsComponent.tsx @@ -29,7 +29,7 @@ export const ListPermissionGroupsComponent: React.FC<{ id: permissionGroup.id, data: permissionGroup, link: createBusterRoute({ - route: BusterRoutes.SETTINGS_PERMISSION_GROUPS_ID_USERS, + route: BusterRoutes.APP_SETTINGS_PERMISSION_GROUPS_ID_USERS, permissionGroupId: permissionGroup.id }) }; diff --git a/web/src/app/app/(settings_layout)/settings/(permissions)/permission-groups/[permissionGroupId]/_PermissionGroupIndividualLayout/PermissionAppSegments.tsx b/web/src/app/app/(settings_layout)/settings/(permissions)/permission-groups/[permissionGroupId]/_PermissionGroupIndividualLayout/PermissionAppSegments.tsx index c4c47e683..dae8212d4 100644 --- a/web/src/app/app/(settings_layout)/settings/(permissions)/permission-groups/[permissionGroupId]/_PermissionGroupIndividualLayout/PermissionAppSegments.tsx +++ b/web/src/app/app/(settings_layout)/settings/(permissions)/permission-groups/[permissionGroupId]/_PermissionGroupIndividualLayout/PermissionAppSegments.tsx @@ -14,10 +14,10 @@ export enum PermissionSegmentsApps { } const RouteToAppSegment: Record = { - [BusterRoutes.SETTINGS_PERMISSION_GROUPS_ID_USERS]: PermissionSegmentsApps.USERS, - [BusterRoutes.SETTINGS_PERMISSION_GROUPS_ID_DATASET_GROUPS]: + [BusterRoutes.APP_SETTINGS_PERMISSION_GROUPS_ID_USERS]: PermissionSegmentsApps.USERS, + [BusterRoutes.APP_SETTINGS_PERMISSION_GROUPS_ID_DATASET_GROUPS]: PermissionSegmentsApps.DATASET_GROUPS, - [BusterRoutes.SETTINGS_PERMISSION_GROUPS_ID_DATASETS]: PermissionSegmentsApps.DATASETS + [BusterRoutes.APP_SETTINGS_PERMISSION_GROUPS_ID_DATASETS]: PermissionSegmentsApps.DATASETS }; export const PermissionAppSegments: React.FC<{ @@ -33,7 +33,7 @@ export const PermissionAppSegments: React.FC<{ label: 'Users', value: PermissionSegmentsApps.USERS, link: createBusterRoute({ - route: BusterRoutes.SETTINGS_PERMISSION_GROUPS_ID_USERS, + route: BusterRoutes.APP_SETTINGS_PERMISSION_GROUPS_ID_USERS, permissionGroupId }) }, @@ -41,7 +41,7 @@ export const PermissionAppSegments: React.FC<{ label: 'Dataset groups', value: PermissionSegmentsApps.DATASET_GROUPS, link: createBusterRoute({ - route: BusterRoutes.SETTINGS_PERMISSION_GROUPS_ID_DATASET_GROUPS, + route: BusterRoutes.APP_SETTINGS_PERMISSION_GROUPS_ID_DATASET_GROUPS, permissionGroupId }) }, @@ -49,7 +49,7 @@ export const PermissionAppSegments: React.FC<{ label: 'Datasets', value: PermissionSegmentsApps.DATASETS, link: createBusterRoute({ - route: BusterRoutes.SETTINGS_PERMISSION_GROUPS_ID_DATASETS, + route: BusterRoutes.APP_SETTINGS_PERMISSION_GROUPS_ID_DATASETS, permissionGroupId }) } diff --git a/web/src/app/app/(settings_layout)/settings/(permissions)/permission-groups/[permissionGroupId]/_PermissionGroupIndividualLayout/PermissionBackButton.tsx b/web/src/app/app/(settings_layout)/settings/(permissions)/permission-groups/[permissionGroupId]/_PermissionGroupIndividualLayout/PermissionBackButton.tsx index c3d96ad3c..8a5ee166b 100644 --- a/web/src/app/app/(settings_layout)/settings/(permissions)/permission-groups/[permissionGroupId]/_PermissionGroupIndividualLayout/PermissionBackButton.tsx +++ b/web/src/app/app/(settings_layout)/settings/(permissions)/permission-groups/[permissionGroupId]/_PermissionGroupIndividualLayout/PermissionBackButton.tsx @@ -2,8 +2,7 @@ import { BackButton } from '@/components/ui/buttons/BackButton'; import { createBusterRoute, BusterRoutes } from '@/routes/busterRoutes'; export const PermissionGroupBackButton = ({}: {}) => { - const route = createBusterRoute({ route: BusterRoutes.SETTINGS_PERMISSION_GROUPS }); + const route = createBusterRoute({ route: BusterRoutes.APP_SETTINGS_PERMISSION_GROUPS }); const text = 'Permission groups'; - return ; }; diff --git a/web/src/app/app/(settings_layout)/settings/(permissions)/users/[userId]/permission-groups/UserPermissionGroupsListContainer.tsx b/web/src/app/app/(settings_layout)/settings/(permissions)/users/[userId]/permission-groups/UserPermissionGroupsListContainer.tsx index 1b75b1849..76e3203cb 100644 --- a/web/src/app/app/(settings_layout)/settings/(permissions)/users/[userId]/permission-groups/UserPermissionGroupsListContainer.tsx +++ b/web/src/app/app/(settings_layout)/settings/(permissions)/users/[userId]/permission-groups/UserPermissionGroupsListContainer.tsx @@ -72,7 +72,7 @@ export const UserPermissionGroupsListContainer: React.FC<{ id: permissionGroup.id, data: permissionGroup, link: createBusterRoute({ - route: BusterRoutes.SETTINGS_PERMISSION_GROUPS_ID_DATASETS, + route: BusterRoutes.APP_SETTINGS_PERMISSION_GROUPS_ID_DATASETS, permissionGroupId: permissionGroup.id }) }; diff --git a/web/src/app/app/(settings_layout)/settings/(restricted-width)/billing/page.tsx b/web/src/app/app/(settings_layout)/settings/(restricted-width)/billing/page.tsx index 895092e59..f203405e1 100644 --- a/web/src/app/app/(settings_layout)/settings/(restricted-width)/billing/page.tsx +++ b/web/src/app/app/(settings_layout)/settings/(restricted-width)/billing/page.tsx @@ -10,7 +10,7 @@ export default async function Page() { if (!isAdmin) { return redirect( createBusterRoute({ - route: BusterRoutes.SETTINGS_GENERAL + route: BusterRoutes.APP_SETTINGS_PROFILE }) ); } diff --git a/web/src/app/app/(settings_layout)/settings/(restricted-width)/datasources/(admin-restricted-space)/[datasourceId]/_DatasourceFormContent.tsx b/web/src/app/app/(settings_layout)/settings/(restricted-width)/datasources/(admin-restricted-space)/[datasourceId]/_DatasourceFormContent.tsx index dcc032501..8809b9f73 100644 --- a/web/src/app/app/(settings_layout)/settings/(restricted-width)/datasources/(admin-restricted-space)/[datasourceId]/_DatasourceFormContent.tsx +++ b/web/src/app/app/(settings_layout)/settings/(restricted-width)/datasources/(admin-restricted-space)/[datasourceId]/_DatasourceFormContent.tsx @@ -82,7 +82,7 @@ export const DataSourceFormContent: React.FC<{ content: 'You can now use this data source to create data sets.', onOk: () => { onChangePage({ - route: BusterRoutes.SETTINGS_DATASOURCES_ID, + route: BusterRoutes.APP_SETTINGS_DATASOURCES_ID, datasourceId: res.id }); }, diff --git a/web/src/app/app/(settings_layout)/settings/(restricted-width)/datasources/(admin-restricted-space)/[datasourceId]/page.tsx b/web/src/app/app/(settings_layout)/settings/(restricted-width)/datasources/(admin-restricted-space)/[datasourceId]/page.tsx index 6ef833dbd..a287ed7ef 100644 --- a/web/src/app/app/(settings_layout)/settings/(restricted-width)/datasources/(admin-restricted-space)/[datasourceId]/page.tsx +++ b/web/src/app/app/(settings_layout)/settings/(restricted-width)/datasources/(admin-restricted-space)/[datasourceId]/page.tsx @@ -14,7 +14,7 @@ export default function Page({ diff --git a/web/src/app/app/(settings_layout)/settings/(restricted-width)/datasources/(admin-restricted-space)/add/page.tsx b/web/src/app/app/(settings_layout)/settings/(restricted-width)/datasources/(admin-restricted-space)/add/page.tsx index 54b610405..4a5fe0d3f 100644 --- a/web/src/app/app/(settings_layout)/settings/(restricted-width)/datasources/(admin-restricted-space)/add/page.tsx +++ b/web/src/app/app/(settings_layout)/settings/(restricted-width)/datasources/(admin-restricted-space)/add/page.tsx @@ -20,7 +20,7 @@ export default function Page() { const linkUrl = selectedDataSource ? '' : createBusterRoute({ - route: BusterRoutes.SETTINGS_DATASOURCES + route: BusterRoutes.APP_SETTINGS_DATASOURCES }); return ( diff --git a/web/src/app/app/(settings_layout)/settings/(restricted-width)/datasources/(admin-restricted-space)/layout.tsx b/web/src/app/app/(settings_layout)/settings/(restricted-width)/datasources/(admin-restricted-space)/layout.tsx index be78d35e0..f41b1b9ed 100644 --- a/web/src/app/app/(settings_layout)/settings/(restricted-width)/datasources/(admin-restricted-space)/layout.tsx +++ b/web/src/app/app/(settings_layout)/settings/(restricted-width)/datasources/(admin-restricted-space)/layout.tsx @@ -9,7 +9,7 @@ export default function Layout({ children }: { children: React.ReactNode }) { if (!isAdmin) { return redirect( createBusterRoute({ - route: BusterRoutes.SETTINGS_DATASOURCES + route: BusterRoutes.APP_SETTINGS_DATASOURCES }) ); } diff --git a/web/src/app/app/(settings_layout)/settings/(restricted-width)/datasources/_DatasourceList.tsx b/web/src/app/app/(settings_layout)/settings/(restricted-width)/datasources/_DatasourceList.tsx index facd037f3..07e443084 100644 --- a/web/src/app/app/(settings_layout)/settings/(restricted-width)/datasources/_DatasourceList.tsx +++ b/web/src/app/app/(settings_layout)/settings/(restricted-width)/datasources/_DatasourceList.tsx @@ -47,7 +47,7 @@ export const DatasourceList: React.FC = () => { buttonIcon={} buttonAction={() => onChangePage({ - route: BusterRoutes.SETTINGS_DATASOURCES_ADD + route: BusterRoutes.APP_SETTINGS_DATASOURCES_ADD }) } /> @@ -62,7 +62,7 @@ const AddSourceHeader: React.FC<{ isAdmin: boolean }> = ({ isAdmin }) => { Your data sources {isAdmin && (