@malloy-publisher/sdk 0.0.34 → 0.0.35
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 +21 -0
- package/dist/{RenderedResult-9A74lwfO.cjs → RenderedResult-DphykkT6.cjs} +1 -1
- package/dist/client/api.d.ts +18 -0
- package/dist/components/ApiErrorDisplay.d.ts +13 -0
- package/dist/components/Model/ModelCell.d.ts +1 -6
- package/dist/components/Package/Config.d.ts +1 -9
- package/dist/components/Package/Connections.d.ts +1 -8
- package/dist/components/Package/Databases.d.ts +1 -9
- package/dist/components/Package/Models.d.ts +1 -6
- package/dist/components/Package/Notebooks.d.ts +2 -7
- package/dist/components/Package/Package.d.ts +1 -6
- package/dist/components/Package/PackageProvider.d.ts +14 -0
- package/dist/components/Package/Schedules.d.ts +1 -9
- package/dist/components/Package/index.d.ts +2 -1
- package/dist/components/Project/About.d.ts +1 -7
- package/dist/components/Project/ConnectionExplorer.d.ts +1 -4
- package/dist/components/Project/Packages.d.ts +2 -5
- package/dist/components/Project/Project.d.ts +11 -3
- package/dist/components/Project/index.d.ts +1 -1
- package/dist/components/QueryResult/QueryResult.d.ts +1 -6
- package/dist/{index-TNDWxBXR.cjs → index-nKbldp0y.cjs} +598 -598
- package/dist/index.cjs.js +1 -1
- package/package.json +1 -1
- package/src/components/ApiErrorDisplay.tsx +40 -0
- package/src/components/Home/Home.tsx +8 -1
- package/src/components/Model/Model.tsx +59 -28
- package/src/components/Model/ModelCell.tsx +26 -63
- package/src/components/Model/NamedQueries.tsx +2 -2
- package/src/components/Model/SourcesExplorer.tsx +14 -15
- package/src/components/MutableNotebook/ModelPicker.tsx +13 -3
- package/src/components/MutableNotebook/MutableCell.tsx +5 -14
- package/src/components/MutableNotebook/MutableNotebook.tsx +2 -2
- package/src/components/Notebook/Notebook.tsx +48 -24
- package/src/components/Package/Config.tsx +10 -18
- package/src/components/Package/Connections.tsx +10 -12
- package/src/components/Package/Databases.tsx +93 -198
- package/src/components/Package/FileTreeView.tsx +21 -4
- package/src/components/Package/Models.tsx +21 -31
- package/src/components/Package/Notebooks.tsx +22 -32
- package/src/components/Package/Package.tsx +31 -89
- package/src/components/Package/PackageProvider.tsx +46 -0
- package/src/components/Package/Schedules.tsx +10 -19
- package/src/components/Package/index.ts +6 -1
- package/src/components/Project/About.tsx +7 -15
- package/src/components/Project/ConnectionExplorer.tsx +131 -52
- package/src/components/Project/Packages.tsx +12 -13
- package/src/components/Project/Project.tsx +35 -16
- package/src/components/Project/index.ts +1 -1
- package/src/components/QueryResult/QueryResult.tsx +12 -15
- package/src/components/RenderedResult/ResultContainer.tsx +0 -1
- package/dist/RenderedResult-CKEsEevp.js +0 -51
- package/dist/abap-BmBUA35e.js +0 -6
- package/dist/actionscript-3-zFUbzQa9.js +0 -6
- package/dist/ada-CBvPkFpZ.js +0 -6
- package/dist/andromeeda-uXNdzNpk.js +0 -4
- package/dist/angular-html-0fTdLuKf.js +0 -32
- package/dist/angular-ts-wkniW60G.js +0 -21
- package/dist/apache-CVNlsSDc.js +0 -6
- package/dist/apex-DFk3KRB1.js +0 -6
- package/dist/apl-TLDHFJX6.js +0 -16
- package/dist/applescript-CYMR_y0g.js +0 -6
- package/dist/ara-4QmU5e04.js +0 -6
- package/dist/asciidoc-v_1bjgUg.js +0 -6
- package/dist/asm-RC0Yh-NZ.js +0 -6
- package/dist/astro-Uf8_VxKJ.js +0 -16
- package/dist/aurora-x-BwoVEUWZ.js +0 -4
- package/dist/awk-gPH8MVMW.js +0 -6
- package/dist/ayu-dark-CxPZkpb2.js +0 -4
- package/dist/ballerina-kvLnRU_e.js +0 -6
- package/dist/bat-BHYy44sT.js +0 -6
- package/dist/beancount-D-MADTs_.js +0 -6
- package/dist/berry-Ci9U0o4h.js +0 -6
- package/dist/bibtex-CX618D15.js +0 -6
- package/dist/bicep-iuYiPopT.js +0 -6
- package/dist/blade-BtR00Gx0.js +0 -18
- package/dist/bsl-BIXPNqL4.js +0 -8
- package/dist/c-DASdrs7p.js +0 -6
- package/dist/cadence-BDALQi26.js +0 -6
- package/dist/cairo-tXZKA2PT.js +0 -8
- package/dist/catppuccin-frappe-BrTOiad2.js +0 -4
- package/dist/catppuccin-latte-D-dc_R4m.js +0 -4
- package/dist/catppuccin-macchiato-DN4jOp0G.js +0 -4
- package/dist/catppuccin-mocha-B8yCE3-3.js +0 -4
- package/dist/clarity-CNgV2Ths.js +0 -6
- package/dist/clojure-CsKKFGwv.js +0 -6
- package/dist/cmake-Dr-A3iJx.js +0 -6
- package/dist/cobol-DMssKNmC.js +0 -10
- package/dist/codeowners-Bt9yU6NX.js +0 -6
- package/dist/codeql-DBNTqJi1.js +0 -6
- package/dist/coffee-D_GzM8k1.js +0 -8
- package/dist/common-lisp-r7ZEOG7T.js +0 -6
- package/dist/components/Package/PublisherPackageProvider.d.ts +0 -14
- package/dist/components/Project/TablesInSchema.d.ts +0 -10
- package/dist/coq-CB6Pv_W9.js +0 -6
- package/dist/cpp-CJF2i3ah.js +0 -18
- package/dist/crystal-BKWnaU3g.js +0 -18
- package/dist/csharp-CYWRhZ2R.js +0 -6
- package/dist/css-D1aVdRIU.js +0 -6
- package/dist/csv-DvCncUGQ.js +0 -6
- package/dist/cue-BXMrmvay.js +0 -6
- package/dist/cypher-DTm5zNR1.js +0 -6
- package/dist/d-D6ZXmn3l.js +0 -6
- package/dist/dark-plus-pUHDTVV0.js +0 -4
- package/dist/dart-Dz59Is3F.js +0 -6
- package/dist/dax-DTVGzydb.js +0 -6
- package/dist/desktop-Db9vb-dl.js +0 -6
- package/dist/diff-XmNrvgM1.js +0 -6
- package/dist/docker-DWH2onkn.js +0 -6
- package/dist/dotenv-4337wvzu.js +0 -6
- package/dist/dracula-BtZx2Kac.js +0 -4
- package/dist/dracula-soft-BKa-aqBv.js +0 -4
- package/dist/dream-maker-CvvfrJSx.js +0 -6
- package/dist/edge-CgxR-qhM.js +0 -12
- package/dist/elixir-DZkeSPwW.js +0 -8
- package/dist/elm-BKuV1HE1.js +0 -8
- package/dist/emacs-lisp-BAefI874.js +0 -6
- package/dist/erb-BLwkpXUJ.js +0 -10
- package/dist/erlang-CmIiwF3I.js +0 -6
- package/dist/everforest-dark-DMCBqXCK.js +0 -4
- package/dist/everforest-light-BbXl82Em.js +0 -4
- package/dist/fennel-DNqkz9pE.js +0 -6
- package/dist/fish-DIm72t2T.js +0 -6
- package/dist/fluent-BapTxJsC.js +0 -6
- package/dist/fortran-fixed-form-s9Hnb3av.js +0 -8
- package/dist/fortran-free-form-CNDsBFUj.js +0 -6
- package/dist/fsharp-Cv0x43wb.js +0 -8
- package/dist/gdresource-CMcKXvgJ.js +0 -10
- package/dist/gdscript-D7aheHm-.js +0 -6
- package/dist/gdshader-BGJEsM2Z.js +0 -6
- package/dist/genie-C9gPjc6J.js +0 -6
- package/dist/gherkin-bka1Exbx.js +0 -6
- package/dist/git-commit-BspYIY3P.js +0 -8
- package/dist/git-rebase--zLBTjUa.js +0 -8
- package/dist/github-dark-DenFmJkN.js +0 -4
- package/dist/github-dark-default-BJPUVz4H.js +0 -4
- package/dist/github-dark-dimmed-DUshB20C.js +0 -4
- package/dist/github-dark-high-contrast-D3aGCnF8.js +0 -4
- package/dist/github-light-JYsPkUQd.js +0 -4
- package/dist/github-light-default-D99KPAby.js +0 -4
- package/dist/github-light-high-contrast-BbmZE-Mp.js +0 -4
- package/dist/gleam-B4k9YFGD.js +0 -6
- package/dist/glimmer-js-DhY9umHJ.js +0 -14
- package/dist/glimmer-ts-CCrHcYH5.js +0 -14
- package/dist/glsl-XLGYNq5B.js +0 -8
- package/dist/gnuplot-DnWoRZt-.js +0 -6
- package/dist/go-BErP6iv1.js +0 -6
- package/dist/graphql-DWpQF4JI.js +0 -14
- package/dist/groovy-IWs5-NIO.js +0 -6
- package/dist/hack-CQrV-ytR.js +0 -10
- package/dist/haml-CMN0hQaL.js +0 -10
- package/dist/handlebars-Cc-7fXX5.js +0 -14
- package/dist/haskell-CtlGos0K.js +0 -6
- package/dist/haxe-CZZ33vZw.js +0 -6
- package/dist/hcl-6hOg9WP4.js +0 -6
- package/dist/hjson-CgwED-oz.js +0 -6
- package/dist/hlsl-3-lv4gi7.js +0 -6
- package/dist/houston-BDYrDoDW.js +0 -4
- package/dist/html-B0P_v3yU.js +0 -10
- package/dist/html-derivative-D59SHfh8.js +0 -8
- package/dist/http-Dcjm_K1m.js +0 -14
- package/dist/hxml-BNKImryz.js +0 -8
- package/dist/hy-C2xHhR6I.js +0 -6
- package/dist/imba-Drd0AMDo.js +0 -8
- package/dist/index-DahUc0AC.js +0 -139511
- package/dist/index.es.js +0 -19
- package/dist/ini-BUcvsX-U.js +0 -6
- package/dist/java-B7odJ7Ap.js +0 -6
- package/dist/javascript-fa8UlHZE.js +0 -6
- package/dist/jinja-CCSYduCH.js +0 -11
- package/dist/jison-BygvlveW.js +0 -8
- package/dist/json-71t8ZF9g.js +0 -6
- package/dist/json5-Z7F6rA6a.js +0 -6
- package/dist/jsonc-Dphhs4m2.js +0 -6
- package/dist/jsonl-D9jj92Gg.js +0 -6
- package/dist/jsonnet-DEQ7IUoJ.js +0 -6
- package/dist/jssm-j74e88UX.js +0 -6
- package/dist/jsx-Bkesy5tT.js +0 -6
- package/dist/julia-CiahampL.js +0 -16
- package/dist/kanagawa-dragon-CiKur4Hl.js +0 -4
- package/dist/kanagawa-lotus-BKu-smKu.js +0 -4
- package/dist/kanagawa-wave-CQwozSzG.js +0 -4
- package/dist/kotlin-DCgZY7Ii.js +0 -6
- package/dist/kusto-Cw029H-v.js +0 -6
- package/dist/laserwave-6a00oqik.js +0 -4
- package/dist/latex-LfGCYGw5.js +0 -8
- package/dist/lean-CYSet4vs.js +0 -6
- package/dist/less-DQA4v-Nm.js +0 -6
- package/dist/light-plus-CZuVqSLX.js +0 -4
- package/dist/liquid-CvufO3kO.js +0 -14
- package/dist/log-D2eRfqDn.js +0 -6
- package/dist/logo-QEAtGWZ9.js +0 -6
- package/dist/lua-BVfhNLDr.js +0 -8
- package/dist/luau-BjYGiqID.js +0 -6
- package/dist/make-BjuHP00g.js +0 -6
- package/dist/malloy-explorer.css +0 -468
- package/dist/markdown-B6guhLWd.js +0 -6
- package/dist/marko-CHlMS8w5.js +0 -14
- package/dist/material-theme-D6KBX41T.js +0 -4
- package/dist/material-theme-darker-CkRroheE.js +0 -4
- package/dist/material-theme-lighter-BUBw43Yz.js +0 -4
- package/dist/material-theme-ocean-ClGX14Ja.js +0 -4
- package/dist/material-theme-palenight-C1RVm8K1.js +0 -4
- package/dist/matlab-BpQlIJiw.js +0 -6
- package/dist/mdc-4K6B6lHG.js +0 -12
- package/dist/mdx-DIoECIFU.js +0 -6
- package/dist/mermaid-BZ7WHNIe.js +0 -6
- package/dist/min-dark-C7ak0t6c.js +0 -4
- package/dist/min-light-CKFxVcPp.js +0 -4
- package/dist/mipsasm-DusDYkFc.js +0 -6
- package/dist/mojo-CY9jaezJ.js +0 -6
- package/dist/monokai-C1KBYcO0.js +0 -4
- package/dist/move-ChphFumd.js +0 -6
- package/dist/narrat-Dz4d7OmN.js +0 -6
- package/dist/nextflow-DW0Yq9a2.js +0 -6
- package/dist/nginx-Can2eAjw.js +0 -8
- package/dist/night-owl-Bm2rzalh.js +0 -4
- package/dist/nim-B3r2RtQZ.js +0 -20
- package/dist/nix-Cg5uV_xg.js +0 -6
- package/dist/nord-CC5OiUXg.js +0 -4
- package/dist/nushell-BfRnzRWn.js +0 -6
- package/dist/objective-c-BGg9R27G.js +0 -6
- package/dist/objective-cpp-CJ3y3V_5.js +0 -6
- package/dist/ocaml-BZLsfx_o.js +0 -6
- package/dist/one-dark-pro-D7-kP8fv.js +0 -4
- package/dist/one-light-D9sNaUtq.js +0 -4
- package/dist/pascal-l2bqd7Dz.js +0 -6
- package/dist/perl-DaMQyPwp.js +0 -16
- package/dist/php-BL3EfPBi.js +0 -18
- package/dist/plastic-CSTz3KZp.js +0 -4
- package/dist/plsql-oVq_K_wH.js +0 -6
- package/dist/po-5jaeIyVd.js +0 -6
- package/dist/poimandres-C-VADXHD.js +0 -4
- package/dist/polar-wcLp8ci7.js +0 -6
- package/dist/postcss-BZ3MNRIJ.js +0 -6
- package/dist/powerquery-CgRa2XRw.js +0 -6
- package/dist/powershell-Diwyv8Eh.js +0 -6
- package/dist/prisma-COL_v1x4.js +0 -6
- package/dist/prolog-CuvJOxqT.js +0 -6
- package/dist/proto-o9HLmF90.js +0 -6
- package/dist/pug-HKe4Luo3.js +0 -12
- package/dist/puppet-wpGOnQp5.js +0 -6
- package/dist/purescript-B_1NgE2N.js +0 -6
- package/dist/python-xYxLFJY-.js +0 -6
- package/dist/qml-FlMIyjU9.js +0 -8
- package/dist/qmldir-BInDYbpo.js +0 -6
- package/dist/qss-D-h4NdUG.js +0 -6
- package/dist/r-F-9I-ITZ.js +0 -6
- package/dist/racket-BoD1TBFT.js +0 -6
- package/dist/raku-IaYcw19m.js +0 -6
- package/dist/razor-CeqqNtyB.js +0 -10
- package/dist/red-7y8PH7HH.js +0 -4
- package/dist/reg-CMUdAgIP.js +0 -6
- package/dist/regexp-GiFkbxS-.js +0 -6
- package/dist/rel-BaRn3QX7.js +0 -6
- package/dist/riscv-B9V3SsvW.js +0 -6
- package/dist/rose-pine-DhT-HZE9.js +0 -4
- package/dist/rose-pine-dawn-DiCjL2i4.js +0 -4
- package/dist/rose-pine-moon-BNmGHlcn.js +0 -4
- package/dist/rst-C3D6-dqL.js +0 -22
- package/dist/ruby-DcPLUUK3.js +0 -30
- package/dist/rust-Pc7DCsZD.js +0 -6
- package/dist/sas-tDSYjXcL.js +0 -8
- package/dist/sass-iCyS6eP9.js +0 -6
- package/dist/scala-Cly-fENF.js +0 -6
- package/dist/scheme-Zi24oEYu.js +0 -6
- package/dist/scss-DhHc4lxB.js +0 -8
- package/dist/sdbl-BBamrXFL.js +0 -6
- package/dist/shaderlab-CvqEIoL0.js +0 -8
- package/dist/shellscript-Dn0-btNd.js +0 -6
- package/dist/shellsession-8OLo3sB6.js +0 -8
- package/dist/slack-dark-i7wN4OET.js +0 -4
- package/dist/slack-ochin-ndHf0LoP.js +0 -4
- package/dist/smalltalk-Cns31tKw.js +0 -6
- package/dist/snazzy-light-BlSJXAu4.js +0 -4
- package/dist/solarized-dark-UTmkh7lw.js +0 -4
- package/dist/solarized-light-BheCkDPT.js +0 -4
- package/dist/solidity-BG_k8fA_.js +0 -6
- package/dist/soy-EwHMOVPj.js +0 -8
- package/dist/sparql-DhuelBut.js +0 -8
- package/dist/splunk-CTqDjQdo.js +0 -6
- package/dist/sql-DCkt643-.js +0 -6
- package/dist/ssh-config-DHHGll-v.js +0 -6
- package/dist/stata-Dok6hMw0.js +0 -8
- package/dist/stylus-n_9f0QQ5.js +0 -6
- package/dist/svelte-01qw6Rxm.js +0 -14
- package/dist/swift-BAWqNR8A.js +0 -6
- package/dist/synthwave-84-NU3C_KFZ.js +0 -4
- package/dist/system-verilog-Cui-g-ut.js +0 -6
- package/dist/systemd-CsKYQIQK.js +0 -6
- package/dist/talonscript-D2dGh8FO.js +0 -6
- package/dist/tasl-D3W8HMV6.js +0 -6
- package/dist/tcl-2y0Fuc4S.js +0 -6
- package/dist/templ-Hmy8U0DD.js +0 -12
- package/dist/terraform-BGW6Oerf.js +0 -6
- package/dist/tex-mHs7a43s.js +0 -8
- package/dist/tokyo-night-LhP3hHhi.js +0 -4
- package/dist/toml-CQSfOn0e.js +0 -6
- package/dist/ts-tags-DYZ4SGcN.js +0 -41
- package/dist/tsv-BtvSkaG0.js +0 -6
- package/dist/tsx-DiGsgWT8.js +0 -6
- package/dist/turtle-BJ2wmjPc.js +0 -6
- package/dist/twig-BmytkGQV.js +0 -18
- package/dist/typescript-buWNZFwO.js +0 -6
- package/dist/typespec-bLbdsxJL.js +0 -6
- package/dist/typst-Y9_SmXTs.js +0 -6
- package/dist/v-wa8Orrdd.js +0 -6
- package/dist/vala-DRdriFr_.js +0 -6
- package/dist/vb-E2_-jk4M.js +0 -6
- package/dist/vendor-DfRellEl.js +0 -75318
- package/dist/verilog-B1iBoR5_.js +0 -6
- package/dist/vesper-CJsaOsSM.js +0 -4
- package/dist/vhdl-CRVaAhXk.js +0 -6
- package/dist/viml-B-zWOd7Z.js +0 -6
- package/dist/vitesse-black-BoGvW84i.js +0 -4
- package/dist/vitesse-dark-Cym-eLtO.js +0 -4
- package/dist/vitesse-light-CcmG315c.js +0 -4
- package/dist/vue-Bl1uVNsA.js +0 -31
- package/dist/vue-html-DHr5wjBG.js +0 -10
- package/dist/vyper-DWutKXpa.js +0 -6
- package/dist/wasm-Bv5f0gKv.js +0 -6
- package/dist/wasm-DQxwEHae.js +0 -7
- package/dist/wenyan-BMYnfus1.js +0 -6
- package/dist/wgsl-DnPoPGDU.js +0 -6
- package/dist/wikitext-CntM04PE.js +0 -6
- package/dist/wolfram-Ws5qPlX9.js +0 -6
- package/dist/xml-ChBsf5uy.js +0 -8
- package/dist/xsl-BefjlXrd.js +0 -8
- package/dist/yaml-Bbg74JKr.js +0 -6
- package/dist/zenscript-C0RKE4nU.js +0 -6
- package/dist/zig-D6SXBGNm.js +0 -6
- package/src/components/Package/PublisherPackageProvider.tsx +0 -48
- package/src/components/Project/TablesInSchema.tsx +0 -84
|
@@ -11,11 +11,13 @@ import {
|
|
|
11
11
|
import Stack from "@mui/material/Stack";
|
|
12
12
|
import { QueryClient, useQuery } from "@tanstack/react-query";
|
|
13
13
|
import React, { useEffect } from "react";
|
|
14
|
-
import { Configuration, NotebooksApi } from "../../client";
|
|
14
|
+
import { Configuration, NotebooksApi, CompiledNotebook } from "../../client";
|
|
15
15
|
import { highlight } from "../highlighter";
|
|
16
|
-
import {
|
|
16
|
+
import { usePackage } from "../Package";
|
|
17
17
|
import { StyledCard, StyledCardContent, StyledCardMedia } from "../styles";
|
|
18
18
|
import { NotebookCell } from "./NotebookCell";
|
|
19
|
+
import { ApiErrorDisplay, ApiError } from "../ApiErrorDisplay";
|
|
20
|
+
import { AxiosError } from "axios";
|
|
19
21
|
|
|
20
22
|
const notebooksApi = new NotebooksApi(new Configuration());
|
|
21
23
|
const queryClient = new QueryClient();
|
|
@@ -27,7 +29,7 @@ interface NotebookProps {
|
|
|
27
29
|
expandEmbeddings?: boolean;
|
|
28
30
|
hideEmbeddingIcons?: boolean;
|
|
29
31
|
}
|
|
30
|
-
// Requires
|
|
32
|
+
// Requires PackageProvider
|
|
31
33
|
export default function Notebook({
|
|
32
34
|
notebookPath,
|
|
33
35
|
expandCodeCells,
|
|
@@ -40,7 +42,7 @@ export default function Notebook({
|
|
|
40
42
|
const [highlightedEmbedCode, setHighlightedEmbedCode] =
|
|
41
43
|
React.useState<string>();
|
|
42
44
|
const { server, projectName, packageName, accessToken, versionId } =
|
|
43
|
-
|
|
45
|
+
usePackage();
|
|
44
46
|
const notebookCodeSnippet = getNotebookCodeSnippet(
|
|
45
47
|
server,
|
|
46
48
|
packageName,
|
|
@@ -59,7 +61,7 @@ export default function Notebook({
|
|
|
59
61
|
isSuccess,
|
|
60
62
|
isError,
|
|
61
63
|
error,
|
|
62
|
-
} = useQuery(
|
|
64
|
+
} = useQuery<CompiledNotebook, ApiError>(
|
|
63
65
|
{
|
|
64
66
|
queryKey: [
|
|
65
67
|
"notebook",
|
|
@@ -69,21 +71,44 @@ export default function Notebook({
|
|
|
69
71
|
notebookPath,
|
|
70
72
|
versionId,
|
|
71
73
|
],
|
|
72
|
-
queryFn: () =>
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
74
|
+
queryFn: async () => {
|
|
75
|
+
try {
|
|
76
|
+
const response = await notebooksApi.getNotebook(
|
|
77
|
+
projectName,
|
|
78
|
+
packageName,
|
|
79
|
+
notebookPath,
|
|
80
|
+
versionId,
|
|
81
|
+
{
|
|
82
|
+
baseURL: server,
|
|
83
|
+
withCredentials: !accessToken,
|
|
84
|
+
headers: {
|
|
85
|
+
Authorization: accessToken && `Bearer ${accessToken}`,
|
|
86
|
+
},
|
|
83
87
|
},
|
|
84
|
-
|
|
85
|
-
|
|
88
|
+
);
|
|
89
|
+
return response.data;
|
|
90
|
+
} catch (err) {
|
|
91
|
+
// If it's an Axios error, it will have response data
|
|
92
|
+
if (err && typeof err === "object" && "response" in err) {
|
|
93
|
+
const axiosError = err as AxiosError<{
|
|
94
|
+
code: string;
|
|
95
|
+
message: string;
|
|
96
|
+
}>;
|
|
97
|
+
if (axiosError.response?.data) {
|
|
98
|
+
const apiError: ApiError = new Error(
|
|
99
|
+
axiosError.response.data.message || axiosError.message,
|
|
100
|
+
);
|
|
101
|
+
apiError.status = axiosError.response.status;
|
|
102
|
+
apiError.data = axiosError.response.data;
|
|
103
|
+
throw apiError;
|
|
104
|
+
}
|
|
105
|
+
}
|
|
106
|
+
// For other errors, throw as is
|
|
107
|
+
throw err;
|
|
108
|
+
}
|
|
109
|
+
},
|
|
86
110
|
retry: false,
|
|
111
|
+
throwOnError: false,
|
|
87
112
|
},
|
|
88
113
|
queryClient,
|
|
89
114
|
);
|
|
@@ -171,7 +196,7 @@ export default function Notebook({
|
|
|
171
196
|
</Typography>
|
|
172
197
|
)}
|
|
173
198
|
{isSuccess &&
|
|
174
|
-
notebook.
|
|
199
|
+
notebook.notebookCells?.map((cell, index) => (
|
|
175
200
|
<NotebookCell
|
|
176
201
|
cell={cell}
|
|
177
202
|
notebookPath={notebookPath}
|
|
@@ -190,11 +215,10 @@ export default function Notebook({
|
|
|
190
215
|
/>
|
|
191
216
|
))}
|
|
192
217
|
{isError && (
|
|
193
|
-
<
|
|
194
|
-
{
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
</Typography>
|
|
218
|
+
<ApiErrorDisplay
|
|
219
|
+
error={error}
|
|
220
|
+
context={`${projectName} > ${packageName} > ${notebookPath}`}
|
|
221
|
+
/>
|
|
198
222
|
)}
|
|
199
223
|
</Stack>
|
|
200
224
|
</StyledCardMedia>
|
|
@@ -11,26 +11,16 @@ import { QueryClient, useQuery } from "@tanstack/react-query";
|
|
|
11
11
|
import axios from "axios";
|
|
12
12
|
import { Configuration, PackagesApi } from "../../client";
|
|
13
13
|
import { StyledCard, StyledCardContent } from "../styles";
|
|
14
|
+
import { usePackage } from "./PackageProvider";
|
|
15
|
+
import { ApiErrorDisplay } from "../ApiErrorDisplay";
|
|
14
16
|
|
|
15
|
-
axios.defaults.baseURL = "http://localhost:4000";
|
|
16
17
|
const packagesApi = new PackagesApi(new Configuration());
|
|
17
18
|
const queryClient = new QueryClient();
|
|
18
19
|
|
|
19
|
-
|
|
20
|
-
server
|
|
21
|
-
|
|
22
|
-
packageName: string;
|
|
23
|
-
versionId?: string;
|
|
24
|
-
accessToken?: string;
|
|
25
|
-
}
|
|
20
|
+
export default function Config() {
|
|
21
|
+
const { server, projectName, packageName, versionId, accessToken } =
|
|
22
|
+
usePackage();
|
|
26
23
|
|
|
27
|
-
export default function Package({
|
|
28
|
-
server,
|
|
29
|
-
projectName,
|
|
30
|
-
packageName,
|
|
31
|
-
versionId,
|
|
32
|
-
accessToken,
|
|
33
|
-
}: PackageProps) {
|
|
34
24
|
const { data, isSuccess, isError, error } = useQuery(
|
|
35
25
|
{
|
|
36
26
|
queryKey: ["package", server, projectName, packageName, versionId],
|
|
@@ -43,6 +33,7 @@ export default function Package({
|
|
|
43
33
|
},
|
|
44
34
|
}),
|
|
45
35
|
retry: false,
|
|
36
|
+
throwOnError: false,
|
|
46
37
|
},
|
|
47
38
|
queryClient,
|
|
48
39
|
);
|
|
@@ -94,9 +85,10 @@ export default function Package({
|
|
|
94
85
|
</ListItem>
|
|
95
86
|
))}
|
|
96
87
|
{isError && (
|
|
97
|
-
<
|
|
98
|
-
{
|
|
99
|
-
|
|
88
|
+
<ApiErrorDisplay
|
|
89
|
+
error={error}
|
|
90
|
+
context={`${projectName} > ${packageName} > ${versionId}`}
|
|
91
|
+
/>
|
|
100
92
|
)}
|
|
101
93
|
</List>
|
|
102
94
|
</Box>
|
|
@@ -11,17 +11,12 @@ import { QueryClient, useQuery } from "@tanstack/react-query";
|
|
|
11
11
|
import { Configuration, ConnectionsApi } from "../../client";
|
|
12
12
|
import { Connection as ApiConnection } from "../../client/api";
|
|
13
13
|
import { StyledCard, StyledCardContent } from "../styles";
|
|
14
|
+
import { usePackage } from "./PackageProvider";
|
|
15
|
+
import { ApiErrorDisplay } from "../ApiErrorDisplay";
|
|
14
16
|
|
|
15
17
|
const connectionsApi = new ConnectionsApi(new Configuration());
|
|
16
18
|
const queryClient = new QueryClient();
|
|
17
19
|
|
|
18
|
-
interface ConnectionsProps {
|
|
19
|
-
server?: string;
|
|
20
|
-
projectName: string;
|
|
21
|
-
accessToken: string;
|
|
22
|
-
navigate: (to: string, event?: React.MouseEvent) => void;
|
|
23
|
-
}
|
|
24
|
-
|
|
25
20
|
// TODO(jjs) - Move this UI to the ConnectionExplorer component
|
|
26
21
|
function Connection({ connection }: { connection: ApiConnection }) {
|
|
27
22
|
return (
|
|
@@ -36,8 +31,9 @@ function Connection({ connection }: { connection: ApiConnection }) {
|
|
|
36
31
|
);
|
|
37
32
|
}
|
|
38
33
|
|
|
39
|
-
export default function Connections(
|
|
40
|
-
const { server, projectName, accessToken } =
|
|
34
|
+
export default function Connections() {
|
|
35
|
+
const { server, projectName, accessToken } = usePackage();
|
|
36
|
+
|
|
41
37
|
const { data, isSuccess, isError, error } = useQuery(
|
|
42
38
|
{
|
|
43
39
|
queryKey: ["connections", server, projectName],
|
|
@@ -50,6 +46,7 @@ export default function Connections(connectionProps: ConnectionsProps) {
|
|
|
50
46
|
},
|
|
51
47
|
}),
|
|
52
48
|
retry: false,
|
|
49
|
+
throwOnError: false,
|
|
53
50
|
},
|
|
54
51
|
queryClient,
|
|
55
52
|
);
|
|
@@ -98,9 +95,10 @@ export default function Connections(connectionProps: ConnectionsProps) {
|
|
|
98
95
|
<Typography variant="body2">No Connections</Typography>
|
|
99
96
|
)}
|
|
100
97
|
{isError && (
|
|
101
|
-
<
|
|
102
|
-
{
|
|
103
|
-
|
|
98
|
+
<ApiErrorDisplay
|
|
99
|
+
error={error}
|
|
100
|
+
context={`${projectName} > Connections`}
|
|
101
|
+
/>
|
|
104
102
|
)}
|
|
105
103
|
</Box>
|
|
106
104
|
</StyledCardContent>
|
|
@@ -4,7 +4,6 @@ import {
|
|
|
4
4
|
DialogContent,
|
|
5
5
|
DialogTitle,
|
|
6
6
|
Divider,
|
|
7
|
-
IconButton,
|
|
8
7
|
Table,
|
|
9
8
|
TableBody,
|
|
10
9
|
TableCell,
|
|
@@ -17,26 +16,31 @@ import { QueryClient, useQuery } from "@tanstack/react-query";
|
|
|
17
16
|
import React from "react";
|
|
18
17
|
import { Configuration, Database, DatabasesApi } from "../../client";
|
|
19
18
|
import { StyledCard, StyledCardContent } from "../styles";
|
|
19
|
+
import { usePackage } from "./PackageProvider";
|
|
20
|
+
import { ApiErrorDisplay } from "../ApiErrorDisplay";
|
|
20
21
|
|
|
21
22
|
const databasesApi = new DatabasesApi(new Configuration());
|
|
22
23
|
const queryClient = new QueryClient();
|
|
23
24
|
|
|
24
|
-
|
|
25
|
-
server
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
25
|
+
export default function Databases() {
|
|
26
|
+
const { server, projectName, packageName, versionId, accessToken } =
|
|
27
|
+
usePackage();
|
|
28
|
+
|
|
29
|
+
const [open, setOpen] = React.useState(false);
|
|
30
|
+
const [selectedDatabase, setSelectedDatabase] =
|
|
31
|
+
React.useState<Database | null>(null);
|
|
32
|
+
|
|
33
|
+
const handleOpen = (database: Database) => {
|
|
34
|
+
setSelectedDatabase(database);
|
|
35
|
+
setOpen(true);
|
|
36
|
+
};
|
|
37
|
+
|
|
38
|
+
const handleClose = () => {
|
|
39
|
+
setOpen(false);
|
|
40
|
+
setSelectedDatabase(null);
|
|
41
|
+
};
|
|
31
42
|
|
|
32
|
-
|
|
33
|
-
server,
|
|
34
|
-
projectName,
|
|
35
|
-
packageName,
|
|
36
|
-
versionId,
|
|
37
|
-
accessToken,
|
|
38
|
-
}: DatabaseProps) {
|
|
39
|
-
const { data, isSuccess, isError, error } = useQuery(
|
|
43
|
+
const { data, isError, error, isSuccess } = useQuery(
|
|
40
44
|
{
|
|
41
45
|
queryKey: ["databases", server, projectName, packageName, versionId],
|
|
42
46
|
queryFn: () =>
|
|
@@ -48,6 +52,7 @@ export default function DatabaseView({
|
|
|
48
52
|
},
|
|
49
53
|
}),
|
|
50
54
|
retry: false,
|
|
55
|
+
throwOnError: false,
|
|
51
56
|
},
|
|
52
57
|
queryClient,
|
|
53
58
|
);
|
|
@@ -63,203 +68,93 @@ export default function DatabaseView({
|
|
|
63
68
|
}
|
|
64
69
|
};
|
|
65
70
|
return (
|
|
66
|
-
|
|
67
|
-
<
|
|
68
|
-
<
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
71
|
+
<>
|
|
72
|
+
<StyledCard variant="outlined" sx={{ padding: "10px", width: "100%" }}>
|
|
73
|
+
<StyledCardContent>
|
|
74
|
+
<Typography variant="overline" fontWeight="bold">
|
|
75
|
+
Databases
|
|
76
|
+
</Typography>
|
|
77
|
+
<Divider />
|
|
78
|
+
<Box
|
|
79
|
+
sx={{
|
|
80
|
+
mt: "10px",
|
|
81
|
+
maxHeight: "200px",
|
|
82
|
+
overflowY: "auto",
|
|
83
|
+
}}
|
|
84
|
+
>
|
|
85
|
+
{!isSuccess && !isError && (
|
|
86
|
+
<Typography variant="body2" sx={{ p: "10px", m: "auto" }}>
|
|
87
|
+
Fetching Databases...
|
|
88
|
+
</Typography>
|
|
89
|
+
)}
|
|
90
|
+
{isError && (
|
|
91
|
+
<ApiErrorDisplay
|
|
92
|
+
error={error}
|
|
93
|
+
context={`${projectName} > ${packageName} > Databases`}
|
|
94
|
+
/>
|
|
95
|
+
)}
|
|
96
|
+
{isSuccess && data.data.length > 0 && (
|
|
86
97
|
<Table size="small">
|
|
87
98
|
<TableHead>
|
|
88
99
|
<TableRow>
|
|
89
|
-
<TableCell>
|
|
90
|
-
|
|
91
|
-
variant="subtitle2"
|
|
92
|
-
fontWeight="bold"
|
|
93
|
-
>
|
|
94
|
-
Database Name
|
|
95
|
-
</Typography>
|
|
96
|
-
</TableCell>
|
|
97
|
-
<TableCell align="right">
|
|
98
|
-
<Typography
|
|
99
|
-
variant="subtitle2"
|
|
100
|
-
fontWeight="bold"
|
|
101
|
-
>
|
|
102
|
-
Table Rows
|
|
103
|
-
</Typography>
|
|
104
|
-
</TableCell>
|
|
100
|
+
<TableCell>Name</TableCell>
|
|
101
|
+
<TableCell align="right">Rows</TableCell>
|
|
105
102
|
</TableRow>
|
|
106
103
|
</TableHead>
|
|
107
104
|
<TableBody>
|
|
108
105
|
{data.data.map((database) => (
|
|
109
|
-
<TableRow
|
|
110
|
-
|
|
111
|
-
|
|
106
|
+
<TableRow
|
|
107
|
+
key={database.path}
|
|
108
|
+
onClick={() => handleOpen(database)}
|
|
109
|
+
sx={{ cursor: "pointer" }}
|
|
110
|
+
>
|
|
111
|
+
<TableCell component="th" scope="row">
|
|
112
|
+
{database.path}
|
|
112
113
|
</TableCell>
|
|
113
114
|
<TableCell align="right">
|
|
114
|
-
|
|
115
|
-
{formatRowSize(database.info.rowCount)}
|
|
116
|
-
</Typography>
|
|
115
|
+
{formatRowSize(database.info.rowCount)}
|
|
117
116
|
</TableCell>
|
|
118
117
|
</TableRow>
|
|
119
118
|
))}
|
|
120
119
|
</TableBody>
|
|
121
120
|
</Table>
|
|
121
|
+
)}
|
|
122
|
+
{isSuccess && data.data.length === 0 && (
|
|
123
|
+
<Typography variant="body2" sx={{ p: "10px", m: "auto" }}>
|
|
124
|
+
No databases found
|
|
125
|
+
</Typography>
|
|
126
|
+
)}
|
|
127
|
+
</Box>
|
|
128
|
+
</StyledCardContent>
|
|
129
|
+
</StyledCard>
|
|
130
|
+
|
|
131
|
+
<Dialog open={open} onClose={handleClose} maxWidth="sm" fullWidth>
|
|
132
|
+
<DialogTitle>{selectedDatabase?.path}</DialogTitle>
|
|
133
|
+
<DialogContent>
|
|
134
|
+
{selectedDatabase?.info?.columns && (
|
|
135
|
+
<TableContainer>
|
|
136
|
+
<Table size="small">
|
|
137
|
+
<TableHead>
|
|
138
|
+
<TableRow>
|
|
139
|
+
<TableCell>Column</TableCell>
|
|
140
|
+
<TableCell>Type</TableCell>
|
|
141
|
+
</TableRow>
|
|
142
|
+
</TableHead>
|
|
143
|
+
<TableBody>
|
|
144
|
+
{selectedDatabase.info.columns.map((column) => (
|
|
145
|
+
<TableRow key={column.name}>
|
|
146
|
+
<TableCell component="th" scope="row">
|
|
147
|
+
{column.name}
|
|
148
|
+
</TableCell>
|
|
149
|
+
<TableCell>{column.type}</TableCell>
|
|
150
|
+
</TableRow>
|
|
151
|
+
))}
|
|
152
|
+
</TableBody>
|
|
153
|
+
</Table>
|
|
122
154
|
</TableContainer>
|
|
123
155
|
)}
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
{isError && (
|
|
128
|
-
<Typography variant="body2" sx={{ p: "10px", m: "auto" }}>
|
|
129
|
-
{`${projectName} > ${packageName} > ${versionId} - ${error.message}`}
|
|
130
|
-
</Typography>
|
|
131
|
-
)}
|
|
132
|
-
</Box>
|
|
133
|
-
</StyledCardContent>
|
|
134
|
-
</StyledCard>
|
|
135
|
-
);
|
|
136
|
-
}
|
|
137
|
-
|
|
138
|
-
function NameAndSchema({ database }: { database: Database }) {
|
|
139
|
-
const [open, setOpen] = React.useState(false);
|
|
140
|
-
return (
|
|
141
|
-
<Box
|
|
142
|
-
sx={{ display: "flex", alignItems: "center" }}
|
|
143
|
-
onClick={() => setOpen(!open)}
|
|
144
|
-
style={{ cursor: "pointer" }}
|
|
145
|
-
>
|
|
146
|
-
<Typography
|
|
147
|
-
variant="body2"
|
|
148
|
-
color="primary"
|
|
149
|
-
sx={{
|
|
150
|
-
maxWidth: "200px",
|
|
151
|
-
overflow: "hidden",
|
|
152
|
-
textOverflow: "ellipsis",
|
|
153
|
-
whiteSpace: "nowrap",
|
|
154
|
-
}}
|
|
155
|
-
>
|
|
156
|
-
{database.path}
|
|
157
|
-
</Typography>
|
|
158
|
-
|
|
159
|
-
<Box sx={{ display: "flex", alignItems: "center" }}>
|
|
160
|
-
<Box sx={{ mr: 1, display: "flex", alignItems: "center" }}>
|
|
161
|
-
<svg
|
|
162
|
-
width="16"
|
|
163
|
-
height="16"
|
|
164
|
-
viewBox="0 0 24 24"
|
|
165
|
-
fill="none"
|
|
166
|
-
xmlns="http://www.w3.org/2000/svg"
|
|
167
|
-
>
|
|
168
|
-
<path
|
|
169
|
-
d="M11 7H6C5.46957 7 4.96086 7.21071 4.58579 7.58579C4.21071 7.96086 4 8.46957 4 9V18C4 18.5304 4.21071 19.0391 4.58579 19.4142C4.96086 19.7893 5.46957 20 6 20H15C15.5304 20 16.0391 19.7893 16.4142 19.4142C16.7893 19.0391 17 18.5304 17 18V13"
|
|
170
|
-
stroke="currentColor"
|
|
171
|
-
strokeWidth="2"
|
|
172
|
-
strokeLinecap="round"
|
|
173
|
-
strokeLinejoin="round"
|
|
174
|
-
/>
|
|
175
|
-
<path
|
|
176
|
-
d="M9 15L20 4"
|
|
177
|
-
stroke="currentColor"
|
|
178
|
-
strokeWidth="2"
|
|
179
|
-
strokeLinecap="round"
|
|
180
|
-
strokeLinejoin="round"
|
|
181
|
-
/>
|
|
182
|
-
<path
|
|
183
|
-
d="M15 4H20V9"
|
|
184
|
-
stroke="currentColor"
|
|
185
|
-
strokeWidth="2"
|
|
186
|
-
strokeLinecap="round"
|
|
187
|
-
strokeLinejoin="round"
|
|
188
|
-
/>
|
|
189
|
-
</svg>
|
|
190
|
-
</Box>
|
|
191
|
-
</Box>
|
|
192
|
-
<SchemaButton
|
|
193
|
-
database={database}
|
|
194
|
-
open={open}
|
|
195
|
-
setClose={() => setOpen(false)}
|
|
196
|
-
/>
|
|
197
|
-
</Box>
|
|
198
|
-
);
|
|
199
|
-
}
|
|
200
|
-
|
|
201
|
-
function SchemaButton({
|
|
202
|
-
database,
|
|
203
|
-
open,
|
|
204
|
-
setClose,
|
|
205
|
-
}: {
|
|
206
|
-
open: boolean;
|
|
207
|
-
setClose: () => void;
|
|
208
|
-
database: Database;
|
|
209
|
-
}) {
|
|
210
|
-
return (
|
|
211
|
-
<Dialog open={open} onClose={setClose} maxWidth="sm" fullWidth>
|
|
212
|
-
<DialogTitle>
|
|
213
|
-
Schema:{" "}
|
|
214
|
-
<Typography
|
|
215
|
-
fontSize="large"
|
|
216
|
-
variant="body2"
|
|
217
|
-
fontFamily="monospace"
|
|
218
|
-
component="span"
|
|
219
|
-
>
|
|
220
|
-
{database.path}
|
|
221
|
-
</Typography>
|
|
222
|
-
<IconButton
|
|
223
|
-
aria-label="close"
|
|
224
|
-
onClick={setClose}
|
|
225
|
-
sx={{ position: "absolute", right: 8, top: 8 }}
|
|
226
|
-
>
|
|
227
|
-
<Box
|
|
228
|
-
sx={{
|
|
229
|
-
width: 24,
|
|
230
|
-
height: 24,
|
|
231
|
-
display: "flex",
|
|
232
|
-
alignItems: "center",
|
|
233
|
-
justifyContent: "center",
|
|
234
|
-
}}
|
|
235
|
-
>
|
|
236
|
-
X
|
|
237
|
-
</Box>
|
|
238
|
-
</IconButton>
|
|
239
|
-
</DialogTitle>
|
|
240
|
-
<DialogContent>
|
|
241
|
-
<TableContainer>
|
|
242
|
-
<Table
|
|
243
|
-
size="small"
|
|
244
|
-
sx={{ "& .MuiTableCell-root": { padding: "10px" } }}
|
|
245
|
-
>
|
|
246
|
-
<TableHead>
|
|
247
|
-
<TableRow>
|
|
248
|
-
<TableCell>NAME</TableCell>
|
|
249
|
-
<TableCell>TYPE</TableCell>
|
|
250
|
-
</TableRow>
|
|
251
|
-
</TableHead>
|
|
252
|
-
<TableBody>
|
|
253
|
-
{database.info.columns.map((row) => (
|
|
254
|
-
<TableRow key={row.name}>
|
|
255
|
-
<TableCell>{row.name}</TableCell>
|
|
256
|
-
<TableCell>{row.type}</TableCell>
|
|
257
|
-
</TableRow>
|
|
258
|
-
))}
|
|
259
|
-
</TableBody>
|
|
260
|
-
</Table>
|
|
261
|
-
</TableContainer>
|
|
262
|
-
</DialogContent>
|
|
263
|
-
</Dialog>
|
|
156
|
+
</DialogContent>
|
|
157
|
+
</Dialog>
|
|
158
|
+
</>
|
|
264
159
|
);
|
|
265
160
|
}
|
|
@@ -22,7 +22,7 @@ import Collapse from "@mui/material/Collapse";
|
|
|
22
22
|
import DnsIcon from "@mui/icons-material/DnsOutlined";
|
|
23
23
|
import DataArrayIcon from "@mui/icons-material/DataArrayOutlined";
|
|
24
24
|
import { Database, Model } from "../../client";
|
|
25
|
-
import { Typography } from "@mui/material";
|
|
25
|
+
import { Typography, Tooltip } from "@mui/material";
|
|
26
26
|
|
|
27
27
|
interface FiieTreeViewProps {
|
|
28
28
|
items: Model[] | Database[];
|
|
@@ -65,6 +65,7 @@ type ExtendedTreeItemProps = {
|
|
|
65
65
|
fileType: FileType;
|
|
66
66
|
selectable: boolean;
|
|
67
67
|
link: ((event?: React.MouseEvent) => void) | undefined;
|
|
68
|
+
error?: string;
|
|
68
69
|
};
|
|
69
70
|
|
|
70
71
|
interface CustomLabelProps {
|
|
@@ -72,13 +73,13 @@ interface CustomLabelProps {
|
|
|
72
73
|
}
|
|
73
74
|
|
|
74
75
|
function CustomTreeItem2Label({ item, ...other }: CustomLabelProps) {
|
|
75
|
-
|
|
76
|
+
const label = (
|
|
76
77
|
<TreeItem2Label
|
|
77
78
|
{...other}
|
|
78
79
|
sx={{
|
|
79
80
|
display: "flex",
|
|
80
81
|
alignItems: "center",
|
|
81
|
-
color: "grey.600",
|
|
82
|
+
color: item.error ? "error.main" : "grey.600",
|
|
82
83
|
}}
|
|
83
84
|
>
|
|
84
85
|
{(item.fileType === "directory" && <FolderIcon />) ||
|
|
@@ -88,12 +89,26 @@ function CustomTreeItem2Label({ item, ...other }: CustomLabelProps) {
|
|
|
88
89
|
<Typography
|
|
89
90
|
variant="body2"
|
|
90
91
|
sx={{ marginLeft: "5px" }}
|
|
91
|
-
color={
|
|
92
|
+
color={
|
|
93
|
+
item.error
|
|
94
|
+
? "error.main"
|
|
95
|
+
: item.link
|
|
96
|
+
? "primary.main"
|
|
97
|
+
: "grey.600"
|
|
98
|
+
}
|
|
92
99
|
>
|
|
93
100
|
{item.label}
|
|
94
101
|
</Typography>
|
|
95
102
|
</TreeItem2Label>
|
|
96
103
|
);
|
|
104
|
+
|
|
105
|
+
return item.error ? (
|
|
106
|
+
<Tooltip title={item.error} placement="right">
|
|
107
|
+
{label}
|
|
108
|
+
</Tooltip>
|
|
109
|
+
) : (
|
|
110
|
+
label
|
|
111
|
+
);
|
|
97
112
|
}
|
|
98
113
|
|
|
99
114
|
interface CustomTreeItemProps
|
|
@@ -193,6 +208,7 @@ function getTreeViewRecursive(
|
|
|
193
208
|
"unknown";
|
|
194
209
|
if (fileType !== "unknown") {
|
|
195
210
|
// This is a model or database.
|
|
211
|
+
const entry = value as Model | Database;
|
|
196
212
|
treeViewItems.push({
|
|
197
213
|
id: path + key,
|
|
198
214
|
label: key,
|
|
@@ -202,6 +218,7 @@ function getTreeViewRecursive(
|
|
|
202
218
|
? (event) => navigate(path + key, event)
|
|
203
219
|
: undefined,
|
|
204
220
|
selectable: fileType === "model" || fileType === "notebook",
|
|
221
|
+
error: "error" in entry ? entry.error : undefined,
|
|
205
222
|
});
|
|
206
223
|
} else {
|
|
207
224
|
// This is a directory.
|