diff --git a/web/src/api/buster_rest/datasource/queryRequests.ts b/web/src/api/buster_rest/datasource/queryRequests.ts index a53602118..85c3116f6 100644 --- a/web/src/api/buster_rest/datasource/queryRequests.ts +++ b/web/src/api/buster_rest/datasource/queryRequests.ts @@ -9,10 +9,11 @@ import { import { queryKeys } from '@/api/query_keys'; import { useBusterNotifications } from '@/context/BusterNotifications'; -export const useListDatasources = () => { +export const useListDatasources = (enabled: boolean) => { return useQuery({ ...queryKeys.datasourceGetList, - queryFn: listDatasources + queryFn: listDatasources, + enabled }); }; diff --git a/web/src/app/app/(primary_layout)/datasets/[datasetId]/permissions/dataset-groups/_PermissionDatasetGroups/PermissionListDatasetGroupContainer.tsx b/web/src/app/app/(primary_layout)/datasets/[datasetId]/permissions/dataset-groups/_PermissionDatasetGroups/PermissionListDatasetGroupContainer.tsx index 4deb026f3..21816410c 100644 --- a/web/src/app/app/(primary_layout)/datasets/[datasetId]/permissions/dataset-groups/_PermissionDatasetGroups/PermissionListDatasetGroupContainer.tsx +++ b/web/src/app/app/(primary_layout)/datasets/[datasetId]/permissions/dataset-groups/_PermissionDatasetGroups/PermissionListDatasetGroupContainer.tsx @@ -100,7 +100,7 @@ export const PermissionListDatasetGroupContainer: React.FC<{ data: {}, hidden: cannotQueryPermissionGroups.length === 0, rowSection: { - title: 'Not Assigned', + title: 'Not assigned', secondaryTitle: cannotQueryPermissionGroups.length.toString() } }, diff --git a/web/src/app/app/(primary_layout)/datasets/[datasetId]/permissions/overview/_PermissionOverview/PermissionListUserContainer.tsx b/web/src/app/app/(primary_layout)/datasets/[datasetId]/permissions/overview/_PermissionOverview/PermissionListUserContainer.tsx index 6af22d253..e225a722e 100644 --- a/web/src/app/app/(primary_layout)/datasets/[datasetId]/permissions/overview/_PermissionOverview/PermissionListUserContainer.tsx +++ b/web/src/app/app/(primary_layout)/datasets/[datasetId]/permissions/overview/_PermissionOverview/PermissionListUserContainer.tsx @@ -87,7 +87,7 @@ export const PermissionListUserContainer: React.FC<{ data: {}, hidden: cannotQueryUsers.length === 0, rowSection: { - title: 'Not Assigned', + title: 'Not assigned', secondaryTitle: cannotQueryUsers.length.toString() } }, diff --git a/web/src/app/app/(primary_layout)/datasets/[datasetId]/permissions/permission-groups/_PermissionPermissionGroup/PermissionListPermissionGroupContainer.tsx b/web/src/app/app/(primary_layout)/datasets/[datasetId]/permissions/permission-groups/_PermissionPermissionGroup/PermissionListPermissionGroupContainer.tsx index 41ca42fcf..ad52a0fbc 100644 --- a/web/src/app/app/(primary_layout)/datasets/[datasetId]/permissions/permission-groups/_PermissionPermissionGroup/PermissionListPermissionGroupContainer.tsx +++ b/web/src/app/app/(primary_layout)/datasets/[datasetId]/permissions/permission-groups/_PermissionPermissionGroup/PermissionListPermissionGroupContainer.tsx @@ -98,7 +98,7 @@ export const PermissionListPermissionGroupContainer: React.FC<{ data: {}, hidden: cannotQueryPermissionGroups.length === 0, rowSection: { - title: 'Not Assigned', + title: 'Not assigned', secondaryTitle: cannotQueryPermissionGroups.length.toString() } }, diff --git a/web/src/app/app/(settings_layout)/settings/(permissions)/dataset-groups/[datasetGroupId]/datasets/DatasetGroupDatasetsListContainer.tsx b/web/src/app/app/(settings_layout)/settings/(permissions)/dataset-groups/[datasetGroupId]/datasets/DatasetGroupDatasetsListContainer.tsx index 0be228fe9..af5b743fb 100644 --- a/web/src/app/app/(settings_layout)/settings/(permissions)/dataset-groups/[datasetGroupId]/datasets/DatasetGroupDatasetsListContainer.tsx +++ b/web/src/app/app/(settings_layout)/settings/(permissions)/dataset-groups/[datasetGroupId]/datasets/DatasetGroupDatasetsListContainer.tsx @@ -108,7 +108,7 @@ export const DatasetGroupDatasetsListContainer: React.FC<{ data: {}, hidden: cannotQueryPermissionUsers.length === 0, rowSection: { - title: 'Not Assigned', + title: 'Not assigned', secondaryTitle: cannotQueryPermissionUsers.length.toString() } }, diff --git a/web/src/app/app/(settings_layout)/settings/(permissions)/dataset-groups/[datasetGroupId]/permission-groups/DatasetGroupDatasetsListContainer.tsx b/web/src/app/app/(settings_layout)/settings/(permissions)/dataset-groups/[datasetGroupId]/permission-groups/DatasetGroupDatasetsListContainer.tsx index 5cea2ecc6..e33fba976 100644 --- a/web/src/app/app/(settings_layout)/settings/(permissions)/dataset-groups/[datasetGroupId]/permission-groups/DatasetGroupDatasetsListContainer.tsx +++ b/web/src/app/app/(settings_layout)/settings/(permissions)/dataset-groups/[datasetGroupId]/permission-groups/DatasetGroupDatasetsListContainer.tsx @@ -108,7 +108,7 @@ export const DatasetGroupDatasetGroupsListContainer: React.FC<{ data: {}, hidden: cannotQueryPermissionDatasetGroups.length === 0, rowSection: { - title: 'Not Assigned', + title: 'Not assigned', secondaryTitle: cannotQueryPermissionDatasetGroups.length.toString() } }, diff --git a/web/src/app/app/(settings_layout)/settings/(permissions)/dataset-groups/[datasetGroupId]/users/DatasetGroupUsersListContainer.tsx b/web/src/app/app/(settings_layout)/settings/(permissions)/dataset-groups/[datasetGroupId]/users/DatasetGroupUsersListContainer.tsx index 61b2f9bd7..ebf780710 100644 --- a/web/src/app/app/(settings_layout)/settings/(permissions)/dataset-groups/[datasetGroupId]/users/DatasetGroupUsersListContainer.tsx +++ b/web/src/app/app/(settings_layout)/settings/(permissions)/dataset-groups/[datasetGroupId]/users/DatasetGroupUsersListContainer.tsx @@ -112,7 +112,7 @@ export const DatasetGroupUsersListContainer: React.FC<{ data: {}, hidden: cannotQueryPermissionUsers.length === 0, rowSection: { - title: 'Not Assigned', + title: 'Not assigned', secondaryTitle: cannotQueryPermissionUsers.length.toString() } }, diff --git a/web/src/app/app/(settings_layout)/settings/(permissions)/permission-groups/[permissionGroupId]/dataset-groups/_PermissionGroupDatasetGroupsController/PermissionGroupDatasetsListContainer.tsx b/web/src/app/app/(settings_layout)/settings/(permissions)/permission-groups/[permissionGroupId]/dataset-groups/_PermissionGroupDatasetGroupsController/PermissionGroupDatasetsListContainer.tsx index 421f22f9f..66988a137 100644 --- a/web/src/app/app/(settings_layout)/settings/(permissions)/permission-groups/[permissionGroupId]/dataset-groups/_PermissionGroupDatasetGroupsController/PermissionGroupDatasetsListContainer.tsx +++ b/web/src/app/app/(settings_layout)/settings/(permissions)/permission-groups/[permissionGroupId]/dataset-groups/_PermissionGroupDatasetGroupsController/PermissionGroupDatasetsListContainer.tsx @@ -103,7 +103,7 @@ export const PermissionGroupDatasetGroupsListContainer: React.FC<{ data: {}, hidden: cannotQueryPermissionDatasetGroups.length === 0, rowSection: { - title: 'Not Assigned', + title: 'Not assigned', secondaryTitle: cannotQueryPermissionDatasetGroups.length.toString() } }, diff --git a/web/src/app/app/(settings_layout)/settings/(permissions)/permission-groups/[permissionGroupId]/datasets/_PermissionGroupDatasetsController/PermissionGroupDatasetsListContainer.tsx b/web/src/app/app/(settings_layout)/settings/(permissions)/permission-groups/[permissionGroupId]/datasets/_PermissionGroupDatasetsController/PermissionGroupDatasetsListContainer.tsx index 7a9a4ed5b..fa6d7b04b 100644 --- a/web/src/app/app/(settings_layout)/settings/(permissions)/permission-groups/[permissionGroupId]/datasets/_PermissionGroupDatasetsController/PermissionGroupDatasetsListContainer.tsx +++ b/web/src/app/app/(settings_layout)/settings/(permissions)/permission-groups/[permissionGroupId]/datasets/_PermissionGroupDatasetsController/PermissionGroupDatasetsListContainer.tsx @@ -108,7 +108,7 @@ export const PermissionGroupDatasetsListContainer: React.FC<{ data: {}, hidden: cannotQueryPermissionUsers.length === 0, rowSection: { - title: 'Not Assigned', + title: 'Not assigned', secondaryTitle: cannotQueryPermissionUsers.length.toString() } }, diff --git a/web/src/app/app/(settings_layout)/settings/(permissions)/permission-groups/[permissionGroupId]/users/_PermissionGroupUsersController/PermissionGroupUsersListContainer.tsx b/web/src/app/app/(settings_layout)/settings/(permissions)/permission-groups/[permissionGroupId]/users/_PermissionGroupUsersController/PermissionGroupUsersListContainer.tsx index 7d993fa39..dd1f4ce0a 100644 --- a/web/src/app/app/(settings_layout)/settings/(permissions)/permission-groups/[permissionGroupId]/users/_PermissionGroupUsersController/PermissionGroupUsersListContainer.tsx +++ b/web/src/app/app/(settings_layout)/settings/(permissions)/permission-groups/[permissionGroupId]/users/_PermissionGroupUsersController/PermissionGroupUsersListContainer.tsx @@ -107,7 +107,7 @@ export const PermissionGroupUsersListContainer: React.FC<{ data: {}, hidden: cannotQueryPermissionUsers.length === 0, rowSection: { - title: 'Not Assigned', + title: 'Not assigned', secondaryTitle: cannotQueryPermissionUsers.length.toString() } }, diff --git a/web/src/app/app/(settings_layout)/settings/(permissions)/users/[userId]/dataset-groups/UserDatasetGroupListContainer.tsx b/web/src/app/app/(settings_layout)/settings/(permissions)/users/[userId]/dataset-groups/UserDatasetGroupListContainer.tsx index 00388afa1..5e4748959 100644 --- a/web/src/app/app/(settings_layout)/settings/(permissions)/users/[userId]/dataset-groups/UserDatasetGroupListContainer.tsx +++ b/web/src/app/app/(settings_layout)/settings/(permissions)/users/[userId]/dataset-groups/UserDatasetGroupListContainer.tsx @@ -109,7 +109,7 @@ export const UserDatasetGroupListContainer: React.FC<{ data: {}, hidden: cannotQueryPermissionUsers.length === 0, rowSection: { - title: 'Not Assigned', + title: 'Not assigned', secondaryTitle: cannotQueryPermissionUsers.length.toString() } }, diff --git a/web/src/app/app/(settings_layout)/settings/(permissions)/users/[userId]/datasets/UserDatasetsListContainer.tsx b/web/src/app/app/(settings_layout)/settings/(permissions)/users/[userId]/datasets/UserDatasetsListContainer.tsx index 2b3a05479..2081eb98f 100644 --- a/web/src/app/app/(settings_layout)/settings/(permissions)/users/[userId]/datasets/UserDatasetsListContainer.tsx +++ b/web/src/app/app/(settings_layout)/settings/(permissions)/users/[userId]/datasets/UserDatasetsListContainer.tsx @@ -104,7 +104,7 @@ export const UserDatasetsListContainer: React.FC<{ data: {}, hidden: cannotQueryPermissionUsers.length === 0, rowSection: { - title: 'Not Assigned', + title: 'Not assigned', secondaryTitle: cannotQueryPermissionUsers.length.toString() } }, 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 6be8df02e..9c90ec8f0 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 @@ -110,7 +110,7 @@ export const UserPermissionGroupsListContainer: React.FC<{ data: {}, hidden: cannotQueryPermissionUsers.length === 0, rowSection: { - title: 'Not Assigned', + title: 'Not assigned', secondaryTitle: cannotQueryPermissionUsers.length.toString() } }, diff --git a/web/src/components/features/PermissionComponents/PermissionAssignedCell.tsx b/web/src/components/features/PermissionComponents/PermissionAssignedCell.tsx index 02f8e317f..0be2b12a4 100644 --- a/web/src/components/features/PermissionComponents/PermissionAssignedCell.tsx +++ b/web/src/components/features/PermissionComponents/PermissionAssignedCell.tsx @@ -18,7 +18,7 @@ export const PERMISSION_OPTIONS_ASSIGNED: SelectItem<'true' | 'false'>[] = [ value: 'true' }, { - label: 'Not Assigned', + label: 'Not assigned', value: 'false' } ]; diff --git a/web/src/components/features/modal/NewDatasetModal.tsx b/web/src/components/features/modal/NewDatasetModal.tsx index 7f997e620..dddd8f574 100644 --- a/web/src/components/features/modal/NewDatasetModal.tsx +++ b/web/src/components/features/modal/NewDatasetModal.tsx @@ -27,7 +27,7 @@ export const NewDatasetModal: React.FC<{ const [selectedDatasource, setSelectedDatasource] = React.useState( datasourceId || null ); - const { refetch: refetchDatasourcesList } = useListDatasources(); + const { refetch: refetchDatasourcesList } = useListDatasources(open); const [datasetName, setDatasetName] = React.useState(''); const disableSubmit = !selectedDatasource || !datasetName; @@ -109,7 +109,7 @@ const SelectDataSourceDropdown: React.FC<{ selectedDatasource: string | null; }> = React.memo(({ setSelectedDatasource, selectedDatasource }) => { const router = useRouter(); - const { data: dataSourcesList } = useListDatasources(); + const { data: dataSourcesList } = useListDatasources(false); const selectOptions: SelectItem[] = useMemo(() => { return (dataSourcesList || []).map((dataSource) => ({ diff --git a/web/src/components/ui/select/Select.tsx b/web/src/components/ui/select/Select.tsx index ac3ed429d..84aec22bd 100644 --- a/web/src/components/ui/select/Select.tsx +++ b/web/src/components/ui/select/Select.tsx @@ -57,7 +57,8 @@ export const Select = ({ disabled={disabled} onOpenChange={onOpenChange} open={open} - value={value || defaultValue} + defaultValue={defaultValue} + value={value} onValueChange={onValueChange}> diff --git a/web/src/components/ui/select/SelectBase.tsx b/web/src/components/ui/select/SelectBase.tsx index 103ac6297..6ac204c4a 100644 --- a/web/src/components/ui/select/SelectBase.tsx +++ b/web/src/components/ui/select/SelectBase.tsx @@ -17,8 +17,7 @@ export const selectVariants = cva( { variants: { variant: { - default: - 'border-border shadow bg-background data-[placeholder]:text-gray-light hover:border-gray-light', + default: 'border-border shadow bg-background data-[placeholder]:text-gray-light ', ghost: 'border-none bg-transparent shadow-none disabled:bg-transparent outline-none' }, size: { @@ -45,7 +44,7 @@ const SelectTrigger = React.forwardRef< {...props}> {children} -
+
@@ -61,7 +60,7 @@ const SelectScrollUpButton = React.forwardRef< ref={ref} className={cn('flex cursor-default items-center justify-center py-1', className)} {...props}> -
+
@@ -76,7 +75,7 @@ const SelectScrollDownButton = React.forwardRef< ref={ref} className={cn('flex cursor-default items-center justify-center py-1', className)} {...props}> -
+
@@ -134,39 +133,39 @@ const SelectItem = React.forwardRef< index?: number; icon?: React.ReactNode; } ->(({ className, children, icon, secondaryChildren, index, ...props }, ref) => ( - -
-
- {icon && {icon}} - - {children} - -
- {secondaryChildren && {secondaryChildren}} -
- -
- -
- -
-
- {index !== undefined && ( - - {index} - +>(({ className, children, icon, secondaryChildren, index, ...props }, ref) => { + return ( + - -)); + {...props}> +
+
+ {icon && {icon}} + + {children} + +
+ {secondaryChildren && {secondaryChildren}} +
+ +
+ + + + {index !== undefined && ( + + {index} + + )} +
+ + ); +}); SelectItem.displayName = SelectPrimitive.Item.displayName; const SelectSeparator = React.forwardRef< diff --git a/web/src/controllers/DatasetPermissionUser/PermissionListUsersContainer.tsx b/web/src/controllers/DatasetPermissionUser/PermissionListUsersContainer.tsx index d3b32236f..4ab240ffa 100644 --- a/web/src/controllers/DatasetPermissionUser/PermissionListUsersContainer.tsx +++ b/web/src/controllers/DatasetPermissionUser/PermissionListUsersContainer.tsx @@ -109,7 +109,7 @@ export const PermissionListUsersContainer: React.FC<{ data: {}, hidden: cannotQueryPermissionUsers.length === 0, rowSection: { - title: 'Not Assigned', + title: 'Not assigned', secondaryTitle: cannotQueryPermissionUsers.length.toString() } }, diff --git a/web/src/controllers/DatasetPermissionUser/config.ts b/web/src/controllers/DatasetPermissionUser/config.ts index ce98b301f..10240508c 100644 --- a/web/src/controllers/DatasetPermissionUser/config.ts +++ b/web/src/controllers/DatasetPermissionUser/config.ts @@ -6,7 +6,7 @@ export const PERMISSION_USERS_OPTIONS: SelectItem<'true' | 'false'>[] = [ value: 'true' }, { - label: 'Not Assigned', + label: 'Not assigned', value: 'false' } ];