@malloy-publisher/sdk 0.0.36 → 0.0.38
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/dist/RenderedResult-D0NN1YlV.js +79 -0
- package/dist/RenderedResult-JN8rBUlE.cjs +1 -0
- package/dist/client/api.d.ts +2 -2
- package/dist/components/ApiErrorDisplay.d.ts +1 -1
- package/dist/components/Loading.d.ts +37 -0
- package/dist/components/Model/SourcesExplorer.d.ts +2 -2
- package/dist/components/MutableNotebook/EditableMalloyCell.d.ts +3 -3
- package/dist/components/MutableNotebook/MutableCell.d.ts +3 -4
- package/dist/components/MutableNotebook/MutableNotebook.d.ts +2 -1
- package/dist/components/index.d.ts +1 -0
- package/dist/{index-nKbldp0y.cjs → index-BH85bTLt.cjs} +594 -594
- package/dist/{index-DvGSfdDD.js → index-fYVnpzww.js} +20765 -20651
- package/dist/index.cjs.js +1 -1
- package/dist/index.es.js +17 -16
- package/dist/{vendor-C8UD-eyK.js → vendor-BCM56_2K.js} +16200 -19097
- package/dist/{vendor-BH1c2Hhy.cjs → vendor-Bg9-K32d.cjs} +140 -241
- package/package.json +1 -1
- package/src/components/ApiErrorDisplay.tsx +1 -1
- package/src/components/Home/Home.tsx +2 -3
- package/src/components/Loading.tsx +104 -0
- package/src/components/Model/Model.tsx +2 -6
- package/src/components/Model/NamedQueries.tsx +13 -13
- package/src/components/Model/SourcesExplorer.tsx +21 -41
- package/src/components/MutableNotebook/EditableMalloyCell.tsx +4 -22
- package/src/components/MutableNotebook/ModelPicker.tsx +31 -52
- package/src/components/MutableNotebook/MutableCell.tsx +229 -137
- package/src/components/MutableNotebook/MutableNotebook.tsx +102 -62
- package/src/components/Notebook/Notebook.tsx +10 -4
- package/src/components/Package/Databases.tsx +2 -3
- package/src/components/Package/Models.tsx +6 -6
- package/src/components/Package/Notebooks.tsx +7 -5
- package/src/components/Package/Package.tsx +1 -1
- package/src/components/Package/Schedules.tsx +2 -5
- package/src/components/Project/About.tsx +2 -5
- package/src/components/Project/ConnectionExplorer.tsx +4 -15
- package/src/components/Project/Packages.tsx +2 -5
- package/src/components/QueryResult/QueryResult.tsx +2 -6
- package/src/components/RenderedResult/RenderedResult.tsx +107 -18
- package/src/components/RenderedResult/ResultContainer.tsx +5 -2
- package/src/components/index.ts +1 -0
- package/dist/RenderedResult-BlNz8j4d.js +0 -51
- package/dist/RenderedResult-DphykkT6.cjs +0 -1
|
@@ -1,32 +1,33 @@
|
|
|
1
1
|
// TODO(jjs) - Export to .malloynb
|
|
2
2
|
// TOOD(jjs) - Import via Publisher API that parses whole NB
|
|
3
3
|
|
|
4
|
+
import AddIcon from "@mui/icons-material/Add";
|
|
4
5
|
import {
|
|
5
6
|
Box,
|
|
6
7
|
Button,
|
|
7
|
-
CardActions,
|
|
8
8
|
Dialog,
|
|
9
9
|
DialogActions,
|
|
10
10
|
DialogContent,
|
|
11
11
|
DialogContentText,
|
|
12
12
|
DialogTitle,
|
|
13
|
+
Divider,
|
|
13
14
|
Menu,
|
|
14
15
|
MenuItem,
|
|
15
16
|
Typography,
|
|
16
17
|
} from "@mui/material";
|
|
17
18
|
import Stack from "@mui/material/Stack";
|
|
18
19
|
import React from "react";
|
|
19
|
-
import { useRouterClickHandler } from "../click_helper";
|
|
20
20
|
import { Configuration, ModelsApi } from "../../client";
|
|
21
|
+
import { useRouterClickHandler } from "../click_helper";
|
|
21
22
|
import { SourceAndPath } from "../Model/SourcesExplorer";
|
|
22
23
|
import { NotebookManager } from "../NotebookManager";
|
|
23
24
|
import { usePackage } from "../Package";
|
|
24
25
|
import { StyledCard, StyledCardContent, StyledCardMedia } from "../styles";
|
|
25
|
-
import { ModelPicker } from "./ModelPicker";
|
|
26
26
|
import { MutableCell } from "./MutableCell";
|
|
27
27
|
import { useNotebookStorage } from "./NotebookStorageProvider";
|
|
28
28
|
|
|
29
29
|
import * as Malloy from "@malloydata/malloy-interfaces";
|
|
30
|
+
import { ModelPicker } from "./ModelPicker";
|
|
30
31
|
|
|
31
32
|
const modelsApi = new ModelsApi(new Configuration());
|
|
32
33
|
|
|
@@ -34,6 +35,7 @@ interface MutableNotebookProps {
|
|
|
34
35
|
notebookPath?: string;
|
|
35
36
|
expandCodeCells?: boolean;
|
|
36
37
|
expandEmbeddings?: boolean;
|
|
38
|
+
hideEmbeddingIcons?: boolean;
|
|
37
39
|
}
|
|
38
40
|
|
|
39
41
|
interface PathToSources {
|
|
@@ -45,6 +47,7 @@ export default function MutableNotebook({
|
|
|
45
47
|
notebookPath,
|
|
46
48
|
expandCodeCells,
|
|
47
49
|
expandEmbeddings,
|
|
50
|
+
hideEmbeddingIcons,
|
|
48
51
|
}: MutableNotebookProps) {
|
|
49
52
|
const navigate = useRouterClickHandler();
|
|
50
53
|
const { server, projectName, packageName, versionId, accessToken } =
|
|
@@ -201,27 +204,6 @@ export default function MutableNotebook({
|
|
|
201
204
|
}
|
|
202
205
|
return sourceAndPath;
|
|
203
206
|
};
|
|
204
|
-
const createButtons = (index: number) => {
|
|
205
|
-
return (
|
|
206
|
-
<CardActions
|
|
207
|
-
sx={{
|
|
208
|
-
padding: "0px 10px 0px 10px",
|
|
209
|
-
mb: "auto",
|
|
210
|
-
mt: "auto",
|
|
211
|
-
justifyContent: "flex-end",
|
|
212
|
-
}}
|
|
213
|
-
>
|
|
214
|
-
<Button
|
|
215
|
-
variant="outlined"
|
|
216
|
-
size="small"
|
|
217
|
-
startIcon={<AddIcon />}
|
|
218
|
-
onClick={(e) => handleMenuClick(e, index)}
|
|
219
|
-
>
|
|
220
|
-
New Cell
|
|
221
|
-
</Button>
|
|
222
|
-
</CardActions>
|
|
223
|
-
);
|
|
224
|
-
};
|
|
225
207
|
return (
|
|
226
208
|
<StyledCard variant="outlined">
|
|
227
209
|
<StyledCardContent>
|
|
@@ -229,19 +211,32 @@ export default function MutableNotebook({
|
|
|
229
211
|
sx={{
|
|
230
212
|
flexDirection: "row",
|
|
231
213
|
justifyContent: "space-between",
|
|
214
|
+
alignItems: "center",
|
|
232
215
|
}}
|
|
233
216
|
>
|
|
234
|
-
<
|
|
217
|
+
<Stack direction="row" spacing={1} alignItems="center">
|
|
235
218
|
<Typography
|
|
219
|
+
variant="overline"
|
|
236
220
|
sx={{
|
|
237
|
-
fontSize: "
|
|
238
|
-
minHeight: "56px",
|
|
221
|
+
fontSize: "13px",
|
|
239
222
|
fontWeight: "bold",
|
|
223
|
+
verticalAlign: "middle",
|
|
240
224
|
}}
|
|
241
225
|
>
|
|
242
|
-
|
|
226
|
+
Workbook
|
|
243
227
|
</Typography>
|
|
244
|
-
|
|
228
|
+
<Typography
|
|
229
|
+
variant="subtitle2"
|
|
230
|
+
sx={{
|
|
231
|
+
fontSize: "13px",
|
|
232
|
+
fontWeight: "normal",
|
|
233
|
+
verticalAlign: "middle",
|
|
234
|
+
ml: 1,
|
|
235
|
+
}}
|
|
236
|
+
>
|
|
237
|
+
{`${projectName} > ${packageName} > ${notebookPath}`}
|
|
238
|
+
</Typography>
|
|
239
|
+
</Stack>
|
|
245
240
|
<Stack sx={{ display: "flex", flexDirection: "row", gap: 1 }}>
|
|
246
241
|
<Box
|
|
247
242
|
sx={{
|
|
@@ -262,11 +257,11 @@ export default function MutableNotebook({
|
|
|
262
257
|
}}
|
|
263
258
|
>
|
|
264
259
|
<Button
|
|
265
|
-
variant="outlined"
|
|
266
260
|
color="error"
|
|
267
261
|
onClick={handleDeleteClick}
|
|
262
|
+
size="small"
|
|
268
263
|
>
|
|
269
|
-
Delete
|
|
264
|
+
Delete
|
|
270
265
|
</Button>
|
|
271
266
|
<Dialog
|
|
272
267
|
open={deleteDialogOpen}
|
|
@@ -282,13 +277,18 @@ export default function MutableNotebook({
|
|
|
282
277
|
</DialogContentText>
|
|
283
278
|
</DialogContent>
|
|
284
279
|
<DialogActions>
|
|
285
|
-
<Button
|
|
280
|
+
<Button
|
|
281
|
+
onClick={handleDeleteCancel}
|
|
282
|
+
color="primary"
|
|
283
|
+
size="small"
|
|
284
|
+
>
|
|
286
285
|
Cancel
|
|
287
286
|
</Button>
|
|
288
287
|
<Button
|
|
289
288
|
onClick={(event) => handleDeleteConfirm(event)}
|
|
290
289
|
color="error"
|
|
291
290
|
autoFocus
|
|
291
|
+
size="small"
|
|
292
292
|
>
|
|
293
293
|
Delete
|
|
294
294
|
</Button>
|
|
@@ -297,27 +297,86 @@ export default function MutableNotebook({
|
|
|
297
297
|
</Box>
|
|
298
298
|
</Stack>
|
|
299
299
|
</Stack>
|
|
300
|
+
<Divider />
|
|
301
|
+
<Stack
|
|
302
|
+
sx={{
|
|
303
|
+
display: "flex",
|
|
304
|
+
flexDirection: "row",
|
|
305
|
+
width: "100%",
|
|
306
|
+
mt: 2,
|
|
307
|
+
}}
|
|
308
|
+
>
|
|
309
|
+
<Box sx={{ flex: 1 }}>
|
|
310
|
+
<ModelPicker
|
|
311
|
+
initialSelectedModels={notebookData.getModels()}
|
|
312
|
+
onModelChange={(models) => {
|
|
313
|
+
setNotebookData(notebookData.setModels(models));
|
|
314
|
+
saveNotebook();
|
|
315
|
+
}}
|
|
316
|
+
/>
|
|
317
|
+
</Box>
|
|
318
|
+
<Box
|
|
319
|
+
sx={{
|
|
320
|
+
display: "flex",
|
|
321
|
+
gap: 1,
|
|
322
|
+
justifyContent: "center",
|
|
323
|
+
flex: 2,
|
|
324
|
+
}}
|
|
325
|
+
>
|
|
326
|
+
<Button
|
|
327
|
+
size="small"
|
|
328
|
+
startIcon={<AddIcon />}
|
|
329
|
+
onClick={() =>
|
|
330
|
+
handleAddCell(false, notebookData.getCells().length)
|
|
331
|
+
}
|
|
332
|
+
>
|
|
333
|
+
Explore
|
|
334
|
+
</Button>
|
|
335
|
+
<Button
|
|
336
|
+
size="small"
|
|
337
|
+
startIcon={<AddIcon />}
|
|
338
|
+
onClick={() =>
|
|
339
|
+
handleAddCell(true, notebookData.getCells().length)
|
|
340
|
+
}
|
|
341
|
+
>
|
|
342
|
+
Markdown
|
|
343
|
+
</Button>
|
|
344
|
+
</Box>
|
|
345
|
+
<Box sx={{ flex: 1 }} />
|
|
346
|
+
</Stack>
|
|
300
347
|
</StyledCardContent>
|
|
301
|
-
<ModelPicker
|
|
302
|
-
initialSelectedModels={notebookData.getModels()}
|
|
303
|
-
onModelChange={(models) => {
|
|
304
|
-
setNotebookData(notebookData.setModels(models));
|
|
305
|
-
saveNotebook();
|
|
306
|
-
}}
|
|
307
|
-
/>
|
|
308
|
-
|
|
309
348
|
<StyledCardMedia>
|
|
310
349
|
<Stack>
|
|
350
|
+
{notebookData.getCells().length === 0 && (
|
|
351
|
+
<>
|
|
352
|
+
<Typography
|
|
353
|
+
sx={{
|
|
354
|
+
textAlign: "center",
|
|
355
|
+
p: 2,
|
|
356
|
+
variant: "subtitle2",
|
|
357
|
+
fontWeight: "medium",
|
|
358
|
+
}}
|
|
359
|
+
>
|
|
360
|
+
Workbook is empty
|
|
361
|
+
</Typography>
|
|
362
|
+
<Typography
|
|
363
|
+
variant="body2"
|
|
364
|
+
sx={{ textAlign: "center", mb: 2, variant: "body2" }}
|
|
365
|
+
>
|
|
366
|
+
Click the + buttons to add a markdown or code cell.
|
|
367
|
+
</Typography>
|
|
368
|
+
</>
|
|
369
|
+
)}
|
|
311
370
|
{notebookData.getCells().map((cell, index) => (
|
|
312
371
|
<React.Fragment
|
|
313
372
|
key={`${index}-${notebookData.getCells().length}`}
|
|
314
373
|
>
|
|
315
374
|
<MutableCell
|
|
316
375
|
cell={cell}
|
|
317
|
-
newCell={createButtons(index)}
|
|
318
376
|
sourceAndPaths={getSourceList(sourceAndPaths)}
|
|
319
377
|
expandCodeCell={expandCodeCells}
|
|
320
378
|
expandEmbedding={expandEmbeddings}
|
|
379
|
+
hideEmbeddingIcons={hideEmbeddingIcons}
|
|
321
380
|
editingMarkdown={editingMarkdownIndex === index}
|
|
322
381
|
editingMalloy={editingMalloyIndex === index}
|
|
323
382
|
onDelete={() => {
|
|
@@ -345,9 +404,6 @@ export default function MutableNotebook({
|
|
|
345
404
|
/>
|
|
346
405
|
</React.Fragment>
|
|
347
406
|
))}
|
|
348
|
-
<Box style={{ paddingRight: "7px", paddingTop: "10px" }}>
|
|
349
|
-
{createButtons(notebookData.getCells().length)}
|
|
350
|
-
</Box>
|
|
351
407
|
<Menu
|
|
352
408
|
anchorEl={menuAnchorEl}
|
|
353
409
|
open={menuOpen}
|
|
@@ -376,22 +432,6 @@ export default function MutableNotebook({
|
|
|
376
432
|
</StyledCard>
|
|
377
433
|
);
|
|
378
434
|
}
|
|
379
|
-
function AddIcon() {
|
|
380
|
-
return (
|
|
381
|
-
<svg
|
|
382
|
-
width="24"
|
|
383
|
-
height="24"
|
|
384
|
-
viewBox="0 0 24 24"
|
|
385
|
-
fill="none"
|
|
386
|
-
xmlns="http://www.w3.org/2000/svg"
|
|
387
|
-
>
|
|
388
|
-
<path
|
|
389
|
-
d="M19 13H13V19H11V13H5V11H11V5H13V11H19V13Z"
|
|
390
|
-
fill="currentColor"
|
|
391
|
-
/>
|
|
392
|
-
</svg>
|
|
393
|
-
);
|
|
394
|
-
}
|
|
395
435
|
|
|
396
436
|
function ExportMalloyButton({
|
|
397
437
|
notebookData,
|
|
@@ -412,8 +452,8 @@ function ExportMalloyButton({
|
|
|
412
452
|
}
|
|
413
453
|
};
|
|
414
454
|
return (
|
|
415
|
-
<Button
|
|
416
|
-
{copied ? "Copied!" : "Export
|
|
455
|
+
<Button color="primary" onClick={handleExport} size="small">
|
|
456
|
+
{copied ? "Copied!" : "Export"}
|
|
417
457
|
</Button>
|
|
418
458
|
);
|
|
419
459
|
}
|
|
@@ -18,6 +18,7 @@ import { StyledCard, StyledCardContent, StyledCardMedia } from "../styles";
|
|
|
18
18
|
import { NotebookCell } from "./NotebookCell";
|
|
19
19
|
import { ApiErrorDisplay, ApiError } from "../ApiErrorDisplay";
|
|
20
20
|
import { AxiosError } from "axios";
|
|
21
|
+
import { Loading } from "../Loading";
|
|
21
22
|
|
|
22
23
|
const notebooksApi = new NotebooksApi(new Configuration());
|
|
23
24
|
const queryClient = new QueryClient();
|
|
@@ -191,9 +192,7 @@ export default function Notebook({
|
|
|
191
192
|
<StyledCardMedia>
|
|
192
193
|
<Stack spacing={1} component="section">
|
|
193
194
|
{!isSuccess && !isError && (
|
|
194
|
-
<
|
|
195
|
-
Fetching Notebook...
|
|
196
|
-
</Typography>
|
|
195
|
+
<Loading text="Fetching Notebook..." />
|
|
197
196
|
)}
|
|
198
197
|
{isSuccess &&
|
|
199
198
|
notebook.notebookCells?.map((cell, index) => (
|
|
@@ -214,7 +213,14 @@ export default function Notebook({
|
|
|
214
213
|
key={index}
|
|
215
214
|
/>
|
|
216
215
|
))}
|
|
217
|
-
{isError && (
|
|
216
|
+
{isError && error.data?.code === 404 && (
|
|
217
|
+
<Typography>
|
|
218
|
+
<code>{`${projectName} > ${packageName} > ${notebookPath}`}</code>{" "}
|
|
219
|
+
not found.
|
|
220
|
+
</Typography>
|
|
221
|
+
)}
|
|
222
|
+
|
|
223
|
+
{isError && error.data?.code !== 404 && (
|
|
218
224
|
<ApiErrorDisplay
|
|
219
225
|
error={error}
|
|
220
226
|
context={`${projectName} > ${packageName} > ${notebookPath}`}
|
|
@@ -18,6 +18,7 @@ import { Configuration, Database, DatabasesApi } from "../../client";
|
|
|
18
18
|
import { StyledCard, StyledCardContent } from "../styles";
|
|
19
19
|
import { usePackage } from "./PackageProvider";
|
|
20
20
|
import { ApiErrorDisplay } from "../ApiErrorDisplay";
|
|
21
|
+
import { Loading } from "../Loading";
|
|
21
22
|
|
|
22
23
|
const databasesApi = new DatabasesApi(new Configuration());
|
|
23
24
|
const queryClient = new QueryClient();
|
|
@@ -83,9 +84,7 @@ export default function Databases() {
|
|
|
83
84
|
}}
|
|
84
85
|
>
|
|
85
86
|
{!isSuccess && !isError && (
|
|
86
|
-
<
|
|
87
|
-
Fetching Databases...
|
|
88
|
-
</Typography>
|
|
87
|
+
<Loading text="Fetching Databases..." />
|
|
89
88
|
)}
|
|
90
89
|
{isError && (
|
|
91
90
|
<ApiErrorDisplay
|
|
@@ -6,6 +6,7 @@ import { StyledCard, StyledCardContent } from "../styles";
|
|
|
6
6
|
import { FileTreeView } from "./FileTreeView";
|
|
7
7
|
import { usePackage } from "./PackageProvider";
|
|
8
8
|
import { ApiErrorDisplay } from "../ApiErrorDisplay";
|
|
9
|
+
import { Loading } from "../Loading";
|
|
9
10
|
|
|
10
11
|
axios.defaults.baseURL = "http://localhost:4000";
|
|
11
12
|
const modelsApi = new ModelsApi(new Configuration());
|
|
@@ -52,18 +53,14 @@ export default function Models({ navigate }: ModelsProps) {
|
|
|
52
53
|
overflowY: "auto",
|
|
53
54
|
}}
|
|
54
55
|
>
|
|
55
|
-
{!isSuccess && !isError &&
|
|
56
|
-
<Typography variant="body2" sx={{ p: "10px", m: "auto" }}>
|
|
57
|
-
Fetching Models...
|
|
58
|
-
</Typography>
|
|
59
|
-
)}
|
|
56
|
+
{!isSuccess && !isError && <Loading text="Fetching Models..." />}
|
|
60
57
|
{isError && (
|
|
61
58
|
<ApiErrorDisplay
|
|
62
59
|
error={error}
|
|
63
60
|
context={`${projectName} > ${packageName} > Models`}
|
|
64
61
|
/>
|
|
65
62
|
)}
|
|
66
|
-
{isSuccess && (
|
|
63
|
+
{isSuccess && data.data.length > 0 && (
|
|
67
64
|
<FileTreeView
|
|
68
65
|
items={data.data.sort((a, b) => {
|
|
69
66
|
return a.path.localeCompare(b.path);
|
|
@@ -72,6 +69,9 @@ export default function Models({ navigate }: ModelsProps) {
|
|
|
72
69
|
defaultExpandedItems={DEFAULT_EXPANDED_FOLDERS}
|
|
73
70
|
/>
|
|
74
71
|
)}
|
|
72
|
+
{isSuccess && data.data.length === 0 && (
|
|
73
|
+
<Typography>No models found.</Typography>
|
|
74
|
+
)}
|
|
75
75
|
</Box>
|
|
76
76
|
</StyledCardContent>
|
|
77
77
|
</StyledCard>
|
|
@@ -5,6 +5,7 @@ import { StyledCard, StyledCardContent } from "../styles";
|
|
|
5
5
|
import { FileTreeView } from "./FileTreeView";
|
|
6
6
|
import { usePackage } from "./PackageProvider";
|
|
7
7
|
import { ApiErrorDisplay } from "../ApiErrorDisplay";
|
|
8
|
+
import { Loading } from "../Loading";
|
|
8
9
|
|
|
9
10
|
const notebooksApi = new NotebooksApi(new Configuration());
|
|
10
11
|
const queryClient = new QueryClient();
|
|
@@ -19,7 +20,7 @@ export default function Notebooks({ navigate }: NotebooksProps) {
|
|
|
19
20
|
const { server, projectName, packageName, versionId, accessToken } =
|
|
20
21
|
usePackage();
|
|
21
22
|
|
|
22
|
-
const { data,
|
|
23
|
+
const { data, isError, error, isSuccess } = useQuery(
|
|
23
24
|
{
|
|
24
25
|
queryKey: ["notebooks", server, projectName, packageName, versionId],
|
|
25
26
|
queryFn: () =>
|
|
@@ -51,9 +52,7 @@ export default function Notebooks({ navigate }: NotebooksProps) {
|
|
|
51
52
|
}}
|
|
52
53
|
>
|
|
53
54
|
{!isSuccess && !isError && (
|
|
54
|
-
<
|
|
55
|
-
Fetching Notebooks...
|
|
56
|
-
</Typography>
|
|
55
|
+
<Loading text="Fetching Notebooks..." />
|
|
57
56
|
)}
|
|
58
57
|
{isError && (
|
|
59
58
|
<ApiErrorDisplay
|
|
@@ -61,7 +60,7 @@ export default function Notebooks({ navigate }: NotebooksProps) {
|
|
|
61
60
|
context={`${projectName} > ${packageName} > Notebooks`}
|
|
62
61
|
/>
|
|
63
62
|
)}
|
|
64
|
-
{isSuccess && (
|
|
63
|
+
{isSuccess && data.data.length > 0 && (
|
|
65
64
|
<FileTreeView
|
|
66
65
|
items={data.data.sort((a, b) => {
|
|
67
66
|
return a.path.localeCompare(b.path);
|
|
@@ -70,6 +69,9 @@ export default function Notebooks({ navigate }: NotebooksProps) {
|
|
|
70
69
|
navigate={navigate}
|
|
71
70
|
/>
|
|
72
71
|
)}
|
|
72
|
+
{isSuccess && data.data.length === 0 && (
|
|
73
|
+
<Typography>No notebooks found.</Typography>
|
|
74
|
+
)}
|
|
73
75
|
</Box>
|
|
74
76
|
</StyledCardContent>
|
|
75
77
|
</StyledCard>
|
|
@@ -15,6 +15,7 @@ import { Configuration, SchedulesApi } from "../../client";
|
|
|
15
15
|
import { StyledCard, StyledCardContent } from "../styles";
|
|
16
16
|
import { usePackage } from "./PackageProvider";
|
|
17
17
|
import { ApiErrorDisplay } from "../ApiErrorDisplay";
|
|
18
|
+
import { Loading } from "../Loading";
|
|
18
19
|
|
|
19
20
|
const schedulesApi = new SchedulesApi(new Configuration());
|
|
20
21
|
const queryClient = new QueryClient();
|
|
@@ -41,11 +42,7 @@ export default function Schedules() {
|
|
|
41
42
|
);
|
|
42
43
|
|
|
43
44
|
if (isLoading) {
|
|
44
|
-
return
|
|
45
|
-
<Typography variant="body2" sx={{ p: "20px", m: "auto" }}>
|
|
46
|
-
Fetching Schedules...
|
|
47
|
-
</Typography>
|
|
48
|
-
);
|
|
45
|
+
return <Loading text="Fetching Schedules..." />;
|
|
49
46
|
}
|
|
50
47
|
|
|
51
48
|
if (isError) {
|
|
@@ -5,6 +5,7 @@ import { StyledCard, StyledCardContent, StyledCardMedia } from "../styles";
|
|
|
5
5
|
import { QueryClient, useQuery } from "@tanstack/react-query";
|
|
6
6
|
import { useProject } from "./Project";
|
|
7
7
|
import { ApiErrorDisplay } from "../ApiErrorDisplay";
|
|
8
|
+
import { Loading } from "../Loading";
|
|
8
9
|
|
|
9
10
|
const projectsApi = new ProjectsApi(new Configuration());
|
|
10
11
|
const queryClient = new QueryClient();
|
|
@@ -31,11 +32,7 @@ export default function About() {
|
|
|
31
32
|
|
|
32
33
|
return (
|
|
33
34
|
<>
|
|
34
|
-
{!isSuccess && !isError &&
|
|
35
|
-
<Typography variant="body2" sx={{ p: "10px", m: "auto" }}>
|
|
36
|
-
Fetching About...
|
|
37
|
-
</Typography>
|
|
38
|
-
)}
|
|
35
|
+
{!isSuccess && !isError && <Loading text="Fetching About..." />}
|
|
39
36
|
{isSuccess && (
|
|
40
37
|
<StyledCard variant="outlined">
|
|
41
38
|
<StyledCardContent>
|
|
@@ -26,6 +26,7 @@ import { ConnectionsApi } from "../../client/api";
|
|
|
26
26
|
import { Configuration } from "../../client/configuration";
|
|
27
27
|
import { useProject } from "./Project";
|
|
28
28
|
import { ApiErrorDisplay } from "../ApiErrorDisplay";
|
|
29
|
+
import { Loading } from "../Loading";
|
|
29
30
|
|
|
30
31
|
const connectionsApi = new ConnectionsApi(new Configuration());
|
|
31
32
|
const queryClient = new QueryClient();
|
|
@@ -92,11 +93,7 @@ export default function ConnectionExplorer({
|
|
|
92
93
|
</Box>
|
|
93
94
|
<Divider />
|
|
94
95
|
<Box sx={{ mt: "10px", maxHeight: "600px", overflowY: "auto" }}>
|
|
95
|
-
{isLoading &&
|
|
96
|
-
<Typography variant="body2" sx={{ p: "20px", m: "auto" }}>
|
|
97
|
-
Fetching Table Paths...
|
|
98
|
-
</Typography>
|
|
99
|
-
)}
|
|
96
|
+
{isLoading && <Loading text="Fetching Table Paths..." />}
|
|
100
97
|
{isError && (
|
|
101
98
|
<ApiErrorDisplay
|
|
102
99
|
error={error}
|
|
@@ -242,11 +239,7 @@ function TableViewer({
|
|
|
242
239
|
</IconButton>
|
|
243
240
|
</DialogTitle>
|
|
244
241
|
<DialogContent>
|
|
245
|
-
{isLoading &&
|
|
246
|
-
<Typography variant="body2" sx={{ p: "20px", m: "auto" }}>
|
|
247
|
-
Fetching Table Details...
|
|
248
|
-
</Typography>
|
|
249
|
-
)}
|
|
242
|
+
{isLoading && <Loading text="Fetching Table Details..." />}
|
|
250
243
|
{isError && (
|
|
251
244
|
<ApiErrorDisplay
|
|
252
245
|
error={error}
|
|
@@ -326,11 +319,7 @@ function TablesInSchema({
|
|
|
326
319
|
</Typography>
|
|
327
320
|
<Divider />
|
|
328
321
|
<Box sx={{ mt: "10px", maxHeight: "600px", overflowY: "auto" }}>
|
|
329
|
-
{isLoading &&
|
|
330
|
-
<Typography variant="body2" sx={{ p: "20px", m: "auto" }}>
|
|
331
|
-
Fetching Tables...
|
|
332
|
-
</Typography>
|
|
333
|
-
)}
|
|
322
|
+
{isLoading && <Loading text="Fetching Tables..." />}
|
|
334
323
|
{isError && (
|
|
335
324
|
<ApiErrorDisplay
|
|
336
325
|
error={error}
|
|
@@ -4,6 +4,7 @@ import { StyledCard, StyledCardContent, StyledCardMedia } from "../styles";
|
|
|
4
4
|
import { QueryClient, useQuery } from "@tanstack/react-query";
|
|
5
5
|
import { useProject } from "./Project";
|
|
6
6
|
import { ApiErrorDisplay } from "../ApiErrorDisplay";
|
|
7
|
+
import { Loading } from "../Loading";
|
|
7
8
|
|
|
8
9
|
const packagesApi = new PackagesApi(new Configuration());
|
|
9
10
|
const queryClient = new QueryClient();
|
|
@@ -34,11 +35,7 @@ export default function Packages({ navigate }: PackagesProps) {
|
|
|
34
35
|
|
|
35
36
|
return (
|
|
36
37
|
<>
|
|
37
|
-
{!isSuccess && !isError &&
|
|
38
|
-
<Typography variant="body2" sx={{ p: "20px", m: "auto" }}>
|
|
39
|
-
Fetching Packages...
|
|
40
|
-
</Typography>
|
|
41
|
-
)}
|
|
38
|
+
{!isSuccess && !isError && <Loading text="Fetching Packages..." />}
|
|
42
39
|
{isSuccess && (
|
|
43
40
|
<StyledCard variant="outlined">
|
|
44
41
|
<StyledCardContent>
|
|
@@ -1,14 +1,12 @@
|
|
|
1
1
|
import { Suspense, lazy } from "react";
|
|
2
2
|
import { Configuration, QueryresultsApi } from "../../client";
|
|
3
|
-
import axios from "axios";
|
|
4
|
-
import { Typography } from "@mui/material";
|
|
5
3
|
import { QueryClient, useQuery } from "@tanstack/react-query";
|
|
6
4
|
import { usePackage } from "../Package/PackageProvider";
|
|
7
5
|
import { ApiErrorDisplay } from "../ApiErrorDisplay";
|
|
6
|
+
import { Loading } from "../Loading";
|
|
8
7
|
|
|
9
8
|
const RenderedResult = lazy(() => import("../RenderedResult/RenderedResult"));
|
|
10
9
|
|
|
11
|
-
axios.defaults.baseURL = "http://localhost:4000";
|
|
12
10
|
const queryResultsApi = new QueryresultsApi(new Configuration());
|
|
13
11
|
const queryClient = new QueryClient();
|
|
14
12
|
|
|
@@ -67,9 +65,7 @@ export default function QueryResult({
|
|
|
67
65
|
return (
|
|
68
66
|
<>
|
|
69
67
|
{!isSuccess && !isError && (
|
|
70
|
-
<
|
|
71
|
-
Fetching Query Results...
|
|
72
|
-
</Typography>
|
|
68
|
+
<Loading text="Fetching Query Results..." />
|
|
73
69
|
)}
|
|
74
70
|
{isSuccess && (
|
|
75
71
|
<Suspense fallback={<div>Loading...</div>}>
|