@malloy-publisher/sdk 0.9.7 → 0.9.9
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 +117 -17
- package/dist/{RenderedResult-CkUS04tl.es.js → RenderedResult-BHuJpdSn.es.js} +2 -2
- package/dist/{RenderedResult-qnpbr4tc.cjs.js → RenderedResult-Bw7EQc42.cjs.js} +1 -1
- package/dist/ServerProvider-B0dUY8be.cjs.js +1 -0
- package/dist/{ServerProvider-DnLLeXEX.es.js → ServerProvider-CQy4jVYK.es.js} +1602 -1074
- package/dist/builder/index.cjs.js +93 -93
- package/dist/builder/index.es.js +4630 -4562
- package/dist/builder-entry.d.ts +13 -12
- package/dist/client/api.d.ts +893 -104
- package/dist/client/index.cjs.js +1 -1
- package/dist/client/index.es.js +125 -104
- package/dist/components/Dashboard/DashboardTile.d.ts +3 -1
- package/dist/components/Dashboard/DashboardView.d.ts +1 -3
- package/dist/components/Dashboard/index.d.ts +0 -2
- package/dist/components/DocumentCreate/createDocument.d.ts +29 -9
- package/dist/components/DocumentCreate/documentPath.d.ts +21 -6
- package/dist/components/DocumentCreate/guards.d.ts +2 -3
- package/dist/components/DocumentCreate/index.d.ts +2 -3
- package/dist/components/DocumentCreate/newNotebook.d.ts +14 -5
- package/dist/components/DocumentStorage/BrowserDocumentStorage.d.ts +6 -0
- package/dist/components/DocumentStorage/DocumentStorage.d.ts +52 -24
- package/dist/components/Loading.d.ts +1 -1
- package/dist/components/Package/ContentTypeIcon.d.ts +3 -3
- package/dist/components/Package/DataSchemaDialog.d.ts +26 -0
- package/dist/components/Package/NewDocumentDialog.d.ts +19 -10
- package/dist/components/Package/Package.d.ts +14 -9
- package/dist/components/Package/documentLocation.d.ts +66 -23
- package/dist/components/Package/index.d.ts +3 -2
- package/dist/components/Package/reportQueries.d.ts +8 -0
- package/dist/components/Package/useDocumentLocation.d.ts +36 -6
- package/dist/components/Package/useDraftLayout.d.ts +20 -0
- package/dist/components/Report/CellReport.d.ts +89 -0
- package/dist/components/Report/LinearReport.d.ts +18 -0
- package/dist/components/Report/Report.d.ts +62 -0
- package/dist/components/Report/index.d.ts +2 -0
- package/dist/components/Report/telemetry.d.ts +163 -0
- package/dist/components/{DashboardBuilder → ReportBuilder}/BuilderDialogs.d.ts +2 -2
- package/dist/components/{DashboardBuilder → ReportBuilder}/BuilderGrid.d.ts +2 -2
- package/dist/components/{DashboardBuilder → ReportBuilder}/BuilderHeader.d.ts +5 -4
- package/dist/components/{DashboardBuilder → ReportBuilder}/BuilderToolbar.d.ts +5 -1
- package/dist/components/{DashboardBuilder → ReportBuilder}/EditorSurface.d.ts +10 -7
- package/dist/components/{DashboardBuilder/DashboardBuilder.d.ts → ReportBuilder/ReportBuilder.d.ts} +17 -8
- package/dist/components/{DashboardBuilder/DashboardEditor.d.ts → ReportBuilder/ReportEditor.d.ts} +41 -14
- package/dist/components/ReportBuilder/builderReport.d.ts +14 -0
- package/dist/components/{DashboardBuilder → ReportBuilder}/catalog.d.ts +8 -5
- package/dist/components/{DashboardBuilder → ReportBuilder}/document.d.ts +3 -4
- package/dist/components/{DashboardBuilder → ReportBuilder}/documentSession.d.ts +1 -1
- package/dist/components/{DashboardBuilder → ReportBuilder}/imports.d.ts +5 -1
- package/dist/components/{DashboardBuilder → ReportBuilder}/malloyTree.d.ts +9 -0
- package/dist/components/{DashboardBuilder → ReportBuilder}/newDashboard.d.ts +7 -1
- package/dist/components/{DashboardBuilder → ReportBuilder}/readDocument.d.ts +7 -5
- package/dist/components/{DashboardBuilder → ReportBuilder}/readForEditor.d.ts +1 -1
- package/dist/components/ReportBuilder/reportTag.d.ts +52 -0
- package/dist/components/{DashboardBuilder → ReportBuilder}/spliceDocument.d.ts +1 -7
- package/dist/components/{DashboardBuilder → ReportBuilder}/useBuilderSelection.d.ts +2 -2
- package/dist/components/{DashboardBuilder → ReportBuilder}/useControlBindings.d.ts +2 -2
- package/dist/components/ReportBuilder/useEditorCatalog.d.ts +25 -0
- package/dist/components/{DashboardBuilder → ReportBuilder}/useHostCopy.d.ts +5 -3
- package/dist/components/{DashboardBuilder → ReportBuilder}/useOpenedDocument.d.ts +7 -5
- package/dist/components/{DashboardBuilder/useDashboardEditor.d.ts → ReportBuilder/useReportEditor.d.ts} +3 -7
- package/dist/components/{DashboardBuilder → ReportBuilder}/useSaveChannel.d.ts +6 -4
- package/dist/components/{DashboardBuilder → ReportBuilder}/useTileEditing.d.ts +2 -2
- package/dist/components/ServerProvider.d.ts +2 -1
- package/dist/components/drill/resolveDrill.d.ts +8 -1
- package/dist/components/drill/useDrillSelf.d.ts +4 -2
- package/dist/components/index.d.ts +2 -1
- package/dist/components/{Dashboard → legacy}/Dashboard.d.ts +15 -9
- package/dist/components/legacy/MalloynbCells.d.ts +13 -0
- package/dist/components/legacy/Notebook.d.ts +15 -0
- package/dist/components/{DashboardBuilder → legacy}/NotebookEditor.d.ts +3 -3
- package/dist/components/legacy/builderNames.d.ts +10 -0
- package/dist/components/legacy/index.d.ts +11 -0
- package/dist/components/legacy/kindAdapter.d.ts +11 -0
- package/dist/components/legacy/kindTypedDrafts.d.ts +10 -0
- package/dist/components/legacy/nameAlias.d.ts +44 -0
- package/dist/components/legacy/queryKeys.d.ts +8 -0
- package/dist/index.cjs.js +19 -19
- package/dist/index.es.js +8216 -7635
- package/dist/text/index.es.js +2 -2
- package/dist/{text-entry-CA0LZ1xL.es.js → text-entry-72YFLeNk.es.js} +10 -10
- package/dist/{useCompiledDocument-Bf72Ob5v.es.js → useCompiledDocument-1dgF5CC9.es.js} +4593 -4395
- package/dist/useCompiledDocument-BKyRnXmA.cjs.js +141 -0
- package/package.json +2 -2
- package/src/builder-entry.ts +32 -24
- package/src/components/Dashboard/DashboardTile.tsx +17 -0
- package/src/components/Dashboard/DashboardView.spec.tsx +0 -21
- package/src/components/Dashboard/DashboardView.tsx +8 -24
- package/src/components/Dashboard/dropValueUrlTags.spec.ts +1 -4
- package/src/components/Dashboard/index.ts +0 -2
- package/src/components/DocumentCreate/createDocument.spec.ts +346 -53
- package/src/components/DocumentCreate/createDocument.ts +143 -63
- package/src/components/DocumentCreate/documentPath.ts +41 -12
- package/src/components/DocumentCreate/guards.ts +7 -15
- package/src/components/DocumentCreate/index.ts +3 -7
- package/src/components/DocumentCreate/newNotebook.spec.ts +113 -43
- package/src/components/DocumentCreate/newNotebook.ts +32 -10
- package/src/components/DocumentStorage/BrowserDocumentStorage.spec.ts +130 -28
- package/src/components/DocumentStorage/BrowserDocumentStorage.ts +78 -40
- package/src/components/DocumentStorage/DocumentStorage.contract.spec.tsx +426 -0
- package/src/components/DocumentStorage/DocumentStorage.ts +57 -24
- package/src/components/Home/AddEnvironmentDialog.tsx +1 -1
- package/src/components/Home/Home.tsx +1 -1
- package/src/components/Loading.tsx +1 -1
- package/src/components/Model/SourcesExplorer.tsx +1 -1
- package/src/components/Notebook/NotebookCell.tsx +6 -5
- package/src/components/Notebook/cellKind.spec.ts +15 -7
- package/src/components/Package/ContentTypeIcon.tsx +16 -3
- package/src/components/Package/DataSchemaDialog.spec.tsx +85 -0
- package/src/components/Package/DataSchemaDialog.tsx +367 -0
- package/src/components/Package/NewDocumentDialog.spec.tsx +145 -88
- package/src/components/Package/NewDocumentDialog.tsx +93 -48
- package/src/components/Package/Package.agents.spec.tsx +76 -0
- package/src/components/Package/Package.artifacts.spec.tsx +79 -60
- package/src/components/Package/Package.create.spec.tsx +126 -112
- package/src/components/Package/Package.notebooks.spec.tsx +46 -27
- package/src/components/Package/Package.spec.tsx +43 -30
- package/src/components/Package/Package.tsx +217 -293
- package/src/components/Package/documentLocation.spec.ts +145 -50
- package/src/components/Package/documentLocation.ts +118 -39
- package/src/components/Package/index.ts +12 -3
- package/src/components/Package/reportQueries.ts +25 -0
- package/src/components/Package/useDocumentLocation.spec.ts +58 -0
- package/src/components/Package/useDocumentLocation.ts +90 -32
- package/src/components/Package/useDraftLayout.spec.tsx +143 -0
- package/src/components/Package/useDraftLayout.ts +81 -0
- package/src/components/Prose.spec.tsx +3 -3
- package/src/components/RenderedResult/RenderedResult.tsx +1 -1
- package/src/components/Report/CellReport.spec.tsx +155 -0
- package/src/components/{Notebook/Notebook.tsx → Report/CellReport.tsx} +178 -220
- package/src/components/Report/LinearReport.tsx +71 -0
- package/src/components/Report/Report.spec.tsx +238 -0
- package/src/components/Report/Report.telemetry.spec.tsx +292 -0
- package/src/components/Report/Report.tsx +277 -0
- package/src/components/Report/index.ts +12 -0
- package/src/components/Report/telemetry.spec.ts +90 -0
- package/src/components/Report/telemetry.ts +250 -0
- package/src/components/{DashboardBuilder → ReportBuilder}/BuilderDialogs.tsx +5 -5
- package/src/components/{DashboardBuilder → ReportBuilder}/BuilderGrid.tsx +2 -2
- package/src/components/{DashboardBuilder → ReportBuilder}/BuilderHeader.tsx +6 -7
- package/src/components/{DashboardBuilder → ReportBuilder}/BuilderToolbar.tsx +33 -0
- package/src/components/{DashboardBuilder → ReportBuilder}/DrillDialog.tsx +2 -2
- package/src/components/{DashboardBuilder → ReportBuilder}/EditorSurface.tsx +67 -107
- package/src/components/{DashboardBuilder → ReportBuilder}/FilterDialog.tsx +3 -4
- package/src/components/{DashboardBuilder/DashboardBuilder.charts.spec.tsx → ReportBuilder/ReportBuilder.charts.spec.tsx} +4 -4
- package/src/components/{DashboardBuilder/DashboardBuilder.exit.spec.tsx → ReportBuilder/ReportBuilder.exit.spec.tsx} +5 -5
- package/src/components/{DashboardBuilder/DashboardBuilder.inline.spec.tsx → ReportBuilder/ReportBuilder.inline.spec.tsx} +4 -4
- package/src/components/ReportBuilder/ReportBuilder.layoutSwitch.spec.tsx +145 -0
- package/src/components/{DashboardBuilder/DashboardBuilder.notebook.spec.tsx → ReportBuilder/ReportBuilder.notebook.spec.tsx} +22 -21
- package/src/components/{DashboardBuilder/DashboardBuilder.openDraft.spec.tsx → ReportBuilder/ReportBuilder.openDraft.spec.tsx} +3 -3
- package/src/components/{DashboardBuilder/DashboardBuilder.sources.spec.tsx → ReportBuilder/ReportBuilder.sources.spec.tsx} +19 -8
- package/src/components/{DashboardBuilder/DashboardBuilder.spec.tsx → ReportBuilder/ReportBuilder.spec.tsx} +34 -34
- package/src/components/{DashboardBuilder/DashboardBuilder.textTiles.spec.tsx → ReportBuilder/ReportBuilder.textTiles.spec.tsx} +5 -5
- package/src/components/{DashboardBuilder/DashboardBuilder.tsx → ReportBuilder/ReportBuilder.tsx} +46 -21
- package/src/components/{DashboardBuilder/DashboardEditor.authoritative.spec.tsx → ReportBuilder/ReportEditor.authoritative.spec.tsx} +28 -20
- package/src/components/{DashboardBuilder/DashboardEditor.emptyStart.spec.tsx → ReportBuilder/ReportEditor.emptyStart.spec.tsx} +19 -11
- package/src/components/{DashboardBuilder/DashboardEditor.filterTag.spec.tsx → ReportBuilder/ReportEditor.filterTag.spec.tsx} +7 -7
- package/src/components/{DashboardBuilder/DashboardEditor.notebook.spec.tsx → ReportBuilder/ReportEditor.notebook.spec.tsx} +70 -49
- package/src/components/{DashboardBuilder/DashboardEditor.package.spec.tsx → ReportBuilder/ReportEditor.package.spec.tsx} +52 -8
- package/src/components/{DashboardBuilder/DashboardEditor.resourceUri.spec.tsx → ReportBuilder/ReportEditor.resourceUri.spec.tsx} +50 -18
- package/src/components/{DashboardBuilder/DashboardEditor.spec.tsx → ReportBuilder/ReportEditor.spec.tsx} +65 -20
- package/src/components/{DashboardBuilder/DashboardEditor.textSource.spec.tsx → ReportBuilder/ReportEditor.textSource.spec.tsx} +6 -6
- package/src/components/{DashboardBuilder/DashboardEditor.tsx → ReportBuilder/ReportEditor.tsx} +92 -35
- package/src/components/{DashboardBuilder → ReportBuilder}/addTile.compile.spec.ts +1 -3
- package/src/components/{DashboardBuilder → ReportBuilder}/addTileToDocument.spec.ts +1 -0
- package/src/components/{DashboardBuilder → ReportBuilder}/artifactBlock.spec.ts +21 -29
- package/src/components/ReportBuilder/builderReport.ts +53 -0
- package/src/components/{DashboardBuilder → ReportBuilder}/catalog.spec.ts +28 -10
- package/src/components/{DashboardBuilder → ReportBuilder}/catalog.ts +17 -10
- package/src/components/{DashboardBuilder → ReportBuilder}/controls.spec.ts +1 -0
- package/src/components/{DashboardBuilder → ReportBuilder}/document.ts +4 -7
- package/src/components/{DashboardBuilder → ReportBuilder}/documentSession.spec.ts +5 -5
- package/src/components/{DashboardBuilder → ReportBuilder}/documentSession.ts +1 -1
- package/src/components/{DashboardBuilder → ReportBuilder}/imports.spec.ts +6 -2
- package/src/components/{DashboardBuilder → ReportBuilder}/imports.ts +8 -4
- package/src/components/{DashboardBuilder → ReportBuilder}/legacyNotebook.chart.spec.ts +1 -1
- package/src/components/{DashboardBuilder → ReportBuilder}/legacyNotebook.convert.spec.ts +9 -13
- package/src/components/{DashboardBuilder → ReportBuilder}/legacyNotebook.read.spec.ts +15 -15
- package/src/components/{DashboardBuilder → ReportBuilder}/legacyNotebook.ts +7 -2
- package/src/components/{DashboardBuilder → ReportBuilder}/malloyTree.ts +25 -0
- package/src/components/{DashboardBuilder → ReportBuilder}/newDashboard.spec.ts +12 -4
- package/src/components/{DashboardBuilder → ReportBuilder}/newDashboard.ts +11 -24
- package/src/components/{DashboardBuilder → ReportBuilder}/preview.spec.ts +1 -0
- package/src/components/{DashboardBuilder → ReportBuilder}/readDocument.spec.ts +64 -36
- package/src/components/{DashboardBuilder → ReportBuilder}/readDocument.ts +33 -32
- package/src/components/ReportBuilder/readForEditor.spec.ts +96 -0
- package/src/components/{DashboardBuilder → ReportBuilder}/readForEditor.ts +3 -11
- package/src/components/ReportBuilder/reportTag.ts +108 -0
- package/src/components/{DashboardBuilder → ReportBuilder}/spliceDocument.imports.spec.ts +28 -1
- package/src/components/{DashboardBuilder → ReportBuilder}/spliceDocument.spec.ts +32 -3
- package/src/components/{DashboardBuilder → ReportBuilder}/spliceDocument.ts +37 -60
- package/src/components/{DashboardBuilder → ReportBuilder}/tagParse.spec.ts +3 -3
- package/src/components/{DashboardBuilder → ReportBuilder}/testing/artifactTagParity.json +2 -2
- package/src/components/ReportBuilder/testing/drillResolution.json +279 -0
- package/src/components/ReportBuilder/testing/reportLayoutParity.json +125 -0
- package/src/components/{DashboardBuilder → ReportBuilder}/textTiles.spec.ts +66 -143
- package/src/components/{DashboardBuilder → ReportBuilder}/useBuilderSelection.ts +2 -2
- package/src/components/{DashboardBuilder → ReportBuilder}/useControlBindings.ts +2 -2
- package/src/components/ReportBuilder/useEditorCatalog.spec.tsx +156 -0
- package/src/components/ReportBuilder/useEditorCatalog.ts +119 -0
- package/src/components/{DashboardBuilder → ReportBuilder}/useHostCopy.ts +7 -5
- package/src/components/{DashboardBuilder → ReportBuilder}/useOpenedDocument.ts +56 -35
- package/src/components/{DashboardBuilder/useDashboardEditor.spec.ts → ReportBuilder/useReportEditor.spec.ts} +6 -6
- package/src/components/{DashboardBuilder/useDashboardEditor.ts → ReportBuilder/useReportEditor.ts} +6 -17
- package/src/components/{DashboardBuilder → ReportBuilder}/useSaveChannel.ts +36 -35
- package/src/components/{DashboardBuilder → ReportBuilder}/useTileEditing.ts +2 -2
- package/src/components/ServerProvider.tsx +2 -0
- package/src/components/drill/resolveDrill.ts +9 -2
- package/src/components/drill/useDrill.tsx +1 -0
- package/src/components/drill/useDrillSelf.spec.tsx +60 -7
- package/src/components/drill/useDrillSelf.ts +29 -12
- package/src/components/index.ts +2 -1
- package/src/components/{Dashboard → legacy}/Dashboard.spec.tsx +1 -1
- package/src/components/{Dashboard → legacy}/Dashboard.tsx +40 -28
- package/src/components/legacy/MalloynbCells.tsx +88 -0
- package/src/components/{Notebook → legacy}/Notebook.served.spec.tsx +17 -13
- package/src/components/{Notebook → legacy}/Notebook.spec.tsx +24 -20
- package/src/components/legacy/Notebook.tsx +44 -0
- package/src/components/{DashboardBuilder → legacy}/NotebookEditor.tsx +7 -4
- package/src/components/legacy/builderNames.ts +25 -0
- package/src/components/legacy/index.ts +20 -0
- package/src/components/legacy/kindAdapter.ts +19 -0
- package/src/components/legacy/kindTypedDrafts.ts +34 -0
- package/src/components/legacy/nameAlias.spec.ts +124 -0
- package/src/components/legacy/nameAlias.ts +95 -0
- package/src/components/legacy/queryKeys.ts +26 -0
- package/src/hooks/useGivensState.spec.ts +9 -9
- package/src/mainEntry.spec.ts +1 -1
- package/src/textEntry.spec.ts +9 -9
- package/src/utils/formatting.spec.ts +5 -5
- package/src/utils/parsing.spec.ts +1 -1
- package/src/utils/parsing.ts +1 -1
- package/dist/ServerProvider-Gj-im5VD.cjs.js +0 -1
- package/dist/components/Dashboard/telemetry.d.ts +0 -73
- package/dist/components/DashboardBuilder/builderReport.d.ts +0 -13
- package/dist/components/DashboardBuilder/telemetry.d.ts +0 -43
- package/dist/components/DocumentCreate/events.d.ts +0 -10
- package/dist/components/Notebook/Notebook.d.ts +0 -52
- package/dist/components/Notebook/index.d.ts +0 -1
- package/dist/useCompiledDocument-tBejqZ7s.cjs.js +0 -142
- package/src/components/Dashboard/telemetry.ts +0 -75
- package/src/components/DashboardBuilder/builderReport.ts +0 -74
- package/src/components/DashboardBuilder/readForEditor.spec.ts +0 -80
- package/src/components/DashboardBuilder/telemetry.ts +0 -47
- package/src/components/DashboardBuilder/testing/documentKindRule.json +0 -40
- package/src/components/DocumentCreate/events.ts +0 -15
- package/src/components/Notebook/index.ts +0 -4
- /package/dist/components/{DashboardBuilder → ReportBuilder}/AddTileDialog.d.ts +0 -0
- /package/dist/components/{DashboardBuilder → ReportBuilder}/ChartPicker.d.ts +0 -0
- /package/dist/components/{DashboardBuilder → ReportBuilder}/DrillDialog.d.ts +0 -0
- /package/dist/components/{DashboardBuilder → ReportBuilder}/FilterDialog.d.ts +0 -0
- /package/dist/components/{DashboardBuilder → ReportBuilder}/FilterStrip.d.ts +0 -0
- /package/dist/components/{DashboardBuilder → ReportBuilder}/InlineMarkdown.d.ts +0 -0
- /package/dist/components/{DashboardBuilder → ReportBuilder}/InlineText.d.ts +0 -0
- /package/dist/components/{DashboardBuilder → ReportBuilder}/SourceViewPicker.d.ts +0 -0
- /package/dist/components/{DashboardBuilder → ReportBuilder}/TextTileBody.d.ts +0 -0
- /package/dist/components/{DashboardBuilder → ReportBuilder}/TileFrame.d.ts +0 -0
- /package/dist/components/{DashboardBuilder → ReportBuilder}/TileMenu.d.ts +0 -0
- /package/dist/components/{DashboardBuilder → ReportBuilder}/addTileToDocument.d.ts +0 -0
- /package/dist/components/{DashboardBuilder → ReportBuilder}/annotationText.d.ts +0 -0
- /package/dist/components/{DashboardBuilder → ReportBuilder}/changedTile.d.ts +0 -0
- /package/dist/components/{DashboardBuilder → ReportBuilder}/chartLine.d.ts +0 -0
- /package/dist/components/{DashboardBuilder → ReportBuilder}/controls.d.ts +0 -0
- /package/dist/components/{DashboardBuilder → ReportBuilder}/inlineEdit.d.ts +0 -0
- /package/dist/components/{DashboardBuilder → ReportBuilder}/layout.d.ts +0 -0
- /package/dist/components/{DashboardBuilder → ReportBuilder}/legacyNotebook.d.ts +0 -0
- /package/dist/components/{DashboardBuilder → ReportBuilder}/loadMalloy.d.ts +0 -0
- /package/dist/components/{DashboardBuilder → ReportBuilder}/openDraft.d.ts +0 -0
- /package/dist/components/{DashboardBuilder → ReportBuilder}/preview.d.ts +0 -0
- /package/dist/components/{DashboardBuilder → ReportBuilder}/sortable.d.ts +0 -0
- /package/dist/components/{DashboardBuilder → ReportBuilder}/spliceResult.d.ts +0 -0
- /package/dist/components/{DashboardBuilder → ReportBuilder}/tagParse.d.ts +0 -0
- /package/dist/components/{DashboardBuilder → ReportBuilder}/testing/fixtures.d.ts +0 -0
- /package/dist/components/{DashboardBuilder → ReportBuilder}/testing/inline.d.ts +0 -0
- /package/dist/components/{DashboardBuilder → ReportBuilder}/testing/resize.d.ts +0 -0
- /package/dist/components/{DashboardBuilder → ReportBuilder}/tileDisplayTitle.d.ts +0 -0
- /package/dist/components/{DashboardBuilder → ReportBuilder}/useBuilderSession.d.ts +0 -0
- /package/dist/components/{DashboardBuilder → ReportBuilder}/useBuilderShortcuts.d.ts +0 -0
- /package/dist/components/{DashboardBuilder → ReportBuilder}/useConversionConfirm.d.ts +0 -0
- /package/dist/components/{DashboardBuilder → ReportBuilder}/useDocumentEditor.d.ts +0 -0
- /package/dist/components/{DashboardBuilder → ReportBuilder}/useDraft.d.ts +0 -0
- /package/dist/components/{DashboardBuilder → ReportBuilder}/useExitGuard.d.ts +0 -0
- /package/dist/components/{DashboardBuilder → ReportBuilder}/useFilterForm.d.ts +0 -0
- /package/dist/components/{DashboardBuilder → ReportBuilder}/useOpenDraftCommit.d.ts +0 -0
- /package/dist/components/{DashboardBuilder → ReportBuilder}/useTileReorder.d.ts +0 -0
- /package/dist/components/{DashboardBuilder → ReportBuilder}/useTileResize.d.ts +0 -0
- /package/src/components/{DashboardBuilder → ReportBuilder}/AddTileDialog.spec.tsx +0 -0
- /package/src/components/{DashboardBuilder → ReportBuilder}/AddTileDialog.tsx +0 -0
- /package/src/components/{DashboardBuilder → ReportBuilder}/ChartPicker.render.spec.tsx +0 -0
- /package/src/components/{DashboardBuilder → ReportBuilder}/ChartPicker.spec.ts +0 -0
- /package/src/components/{DashboardBuilder → ReportBuilder}/ChartPicker.tsx +0 -0
- /package/src/components/{DashboardBuilder → ReportBuilder}/FilterStrip.tsx +0 -0
- /package/src/components/{DashboardBuilder → ReportBuilder}/InlineMarkdown.tsx +0 -0
- /package/src/components/{DashboardBuilder → ReportBuilder}/InlineText.tsx +0 -0
- /package/src/components/{DashboardBuilder → ReportBuilder}/SourceViewPicker.tsx +0 -0
- /package/src/components/{DashboardBuilder → ReportBuilder}/TextTileBody.tsx +0 -0
- /package/src/components/{DashboardBuilder → ReportBuilder}/TileFrame.tsx +0 -0
- /package/src/components/{DashboardBuilder → ReportBuilder}/TileMenu.tsx +0 -0
- /package/src/components/{DashboardBuilder → ReportBuilder}/__test__/inventory.ts +0 -0
- /package/src/components/{DashboardBuilder → ReportBuilder}/addTileToDocument.ts +0 -0
- /package/src/components/{DashboardBuilder → ReportBuilder}/annotationText.spec.ts +0 -0
- /package/src/components/{DashboardBuilder → ReportBuilder}/annotationText.ts +0 -0
- /package/src/components/{DashboardBuilder → ReportBuilder}/artifactTagParity.spec.ts +0 -0
- /package/src/components/{DashboardBuilder → ReportBuilder}/catalog.aggregate.spec.ts +0 -0
- /package/src/components/{DashboardBuilder → ReportBuilder}/changedTile.spec.ts +0 -0
- /package/src/components/{DashboardBuilder → ReportBuilder}/changedTile.ts +0 -0
- /package/src/components/{DashboardBuilder → ReportBuilder}/chartLine.spec.ts +0 -0
- /package/src/components/{DashboardBuilder → ReportBuilder}/chartLine.ts +0 -0
- /package/src/components/{DashboardBuilder → ReportBuilder}/controls.ts +0 -0
- /package/src/components/{DashboardBuilder → ReportBuilder}/emptyStart.spec.ts +0 -0
- /package/src/components/{DashboardBuilder → ReportBuilder}/inlineEdit.tsx +0 -0
- /package/src/components/{DashboardBuilder → ReportBuilder}/invariants.spec.ts +0 -0
- /package/src/components/{DashboardBuilder → ReportBuilder}/keepRowStructure.spec.ts +0 -0
- /package/src/components/{DashboardBuilder → ReportBuilder}/layout.ts +0 -0
- /package/src/components/{DashboardBuilder → ReportBuilder}/loadMalloy.spec.ts +0 -0
- /package/src/components/{DashboardBuilder → ReportBuilder}/loadMalloy.ts +0 -0
- /package/src/components/{DashboardBuilder → ReportBuilder}/malloyTree.spec.ts +0 -0
- /package/src/components/{DashboardBuilder → ReportBuilder}/moveIntoGap.spec.ts +0 -0
- /package/src/components/{DashboardBuilder → ReportBuilder}/openDraft.ts +0 -0
- /package/src/components/{DashboardBuilder → ReportBuilder}/preview.shapes.spec.ts +0 -0
- /package/src/components/{DashboardBuilder → ReportBuilder}/preview.ts +0 -0
- /package/src/components/{DashboardBuilder → ReportBuilder}/scannerShapes.spec.ts +0 -0
- /package/src/components/{DashboardBuilder → ReportBuilder}/sortable.spec.ts +0 -0
- /package/src/components/{DashboardBuilder → ReportBuilder}/sortable.tsx +0 -0
- /package/src/components/{DashboardBuilder → ReportBuilder}/spliceDocument.chart.spec.ts +0 -0
- /package/src/components/{DashboardBuilder → ReportBuilder}/spliceResult.ts +0 -0
- /package/src/components/{DashboardBuilder → ReportBuilder}/statementExtent.spec.ts +0 -0
- /package/src/components/{DashboardBuilder → ReportBuilder}/tagParse.ts +0 -0
- /package/src/components/{DashboardBuilder → ReportBuilder}/testing/fixtures.ts +0 -0
- /package/src/components/{DashboardBuilder → ReportBuilder}/testing/inline.ts +0 -0
- /package/src/components/{DashboardBuilder → ReportBuilder}/testing/resize.ts +0 -0
- /package/src/components/{DashboardBuilder → ReportBuilder}/testing/urlRenderTags.json +0 -0
- /package/src/components/{DashboardBuilder → ReportBuilder}/tileDisplayTitle.ts +0 -0
- /package/src/components/{DashboardBuilder → ReportBuilder}/useBuilderSession.spec.ts +0 -0
- /package/src/components/{DashboardBuilder → ReportBuilder}/useBuilderSession.ts +0 -0
- /package/src/components/{DashboardBuilder → ReportBuilder}/useBuilderShortcuts.overlay.spec.tsx +0 -0
- /package/src/components/{DashboardBuilder → ReportBuilder}/useBuilderShortcuts.spec.tsx +0 -0
- /package/src/components/{DashboardBuilder → ReportBuilder}/useBuilderShortcuts.ts +0 -0
- /package/src/components/{DashboardBuilder → ReportBuilder}/useConversionConfirm.ts +0 -0
- /package/src/components/{DashboardBuilder → ReportBuilder}/useDocumentEditor.spec.ts +0 -0
- /package/src/components/{DashboardBuilder → ReportBuilder}/useDocumentEditor.ts +0 -0
- /package/src/components/{DashboardBuilder → ReportBuilder}/useDraft.ts +0 -0
- /package/src/components/{DashboardBuilder → ReportBuilder}/useExitGuard.spec.ts +0 -0
- /package/src/components/{DashboardBuilder → ReportBuilder}/useExitGuard.ts +0 -0
- /package/src/components/{DashboardBuilder → ReportBuilder}/useFilterForm.existing.spec.tsx +0 -0
- /package/src/components/{DashboardBuilder → ReportBuilder}/useFilterForm.spec.tsx +0 -0
- /package/src/components/{DashboardBuilder → ReportBuilder}/useFilterForm.ts +0 -0
- /package/src/components/{DashboardBuilder → ReportBuilder}/useOpenDraftCommit.ts +0 -0
- /package/src/components/{DashboardBuilder → ReportBuilder}/useTileReorder.spec.tsx +0 -0
- /package/src/components/{DashboardBuilder → ReportBuilder}/useTileReorder.ts +0 -0
- /package/src/components/{DashboardBuilder → ReportBuilder}/useTileResize.spec.tsx +0 -0
- /package/src/components/{DashboardBuilder → ReportBuilder}/useTileResize.ts +0 -0
- /package/src/components/{DashboardBuilder → ReportBuilder}/withGaps.spec.ts +0 -0
- /package/src/components/{Notebook → legacy}/Notebook.layout.spec.tsx +0 -0
|
@@ -69,7 +69,7 @@ const mount = (props: Partial<Dialog> = {}) =>
|
|
|
69
69
|
render(
|
|
70
70
|
<NewDocumentDialog
|
|
71
71
|
open
|
|
72
|
-
|
|
72
|
+
layout="grid"
|
|
73
73
|
environmentName="env"
|
|
74
74
|
packageName="pkg"
|
|
75
75
|
models={["storefront.malloy", "other.malloy"]}
|
|
@@ -81,7 +81,7 @@ const mount = (props: Partial<Dialog> = {}) =>
|
|
|
81
81
|
{ wrapper: serverWrapper },
|
|
82
82
|
);
|
|
83
83
|
|
|
84
|
-
const titleFilled = (value: string, label = "
|
|
84
|
+
const titleFilled = (value: string, label = "Report title") =>
|
|
85
85
|
waitFor(() =>
|
|
86
86
|
expect(screen.getByLabelText(label)).toHaveProperty("value", value),
|
|
87
87
|
);
|
|
@@ -114,104 +114,162 @@ describe("NewDocumentDialog", () => {
|
|
|
114
114
|
await titleFilled("by category");
|
|
115
115
|
|
|
116
116
|
// A source with no views is not on the list, so a pair that cannot be written cannot be picked.
|
|
117
|
-
fireEvent.mouseDown(
|
|
117
|
+
fireEvent.mouseDown(
|
|
118
|
+
screen.getByRole("combobox", { name: /First query/ }),
|
|
119
|
+
);
|
|
118
120
|
expect(
|
|
119
121
|
screen.getAllByRole("option").map((option) => option.textContent),
|
|
120
122
|
).toEqual(["order_items → by_category", "order_items → by_brand"]);
|
|
121
123
|
fireEvent.click(
|
|
122
124
|
screen.getByRole("option", { name: "order_items → by_brand" }),
|
|
123
125
|
);
|
|
124
|
-
fireEvent.change(screen.getByLabelText("
|
|
126
|
+
fireEvent.change(screen.getByLabelText("Report title"), {
|
|
125
127
|
target: { value: "Sales by Region" },
|
|
126
128
|
});
|
|
127
129
|
expect(
|
|
128
|
-
screen.getByText(/Written as
|
|
130
|
+
screen.getByText(/Written as sales-by-region\.malloy in the package/),
|
|
129
131
|
).toBeDefined();
|
|
130
132
|
|
|
131
|
-
fireEvent.click(screen.getByRole("button", { name: "Create
|
|
133
|
+
fireEvent.click(screen.getByRole("button", { name: "Create report" }));
|
|
132
134
|
await waitFor(() => expect(onCreated).toHaveBeenCalledTimes(1));
|
|
133
135
|
expect(onCreated.mock.calls[0][0]).toEqual({
|
|
134
|
-
|
|
135
|
-
path: "
|
|
136
|
+
layout: "grid",
|
|
137
|
+
path: "sales-by-region.malloy",
|
|
136
138
|
slug: "sales-by-region",
|
|
137
139
|
});
|
|
138
140
|
const [path, source] = write.mock.calls[0];
|
|
139
|
-
expect(path).toBe("
|
|
140
|
-
expect(source).toContain(
|
|
141
|
+
expect(path).toBe("sales-by-region.malloy");
|
|
142
|
+
expect(source).toContain("layout=grid");
|
|
143
|
+
expect(source).toContain('"order_items_tiles -> by_brand_tile"');
|
|
141
144
|
expect(source).toContain(
|
|
142
|
-
'import { order_items } from "
|
|
145
|
+
'import { order_items } from "storefront.malloy"',
|
|
143
146
|
);
|
|
144
147
|
expect(onEvent.mock.calls).toEqual([
|
|
145
|
-
[
|
|
148
|
+
[
|
|
149
|
+
expect.objectContaining({
|
|
150
|
+
type: "report.created",
|
|
151
|
+
where: "package",
|
|
152
|
+
layout: "grid",
|
|
153
|
+
}),
|
|
154
|
+
],
|
|
146
155
|
]);
|
|
147
156
|
});
|
|
148
157
|
|
|
149
|
-
it("writes a
|
|
158
|
+
it("writes a linear report at the package root with its first query", async () => {
|
|
150
159
|
const write = mock((_path: string, _source: string) => Promise.resolve());
|
|
151
160
|
const onCreated = mock((_created: unknown) => {});
|
|
152
161
|
mount({
|
|
153
|
-
|
|
162
|
+
layout: "linear",
|
|
154
163
|
target: packageTarget([], write),
|
|
155
164
|
onCreated,
|
|
156
165
|
});
|
|
157
|
-
await titleFilled("by category"
|
|
166
|
+
await titleFilled("by category");
|
|
158
167
|
expect(
|
|
159
168
|
screen.getByRole("combobox", { name: /First query/ }),
|
|
160
169
|
).toBeDefined();
|
|
161
170
|
|
|
162
|
-
fireEvent.click(screen.getByRole("button", { name: "Create
|
|
171
|
+
fireEvent.click(screen.getByRole("button", { name: "Create report" }));
|
|
163
172
|
await waitFor(() => expect(onCreated).toHaveBeenCalledTimes(1));
|
|
164
173
|
expect(onCreated.mock.calls[0][0]).toEqual({
|
|
165
|
-
|
|
166
|
-
path: "
|
|
174
|
+
layout: "linear",
|
|
175
|
+
path: "by-category.malloy",
|
|
167
176
|
slug: "by-category",
|
|
168
177
|
});
|
|
169
178
|
const [path, source] = write.mock.calls[0];
|
|
170
|
-
expect(path).toBe("
|
|
171
|
-
expect(source).toContain("
|
|
179
|
+
expect(path).toBe("by-category.malloy");
|
|
180
|
+
expect(source).toContain("layout=linear");
|
|
181
|
+
expect(source).not.toContain("kind=notebook");
|
|
172
182
|
expect(source).toContain("view: by_category_tile is by_category");
|
|
173
183
|
});
|
|
174
184
|
|
|
175
|
-
it("switches
|
|
176
|
-
|
|
185
|
+
it("switches layout in place, keeping the choices already read, and writes it", async () => {
|
|
186
|
+
const write = mock((_path: string, _source: string) => Promise.resolve());
|
|
187
|
+
mount({ target: packageTarget([], write) });
|
|
188
|
+
await titleFilled("by category");
|
|
189
|
+
fireEvent.mouseDown(screen.getByRole("combobox", { name: /Layout/ }));
|
|
190
|
+
fireEvent.click(screen.getByRole("option", { name: /^Linear/ }));
|
|
191
|
+
expect(getModel).toHaveBeenCalledTimes(2);
|
|
192
|
+
fireEvent.click(screen.getByRole("button", { name: "Create report" }));
|
|
193
|
+
await waitFor(() => expect(write).toHaveBeenCalledTimes(1));
|
|
194
|
+
expect(write.mock.calls[0][0]).toBe("by-category.malloy");
|
|
195
|
+
expect(write.mock.calls[0][1]).toContain("layout=linear");
|
|
196
|
+
});
|
|
197
|
+
|
|
198
|
+
it("opens on linear when the host names no layout", async () => {
|
|
199
|
+
mount({ layout: undefined });
|
|
177
200
|
await titleFilled("by category");
|
|
178
|
-
fireEvent.mouseDown(screen.getByRole("combobox", { name: /Type/ }));
|
|
179
|
-
fireEvent.click(screen.getByRole("option", { name: "Notebook" }));
|
|
180
201
|
expect(
|
|
181
|
-
screen.getByRole("
|
|
202
|
+
screen.getByRole("combobox", { name: /Layout/ }).textContent,
|
|
203
|
+
).toMatch(/^Linear/);
|
|
204
|
+
});
|
|
205
|
+
|
|
206
|
+
it("writes at a typed location, with the import relative to it", async () => {
|
|
207
|
+
const write = mock((_path: string, _source: string) => Promise.resolve());
|
|
208
|
+
const onCreated = mock((_created: unknown) => {});
|
|
209
|
+
mount({ target: packageTarget([], write), onCreated });
|
|
210
|
+
await titleFilled("by category");
|
|
211
|
+
fireEvent.change(screen.getByLabelText("Location"), {
|
|
212
|
+
target: { value: "team/sales/q3" },
|
|
213
|
+
});
|
|
214
|
+
expect(
|
|
215
|
+
screen.getByText(/Written as team\/sales\/q3\.malloy in the package/),
|
|
182
216
|
).toBeDefined();
|
|
183
|
-
|
|
184
|
-
expect(
|
|
217
|
+
fireEvent.click(screen.getByRole("button", { name: "Create report" }));
|
|
218
|
+
await waitFor(() => expect(onCreated).toHaveBeenCalledTimes(1));
|
|
219
|
+
expect(write.mock.calls[0][0]).toBe("team/sales/q3.malloy");
|
|
220
|
+
expect(write.mock.calls[0][1]).toContain(
|
|
221
|
+
'import { order_items } from "../../storefront.malloy"',
|
|
222
|
+
);
|
|
223
|
+
expect(onCreated.mock.calls[0][0]).toMatchObject({
|
|
224
|
+
path: "team/sales/q3.malloy",
|
|
225
|
+
slug: "q3",
|
|
226
|
+
});
|
|
227
|
+
});
|
|
228
|
+
|
|
229
|
+
it("refuses a typed location that is taken, under public/, or the package's index", async () => {
|
|
230
|
+
const write = mock((_path: string, _source: string) => Promise.resolve());
|
|
231
|
+
mount({ target: packageTarget(["taken.malloy"], write) });
|
|
232
|
+
await titleFilled("by category");
|
|
233
|
+
const location = screen.getByLabelText("Location");
|
|
234
|
+
fireEvent.change(location, { target: { value: "taken.malloy" } });
|
|
235
|
+
expect(
|
|
236
|
+
screen.getByText(
|
|
237
|
+
/taken\.malloy already exists; choose another location\./,
|
|
238
|
+
),
|
|
239
|
+
).toBeDefined();
|
|
240
|
+
fireEvent.click(screen.getByRole("button", { name: "Create report" }));
|
|
241
|
+
fireEvent.change(location, { target: { value: "public/x" } });
|
|
242
|
+
expect(screen.getByText(/cannot live under public\//)).toBeDefined();
|
|
243
|
+
fireEvent.change(location, { target: { value: "index" } });
|
|
244
|
+
expect(screen.getByText(/index\.malloy is its surface/)).toBeDefined();
|
|
245
|
+
expect(write).not.toHaveBeenCalled();
|
|
185
246
|
});
|
|
186
247
|
|
|
187
248
|
it("takes the next free name when the package already has the title's file", async () => {
|
|
188
249
|
const write = mock((_path: string, _source: string) => Promise.resolve());
|
|
189
250
|
mount({
|
|
190
|
-
target: packageTarget(
|
|
191
|
-
["dashboards/overview.malloy", "dashboards/overview-2.malloy"],
|
|
192
|
-
write,
|
|
193
|
-
),
|
|
251
|
+
target: packageTarget(["overview.malloy", "overview-2.malloy"], write),
|
|
194
252
|
});
|
|
195
253
|
await titleFilled("by category");
|
|
196
|
-
fireEvent.change(screen.getByLabelText("
|
|
254
|
+
fireEvent.change(screen.getByLabelText("Report title"), {
|
|
197
255
|
target: { value: "Overview" },
|
|
198
256
|
});
|
|
199
257
|
expect(
|
|
200
|
-
screen.getByText(/Written as
|
|
258
|
+
screen.getByText(/Written as overview-3\.malloy in the package/),
|
|
201
259
|
).toBeDefined();
|
|
202
|
-
fireEvent.click(screen.getByRole("button", { name: "Create
|
|
260
|
+
fireEvent.click(screen.getByRole("button", { name: "Create report" }));
|
|
203
261
|
await waitFor(() => expect(write).toHaveBeenCalledTimes(1));
|
|
204
|
-
expect(write.mock.calls[0][0]).toBe("
|
|
262
|
+
expect(write.mock.calls[0][0]).toBe("overview-3.malloy");
|
|
205
263
|
});
|
|
206
264
|
|
|
207
|
-
it("
|
|
265
|
+
it("checks a name against paths only: a same-named file in another directory does not take it", async () => {
|
|
208
266
|
mount({
|
|
209
|
-
|
|
267
|
+
layout: "linear",
|
|
210
268
|
target: packageTarget(["dashboards/by-category.malloy"]),
|
|
211
269
|
});
|
|
212
|
-
await titleFilled("by category"
|
|
270
|
+
await titleFilled("by category");
|
|
213
271
|
expect(
|
|
214
|
-
screen.getByText(/Written as
|
|
272
|
+
screen.getByText(/Written as by-category\.malloy in the package/),
|
|
215
273
|
).toBeDefined();
|
|
216
274
|
});
|
|
217
275
|
|
|
@@ -228,7 +286,7 @@ describe("NewDocumentDialog", () => {
|
|
|
228
286
|
onCreated,
|
|
229
287
|
});
|
|
230
288
|
await titleFilled("by category");
|
|
231
|
-
fireEvent.click(screen.getByRole("button", { name: "Create
|
|
289
|
+
fireEvent.click(screen.getByRole("button", { name: "Create report" }));
|
|
232
290
|
expect(await screen.findByText("File already exists")).toBeDefined();
|
|
233
291
|
expect(onCreated).not.toHaveBeenCalled();
|
|
234
292
|
});
|
|
@@ -236,7 +294,9 @@ describe("NewDocumentDialog", () => {
|
|
|
236
294
|
it("offers only the sources a model exports, not the ones it imports", async () => {
|
|
237
295
|
mount({ models: ["mid.malloy"] });
|
|
238
296
|
await titleFilled("overview");
|
|
239
|
-
fireEvent.mouseDown(
|
|
297
|
+
fireEvent.mouseDown(
|
|
298
|
+
screen.getByRole("combobox", { name: /First query/ }),
|
|
299
|
+
);
|
|
240
300
|
expect(
|
|
241
301
|
screen.getAllByRole("option").map((option) => option.textContent),
|
|
242
302
|
).toEqual(["mid_src → overview"]);
|
|
@@ -260,7 +320,7 @@ describe("NewDocumentDialog", () => {
|
|
|
260
320
|
expect(
|
|
261
321
|
screen
|
|
262
322
|
.getByRole("button", {
|
|
263
|
-
name: "Create
|
|
323
|
+
name: "Create report: No model view to start from yet",
|
|
264
324
|
})
|
|
265
325
|
.hasAttribute("disabled"),
|
|
266
326
|
).toBe(true);
|
|
@@ -283,7 +343,7 @@ describe("NewDocumentDialog", () => {
|
|
|
283
343
|
view.rerender(
|
|
284
344
|
<NewDocumentDialog
|
|
285
345
|
open
|
|
286
|
-
|
|
346
|
+
layout="grid"
|
|
287
347
|
environmentName="env"
|
|
288
348
|
packageName="pkg"
|
|
289
349
|
models={["storefront.malloy", "other.malloy"]}
|
|
@@ -303,7 +363,7 @@ describe("NewDocumentDialog", () => {
|
|
|
303
363
|
view.rerender(
|
|
304
364
|
<NewDocumentDialog
|
|
305
365
|
open={false}
|
|
306
|
-
|
|
366
|
+
layout="grid"
|
|
307
367
|
environmentName="env"
|
|
308
368
|
packageName="pkg"
|
|
309
369
|
models={["storefront.malloy", "other.malloy"]}
|
|
@@ -315,7 +375,7 @@ describe("NewDocumentDialog", () => {
|
|
|
315
375
|
view.rerender(
|
|
316
376
|
<NewDocumentDialog
|
|
317
377
|
open
|
|
318
|
-
|
|
378
|
+
layout="linear"
|
|
319
379
|
environmentName="env"
|
|
320
380
|
packageName="pkg"
|
|
321
381
|
models={["storefront.malloy", "other.malloy"]}
|
|
@@ -324,7 +384,7 @@ describe("NewDocumentDialog", () => {
|
|
|
324
384
|
onCreated={() => {}}
|
|
325
385
|
/>,
|
|
326
386
|
);
|
|
327
|
-
await titleFilled("by category"
|
|
387
|
+
await titleFilled("by category");
|
|
328
388
|
expect(getModel).toHaveBeenCalledTimes(2);
|
|
329
389
|
});
|
|
330
390
|
});
|
|
@@ -342,7 +402,7 @@ describe("NewDocumentDialog", () => {
|
|
|
342
402
|
// A stale listing: it does not know about the file the store has.
|
|
343
403
|
listDocuments: async () => [],
|
|
344
404
|
getDocument: async (locator: DocumentLocator) => {
|
|
345
|
-
if (locator.path === "env/pkg/
|
|
405
|
+
if (locator.path === "env/pkg/overview.malloy")
|
|
346
406
|
return "someone else's";
|
|
347
407
|
throw new DocumentNotFoundError("absent");
|
|
348
408
|
},
|
|
@@ -357,7 +417,7 @@ describe("NewDocumentDialog", () => {
|
|
|
357
417
|
saved.length = 0;
|
|
358
418
|
const onCreated = mock((_created: unknown) => {});
|
|
359
419
|
mount({
|
|
360
|
-
|
|
420
|
+
layout: "linear",
|
|
361
421
|
target: {
|
|
362
422
|
route: "storage",
|
|
363
423
|
storage,
|
|
@@ -367,18 +427,16 @@ describe("NewDocumentDialog", () => {
|
|
|
367
427
|
},
|
|
368
428
|
onCreated,
|
|
369
429
|
});
|
|
370
|
-
await titleFilled("by category"
|
|
371
|
-
fireEvent.change(screen.getByLabelText("
|
|
430
|
+
await titleFilled("by category");
|
|
431
|
+
fireEvent.change(screen.getByLabelText("Report title"), {
|
|
372
432
|
target: { value: "Overview" },
|
|
373
433
|
});
|
|
374
|
-
fireEvent.click(
|
|
375
|
-
screen.getByRole("button", { name: "Create notebook" }),
|
|
376
|
-
);
|
|
434
|
+
fireEvent.click(screen.getByRole("button", { name: "Create report" }));
|
|
377
435
|
await waitFor(() => expect(onCreated).toHaveBeenCalledTimes(1));
|
|
378
|
-
expect(saved).toEqual(["env/pkg/
|
|
436
|
+
expect(saved).toEqual(["env/pkg/overview-2.malloy"]);
|
|
379
437
|
expect(onCreated.mock.calls[0][0]).toMatchObject({
|
|
380
438
|
slug: "overview-2",
|
|
381
|
-
locator: { workspace: "record", type: "
|
|
439
|
+
locator: { workspace: "record", type: "linear" },
|
|
382
440
|
});
|
|
383
441
|
});
|
|
384
442
|
});
|
|
@@ -420,7 +478,7 @@ describe("NewDocumentDialog: a model it could not read", () => {
|
|
|
420
478
|
expect(
|
|
421
479
|
isDisabled(
|
|
422
480
|
createButton(
|
|
423
|
-
"Create
|
|
481
|
+
"Create report: Couldn't read the model views to start from",
|
|
424
482
|
),
|
|
425
483
|
),
|
|
426
484
|
).toBe(true);
|
|
@@ -429,7 +487,7 @@ describe("NewDocumentDialog: a model it could not read", () => {
|
|
|
429
487
|
fireEvent.click(screen.getByRole("button", { name: "Retry" }));
|
|
430
488
|
await titleFilled("by category");
|
|
431
489
|
expect(screen.queryByText(/Couldn't read storefront\.malloy/)).toBeNull();
|
|
432
|
-
expect(isDisabled(createButton("Create
|
|
490
|
+
expect(isDisabled(createButton("Create report"))).toBe(false);
|
|
433
491
|
});
|
|
434
492
|
|
|
435
493
|
it("names every model it could not read", async () => {
|
|
@@ -455,7 +513,7 @@ describe("NewDocumentDialog: a model it could not read", () => {
|
|
|
455
513
|
"Couldn't read other.malloy, so its views aren't listed.",
|
|
456
514
|
),
|
|
457
515
|
).toBeDefined();
|
|
458
|
-
expect(isDisabled(createButton("Create
|
|
516
|
+
expect(isDisabled(createButton("Create report"))).toBe(false);
|
|
459
517
|
});
|
|
460
518
|
|
|
461
519
|
for (const [status, retry] of [
|
|
@@ -480,7 +538,7 @@ describe("NewDocumentDialog: why Create is off", () => {
|
|
|
480
538
|
it("while the views load, in its name and its tooltip", async () => {
|
|
481
539
|
getModel.mockImplementation(() => pending());
|
|
482
540
|
mount();
|
|
483
|
-
const button = createButton("Create
|
|
541
|
+
const button = createButton("Create report: Loading model views");
|
|
484
542
|
expect(isDisabled(button)).toBe(true);
|
|
485
543
|
fireEvent.mouseOver(button.parentElement!);
|
|
486
544
|
expect((await screen.findByRole("tooltip")).textContent).toBe(
|
|
@@ -492,7 +550,7 @@ describe("NewDocumentDialog: why Create is off", () => {
|
|
|
492
550
|
mount({ models: [], modelsLoading: true });
|
|
493
551
|
expect(screen.queryByText(/This package has no models yet/)).toBeNull();
|
|
494
552
|
expect(
|
|
495
|
-
isDisabled(createButton("Create
|
|
553
|
+
isDisabled(createButton("Create report: Loading model views")),
|
|
496
554
|
).toBe(true);
|
|
497
555
|
});
|
|
498
556
|
|
|
@@ -512,7 +570,7 @@ describe("NewDocumentDialog: why Create is off", () => {
|
|
|
512
570
|
expect(
|
|
513
571
|
isDisabled(
|
|
514
572
|
createButton(
|
|
515
|
-
"Create
|
|
573
|
+
"Create report: Couldn't read the model views to start from",
|
|
516
574
|
),
|
|
517
575
|
),
|
|
518
576
|
).toBe(true);
|
|
@@ -539,7 +597,7 @@ describe("NewDocumentDialog: why Create is off", () => {
|
|
|
539
597
|
expect(
|
|
540
598
|
isDisabled(
|
|
541
599
|
createButton(
|
|
542
|
-
"Create
|
|
600
|
+
"Create report: Couldn't read the model views to start from",
|
|
543
601
|
),
|
|
544
602
|
),
|
|
545
603
|
).toBe(true);
|
|
@@ -550,7 +608,7 @@ describe("NewDocumentDialog: why Create is off", () => {
|
|
|
550
608
|
await screen.findByText(/no model in this package declares one yet/);
|
|
551
609
|
expect(
|
|
552
610
|
isDisabled(
|
|
553
|
-
createButton("Create
|
|
611
|
+
createButton("Create report: No model view to start from yet"),
|
|
554
612
|
),
|
|
555
613
|
).toBe(true);
|
|
556
614
|
});
|
|
@@ -559,28 +617,28 @@ describe("NewDocumentDialog: why Create is off", () => {
|
|
|
559
617
|
const write = mock((_path: string, _source: string) => Promise.resolve());
|
|
560
618
|
mount({ target: packageTarget([], write) });
|
|
561
619
|
await titleFilled("by category");
|
|
562
|
-
fireEvent.change(screen.getByLabelText("
|
|
620
|
+
fireEvent.change(screen.getByLabelText("Report title"), {
|
|
563
621
|
target: { value: " " },
|
|
564
622
|
});
|
|
565
623
|
expect(screen.queryByText("A title cannot be empty.")).toBeNull();
|
|
566
|
-
const button = createButton("Create
|
|
624
|
+
const button = createButton("Create report");
|
|
567
625
|
expect(isDisabled(button)).toBe(false);
|
|
568
626
|
fireEvent.click(button);
|
|
569
627
|
expect(screen.getByText("A title cannot be empty.")).toBeDefined();
|
|
570
628
|
expect(
|
|
571
|
-
screen.getByLabelText("
|
|
629
|
+
screen.getByLabelText("Report title").getAttribute("aria-invalid"),
|
|
572
630
|
).toBe("true");
|
|
573
631
|
expect(write).not.toHaveBeenCalled();
|
|
574
632
|
});
|
|
575
633
|
|
|
576
634
|
it("not for a title that cannot be written, whose problem shows as it is typed", async () => {
|
|
577
|
-
mount({
|
|
578
|
-
await titleFilled("by category"
|
|
579
|
-
fireEvent.change(screen.getByLabelText("
|
|
635
|
+
mount({ layout: "linear" });
|
|
636
|
+
await titleFilled("by category");
|
|
637
|
+
fireEvent.change(screen.getByLabelText("Report title"), {
|
|
580
638
|
target: { value: "a |## b" },
|
|
581
639
|
});
|
|
582
640
|
expect(screen.getByText(/A title cannot contain `\|##`/)).toBeDefined();
|
|
583
|
-
expect(isDisabled(createButton("Create
|
|
641
|
+
expect(isDisabled(createButton("Create report"))).toBe(false);
|
|
584
642
|
});
|
|
585
643
|
});
|
|
586
644
|
|
|
@@ -606,7 +664,7 @@ describe("NewDocumentDialog: the picked view", () => {
|
|
|
606
664
|
view.rerender(
|
|
607
665
|
<NewDocumentDialog
|
|
608
666
|
open
|
|
609
|
-
|
|
667
|
+
layout="grid"
|
|
610
668
|
environmentName="env"
|
|
611
669
|
packageName="pkg"
|
|
612
670
|
versionId={versionId}
|
|
@@ -617,7 +675,8 @@ describe("NewDocumentDialog: the picked view", () => {
|
|
|
617
675
|
/>,
|
|
618
676
|
);
|
|
619
677
|
|
|
620
|
-
const firstTile = () =>
|
|
678
|
+
const firstTile = () =>
|
|
679
|
+
screen.getByRole("combobox", { name: /First query/ });
|
|
621
680
|
|
|
622
681
|
const pickBrand = async () => {
|
|
623
682
|
await titleFilled("by category");
|
|
@@ -644,7 +703,7 @@ describe("NewDocumentDialog: the picked view", () => {
|
|
|
644
703
|
await waitFor(() =>
|
|
645
704
|
expect(firstTile().textContent).toBe("order_items → by_brand"),
|
|
646
705
|
);
|
|
647
|
-
expect(isDisabled(createButton("Create
|
|
706
|
+
expect(isDisabled(createButton("Create report"))).toBe(false);
|
|
648
707
|
});
|
|
649
708
|
|
|
650
709
|
it("is not swapped for another when it leaves the list", async () => {
|
|
@@ -658,9 +717,7 @@ describe("NewDocumentDialog: the picked view", () => {
|
|
|
658
717
|
).toBeDefined();
|
|
659
718
|
expect(firstTile().textContent).not.toContain("by_category");
|
|
660
719
|
expect(
|
|
661
|
-
isDisabled(
|
|
662
|
-
createButton("Create dashboard: Pick a view to start from"),
|
|
663
|
-
),
|
|
720
|
+
isDisabled(createButton("Create report: Pick a view to start from")),
|
|
664
721
|
).toBe(true);
|
|
665
722
|
});
|
|
666
723
|
});
|
|
@@ -678,10 +735,10 @@ describe("NewDocumentDialog: while it creates", () => {
|
|
|
678
735
|
const onCreated = mock((_created: unknown) => {});
|
|
679
736
|
mount({ target: packageTarget([], write), onClose, onCreated });
|
|
680
737
|
await titleFilled("by category");
|
|
681
|
-
fireEvent.click(createButton("Create
|
|
738
|
+
fireEvent.click(createButton("Create report"));
|
|
682
739
|
|
|
683
740
|
const creating = await screen.findByRole("button", {
|
|
684
|
-
name: "Creating
|
|
741
|
+
name: "Creating report…",
|
|
685
742
|
});
|
|
686
743
|
expect(isDisabled(creating)).toBe(true);
|
|
687
744
|
expect(isDisabled(screen.getByRole("button", { name: "Cancel" }))).toBe(
|
|
@@ -695,12 +752,12 @@ describe("NewDocumentDialog: while it creates", () => {
|
|
|
695
752
|
await waitFor(() => expect(onCreated).toHaveBeenCalledTimes(1));
|
|
696
753
|
});
|
|
697
754
|
|
|
698
|
-
it("names the
|
|
699
|
-
mount({
|
|
700
|
-
await titleFilled("by category"
|
|
701
|
-
fireEvent.click(createButton("Create
|
|
755
|
+
it("names the report while it creates a linear one", async () => {
|
|
756
|
+
mount({ layout: "linear", target: packageTarget([], () => pending()) });
|
|
757
|
+
await titleFilled("by category");
|
|
758
|
+
fireEvent.click(createButton("Create report"));
|
|
702
759
|
expect(
|
|
703
|
-
await screen.findByRole("button", { name: "Creating
|
|
760
|
+
await screen.findByRole("button", { name: "Creating report…" }),
|
|
704
761
|
).toBeDefined();
|
|
705
762
|
});
|
|
706
763
|
});
|
|
@@ -715,11 +772,11 @@ describe("NewDocumentDialog: what the host decides", () => {
|
|
|
715
772
|
expect(onClose).toHaveBeenCalledTimes(2);
|
|
716
773
|
});
|
|
717
774
|
|
|
718
|
-
it("offers no
|
|
719
|
-
mount({
|
|
720
|
-
await titleFilled("by category"
|
|
721
|
-
expect(screen.queryByRole("combobox", { name: /
|
|
722
|
-
expect(createButton("Create
|
|
775
|
+
it("offers no layout to switch to when allowLayoutChange is false", async () => {
|
|
776
|
+
mount({ layout: "linear", allowLayoutChange: false });
|
|
777
|
+
await titleFilled("by category");
|
|
778
|
+
expect(screen.queryByRole("combobox", { name: /Layout/ })).toBeNull();
|
|
779
|
+
expect(createButton("Create report")).toBeDefined();
|
|
723
780
|
});
|
|
724
781
|
|
|
725
782
|
it("says where the host saves it, in the host's words", async () => {
|