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 {
id: string;

View File

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

View File

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

View File

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

View File

@ -12,7 +12,11 @@ import {
updateDataset,
deleteDataset
} from './requests';
import { BusterDataset, BusterDatasetData, BusterDatasetListItem } from './responseInterfaces';
import type {
BusterDataset,
BusterDatasetData,
BusterDatasetListItem
} from '../../asset_interfaces/datasets';
import { useMemoizedFn } from 'ahooks';
import { QueryClient, useQueryClient } from '@tanstack/react-query';
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 * as config from './config';
import { serverFetch } from '@/api/createServerInstance';

View File

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

View File

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

View File

@ -1,5 +1,5 @@
import { BusterDatasetListItem } from '../datasets';
import { BusterOrganizationRole } from '../users';
import type { BusterDatasetListItem } from '../../asset_interfaces/datasets';
import type { BusterOrganizationRole } from '../users';
export interface BusterPermissionListUser {
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 {
'/datasets/list:listDatasetsAdmin' = '/datasets/list:listDatasetsAdmin',

View File

@ -1,6 +1,5 @@
import { DataSourceTypes } from '@/api/buster_rest';
import { BusterSocketRequestBase } from '../base_interfaces';
import { DatasourceCreateCredentials } from './interface';
import type { BusterSocketRequestBase } from '../base_interfaces';
import type { DatasourceCreateCredentials } from './interface';
export type DatasourceListRequest = BusterSocketRequestBase<
'/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 {
'/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 {
datasource_name: 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 { SelectProps, Select } from 'antd';
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 React from 'react';
import isEmpty from 'lodash/isEmpty';

View File

@ -6,8 +6,7 @@ import { AppSplitter, AppSplitterRef } from '@/components';
import { SQLContainer } from './SQLContainer';
import { DataContainer } from './DataContainer';
import { useMemoizedFn, useRequest } from 'ahooks';
import { BusterDatasetData } from '@/api/buster_rest/datasets';
import { timeout } from '@/utils';
import type { BusterDatasetData } from '@/api/asset_interfaces/datasets';
import { EditorApps, EditorContainerSubHeader } from './EditorContainerSubHeader';
import { createStyles } from 'antd-style';
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 AppDataGrid from '@/components/table/AppDataGrid';
import { useUserConfigContextSelector } from '@/context/Users';

View File

@ -6,7 +6,7 @@ import { BusterUserAvatar } from '@/components';
import { formatDate } from '@/utils';
import { BusterList, BusterListColumn, BusterListRow } from '@/components/list';
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 { useDatasetContextSelector } from '@/context/Datasets';
import { useMemoizedFn } from 'ahooks';

View File

@ -1,6 +1,6 @@
'use client';
import { DataSource } from '@/api/buster_rest';
import type { DataSource } from '@/api/asset_interfaces/datasources';
import { AppMaterialIcons, PulseLoader } from '@/components';
import { AppDataSourceIcon } from '@/components/icons/AppDataSourceIcons';
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 { useDataSourceContextSelector } from '@/context/DataSources';
import { BusterRoutes } from '@/routes';
import { useAntToken } from '@/styles/useAntToken';
import { useMemoizedFn } from 'ahooks';
import React, { useContext, useState } from 'react';
import React, { useState } from 'react';
import { PostgresForm } from './_forms/PostgresForm';
import { DatasourceCreateCredentials } from '@/api/buster_socket/datasources/interface';
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 { DataSource } from '@/api/buster_rest';
import {
import type { DataSource } from '@/api/asset_interfaces/datasources';
import type {
BigQueryCreateCredentials,
DatasourceCreateCredentials
} from '@/api/buster_socket/datasources/interface';

View File

@ -1,9 +1,8 @@
import {
DatabricksCreateCredentials,
DatasourceCreateCredentials,
PostgresCreateCredentials
DatasourceCreateCredentials
} 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 { FormWrapper } from './FormWrapper';
import { Form, Input } from 'antd';

View File

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

View File

@ -1,13 +1,12 @@
import {
DatasourceCreateCredentials,
MySqlCreateCredentials,
PostgresCreateCredentials
MySqlCreateCredentials
} 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 { Form, Select, Input, InputNumber } from 'antd';
import React, { useEffect, useLayoutEffect, useRef } from 'react';
import { FormWrapper, FormWrapperHandle } from './FormWrapper';
import { Form, Input, InputNumber } from 'antd';
import React from 'react';
import { FormWrapper } from './FormWrapper';
export const MySqlForm: React.FC<{
dataSource?: DataSource;

View File

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

View File

@ -1,10 +1,8 @@
import {
DatasourceCreateCredentials,
MySqlCreateCredentials,
PostgresCreateCredentials,
RedshiftCreateCredentials
} 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 { Form, Input, InputNumber } from 'antd';

View File

@ -1,10 +1,10 @@
import React, { useEffect, useLayoutEffect, useRef } from 'react';
import { FormWrapper, FormWrapperHandle } from './FormWrapper';
import React from 'react';
import { FormWrapper } from './FormWrapper';
import {
DatasourceCreateCredentials,
MySqlCreateCredentials
} 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 { Form, Input } from 'antd';
import { RuleObject } from 'antd/es/form';

View File

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

View File

@ -4,7 +4,7 @@ import React from 'react';
import { BusterRoutes, createBusterRoute } from '@/routes';
import { HeaderContainer } from '../../_HeaderContainer';
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 { useAntToken } from '@/styles/useAntToken';

View File

@ -6,7 +6,7 @@ import { Button, Dropdown, Skeleton } from 'antd';
import { AppMaterialIcons } from '@/components';
import { useAntToken } from '@/styles/useAntToken';
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 { MenuProps } from 'antd/lib';
import Link from 'next/link';

View File

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

View File

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

View File

@ -1,9 +1,9 @@
import React, { PropsWithChildren, useEffect, useRef, useState } from 'react';
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 { 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 { BusterRoutes } from '@/routes';
import { DatasourceUpdateRequest } from '@/api/buster_socket/datasources/datasourceRequests';

View File

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