@malloy-publisher/sdk 0.0.33 → 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-DphykkT6.cjs +1 -0
- 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/components/RenderedResult/RenderedResult.d.ts +4 -1
- package/dist/index-nKbldp0y.cjs +3000 -0
- package/dist/index.cjs.js +1 -2914
- package/dist/sdk.css +1 -1
- package/package.json +5 -5
- 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 +6 -10
- package/src/components/MutableNotebook/MutableNotebook.tsx +2 -2
- package/src/components/Notebook/Notebook.tsx +48 -24
- package/src/components/Notebook/NotebookCell.tsx +7 -5
- 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/RenderedResult.tsx +50 -11
- package/src/components/RenderedResult/ResultContainer.tsx +24 -9
- package/dist/RenderedResult-B9Gth8IY.cjs +0 -1
- package/dist/RenderedResult-Drg_uJPZ.js +0 -30
- 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.es.js +0 -140061
- 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 -497
- 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
|
@@ -17,6 +17,7 @@ import LinkOutlinedIcon from "@mui/icons-material/LinkOutlined";
|
|
|
17
17
|
import ContentCopyIcon from "@mui/icons-material/ContentCopy";
|
|
18
18
|
import { useEffect } from "react";
|
|
19
19
|
import { highlight } from "../highlighter";
|
|
20
|
+
import { usePackage } from "../Package/PackageProvider";
|
|
20
21
|
|
|
21
22
|
const StyledCard = styled(Card)({
|
|
22
23
|
display: "flex",
|
|
@@ -25,75 +26,60 @@ const StyledCard = styled(Card)({
|
|
|
25
26
|
});
|
|
26
27
|
|
|
27
28
|
interface ModelCellProps {
|
|
28
|
-
server: string;
|
|
29
|
-
projectName: string;
|
|
30
|
-
packageName: string;
|
|
31
29
|
modelPath: string;
|
|
32
|
-
versionId: string;
|
|
33
30
|
sourceName?: string;
|
|
34
31
|
queryName: string;
|
|
35
32
|
expandResult?: boolean;
|
|
36
33
|
hideResultIcon?: boolean;
|
|
37
34
|
expandEmbedding?: boolean;
|
|
38
35
|
hideEmbeddingIcon?: boolean;
|
|
39
|
-
accessToken?: string;
|
|
40
36
|
noView?: boolean;
|
|
41
37
|
annotations?: string[];
|
|
42
38
|
}
|
|
43
39
|
|
|
44
40
|
export function ModelCell({
|
|
45
|
-
server,
|
|
46
|
-
projectName,
|
|
47
|
-
packageName,
|
|
48
41
|
modelPath,
|
|
49
|
-
versionId,
|
|
50
42
|
sourceName,
|
|
51
43
|
queryName,
|
|
52
44
|
expandResult,
|
|
53
45
|
hideResultIcon,
|
|
54
46
|
expandEmbedding,
|
|
55
47
|
hideEmbeddingIcon,
|
|
56
|
-
accessToken,
|
|
57
48
|
noView,
|
|
58
49
|
annotations,
|
|
59
50
|
}: ModelCellProps) {
|
|
60
51
|
const [resultsExpanded, setResultsExpanded] = React.useState(expandResult);
|
|
61
52
|
const [embeddingExpanded, setEmbeddingExpanded] =
|
|
62
|
-
React.useState(expandEmbedding);
|
|
53
|
+
React.useState<boolean>(expandEmbedding);
|
|
63
54
|
const [highlightedEmbedCode, setHighlightedEmbedCode] =
|
|
64
55
|
React.useState<string>();
|
|
65
56
|
const [highlightedAnnotations, setHighlightedAnnotations] =
|
|
66
57
|
React.useState<string>();
|
|
67
58
|
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
server,
|
|
72
|
-
projectName,
|
|
73
|
-
packageName,
|
|
74
|
-
modelPath,
|
|
75
|
-
versionId,
|
|
76
|
-
sourceName,
|
|
77
|
-
queryName,
|
|
78
|
-
),
|
|
79
|
-
"typescript",
|
|
80
|
-
).then((code) => {
|
|
81
|
-
setHighlightedEmbedCode(code);
|
|
82
|
-
});
|
|
83
|
-
}, [
|
|
59
|
+
const { server, projectName, packageName, versionId } = usePackage();
|
|
60
|
+
|
|
61
|
+
const queryResultCodeSnippet = getQueryResultCodeSnippet(
|
|
84
62
|
server,
|
|
85
63
|
projectName,
|
|
86
64
|
packageName,
|
|
87
|
-
modelPath,
|
|
88
65
|
versionId,
|
|
89
66
|
sourceName,
|
|
90
67
|
queryName,
|
|
91
|
-
|
|
68
|
+
);
|
|
69
|
+
|
|
70
|
+
useEffect(() => {
|
|
71
|
+
highlight(queryResultCodeSnippet, "typescript").then((code) => {
|
|
72
|
+
setHighlightedEmbedCode(code);
|
|
73
|
+
});
|
|
74
|
+
}, [embeddingExpanded, queryResultCodeSnippet]);
|
|
92
75
|
|
|
93
76
|
useEffect(() => {
|
|
94
|
-
if (annotations) {
|
|
95
|
-
|
|
96
|
-
|
|
77
|
+
if (annotations && annotations.length > 0) {
|
|
78
|
+
const code = annotations
|
|
79
|
+
.map((annotation) => `// ${annotation}`)
|
|
80
|
+
.join("\n");
|
|
81
|
+
highlight(code, "typescript").then((highlightedCode) => {
|
|
82
|
+
setHighlightedAnnotations(highlightedCode);
|
|
97
83
|
});
|
|
98
84
|
}
|
|
99
85
|
}, [annotations]);
|
|
@@ -155,39 +141,33 @@ export function ModelCell({
|
|
|
155
141
|
</CardActions>
|
|
156
142
|
</Stack>
|
|
157
143
|
<Collapse in={embeddingExpanded} timeout="auto" unmountOnExit>
|
|
158
|
-
<Divider
|
|
144
|
+
<Divider />
|
|
159
145
|
<Stack
|
|
160
146
|
sx={{
|
|
147
|
+
p: "10px",
|
|
161
148
|
borderRadius: 0,
|
|
162
149
|
flexDirection: "row",
|
|
163
150
|
justifyContent: "space-between",
|
|
164
151
|
}}
|
|
165
152
|
>
|
|
166
153
|
<Typography
|
|
167
|
-
|
|
168
|
-
|
|
154
|
+
sx={{
|
|
155
|
+
fontSize: "12px",
|
|
156
|
+
"& .line": { textWrap: "wrap" },
|
|
157
|
+
}}
|
|
169
158
|
>
|
|
170
159
|
<div
|
|
171
|
-
className="content"
|
|
172
160
|
dangerouslySetInnerHTML={{
|
|
173
161
|
__html: highlightedEmbedCode,
|
|
174
162
|
}}
|
|
175
163
|
/>
|
|
176
164
|
</Typography>
|
|
177
|
-
<Tooltip title="
|
|
165
|
+
<Tooltip title="Copy Embeddable Code">
|
|
178
166
|
<IconButton
|
|
179
167
|
sx={{ width: "24px", height: "24px" }}
|
|
180
168
|
onClick={() => {
|
|
181
169
|
navigator.clipboard.writeText(
|
|
182
|
-
|
|
183
|
-
server,
|
|
184
|
-
projectName,
|
|
185
|
-
packageName,
|
|
186
|
-
modelPath,
|
|
187
|
-
versionId,
|
|
188
|
-
sourceName,
|
|
189
|
-
queryName,
|
|
190
|
-
),
|
|
170
|
+
queryResultCodeSnippet,
|
|
191
171
|
);
|
|
192
172
|
}}
|
|
193
173
|
>
|
|
@@ -227,14 +207,9 @@ export function ModelCell({
|
|
|
227
207
|
)}
|
|
228
208
|
<CardContent>
|
|
229
209
|
<QueryResult
|
|
230
|
-
server={server}
|
|
231
|
-
projectName={projectName}
|
|
232
|
-
packageName={packageName}
|
|
233
210
|
modelPath={modelPath}
|
|
234
|
-
versionId={versionId}
|
|
235
211
|
sourceName={sourceName}
|
|
236
212
|
queryName={queryName}
|
|
237
|
-
accessToken={accessToken}
|
|
238
213
|
/>
|
|
239
214
|
</CardContent>
|
|
240
215
|
</Collapse>
|
|
@@ -247,7 +222,6 @@ function getQueryResultCodeSnippet(
|
|
|
247
222
|
server: string,
|
|
248
223
|
projectName: string,
|
|
249
224
|
packageName: string,
|
|
250
|
-
modelPath: string,
|
|
251
225
|
versionId: string,
|
|
252
226
|
sourceName: string,
|
|
253
227
|
queryName: string,
|
|
@@ -257,19 +231,8 @@ server="${server}"
|
|
|
257
231
|
accessToken={accessToken}
|
|
258
232
|
projectName="${projectName}"
|
|
259
233
|
packageName="${packageName}"
|
|
260
|
-
modelPath="${modelPath}"
|
|
261
234
|
versionId="${versionId}"
|
|
262
235
|
sourceName="${sourceName}"
|
|
263
236
|
queryName="${queryName}"
|
|
264
237
|
/>`;
|
|
265
238
|
}
|
|
266
|
-
|
|
267
|
-
function getAnnotations(annotations: string[]): string {
|
|
268
|
-
let res = "";
|
|
269
|
-
|
|
270
|
-
for (const an of annotations) {
|
|
271
|
-
res += an;
|
|
272
|
-
}
|
|
273
|
-
|
|
274
|
-
return res;
|
|
275
|
-
}
|
|
@@ -10,7 +10,7 @@ import { StyledCard, StyledCardContent } from "../styles";
|
|
|
10
10
|
|
|
11
11
|
import { QueryClient, useMutation } from "@tanstack/react-query";
|
|
12
12
|
import { Configuration } from "../../client";
|
|
13
|
-
import {
|
|
13
|
+
import { usePackage } from "../Package";
|
|
14
14
|
import React from "react";
|
|
15
15
|
import ResultContainer from "../RenderedResult/ResultContainer";
|
|
16
16
|
|
|
@@ -27,7 +27,7 @@ export default function NamedQueries({
|
|
|
27
27
|
modelPath,
|
|
28
28
|
}: NamedQueryProps) {
|
|
29
29
|
const { server, projectName, packageName, versionId, accessToken } =
|
|
30
|
-
|
|
30
|
+
usePackage();
|
|
31
31
|
const [namedQueryResults, setNamedQueryResults] = React.useState<
|
|
32
32
|
Record<string, string>
|
|
33
33
|
>({});
|
|
@@ -21,7 +21,7 @@ import { styled } from "@mui/material/styles";
|
|
|
21
21
|
import { QueryClient, useMutation } from "@tanstack/react-query";
|
|
22
22
|
import React from "react";
|
|
23
23
|
import { Configuration, QueryresultsApi } from "../../client";
|
|
24
|
-
import {
|
|
24
|
+
import { usePackage } from "../Package/PackageProvider";
|
|
25
25
|
|
|
26
26
|
const queryResultsApi = new QueryresultsApi(new Configuration());
|
|
27
27
|
const queryClient = new QueryClient();
|
|
@@ -87,8 +87,8 @@ export function SourcesExplorer({
|
|
|
87
87
|
const [selectedTab, setSelectedTab] = React.useState(
|
|
88
88
|
existingSourceName
|
|
89
89
|
? sourceAndPaths.findIndex(
|
|
90
|
-
|
|
91
|
-
|
|
90
|
+
(entry) => entry.sourceInfo.name === existingSourceName,
|
|
91
|
+
)
|
|
92
92
|
: 0,
|
|
93
93
|
);
|
|
94
94
|
|
|
@@ -193,7 +193,7 @@ export function SourceExplorerComponent({
|
|
|
193
193
|
}
|
|
194
194
|
}, [onChange, query]);
|
|
195
195
|
const { server, projectName, packageName, versionId, accessToken } =
|
|
196
|
-
|
|
196
|
+
usePackage();
|
|
197
197
|
const mutation = useMutation(
|
|
198
198
|
{
|
|
199
199
|
mutationFn: () => {
|
|
@@ -272,7 +272,6 @@ export function SourceExplorerComponent({
|
|
|
272
272
|
onFocusedNestViewPathChange={setFocusedNestViewPath}
|
|
273
273
|
onDrill={(params) => {
|
|
274
274
|
console.info(params);
|
|
275
|
-
window.alert("Drill!");
|
|
276
275
|
}}
|
|
277
276
|
>
|
|
278
277
|
<div
|
|
@@ -324,16 +323,16 @@ export function SourceExplorerComponent({
|
|
|
324
323
|
submittedQuery={
|
|
325
324
|
query?.malloyQuery
|
|
326
325
|
? {
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
326
|
+
executionState: mutation.isPending
|
|
327
|
+
? "running"
|
|
328
|
+
: "finished",
|
|
329
|
+
response: {
|
|
330
|
+
result: query.malloyResult,
|
|
331
|
+
},
|
|
332
|
+
query: query.malloyQuery,
|
|
333
|
+
queryResolutionStartMillis: Date.now(),
|
|
334
|
+
onCancel: mutation.reset,
|
|
335
|
+
}
|
|
337
336
|
: undefined
|
|
338
337
|
}
|
|
339
338
|
options={{ showRawQuery: true }}
|
|
@@ -18,8 +18,9 @@ import {
|
|
|
18
18
|
import { QueryClient, useQuery } from "@tanstack/react-query";
|
|
19
19
|
import React from "react";
|
|
20
20
|
import { Configuration, ModelsApi } from "../../client";
|
|
21
|
-
import {
|
|
21
|
+
import { usePackage } from "../Package/PackageProvider";
|
|
22
22
|
import { StyledCard } from "../styles";
|
|
23
|
+
import { ApiErrorDisplay } from "../ApiErrorDisplay";
|
|
23
24
|
|
|
24
25
|
const modelsApi = new ModelsApi(new Configuration());
|
|
25
26
|
const queryClient = new QueryClient();
|
|
@@ -38,7 +39,7 @@ export function ModelPicker({
|
|
|
38
39
|
onModelChange,
|
|
39
40
|
}: ModelPickerProps) {
|
|
40
41
|
const { server, projectName, packageName, versionId, accessToken } =
|
|
41
|
-
|
|
42
|
+
usePackage();
|
|
42
43
|
const { data, isLoading, isSuccess, isError, error } = useQuery(
|
|
43
44
|
{
|
|
44
45
|
queryKey: ["models", server, projectName, packageName, versionId],
|
|
@@ -51,6 +52,7 @@ export function ModelPicker({
|
|
|
51
52
|
},
|
|
52
53
|
}),
|
|
53
54
|
retry: false,
|
|
55
|
+
throwOnError: false,
|
|
54
56
|
},
|
|
55
57
|
queryClient,
|
|
56
58
|
);
|
|
@@ -83,6 +85,15 @@ export function ModelPicker({
|
|
|
83
85
|
.map((model) => model.path);
|
|
84
86
|
}
|
|
85
87
|
|
|
88
|
+
if (isError) {
|
|
89
|
+
return (
|
|
90
|
+
<ApiErrorDisplay
|
|
91
|
+
error={error}
|
|
92
|
+
context={`${projectName} > ${packageName} > Model Picker`}
|
|
93
|
+
/>
|
|
94
|
+
);
|
|
95
|
+
}
|
|
96
|
+
|
|
86
97
|
return (
|
|
87
98
|
<StyledCard
|
|
88
99
|
sx={{ maxWidth: 400, marginLeft: "10px", padding: "10px 5px 5px 5px" }}
|
|
@@ -90,7 +101,6 @@ export function ModelPicker({
|
|
|
90
101
|
<Typography variant="h6">Imported Models</Typography>
|
|
91
102
|
<FormControl fullWidth>
|
|
92
103
|
{isLoading && <Typography>Loading...</Typography>}
|
|
93
|
-
{isError && <Typography>Error: {error.message}</Typography>}
|
|
94
104
|
<Stack
|
|
95
105
|
direction="row"
|
|
96
106
|
spacing={1}
|
|
@@ -26,7 +26,7 @@ import MDEditor from "@uiw/react-md-editor";
|
|
|
26
26
|
import { EditableMalloyCell } from "./EditableMalloyCell";
|
|
27
27
|
import { NotebookCellValue } from "../NotebookManager";
|
|
28
28
|
import { SourceAndPath } from "../Model/SourcesExplorer";
|
|
29
|
-
|
|
29
|
+
import ResultContainer from "../RenderedResult/ResultContainer";
|
|
30
30
|
|
|
31
31
|
interface NotebookCellProps {
|
|
32
32
|
cell: NotebookCellValue;
|
|
@@ -293,15 +293,11 @@ export function MutableCell({
|
|
|
293
293
|
/>
|
|
294
294
|
))}
|
|
295
295
|
{!editingMalloy && cell.result && (
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
<RenderedResult result={cell.result} />
|
|
302
|
-
</Suspense>
|
|
303
|
-
</CardContent>
|
|
304
|
-
</>
|
|
296
|
+
<ResultContainer
|
|
297
|
+
result={cell.result}
|
|
298
|
+
minHeight={300}
|
|
299
|
+
maxHeight={800}
|
|
300
|
+
/>
|
|
305
301
|
)}
|
|
306
302
|
</>
|
|
307
303
|
))}
|
|
@@ -20,7 +20,7 @@ import { useRouterClickHandler } from "../click_helper";
|
|
|
20
20
|
import { Configuration, ModelsApi } from "../../client";
|
|
21
21
|
import { SourceAndPath } from "../Model/SourcesExplorer";
|
|
22
22
|
import { NotebookManager } from "../NotebookManager";
|
|
23
|
-
import {
|
|
23
|
+
import { usePackage } from "../Package";
|
|
24
24
|
import { StyledCard, StyledCardContent, StyledCardMedia } from "../styles";
|
|
25
25
|
import { ModelPicker } from "./ModelPicker";
|
|
26
26
|
import { MutableCell } from "./MutableCell";
|
|
@@ -48,7 +48,7 @@ export default function MutableNotebook({
|
|
|
48
48
|
}: MutableNotebookProps) {
|
|
49
49
|
const navigate = useRouterClickHandler();
|
|
50
50
|
const { server, projectName, packageName, versionId, accessToken } =
|
|
51
|
-
|
|
51
|
+
usePackage();
|
|
52
52
|
if (!projectName || !packageName) {
|
|
53
53
|
throw new Error(
|
|
54
54
|
"Project and package must be provided via PubliserPackageProvider",
|
|
@@ -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>
|
|
@@ -225,11 +225,13 @@ export function NotebookCell({
|
|
|
225
225
|
/>
|
|
226
226
|
</Collapse>
|
|
227
227
|
{cell.result && !sourcesExpanded && (
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
228
|
+
<>
|
|
229
|
+
<ResultContainer
|
|
230
|
+
result={cell.result}
|
|
231
|
+
minHeight={300}
|
|
232
|
+
maxHeight={700}
|
|
233
|
+
/>
|
|
234
|
+
</>
|
|
233
235
|
)}
|
|
234
236
|
</StyledCard>
|
|
235
237
|
))
|
|
@@ -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>
|