@quillsql/admin 1.6.1 → 1.6.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/Admin.d.ts +41 -87
- package/dist/cjs/Admin.d.ts.map +1 -1
- package/dist/cjs/Admin.js +358 -456
- package/dist/cjs/AdminProvider.d.ts +108 -50
- package/dist/cjs/AdminProvider.d.ts.map +1 -1
- package/dist/cjs/AdminProvider.js +390 -208
- package/dist/cjs/api/ConnectionClient.d.ts +20 -38
- package/dist/cjs/api/ConnectionClient.d.ts.map +1 -1
- package/dist/cjs/api/ConnectionClient.js +291 -321
- package/dist/cjs/assets/ArrowDownHeadIcon.d.ts.map +1 -1
- package/dist/cjs/components/Banner/index.d.ts +0 -1
- package/dist/cjs/components/Banner/index.d.ts.map +1 -1
- package/dist/cjs/components/Banner/index.js +1 -1
- package/dist/cjs/components/CardSection.js +1 -1
- package/dist/cjs/components/CardTitle.js +1 -1
- package/dist/cjs/components/ClipboardButton.d.ts +8 -0
- package/dist/cjs/components/ClipboardButton.d.ts.map +1 -0
- package/dist/cjs/components/ClipboardButton.js +74 -0
- package/dist/cjs/components/DashboardSelectPopover.d.ts +8 -5
- package/dist/cjs/components/DashboardSelectPopover.d.ts.map +1 -1
- package/dist/cjs/components/DashboardSelectPopover.js +74 -185
- package/dist/cjs/components/DatabaseMismatchCard.d.ts +3 -3
- package/dist/cjs/components/DatabaseMismatchCard.d.ts.map +1 -1
- package/dist/cjs/components/DatabaseMismatchCard.js +3 -3
- package/dist/cjs/components/DatabaseSelector.d.ts.map +1 -1
- package/dist/cjs/components/DatabaseSelector.js +10 -2
- package/dist/cjs/components/DateRangePicker/SingleDatePicker.d.ts +10 -0
- package/dist/cjs/components/DateRangePicker/SingleDatePicker.d.ts.map +1 -0
- package/dist/cjs/components/DateRangePicker/SingleDatePicker.js +263 -0
- package/dist/cjs/components/DateRangePicker/YearlessDateRangePicker.d.ts +18 -0
- package/dist/cjs/components/DateRangePicker/YearlessDateRangePicker.d.ts.map +1 -0
- package/dist/cjs/components/DateRangePicker/YearlessDateRangePicker.js +288 -0
- package/dist/cjs/components/DateRangePicker/dateRangePickerUtils.d.ts +91 -0
- package/dist/cjs/components/DateRangePicker/dateRangePickerUtils.d.ts.map +1 -0
- package/dist/cjs/components/DateRangePicker/dateRangePickerUtils.js +898 -0
- package/dist/cjs/components/DeleteButton.d.ts +0 -1
- package/dist/cjs/components/DeleteButton.d.ts.map +1 -1
- package/dist/cjs/components/DeleteButton.js +1 -1
- package/dist/cjs/components/DropDownMenu.js +1 -1
- package/dist/cjs/components/DropDownMenuWithLabel.d.ts +4 -3
- package/dist/cjs/components/DropDownMenuWithLabel.d.ts.map +1 -1
- package/dist/cjs/components/DropDownMenuWithLabel.js +56 -29
- package/dist/cjs/components/DynamicBanner.d.ts +2 -5
- package/dist/cjs/components/DynamicBanner.d.ts.map +1 -1
- package/dist/cjs/components/DynamicBanner.js +3 -3
- package/dist/cjs/components/EmptyDashboardComponent/index.d.ts +0 -1
- package/dist/cjs/components/EmptyDashboardComponent/index.d.ts.map +1 -1
- package/dist/cjs/components/EmptyDashboardComponent/index.js +6 -5
- package/dist/cjs/components/EmptyVirtualTablesComponent.d.ts +4 -0
- package/dist/cjs/components/EmptyVirtualTablesComponent.d.ts.map +1 -0
- package/dist/cjs/components/EmptyVirtualTablesComponent.js +41 -0
- package/dist/cjs/components/ExternalLink.d.ts +4 -0
- package/dist/cjs/components/ExternalLink.d.ts.map +1 -0
- package/dist/cjs/components/ExternalLink.js +15 -0
- package/dist/cjs/components/FormTooltip.d.ts +8 -0
- package/dist/cjs/components/FormTooltip.d.ts.map +1 -0
- package/dist/cjs/components/FormTooltip.js +89 -0
- package/dist/cjs/components/InputLabel.d.ts +4 -1
- package/dist/cjs/components/InputLabel.d.ts.map +1 -1
- package/dist/cjs/components/InputLabel.js +13 -8
- package/dist/cjs/components/InternalDashboard/ChartSkeleton.d.ts +11 -0
- package/dist/cjs/components/InternalDashboard/ChartSkeleton.d.ts.map +1 -0
- package/dist/cjs/components/InternalDashboard/ChartSkeleton.js +21 -0
- package/dist/cjs/components/InternalDashboard/DashboardFilter.d.ts +20 -0
- package/dist/cjs/components/InternalDashboard/DashboardFilter.d.ts.map +1 -0
- package/dist/cjs/components/InternalDashboard/DashboardFilter.js +104 -0
- package/dist/cjs/components/InternalDashboard/DashboardLoadingComponent.d.ts +7 -0
- package/dist/cjs/components/InternalDashboard/DashboardLoadingComponent.d.ts.map +1 -0
- package/dist/cjs/components/InternalDashboard/DashboardLoadingComponent.js +22 -0
- package/dist/cjs/components/InternalDashboard/DateRangePicker/QuillDateRangePicker.d.ts +37 -0
- package/dist/cjs/components/InternalDashboard/DateRangePicker/QuillDateRangePicker.d.ts.map +1 -0
- package/dist/cjs/components/InternalDashboard/DateRangePicker/QuillDateRangePicker.js +275 -0
- package/dist/cjs/components/InternalDashboard/DateRangePicker/dateRangePickerUtils.d.ts +85 -0
- package/dist/cjs/components/InternalDashboard/DateRangePicker/dateRangePickerUtils.d.ts.map +1 -0
- package/dist/cjs/components/InternalDashboard/DateRangePicker/dateRangePickerUtils.js +534 -0
- package/dist/cjs/components/InternalDashboard/InternalDashboard.d.ts +17 -0
- package/dist/cjs/components/InternalDashboard/InternalDashboard.d.ts.map +1 -0
- package/dist/cjs/components/InternalDashboard/InternalDashboard.js +1947 -0
- package/dist/cjs/components/OrgSelect.d.ts +9 -13
- package/dist/cjs/components/OrgSelect.d.ts.map +1 -1
- package/dist/cjs/components/OrgSelect.js +136 -119
- package/dist/cjs/components/QuillMultiSelectWithCombo.d.ts +30 -0
- package/dist/cjs/components/QuillMultiSelectWithCombo.d.ts.map +1 -0
- package/dist/cjs/components/QuillMultiSelectWithCombo.js +504 -0
- package/dist/cjs/components/QuillPopover.d.ts +11 -0
- package/dist/cjs/components/QuillPopover.d.ts.map +1 -0
- package/dist/cjs/components/QuillPopover.js +180 -0
- package/dist/cjs/components/QuillSelect.d.ts +1 -1
- package/dist/cjs/components/QuillSelect.d.ts.map +1 -1
- package/dist/cjs/components/QuillSelect.js +38 -16
- package/dist/cjs/components/QuillSelectWithCombo.d.ts +22 -0
- package/dist/cjs/components/QuillSelectWithCombo.d.ts.map +1 -0
- package/dist/cjs/components/QuillSelectWithCombo.js +327 -0
- package/dist/cjs/components/QuillTab.d.ts +12 -0
- package/dist/cjs/components/QuillTab.d.ts.map +1 -0
- package/dist/cjs/components/QuillTab.js +84 -0
- package/dist/cjs/components/QuillToolTipPortal.d.ts +11 -0
- package/dist/cjs/components/QuillToolTipPortal.d.ts.map +1 -0
- package/dist/cjs/components/QuillToolTipPortal.js +108 -0
- package/dist/cjs/components/SegmentedControl.d.ts +8 -2
- package/dist/cjs/components/SegmentedControl.d.ts.map +1 -1
- package/dist/cjs/components/SegmentedControl.js +11 -12
- package/dist/cjs/components/SqlTextEditor.d.ts +2 -5
- package/dist/cjs/components/SqlTextEditor.d.ts.map +1 -1
- package/dist/cjs/components/SqlTextEditor.js +20 -19
- package/dist/cjs/components/StepDisplay.d.ts.map +1 -1
- package/dist/cjs/components/StepDisplay.js +2 -2
- package/dist/cjs/components/Tenants/EditTenant.d.ts +41 -0
- package/dist/cjs/components/Tenants/EditTenant.d.ts.map +1 -0
- package/dist/cjs/components/Tenants/EditTenant.js +760 -0
- package/dist/cjs/components/UiComponents.d.ts +35 -6
- package/dist/cjs/components/UiComponents.d.ts.map +1 -1
- package/dist/cjs/components/UiComponents.js +226 -28
- package/dist/cjs/components/VirtualTableTile.d.ts +7 -0
- package/dist/cjs/components/VirtualTableTile.d.ts.map +1 -0
- package/dist/cjs/components/VirtualTableTile.js +51 -0
- package/dist/cjs/components/index.d.ts +5 -5
- package/dist/cjs/components/index.d.ts.map +1 -1
- package/dist/cjs/components/index.js +1 -1
- package/dist/cjs/constants/dataTypes.d.ts.map +1 -1
- package/dist/cjs/constants/dataTypes.js +2 -0
- package/dist/cjs/forms/client_onboard/ConnectDatabase.d.ts +15 -6
- package/dist/cjs/forms/client_onboard/ConnectDatabase.d.ts.map +1 -1
- package/dist/cjs/forms/client_onboard/ConnectDatabase.js +209 -96
- package/dist/cjs/forms/client_onboard/ConnectSchema.d.ts +13 -9
- package/dist/cjs/forms/client_onboard/ConnectSchema.d.ts.map +1 -1
- package/dist/cjs/forms/client_onboard/ConnectSchema.js +158 -236
- package/dist/cjs/forms/client_onboard/CreateVirtualTables.d.ts +47 -0
- package/dist/cjs/forms/client_onboard/CreateVirtualTables.d.ts.map +1 -0
- package/dist/cjs/forms/client_onboard/CreateVirtualTables.js +396 -0
- package/dist/cjs/forms/client_onboard/__tests__/ConnectDatabase.test.d.ts +2 -0
- package/dist/cjs/forms/client_onboard/__tests__/ConnectDatabase.test.d.ts.map +1 -0
- package/dist/cjs/forms/client_onboard/__tests__/ConnectDatabase.test.js +571 -0
- package/dist/cjs/forms/client_onboard/__tests__/ConnectSchema.test.d.ts +2 -0
- package/dist/cjs/forms/client_onboard/__tests__/ConnectSchema.test.d.ts.map +1 -0
- package/dist/cjs/forms/client_onboard/__tests__/ConnectSchema.test.js +459 -0
- package/dist/cjs/forms/client_onboard/__tests__/CreateVirtualTables.test.d.ts +2 -0
- package/dist/cjs/forms/client_onboard/__tests__/CreateVirtualTables.test.d.ts.map +1 -0
- package/dist/cjs/forms/client_onboard/__tests__/CreateVirtualTables.test.js +385 -0
- package/dist/cjs/forms/virtual_tables/CreateEditVirtualTable.d.ts +20 -0
- package/dist/cjs/forms/virtual_tables/CreateEditVirtualTable.d.ts.map +1 -0
- package/dist/cjs/forms/virtual_tables/CreateEditVirtualTable.js +294 -0
- package/dist/cjs/hooks/useDashboardManager.d.ts +16 -0
- package/dist/cjs/hooks/useDashboardManager.d.ts.map +1 -0
- package/dist/cjs/hooks/useDashboardManager.js +113 -0
- package/dist/cjs/hooks/useDatabaseSchema.d.ts +5 -0
- package/dist/cjs/hooks/useDatabaseSchema.d.ts.map +1 -0
- package/dist/cjs/hooks/useDatabaseSchema.js +54 -0
- package/dist/cjs/hooks/useItemBeingEdited.d.ts +1 -2
- package/dist/cjs/hooks/useItemBeingEdited.d.ts.map +1 -1
- package/dist/cjs/hooks/useItemBeingEdited.js +2 -14
- package/dist/cjs/hooks/useOnClickOutside.d.ts +4 -1
- package/dist/cjs/hooks/useOnClickOutside.d.ts.map +1 -1
- package/dist/cjs/hooks/useOnClickOutside.js +50 -7
- package/dist/cjs/hooks/useTenants.d.ts +13 -0
- package/dist/cjs/hooks/useTenants.d.ts.map +1 -0
- package/dist/cjs/hooks/useTenants.js +174 -0
- package/dist/cjs/hooks/useThrottle.d.ts +2 -0
- package/dist/cjs/hooks/useThrottle.d.ts.map +1 -0
- package/dist/cjs/hooks/useThrottle.js +14 -0
- package/dist/cjs/icons/CheckCircleIcon.d.ts +5 -0
- package/dist/cjs/icons/CheckCircleIcon.d.ts.map +1 -0
- package/dist/cjs/icons/CheckCircleIcon.js +5 -0
- package/dist/cjs/icons/DownChevronIcon.d.ts +2 -0
- package/dist/cjs/icons/DownChevronIcon.d.ts.map +1 -0
- package/dist/cjs/icons/DownChevronIcon.js +7 -0
- package/dist/cjs/icons/ExclamationFilledIcon.d.ts +5 -0
- package/dist/cjs/icons/ExclamationFilledIcon.d.ts.map +1 -0
- package/dist/cjs/icons/ExclamationFilledIcon.js +5 -0
- package/dist/cjs/icons/ExteriorLinkIcon.d.ts +5 -0
- package/dist/cjs/icons/ExteriorLinkIcon.d.ts.map +1 -0
- package/dist/cjs/icons/ExteriorLinkIcon.js +5 -0
- package/dist/cjs/icons/GlobeIcon.d.ts +5 -0
- package/dist/cjs/icons/GlobeIcon.d.ts.map +1 -0
- package/dist/cjs/icons/GlobeIcon.js +15 -0
- package/dist/cjs/icons/InformationCircleIcon.d.ts +4 -0
- package/dist/cjs/icons/InformationCircleIcon.d.ts.map +1 -0
- package/dist/cjs/icons/InformationCircleIcon.js +7 -0
- package/dist/cjs/icons/LeftChevronIcon.d.ts +2 -0
- package/dist/cjs/icons/LeftChevronIcon.d.ts.map +1 -0
- package/dist/cjs/icons/LeftChevronIcon.js +7 -0
- package/dist/cjs/icons/QuestionMarkCircleIcon.d.ts +5 -0
- package/dist/cjs/icons/QuestionMarkCircleIcon.d.ts.map +1 -0
- package/dist/cjs/icons/QuestionMarkCircleIcon.js +5 -0
- package/dist/cjs/icons/RightChevronIcon.d.ts +2 -0
- package/dist/cjs/icons/RightChevronIcon.d.ts.map +1 -0
- package/dist/cjs/icons/RightChevronIcon.js +7 -0
- package/dist/cjs/icons/XMarkIcon.d.ts +0 -1
- package/dist/cjs/icons/XMarkIcon.d.ts.map +1 -1
- package/dist/cjs/icons/XMarkIcon.js +1 -1
- package/dist/cjs/index.d.ts +2 -3
- package/dist/cjs/index.d.ts.map +1 -1
- package/dist/cjs/index.js +6 -7
- package/dist/cjs/modals/CodePreview.d.ts +6 -0
- package/dist/cjs/modals/CodePreview.d.ts.map +1 -0
- package/dist/cjs/modals/CodePreview.js +151 -0
- package/dist/cjs/modals/EditEnvironmentModal.d.ts +15 -0
- package/dist/cjs/modals/EditEnvironmentModal.d.ts.map +1 -0
- package/dist/cjs/modals/EditEnvironmentModal.js +551 -0
- package/dist/cjs/modals/EditFiltersModal.d.ts +14 -10
- package/dist/cjs/modals/EditFiltersModal.d.ts.map +1 -1
- package/dist/cjs/modals/EditFiltersModal.js +1219 -263
- package/dist/cjs/modals/NewDashboardModal.d.ts +6 -8
- package/dist/cjs/modals/NewDashboardModal.d.ts.map +1 -1
- package/dist/cjs/modals/NewDashboardModal.js +147 -146
- package/dist/cjs/modals/PromoteDashboardModal.d.ts +16 -0
- package/dist/cjs/modals/PromoteDashboardModal.d.ts.map +1 -0
- package/dist/cjs/modals/PromoteDashboardModal.js +56 -0
- package/dist/cjs/modals/PromoteReportModal.d.ts +15 -0
- package/dist/cjs/modals/PromoteReportModal.d.ts.map +1 -0
- package/dist/cjs/modals/PromoteReportModal.js +128 -0
- package/dist/cjs/modals/PromoteViewModal.d.ts +5 -5
- package/dist/cjs/modals/PromoteViewModal.d.ts.map +1 -1
- package/dist/cjs/modals/PromoteViewModal.js +58 -94
- package/dist/cjs/modals/ReorderDashboardModal.d.ts +1 -2
- package/dist/cjs/modals/ReorderDashboardModal.d.ts.map +1 -1
- package/dist/cjs/modals/ReorderDashboardModal.js +34 -20
- package/dist/cjs/modals/SavedQueriesModal.d.ts +7 -0
- package/dist/cjs/modals/SavedQueriesModal.d.ts.map +1 -0
- package/dist/cjs/modals/SavedQueriesModal.js +128 -0
- package/dist/cjs/modals/index.d.ts +0 -1
- package/dist/cjs/modals/index.d.ts.map +1 -1
- package/dist/cjs/modals/index.js +1 -3
- package/dist/cjs/primitives/ButtonPrimitive.d.ts +3 -1
- package/dist/cjs/primitives/ButtonPrimitive.d.ts.map +1 -1
- package/dist/cjs/primitives/ButtonPrimitive.js +24 -16
- package/dist/cjs/primitives/CheckboxPrimitive.d.ts +12 -0
- package/dist/cjs/primitives/CheckboxPrimitive.d.ts.map +1 -0
- package/dist/cjs/primitives/CheckboxPrimitive.js +29 -0
- package/dist/cjs/primitives/HeaderPrimitive.d.ts.map +1 -1
- package/dist/cjs/primitives/HeaderPrimitive.js +1 -1
- package/dist/cjs/primitives/MiniButtonPrimitive.d.ts +7 -0
- package/dist/cjs/primitives/MiniButtonPrimitive.d.ts.map +1 -0
- package/dist/cjs/primitives/MiniButtonPrimitive.js +56 -0
- package/dist/cjs/primitives/ModalPrimitive.d.ts +2 -10
- package/dist/cjs/primitives/ModalPrimitive.d.ts.map +1 -1
- package/dist/cjs/primitives/ModalPrimitive.js +6 -6
- package/dist/cjs/primitives/PlaceholderPrimitive.d.ts +5 -0
- package/dist/cjs/primitives/PlaceholderPrimitive.d.ts.map +1 -0
- package/dist/cjs/primitives/PlaceholderPrimitive.js +18 -0
- package/dist/cjs/primitives/PopoverPrimitive.d.ts +8 -0
- package/dist/cjs/primitives/PopoverPrimitive.d.ts.map +1 -0
- package/dist/cjs/primitives/PopoverPrimitive.js +53 -0
- package/dist/cjs/primitives/SecondaryButtonPrimitive.d.ts +3 -1
- package/dist/cjs/primitives/SecondaryButtonPrimitive.d.ts.map +1 -1
- package/dist/cjs/primitives/SecondaryButtonPrimitive.js +13 -10
- package/dist/cjs/primitives/TextInputPrimitive.d.ts +7 -2
- package/dist/cjs/primitives/TextInputPrimitive.d.ts.map +1 -1
- package/dist/cjs/primitives/TextInputPrimitive.js +109 -14
- package/dist/cjs/primitives/TogglePrimitive.d.ts +6 -3
- package/dist/cjs/primitives/TogglePrimitive.d.ts.map +1 -1
- package/dist/cjs/primitives/TogglePrimitive.js +10 -7
- package/dist/cjs/primitives/index.d.ts +1 -1
- package/dist/cjs/primitives/index.d.ts.map +1 -1
- package/dist/cjs/primitives/index.js +3 -3
- package/dist/cjs/public_components/ChartQueryBuilder.d.ts +9 -0
- package/dist/cjs/public_components/ChartQueryBuilder.d.ts.map +1 -0
- package/dist/cjs/public_components/ChartQueryBuilder.js +131 -0
- package/dist/cjs/public_components/CreateEnvironment.d.ts +1 -1
- package/dist/cjs/public_components/CreateEnvironment.d.ts.map +1 -1
- package/dist/cjs/public_components/CreateEnvironment.js +168 -81
- package/dist/cjs/public_components/DashboardManager.d.ts +2 -2
- package/dist/cjs/public_components/DashboardManager.d.ts.map +1 -1
- package/dist/cjs/public_components/DashboardManager.js +346 -187
- package/dist/cjs/public_components/EnvSelectPopover.d.ts +12 -0
- package/dist/cjs/public_components/EnvSelectPopover.d.ts.map +1 -0
- package/dist/cjs/public_components/EnvSelectPopover.js +144 -0
- package/dist/cjs/public_components/{SQLViewManager.d.ts → VirtualTableManager.d.ts} +3 -2
- package/dist/cjs/public_components/VirtualTableManager.d.ts.map +1 -0
- package/dist/cjs/public_components/VirtualTableManager.js +731 -0
- package/dist/cjs/public_components/__tests__/CreateEnvironment.test.d.ts +2 -0
- package/dist/cjs/public_components/__tests__/CreateEnvironment.test.d.ts.map +1 -0
- package/dist/cjs/public_components/__tests__/CreateEnvironment.test.js +685 -0
- package/dist/cjs/utils/astProcessing.d.ts +14 -1
- package/dist/cjs/utils/astProcessing.d.ts.map +1 -1
- package/dist/cjs/utils/astProcessing.js +72 -8
- package/dist/cjs/utils/astProcessing.uspec.js +7 -3
- package/dist/cjs/utils/columnProcessing.d.ts +12 -0
- package/dist/cjs/utils/columnProcessing.d.ts.map +1 -1
- package/dist/cjs/utils/columnProcessing.js +173 -7
- package/dist/cjs/utils/constants.d.ts +4 -21
- package/dist/cjs/utils/constants.d.ts.map +1 -1
- package/dist/cjs/utils/constants.js +20 -11
- package/dist/cjs/utils/dataEditor.d.ts +4 -3
- package/dist/cjs/utils/dataEditor.d.ts.map +1 -1
- package/dist/cjs/utils/dataEditor.js +69 -121
- package/dist/cjs/utils/dataFetcher.d.ts +20 -2
- package/dist/cjs/utils/dataFetcher.d.ts.map +1 -1
- package/dist/cjs/utils/dataFetcher.js +46 -56
- package/dist/cjs/utils/databases.d.ts +20 -8
- package/dist/cjs/utils/databases.d.ts.map +1 -1
- package/dist/cjs/utils/databases.js +63 -24
- package/dist/cjs/utils/filter.d.ts +222 -0
- package/dist/cjs/utils/filter.d.ts.map +1 -0
- package/dist/cjs/utils/filter.js +347 -0
- package/dist/cjs/utils/monacoAutocomplete.d.ts +2 -1
- package/dist/cjs/utils/monacoAutocomplete.d.ts.map +1 -1
- package/dist/cjs/utils/monacoAutocomplete.js +149 -44
- package/dist/cjs/utils/report.d.ts +120 -0
- package/dist/cjs/utils/report.d.ts.map +1 -0
- package/dist/cjs/utils/report.js +109 -0
- package/dist/cjs/utils/schema.d.ts +41 -29
- package/dist/cjs/utils/schema.d.ts.map +1 -1
- package/dist/cjs/utils/schema.js +137 -91
- package/dist/cjs/utils/table.d.ts +70 -4
- package/dist/cjs/utils/table.d.ts.map +1 -1
- package/dist/cjs/utils/tenants.d.ts +48 -0
- package/dist/cjs/utils/tenants.d.ts.map +1 -0
- package/dist/cjs/utils/tenants.js +37 -0
- package/dist/cjs/utils/textProcessing.js +1 -2
- package/dist/cjs/utils/ui.d.ts +2 -0
- package/dist/cjs/utils/ui.d.ts.map +1 -0
- package/dist/cjs/utils/ui.js +18 -0
- package/dist/cjs/utils/validation.d.ts +2 -0
- package/dist/cjs/utils/validation.d.ts.map +1 -0
- package/dist/cjs/utils/validation.js +77 -0
- package/dist/cjs/utils/validation.uspec.d.ts +2 -0
- package/dist/cjs/utils/validation.uspec.d.ts.map +1 -0
- package/dist/cjs/utils/validation.uspec.js +53 -0
- package/dist/esm/Admin.d.ts +41 -87
- package/dist/esm/Admin.d.ts.map +1 -1
- package/dist/esm/Admin.js +355 -422
- package/dist/esm/AdminProvider.d.ts +108 -50
- package/dist/esm/AdminProvider.d.ts.map +1 -1
- package/dist/esm/AdminProvider.js +390 -209
- package/dist/esm/api/ConnectionClient.d.ts +20 -38
- package/dist/esm/api/ConnectionClient.d.ts.map +1 -1
- package/dist/esm/api/ConnectionClient.js +280 -306
- package/dist/esm/assets/ArrowDownHeadIcon.d.ts.map +1 -1
- package/dist/esm/components/Banner/index.d.ts +0 -1
- package/dist/esm/components/Banner/index.d.ts.map +1 -1
- package/dist/esm/components/ClipboardButton.d.ts +8 -0
- package/dist/esm/components/ClipboardButton.d.ts.map +1 -0
- package/dist/esm/components/ClipboardButton.js +69 -0
- package/dist/esm/components/DashboardSelectPopover.d.ts +8 -5
- package/dist/esm/components/DashboardSelectPopover.d.ts.map +1 -1
- package/dist/esm/components/DashboardSelectPopover.js +72 -186
- package/dist/esm/components/DatabaseMismatchCard.d.ts +3 -3
- package/dist/esm/components/DatabaseMismatchCard.d.ts.map +1 -1
- package/dist/esm/components/DatabaseMismatchCard.js +2 -2
- package/dist/esm/components/DatabaseSelector.d.ts.map +1 -1
- package/dist/esm/components/DatabaseSelector.js +9 -1
- package/dist/esm/components/DateRangePicker/SingleDatePicker.d.ts +10 -0
- package/dist/esm/components/DateRangePicker/SingleDatePicker.d.ts.map +1 -0
- package/dist/esm/components/DateRangePicker/SingleDatePicker.js +227 -0
- package/dist/esm/components/DateRangePicker/YearlessDateRangePicker.d.ts +18 -0
- package/dist/esm/components/DateRangePicker/YearlessDateRangePicker.d.ts.map +1 -0
- package/dist/esm/components/DateRangePicker/YearlessDateRangePicker.js +282 -0
- package/dist/esm/components/DateRangePicker/dateRangePickerUtils.d.ts +91 -0
- package/dist/esm/components/DateRangePicker/dateRangePickerUtils.d.ts.map +1 -0
- package/dist/esm/components/DateRangePicker/dateRangePickerUtils.js +883 -0
- package/dist/esm/components/DeleteButton.d.ts +0 -1
- package/dist/esm/components/DeleteButton.d.ts.map +1 -1
- package/dist/esm/components/DropDownMenuWithLabel.d.ts +4 -3
- package/dist/esm/components/DropDownMenuWithLabel.d.ts.map +1 -1
- package/dist/esm/components/DropDownMenuWithLabel.js +37 -23
- package/dist/esm/components/DynamicBanner.d.ts +2 -5
- package/dist/esm/components/DynamicBanner.d.ts.map +1 -1
- package/dist/esm/components/DynamicBanner.js +2 -2
- package/dist/esm/components/EmptyDashboardComponent/index.d.ts +0 -1
- package/dist/esm/components/EmptyDashboardComponent/index.d.ts.map +1 -1
- package/dist/esm/components/EmptyDashboardComponent/index.js +5 -4
- package/dist/esm/components/EmptyVirtualTablesComponent.d.ts +4 -0
- package/dist/esm/components/EmptyVirtualTablesComponent.d.ts.map +1 -0
- package/dist/esm/components/EmptyVirtualTablesComponent.js +38 -0
- package/dist/esm/components/ExternalLink.d.ts +4 -0
- package/dist/esm/components/ExternalLink.d.ts.map +1 -0
- package/dist/esm/components/ExternalLink.js +9 -0
- package/dist/esm/components/FormTooltip.d.ts +8 -0
- package/dist/esm/components/FormTooltip.d.ts.map +1 -0
- package/dist/esm/components/FormTooltip.js +84 -0
- package/dist/esm/components/InputLabel.d.ts +4 -1
- package/dist/esm/components/InputLabel.d.ts.map +1 -1
- package/dist/esm/components/InputLabel.js +10 -8
- package/dist/esm/components/InternalDashboard/ChartSkeleton.d.ts +11 -0
- package/dist/esm/components/InternalDashboard/ChartSkeleton.d.ts.map +1 -0
- package/dist/esm/components/InternalDashboard/ChartSkeleton.js +16 -0
- package/dist/esm/components/InternalDashboard/DashboardFilter.d.ts +20 -0
- package/dist/esm/components/InternalDashboard/DashboardFilter.d.ts.map +1 -0
- package/dist/esm/components/InternalDashboard/DashboardFilter.js +101 -0
- package/dist/esm/components/InternalDashboard/DashboardLoadingComponent.d.ts +7 -0
- package/dist/esm/components/InternalDashboard/DashboardLoadingComponent.d.ts.map +1 -0
- package/dist/esm/components/InternalDashboard/DashboardLoadingComponent.js +15 -0
- package/dist/esm/components/InternalDashboard/DateRangePicker/QuillDateRangePicker.d.ts +37 -0
- package/dist/esm/components/InternalDashboard/DateRangePicker/QuillDateRangePicker.d.ts.map +1 -0
- package/dist/esm/components/InternalDashboard/DateRangePicker/QuillDateRangePicker.js +269 -0
- package/dist/esm/components/InternalDashboard/DateRangePicker/dateRangePickerUtils.d.ts +85 -0
- package/dist/esm/components/InternalDashboard/DateRangePicker/dateRangePickerUtils.d.ts.map +1 -0
- package/dist/esm/components/InternalDashboard/DateRangePicker/dateRangePickerUtils.js +520 -0
- package/dist/esm/components/InternalDashboard/InternalDashboard.d.ts +17 -0
- package/dist/esm/components/InternalDashboard/InternalDashboard.d.ts.map +1 -0
- package/dist/esm/components/InternalDashboard/InternalDashboard.js +1940 -0
- package/dist/esm/components/OrgSelect.d.ts +9 -13
- package/dist/esm/components/OrgSelect.d.ts.map +1 -1
- package/dist/esm/components/OrgSelect.js +134 -117
- package/dist/esm/components/QuillMultiSelectWithCombo.d.ts +30 -0
- package/dist/esm/components/QuillMultiSelectWithCombo.d.ts.map +1 -0
- package/dist/esm/components/QuillMultiSelectWithCombo.js +466 -0
- package/dist/esm/components/QuillPopover.d.ts +11 -0
- package/dist/esm/components/QuillPopover.d.ts.map +1 -0
- package/dist/esm/components/QuillPopover.js +144 -0
- package/dist/esm/components/QuillSelect.d.ts +1 -1
- package/dist/esm/components/QuillSelect.d.ts.map +1 -1
- package/dist/esm/components/QuillSelect.js +39 -16
- package/dist/esm/components/QuillSelectWithCombo.d.ts +22 -0
- package/dist/esm/components/QuillSelectWithCombo.d.ts.map +1 -0
- package/dist/esm/components/QuillSelectWithCombo.js +291 -0
- package/dist/esm/components/QuillTab.d.ts +12 -0
- package/dist/esm/components/QuillTab.d.ts.map +1 -0
- package/dist/esm/components/QuillTab.js +81 -0
- package/dist/esm/components/QuillToolTipPortal.d.ts +11 -0
- package/dist/esm/components/QuillToolTipPortal.d.ts.map +1 -0
- package/dist/esm/components/QuillToolTipPortal.js +104 -0
- package/dist/esm/components/SegmentedControl.d.ts +8 -2
- package/dist/esm/components/SegmentedControl.d.ts.map +1 -1
- package/dist/esm/components/SegmentedControl.js +10 -10
- package/dist/esm/components/SqlTextEditor.d.ts +2 -5
- package/dist/esm/components/SqlTextEditor.d.ts.map +1 -1
- package/dist/esm/components/SqlTextEditor.js +21 -20
- package/dist/esm/components/StepDisplay.d.ts.map +1 -1
- package/dist/esm/components/StepDisplay.js +1 -1
- package/dist/esm/components/Tenants/EditTenant.d.ts +41 -0
- package/dist/esm/components/Tenants/EditTenant.d.ts.map +1 -0
- package/dist/esm/components/Tenants/EditTenant.js +754 -0
- package/dist/esm/components/UiComponents.d.ts +35 -6
- package/dist/esm/components/UiComponents.d.ts.map +1 -1
- package/dist/esm/components/UiComponents.js +220 -26
- package/dist/esm/components/VirtualTableTile.d.ts +7 -0
- package/dist/esm/components/VirtualTableTile.d.ts.map +1 -0
- package/dist/esm/components/VirtualTableTile.js +48 -0
- package/dist/esm/components/index.d.ts +5 -5
- package/dist/esm/components/index.d.ts.map +1 -1
- package/dist/esm/components/index.js +5 -5
- package/dist/esm/constants/dataTypes.d.ts.map +1 -1
- package/dist/esm/constants/dataTypes.js +2 -0
- package/dist/esm/forms/client_onboard/ConnectDatabase.d.ts +15 -6
- package/dist/esm/forms/client_onboard/ConnectDatabase.d.ts.map +1 -1
- package/dist/esm/forms/client_onboard/ConnectDatabase.js +211 -98
- package/dist/esm/forms/client_onboard/ConnectSchema.d.ts +13 -9
- package/dist/esm/forms/client_onboard/ConnectSchema.d.ts.map +1 -1
- package/dist/esm/forms/client_onboard/ConnectSchema.js +160 -238
- package/dist/esm/forms/client_onboard/CreateVirtualTables.d.ts +47 -0
- package/dist/esm/forms/client_onboard/CreateVirtualTables.d.ts.map +1 -0
- package/dist/esm/forms/client_onboard/CreateVirtualTables.js +388 -0
- package/dist/esm/forms/client_onboard/__tests__/ConnectDatabase.test.d.ts +2 -0
- package/dist/esm/forms/client_onboard/__tests__/ConnectDatabase.test.d.ts.map +1 -0
- package/dist/esm/forms/client_onboard/__tests__/ConnectDatabase.test.js +566 -0
- package/dist/esm/forms/client_onboard/__tests__/ConnectSchema.test.d.ts +2 -0
- package/dist/esm/forms/client_onboard/__tests__/ConnectSchema.test.d.ts.map +1 -0
- package/dist/esm/forms/client_onboard/__tests__/ConnectSchema.test.js +454 -0
- package/dist/esm/forms/client_onboard/__tests__/CreateVirtualTables.test.d.ts +2 -0
- package/dist/esm/forms/client_onboard/__tests__/CreateVirtualTables.test.d.ts.map +1 -0
- package/dist/esm/forms/client_onboard/__tests__/CreateVirtualTables.test.js +380 -0
- package/dist/esm/forms/virtual_tables/CreateEditVirtualTable.d.ts +20 -0
- package/dist/esm/forms/virtual_tables/CreateEditVirtualTable.d.ts.map +1 -0
- package/dist/esm/forms/virtual_tables/CreateEditVirtualTable.js +288 -0
- package/dist/esm/hooks/useDashboardManager.d.ts +16 -0
- package/dist/esm/hooks/useDashboardManager.d.ts.map +1 -0
- package/dist/esm/hooks/useDashboardManager.js +109 -0
- package/dist/esm/hooks/useDatabaseSchema.d.ts +5 -0
- package/dist/esm/hooks/useDatabaseSchema.d.ts.map +1 -0
- package/dist/esm/hooks/useDatabaseSchema.js +50 -0
- package/dist/esm/hooks/useItemBeingEdited.d.ts +1 -2
- package/dist/esm/hooks/useItemBeingEdited.d.ts.map +1 -1
- package/dist/esm/hooks/useItemBeingEdited.js +3 -15
- package/dist/esm/hooks/useOnClickOutside.d.ts +4 -1
- package/dist/esm/hooks/useOnClickOutside.d.ts.map +1 -1
- package/dist/esm/hooks/useOnClickOutside.js +49 -8
- package/dist/esm/hooks/useTenants.d.ts +13 -0
- package/dist/esm/hooks/useTenants.d.ts.map +1 -0
- package/dist/esm/hooks/useTenants.js +170 -0
- package/dist/esm/hooks/useThrottle.d.ts +2 -0
- package/dist/esm/hooks/useThrottle.d.ts.map +1 -0
- package/dist/esm/hooks/useThrottle.js +11 -0
- package/dist/esm/icons/CheckCircleIcon.d.ts +5 -0
- package/dist/esm/icons/CheckCircleIcon.d.ts.map +1 -0
- package/dist/esm/icons/CheckCircleIcon.js +3 -0
- package/dist/esm/icons/DownChevronIcon.d.ts +2 -0
- package/dist/esm/icons/DownChevronIcon.d.ts.map +1 -0
- package/dist/esm/icons/DownChevronIcon.js +4 -0
- package/dist/esm/icons/ExclamationFilledIcon.d.ts +5 -0
- package/dist/esm/icons/ExclamationFilledIcon.d.ts.map +1 -0
- package/dist/esm/icons/ExclamationFilledIcon.js +3 -0
- package/dist/esm/icons/ExteriorLinkIcon.d.ts +5 -0
- package/dist/esm/icons/ExteriorLinkIcon.d.ts.map +1 -0
- package/dist/esm/icons/ExteriorLinkIcon.js +3 -0
- package/dist/esm/icons/GlobeIcon.d.ts +5 -0
- package/dist/esm/icons/GlobeIcon.d.ts.map +1 -0
- package/dist/esm/icons/GlobeIcon.js +12 -0
- package/dist/esm/icons/InformationCircleIcon.d.ts +4 -0
- package/dist/esm/icons/InformationCircleIcon.d.ts.map +1 -0
- package/dist/esm/icons/InformationCircleIcon.js +4 -0
- package/dist/esm/icons/LeftChevronIcon.d.ts +2 -0
- package/dist/esm/icons/LeftChevronIcon.d.ts.map +1 -0
- package/dist/esm/icons/LeftChevronIcon.js +4 -0
- package/dist/esm/icons/QuestionMarkCircleIcon.d.ts +5 -0
- package/dist/esm/icons/QuestionMarkCircleIcon.d.ts.map +1 -0
- package/dist/esm/icons/QuestionMarkCircleIcon.js +3 -0
- package/dist/esm/icons/RightChevronIcon.d.ts +2 -0
- package/dist/esm/icons/RightChevronIcon.d.ts.map +1 -0
- package/dist/esm/icons/RightChevronIcon.js +4 -0
- package/dist/esm/icons/XMarkIcon.d.ts +0 -1
- package/dist/esm/icons/XMarkIcon.d.ts.map +1 -1
- package/dist/esm/index.d.ts +2 -3
- package/dist/esm/index.d.ts.map +1 -1
- package/dist/esm/index.js +3 -3
- package/dist/esm/modals/CodePreview.d.ts +6 -0
- package/dist/esm/modals/CodePreview.d.ts.map +1 -0
- package/dist/esm/modals/CodePreview.js +145 -0
- package/dist/esm/modals/EditEnvironmentModal.d.ts +15 -0
- package/dist/esm/modals/EditEnvironmentModal.d.ts.map +1 -0
- package/dist/esm/modals/EditEnvironmentModal.js +545 -0
- package/dist/esm/modals/EditFiltersModal.d.ts +14 -10
- package/dist/esm/modals/EditFiltersModal.d.ts.map +1 -1
- package/dist/esm/modals/EditFiltersModal.js +1226 -264
- package/dist/esm/modals/NewDashboardModal.d.ts +6 -8
- package/dist/esm/modals/NewDashboardModal.d.ts.map +1 -1
- package/dist/esm/modals/NewDashboardModal.js +148 -146
- package/dist/esm/modals/PromoteDashboardModal.d.ts +16 -0
- package/dist/esm/modals/PromoteDashboardModal.d.ts.map +1 -0
- package/dist/esm/modals/PromoteDashboardModal.js +53 -0
- package/dist/esm/modals/PromoteReportModal.d.ts +15 -0
- package/dist/esm/modals/PromoteReportModal.d.ts.map +1 -0
- package/dist/esm/modals/PromoteReportModal.js +125 -0
- package/dist/esm/modals/PromoteViewModal.d.ts +5 -5
- package/dist/esm/modals/PromoteViewModal.d.ts.map +1 -1
- package/dist/esm/modals/PromoteViewModal.js +58 -94
- package/dist/esm/modals/ReorderDashboardModal.d.ts +1 -2
- package/dist/esm/modals/ReorderDashboardModal.d.ts.map +1 -1
- package/dist/esm/modals/ReorderDashboardModal.js +34 -20
- package/dist/esm/modals/SavedQueriesModal.d.ts +7 -0
- package/dist/esm/modals/SavedQueriesModal.d.ts.map +1 -0
- package/dist/esm/modals/SavedQueriesModal.js +125 -0
- package/dist/esm/modals/index.d.ts +0 -1
- package/dist/esm/modals/index.d.ts.map +1 -1
- package/dist/esm/modals/index.js +0 -1
- package/dist/esm/primitives/ButtonPrimitive.d.ts +3 -1
- package/dist/esm/primitives/ButtonPrimitive.d.ts.map +1 -1
- package/dist/esm/primitives/ButtonPrimitive.js +25 -17
- package/dist/esm/primitives/CheckboxPrimitive.d.ts +12 -0
- package/dist/esm/primitives/CheckboxPrimitive.d.ts.map +1 -0
- package/dist/esm/primitives/CheckboxPrimitive.js +27 -0
- package/dist/esm/primitives/HeaderPrimitive.d.ts.map +1 -1
- package/dist/esm/primitives/HeaderPrimitive.js +1 -1
- package/dist/esm/primitives/MiniButtonPrimitive.d.ts +7 -0
- package/dist/esm/primitives/MiniButtonPrimitive.d.ts.map +1 -0
- package/dist/esm/primitives/MiniButtonPrimitive.js +54 -0
- package/dist/esm/primitives/ModalPrimitive.d.ts +2 -10
- package/dist/esm/primitives/ModalPrimitive.d.ts.map +1 -1
- package/dist/esm/primitives/ModalPrimitive.js +7 -7
- package/dist/esm/primitives/PlaceholderPrimitive.d.ts +5 -0
- package/dist/esm/primitives/PlaceholderPrimitive.d.ts.map +1 -0
- package/dist/esm/primitives/PlaceholderPrimitive.js +15 -0
- package/dist/esm/primitives/PopoverPrimitive.d.ts +8 -0
- package/dist/esm/primitives/PopoverPrimitive.d.ts.map +1 -0
- package/dist/esm/primitives/PopoverPrimitive.js +49 -0
- package/dist/esm/primitives/SecondaryButtonPrimitive.d.ts +3 -1
- package/dist/esm/primitives/SecondaryButtonPrimitive.d.ts.map +1 -1
- package/dist/esm/primitives/SecondaryButtonPrimitive.js +14 -11
- package/dist/esm/primitives/TextInputPrimitive.d.ts +7 -2
- package/dist/esm/primitives/TextInputPrimitive.d.ts.map +1 -1
- package/dist/esm/primitives/TextInputPrimitive.js +77 -12
- package/dist/esm/primitives/TogglePrimitive.d.ts +6 -3
- package/dist/esm/primitives/TogglePrimitive.d.ts.map +1 -1
- package/dist/esm/primitives/TogglePrimitive.js +10 -7
- package/dist/esm/primitives/index.d.ts +1 -1
- package/dist/esm/primitives/index.d.ts.map +1 -1
- package/dist/esm/primitives/index.js +1 -1
- package/dist/esm/public_components/ChartQueryBuilder.d.ts +9 -0
- package/dist/esm/public_components/ChartQueryBuilder.d.ts.map +1 -0
- package/dist/esm/public_components/ChartQueryBuilder.js +125 -0
- package/dist/esm/public_components/CreateEnvironment.d.ts +1 -1
- package/dist/esm/public_components/CreateEnvironment.d.ts.map +1 -1
- package/dist/esm/public_components/CreateEnvironment.js +152 -75
- package/dist/esm/public_components/DashboardManager.d.ts +2 -2
- package/dist/esm/public_components/DashboardManager.d.ts.map +1 -1
- package/dist/esm/public_components/DashboardManager.js +350 -191
- package/dist/esm/public_components/EnvSelectPopover.d.ts +12 -0
- package/dist/esm/public_components/EnvSelectPopover.d.ts.map +1 -0
- package/dist/esm/public_components/EnvSelectPopover.js +138 -0
- package/dist/esm/public_components/{SQLViewManager.d.ts → VirtualTableManager.d.ts} +3 -2
- package/dist/esm/public_components/VirtualTableManager.d.ts.map +1 -0
- package/dist/esm/public_components/VirtualTableManager.js +723 -0
- package/dist/esm/public_components/__tests__/CreateEnvironment.test.d.ts +2 -0
- package/dist/esm/public_components/__tests__/CreateEnvironment.test.d.ts.map +1 -0
- package/dist/esm/public_components/__tests__/CreateEnvironment.test.js +680 -0
- package/dist/esm/utils/astProcessing.d.ts +14 -1
- package/dist/esm/utils/astProcessing.d.ts.map +1 -1
- package/dist/esm/utils/astProcessing.js +67 -6
- package/dist/esm/utils/astProcessing.uspec.js +8 -4
- package/dist/esm/utils/columnProcessing.d.ts +12 -0
- package/dist/esm/utils/columnProcessing.d.ts.map +1 -1
- package/dist/esm/utils/columnProcessing.js +167 -4
- package/dist/esm/utils/constants.d.ts +4 -21
- package/dist/esm/utils/constants.d.ts.map +1 -1
- package/dist/esm/utils/constants.js +18 -9
- package/dist/esm/utils/dataEditor.d.ts +4 -3
- package/dist/esm/utils/dataEditor.d.ts.map +1 -1
- package/dist/esm/utils/dataEditor.js +65 -117
- package/dist/esm/utils/dataFetcher.d.ts +20 -2
- package/dist/esm/utils/dataFetcher.d.ts.map +1 -1
- package/dist/esm/utils/dataFetcher.js +44 -53
- package/dist/esm/utils/databases.d.ts +20 -8
- package/dist/esm/utils/databases.d.ts.map +1 -1
- package/dist/esm/utils/databases.js +60 -21
- package/dist/esm/utils/filter.d.ts +222 -0
- package/dist/esm/utils/filter.d.ts.map +1 -0
- package/dist/esm/utils/filter.js +343 -0
- package/dist/esm/utils/monacoAutocomplete.d.ts +2 -1
- package/dist/esm/utils/monacoAutocomplete.d.ts.map +1 -1
- package/dist/esm/utils/monacoAutocomplete.js +146 -41
- package/dist/esm/utils/report.d.ts +120 -0
- package/dist/esm/utils/report.d.ts.map +1 -0
- package/dist/esm/utils/report.js +106 -0
- package/dist/esm/utils/schema.d.ts +41 -29
- package/dist/esm/utils/schema.d.ts.map +1 -1
- package/dist/esm/utils/schema.js +133 -88
- package/dist/esm/utils/table.d.ts +70 -4
- package/dist/esm/utils/table.d.ts.map +1 -1
- package/dist/esm/utils/tenants.d.ts +48 -0
- package/dist/esm/utils/tenants.d.ts.map +1 -0
- package/dist/esm/utils/tenants.js +31 -0
- package/dist/esm/utils/ui.d.ts +2 -0
- package/dist/esm/utils/ui.d.ts.map +1 -0
- package/dist/esm/utils/ui.js +14 -0
- package/dist/esm/utils/validation.d.ts +2 -0
- package/dist/esm/utils/validation.d.ts.map +1 -0
- package/dist/esm/utils/validation.js +74 -0
- package/dist/esm/utils/validation.uspec.d.ts +2 -0
- package/dist/esm/utils/validation.uspec.d.ts.map +1 -0
- package/dist/esm/utils/validation.uspec.js +51 -0
- package/package.json +22 -9
- package/dist/cjs/components/EnvSelectPopover.d.ts +0 -13
- package/dist/cjs/components/EnvSelectPopover.d.ts.map +0 -1
- package/dist/cjs/components/EnvSelectPopover.js +0 -224
- package/dist/cjs/components/SqlViewTile.d.ts +0 -8
- package/dist/cjs/components/SqlViewTile.d.ts.map +0 -1
- package/dist/cjs/components/SqlViewTile.js +0 -69
- package/dist/cjs/forms/client_onboard/CreateSqlViews.d.ts +0 -24
- package/dist/cjs/forms/client_onboard/CreateSqlViews.d.ts.map +0 -1
- package/dist/cjs/forms/client_onboard/CreateSqlViews.js +0 -250
- package/dist/cjs/forms/sql_views/CreateEditSqlView.d.ts +0 -29
- package/dist/cjs/forms/sql_views/CreateEditSqlView.d.ts.map +0 -1
- package/dist/cjs/forms/sql_views/CreateEditSqlView.js +0 -228
- package/dist/cjs/modals/PromoteDashModal.d.ts +0 -17
- package/dist/cjs/modals/PromoteDashModal.d.ts.map +0 -1
- package/dist/cjs/modals/PromoteDashModal.js +0 -133
- package/dist/cjs/primitives/SelectPrimitive.d.ts +0 -16
- package/dist/cjs/primitives/SelectPrimitive.d.ts.map +0 -1
- package/dist/cjs/primitives/SelectPrimitive.js +0 -43
- package/dist/cjs/public_components/DashboardBuilder.d.ts +0 -7
- package/dist/cjs/public_components/DashboardBuilder.d.ts.map +0 -1
- package/dist/cjs/public_components/DashboardBuilder.js +0 -220
- package/dist/cjs/public_components/SQLViewManager.d.ts.map +0 -1
- package/dist/cjs/public_components/SQLViewManager.js +0 -563
- package/dist/esm/components/EnvSelectPopover.d.ts +0 -13
- package/dist/esm/components/EnvSelectPopover.d.ts.map +0 -1
- package/dist/esm/components/EnvSelectPopover.js +0 -221
- package/dist/esm/components/SqlViewTile.d.ts +0 -8
- package/dist/esm/components/SqlViewTile.d.ts.map +0 -1
- package/dist/esm/components/SqlViewTile.js +0 -40
- package/dist/esm/forms/client_onboard/CreateSqlViews.d.ts +0 -24
- package/dist/esm/forms/client_onboard/CreateSqlViews.d.ts.map +0 -1
- package/dist/esm/forms/client_onboard/CreateSqlViews.js +0 -242
- package/dist/esm/forms/sql_views/CreateEditSqlView.d.ts +0 -29
- package/dist/esm/forms/sql_views/CreateEditSqlView.d.ts.map +0 -1
- package/dist/esm/forms/sql_views/CreateEditSqlView.js +0 -222
- package/dist/esm/modals/PromoteDashModal.d.ts +0 -17
- package/dist/esm/modals/PromoteDashModal.d.ts.map +0 -1
- package/dist/esm/modals/PromoteDashModal.js +0 -130
- package/dist/esm/primitives/SelectPrimitive.d.ts +0 -16
- package/dist/esm/primitives/SelectPrimitive.d.ts.map +0 -1
- package/dist/esm/primitives/SelectPrimitive.js +0 -41
- package/dist/esm/public_components/DashboardBuilder.d.ts +0 -7
- package/dist/esm/public_components/DashboardBuilder.d.ts.map +0 -1
- package/dist/esm/public_components/DashboardBuilder.js +0 -214
- package/dist/esm/public_components/SQLViewManager.d.ts.map +0 -1
- package/dist/esm/public_components/SQLViewManager.js +0 -555
package/dist/esm/Admin.js
CHANGED
|
@@ -1,175 +1,35 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { createElement as _createElement } from "react";
|
|
2
|
+
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
2
3
|
import { useState, useEffect, useRef, useCallback } from 'react';
|
|
3
|
-
import {
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
import
|
|
12
|
-
|
|
4
|
+
import {
|
|
5
|
+
// QuillProvider,
|
|
6
|
+
ChartEditor, ReportBuilder, useQuill, } from '@quillsql/react';
|
|
7
|
+
import { Highlight, themes } from 'prism-react-renderer';
|
|
8
|
+
// import { DashboardManager } from './components';
|
|
9
|
+
import {
|
|
10
|
+
// AdminProvider,
|
|
11
|
+
useAdmin, } from './AdminProvider';
|
|
12
|
+
// import {
|
|
13
|
+
// HeaderPrimitive,
|
|
14
|
+
// ModalPrimitive,
|
|
15
|
+
// TextInputPrimitive,
|
|
16
|
+
// } from './primitives';
|
|
17
|
+
import { LoadingSpinner, MemoizedButton,
|
|
18
|
+
// MemoizedSecondaryButton,
|
|
19
|
+
// TextInputComponentProps,
|
|
20
|
+
} from './components/UiComponents';
|
|
21
|
+
// import ChartQueryBuilder from './public_components/ChartQueryBuilder';
|
|
22
|
+
// import VirtualTableManager from './public_components/VirtualTableManager';
|
|
13
23
|
import { MemoizedModal } from './components/UiComponents';
|
|
14
24
|
import { SQLEditor } from '@quillsql/react';
|
|
15
|
-
import
|
|
16
|
-
|
|
25
|
+
import QuillTab from './components/QuillTab';
|
|
26
|
+
import { parseQuillReportToQuillReportInternal } from './utils/report';
|
|
27
|
+
import { useDashboardManager } from './hooks/useDashboardManager';
|
|
28
|
+
import PromoteReportModal from './modals/PromoteReportModal';
|
|
29
|
+
import { CheckboxPrimitive, HeaderPrimitive, ModalPrimitive, } from './primitives';
|
|
30
|
+
import { QuillSelectComponentWithCombo } from './components/QuillSelectWithCombo';
|
|
31
|
+
import { quillFetch } from './utils/dataFetcher';
|
|
17
32
|
export const defaultTheme = {
|
|
18
|
-
fontFamily: 'Inter; Helvetica',
|
|
19
|
-
backgroundColor: '#FFFFFF',
|
|
20
|
-
primaryTextColor: '#364153',
|
|
21
|
-
secondaryTextColor: '#6C727F',
|
|
22
|
-
chartLabelFontFamily: 'Inter; Helvetica',
|
|
23
|
-
chartLabelColor: '#666666',
|
|
24
|
-
chartTickColor: '#CCCCCC',
|
|
25
|
-
chartColors: ['#6269E9', '#E14F62', '#55B5A6', '#E9A23B', '#D0ACCF'],
|
|
26
|
-
borderColor: '#E5E7EB',
|
|
27
|
-
primaryButtonColor: '#364153',
|
|
28
|
-
borderWidth: 1,
|
|
29
|
-
labelFontWeight: 500,
|
|
30
|
-
fontSize: 14,
|
|
31
|
-
};
|
|
32
|
-
export default function Portal({ publicKey, queryEndpoint, theme = defaultTheme, queryHeaders, withCredentials, environment, organizationId, TextInputComponent, ButtonComponent = MemoizedButton, SecondaryButtonComponent = MemoizedSecondaryButton, ModalComponent, SelectComponent, OrganizationSelectComponent, UserManagementComponent, HeaderComponent, }) {
|
|
33
|
-
return (_jsx(AdminProvider, { publicKey: publicKey, children: _jsx(Navigation, { theme: theme, publicKey: publicKey, queryEndpoint: queryEndpoint, queryHeaders: queryHeaders, withCredentials: withCredentials,
|
|
34
|
-
// @ts-ignore
|
|
35
|
-
TextInputComponent: TextInputComponent || TextInputPrimitive, ButtonComponent: ButtonComponent,
|
|
36
|
-
// @ts-ignore
|
|
37
|
-
HeaderComponent: HeaderComponent || HeaderPrimitive, SecondaryButtonComponent: SecondaryButtonComponent,
|
|
38
|
-
// @ts-ignore
|
|
39
|
-
ModalComponent: ModalComponent || ModalPrimitive, environment: environment, OrganizationSelectComponent: OrganizationSelectComponent, UserManagementComponent: UserManagementComponent,
|
|
40
|
-
// @ts-ignore
|
|
41
|
-
SelectComponent: SelectComponent || SelectPrimitive }) }));
|
|
42
|
-
}
|
|
43
|
-
function Navigation({ TextInputComponent, ButtonComponent, SecondaryButtonComponent, ModalComponent, SelectComponent, OrganizationSelectComponent, UserManagementComponent, HeaderComponent, publicKey, queryEndpoint, queryHeaders, environment, withCredentials, }) {
|
|
44
|
-
const { state, dispatch } = useAdmin();
|
|
45
|
-
// MMTODO: Idk if this is needed
|
|
46
|
-
// useEffect(() => {
|
|
47
|
-
// setEnvironmentContext(environment);
|
|
48
|
-
// }, [environment]);
|
|
49
|
-
if (!state.client) {
|
|
50
|
-
return null;
|
|
51
|
-
}
|
|
52
|
-
const renderComponentBasedOnName = () => {
|
|
53
|
-
switch (state.activeComponent) {
|
|
54
|
-
case 'Dashboards':
|
|
55
|
-
return (_jsx(DashboardManager
|
|
56
|
-
// @ts-ignore
|
|
57
|
-
, {
|
|
58
|
-
// @ts-ignore
|
|
59
|
-
TextInputComponent: TextInputComponent, ButtonComponent: ButtonComponent, SecondaryButtonComponent: SecondaryButtonComponent, ModalComponent: ModalComponent, SelectComponent: SelectComponent, HeaderComponent: HeaderComponent, setReportId: (id) => dispatch({ type: 'SET_REPORT_ID', payload: id }), queryEndpoint: queryEndpoint, queryHeaders: queryHeaders, withCredentials: withCredentials }));
|
|
60
|
-
case 'SQL editor':
|
|
61
|
-
return _jsx(DashboardBuilder, {});
|
|
62
|
-
case 'SQL views':
|
|
63
|
-
return _jsx(SQLViewManager, {});
|
|
64
|
-
default:
|
|
65
|
-
return (_jsx(DashboardManager
|
|
66
|
-
// @ts-ignore
|
|
67
|
-
, {
|
|
68
|
-
// @ts-ignore
|
|
69
|
-
TextInputComponent: TextInputComponent, ButtonComponent: ButtonComponent, SecondaryButtonComponent: SecondaryButtonComponent, ModalComponent: ModalComponent, SelectComponent: SelectComponent, HeaderComponent: HeaderComponent, setReportId: (id) => dispatch({ type: 'SET_REPORT_ID', payload: id }), queryEndpoint: queryEndpoint, queryHeaders: queryHeaders, withCredentials: withCredentials }));
|
|
70
|
-
}
|
|
71
|
-
};
|
|
72
|
-
return (_jsxs("div", { style: {
|
|
73
|
-
display: 'flex',
|
|
74
|
-
flexDirection: 'column',
|
|
75
|
-
height: '100vh',
|
|
76
|
-
width: '100vw',
|
|
77
|
-
}, children: [_jsxs("nav", { style: {
|
|
78
|
-
zIndex: 2,
|
|
79
|
-
height: '70px',
|
|
80
|
-
width: '100%',
|
|
81
|
-
display: 'flex',
|
|
82
|
-
flexDirection: 'row',
|
|
83
|
-
justifyContent: 'space-between',
|
|
84
|
-
alignItems: 'center',
|
|
85
|
-
backgroundColor: 'white',
|
|
86
|
-
padding: '0',
|
|
87
|
-
position: 'fixed',
|
|
88
|
-
top: 0,
|
|
89
|
-
left: 0,
|
|
90
|
-
right: 0,
|
|
91
|
-
borderBottomWidth: 1,
|
|
92
|
-
borderTopWidth: 0,
|
|
93
|
-
borderLeftWidth: 0,
|
|
94
|
-
borderRightWidth: 0,
|
|
95
|
-
borderStyle: 'solid',
|
|
96
|
-
borderColor: theme.borderColor,
|
|
97
|
-
}, children: [_jsx("div", { style: {
|
|
98
|
-
paddingTop: '18px',
|
|
99
|
-
paddingLeft: '14px',
|
|
100
|
-
paddingBottom: '18px',
|
|
101
|
-
width: 230,
|
|
102
|
-
}, children: _jsxs("svg", { width: "45", height: "18", viewBox: "0 0 45 18", fill: "none", xmlns: "http://www.w3.org/2000/svg", children: [_jsx("g", { clipPath: "url(#clip0_2489_282)", children: _jsx("path", { d: "M18.634 17.3008H9.196C7.97867 17.3008 6.84933 17.1248 5.808 16.7728C4.78133 16.4061 3.894 15.8781 3.146 15.1888C2.398 14.4994 1.81133 13.6634 1.386 12.6808C0.960667 11.6981 0.748 10.5761 0.748 9.31478C0.748 8.14145 0.960667 7.06345 1.386 6.08078C1.826 5.09811 2.42 4.25478 3.168 3.55078C3.916 2.84678 4.796 2.30411 5.808 1.92278C6.82 1.52678 7.90533 1.32878 9.064 1.32878C10.2227 1.32878 11.308 1.52678 12.32 1.92278C13.332 2.31878 14.212 2.86878 14.96 3.57278C15.708 4.27678 16.2947 5.12011 16.72 6.10278C17.16 7.07078 17.38 8.14145 17.38 9.31478C17.38 9.87211 17.314 10.4148 17.182 10.9428C17.0647 11.4708 16.8813 11.9694 16.632 12.4388C16.3827 12.9081 16.06 13.3334 15.664 13.7148C15.268 14.0814 14.806 14.3821 14.278 14.6168V14.6608H18.634V17.3008ZM4.312 9.31478C4.312 9.98945 4.43667 10.6201 4.686 11.2068C4.93533 11.7934 5.27267 12.3068 5.698 12.7468C6.138 13.1721 6.644 13.5094 7.216 13.7588C7.788 14.0081 8.404 14.1328 9.064 14.1328C9.724 14.1328 10.34 14.0081 10.912 13.7588C11.484 13.5094 11.9827 13.1721 12.408 12.7468C12.848 12.3068 13.1927 11.7934 13.442 11.2068C13.6913 10.6201 13.816 9.98945 13.816 9.31478C13.816 8.64011 13.6913 8.00945 13.442 7.42278C13.1927 6.83611 12.848 6.33011 12.408 5.90478C11.9827 5.46478 11.484 5.12011 10.912 4.87078C10.34 4.62145 9.724 4.49678 9.064 4.49678C8.404 4.49678 7.788 4.62145 7.216 4.87078C6.644 5.12011 6.138 5.46478 5.698 5.90478C5.27267 6.33011 4.93533 6.83611 4.686 7.42278C4.43667 8.00945 4.312 8.64011 4.312 9.31478ZM29.3164 17.3008H26.1484V15.8488H26.1044C25.987 16.0541 25.833 16.2594 25.6424 16.4648C25.4664 16.6701 25.2464 16.8534 24.9824 17.0148C24.7184 17.1761 24.4177 17.3081 24.0804 17.4108C23.743 17.5134 23.3764 17.5648 22.9804 17.5648C22.1444 17.5648 21.4624 17.4401 20.9344 17.1908C20.421 16.9268 20.0177 16.5674 19.7244 16.1128C19.4457 15.6581 19.255 15.1228 19.1524 14.5068C19.0644 13.8908 19.0204 13.2234 19.0204 12.5048V6.60878H22.3204V11.8448C22.3204 12.1528 22.3277 12.4754 22.3424 12.8128C22.3717 13.1354 22.4377 13.4361 22.5404 13.7148C22.6577 13.9934 22.8264 14.2208 23.0464 14.3968C23.281 14.5728 23.611 14.6608 24.0364 14.6608C24.4617 14.6608 24.8064 14.5874 25.0704 14.4408C25.3344 14.2794 25.5324 14.0741 25.6644 13.8248C25.811 13.5608 25.9064 13.2674 25.9504 12.9448C25.9944 12.6221 26.0164 12.2848 26.0164 11.9328V6.60878H29.3164V17.3008ZM30.8172 6.60878H34.1172V17.3008H30.8172V6.60878ZM30.5532 3.24278C30.5532 2.71478 30.7365 2.26745 31.1032 1.90078C31.4845 1.51945 31.9392 1.32878 32.4672 1.32878C32.9952 1.32878 33.4425 1.51945 33.8092 1.90078C34.1905 2.26745 34.3812 2.71478 34.3812 3.24278C34.3812 3.77078 34.1905 4.22545 33.8092 4.60678C33.4425 4.97345 32.9952 5.15678 32.4672 5.15678C31.9392 5.15678 31.4845 4.97345 31.1032 4.60678C30.7365 4.22545 30.5532 3.77078 30.5532 3.24278ZM35.652 0.66878H38.952V17.3008H35.652V0.66878ZM40.4869 0.66878H43.7869V17.3008H40.4869V0.66878Z", fill: "#212121" }) }), _jsx("defs", { children: _jsx("clipPath", { id: "clip0_2489_282", children: _jsx("rect", { width: "45", height: "18", fill: "white" }) }) })] }) }), _jsxs("div", { style: { display: 'flex', flexDirection: 'row' }, children: [_jsx("button", { style: {
|
|
103
|
-
color: '#212121',
|
|
104
|
-
backgroundColor: state.activeComponent === 'Dashboards'
|
|
105
|
-
? '#2121210A'
|
|
106
|
-
: 'transparent',
|
|
107
|
-
padding: '8px 12px',
|
|
108
|
-
height: '38px',
|
|
109
|
-
marginBottom: '4px',
|
|
110
|
-
fontWeight: 'bold',
|
|
111
|
-
fontSize: '0.875rem',
|
|
112
|
-
borderRadius: '4px',
|
|
113
|
-
transition: 'background-color 0.3s',
|
|
114
|
-
border: 'none',
|
|
115
|
-
outline: 'none',
|
|
116
|
-
},
|
|
117
|
-
// onClick={() => setActiveComponent("Dashboards")}
|
|
118
|
-
onClick: () => dispatch({ type: 'SET_ACTIVE_COMPONENT', payload: 'Dashboards' }), children: "Dashboards" }), _jsx("button", { style: {
|
|
119
|
-
color: '#212121',
|
|
120
|
-
backgroundColor: state.activeComponent === 'SQL editor'
|
|
121
|
-
? '#2121210A'
|
|
122
|
-
: 'transparent',
|
|
123
|
-
padding: '8px 12px',
|
|
124
|
-
height: '38px',
|
|
125
|
-
marginBottom: '4px',
|
|
126
|
-
fontWeight: 'bold',
|
|
127
|
-
fontSize: '0.875rem',
|
|
128
|
-
borderRadius: '4px',
|
|
129
|
-
transition: 'background-color 0.3s',
|
|
130
|
-
border: 'none',
|
|
131
|
-
outline: 'none',
|
|
132
|
-
},
|
|
133
|
-
// onClick={() => setActiveComponent("SQL editor")}
|
|
134
|
-
onClick: () => dispatch({ type: 'SET_ACTIVE_COMPONENT', payload: 'SQL editor' }), children: "SQL editor" }), _jsx("button", { style: {
|
|
135
|
-
color: '#212121',
|
|
136
|
-
backgroundColor: state.activeComponent === 'SQL views'
|
|
137
|
-
? '#2121210A'
|
|
138
|
-
: 'transparent',
|
|
139
|
-
padding: '8px 12px',
|
|
140
|
-
height: '38px',
|
|
141
|
-
marginBottom: '4px',
|
|
142
|
-
fontWeight: 'bold',
|
|
143
|
-
fontSize: '0.875rem',
|
|
144
|
-
borderRadius: '4px',
|
|
145
|
-
transition: 'background-color 0.3s',
|
|
146
|
-
border: 'none',
|
|
147
|
-
outline: 'none',
|
|
148
|
-
},
|
|
149
|
-
// onClick={() => setActiveComponent("SQL views")}
|
|
150
|
-
onClick: () => dispatch({ type: 'SET_ACTIVE_COMPONENT', payload: 'SQL views' }), children: "SQL views" })] }), _jsx("div", { style: {
|
|
151
|
-
display: 'flex',
|
|
152
|
-
flexDirection: 'row',
|
|
153
|
-
minHeight: '50px',
|
|
154
|
-
justifyContent: 'flex-end',
|
|
155
|
-
alignItems: 'center',
|
|
156
|
-
paddingRight: '8px',
|
|
157
|
-
width: 230,
|
|
158
|
-
}, children: UserManagementComponent && _jsx(UserManagementComponent, {}) })] }), _jsx("div", { style: {
|
|
159
|
-
display: 'flex',
|
|
160
|
-
flexDirection: 'column',
|
|
161
|
-
height: '100%',
|
|
162
|
-
width: '100%',
|
|
163
|
-
// marginTop: activeComponent !== 'Report' ? '70px' : undefined
|
|
164
|
-
}, children: _jsx(QuillProvider
|
|
165
|
-
// organizationId={'2'}
|
|
166
|
-
// publicKey={client?._id}
|
|
167
|
-
, {
|
|
168
|
-
// organizationId={'2'}
|
|
169
|
-
// publicKey={client?._id}
|
|
170
|
-
organizationId: state.organizationId, queryEndpoint: queryEndpoint || '', withCredentials: withCredentials, queryHeaders: queryHeaders || {}, publicKey: state.client._id, environment: state.environment, theme: theme, children: renderComponentBasedOnName() }) })] }));
|
|
171
|
-
}
|
|
172
|
-
export const theme = {
|
|
173
33
|
fontFamily: 'Inter; Helvetica',
|
|
174
34
|
backgroundColor: '#FFFFFF',
|
|
175
35
|
primaryTextColor: '#364153',
|
|
@@ -186,35 +46,6 @@ export const theme = {
|
|
|
186
46
|
primaryButtonTextColor: '#FFFFFF',
|
|
187
47
|
hoverBackgroundColor: '#F4F4F5',
|
|
188
48
|
};
|
|
189
|
-
export function convertPostgresColumn(column) {
|
|
190
|
-
let format;
|
|
191
|
-
switch (column.dataTypeID) {
|
|
192
|
-
case 20: // int8
|
|
193
|
-
case 21: // int2
|
|
194
|
-
case 23: // int4
|
|
195
|
-
format = 'whole_number';
|
|
196
|
-
break;
|
|
197
|
-
case 700: // float4
|
|
198
|
-
case 701: // float8
|
|
199
|
-
case 1700: // numeric
|
|
200
|
-
format = 'two_decimal_places';
|
|
201
|
-
break;
|
|
202
|
-
case 1082: // date
|
|
203
|
-
case 1083: // time
|
|
204
|
-
case 1184: // timestamptz
|
|
205
|
-
case 1114: // timestamp
|
|
206
|
-
format = 'MMM_dd_yyyy';
|
|
207
|
-
break;
|
|
208
|
-
case 1043: // varchar
|
|
209
|
-
default:
|
|
210
|
-
format = 'string';
|
|
211
|
-
}
|
|
212
|
-
return {
|
|
213
|
-
label: column.name,
|
|
214
|
-
field: column.name,
|
|
215
|
-
format: format,
|
|
216
|
-
};
|
|
217
|
-
}
|
|
218
49
|
export function getPostgresBasicType(column) {
|
|
219
50
|
let format;
|
|
220
51
|
// first check if column.dataTypeID exists
|
|
@@ -256,6 +87,12 @@ export function getPostgresBasicType(column) {
|
|
|
256
87
|
case 'timestamp':
|
|
257
88
|
format = 'date';
|
|
258
89
|
break;
|
|
90
|
+
// case 'json':
|
|
91
|
+
// case 'jsonb':
|
|
92
|
+
// case 'json[]':
|
|
93
|
+
// case 'jsonb[]':
|
|
94
|
+
// format = 'object';
|
|
95
|
+
// break;
|
|
259
96
|
case 'varchar':
|
|
260
97
|
default:
|
|
261
98
|
format = 'string';
|
|
@@ -263,42 +100,165 @@ export function getPostgresBasicType(column) {
|
|
|
263
100
|
}
|
|
264
101
|
return format;
|
|
265
102
|
}
|
|
266
|
-
export function TableCell({ table,
|
|
267
|
-
const
|
|
268
|
-
|
|
269
|
-
};
|
|
270
|
-
return (_jsxs("div", { onClick: handleClickTableCell, style: {
|
|
271
|
-
marginBottom: '54px',
|
|
103
|
+
export function TableCell({ table, clickTableCellHeader, clickTableCellBody, hoverActions, isLoading, reloadAction, }) {
|
|
104
|
+
const { state } = useAdmin();
|
|
105
|
+
return (_jsxs("div", { className: `table-cell-${table._id}`, style: {
|
|
272
106
|
flex: 1,
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
107
|
+
// width: '460px',
|
|
108
|
+
borderRadius: 8,
|
|
109
|
+
border: '1px solid #E5E7EB',
|
|
110
|
+
boxShadow: '0px 2px 8px 0px rgba(56, 65, 81, 0.08)',
|
|
111
|
+
position: 'relative',
|
|
112
|
+
}, children: [_jsxs("div", { style: {
|
|
113
|
+
display: 'flex',
|
|
114
|
+
flexDirection: 'column',
|
|
115
|
+
justifyContent: 'space-between',
|
|
116
|
+
padding: '0.5em 0.5em 0.5em 1em',
|
|
117
|
+
borderBottom: '1px solid #E5E7EB',
|
|
118
|
+
borderTopLeftRadius: 8,
|
|
119
|
+
borderTopRightRadius: 8,
|
|
120
|
+
cursor: 'pointer',
|
|
121
|
+
}, onClick: () => {
|
|
122
|
+
clickTableCellHeader(table);
|
|
123
|
+
}, children: [_jsxs("div", { style: {
|
|
124
|
+
display: 'flex',
|
|
125
|
+
flexDirection: 'row',
|
|
126
|
+
alignItems: 'center',
|
|
127
|
+
justifyContent: 'space-between',
|
|
128
|
+
cursor: 'pointer',
|
|
129
|
+
}, children: [_jsx("h3", { style: {
|
|
130
|
+
fontFamily: defaultTheme?.fontFamily,
|
|
131
|
+
color: defaultTheme?.primaryTextColor,
|
|
132
|
+
boxSizing: 'content-box',
|
|
133
|
+
fontSize: 16,
|
|
134
|
+
height: 32,
|
|
135
|
+
alignContent: 'center',
|
|
136
|
+
marginTop: 'auto',
|
|
137
|
+
marginBottom: 'auto',
|
|
138
|
+
fontWeight: '500',
|
|
139
|
+
textOverflow: 'ellipsis',
|
|
140
|
+
padding: 0,
|
|
141
|
+
whiteSpace: 'nowrap',
|
|
142
|
+
display: 'block',
|
|
143
|
+
maxWidth: '100%',
|
|
144
|
+
overflow: 'hidden',
|
|
145
|
+
}, children: table.name }), table.broken ? (_jsxs("div", { style: {
|
|
146
|
+
display: 'flex',
|
|
147
|
+
flexDirection: 'row',
|
|
148
|
+
alignItems: 'center',
|
|
149
|
+
justifyContent: 'center',
|
|
150
|
+
gap: 2,
|
|
151
|
+
color: customError(table.error).severity === 'error'
|
|
152
|
+
? '#CA3A31'
|
|
153
|
+
: '#FFA500',
|
|
154
|
+
}, children: [_jsx("h3", { style: {
|
|
155
|
+
fontSize: 14,
|
|
156
|
+
}, children: customError(table.error).error }), isLoading ? (_jsx("div", { style: {
|
|
157
|
+
width: 32,
|
|
158
|
+
height: 32,
|
|
159
|
+
display: 'flex',
|
|
160
|
+
justifyContent: 'center',
|
|
161
|
+
alignItems: 'center',
|
|
162
|
+
}, children: _jsx(LoadingSpinner, {}) })) : (_jsxs("button", { style: {
|
|
163
|
+
height: 32,
|
|
164
|
+
width: 32,
|
|
165
|
+
color: defaultTheme?.secondaryTextColor,
|
|
166
|
+
borderRadius: 6,
|
|
167
|
+
outline: 'none',
|
|
168
|
+
cursor: 'pointer',
|
|
169
|
+
fontSize: 14,
|
|
170
|
+
display: 'flex',
|
|
171
|
+
flexDirection: 'row',
|
|
172
|
+
alignItems: 'center',
|
|
173
|
+
}, className: "secondary-button-quill", onClick: (event) => {
|
|
174
|
+
event.stopPropagation();
|
|
175
|
+
reloadAction && reloadAction(table);
|
|
176
|
+
}, children: [_jsx("style", { children: `.secondary-button-quill { background: white } .secondary-button-quill:hover { background: #F4F4F5 }` }), _jsx("svg", { xmlns: "http://www.w3.org/2000/svg", fill: "currentColor", viewBox: "0 0 16 16", strokeWidth: 1.5, height: 16, width: 16, style: {
|
|
177
|
+
marginLeft: 'auto',
|
|
178
|
+
marginRight: 'auto',
|
|
179
|
+
}, children: _jsx("path", { fillRule: "evenodd", d: "M13.836 2.477a.75.75 0 0 1 .75.75v3.182a.75.75 0 0 1-.75.75h-3.182a.75.75 0 0 1 0-1.5h1.37l-.84-.841a4.5 4.5 0 0 0-7.08.932.75.75 0 0 1-1.3-.75 6 6 0 0 1 9.44-1.242l.842.84V3.227a.75.75 0 0 1 .75-.75Zm-.911 7.5A.75.75 0 0 1 13.199 11a6 6 0 0 1-9.44 1.241l-.84-.84v1.371a.75.75 0 0 1-1.5 0V9.591a.75.75 0 0 1 .75-.75H5.35a.75.75 0 0 1 0 1.5H3.98l.841.841a4.5 4.5 0 0 0 7.08-.932.75.75 0 0 1 1.025-.273Z", clipRule: "evenodd" }) })] }))] })) : (_jsxs(_Fragment, { children: [isLoading && (_jsx("div", { style: {
|
|
180
|
+
width: 32,
|
|
181
|
+
height: 32,
|
|
182
|
+
display: 'flex',
|
|
183
|
+
justifyContent: 'center',
|
|
184
|
+
alignItems: 'center',
|
|
185
|
+
}, className: `table-cell-${table._id}-loading`, children: _jsx(LoadingSpinner, {}) })), hoverActions && (_jsx("div", { className: `table-cell-${table._id}-actions`, children: hoverActions(table) }))] }))] }), (table.ownerTenantFields?.length ?? 0) > 0 && (_jsx("div", { style: {
|
|
186
|
+
flexDirection: 'row',
|
|
187
|
+
display: 'flex',
|
|
188
|
+
gap: 4,
|
|
189
|
+
}, children: table.ownerTenantFields
|
|
190
|
+
?.map((tenantField) => {
|
|
191
|
+
return (state.client?.allTenantTypes?.find((t) => t.tenantField === tenantField)?.name || tenantField);
|
|
192
|
+
})
|
|
193
|
+
.map((tenantField) => (_jsx("div", { style: {
|
|
194
|
+
fontWeight: 300,
|
|
195
|
+
fontSize: 10,
|
|
196
|
+
color: defaultTheme?.primaryTextColor,
|
|
197
|
+
padding: 2,
|
|
198
|
+
paddingLeft: 4,
|
|
199
|
+
paddingRight: 4,
|
|
200
|
+
border: '1px solid #E5E7EB',
|
|
201
|
+
borderRadius: 32,
|
|
202
|
+
}, children: tenantField }, tenantField))) }))] }), _jsx(Highlight, { theme: themes.nightOwlLight, code: table?.viewQuery || '', language: "sql", children: ({ className, tokens, style, getLineProps, getTokenProps }) => (_jsx("pre", { className: className, onClick: () => {
|
|
203
|
+
clickTableCellBody(table);
|
|
204
|
+
}, style: {
|
|
277
205
|
...style,
|
|
278
206
|
textAlign: 'left',
|
|
279
|
-
|
|
280
|
-
padding: '0.5em',
|
|
207
|
+
padding: '1em',
|
|
281
208
|
overflow: 'auto',
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
209
|
+
height: (table.ownerTenantFields?.length ?? 0) > 0 ? 132 : 153,
|
|
210
|
+
width: '100%',
|
|
211
|
+
borderBottomLeftRadius: 8,
|
|
212
|
+
borderBottomRightRadius: 8,
|
|
213
|
+
cursor: 'pointer',
|
|
214
|
+
}, children: tokens.map((line, i) => (_createElement("div", { ...getLineProps({ line }), key: i, style: {
|
|
215
|
+
wordWrap: 'normal',
|
|
216
|
+
whiteSpace: 'normal',
|
|
217
|
+
} }, line.map((token, key) => (_jsx("span", { ...getTokenProps({ token }) }, key)))))) })) }), hoverActions && (_jsx("style", { children: `
|
|
218
|
+
.table-cell-${table._id}-actions {
|
|
219
|
+
display: none;
|
|
220
|
+
pointer-events: none;
|
|
221
|
+
}
|
|
222
|
+
.table-cell-${table._id}-loading {
|
|
223
|
+
display: block;
|
|
224
|
+
}
|
|
225
|
+
.table-cell-${table._id}:hover .table-cell-${table._id}-loading {
|
|
226
|
+
display: none !important;
|
|
227
|
+
}
|
|
228
|
+
.table-cell-${table._id}:hover .table-cell-${table._id}-actions {
|
|
229
|
+
display: block;
|
|
230
|
+
pointer-events: all;
|
|
231
|
+
}
|
|
232
|
+
` }))] }));
|
|
287
233
|
}
|
|
234
|
+
const customError = (error) => {
|
|
235
|
+
if (error === 'connect ETIMEDOUT') {
|
|
236
|
+
return { severity: 'warning', error: 'Query timed out' };
|
|
237
|
+
}
|
|
238
|
+
else if (error === 'read ECONNRESET' || error === 'socket hang up') {
|
|
239
|
+
return { severity: 'warning', error: 'Connection lost' };
|
|
240
|
+
}
|
|
241
|
+
else {
|
|
242
|
+
return { severity: 'error', error: 'Query failed' };
|
|
243
|
+
}
|
|
244
|
+
};
|
|
288
245
|
const FakeModal = ({ children }) => (_jsx("div", { style: { height: '100%' }, children: children }));
|
|
289
246
|
const FakeSQLEditorModal = ({ children, isOpen, }) => {
|
|
290
247
|
if (!isOpen)
|
|
291
248
|
return null;
|
|
292
249
|
return _jsx("div", { style: { height: '100%' }, children: children });
|
|
293
250
|
};
|
|
294
|
-
function
|
|
295
|
-
const { state, dispatch } = useAdmin();
|
|
296
|
-
const { data, loading
|
|
251
|
+
function QuillReportDetail({ reportId, isOpen, setIsOpen, deleteReport, handleSave, ModalComponent = MemoizedModal, fallbackData, }) {
|
|
252
|
+
const { state, dispatch, getToken } = useAdmin();
|
|
253
|
+
const { data, loading } = useQuill(reportId, {
|
|
254
|
+
rowsPerPage: 10,
|
|
255
|
+
rowsPerRequest: 100,
|
|
256
|
+
});
|
|
297
257
|
const parentRef = useRef(null);
|
|
298
258
|
const [modalWidth, setModalWidth] = useState(200);
|
|
299
259
|
const [modalHeight, setModalHeight] = useState(200);
|
|
300
260
|
const [isOpenChartBuilder, setIsOpenChartBuilder] = useState(false);
|
|
301
|
-
const [
|
|
261
|
+
const [isPromoteReportModalOpen, setIsPromoteReportModalOpen] = useState(false);
|
|
302
262
|
const handleResize = useCallback(() => {
|
|
303
263
|
const screenSize = window.innerWidth;
|
|
304
264
|
const isEditQuery = state.activeQuery && state.activeEditItem;
|
|
@@ -317,15 +277,6 @@ function QuillReport({ reportId, saveDashboardItem, isOpen, setIsOpen, isEditQue
|
|
|
317
277
|
window.removeEventListener('resize', handleResize);
|
|
318
278
|
};
|
|
319
279
|
}, [handleResize]);
|
|
320
|
-
useEffect(() => {
|
|
321
|
-
const selectedOrg = state.organizations.find((org) => {
|
|
322
|
-
const orgId = org.id ? org.id : org.ID;
|
|
323
|
-
return orgId && String(orgId) === String(state.organizationId);
|
|
324
|
-
});
|
|
325
|
-
if (selectedOrg) {
|
|
326
|
-
setSelectedOrgName(selectedOrg.name ? selectedOrg.name : selectedOrg.NAME);
|
|
327
|
-
}
|
|
328
|
-
}, [state.organizations, state.organizationId]);
|
|
329
280
|
const handleSetIsOpen = (isOpen) => {
|
|
330
281
|
if (!isOpen) {
|
|
331
282
|
dispatch({
|
|
@@ -337,29 +288,32 @@ function QuillReport({ reportId, saveDashboardItem, isOpen, setIsOpen, isEditQue
|
|
|
337
288
|
setIsOpenChartBuilder(isOpen);
|
|
338
289
|
setIsOpen(isOpen);
|
|
339
290
|
};
|
|
340
|
-
if (!data || loading) {
|
|
291
|
+
if ((!data && !fallbackData) || loading) {
|
|
341
292
|
return null;
|
|
342
293
|
}
|
|
343
|
-
return (_jsx("div", { ref: parentRef, children: _jsx(ModalComponent, { isOpen: isOpen, setIsOpen: handleSetIsOpen, title:
|
|
294
|
+
return (_jsx("div", { ref: parentRef, children: _jsx(ModalComponent, { isOpen: isOpen, setIsOpen: handleSetIsOpen, title: isOpenChartBuilder || (state.activeQuery && state.activeEditItem)
|
|
295
|
+
? 'Editing ' + (data?.name || fallbackData?.name || 'Report Detail')
|
|
296
|
+
: data?.name || fallbackData?.name || 'Report Detail', width: modalWidth, height: modalHeight, children: _jsxs("div", { style: {
|
|
344
297
|
width: '100%',
|
|
345
298
|
height: 'calc(100% - 52px)', // full height minus header height
|
|
346
299
|
display: 'flex',
|
|
347
300
|
flexDirection: 'column',
|
|
348
301
|
flexGrow: 1,
|
|
349
|
-
}, children: [
|
|
302
|
+
}, children: [!isOpenChartBuilder &&
|
|
303
|
+
!(state.activeEditItem && state.activeQuery) && (_jsxs("div", { style: {
|
|
350
304
|
display: 'flex',
|
|
351
305
|
alignItems: 'center',
|
|
352
306
|
gap: 16,
|
|
353
|
-
|
|
307
|
+
paddingLeft: 20,
|
|
354
308
|
}, children: [_jsxs("button", { style: {
|
|
355
309
|
height: 36,
|
|
356
|
-
color:
|
|
310
|
+
color: defaultTheme?.secondaryTextColor,
|
|
357
311
|
border: '1px solid #e7e7e7',
|
|
358
312
|
borderRadius: 6,
|
|
359
313
|
outline: 'none',
|
|
360
314
|
cursor: 'pointer',
|
|
361
|
-
fontFamily:
|
|
362
|
-
fontWeight:
|
|
315
|
+
fontFamily: defaultTheme?.fontFamily,
|
|
316
|
+
fontWeight: defaultTheme?.buttonFontWeight || 500,
|
|
363
317
|
fontSize: 14,
|
|
364
318
|
padding: '0px 12px',
|
|
365
319
|
display: 'flex',
|
|
@@ -367,7 +321,7 @@ function QuillReport({ reportId, saveDashboardItem, isOpen, setIsOpen, isEditQue
|
|
|
367
321
|
alignItems: 'center',
|
|
368
322
|
gap: 5,
|
|
369
323
|
}, onClick: () => {
|
|
370
|
-
setIsOpenChartBuilder(
|
|
324
|
+
setIsOpenChartBuilder(true);
|
|
371
325
|
dispatch({
|
|
372
326
|
type: 'SET_ACTIVE_QUERY',
|
|
373
327
|
payload: '',
|
|
@@ -375,20 +329,20 @@ function QuillReport({ reportId, saveDashboardItem, isOpen, setIsOpen, isEditQue
|
|
|
375
329
|
dispatch({ type: 'SET_ACTIVE_EDIT_ITEM', payload: null });
|
|
376
330
|
}, className: "secondary-button-quill", children: [_jsx("style", { children: `.secondary-button-quill { background: white } .secondary-button-quill:hover { background: #F4F4F5 }` }), _jsxs("svg", { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 20 20", fill: "currentColor", height: 15, width: 15, children: [_jsx("path", { d: "M12 9a1 1 0 0 1-1-1V3c0-.552.45-1.007.997-.93a7.004 7.004 0 0 1 5.933 5.933c.078.547-.378.997-.93.997h-5Z" }), _jsx("path", { d: "M8.003 4.07C8.55 3.994 9 4.449 9 5v5a1 1 0 0 0 1 1h5c.552 0 1.008.45.93.997A7.001 7.001 0 0 1 2 11a7.002 7.002 0 0 1 6.003-6.93Z" })] }), "Edit chart"] }), _jsxs("button", { style: {
|
|
377
331
|
height: 36,
|
|
378
|
-
color:
|
|
332
|
+
color: defaultTheme?.secondaryTextColor,
|
|
379
333
|
border: '1px solid #e7e7e7',
|
|
380
334
|
borderRadius: 6,
|
|
381
335
|
outline: 'none',
|
|
382
336
|
cursor: 'pointer',
|
|
383
|
-
fontFamily:
|
|
384
|
-
fontWeight:
|
|
337
|
+
fontFamily: defaultTheme?.fontFamily,
|
|
338
|
+
fontWeight: defaultTheme?.buttonFontWeight || 500,
|
|
385
339
|
fontSize: 14,
|
|
386
340
|
padding: '0px 12px',
|
|
387
341
|
display: 'flex',
|
|
388
342
|
flexDirection: 'row',
|
|
389
343
|
alignItems: 'center',
|
|
390
344
|
gap: 5,
|
|
391
|
-
}, onClick: () => {
|
|
345
|
+
}, onClick: async () => {
|
|
392
346
|
if (state.activeQuery && state.activeEditItem) {
|
|
393
347
|
dispatch({ type: 'SET_ACTIVE_QUERY', payload: '' });
|
|
394
348
|
dispatch({ type: 'SET_ACTIVE_EDIT_ITEM', payload: null });
|
|
@@ -396,215 +350,194 @@ function QuillReport({ reportId, saveDashboardItem, isOpen, setIsOpen, isEditQue
|
|
|
396
350
|
}
|
|
397
351
|
dispatch({
|
|
398
352
|
type: 'SET_ACTIVE_QUERY',
|
|
399
|
-
payload: data
|
|
353
|
+
payload: data?.queryString || fallbackData?.queryString,
|
|
354
|
+
});
|
|
355
|
+
const editItem = data?.queryString
|
|
356
|
+
? await parseQuillReportToQuillReportInternal(data, state.client, state.tables, getToken)
|
|
357
|
+
: fallbackData;
|
|
358
|
+
dispatch({
|
|
359
|
+
type: 'SET_ACTIVE_EDIT_ITEM',
|
|
360
|
+
payload: editItem,
|
|
400
361
|
});
|
|
401
|
-
dispatch({ type: 'SET_ACTIVE_EDIT_ITEM', payload: data });
|
|
402
362
|
}, className: "secondary-button-quill", children: [_jsx("style", { children: `.secondary-button-quill { background: white } .secondary-button-quill:hover { background: #F4F4F5 }` }), _jsx("svg", { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", fill: "currentColor", height: 12, width: 12, children: _jsx("path", { d: "M21.731 2.269a2.625 2.625 0 0 0-3.712 0l-1.157 1.157 3.712 3.712 1.157-1.157a2.625 2.625 0 0 0 0-3.712ZM19.513 8.199l-3.712-3.712-12.15 12.15a5.25 5.25 0 0 0-1.32 2.214l-.8 2.685a.75.75 0 0 0 .933.933l2.685-.8a5.25 5.25 0 0 0 2.214-1.32L19.513 8.2Z" }) }), "Edit query"] }), _jsxs("button", { style: {
|
|
403
363
|
height: 36,
|
|
404
|
-
color:
|
|
364
|
+
color: defaultTheme?.secondaryTextColor,
|
|
405
365
|
border: '1px solid #e7e7e7',
|
|
406
366
|
borderRadius: 6,
|
|
407
367
|
outline: 'none',
|
|
408
368
|
cursor: 'pointer',
|
|
409
|
-
fontFamily:
|
|
410
|
-
fontWeight:
|
|
369
|
+
fontFamily: defaultTheme?.fontFamily,
|
|
370
|
+
fontWeight: defaultTheme?.buttonFontWeight || 500,
|
|
411
371
|
fontSize: 14,
|
|
412
372
|
padding: '0px 12px',
|
|
413
373
|
display: 'flex',
|
|
414
374
|
flexDirection: 'row',
|
|
415
375
|
alignItems: 'center',
|
|
416
376
|
gap: 4,
|
|
417
|
-
}, onClick:
|
|
377
|
+
}, onClick: () => {
|
|
378
|
+
setIsPromoteReportModalOpen(true);
|
|
379
|
+
}, className: "secondary-button-quill", children: [_jsx("style", { children: `.secondary-button-quill { background: white } .secondary-button-quill:hover { background: #F4F4F5 }` }), _jsx("svg", { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", fill: "currentColor", height: 14, width: 14, children: _jsx("path", { fillRule: "evenodd", d: "M11.47 2.47a.75.75 0 0 1 1.06 0l4.5 4.5a.75.75 0 0 1-1.06 1.06l-3.22-3.22V16.5a.75.75 0 0 1-1.5 0V4.81L8.03 8.03a.75.75 0 0 1-1.06-1.06l4.5-4.5ZM3 15.75a.75.75 0 0 1 .75.75v2.25a1.5 1.5 0 0 0 1.5 1.5h13.5a1.5 1.5 0 0 0 1.5-1.5V16.5a.75.75 0 0 1 1.5 0v2.25a3 3 0 0 1-3 3H5.25a3 3 0 0 1-3-3V16.5a.75.75 0 0 1 .75-.75Z", clipRule: "evenodd" }) }), "Promote"] }), _jsxs("button", { style: {
|
|
380
|
+
height: 36,
|
|
381
|
+
color: defaultTheme?.secondaryTextColor,
|
|
382
|
+
border: '1px solid #e7e7e7',
|
|
383
|
+
borderRadius: 6,
|
|
384
|
+
outline: 'none',
|
|
385
|
+
cursor: 'pointer',
|
|
386
|
+
fontFamily: defaultTheme?.fontFamily,
|
|
387
|
+
fontWeight: defaultTheme?.buttonFontWeight || 500,
|
|
388
|
+
fontSize: 14,
|
|
389
|
+
padding: '0px 12px',
|
|
390
|
+
display: 'flex',
|
|
391
|
+
flexDirection: 'row',
|
|
392
|
+
alignItems: 'center',
|
|
393
|
+
gap: 4,
|
|
394
|
+
}, onClick: async () => {
|
|
395
|
+
if (await deleteReport(reportId)) {
|
|
396
|
+
setIsOpen(false);
|
|
397
|
+
}
|
|
398
|
+
}, className: "secondary-button-quill", children: [_jsx("style", { children: `.secondary-button-quill { background: white } .secondary-button-quill:hover { background: #F4F4F5 }` }), _jsx("svg", { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 20 20", fill: "currentColor", height: 14, width: 14, children: _jsx("path", { fillRule: "evenodd", d: "M8.75 1A2.75 2.75 0 0 0 6 3.75v.443c-.795.077-1.584.176-2.365.298a.75.75 0 1 0 .23 1.482l.149-.022.841 10.518A2.75 2.75 0 0 0 7.596 19h4.807a2.75 2.75 0 0 0 2.742-2.53l.841-10.52.149.023a.75.75 0 0 0 .23-1.482A41.03 41.03 0 0 0 14 4.193V3.75A2.75 2.75 0 0 0 11.25 1h-2.5ZM10 4c.84 0 1.673.025 2.5.075V3.75c0-.69-.56-1.25-1.25-1.25h-2.5c-.69 0-1.25.56-1.25 1.25v.325C8.327 4.025 9.16 4 10 4ZM8.58 7.72a.75.75 0 0 0-1.5.06l.3 7.5a.75.75 0 1 0 1.5-.06l-.3-7.5Zm4.34.06a.75.75 0 1 0-1.5-.06l-.3 7.5a.75.75 0 1 0 1.5.06l.3-7.5Z", clipRule: "evenodd" }) }), "Delete"] })] })), _jsx("div", { style: {
|
|
418
399
|
display: 'flex',
|
|
419
400
|
flexDirection: 'row',
|
|
420
|
-
height: 'calc(100% -
|
|
401
|
+
height: 'calc(100% - 36px)', // full height minus button container
|
|
421
402
|
flexGrow: 1,
|
|
422
|
-
}, children:
|
|
403
|
+
}, children: _jsxs("div", { style: {
|
|
423
404
|
width: '100%',
|
|
424
405
|
height: '100%',
|
|
425
406
|
overflowX: 'hidden',
|
|
426
407
|
overflowY: 'auto',
|
|
427
|
-
}, children: state.activeEditItem && state.activeQuery ? (_jsx(QueryEditor, { onSave:
|
|
428
|
-
|
|
429
|
-
|
|
430
|
-
|
|
431
|
-
|
|
432
|
-
|
|
433
|
-
|
|
434
|
-
|
|
435
|
-
|
|
436
|
-
|
|
408
|
+
}, children: [state.activeEditItem && state.activeQuery ? (_jsx(QueryEditor, { onSave: (report) => {
|
|
409
|
+
handleSave({ report, action: 'upsert' });
|
|
410
|
+
} })) : data ? (_jsx(ChartEditor, { isOpen: isOpenChartBuilder, setIsOpen: setIsOpenChartBuilder, reportId: reportId, isAdmin: true, onDelete: () => deleteReport(reportId), onAddToDashboardComplete: (report) => {
|
|
411
|
+
handleSave({ report: report, action: 'upsert' });
|
|
412
|
+
}, isHorizontalView: true, ModalComponent: FakeModal, ButtonComponent: MemoizedButton, onClickChartError: (errorResult) => {
|
|
413
|
+
if (state.navigateToVirtualTableBuilder) {
|
|
414
|
+
state.navigateToVirtualTableBuilder(errorResult);
|
|
415
|
+
setIsOpenChartBuilder(false);
|
|
416
|
+
setIsOpen(false);
|
|
417
|
+
dispatch({
|
|
418
|
+
type: 'SET_ACTIVE_QUERY',
|
|
419
|
+
payload: '',
|
|
420
|
+
});
|
|
421
|
+
dispatch({ type: 'SET_ACTIVE_EDIT_ITEM', payload: null });
|
|
422
|
+
}
|
|
423
|
+
}, destinationDashboard: data.dashboardName })) : null, _jsx(PromoteReportModal, { ModalComponent: ModalPrimitive, HeaderComponent: HeaderPrimitive, ButtonComponent: MemoizedButton, SelectComponent: QuillSelectComponentWithCombo, CheckboxComponent: CheckboxPrimitive, isOpen: isPromoteReportModalOpen, setIsOpen: setIsPromoteReportModalOpen, reportId: reportId, currentClientId: state.client._id, currentDashboardName: state.selectedDashboard || '' })] }) })] }) }) }));
|
|
437
424
|
}
|
|
438
425
|
function QueryEditor({ onSave }) {
|
|
439
426
|
const { state, dispatch } = useAdmin();
|
|
440
|
-
const
|
|
441
|
-
|
|
442
|
-
|
|
443
|
-
|
|
444
|
-
|
|
445
|
-
});
|
|
446
|
-
if (selectedOrg) {
|
|
447
|
-
setSelectedOrgName(selectedOrg.name ? selectedOrg.name : selectedOrg.NAME);
|
|
448
|
-
}
|
|
449
|
-
}, [state.organizations, state.organizationId]);
|
|
450
|
-
if (state.activeEditItem &&
|
|
451
|
-
state.activeEditItem.referencedTables &&
|
|
452
|
-
state.activeEditItem.referencedTables.length === 1 &&
|
|
427
|
+
const modeToggleOptions = [
|
|
428
|
+
{ label: 'SQL Editor', value: 'SQL Editor' },
|
|
429
|
+
{ label: 'Report Builder', value: 'Report Builder' },
|
|
430
|
+
];
|
|
431
|
+
const initialToggleMode = state.activeEditItem &&
|
|
453
432
|
state.activeQuery &&
|
|
454
433
|
!state.activeQuery.match(/^\s*with\s/i) &&
|
|
455
|
-
!
|
|
456
|
-
|
|
457
|
-
|
|
458
|
-
|
|
459
|
-
|
|
460
|
-
|
|
461
|
-
|
|
462
|
-
dispatch({ type: 'SET_ACTIVE_QUERY', payload: '' });
|
|
463
|
-
dispatch({ type: 'SET_ACTIVE_EDIT_ITEM', payload: null });
|
|
464
|
-
dispatch({
|
|
465
|
-
type: 'SET_SELECTED_DASHBOARD',
|
|
466
|
-
payload: dashboard,
|
|
467
|
-
});
|
|
468
|
-
onSave(); // refresh the dashboard in the background
|
|
469
|
-
}, organizationName: selectedOrgName, isChartBuilderHorizontalView: true,
|
|
470
|
-
// @ts-ignore
|
|
471
|
-
ChartBuilderModalComponent: FakeSQLEditorModal, containerStyle: {
|
|
472
|
-
height: '100%',
|
|
473
|
-
width: '100%',
|
|
474
|
-
} }));
|
|
475
|
-
}
|
|
476
|
-
return (_jsx(SQLEditor, { isChartBuilderHorizontalView: true, isChartBuilderEnabled: true, showAccessControlOptions: true, showDateFieldOptions: true, showTableFormatOptions: true, defaultQuery: state.activeQuery, addToDashboardButtonLabel: state.activeQuery ? 'Save changes' : 'Add to dashboard', chartBuilderTitle: state.activeQuery ? 'Save changes' : 'Add to dashboard', report: state.activeQuery ? state.activeEditItem : undefined, onAddToDashboardComplete: (report) => {
|
|
477
|
-
const dashboard = state.dashboards.find((dash) => {
|
|
478
|
-
return dash.name === report.dashboardName;
|
|
479
|
-
});
|
|
480
|
-
dispatch({ type: 'SET_ACTIVE_QUERY', payload: '' });
|
|
481
|
-
dispatch({ type: 'SET_ACTIVE_EDIT_ITEM', payload: null });
|
|
482
|
-
dispatch({
|
|
483
|
-
type: 'SET_SELECTED_DASHBOARD',
|
|
484
|
-
payload: dashboard,
|
|
485
|
-
});
|
|
486
|
-
onSave(); // refresh the dashboard in the background
|
|
487
|
-
}, containerStyle: {
|
|
434
|
+
!(state.activeEditItem.adminError || state.activeEditItem.error)
|
|
435
|
+
? 'Report Builder'
|
|
436
|
+
: 'SQL Editor';
|
|
437
|
+
const [toggleMode, setToggleMode] = useState(initialToggleMode);
|
|
438
|
+
const [isChartBuilderOpen, setIsChartBuilderOpen] = useState(false);
|
|
439
|
+
const { setSelectedDashboard } = useDashboardManager();
|
|
440
|
+
return (_jsxs("div", { style: {
|
|
488
441
|
height: '100%',
|
|
489
|
-
|
|
490
|
-
|
|
491
|
-
|
|
492
|
-
|
|
442
|
+
display: 'flex',
|
|
443
|
+
flexDirection: 'column',
|
|
444
|
+
}, children: [!isChartBuilderOpen && (_jsx("div", { id: "quill-edit-banner", style: {
|
|
445
|
+
width: '100%',
|
|
446
|
+
display: 'flex',
|
|
447
|
+
flexDirection: 'row',
|
|
448
|
+
alignItems: 'center',
|
|
449
|
+
justifyContent: 'space-between',
|
|
450
|
+
borderBottom: '1px solid #e7e7e7',
|
|
451
|
+
padding: '10px',
|
|
452
|
+
}, children: _jsx("div", { style: { display: 'flex', marginTop: 'auto' }, children: _jsx("div", { style: {
|
|
453
|
+
display: 'flex',
|
|
454
|
+
flexDirection: 'row',
|
|
455
|
+
alignItems: 'center',
|
|
456
|
+
borderRadius: '0.25rem',
|
|
457
|
+
borderStyle: 'none',
|
|
458
|
+
outlineStyle: 'none',
|
|
459
|
+
background: '#F9FAFB',
|
|
460
|
+
padding: 4,
|
|
461
|
+
}, children: _jsx(QuillTab, { modeToggleOptions: modeToggleOptions, toggleMode: toggleMode, setToggleMode: setToggleMode, disabledTooltip: initialToggleMode === 'Report Builder'
|
|
462
|
+
? undefined
|
|
463
|
+
: (state.activeEditItem?.error ??
|
|
464
|
+
state.activeEditItem?.adminError ??
|
|
465
|
+
'The Report Builder only supports queries created in the Report Builder'), width: '250px' }) }) }) })), _jsx("div", { style: { flexGrow: 1, paddingBottom: 8, overflowY: 'auto' }, children: toggleMode === 'Report Builder' ? (_jsx(ReportBuilder, { isAdminEnabled: true, destinationDashboard: state.activeEditItem.dashboardName,
|
|
466
|
+
// initialTableName={state.tables.length > 0 && state.tables[0]!.name}
|
|
467
|
+
reportId: state.activeEditItem?.id, onSubmitEditReport: (report) => {
|
|
468
|
+
dispatch({ type: 'SET_ACTIVE_QUERY', payload: '' });
|
|
469
|
+
dispatch({ type: 'SET_ACTIVE_EDIT_ITEM', payload: null });
|
|
470
|
+
setSelectedDashboard(report.dashboardName);
|
|
471
|
+
onSave(report); // refresh the dashboard in the background
|
|
472
|
+
}, onDiscardChanges: () => {
|
|
473
|
+
dispatch({ type: 'SET_ACTIVE_QUERY', payload: '' });
|
|
474
|
+
dispatch({ type: 'SET_ACTIVE_EDIT_ITEM', payload: null });
|
|
475
|
+
setIsChartBuilderOpen(false);
|
|
476
|
+
}, onSaveChanges: () => {
|
|
477
|
+
setIsChartBuilderOpen(true);
|
|
478
|
+
}, onCloseChartBuilder: () => {
|
|
479
|
+
setIsChartBuilderOpen(false);
|
|
480
|
+
}, isChartBuilderHorizontalView: true,
|
|
481
|
+
// @ts-ignore
|
|
482
|
+
ChartBuilderModalComponent: FakeSQLEditorModal, containerStyle: {
|
|
483
|
+
height: '100%',
|
|
484
|
+
width: '100%',
|
|
485
|
+
}, isAIEnabled: state.client?.databaseType?.toLowerCase() === 'mssql'
|
|
486
|
+
? false
|
|
487
|
+
: true })) : (_jsx(SQLEditor, { isChartBuilderHorizontalView: true, isAdminEnabled: true, defaultQuery: state.activeQuery, addToDashboardButtonLabel: state.activeQuery ? 'Save changes' : 'Add to dashboard', chartBuilderTitle: state.activeQuery ? 'Save changes' : 'Add to dashboard', report: state.activeQuery ? state.activeEditItem : undefined, destinationDashboard: state.activeEditItem.dashboardName, onDiscardChanges: () => {
|
|
488
|
+
dispatch({ type: 'SET_ACTIVE_QUERY', payload: '' });
|
|
489
|
+
dispatch({ type: 'SET_ACTIVE_EDIT_ITEM', payload: null });
|
|
490
|
+
setIsChartBuilderOpen(false);
|
|
491
|
+
}, onSaveChanges: () => {
|
|
492
|
+
setIsChartBuilderOpen(true);
|
|
493
|
+
}, onCloseChartBuilder: () => {
|
|
494
|
+
setIsChartBuilderOpen(false);
|
|
495
|
+
}, runQueryOnMount: true, onAddToDashboardComplete: (report) => {
|
|
496
|
+
dispatch({ type: 'SET_ACTIVE_QUERY', payload: '' });
|
|
497
|
+
dispatch({ type: 'SET_ACTIVE_EDIT_ITEM', payload: null });
|
|
498
|
+
setSelectedDashboard(report.dashboardName);
|
|
499
|
+
onSave(report); // refresh the dashboard in the background
|
|
500
|
+
}, containerStyle: {
|
|
501
|
+
height: '100%',
|
|
502
|
+
width: '100%',
|
|
503
|
+
},
|
|
504
|
+
// @ts-ignore
|
|
505
|
+
ModalComponent: FakeSQLEditorModal, ButtonComponent: MemoizedButton, isChartBuilderEnabled: true })) })] }));
|
|
493
506
|
}
|
|
494
|
-
export function ReportWrapper({
|
|
495
|
-
const { state,
|
|
496
|
-
const
|
|
497
|
-
|
|
498
|
-
if (!state.client || !dashboardItemId || !query) {
|
|
499
|
-
return;
|
|
500
|
-
}
|
|
501
|
-
let responseData;
|
|
502
|
-
if (queryEndpoint) {
|
|
503
|
-
const response = await fetch(queryEndpoint, {
|
|
504
|
-
method: 'POST',
|
|
505
|
-
headers: {
|
|
506
|
-
...queryHeaders,
|
|
507
|
-
'Content-Type': 'application/json',
|
|
508
|
-
},
|
|
509
|
-
body: JSON.stringify({
|
|
510
|
-
metadata: {
|
|
511
|
-
task: 'edit_query',
|
|
512
|
-
id: state.reportId,
|
|
513
|
-
databaseType: state.client.databaseType,
|
|
514
|
-
query,
|
|
515
|
-
orgId: organizationId || '*',
|
|
516
|
-
},
|
|
517
|
-
}),
|
|
518
|
-
credentials: withCredentials ? 'include' : 'omit',
|
|
519
|
-
});
|
|
520
|
-
responseData = await response.json();
|
|
521
|
-
}
|
|
522
|
-
else {
|
|
523
|
-
const url = `${QUILL_SERVER}/updatequery/${state.client._id}/${organizationId}/`;
|
|
524
|
-
const requestBody = {
|
|
525
|
-
dashboardItemId,
|
|
526
|
-
query,
|
|
527
|
-
};
|
|
528
|
-
const response = await fetch(url, {
|
|
529
|
-
method: 'POST',
|
|
530
|
-
headers: {
|
|
531
|
-
'Content-Type': 'application/json',
|
|
532
|
-
Authorization: 'Bearer ',
|
|
533
|
-
environment: state.environment,
|
|
534
|
-
},
|
|
535
|
-
body: JSON.stringify(requestBody),
|
|
536
|
-
});
|
|
537
|
-
responseData = await response.json();
|
|
538
|
-
}
|
|
539
|
-
if (responseData) {
|
|
540
|
-
if (responseData.error) {
|
|
541
|
-
alert(`Failed to save query. ${typeof responseData.error === 'string'
|
|
542
|
-
? responseData.error
|
|
543
|
-
: responseData.error?.routine === 'errorMissingColumn'
|
|
544
|
-
? "A column was referenced that doesn't exist."
|
|
545
|
-
: responseData.error?.routine
|
|
546
|
-
? responseData.error?.routine
|
|
547
|
-
: 'Error parsing SQL query'}`);
|
|
548
|
-
return;
|
|
549
|
-
}
|
|
550
|
-
setIsEditQueryOpen(false);
|
|
551
|
-
}
|
|
507
|
+
export function ReportWrapper({ ModalComponent, isOpen, setIsOpen, reloadDashboard, }) {
|
|
508
|
+
const { state, getToken } = useAdmin();
|
|
509
|
+
const handleSave = (reportAction) => {
|
|
510
|
+
reloadDashboard(reportAction);
|
|
552
511
|
};
|
|
553
|
-
|
|
554
|
-
|
|
555
|
-
|
|
556
|
-
|
|
557
|
-
|
|
558
|
-
return;
|
|
559
|
-
}
|
|
560
|
-
if (!confirm('Are you sure?')) {
|
|
561
|
-
return;
|
|
562
|
-
}
|
|
563
|
-
let responseData;
|
|
564
|
-
if (queryEndpoint) {
|
|
565
|
-
const response = await fetch(queryEndpoint, {
|
|
566
|
-
method: 'POST',
|
|
567
|
-
headers: {
|
|
568
|
-
...queryHeaders,
|
|
569
|
-
'Content-Type': 'application/json',
|
|
570
|
-
},
|
|
571
|
-
body: JSON.stringify({
|
|
572
|
-
metadata: {
|
|
573
|
-
orgId: organizationId || '*',
|
|
574
|
-
task: 'delete',
|
|
575
|
-
dashboardItemId: state.reportId,
|
|
576
|
-
clientId: state.client._id,
|
|
577
|
-
databaseType: state.client.databaseType,
|
|
578
|
-
},
|
|
579
|
-
}),
|
|
580
|
-
credentials: withCredentials ? 'include' : 'omit', // If withCredentials is true, set to 'include'. Otherwise, set to 'omit'.
|
|
581
|
-
});
|
|
582
|
-
responseData = await response.json(); // If the server returns JSON data
|
|
583
|
-
}
|
|
584
|
-
else {
|
|
585
|
-
const url = `${QUILL_SERVER}/deletedash/${state.client._id}/${organizationId}/`;
|
|
586
|
-
const requestBody = {
|
|
587
|
-
dashboardItemId: state.reportId,
|
|
588
|
-
databaseType: state.client.databaseType,
|
|
589
|
-
};
|
|
590
|
-
const response = await fetch(url, {
|
|
591
|
-
method: 'POST',
|
|
592
|
-
headers: {
|
|
593
|
-
'Content-Type': 'application/json',
|
|
594
|
-
environment: state.environment,
|
|
595
|
-
},
|
|
596
|
-
body: JSON.stringify(requestBody),
|
|
597
|
-
});
|
|
598
|
-
// To get JSON data from the response:
|
|
599
|
-
responseData = await response.json();
|
|
600
|
-
}
|
|
601
|
-
if (responseData) {
|
|
602
|
-
dispatch({ type: 'SET_ACTIVE_COMPONENT', payload: 'Dashboards' });
|
|
603
|
-
reloadDashboard();
|
|
604
|
-
}
|
|
605
|
-
};
|
|
606
|
-
const handleSave = () => {
|
|
607
|
-
reloadDashboard();
|
|
608
|
-
};
|
|
609
|
-
return (_jsx(QuillReport, { reportId: state.reportId, updateQuery: updateQuery, isOpen: isOpen, setIsOpen: setIsOpen, isEditQueryOpen: isEditQueryOpen, setIsEditQueryOpen: setIsEditQueryOpen, deleteReport: deleteReport, handleSave: handleSave, SecondaryButtonComponent: SecondaryButtonComponent, ButtonComponent: ButtonComponent, ModalComponent: ModalComponent, SelectComponent: SelectComponent, OrganizationSelectComponent: OrganizationSelectComponent }));
|
|
512
|
+
return (_jsx(QuillReportDetail, { reportId: state.reportId, isOpen: isOpen, setIsOpen: setIsOpen, deleteReport: async (reportId) => {
|
|
513
|
+
const success = await deleteReport(reportId, state, getToken);
|
|
514
|
+
if (success) {
|
|
515
|
+
handleSave({ report: { id: reportId }, action: 'delete' });
|
|
516
|
+
}
|
|
517
|
+
return success;
|
|
518
|
+
}, handleSave: handleSave, ModalComponent: ModalComponent, fallbackData: state.report }));
|
|
610
519
|
}
|
|
520
|
+
export const deleteReport = async (reportId, state, getToken) => {
|
|
521
|
+
if (!state.client) {
|
|
522
|
+
return false;
|
|
523
|
+
}
|
|
524
|
+
if (!confirm('Are you sure?')) {
|
|
525
|
+
return false;
|
|
526
|
+
}
|
|
527
|
+
await quillFetch({
|
|
528
|
+
client: {
|
|
529
|
+
queryEndpoint: state.queryEndpoint,
|
|
530
|
+
queryHeaders: state.queryHeaders,
|
|
531
|
+
withCredentials: !!state.withCredentials,
|
|
532
|
+
clientId: state.client._id,
|
|
533
|
+
},
|
|
534
|
+
task: 'delete',
|
|
535
|
+
metadata: {
|
|
536
|
+
dashboardItemId: reportId,
|
|
537
|
+
clientId: state.client._id,
|
|
538
|
+
databaseType: state.client.databaseType,
|
|
539
|
+
},
|
|
540
|
+
getToken,
|
|
541
|
+
});
|
|
542
|
+
return true;
|
|
543
|
+
};
|