@malloy-publisher/sdk 0.0.382-dev → 0.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +115 -95
- package/TREE_SHAKING.md +16 -11
- package/bunfig.toml +7 -0
- package/dist/ServerProvider-CTopDUWW.cjs.js +1 -0
- package/dist/ServerProvider-DUFPY6Rv.es.js +4072 -0
- package/dist/client/api.d.ts +3718 -1507
- package/dist/client/configuration.d.ts +1 -1
- package/dist/client/index.cjs.js +1 -1
- package/dist/client/index.d.ts +1 -1
- package/dist/client/index.es.js +85 -59
- package/dist/components/Connections/EditConnectionDialog.d.ts +2 -1
- package/dist/components/Connections/common.d.ts +8 -2
- package/dist/components/Dashboard/Dashboard.d.ts +49 -0
- package/dist/components/Dashboard/DashboardTile.d.ts +48 -0
- package/dist/components/Dashboard/index.d.ts +2 -0
- package/dist/components/DataAppViewer/DataAppViewer.d.ts +23 -0
- package/dist/components/DataAppViewer/index.d.ts +1 -0
- package/dist/components/Environment/Environment.d.ts +6 -0
- package/dist/components/Environment/index.d.ts +2 -0
- package/dist/components/Home/AddEnvironmentDialog.d.ts +1 -0
- package/dist/components/Home/DeleteEnvironmentDialog.d.ts +5 -0
- package/dist/components/Home/EditEnvironmentDialog.d.ts +7 -0
- package/dist/components/Home/Home.d.ts +2 -2
- package/dist/components/Materializations/CreateEnvMaterializationDialog.d.ts +14 -0
- package/dist/components/Materializations/CreateMaterializationDialog.d.ts +10 -0
- package/dist/components/Materializations/DeleteMaterializationDialog.d.ts +7 -0
- package/dist/components/Materializations/EnvironmentMaterializations.d.ts +7 -0
- package/dist/components/Materializations/ManifestView.d.ts +13 -0
- package/dist/components/Materializations/MaterializationDetailDialog.d.ts +9 -0
- package/dist/components/Materializations/MaterializationRunsList.d.ts +15 -0
- package/dist/components/Materializations/Materializations.d.ts +7 -0
- package/dist/components/Materializations/ScheduleCard.d.ts +20 -0
- package/dist/components/Materializations/SectionLabel.d.ts +10 -0
- package/dist/components/Materializations/SetScheduleDialog.d.ts +11 -0
- package/dist/components/Materializations/TriggerChip.d.ts +10 -0
- package/dist/components/Materializations/cron.d.ts +23 -0
- package/dist/components/Materializations/index.d.ts +2 -0
- package/dist/components/Materializations/utils.d.ts +46 -0
- package/dist/components/Notebook/Notebook.d.ts +47 -4
- package/dist/components/Notebook/NotebookCell.d.ts +37 -1
- package/dist/components/Notebook/runPlan.d.ts +29 -0
- package/dist/components/Notebook/types.d.ts +10 -0
- package/dist/components/Package/ContentTypeIcon.d.ts +31 -0
- package/dist/components/Package/Package.d.ts +1 -4
- package/dist/components/RenderedResult/RenderedResult.d.ts +7 -1
- package/dist/components/RenderedResult/ResultContainer.d.ts +5 -1
- package/dist/components/RenderedResult/renderLogs.d.ts +6 -0
- package/dist/components/ResultsDialog.d.ts +6 -1
- package/dist/components/ServerProvider.d.ts +28 -4
- package/dist/components/click_helper.d.ts +10 -1
- package/dist/components/drill/index.d.ts +3 -0
- package/dist/components/drill/markDrillableCells.d.ts +55 -0
- package/dist/components/drill/resolveDrill.d.ts +139 -0
- package/dist/components/drill/useDrill.d.ts +63 -0
- package/dist/components/given/GivenInput.d.ts +52 -0
- package/dist/components/given/GivensPanel.d.ts +47 -0
- package/dist/components/given/filterValue.d.ts +97 -0
- package/dist/components/given/index.d.ts +2 -0
- package/dist/components/given/paramCodec.d.ts +60 -0
- package/dist/components/given/utils.d.ts +17 -0
- package/dist/components/highlighter.d.ts +6 -1
- package/dist/components/index.d.ts +7 -2
- package/dist/components/styles.d.ts +47 -0
- package/dist/constants/docLinks.d.ts +12 -0
- package/dist/{core-YNpOLuB1.cjs.js → core-hLahnv0W.cjs.js} +1 -1
- package/dist/{core-CjeTkq8O.es.js → core-lb28vQkR.es.js} +1 -1
- package/dist/github-dark-BKL9xNgN.cjs.js +1 -0
- package/dist/github-dark-DenFmJkN.es.js +4 -0
- package/dist/hooks/givenValue.d.ts +10 -0
- package/dist/hooks/index.d.ts +4 -0
- package/dist/hooks/useDimensionFiltersFromSpec.d.ts +3 -3
- package/dist/hooks/useDimensionFiltersQuery.d.ts +3 -3
- package/dist/hooks/useDimensionalFilterRangeData.d.ts +4 -4
- package/dist/hooks/useGivensState.d.ts +64 -0
- package/dist/hooks/useModelGivens.d.ts +10 -0
- package/dist/hooks/useSuggestOptions.d.ts +78 -0
- package/dist/index-DvEanVgc.cjs.js +339 -0
- package/dist/{index-DRDu9kIV.es.js → index-txw04ZbN.es.js} +40531 -27964
- package/dist/index.cjs.js +1 -1
- package/dist/index.d.ts +4 -1
- package/dist/index.es.js +79 -48
- package/dist/malloy-explorer.css +12 -1
- package/dist/sdk.css +1 -1
- package/dist/theme/ThemeContext.d.ts +45 -0
- package/dist/theme/buildMalloyExplicitTheme.d.ts +34 -0
- package/dist/theme/buildTableCssVars.d.ts +25 -0
- package/dist/theme/buildVegaThemeOverride.d.ts +16 -0
- package/dist/theme/defaults.d.ts +7 -0
- package/dist/theme/index.d.ts +8 -0
- package/dist/theme/keys.d.ts +20 -0
- package/dist/theme/readChartAnnotations.d.ts +23 -0
- package/dist/theme/resolveTheme.d.ts +22 -0
- package/dist/theme/types.d.ts +70 -0
- package/dist/utils/dataAppEmbed.d.ts +44 -0
- package/dist/utils/formatting.d.ts +1 -1
- package/dist/utils/malloyString.d.ts +7 -0
- package/dist/utils/parsing.d.ts +2 -2
- package/dist/utils/queryClient.d.ts +5 -0
- package/package.json +19 -8
- package/src/client-entry.ts +3 -0
- package/src/components/AnalyzePackageButton.tsx +9 -3
- package/src/components/ApiErrorDisplay.tsx +3 -0
- package/src/components/Connections/AddConnectionDialog.tsx +30 -2
- package/src/components/Connections/DeleteConnectionDialog.tsx +14 -3
- package/src/components/Connections/EditConnectionDialog.tsx +33 -4
- package/src/components/Connections/common.ts +64 -1
- package/src/components/DOMElement/DOMElement.tsx +3 -0
- package/src/components/DOMElement/index.ts +3 -0
- package/src/components/Dashboard/Dashboard.tsx +398 -0
- package/src/components/Dashboard/DashboardTile.tsx +153 -0
- package/src/components/Dashboard/index.ts +5 -0
- package/src/components/DataAppViewer/DataAppViewer.tsx +214 -0
- package/src/components/DataAppViewer/index.ts +4 -0
- package/src/components/{Project → Environment}/About.tsx +11 -4
- package/src/components/Environment/AddPackageDialog.tsx +202 -0
- package/src/components/{Project → Environment}/ConnectionExplorer.tsx +17 -14
- package/src/components/Environment/Connections.tsx +391 -0
- package/src/components/{Project → Environment}/DeletePackageDialog.tsx +8 -4
- package/src/components/{Project → Environment}/EditPackageDialog.tsx +21 -13
- package/src/components/Environment/Environment.tsx +89 -0
- package/src/components/Environment/Packages.tsx +206 -0
- package/src/components/Environment/index.ts +5 -0
- package/src/components/Home/{AddProjectDialog.tsx → AddEnvironmentDialog.tsx} +25 -19
- package/src/components/Home/{DeleteProjectDialog.tsx → DeleteEnvironmentDialog.tsx} +20 -15
- package/src/components/Home/{EditProjectDialog.tsx → EditEnvironmentDialog.tsx} +35 -28
- package/src/components/Home/Home.tsx +386 -408
- package/src/components/Home/index.ts +3 -0
- package/src/components/Loading.tsx +3 -0
- package/src/components/Materializations/CreateEnvMaterializationDialog.tsx +179 -0
- package/src/components/Materializations/CreateMaterializationDialog.tsx +112 -0
- package/src/components/Materializations/DeleteMaterializationDialog.tsx +109 -0
- package/src/components/Materializations/EnvironmentMaterializations.tsx +267 -0
- package/src/components/Materializations/ManifestView.tsx +87 -0
- package/src/components/Materializations/MaterializationDetailDialog.tsx +259 -0
- package/src/components/Materializations/MaterializationRunsList.tsx +256 -0
- package/src/components/Materializations/Materializations.tsx +355 -0
- package/src/components/Materializations/ScheduleCard.tsx +231 -0
- package/src/components/Materializations/SectionLabel.tsx +30 -0
- package/src/components/Materializations/SetScheduleDialog.tsx +162 -0
- package/src/components/Materializations/TriggerChip.tsx +44 -0
- package/src/components/Materializations/cron.ts +124 -0
- package/src/components/Materializations/index.ts +5 -0
- package/src/components/Materializations/utils.ts +145 -0
- package/src/components/Model/Model.tsx +44 -2
- package/src/components/Model/ModelCell.tsx +14 -5
- package/src/components/Model/ModelExplorer.tsx +3 -0
- package/src/components/Model/ModelExplorerDialog.tsx +4 -1
- package/src/components/Model/SourcesExplorer.tsx +9 -6
- package/src/components/Model/index.ts +3 -0
- package/src/components/Model/useModelData.ts +6 -3
- package/src/components/Notebook/Notebook.tsx +475 -339
- package/src/components/Notebook/NotebookCell.tsx +264 -25
- package/src/components/Notebook/index.ts +3 -0
- package/src/components/Notebook/runPlan.spec.ts +155 -0
- package/src/components/Notebook/runPlan.ts +67 -0
- package/src/components/Notebook/types.ts +14 -0
- package/src/components/Package/ContentTypeIcon.spec.ts +91 -0
- package/src/components/Package/ContentTypeIcon.tsx +177 -0
- package/src/components/Package/FileTreeView.tsx +3 -0
- package/src/components/Package/Models.tsx +7 -4
- package/src/components/Package/Package.tsx +666 -59
- package/src/components/Package/index.ts +3 -0
- package/src/components/QueryResult/QueryResult.tsx +17 -8
- package/src/components/QueryResult/index.ts +3 -0
- package/src/components/RenderedResult/RenderedResult.tsx +685 -67
- package/src/components/RenderedResult/ResultContainer.tsx +71 -2
- package/src/components/RenderedResult/index.ts +3 -0
- package/src/components/RenderedResult/renderLogs.spec.ts +58 -0
- package/src/components/RenderedResult/renderLogs.ts +43 -0
- package/src/components/ResultsDialog.tsx +13 -1
- package/src/components/ServerProvider.tsx +175 -51
- package/src/components/Workbook/BrowserWorkbookStorage.ts +3 -0
- package/src/components/Workbook/EditableMalloyCell.tsx +3 -0
- package/src/components/Workbook/ModelPicker.tsx +7 -4
- package/src/components/Workbook/MutableCell.tsx +10 -5
- package/src/components/Workbook/Workbook.tsx +8 -5
- package/src/components/Workbook/WorkbookList.tsx +3 -0
- package/src/components/Workbook/WorkbookManager.ts +3 -0
- package/src/components/Workbook/WorkbookStorage.ts +3 -0
- package/src/components/Workbook/WorkbookStorageProvider.tsx +3 -0
- package/src/components/Workbook/index.ts +3 -0
- package/src/components/click_helper.ts +17 -1
- package/src/components/drill/index.ts +28 -0
- package/src/components/drill/markDrillableCells.dom.spec.ts +313 -0
- package/src/components/drill/markDrillableCells.spec.ts +109 -0
- package/src/components/drill/markDrillableCells.ts +314 -0
- package/src/components/drill/resolveDrill.spec.ts +449 -0
- package/src/components/drill/resolveDrill.ts +375 -0
- package/src/components/drill/useDrill.tsx +203 -0
- package/src/components/filter/DimensionFilter.tsx +3 -0
- package/src/components/filter/index.ts +3 -0
- package/src/components/filter/utils.ts +16 -5
- package/src/components/given/GivenInput.spec.tsx +689 -0
- package/src/components/given/GivenInput.tsx +801 -0
- package/src/components/given/GivensPanel.spec.tsx +175 -0
- package/src/components/given/GivensPanel.tsx +195 -0
- package/src/components/given/filterValue.spec.ts +364 -0
- package/src/components/given/filterValue.ts +207 -0
- package/src/components/given/index.ts +9 -0
- package/src/components/given/paramCodec.spec.ts +857 -0
- package/src/components/given/paramCodec.ts +483 -0
- package/src/components/given/utils.spec.ts +60 -0
- package/src/components/given/utils.ts +79 -0
- package/src/components/highlighter.ts +22 -5
- package/src/components/index.ts +10 -2
- package/src/components/styles.ts +82 -33
- package/src/constants/docLinks.spec.ts +54 -0
- package/src/constants/docLinks.ts +46 -0
- package/src/hooks/givenValue.ts +13 -0
- package/src/hooks/index.ts +13 -0
- package/src/hooks/useDimensionFilters.ts +4 -7
- package/src/hooks/useDimensionFiltersFromSpec.ts +8 -5
- package/src/hooks/useDimensionFiltersQuery.ts +10 -13
- package/src/hooks/useDimensionalFilterRangeData.ts +11 -14
- package/src/hooks/useGivensState.spec.ts +449 -0
- package/src/hooks/useGivensState.ts +340 -0
- package/src/hooks/useModelGivens.ts +29 -0
- package/src/hooks/useQueryWithApiError.ts +3 -0
- package/src/hooks/useRawQueryData.ts +6 -3
- package/src/hooks/useSuggestOptions.spec.ts +112 -0
- package/src/hooks/useSuggestOptions.ts +263 -0
- package/src/index.ts +10 -1
- package/src/react-app-env.d.ts +3 -0
- package/src/theme/ThemeContext.tsx +86 -0
- package/src/theme/buildMalloyExplicitTheme.ts +61 -0
- package/src/theme/buildTableCssVars.spec.ts +67 -0
- package/src/theme/buildTableCssVars.ts +67 -0
- package/src/theme/buildVegaThemeOverride.spec.ts +56 -0
- package/src/theme/buildVegaThemeOverride.ts +47 -0
- package/src/theme/defaults.ts +78 -0
- package/src/theme/index.ts +11 -0
- package/src/theme/keys.ts +32 -0
- package/src/theme/readChartAnnotations.spec.ts +58 -0
- package/src/theme/readChartAnnotations.ts +69 -0
- package/src/theme/resolveTheme.spec.ts +160 -0
- package/src/theme/resolveTheme.ts +121 -0
- package/src/theme/types.ts +79 -0
- package/src/utils/dataAppEmbed.spec.ts +63 -0
- package/src/utils/dataAppEmbed.ts +84 -0
- package/src/utils/formatting.spec.ts +25 -21
- package/src/utils/formatting.ts +11 -7
- package/src/utils/malloyString.spec.ts +24 -0
- package/src/utils/malloyString.ts +12 -0
- package/src/utils/parsing.spec.ts +26 -19
- package/src/utils/parsing.ts +11 -6
- package/src/utils/queryClient.ts +17 -0
- package/test/README.md +141 -0
- package/test/setup.ts +29 -0
- package/tsconfig.json +12 -1
- package/tsconfig.spec.json +22 -0
- package/vite.config.ts +3 -0
- package/dist/ServerProvider-lOQXDlqB.cjs.js +0 -1
- package/dist/ServerProvider-on-8FH5Z.es.js +0 -3060
- package/dist/components/Home/AddProjectDialog.d.ts +0 -1
- package/dist/components/Home/DeleteProjectDialog.d.ts +0 -5
- package/dist/components/Home/EditProjectDialog.d.ts +0 -7
- package/dist/components/Package/Config.d.ts +0 -5
- package/dist/components/Package/Databases.d.ts +0 -5
- package/dist/components/Package/Notebooks.d.ts +0 -6
- package/dist/components/Project/Project.d.ts +0 -6
- package/dist/components/Project/index.d.ts +0 -2
- package/dist/index-BOLBP6_i.cjs.js +0 -233
- package/src/components/Package/Config.tsx +0 -97
- package/src/components/Package/Connections.tsx +0 -373
- package/src/components/Package/Databases.tsx +0 -228
- package/src/components/Package/Notebooks.tsx +0 -77
- package/src/components/Project/AddPackageDialog.tsx +0 -159
- package/src/components/Project/Packages.tsx +0 -191
- package/src/components/Project/Project.tsx +0 -52
- package/src/components/Project/index.ts +0 -2
- /package/dist/components/{Project → Environment}/About.d.ts +0 -0
- /package/dist/components/{Project → Environment}/AddPackageDialog.d.ts +0 -0
- /package/dist/components/{Project → Environment}/ConnectionExplorer.d.ts +0 -0
- /package/dist/components/{Package → Environment}/Connections.d.ts +0 -0
- /package/dist/components/{Project → Environment}/DeletePackageDialog.d.ts +0 -0
- /package/dist/components/{Project → Environment}/EditPackageDialog.d.ts +0 -0
- /package/dist/components/{Project → Environment}/Packages.d.ts +0 -0
|
@@ -1,97 +0,0 @@
|
|
|
1
|
-
import ErrorIcon from "@mui/icons-material/ErrorOutlined";
|
|
2
|
-
import { Box, List, ListItem, ListItemText } from "@mui/material";
|
|
3
|
-
import { useQueryWithApiError } from "../../hooks/useQueryWithApiError";
|
|
4
|
-
import { ApiErrorDisplay } from "../ApiErrorDisplay";
|
|
5
|
-
import { Loading } from "../Loading";
|
|
6
|
-
import {
|
|
7
|
-
PackageCard,
|
|
8
|
-
PackageCardContent,
|
|
9
|
-
PackageSectionTitle,
|
|
10
|
-
} from "../styles";
|
|
11
|
-
import { parseResourceUri } from "../../utils/formatting";
|
|
12
|
-
import { useServer } from "../ServerProvider";
|
|
13
|
-
|
|
14
|
-
type Props = {
|
|
15
|
-
resourceUri: string;
|
|
16
|
-
};
|
|
17
|
-
|
|
18
|
-
export default function Config({ resourceUri }: Props) {
|
|
19
|
-
const { apiClients } = useServer();
|
|
20
|
-
const {
|
|
21
|
-
projectName: projectName,
|
|
22
|
-
packageName: packageName,
|
|
23
|
-
versionId: versionId,
|
|
24
|
-
} = parseResourceUri(resourceUri);
|
|
25
|
-
|
|
26
|
-
const { data, isSuccess, isError, error } = useQueryWithApiError({
|
|
27
|
-
queryKey: ["package", projectName, packageName, versionId],
|
|
28
|
-
queryFn: () =>
|
|
29
|
-
apiClients.packages.getPackage(
|
|
30
|
-
projectName,
|
|
31
|
-
packageName,
|
|
32
|
-
versionId,
|
|
33
|
-
false,
|
|
34
|
-
),
|
|
35
|
-
});
|
|
36
|
-
|
|
37
|
-
return (
|
|
38
|
-
<PackageCard>
|
|
39
|
-
<PackageCardContent>
|
|
40
|
-
<PackageSectionTitle>Package Config</PackageSectionTitle>
|
|
41
|
-
<Box
|
|
42
|
-
sx={{
|
|
43
|
-
maxHeight: "200px",
|
|
44
|
-
overflowY: "auto",
|
|
45
|
-
}}
|
|
46
|
-
>
|
|
47
|
-
<List dense={true} disablePadding={true}>
|
|
48
|
-
<ListItem dense={true} disablePadding={true}>
|
|
49
|
-
<ListItemText
|
|
50
|
-
primary="Name"
|
|
51
|
-
primaryTypographyProps={{ fontWeight: "500" }}
|
|
52
|
-
secondary={packageName}
|
|
53
|
-
/>
|
|
54
|
-
</ListItem>
|
|
55
|
-
{!isSuccess && !isError && (
|
|
56
|
-
<ListItem>
|
|
57
|
-
<Loading text="Fetching Package Metadata..." />
|
|
58
|
-
</ListItem>
|
|
59
|
-
)}
|
|
60
|
-
{isSuccess &&
|
|
61
|
-
((data.data && (
|
|
62
|
-
<ListItem dense={true} disablePadding={true}>
|
|
63
|
-
<ListItemText
|
|
64
|
-
primary="Description"
|
|
65
|
-
primaryTypographyProps={{
|
|
66
|
-
fontWeight: "500",
|
|
67
|
-
}}
|
|
68
|
-
secondary={data.data.description}
|
|
69
|
-
/>
|
|
70
|
-
</ListItem>
|
|
71
|
-
)) || (
|
|
72
|
-
<ListItem
|
|
73
|
-
disablePadding={true}
|
|
74
|
-
dense={true}
|
|
75
|
-
sx={{ mt: "20px" }}
|
|
76
|
-
>
|
|
77
|
-
<ErrorIcon
|
|
78
|
-
sx={{
|
|
79
|
-
color: "grey.600",
|
|
80
|
-
mr: "10px",
|
|
81
|
-
}}
|
|
82
|
-
/>
|
|
83
|
-
<ListItemText primary={"No package manifest"} />
|
|
84
|
-
</ListItem>
|
|
85
|
-
))}
|
|
86
|
-
{isError && (
|
|
87
|
-
<ApiErrorDisplay
|
|
88
|
-
error={error}
|
|
89
|
-
context={`${projectName} > ${packageName} > ${versionId}`}
|
|
90
|
-
/>
|
|
91
|
-
)}
|
|
92
|
-
</List>
|
|
93
|
-
</Box>
|
|
94
|
-
</PackageCardContent>
|
|
95
|
-
</PackageCard>
|
|
96
|
-
);
|
|
97
|
-
}
|
|
@@ -1,373 +0,0 @@
|
|
|
1
|
-
import SearchIcon from "@mui/icons-material/Search";
|
|
2
|
-
import {
|
|
3
|
-
Box,
|
|
4
|
-
Dialog,
|
|
5
|
-
DialogContent,
|
|
6
|
-
DialogTitle,
|
|
7
|
-
IconButton,
|
|
8
|
-
Snackbar,
|
|
9
|
-
Table,
|
|
10
|
-
TableBody,
|
|
11
|
-
TableCell,
|
|
12
|
-
TableRow,
|
|
13
|
-
Typography,
|
|
14
|
-
} from "@mui/material";
|
|
15
|
-
import { useQueryClient } from "@tanstack/react-query";
|
|
16
|
-
import { useState } from "react";
|
|
17
|
-
import { Connection as ApiConnection } from "../../client/api";
|
|
18
|
-
import {
|
|
19
|
-
useMutationWithApiError,
|
|
20
|
-
useQueryWithApiError,
|
|
21
|
-
} from "../../hooks/useQueryWithApiError";
|
|
22
|
-
import { encodeResourceUri, parseResourceUri } from "../../utils/formatting";
|
|
23
|
-
import { ApiErrorDisplay } from "../ApiErrorDisplay";
|
|
24
|
-
import AddConnectionDialog from "../Connections/AddConnectionDialog";
|
|
25
|
-
import DeleteConnectionDialog from "../Connections/DeleteConnectionDialog";
|
|
26
|
-
import EditConnectionDialog from "../Connections/EditConnectionDialog";
|
|
27
|
-
import ConnectionExplorer from "../Project/ConnectionExplorer";
|
|
28
|
-
import { useServer } from "../ServerProvider";
|
|
29
|
-
import {
|
|
30
|
-
PackageCard,
|
|
31
|
-
PackageCardContent,
|
|
32
|
-
PackageSectionTitle,
|
|
33
|
-
} from "../styles";
|
|
34
|
-
|
|
35
|
-
type ConnectionProps = {
|
|
36
|
-
connection: ApiConnection;
|
|
37
|
-
onClick: () => void;
|
|
38
|
-
onEdit: (connection: ApiConnection) => Promise<unknown>;
|
|
39
|
-
onDelete: (connection: ApiConnection) => Promise<unknown> | void;
|
|
40
|
-
isMutating: boolean;
|
|
41
|
-
mutable: boolean;
|
|
42
|
-
isAdding: boolean;
|
|
43
|
-
};
|
|
44
|
-
|
|
45
|
-
// TODO(jjs) - Move this UI to the ConnectionExplorer component
|
|
46
|
-
function Connection({
|
|
47
|
-
connection,
|
|
48
|
-
onClick,
|
|
49
|
-
onEdit,
|
|
50
|
-
onDelete,
|
|
51
|
-
isMutating,
|
|
52
|
-
mutable,
|
|
53
|
-
isAdding,
|
|
54
|
-
}: ConnectionProps) {
|
|
55
|
-
return (
|
|
56
|
-
<TableRow
|
|
57
|
-
key={connection.name}
|
|
58
|
-
sx={{
|
|
59
|
-
"&:hover": {
|
|
60
|
-
backgroundColor: isAdding ? undefined : "action.hover",
|
|
61
|
-
},
|
|
62
|
-
}}
|
|
63
|
-
>
|
|
64
|
-
<TableCell
|
|
65
|
-
sx={{
|
|
66
|
-
cursor: isAdding ? "default" : "pointer",
|
|
67
|
-
flexGrow: 1,
|
|
68
|
-
opacity: isAdding ? 0.5 : 1,
|
|
69
|
-
}}
|
|
70
|
-
onClick={isAdding ? undefined : onClick}
|
|
71
|
-
>
|
|
72
|
-
<Box
|
|
73
|
-
sx={{
|
|
74
|
-
display: "flex",
|
|
75
|
-
alignItems: "center",
|
|
76
|
-
gap: 1,
|
|
77
|
-
}}
|
|
78
|
-
>
|
|
79
|
-
<Typography variant="body2">{connection.name}</Typography>
|
|
80
|
-
<SearchIcon
|
|
81
|
-
sx={{
|
|
82
|
-
fontSize: "1rem",
|
|
83
|
-
color: "action.active",
|
|
84
|
-
opacity: 0.7,
|
|
85
|
-
}}
|
|
86
|
-
/>
|
|
87
|
-
</Box>
|
|
88
|
-
</TableCell>
|
|
89
|
-
<TableCell sx={{ minWidth: "120px" }}>
|
|
90
|
-
<Typography variant="body2">{connection.type}</Typography>
|
|
91
|
-
</TableCell>
|
|
92
|
-
{mutable && (
|
|
93
|
-
<TableCell sx={{ minWidth: "120px" }}>
|
|
94
|
-
<EditConnectionDialog
|
|
95
|
-
connection={connection}
|
|
96
|
-
onSubmit={onEdit}
|
|
97
|
-
isSubmitting={isMutating}
|
|
98
|
-
/>
|
|
99
|
-
<DeleteConnectionDialog
|
|
100
|
-
connection={connection}
|
|
101
|
-
onCloseDialog={() => {}}
|
|
102
|
-
isMutating={isMutating}
|
|
103
|
-
onDelete={() => onDelete(connection)}
|
|
104
|
-
/>
|
|
105
|
-
</TableCell>
|
|
106
|
-
)}
|
|
107
|
-
</TableRow>
|
|
108
|
-
);
|
|
109
|
-
}
|
|
110
|
-
|
|
111
|
-
type ConnectionsProps = {
|
|
112
|
-
resourceUri: string;
|
|
113
|
-
};
|
|
114
|
-
|
|
115
|
-
export default function Connections({ resourceUri }: ConnectionsProps) {
|
|
116
|
-
const { apiClients, mutable } = useServer();
|
|
117
|
-
const queryClient = useQueryClient();
|
|
118
|
-
const { projectName: projectName } = parseResourceUri(resourceUri);
|
|
119
|
-
const [notificationMessage, setNotificationMessage] = useState("");
|
|
120
|
-
const [selectedConnection, setSelectedConnection] = useState<string | null>(
|
|
121
|
-
null,
|
|
122
|
-
);
|
|
123
|
-
const selectedConnectionResourceUri = encodeResourceUri({
|
|
124
|
-
projectName: projectName,
|
|
125
|
-
connectionName: selectedConnection,
|
|
126
|
-
});
|
|
127
|
-
|
|
128
|
-
const { data, isSuccess, isError, error } = useQueryWithApiError({
|
|
129
|
-
queryKey: ["connections", projectName],
|
|
130
|
-
queryFn: () => apiClients.connections.listConnections(projectName),
|
|
131
|
-
});
|
|
132
|
-
|
|
133
|
-
const handleConnectionClick = (connectionName: string) => {
|
|
134
|
-
setSelectedConnection(connectionName);
|
|
135
|
-
};
|
|
136
|
-
|
|
137
|
-
const handleCloseDialog = () => {
|
|
138
|
-
setSelectedConnection(null);
|
|
139
|
-
};
|
|
140
|
-
|
|
141
|
-
const addConnection = useMutationWithApiError({
|
|
142
|
-
mutationFn: (payload: ApiConnection) => {
|
|
143
|
-
return apiClients.projects.updateProject(projectName, {
|
|
144
|
-
name: projectName,
|
|
145
|
-
connections: [...data.data, payload],
|
|
146
|
-
});
|
|
147
|
-
},
|
|
148
|
-
onSuccess() {
|
|
149
|
-
setNotificationMessage("Connection added successfully");
|
|
150
|
-
queryClient.invalidateQueries({
|
|
151
|
-
queryKey: ["connections", projectName],
|
|
152
|
-
});
|
|
153
|
-
},
|
|
154
|
-
onError(error) {
|
|
155
|
-
setNotificationMessage(error.message);
|
|
156
|
-
},
|
|
157
|
-
});
|
|
158
|
-
|
|
159
|
-
const updateConnection = useMutationWithApiError({
|
|
160
|
-
mutationFn: (payload: ApiConnection) => {
|
|
161
|
-
return apiClients.projects.updateProject(projectName, {
|
|
162
|
-
name: projectName,
|
|
163
|
-
connections: data.data.map((conn) =>
|
|
164
|
-
conn.name === payload.name ? payload : conn,
|
|
165
|
-
),
|
|
166
|
-
});
|
|
167
|
-
},
|
|
168
|
-
onSuccess(_data, variables) {
|
|
169
|
-
setNotificationMessage(
|
|
170
|
-
`Connection ${variables.name} updated successfully`,
|
|
171
|
-
);
|
|
172
|
-
queryClient.invalidateQueries({
|
|
173
|
-
queryKey: ["connections", projectName],
|
|
174
|
-
});
|
|
175
|
-
},
|
|
176
|
-
onError(error) {
|
|
177
|
-
setNotificationMessage(error.message);
|
|
178
|
-
},
|
|
179
|
-
});
|
|
180
|
-
|
|
181
|
-
const deleteConnection = useMutationWithApiError({
|
|
182
|
-
mutationFn: (payload: ApiConnection) => {
|
|
183
|
-
return apiClients.projects.updateProject(projectName, {
|
|
184
|
-
name: projectName,
|
|
185
|
-
connections: data.data.filter((conn) => conn.name !== payload.name),
|
|
186
|
-
});
|
|
187
|
-
},
|
|
188
|
-
onSuccess(_data, variables) {
|
|
189
|
-
setNotificationMessage(
|
|
190
|
-
`Connection ${variables.name} deleted successfully`,
|
|
191
|
-
);
|
|
192
|
-
queryClient.invalidateQueries({
|
|
193
|
-
queryKey: ["connections", projectName],
|
|
194
|
-
});
|
|
195
|
-
},
|
|
196
|
-
onError(error) {
|
|
197
|
-
setNotificationMessage(error.message);
|
|
198
|
-
},
|
|
199
|
-
});
|
|
200
|
-
|
|
201
|
-
return (
|
|
202
|
-
<>
|
|
203
|
-
<PackageCard>
|
|
204
|
-
<PackageCardContent>
|
|
205
|
-
<PackageSectionTitle>Database Connections</PackageSectionTitle>
|
|
206
|
-
<Box
|
|
207
|
-
sx={{
|
|
208
|
-
mb: 1,
|
|
209
|
-
maxHeight: "200px",
|
|
210
|
-
overflowY: "auto",
|
|
211
|
-
}}
|
|
212
|
-
>
|
|
213
|
-
{!isSuccess && !isError && (
|
|
214
|
-
<Typography variant="body2" sx={{ m: "auto" }}>
|
|
215
|
-
Fetching Connections...
|
|
216
|
-
</Typography>
|
|
217
|
-
)}
|
|
218
|
-
{isSuccess && data.data.length > 0 && (
|
|
219
|
-
<Table
|
|
220
|
-
size="small"
|
|
221
|
-
sx={{
|
|
222
|
-
borderCollapse: "collapse",
|
|
223
|
-
"& .MuiTableRow-root": {
|
|
224
|
-
display: "flex",
|
|
225
|
-
width: "100%",
|
|
226
|
-
},
|
|
227
|
-
"& .MuiTableCell-root": {
|
|
228
|
-
borderBottom: "1px solid #e0e0e0",
|
|
229
|
-
display: "flex",
|
|
230
|
-
alignItems: "center",
|
|
231
|
-
},
|
|
232
|
-
"& .MuiTableRow-root:last-child .MuiTableCell-root":
|
|
233
|
-
{
|
|
234
|
-
borderBottom: "none",
|
|
235
|
-
},
|
|
236
|
-
}}
|
|
237
|
-
>
|
|
238
|
-
<TableBody>
|
|
239
|
-
<TableRow>
|
|
240
|
-
<TableCell sx={{ flexGrow: 1 }}>
|
|
241
|
-
<Typography
|
|
242
|
-
variant="body2"
|
|
243
|
-
fontWeight="500"
|
|
244
|
-
color="text.secondary"
|
|
245
|
-
>
|
|
246
|
-
Connection Name
|
|
247
|
-
</Typography>
|
|
248
|
-
</TableCell>
|
|
249
|
-
<TableCell sx={{ minWidth: "120px" }}>
|
|
250
|
-
<Typography
|
|
251
|
-
variant="body2"
|
|
252
|
-
fontWeight="500"
|
|
253
|
-
color="text.secondary"
|
|
254
|
-
>
|
|
255
|
-
Type
|
|
256
|
-
</Typography>
|
|
257
|
-
</TableCell>
|
|
258
|
-
{mutable && (
|
|
259
|
-
<TableCell sx={{ minWidth: "120px" }}>
|
|
260
|
-
<Typography
|
|
261
|
-
variant="body2"
|
|
262
|
-
fontWeight="500"
|
|
263
|
-
color="text.secondary"
|
|
264
|
-
sx={{ mx: "auto" }}
|
|
265
|
-
>
|
|
266
|
-
Actions
|
|
267
|
-
</Typography>
|
|
268
|
-
</TableCell>
|
|
269
|
-
)}
|
|
270
|
-
</TableRow>
|
|
271
|
-
{data.data.map((conn) => (
|
|
272
|
-
<Connection
|
|
273
|
-
key={conn.name}
|
|
274
|
-
connection={conn}
|
|
275
|
-
onClick={() =>
|
|
276
|
-
handleConnectionClick(conn.name)
|
|
277
|
-
}
|
|
278
|
-
onEdit={(payload) =>
|
|
279
|
-
updateConnection.mutateAsync(payload)
|
|
280
|
-
}
|
|
281
|
-
onDelete={(payload) => {
|
|
282
|
-
if (!conn.resource) {
|
|
283
|
-
deleteConnection.mutateAsync(payload);
|
|
284
|
-
} else {
|
|
285
|
-
setNotificationMessage(
|
|
286
|
-
"Cannot delete this connection",
|
|
287
|
-
);
|
|
288
|
-
}
|
|
289
|
-
}}
|
|
290
|
-
isMutating={
|
|
291
|
-
addConnection.isPending ||
|
|
292
|
-
updateConnection.isPending ||
|
|
293
|
-
deleteConnection.isPending
|
|
294
|
-
}
|
|
295
|
-
mutable={mutable}
|
|
296
|
-
isAdding={addConnection.isPending}
|
|
297
|
-
/>
|
|
298
|
-
))}
|
|
299
|
-
</TableBody>
|
|
300
|
-
</Table>
|
|
301
|
-
)}
|
|
302
|
-
{isSuccess && data.data.length === 0 && (
|
|
303
|
-
<Typography variant="body2">No Connections</Typography>
|
|
304
|
-
)}
|
|
305
|
-
{isError && (
|
|
306
|
-
<ApiErrorDisplay
|
|
307
|
-
error={error}
|
|
308
|
-
context={`${projectName} > Connections`}
|
|
309
|
-
/>
|
|
310
|
-
)}
|
|
311
|
-
</Box>
|
|
312
|
-
{mutable && (
|
|
313
|
-
<Box sx={{ display: "flex", justifyContent: "flex-end" }}>
|
|
314
|
-
<AddConnectionDialog
|
|
315
|
-
onSubmit={(payload) =>
|
|
316
|
-
addConnection.mutateAsync(payload)
|
|
317
|
-
}
|
|
318
|
-
isSubmitting={addConnection.isPending}
|
|
319
|
-
/>
|
|
320
|
-
</Box>
|
|
321
|
-
)}
|
|
322
|
-
</PackageCardContent>
|
|
323
|
-
</PackageCard>
|
|
324
|
-
|
|
325
|
-
<Snackbar
|
|
326
|
-
open={notificationMessage !== ""}
|
|
327
|
-
autoHideDuration={6000}
|
|
328
|
-
onClose={() => setNotificationMessage("")}
|
|
329
|
-
message={notificationMessage}
|
|
330
|
-
/>
|
|
331
|
-
|
|
332
|
-
{/* Connection Explorer Dialog */}
|
|
333
|
-
<Dialog
|
|
334
|
-
open={selectedConnection !== null}
|
|
335
|
-
onClose={handleCloseDialog}
|
|
336
|
-
maxWidth="lg"
|
|
337
|
-
fullWidth
|
|
338
|
-
>
|
|
339
|
-
<DialogTitle>
|
|
340
|
-
Connection Explorer: {selectedConnection}
|
|
341
|
-
<IconButton
|
|
342
|
-
aria-label="close"
|
|
343
|
-
onClick={handleCloseDialog}
|
|
344
|
-
sx={{ position: "absolute", right: 8, top: 8 }}
|
|
345
|
-
>
|
|
346
|
-
<Box
|
|
347
|
-
sx={{
|
|
348
|
-
width: 24,
|
|
349
|
-
height: 24,
|
|
350
|
-
display: "flex",
|
|
351
|
-
alignItems: "center",
|
|
352
|
-
justifyContent: "center",
|
|
353
|
-
}}
|
|
354
|
-
>
|
|
355
|
-
X
|
|
356
|
-
</Box>
|
|
357
|
-
</IconButton>
|
|
358
|
-
</DialogTitle>
|
|
359
|
-
<DialogContent>
|
|
360
|
-
{selectedConnection && (
|
|
361
|
-
<ConnectionExplorer
|
|
362
|
-
resourceUri={selectedConnectionResourceUri}
|
|
363
|
-
connectionName={selectedConnection}
|
|
364
|
-
connection={data?.data?.find(
|
|
365
|
-
(c) => c.name === selectedConnection,
|
|
366
|
-
)}
|
|
367
|
-
/>
|
|
368
|
-
)}
|
|
369
|
-
</DialogContent>
|
|
370
|
-
</Dialog>
|
|
371
|
-
</>
|
|
372
|
-
);
|
|
373
|
-
}
|
|
@@ -1,228 +0,0 @@
|
|
|
1
|
-
import {
|
|
2
|
-
Box,
|
|
3
|
-
Dialog,
|
|
4
|
-
DialogContent,
|
|
5
|
-
DialogTitle,
|
|
6
|
-
Table,
|
|
7
|
-
TableBody,
|
|
8
|
-
TableCell,
|
|
9
|
-
TableContainer,
|
|
10
|
-
TableHead,
|
|
11
|
-
TableRow,
|
|
12
|
-
Typography,
|
|
13
|
-
IconButton,
|
|
14
|
-
} from "@mui/material";
|
|
15
|
-
import SearchIcon from "@mui/icons-material/Search";
|
|
16
|
-
import React from "react";
|
|
17
|
-
import { Database } from "../../client";
|
|
18
|
-
import { useQueryWithApiError } from "../../hooks/useQueryWithApiError";
|
|
19
|
-
import { ApiErrorDisplay } from "../ApiErrorDisplay";
|
|
20
|
-
import { Loading } from "../Loading";
|
|
21
|
-
import {
|
|
22
|
-
PackageCard,
|
|
23
|
-
PackageCardContent,
|
|
24
|
-
PackageSectionTitle,
|
|
25
|
-
} from "../styles";
|
|
26
|
-
import { parseResourceUri } from "../../utils/formatting";
|
|
27
|
-
import { useServer } from "../ServerProvider";
|
|
28
|
-
|
|
29
|
-
type Props = {
|
|
30
|
-
resourceUri: string;
|
|
31
|
-
};
|
|
32
|
-
|
|
33
|
-
export default function Databases({ resourceUri }: Props) {
|
|
34
|
-
const { apiClients } = useServer();
|
|
35
|
-
const {
|
|
36
|
-
projectName: projectName,
|
|
37
|
-
packageName: packageName,
|
|
38
|
-
versionId: versionId,
|
|
39
|
-
} = parseResourceUri(resourceUri);
|
|
40
|
-
|
|
41
|
-
const [open, setOpen] = React.useState(false);
|
|
42
|
-
const [selectedDatabase, setSelectedDatabase] =
|
|
43
|
-
React.useState<Database | null>(null);
|
|
44
|
-
|
|
45
|
-
const handleOpen = (database: Database) => {
|
|
46
|
-
setSelectedDatabase(database);
|
|
47
|
-
setOpen(true);
|
|
48
|
-
};
|
|
49
|
-
|
|
50
|
-
const handleClose = () => {
|
|
51
|
-
setOpen(false);
|
|
52
|
-
setSelectedDatabase(null);
|
|
53
|
-
};
|
|
54
|
-
|
|
55
|
-
const { data, isError, error, isSuccess } = useQueryWithApiError({
|
|
56
|
-
queryKey: ["databases", projectName, packageName, versionId],
|
|
57
|
-
queryFn: () =>
|
|
58
|
-
apiClients.databases.listDatabases(
|
|
59
|
-
projectName,
|
|
60
|
-
packageName,
|
|
61
|
-
versionId,
|
|
62
|
-
),
|
|
63
|
-
});
|
|
64
|
-
const formatRowSize = (size: number) => {
|
|
65
|
-
if (size >= 1024 * 1024 * 1024 * 1024) {
|
|
66
|
-
return `${(size / (1024 * 1024 * 1024)).toFixed(2)} T`;
|
|
67
|
-
} else if (size >= 1024 * 1024 * 1024) {
|
|
68
|
-
return `${(size / (1024 * 1024 * 1024)).toFixed(2)} G`;
|
|
69
|
-
} else if (size >= 1024 * 1024) {
|
|
70
|
-
return `${(size / (1024 * 1024)).toFixed(2)} M`;
|
|
71
|
-
} else {
|
|
72
|
-
return `${(size / 1024).toFixed(2)} K`;
|
|
73
|
-
}
|
|
74
|
-
};
|
|
75
|
-
return (
|
|
76
|
-
<>
|
|
77
|
-
<PackageCard>
|
|
78
|
-
<PackageCardContent>
|
|
79
|
-
<PackageSectionTitle>Embedded Databases</PackageSectionTitle>
|
|
80
|
-
<Box
|
|
81
|
-
sx={{
|
|
82
|
-
maxHeight: "200px",
|
|
83
|
-
overflowY: "auto",
|
|
84
|
-
}}
|
|
85
|
-
>
|
|
86
|
-
{!isSuccess && !isError && (
|
|
87
|
-
<Loading text="Fetching Databases..." />
|
|
88
|
-
)}
|
|
89
|
-
{isError && (
|
|
90
|
-
<ApiErrorDisplay
|
|
91
|
-
error={error}
|
|
92
|
-
context={`${projectName} > ${packageName} > Databases`}
|
|
93
|
-
/>
|
|
94
|
-
)}
|
|
95
|
-
{isSuccess && data.data.length > 0 && (
|
|
96
|
-
<Table
|
|
97
|
-
size="small"
|
|
98
|
-
sx={{
|
|
99
|
-
borderCollapse: "collapse",
|
|
100
|
-
"& .MuiTableCell-root": {
|
|
101
|
-
borderBottom: "1px solid #e0e0e0",
|
|
102
|
-
},
|
|
103
|
-
"& .MuiTableRow-root:last-child .MuiTableCell-root":
|
|
104
|
-
{
|
|
105
|
-
borderBottom: "none",
|
|
106
|
-
},
|
|
107
|
-
}}
|
|
108
|
-
>
|
|
109
|
-
<TableBody>
|
|
110
|
-
<TableRow>
|
|
111
|
-
<TableCell>
|
|
112
|
-
<Typography
|
|
113
|
-
variant="body2"
|
|
114
|
-
fontWeight="500"
|
|
115
|
-
color="text.secondary"
|
|
116
|
-
>
|
|
117
|
-
Name
|
|
118
|
-
</Typography>
|
|
119
|
-
</TableCell>
|
|
120
|
-
<TableCell align="right">
|
|
121
|
-
<Typography
|
|
122
|
-
variant="body2"
|
|
123
|
-
fontWeight="500"
|
|
124
|
-
color="text.secondary"
|
|
125
|
-
>
|
|
126
|
-
Rows
|
|
127
|
-
</Typography>
|
|
128
|
-
</TableCell>
|
|
129
|
-
</TableRow>
|
|
130
|
-
{data.data.map((database) => (
|
|
131
|
-
<TableRow
|
|
132
|
-
key={database.path}
|
|
133
|
-
onClick={() => handleOpen(database)}
|
|
134
|
-
sx={{
|
|
135
|
-
cursor: "pointer",
|
|
136
|
-
"&:hover": {
|
|
137
|
-
backgroundColor: "action.hover",
|
|
138
|
-
},
|
|
139
|
-
}}
|
|
140
|
-
>
|
|
141
|
-
<TableCell component="th" scope="row">
|
|
142
|
-
<Box
|
|
143
|
-
sx={{
|
|
144
|
-
display: "flex",
|
|
145
|
-
alignItems: "center",
|
|
146
|
-
gap: 1,
|
|
147
|
-
}}
|
|
148
|
-
>
|
|
149
|
-
<Typography variant="body2">
|
|
150
|
-
{database.path}
|
|
151
|
-
</Typography>
|
|
152
|
-
<SearchIcon
|
|
153
|
-
sx={{
|
|
154
|
-
fontSize: "1rem",
|
|
155
|
-
color: "action.active",
|
|
156
|
-
opacity: 0.7,
|
|
157
|
-
}}
|
|
158
|
-
/>
|
|
159
|
-
</Box>
|
|
160
|
-
</TableCell>
|
|
161
|
-
<TableCell align="right">
|
|
162
|
-
<Typography variant="body2">
|
|
163
|
-
{formatRowSize(database.info.rowCount)}
|
|
164
|
-
</Typography>
|
|
165
|
-
</TableCell>
|
|
166
|
-
</TableRow>
|
|
167
|
-
))}
|
|
168
|
-
</TableBody>
|
|
169
|
-
</Table>
|
|
170
|
-
)}
|
|
171
|
-
{isSuccess && data.data.length === 0 && (
|
|
172
|
-
<Typography variant="body2" sx={{ m: "auto" }}>
|
|
173
|
-
No databases found
|
|
174
|
-
</Typography>
|
|
175
|
-
)}
|
|
176
|
-
</Box>
|
|
177
|
-
</PackageCardContent>
|
|
178
|
-
</PackageCard>
|
|
179
|
-
|
|
180
|
-
<Dialog open={open} onClose={handleClose} maxWidth="sm" fullWidth>
|
|
181
|
-
<DialogTitle>
|
|
182
|
-
{selectedDatabase?.path}
|
|
183
|
-
<IconButton
|
|
184
|
-
aria-label="close"
|
|
185
|
-
onClick={handleClose}
|
|
186
|
-
sx={{ position: "absolute", right: 8, top: 8 }}
|
|
187
|
-
>
|
|
188
|
-
<Box
|
|
189
|
-
sx={{
|
|
190
|
-
width: 24,
|
|
191
|
-
height: 24,
|
|
192
|
-
display: "flex",
|
|
193
|
-
alignItems: "center",
|
|
194
|
-
justifyContent: "center",
|
|
195
|
-
}}
|
|
196
|
-
>
|
|
197
|
-
X
|
|
198
|
-
</Box>
|
|
199
|
-
</IconButton>
|
|
200
|
-
</DialogTitle>
|
|
201
|
-
<DialogContent>
|
|
202
|
-
{selectedDatabase?.info?.columns && (
|
|
203
|
-
<TableContainer>
|
|
204
|
-
<Table size="small">
|
|
205
|
-
<TableHead>
|
|
206
|
-
<TableRow>
|
|
207
|
-
<TableCell>Column</TableCell>
|
|
208
|
-
<TableCell>Type</TableCell>
|
|
209
|
-
</TableRow>
|
|
210
|
-
</TableHead>
|
|
211
|
-
<TableBody>
|
|
212
|
-
{selectedDatabase.info.columns.map((column) => (
|
|
213
|
-
<TableRow key={column.name}>
|
|
214
|
-
<TableCell component="th" scope="row">
|
|
215
|
-
{column.name}
|
|
216
|
-
</TableCell>
|
|
217
|
-
<TableCell>{column.type}</TableCell>
|
|
218
|
-
</TableRow>
|
|
219
|
-
))}
|
|
220
|
-
</TableBody>
|
|
221
|
-
</Table>
|
|
222
|
-
</TableContainer>
|
|
223
|
-
)}
|
|
224
|
-
</DialogContent>
|
|
225
|
-
</Dialog>
|
|
226
|
-
</>
|
|
227
|
-
);
|
|
228
|
-
}
|