@manta-eu/react 0.1.1 → 0.1.2
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 +2 -5
- package/dist/components/breadcrumbs/index.d.ts +26 -0
- package/dist/components/breadcrumbs/index.d.ts.map +1 -0
- package/dist/components/breadcrumbs/index.js +36 -0
- package/dist/components/chip/index.d.ts +14 -0
- package/dist/components/chip/index.d.ts.map +1 -0
- package/dist/components/chip/index.js +8 -0
- package/dist/components/editable-text/index.d.ts +13 -0
- package/dist/components/editable-text/index.d.ts.map +1 -0
- package/dist/components/editable-text/index.js +61 -0
- package/dist/components/explain-fact/ExplainFact.d.ts +16 -0
- package/dist/components/explain-fact/ExplainFact.d.ts.map +1 -0
- package/dist/components/{rdfox-explain/RDFoxExplain.js → explain-fact/ExplainFact.js} +12 -12
- package/dist/components/explain-fact/OutdatedFactNotice.d.ts.map +1 -0
- package/dist/components/input/index.d.ts +2 -0
- package/dist/components/input/index.d.ts.map +1 -1
- package/dist/components/input/index.js +2 -0
- package/dist/components/input/input-numeric.d.ts +19 -0
- package/dist/components/input/input-numeric.d.ts.map +1 -0
- package/dist/components/input/input-numeric.js +85 -0
- package/dist/components/input/input-tags.d.ts +17 -0
- package/dist/components/input/input-tags.d.ts.map +1 -0
- package/dist/components/input/input-tags.js +46 -0
- package/dist/components/multi-select/index.d.ts +32 -0
- package/dist/components/multi-select/index.d.ts.map +1 -0
- package/dist/components/multi-select/index.js +33 -0
- package/dist/components/multi-select/toggle-value.d.ts +2 -0
- package/dist/components/multi-select/toggle-value.d.ts.map +1 -0
- package/dist/components/multi-select/toggle-value.js +3 -0
- package/dist/components/sidebar/index.d.ts +4 -1
- package/dist/components/sidebar/index.d.ts.map +1 -1
- package/dist/components/sidebar/index.js +2 -2
- package/dist/components/skeleton/index.js +1 -1
- package/dist/components/tool-invocation-card/ExplainFactResultDisplay.d.ts +9 -0
- package/dist/components/tool-invocation-card/ExplainFactResultDisplay.d.ts.map +1 -0
- package/dist/components/tool-invocation-card/{ExplainRDFoxResultDisplay.js → ExplainFactResultDisplay.js} +3 -3
- package/dist/components/tool-invocation-card/ToolOutputRenderer.js +2 -2
- package/dist/components/tool-invocation-card/types.d.ts +4 -4
- package/dist/components/tool-invocation-card/types.d.ts.map +1 -1
- package/dist/components/tool-invocation-card/types.js +2 -2
- package/dist/components/tree-multi-select/index.d.ts +1 -1
- package/dist/components/tree-multi-select/index.d.ts.map +1 -1
- package/dist/components/tree-multi-select/index.js +1 -1
- package/dist/components/tree-multi-select/tree-multi-select-rows.d.ts +2 -1
- package/dist/components/tree-multi-select/tree-multi-select-rows.d.ts.map +1 -1
- package/dist/components/tree-multi-select/tree-multi-select-rows.js +21 -31
- package/dist/components/tree-multi-select/tree-multi-select.d.ts +2 -0
- package/dist/components/tree-multi-select/tree-multi-select.d.ts.map +1 -1
- package/dist/components/tree-multi-select/tree-multi-select.js +21 -8
- package/dist/explain-fact/DatalogCode.d.ts.map +1 -0
- package/dist/explain-fact/EntityChip.d.ts.map +1 -0
- package/dist/explain-fact/EntityChip.js +17 -0
- package/dist/explain-fact/ExplainCompactView.d.ts.map +1 -0
- package/dist/explain-fact/ExplainFactState.d.ts +7 -0
- package/dist/explain-fact/ExplainFactState.d.ts.map +1 -0
- package/dist/{rdfox-explain/RDFoxExplainState.js → explain-fact/ExplainFactState.js} +1 -1
- package/dist/explain-fact/ExplainFullView.d.ts.map +1 -0
- package/dist/explain-fact/ExplainStates.d.ts.map +1 -0
- package/dist/explain-fact/ExplainTag.d.ts.map +1 -0
- package/dist/explain-fact/FactNotice.d.ts +7 -0
- package/dist/explain-fact/FactNotice.d.ts.map +1 -0
- package/dist/explain-fact/FactNotice.js +25 -0
- package/dist/explain-fact/FactValue.d.ts.map +1 -0
- package/dist/explain-fact/NumDot.d.ts.map +1 -0
- package/dist/explain-fact/PanelLabel.d.ts.map +1 -0
- package/dist/explain-fact/ProofSubjectHeader.d.ts.map +1 -0
- package/dist/explain-fact/ProvenanceBadge.d.ts.map +1 -0
- package/dist/{rdfox-explain → explain-fact}/ProvenanceBadge.js +2 -1
- package/dist/explain-fact/RuleVariableTypes.d.ts.map +1 -0
- package/dist/explain-fact/SubstitutedFactNotice.d.ts.map +1 -0
- package/dist/explain-fact/ValuePill.d.ts.map +1 -0
- package/dist/explain-fact/conclusion/ConclusionCard.d.ts.map +1 -0
- package/dist/explain-fact/conclusion/ConclusionSubtitle.d.ts.map +1 -0
- package/dist/{rdfox-explain → explain-fact}/conclusion/ConclusionSubtitle.js +3 -1
- package/dist/explain-fact/conclusion/index.d.ts.map +1 -0
- package/dist/explain-fact/explain-styles.d.ts.map +1 -0
- package/dist/explain-fact/fact-token.d.ts.map +1 -0
- package/dist/explain-fact/formula-hues.d.ts.map +1 -0
- package/dist/{rdfox-explain → explain-fact}/index.d.ts +2 -3
- package/dist/explain-fact/index.d.ts.map +1 -0
- package/dist/{rdfox-explain → explain-fact}/index.js +2 -3
- package/dist/explain-fact/inspector/ExplainInspector.d.ts.map +1 -0
- package/dist/explain-fact/inspector/ExplainInspector.js +20 -0
- package/dist/explain-fact/inspector/InspectorBindings.d.ts.map +1 -0
- package/dist/explain-fact/inspector/InspectorFact.d.ts.map +1 -0
- package/dist/explain-fact/inspector/InspectorHeader.d.ts.map +1 -0
- package/dist/{rdfox-explain → explain-fact}/inspector/InspectorRule.d.ts +3 -0
- package/dist/explain-fact/inspector/InspectorRule.d.ts.map +1 -0
- package/dist/{rdfox-explain → explain-fact}/inspector/InspectorRule.js +4 -5
- package/dist/explain-fact/inspector/SupportsSection.d.ts.map +1 -0
- package/dist/{rdfox-explain → explain-fact}/inspector/SupportsSection.js +2 -1
- package/dist/explain-fact/inspector/index.d.ts.map +1 -0
- package/dist/explain-fact/proof-tree/ProofFactLabel.d.ts.map +1 -0
- package/dist/explain-fact/proof-tree/ProofRowBadge.d.ts.map +1 -0
- package/dist/explain-fact/proof-tree/ProofRowContent.d.ts.map +1 -0
- package/dist/explain-fact/proof-tree/ProofRowValue.d.ts.map +1 -0
- package/dist/explain-fact/proof-tree/ProofTree.d.ts.map +1 -0
- package/dist/{rdfox-explain → explain-fact}/proof-tree/ProofTree.js +1 -1
- package/dist/explain-fact/proof-tree/ProofTreeFormulaFooter.d.ts.map +1 -0
- package/dist/explain-fact/proof-tree/ProofTreeNode.d.ts.map +1 -0
- package/dist/explain-fact/proof-tree/SupportsTag.d.ts.map +1 -0
- package/dist/explain-fact/proof-tree/SupportsTag.js +6 -0
- package/dist/explain-fact/proof-tree/index.d.ts.map +1 -0
- package/dist/explain-fact/proof-tree/proof-tree-navigation.d.ts.map +1 -0
- package/dist/explain-fact/proof-tree/proof-tree-root-view.d.ts.map +1 -0
- package/dist/explain-fact/proof-tree/visible-premises.d.ts.map +1 -0
- package/dist/explain-fact/rule-presentation.d.ts.map +1 -0
- package/dist/{rdfox-explain → explain-fact}/tree-model.d.ts +18 -9
- package/dist/explain-fact/tree-model.d.ts.map +1 -0
- package/dist/{rdfox-explain → explain-fact}/tree-model.js +19 -10
- package/dist/explain-fact/use-fact-measure.d.ts.map +1 -0
- package/dist/globals.css +237 -18
- package/dist/hooks/useValidateActionPlan.d.ts.map +1 -1
- package/dist/index.d.ts +3 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +3 -0
- package/dist/ldo-ui.d.ts +1 -1
- package/dist/ldo-ui.d.ts.map +1 -1
- package/dist/ldo-ui.js +1 -1
- package/dist/lib/datastore-route-paths.d.ts +2 -2
- package/dist/lib/datastore-route-paths.d.ts.map +1 -1
- package/dist/lib/datastore-route-paths.js +2 -2
- package/dist/lib/datastore-route-table.d.ts +36 -0
- package/dist/lib/datastore-route-table.d.ts.map +1 -0
- package/dist/lib/datastore-route-table.js +43 -0
- package/dist/lib/datastore-routes.d.ts +1 -1
- package/dist/lib/datastore-routes.d.ts.map +1 -1
- package/dist/lib/datastore-routes.js +1 -1
- package/dist/lib/spa-routes.d.ts +3 -0
- package/dist/lib/spa-routes.d.ts.map +1 -0
- package/dist/lib/spa-routes.js +5 -0
- package/dist/routes/data-explorer/components/Breadcrumbs.d.ts.map +1 -1
- package/dist/routes/data-explorer/components/Breadcrumbs.js +5 -5
- package/dist/routes/datastores/components/DatastoreFormDialog.d.ts +18 -0
- package/dist/routes/datastores/components/DatastoreFormDialog.d.ts.map +1 -0
- package/dist/routes/datastores/components/DatastoreFormDialog.js +27 -0
- package/dist/routes/datastores/components/DatastoreTableSkeleton.d.ts +2 -0
- package/dist/routes/datastores/components/DatastoreTableSkeleton.d.ts.map +1 -0
- package/dist/routes/datastores/components/DatastoreTableSkeleton.js +7 -0
- package/dist/routes/datastores/components/DatastoresToolbar.d.ts +18 -0
- package/dist/routes/datastores/components/DatastoresToolbar.d.ts.map +1 -0
- package/dist/routes/datastores/components/DatastoresToolbar.js +29 -0
- package/dist/routes/datastores/components/LinkUnlinkedDatastoreDialog.d.ts +14 -0
- package/dist/routes/datastores/components/LinkUnlinkedDatastoreDialog.d.ts.map +1 -0
- package/dist/routes/datastores/components/LinkUnlinkedDatastoreDialog.js +83 -0
- package/dist/routes/datastores/components/RenameDatastoreGroupDialog.d.ts +9 -0
- package/dist/routes/datastores/components/RenameDatastoreGroupDialog.d.ts.map +1 -0
- package/dist/routes/datastores/components/RenameDatastoreGroupDialog.js +21 -0
- package/dist/routes/datastores/components/StatusBadge.d.ts +21 -0
- package/dist/routes/datastores/components/StatusBadge.d.ts.map +1 -0
- package/dist/routes/datastores/components/StatusBadge.js +49 -0
- package/dist/routes/datastores/components/UnlinkedDatastoresPanel.d.ts +20 -0
- package/dist/routes/datastores/components/UnlinkedDatastoresPanel.d.ts.map +1 -0
- package/dist/routes/datastores/components/UnlinkedDatastoresPanel.js +13 -0
- package/dist/routes/datastores/flatten.d.ts +33 -0
- package/dist/routes/datastores/flatten.d.ts.map +1 -0
- package/dist/routes/datastores/flatten.js +86 -0
- package/dist/routes/datastores/hooks/useDatastoreColumns.d.ts +47 -0
- package/dist/routes/datastores/hooks/useDatastoreColumns.d.ts.map +1 -0
- package/dist/routes/datastores/hooks/useDatastoreColumns.js +165 -0
- package/dist/routes/datastores/hooks/useDatastoreTable.d.ts +14 -0
- package/dist/routes/datastores/hooks/useDatastoreTable.d.ts.map +1 -0
- package/dist/routes/datastores/hooks/useDatastoreTable.js +45 -0
- package/dist/routes/datastores/index.d.ts +2 -0
- package/dist/routes/datastores/index.d.ts.map +1 -0
- package/dist/routes/datastores/index.js +467 -0
- package/dist/routes/explain/ExplainEmpty.d.ts +2 -0
- package/dist/routes/explain/ExplainEmpty.d.ts.map +1 -0
- package/dist/routes/explain/ExplainEmpty.js +8 -0
- package/dist/routes/explain/index.d.ts +2 -0
- package/dist/routes/explain/index.d.ts.map +1 -0
- package/dist/routes/explain/index.js +16 -0
- package/dist/routes/explain/url-params.d.ts +9 -0
- package/dist/routes/explain/url-params.d.ts.map +1 -0
- package/dist/routes/explain/url-params.js +21 -0
- package/dist/routes/integrations/components/ConnectionRow.d.ts.map +1 -1
- package/dist/routes/integrations/components/ConnectionRow.js +1 -1
- package/dist/routes/integrations/connection-view.d.ts.map +1 -1
- package/dist/routes/integrations/connection-view.js +17 -1
- package/dist/routes/integrations/types.d.ts +2 -1
- package/dist/routes/integrations/types.d.ts.map +1 -1
- package/dist/routes/rules/components/CreateRuleChatModal.d.ts +10 -0
- package/dist/routes/rules/components/CreateRuleChatModal.d.ts.map +1 -0
- package/dist/routes/rules/components/CreateRuleChatModal.js +52 -0
- package/dist/routes/rules/components/RuleActionabilityBadge.d.ts +8 -0
- package/dist/routes/rules/components/RuleActionabilityBadge.d.ts.map +1 -0
- package/dist/routes/rules/components/RuleActionabilityBadge.js +18 -0
- package/dist/routes/rules/components/RuleAffectedActionPlansSection.d.ts +6 -0
- package/dist/routes/rules/components/RuleAffectedActionPlansSection.d.ts.map +1 -0
- package/dist/routes/rules/components/RuleAffectedActionPlansSection.js +151 -0
- package/dist/routes/rules/components/RuleAst.d.ts +6 -0
- package/dist/routes/rules/components/RuleAst.d.ts.map +1 -0
- package/dist/routes/rules/components/RuleAst.js +23 -0
- package/dist/routes/rules/components/RuleDependentRulesSection.d.ts +6 -0
- package/dist/routes/rules/components/RuleDependentRulesSection.d.ts.map +1 -0
- package/dist/routes/rules/components/RuleDependentRulesSection.js +16 -0
- package/dist/routes/rules/components/RuleDetailsPage.d.ts +14 -0
- package/dist/routes/rules/components/RuleDetailsPage.d.ts.map +1 -0
- package/dist/routes/rules/components/RuleDetailsPage.js +51 -0
- package/dist/routes/rules/components/RuleProducersSection.d.ts +7 -0
- package/dist/routes/rules/components/RuleProducersSection.d.ts.map +1 -0
- package/dist/routes/rules/components/RuleProducersSection.js +10 -0
- package/dist/routes/rules/components/RuleSampleFactsSection.d.ts +7 -0
- package/dist/routes/rules/components/RuleSampleFactsSection.d.ts.map +1 -0
- package/dist/routes/rules/components/RuleSampleFactsSection.js +70 -0
- package/dist/routes/rules/components/RulesOverviewHeaderActions.d.ts +17 -0
- package/dist/routes/rules/components/RulesOverviewHeaderActions.d.ts.map +1 -0
- package/dist/routes/rules/components/RulesOverviewHeaderActions.js +55 -0
- package/dist/routes/rules/components/RulesOverviewPage.d.ts +13 -0
- package/dist/routes/rules/components/RulesOverviewPage.d.ts.map +1 -0
- package/dist/routes/rules/components/RulesOverviewPage.js +236 -0
- package/dist/routes/rules/components/SupportedActionShapesList/SupportedActionShapeDetails.d.ts +7 -0
- package/dist/routes/rules/components/SupportedActionShapesList/SupportedActionShapeDetails.d.ts.map +1 -0
- package/dist/routes/rules/components/SupportedActionShapesList/SupportedActionShapeDetails.js +47 -0
- package/dist/routes/rules/components/SupportedActionShapesList/SupportedActionShapesList.d.ts +8 -0
- package/dist/routes/rules/components/SupportedActionShapesList/SupportedActionShapesList.d.ts.map +1 -0
- package/dist/routes/rules/components/SupportedActionShapesList/SupportedActionShapesList.js +76 -0
- package/dist/routes/rules/components/SupportedActionShapesList/TokenList.d.ts +6 -0
- package/dist/routes/rules/components/SupportedActionShapesList/TokenList.d.ts.map +1 -0
- package/dist/routes/rules/components/SupportedActionShapesList/TokenList.js +9 -0
- package/dist/routes/rules/components/SupportedActionShapesList/index.d.ts +2 -0
- package/dist/routes/rules/components/SupportedActionShapesList/index.d.ts.map +1 -0
- package/dist/routes/rules/components/SupportedActionShapesList/index.js +1 -0
- package/dist/routes/rules/components/SupportedActionShapesList/shacl-shape.d.ts +20 -0
- package/dist/routes/rules/components/SupportedActionShapesList/shacl-shape.d.ts.map +1 -0
- package/dist/routes/rules/components/SupportedActionShapesList/shacl-shape.js +48 -0
- package/dist/routes/rules/components/datalog-editor/BindingsPreview.d.ts +9 -0
- package/dist/routes/rules/components/datalog-editor/BindingsPreview.d.ts.map +1 -0
- package/dist/routes/rules/components/datalog-editor/BindingsPreview.js +38 -0
- package/dist/routes/rules/components/datalog-editor/FactsPreview.d.ts +10 -0
- package/dist/routes/rules/components/datalog-editor/FactsPreview.d.ts.map +1 -0
- package/dist/routes/rules/components/datalog-editor/FactsPreview.js +43 -0
- package/dist/routes/rules/components/datalog-editor/PreviewPanel.d.ts +7 -0
- package/dist/routes/rules/components/datalog-editor/PreviewPanel.d.ts.map +1 -0
- package/dist/routes/rules/components/datalog-editor/PreviewPanel.js +8 -0
- package/dist/routes/rules/components/datalog-editor/QueryResults.d.ts +9 -0
- package/dist/routes/rules/components/datalog-editor/QueryResults.d.ts.map +1 -0
- package/dist/routes/rules/components/datalog-editor/QueryResults.js +22 -0
- package/dist/routes/rules/components/datalog-editor/SparqlQueryPanel.d.ts +11 -0
- package/dist/routes/rules/components/datalog-editor/SparqlQueryPanel.d.ts.map +1 -0
- package/dist/routes/rules/components/datalog-editor/SparqlQueryPanel.js +21 -0
- package/dist/routes/rules/components/rule-producers.d.ts +15 -0
- package/dist/routes/rules/components/rule-producers.d.ts.map +1 -0
- package/dist/routes/rules/components/rule-producers.js +76 -0
- package/dist/routes/rules/components/sample-facts-query.d.ts +9 -0
- package/dist/routes/rules/components/sample-facts-query.d.ts.map +1 -0
- package/dist/routes/rules/components/sample-facts-query.js +71 -0
- package/dist/routes/rules/datalog-editor.d.ts +6 -0
- package/dist/routes/rules/datalog-editor.d.ts.map +1 -0
- package/dist/routes/rules/datalog-editor.js +7 -0
- package/dist/routes/rules/hooks/useRuleFactsPreview.d.ts +53 -0
- package/dist/routes/rules/hooks/useRuleFactsPreview.d.ts.map +1 -0
- package/dist/routes/rules/hooks/useRuleFactsPreview.js +214 -0
- package/dist/routes/rules/hooks/useSparqlQueryExecution.d.ts +14 -0
- package/dist/routes/rules/hooks/useSparqlQueryExecution.d.ts.map +1 -0
- package/dist/routes/rules/hooks/useSparqlQueryExecution.js +77 -0
- package/dist/routes/rules/pages.d.ts +6 -0
- package/dist/routes/rules/pages.d.ts.map +1 -0
- package/dist/routes/rules/pages.js +7 -0
- package/dist/rules/RuleNameLink.d.ts +6 -0
- package/dist/rules/RuleNameLink.d.ts.map +1 -0
- package/dist/rules/RuleNameLink.js +8 -0
- package/package.json +59 -24
- package/src/globals.css +5 -0
- package/src/themes/manta-dark.css +1 -0
- package/src/themes/manta.css +1 -0
- package/src/themes/standard.css +1 -0
- package/dist/components/rdfox-explain/OutdatedFactNotice.d.ts.map +0 -1
- package/dist/components/rdfox-explain/RDFoxExplain.d.ts +0 -16
- package/dist/components/rdfox-explain/RDFoxExplain.d.ts.map +0 -1
- package/dist/components/tool-invocation-card/ExplainRDFoxResultDisplay.d.ts +0 -9
- package/dist/components/tool-invocation-card/ExplainRDFoxResultDisplay.d.ts.map +0 -1
- package/dist/lib/test-utils.d.ts +0 -4
- package/dist/lib/test-utils.d.ts.map +0 -1
- package/dist/lib/test-utils.js +0 -16
- package/dist/rdfox-explain/AbsentFactNotice.d.ts +0 -5
- package/dist/rdfox-explain/AbsentFactNotice.d.ts.map +0 -1
- package/dist/rdfox-explain/AbsentFactNotice.js +0 -6
- package/dist/rdfox-explain/DatalogCode.d.ts.map +0 -1
- package/dist/rdfox-explain/EntityChip.d.ts.map +0 -1
- package/dist/rdfox-explain/EntityChip.js +0 -9
- package/dist/rdfox-explain/ExplainCompactView.d.ts.map +0 -1
- package/dist/rdfox-explain/ExplainFullView.d.ts.map +0 -1
- package/dist/rdfox-explain/ExplainStates.d.ts.map +0 -1
- package/dist/rdfox-explain/ExplainTag.d.ts.map +0 -1
- package/dist/rdfox-explain/FactValue.d.ts.map +0 -1
- package/dist/rdfox-explain/NumDot.d.ts.map +0 -1
- package/dist/rdfox-explain/PanelLabel.d.ts.map +0 -1
- package/dist/rdfox-explain/ProofSubjectHeader.d.ts.map +0 -1
- package/dist/rdfox-explain/ProvenanceBadge.d.ts.map +0 -1
- package/dist/rdfox-explain/RDFoxExplainState.d.ts +0 -7
- package/dist/rdfox-explain/RDFoxExplainState.d.ts.map +0 -1
- package/dist/rdfox-explain/RuleVariableTypes.d.ts.map +0 -1
- package/dist/rdfox-explain/StoredFactNotice.d.ts +0 -5
- package/dist/rdfox-explain/StoredFactNotice.d.ts.map +0 -1
- package/dist/rdfox-explain/StoredFactNotice.js +0 -6
- package/dist/rdfox-explain/SubstitutedFactNotice.d.ts.map +0 -1
- package/dist/rdfox-explain/ValuePill.d.ts.map +0 -1
- package/dist/rdfox-explain/busy-aggregate-fixture.d.ts +0 -7
- package/dist/rdfox-explain/busy-aggregate-fixture.d.ts.map +0 -1
- package/dist/rdfox-explain/busy-aggregate-fixture.js +0 -6
- package/dist/rdfox-explain/conclusion/ConclusionCard.d.ts.map +0 -1
- package/dist/rdfox-explain/conclusion/ConclusionSubtitle.d.ts.map +0 -1
- package/dist/rdfox-explain/conclusion/index.d.ts.map +0 -1
- package/dist/rdfox-explain/explain-styles.d.ts.map +0 -1
- package/dist/rdfox-explain/fact-token.d.ts.map +0 -1
- package/dist/rdfox-explain/formula-hues.d.ts.map +0 -1
- package/dist/rdfox-explain/index.d.ts.map +0 -1
- package/dist/rdfox-explain/inspector/ExplainInspector.d.ts.map +0 -1
- package/dist/rdfox-explain/inspector/ExplainInspector.js +0 -22
- package/dist/rdfox-explain/inspector/InspectorBindings.d.ts.map +0 -1
- package/dist/rdfox-explain/inspector/InspectorFact.d.ts.map +0 -1
- package/dist/rdfox-explain/inspector/InspectorHeader.d.ts.map +0 -1
- package/dist/rdfox-explain/inspector/InspectorRule.d.ts.map +0 -1
- package/dist/rdfox-explain/inspector/SupportsSection.d.ts.map +0 -1
- package/dist/rdfox-explain/inspector/index.d.ts.map +0 -1
- package/dist/rdfox-explain/proof-tree/ProofFactLabel.d.ts.map +0 -1
- package/dist/rdfox-explain/proof-tree/ProofRowBadge.d.ts.map +0 -1
- package/dist/rdfox-explain/proof-tree/ProofRowContent.d.ts.map +0 -1
- package/dist/rdfox-explain/proof-tree/ProofRowValue.d.ts.map +0 -1
- package/dist/rdfox-explain/proof-tree/ProofTree.d.ts.map +0 -1
- package/dist/rdfox-explain/proof-tree/ProofTreeFormulaFooter.d.ts.map +0 -1
- package/dist/rdfox-explain/proof-tree/ProofTreeNode.d.ts.map +0 -1
- package/dist/rdfox-explain/proof-tree/SupportsTag.d.ts.map +0 -1
- package/dist/rdfox-explain/proof-tree/SupportsTag.js +0 -6
- package/dist/rdfox-explain/proof-tree/index.d.ts.map +0 -1
- package/dist/rdfox-explain/proof-tree/proof-tree-navigation.d.ts.map +0 -1
- package/dist/rdfox-explain/proof-tree/proof-tree-root-view.d.ts.map +0 -1
- package/dist/rdfox-explain/proof-tree/visible-premises.d.ts.map +0 -1
- package/dist/rdfox-explain/rule-presentation.d.ts.map +0 -1
- package/dist/rdfox-explain/tree-model.d.ts.map +0 -1
- package/dist/rdfox-explain/use-fact-measure.d.ts.map +0 -1
- package/dist/test-support.d.ts +0 -9
- package/dist/test-support.d.ts.map +0 -1
- package/dist/test-support.js +0 -18
- /package/dist/components/{rdfox-explain → explain-fact}/OutdatedFactNotice.d.ts +0 -0
- /package/dist/components/{rdfox-explain → explain-fact}/OutdatedFactNotice.js +0 -0
- /package/dist/{rdfox-explain → explain-fact}/DatalogCode.d.ts +0 -0
- /package/dist/{rdfox-explain → explain-fact}/DatalogCode.js +0 -0
- /package/dist/{rdfox-explain → explain-fact}/EntityChip.d.ts +0 -0
- /package/dist/{rdfox-explain → explain-fact}/ExplainCompactView.d.ts +0 -0
- /package/dist/{rdfox-explain → explain-fact}/ExplainCompactView.js +0 -0
- /package/dist/{rdfox-explain → explain-fact}/ExplainFullView.d.ts +0 -0
- /package/dist/{rdfox-explain → explain-fact}/ExplainFullView.js +0 -0
- /package/dist/{rdfox-explain → explain-fact}/ExplainStates.d.ts +0 -0
- /package/dist/{rdfox-explain → explain-fact}/ExplainStates.js +0 -0
- /package/dist/{rdfox-explain → explain-fact}/ExplainTag.d.ts +0 -0
- /package/dist/{rdfox-explain → explain-fact}/ExplainTag.js +0 -0
- /package/dist/{rdfox-explain → explain-fact}/FactValue.d.ts +0 -0
- /package/dist/{rdfox-explain → explain-fact}/FactValue.js +0 -0
- /package/dist/{rdfox-explain → explain-fact}/NumDot.d.ts +0 -0
- /package/dist/{rdfox-explain → explain-fact}/NumDot.js +0 -0
- /package/dist/{rdfox-explain → explain-fact}/PanelLabel.d.ts +0 -0
- /package/dist/{rdfox-explain → explain-fact}/PanelLabel.js +0 -0
- /package/dist/{rdfox-explain → explain-fact}/ProofSubjectHeader.d.ts +0 -0
- /package/dist/{rdfox-explain → explain-fact}/ProofSubjectHeader.js +0 -0
- /package/dist/{rdfox-explain → explain-fact}/ProvenanceBadge.d.ts +0 -0
- /package/dist/{rdfox-explain → explain-fact}/RuleVariableTypes.d.ts +0 -0
- /package/dist/{rdfox-explain → explain-fact}/RuleVariableTypes.js +0 -0
- /package/dist/{rdfox-explain → explain-fact}/SubstitutedFactNotice.d.ts +0 -0
- /package/dist/{rdfox-explain → explain-fact}/SubstitutedFactNotice.js +0 -0
- /package/dist/{rdfox-explain → explain-fact}/ValuePill.d.ts +0 -0
- /package/dist/{rdfox-explain → explain-fact}/ValuePill.js +0 -0
- /package/dist/{rdfox-explain → explain-fact}/conclusion/ConclusionCard.d.ts +0 -0
- /package/dist/{rdfox-explain → explain-fact}/conclusion/ConclusionCard.js +0 -0
- /package/dist/{rdfox-explain → explain-fact}/conclusion/ConclusionSubtitle.d.ts +0 -0
- /package/dist/{rdfox-explain → explain-fact}/conclusion/index.d.ts +0 -0
- /package/dist/{rdfox-explain → explain-fact}/conclusion/index.js +0 -0
- /package/dist/{rdfox-explain → explain-fact}/explain-styles.d.ts +0 -0
- /package/dist/{rdfox-explain → explain-fact}/explain-styles.js +0 -0
- /package/dist/{rdfox-explain → explain-fact}/fact-token.d.ts +0 -0
- /package/dist/{rdfox-explain → explain-fact}/fact-token.js +0 -0
- /package/dist/{rdfox-explain → explain-fact}/formula-hues.d.ts +0 -0
- /package/dist/{rdfox-explain → explain-fact}/formula-hues.js +0 -0
- /package/dist/{rdfox-explain → explain-fact}/inspector/ExplainInspector.d.ts +0 -0
- /package/dist/{rdfox-explain → explain-fact}/inspector/InspectorBindings.d.ts +0 -0
- /package/dist/{rdfox-explain → explain-fact}/inspector/InspectorBindings.js +0 -0
- /package/dist/{rdfox-explain → explain-fact}/inspector/InspectorFact.d.ts +0 -0
- /package/dist/{rdfox-explain → explain-fact}/inspector/InspectorFact.js +0 -0
- /package/dist/{rdfox-explain → explain-fact}/inspector/InspectorHeader.d.ts +0 -0
- /package/dist/{rdfox-explain → explain-fact}/inspector/InspectorHeader.js +0 -0
- /package/dist/{rdfox-explain → explain-fact}/inspector/SupportsSection.d.ts +0 -0
- /package/dist/{rdfox-explain → explain-fact}/inspector/index.d.ts +0 -0
- /package/dist/{rdfox-explain → explain-fact}/inspector/index.js +0 -0
- /package/dist/{rdfox-explain → explain-fact}/proof-tree/ProofFactLabel.d.ts +0 -0
- /package/dist/{rdfox-explain → explain-fact}/proof-tree/ProofFactLabel.js +0 -0
- /package/dist/{rdfox-explain → explain-fact}/proof-tree/ProofRowBadge.d.ts +0 -0
- /package/dist/{rdfox-explain → explain-fact}/proof-tree/ProofRowBadge.js +0 -0
- /package/dist/{rdfox-explain → explain-fact}/proof-tree/ProofRowContent.d.ts +0 -0
- /package/dist/{rdfox-explain → explain-fact}/proof-tree/ProofRowContent.js +0 -0
- /package/dist/{rdfox-explain → explain-fact}/proof-tree/ProofRowValue.d.ts +0 -0
- /package/dist/{rdfox-explain → explain-fact}/proof-tree/ProofRowValue.js +0 -0
- /package/dist/{rdfox-explain → explain-fact}/proof-tree/ProofTree.d.ts +0 -0
- /package/dist/{rdfox-explain → explain-fact}/proof-tree/ProofTreeFormulaFooter.d.ts +0 -0
- /package/dist/{rdfox-explain → explain-fact}/proof-tree/ProofTreeFormulaFooter.js +0 -0
- /package/dist/{rdfox-explain → explain-fact}/proof-tree/ProofTreeNode.d.ts +0 -0
- /package/dist/{rdfox-explain → explain-fact}/proof-tree/ProofTreeNode.js +0 -0
- /package/dist/{rdfox-explain → explain-fact}/proof-tree/SupportsTag.d.ts +0 -0
- /package/dist/{rdfox-explain → explain-fact}/proof-tree/index.d.ts +0 -0
- /package/dist/{rdfox-explain → explain-fact}/proof-tree/index.js +0 -0
- /package/dist/{rdfox-explain → explain-fact}/proof-tree/proof-tree-navigation.d.ts +0 -0
- /package/dist/{rdfox-explain → explain-fact}/proof-tree/proof-tree-navigation.js +0 -0
- /package/dist/{rdfox-explain → explain-fact}/proof-tree/proof-tree-root-view.d.ts +0 -0
- /package/dist/{rdfox-explain → explain-fact}/proof-tree/proof-tree-root-view.js +0 -0
- /package/dist/{rdfox-explain → explain-fact}/proof-tree/visible-premises.d.ts +0 -0
- /package/dist/{rdfox-explain → explain-fact}/proof-tree/visible-premises.js +0 -0
- /package/dist/{rdfox-explain → explain-fact}/rule-presentation.d.ts +0 -0
- /package/dist/{rdfox-explain → explain-fact}/rule-presentation.js +0 -0
- /package/dist/{rdfox-explain → explain-fact}/use-fact-measure.d.ts +0 -0
- /package/dist/{rdfox-explain → explain-fact}/use-fact-measure.js +0 -0
|
@@ -0,0 +1,467 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
2
|
+
import { useBringDatastoreOnlineMutation, useLinkUnlinkedDatastoreMutation, useDatastoreTreeQuery, useProvisionDatastoreMutation, useRegisterDatastoreMutation, useRemoveDatastoreMutation, useRenameDatastoreGroupMutation, useRestoreDatastoreMutation, useUnlinkedDatastoresQuery, } from "@manta-eu/client";
|
|
3
|
+
import { enableDatastoreRemoval } from "@manta-eu/client/shared/constants";
|
|
4
|
+
import { deriveDatastoreId } from "@manta-eu/client/shared/datastore-id";
|
|
5
|
+
import { parseError } from "@manta-eu/client/shared/error-utils";
|
|
6
|
+
import { namesAGroup, pathSegments } from "@manta-eu/client/shared/team";
|
|
7
|
+
import { activeRealm } from "@manta-eu/ldo/realm";
|
|
8
|
+
import { isPresent } from "@manta-eu/lib/present";
|
|
9
|
+
import { useQueryClient } from "@tanstack/react-query";
|
|
10
|
+
import { Archive, Database, EyeOff, Plus, RefreshCcw, TriangleAlert } from "lucide-react";
|
|
11
|
+
import { useCallback, useEffect, useMemo, useState } from "react";
|
|
12
|
+
import { useNavigate, useSearchParams } from "react-router";
|
|
13
|
+
import { toast } from "sonner";
|
|
14
|
+
import { DatastoreFormDialog } from "./components/DatastoreFormDialog.js";
|
|
15
|
+
import { DatastoresToolbar } from "./components/DatastoresToolbar.js";
|
|
16
|
+
import { DatastoreTableSkeleton } from "./components/DatastoreTableSkeleton.js";
|
|
17
|
+
import { LinkUnlinkedDatastoreDialog } from "./components/LinkUnlinkedDatastoreDialog.js";
|
|
18
|
+
import { RenameDatastoreGroupDialog } from "./components/RenameDatastoreGroupDialog.js";
|
|
19
|
+
import { UnlinkedDatastoresPanel } from "./components/UnlinkedDatastoresPanel.js";
|
|
20
|
+
import { existingOrganizationNameKeys, hiddenRowCount, organizationNameKey, organizationNames, realmDefaultRow, toDatastoreRows, unlinkedDatastoreRow, visibilityForStatusFilter, visibleDatastoreRows, } from "./flatten.js";
|
|
21
|
+
import { datastoreColumnIds, unlinkedColumnLabels, unlinkedColumnOrder, useDatastoreColumns, } from "./hooks/useDatastoreColumns.js";
|
|
22
|
+
import { useDatastoreTable } from "./hooks/useDatastoreTable.js";
|
|
23
|
+
import { Button } from "#components/button/index";
|
|
24
|
+
import { collectDatastoreIds } from "#components/datastore-management/tree";
|
|
25
|
+
import { useDatastoreStatusByDatastoreId } from "#components/datastore-management/use-datastore-status";
|
|
26
|
+
import { EmptyState } from "#components/empty-state/index";
|
|
27
|
+
import { DeleteConfirmationDialog } from "#components/layouts/DeleteConfirmationDialog";
|
|
28
|
+
import { PageHeader } from "#components/layouts/page/index";
|
|
29
|
+
import { RouteLayout } from "#components/layouts/RouteLayout";
|
|
30
|
+
import { ScopeTabs } from "#components/scope-tabs/index";
|
|
31
|
+
import { DataTable } from "#components/table/index";
|
|
32
|
+
import { TablePagination } from "#components/table-pagination/index";
|
|
33
|
+
import { Tabs, TabsContent } from "#components/tabs/index";
|
|
34
|
+
import { Tooltip, TooltipContent, TooltipTrigger } from "#components/tooltip/index";
|
|
35
|
+
import { useDatastoreSelection } from "#hooks/useDatastoreSelection";
|
|
36
|
+
import { useAuthContext } from "#providers/AuthContext";
|
|
37
|
+
import { useMantaClient } from "#providers/index";
|
|
38
|
+
const realmDatastoreId = activeRealm();
|
|
39
|
+
const tabLabels = {
|
|
40
|
+
organizations: "Organizations",
|
|
41
|
+
unlinked: "Unlinked",
|
|
42
|
+
};
|
|
43
|
+
const activeTabs = ["organizations", "unlinked"];
|
|
44
|
+
export function DatastoresRoute() {
|
|
45
|
+
const { datastore, datastores, user, logout, isOperator, canSwitchDatastore } = useAuthContext();
|
|
46
|
+
const { mantaClient } = useMantaClient();
|
|
47
|
+
const queryClient = useQueryClient();
|
|
48
|
+
const navigate = useNavigate();
|
|
49
|
+
const { setSelectedDatastore, isSwitching } = useDatastoreSelection({ canSwitchDatastore });
|
|
50
|
+
// A search keeps hierarchy order, so only an explicit sort drops the Name indent.
|
|
51
|
+
const [sorting, setSorting] = useState([]);
|
|
52
|
+
const [unlinkedSorting, setUnlinkedSorting] = useState([]);
|
|
53
|
+
const indented = !isPresent(sorting);
|
|
54
|
+
const [formTarget, setFormTarget] = useState(null);
|
|
55
|
+
const [pendingRemoval, setPendingRemoval] = useState(null);
|
|
56
|
+
const [renameTarget, setRenameTarget] = useState(null);
|
|
57
|
+
const [linkDialogTarget, setLinkDialogTarget] = useState(null);
|
|
58
|
+
const [visibility, setVisibility] = useState({
|
|
59
|
+
showArchived: false,
|
|
60
|
+
showUnprovisioned: false,
|
|
61
|
+
});
|
|
62
|
+
const { showArchived, showUnprovisioned } = visibility;
|
|
63
|
+
const [searchParams, setSearchParams] = useSearchParams();
|
|
64
|
+
const tabParam = searchParams.get("tab");
|
|
65
|
+
const activeTab = tabParam && activeTabs.includes(tabParam) ? tabParam : "organizations";
|
|
66
|
+
useEffect(() => {
|
|
67
|
+
if (tabParam !== activeTab)
|
|
68
|
+
setSearchParams({ tab: activeTab }, { replace: true });
|
|
69
|
+
}, [tabParam, activeTab, setSearchParams]);
|
|
70
|
+
const toggleVisibility = useCallback((key) => {
|
|
71
|
+
setVisibility((current) => ({ ...current, [key]: !current[key] }));
|
|
72
|
+
}, []);
|
|
73
|
+
const { data, isLoading, isFetching, refetch } = useDatastoreTreeQuery(mantaClient, undefined, {
|
|
74
|
+
enabled: !!isOperator,
|
|
75
|
+
});
|
|
76
|
+
const { data: unlinkedData, error: unlinkedError, isLoading: isUnlinkedLoading, } = useUnlinkedDatastoresQuery(mantaClient, undefined, {
|
|
77
|
+
enabled: !!isOperator,
|
|
78
|
+
staleTime: Infinity,
|
|
79
|
+
refetchOnWindowFocus: false,
|
|
80
|
+
retry: false,
|
|
81
|
+
});
|
|
82
|
+
function invalidateTree() {
|
|
83
|
+
void queryClient.invalidateQueries({ queryKey: useDatastoreTreeQuery.getKey() });
|
|
84
|
+
}
|
|
85
|
+
const handleRefresh = useCallback(() => {
|
|
86
|
+
void refetch();
|
|
87
|
+
void queryClient.refetchQueries({ queryKey: ["DatastoreProvisioningStatuses"] });
|
|
88
|
+
void queryClient.refetchQueries({ queryKey: useUnlinkedDatastoresQuery.getKey() });
|
|
89
|
+
}, [refetch, queryClient]);
|
|
90
|
+
const provisionMutation = useProvisionDatastoreMutation(mantaClient, {
|
|
91
|
+
onSuccess: (result) => {
|
|
92
|
+
invalidateTree();
|
|
93
|
+
const { success, name, error, pending } = result.provisionDatastore;
|
|
94
|
+
if (!success) {
|
|
95
|
+
toast.error("Couldn't create the datastore", { description: error ?? undefined });
|
|
96
|
+
return;
|
|
97
|
+
}
|
|
98
|
+
// The datastore is usually ready by the time this returns, so read its status now rather
|
|
99
|
+
// than leaving the row stale until the next poll.
|
|
100
|
+
void queryClient.refetchQueries({ queryKey: ["DatastoreProvisioningStatuses"] });
|
|
101
|
+
// pending means only that its Dagster run outlived the wait.
|
|
102
|
+
if (pending) {
|
|
103
|
+
toast.success(`Datastore "${name}" is being created`, {
|
|
104
|
+
description: "It is taking longer than usual, and becomes available once its knowledge graph is built.",
|
|
105
|
+
});
|
|
106
|
+
}
|
|
107
|
+
else {
|
|
108
|
+
toast.success(`Datastore "${name}" is ready`);
|
|
109
|
+
}
|
|
110
|
+
},
|
|
111
|
+
onError: (error) => {
|
|
112
|
+
const info = parseError(error, "Couldn't create the datastore");
|
|
113
|
+
toast.error(info.message, { description: info.description });
|
|
114
|
+
},
|
|
115
|
+
});
|
|
116
|
+
const removeMutation = useRemoveDatastoreMutation(mantaClient, {
|
|
117
|
+
onSuccess: (result) => {
|
|
118
|
+
invalidateTree();
|
|
119
|
+
if (result.removeDatastore.success)
|
|
120
|
+
toast.success("Datastore removed");
|
|
121
|
+
else
|
|
122
|
+
toast.error("Couldn't remove the datastore", { description: result.removeDatastore.error ?? undefined });
|
|
123
|
+
},
|
|
124
|
+
onError: (error) => {
|
|
125
|
+
const info = parseError(error, "Couldn't remove the datastore");
|
|
126
|
+
toast.error(info.message, { description: info.description });
|
|
127
|
+
},
|
|
128
|
+
});
|
|
129
|
+
const restoreMutation = useRestoreDatastoreMutation(mantaClient, {
|
|
130
|
+
onSuccess: (result) => {
|
|
131
|
+
invalidateTree();
|
|
132
|
+
if (result.restoreDatastore.success)
|
|
133
|
+
toast.success("Datastore restored");
|
|
134
|
+
else
|
|
135
|
+
toast.error("Couldn't restore the datastore", { description: result.restoreDatastore.error ?? undefined });
|
|
136
|
+
},
|
|
137
|
+
onError: (error) => {
|
|
138
|
+
const info = parseError(error, "Couldn't restore the datastore");
|
|
139
|
+
toast.error(info.message, { description: info.description });
|
|
140
|
+
},
|
|
141
|
+
});
|
|
142
|
+
const registerMutation = useRegisterDatastoreMutation(mantaClient, {
|
|
143
|
+
onSuccess: (result) => {
|
|
144
|
+
// "Not registered" is treated as settled, so status polling stopped - force a re-check.
|
|
145
|
+
void queryClient.invalidateQueries({ queryKey: ["DatastoreProvisioningStatuses"] });
|
|
146
|
+
if (result.registerDatastore.success)
|
|
147
|
+
toast.success("Datastore registered");
|
|
148
|
+
else
|
|
149
|
+
toast.error("Couldn't register the datastore", { description: result.registerDatastore.error ?? undefined });
|
|
150
|
+
},
|
|
151
|
+
onError: (error) => {
|
|
152
|
+
const info = parseError(error, "Couldn't register the datastore");
|
|
153
|
+
toast.error(info.message, { description: info.description });
|
|
154
|
+
},
|
|
155
|
+
});
|
|
156
|
+
const renameMutation = useRenameDatastoreGroupMutation(mantaClient, {
|
|
157
|
+
onSuccess: (result) => {
|
|
158
|
+
invalidateTree();
|
|
159
|
+
if (result.renameDatastoreGroup.success)
|
|
160
|
+
toast.success("Renamed");
|
|
161
|
+
else
|
|
162
|
+
toast.error("Couldn't rename", { description: result.renameDatastoreGroup.error ?? undefined });
|
|
163
|
+
},
|
|
164
|
+
onError: (error) => {
|
|
165
|
+
const info = parseError(error, "Couldn't rename");
|
|
166
|
+
toast.error(info.message, { description: info.description });
|
|
167
|
+
},
|
|
168
|
+
});
|
|
169
|
+
const bringOnlineMutation = useBringDatastoreOnlineMutation(mantaClient, {
|
|
170
|
+
onSuccess: (result, variables) => {
|
|
171
|
+
void queryClient.refetchQueries({ queryKey: ["DatastoreProvisioningStatuses"] });
|
|
172
|
+
if (!result.bringDatastoreOnline.success) {
|
|
173
|
+
toast.error("Couldn't bring the datastore online", {
|
|
174
|
+
description: result.bringDatastoreOnline.error ?? undefined,
|
|
175
|
+
});
|
|
176
|
+
return;
|
|
177
|
+
}
|
|
178
|
+
const requested = variables.datastoreId;
|
|
179
|
+
if (!isPresent(requested))
|
|
180
|
+
return;
|
|
181
|
+
toast.success(`Datastore "${requested}" brought online`);
|
|
182
|
+
},
|
|
183
|
+
onError: (error) => {
|
|
184
|
+
const info = parseError(error, "Couldn't bring the datastore online");
|
|
185
|
+
toast.error(info.message, { description: info.description });
|
|
186
|
+
},
|
|
187
|
+
});
|
|
188
|
+
const treeRows = useMemo(() => [
|
|
189
|
+
...(realmDatastoreId ? [realmDefaultRow(realmDatastoreId)] : []),
|
|
190
|
+
...toDatastoreRows(data?.datastoreTree ?? []),
|
|
191
|
+
], [data]);
|
|
192
|
+
const unlinkedRows = useMemo(() => (unlinkedData?.unlinkedDatastores ?? []).map((entry) => unlinkedDatastoreRow(entry.id)), [unlinkedData]);
|
|
193
|
+
const allRows = useMemo(() => [...treeRows, ...unlinkedRows], [treeRows, unlinkedRows]);
|
|
194
|
+
const rows = useMemo(() => visibleDatastoreRows(treeRows, visibility), [treeRows, visibility]);
|
|
195
|
+
const unprovisionedCount = useMemo(() => hiddenRowCount(treeRows, visibility, "showUnprovisioned", rows.length), [treeRows, visibility, rows.length]);
|
|
196
|
+
const unlinkedCount = unlinkedRows.length;
|
|
197
|
+
const existingOrganizationNames = useMemo(() => existingOrganizationNameKeys(allRows), [allRows]);
|
|
198
|
+
const organizationNameOptions = useMemo(() => organizationNames(allRows), [allRows]);
|
|
199
|
+
// Mirrors provisionDatastore's assertDatastoreIdAvailable (Infisical folder-per-id is global,
|
|
200
|
+
// not scoped to siblings), so a slug collision is caught before the server round-trip.
|
|
201
|
+
const existingDatastoreIds = useMemo(() => new Set(treeRows.flatMap((row) => (isPresent(row.datastoreId) ? [row.datastoreId] : []))), [treeRows]);
|
|
202
|
+
const statusByDatastoreId = useDatastoreStatusByDatastoreId(collectDatastoreIds([...rows, ...unlinkedRows]), !!isOperator);
|
|
203
|
+
const derivedIdForRow = useCallback((row) => deriveDatastoreId(row.organizationName, row.isOrganization ? [] : pathSegments(row.path)), []);
|
|
204
|
+
const unlinkedIdSet = useMemo(() => new Set((unlinkedData?.unlinkedDatastores ?? []).map((entry) => entry.id)), [unlinkedData]);
|
|
205
|
+
const suggestedMatchByDatastoreId = useMemo(() => {
|
|
206
|
+
const matches = {};
|
|
207
|
+
for (const row of treeRows) {
|
|
208
|
+
if (isPresent(row.datastoreId))
|
|
209
|
+
continue;
|
|
210
|
+
const derived = derivedIdForRow(row);
|
|
211
|
+
if (unlinkedIdSet.has(derived))
|
|
212
|
+
matches[derived] ??= row;
|
|
213
|
+
}
|
|
214
|
+
return matches;
|
|
215
|
+
}, [treeRows, unlinkedIdSet, derivedIdForRow]);
|
|
216
|
+
const suggestedLinkTarget = useCallback((datastoreId) => {
|
|
217
|
+
const match = suggestedMatchByDatastoreId[datastoreId];
|
|
218
|
+
if (!match)
|
|
219
|
+
return undefined;
|
|
220
|
+
// An org-root match links with a blank name; the dialog reads that as atOrganizationRoot.
|
|
221
|
+
if (match.isOrganization) {
|
|
222
|
+
return { organizationName: match.organizationName, parentPath: [], name: "" };
|
|
223
|
+
}
|
|
224
|
+
const segments = pathSegments(match.path);
|
|
225
|
+
return {
|
|
226
|
+
organizationName: match.organizationName,
|
|
227
|
+
parentPath: segments.slice(0, -1),
|
|
228
|
+
name: match.name,
|
|
229
|
+
};
|
|
230
|
+
}, [suggestedMatchByDatastoreId]);
|
|
231
|
+
const matchableRowIds = useMemo(() => {
|
|
232
|
+
const ids = new Set();
|
|
233
|
+
for (const row of allRows) {
|
|
234
|
+
if (!isPresent(row.datastoreId) && unlinkedIdSet.has(derivedIdForRow(row)))
|
|
235
|
+
ids.add(row.id);
|
|
236
|
+
}
|
|
237
|
+
return ids;
|
|
238
|
+
}, [allRows, unlinkedIdSet, derivedIdForRow]);
|
|
239
|
+
// Adopting an existing group as a datastore needs no form - the name and parent are already known.
|
|
240
|
+
const provisionExisting = useCallback((row) => {
|
|
241
|
+
provisionMutation.mutate({
|
|
242
|
+
input: {
|
|
243
|
+
organizationName: row.organizationName,
|
|
244
|
+
parentPath: row.isOrganization ? [] : pathSegments(row.path).slice(0, -1),
|
|
245
|
+
name: row.isOrganization ? row.organizationName : row.name,
|
|
246
|
+
atOrganizationRoot: row.isOrganization,
|
|
247
|
+
},
|
|
248
|
+
});
|
|
249
|
+
}, [provisionMutation.mutate]);
|
|
250
|
+
const linkExistingMutation = useLinkUnlinkedDatastoreMutation(mantaClient, {
|
|
251
|
+
onSuccess: (result) => {
|
|
252
|
+
invalidateTree();
|
|
253
|
+
void queryClient.invalidateQueries({ queryKey: useUnlinkedDatastoresQuery.getKey() });
|
|
254
|
+
void queryClient.invalidateQueries({ queryKey: ["DatastoreProvisioningStatuses"] });
|
|
255
|
+
if (result.linkUnlinkedDatastore.success) {
|
|
256
|
+
toast.success(`Linked to the existing datastore "${result.linkUnlinkedDatastore.datastoreId}"`);
|
|
257
|
+
}
|
|
258
|
+
else {
|
|
259
|
+
toast.error("Couldn't link the existing datastore", {
|
|
260
|
+
description: result.linkUnlinkedDatastore.error ?? undefined,
|
|
261
|
+
});
|
|
262
|
+
}
|
|
263
|
+
},
|
|
264
|
+
onError: (error) => {
|
|
265
|
+
const info = parseError(error, "Couldn't link the existing datastore");
|
|
266
|
+
toast.error(info.message, { description: info.description });
|
|
267
|
+
},
|
|
268
|
+
});
|
|
269
|
+
const onLinkExisting = useCallback((row) => {
|
|
270
|
+
linkExistingMutation.mutate({
|
|
271
|
+
input: {
|
|
272
|
+
datastoreId: derivedIdForRow(row),
|
|
273
|
+
organizationName: row.organizationName,
|
|
274
|
+
parentPath: row.isOrganization ? [] : pathSegments(row.path).slice(0, -1),
|
|
275
|
+
name: row.isOrganization ? row.organizationName : row.name,
|
|
276
|
+
atOrganizationRoot: row.isOrganization,
|
|
277
|
+
},
|
|
278
|
+
});
|
|
279
|
+
}, [linkExistingMutation.mutate, derivedIdForRow]);
|
|
280
|
+
const onSelect = useCallback((row) => {
|
|
281
|
+
if (isPresent(row.datastoreId))
|
|
282
|
+
void setSelectedDatastore(row.datastoreId, row.isOrganization ? "organization" : "datastore");
|
|
283
|
+
}, [setSelectedDatastore]);
|
|
284
|
+
const onAddChild = useCallback((row) => setFormTarget({
|
|
285
|
+
kind: "datastore",
|
|
286
|
+
parentPath: row.path,
|
|
287
|
+
parentName: row.name,
|
|
288
|
+
organizationName: row.organizationName,
|
|
289
|
+
}), []);
|
|
290
|
+
const onLink = useCallback((row) => {
|
|
291
|
+
if (isPresent(row.datastoreId))
|
|
292
|
+
setLinkDialogTarget(row.datastoreId);
|
|
293
|
+
}, []);
|
|
294
|
+
const onRestore = useCallback((row) => {
|
|
295
|
+
if (isPresent(row.datastoreId))
|
|
296
|
+
restoreMutation.mutate({ datastoreId: row.datastoreId });
|
|
297
|
+
}, [restoreMutation.mutate]);
|
|
298
|
+
const onRegister = useCallback((row) => {
|
|
299
|
+
if (isPresent(row.datastoreId))
|
|
300
|
+
registerMutation.mutate({ datastoreId: row.datastoreId });
|
|
301
|
+
}, [registerMutation.mutate]);
|
|
302
|
+
const onManageUsers = useCallback((row) => {
|
|
303
|
+
const query = new URLSearchParams({ org: row.organizationAlias });
|
|
304
|
+
if (namesAGroup(row.path))
|
|
305
|
+
query.set("group", row.path);
|
|
306
|
+
if (isPresent(row.organizationName))
|
|
307
|
+
query.set("name", row.organizationName);
|
|
308
|
+
void navigate(`/team?${query.toString()}`);
|
|
309
|
+
}, [navigate]);
|
|
310
|
+
const onBringOnline = useCallback((row) => {
|
|
311
|
+
if (isPresent(row.datastoreId))
|
|
312
|
+
bringOnlineMutation.mutate({ datastoreId: row.datastoreId });
|
|
313
|
+
}, [bringOnlineMutation.mutate]);
|
|
314
|
+
const columns = useDatastoreColumns({
|
|
315
|
+
statusByDatastoreId,
|
|
316
|
+
currentDatastoreId: datastore?.id ?? realmDatastoreId,
|
|
317
|
+
isSwitching,
|
|
318
|
+
indented,
|
|
319
|
+
matchableRowIds,
|
|
320
|
+
suggestedMatchByDatastoreId,
|
|
321
|
+
onSelect,
|
|
322
|
+
onAddChild,
|
|
323
|
+
onLink,
|
|
324
|
+
onProvision: provisionExisting,
|
|
325
|
+
onLinkExisting,
|
|
326
|
+
onRemove: setPendingRemoval,
|
|
327
|
+
onRestore,
|
|
328
|
+
onRename: setRenameTarget,
|
|
329
|
+
onRegister,
|
|
330
|
+
onManageUsers,
|
|
331
|
+
onBringOnline,
|
|
332
|
+
isBringingOnline: bringOnlineMutation.isPending,
|
|
333
|
+
});
|
|
334
|
+
const filterToggles = [
|
|
335
|
+
...(enableDatastoreRemoval
|
|
336
|
+
? [
|
|
337
|
+
{
|
|
338
|
+
key: "archived",
|
|
339
|
+
label: showArchived ? "Hide archived" : "Show archived",
|
|
340
|
+
description: "Datastores that were removed; nothing is deleted, so they can be restored.",
|
|
341
|
+
icon: showArchived ? EyeOff : Archive,
|
|
342
|
+
active: showArchived,
|
|
343
|
+
onToggle: () => toggleVisibility("showArchived"),
|
|
344
|
+
},
|
|
345
|
+
]
|
|
346
|
+
: []),
|
|
347
|
+
...(showUnprovisioned || unprovisionedCount > 0
|
|
348
|
+
? [
|
|
349
|
+
{
|
|
350
|
+
key: "unprovisioned",
|
|
351
|
+
label: showUnprovisioned ? "Hide unprovisioned" : `Show unprovisioned (${unprovisionedCount})`,
|
|
352
|
+
description: "Organizations and groups that haven't had a datastore set up yet.",
|
|
353
|
+
icon: showUnprovisioned ? EyeOff : TriangleAlert,
|
|
354
|
+
active: showUnprovisioned,
|
|
355
|
+
onToggle: () => toggleVisibility("showUnprovisioned"),
|
|
356
|
+
},
|
|
357
|
+
]
|
|
358
|
+
: []),
|
|
359
|
+
];
|
|
360
|
+
const treeColumns = useMemo(() => columns.filter((column) => column.id !== datastoreColumnIds.suggestedMatch), [columns]);
|
|
361
|
+
const { table, searchQuery, onSearchQueryChange, statusFilter, onStatusFilterChange } = useDatastoreTable("datastores", rows, treeColumns, sorting, setSorting);
|
|
362
|
+
const unlinkedColumns = useMemo(() => unlinkedColumnOrder.flatMap((id) => columns.filter((column) => column.id === id)), [columns]);
|
|
363
|
+
const { table: unlinkedTable, searchQuery: unlinkedSearchQuery, onSearchQueryChange: onUnlinkedSearchQueryChange, statusFilter: unlinkedStatusFilter, onStatusFilterChange: onUnlinkedStatusFilterChange, } = useDatastoreTable("datastores-unlinked", unlinkedRows, unlinkedColumns, unlinkedSorting, setUnlinkedSorting);
|
|
364
|
+
const scopeTabs = activeTabs.map((tab) => ({
|
|
365
|
+
value: tab,
|
|
366
|
+
label: tabLabels[tab],
|
|
367
|
+
...(tab === "unlinked" && !isUnlinkedLoading ? { count: unlinkedCount } : {}),
|
|
368
|
+
}));
|
|
369
|
+
const tabsList = _jsx(ScopeTabs, { tabs: scopeTabs, activeValue: activeTab, isLoading: isLoading });
|
|
370
|
+
const handleStatusFilterChange = useCallback((status) => {
|
|
371
|
+
setVisibility((current) => visibilityForStatusFilter(current, status));
|
|
372
|
+
onStatusFilterChange(status);
|
|
373
|
+
}, [onStatusFilterChange]);
|
|
374
|
+
// A group at the same level with the same exact name already has a datastore - mirrors
|
|
375
|
+
// ensureOrgGroupPath's exact-match lookup, which would otherwise adopt or collide with it server-side.
|
|
376
|
+
function siblingDatastoreCollision(organizationName, parentPath, name) {
|
|
377
|
+
const parentSegments = pathSegments(parentPath);
|
|
378
|
+
return allRows.some((row) => {
|
|
379
|
+
const segments = pathSegments(row.path);
|
|
380
|
+
return (row.organizationName === organizationName &&
|
|
381
|
+
isPresent(row.datastoreId) &&
|
|
382
|
+
!row.removed &&
|
|
383
|
+
row.name === name &&
|
|
384
|
+
segments.length === parentSegments.length + 1 &&
|
|
385
|
+
parentSegments.every((segment, i) => segments[i] === segment));
|
|
386
|
+
});
|
|
387
|
+
}
|
|
388
|
+
function submitForm(values) {
|
|
389
|
+
if (!formTarget)
|
|
390
|
+
return;
|
|
391
|
+
const name = values.name.trim();
|
|
392
|
+
if (formTarget.kind === "organization") {
|
|
393
|
+
if (existingOrganizationNames.has(organizationNameKey(name))) {
|
|
394
|
+
toast.error(`An organization named "${name}" already exists`, {
|
|
395
|
+
description: "Choose a different name, or add a datastore under the existing organization instead.",
|
|
396
|
+
});
|
|
397
|
+
return;
|
|
398
|
+
}
|
|
399
|
+
const derived = deriveDatastoreId(name, []);
|
|
400
|
+
if (unlinkedIdSet.has(derived)) {
|
|
401
|
+
toast.error(`"${name}" resolves to '${derived}', which already exists but isn't linked`, {
|
|
402
|
+
description: "Link it from the Unlinked tab instead of creating a new one.",
|
|
403
|
+
});
|
|
404
|
+
return;
|
|
405
|
+
}
|
|
406
|
+
if (existingDatastoreIds.has(derived)) {
|
|
407
|
+
toast.error(`"${name}" resolves to a datastore id that's already in use`, {
|
|
408
|
+
description: "Choose a name that doesn't collide with an existing organization or datastore.",
|
|
409
|
+
});
|
|
410
|
+
return;
|
|
411
|
+
}
|
|
412
|
+
}
|
|
413
|
+
else {
|
|
414
|
+
if (siblingDatastoreCollision(formTarget.organizationName, formTarget.parentPath, name)) {
|
|
415
|
+
toast.error(`"${name}" already exists under ${formTarget.parentName}`, {
|
|
416
|
+
description: "Choose a different name, or select the existing datastore instead.",
|
|
417
|
+
});
|
|
418
|
+
return;
|
|
419
|
+
}
|
|
420
|
+
const datastoreId = deriveDatastoreId(formTarget.organizationName, [
|
|
421
|
+
...pathSegments(formTarget.parentPath),
|
|
422
|
+
name,
|
|
423
|
+
]);
|
|
424
|
+
if (unlinkedIdSet.has(datastoreId)) {
|
|
425
|
+
toast.error(`"${name}" resolves to '${datastoreId}', which already exists but isn't linked`, {
|
|
426
|
+
description: "Link it from the Unlinked tab instead of creating a new one.",
|
|
427
|
+
});
|
|
428
|
+
return;
|
|
429
|
+
}
|
|
430
|
+
if (existingDatastoreIds.has(datastoreId)) {
|
|
431
|
+
toast.error(`"${name}" resolves to a datastore id that's already in use`, {
|
|
432
|
+
description: "Choose a different name to avoid colliding with another datastore.",
|
|
433
|
+
});
|
|
434
|
+
return;
|
|
435
|
+
}
|
|
436
|
+
}
|
|
437
|
+
const input = formTarget.kind === "organization"
|
|
438
|
+
? { organizationName: name, atOrganizationRoot: true, name }
|
|
439
|
+
: {
|
|
440
|
+
organizationName: formTarget.organizationName,
|
|
441
|
+
parentPath: pathSegments(formTarget.parentPath),
|
|
442
|
+
name,
|
|
443
|
+
atOrganizationRoot: false,
|
|
444
|
+
};
|
|
445
|
+
provisionMutation.mutate({ input });
|
|
446
|
+
setFormTarget(null);
|
|
447
|
+
}
|
|
448
|
+
return (_jsxs(RouteLayout, { user: user, datastore: datastore, datastores: datastores, isOperator: isOperator, canSwitchDatastore: canSwitchDatastore, logout: logout, children: [_jsx(PageHeader, { title: "Datastores", icon: Database, actions: _jsxs(_Fragment, { children: [_jsx(Button, { iconOnly: true, variant: "tertiary", onClick: handleRefresh, disabled: isFetching, icon: RefreshCcw, "aria-label": "Refresh datastores" }), activeTab === "organizations" && (_jsxs(_Fragment, { children: [filterToggles.map((toggle) => (_jsxs(Tooltip, { children: [_jsx(TooltipTrigger, { asChild: true, children: _jsx(Button, { variant: "secondary", "aria-pressed": toggle.active, onClick: toggle.onToggle, icon: toggle.icon, children: toggle.label }) }), _jsx(TooltipContent, { children: toggle.description })] }, toggle.key))), _jsx(Button, { icon: Plus, onClick: () => setFormTarget({ kind: "organization" }), children: "Add organization" })] }))] }) }), _jsxs(Tabs, { value: activeTab, onValueChange: (tab) => setSearchParams({ tab }, { replace: true }), className: "flex flex-col flex-1 min-h-0 overflow-hidden", children: [_jsxs(TabsContent, { value: "organizations", className: "flex flex-col flex-1 min-h-0 overflow-hidden", children: [_jsx("div", { className: "border-b border-muted-border px-5 py-3 shrink-0", children: _jsx(DatastoresToolbar, { tabs: tabsList, searchQuery: searchQuery, onSearchQueryChange: onSearchQueryChange, statusFilter: statusFilter, onStatusFilterChange: handleStatusFilterChange, table: table }) }), _jsxs("div", { className: "flex-1 overflow-auto p-4", children: [isLoading && _jsx(DatastoreTableSkeleton, {}), !isLoading && !isPresent(rows) && (_jsx(EmptyState, { icon: Database, title: "No organizations yet", description: "Provision an organization to give it its first datastore.", children: _jsx(Button, { icon: Plus, onClick: () => setFormTarget({ kind: "organization" }), children: "Add organization" }) })), !isLoading && isPresent(rows) && (_jsxs("div", { className: "flex flex-col gap-3", children: [_jsx("div", { className: "rounded-xl border border-muted-border bg-card overflow-hidden", children: _jsx(DataTable, { table: table, noResultsMessage: "No datastores match your filters." }) }), _jsx(TablePagination, { table: table, total: rows.length })] }))] })] }), _jsx(TabsContent, { value: "unlinked", className: "flex flex-col flex-1 min-h-0 overflow-hidden", children: _jsx(UnlinkedDatastoresPanel, { tabs: tabsList, table: unlinkedTable, rows: unlinkedRows, searchQuery: unlinkedSearchQuery, onSearchQueryChange: onUnlinkedSearchQueryChange, statusFilter: unlinkedStatusFilter, onStatusFilterChange: onUnlinkedStatusFilterChange, columnLabels: unlinkedColumnLabels, columnDefaultOrder: unlinkedColumnOrder, isLoading: isUnlinkedLoading, errorMessage: unlinkedError != null
|
|
449
|
+
? (parseError(unlinkedError, "Couldn't list unlinked datastores").description ??
|
|
450
|
+
"Couldn't list unlinked datastores")
|
|
451
|
+
: null }) })] }), formTarget && (_jsx(DatastoreFormDialog, { target: formTarget, onSubmit: submitForm, onCancel: () => setFormTarget(null) })), linkDialogTarget && (_jsx(LinkUnlinkedDatastoreDialog, { datastoreId: linkDialogTarget, suggestedMatch: suggestedLinkTarget(linkDialogTarget), organizationNames: organizationNameOptions, existingOrganizationNames: existingOrganizationNames, onClose: () => setLinkDialogTarget(null) })), renameTarget && (_jsx(RenameDatastoreGroupDialog, { target: renameTarget, onSubmit: (name) => {
|
|
452
|
+
renameMutation.mutate({
|
|
453
|
+
input: {
|
|
454
|
+
id: renameTarget.id,
|
|
455
|
+
organizationId: renameTarget.organizationId,
|
|
456
|
+
isOrganization: renameTarget.isOrganization,
|
|
457
|
+
name,
|
|
458
|
+
},
|
|
459
|
+
});
|
|
460
|
+
setRenameTarget(null);
|
|
461
|
+
}, onCancel: () => setRenameTarget(null) })), pendingRemoval && isPresent(pendingRemoval.datastoreId) && (_jsx(DeleteConfirmationDialog, { title: "Remove datastore", description: `Remove "${pendingRemoval.name}"? Its knowledge graph is taken offline and it stops appearing here. Nothing is deleted - Infisical integrations are untouched - so it can be restored later.`, confirmLabel: "Remove", confirmingLabel: "Removing...", open: true, onOpenChange: (nextOpen) => !nextOpen && setPendingRemoval(null), onConfirm: () => {
|
|
462
|
+
if (isPresent(pendingRemoval.datastoreId)) {
|
|
463
|
+
removeMutation.mutate({ datastoreId: pendingRemoval.datastoreId });
|
|
464
|
+
}
|
|
465
|
+
setPendingRemoval(null);
|
|
466
|
+
}, onCancel: () => setPendingRemoval(null) }))] }));
|
|
467
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ExplainEmpty.d.ts","sourceRoot":"","sources":["../../../src/routes/explain/ExplainEmpty.tsx"],"names":[],"mappings":"AAKA,wBAAgB,YAAY,4CAkB3B"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { FileQuestion } from "lucide-react";
|
|
3
|
+
import { Link } from "react-router";
|
|
4
|
+
import { Button } from "#components/button/index";
|
|
5
|
+
import { EmptyState } from "#components/empty-state/index";
|
|
6
|
+
export function ExplainEmpty() {
|
|
7
|
+
return (_jsx(EmptyState, { icon: FileQuestion, title: "Choose a fact to explain", description: "Open this view from a chat explanation or a rule sample fact so the URL includes a subject and object.", className: "h-full max-w-lg", children: _jsxs("div", { className: "flex items-center gap-2 mt-4", children: [_jsx(Button, { asChild: true, variant: "secondary", children: _jsx(Link, { to: "/", children: "Back to chat" }) }), _jsx(Button, { asChild: true, variant: "tertiary", children: _jsx(Link, { to: "/rules", children: "View rules" }) })] }) }));
|
|
8
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/routes/explain/index.tsx"],"names":[],"mappings":"AAUA,wBAAgB,YAAY,4CAyB3B"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { Network } from "lucide-react";
|
|
3
|
+
import { useMemo } from "react";
|
|
4
|
+
import { useSearchParams } from "react-router";
|
|
5
|
+
import { ExplainEmpty } from "./ExplainEmpty.js";
|
|
6
|
+
import { parseExplainUrlParams } from "./url-params.js";
|
|
7
|
+
import { ExplainFact } from "#components/explain-fact/ExplainFact";
|
|
8
|
+
import { PageHeader } from "#components/layouts/page/index";
|
|
9
|
+
import { RouteLayout } from "#components/layouts/RouteLayout";
|
|
10
|
+
import { useAuthContext } from "#providers/AuthContext";
|
|
11
|
+
export function ExplainRoute() {
|
|
12
|
+
const { datastore, datastores, user, logout, isOperator, canSwitchDatastore } = useAuthContext();
|
|
13
|
+
const [searchParams] = useSearchParams();
|
|
14
|
+
const params = useMemo(() => parseExplainUrlParams(searchParams), [searchParams]);
|
|
15
|
+
return (_jsxs(RouteLayout, { user: user, datastore: datastore, datastores: datastores, isOperator: isOperator, canSwitchDatastore: canSwitchDatastore, logout: logout, children: [_jsx(PageHeader, { title: "Explain", icon: Network }), _jsx("div", { className: "min-h-0 flex-1 p-4", children: params ? (_jsx(ExplainFact, { mode: "full", ...params, className: "h-full rounded-md border border-muted-border bg-card/30" })) : (_jsx(ExplainEmpty, {})) })] }));
|
|
16
|
+
}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
export type ExplainRouteParams = {
|
|
2
|
+
subject: string;
|
|
3
|
+
predicate?: string;
|
|
4
|
+
object: string;
|
|
5
|
+
namedGraph?: string;
|
|
6
|
+
objectDatatype?: string;
|
|
7
|
+
};
|
|
8
|
+
export declare function parseExplainUrlParams(params: URLSearchParams): ExplainRouteParams | null;
|
|
9
|
+
//# sourceMappingURL=url-params.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"url-params.d.ts","sourceRoot":"","sources":["../../../src/routes/explain/url-params.ts"],"names":[],"mappings":"AAEA,MAAM,MAAM,kBAAkB,GAAG;IAC/B,OAAO,EAAE,MAAM,CAAC;IAChB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,MAAM,EAAE,MAAM,CAAC;IACf,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,cAAc,CAAC,EAAE,MAAM,CAAC;CACzB,CAAC;AAQF,wBAAgB,qBAAqB,CAAC,MAAM,EAAE,eAAe,GAAG,kBAAkB,GAAG,IAAI,CAiBxF"}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { isPresent } from "@manta-eu/lib/present";
|
|
2
|
+
function stringParam(params, key) {
|
|
3
|
+
const value = params.get(key)?.trim();
|
|
4
|
+
return isPresent(value) ? value : undefined;
|
|
5
|
+
}
|
|
6
|
+
export function parseExplainUrlParams(params) {
|
|
7
|
+
const subject = stringParam(params, "subject");
|
|
8
|
+
const object = stringParam(params, "object");
|
|
9
|
+
if (!subject || !object)
|
|
10
|
+
return null;
|
|
11
|
+
const predicate = stringParam(params, "predicate");
|
|
12
|
+
const namedGraph = stringParam(params, "namedGraph");
|
|
13
|
+
const objectDatatype = stringParam(params, "objectDatatype");
|
|
14
|
+
return {
|
|
15
|
+
subject,
|
|
16
|
+
object,
|
|
17
|
+
...(predicate && { predicate }),
|
|
18
|
+
...(namedGraph && { namedGraph }),
|
|
19
|
+
...(objectDatatype && { objectDatatype }),
|
|
20
|
+
};
|
|
21
|
+
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ConnectionRow.d.ts","sourceRoot":"","sources":["../../../../src/routes/integrations/components/ConnectionRow.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AACvC,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,oBAAoB,CAAC;AAOzD,MAAM,MAAM,kBAAkB,GAAG;IAC/B,UAAU,EAAE,cAAc,CAAC;IAC3B,OAAO,CAAC,EAAE,MAAM,IAAI,CAAC;IACrB,QAAQ,CAAC,EAAE,MAAM,IAAI,CAAC;IACtB,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,MAAM,CAAC,EAAE,MAAM,IAAI,CAAC;IACpB,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,MAAM,CAAC,EAAE,SAAS,CAAC;CACpB,CAAC;AAEF,wBAAgB,aAAa,CAAC,KAAK,EAAE,kBAAkB,
|
|
1
|
+
{"version":3,"file":"ConnectionRow.d.ts","sourceRoot":"","sources":["../../../../src/routes/integrations/components/ConnectionRow.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AACvC,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,oBAAoB,CAAC;AAOzD,MAAM,MAAM,kBAAkB,GAAG;IAC/B,UAAU,EAAE,cAAc,CAAC;IAC3B,OAAO,CAAC,EAAE,MAAM,IAAI,CAAC;IACrB,QAAQ,CAAC,EAAE,MAAM,IAAI,CAAC;IACtB,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,MAAM,CAAC,EAAE,MAAM,IAAI,CAAC;IACpB,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,MAAM,CAAC,EAAE,SAAS,CAAC;CACpB,CAAC;AAEF,wBAAgB,aAAa,CAAC,KAAK,EAAE,kBAAkB,2CA2FtD;AAED,wBAAgB,qBAAqB,4CAcpC"}
|
|
@@ -10,7 +10,7 @@ export function ConnectionRow(props) {
|
|
|
10
10
|
const { connection, onClick, onRemove, isRemoving, onSync, isSyncing, action } = props;
|
|
11
11
|
const { primaryLabel, secondaryLabel, status, syncedLabel, namedAccount } = connection;
|
|
12
12
|
const interactive = isPresent(onClick);
|
|
13
|
-
const content = (_jsxs(_Fragment, { children: [
|
|
13
|
+
const content = (_jsxs(_Fragment, { children: [_jsxs("div", { className: "flex-1 min-w-0 grid gap-0.5", children: [namedAccount ? (_jsx(ConnectionAccountLabel, { account: namedAccount })) : (_jsx("p", { className: "typography-caption-medium text-default-foreground truncate", children: primaryLabel })), isPresent(secondaryLabel) && (_jsx("p", { title: secondaryLabel, className: cn("typography-small text-muted-foreground truncate", namedAccount && "pl-11"), children: secondaryLabel }))] }), _jsxs("div", { className: cn("flex flex-wrap items-center justify-end gap-x-4 gap-y-3 shrink-0", isPresent(action) && "max-sm:basis-full"), children: [isPresent(syncedLabel) && (_jsx("span", { className: "typography-tiny text-muted-foreground hidden sm:inline", children: syncedLabel })), _jsx(StatusChip, { status: status }), action, onSync && (_jsx(Button, { variant: "ghost", size: "sm", iconOnly: true, icon: RefreshCw, isLoading: isSyncing, onClick: (event) => {
|
|
14
14
|
event.stopPropagation();
|
|
15
15
|
onSync();
|
|
16
16
|
}, "aria-label": `Sync ${primaryLabel}`, className: "text-muted-foreground hover:text-default-foreground" })), onRemove && (_jsx(Button, { variant: "ghost", size: "sm", iconOnly: true, icon: Trash2, disabled: isRemoving, onClick: (event) => {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"connection-view.d.ts","sourceRoot":"","sources":["../../../src/routes/integrations/connection-view.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,yBAAyB,CAAC;AACtD,OAAO,KAAK,
|
|
1
|
+
{"version":3,"file":"connection-view.d.ts","sourceRoot":"","sources":["../../../src/routes/integrations/connection-view.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,yBAAyB,CAAC;AACtD,OAAO,KAAK,EAAuD,kBAAkB,EAAE,MAAM,SAAS,CAAC;AAEvG;;;GAGG;AACH,MAAM,MAAM,YAAY,GAAG;IACzB,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,UAAU,EAAE,MAAM,CAAC;IACnB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,gBAAgB,CAAC,EAAE;QAAE,KAAK,EAAE,MAAM,CAAC;QAAC,IAAI,EAAE,MAAM,CAAA;KAAE,CAAC;CACpD,CAAC;AAEF,MAAM,MAAM,cAAc,GAAG;IAC3B,MAAM,EAAE,kBAAkB,CAAC,MAAM,CAAC,CAAC;IACnC,EAAE,EAAE,MAAM,CAAC;IACX,YAAY,EAAE,MAAM,CAAC;IACrB,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,MAAM,EAAE,MAAM,CAAC;IACf,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,YAAY,CAAC,EAAE,YAAY,CAAC;CAC7B,CAAC;AAgEF,wBAAgB,gBAAgB,CAAC,UAAU,EAAE,kBAAkB,GAAG,cAAc,CAmB/E"}
|
|
@@ -29,6 +29,22 @@ const statusMap = {
|
|
|
29
29
|
[GQLRelayIntegrationStatus.Deleting]: { label: "Deleting", tone: "neutral" },
|
|
30
30
|
[GQLRelayIntegrationStatus.Deleted]: { label: "Deleted", tone: "neutral" },
|
|
31
31
|
};
|
|
32
|
+
const oauthConnectedStatus = { label: "Connected", tone: "success" };
|
|
33
|
+
// Integrations whose account is limited to what was picked at connect time, so an empty pick reads nothing.
|
|
34
|
+
const oauthIncludedResourcesLabels = {
|
|
35
|
+
[GQLIntegration.Dash]: { label: "Folders", noneLabel: "No folders selected" },
|
|
36
|
+
};
|
|
37
|
+
function oauthScope({ integration, includedResources, }) {
|
|
38
|
+
const labels = oauthIncludedResourcesLabels[integration];
|
|
39
|
+
if (!labels || !includedResources)
|
|
40
|
+
return { status: oauthConnectedStatus };
|
|
41
|
+
if (!isPresent(includedResources))
|
|
42
|
+
return { status: { label: labels.noneLabel, tone: "warning" } };
|
|
43
|
+
return {
|
|
44
|
+
status: oauthConnectedStatus,
|
|
45
|
+
secondaryLabel: `${labels.label}: ${includedResources.map(({ id, name }) => name ?? id).join(", ")}`,
|
|
46
|
+
};
|
|
47
|
+
}
|
|
32
48
|
function toManagedConnectionView(connection) {
|
|
33
49
|
return {
|
|
34
50
|
source: connection.kind,
|
|
@@ -50,7 +66,7 @@ export function toConnectionView(connection) {
|
|
|
50
66
|
source: c.kind,
|
|
51
67
|
id: c.id,
|
|
52
68
|
primaryLabel: isPresent(c.name) ? c.name : `${oauthAccountNoun[c.integration]} ${c.externalId}`,
|
|
53
|
-
|
|
69
|
+
...oauthScope(c),
|
|
54
70
|
namedAccount: {
|
|
55
71
|
name: isPresent(c.name) ? c.name : oauthAccountNoun[c.integration],
|
|
56
72
|
noun: isPresent(c.name) ? oauthAccountNoun[c.integration] : undefined,
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { GQLGmailIntegrationStatus, GQLInferalIntegrationProvider, GQLIntegration, GQLRelayIntegrationStatus } from "@manta-eu/client";
|
|
1
|
+
import type { GQLGmailIntegrationStatus, GQLIncludedResource, GQLInferalIntegrationProvider, GQLIntegration, GQLRelayIntegrationStatus } from "@manta-eu/client";
|
|
2
2
|
import type { HexColor } from "@manta-eu/lib/color";
|
|
3
3
|
import type { ComponentType, SVGProps } from "react";
|
|
4
4
|
import type { ConnectionView } from "./connection-view.js";
|
|
@@ -33,6 +33,7 @@ export type OAuthConnection = {
|
|
|
33
33
|
name?: string;
|
|
34
34
|
entityIri?: string;
|
|
35
35
|
typeIri?: string;
|
|
36
|
+
includedResources?: GQLIncludedResource[];
|
|
36
37
|
};
|
|
37
38
|
export type GmailConnection = {
|
|
38
39
|
kind: "gmail";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/routes/integrations/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,yBAAyB,EACzB,6BAA6B,EAC7B,cAAc,EACd,yBAAyB,EAC1B,MAAM,kBAAkB,CAAC;AAC1B,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,qBAAqB,CAAC;AACpD,OAAO,KAAK,EAAE,aAAa,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AACrD,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,mBAAmB,CAAC;AAExD,eAAO,MAAM,eAAe,UAAU,CAAC;AACvC,eAAO,MAAM,eAAe,UAAU,CAAC;AACvC,eAAO,MAAM,cAAc,SAAS,CAAC;AAErC,MAAM,MAAM,UAAU,GAClB,GAAG,6BAA6B,EAAE,GAClC,OAAO,eAAe,GACtB,OAAO,eAAe,GACtB,OAAO,cAAc,CAAC;AAC1B,MAAM,MAAM,gBAAgB,GAAG,SAAS,GAAG,OAAO,GAAG,OAAO,CAAC;AAC7D,MAAM,MAAM,qBAAqB,GAAG,aAAa,CAAC,QAAQ,CAAC,aAAa,CAAC,CAAC,CAAC;AAE3E,MAAM,MAAM,oBAAoB,CAAC,EAAE,SAAS,MAAM,GAAG,UAAU,IAAI;IACjE,EAAE,EAAE,EAAE,CAAC;IACP,IAAI,EAAE,MAAM,CAAC;IACb,UAAU,EAAE,QAAQ,CAAC;IACrB,IAAI,EAAE,qBAAqB,CAAC;CAC7B,CAAC;AAEF,mFAAmF;AACnF,MAAM,MAAM,iBAAiB,GAAG;IAC9B,IAAI,EAAE,SAAS,CAAC;IAChB,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,EAAE,MAAM,CAAC;IACb,GAAG,EAAE,MAAM,GAAG,IAAI,CAAC;IACnB,MAAM,EAAE,yBAAyB,CAAC;IAClC,YAAY,EAAE,IAAI,GAAG,IAAI,CAAC;IAC1B,MAAM,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;CACxB,CAAC;AAEF,mGAAmG;AACnG,MAAM,MAAM,eAAe,GAAG;IAC5B,IAAI,EAAE,OAAO,CAAC;IACd,EAAE,EAAE,MAAM,CAAC;IACX,WAAW,EAAE,cAAc,CAAC;IAC5B,UAAU,EAAE,MAAM,CAAC;IACnB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,OAAO,CAAC,EAAE,MAAM,CAAC;
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/routes/integrations/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,yBAAyB,EACzB,mBAAmB,EACnB,6BAA6B,EAC7B,cAAc,EACd,yBAAyB,EAC1B,MAAM,kBAAkB,CAAC;AAC1B,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,qBAAqB,CAAC;AACpD,OAAO,KAAK,EAAE,aAAa,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AACrD,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,mBAAmB,CAAC;AAExD,eAAO,MAAM,eAAe,UAAU,CAAC;AACvC,eAAO,MAAM,eAAe,UAAU,CAAC;AACvC,eAAO,MAAM,cAAc,SAAS,CAAC;AAErC,MAAM,MAAM,UAAU,GAClB,GAAG,6BAA6B,EAAE,GAClC,OAAO,eAAe,GACtB,OAAO,eAAe,GACtB,OAAO,cAAc,CAAC;AAC1B,MAAM,MAAM,gBAAgB,GAAG,SAAS,GAAG,OAAO,GAAG,OAAO,CAAC;AAC7D,MAAM,MAAM,qBAAqB,GAAG,aAAa,CAAC,QAAQ,CAAC,aAAa,CAAC,CAAC,CAAC;AAE3E,MAAM,MAAM,oBAAoB,CAAC,EAAE,SAAS,MAAM,GAAG,UAAU,IAAI;IACjE,EAAE,EAAE,EAAE,CAAC;IACP,IAAI,EAAE,MAAM,CAAC;IACb,UAAU,EAAE,QAAQ,CAAC;IACrB,IAAI,EAAE,qBAAqB,CAAC;CAC7B,CAAC;AAEF,mFAAmF;AACnF,MAAM,MAAM,iBAAiB,GAAG;IAC9B,IAAI,EAAE,SAAS,CAAC;IAChB,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,EAAE,MAAM,CAAC;IACb,GAAG,EAAE,MAAM,GAAG,IAAI,CAAC;IACnB,MAAM,EAAE,yBAAyB,CAAC;IAClC,YAAY,EAAE,IAAI,GAAG,IAAI,CAAC;IAC1B,MAAM,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;CACxB,CAAC;AAEF,mGAAmG;AACnG,MAAM,MAAM,eAAe,GAAG;IAC5B,IAAI,EAAE,OAAO,CAAC;IACd,EAAE,EAAE,MAAM,CAAC;IACX,WAAW,EAAE,cAAc,CAAC;IAC5B,UAAU,EAAE,MAAM,CAAC;IACnB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,iBAAiB,CAAC,EAAE,mBAAmB,EAAE,CAAC;CAC3C,CAAC;AAEF,MAAM,MAAM,eAAe,GAAG;IAC5B,IAAI,EAAE,OAAO,CAAC;IACd,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,EAAE,MAAM,CAAC;IACb,GAAG,EAAE,IAAI,CAAC;IACV,MAAM,EAAE,yBAAyB,CAAC;IAClC,YAAY,EAAE,IAAI,GAAG,IAAI,CAAC;IAC1B,MAAM,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;CACxB,CAAC;AAEF,MAAM,MAAM,kBAAkB,GAAG,iBAAiB,GAAG,eAAe,GAAG,eAAe,CAAC;AAEvF,MAAM,MAAM,iBAAiB,CAAC,EAAE,SAAS,MAAM,GAAG,UAAU,IAAI;IAC9D,EAAE,EAAE,EAAE,CAAC;IACP,IAAI,EAAE,MAAM,CAAC;IACb,QAAQ,EAAE,MAAM,CAAC;IACjB,WAAW,EAAE,cAAc,EAAE,CAAC;CAC/B,CAAC"}
|