move dataset to shared asset

This commit is contained in:
Nate Kelley 2025-02-01 20:59:24 -07:00
parent 90fac0a5c7
commit 4cee544cf3
No known key found for this signature in database
GPG Key ID: FD90372AB8D98B4F
38 changed files with 57 additions and 56 deletions

View File

@ -1,4 +1,4 @@
import { DataSource, DataSourceTypes } from '../datasources'; import type { DataSourceTypes } from '../datasources';
export interface BusterDatasetListItem { export interface BusterDatasetListItem {
id: string; id: string;

View File

@ -1,4 +1,4 @@
import { BusterDataset } from '../../datasets'; import type { BusterDataset } from '../datasets';
export enum DataSourceStatus { export enum DataSourceStatus {
ACTIVE = 'active', ACTIVE = 'active',

View File

@ -4,3 +4,5 @@ export type * from './collection';
export type * from './dashboard'; export type * from './dashboard';
export type * from './chat'; export type * from './chat';
export type * from './search'; export type * from './search';
export * from './datasets';
export * from './datasources';

View File

@ -1,4 +1,3 @@
export * from './responseInterfaces';
export * from './requests'; export * from './requests';
export * from './queryRequests'; export * from './queryRequests';
export * from './permissions'; export * from './permissions';

View File

@ -12,7 +12,11 @@ import {
updateDataset, updateDataset,
deleteDataset deleteDataset
} from './requests'; } from './requests';
import { BusterDataset, BusterDatasetData, BusterDatasetListItem } from './responseInterfaces'; import type {
BusterDataset,
BusterDatasetData,
BusterDatasetListItem
} from '../../asset_interfaces/datasets';
import { useMemoizedFn } from 'ahooks'; import { useMemoizedFn } from 'ahooks';
import { QueryClient, useQueryClient } from '@tanstack/react-query'; import { QueryClient, useQueryClient } from '@tanstack/react-query';
import { getDatasetMetadata_server } from './serverRequests'; import { getDatasetMetadata_server } from './serverRequests';

View File

@ -1,4 +1,8 @@
import { BusterDataset, BusterDatasetData, BusterDatasetListItem } from './responseInterfaces'; import type {
BusterDataset,
BusterDatasetData,
BusterDatasetListItem
} from '../../asset_interfaces/datasets';
import { mainApi } from '../instances'; import { mainApi } from '../instances';
import * as config from './config'; import * as config from './config';
import { serverFetch } from '@/api/createServerInstance'; import { serverFetch } from '@/api/createServerInstance';

View File

@ -1,7 +1,7 @@
'use server'; 'use server';
import { serverFetch } from '../../createServerInstance'; import { serverFetch } from '../../createServerInstance';
import { BusterDataset } from './responseInterfaces'; import type { BusterDataset } from '../../asset_interfaces/datasets';
import * as config from './config'; import * as config from './config';
export const getDatasetMetadata_server = async (datasetId: string) => { export const getDatasetMetadata_server = async (datasetId: string) => {

View File

@ -1,5 +1,4 @@
export * from './users'; export * from './users';
export * from './datasources';
export * from './terms'; export * from './terms';
export * from './assets'; export * from './assets';
export * from './api_keys'; export * from './api_keys';

View File

@ -1,5 +1,5 @@
import { BusterDatasetListItem } from '../datasets'; import type { BusterDatasetListItem } from '../../asset_interfaces/datasets';
import { BusterOrganizationRole } from '../users'; import type { BusterOrganizationRole } from '../users';
export interface BusterPermissionListUser { export interface BusterPermissionListUser {
id: string; id: string;

View File

@ -1,4 +1,4 @@
import { BusterDataset, BusterDatasetListItem } from '@/api/buster_rest/datasets'; import { BusterDataset, BusterDatasetListItem } from '@/api/asset_interfaces';
export enum DatasetResponses { export enum DatasetResponses {
'/datasets/list:listDatasetsAdmin' = '/datasets/list:listDatasetsAdmin', '/datasets/list:listDatasetsAdmin' = '/datasets/list:listDatasetsAdmin',

View File

@ -1,6 +1,5 @@
import { DataSourceTypes } from '@/api/buster_rest'; import type { BusterSocketRequestBase } from '../base_interfaces';
import { BusterSocketRequestBase } from '../base_interfaces'; import type { DatasourceCreateCredentials } from './interface';
import { DatasourceCreateCredentials } from './interface';
export type DatasourceListRequest = BusterSocketRequestBase< export type DatasourceListRequest = BusterSocketRequestBase<
'/data_sources/list', '/data_sources/list',

View File

@ -1,4 +1,4 @@
import { DataSource, DataSourceListItem } from '@/api/buster_rest'; import type { DataSource, DataSourceListItem } from '@/api/asset_interfaces/datasources';
export enum DatasourceResponses { export enum DatasourceResponses {
'/data_sources/list:listDataSources' = '/data_sources/list:listDataSources', '/data_sources/list:listDataSources' = '/data_sources/list:listDataSources',

View File

@ -0,0 +1 @@
export * from './interface';

View File

@ -1,5 +1,3 @@
import { StringColorFormat } from '@faker-js/faker';
export interface PostgresCreateCredentials { export interface PostgresCreateCredentials {
datasource_name: string; datasource_name: string;
host: string; host: string;

View File

@ -1,4 +1,4 @@
import { BusterDatasetListItem } from '@/api/buster_rest/datasets'; import type { BusterDatasetListItem } from '@/api/asset_interfaces';
import { AppMaterialIcons } from '@/components'; import { AppMaterialIcons } from '@/components';
import { SelectProps, Select } from 'antd'; import { SelectProps, Select } from 'antd';
import isEmpty from 'lodash/isEmpty'; import isEmpty from 'lodash/isEmpty';

View File

@ -1,4 +1,4 @@
import { BusterDatasetData } from '@/api/buster_rest/datasets'; import type { BusterDatasetData } from '@/api/asset_interfaces/datasets';
import { createStyles } from 'antd-style'; import { createStyles } from 'antd-style';
import React from 'react'; import React from 'react';
import isEmpty from 'lodash/isEmpty'; import isEmpty from 'lodash/isEmpty';

View File

@ -6,8 +6,7 @@ import { AppSplitter, AppSplitterRef } from '@/components';
import { SQLContainer } from './SQLContainer'; import { SQLContainer } from './SQLContainer';
import { DataContainer } from './DataContainer'; import { DataContainer } from './DataContainer';
import { useMemoizedFn, useRequest } from 'ahooks'; import { useMemoizedFn, useRequest } from 'ahooks';
import { BusterDatasetData } from '@/api/buster_rest/datasets'; import type { BusterDatasetData } from '@/api/asset_interfaces/datasets';
import { timeout } from '@/utils';
import { EditorApps, EditorContainerSubHeader } from './EditorContainerSubHeader'; import { EditorApps, EditorContainerSubHeader } from './EditorContainerSubHeader';
import { createStyles } from 'antd-style'; import { createStyles } from 'antd-style';
import { MetadataContainer } from './MetadataContainer'; import { MetadataContainer } from './MetadataContainer';

View File

@ -1,4 +1,4 @@
import { BusterDatasetData } from '@/api/buster_rest/datasets'; import type { BusterDatasetData } from '@/api/asset_interfaces/datasets';
import { ShimmerText } from '@/components'; import { ShimmerText } from '@/components';
import AppDataGrid from '@/components/table/AppDataGrid'; import AppDataGrid from '@/components/table/AppDataGrid';
import { useUserConfigContextSelector } from '@/context/Users'; import { useUserConfigContextSelector } from '@/context/Users';

View File

@ -6,7 +6,7 @@ import { BusterUserAvatar } from '@/components';
import { formatDate } from '@/utils'; import { formatDate } from '@/utils';
import { BusterList, BusterListColumn, BusterListRow } from '@/components/list'; import { BusterList, BusterListColumn, BusterListRow } from '@/components/list';
import { BusterRoutes, createBusterRoute } from '@/routes'; import { BusterRoutes, createBusterRoute } from '@/routes';
import { BusterDatasetListItem } from '@/api/buster_rest/datasets'; import type { BusterDatasetListItem } from '@/api/asset_interfaces/datasets';
import { ListEmptyStateWithButton } from '../../../components/list'; import { ListEmptyStateWithButton } from '../../../components/list';
import { useDatasetContextSelector } from '@/context/Datasets'; import { useDatasetContextSelector } from '@/context/Datasets';
import { useMemoizedFn } from 'ahooks'; import { useMemoizedFn } from 'ahooks';

View File

@ -1,6 +1,6 @@
'use client'; 'use client';
import { DataSource } from '@/api/buster_rest'; import type { DataSource } from '@/api/asset_interfaces/datasources';
import { AppMaterialIcons, PulseLoader } from '@/components'; import { AppMaterialIcons, PulseLoader } from '@/components';
import { AppDataSourceIcon } from '@/components/icons/AppDataSourceIcons'; import { AppDataSourceIcon } from '@/components/icons/AppDataSourceIcons';
import { useAntToken } from '@/styles/useAntToken'; import { useAntToken } from '@/styles/useAntToken';

View File

@ -1,10 +1,10 @@
import { DataSource, DataSourceTypes } from '@/api/buster_rest'; import type { DataSource, DataSourceTypes } from '@/api/asset_interfaces/datasources';
import { useAppLayoutContextSelector } from '@/context/BusterAppLayout'; import { useAppLayoutContextSelector } from '@/context/BusterAppLayout';
import { useDataSourceContextSelector } from '@/context/DataSources'; import { useDataSourceContextSelector } from '@/context/DataSources';
import { BusterRoutes } from '@/routes'; import { BusterRoutes } from '@/routes';
import { useAntToken } from '@/styles/useAntToken'; import { useAntToken } from '@/styles/useAntToken';
import { useMemoizedFn } from 'ahooks'; import { useMemoizedFn } from 'ahooks';
import React, { useContext, useState } from 'react'; import React, { useState } from 'react';
import { PostgresForm } from './_forms/PostgresForm'; import { PostgresForm } from './_forms/PostgresForm';
import { DatasourceCreateCredentials } from '@/api/buster_socket/datasources/interface'; import { DatasourceCreateCredentials } from '@/api/buster_socket/datasources/interface';
import { MySqlForm } from './_forms/MySqlForm'; import { MySqlForm } from './_forms/MySqlForm';

View File

@ -1,7 +1,7 @@
import React, { useContext, useEffect, useLayoutEffect, useMemo, useRef, useState } from 'react'; import React, { useMemo, useRef, useState } from 'react';
import { FormWrapper, FormWrapperHandle } from './FormWrapper'; import { FormWrapper, FormWrapperHandle } from './FormWrapper';
import { DataSource } from '@/api/buster_rest'; import type { DataSource } from '@/api/asset_interfaces/datasources';
import { import type {
BigQueryCreateCredentials, BigQueryCreateCredentials,
DatasourceCreateCredentials DatasourceCreateCredentials
} from '@/api/buster_socket/datasources/interface'; } from '@/api/buster_socket/datasources/interface';

View File

@ -1,9 +1,8 @@
import { import {
DatabricksCreateCredentials, DatabricksCreateCredentials,
DatasourceCreateCredentials, DatasourceCreateCredentials
PostgresCreateCredentials
} from '@/api/buster_socket/datasources/interface'; } from '@/api/buster_socket/datasources/interface';
import { DataSource } from '@/api/buster_rest'; import type { DataSource } from '@/api/asset_interfaces/datasources';
import React from 'react'; import React from 'react';
import { FormWrapper } from './FormWrapper'; import { FormWrapper } from './FormWrapper';
import { Form, Input } from 'antd'; import { Form, Input } from 'antd';

View File

@ -3,8 +3,8 @@ import { Button, Form, FormInstance, Input } from 'antd';
import { createStyles } from 'antd-style'; import { createStyles } from 'antd-style';
import React, { useImperativeHandle, useLayoutEffect } from 'react'; import React, { useImperativeHandle, useLayoutEffect } from 'react';
import { WhiteListBlock } from '../WhiteListBlock'; import { WhiteListBlock } from '../WhiteListBlock';
import { DatasourceCreateCredentials } from '@/api/buster_socket/datasources/interface'; import type { DatasourceCreateCredentials } from '@/api/buster_socket/datasources';
import { DataSource } from '@/api/buster_rest'; import type { DataSource } from '@/api/asset_interfaces/datasources';
import { NewDatasetModal } from '@appComponents/NewDatasetModal'; import { NewDatasetModal } from '@appComponents/NewDatasetModal';
const layout = { const layout = {

View File

@ -1,13 +1,12 @@
import { import {
DatasourceCreateCredentials, DatasourceCreateCredentials,
MySqlCreateCredentials, MySqlCreateCredentials
PostgresCreateCredentials
} from '@/api/buster_socket/datasources/interface'; } from '@/api/buster_socket/datasources/interface';
import { DataSource } from '@/api/buster_rest'; import type { DataSource } from '@/api/asset_interfaces';
import { AppSelectTagInput } from '@/components/select/AppSelectTagInput'; import { AppSelectTagInput } from '@/components/select/AppSelectTagInput';
import { Form, Select, Input, InputNumber } from 'antd'; import { Form, Input, InputNumber } from 'antd';
import React, { useEffect, useLayoutEffect, useRef } from 'react'; import React from 'react';
import { FormWrapper, FormWrapperHandle } from './FormWrapper'; import { FormWrapper } from './FormWrapper';
export const MySqlForm: React.FC<{ export const MySqlForm: React.FC<{
dataSource?: DataSource; dataSource?: DataSource;

View File

@ -1,5 +1,5 @@
import { DataSource } from '@/api/buster_rest'; import { DataSource } from '@/api/asset_interfaces';
import React, { useEffect, useLayoutEffect, useRef } from 'react'; import React, { useRef } from 'react';
import { Form, Input, InputNumber, Select } from 'antd'; import { Form, Input, InputNumber, Select } from 'antd';
import { useKeyPress } from 'ahooks'; import { useKeyPress } from 'ahooks';
import { AppSelectTagInput } from '@/components/select/AppSelectTagInput'; import { AppSelectTagInput } from '@/components/select/AppSelectTagInput';

View File

@ -1,10 +1,8 @@
import { import {
DatasourceCreateCredentials, DatasourceCreateCredentials,
MySqlCreateCredentials,
PostgresCreateCredentials,
RedshiftCreateCredentials RedshiftCreateCredentials
} from '@/api/buster_socket/datasources/interface'; } from '@/api/buster_socket/datasources/interface';
import { DataSource } from '@/api/buster_rest'; import type { DataSource } from '@/api/asset_interfaces';
import { AppSelectTagInput } from '@/components/select/AppSelectTagInput'; import { AppSelectTagInput } from '@/components/select/AppSelectTagInput';
import { Form, Input, InputNumber } from 'antd'; import { Form, Input, InputNumber } from 'antd';

View File

@ -1,10 +1,10 @@
import React, { useEffect, useLayoutEffect, useRef } from 'react'; import React from 'react';
import { FormWrapper, FormWrapperHandle } from './FormWrapper'; import { FormWrapper } from './FormWrapper';
import { import {
DatasourceCreateCredentials, DatasourceCreateCredentials,
MySqlCreateCredentials MySqlCreateCredentials
} from '@/api/buster_socket/datasources/interface'; } from '@/api/buster_socket/datasources/interface';
import { DataSource } from '@/api/buster_rest'; import type { DataSource } from '@/api/asset_interfaces';
import { AppSelectTagInput } from '@/components/select/AppSelectTagInput'; import { AppSelectTagInput } from '@/components/select/AppSelectTagInput';
import { Form, Input } from 'antd'; import { Form, Input } from 'antd';
import { RuleObject } from 'antd/es/form'; import { RuleObject } from 'antd/es/form';

View File

@ -2,7 +2,7 @@ import {
DatasourceCreateCredentials, DatasourceCreateCredentials,
SqlServerCreateCredentials SqlServerCreateCredentials
} from '@/api/buster_socket/datasources/interface'; } from '@/api/buster_socket/datasources/interface';
import { DataSource } from '@/api/buster_rest'; import type { DataSource } from '@/api/asset_interfaces';
import React from 'react'; import React from 'react';
import { FormWrapper } from './FormWrapper'; import { FormWrapper } from './FormWrapper';
import { Form, Input, InputNumber } from 'antd'; import { Form, Input, InputNumber } from 'antd';

View File

@ -4,7 +4,7 @@ import React from 'react';
import { BusterRoutes, createBusterRoute } from '@/routes'; import { BusterRoutes, createBusterRoute } from '@/routes';
import { HeaderContainer } from '../../_HeaderContainer'; import { HeaderContainer } from '../../_HeaderContainer';
import { useState } from 'react'; import { useState } from 'react';
import { DatabaseNames, DataSourceTypes, SUPPORTED_DATASOURCES } from '@/api/buster_rest'; import { DatabaseNames, DataSourceTypes, SUPPORTED_DATASOURCES } from '@/api/asset_interfaces';
import { AppDataSourceIcon } from '@/components/icons/AppDataSourceIcons'; import { AppDataSourceIcon } from '@/components/icons/AppDataSourceIcons';
import { useAntToken } from '@/styles/useAntToken'; import { useAntToken } from '@/styles/useAntToken';

View File

@ -6,7 +6,7 @@ import { Button, Dropdown, Skeleton } from 'antd';
import { AppMaterialIcons } from '@/components'; import { AppMaterialIcons } from '@/components';
import { useAntToken } from '@/styles/useAntToken'; import { useAntToken } from '@/styles/useAntToken';
import { AppDataSourceIcon } from '@/components/icons/AppDataSourceIcons'; import { AppDataSourceIcon } from '@/components/icons/AppDataSourceIcons';
import { DataSourceListItem } from '@/api/buster_rest'; import type { DataSourceListItem } from '@/api/asset_interfaces';
import { createStyles } from 'antd-style'; import { createStyles } from 'antd-style';
import { MenuProps } from 'antd/lib'; import { MenuProps } from 'antd/lib';
import Link from 'next/link'; import Link from 'next/link';

View File

@ -10,7 +10,7 @@ import { SupabaseIcon } from './customIcons/supabase';
import { RedUsersIcons } from './customIcons/redUsers'; import { RedUsersIcons } from './customIcons/redUsers';
import { AthenaIcon } from './customIcons/athena'; import { AthenaIcon } from './customIcons/athena';
import React from 'react'; import React from 'react';
import { DataSourceTypes } from '@/api/buster_rest'; import { DataSourceTypes } from '@/api/asset_interfaces';
import { AppMaterialIcons } from './AppMaterialIcons'; import { AppMaterialIcons } from './AppMaterialIcons';
const IconRecord: Record<DataSourceTypes, any> = { const IconRecord: Record<DataSourceTypes, any> = {

View File

@ -5,8 +5,8 @@ import {
useContextSelector useContextSelector
} from '@fluentui/react-context-selector'; } from '@fluentui/react-context-selector';
import { useMemoizedFn } from 'ahooks'; import { useMemoizedFn } from 'ahooks';
import { BusterSearchResult } from '@/api/asset_interfaces'; import type { BusterSearchResult } from '@/api/asset_interfaces';
import type { BusterDatasetListItem } from '@/api/buster_rest'; import type { BusterDatasetListItem } from '@/api/asset_interfaces/datasets';
export const useBusterNewChat = () => { export const useBusterNewChat = () => {
const [prompt, setPrompt] = useState(''); const [prompt, setPrompt] = useState('');

View File

@ -1,9 +1,9 @@
import React, { PropsWithChildren, useEffect, useRef, useState } from 'react'; import React, { PropsWithChildren, useEffect, useRef, useState } from 'react';
import { useBusterWebSocket } from '../BusterWebSocket'; import { useBusterWebSocket } from '../BusterWebSocket';
import { DataSource, DataSourceListItem } from '@/api/buster_rest/datasources'; import type { DataSource, DataSourceListItem } from '@/api/asset_interfaces/datasources';
import { useSelectedLayoutSegments } from 'next/navigation'; import { useSelectedLayoutSegments } from 'next/navigation';
import { useMemoizedFn, useMount } from 'ahooks'; import { useMemoizedFn, useMount } from 'ahooks';
import { DatasourceCreateCredentials } from '@/api/buster_socket/datasources/interface'; import type { DatasourceCreateCredentials } from '@/api/buster_socket/datasources/interface';
import { useAppLayoutContextSelector } from '../BusterAppLayout'; import { useAppLayoutContextSelector } from '../BusterAppLayout';
import { BusterRoutes } from '@/routes'; import { BusterRoutes } from '@/routes';
import { DatasourceUpdateRequest } from '@/api/buster_socket/datasources/datasourceRequests'; import { DatasourceUpdateRequest } from '@/api/buster_socket/datasources/datasourceRequests';

View File

@ -1,6 +1,6 @@
import React, { useState } from 'react'; import React, { useState } from 'react';
import { useBusterWebSocket } from '../BusterWebSocket'; import { useBusterWebSocket } from '../BusterWebSocket';
import { BusterDatasetListItem } from '@/api/buster_rest/datasets'; import type { BusterDatasetListItem } from '@/api/asset_interfaces';
import { useMemoizedFn } from 'ahooks'; import { useMemoizedFn } from 'ahooks';
import { useUserConfigContextSelector } from '../Users'; import { useUserConfigContextSelector } from '../Users';
import { usePermissionsContextSelector } from './PermissionsConfigProvider'; import { usePermissionsContextSelector } from './PermissionsConfigProvider';