@quillsql/admin 1.3.4 → 1.3.6
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/{Admin.d.ts → cjs/Admin.d.ts} +1 -0
- package/dist/cjs/Admin.d.ts.map +1 -0
- package/dist/{Admin.js → cjs/Admin.js} +24 -28
- package/dist/{AdminProvider.d.ts → cjs/AdminProvider.d.ts} +1 -0
- package/dist/cjs/AdminProvider.d.ts.map +1 -0
- package/dist/{AdminProvider.js → cjs/AdminProvider.js} +0 -1
- package/dist/{api → cjs/api}/ConnectionClient.d.ts +1 -0
- package/dist/cjs/api/ConnectionClient.d.ts.map +1 -0
- package/dist/{api → cjs/api}/ConnectionClient.js +0 -1
- package/dist/{components → cjs/components}/Banner/index.d.ts +1 -0
- package/dist/cjs/components/Banner/index.d.ts.map +1 -0
- package/dist/{components → cjs/components}/Banner/index.js +0 -1
- package/dist/{components → cjs/components}/CardSection.d.ts +1 -0
- package/dist/cjs/components/CardSection.d.ts.map +1 -0
- package/dist/{components → cjs/components}/CardSection.js +0 -1
- package/dist/{components → cjs/components}/CardTitle.d.ts +1 -0
- package/dist/cjs/components/CardTitle.d.ts.map +1 -0
- package/dist/{components → cjs/components}/CardTitle.js +0 -1
- package/dist/{components → cjs/components}/DashboardSelectPopover.d.ts +1 -0
- package/dist/cjs/components/DashboardSelectPopover.d.ts.map +1 -0
- package/dist/{components → cjs/components}/DashboardSelectPopover.js +0 -1
- package/dist/{components → cjs/components}/DatabaseSelector.d.ts +1 -0
- package/dist/cjs/components/DatabaseSelector.d.ts.map +1 -0
- package/dist/{components → cjs/components}/DatabaseSelector.js +0 -1
- package/dist/{components → cjs/components}/DeleteButton.d.ts +1 -0
- package/dist/cjs/components/DeleteButton.d.ts.map +1 -0
- package/dist/{components → cjs/components}/DeleteButton.js +0 -1
- package/dist/{components → cjs/components}/DropDownMenu.d.ts +1 -0
- package/dist/cjs/components/DropDownMenu.d.ts.map +1 -0
- package/dist/{components → cjs/components}/DropDownMenu.js +0 -1
- package/dist/{components → cjs/components}/DropDownMenuWithLabel.d.ts +1 -0
- package/dist/cjs/components/DropDownMenuWithLabel.d.ts.map +1 -0
- package/dist/{components → cjs/components}/DropDownMenuWithLabel.js +0 -1
- package/dist/cjs/components/EmptyDashboardComponent/index.d.ts +3 -0
- package/dist/cjs/components/EmptyDashboardComponent/index.d.ts.map +1 -0
- package/dist/cjs/components/EmptyDashboardComponent/index.js +45 -0
- package/dist/{components → cjs/components}/EnvSelectPopover.d.ts +1 -0
- package/dist/cjs/components/EnvSelectPopover.d.ts.map +1 -0
- package/dist/{components → cjs/components}/EnvSelectPopover.js +19 -3
- package/dist/{components → cjs/components}/InputLabel.d.ts +1 -0
- package/dist/cjs/components/InputLabel.d.ts.map +1 -0
- package/dist/{components → cjs/components}/InputLabel.js +0 -1
- package/dist/{components → cjs/components}/OrgSelect.d.ts +1 -0
- package/dist/cjs/components/OrgSelect.d.ts.map +1 -0
- package/dist/{components → cjs/components}/OrgSelect.js +0 -1
- package/dist/{components → cjs/components}/SqlViewTile.d.ts +1 -0
- package/dist/cjs/components/SqlViewTile.d.ts.map +1 -0
- package/dist/{components → cjs/components}/SqlViewTile.js +0 -1
- package/dist/{components → cjs/components}/StepDisplay.d.ts +1 -0
- package/dist/cjs/components/StepDisplay.d.ts.map +1 -0
- package/dist/{components → cjs/components}/StepDisplay.js +0 -1
- package/dist/cjs/components/index.d.ts +6 -0
- package/dist/cjs/components/index.d.ts.map +1 -0
- package/dist/{components → cjs/components}/index.js +0 -1
- package/dist/{forms → cjs/forms}/client_onboard/ConnectDatabase.d.ts +1 -0
- package/dist/cjs/forms/client_onboard/ConnectDatabase.d.ts.map +1 -0
- package/dist/{forms → cjs/forms}/client_onboard/ConnectDatabase.js +0 -1
- package/dist/{forms → cjs/forms}/client_onboard/ConnectSchema.d.ts +1 -0
- package/dist/cjs/forms/client_onboard/ConnectSchema.d.ts.map +1 -0
- package/dist/{forms → cjs/forms}/client_onboard/ConnectSchema.js +0 -1
- package/dist/{forms → cjs/forms}/client_onboard/CreateSqlViews.d.ts +1 -0
- package/dist/cjs/forms/client_onboard/CreateSqlViews.d.ts.map +1 -0
- package/dist/{forms → cjs/forms}/client_onboard/CreateSqlViews.js +0 -1
- package/dist/{hooks → cjs/hooks}/useItemBeingEdited.d.ts +1 -0
- package/dist/cjs/hooks/useItemBeingEdited.d.ts.map +1 -0
- package/dist/{hooks → cjs/hooks}/useItemBeingEdited.js +0 -1
- package/dist/{icons → cjs/icons}/ArrowDownHeadIcon.d.ts +1 -0
- package/dist/cjs/icons/ArrowDownHeadIcon.d.ts.map +1 -0
- package/dist/{icons → cjs/icons}/ArrowDownHeadIcon.js +0 -1
- package/dist/{icons → cjs/icons}/XMarkIcon.d.ts +1 -0
- package/dist/cjs/icons/XMarkIcon.d.ts.map +1 -0
- package/dist/{icons → cjs/icons}/XMarkIcon.js +0 -1
- package/dist/cjs/icons/index.d.ts +2 -0
- package/dist/cjs/icons/index.d.ts.map +1 -0
- package/dist/{icons → cjs/icons}/index.js +0 -1
- package/dist/cjs/index.d.ts +7 -0
- package/dist/cjs/index.d.ts.map +1 -0
- package/dist/{index.js → cjs/index.js} +0 -1
- package/dist/{modals → cjs/modals}/EditDashboardsModal.d.ts +1 -0
- package/dist/cjs/modals/EditDashboardsModal.d.ts.map +1 -0
- package/dist/{modals → cjs/modals}/EditDashboardsModal.js +0 -1
- package/dist/{modals → cjs/modals}/NewDashboardModal.d.ts +1 -0
- package/dist/cjs/modals/NewDashboardModal.d.ts.map +1 -0
- package/dist/{modals → cjs/modals}/NewDashboardModal.js +0 -1
- package/dist/{modals → cjs/modals}/PromoteDashModal.d.ts +1 -0
- package/dist/cjs/modals/PromoteDashModal.d.ts.map +1 -0
- package/dist/{modals → cjs/modals}/PromoteDashModal.js +0 -1
- package/dist/{modals → cjs/modals}/PromoteViewModal.d.ts +1 -0
- package/dist/cjs/modals/PromoteViewModal.d.ts.map +1 -0
- package/dist/{modals → cjs/modals}/PromoteViewModal.js +0 -1
- package/dist/{modals → cjs/modals}/ReorderDashboardModal.d.ts +1 -0
- package/dist/cjs/modals/ReorderDashboardModal.d.ts.map +1 -0
- package/dist/{modals → cjs/modals}/ReorderDashboardModal.js +0 -1
- package/dist/cjs/modals/index.d.ts +5 -0
- package/dist/cjs/modals/index.d.ts.map +1 -0
- package/dist/{modals → cjs/modals}/index.js +0 -1
- package/dist/{primitives → cjs/primitives}/ButtonPrimitive.d.ts +1 -0
- package/dist/cjs/primitives/ButtonPrimitive.d.ts.map +1 -0
- package/dist/{primitives → cjs/primitives}/ButtonPrimitive.js +0 -1
- package/dist/{primitives → cjs/primitives}/HeaderPrimitive.d.ts +1 -0
- package/dist/cjs/primitives/HeaderPrimitive.d.ts.map +1 -0
- package/dist/{primitives → cjs/primitives}/HeaderPrimitive.js +0 -1
- package/dist/{primitives → cjs/primitives}/ModalPrimitive.d.ts +1 -0
- package/dist/cjs/primitives/ModalPrimitive.d.ts.map +1 -0
- package/dist/{primitives → cjs/primitives}/ModalPrimitive.js +0 -1
- package/dist/{primitives → cjs/primitives}/SecondaryButtonPrimitive.d.ts +1 -0
- package/dist/cjs/primitives/SecondaryButtonPrimitive.d.ts.map +1 -0
- package/dist/{primitives → cjs/primitives}/SecondaryButtonPrimitive.js +0 -1
- package/dist/{primitives → cjs/primitives}/SelectPrimitive.d.ts +1 -0
- package/dist/cjs/primitives/SelectPrimitive.d.ts.map +1 -0
- package/dist/{primitives → cjs/primitives}/SelectPrimitive.js +0 -1
- package/dist/{primitives → cjs/primitives}/TextInputPrimitive.d.ts +1 -0
- package/dist/cjs/primitives/TextInputPrimitive.d.ts.map +1 -0
- package/dist/{primitives → cjs/primitives}/TextInputPrimitive.js +0 -1
- package/dist/{primitives → cjs/primitives}/TogglePrimitive.d.ts +1 -0
- package/dist/cjs/primitives/TogglePrimitive.d.ts.map +1 -0
- package/dist/{primitives → cjs/primitives}/TogglePrimitive.js +0 -1
- package/dist/cjs/primitives/index.d.ts +7 -0
- package/dist/cjs/primitives/index.d.ts.map +1 -0
- package/dist/{primitives → cjs/primitives}/index.js +0 -1
- package/dist/{public_components → cjs/public_components}/CreateEnvironment.d.ts +1 -0
- package/dist/cjs/public_components/CreateEnvironment.d.ts.map +1 -0
- package/dist/{public_components → cjs/public_components}/CreateEnvironment.js +0 -1
- package/dist/{public_components → cjs/public_components}/DashboardBuilder.d.ts +1 -0
- package/dist/cjs/public_components/DashboardBuilder.d.ts.map +1 -0
- package/dist/{public_components → cjs/public_components}/DashboardBuilder.js +0 -1
- package/dist/{public_components → cjs/public_components}/DashboardManager.d.ts +1 -0
- package/dist/cjs/public_components/DashboardManager.d.ts.map +1 -0
- package/dist/{public_components → cjs/public_components}/DashboardManager.js +11 -5
- package/dist/{public_components → cjs/public_components}/SQLViewManager.d.ts +1 -0
- package/dist/cjs/public_components/SQLViewManager.d.ts.map +1 -0
- package/dist/{public_components → cjs/public_components}/SQLViewManager.js +0 -1
- package/dist/{utils → cjs/utils}/constants.d.ts +1 -0
- package/dist/cjs/utils/constants.d.ts.map +1 -0
- package/dist/{utils → cjs/utils}/constants.js +0 -1
- package/dist/{utils → cjs/utils}/databases.d.ts +1 -0
- package/dist/cjs/utils/databases.d.ts.map +1 -0
- package/dist/{utils → cjs/utils}/databases.js +0 -1
- package/dist/{utils → cjs/utils}/delay.d.ts +1 -0
- package/dist/cjs/utils/delay.d.ts.map +1 -0
- package/dist/{utils → cjs/utils}/delay.js +0 -1
- package/dist/{utils → cjs/utils}/schema.d.ts +1 -0
- package/dist/cjs/utils/schema.d.ts.map +1 -0
- package/dist/{utils → cjs/utils}/schema.js +0 -1
- package/dist/{utils → cjs/utils}/table.d.ts +1 -0
- package/dist/cjs/utils/table.d.ts.map +1 -0
- package/dist/{utils → cjs/utils}/table.js +0 -1
- package/dist/esm/Admin.d.ts +167 -0
- package/dist/esm/Admin.d.ts.map +1 -0
- package/dist/esm/Admin.js +1387 -0
- package/dist/esm/AdminProvider.d.ts +126 -0
- package/dist/esm/AdminProvider.d.ts.map +1 -0
- package/dist/esm/AdminProvider.js +315 -0
- package/dist/esm/api/ConnectionClient.d.ts +24 -0
- package/dist/esm/api/ConnectionClient.d.ts.map +1 -0
- package/dist/esm/api/ConnectionClient.js +244 -0
- package/dist/esm/components/Banner/index.d.ts +3 -0
- package/dist/esm/components/Banner/index.d.ts.map +1 -0
- package/dist/esm/components/Banner/index.js +27 -0
- package/dist/esm/components/CardSection.d.ts +3 -0
- package/dist/esm/components/CardSection.d.ts.map +1 -0
- package/dist/esm/components/CardSection.js +9 -0
- package/dist/esm/components/CardTitle.d.ts +3 -0
- package/dist/esm/components/CardTitle.d.ts.map +1 -0
- package/dist/esm/components/CardTitle.js +11 -0
- package/dist/esm/components/DashboardSelectPopover.d.ts +11 -0
- package/dist/esm/components/DashboardSelectPopover.d.ts.map +1 -0
- package/dist/esm/components/DashboardSelectPopover.js +175 -0
- package/dist/esm/components/DatabaseSelector.d.ts +11 -0
- package/dist/esm/components/DatabaseSelector.d.ts.map +1 -0
- package/dist/esm/components/DatabaseSelector.js +22 -0
- package/dist/esm/components/DeleteButton.d.ts +3 -0
- package/dist/esm/components/DeleteButton.d.ts.map +1 -0
- package/dist/esm/components/DeleteButton.js +10 -0
- package/dist/esm/components/DropDownMenu.d.ts +10 -0
- package/dist/esm/components/DropDownMenu.d.ts.map +1 -0
- package/dist/esm/components/DropDownMenu.js +39 -0
- package/dist/esm/components/DropDownMenuWithLabel.d.ts +12 -0
- package/dist/esm/components/DropDownMenuWithLabel.d.ts.map +1 -0
- package/dist/esm/components/DropDownMenuWithLabel.js +47 -0
- package/dist/esm/components/EmptyDashboardComponent/index.d.ts +3 -0
- package/dist/esm/components/EmptyDashboardComponent/index.d.ts.map +1 -0
- package/dist/esm/components/EmptyDashboardComponent/index.js +42 -0
- package/dist/esm/components/EnvSelectPopover.d.ts +13 -0
- package/dist/esm/components/EnvSelectPopover.d.ts.map +1 -0
- package/dist/esm/components/EnvSelectPopover.js +222 -0
- package/dist/esm/components/InputLabel.d.ts +3 -0
- package/dist/esm/components/InputLabel.d.ts.map +1 -0
- package/dist/esm/components/InputLabel.js +10 -0
- package/dist/esm/components/OrgSelect.d.ts +12 -0
- package/dist/esm/components/OrgSelect.d.ts.map +1 -0
- package/dist/esm/components/OrgSelect.js +193 -0
- package/dist/esm/components/SqlViewTile.d.ts +8 -0
- package/dist/esm/components/SqlViewTile.d.ts.map +1 -0
- package/dist/esm/components/SqlViewTile.js +40 -0
- package/dist/esm/components/StepDisplay.d.ts +10 -0
- package/dist/esm/components/StepDisplay.d.ts.map +1 -0
- package/dist/esm/components/StepDisplay.js +15 -0
- package/dist/esm/components/index.d.ts +6 -0
- package/dist/esm/components/index.d.ts.map +1 -0
- package/dist/esm/forms/client_onboard/ConnectDatabase.d.ts +11 -0
- package/dist/esm/forms/client_onboard/ConnectDatabase.d.ts.map +1 -0
- package/dist/esm/forms/client_onboard/ConnectDatabase.js +137 -0
- package/dist/esm/forms/client_onboard/ConnectSchema.d.ts +13 -0
- package/dist/esm/forms/client_onboard/ConnectSchema.d.ts.map +1 -0
- package/dist/esm/forms/client_onboard/ConnectSchema.js +171 -0
- package/dist/esm/forms/client_onboard/CreateSqlViews.d.ts +15 -0
- package/dist/esm/forms/client_onboard/CreateSqlViews.d.ts.map +1 -0
- package/dist/esm/forms/client_onboard/CreateSqlViews.js +202 -0
- package/dist/esm/hooks/useItemBeingEdited.d.ts +4 -0
- package/dist/esm/hooks/useItemBeingEdited.d.ts.map +1 -0
- package/dist/esm/hooks/useItemBeingEdited.js +25 -0
- package/dist/esm/icons/ArrowDownHeadIcon.d.ts +5 -0
- package/dist/esm/icons/ArrowDownHeadIcon.d.ts.map +1 -0
- package/dist/esm/icons/ArrowDownHeadIcon.js +3 -0
- package/dist/esm/icons/XMarkIcon.d.ts +3 -0
- package/dist/esm/icons/XMarkIcon.d.ts.map +1 -0
- package/dist/esm/icons/XMarkIcon.js +11 -0
- package/dist/esm/icons/index.d.ts +2 -0
- package/dist/esm/icons/index.d.ts.map +1 -0
- package/dist/esm/index.d.ts +7 -0
- package/dist/esm/index.d.ts.map +1 -0
- package/dist/esm/modals/EditDashboardsModal.d.ts +20 -0
- package/dist/esm/modals/EditDashboardsModal.d.ts.map +1 -0
- package/dist/esm/modals/EditDashboardsModal.js +91 -0
- package/dist/esm/modals/NewDashboardModal.d.ts +19 -0
- package/dist/esm/modals/NewDashboardModal.d.ts.map +1 -0
- package/dist/esm/modals/NewDashboardModal.js +276 -0
- package/dist/esm/modals/PromoteDashModal.d.ts +17 -0
- package/dist/esm/modals/PromoteDashModal.d.ts.map +1 -0
- package/dist/esm/modals/PromoteDashModal.js +123 -0
- package/dist/esm/modals/PromoteViewModal.d.ts +13 -0
- package/dist/esm/modals/PromoteViewModal.d.ts.map +1 -0
- package/dist/esm/modals/PromoteViewModal.js +105 -0
- package/dist/esm/modals/ReorderDashboardModal.d.ts +11 -0
- package/dist/esm/modals/ReorderDashboardModal.d.ts.map +1 -0
- package/dist/esm/modals/ReorderDashboardModal.js +124 -0
- package/dist/esm/modals/index.d.ts +5 -0
- package/dist/esm/modals/index.d.ts.map +1 -0
- package/dist/esm/primitives/ButtonPrimitive.d.ts +12 -0
- package/dist/esm/primitives/ButtonPrimitive.d.ts.map +1 -0
- package/dist/esm/primitives/ButtonPrimitive.js +47 -0
- package/dist/esm/primitives/HeaderPrimitive.d.ts +9 -0
- package/dist/esm/primitives/HeaderPrimitive.d.ts.map +1 -0
- package/dist/esm/primitives/HeaderPrimitive.js +9 -0
- package/dist/esm/primitives/ModalPrimitive.d.ts +12 -0
- package/dist/esm/primitives/ModalPrimitive.d.ts.map +1 -0
- package/dist/esm/primitives/ModalPrimitive.js +47 -0
- package/dist/esm/primitives/SecondaryButtonPrimitive.d.ts +10 -0
- package/dist/esm/primitives/SecondaryButtonPrimitive.d.ts.map +1 -0
- package/dist/esm/primitives/SecondaryButtonPrimitive.js +22 -0
- package/dist/esm/primitives/SelectPrimitive.d.ts +16 -0
- package/dist/esm/primitives/SelectPrimitive.d.ts.map +1 -0
- package/dist/esm/primitives/SelectPrimitive.js +41 -0
- package/dist/esm/primitives/TextInputPrimitive.d.ts +12 -0
- package/dist/esm/primitives/TextInputPrimitive.d.ts.map +1 -0
- package/dist/esm/primitives/TextInputPrimitive.js +24 -0
- package/dist/esm/primitives/TogglePrimitive.d.ts +6 -0
- package/dist/esm/primitives/TogglePrimitive.d.ts.map +1 -0
- package/dist/esm/primitives/TogglePrimitive.js +45 -0
- package/dist/esm/primitives/index.d.ts +7 -0
- package/dist/esm/primitives/index.d.ts.map +1 -0
- package/dist/esm/public_components/CreateEnvironment.d.ts +6 -0
- package/dist/esm/public_components/CreateEnvironment.d.ts.map +1 -0
- package/dist/esm/public_components/CreateEnvironment.js +135 -0
- package/dist/esm/public_components/DashboardBuilder.d.ts +7 -0
- package/dist/esm/public_components/DashboardBuilder.d.ts.map +1 -0
- package/dist/esm/public_components/DashboardBuilder.js +192 -0
- package/dist/esm/public_components/DashboardManager.d.ts +6 -0
- package/dist/esm/public_components/DashboardManager.d.ts.map +1 -0
- package/dist/esm/public_components/DashboardManager.js +312 -0
- package/dist/esm/public_components/SQLViewManager.d.ts +5 -0
- package/dist/esm/public_components/SQLViewManager.d.ts.map +1 -0
- package/dist/esm/public_components/SQLViewManager.js +394 -0
- package/dist/esm/utils/constants.d.ts +26 -0
- package/dist/esm/utils/constants.d.ts.map +1 -0
- package/dist/esm/utils/constants.js +13 -0
- package/dist/esm/utils/databases.d.ts +34 -0
- package/dist/esm/utils/databases.d.ts.map +1 -0
- package/dist/esm/utils/databases.js +51 -0
- package/dist/esm/utils/delay.d.ts +2 -0
- package/dist/esm/utils/delay.d.ts.map +1 -0
- package/dist/esm/utils/delay.js +3 -0
- package/dist/esm/utils/schema.d.ts +22 -0
- package/dist/esm/utils/schema.d.ts.map +1 -0
- package/dist/esm/utils/schema.js +1 -0
- package/dist/esm/utils/table.d.ts +16 -0
- package/dist/esm/utils/table.d.ts.map +1 -0
- package/dist/esm/utils/table.js +1 -0
- package/package.json +11 -7
- package/dist/Admin.d.ts.map +0 -1
- package/dist/Admin.js.map +0 -1
- package/dist/AdminProvider.d.ts.map +0 -1
- package/dist/AdminProvider.js.map +0 -1
- package/dist/api/ConnectionClient.d.ts.map +0 -1
- package/dist/api/ConnectionClient.js.map +0 -1
- package/dist/components/Banner/index.d.ts.map +0 -1
- package/dist/components/Banner/index.js.map +0 -1
- package/dist/components/CardSection.d.ts.map +0 -1
- package/dist/components/CardSection.js.map +0 -1
- package/dist/components/CardTitle.d.ts.map +0 -1
- package/dist/components/CardTitle.js.map +0 -1
- package/dist/components/DashboardSelectPopover.d.ts.map +0 -1
- package/dist/components/DashboardSelectPopover.js.map +0 -1
- package/dist/components/DatabaseSelector.d.ts.map +0 -1
- package/dist/components/DatabaseSelector.js.map +0 -1
- package/dist/components/DeleteButton.d.ts.map +0 -1
- package/dist/components/DeleteButton.js.map +0 -1
- package/dist/components/DropDownMenu.d.ts.map +0 -1
- package/dist/components/DropDownMenu.js.map +0 -1
- package/dist/components/DropDownMenuWithLabel.d.ts.map +0 -1
- package/dist/components/DropDownMenuWithLabel.js.map +0 -1
- package/dist/components/EnvSelectPopover.d.ts.map +0 -1
- package/dist/components/EnvSelectPopover.js.map +0 -1
- package/dist/components/InputLabel.d.ts.map +0 -1
- package/dist/components/InputLabel.js.map +0 -1
- package/dist/components/OrgSelect.d.ts.map +0 -1
- package/dist/components/OrgSelect.js.map +0 -1
- package/dist/components/SqlViewTile.d.ts.map +0 -1
- package/dist/components/SqlViewTile.js.map +0 -1
- package/dist/components/StepDisplay.d.ts.map +0 -1
- package/dist/components/StepDisplay.js.map +0 -1
- package/dist/components/index.d.ts.map +0 -1
- package/dist/components/index.js.map +0 -1
- package/dist/forms/client_onboard/ConnectDatabase.d.ts.map +0 -1
- package/dist/forms/client_onboard/ConnectDatabase.js.map +0 -1
- package/dist/forms/client_onboard/ConnectSchema.d.ts.map +0 -1
- package/dist/forms/client_onboard/ConnectSchema.js.map +0 -1
- package/dist/forms/client_onboard/CreateSqlViews.d.ts.map +0 -1
- package/dist/forms/client_onboard/CreateSqlViews.js.map +0 -1
- package/dist/hooks/useItemBeingEdited.d.ts.map +0 -1
- package/dist/hooks/useItemBeingEdited.js.map +0 -1
- package/dist/icons/ArrowDownHeadIcon.d.ts.map +0 -1
- package/dist/icons/ArrowDownHeadIcon.js.map +0 -1
- package/dist/icons/XMarkIcon.d.ts.map +0 -1
- package/dist/icons/XMarkIcon.js.map +0 -1
- package/dist/icons/index.d.ts.map +0 -1
- package/dist/icons/index.js.map +0 -1
- package/dist/index.d.ts.map +0 -1
- package/dist/index.js.map +0 -1
- package/dist/modals/EditDashboardsModal.d.ts.map +0 -1
- package/dist/modals/EditDashboardsModal.js.map +0 -1
- package/dist/modals/NewDashboardModal.d.ts.map +0 -1
- package/dist/modals/NewDashboardModal.js.map +0 -1
- package/dist/modals/PromoteDashModal.d.ts.map +0 -1
- package/dist/modals/PromoteDashModal.js.map +0 -1
- package/dist/modals/PromoteViewModal.d.ts.map +0 -1
- package/dist/modals/PromoteViewModal.js.map +0 -1
- package/dist/modals/ReorderDashboardModal.d.ts.map +0 -1
- package/dist/modals/ReorderDashboardModal.js.map +0 -1
- package/dist/modals/index.d.ts.map +0 -1
- package/dist/modals/index.js.map +0 -1
- package/dist/primitives/ButtonPrimitive.d.ts.map +0 -1
- package/dist/primitives/ButtonPrimitive.js.map +0 -1
- package/dist/primitives/HeaderPrimitive.d.ts.map +0 -1
- package/dist/primitives/HeaderPrimitive.js.map +0 -1
- package/dist/primitives/ModalPrimitive.d.ts.map +0 -1
- package/dist/primitives/ModalPrimitive.js.map +0 -1
- package/dist/primitives/SecondaryButtonPrimitive.d.ts.map +0 -1
- package/dist/primitives/SecondaryButtonPrimitive.js.map +0 -1
- package/dist/primitives/SelectPrimitive.d.ts.map +0 -1
- package/dist/primitives/SelectPrimitive.js.map +0 -1
- package/dist/primitives/TextInputPrimitive.d.ts.map +0 -1
- package/dist/primitives/TextInputPrimitive.js.map +0 -1
- package/dist/primitives/TogglePrimitive.d.ts.map +0 -1
- package/dist/primitives/TogglePrimitive.js.map +0 -1
- package/dist/primitives/index.d.ts.map +0 -1
- package/dist/primitives/index.js.map +0 -1
- package/dist/public_components/CreateEnvironment.d.ts.map +0 -1
- package/dist/public_components/CreateEnvironment.js.map +0 -1
- package/dist/public_components/DashboardBuilder.d.ts.map +0 -1
- package/dist/public_components/DashboardBuilder.js.map +0 -1
- package/dist/public_components/DashboardManager.d.ts.map +0 -1
- package/dist/public_components/DashboardManager.js.map +0 -1
- package/dist/public_components/SQLViewManager.d.ts.map +0 -1
- package/dist/public_components/SQLViewManager.js.map +0 -1
- package/dist/utils/constants.d.ts.map +0 -1
- package/dist/utils/constants.js.map +0 -1
- package/dist/utils/databases.d.ts.map +0 -1
- package/dist/utils/databases.js.map +0 -1
- package/dist/utils/delay.d.ts.map +0 -1
- package/dist/utils/delay.js.map +0 -1
- package/dist/utils/schema.d.ts.map +0 -1
- package/dist/utils/schema.js.map +0 -1
- package/dist/utils/table.d.ts.map +0 -1
- package/dist/utils/table.js.map +0 -1
- /package/dist/{components/index.d.ts → esm/components/index.js} +0 -0
- /package/dist/{icons/index.d.ts → esm/icons/index.js} +0 -0
- /package/dist/{index.d.ts → esm/index.js} +0 -0
- /package/dist/{modals/index.d.ts → esm/modals/index.js} +0 -0
- /package/dist/{primitives/index.d.ts → esm/primitives/index.js} +0 -0
|
@@ -0,0 +1,1387 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
2
|
+
// @ts-nocheck
|
|
3
|
+
import { useState, useEffect } from 'react';
|
|
4
|
+
import { QuillProvider, useQuill, Chart, Table, SQLEditor, AddToDashboardModal, ChartEditor, useDashboard, } from '@quillsql/react';
|
|
5
|
+
import prismTheme from 'prism-react-renderer/themes/nightOwlLight';
|
|
6
|
+
import Highlight, { defaultProps } from 'prism-react-renderer';
|
|
7
|
+
import { DndContext, closestCenter, KeyboardSensor, PointerSensor, useSensor, useSensors, MeasuringStrategy, TouchSensor, } from '@dnd-kit/core';
|
|
8
|
+
import InputLabel from './components/InputLabel';
|
|
9
|
+
import CardSection from './components/CardSection';
|
|
10
|
+
import { arrayMove, SortableContext, sortableKeyboardCoordinates, verticalListSortingStrategy, useSortable, defaultAnimateLayoutChanges, } from '@dnd-kit/sortable';
|
|
11
|
+
import { CSS } from '@dnd-kit/utilities';
|
|
12
|
+
import { OrgSelect, DashboardManager } from './components';
|
|
13
|
+
import { AdminProvider, useAdmin } from './AdminProvider';
|
|
14
|
+
import { ButtonPrimitive, HeaderPrimitive, ModalPrimitive, SecondaryButtonPrimitive, SelectPrimitive, TextInputPrimitive, } from './primitives';
|
|
15
|
+
import DashboardBuilder from './public_components/DashboardBuilder';
|
|
16
|
+
import SQLViewManager from './public_components/SQLViewManager';
|
|
17
|
+
import { InitialDateRangeOptions, QUILL_SERVER, defaultDateRange, } from './utils/constants';
|
|
18
|
+
import TogglePrimitive from './primitives/TogglePrimitive';
|
|
19
|
+
const defaultTheme = {
|
|
20
|
+
fontFamily: 'Inter; Helvetica',
|
|
21
|
+
backgroundColor: '#FFFFFF',
|
|
22
|
+
primaryTextColor: '#364153',
|
|
23
|
+
secondaryTextColor: '#6C727F',
|
|
24
|
+
chartLabelFontFamily: 'Inter; Helvetica',
|
|
25
|
+
chartLabelColor: '#666666',
|
|
26
|
+
chartTickColor: '#CCCCCC',
|
|
27
|
+
// chartColors: ["#6269E9", "#E14F62"],
|
|
28
|
+
borderColor: '#E5E7EB',
|
|
29
|
+
primaryButtonColor: '#364153',
|
|
30
|
+
borderWidth: 1,
|
|
31
|
+
labelFontWeight: '500',
|
|
32
|
+
fontSize: 14,
|
|
33
|
+
};
|
|
34
|
+
export function EditFiltersModal({ isOpen, dashboardData, selectedDashboard, client, setIsOpen, onSave, ModalComponent, TextInputComponent, ButtonComponent, HeaderComponent, SelectComponent, dashNames, setSelectedEditDashboard, SecondaryButtonComponent, openAddFilterModal, openEditOrderModal, }) {
|
|
35
|
+
const { state, dispatch } = useAdmin();
|
|
36
|
+
const [selectedDashboardName, setSelectedDashboardName] = useState(selectedDashboard);
|
|
37
|
+
useEffect(() => {
|
|
38
|
+
setSelectedDashboardName(selectedDashboard);
|
|
39
|
+
}, [selectedDashboard]);
|
|
40
|
+
const { data } = useDashboard(selectedDashboard);
|
|
41
|
+
const [isDateComparison, setIsDateComparison] = useState(false);
|
|
42
|
+
const [newFilters, setNewFilters] = useState([]);
|
|
43
|
+
const [initialRange, setInitialRange] = useState(defaultDateRange);
|
|
44
|
+
const [showDateFilter, setShowDateFilter] = useState(true);
|
|
45
|
+
const [newDateFilter, setNewDateFilter] = useState(null);
|
|
46
|
+
const [selectedTable, setSelectedTable] = useState(null);
|
|
47
|
+
const [field, setField] = useState('');
|
|
48
|
+
useEffect(() => {
|
|
49
|
+
if (data && data.dateFilter) {
|
|
50
|
+
setIsDateComparison(data.dateFilter.comparison);
|
|
51
|
+
dispatch('SET_DATE_FILTER', data.dateFilter);
|
|
52
|
+
}
|
|
53
|
+
}, [data]);
|
|
54
|
+
useEffect(() => {
|
|
55
|
+
setIsDateComparison(!!state.dateFilter.comparison);
|
|
56
|
+
}, [state.dateFilter]);
|
|
57
|
+
useEffect(() => {
|
|
58
|
+
if (state.tables.length) {
|
|
59
|
+
const defaultTable = state.tables[0];
|
|
60
|
+
const name = state.editDashboardData?.filters[0]?.table;
|
|
61
|
+
const table = state.tables.find((t) => t.name === name) ?? defaultTable;
|
|
62
|
+
setSelectedTable(table);
|
|
63
|
+
setField(table.columns.map((elem) => elem.name)[0]);
|
|
64
|
+
}
|
|
65
|
+
}, [state.tables, state.editDashboardData]);
|
|
66
|
+
useEffect(() => {
|
|
67
|
+
if (dashboardData && dashboardData.filters) {
|
|
68
|
+
setNewFilters(dashboardData.filters);
|
|
69
|
+
}
|
|
70
|
+
if (dashboardData && dashboardData.dateFilter) {
|
|
71
|
+
setNewDateFilter(dashboardData.dateFilter);
|
|
72
|
+
}
|
|
73
|
+
}, [dashboardData]);
|
|
74
|
+
const handleAddFilter = async () => {
|
|
75
|
+
setNewFilters([...newFilters, { label: '', field }]);
|
|
76
|
+
};
|
|
77
|
+
const handleSubmitDashboardChanges = async () => {
|
|
78
|
+
if (!selectedDashboardName ||
|
|
79
|
+
newFilters.some((filter) => !filter.label) ||
|
|
80
|
+
(newDateFilter &&
|
|
81
|
+
Object.keys(newDateFilter).length &&
|
|
82
|
+
!newDateFilter.label)) {
|
|
83
|
+
alert('Empty fields');
|
|
84
|
+
return;
|
|
85
|
+
}
|
|
86
|
+
if (newFilters.filter((elem) => !elem.field).length) {
|
|
87
|
+
alert(`no filter field for: ${newFilters.filter((elem) => !elem.field)[0].label}`);
|
|
88
|
+
return;
|
|
89
|
+
}
|
|
90
|
+
const updatedFilters = newFilters.map((filter) => {
|
|
91
|
+
const filterType = getPostgresBasicType(selectedTable.columns.find((col) => col.name === filter.field));
|
|
92
|
+
return {
|
|
93
|
+
table: selectedTable.name,
|
|
94
|
+
field: filter.field,
|
|
95
|
+
labelField: filter.field,
|
|
96
|
+
label: filter.label,
|
|
97
|
+
filterType,
|
|
98
|
+
};
|
|
99
|
+
});
|
|
100
|
+
if (dashNames &&
|
|
101
|
+
dashNames.length > 0 &&
|
|
102
|
+
dashNames.some((dashName) => dashName.name === selectedDashboardName &&
|
|
103
|
+
selectedDashboardName !== selectedDashboard)) {
|
|
104
|
+
alert('Dashboard name already taken!');
|
|
105
|
+
return;
|
|
106
|
+
}
|
|
107
|
+
const fieldsSet = new Set();
|
|
108
|
+
const hasDuplicateField = updatedFilters.some((filter) => {
|
|
109
|
+
if (fieldsSet.has(filter.field)) {
|
|
110
|
+
return true;
|
|
111
|
+
}
|
|
112
|
+
else {
|
|
113
|
+
fieldsSet.add(filter.field);
|
|
114
|
+
return false;
|
|
115
|
+
}
|
|
116
|
+
});
|
|
117
|
+
if (hasDuplicateField ||
|
|
118
|
+
(Object.keys(newDateFilter).length > 0 &&
|
|
119
|
+
updatedFilters.some((filter) => filter.filterType === 'date'))) {
|
|
120
|
+
alert('Maximum of one filter per field');
|
|
121
|
+
return;
|
|
122
|
+
}
|
|
123
|
+
let allValid = true;
|
|
124
|
+
updatedFilters.forEach((filter) => {
|
|
125
|
+
if (filter.filterType !== 'string' && filter.filterType !== 'date') {
|
|
126
|
+
allValid = false;
|
|
127
|
+
console.error(`Invalid filterType found: ${filter.filterType}`);
|
|
128
|
+
}
|
|
129
|
+
});
|
|
130
|
+
if (!allValid) {
|
|
131
|
+
alert('We only support string and filters.');
|
|
132
|
+
return;
|
|
133
|
+
}
|
|
134
|
+
const url = `${QUILL_SERVER}/dashfilter/${client._id}/`;
|
|
135
|
+
const body = {
|
|
136
|
+
newDashboardName: selectedDashboardName,
|
|
137
|
+
filters: updatedFilters,
|
|
138
|
+
dateFilter: {
|
|
139
|
+
...newDateFilter,
|
|
140
|
+
comparison: isDateComparison,
|
|
141
|
+
primaryRange: initialRange,
|
|
142
|
+
},
|
|
143
|
+
name: selectedDashboard,
|
|
144
|
+
};
|
|
145
|
+
dispatch({ type: 'SET_DATE_FILTER', payload: body.dateFilter });
|
|
146
|
+
const headers = {
|
|
147
|
+
'Content-Type': 'application/json',
|
|
148
|
+
Authorization: `Bearer `,
|
|
149
|
+
};
|
|
150
|
+
try {
|
|
151
|
+
const response = await fetch(url, {
|
|
152
|
+
method: 'POST',
|
|
153
|
+
headers: headers,
|
|
154
|
+
body: JSON.stringify(body),
|
|
155
|
+
});
|
|
156
|
+
await onSave();
|
|
157
|
+
setSelectedEditDashboard(null);
|
|
158
|
+
setIsOpen(false);
|
|
159
|
+
}
|
|
160
|
+
catch (e) {
|
|
161
|
+
console.log('error');
|
|
162
|
+
}
|
|
163
|
+
};
|
|
164
|
+
const handleDeleteFilter = (filter) => {
|
|
165
|
+
setNewFilters(newFilters.filter((f) => f !== filter));
|
|
166
|
+
};
|
|
167
|
+
const handleDeleteDateFilter = async () => {
|
|
168
|
+
setShowDateFilter(false);
|
|
169
|
+
setNewDateFilter({});
|
|
170
|
+
};
|
|
171
|
+
const handleAddDateFilter = async () => {
|
|
172
|
+
setShowDateFilter(true);
|
|
173
|
+
if (dashboardData && dashboardData.dateFilter) {
|
|
174
|
+
setNewDateFilter(dashboardData.dateFilter);
|
|
175
|
+
}
|
|
176
|
+
};
|
|
177
|
+
const handleDeleteDashboard = async () => {
|
|
178
|
+
if (confirm('Are you sure? This action cannot be undone.')) {
|
|
179
|
+
const URL = `${QUILL_SERVER}/dashboard/${selectedDashboard}`;
|
|
180
|
+
await fetch(URL, {
|
|
181
|
+
method: 'DELETE',
|
|
182
|
+
headers: { 'Content-Type': 'application/json' },
|
|
183
|
+
body: JSON.stringify({ clientId: client._id }),
|
|
184
|
+
});
|
|
185
|
+
setIsOpen(false);
|
|
186
|
+
setNewFilters([]);
|
|
187
|
+
await onSave();
|
|
188
|
+
}
|
|
189
|
+
};
|
|
190
|
+
return (_jsx(ModalComponent, { isOpen: isOpen, close: () => {
|
|
191
|
+
setIsOpen(false);
|
|
192
|
+
setNewFilters([]);
|
|
193
|
+
setIsDateComparison(state.dateFilter.comparison);
|
|
194
|
+
}, style: {
|
|
195
|
+
minWidth: '814px',
|
|
196
|
+
maxWidth: '814px',
|
|
197
|
+
}, children: _jsxs("div", { style: {
|
|
198
|
+
display: 'flex',
|
|
199
|
+
gap: 16,
|
|
200
|
+
flexDirection: 'column',
|
|
201
|
+
width: '100%',
|
|
202
|
+
height: '100%',
|
|
203
|
+
maxHeight: '100%',
|
|
204
|
+
overflowY: 'auto',
|
|
205
|
+
}, children: [_jsx(HeaderComponent, { label: "Manage dashboard" }), _jsxs("div", { children: [_jsx(InputLabel, { children: "Name" }), _jsx("div", { style: { maxWidth: 230 }, children: _jsx(TextInputComponent, { value: selectedDashboardName, onChange: (e) => setSelectedDashboardName(e.target.value) }) })] }), _jsxs("div", { children: [_jsxs("div", { style: {
|
|
206
|
+
display: 'flex',
|
|
207
|
+
flexDirection: 'column',
|
|
208
|
+
gap: '10px',
|
|
209
|
+
}, children: [_jsx(CardSection, { children: "Date Filter" }), showDateFilter && (_jsx(_Fragment, { children: _jsxs("div", { style: {
|
|
210
|
+
display: 'flex',
|
|
211
|
+
flexDirection: 'row',
|
|
212
|
+
gap: '10px',
|
|
213
|
+
}, children: [_jsxs("div", { style: { display: 'flex', flexDirection: 'column' }, children: [_jsx(InputLabel, { children: "Label" }), _jsx("div", { style: {
|
|
214
|
+
display: 'flex',
|
|
215
|
+
flexDirection: 'row',
|
|
216
|
+
alignItems: 'center',
|
|
217
|
+
}, children: _jsx(TextInputComponent, { value: newDateFilter?.label, onChange: (e) => {
|
|
218
|
+
setNewDateFilter({
|
|
219
|
+
...newDateFilter,
|
|
220
|
+
label: e.target.value,
|
|
221
|
+
});
|
|
222
|
+
} }) })] }), _jsx("div", { style: {
|
|
223
|
+
display: 'flex',
|
|
224
|
+
flexDirection: 'row',
|
|
225
|
+
gap: '10px',
|
|
226
|
+
}, children: _jsxs("div", { style: { display: 'flex', flexDirection: 'column' }, children: [_jsx(InputLabel, { children: "Initial Range" }), _jsx(SelectComponent, { value: initialRange.label, onChange: (e) => {
|
|
227
|
+
setInitialRange(InitialDateRangeOptions.find((table) => table.label === e) ?? initialRange);
|
|
228
|
+
}, options: InitialDateRangeOptions.map((table) => {
|
|
229
|
+
return { label: table.label, value: table.label };
|
|
230
|
+
}) })] }) }), _jsx("div", { style: {
|
|
231
|
+
display: 'flex',
|
|
232
|
+
flexDirection: 'row',
|
|
233
|
+
gap: '10px',
|
|
234
|
+
}, children: _jsxs("div", { style: {
|
|
235
|
+
display: 'flex',
|
|
236
|
+
flexDirection: 'column',
|
|
237
|
+
}, children: [_jsx(InputLabel, { children: "Date Comparison" }), _jsx("div", { style: {
|
|
238
|
+
display: 'flex',
|
|
239
|
+
flexDirection: 'column',
|
|
240
|
+
justifyContent: 'center',
|
|
241
|
+
height: '100%',
|
|
242
|
+
minWidth: 200,
|
|
243
|
+
maxWidth: 200,
|
|
244
|
+
width: 200,
|
|
245
|
+
}, children: _jsx(TogglePrimitive, { value: isDateComparison, onClick: () => {
|
|
246
|
+
setIsDateComparison((isDateComparison) => !isDateComparison);
|
|
247
|
+
} }) })] }) }), _jsx("div", { style: {
|
|
248
|
+
display: 'flex',
|
|
249
|
+
flexGrow: 1,
|
|
250
|
+
flexDirection: 'row',
|
|
251
|
+
alignItems: 'end',
|
|
252
|
+
justifyContent: 'end',
|
|
253
|
+
gap: '10px',
|
|
254
|
+
}, children: _jsx("div", { style: {
|
|
255
|
+
display: 'flex',
|
|
256
|
+
flexDirection: 'column',
|
|
257
|
+
justifyContent: 'center',
|
|
258
|
+
}, children: _jsx("div", { onClick: () => handleDeleteDateFilter(), style: {
|
|
259
|
+
height: 38,
|
|
260
|
+
width: 42,
|
|
261
|
+
alignItems: 'center',
|
|
262
|
+
justifyContent: 'center',
|
|
263
|
+
display: 'flex',
|
|
264
|
+
cursor: 'pointer',
|
|
265
|
+
}, children: _jsx("svg", { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", fill: "#4C5462", width: "20", height: "20", children: _jsx("path", { fillRule: "evenodd", d: "M5.47 5.47a.75.75 0 011.06 0L12 10.94l5.47-5.47a.75.75 0 111.06 1.06L13.06 12l5.47 5.47a.75.75 0 11-1.06 1.06L12 13.06l-5.47 5.47a.75.75 0 01-1.06-1.06L10.94 12 5.47 6.53a.75.75 0 010-1.06z", clipRule: "evenodd" }) }) }) }) })] }) })), !showDateFilter && (_jsx("div", { style: { maxWidth: 230 }, children: _jsx(SecondaryButtonComponent, { onClick: handleAddDateFilter, label: "Add date filter +" }) }))] }), _jsx("div", { style: {
|
|
266
|
+
display: 'flex',
|
|
267
|
+
flexDirection: 'row',
|
|
268
|
+
alignItems: 'center',
|
|
269
|
+
justifyContent: 'space-between',
|
|
270
|
+
marginTop: 20,
|
|
271
|
+
}, children: _jsx(CardSection, { children: "Filters" }) }), newFilters.length > 0 && (_jsx("div", { style: { display: 'flex', flexDirection: 'column', gap: '6px' }, children: newFilters.map((filter, index) => {
|
|
272
|
+
return (_jsxs("div", { style: {
|
|
273
|
+
display: 'flex',
|
|
274
|
+
flexDirection: 'row',
|
|
275
|
+
gap: '10px',
|
|
276
|
+
}, children: [_jsxs("div", { style: {
|
|
277
|
+
display: 'flex',
|
|
278
|
+
flexDirection: 'column',
|
|
279
|
+
maxWidth: 300,
|
|
280
|
+
}, children: [index === 0 && _jsx(InputLabel, { children: "Label" }), _jsx(TextInputComponent, { value: filter.label, onChange: (e) => {
|
|
281
|
+
const updatedFilters = newFilters.map((otherFilter, i) => index === i
|
|
282
|
+
? { ...otherFilter, label: e.target.value }
|
|
283
|
+
: otherFilter);
|
|
284
|
+
setNewFilters(updatedFilters);
|
|
285
|
+
} })] }), _jsxs("div", { style: {
|
|
286
|
+
display: 'flex',
|
|
287
|
+
flexDirection: 'column',
|
|
288
|
+
maxWidth: 300,
|
|
289
|
+
}, children: [index === 0 && _jsx(InputLabel, { children: "Table" }), _jsx(SelectComponent, { defaultValue: "", value: selectedTable ? selectedTable.name : '', onChange: (e) => setSelectedTable(state.tables.find((table) => table.name === e)), options: state.tables.map((table) => {
|
|
290
|
+
return { label: table.name, value: table.name };
|
|
291
|
+
}) })] }), _jsxs("div", { style: {
|
|
292
|
+
display: 'flex',
|
|
293
|
+
flexDirection: 'column',
|
|
294
|
+
maxWidth: 300,
|
|
295
|
+
}, children: [index === 0 && _jsx(InputLabel, { children: "Field" }), _jsx("div", { style: {
|
|
296
|
+
display: 'flex',
|
|
297
|
+
flexDirection: 'column',
|
|
298
|
+
alignItems: 'center',
|
|
299
|
+
}, children: _jsxs("div", { style: {
|
|
300
|
+
display: 'flex',
|
|
301
|
+
flexDirection: 'row',
|
|
302
|
+
alignItems: 'center',
|
|
303
|
+
}, children: [_jsx(SelectComponent, { defaultValue: "", value: filter && filter.field ? filter.field : '', options: selectedTable?.columns.map((column) => {
|
|
304
|
+
return {
|
|
305
|
+
label: column.name,
|
|
306
|
+
value: column.name,
|
|
307
|
+
};
|
|
308
|
+
}), onChange: (e) => {
|
|
309
|
+
const updatedFilters = newFilters.map((otherFilter, i) => index === i
|
|
310
|
+
? { ...otherFilter, field: e }
|
|
311
|
+
: otherFilter);
|
|
312
|
+
setNewFilters(updatedFilters);
|
|
313
|
+
} }), _jsx("div", { onClick: () => handleDeleteFilter(filter), style: {
|
|
314
|
+
height: 38,
|
|
315
|
+
width: 42,
|
|
316
|
+
alignItems: 'center',
|
|
317
|
+
justifyContent: 'center',
|
|
318
|
+
display: 'flex',
|
|
319
|
+
cursor: 'pointer',
|
|
320
|
+
}, children: _jsx("svg", { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", fill: "#4C5462", width: "20", height: "20", children: _jsx("path", { fillRule: "evenodd", d: "M5.47 5.47a.75.75 0 011.06 0L12 10.94l5.47-5.47a.75.75 0 111.06 1.06L13.06 12l5.47 5.47a.75.75 0 11-1.06 1.06L12 13.06l-5.47 5.47a.75.75 0 01-1.06-1.06L10.94 12 5.47 6.53a.75.75 0 010-1.06z", clipRule: "evenodd" }) }) })] }) })] })] }));
|
|
321
|
+
}) })), _jsx("div", { style: { height: 12 } }), _jsx(SecondaryButtonComponent, { onClick: handleAddFilter, label: "Add filter +" })] }), _jsx(CardSection, { children: "Chart order" }), _jsx("div", { style: { maxWidth: 230 }, children: _jsx(SecondaryButtonComponent, { onClick: () => openEditOrderModal(selectedDashboardName), label: "Edit chart order" }) }), _jsx(CardSection, { children: "Danger Zone" }), _jsx("div", { style: { maxWidth: 230 }, children: _jsx(SecondaryButtonComponent, { onClick: handleDeleteDashboard, label: "Delete Dashboard" }) }), _jsx("div", { style: { height: 18 } }), _jsx("div", { style: { maxWidth: 230 }, children: _jsx(ButtonComponent, { onClick: handleSubmitDashboardChanges, label: "Save changes" }) })] }) }));
|
|
322
|
+
}
|
|
323
|
+
export function AddFilterModal({ isOpen, selectedDashboard, client, setIsOpen, ModalComponent, TextInputComponent, SelectComponent, HeaderComponent, ButtonComponent, openAddDashboardModal, }) {
|
|
324
|
+
const [selectedTable, setSelectedTable] = useState(null);
|
|
325
|
+
const [name, setName] = useState('');
|
|
326
|
+
const [field, setField] = useState('');
|
|
327
|
+
const [filterType, setFilterType] = useState('string');
|
|
328
|
+
const [dateRange, setDateRange] = useState([new Date(), new Date()]);
|
|
329
|
+
const { state, dispatch } = useAdmin();
|
|
330
|
+
useEffect(() => {
|
|
331
|
+
if (state.tables.length) {
|
|
332
|
+
setSelectedTable(state.tables[0]);
|
|
333
|
+
// setField(tables[0].columns.map((elem) => elem.name));
|
|
334
|
+
setField(state.tables[0].columns[0].name);
|
|
335
|
+
}
|
|
336
|
+
}, [state.tables]);
|
|
337
|
+
const handleAddFilter = async () => {
|
|
338
|
+
if (!selectedTable || !field) {
|
|
339
|
+
return;
|
|
340
|
+
}
|
|
341
|
+
const filterType = getPostgresBasicType(selectedTable.columns.find((col) => col.name === field));
|
|
342
|
+
if (filterType !== 'string' && filterType !== 'date') {
|
|
343
|
+
alert('We only support string and filters.');
|
|
344
|
+
return;
|
|
345
|
+
}
|
|
346
|
+
let responseData;
|
|
347
|
+
const url = `${QUILL_SERVER}/dashfilter/${client._id}/`;
|
|
348
|
+
const body = {
|
|
349
|
+
name: selectedDashboard,
|
|
350
|
+
filter: {
|
|
351
|
+
table: selectedTable.name,
|
|
352
|
+
field: field,
|
|
353
|
+
labelField: field,
|
|
354
|
+
label: name,
|
|
355
|
+
filterType,
|
|
356
|
+
},
|
|
357
|
+
};
|
|
358
|
+
const headers = {
|
|
359
|
+
'Content-Type': 'application/json',
|
|
360
|
+
Authorization: `Bearer `,
|
|
361
|
+
};
|
|
362
|
+
try {
|
|
363
|
+
const response = await fetch(url, {
|
|
364
|
+
method: 'POST',
|
|
365
|
+
headers: headers,
|
|
366
|
+
body: JSON.stringify(body),
|
|
367
|
+
});
|
|
368
|
+
if (!response.ok) {
|
|
369
|
+
throw new Error(`HTTP error! Status: ${response.status}`);
|
|
370
|
+
}
|
|
371
|
+
responseData = await response.json();
|
|
372
|
+
}
|
|
373
|
+
catch (error) {
|
|
374
|
+
console.error('There was a problem with the fetch operation:', error);
|
|
375
|
+
}
|
|
376
|
+
if (responseData) {
|
|
377
|
+
setIsOpen(false);
|
|
378
|
+
setName('');
|
|
379
|
+
setField('');
|
|
380
|
+
return;
|
|
381
|
+
}
|
|
382
|
+
};
|
|
383
|
+
if (!selectedTable) {
|
|
384
|
+
return null;
|
|
385
|
+
}
|
|
386
|
+
return (_jsx(ModalComponent, { isOpen: isOpen, close: () => setIsOpen(false), children: _jsxs("div", { style: { display: 'flex', flexDirection: 'column' }, children: [_jsx(HeaderComponent, { label: "Add filter" }), _jsx("div", { children: "Label" }), _jsx(TextInputComponent, { value: name, onChange: (e) => setName(e.target.value) }), _jsx("div", { children: "Table" }), _jsx(SelectComponent, { defaultValue: "", value: selectedTable ? selectedTable : '', onChange: (e) => setSelectedTable(e.target.value), QuillOptions: state.tables.map((table) => {
|
|
387
|
+
return { label: table.name, value: table.name };
|
|
388
|
+
}) }), _jsx("div", { children: "Field" }), _jsx(SelectComponent, { defaultValue: "", value: field ? field : '', QuillOptions: selectedTable.columns.map((column) => {
|
|
389
|
+
return { label: column.name, value: column.name };
|
|
390
|
+
}), onChange: (e) => {
|
|
391
|
+
setField(e);
|
|
392
|
+
} }), _jsx(ButtonComponent, { label: "Add filter", onClick: handleAddFilter })] }) }));
|
|
393
|
+
}
|
|
394
|
+
export default function Portal({ publicKey, queryEndpoint, theme = defaultTheme, queryHeaders, withCredentials, environment, organizationId, TextInputComponent, ButtonComponent, SecondaryButtonComponent, ModalComponent, SelectComponent, OrganizationSelectComponent, UserManagementComponent, HeaderComponent, }) {
|
|
395
|
+
return (_jsx(AdminProvider, { publicKey: publicKey, children: _jsx(Navigation, { theme: theme, publicKey: publicKey, queryEndpoint: queryEndpoint, queryHeaders: queryHeaders, withCredentials: withCredentials, TextInputComponent: TextInputComponent || TextInputPrimitive, ButtonComponent: ButtonComponent || ButtonPrimitive, HeaderComponent: HeaderComponent || HeaderPrimitive, SecondaryButtonComponent: SecondaryButtonComponent || SecondaryButtonPrimitive, ModalComponent: ModalComponent || ModalPrimitive, environment: environment, OrganizationSelectComponent: OrganizationSelectComponent, UserManagementComponent: UserManagementComponent, SelectComponent: SelectComponent || SelectPrimitive }) }));
|
|
396
|
+
}
|
|
397
|
+
function Navigation({ TextInputComponent, ButtonComponent, SecondaryButtonComponent, ModalComponent, SelectComponent, OrganizationSelectComponent, UserManagementComponent, HeaderComponent, publicKey, queryEndpoint, queryHeaders, environment, withCredentials, }) {
|
|
398
|
+
const { state, dispatch } = useAdmin();
|
|
399
|
+
// MMTODO: Idk if this is needed
|
|
400
|
+
// useEffect(() => {
|
|
401
|
+
// setEnvironmentContext(environment);
|
|
402
|
+
// }, [environment]);
|
|
403
|
+
if (!state.client) {
|
|
404
|
+
return null;
|
|
405
|
+
}
|
|
406
|
+
const renderComponentBasedOnName = () => {
|
|
407
|
+
switch (state.activeComponent) {
|
|
408
|
+
case 'Dashboards':
|
|
409
|
+
return (_jsx(DashboardManager, { 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 }));
|
|
410
|
+
case 'SQL editor':
|
|
411
|
+
return _jsx(DashboardBuilder, {});
|
|
412
|
+
case 'Report':
|
|
413
|
+
return (_jsx(ReportWrapper, { TextInputComponent: TextInputComponent, ButtonComponent: ButtonComponent, SecondaryButtonComponent: SecondaryButtonComponent, ModalComponent: ModalComponent, SelectComponent: SelectComponent, OrganizationSelectComponent: OrganizationSelectComponent, organizationId: state.organizationId, queryEndpoint: queryEndpoint, queryHeaders: queryHeaders, withCredentials: withCredentials }));
|
|
414
|
+
case 'SQL views':
|
|
415
|
+
return _jsx(SQLViewManager, {});
|
|
416
|
+
default:
|
|
417
|
+
return (_jsx(Dashboards, { TextInputComponent: TextInputComponent, ButtonComponent: ButtonComponent, SecondaryButtonComponent: SecondaryButtonComponent, OrganizationSelectComponent: OrganizationSelectComponent, ModalComponent: ModalComponent, SelectComponent: SelectComponent, HeaderComponent: HeaderComponent, setReportId: (id) => dispatch({ type: 'SET_REPORT_ID', payload: id }), queryEndpoint: queryEndpoint, organizationId: state.organizationId, queryHeaders: queryHeaders, withCredentials: withCredentials }));
|
|
418
|
+
}
|
|
419
|
+
};
|
|
420
|
+
return (_jsxs("div", { style: {
|
|
421
|
+
display: 'flex',
|
|
422
|
+
flexDirection: 'column',
|
|
423
|
+
height: '100vh',
|
|
424
|
+
width: '100vw',
|
|
425
|
+
}, children: [_jsxs("nav", { style: {
|
|
426
|
+
zIndex: 2,
|
|
427
|
+
height: '70px',
|
|
428
|
+
width: '100%',
|
|
429
|
+
display: 'flex',
|
|
430
|
+
flexDirection: 'row',
|
|
431
|
+
justifyContent: 'space-between',
|
|
432
|
+
alignItems: 'center',
|
|
433
|
+
backgroundColor: 'white',
|
|
434
|
+
padding: '0',
|
|
435
|
+
position: 'fixed',
|
|
436
|
+
top: 0,
|
|
437
|
+
left: 0,
|
|
438
|
+
right: 0,
|
|
439
|
+
borderBottomWidth: 1,
|
|
440
|
+
borderTopWidth: 0,
|
|
441
|
+
borderLeftWidth: 0,
|
|
442
|
+
borderRightWidth: 0,
|
|
443
|
+
borderStyle: 'solid',
|
|
444
|
+
borderColor: theme.borderColor,
|
|
445
|
+
}, children: [_jsx("div", { style: {
|
|
446
|
+
paddingTop: '18px',
|
|
447
|
+
paddingLeft: '14px',
|
|
448
|
+
paddingBottom: '18px',
|
|
449
|
+
width: 230,
|
|
450
|
+
}, 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: {
|
|
451
|
+
color: '#212121',
|
|
452
|
+
backgroundColor: state.activeComponent === 'Dashboards'
|
|
453
|
+
? '#2121210A'
|
|
454
|
+
: 'transparent',
|
|
455
|
+
padding: '8px 12px',
|
|
456
|
+
height: '38px',
|
|
457
|
+
marginBottom: '4px',
|
|
458
|
+
fontWeight: 'bold',
|
|
459
|
+
fontSize: '0.875rem',
|
|
460
|
+
borderRadius: '4px',
|
|
461
|
+
transition: 'background-color 0.3s',
|
|
462
|
+
border: 'none',
|
|
463
|
+
outline: 'none',
|
|
464
|
+
},
|
|
465
|
+
// onClick={() => setActiveComponent("Dashboards")}
|
|
466
|
+
onClick: () => dispatch({ type: 'SET_ACTIVE_COMPONENT', payload: 'Dashboards' }), children: "Dashboards" }), _jsx("button", { style: {
|
|
467
|
+
color: '#212121',
|
|
468
|
+
backgroundColor: state.activeComponent === 'SQL editor'
|
|
469
|
+
? '#2121210A'
|
|
470
|
+
: 'transparent',
|
|
471
|
+
padding: '8px 12px',
|
|
472
|
+
height: '38px',
|
|
473
|
+
marginBottom: '4px',
|
|
474
|
+
fontWeight: 'bold',
|
|
475
|
+
fontSize: '0.875rem',
|
|
476
|
+
borderRadius: '4px',
|
|
477
|
+
transition: 'background-color 0.3s',
|
|
478
|
+
border: 'none',
|
|
479
|
+
outline: 'none',
|
|
480
|
+
},
|
|
481
|
+
// onClick={() => setActiveComponent("SQL editor")}
|
|
482
|
+
onClick: () => dispatch({ type: 'SET_ACTIVE_COMPONENT', payload: 'SQL editor' }), children: "SQL editor" }), _jsx("button", { style: {
|
|
483
|
+
color: '#212121',
|
|
484
|
+
backgroundColor: state.activeComponent === 'SQL views'
|
|
485
|
+
? '#2121210A'
|
|
486
|
+
: 'transparent',
|
|
487
|
+
padding: '8px 12px',
|
|
488
|
+
height: '38px',
|
|
489
|
+
marginBottom: '4px',
|
|
490
|
+
fontWeight: 'bold',
|
|
491
|
+
fontSize: '0.875rem',
|
|
492
|
+
borderRadius: '4px',
|
|
493
|
+
transition: 'background-color 0.3s',
|
|
494
|
+
border: 'none',
|
|
495
|
+
outline: 'none',
|
|
496
|
+
},
|
|
497
|
+
// onClick={() => setActiveComponent("SQL views")}
|
|
498
|
+
onClick: () => dispatch({ type: 'SET_ACTIVE_COMPONENT', payload: 'SQL views' }), children: "SQL views" })] }), _jsx("div", { style: {
|
|
499
|
+
display: 'flex',
|
|
500
|
+
flexDirection: 'row',
|
|
501
|
+
minHeight: '50px',
|
|
502
|
+
justifyContent: 'flex-end',
|
|
503
|
+
alignItems: 'center',
|
|
504
|
+
paddingRight: '8px',
|
|
505
|
+
width: 230,
|
|
506
|
+
}, children: UserManagementComponent && _jsx(UserManagementComponent, {}) })] }), _jsx("div", { style: {
|
|
507
|
+
display: 'flex',
|
|
508
|
+
flexDirection: 'column',
|
|
509
|
+
height: '100%',
|
|
510
|
+
width: '100%',
|
|
511
|
+
// marginTop: activeComponent !== 'Report' ? '70px' : undefined
|
|
512
|
+
}, children: _jsx(QuillProvider
|
|
513
|
+
// organizationId={'2'}
|
|
514
|
+
// publicKey={client?._id}
|
|
515
|
+
, {
|
|
516
|
+
// organizationId={'2'}
|
|
517
|
+
// publicKey={client?._id}
|
|
518
|
+
organizationId: state.organizationId, queryEndpoint: queryEndpoint, withCredentials: withCredentials, queryHeaders: queryHeaders, publicKey: state.client._id, environment: state.environment, theme: theme, children: renderComponentBasedOnName() }) })] }));
|
|
519
|
+
}
|
|
520
|
+
export const theme = {
|
|
521
|
+
fontFamily: 'Inter; Helvetica',
|
|
522
|
+
backgroundColor: '#FFFFFF',
|
|
523
|
+
primaryTextColor: '#364153',
|
|
524
|
+
secondaryTextColor: '#6C727F',
|
|
525
|
+
chartLabelFontFamily: 'Inter; Helvetica',
|
|
526
|
+
chartLabelColor: '#666666',
|
|
527
|
+
chartTickColor: '#CCCCCC',
|
|
528
|
+
chartColors: ['#6269E9', '#E14F62', '#55B5A6', '#E9A23B', '#D0ACCF'],
|
|
529
|
+
borderColor: '#E5E7EB',
|
|
530
|
+
labelFontWeight: 500,
|
|
531
|
+
fontSize: 14,
|
|
532
|
+
borderWidth: 1,
|
|
533
|
+
primaryButtonColor: '#212121',
|
|
534
|
+
primaryButtonTextColor: '#FFFFFF',
|
|
535
|
+
};
|
|
536
|
+
export function convertPostgresColumn(column) {
|
|
537
|
+
let format;
|
|
538
|
+
switch (column.dataTypeID) {
|
|
539
|
+
case 20: // int8
|
|
540
|
+
case 21: // int2
|
|
541
|
+
case 23: // int4
|
|
542
|
+
format = 'whole_number';
|
|
543
|
+
break;
|
|
544
|
+
case 700: // float4
|
|
545
|
+
case 701: // float8
|
|
546
|
+
case 1700: // numeric
|
|
547
|
+
format = 'two_decimal_places';
|
|
548
|
+
break;
|
|
549
|
+
case 1082: // date
|
|
550
|
+
case 1083: // time
|
|
551
|
+
case 1184: // timestamptz
|
|
552
|
+
case 1114: // timestamp
|
|
553
|
+
format = 'MMM_dd_yyyy';
|
|
554
|
+
break;
|
|
555
|
+
case 1043: // varchar
|
|
556
|
+
default:
|
|
557
|
+
format = 'string';
|
|
558
|
+
}
|
|
559
|
+
return {
|
|
560
|
+
label: column.name,
|
|
561
|
+
field: column.name,
|
|
562
|
+
format: format,
|
|
563
|
+
};
|
|
564
|
+
}
|
|
565
|
+
export function getPostgresBasicType(column) {
|
|
566
|
+
let format;
|
|
567
|
+
// first check if column.dataTypeID exists
|
|
568
|
+
if (column.dataTypeID) {
|
|
569
|
+
switch (column.dataTypeID) {
|
|
570
|
+
case 20: // int8
|
|
571
|
+
case 21: // int2
|
|
572
|
+
case 23: // int4
|
|
573
|
+
case 700: // float4
|
|
574
|
+
case 701: // float8
|
|
575
|
+
case 1700: // numeric
|
|
576
|
+
format = 'number';
|
|
577
|
+
break;
|
|
578
|
+
case 1082: // date
|
|
579
|
+
case 1083: // time
|
|
580
|
+
case 1184: // timestamptz
|
|
581
|
+
case 1114: // timestamp
|
|
582
|
+
format = 'date';
|
|
583
|
+
break;
|
|
584
|
+
case 1043: // varchar
|
|
585
|
+
default:
|
|
586
|
+
format = 'string';
|
|
587
|
+
}
|
|
588
|
+
}
|
|
589
|
+
else if (column.fieldType) {
|
|
590
|
+
// if column.dataTypeID doesn't exist, check column.fieldType
|
|
591
|
+
switch (column.fieldType) {
|
|
592
|
+
case 'int8':
|
|
593
|
+
case 'int2':
|
|
594
|
+
case 'int4':
|
|
595
|
+
case 'float4':
|
|
596
|
+
case 'float8':
|
|
597
|
+
case 'numeric':
|
|
598
|
+
format = 'number';
|
|
599
|
+
break;
|
|
600
|
+
case 'date':
|
|
601
|
+
case 'time':
|
|
602
|
+
case 'timestamptz':
|
|
603
|
+
case 'timestamp':
|
|
604
|
+
format = 'date';
|
|
605
|
+
break;
|
|
606
|
+
case 'varchar':
|
|
607
|
+
default:
|
|
608
|
+
format = 'string';
|
|
609
|
+
}
|
|
610
|
+
}
|
|
611
|
+
return format;
|
|
612
|
+
}
|
|
613
|
+
export function classNames(...classes) {
|
|
614
|
+
return classes.filter(Boolean).join(' ');
|
|
615
|
+
}
|
|
616
|
+
export function AddDashboardModal({ selectedDashboard, isOpen, setIsOpen, client, ModalComponent, TextInputComponent, SelectComponent, HeaderComponent, ButtonComponent, dashNames, getDashNames, organizationId, }) {
|
|
617
|
+
const { state, dispatch } = useAdmin();
|
|
618
|
+
const [selectedDashboardName, setSelectedDashboardName] = useState(selectedDashboard?.name);
|
|
619
|
+
// const [tables] = useContext(TablesContext);
|
|
620
|
+
const [selectedTable, setSelectedTable] = useState(null);
|
|
621
|
+
const [name, setName] = useState('');
|
|
622
|
+
const [field, setField] = useState('');
|
|
623
|
+
const [filterType, setFilterType] = useState('string');
|
|
624
|
+
const [dateRange, setDateRange] = useState([new Date(), new Date()]);
|
|
625
|
+
const [newFilters, setNewFilters] = useState([]);
|
|
626
|
+
const [newDateFilter, setNewDateFilter] = useState(null);
|
|
627
|
+
useEffect(() => {
|
|
628
|
+
if (state.tables.length) {
|
|
629
|
+
setSelectedTable(state.tables[0]);
|
|
630
|
+
// setField(tables[0].columns.map((elem) => elem.name));
|
|
631
|
+
setField(state.tables[0].columns[0].name);
|
|
632
|
+
}
|
|
633
|
+
}, [state.tables]);
|
|
634
|
+
const handleDeleteFilter = async (filter) => {
|
|
635
|
+
setNewFilters(newFilters.filter((f) => f !== filter));
|
|
636
|
+
};
|
|
637
|
+
const handleAddDashboardSubmit = async () => {
|
|
638
|
+
if (!selectedDashboardName ||
|
|
639
|
+
newFilters.some((filter) => !filter.label) ||
|
|
640
|
+
(newDateFilter && newDateFilter.label)) {
|
|
641
|
+
alert('Empty labels');
|
|
642
|
+
return;
|
|
643
|
+
}
|
|
644
|
+
if (newFilters.some((filter) => !filter.field)) {
|
|
645
|
+
alert('Empty fields');
|
|
646
|
+
return;
|
|
647
|
+
}
|
|
648
|
+
if (!selectedTable || !field) {
|
|
649
|
+
return;
|
|
650
|
+
}
|
|
651
|
+
if (dashNames &&
|
|
652
|
+
dashNames.length > 0 &&
|
|
653
|
+
dashNames.some((dashName) => dashName.name === selectedDashboardName)) {
|
|
654
|
+
alert('Dashboard name already taken!');
|
|
655
|
+
return;
|
|
656
|
+
}
|
|
657
|
+
let updatedFilters = newFilters.map((filter) => {
|
|
658
|
+
const filterType = getPostgresBasicType(selectedTable.columns.find((col) => col.name === filter.field));
|
|
659
|
+
return {
|
|
660
|
+
table: selectedTable.name,
|
|
661
|
+
field: filter.field,
|
|
662
|
+
labelField: filter.field,
|
|
663
|
+
label: filter.label,
|
|
664
|
+
filterType,
|
|
665
|
+
};
|
|
666
|
+
});
|
|
667
|
+
const fieldsSet = new Set();
|
|
668
|
+
const hasDuplicateField = updatedFilters.some((filter) => {
|
|
669
|
+
if (fieldsSet.has(filter.field)) {
|
|
670
|
+
return true;
|
|
671
|
+
}
|
|
672
|
+
else {
|
|
673
|
+
fieldsSet.add(filter.field);
|
|
674
|
+
return false;
|
|
675
|
+
}
|
|
676
|
+
});
|
|
677
|
+
if (hasDuplicateField) {
|
|
678
|
+
alert('Maximum of one filter per field');
|
|
679
|
+
return;
|
|
680
|
+
}
|
|
681
|
+
let allValid = true;
|
|
682
|
+
updatedFilters.forEach((filter) => {
|
|
683
|
+
if (filter.filterType !== 'string' && filter.filterType !== 'date') {
|
|
684
|
+
allValid = false;
|
|
685
|
+
console.error(`Invalid filterType found: ${filter.filterType}`);
|
|
686
|
+
}
|
|
687
|
+
});
|
|
688
|
+
if (!allValid) {
|
|
689
|
+
alert('We only support string and filters.');
|
|
690
|
+
return;
|
|
691
|
+
}
|
|
692
|
+
if (updatedFilters.filter((filter) => filter.filterType === 'date').length > 1) {
|
|
693
|
+
alert('More than one date filter');
|
|
694
|
+
return;
|
|
695
|
+
}
|
|
696
|
+
let responseData;
|
|
697
|
+
const url = `${QUILL_SERVER}/newdash/${client._id}/`;
|
|
698
|
+
const body = newDateFilter && Object.keys(newDateFilter).length
|
|
699
|
+
? {
|
|
700
|
+
dateFilter: newDateFilter,
|
|
701
|
+
newDashboardName: selectedDashboardName,
|
|
702
|
+
filters: updatedFilters,
|
|
703
|
+
organizationId,
|
|
704
|
+
}
|
|
705
|
+
: {
|
|
706
|
+
newDashboardName: selectedDashboardName,
|
|
707
|
+
filters: updatedFilters,
|
|
708
|
+
organizationId,
|
|
709
|
+
};
|
|
710
|
+
const headers = {
|
|
711
|
+
'Content-Type': 'application/json',
|
|
712
|
+
Authorization: `Bearer `,
|
|
713
|
+
};
|
|
714
|
+
try {
|
|
715
|
+
const response = await fetch(url, {
|
|
716
|
+
method: 'POST',
|
|
717
|
+
headers: headers,
|
|
718
|
+
body: JSON.stringify(body),
|
|
719
|
+
});
|
|
720
|
+
if (!response.ok) {
|
|
721
|
+
throw new Error(`HTTP error! Status: ${response.status}`);
|
|
722
|
+
}
|
|
723
|
+
responseData = await response.json();
|
|
724
|
+
}
|
|
725
|
+
catch (e) {
|
|
726
|
+
console.log('error');
|
|
727
|
+
}
|
|
728
|
+
if (responseData) {
|
|
729
|
+
setIsOpen(false);
|
|
730
|
+
setName('');
|
|
731
|
+
setSelectedDashboardName('');
|
|
732
|
+
setNewFilters([]);
|
|
733
|
+
setNewDateFilter(null);
|
|
734
|
+
getDashNames();
|
|
735
|
+
return;
|
|
736
|
+
}
|
|
737
|
+
};
|
|
738
|
+
if (!selectedTable) {
|
|
739
|
+
return _jsx(_Fragment, {});
|
|
740
|
+
}
|
|
741
|
+
const handleAddFilter = async () => {
|
|
742
|
+
setNewFilters([...newFilters, { label: '', field }]);
|
|
743
|
+
};
|
|
744
|
+
return (_jsx(ModalComponent, { isOpen: isOpen, close: () => setIsOpen(false), children: _jsxs("div", { children: [_jsx(TextInputComponent, { placeholder: "Enter Dashboard Name...", onChange: (e) => setSelectedDashboardName(e.target.value), value: selectedDashboardName }), _jsxs("div", { style: {
|
|
745
|
+
display: 'flex',
|
|
746
|
+
flexDirection: 'column',
|
|
747
|
+
alignItems: 'center',
|
|
748
|
+
}, children: [newFilters.map((filter, index) => {
|
|
749
|
+
return (_jsxs("div", { style: { display: 'flex', flexDirection: 'row' }, children: [_jsxs("div", { style: { display: 'flex', flexDirection: 'column' }, children: [_jsx("h2", { children: "Label" }), _jsx(TextInputComponent, { value: filter.label, onChange: (e) => {
|
|
750
|
+
const updatedFilters = newFilters.map((otherFilter, i) => index === i
|
|
751
|
+
? { ...otherFilter, label: e.target.value }
|
|
752
|
+
: otherFilter);
|
|
753
|
+
setNewFilters(updatedFilters);
|
|
754
|
+
} })] }), _jsxs("div", { style: { display: 'flex', flexDirection: 'column' }, children: [_jsx("h4", { children: "Field" }), _jsx("div", { style: {
|
|
755
|
+
display: 'flex',
|
|
756
|
+
flexDirection: 'column',
|
|
757
|
+
alignItems: 'center',
|
|
758
|
+
}, children: _jsxs("div", { style: {
|
|
759
|
+
display: 'flex',
|
|
760
|
+
flexDirection: 'row',
|
|
761
|
+
alignItems: 'center',
|
|
762
|
+
}, children: [_jsx(SelectComponent, { defaultValue: "", value: filter && filter.field ? filter.field : '', QuillOptions: selectedTable.columns.map((column) => {
|
|
763
|
+
return { label: column.name, value: column.name };
|
|
764
|
+
}), onChange: (e) => {
|
|
765
|
+
const updatedFilters = newFilters.map((otherFilter, i) => index === i
|
|
766
|
+
? { ...otherFilter, field: e }
|
|
767
|
+
: otherFilter);
|
|
768
|
+
setNewFilters(updatedFilters);
|
|
769
|
+
} }), _jsx("div", { onClick: () => handleDeleteFilter(filter), style: {
|
|
770
|
+
height: 38,
|
|
771
|
+
width: 42,
|
|
772
|
+
alignItems: 'center',
|
|
773
|
+
justifyContent: 'center',
|
|
774
|
+
display: 'flex',
|
|
775
|
+
}, children: _jsx("svg", { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", fill: "#4C5462", width: "20", height: "20", children: _jsx("path", { fillRule: "evenodd", d: "M5.47 5.47a.75.75 0 011.06 0L12 10.94l5.47-5.47a.75.75 0 111.06 1.06L13.06 12l5.47 5.47a.75.75 0 11-1.06 1.06L12 13.06l-5.47 5.47a.75.75 0 01-1.06-1.06L10.94 12 5.47 6.53a.75.75 0 010-1.06z", clipRule: "evenodd" }) }) })] }) })] })] }, filter.field + index));
|
|
776
|
+
}), _jsx(ButtonComponent, { onClick: handleAddFilter, label: "Add new filter +" }), _jsx(ButtonComponent, { onClick: handleAddDashboardSubmit, label: "Add Dashboard +" })] })] }) }));
|
|
777
|
+
}
|
|
778
|
+
export function TableCell({ table, clickTableCell }) {
|
|
779
|
+
const handleClickTableCell = () => {
|
|
780
|
+
clickTableCell(table);
|
|
781
|
+
};
|
|
782
|
+
return (_jsxs("div", { onClick: handleClickTableCell, style: {
|
|
783
|
+
marginBottom: '54px',
|
|
784
|
+
flex: 1,
|
|
785
|
+
minWidth: '540px',
|
|
786
|
+
maxWidth: '540px',
|
|
787
|
+
cursor: 'pointer',
|
|
788
|
+
}, children: [_jsx("div", { style: { display: 'flex', flexDirection: 'row', alignItems: 'center' }, children: _jsx("h3", { style: { color: '#384151' }, children: table.displayName }) }), _jsx(Highlight, { ...defaultProps, theme: prismTheme, code: table.viewQuery, language: "sql", children: ({ className, style, tokens, getLineProps, getTokenProps }) => (_jsx("pre", { className: className, style: {
|
|
789
|
+
...style,
|
|
790
|
+
textAlign: 'left',
|
|
791
|
+
margin: '1em 0',
|
|
792
|
+
padding: '0.5em',
|
|
793
|
+
overflow: 'auto',
|
|
794
|
+
maxHeight: 120,
|
|
795
|
+
maxWidth: 520,
|
|
796
|
+
// lineHeight: "1.3em",
|
|
797
|
+
// height: "1.3em",
|
|
798
|
+
}, children: tokens.map((line, i) => (_jsx("div", { ...getLineProps({ line, key: i }), children: line.map((token, key) => (_jsx("span", { ...getTokenProps({ token, key }) }, key))) }, i))) })) })] }, table.displayName));
|
|
799
|
+
}
|
|
800
|
+
export const SQLEditorComponent = ({ query, setQuery,
|
|
801
|
+
// handleRunQuery,
|
|
802
|
+
theme,
|
|
803
|
+
// defineEditorTheme,
|
|
804
|
+
// setEditorTheme,
|
|
805
|
+
}) => {
|
|
806
|
+
const [isOpen, setIsOpen] = useState(false);
|
|
807
|
+
const [rows, setRows] = useState([]);
|
|
808
|
+
const [columns, setColumns] = useState([]);
|
|
809
|
+
const [fields, setFields] = useState([]);
|
|
810
|
+
// const [activeQuery] = useContext(ActiveQueryContext);
|
|
811
|
+
const { state, dispatch } = useAdmin();
|
|
812
|
+
return (_jsxs("div", { style: {
|
|
813
|
+
background: theme.backgroundColor,
|
|
814
|
+
// maxHeight: 700,
|
|
815
|
+
// width: "100%",
|
|
816
|
+
minWidth: 450,
|
|
817
|
+
// overflowY: "scroll",
|
|
818
|
+
// padding: "20px 30px 20px 20px",
|
|
819
|
+
// marginLeft: 20,
|
|
820
|
+
borderRadius: 6,
|
|
821
|
+
overflow: 'hidden',
|
|
822
|
+
}, children: [_jsx(SQLEditor, { containerStyle: { height: 'calc(100vh - 270px)', width: '100%' }, onChangeQuery: (query) => setQuery(query), onChangeData: (data) => setRows(data), onChangeColumns: (columns) => setColumns(columns), onChangeFields: (fields) => setFields(fields), defaultQuery: state.activeQuery ? state.activeQuery : '' }), rows.length > 0 && (_jsx("button", { style: {
|
|
823
|
+
height: 36,
|
|
824
|
+
marginLeft: 250,
|
|
825
|
+
marginTop: 20,
|
|
826
|
+
background: theme.primaryButtonColor,
|
|
827
|
+
color: theme.backgroundColor,
|
|
828
|
+
display: 'flex',
|
|
829
|
+
borderRadius: 6,
|
|
830
|
+
alignItems: 'center',
|
|
831
|
+
justifyContent: 'center',
|
|
832
|
+
outline: 'none',
|
|
833
|
+
cursor: 'pointer',
|
|
834
|
+
fontFamily: theme.fontFamily,
|
|
835
|
+
fontWeight: theme.buttonFontWeight || 600,
|
|
836
|
+
border: 'none',
|
|
837
|
+
fontSize: 14,
|
|
838
|
+
paddingLeft: 20,
|
|
839
|
+
paddingRight: 20,
|
|
840
|
+
}, onClick: () => setIsOpen(true), children: "Add to dashboard" })), _jsx(AddToDashboardModal, { isOpen: isOpen, setIsOpen: setIsOpen, rows: rows, columns: columns, query: query, showTableFormatQuillOptions: true, showDateFieldQuillOptions: true, showAccessControlQuillOptions: true, fields: fields })] }));
|
|
841
|
+
};
|
|
842
|
+
const SchemaListComponent = ({ schema, theme }) => {
|
|
843
|
+
return (_jsx("div", { style: {
|
|
844
|
+
background: theme.backgroundColor,
|
|
845
|
+
maxHeight: 700,
|
|
846
|
+
width: 300,
|
|
847
|
+
minWidth: 300,
|
|
848
|
+
overflowY: 'scroll',
|
|
849
|
+
// maxHeight: "100%",
|
|
850
|
+
paddingLeft: 20,
|
|
851
|
+
paddingRight: 20,
|
|
852
|
+
}, children: schema.map((elem, index) => (_jsx(SchemaItem, { elem: elem, theme: theme, index: index }, elem.displayName + index))) }));
|
|
853
|
+
};
|
|
854
|
+
function SchemaItem({ elem, theme, index }) {
|
|
855
|
+
const [isOpen, setIsOpen] = useState(index === 0);
|
|
856
|
+
const schemaContainerStyle = {
|
|
857
|
+
display: 'flex',
|
|
858
|
+
flexDirection: 'column',
|
|
859
|
+
// WebkitTouchCallout: "none",
|
|
860
|
+
// WebkitUserSelect: "none",
|
|
861
|
+
// KhtmlUserSelect: "none",
|
|
862
|
+
// MozUserSelect: "none",
|
|
863
|
+
// msUserSelect: "none",
|
|
864
|
+
// userSelect: "none",
|
|
865
|
+
};
|
|
866
|
+
const schemaRowStyle = {
|
|
867
|
+
display: 'flex',
|
|
868
|
+
flexDirection: 'row',
|
|
869
|
+
alignItems: 'center',
|
|
870
|
+
width: '100%',
|
|
871
|
+
justifyContent: 'space-between',
|
|
872
|
+
cursor: 'pointer',
|
|
873
|
+
};
|
|
874
|
+
const schemaRowHoverStyle = {
|
|
875
|
+
background: theme.selectUnderlayColor,
|
|
876
|
+
};
|
|
877
|
+
return (_jsxs("div", { style: schemaContainerStyle, children: [_jsxs("div", { style: { ...schemaRowStyle, ...(isOpen && schemaRowHoverStyle) }, onClick: () => setIsOpen(!isOpen), children: [_jsx("p", { style: {
|
|
878
|
+
marginLeft: theme.padding,
|
|
879
|
+
fontSize: theme.fontSize,
|
|
880
|
+
color: '#384151',
|
|
881
|
+
fontWeight: '500',
|
|
882
|
+
}, children: elem.displayName }), _jsx("div", { style: {
|
|
883
|
+
display: 'flex',
|
|
884
|
+
alignItems: 'center',
|
|
885
|
+
justifyContent: 'center',
|
|
886
|
+
// paddingRight: 25,
|
|
887
|
+
paddingTop: 20,
|
|
888
|
+
paddingBottom: 20,
|
|
889
|
+
paddingLeft: 0,
|
|
890
|
+
cursor: 'pointer',
|
|
891
|
+
}, children: isOpen ? (_jsx("svg", { xmlns: "http://www.w3.org/2000/svg", fill: "none", viewBox: "0 0 24 24", strokeWidth: 1.5, stroke: "currentColor", className: "h-5 w-5 text-gray-400", children: _jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M19.5 8.25l-7.5 7.5-7.5-7.5" }) })) : (_jsx("svg", { xmlns: "http://www.w3.org/2000/svg", fill: "none", viewBox: "0 0 24 24", strokeWidth: 1.5, stroke: "currentColor", className: "h-5 w-5", children: _jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M8.25 4.5l7.5 7.5-7.5 7.5" }) })) })] }), isOpen ? (_jsx("div", { style: {
|
|
892
|
+
paddingBottom: theme.padding,
|
|
893
|
+
display: 'flex',
|
|
894
|
+
flexDirection: 'column',
|
|
895
|
+
paddingLeft: theme.padding,
|
|
896
|
+
paddingRight: theme.padding,
|
|
897
|
+
}, children: elem.columns.map((elem, index) => (_jsxs("div", { style: {
|
|
898
|
+
paddingTop: theme.padding,
|
|
899
|
+
display: 'flex',
|
|
900
|
+
flexDirection: 'row',
|
|
901
|
+
alignItems: 'center',
|
|
902
|
+
justifyContent: 'space-between',
|
|
903
|
+
}, children: [_jsx("div", { title: elem.displayName, className: "text-gray-500", style: {
|
|
904
|
+
fontSize: 13,
|
|
905
|
+
// color: theme.secondaryFontColor,
|
|
906
|
+
whiteSpace: 'nowrap',
|
|
907
|
+
padding: 0,
|
|
908
|
+
margin: 0,
|
|
909
|
+
textOverflow: 'ellipsis',
|
|
910
|
+
overflow: 'hidden',
|
|
911
|
+
width: 200,
|
|
912
|
+
maxWidth: 200,
|
|
913
|
+
}, children: elem.displayName }), _jsx("div", { className: "text-gray-500", title: elem.displayName, style: {
|
|
914
|
+
fontSize: 13,
|
|
915
|
+
color: theme.secondaryFontColor,
|
|
916
|
+
padding: 0,
|
|
917
|
+
margin: 0,
|
|
918
|
+
}, children: elem.fieldType })] }, elem.displayName + elem.index))) })) : null] }));
|
|
919
|
+
}
|
|
920
|
+
export function defineEditorTheme(monaco, theme) {
|
|
921
|
+
monaco.editor.defineTheme('onedark', {
|
|
922
|
+
base: theme.darkMode ? 'vs-dark' : 'vs',
|
|
923
|
+
inherit: true,
|
|
924
|
+
rules: [
|
|
925
|
+
{
|
|
926
|
+
token: 'comment',
|
|
927
|
+
foreground: '#5d7988',
|
|
928
|
+
fontStyle: 'italic',
|
|
929
|
+
},
|
|
930
|
+
{ token: 'constant', foreground: '#e06c75' },
|
|
931
|
+
],
|
|
932
|
+
colors: {
|
|
933
|
+
'editor.background': '#F9F9F9',
|
|
934
|
+
},
|
|
935
|
+
});
|
|
936
|
+
}
|
|
937
|
+
export function setEditorTheme(editor, monaco) {
|
|
938
|
+
try {
|
|
939
|
+
monaco.editor.setTheme('onedark');
|
|
940
|
+
}
|
|
941
|
+
catch (e) {
|
|
942
|
+
console.log('ERROR: ', e);
|
|
943
|
+
}
|
|
944
|
+
}
|
|
945
|
+
export function isValidDate(d) {
|
|
946
|
+
return d instanceof Date && !isNaN(d);
|
|
947
|
+
}
|
|
948
|
+
export const isArrayOfValidDates = (arr, field) => arr.every((d) => new Date(d[field]) instanceof Date && !isNaN(new Date(d[field])));
|
|
949
|
+
export function formatDateBuckets(startDate, endDate) {
|
|
950
|
+
// Calculate the distance in hours
|
|
951
|
+
const distanceInHours = Math.abs(differenceInHours(endDate, startDate));
|
|
952
|
+
// Check if the distance is less than or equal to one hour
|
|
953
|
+
if (distanceInHours <= 1) {
|
|
954
|
+
return {
|
|
955
|
+
unit: 'hour',
|
|
956
|
+
format: 'h a',
|
|
957
|
+
startOf: startOfHour,
|
|
958
|
+
};
|
|
959
|
+
}
|
|
960
|
+
// Calculate the distance in days
|
|
961
|
+
const distanceInDays = Math.abs(differenceInDays(endDate, startDate));
|
|
962
|
+
// Check if the distance is less than or equal to one day
|
|
963
|
+
if (distanceInDays <= 1) {
|
|
964
|
+
return {
|
|
965
|
+
unit: 'day',
|
|
966
|
+
format: 'MMM d',
|
|
967
|
+
startOf: startOfDay,
|
|
968
|
+
};
|
|
969
|
+
}
|
|
970
|
+
// Calculate the distance in months
|
|
971
|
+
const distanceInMonths = Math.abs(differenceInMonths(endDate, startDate));
|
|
972
|
+
// Check if the distance is less than or equal to one month
|
|
973
|
+
if (distanceInMonths <= 1) {
|
|
974
|
+
return {
|
|
975
|
+
unit: 'month',
|
|
976
|
+
format: 'MMM yyyy',
|
|
977
|
+
startOf: startOfMonth,
|
|
978
|
+
};
|
|
979
|
+
}
|
|
980
|
+
// Calculate the distance in years
|
|
981
|
+
const distanceInYears = Math.abs(differenceInYears(endDate, startDate));
|
|
982
|
+
// Check if the distance is less than or equal to one year
|
|
983
|
+
if (distanceInYears <= 1) {
|
|
984
|
+
return {
|
|
985
|
+
unit: 'year',
|
|
986
|
+
format: 'yyyy',
|
|
987
|
+
startOf: startOfYear,
|
|
988
|
+
};
|
|
989
|
+
}
|
|
990
|
+
// Otherwise, the distance is more than one year
|
|
991
|
+
return {
|
|
992
|
+
unit: 'year',
|
|
993
|
+
format: 'yyyy',
|
|
994
|
+
startOf: startOfYear,
|
|
995
|
+
};
|
|
996
|
+
}
|
|
997
|
+
const POSTGRES_DATE_TYPES = [
|
|
998
|
+
'timestamp',
|
|
999
|
+
'date',
|
|
1000
|
+
'timestamptz',
|
|
1001
|
+
'time',
|
|
1002
|
+
'timetz',
|
|
1003
|
+
];
|
|
1004
|
+
const FORMAT_QuillOptionS = [
|
|
1005
|
+
{ value: 'whole_number', label: 'whole number' },
|
|
1006
|
+
{ value: 'one_decimal_place', label: 'one decimal place' },
|
|
1007
|
+
{ value: 'dollar_amount', label: 'dollar amount' },
|
|
1008
|
+
{ value: 'MMM_yyyy', label: 'month' },
|
|
1009
|
+
{ value: 'MMM_dd-MMM_dd', label: 'week' },
|
|
1010
|
+
{ value: 'MMM_dd_yyyy', label: 'day' },
|
|
1011
|
+
{ value: 'MMM_dd_hh:mm_ap_pm', label: 'day and time' },
|
|
1012
|
+
{ value: 'hh_ap_pm', label: 'hour' },
|
|
1013
|
+
{ value: 'percent', label: 'percent' },
|
|
1014
|
+
{ value: 'string', label: 'string' },
|
|
1015
|
+
];
|
|
1016
|
+
function Report({ reportId, saveDashboardItem, isOpen, setIsOpen, isEditQueryOpen, SecondaryButtonComponent, ButtonComponent, deleteReport, updateQuery, OrganizationSelectComponent, ModalComponent, NavigateToDashboardBuilder, }) {
|
|
1017
|
+
const { data, loading, error } = useQuill(reportId);
|
|
1018
|
+
const { state, dispatch } = useAdmin();
|
|
1019
|
+
const downloadCSV = () => {
|
|
1020
|
+
// report.rows
|
|
1021
|
+
if (!data) {
|
|
1022
|
+
return;
|
|
1023
|
+
}
|
|
1024
|
+
const json = data.rows; // JSON data passed as a prop
|
|
1025
|
+
const fields = Object.keys(json[0]); // Assumes all objects have same keys
|
|
1026
|
+
const csvRows = [];
|
|
1027
|
+
// Header row
|
|
1028
|
+
csvRows.push(fields.join(','));
|
|
1029
|
+
// Data rows
|
|
1030
|
+
for (let row of json) {
|
|
1031
|
+
let values = fields.map((field) => JSON.stringify(row[field] || ''));
|
|
1032
|
+
csvRows.push(values.join(','));
|
|
1033
|
+
}
|
|
1034
|
+
// Create CSV string and create a 'blob' with it
|
|
1035
|
+
const csvString = csvRows.join('\r\n');
|
|
1036
|
+
const csvBlob = new Blob([csvString], { type: 'text/csv' });
|
|
1037
|
+
// Create a download link and click it
|
|
1038
|
+
const downloadLink = document.createElement('a');
|
|
1039
|
+
downloadLink.download = 'download.csv';
|
|
1040
|
+
downloadLink.href = URL.createObjectURL(csvBlob);
|
|
1041
|
+
downloadLink.style.display = 'none';
|
|
1042
|
+
document.body.appendChild(downloadLink);
|
|
1043
|
+
downloadLink.click();
|
|
1044
|
+
document.body.removeChild(downloadLink);
|
|
1045
|
+
};
|
|
1046
|
+
const goBack = () => {
|
|
1047
|
+
// setActiveComponent("Dashboards");
|
|
1048
|
+
dispatch({ type: 'SET_ACTIVE_COMPONENT', payload: 'Dashboards' });
|
|
1049
|
+
};
|
|
1050
|
+
if (!data || loading) {
|
|
1051
|
+
return null;
|
|
1052
|
+
}
|
|
1053
|
+
if (error) {
|
|
1054
|
+
return _jsx("div", { children: error });
|
|
1055
|
+
}
|
|
1056
|
+
return (_jsxs("div", { style: { paddingLeft: 40, paddingRight: 40 }, children: [_jsx("div", { style: {
|
|
1057
|
+
// width: 'calc(100vw - 30px)',
|
|
1058
|
+
display: 'flex',
|
|
1059
|
+
position: 'fixed',
|
|
1060
|
+
backgroundColor: 'white',
|
|
1061
|
+
zIndex: 1,
|
|
1062
|
+
left: 0,
|
|
1063
|
+
right: 0,
|
|
1064
|
+
top: 0,
|
|
1065
|
+
flexDirection: 'row',
|
|
1066
|
+
paddingTop: 15,
|
|
1067
|
+
alignItems: 'center',
|
|
1068
|
+
justifyContent: 'space-between',
|
|
1069
|
+
paddingLeft: '30px',
|
|
1070
|
+
paddingRight: '30px',
|
|
1071
|
+
borderBottomWidth: 1,
|
|
1072
|
+
borderTopWidth: 0,
|
|
1073
|
+
borderLeftWidth: 0,
|
|
1074
|
+
borderRightWidth: 0,
|
|
1075
|
+
borderStyle: 'solid',
|
|
1076
|
+
borderColor: theme.borderColor,
|
|
1077
|
+
paddingBottom: 20,
|
|
1078
|
+
boxShadow: '0px 1px 4px 0px rgba(0, 0, 0, 0.07)',
|
|
1079
|
+
// paddingRight: '50px',
|
|
1080
|
+
// position: 'absolute'
|
|
1081
|
+
// // zIndex: 10
|
|
1082
|
+
}, children: _jsxs("div", { style: {
|
|
1083
|
+
display: 'flex',
|
|
1084
|
+
flexDirection: 'row',
|
|
1085
|
+
alignItems: 'flex-end',
|
|
1086
|
+
justifyContent: 'space-between',
|
|
1087
|
+
width: '100%',
|
|
1088
|
+
// marginLeft: '25px'
|
|
1089
|
+
}, children: [_jsxs("div", { style: {
|
|
1090
|
+
display: 'flex',
|
|
1091
|
+
flexDirection: 'row',
|
|
1092
|
+
alignItems: 'center',
|
|
1093
|
+
paddingBottom: 4,
|
|
1094
|
+
}, children: [_jsx(SecondaryButtonComponent, { label: "\u2190 Back", onClick: goBack }), _jsx("h1", { style: {
|
|
1095
|
+
fontSize: '36px',
|
|
1096
|
+
paddingTop: '0px',
|
|
1097
|
+
fontWeight: '600',
|
|
1098
|
+
color: '#384151',
|
|
1099
|
+
margin: 0,
|
|
1100
|
+
paddingLeft: 16,
|
|
1101
|
+
}, children: data.name })] }), _jsxs("div", { style: {
|
|
1102
|
+
display: 'flex',
|
|
1103
|
+
flexDirection: 'row',
|
|
1104
|
+
alignItems: 'center',
|
|
1105
|
+
}, children: [_jsx("div", { style: { width: '20px' } }), _jsx("div", { style: { display: 'flex', flexDirection: 'column' }, children: _jsx("div", { style: {
|
|
1106
|
+
display: 'flex',
|
|
1107
|
+
flexDirection: 'row',
|
|
1108
|
+
alignItems: 'flex-end',
|
|
1109
|
+
gap: 16,
|
|
1110
|
+
}, children: _jsx(OrgSelect, { environment: state.environment, setEnvironment: (env) => dispatch({ type: 'SET_ENVIRONMENT', payload: env }), organizations: state.organizations, organizationId: state.organizationId, setOrganizationId: (orgId) => dispatch({ type: 'SET_ORGANIZATION_ID', payload: orgId }), theme: state.theme }) }) })] })] }) }), _jsx("div", { style: { height: 240 } }), _jsx(Chart, { chartId: reportId, colors: theme.chartColors, isAnimationActive: false, containerStyle: {
|
|
1111
|
+
width: 'calc(100vw - 80px)',
|
|
1112
|
+
height: data.chartType === 'table' ? 600 : 400,
|
|
1113
|
+
} }), _jsxs("div", { style: {
|
|
1114
|
+
display: 'flex',
|
|
1115
|
+
alignItems: 'center',
|
|
1116
|
+
gap: 16,
|
|
1117
|
+
marginTop: 20,
|
|
1118
|
+
}, children: [_jsx(SecondaryButtonComponent, { label: "Edit chart", onClick: () => setIsOpen(true) }), state.navigateToDashboardBuilder && (_jsx(SecondaryButtonComponent, { label: "Edit query", onClick: () => {
|
|
1119
|
+
dispatch({ type: 'SET_ACTIVE_QUERY', payload: data.queryString });
|
|
1120
|
+
dispatch({ type: 'SET_ACTIVE_EDIT_ITEM', payload: data });
|
|
1121
|
+
state.navigateToDashboardBuilder();
|
|
1122
|
+
} })), _jsx(SecondaryButtonComponent, { label: "Delete", onClick: deleteReport })] }), data.chartType !== 'table' && (_jsx(Table, { containerStyle: { height: 400, width: '100%', marginTop: 24 }, chartId: reportId })), _jsx(EditVisualizationModal, { isOpen: isOpen, setIsOpen: setIsOpen, report: data, isEditMode: !!state.activeQuery, data: data.rows, query: data.queryString, columns: data.columns, fields: data.fields })] }));
|
|
1123
|
+
}
|
|
1124
|
+
function EditVisualizationModal({ isOpen, setIsOpen, report, data, isEditMode, }) {
|
|
1125
|
+
if (!report && !data?.length) {
|
|
1126
|
+
return null;
|
|
1127
|
+
}
|
|
1128
|
+
return (_jsx(_Fragment, { children: isOpen && (_jsxs("div", { className: "inset-0 overflow-y-auto relative", style: { zIndex: 120 }, children: [_jsx("div", { className: "absolute inset-0 bg-black/30", "aria-hidden": "true", onClick: () => setIsOpen(false) }), _jsx("div", { className: "flex min-h-full items-center justify-center p-4", children: _jsx("div", { className: "bg-white px-7 py-7 rounded-lg", children: _jsx(ChartEditor, { isOpen: isOpen, setIsOpen: setIsOpen, isEditMode: isEditMode, chartId: report._id, admin: true }) }) })] })) }));
|
|
1129
|
+
}
|
|
1130
|
+
export function ReportWrapper({ SecondaryButtonComponent, ButtonComponent, ModalComponent, SelectComponent, OrganizationSelectComponent, organizationId, queryEndpoint, queryHeaders, withCredentials, }) {
|
|
1131
|
+
const { state, dispatch } = useAdmin();
|
|
1132
|
+
let [isOpen, setIsOpen] = useState(false);
|
|
1133
|
+
const [isEditQueryOpen, setIsEditQueryOpen] = useState(false);
|
|
1134
|
+
const updateQuery = async (dashboardItemId, query) => {
|
|
1135
|
+
if (!state.client || !dashboardItemId || !query) {
|
|
1136
|
+
return;
|
|
1137
|
+
}
|
|
1138
|
+
let responseData;
|
|
1139
|
+
if (queryEndpoint) {
|
|
1140
|
+
const response = await fetch(queryEndpoint, {
|
|
1141
|
+
method: 'POST',
|
|
1142
|
+
headers: {
|
|
1143
|
+
...queryHeaders,
|
|
1144
|
+
'Content-Type': 'application/json',
|
|
1145
|
+
},
|
|
1146
|
+
body: JSON.stringify({
|
|
1147
|
+
metadata: {
|
|
1148
|
+
task: 'edit_query',
|
|
1149
|
+
id: state.reportId,
|
|
1150
|
+
query,
|
|
1151
|
+
...(organizationId && { orgId: organizationId }),
|
|
1152
|
+
},
|
|
1153
|
+
}),
|
|
1154
|
+
credentials: withCredentials ? 'include' : 'omit',
|
|
1155
|
+
});
|
|
1156
|
+
responseData = await response.json();
|
|
1157
|
+
}
|
|
1158
|
+
else {
|
|
1159
|
+
const url = `${QUILL_SERVER}/updatequery/${state.client._id}/${organizationId}/`;
|
|
1160
|
+
const requestBody = {
|
|
1161
|
+
dashboardItemId,
|
|
1162
|
+
query,
|
|
1163
|
+
};
|
|
1164
|
+
const response = await fetch(url, {
|
|
1165
|
+
method: 'POST',
|
|
1166
|
+
headers: {
|
|
1167
|
+
'Content-Type': 'application/json',
|
|
1168
|
+
Authorization: 'Bearer ',
|
|
1169
|
+
environment: state.environment || undefined,
|
|
1170
|
+
},
|
|
1171
|
+
body: JSON.stringify(requestBody),
|
|
1172
|
+
});
|
|
1173
|
+
responseData = await response.json();
|
|
1174
|
+
}
|
|
1175
|
+
if (responseData) {
|
|
1176
|
+
if (responseData.error) {
|
|
1177
|
+
alert(`Failed to save query. ${typeof responseData.error === 'string'
|
|
1178
|
+
? responseData.error
|
|
1179
|
+
: responseData.error?.routine === 'errorMissingColumn'
|
|
1180
|
+
? "A column was referenced that doesn't exist."
|
|
1181
|
+
: responseData.error?.routine
|
|
1182
|
+
? responseData.error?.routine
|
|
1183
|
+
: 'Error parsing SQL query'}`);
|
|
1184
|
+
return;
|
|
1185
|
+
}
|
|
1186
|
+
setIsEditQueryOpen(false);
|
|
1187
|
+
}
|
|
1188
|
+
};
|
|
1189
|
+
const deleteReport = async () => {
|
|
1190
|
+
if (!state.reportId) {
|
|
1191
|
+
return;
|
|
1192
|
+
}
|
|
1193
|
+
if (!state.client) {
|
|
1194
|
+
return;
|
|
1195
|
+
}
|
|
1196
|
+
if (!confirm('Are you sure?')) {
|
|
1197
|
+
return;
|
|
1198
|
+
}
|
|
1199
|
+
let responseData;
|
|
1200
|
+
if (queryEndpoint) {
|
|
1201
|
+
const response = await fetch(queryEndpoint, {
|
|
1202
|
+
method: 'POST',
|
|
1203
|
+
headers: {
|
|
1204
|
+
...queryHeaders,
|
|
1205
|
+
'Content-Type': 'application/json',
|
|
1206
|
+
},
|
|
1207
|
+
body: JSON.stringify({
|
|
1208
|
+
metadata: organizationId
|
|
1209
|
+
? {
|
|
1210
|
+
orgId: organizationId,
|
|
1211
|
+
task: 'delete',
|
|
1212
|
+
dashboardItemId: state.reportId,
|
|
1213
|
+
clientId: state.client._id,
|
|
1214
|
+
}
|
|
1215
|
+
: {
|
|
1216
|
+
task: 'delete',
|
|
1217
|
+
dashboardItemId: state.reportId,
|
|
1218
|
+
clientId: state.client._id,
|
|
1219
|
+
},
|
|
1220
|
+
}),
|
|
1221
|
+
credentials: withCredentials ? 'include' : 'omit', // If withCredentials is true, set to 'include'. Otherwise, set to 'omit'.
|
|
1222
|
+
});
|
|
1223
|
+
responseData = await response.json(); // If the server returns JSON data
|
|
1224
|
+
}
|
|
1225
|
+
else {
|
|
1226
|
+
const url = `${QUILL_SERVER}/deletedash/${state.client._id}/${organizationId}/`;
|
|
1227
|
+
const requestBody = {
|
|
1228
|
+
dashboardItemId: state.reportId,
|
|
1229
|
+
};
|
|
1230
|
+
const response = await fetch(url, {
|
|
1231
|
+
method: 'POST',
|
|
1232
|
+
headers: {
|
|
1233
|
+
'Content-Type': 'application/json',
|
|
1234
|
+
environment: state.environment || undefined,
|
|
1235
|
+
},
|
|
1236
|
+
body: JSON.stringify(requestBody),
|
|
1237
|
+
});
|
|
1238
|
+
// To get JSON data from the response:
|
|
1239
|
+
responseData = await response.json();
|
|
1240
|
+
}
|
|
1241
|
+
if (responseData) {
|
|
1242
|
+
dispatch({ type: 'SET_ACTIVE_COMPONENT', payload: 'Dashboards' });
|
|
1243
|
+
}
|
|
1244
|
+
};
|
|
1245
|
+
return (_jsx(Report, { reportId: state.reportId, updateQuery: updateQuery, isOpen: isOpen, setIsOpen: setIsOpen, isEditQueryOpen: isEditQueryOpen, setIsEditQueryOpen: setIsEditQueryOpen, deleteReport: deleteReport, SecondaryButtonComponent: SecondaryButtonComponent, ButtonComponent: ButtonComponent, ModalComponent: ModalComponent, SelectComponent: SelectComponent, OrganizationSelectComponent: OrganizationSelectComponent }));
|
|
1246
|
+
}
|
|
1247
|
+
const measuringConfig = {
|
|
1248
|
+
droppable: {
|
|
1249
|
+
strategy: MeasuringStrategy.Always,
|
|
1250
|
+
},
|
|
1251
|
+
};
|
|
1252
|
+
export function ReorderableList({ initialItems, client, itemMap, ButtonComponent, closeModal, onSave, }) {
|
|
1253
|
+
const [items, setItems] = useState([]);
|
|
1254
|
+
// const [client] = useContext(ClientContext);
|
|
1255
|
+
const sensors = useSensors(useSensor(PointerSensor), useSensor(KeyboardSensor, {
|
|
1256
|
+
coordinateGetter: sortableKeyboardCoordinates,
|
|
1257
|
+
}), useSensor(TouchSensor, {
|
|
1258
|
+
activationConstraint: '',
|
|
1259
|
+
}));
|
|
1260
|
+
useEffect(() => {
|
|
1261
|
+
setItems(initialItems
|
|
1262
|
+
.sort((a, b) => {
|
|
1263
|
+
if (a.order === undefined && b.order === undefined)
|
|
1264
|
+
return 0; // both items don't have the 'order' field
|
|
1265
|
+
if (a.order === undefined)
|
|
1266
|
+
return 1; // only 'a' doesn't have the 'order' field, place 'a' last
|
|
1267
|
+
if (b.order === undefined)
|
|
1268
|
+
return -1; // only 'b' doesn't have the 'order' field, place 'b' last
|
|
1269
|
+
return a.order - b.order; // both items have the 'order' field, sort numerically
|
|
1270
|
+
})
|
|
1271
|
+
.map((elem) => elem._id));
|
|
1272
|
+
}, [initialItems]);
|
|
1273
|
+
const handleSaveChanges = async () => {
|
|
1274
|
+
if (!client) {
|
|
1275
|
+
return;
|
|
1276
|
+
}
|
|
1277
|
+
if (!items.length) {
|
|
1278
|
+
return;
|
|
1279
|
+
}
|
|
1280
|
+
try {
|
|
1281
|
+
const response = await fetch(`${QUILL_SERVER}/dashorder/`, {
|
|
1282
|
+
method: 'POST',
|
|
1283
|
+
headers: {
|
|
1284
|
+
'Content-Type': 'application/json',
|
|
1285
|
+
},
|
|
1286
|
+
body: JSON.stringify({
|
|
1287
|
+
publicKey: client._id,
|
|
1288
|
+
orderArray: items,
|
|
1289
|
+
}),
|
|
1290
|
+
});
|
|
1291
|
+
if (!response.ok) {
|
|
1292
|
+
const errorData = await response.json();
|
|
1293
|
+
throw new Error(`Error: ${errorData.error || 'Unknown error'}`);
|
|
1294
|
+
}
|
|
1295
|
+
const data = await response.json();
|
|
1296
|
+
await onSave();
|
|
1297
|
+
closeModal();
|
|
1298
|
+
}
|
|
1299
|
+
catch (error) {
|
|
1300
|
+
console.error(error.message);
|
|
1301
|
+
}
|
|
1302
|
+
};
|
|
1303
|
+
return (_jsxs("div", { children: [_jsx(DndContext, { sensors: sensors, collisionDetection: closestCenter, onDragEnd: handleDragEnd, measuring: measuringConfig, children: _jsx(SortableContext, { items: items, strategy: verticalListSortingStrategy, children: _jsxs("div", { style: {
|
|
1304
|
+
background: 'white',
|
|
1305
|
+
position: 'fixed',
|
|
1306
|
+
width: '100%',
|
|
1307
|
+
height: 'calc(100% - 40px)',
|
|
1308
|
+
overflowY: 'scroll',
|
|
1309
|
+
overflowX: 'hidden',
|
|
1310
|
+
maxWidth: 700,
|
|
1311
|
+
}, children: [_jsx("div", { style: { height: 80 } }), items.map((id) => (_jsx(SortableItem, { id: id, name: itemMap?.get(id).name }, id))), _jsx("div", { style: { height: 100, width: '100%' } })] }) }) }), _jsx("div", { style: {
|
|
1312
|
+
height: 80,
|
|
1313
|
+
paddingTop: 20,
|
|
1314
|
+
width: '100%',
|
|
1315
|
+
background: 'white',
|
|
1316
|
+
position: 'absolute',
|
|
1317
|
+
bottom: -20,
|
|
1318
|
+
left: 0,
|
|
1319
|
+
right: 0,
|
|
1320
|
+
}, children: _jsx(ButtonComponent, { onClick: handleSaveChanges, label: "Save changes" }) })] }));
|
|
1321
|
+
function handleDragEnd(event) {
|
|
1322
|
+
const { active, over } = event;
|
|
1323
|
+
if (!over?.id || !active?.id) {
|
|
1324
|
+
return;
|
|
1325
|
+
}
|
|
1326
|
+
if (active.id !== over.id) {
|
|
1327
|
+
setItems((items) => {
|
|
1328
|
+
const oldIndex = items.indexOf(active.id);
|
|
1329
|
+
const newIndex = items.indexOf(over.id);
|
|
1330
|
+
return arrayMove(items, oldIndex, newIndex);
|
|
1331
|
+
});
|
|
1332
|
+
}
|
|
1333
|
+
}
|
|
1334
|
+
}
|
|
1335
|
+
const animateLayoutChanges = (args) => args.isSorting || args.wasDragging ? defaultAnimateLayoutChanges(args) : true;
|
|
1336
|
+
function SortableItem({ id, name }) {
|
|
1337
|
+
const { attributes, listeners, setNodeRef, transform, transition } = useSortable({
|
|
1338
|
+
animateLayoutChanges,
|
|
1339
|
+
id: id,
|
|
1340
|
+
});
|
|
1341
|
+
let height = 50;
|
|
1342
|
+
const style = {
|
|
1343
|
+
transform: CSS.Translate.toString(transform),
|
|
1344
|
+
transition,
|
|
1345
|
+
display: 'flex',
|
|
1346
|
+
justifyContent: 'space-between',
|
|
1347
|
+
alignItems: 'center',
|
|
1348
|
+
borderRadius: '10px',
|
|
1349
|
+
border: '1px solid #E7E7E7',
|
|
1350
|
+
boxShadow: '0px 2px 8px 0px rgba(56, 65, 81, 0.08)',
|
|
1351
|
+
cursor: 'grab',
|
|
1352
|
+
userSelect: 'none',
|
|
1353
|
+
marginBottom: 20,
|
|
1354
|
+
background: 'white',
|
|
1355
|
+
};
|
|
1356
|
+
return (_jsx("div", { ref: setNodeRef, style: style, ...attributes, children: _jsxs("div", { style: {
|
|
1357
|
+
cursor: 'pointer',
|
|
1358
|
+
width: '100%',
|
|
1359
|
+
display: 'flex',
|
|
1360
|
+
flexDirection: 'row',
|
|
1361
|
+
alignItems: 'center',
|
|
1362
|
+
justifyContent: 'space-between',
|
|
1363
|
+
height: 260,
|
|
1364
|
+
}, ...listeners, children: [_jsxs("div", { style: {
|
|
1365
|
+
display: 'flex',
|
|
1366
|
+
flexDirection: 'column',
|
|
1367
|
+
justifyContent: 'space-between',
|
|
1368
|
+
height: 260,
|
|
1369
|
+
paddingTop: 20,
|
|
1370
|
+
paddingBottom: 20,
|
|
1371
|
+
width: '100%',
|
|
1372
|
+
}, children: [_jsx("div", { style: {
|
|
1373
|
+
minWidth: 600,
|
|
1374
|
+
width: '100%',
|
|
1375
|
+
paddingLeft: 20,
|
|
1376
|
+
fontSize: 18,
|
|
1377
|
+
fontWeight: '500',
|
|
1378
|
+
}, children: name }), _jsx(Chart, { chartId: id, containerStyle: {
|
|
1379
|
+
height: 180,
|
|
1380
|
+
width: '100%',
|
|
1381
|
+
} })] }), _jsx("div", { style: {
|
|
1382
|
+
display: 'flex',
|
|
1383
|
+
flexDirection: 'column',
|
|
1384
|
+
paddingRight: 20,
|
|
1385
|
+
paddingLeft: 20,
|
|
1386
|
+
}, children: _jsx("svg", { xmlns: "http://www.w3.org/2000/svg", fill: "none", viewBox: "0 0 24 24", "stroke-width": "1.5", stroke: "#6D727E", height: 24, width: 24, children: _jsx("path", { "stroke-linecap": "round", "stroke-linejoin": "round", d: "M8.25 15L12 18.75 15.75 15m-7.5-6L12 5.25 15.75 9" }) }) })] }) }));
|
|
1387
|
+
}
|