From b658eb27283cf448668b543c7b851fd0afe7b068 Mon Sep 17 00:00:00 2001 From: Nate Kelley Date: Thu, 23 Jan 2025 10:54:21 -0700 Subject: [PATCH] reroute to correct link for datasets --- .../DatasetGroupDatasetsListContainer.tsx | 4 ++-- .../PermissionGroupDatasetsListContainer.tsx | 4 ++-- .../datasets/UserDatasetsController.tsx | 5 +---- .../datasets/UserDatasetsListContainer.tsx | 5 ++--- .../UserPermissionGroupsListContainer.tsx | 18 +++++++++--------- 5 files changed, 16 insertions(+), 20 deletions(-) diff --git a/web/src/app/app/settings/dataset-groups/[datasetGroupId]/datasets/DatasetGroupDatasetsListContainer.tsx b/web/src/app/app/settings/dataset-groups/[datasetGroupId]/datasets/DatasetGroupDatasetsListContainer.tsx index 65205dfdc..670fef9cb 100644 --- a/web/src/app/app/settings/dataset-groups/[datasetGroupId]/datasets/DatasetGroupDatasetsListContainer.tsx +++ b/web/src/app/app/settings/dataset-groups/[datasetGroupId]/datasets/DatasetGroupDatasetsListContainer.tsx @@ -72,8 +72,8 @@ export const DatasetGroupDatasetsListContainer: React.FC<{ id: dataset.id, data: dataset, link: createBusterRoute({ - route: BusterRoutes.APP_SETTINGS_USERS_ID, - userId: dataset.id + route: BusterRoutes.APP_DATASETS_ID, + datasetId: dataset.id }) }; if (dataset.assigned) { diff --git a/web/src/app/app/settings/permission-groups/[permissionGroupId]/datasets/PermissionGroupDatasetsListContainer.tsx b/web/src/app/app/settings/permission-groups/[permissionGroupId]/datasets/PermissionGroupDatasetsListContainer.tsx index 399ec7a4b..dabb68ecc 100644 --- a/web/src/app/app/settings/permission-groups/[permissionGroupId]/datasets/PermissionGroupDatasetsListContainer.tsx +++ b/web/src/app/app/settings/permission-groups/[permissionGroupId]/datasets/PermissionGroupDatasetsListContainer.tsx @@ -72,8 +72,8 @@ export const PermissionGroupDatasetsListContainer: React.FC<{ id: dataset.id, data: dataset, link: createBusterRoute({ - route: BusterRoutes.APP_SETTINGS_USERS_ID, - userId: dataset.id + route: BusterRoutes.APP_DATASETS_ID, + datasetId: dataset.id }) }; if (dataset.assigned) { diff --git a/web/src/app/app/settings/users/[userId]/datasets/UserDatasetsController.tsx b/web/src/app/app/settings/users/[userId]/datasets/UserDatasetsController.tsx index 09ed4bfef..0a3d1d447 100644 --- a/web/src/app/app/settings/users/[userId]/datasets/UserDatasetsController.tsx +++ b/web/src/app/app/settings/users/[userId]/datasets/UserDatasetsController.tsx @@ -2,10 +2,7 @@ import { useGetUserDatasets } from '@/api/buster_rest'; import { useDebounceSearch } from '@/hooks'; -import { - NewPermissionGroupModal, - PermissionSearchAndListWrapper -} from '@appComponents/PermissionComponents'; +import { PermissionSearchAndListWrapper } from '@appComponents/PermissionComponents'; import React, { useMemo, useState } from 'react'; import { UserDatasetsListContainer } from './UserDatasetsListContainer'; import { Button } from 'antd'; diff --git a/web/src/app/app/settings/users/[userId]/datasets/UserDatasetsListContainer.tsx b/web/src/app/app/settings/users/[userId]/datasets/UserDatasetsListContainer.tsx index 5f9cb31f1..209f1c597 100644 --- a/web/src/app/app/settings/users/[userId]/datasets/UserDatasetsListContainer.tsx +++ b/web/src/app/app/settings/users/[userId]/datasets/UserDatasetsListContainer.tsx @@ -15,7 +15,6 @@ import { BusterRoutes, createBusterRoute } from '@/routes'; import { useMemoizedFn } from 'ahooks'; import React, { useMemo, useState } from 'react'; import { UserDatasetsSelectedPopup } from './UserDatasetsSelectedPopup'; -import pluralize from 'pluralize'; export const UserDatasetsListContainer: React.FC<{ filteredDatasets: BusterUserDataset[]; @@ -70,8 +69,8 @@ export const UserDatasetsListContainer: React.FC<{ id: dataset.id, data: dataset, link: createBusterRoute({ - route: BusterRoutes.APP_SETTINGS_USERS_ID, - userId: dataset.id + route: BusterRoutes.APP_DATASETS_ID, + datasetId: dataset.id }) }; if (dataset.assigned) { diff --git a/web/src/app/app/settings/users/[userId]/permission-groups/UserPermissionGroupsListContainer.tsx b/web/src/app/app/settings/users/[userId]/permission-groups/UserPermissionGroupsListContainer.tsx index be7b66ddd..58136ff6f 100644 --- a/web/src/app/app/settings/users/[userId]/permission-groups/UserPermissionGroupsListContainer.tsx +++ b/web/src/app/app/settings/users/[userId]/permission-groups/UserPermissionGroupsListContainer.tsx @@ -70,19 +70,19 @@ export const UserPermissionGroupsListContainer: React.FC<{ cannotQueryPermissionUsers: BusterListRowItem[]; canQueryPermissionUsers: BusterListRowItem[]; }>( - (acc, permissionUser) => { - const user: BusterListRowItem = { - id: permissionUser.id, - data: permissionUser, + (acc, permissionGroup) => { + const permissionGroupItem: BusterListRowItem = { + id: permissionGroup.id, + data: permissionGroup, link: createBusterRoute({ - route: BusterRoutes.APP_SETTINGS_USERS_ID, - userId: permissionUser.id + route: BusterRoutes.SETTINGS_PERMISSION_GROUPS_ID_DATASETS, + permissionGroupId: permissionGroup.id }) }; - if (permissionUser.assigned) { - acc.canQueryPermissionUsers.push(user); + if (permissionGroup.assigned) { + acc.canQueryPermissionUsers.push(permissionGroupItem); } else { - acc.cannotQueryPermissionUsers.push(user); + acc.cannotQueryPermissionUsers.push(permissionGroupItem); } return acc; },