@malloy-publisher/sdk 0.3.0 → 0.4.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 +22 -9
- package/dist/DocumentStorageProvider-CyOJ0hqf.es.js +24443 -0
- package/dist/DocumentStorageProvider-DGPQEd_l.cjs.js +134 -0
- package/dist/RenderedResult-BnPzJ9Jf.es.js +549 -0
- package/dist/RenderedResult-Dp22kZsQ.cjs.js +115 -0
- package/dist/{ServerProvider-DSK9rfSY.es.js → ServerProvider-BWOEKg0O.es.js} +1256 -1318
- package/dist/ServerProvider-Cc489A3f.cjs.js +1 -0
- package/dist/builder/index.cjs.js +105 -0
- package/dist/builder/index.d.ts +2 -0
- package/dist/builder/index.es.js +9482 -0
- package/dist/builder-entry.d.ts +8 -0
- package/dist/client/api.d.ts +100 -42
- package/dist/client/index.cjs.js +1 -1
- package/dist/client/index.es.js +1 -1
- package/dist/components/AppDialog.d.ts +30 -0
- package/dist/components/BackLink.d.ts +32 -0
- package/dist/components/Dashboard/Dashboard.d.ts +19 -14
- package/dist/components/Dashboard/DashboardBar.d.ts +21 -0
- package/dist/components/Dashboard/DashboardGrid.d.ts +67 -0
- package/dist/components/Dashboard/DashboardTile.d.ts +6 -1
- package/dist/components/Dashboard/ExploreDialog.d.ts +18 -0
- package/dist/components/Dashboard/RowsDialog.d.ts +47 -0
- package/dist/components/Dashboard/TileCard.d.ts +44 -0
- package/dist/components/Dashboard/index.d.ts +2 -0
- package/dist/components/Dashboard/promoteMeasureRow.d.ts +7 -3
- package/dist/components/Dashboard/telemetry.d.ts +48 -0
- package/dist/components/DashboardBuilder/AddTileDialog.d.ts +35 -0
- package/dist/components/DashboardBuilder/BuilderToolbar.d.ts +31 -0
- package/dist/components/DashboardBuilder/DashboardBuilder.d.ts +118 -0
- package/dist/components/DashboardBuilder/DashboardEditor.d.ts +30 -0
- package/dist/components/DashboardBuilder/DiffDialog.d.ts +15 -0
- package/dist/components/DashboardBuilder/DrillDialog.d.ts +15 -0
- package/dist/components/DashboardBuilder/FilterDialog.d.ts +54 -0
- package/dist/components/DashboardBuilder/FilterStrip.d.ts +17 -0
- package/dist/components/DashboardBuilder/SettingsPopover.d.ts +20 -0
- package/dist/components/DashboardBuilder/TileFrame.d.ts +42 -0
- package/dist/components/DashboardBuilder/TileMenu.d.ts +24 -0
- package/dist/components/DashboardBuilder/catalog.d.ts +62 -0
- package/dist/components/DashboardBuilder/controls.d.ts +157 -0
- package/dist/components/DashboardBuilder/diff.d.ts +35 -0
- package/dist/components/DashboardBuilder/document.d.ts +218 -0
- package/dist/components/DashboardBuilder/layout.d.ts +71 -0
- package/dist/components/DashboardBuilder/malloyText.d.ts +45 -0
- package/dist/components/DashboardBuilder/newDashboard.d.ts +17 -0
- package/dist/components/DashboardBuilder/preview.d.ts +60 -0
- package/dist/components/DashboardBuilder/readDocument.d.ts +106 -0
- package/dist/components/DashboardBuilder/sortable.d.ts +51 -0
- package/dist/components/DashboardBuilder/spliceDocument.d.ts +53 -0
- package/dist/components/DashboardBuilder/testing/fixtures.d.ts +10 -0
- package/dist/components/DashboardBuilder/useBuilderShortcuts.d.ts +22 -0
- package/dist/components/DashboardBuilder/useDashboardEditor.d.ts +63 -0
- package/dist/components/DashboardBuilder/useDraft.d.ts +13 -0
- package/dist/components/DashboardBuilder/useFilterForm.d.ts +65 -0
- package/dist/components/DashboardBuilder/useTileReorder.d.ts +22 -0
- package/dist/components/DashboardBuilder/useTileResize.d.ts +29 -0
- package/dist/components/DocumentStorage/DocumentStorageProvider.d.ts +7 -0
- package/dist/components/DocumentStorage/index.d.ts +1 -1
- package/dist/components/FloatingIconButton.d.ts +16 -0
- package/dist/components/ItemRow.d.ts +38 -0
- package/dist/components/Materializations/MaterializationDetailDialog.d.ts +1 -2
- package/dist/components/Materializations/MaterializationRunsList.d.ts +1 -5
- package/dist/components/Materializations/Materializations.d.ts +7 -3
- package/dist/components/Materializations/ScopeButton.d.ts +18 -0
- package/dist/components/Materializations/SectionLabel.d.ts +7 -4
- package/dist/components/Materializations/TriggerLabel.d.ts +14 -0
- package/dist/components/Materializations/index.d.ts +0 -1
- package/dist/components/Package/ContentTypeIcon.d.ts +3 -5
- package/dist/components/Package/NewDashboardDialog.d.ts +18 -0
- package/dist/components/Package/index.d.ts +0 -1
- package/dist/components/PackageSection.d.ts +23 -0
- package/dist/components/Prose.d.ts +46 -0
- package/dist/components/RenderedResult/ResultPanel.d.ts +30 -0
- package/dist/components/RenderedResult/index.d.ts +1 -0
- package/dist/components/buttons.d.ts +53 -0
- package/dist/components/drill/index.d.ts +1 -1
- package/dist/components/drill/resolveDrill.d.ts +22 -0
- package/dist/components/drill/useDrill.d.ts +11 -2
- package/dist/components/index.d.ts +6 -0
- package/dist/components/styles.d.ts +49 -44
- package/dist/hooks/index.d.ts +2 -0
- package/dist/hooks/useCrudMutation.d.ts +42 -0
- package/dist/hooks/useDocumentControls.d.ts +70 -0
- package/dist/hooks/useQueryResult.d.ts +40 -0
- package/dist/index.cjs.js +22 -273
- package/dist/index.d.ts +1 -0
- package/dist/index.es.js +16888 -44451
- package/dist/telemetry/consoleEvents.d.ts +60 -0
- package/dist/utils/malloyLiteral.d.ts +11 -0
- package/dist/utils/sha256.d.ts +2 -0
- package/package.json +24 -9
- package/src/builder-entry.ts +55 -0
- package/src/components/AppDialog.tsx +115 -0
- package/src/components/BackLink.tsx +83 -0
- package/src/components/Connections/AddConnectionDialog.tsx +50 -70
- package/src/components/Connections/DeleteConnectionDialog.tsx +23 -50
- package/src/components/Connections/EditConnectionDialog.tsx +54 -73
- package/src/components/Dashboard/Dashboard.spec.tsx +7 -10
- package/src/components/Dashboard/Dashboard.tsx +165 -175
- package/src/components/Dashboard/DashboardBar.tsx +88 -0
- package/src/components/Dashboard/DashboardGrid.tsx +124 -0
- package/src/components/Dashboard/DashboardTile.spec.tsx +30 -6
- package/src/components/Dashboard/DashboardTile.tsx +66 -123
- package/src/components/Dashboard/ExploreDialog.tsx +84 -0
- package/src/components/Dashboard/RowsDialog.spec.ts +42 -0
- package/src/components/Dashboard/RowsDialog.tsx +234 -0
- package/src/components/Dashboard/TileCard.tsx +120 -0
- package/src/components/Dashboard/index.ts +2 -0
- package/src/components/Dashboard/promoteMeasureRow.spec.ts +70 -0
- package/src/components/Dashboard/promoteMeasureRow.ts +33 -2
- package/src/components/Dashboard/telemetry.ts +51 -0
- package/src/components/Dashboard/tileGridColumn.spec.ts +1 -1
- package/src/components/DashboardBuilder/AddTileDialog.tsx +247 -0
- package/src/components/DashboardBuilder/BuilderToolbar.tsx +162 -0
- package/src/components/DashboardBuilder/DashboardBuilder.spec.tsx +852 -0
- package/src/components/DashboardBuilder/DashboardBuilder.tsx +666 -0
- package/src/components/DashboardBuilder/DashboardEditor.package.spec.tsx +163 -0
- package/src/components/DashboardBuilder/DashboardEditor.spec.tsx +188 -0
- package/src/components/DashboardBuilder/DashboardEditor.tsx +567 -0
- package/src/components/DashboardBuilder/DiffDialog.tsx +122 -0
- package/src/components/DashboardBuilder/DrillDialog.tsx +269 -0
- package/src/components/DashboardBuilder/FilterDialog.tsx +562 -0
- package/src/components/DashboardBuilder/FilterStrip.tsx +126 -0
- package/src/components/DashboardBuilder/SettingsPopover.tsx +168 -0
- package/src/components/DashboardBuilder/TileFrame.tsx +380 -0
- package/src/components/DashboardBuilder/TileMenu.tsx +188 -0
- package/src/components/DashboardBuilder/catalog.spec.ts +215 -0
- package/src/components/DashboardBuilder/catalog.ts +225 -0
- package/src/components/DashboardBuilder/controls.spec.ts +243 -0
- package/src/components/DashboardBuilder/controls.ts +398 -0
- package/src/components/DashboardBuilder/diff.spec.ts +44 -0
- package/src/components/DashboardBuilder/diff.ts +93 -0
- package/src/components/DashboardBuilder/document.ts +209 -0
- package/src/components/DashboardBuilder/keepRowStructure.spec.ts +84 -0
- package/src/components/DashboardBuilder/layout.ts +143 -0
- package/src/components/DashboardBuilder/malloyText.spec.ts +84 -0
- package/src/components/DashboardBuilder/malloyText.ts +151 -0
- package/src/components/DashboardBuilder/moveIntoGap.spec.ts +90 -0
- package/src/components/DashboardBuilder/newDashboard.spec.ts +40 -0
- package/src/components/DashboardBuilder/newDashboard.ts +48 -0
- package/src/components/DashboardBuilder/preview.spec.ts +149 -0
- package/src/components/DashboardBuilder/preview.ts +172 -0
- package/src/components/DashboardBuilder/readDocument.spec.ts +375 -0
- package/src/components/DashboardBuilder/readDocument.ts +467 -0
- package/src/components/DashboardBuilder/sortable.tsx +151 -0
- package/src/components/DashboardBuilder/spliceDocument.spec.ts +1161 -0
- package/src/components/DashboardBuilder/spliceDocument.ts +1135 -0
- package/src/components/DashboardBuilder/testing/fixtures.ts +48 -0
- package/src/components/DashboardBuilder/useBuilderShortcuts.ts +88 -0
- package/src/components/DashboardBuilder/useDashboardEditor.spec.ts +311 -0
- package/src/components/DashboardBuilder/useDashboardEditor.ts +201 -0
- package/src/components/DashboardBuilder/useDraft.ts +43 -0
- package/src/components/DashboardBuilder/useFilterForm.spec.tsx +144 -0
- package/src/components/DashboardBuilder/useFilterForm.ts +352 -0
- package/src/components/DashboardBuilder/useTileReorder.spec.tsx +97 -0
- package/src/components/DashboardBuilder/useTileReorder.ts +115 -0
- package/src/components/DashboardBuilder/useTileResize.spec.tsx +121 -0
- package/src/components/DashboardBuilder/useTileResize.ts +110 -0
- package/src/components/DashboardBuilder/withGaps.spec.ts +96 -0
- package/src/components/DocumentStorage/DocumentStorageProvider.tsx +12 -0
- package/src/components/DocumentStorage/index.ts +1 -0
- package/src/components/Environment/About.tsx +16 -62
- package/src/components/Environment/AddPackageDialog.tsx +85 -154
- package/src/components/Environment/Connections.tsx +125 -205
- package/src/components/Environment/DeletePackageDialog.tsx +32 -77
- package/src/components/Environment/EditPackageDialog.tsx +46 -58
- package/src/components/Environment/Environment.tsx +34 -36
- package/src/components/Environment/Packages.tsx +63 -128
- package/src/components/FloatingIconButton.tsx +41 -0
- package/src/components/Home/AddEnvironmentDialog.tsx +47 -70
- package/src/components/Home/DeleteEnvironmentDialog.tsx +32 -77
- package/src/components/Home/EditEnvironmentDialog.tsx +47 -61
- package/src/components/Home/Home.tsx +101 -214
- package/src/components/ItemRow.tsx +165 -0
- package/src/components/Materializations/CreateMaterializationDialog.tsx +34 -51
- package/src/components/Materializations/DeleteMaterializationDialog.tsx +31 -53
- package/src/components/Materializations/MaterializationDetailDialog.tsx +60 -69
- package/src/components/Materializations/MaterializationRunsList.tsx +29 -42
- package/src/components/Materializations/Materializations.tsx +137 -140
- package/src/components/Materializations/ScopeButton.tsx +85 -0
- package/src/components/Materializations/SectionLabel.tsx +7 -4
- package/src/components/Materializations/SetScheduleDialog.tsx +48 -89
- package/src/components/Materializations/TriggerLabel.tsx +36 -0
- package/src/components/Materializations/cron.spec.ts +113 -0
- package/src/components/Materializations/index.ts +0 -1
- package/src/components/Materializations/utils.spec.ts +182 -0
- package/src/components/Model/Model.tsx +6 -23
- package/src/components/Model/ModelCell.tsx +33 -72
- package/src/components/Notebook/Notebook.tsx +25 -88
- package/src/components/Notebook/NotebookCell.tsx +35 -183
- package/src/components/Package/ContentTypeIcon.spec.ts +22 -37
- package/src/components/Package/ContentTypeIcon.tsx +10 -12
- package/src/components/Package/NewDashboardDialog.spec.tsx +129 -0
- package/src/components/Package/NewDashboardDialog.tsx +265 -0
- package/src/components/Package/Package.tsx +179 -238
- package/src/components/Package/index.ts +0 -1
- package/src/components/PackageSection.tsx +85 -0
- package/src/components/Prose.spec.tsx +85 -0
- package/src/components/Prose.tsx +179 -0
- package/src/components/QueryResult/QueryResult.tsx +15 -43
- package/src/components/RenderedResult/RenderedResult.lifecycle.spec.tsx +198 -0
- package/src/components/RenderedResult/RenderedResult.tsx +22 -8
- package/src/components/RenderedResult/ResultContainer.tsx +4 -12
- package/src/components/RenderedResult/ResultPanel.spec.tsx +49 -0
- package/src/components/RenderedResult/ResultPanel.tsx +73 -0
- package/src/components/RenderedResult/index.ts +1 -0
- package/src/components/ResultsDialog.tsx +8 -32
- package/src/components/buttons.tsx +114 -0
- package/src/components/designSystem.spec.tsx +316 -0
- package/src/components/drill/index.ts +1 -0
- package/src/components/drill/resolveDrill.ts +22 -1
- package/src/components/drill/useDrill.spec.tsx +94 -0
- package/src/components/drill/useDrill.tsx +52 -12
- package/src/components/given/GivensPanel.tsx +1 -1
- package/src/components/given/paramCodec.spec.ts +1 -1
- package/src/components/index.ts +16 -0
- package/src/components/styles.ts +49 -122
- package/src/hooks/index.ts +13 -0
- package/src/hooks/useCrudMutation.spec.tsx +119 -0
- package/src/hooks/useCrudMutation.tsx +85 -0
- package/src/hooks/useDocumentControls.ts +170 -0
- package/src/hooks/useQueryResult.ts +82 -0
- package/src/index.ts +9 -0
- package/src/telemetry/consoleEvents.spec.ts +130 -0
- package/src/telemetry/consoleEvents.ts +124 -0
- package/src/theme/defaults.ts +34 -23
- package/src/theme/resolveTheme.spec.ts +9 -4
- package/src/theme/resolveTheme.ts +12 -8
- package/src/utils/malloyLiteral.spec.ts +43 -0
- package/src/utils/malloyLiteral.ts +76 -0
- package/src/utils/sha256.ts +13 -0
- package/test/README.md +1 -1
- package/test/serverProvider.tsx +5 -2
- package/vite.config.ts +5 -0
- package/dist/ServerProvider-CGnLjzag.cjs.js +0 -1
- package/dist/components/Materializations/CreateEnvMaterializationDialog.d.ts +0 -14
- package/dist/components/Materializations/EnvironmentMaterializations.d.ts +0 -7
- package/dist/components/Materializations/ScheduleCard.d.ts +0 -20
- package/dist/components/Materializations/TriggerChip.d.ts +0 -10
- package/dist/components/Package/Models.d.ts +0 -6
- package/src/components/Materializations/CreateEnvMaterializationDialog.tsx +0 -179
- package/src/components/Materializations/EnvironmentMaterializations.tsx +0 -267
- package/src/components/Materializations/ScheduleCard.tsx +0 -231
- package/src/components/Materializations/TriggerChip.tsx +0 -44
- package/src/components/Package/Models.tsx +0 -71
|
@@ -5,12 +5,8 @@ import AddIcon from "@mui/icons-material/Add";
|
|
|
5
5
|
import DeleteIcon from "@mui/icons-material/Delete";
|
|
6
6
|
import Box from "@mui/material/Box";
|
|
7
7
|
import Button from "@mui/material/Button";
|
|
8
|
-
import Dialog from "@mui/material/Dialog";
|
|
9
|
-
import DialogActions from "@mui/material/DialogActions";
|
|
10
|
-
import DialogContent from "@mui/material/DialogContent";
|
|
11
|
-
import DialogContentText from "@mui/material/DialogContentText";
|
|
12
|
-
import DialogTitle from "@mui/material/DialogTitle";
|
|
13
8
|
import IconButton from "@mui/material/IconButton";
|
|
9
|
+
import Stack from "@mui/material/Stack";
|
|
14
10
|
import TextField from "@mui/material/TextField";
|
|
15
11
|
import Typography from "@mui/material/Typography";
|
|
16
12
|
import React, { useState } from "react";
|
|
@@ -23,6 +19,8 @@ import {
|
|
|
23
19
|
ConnectionTypeEnum,
|
|
24
20
|
DucklakeConnection,
|
|
25
21
|
} from "../../client/api";
|
|
22
|
+
import { AppDialog } from "../AppDialog";
|
|
23
|
+
import { AddButton, SecondaryButton } from "../buttons";
|
|
26
24
|
import {
|
|
27
25
|
attachedDatabaseConnectionFieldName,
|
|
28
26
|
attributesFieldName,
|
|
@@ -401,43 +399,49 @@ export default function AddConnectionDialog({
|
|
|
401
399
|
|
|
402
400
|
return (
|
|
403
401
|
<React.Fragment>
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
|
|
402
|
+
<AddButton label="Connection" onClick={handleClickOpen} />
|
|
403
|
+
<AppDialog
|
|
404
|
+
open={open}
|
|
405
|
+
onClose={handleClose}
|
|
406
|
+
title="New connection"
|
|
407
|
+
description="Add a connection so packages in this environment can query your database with Malloy."
|
|
408
|
+
actions={
|
|
409
|
+
<>
|
|
410
|
+
<Button disabled={isSubmitting} onClick={handleClose}>
|
|
411
|
+
Cancel
|
|
412
|
+
</Button>
|
|
413
|
+
<Button
|
|
414
|
+
type="submit"
|
|
415
|
+
form="connection-form"
|
|
416
|
+
variant="contained"
|
|
417
|
+
loading={isSubmitting}
|
|
418
|
+
>
|
|
419
|
+
Create connection
|
|
420
|
+
</Button>
|
|
421
|
+
</>
|
|
422
|
+
}
|
|
413
423
|
>
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
<DialogContentText>
|
|
420
|
-
Add a new connection to query your data database using Malloy.
|
|
421
|
-
</DialogContentText>
|
|
422
|
-
<form onSubmit={handleSubmit} id="connection-form">
|
|
424
|
+
<form onSubmit={handleSubmit} id="connection-form">
|
|
425
|
+
{/* One column, one gap. The fields carry no margin of
|
|
426
|
+
their own, so without this they sit flush and their
|
|
427
|
+
borders overlap. */}
|
|
428
|
+
<Stack sx={{ gap: 2 }}>
|
|
423
429
|
<TextField
|
|
424
430
|
autoFocus
|
|
425
431
|
required
|
|
426
|
-
margin="dense"
|
|
427
432
|
id="name"
|
|
428
433
|
name="name"
|
|
429
|
-
label="
|
|
434
|
+
label="Name"
|
|
430
435
|
type="text"
|
|
431
436
|
fullWidth
|
|
432
|
-
|
|
437
|
+
size="small"
|
|
433
438
|
/>
|
|
434
439
|
<TextField
|
|
435
|
-
margin="dense"
|
|
436
440
|
id="type"
|
|
437
441
|
name="type"
|
|
438
442
|
label="Connection Type"
|
|
439
443
|
fullWidth
|
|
440
|
-
|
|
444
|
+
size="small"
|
|
441
445
|
value={type}
|
|
442
446
|
select
|
|
443
447
|
onChange={(event) =>
|
|
@@ -469,11 +473,10 @@ export default function AddConnectionDialog({
|
|
|
469
473
|
Catalog
|
|
470
474
|
</Typography>
|
|
471
475
|
<TextField
|
|
472
|
-
margin="dense"
|
|
473
476
|
id="ducklake_catalogType"
|
|
474
477
|
label="Catalog Type"
|
|
475
478
|
fullWidth
|
|
476
|
-
|
|
479
|
+
size="small"
|
|
477
480
|
value={ducklakeCatalogType}
|
|
478
481
|
select
|
|
479
482
|
onChange={(event) =>
|
|
@@ -488,13 +491,12 @@ export default function AddConnectionDialog({
|
|
|
488
491
|
(field) => (
|
|
489
492
|
<TextField
|
|
490
493
|
key={`pg_${field.name}`}
|
|
491
|
-
margin="dense"
|
|
492
494
|
id={`ducklake_pg_${field.name}`}
|
|
493
495
|
name={`ducklake_pg_${field.name}`}
|
|
494
496
|
label={field.label}
|
|
495
497
|
type={field.type}
|
|
496
498
|
fullWidth
|
|
497
|
-
|
|
499
|
+
size="small"
|
|
498
500
|
/>
|
|
499
501
|
),
|
|
500
502
|
)}
|
|
@@ -518,11 +520,10 @@ export default function AddConnectionDialog({
|
|
|
518
520
|
Storage
|
|
519
521
|
</Typography>
|
|
520
522
|
<TextField
|
|
521
|
-
margin="dense"
|
|
522
523
|
id="ducklake_storageType"
|
|
523
524
|
label="Storage Type"
|
|
524
525
|
fullWidth
|
|
525
|
-
|
|
526
|
+
size="small"
|
|
526
527
|
value={ducklakeStorageType}
|
|
527
528
|
select
|
|
528
529
|
onChange={(event) =>
|
|
@@ -533,7 +534,6 @@ export default function AddConnectionDialog({
|
|
|
533
534
|
<MenuItem value="gcs">GCS</MenuItem>
|
|
534
535
|
</TextField>
|
|
535
536
|
<TextField
|
|
536
|
-
margin="dense"
|
|
537
537
|
required
|
|
538
538
|
id="ducklake_bucketUrl"
|
|
539
539
|
name="ducklake_bucketUrl"
|
|
@@ -544,7 +544,7 @@ export default function AddConnectionDialog({
|
|
|
544
544
|
}
|
|
545
545
|
type="text"
|
|
546
546
|
fullWidth
|
|
547
|
-
|
|
547
|
+
size="small"
|
|
548
548
|
/>
|
|
549
549
|
{ducklakeStorageType === "s3" && (
|
|
550
550
|
<>
|
|
@@ -565,7 +565,6 @@ export default function AddConnectionDialog({
|
|
|
565
565
|
.map((field) => (
|
|
566
566
|
<TextField
|
|
567
567
|
key={`s3_${field.name}`}
|
|
568
|
-
margin="dense"
|
|
569
568
|
id={`ducklake_s3_${field.name}`}
|
|
570
569
|
name={`ducklake_s3_${field.name}`}
|
|
571
570
|
label={field.label}
|
|
@@ -575,7 +574,7 @@ export default function AddConnectionDialog({
|
|
|
575
574
|
: field.type
|
|
576
575
|
}
|
|
577
576
|
fullWidth
|
|
578
|
-
|
|
577
|
+
size="small"
|
|
579
578
|
required={field.required}
|
|
580
579
|
select={!!field.selectOptions}
|
|
581
580
|
defaultValue={
|
|
@@ -623,13 +622,12 @@ export default function AddConnectionDialog({
|
|
|
623
622
|
{gcsAttachedDatabaseFields.map((field) => (
|
|
624
623
|
<TextField
|
|
625
624
|
key={`gcs_${field.name}`}
|
|
626
|
-
margin="dense"
|
|
627
625
|
id={`ducklake_gcs_${field.name}`}
|
|
628
626
|
name={`ducklake_gcs_${field.name}`}
|
|
629
627
|
label={field.label}
|
|
630
628
|
type={field.type}
|
|
631
629
|
fullWidth
|
|
632
|
-
|
|
630
|
+
size="small"
|
|
633
631
|
required={field.required}
|
|
634
632
|
/>
|
|
635
633
|
))}
|
|
@@ -650,14 +648,12 @@ export default function AddConnectionDialog({
|
|
|
650
648
|
<Typography variant="subtitle1" fontWeight={500}>
|
|
651
649
|
Attached Databases
|
|
652
650
|
</Typography>
|
|
653
|
-
<
|
|
654
|
-
|
|
651
|
+
<SecondaryButton
|
|
652
|
+
label="Database"
|
|
653
|
+
icon={<AddIcon />}
|
|
655
654
|
onClick={addAttachedDatabase}
|
|
656
|
-
|
|
657
|
-
|
|
658
|
-
>
|
|
659
|
-
Add Database
|
|
660
|
-
</Button>
|
|
655
|
+
ariaLabel="Add database"
|
|
656
|
+
/>
|
|
661
657
|
</Box>
|
|
662
658
|
{attachedDatabases.length === 0 && (
|
|
663
659
|
<Typography
|
|
@@ -707,23 +703,21 @@ export default function AddConnectionDialog({
|
|
|
707
703
|
</IconButton>
|
|
708
704
|
</Box>
|
|
709
705
|
<TextField
|
|
710
|
-
margin="dense"
|
|
711
706
|
required
|
|
712
707
|
id={`attachedDb_${index}_name`}
|
|
713
708
|
name={`attachedDb_${index}_name`}
|
|
714
709
|
label="Database Name"
|
|
715
710
|
type="text"
|
|
716
711
|
fullWidth
|
|
717
|
-
|
|
712
|
+
size="small"
|
|
718
713
|
defaultValue={db.name}
|
|
719
714
|
/>
|
|
720
715
|
<TextField
|
|
721
|
-
margin="dense"
|
|
722
716
|
id={`attachedDb_${index}_type`}
|
|
723
717
|
name={`attachedDb_${index}_type`}
|
|
724
718
|
label="Database Type"
|
|
725
719
|
fullWidth
|
|
726
|
-
|
|
720
|
+
size="small"
|
|
727
721
|
value={db.dbType}
|
|
728
722
|
select
|
|
729
723
|
onChange={(event) =>
|
|
@@ -760,7 +754,6 @@ export default function AddConnectionDialog({
|
|
|
760
754
|
.map((field) => (
|
|
761
755
|
<TextField
|
|
762
756
|
key={field.name}
|
|
763
|
-
margin="dense"
|
|
764
757
|
id={`attachedDb_${index}_${field.name}`}
|
|
765
758
|
name={`attachedDb_${index}_${field.name}`}
|
|
766
759
|
label={field.label}
|
|
@@ -770,7 +763,7 @@ export default function AddConnectionDialog({
|
|
|
770
763
|
: field.type
|
|
771
764
|
}
|
|
772
765
|
fullWidth
|
|
773
|
-
|
|
766
|
+
size="small"
|
|
774
767
|
required={field.required}
|
|
775
768
|
select={!!field.selectOptions}
|
|
776
769
|
defaultValue={
|
|
@@ -814,32 +807,19 @@ export default function AddConnectionDialog({
|
|
|
814
807
|
connectionFieldsByType[type].map((field) => (
|
|
815
808
|
<TextField
|
|
816
809
|
key={field.name}
|
|
817
|
-
margin="dense"
|
|
818
810
|
id={field.name}
|
|
819
811
|
name={field.name}
|
|
820
812
|
label={field.label}
|
|
821
813
|
type={field.type}
|
|
822
814
|
fullWidth
|
|
823
|
-
|
|
815
|
+
size="small"
|
|
824
816
|
required={field.required}
|
|
825
817
|
/>
|
|
826
818
|
))
|
|
827
819
|
)}
|
|
828
|
-
</
|
|
829
|
-
</
|
|
830
|
-
|
|
831
|
-
<Button disabled={isSubmitting} onClick={handleClose}>
|
|
832
|
-
Cancel
|
|
833
|
-
</Button>
|
|
834
|
-
<Button
|
|
835
|
-
type="submit"
|
|
836
|
-
form="connection-form"
|
|
837
|
-
loading={isSubmitting}
|
|
838
|
-
>
|
|
839
|
-
Create Connection
|
|
840
|
-
</Button>
|
|
841
|
-
</DialogActions>
|
|
842
|
-
</Dialog>
|
|
820
|
+
</Stack>
|
|
821
|
+
</form>
|
|
822
|
+
</AppDialog>
|
|
843
823
|
</React.Fragment>
|
|
844
824
|
);
|
|
845
825
|
}
|
|
@@ -2,20 +2,14 @@
|
|
|
2
2
|
// SPDX-License-Identifier: MIT
|
|
3
3
|
|
|
4
4
|
import { Delete } from "@mui/icons-material";
|
|
5
|
-
import CloseIcon from "@mui/icons-material/Close";
|
|
6
|
-
import { Snackbar } from "@mui/material";
|
|
7
5
|
import Button from "@mui/material/Button";
|
|
8
|
-
import Dialog from "@mui/material/Dialog";
|
|
9
|
-
import DialogActions from "@mui/material/DialogActions";
|
|
10
|
-
import DialogContent from "@mui/material/DialogContent";
|
|
11
|
-
import DialogTitle from "@mui/material/DialogTitle";
|
|
12
|
-
import IconButton from "@mui/material/IconButton";
|
|
13
6
|
import ListItemIcon from "@mui/material/ListItemIcon";
|
|
14
7
|
import ListItemText from "@mui/material/ListItemText";
|
|
15
8
|
import MenuItem from "@mui/material/MenuItem";
|
|
16
9
|
import Typography from "@mui/material/Typography";
|
|
17
10
|
import React, { useState } from "react";
|
|
18
11
|
import { Connection } from "../../client";
|
|
12
|
+
import { AppDialog } from "../AppDialog";
|
|
19
13
|
|
|
20
14
|
export default function DeleteConnectionDialog({
|
|
21
15
|
connection,
|
|
@@ -29,7 +23,6 @@ export default function DeleteConnectionDialog({
|
|
|
29
23
|
onDelete: () => void;
|
|
30
24
|
}) {
|
|
31
25
|
const [open, setOpen] = useState(false);
|
|
32
|
-
const [notificationMessage, setNotificationMessage] = useState("");
|
|
33
26
|
const handleClickOpen = () => {
|
|
34
27
|
setOpen(true);
|
|
35
28
|
};
|
|
@@ -54,50 +47,30 @@ export default function DeleteConnectionDialog({
|
|
|
54
47
|
<ListItemText>Delete</ListItemText>
|
|
55
48
|
</MenuItem>
|
|
56
49
|
|
|
57
|
-
<
|
|
58
|
-
onClose={handleClose}
|
|
59
|
-
aria-labelledby="customized-dialog-title"
|
|
50
|
+
<AppDialog
|
|
60
51
|
open={open}
|
|
52
|
+
onClose={handleClose}
|
|
53
|
+
title="Delete connection"
|
|
54
|
+
actions={
|
|
55
|
+
<>
|
|
56
|
+
<Button onClick={handleClose}>Cancel</Button>
|
|
57
|
+
<Button
|
|
58
|
+
variant="contained"
|
|
59
|
+
color="error"
|
|
60
|
+
autoFocus
|
|
61
|
+
onClick={() => onDelete()}
|
|
62
|
+
loading={isMutating}
|
|
63
|
+
>
|
|
64
|
+
Delete connection
|
|
65
|
+
</Button>
|
|
66
|
+
</>
|
|
67
|
+
}
|
|
61
68
|
>
|
|
62
|
-
<
|
|
63
|
-
Delete
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
onClick={handleClose}
|
|
68
|
-
sx={(theme) => ({
|
|
69
|
-
position: "absolute",
|
|
70
|
-
right: 8,
|
|
71
|
-
top: 8,
|
|
72
|
-
color: theme.palette.grey[500],
|
|
73
|
-
})}
|
|
74
|
-
>
|
|
75
|
-
<CloseIcon />
|
|
76
|
-
</IconButton>
|
|
77
|
-
<DialogContent dividers>
|
|
78
|
-
<Typography gutterBottom>
|
|
79
|
-
Are you sure you want to delete "{connection.name}"?
|
|
80
|
-
This action cannot be undone.
|
|
81
|
-
</Typography>
|
|
82
|
-
</DialogContent>
|
|
83
|
-
<DialogActions>
|
|
84
|
-
<Button
|
|
85
|
-
loading={isMutating}
|
|
86
|
-
variant="contained"
|
|
87
|
-
autoFocus
|
|
88
|
-
onClick={() => onDelete()}
|
|
89
|
-
color="error"
|
|
90
|
-
>
|
|
91
|
-
Delete
|
|
92
|
-
</Button>
|
|
93
|
-
</DialogActions>
|
|
94
|
-
<Snackbar
|
|
95
|
-
open={notificationMessage !== ""}
|
|
96
|
-
autoHideDuration={6000}
|
|
97
|
-
onClose={() => setNotificationMessage("")}
|
|
98
|
-
message={notificationMessage}
|
|
99
|
-
/>
|
|
100
|
-
</Dialog>
|
|
69
|
+
<Typography variant="body2">
|
|
70
|
+
Delete <strong>{connection.name}</strong>? Packages that query
|
|
71
|
+
through it stop working, and this cannot be undone.
|
|
72
|
+
</Typography>
|
|
73
|
+
</AppDialog>
|
|
101
74
|
</React.Fragment>
|
|
102
75
|
);
|
|
103
76
|
}
|