@quillsql/admin 1.6.3 → 1.7.0
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 +14 -8
- package/dist/cjs/Admin.d.ts.map +1 -1
- package/dist/cjs/Admin.js +134 -25
- package/dist/cjs/AdminProvider.d.ts +26 -5
- package/dist/cjs/AdminProvider.d.ts.map +1 -1
- package/dist/cjs/AdminProvider.js +174 -85
- package/dist/cjs/api/ConnectionClient.d.ts +26 -12
- package/dist/cjs/api/ConnectionClient.d.ts.map +1 -1
- package/dist/cjs/api/ConnectionClient.js +198 -31
- package/dist/cjs/assets/ArrowDownHeadIcon.d.ts.map +1 -1
- package/dist/cjs/assets/XIcon.d.ts.map +1 -1
- package/dist/cjs/components/CardSection.d.ts.map +1 -1
- package/dist/cjs/components/CardSection.js +4 -2
- package/dist/cjs/components/ClipboardButton.d.ts.map +1 -1
- package/dist/cjs/components/DashboardSelectPopover.d.ts.map +1 -1
- package/dist/cjs/components/DashboardSelectPopover.js +46 -7
- package/dist/cjs/components/DatabaseSelector.d.ts +3 -1
- package/dist/cjs/components/DatabaseSelector.d.ts.map +1 -1
- package/dist/cjs/components/DatabaseSelector.js +3 -2
- package/dist/cjs/components/DateRangePicker/SingleDatePicker.d.ts.map +1 -1
- package/dist/cjs/components/DateRangePicker/SingleDatePicker.js +31 -7
- package/dist/cjs/components/DateRangePicker/YearlessDateRangePicker.d.ts.map +1 -1
- package/dist/cjs/components/DateRangePicker/YearlessDateRangePicker.js +31 -7
- package/dist/cjs/components/DateRangePicker/dateRangePickerUtils.d.ts.map +1 -1
- package/dist/cjs/components/DropDownMenuWithLabel.d.ts.map +1 -1
- package/dist/cjs/components/DropDownMenuWithLabel.js +8 -1
- package/dist/cjs/components/DynamicBanner.d.ts +3 -2
- package/dist/cjs/components/DynamicBanner.d.ts.map +1 -1
- package/dist/cjs/components/DynamicBanner.js +7 -2
- package/dist/cjs/components/EmptyDashboardComponent/index.d.ts.map +1 -1
- package/dist/cjs/components/EmptyDashboardComponent/index.js +3 -2
- package/dist/cjs/components/EmptyVirtualTablesComponent.d.ts.map +1 -1
- package/dist/cjs/components/EmptyVirtualTablesComponent.js +4 -1
- package/dist/cjs/components/FormTooltip.d.ts.map +1 -1
- package/dist/cjs/components/FormTooltip.js +4 -1
- package/dist/cjs/components/InputLabel.d.ts.map +1 -1
- package/dist/cjs/components/InputLabel.js +4 -2
- package/dist/cjs/components/InternalDashboard/DashboardFilter.d.ts +1 -1
- package/dist/cjs/components/InternalDashboard/DashboardFilter.d.ts.map +1 -1
- package/dist/cjs/components/InternalDashboard/DashboardLoadingComponent.d.ts.map +1 -1
- package/dist/cjs/components/InternalDashboard/DateRangePicker/QuillDateRangePicker.d.ts.map +1 -1
- package/dist/cjs/components/InternalDashboard/DateRangePicker/QuillDateRangePicker.js +33 -14
- package/dist/cjs/components/InternalDashboard/DateRangePicker/dateRangePickerUtils.d.ts.map +1 -1
- package/dist/cjs/components/InternalDashboard/InternalDashboard.d.ts.map +1 -1
- package/dist/cjs/components/InternalDashboard/InternalDashboard.js +128 -35
- package/dist/cjs/components/OrgSelect.d.ts +0 -6
- package/dist/cjs/components/OrgSelect.d.ts.map +1 -1
- package/dist/cjs/components/OrgSelect.js +79 -47
- package/dist/cjs/components/QuillMultiSelectWithCombo.d.ts +8 -2
- package/dist/cjs/components/QuillMultiSelectWithCombo.d.ts.map +1 -1
- package/dist/cjs/components/QuillMultiSelectWithCombo.js +351 -167
- package/dist/cjs/components/QuillPopover.d.ts.map +1 -1
- package/dist/cjs/components/QuillPopover.js +4 -5
- package/dist/cjs/components/QuillSelect.js +9 -9
- package/dist/cjs/components/QuillSelectWithCombo.d.ts +4 -3
- package/dist/cjs/components/QuillSelectWithCombo.d.ts.map +1 -1
- package/dist/cjs/components/QuillSelectWithCombo.js +47 -21
- package/dist/cjs/components/QuillToolTipPortal.d.ts.map +1 -1
- package/dist/cjs/components/SqlTextEditor.d.ts.map +1 -1
- package/dist/cjs/components/SqlTextEditor.js +15 -2
- package/dist/cjs/components/Tenants/EditTenant.d.ts.map +1 -1
- package/dist/cjs/components/Tenants/EditTenant.js +51 -8
- package/dist/cjs/components/UiComponents.d.ts +16 -43
- package/dist/cjs/components/UiComponents.d.ts.map +1 -1
- package/dist/cjs/components/UiComponents.js +162 -33
- package/dist/cjs/forms/client_onboard/ConnectDatabase.d.ts.map +1 -1
- package/dist/cjs/forms/client_onboard/ConnectDatabase.js +163 -51
- package/dist/cjs/forms/client_onboard/ConnectSchema.d.ts.map +1 -1
- package/dist/cjs/forms/client_onboard/ConnectSchema.js +36 -2
- package/dist/cjs/forms/client_onboard/CreateVirtualTables.d.ts +2 -1
- package/dist/cjs/forms/client_onboard/CreateVirtualTables.d.ts.map +1 -1
- package/dist/cjs/forms/client_onboard/CreateVirtualTables.js +60 -22
- package/dist/cjs/forms/client_onboard/__tests__/ConnectSchema.test.js +2 -1
- package/dist/cjs/forms/client_onboard/__tests__/CreateVirtualTables.test.js +2 -1
- package/dist/cjs/forms/virtual_tables/CreateEditVirtualTable.d.ts.map +1 -1
- package/dist/cjs/forms/virtual_tables/CreateEditVirtualTable.js +101 -15
- package/dist/cjs/hooks/useDatabaseSchema.d.ts.map +1 -1
- package/dist/cjs/hooks/useDatabaseSchema.js +18 -2
- package/dist/cjs/hooks/useLongLoading.d.ts +13 -0
- package/dist/cjs/hooks/useLongLoading.d.ts.map +1 -0
- package/dist/cjs/hooks/useLongLoading.js +67 -0
- package/dist/cjs/hooks/useOnClickOutside.d.ts.map +1 -1
- package/dist/cjs/hooks/useThrottle.d.ts.map +1 -1
- package/dist/cjs/icons/ArrowDownHeadIcon.d.ts.map +1 -1
- package/dist/cjs/icons/CheckCircleIcon.d.ts.map +1 -1
- package/dist/cjs/icons/ExclamationFilledIcon.d.ts.map +1 -1
- package/dist/cjs/icons/ExteriorLinkIcon.d.ts.map +1 -1
- package/dist/cjs/icons/QuestionMarkCircleIcon.d.ts.map +1 -1
- package/dist/cjs/modals/CodePreview.d.ts.map +1 -1
- package/dist/cjs/modals/CodePreview.js +7 -2
- package/dist/cjs/modals/CreateEnvironmentModal.d.ts +5 -0
- package/dist/cjs/modals/CreateEnvironmentModal.d.ts.map +1 -0
- package/dist/cjs/modals/CreateEnvironmentModal.js +21 -0
- package/dist/cjs/modals/EditEnvironmentModal.d.ts.map +1 -1
- package/dist/cjs/modals/EditEnvironmentModal.js +74 -17
- package/dist/cjs/modals/EditFiltersModal.d.ts.map +1 -1
- package/dist/cjs/modals/EditFiltersModal.js +19 -15
- package/dist/cjs/modals/NewDashboardModal.d.ts.map +1 -1
- package/dist/cjs/modals/NewDashboardModal.js +54 -28
- package/dist/cjs/modals/PromoteReportModal.d.ts.map +1 -1
- package/dist/cjs/modals/PromoteReportModal.js +15 -4
- package/dist/cjs/modals/PromoteViewModal.d.ts.map +1 -1
- package/dist/cjs/modals/PromoteViewModal.js +13 -2
- package/dist/cjs/primitives/ButtonPrimitive.d.ts.map +1 -1
- package/dist/cjs/primitives/ButtonPrimitive.js +10 -6
- package/dist/cjs/primitives/CheckboxPrimitive.d.ts.map +1 -1
- package/dist/cjs/primitives/CheckboxPrimitive.js +2 -0
- package/dist/cjs/primitives/HeaderPrimitive.d.ts.map +1 -1
- package/dist/cjs/primitives/HeaderPrimitive.js +11 -7
- package/dist/cjs/primitives/PopoverPrimitive.d.ts.map +1 -1
- package/dist/cjs/primitives/PopoverPrimitive.js +19 -6
- package/dist/cjs/primitives/SecondaryButtonPrimitive.d.ts.map +1 -1
- package/dist/cjs/primitives/SecondaryButtonPrimitive.js +5 -3
- package/dist/cjs/primitives/TogglePrimitive.d.ts.map +1 -1
- package/dist/cjs/public_components/ChartQueryBuilder.d.ts.map +1 -1
- package/dist/cjs/public_components/ChartQueryBuilder.js +17 -7
- package/dist/cjs/public_components/CreateEnvironment.d.ts.map +1 -1
- package/dist/cjs/public_components/CreateEnvironment.js +68 -30
- package/dist/cjs/public_components/DashboardManager.d.ts.map +1 -1
- package/dist/cjs/public_components/DashboardManager.js +71 -4
- package/dist/cjs/public_components/EnvSelectPopover.d.ts +2 -1
- package/dist/cjs/public_components/EnvSelectPopover.d.ts.map +1 -1
- package/dist/cjs/public_components/EnvSelectPopover.js +48 -8
- package/dist/cjs/public_components/VirtualTableManager.d.ts.map +1 -1
- package/dist/cjs/public_components/VirtualTableManager.js +124 -10
- package/dist/cjs/public_components/__tests__/CreateEnvironment.test.js +41 -2
- package/dist/cjs/utils/astProcessing.d.ts.map +1 -1
- package/dist/cjs/utils/columnProcessing.d.ts +1 -0
- package/dist/cjs/utils/columnProcessing.d.ts.map +1 -1
- package/dist/cjs/utils/columnProcessing.js +7 -1
- package/dist/cjs/utils/constants.d.ts +1 -0
- package/dist/cjs/utils/constants.d.ts.map +1 -1
- package/dist/cjs/utils/constants.js +5 -1
- package/dist/cjs/utils/dataEditor.d.ts.map +1 -1
- package/dist/cjs/utils/dataFetcher.d.ts.map +1 -1
- package/dist/cjs/utils/dataFetcher.js +0 -1
- package/dist/cjs/utils/databases.d.ts +6 -1
- package/dist/cjs/utils/databases.d.ts.map +1 -1
- package/dist/cjs/utils/databases.js +23 -5
- package/dist/cjs/utils/delay.d.ts.map +1 -1
- package/dist/cjs/utils/filter.d.ts +17 -21
- package/dist/cjs/utils/filter.d.ts.map +1 -1
- package/dist/cjs/utils/filter.js +6 -6
- package/dist/cjs/utils/report.d.ts +5 -5
- package/dist/cjs/utils/report.d.ts.map +1 -1
- package/dist/cjs/utils/schema.d.ts +6 -3
- package/dist/cjs/utils/schema.d.ts.map +1 -1
- package/dist/cjs/utils/schema.js +42 -3
- package/dist/cjs/utils/table.d.ts.map +1 -1
- package/dist/cjs/utils/tenants.d.ts.map +1 -1
- package/dist/cjs/utils/ui.d.ts.map +1 -1
- package/dist/esm/Admin.d.ts +14 -8
- package/dist/esm/Admin.d.ts.map +1 -1
- package/dist/esm/Admin.js +135 -26
- package/dist/esm/AdminProvider.d.ts +26 -5
- package/dist/esm/AdminProvider.d.ts.map +1 -1
- package/dist/esm/AdminProvider.js +177 -88
- package/dist/esm/api/ConnectionClient.d.ts +26 -12
- package/dist/esm/api/ConnectionClient.d.ts.map +1 -1
- package/dist/esm/api/ConnectionClient.js +196 -31
- package/dist/esm/assets/ArrowDownHeadIcon.d.ts.map +1 -1
- package/dist/esm/assets/XIcon.d.ts.map +1 -1
- package/dist/esm/components/CardSection.d.ts.map +1 -1
- package/dist/esm/components/CardSection.js +4 -2
- package/dist/esm/components/ClipboardButton.d.ts.map +1 -1
- package/dist/esm/components/DashboardSelectPopover.d.ts.map +1 -1
- package/dist/esm/components/DashboardSelectPopover.js +47 -8
- package/dist/esm/components/DatabaseSelector.d.ts +3 -1
- package/dist/esm/components/DatabaseSelector.d.ts.map +1 -1
- package/dist/esm/components/DatabaseSelector.js +3 -2
- package/dist/esm/components/DateRangePicker/SingleDatePicker.d.ts.map +1 -1
- package/dist/esm/components/DateRangePicker/SingleDatePicker.js +31 -7
- package/dist/esm/components/DateRangePicker/YearlessDateRangePicker.d.ts.map +1 -1
- package/dist/esm/components/DateRangePicker/YearlessDateRangePicker.js +31 -7
- package/dist/esm/components/DateRangePicker/dateRangePickerUtils.d.ts.map +1 -1
- package/dist/esm/components/DropDownMenuWithLabel.d.ts.map +1 -1
- package/dist/esm/components/DropDownMenuWithLabel.js +9 -2
- package/dist/esm/components/DynamicBanner.d.ts +3 -2
- package/dist/esm/components/DynamicBanner.d.ts.map +1 -1
- package/dist/esm/components/DynamicBanner.js +7 -2
- package/dist/esm/components/EmptyDashboardComponent/index.d.ts.map +1 -1
- package/dist/esm/components/EmptyDashboardComponent/index.js +3 -2
- package/dist/esm/components/EmptyVirtualTablesComponent.d.ts.map +1 -1
- package/dist/esm/components/EmptyVirtualTablesComponent.js +4 -1
- package/dist/esm/components/FormTooltip.d.ts.map +1 -1
- package/dist/esm/components/FormTooltip.js +4 -1
- package/dist/esm/components/InputLabel.d.ts.map +1 -1
- package/dist/esm/components/InputLabel.js +4 -2
- package/dist/esm/components/InternalDashboard/DashboardFilter.d.ts +1 -1
- package/dist/esm/components/InternalDashboard/DashboardFilter.d.ts.map +1 -1
- package/dist/esm/components/InternalDashboard/DashboardFilter.js +1 -1
- package/dist/esm/components/InternalDashboard/DashboardLoadingComponent.d.ts.map +1 -1
- package/dist/esm/components/InternalDashboard/DateRangePicker/QuillDateRangePicker.d.ts.map +1 -1
- package/dist/esm/components/InternalDashboard/DateRangePicker/QuillDateRangePicker.js +33 -11
- package/dist/esm/components/InternalDashboard/DateRangePicker/dateRangePickerUtils.d.ts.map +1 -1
- package/dist/esm/components/InternalDashboard/InternalDashboard.d.ts.map +1 -1
- package/dist/esm/components/InternalDashboard/InternalDashboard.js +129 -36
- package/dist/esm/components/OrgSelect.d.ts +0 -6
- package/dist/esm/components/OrgSelect.d.ts.map +1 -1
- package/dist/esm/components/OrgSelect.js +79 -45
- package/dist/esm/components/QuillMultiSelectWithCombo.d.ts +8 -2
- package/dist/esm/components/QuillMultiSelectWithCombo.d.ts.map +1 -1
- package/dist/esm/components/QuillMultiSelectWithCombo.js +351 -167
- package/dist/esm/components/QuillPopover.d.ts.map +1 -1
- package/dist/esm/components/QuillPopover.js +4 -5
- package/dist/esm/components/QuillSelect.js +9 -9
- package/dist/esm/components/QuillSelectWithCombo.d.ts +4 -3
- package/dist/esm/components/QuillSelectWithCombo.d.ts.map +1 -1
- package/dist/esm/components/QuillSelectWithCombo.js +47 -21
- package/dist/esm/components/QuillToolTipPortal.d.ts.map +1 -1
- package/dist/esm/components/SqlTextEditor.d.ts.map +1 -1
- package/dist/esm/components/SqlTextEditor.js +15 -2
- package/dist/esm/components/Tenants/EditTenant.d.ts.map +1 -1
- package/dist/esm/components/Tenants/EditTenant.js +51 -8
- package/dist/esm/components/UiComponents.d.ts +16 -43
- package/dist/esm/components/UiComponents.d.ts.map +1 -1
- package/dist/esm/components/UiComponents.js +127 -29
- package/dist/esm/forms/client_onboard/ConnectDatabase.d.ts.map +1 -1
- package/dist/esm/forms/client_onboard/ConnectDatabase.js +163 -51
- package/dist/esm/forms/client_onboard/ConnectSchema.d.ts.map +1 -1
- package/dist/esm/forms/client_onboard/ConnectSchema.js +36 -2
- package/dist/esm/forms/client_onboard/CreateVirtualTables.d.ts +2 -1
- package/dist/esm/forms/client_onboard/CreateVirtualTables.d.ts.map +1 -1
- package/dist/esm/forms/client_onboard/CreateVirtualTables.js +61 -23
- package/dist/esm/forms/client_onboard/__tests__/ConnectSchema.test.js +2 -1
- package/dist/esm/forms/client_onboard/__tests__/CreateVirtualTables.test.js +2 -1
- package/dist/esm/forms/virtual_tables/CreateEditVirtualTable.d.ts.map +1 -1
- package/dist/esm/forms/virtual_tables/CreateEditVirtualTable.js +103 -17
- package/dist/esm/hooks/useDatabaseSchema.d.ts.map +1 -1
- package/dist/esm/hooks/useDatabaseSchema.js +19 -3
- package/dist/esm/hooks/useLongLoading.d.ts +13 -0
- package/dist/esm/hooks/useLongLoading.d.ts.map +1 -0
- package/dist/esm/hooks/useLongLoading.js +64 -0
- package/dist/esm/hooks/useOnClickOutside.d.ts.map +1 -1
- package/dist/esm/hooks/useThrottle.d.ts.map +1 -1
- package/dist/esm/icons/ArrowDownHeadIcon.d.ts.map +1 -1
- package/dist/esm/icons/CheckCircleIcon.d.ts.map +1 -1
- package/dist/esm/icons/ExclamationFilledIcon.d.ts.map +1 -1
- package/dist/esm/icons/ExteriorLinkIcon.d.ts.map +1 -1
- package/dist/esm/icons/QuestionMarkCircleIcon.d.ts.map +1 -1
- package/dist/esm/modals/CodePreview.d.ts.map +1 -1
- package/dist/esm/modals/CodePreview.js +7 -2
- package/dist/esm/modals/CreateEnvironmentModal.d.ts +5 -0
- package/dist/esm/modals/CreateEnvironmentModal.d.ts.map +1 -0
- package/dist/esm/modals/CreateEnvironmentModal.js +15 -0
- package/dist/esm/modals/EditEnvironmentModal.d.ts.map +1 -1
- package/dist/esm/modals/EditEnvironmentModal.js +74 -17
- package/dist/esm/modals/EditFiltersModal.d.ts.map +1 -1
- package/dist/esm/modals/EditFiltersModal.js +21 -17
- package/dist/esm/modals/NewDashboardModal.d.ts.map +1 -1
- package/dist/esm/modals/NewDashboardModal.js +55 -29
- package/dist/esm/modals/PromoteReportModal.d.ts.map +1 -1
- package/dist/esm/modals/PromoteReportModal.js +15 -4
- package/dist/esm/modals/PromoteViewModal.d.ts.map +1 -1
- package/dist/esm/modals/PromoteViewModal.js +13 -2
- package/dist/esm/primitives/ButtonPrimitive.d.ts.map +1 -1
- package/dist/esm/primitives/ButtonPrimitive.js +10 -6
- package/dist/esm/primitives/CheckboxPrimitive.d.ts.map +1 -1
- package/dist/esm/primitives/CheckboxPrimitive.js +2 -0
- package/dist/esm/primitives/HeaderPrimitive.d.ts.map +1 -1
- package/dist/esm/primitives/HeaderPrimitive.js +11 -7
- package/dist/esm/primitives/PopoverPrimitive.d.ts.map +1 -1
- package/dist/esm/primitives/PopoverPrimitive.js +19 -6
- package/dist/esm/primitives/SecondaryButtonPrimitive.d.ts.map +1 -1
- package/dist/esm/primitives/SecondaryButtonPrimitive.js +5 -3
- package/dist/esm/primitives/TogglePrimitive.d.ts.map +1 -1
- package/dist/esm/public_components/ChartQueryBuilder.d.ts.map +1 -1
- package/dist/esm/public_components/ChartQueryBuilder.js +18 -8
- package/dist/esm/public_components/CreateEnvironment.d.ts.map +1 -1
- package/dist/esm/public_components/CreateEnvironment.js +68 -30
- package/dist/esm/public_components/DashboardManager.d.ts.map +1 -1
- package/dist/esm/public_components/DashboardManager.js +72 -5
- package/dist/esm/public_components/EnvSelectPopover.d.ts +2 -1
- package/dist/esm/public_components/EnvSelectPopover.d.ts.map +1 -1
- package/dist/esm/public_components/EnvSelectPopover.js +49 -9
- package/dist/esm/public_components/VirtualTableManager.d.ts.map +1 -1
- package/dist/esm/public_components/VirtualTableManager.js +125 -11
- package/dist/esm/public_components/__tests__/CreateEnvironment.test.js +41 -2
- package/dist/esm/utils/astProcessing.d.ts.map +1 -1
- package/dist/esm/utils/columnProcessing.d.ts +1 -0
- package/dist/esm/utils/columnProcessing.d.ts.map +1 -1
- package/dist/esm/utils/columnProcessing.js +7 -2
- package/dist/esm/utils/constants.d.ts +1 -0
- package/dist/esm/utils/constants.d.ts.map +1 -1
- package/dist/esm/utils/constants.js +4 -0
- package/dist/esm/utils/dataEditor.d.ts.map +1 -1
- package/dist/esm/utils/dataFetcher.d.ts.map +1 -1
- package/dist/esm/utils/dataFetcher.js +0 -1
- package/dist/esm/utils/databases.d.ts +6 -1
- package/dist/esm/utils/databases.d.ts.map +1 -1
- package/dist/esm/utils/databases.js +23 -5
- package/dist/esm/utils/delay.d.ts.map +1 -1
- package/dist/esm/utils/filter.d.ts +17 -21
- package/dist/esm/utils/filter.d.ts.map +1 -1
- package/dist/esm/utils/filter.js +5 -5
- package/dist/esm/utils/report.d.ts +5 -5
- package/dist/esm/utils/report.d.ts.map +1 -1
- package/dist/esm/utils/schema.d.ts +6 -3
- package/dist/esm/utils/schema.d.ts.map +1 -1
- package/dist/esm/utils/schema.js +42 -3
- package/dist/esm/utils/table.d.ts.map +1 -1
- package/dist/esm/utils/tenants.d.ts.map +1 -1
- package/dist/esm/utils/ui.d.ts.map +1 -1
- package/package.json +1 -1
|
@@ -1,19 +1,21 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
2
|
-
//@ts-nocheck
|
|
3
2
|
import { useContext, useEffect, useState, useRef, } from 'react';
|
|
3
|
+
import { useAdmin } from '../AdminProvider';
|
|
4
4
|
import { XIcon } from '../assets';
|
|
5
5
|
import { ThemeContext } from '@quillsql/react';
|
|
6
|
-
import useOnClickOutside from '../hooks/useOnClickOutside';
|
|
6
|
+
import useOnClickOutside, { getEffectiveZIndex, } from '../hooks/useOnClickOutside';
|
|
7
7
|
import { QuillToolTipPortal } from './QuillToolTipPortal';
|
|
8
|
+
import { createPortal } from 'react-dom';
|
|
9
|
+
import { getScrollableParent } from '../utils/ui';
|
|
8
10
|
export const MemoizedTextInput = ({ value, onChange, placeholder, id, width, }) => {
|
|
9
|
-
const
|
|
11
|
+
const { state } = useAdmin();
|
|
10
12
|
return (_jsxs("div", { style: { position: 'relative', width: width }, children: [_jsx("style", { children: `
|
|
11
13
|
.quill-text-input {
|
|
12
14
|
background-color: white;
|
|
13
15
|
height: 40px;
|
|
14
16
|
width: 180px;
|
|
15
17
|
color: #384151;
|
|
16
|
-
border: 1px solid
|
|
18
|
+
border: 1px solid ${state.theme.borderColor};
|
|
17
19
|
border-radius: 6px;
|
|
18
20
|
text-align: left;
|
|
19
21
|
box-shadow: 0px 1px 4px 0px rgba(56, 65, 81, 0.08);
|
|
@@ -23,15 +25,14 @@ export const MemoizedTextInput = ({ value, onChange, placeholder, id, width, })
|
|
|
23
25
|
padding-bottom: 0px;
|
|
24
26
|
box-sizing: content-box;
|
|
25
27
|
}` }), _jsx("input", { id: id, className: "quill-text-input", type: "text", value: value, onChange: onChange, placeholder: placeholder, style: {
|
|
26
|
-
fontFamily: theme?.fontFamily,
|
|
28
|
+
fontFamily: state.theme?.fontFamily,
|
|
27
29
|
width: width ? 'calc(100% - 24px)' : '180px',
|
|
28
30
|
} })] }));
|
|
29
31
|
};
|
|
30
32
|
export const MemoizedButton = ({ label, onClick, isLoading = false, primary = true, style = {}, width = 'auto', disabled = false, tooltipText = '', }) => {
|
|
31
|
-
const
|
|
33
|
+
const { state } = useAdmin();
|
|
32
34
|
return (_jsx(QuillToolTipPortal, { text: tooltipText, enabled: tooltipText !== '', children: _jsxs("button", { className: disabled ? 'quill-button-disabled' : 'quill-button', onClick: disabled ? undefined : onClick, style: {
|
|
33
|
-
fontFamily: theme?.fontFamily,
|
|
34
|
-
color: primary ? 'white' : '#212121',
|
|
35
|
+
fontFamily: state.theme?.fontFamily,
|
|
35
36
|
height: 40,
|
|
36
37
|
display: 'flex',
|
|
37
38
|
border: 'none',
|
|
@@ -50,20 +51,30 @@ export const MemoizedButton = ({ label, onClick, isLoading = false, primary = tr
|
|
|
50
51
|
width: width,
|
|
51
52
|
}, children: [_jsx("style", { children: `
|
|
52
53
|
.quill-button {
|
|
53
|
-
|
|
54
|
+
background-color: ${primary ? state.theme?.primaryButtonColor : 'white'};
|
|
55
|
+
color: ${primary
|
|
56
|
+
? (state.theme?.primaryButtonTextColor ?? 'white')
|
|
57
|
+
: state.theme?.secondaryTextColor}
|
|
54
58
|
}
|
|
55
59
|
.quill-button-disabled {
|
|
56
|
-
background-color:
|
|
60
|
+
background-color: ${primary ? state.theme?.primaryButtonColor : 'white'};
|
|
61
|
+
opacity: 0.5;
|
|
62
|
+
color: ${primary
|
|
63
|
+
? (state.theme?.primaryButtonTextColor ?? 'white')
|
|
64
|
+
: state.theme?.secondaryTextColor}
|
|
57
65
|
}
|
|
58
66
|
.quill-button:hover {
|
|
59
|
-
background-color: rgba(56, 65, 81, 0.9);
|
|
67
|
+
background-color: ${primary ? state.theme?.hoverPrimaryButtonColor : 'rgba(56, 65, 81, 0.9)'};
|
|
68
|
+
color: ${primary
|
|
69
|
+
? (state.theme?.hoverPrimaryButtonTextColor ?? 'white')
|
|
70
|
+
: state.theme?.secondaryTextColor}
|
|
60
71
|
}` }), isLoading ? (_jsx("div", { style: { position: 'absolute' }, children: _jsx(LoadingSpinner, {}) })) : null, _jsx("div", { style: {
|
|
61
72
|
visibility: isLoading ? 'hidden' : 'visible',
|
|
62
73
|
}, children: label })] }) }));
|
|
63
74
|
};
|
|
64
75
|
export const MemoizedSecondaryButton = ({ label, onClick, isLoading = false, }) => {
|
|
65
|
-
const
|
|
66
|
-
return (_jsxs("button", { className: "quill-secondary-button", onClick: onClick, style: { fontFamily: theme?.fontFamily }, children: [_jsx("style", { children: `
|
|
76
|
+
const { state } = useAdmin();
|
|
77
|
+
return (_jsxs("button", { className: "quill-secondary-button", onClick: onClick, style: { fontFamily: state.theme?.fontFamily }, children: [_jsx("style", { children: `
|
|
67
78
|
.quill-secondary-button {
|
|
68
79
|
background-color: #F5F5F6;
|
|
69
80
|
background-color: white;
|
|
@@ -108,6 +119,7 @@ export const MemoizedText = ({ children }) => (_jsx("p", { style: {
|
|
|
108
119
|
}, children: children }));
|
|
109
120
|
export function MemoizedPopover({ onClose, parentRef, children, style = {}, onClick, label, showTrigger = true, isOpen, setIsOpen, }) {
|
|
110
121
|
const modalRef = useRef(null);
|
|
122
|
+
const { state } = useAdmin();
|
|
111
123
|
useOnClickOutside(modalRef, (e) => {
|
|
112
124
|
// Exclude click on trigger button (e.g. Dropdown Button) from outside click handler
|
|
113
125
|
const isTriggerElem = parentRef
|
|
@@ -129,7 +141,7 @@ export function MemoizedPopover({ onClose, parentRef, children, style = {}, onCl
|
|
|
129
141
|
onClick(e);
|
|
130
142
|
}
|
|
131
143
|
}, label: label })), isOpen && (_jsx("div", { id: "quill-popover-modal", ref: modalRef, style: { position: 'relative' }, children: _jsx("div", { style: {
|
|
132
|
-
background:
|
|
144
|
+
background: state.theme?.backgroundColor,
|
|
133
145
|
position: 'absolute',
|
|
134
146
|
boxShadow: '0px 1px 12px 0px rgba(56, 65, 81, 0.1)',
|
|
135
147
|
border: '1px solid #e7e7e7',
|
|
@@ -142,7 +154,10 @@ export function MemoizedPopover({ onClose, parentRef, children, style = {}, onCl
|
|
|
142
154
|
...style,
|
|
143
155
|
}, children: children }) }))] }));
|
|
144
156
|
}
|
|
145
|
-
export const QuillTabs = ({ options =
|
|
157
|
+
export const QuillTabs = ({ options = [
|
|
158
|
+
{ label: 'or', value: 'OR' },
|
|
159
|
+
{ label: 'and', value: 'AND' },
|
|
160
|
+
], value, onChange, }) => (_jsx("div", { style: {
|
|
146
161
|
flexDirection: 'row',
|
|
147
162
|
alignItems: 'center',
|
|
148
163
|
borderRadius: '0.25rem',
|
|
@@ -181,7 +196,7 @@ export const QuillTabs = ({ options = DEFAULT_TAB_OPTIONS, value, onChange, }) =
|
|
|
181
196
|
}),
|
|
182
197
|
}, children: option.label }, index))) }));
|
|
183
198
|
export function MemoizedModal({ isOpen, setIsOpen, title, children, width, height, }) {
|
|
184
|
-
const
|
|
199
|
+
const { state } = useAdmin();
|
|
185
200
|
useEffect(() => {
|
|
186
201
|
// Prevent scrolling in the background when the modal is open
|
|
187
202
|
if (isOpen) {
|
|
@@ -213,7 +228,7 @@ export function MemoizedModal({ isOpen, setIsOpen, title, children, width, heigh
|
|
|
213
228
|
justifyContent: 'center',
|
|
214
229
|
alignItems: 'center',
|
|
215
230
|
transform: 'translateX(-50%) translateY(-50%)',
|
|
216
|
-
background:
|
|
231
|
+
background: state.theme?.backgroundColor,
|
|
217
232
|
borderRadius: 8,
|
|
218
233
|
borderStyle: 'solid',
|
|
219
234
|
borderWidth: 1,
|
|
@@ -232,7 +247,7 @@ export function MemoizedModal({ isOpen, setIsOpen, title, children, width, heigh
|
|
|
232
247
|
display: 'flex',
|
|
233
248
|
flexDirection: 'column',
|
|
234
249
|
position: 'relative',
|
|
235
|
-
fontFamily: theme?.fontFamily,
|
|
250
|
+
fontFamily: state.theme?.fontFamily,
|
|
236
251
|
}, children: [_jsxs("div", { id: "quill-modal-header", style: {
|
|
237
252
|
display: 'flex',
|
|
238
253
|
flexDirection: 'row',
|
|
@@ -245,8 +260,8 @@ export function MemoizedModal({ isOpen, setIsOpen, title, children, width, heigh
|
|
|
245
260
|
marginLeft: 20,
|
|
246
261
|
// width: '90%',
|
|
247
262
|
textAlign: 'left',
|
|
248
|
-
color: theme?.primaryTextColor,
|
|
249
|
-
}, children: title }), _jsx("div", { style: { marginRight: 10, marginTop: 10 }, children: _jsx(MemoizedDeleteButton, { onClick: () => setIsOpen(false) }) })] }), children] }) })] }));
|
|
263
|
+
color: state.theme?.primaryTextColor,
|
|
264
|
+
}, children: title }), _jsx("div", { style: { marginRight: 10, marginTop: 10 }, children: _jsx(MemoizedDeleteButton, { onClick: () => setIsOpen(false), style: {} }) })] }), children] }) })] }));
|
|
250
265
|
}
|
|
251
266
|
export const MemoizedDeleteButton = ({ onClick, style }) => (_jsxs("button", { title: "Delete", className: "quill-delete-button", type: "button", onClick: onClick, style: {
|
|
252
267
|
height: 40,
|
|
@@ -265,13 +280,16 @@ export const MemoizedDeleteButton = ({ onClick, style }) => (_jsxs("button", { t
|
|
|
265
280
|
.quill-delete-button:hover {
|
|
266
281
|
background-color: rgba(56, 65, 81, 0.03);
|
|
267
282
|
}` }), _jsx(XIcon, { height: "20", width: "20", fill: "#6C727F" })] }));
|
|
268
|
-
export const LoadingSpinner = ({ scale = 1 }) =>
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
283
|
+
export const LoadingSpinner = ({ scale = 1 }) => {
|
|
284
|
+
const { state: { theme }, } = useAdmin();
|
|
285
|
+
return (_jsxs("svg", { width: "24", height: "24", style: { scale: scale }, children: [_jsx("circle", { cx: "12", cy: "12", r: "9.375", strokeWidth: "3.75", strokeDasharray: "19.63 39.25" // calc(2 * 3.14 * 9.375 / 3) calc(2 * 3.14 * 9.375 * 2 / 3)
|
|
286
|
+
, strokeDashoffset: "9.81" // calc(2 * 3.14 * 9.375 / 6)
|
|
287
|
+
, stroke: theme?.primaryTextColor ?? '#364153', fill: "none", transform: "rotate(-90 12 12)", children: _jsx("animateTransform", { attributeName: "transform", attributeType: "XML", type: "rotate", from: "-180 12 12", to: "180 12 12", dur: "0.8s", repeatCount: "indefinite" }) }), _jsx("circle", { cx: "12", cy: "12", r: "9.375", strokeWidth: "3.75", strokeDasharray: "19.63 19.63" // calc(2 * 3.14 * 9.375 / 3) calc(2 * 3.14 * 9.375 * 1 / 3)
|
|
288
|
+
, strokeDashoffset: "19.63 39.25" // calc(2 * 3.14 * 9.375 / 3) calc(2 * 3.14 * 9.375 * 2 / 3)
|
|
289
|
+
, stroke: '#ADB1B9', fill: "none", transform: "rotate(90 12 12)", children: _jsx("animateTransform", { attributeName: "transform", attributeType: "XML", type: "rotate", from: "0 12 12", to: "360 12 12", dur: "0.8s", repeatCount: "indefinite" }) })] }));
|
|
290
|
+
};
|
|
273
291
|
export const QuillErrorMessageComponent = ({ containerStyle, errorMessage, }) => {
|
|
274
|
-
const
|
|
292
|
+
const { state } = useAdmin();
|
|
275
293
|
return (_jsx("div", { style: {
|
|
276
294
|
borderRadius: 8,
|
|
277
295
|
backgroundColor: '#FF9494',
|
|
@@ -282,7 +300,7 @@ export const QuillErrorMessageComponent = ({ containerStyle, errorMessage, }) =>
|
|
|
282
300
|
alignItems: 'center',
|
|
283
301
|
fontSize: 13,
|
|
284
302
|
fontWeight: 'bold',
|
|
285
|
-
fontFamily: theme?.fontFamily,
|
|
303
|
+
fontFamily: state.theme?.fontFamily,
|
|
286
304
|
color: 'white',
|
|
287
305
|
...containerStyle,
|
|
288
306
|
}, children: errorMessage }));
|
|
@@ -303,8 +321,8 @@ export const OverflowContainer = ({ children }) => {
|
|
|
303
321
|
const container = containerRef.current;
|
|
304
322
|
if (container) {
|
|
305
323
|
checkOverflow();
|
|
306
|
-
const topObserver = new IntersectionObserver(([entry]) => setShowTopShadow(!entry
|
|
307
|
-
const bottomObserver = new IntersectionObserver(([entry]) => setShowBottomShadow(!entry
|
|
324
|
+
const topObserver = new IntersectionObserver(([entry]) => setShowTopShadow(!entry?.isIntersecting), { root: container, threshold: 0 });
|
|
325
|
+
const bottomObserver = new IntersectionObserver(([entry]) => setShowBottomShadow(!entry?.isIntersecting), { root: container, threshold: 0 });
|
|
308
326
|
const topSentinel = document.createElement('div');
|
|
309
327
|
const bottomSentinel = document.createElement('div');
|
|
310
328
|
container.insertBefore(topSentinel, container.firstChild);
|
|
@@ -322,6 +340,7 @@ export const OverflowContainer = ({ children }) => {
|
|
|
322
340
|
const containerStyle = {
|
|
323
341
|
position: 'relative',
|
|
324
342
|
overflowY: 'auto',
|
|
343
|
+
overscrollBehavior: 'none',
|
|
325
344
|
};
|
|
326
345
|
const shadowStyle = {
|
|
327
346
|
position: 'sticky',
|
|
@@ -410,3 +429,82 @@ export const QuillToolTip = ({ children, text, enabled = true, containerStyle =
|
|
|
410
429
|
opacity: 1;
|
|
411
430
|
}` }), children, _jsx("div", { className: "tooltip-text", style: { ...textStyle }, children: text })] })) : (children);
|
|
412
431
|
};
|
|
432
|
+
export const QuillPortal = ({ children, containerStyle, anchorRef, showModal, setShowModal, }) => {
|
|
433
|
+
const modalRef = useRef(null);
|
|
434
|
+
const [popoverPosition, setPopoverPosition] = useState(undefined);
|
|
435
|
+
const [z, setZ] = useState(10);
|
|
436
|
+
const scrollableParentRef = useRef(document.body);
|
|
437
|
+
const updatePosition = () => {
|
|
438
|
+
if (anchorRef.current) {
|
|
439
|
+
requestAnimationFrame(() => {
|
|
440
|
+
const rect = anchorRef?.current?.getBoundingClientRect();
|
|
441
|
+
if (rect) {
|
|
442
|
+
const viewportHeight = window.innerHeight;
|
|
443
|
+
// Calculate available space below the element with a 64px bottom margin
|
|
444
|
+
const availableHeight = viewportHeight - rect.bottom - 64;
|
|
445
|
+
setPopoverPosition({
|
|
446
|
+
top: rect.bottom + window.scrollY,
|
|
447
|
+
left: rect.left + window.scrollX,
|
|
448
|
+
width: rect.width,
|
|
449
|
+
maxHeight: availableHeight,
|
|
450
|
+
});
|
|
451
|
+
}
|
|
452
|
+
});
|
|
453
|
+
}
|
|
454
|
+
};
|
|
455
|
+
useEffect(() => {
|
|
456
|
+
let resizeObserver;
|
|
457
|
+
let mutationObserver;
|
|
458
|
+
if (showModal && anchorRef.current) {
|
|
459
|
+
updatePosition();
|
|
460
|
+
setZ(getEffectiveZIndex(anchorRef.current) + 1);
|
|
461
|
+
resizeObserver = new ResizeObserver(() => updatePosition());
|
|
462
|
+
resizeObserver.observe(anchorRef.current);
|
|
463
|
+
mutationObserver = new MutationObserver(() => updatePosition());
|
|
464
|
+
mutationObserver.observe(anchorRef.current, {
|
|
465
|
+
attributes: true,
|
|
466
|
+
subtree: true,
|
|
467
|
+
});
|
|
468
|
+
// Track scrolling of the nearest scrollable ancestor
|
|
469
|
+
scrollableParentRef.current = getScrollableParent(anchorRef.current);
|
|
470
|
+
scrollableParentRef.current.addEventListener('scroll', updatePosition, {
|
|
471
|
+
passive: true,
|
|
472
|
+
});
|
|
473
|
+
const handleResize = () => requestAnimationFrame(updatePosition);
|
|
474
|
+
window.addEventListener('resize', handleResize, { passive: true });
|
|
475
|
+
return () => {
|
|
476
|
+
resizeObserver.disconnect();
|
|
477
|
+
mutationObserver.disconnect();
|
|
478
|
+
scrollableParentRef.current.removeEventListener('scroll', updatePosition);
|
|
479
|
+
window.removeEventListener('resize', handleResize);
|
|
480
|
+
};
|
|
481
|
+
}
|
|
482
|
+
}, [showModal]);
|
|
483
|
+
useOnClickOutside(modalRef, (event) => {
|
|
484
|
+
if (!anchorRef.current?.contains(event.target))
|
|
485
|
+
setShowModal(false);
|
|
486
|
+
}, showModal);
|
|
487
|
+
return createPortal(_jsx("div", { style: {
|
|
488
|
+
position: 'absolute',
|
|
489
|
+
top: `${popoverPosition?.top ?? 0}px`,
|
|
490
|
+
left: `${popoverPosition?.left ?? 0}px`,
|
|
491
|
+
width: `${popoverPosition?.width ?? 0}px`,
|
|
492
|
+
maxHeight: `${Math.max(popoverPosition?.maxHeight ?? 0, 100)}px`,
|
|
493
|
+
visibility: popoverPosition ? 'visible' : 'hidden',
|
|
494
|
+
// display: 'flex',
|
|
495
|
+
// flexDirection: 'column',
|
|
496
|
+
// boxSizing: 'border-box',
|
|
497
|
+
// borderWidth: 1,
|
|
498
|
+
// borderStyle: 'solid',
|
|
499
|
+
// borderColor: theme?.borderColor,
|
|
500
|
+
// borderRadius: 6,
|
|
501
|
+
// background: theme?.backgroundColor,
|
|
502
|
+
// marginTop: 12,
|
|
503
|
+
zIndex: z,
|
|
504
|
+
// padding: 6,
|
|
505
|
+
// fontFamily: theme?.fontFamily,
|
|
506
|
+
// overflow: 'scroll',
|
|
507
|
+
// fontSize: 14,
|
|
508
|
+
...containerStyle,
|
|
509
|
+
}, ref: modalRef, "data-portal-ignore": "true", children: children }), document.body);
|
|
510
|
+
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ConnectDatabase.d.ts","sourceRoot":"","sources":["../../../../src/forms/client_onboard/ConnectDatabase.tsx"],"names":[],"mappings":"AAAA,OAAc,EACZ,aAAa,EAKd,MAAM,OAAO,CAAC;AAQf,OAAO,EAGL,cAAc,
|
|
1
|
+
{"version":3,"file":"ConnectDatabase.d.ts","sourceRoot":"","sources":["../../../../src/forms/client_onboard/ConnectDatabase.tsx"],"names":[],"mappings":"AAAA,OAAc,EACZ,aAAa,EAKd,MAAM,OAAO,CAAC;AAQf,OAAO,EAGL,cAAc,EAUf,MAAM,uBAAuB,CAAC;AAU/B,OAAO,EAAE,mBAAmB,EAAE,MAAM,aAAa,CAAC;AAClD,OAAO,EAAE,cAAc,EAAE,MAAM,mBAAmB,CAAC;AAOnD,MAAM,CAAC,OAAO,UAAU,eAAe,CAAC,EACtC,cAAc,EACd,YAAY,EACZ,YAAY,EACZ,kBAAkB,EAClB,qBAAqB,EACrB,mBAAmB,EACnB,iBAAiB,GAClB,EAAE;IACD,cAAc,CAAC,EAAE,aAAa,CAAC;IAC/B,YAAY,CAAC,EAAE,aAAa,CAAC;IAC7B,YAAY,CAAC,EAAE,aAAa,CAAC;IAC7B,YAAY,CAAC,EAAE,aAAa,CAAC;IAC7B,kBAAkB,EAAE;QAClB,UAAU,EAAE,cAAc,CAAC;QAC3B,MAAM,EAAE,OAAO,CAAC,mBAAmB,GAAG;YAAE,WAAW,EAAE,MAAM,EAAE,CAAA;SAAE,CAAC,CAAC;QACjE,MAAM,CAAC,EAAE,cAAc,EAAE,CAAC;KAC3B,CAAC;IACF,qBAAqB,EAAE,CACrB,cAAc,EAAE,cAAc,EAC9B,MAAM,EAAE,cAAc,EAAE,EACxB,mBAAmB,EAAE,MAAM,EAAE,EAC7B,QAAQ,EAAE,MAAM,KACb,IAAI,CAAC;IACV,mBAAmB,EAAE,OAAO,CAAC;IAC7B,iBAAiB,CAAC,EAAE,CAAC,QAAQ,EAAE,MAAM,KAAK,OAAO,CAAC,IAAI,CAAC,CAAC;CACzD,2CA4uBA"}
|
|
@@ -11,10 +11,16 @@ import { QuillMultiSelectComponentWithCombo } from '../../components/QuillMultiS
|
|
|
11
11
|
import CardSection from '../../components/CardSection';
|
|
12
12
|
// import InputLabel from '../../components/InputLabel';
|
|
13
13
|
import { useAdmin } from '../../AdminProvider';
|
|
14
|
+
import { quillFetch } from '../../utils/dataFetcher';
|
|
15
|
+
import { useLongLoading } from '../../hooks/useLongLoading';
|
|
14
16
|
export default function ConnectDatabase({ containerStyle, header1Style, header2Style, environmentDetails, setEnvironmentDetails, fetchSchemasLoading, onConnectDatabase, }) {
|
|
15
|
-
const { state, getToken } = useAdmin();
|
|
17
|
+
const { state, getToken, eventTracking } = useAdmin();
|
|
16
18
|
const [error, setError] = useState(undefined);
|
|
17
19
|
const [isConnecting, setIsConnecting] = useState(false);
|
|
20
|
+
useLongLoading(isConnecting, {
|
|
21
|
+
origin: 'ConnectDatabase',
|
|
22
|
+
loadDescription: 'Connecting to database',
|
|
23
|
+
});
|
|
18
24
|
const [clientId, setClientId] = useState(environmentDetails.client.clientId);
|
|
19
25
|
const [fileLabel, setFileLabel] = useState('No file chosen');
|
|
20
26
|
const [allSchemas, setAllSchemas] = useState([]);
|
|
@@ -48,7 +54,12 @@ export default function ConnectDatabase({ containerStyle, header1Style, header2S
|
|
|
48
54
|
// Redact sensitive information
|
|
49
55
|
const savedConnectionDetails = { ...databaseConnectionDetails };
|
|
50
56
|
savedConnectionDetails.connectionString = '';
|
|
51
|
-
|
|
57
|
+
if (databaseConnectionDetails.type === 'Databricks') {
|
|
58
|
+
savedConnectionDetails.token = '';
|
|
59
|
+
}
|
|
60
|
+
else {
|
|
61
|
+
savedConnectionDetails.password = '';
|
|
62
|
+
}
|
|
52
63
|
sessionStorage.setItem('connectionDetails', JSON.stringify(savedConnectionDetails));
|
|
53
64
|
}, [databaseConnectionDetails]);
|
|
54
65
|
const handleFileChange = (e) => {
|
|
@@ -70,6 +81,17 @@ export default function ConnectDatabase({ containerStyle, header1Style, header2S
|
|
|
70
81
|
}
|
|
71
82
|
catch (err) {
|
|
72
83
|
console.log('Error parsing JSON file', err);
|
|
84
|
+
eventTracking?.logError?.({
|
|
85
|
+
type: 'bug', // TODO: determine type
|
|
86
|
+
severity: 'high',
|
|
87
|
+
message: 'Error parsing JSON file',
|
|
88
|
+
errorMessage: err.message,
|
|
89
|
+
errorStack: err.stack,
|
|
90
|
+
errorData: {
|
|
91
|
+
caller: 'ConnectDatabase',
|
|
92
|
+
function: 'handleFileChange',
|
|
93
|
+
},
|
|
94
|
+
});
|
|
73
95
|
setFileLabel('Error parsing JSON file');
|
|
74
96
|
}
|
|
75
97
|
};
|
|
@@ -80,6 +102,7 @@ export default function ConnectDatabase({ containerStyle, header1Style, header2S
|
|
|
80
102
|
return false;
|
|
81
103
|
}
|
|
82
104
|
const typedDetails = databaseConnectionDetails;
|
|
105
|
+
const databricksDetails = databaseConnectionDetails;
|
|
83
106
|
switch (databaseConnectionDetails.type) {
|
|
84
107
|
case 'PostgreSQL':
|
|
85
108
|
case 'MySQL':
|
|
@@ -94,6 +117,10 @@ export default function ConnectDatabase({ containerStyle, header1Style, header2S
|
|
|
94
117
|
!(typedDetails.port ||
|
|
95
118
|
(typedDetails.warehouse &&
|
|
96
119
|
typedDetails.type === 'Snowflake')));
|
|
120
|
+
case 'Databricks':
|
|
121
|
+
return (!databricksDetails.host ||
|
|
122
|
+
!databricksDetails.path ||
|
|
123
|
+
!databricksDetails.token);
|
|
97
124
|
case 'BigQuery':
|
|
98
125
|
return !databaseConnectionDetails.jsonString;
|
|
99
126
|
default:
|
|
@@ -120,11 +147,22 @@ export default function ConnectDatabase({ containerStyle, header1Style, header2S
|
|
|
120
147
|
}
|
|
121
148
|
try {
|
|
122
149
|
setIsConnecting(true);
|
|
123
|
-
await setSchemaNames(state.queryEndpoint, clientId, selectedSchemas, getToken);
|
|
124
|
-
const databaseSchema = await getTableColumnsBySchema(state.queryEndpoint, clientId, getToken, selectedSchemas).then((res) => res.columnsByTable);
|
|
150
|
+
await setSchemaNames(state.queryEndpoint, clientId, selectedSchemas, getToken, state.queryHeaders);
|
|
151
|
+
const databaseSchema = await getTableColumnsBySchema(state.isSelfHosted, state.queryEndpoint, clientId, databaseConnectionDetails.type, getToken, selectedSchemas, state.queryHeaders).then((res) => res.columnsByTable);
|
|
125
152
|
setEnvironmentDetails(databaseConnectionDetails, databaseSchema, selectedSchemas, clientId);
|
|
126
153
|
}
|
|
127
154
|
catch (e) {
|
|
155
|
+
eventTracking?.logError?.({
|
|
156
|
+
type: 'bug', // TODO: determine type
|
|
157
|
+
severity: 'high',
|
|
158
|
+
message: 'Error setting up database',
|
|
159
|
+
errorMessage: e.message,
|
|
160
|
+
errorStack: e.stack,
|
|
161
|
+
errorData: {
|
|
162
|
+
caller: 'ConnectDatabase',
|
|
163
|
+
function: 'nextStep',
|
|
164
|
+
},
|
|
165
|
+
});
|
|
128
166
|
setError(e.message);
|
|
129
167
|
}
|
|
130
168
|
finally {
|
|
@@ -133,11 +171,38 @@ export default function ConnectDatabase({ containerStyle, header1Style, header2S
|
|
|
133
171
|
}, 1000);
|
|
134
172
|
}
|
|
135
173
|
};
|
|
174
|
+
const getSchemaNames = async () => {
|
|
175
|
+
setIsConnecting(true);
|
|
176
|
+
const tempClientId = clientId ?? state.client?.clientId;
|
|
177
|
+
const { data, status, queries } = await quillFetch({
|
|
178
|
+
client: {
|
|
179
|
+
queryEndpoint: state.queryEndpoint,
|
|
180
|
+
queryHeaders: state.queryHeaders,
|
|
181
|
+
withCredentials: !!state.withCredentials,
|
|
182
|
+
clientId: tempClientId,
|
|
183
|
+
},
|
|
184
|
+
task: 'get-schema-names',
|
|
185
|
+
metadata: {
|
|
186
|
+
databaseType: databaseConnectionDetails.type,
|
|
187
|
+
newClientId: clientId,
|
|
188
|
+
},
|
|
189
|
+
getToken: getToken,
|
|
190
|
+
});
|
|
191
|
+
if (status !== 'success') {
|
|
192
|
+
setIsConnecting(false);
|
|
193
|
+
setError('Error fetching schemas');
|
|
194
|
+
return;
|
|
195
|
+
}
|
|
196
|
+
const schemas = queries?.queryResults?.[0]?.rows?.map((row) => row['schema_name'] || row['SCHEMA_NAME']);
|
|
197
|
+
setClientId(data?.clientId);
|
|
198
|
+
setAllSchemas(schemas);
|
|
199
|
+
setIsConnecting(false);
|
|
200
|
+
};
|
|
136
201
|
const testConnectionAndFormClient = async () => {
|
|
137
202
|
setError(undefined);
|
|
138
203
|
const connectionString = formConnectionString(databaseConnectionDetails);
|
|
139
204
|
setIsConnecting(true);
|
|
140
|
-
const result = await testConnectionString(state.queryEndpoint, connectionString, databaseConnectionDetails.type, getToken, clientId);
|
|
205
|
+
const result = await testConnectionString(state.queryEndpoint, connectionString, databaseConnectionDetails.type, getToken, clientId, state.queryHeaders);
|
|
141
206
|
if (result.success) {
|
|
142
207
|
try {
|
|
143
208
|
setConnectionDetails({
|
|
@@ -155,6 +220,17 @@ export default function ConnectDatabase({ containerStyle, header1Style, header2S
|
|
|
155
220
|
onConnectDatabase?.(result.clientId);
|
|
156
221
|
}
|
|
157
222
|
catch (e) {
|
|
223
|
+
eventTracking?.logError?.({
|
|
224
|
+
type: 'bug', // TODO: determine type
|
|
225
|
+
severity: 'high',
|
|
226
|
+
message: 'Error connecting to database',
|
|
227
|
+
errorMessage: e.message,
|
|
228
|
+
errorStack: e.stack,
|
|
229
|
+
errorData: {
|
|
230
|
+
caller: 'ConnectDatabase',
|
|
231
|
+
function: 'testConnectionAndFormClient',
|
|
232
|
+
},
|
|
233
|
+
});
|
|
158
234
|
setError("Couldn't connect to database");
|
|
159
235
|
}
|
|
160
236
|
finally {
|
|
@@ -170,50 +246,75 @@ export default function ConnectDatabase({ containerStyle, header1Style, header2S
|
|
|
170
246
|
display: 'flex',
|
|
171
247
|
flexDirection: 'row',
|
|
172
248
|
justifyContent: 'space-between',
|
|
173
|
-
}, children: [_jsx("h1", { style: header1Style, children: "Connect Database" }), clientId && !!selectedSchemas?.length && (_jsx("svg", { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 20 20", fill: "currentColor", width: "24px", height: "24px", children: _jsx("path", { fillRule: "evenodd", d: "M10 18a8 8 0 1 0 0-16 8 8 0 0 0 0 16Zm3.857-9.809a.75.75 0 0 0-1.214-.882l-3.483 4.79-1.88-1.88a.75.75 0 1 0-1.06 1.061l2.5 2.5a.75.75 0 0 0 1.137-.089l4-5.5Z", clipRule: "evenodd" }) }))] }), _jsxs("div", { style: { marginTop: 12 }, children: [_jsx("h2", { style: { ...header2Style, fontWeight: 600
|
|
174
|
-
return (_jsx(DatabaseSelector, { onDatabaseSelect: onDatabaseSelect, databaseType: databaseConnectionDetails?.type || '', containerStyle: {
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
249
|
+
}, children: [_jsx("h1", { style: header1Style, children: "Connect Database" }), clientId && !!selectedSchemas?.length && (_jsx("svg", { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 20 20", fill: "currentColor", width: "24px", height: "24px", children: _jsx("path", { fillRule: "evenodd", d: "M10 18a8 8 0 1 0 0-16 8 8 0 0 0 0 16Zm3.857-9.809a.75.75 0 0 0-1.214-.882l-3.483 4.79-1.88-1.88a.75.75 0 1 0-1.06 1.061l2.5 2.5a.75.75 0 0 0 1.137-.089l4-5.5Z", clipRule: "evenodd" }) }))] }), !state.isSelfHosted && (_jsxs("div", { style: { marginTop: 12 }, children: [_jsx("h2", { style: { ...header2Style, fontWeight: 600 }, children: "Database type" }), _jsx("div", { style: { display: 'flex', gap: 10, userSelect: 'none' }, children: DATABASE_DEFAULT_INFO.map((database) => {
|
|
250
|
+
return (_jsx(DatabaseSelector, { onDatabaseSelect: onDatabaseSelect, databaseType: databaseConnectionDetails?.type || '', containerStyle: {
|
|
251
|
+
marginBottom: '12px',
|
|
252
|
+
...(state.isSelfHosted && {
|
|
253
|
+
cursor: 'not-allowed',
|
|
254
|
+
pointerEvents: 'none',
|
|
255
|
+
}),
|
|
256
|
+
...(state.isSelfHosted &&
|
|
257
|
+
database.value.toLowerCase() !==
|
|
258
|
+
environmentDetails.connection.type.toLowerCase() && {
|
|
259
|
+
backgroundColor: '#f5f5f5',
|
|
260
|
+
}),
|
|
261
|
+
}, label: database.label, value: database.value, imageUrl: database.imageUrl, theme: state.theme }, database.label));
|
|
262
|
+
}) })] })), databaseConnectionDetails && (_jsxs("div", { children: [!state.isSelfHosted && (_jsx("div", { children: databaseConnectionDetails.type !== 'BigQuery' ? (_jsxs("div", { children: [['MySQL', 'PostgreSQL'].includes(databaseConnectionDetails.type) && (_jsxs("div", { style: { marginTop: 16, marginBottom: 24 }, children: [_jsx("h2", { style: {
|
|
263
|
+
...header2Style,
|
|
264
|
+
fontWeight: 600,
|
|
265
|
+
marginBottom: 8,
|
|
266
|
+
}, children: "Connection Method" }), _jsx(QuillTab, { width: "486px", modeToggleOptions: credentialTabOptions, toggleMode: credentialTab, setToggleMode: setCredentialTab })] })), credentialTab === 'Database Credentials' ? (_jsx("div", { id: "database-details-form", children: _jsx("div", { style: {
|
|
267
|
+
display: 'grid',
|
|
268
|
+
gridTemplateColumns: 'repeat(3, 1fr)',
|
|
269
|
+
gap: '20px',
|
|
270
|
+
justifyContent: 'space-between',
|
|
271
|
+
marginTop: '16px',
|
|
272
|
+
}, children:
|
|
273
|
+
// get a list of types in the databaseConnectionDetails object and create a form for each
|
|
274
|
+
Object.entries(databaseConnectionDetails).map(([key, value]) => {
|
|
275
|
+
if (key !== 'connectionString' && key !== 'type')
|
|
276
|
+
return (_jsxs("div", { "data-testid": `quill-input-${key}`, children: [_jsx("h2", { style: {
|
|
277
|
+
...header2Style,
|
|
278
|
+
fontWeight: '600',
|
|
279
|
+
}, children: key
|
|
280
|
+
.split(/(?=[A-Z])/)
|
|
281
|
+
.map((word) => word.charAt(0).toUpperCase() +
|
|
282
|
+
word.slice(1))
|
|
283
|
+
.join(' ') }), _jsx(TextInputPrimitive, { onChange: (e) => {
|
|
284
|
+
setConnectionDetails({
|
|
285
|
+
...databaseConnectionDetails,
|
|
286
|
+
[key]: e.target.value,
|
|
287
|
+
connectionString: '',
|
|
288
|
+
});
|
|
289
|
+
}, value: value, disabled: key === 'type', password: key === 'password' ? true : false })] }, key));
|
|
290
|
+
}) }) })) : (_jsxs("div", { "data-testid": "quill-input-connectionString", children: [_jsx("h2", { style: { ...header2Style, fontWeight: 600 }, children: "Connection String" }), _jsx(TextInputPrimitive, { onChange: (e) => {
|
|
291
|
+
updateConnectionString(e.target.value);
|
|
292
|
+
}, value: databaseConnectionDetails.connectionString })] }))] })) : (_jsx("div", { style: { minWidth: 790 }, children: _jsx("div", { id: "database-details-form-bq", style: {
|
|
293
|
+
display: 'grid',
|
|
294
|
+
gridTemplateColumns: 'repeat(1, 1fr)',
|
|
295
|
+
gap: '20px',
|
|
296
|
+
justifyContent: 'space-between',
|
|
297
|
+
marginTop: '16px',
|
|
298
|
+
}, children: _jsxs("div", { children: [_jsx("h2", { style: { ...header2Style, fontWeight: '600' }, children: "Service Account Json" }), _jsxs("div", { children: [_jsx("input", { title: "Upload JSON", type: "file", accept: ".json", onChange: handleFileChange, style: { display: 'none' }, id: "fileInput", "data-testid": "quill-input-fileInput", ref: myInputRef }), _jsxs("div", { style: {
|
|
299
|
+
display: 'flex',
|
|
300
|
+
flexDirection: 'row',
|
|
301
|
+
gap: 12,
|
|
302
|
+
alignItems: 'center',
|
|
303
|
+
}, children: [_jsx(ButtonPrimitive, { onClick: handleButtonClick, label: 'Upload JSON' }), _jsx("span", { "data-testid": "quill-file-label", style: { ...header2Style, fontWeight: '600' }, children: fileLabel })] })] })] }) }) })) })), state.isSelfHosted ? (_jsxs("div", { style: {
|
|
304
|
+
borderRadius: 6,
|
|
305
|
+
padding: 12,
|
|
306
|
+
background: '#f5f5f5',
|
|
307
|
+
marginBottom: 18,
|
|
308
|
+
marginTop: 18,
|
|
309
|
+
fontSize: 14,
|
|
310
|
+
}, children: [_jsx("h2", { style: { ...header2Style, fontWeight: 600 }, children: "Self-hosted Database Connection" }), _jsx("div", { style: {
|
|
311
|
+
display: 'flex',
|
|
312
|
+
flexDirection: 'row',
|
|
313
|
+
alignItems: 'center',
|
|
314
|
+
gap: 4,
|
|
315
|
+
color: state.theme?.secondaryTextColor,
|
|
316
|
+
fontFamily: state.theme?.fontFamily,
|
|
317
|
+
}, children: `Using the database credentials passed into the Quill Server SDK at this endpoint: ${state.queryEndpoint}.` })] })) : (_jsxs("div", { style: {
|
|
217
318
|
borderRadius: 6,
|
|
218
319
|
padding: 12,
|
|
219
320
|
background: '#f5f5f5',
|
|
@@ -225,6 +326,8 @@ export default function ConnectDatabase({ containerStyle, header1Style, header2S
|
|
|
225
326
|
flexDirection: 'row',
|
|
226
327
|
alignItems: 'center',
|
|
227
328
|
gap: 4,
|
|
329
|
+
color: state.theme?.secondaryTextColor,
|
|
330
|
+
fontFamily: state.theme?.fontFamily,
|
|
228
331
|
}, children: ["Ensure Quill's IP is allowed to connect to your database", ' ', _jsx(ExternalLink, { href: databaseConnectionDetails.type.toLowerCase() === 'bigquery'
|
|
229
332
|
? 'https://cloud.google.com/access-context-manager/docs/overview#ip-address'
|
|
230
333
|
: databaseConnectionDetails.type.toLowerCase() === 'mysql'
|
|
@@ -240,18 +343,26 @@ export default function ConnectDatabase({ containerStyle, header1Style, header2S
|
|
|
240
343
|
? 'https://clickhouse.com/docs/cloud/security/setting-ip-filters/'
|
|
241
344
|
: 'https://www.postgresql.org/docs/current/auth-pg-hba-conf.html' })] }), _jsx(ClipboardButton, { text: "34.133.137.225", containerStyle: {
|
|
242
345
|
marginTop: 12,
|
|
243
|
-
} })] }), _jsx("div", { style: {
|
|
346
|
+
} })] })), _jsx("div", { style: {
|
|
244
347
|
width: '100%',
|
|
245
348
|
display: 'flex',
|
|
246
349
|
justifyContent: 'space-between',
|
|
247
350
|
alignItems: 'center',
|
|
248
351
|
marginTop: '24px',
|
|
249
|
-
}, "data-testid": "quill-connect-button", children: _jsx(ButtonPrimitive, { label: 'Connect', onClick:
|
|
352
|
+
}, "data-testid": "quill-connect-button", children: _jsx(ButtonPrimitive, { label: 'Connect', onClick: () => {
|
|
353
|
+
if (state.isSelfHosted) {
|
|
354
|
+
getSchemaNames();
|
|
355
|
+
}
|
|
356
|
+
else {
|
|
357
|
+
testConnectionAndFormClient();
|
|
358
|
+
}
|
|
359
|
+
}, disabled: isButtonDisabled && !state.isSelfHosted, isLoading: isConnecting }) })] })), _jsx(ModalPrimitive, { isOpen: !!error, onClose: () => setError(undefined), style: {
|
|
250
360
|
width: 420,
|
|
251
361
|
}, children: _jsxs("div", { style: {
|
|
252
362
|
display: 'flex',
|
|
253
363
|
flexDirection: 'column',
|
|
254
364
|
gap: 20,
|
|
365
|
+
fontFamily: state.theme?.fontFamily,
|
|
255
366
|
width: '100%',
|
|
256
367
|
}, children: [_jsx(CardSection, { children: "Failed to Connect" }), _jsxs("div", { style: { display: 'flex', flexDirection: 'column', gap: 5 }, children: [_jsx("div", { style: {
|
|
257
368
|
color: 'red',
|
|
@@ -280,6 +391,7 @@ export default function ConnectDatabase({ containerStyle, header1Style, header2S
|
|
|
280
391
|
flexDirection: 'column',
|
|
281
392
|
gap: 20,
|
|
282
393
|
width: '100%',
|
|
394
|
+
fontFamily: state.theme?.fontFamily,
|
|
283
395
|
}, children: [_jsx(CardSection, { children: "Connection Successful" }), _jsx("h2", { style: {
|
|
284
396
|
fontSize: 15,
|
|
285
397
|
fontWeight: 500,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ConnectSchema.d.ts","sourceRoot":"","sources":["../../../../src/forms/client_onboard/ConnectSchema.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAgC,MAAM,OAAO,CAAC;AAOpE,OAAO,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAC;AACvD,OAAO,EAAE,cAAc,EAAE,MAAM,mBAAmB,CAAC;AACnD,OAAO,EAAE,KAAK,EAAY,MAAM,qBAAqB,CAAC;AAEtD,OAAO,EAAE,UAAU,EAAE,MAAM,oBAAoB,CAAC;
|
|
1
|
+
{"version":3,"file":"ConnectSchema.d.ts","sourceRoot":"","sources":["../../../../src/forms/client_onboard/ConnectSchema.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAgC,MAAM,OAAO,CAAC;AAOpE,OAAO,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAC;AACvD,OAAO,EAAE,cAAc,EAAE,MAAM,mBAAmB,CAAC;AACnD,OAAO,EAAE,KAAK,EAAY,MAAM,qBAAqB,CAAC;AAEtD,OAAO,EAAE,UAAU,EAAE,MAAM,oBAAoB,CAAC;AAOhD,MAAM,CAAC,OAAO,UAAU,aAAa,CAAC,EACpC,cAAc,EACd,YAAY,EAEZ,cAAc,EACd,UAAU,EACV,UAAU,EACV,gBAAgB,EAChB,QAAQ,EACR,eAAe,EACf,KAAK,EACL,KAAK,EACL,uBAAuB,GACxB,EAAE;IACD,cAAc,CAAC,EAAE,aAAa,CAAC;IAC/B,YAAY,CAAC,EAAE,aAAa,CAAC;IAC7B,YAAY,CAAC,EAAE,aAAa,CAAC;IAC7B,cAAc,EAAE,cAAc,EAAE,CAAC;IACjC,UAAU,EAAE,cAAc,CAAC;IAC3B,UAAU,EAAE,OAAO,CAAC,UAAU,CAAC,CAAC;IAChC,gBAAgB,EAAE,CAAC,UAAU,EAAE,UAAU,KAAK,IAAI,CAAC;IACnD,QAAQ,EAAE,MAAM,CAAC;IACjB,eAAe,EAAE,MAAM,EAAE,CAAC;IAC1B,KAAK,EAAE,KAAK,CAAC;IACb,KAAK,EAAE,MAAM,CAAC;IACd,uBAAuB,EAAE,MAAM,IAAI,CAAC;CACrC,2CA6UA"}
|