@gooddata/sdk-ui-dashboard 11.58.0-alpha.2 → 11.58.0-alpha.4
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/NOTICE +8 -8
- package/esm/__version.d.ts +1 -1
- package/esm/__version.js +1 -1
- package/esm/index.d.ts +5 -5
- package/esm/index.d.ts.map +1 -1
- package/esm/index.js +3 -3
- package/esm/internal.d.ts +1 -0
- package/esm/internal.d.ts.map +1 -1
- package/esm/internal.js +1 -0
- package/esm/model/DashboardTester.d.ts.map +1 -1
- package/esm/model/DashboardTester.js +7 -1
- package/esm/model/commandHandlers/common/validateDrillToCustomUrlParams.d.ts.map +1 -1
- package/esm/model/commandHandlers/common/validateDrillToCustomUrlParams.js +6 -1
- package/esm/model/commandHandlers/common/validateDrills.d.ts.map +1 -1
- package/esm/model/commandHandlers/common/validateDrills.js +12 -3
- package/esm/model/commandHandlers/dashboard/dashboardDrillReferences.d.ts +4 -0
- package/esm/model/commandHandlers/dashboard/dashboardDrillReferences.d.ts.map +1 -0
- package/esm/model/commandHandlers/dashboard/dashboardDrillReferences.js +53 -0
- package/esm/model/commandHandlers/dashboard/initializeDashboardHandler/index.d.ts.map +1 -1
- package/esm/model/commandHandlers/dashboard/initializeDashboardHandler/index.js +13 -6
- package/esm/model/commandHandlers/dashboard/saveAsDashboardHandler.d.ts.map +1 -1
- package/esm/model/commandHandlers/dashboard/saveAsDashboardHandler.js +4 -1
- package/esm/model/commandHandlers/dashboard/saveDashboardHandler.d.ts.map +1 -1
- package/esm/model/commandHandlers/dashboard/saveDashboardHandler.js +30 -6
- package/esm/model/commandHandlers/drill/drillToAttributeUrlHandler.d.ts.map +1 -1
- package/esm/model/commandHandlers/drill/drillToAttributeUrlHandler.js +2 -0
- package/esm/model/commandHandlers/drill/drillToCustomUrlHandler.d.ts.map +1 -1
- package/esm/model/commandHandlers/drill/drillToCustomUrlHandler.js +2 -0
- package/esm/model/commandHandlers/drill/drillToDashboardHandler.d.ts.map +1 -1
- package/esm/model/commandHandlers/drill/drillToDashboardHandler.js +2 -0
- package/esm/model/commandHandlers/drill/drillToInsightHandler.d.ts.map +1 -1
- package/esm/model/commandHandlers/drill/drillToInsightHandler.js +3 -1
- package/esm/model/commandHandlers/drill/resolveDrillToCustomUrl.d.ts.map +1 -1
- package/esm/model/commandHandlers/drill/resolveDrillToCustomUrl.js +30 -29
- package/esm/model/commandHandlers/drill/validateDrillAccess.d.ts +6 -0
- package/esm/model/commandHandlers/drill/validateDrillAccess.d.ts.map +1 -0
- package/esm/model/commandHandlers/drill/validateDrillAccess.js +10 -0
- package/esm/model/commandHandlers/parameters/filterParameterDependenciesWorker.d.ts +45 -0
- package/esm/model/commandHandlers/parameters/filterParameterDependenciesWorker.d.ts.map +1 -0
- package/esm/model/commandHandlers/parameters/filterParameterDependenciesWorker.js +99 -0
- package/esm/model/commandHandlers/parameters/insightParameterDependenciesWorker.d.ts +11 -0
- package/esm/model/commandHandlers/parameters/insightParameterDependenciesWorker.d.ts.map +1 -0
- package/esm/model/commandHandlers/parameters/insightParameterDependenciesWorker.js +71 -0
- package/esm/model/commandHandlers/parameters/loadFilterParameterDependencies.d.ts +22 -0
- package/esm/model/commandHandlers/parameters/loadFilterParameterDependencies.d.ts.map +1 -0
- package/esm/model/commandHandlers/parameters/loadFilterParameterDependencies.js +39 -0
- package/esm/model/commandHandlers/parameters/loadInsightParameterDependencies.d.ts +21 -0
- package/esm/model/commandHandlers/parameters/loadInsightParameterDependencies.d.ts.map +1 -0
- package/esm/model/commandHandlers/parameters/loadInsightParameterDependencies.js +86 -0
- package/esm/model/react/useInitializeDashboardStore.d.ts.map +1 -1
- package/esm/model/react/useInitializeDashboardStore.js +4 -0
- package/esm/model/react/useWidgetExecConfig.d.ts +4 -4
- package/esm/model/react/useWidgetExecConfig.d.ts.map +1 -1
- package/esm/model/react/useWidgetExecConfig.js +2 -2
- package/esm/model/store/catalog/catalogReducers.d.ts +16 -4
- package/esm/model/store/catalog/catalogReducers.d.ts.map +1 -1
- package/esm/model/store/catalog/catalogReducers.js +15 -3
- package/esm/model/store/catalog/catalogSelectors.d.ts +47 -7
- package/esm/model/store/catalog/catalogSelectors.d.ts.map +1 -1
- package/esm/model/store/catalog/catalogSelectors.js +33 -7
- package/esm/model/store/catalog/catalogState.d.ts +30 -9
- package/esm/model/store/catalog/catalogState.d.ts.map +1 -1
- package/esm/model/store/catalog/catalogState.js +2 -1
- package/esm/model/store/catalog/index.d.ts +4 -1
- package/esm/model/store/catalog/index.d.ts.map +1 -1
- package/esm/model/store/filtering/dashboardFilterSelectors.d.ts +8 -2
- package/esm/model/store/filtering/dashboardFilterSelectors.d.ts.map +1 -1
- package/esm/model/store/filtering/dashboardFilterSelectors.js +41 -25
- package/esm/model/store/filtering/types.d.ts +5 -0
- package/esm/model/store/filtering/types.d.ts.map +1 -1
- package/esm/model/store/tabs/layout/layoutSelectors.d.ts.map +1 -1
- package/esm/model/store/tabs/layout/layoutSelectors.js +2 -1
- package/esm/model/store/tabs/parameters/parametersHelpers.d.ts +42 -8
- package/esm/model/store/tabs/parameters/parametersHelpers.d.ts.map +1 -1
- package/esm/model/store/tabs/parameters/parametersHelpers.js +88 -19
- package/esm/model/store/tabs/parameters/parametersSelectors.d.ts +13 -6
- package/esm/model/store/tabs/parameters/parametersSelectors.d.ts.map +1 -1
- package/esm/model/store/tabs/parameters/parametersSelectors.js +24 -13
- package/esm/model/store/ui/index.d.ts +1 -0
- package/esm/model/store/ui/index.d.ts.map +1 -1
- package/esm/model/store/ui/uiReducers.d.ts +5 -1
- package/esm/model/store/ui/uiReducers.d.ts.map +1 -1
- package/esm/model/store/ui/uiReducers.js +8 -4
- package/esm/model/store/ui/uiSelectors.d.ts +5 -1
- package/esm/model/store/ui/uiSelectors.d.ts.map +1 -1
- package/esm/model/store/ui/uiSelectors.js +4 -0
- package/esm/model/store/ui/uiState.d.ts +2 -1
- package/esm/model/store/ui/uiState.d.ts.map +1 -1
- package/esm/model/store/ui/uiState.js +1 -0
- package/esm/model/store/widgetDrills/drillRestrictionSelectors.d.ts +23 -0
- package/esm/model/store/widgetDrills/drillRestrictionSelectors.d.ts.map +1 -0
- package/esm/model/store/widgetDrills/drillRestrictionSelectors.js +5 -0
- package/esm/model/store/widgetDrills/drillRestrictionUtils.d.ts +5 -0
- package/esm/model/store/widgetDrills/drillRestrictionUtils.d.ts.map +1 -0
- package/esm/model/store/widgetDrills/drillRestrictionUtils.js +27 -0
- package/esm/model/store/widgetDrills/widgetDrillSelectors.d.ts.map +1 -1
- package/esm/model/store/widgetDrills/widgetDrillSelectors.js +9 -5
- package/esm/presentation/automations/alerting/state/AlertingDialogStateProvider.js +1 -0
- package/esm/presentation/automations/alerting/state/useAlertDraftFilterWrites.d.ts +4 -2
- package/esm/presentation/automations/alerting/state/useAlertDraftFilterWrites.d.ts.map +1 -1
- package/esm/presentation/automations/alerting/state/useAlertDraftFilterWrites.js +12 -3
- package/esm/presentation/automations/alerting/utils/items.js +8 -14
- package/esm/presentation/automations/connectors/hooks/useBuildAutomationsContext.d.ts.map +1 -1
- package/esm/presentation/automations/connectors/hooks/useBuildAutomationsContext.js +8 -2
- package/esm/presentation/automations/contexts/AutomationsContext.d.ts +4 -2
- package/esm/presentation/automations/contexts/AutomationsContext.d.ts.map +1 -1
- package/esm/presentation/automations/scheduledEmail/hooks/useExportTimezones.js +1 -1
- package/esm/presentation/automations/scheduledEmail/state/ScheduledEmailDialogStateProvider.js +1 -0
- package/esm/presentation/automations/scheduledEmail/state/useScheduledEmailDraftFilterWrites.d.ts +4 -2
- package/esm/presentation/automations/scheduledEmail/state/useScheduledEmailDraftFilterWrites.d.ts.map +1 -1
- package/esm/presentation/automations/scheduledEmail/state/useScheduledEmailDraftFilterWrites.js +25 -6
- package/esm/presentation/automations/shared/automationFilters/components/AutomationAttributeFilter.d.ts.map +1 -1
- package/esm/presentation/automations/shared/automationFilters/components/AutomationAttributeFilter.js +16 -2
- package/esm/presentation/automations/shared/automationFilters/components/AutomationFiltersSelect.d.ts.map +1 -1
- package/esm/presentation/automations/shared/automationFilters/components/AutomationFiltersSelect.js +16 -11
- package/esm/presentation/automations/shared/automationFilters/components/AutomationRestrictedFilters.d.ts +9 -0
- package/esm/presentation/automations/shared/automationFilters/components/AutomationRestrictedFilters.d.ts.map +1 -0
- package/esm/presentation/automations/shared/automationFilters/components/AutomationRestrictedFilters.js +22 -0
- package/esm/presentation/automations/shared/automationFilters/hooks/useDefaultSelectedFiltersForExistingAutomation.d.ts +2 -2
- package/esm/presentation/automations/shared/automationFilters/hooks/useDefaultSelectedFiltersForExistingAutomation.d.ts.map +1 -1
- package/esm/presentation/automations/shared/automationFilters/hooks/useDefaultSelectedFiltersForExistingAutomation.js +17 -5
- package/esm/presentation/automations/shared/automationFilters/useAutomationFilters.d.ts +8 -0
- package/esm/presentation/automations/shared/automationFilters/useAutomationFilters.d.ts.map +1 -1
- package/esm/presentation/automations/shared/automationFilters/useAutomationFilters.js +54 -10
- package/esm/presentation/automations/shared/automationFilters/useAutomationFiltersSelect.d.ts.map +1 -1
- package/esm/presentation/automations/shared/automationFilters/useAutomationFiltersSelect.js +3 -2
- package/esm/presentation/automations/shared/filters/conversions.d.ts +10 -2
- package/esm/presentation/automations/shared/filters/conversions.d.ts.map +1 -1
- package/esm/presentation/automations/shared/filters/conversions.js +15 -6
- package/esm/presentation/dashboardSettingsDialog/DefaultDashboardSettingsDialog.d.ts.map +1 -1
- package/esm/presentation/dashboardSettingsDialog/DefaultDashboardSettingsDialog.js +3 -4
- package/esm/presentation/dashboardSettingsDialog/TimezoneOption.d.ts.map +1 -1
- package/esm/presentation/dashboardSettingsDialog/TimezoneOption.js +20 -7
- package/esm/presentation/dialogs/ExportCsvDialog.d.ts.map +1 -1
- package/esm/presentation/dialogs/ExportCsvDialog.js +2 -1
- package/esm/presentation/drill/DrillConfigPanel/DrillToUrl/CustomUrlEditorParametersSections/IdentifierParametersSection.js +1 -1
- package/esm/presentation/drill/DrillSelect/DrillSelectDropdown.d.ts +2 -1
- package/esm/presentation/drill/DrillSelect/DrillSelectDropdown.d.ts.map +1 -1
- package/esm/presentation/drill/DrillSelect/DrillSelectDropdown.js +19 -1
- package/esm/presentation/drill/DrillSelect/WithDrillSelect.d.ts.map +1 -1
- package/esm/presentation/drill/DrillSelect/WithDrillSelect.js +12 -4
- package/esm/presentation/drill/DrillSelect/types.d.ts +1 -0
- package/esm/presentation/drill/DrillSelect/types.d.ts.map +1 -1
- package/esm/presentation/drill/hooks/useDrillSelectDropdownMenuItems.d.ts.map +1 -1
- package/esm/presentation/drill/hooks/useDrillSelectDropdownMenuItems.js +4 -2
- package/esm/presentation/insightNotSavedDialog/InsightNotSavedDialog.d.ts.map +1 -1
- package/esm/presentation/insightNotSavedDialog/InsightNotSavedDialog.js +4 -5
- package/esm/presentation/localization/bundles/de-DE.localization-bundle.d.ts +3 -0
- package/esm/presentation/localization/bundles/de-DE.localization-bundle.d.ts.map +1 -1
- package/esm/presentation/localization/bundles/de-DE.localization-bundle.js +5 -2
- package/esm/presentation/localization/bundles/en-AU.localization-bundle.d.ts +3 -0
- package/esm/presentation/localization/bundles/en-AU.localization-bundle.d.ts.map +1 -1
- package/esm/presentation/localization/bundles/en-AU.localization-bundle.js +5 -2
- package/esm/presentation/localization/bundles/en-GB.localization-bundle.d.ts +3 -0
- package/esm/presentation/localization/bundles/en-GB.localization-bundle.d.ts.map +1 -1
- package/esm/presentation/localization/bundles/en-GB.localization-bundle.js +5 -2
- package/esm/presentation/localization/bundles/en-US.localization-bundle.d.ts +21 -1
- package/esm/presentation/localization/bundles/en-US.localization-bundle.d.ts.map +1 -1
- package/esm/presentation/localization/bundles/en-US.localization-bundle.js +27 -7
- package/esm/presentation/localization/bundles/es-419.localization-bundle.d.ts +3 -0
- package/esm/presentation/localization/bundles/es-419.localization-bundle.d.ts.map +1 -1
- package/esm/presentation/localization/bundles/es-419.localization-bundle.js +5 -2
- package/esm/presentation/localization/bundles/es-ES.localization-bundle.d.ts +3 -0
- package/esm/presentation/localization/bundles/es-ES.localization-bundle.d.ts.map +1 -1
- package/esm/presentation/localization/bundles/es-ES.localization-bundle.js +5 -2
- package/esm/presentation/localization/bundles/fi-FI.localization-bundle.d.ts +3 -0
- package/esm/presentation/localization/bundles/fi-FI.localization-bundle.d.ts.map +1 -1
- package/esm/presentation/localization/bundles/fi-FI.localization-bundle.js +5 -2
- package/esm/presentation/localization/bundles/fr-CA.localization-bundle.d.ts +3 -0
- package/esm/presentation/localization/bundles/fr-CA.localization-bundle.d.ts.map +1 -1
- package/esm/presentation/localization/bundles/fr-CA.localization-bundle.js +5 -2
- package/esm/presentation/localization/bundles/fr-FR.localization-bundle.d.ts +3 -0
- package/esm/presentation/localization/bundles/fr-FR.localization-bundle.d.ts.map +1 -1
- package/esm/presentation/localization/bundles/fr-FR.localization-bundle.js +5 -2
- package/esm/presentation/localization/bundles/id-ID.localization-bundle.d.ts +3 -0
- package/esm/presentation/localization/bundles/id-ID.localization-bundle.d.ts.map +1 -1
- package/esm/presentation/localization/bundles/id-ID.localization-bundle.js +5 -2
- package/esm/presentation/localization/bundles/it-IT.localization-bundle.d.ts +3 -0
- package/esm/presentation/localization/bundles/it-IT.localization-bundle.d.ts.map +1 -1
- package/esm/presentation/localization/bundles/it-IT.localization-bundle.js +5 -2
- package/esm/presentation/localization/bundles/ja-JP.localization-bundle.d.ts +3 -0
- package/esm/presentation/localization/bundles/ja-JP.localization-bundle.d.ts.map +1 -1
- package/esm/presentation/localization/bundles/ja-JP.localization-bundle.js +5 -2
- package/esm/presentation/localization/bundles/ko-KR.localization-bundle.d.ts +3 -0
- package/esm/presentation/localization/bundles/ko-KR.localization-bundle.d.ts.map +1 -1
- package/esm/presentation/localization/bundles/ko-KR.localization-bundle.js +5 -2
- package/esm/presentation/localization/bundles/nl-NL.localization-bundle.d.ts +3 -0
- package/esm/presentation/localization/bundles/nl-NL.localization-bundle.d.ts.map +1 -1
- package/esm/presentation/localization/bundles/nl-NL.localization-bundle.js +5 -2
- package/esm/presentation/localization/bundles/pl-PL.localization-bundle.d.ts +3 -0
- package/esm/presentation/localization/bundles/pl-PL.localization-bundle.d.ts.map +1 -1
- package/esm/presentation/localization/bundles/pl-PL.localization-bundle.js +5 -2
- package/esm/presentation/localization/bundles/pt-BR.localization-bundle.d.ts +3 -0
- package/esm/presentation/localization/bundles/pt-BR.localization-bundle.d.ts.map +1 -1
- package/esm/presentation/localization/bundles/pt-BR.localization-bundle.js +5 -2
- package/esm/presentation/localization/bundles/pt-PT.localization-bundle.d.ts +3 -0
- package/esm/presentation/localization/bundles/pt-PT.localization-bundle.d.ts.map +1 -1
- package/esm/presentation/localization/bundles/pt-PT.localization-bundle.js +5 -2
- package/esm/presentation/localization/bundles/ru-RU.localization-bundle.d.ts +3 -0
- package/esm/presentation/localization/bundles/ru-RU.localization-bundle.d.ts.map +1 -1
- package/esm/presentation/localization/bundles/ru-RU.localization-bundle.js +5 -2
- package/esm/presentation/localization/bundles/sl-SI.localization-bundle.d.ts +3 -0
- package/esm/presentation/localization/bundles/sl-SI.localization-bundle.d.ts.map +1 -1
- package/esm/presentation/localization/bundles/sl-SI.localization-bundle.js +5 -2
- package/esm/presentation/localization/bundles/th-TH.localization-bundle.d.ts +3 -0
- package/esm/presentation/localization/bundles/th-TH.localization-bundle.d.ts.map +1 -1
- package/esm/presentation/localization/bundles/th-TH.localization-bundle.js +5 -2
- package/esm/presentation/localization/bundles/tr-TR.localization-bundle.d.ts +3 -0
- package/esm/presentation/localization/bundles/tr-TR.localization-bundle.d.ts.map +1 -1
- package/esm/presentation/localization/bundles/tr-TR.localization-bundle.js +5 -2
- package/esm/presentation/localization/bundles/uk-UA.localization-bundle.d.ts +3 -0
- package/esm/presentation/localization/bundles/uk-UA.localization-bundle.d.ts.map +1 -1
- package/esm/presentation/localization/bundles/uk-UA.localization-bundle.js +5 -2
- package/esm/presentation/localization/bundles/vi-VN.localization-bundle.d.ts +3 -0
- package/esm/presentation/localization/bundles/vi-VN.localization-bundle.d.ts.map +1 -1
- package/esm/presentation/localization/bundles/vi-VN.localization-bundle.js +5 -2
- package/esm/presentation/localization/bundles/zh-HK.localization-bundle.d.ts +3 -0
- package/esm/presentation/localization/bundles/zh-HK.localization-bundle.d.ts.map +1 -1
- package/esm/presentation/localization/bundles/zh-HK.localization-bundle.js +5 -2
- package/esm/presentation/localization/bundles/zh-Hans.localization-bundle.d.ts +3 -0
- package/esm/presentation/localization/bundles/zh-Hans.localization-bundle.d.ts.map +1 -1
- package/esm/presentation/localization/bundles/zh-Hans.localization-bundle.js +5 -2
- package/esm/presentation/localization/bundles/zh-Hant.localization-bundle.d.ts +3 -0
- package/esm/presentation/localization/bundles/zh-Hant.localization-bundle.d.ts.map +1 -1
- package/esm/presentation/localization/bundles/zh-Hant.localization-bundle.js +5 -2
- package/esm/presentation/widget/common/RestrictedPlaceholder.d.ts +4 -8
- package/esm/presentation/widget/common/RestrictedPlaceholder.d.ts.map +1 -1
- package/esm/presentation/widget/common/RestrictedPlaceholder.js +16 -23
- package/esm/presentation/widget/insight/DefaultInsightBody/DefaultInsightBody.d.ts.map +1 -1
- package/esm/presentation/widget/insight/DefaultInsightBody/DefaultInsightBody.js +2 -4
- package/esm/presentation/widget/insight/LayeredTableView.d.ts +1 -1
- package/esm/presentation/widget/insight/LayeredTableView.d.ts.map +1 -1
- package/esm/presentation/widget/insight/ViewModeDashboardInsight/InsightDrillDialog/DrillDialogInsight.d.ts.map +1 -1
- package/esm/presentation/widget/insight/ViewModeDashboardInsight/InsightDrillDialog/DrillDialogInsight.js +2 -3
- package/esm/presentation/widget/insight/ViewModeDashboardInsight/InsightDrillDialog/InsightDrillDialog.d.ts.map +1 -1
- package/esm/presentation/widget/insight/ViewModeDashboardInsight/InsightDrillDialog/InsightDrillDialog.js +1 -1
- package/esm/presentation/widget/insight/types.d.ts +1 -1
- package/esm/presentation/widget/insight/types.d.ts.map +1 -1
- package/esm/presentation/widget/richText/RestrictedReferencesDialog.d.ts.map +1 -1
- package/esm/presentation/widget/richText/RestrictedReferencesDialog.js +5 -6
- package/esm/presentation/widget/visualizationSwitcher/ViewModeDashboardVisualizationSwitcher.js +1 -1
- package/esm/presentation/widget/visualizationSwitcher/configuration/VisualizationsList/VisualizationListItem.d.ts.map +1 -1
- package/esm/presentation/widget/visualizationSwitcher/configuration/VisualizationsList/VisualizationListItem.js +1 -4
- package/esm/presentation/widget/widget/InsightWidget/DefaultDashboardInsightWidget.js +2 -3
- package/esm/sdk-ui-dashboard.d.ts +88 -61
- package/package.json +21 -21
- package/styles/css/dashboard.css +1 -7
- package/styles/css/dashboard.css.map +1 -1
- package/styles/css/dashboardSettingsDialog.css +4 -0
- package/styles/css/dashboardSettingsDialog.css.map +1 -1
- package/styles/css/export.css +0 -6
- package/styles/css/export.css.map +1 -1
- package/styles/css/main.css +13 -20
- package/styles/css/main.css.map +1 -1
- package/styles/css/notifications_channels_dialog.css +1 -7
- package/styles/css/notifications_channels_dialog.css.map +1 -1
- package/styles/css/richTextWidget.css +4 -0
- package/styles/css/richTextWidget.css.map +1 -1
- package/styles/scss/dashboardSettingsDialog.scss +5 -0
- package/styles/scss/export.scss +0 -9
- package/styles/scss/notifications_channels_dialog.scss +1 -10
- package/styles/scss/richTextWidget.scss +5 -1
- package/esm/model/commandHandlers/dashboard/initializeDashboardHandler/loadMeasureParameterDependencies.d.ts +0 -13
- package/esm/model/commandHandlers/dashboard/initializeDashboardHandler/loadMeasureParameterDependencies.d.ts.map +0 -1
- package/esm/model/commandHandlers/dashboard/initializeDashboardHandler/loadMeasureParameterDependencies.js +0 -98
- package/esm/model/types/drillTypes.d.ts +0 -13
- package/esm/model/types/drillTypes.d.ts.map +0 -1
- package/esm/model/types/drillTypes.js +0 -14
- package/esm/presentation/widget/insight/geoDefaultDisplayFormRefs.d.ts +0 -5
- package/esm/presentation/widget/insight/geoDefaultDisplayFormRefs.d.ts.map +0 -1
- package/esm/presentation/widget/insight/geoDefaultDisplayFormRefs.js +0 -28
- package/esm/presentation/widget/insight/insightToTable.d.ts +0 -74
- package/esm/presentation/widget/insight/insightToTable.d.ts.map +0 -1
- package/esm/presentation/widget/insight/insightToTable.js +0 -482
|
@@ -4,7 +4,8 @@ import { useDashboardSelector } from "../../../../model/react/DashboardStoreProv
|
|
|
4
4
|
import { selectAllCatalogAttributesMap, selectAllCatalogDisplayFormsMap, selectCatalogAttributesWithComputed, selectCatalogDateDatasets, selectCatalogMeasures, selectCatalogParameters, selectCatalogParametersIsLoaded, } from "../../../../model/store/catalog/catalogSelectors.js";
|
|
5
5
|
import { selectEnableAlertOncePerInterval, selectEnableAnomalyDetectionAlert, selectEnableAutomationEvaluationMode, selectEnableParameters, selectEnableSlideshowExports, selectEnableStringParameters, selectEnableTimezoneChange, selectExternalRecipient, selectIsWhiteLabeled, selectLocale, selectSeparators, selectSettings, selectTimezone, selectWeekStart, } from "../../../../model/store/config/configSelectors.js";
|
|
6
6
|
import { selectEntitlementMinimumRecurrenceMinutes, selectMaxAutomationRecipients, } from "../../../../model/store/entitlements/entitlementsSelectors.js";
|
|
7
|
-
import { selectAutomationAvailableDashboardFilters, selectAutomationCommonDateFilterId, selectAutomationDefaultSelectedFilters, selectAutomationFiltersByTab,
|
|
7
|
+
import { selectAllDashboardFiltersWithoutCrossFiltering, selectAutomationAvailableDashboardFilters, selectAutomationCommonDateFilterId, selectAutomationDefaultSelectedFilters, selectAutomationFiltersByTab, selectDashboardHiddenFilters, selectDashboardLockedFilters, } from "../../../../model/store/filtering/dashboardFilterSelectors.js";
|
|
8
|
+
import { isDashboardFilterRestricted } from "../../../../model/store/filtering/restrictedFilterUtils.js";
|
|
8
9
|
import { selectDashboardTimezoneConfig, selectEffectiveDashboardTimezone, selectPersistedDashboardFilterContextDateFilterConfig, selectScheduledExportTimezone, } from "../../../../model/store/meta/metaSelectors.js";
|
|
9
10
|
import { selectCanCreateAutomation, selectCanManageWorkspace, selectCanUseAiAssistant, } from "../../../../model/store/permissions/permissionsSelectors.js";
|
|
10
11
|
import { selectAttributeFilterConfigsOverrides, selectAttributeFilterConfigsOverridesByTab, selectAttributeFilterConfigsSelectionTypeMap, selectAttributeFilterConfigsSelectionTypeMapByTab, } from "../../../../model/store/tabs/attributeFilterConfigs/attributeFilterConfigsSelectors.js";
|
|
@@ -16,6 +17,7 @@ import { selectMeasureValueFilterConfigsOverrides, selectMeasureValueFilterConfi
|
|
|
16
17
|
import { selectSmartPersistedTabsParameters } from "../../../../model/store/tabs/parameters/parametersSelectors.js";
|
|
17
18
|
import { selectTabs } from "../../../../model/store/tabs/tabsSelectors.js";
|
|
18
19
|
import { selectExecutionTimestamp, selectScheduleEmailDialogReturnFocusTo, } from "../../../../model/store/ui/uiSelectors.js";
|
|
20
|
+
import { selectUnavailableObjects } from "../../../../model/store/unavailableObjects/unavailableObjectsSelectors.js";
|
|
19
21
|
import { selectCurrentUser } from "../../../../model/store/user/userSelectors.js";
|
|
20
22
|
const DEFAULT_MIN_RECURRENCE_MINUTES = "60";
|
|
21
23
|
export function useBuildAutomationsContext() {
|
|
@@ -45,7 +47,8 @@ export function useBuildAutomationsContext() {
|
|
|
45
47
|
const commonDateFilterId = useDashboardSelector(selectAutomationCommonDateFilterId);
|
|
46
48
|
const lockedFilters = useDashboardSelector(selectDashboardLockedFilters);
|
|
47
49
|
const hiddenFilters = useDashboardSelector(selectDashboardHiddenFilters);
|
|
48
|
-
const availableFilters = useDashboardSelector(
|
|
50
|
+
const availableFilters = useDashboardSelector(selectAllDashboardFiltersWithoutCrossFiltering);
|
|
51
|
+
const unavailableObjects = useDashboardSelector(selectUnavailableObjects);
|
|
49
52
|
const automationFiltersByTab = useDashboardSelector(selectAutomationFiltersByTab);
|
|
50
53
|
const defaultSelectedFilters = useDashboardSelector(selectAutomationDefaultSelectedFilters);
|
|
51
54
|
const automationAvailableFilters = useDashboardSelector(selectAutomationAvailableDashboardFilters);
|
|
@@ -95,6 +98,7 @@ export function useBuildAutomationsContext() {
|
|
|
95
98
|
const widgetLocalIdToTabIdMap = useDashboardSelector(selectWidgetLocalIdToTabIdMap);
|
|
96
99
|
const getCatalogAttributeByRef = useCallback((ref) => allCatalogAttributesMap.get(ref), [allCatalogAttributesMap]);
|
|
97
100
|
const getAttributeFilterDisplayForm = useCallback((displayForm) => attrFilterDisplayFormsMap.get(displayForm) ?? catalogDisplayFormsMap.get(displayForm), [attrFilterDisplayFormsMap, catalogDisplayFormsMap]);
|
|
101
|
+
const isFilterRestricted = useCallback((filter) => isDashboardFilterRestricted(filter, unavailableObjects), [unavailableObjects]);
|
|
98
102
|
const widgetExistsByRef = useCallback((ref) => !!ref && widgetsMap.get(ref) !== undefined, [widgetsMap]);
|
|
99
103
|
const dateFilterConfig = useMemo(() => ({
|
|
100
104
|
availableGranularities,
|
|
@@ -177,6 +181,7 @@ export function useBuildAutomationsContext() {
|
|
|
177
181
|
widgetLocalIdToTabIdMap,
|
|
178
182
|
getCatalogAttributeByRef,
|
|
179
183
|
getAttributeFilterDisplayForm,
|
|
184
|
+
isFilterRestricted,
|
|
180
185
|
widgetExistsByRef,
|
|
181
186
|
scheduleEmailDialogReturnFocusTo,
|
|
182
187
|
}), [
|
|
@@ -219,6 +224,7 @@ export function useBuildAutomationsContext() {
|
|
|
219
224
|
widgetLocalIdToTabIdMap,
|
|
220
225
|
getCatalogAttributeByRef,
|
|
221
226
|
getAttributeFilterDisplayForm,
|
|
227
|
+
isFilterRestricted,
|
|
222
228
|
widgetExistsByRef,
|
|
223
229
|
scheduleEmailDialogReturnFocusTo,
|
|
224
230
|
]);
|
|
@@ -99,11 +99,13 @@ export interface IAutomationsContextValue {
|
|
|
99
99
|
lockedFilters: FilterContextItem[];
|
|
100
100
|
/** Dashboard filters configured as hidden; from selectDashboardHiddenFilters. */
|
|
101
101
|
hiddenFilters: FilterContextItem[];
|
|
102
|
-
/** Dashboard's applied filters with cross-filtering filters removed; from
|
|
102
|
+
/** Dashboard's applied filters with cross-filtering filters removed; from selectAllDashboardFiltersWithoutCrossFiltering. */
|
|
103
103
|
availableFilters: FilterContextItem[];
|
|
104
|
+
/** Whether the user may not read the object a filter filters by. Such a filter is kept in the automation, but the filter bar reports it as a count instead of rendering it. */
|
|
105
|
+
isFilterRestricted: (filter: FilterContextItem) => boolean;
|
|
104
106
|
/** Automation-available filters structured per dashboard tab, for whole-dashboard automations on a tabbed dashboard; from selectAutomationFiltersByTab. */
|
|
105
107
|
automationFiltersByTab: IAutomationFiltersTab[];
|
|
106
|
-
/** Automation-available filters with empty (all-values) filters removed; preselects filters for a new automation. From selectAutomationDefaultSelectedFilters. */
|
|
108
|
+
/** Automation-available filters with empty (all-values) filters removed, except restricted ones; preselects filters for a new automation. From selectAutomationDefaultSelectedFilters. */
|
|
107
109
|
defaultSelectedFilters: FilterContextItem[];
|
|
108
110
|
/** Dashboard filters available to an automation — hidden filters removed, common date filter included; from selectAutomationAvailableDashboardFilters. */
|
|
109
111
|
automationAvailableFilters: FilterContextItem[];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AutomationsContext.d.ts","sourceRoot":"","sources":["../../../../src/presentation/automations/contexts/AutomationsContext.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EACR,qCAAqC,EACrC,qBAAqB,EACrB,iBAAiB,EACjB,mCAAmC,EACnC,iBAAiB,EACjB,qBAAqB,EACrB,mBAAmB,EACnB,eAAe,EACf,+BAA+B,EAC/B,0BAA0B,EAC1B,8BAA8B,EAC9B,kCAAkC,EAClC,mBAAmB,EACnB,wBAAwB,EACxB,WAAW,EACX,SAAS,EACT,KAAK,EACL,MAAM,EACN,SAAS,EACZ,MAAM,qBAAqB,CAAC;AAC7B,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,kBAAkB,CAAC;AAChD,OAAO,KAAK,EAAE,wBAAwB,EAAE,MAAM,0BAA0B,CAAC;AAEzE,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,yCAAyC,CAAC;AAErF;;;;;GAKG;AACH,MAAM,WAAW,4BAA4B;IACzC,6IAA6I;IAC7I,sBAAsB,EAAE,qBAAqB,E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AAE,qCAAqC,GAAG,SAAS,CAAC,CAAC;IAChG,iKAAiK;IACjK,oCAAoC,EAAE,MAAM,CACxC,MAAM,EACN,GAAG,CAAC,MAAM,EAAE,qCAAqC,GAAG,SAAS,CAAC,CACjE,CAAC;IACF,sHAAsH;IACtH,iBAAiB,EAAE,8BAA8B,EAAE,CAAC;IACpD,uIAAuI;IACvI,sBAAsB,EAAE,MAAM,CAAC,MAAM,EAAE,8BAA8B,EAAE,CAAC,CAAC;IACzE,gJAAgJ;IAChJ,8BAA8B,EAAE,MAAM,CAAC,MAAM,EAAE,0BAA0B,GAAG,SAAS,CAAC,CAAC;IACvF,+HAA+H;IAC/H,yBAAyB,EAAE,kCAAkC,EAAE,CAAC;IAChE,uJAAuJ;IACvJ,8BAA8B,EAAE,MAAM,CAAC,MAAM,EAAE,kCAAkC,EAAE,CAAC,CAAC;IACrF,0JAA0J;IAC1J,kBAAkB,EAAE,MAAM,GAAG,SAAS,CAAC;IACvC,6FAA6F;IAC7F,aAAa,EAAE,iBAAiB,EAAE,CAAC;IACnC,iFAAiF;IACjF,aAAa,EAAE,iBAAiB,EAAE,CAAC;IACnC,
|
|
1
|
+
{"version":3,"file":"AutomationsContext.d.ts","sourceRoot":"","sources":["../../../../src/presentation/automations/contexts/AutomationsContext.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EACR,qCAAqC,EACrC,qBAAqB,EACrB,iBAAiB,EACjB,mCAAmC,EACnC,iBAAiB,EACjB,qBAAqB,EACrB,mBAAmB,EACnB,eAAe,EACf,+BAA+B,EAC/B,0BAA0B,EAC1B,8BAA8B,EAC9B,kCAAkC,EAClC,mBAAmB,EACnB,wBAAwB,EACxB,WAAW,EACX,SAAS,EACT,KAAK,EACL,MAAM,EACN,SAAS,EACZ,MAAM,qBAAqB,CAAC;AAC7B,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,kBAAkB,CAAC;AAChD,OAAO,KAAK,EAAE,wBAAwB,EAAE,MAAM,0BAA0B,CAAC;A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tF,uBAAuB,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IAChD,2JAA2J;IAC3J,wBAAwB,EAAE,CAAC,GAAG,EAAE,MAAM,KAAK,iBAAiB,GAAG,qBAAqB,GAAG,SAAS,CAAC;IACjG;;;;OAIG;IACH,6BAA6B,EAAE,CAAC,WAAW,EAAE,MAAM,KAAK,mCAAmC,GAAG,SAAS,CAAC;IACxG;;;;OAIG;IACH,gCAAgC,CAAC,EAAE,MAAM,CAAC;IAC1C;;;;OAIG;IACH,iBAAiB,EAAE,CAAC,GAAG,EAAE,MAAM,GAAG,SAAS,KAAK,OAAO,CAAC;CAC3D;AAID;;;;;;;;;GASG;AACH,eAAO,MAAM,0BAA0B,gEAA8B,CAAC;AAEtE;;;;;;;;GAQG;AACH,wBAAgB,qBAAqB,IAAI,wBAAwB,CAWhE"}
|
|
@@ -19,7 +19,7 @@ import { useAutomationsContext } from "../../contexts/AutomationsContext.js";
|
|
|
19
19
|
*/
|
|
20
20
|
export function useExportTimezones(isWidgetSchedule) {
|
|
21
21
|
const { exportTimezones } = useAutomationsContext();
|
|
22
|
-
const { isTimezoneFeatureEnabled = false, allowUserOverrideInViewMode = false, configuredTimezoneId
|
|
22
|
+
const { isTimezoneFeatureEnabled = false, allowUserOverrideInViewMode = false, configuredTimezoneId, workspaceTimezone, effectiveTimezone, scheduledExportTimezone: explicitTimezone, } = exportTimezones ?? {};
|
|
23
23
|
const canSelectScheduleTimezone = isTimezoneFeatureEnabled && allowUserOverrideInViewMode;
|
|
24
24
|
const initialSelection = isWidgetSchedule
|
|
25
25
|
? effectiveTimezone
|
package/esm/presentation/automations/scheduledEmail/state/ScheduledEmailDialogStateProvider.js
CHANGED
|
@@ -96,6 +96,7 @@ function LoadedScheduledEmailDialogState({ children }) {
|
|
|
96
96
|
});
|
|
97
97
|
const { applyFiltersToDraft, applyFiltersByTabToDraft } = useScheduledEmailDraftFilterWrites({
|
|
98
98
|
setEditedAutomation: formState.setEditedAutomation,
|
|
99
|
+
scheduledExportToEdit,
|
|
99
100
|
widget,
|
|
100
101
|
insight,
|
|
101
102
|
storeFilters,
|
package/esm/presentation/automations/scheduledEmail/state/useScheduledEmailDraftFilterWrites.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { type Dispatch, type SetStateAction } from "react";
|
|
2
|
-
import { type FilterContextItem, type IAutomationMetadataObjectDefinition, type IAutomationVisibleFilter, type IInsight, type IWidget } from "@gooddata/sdk-model";
|
|
2
|
+
import { type FilterContextItem, type IAutomationMetadataObject, type IAutomationMetadataObjectDefinition, type IAutomationVisibleFilter, type IInsight, type IWidget } from "@gooddata/sdk-model";
|
|
3
3
|
import type { IAutomationFiltersTab } from "../../../../model/store/filtering/types.js";
|
|
4
4
|
/**
|
|
5
5
|
* Props for {@link useScheduledEmailDraftFilterWrites}.
|
|
@@ -7,6 +7,8 @@ import type { IAutomationFiltersTab } from "../../../../model/store/filtering/ty
|
|
|
7
7
|
*/
|
|
8
8
|
export interface IUseScheduledEmailDraftFilterWritesProps {
|
|
9
9
|
setEditedAutomation: Dispatch<SetStateAction<IAutomationMetadataObjectDefinition>>;
|
|
10
|
+
/** The schedule as it was loaded; the source of the visible-filter entries only it can name. */
|
|
11
|
+
scheduledExportToEdit?: IAutomationMetadataObject;
|
|
10
12
|
widget?: IWidget;
|
|
11
13
|
insight?: IInsight;
|
|
12
14
|
storeFilters: boolean;
|
|
@@ -20,7 +22,7 @@ export interface IUseScheduledEmailDraftFilterWritesProps {
|
|
|
20
22
|
*
|
|
21
23
|
* @internal
|
|
22
24
|
*/
|
|
23
|
-
export declare function useScheduledEmailDraftFilterWrites({ setEditedAutomation, widget, insight, storeFilters, availableFiltersAsVisibleFilters, availableFiltersAsVisibleFiltersByTab, filtersByTab, }: IUseScheduledEmailDraftFilterWritesProps): {
|
|
25
|
+
export declare function useScheduledEmailDraftFilterWrites({ setEditedAutomation, scheduledExportToEdit, widget, insight, storeFilters, availableFiltersAsVisibleFilters, availableFiltersAsVisibleFiltersByTab, filtersByTab, }: IUseScheduledEmailDraftFilterWritesProps): {
|
|
24
26
|
applyFiltersToDraft: (filters: FilterContextItem[], storeFiltersParam?: boolean) => void;
|
|
25
27
|
applyFiltersByTabToDraft: (newFiltersByTab: Record<string, FilterContextItem[]>, storeFiltersParam?: boolean) => void;
|
|
26
28
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useScheduledEmailDraftFilterWrites.d.ts","sourceRoot":"","sources":["../../../../../src/presentation/automations/scheduledEmail/state/useScheduledEmailDraftFilterWrites.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,KAAK,QAAQ,EAAE,KAAK,cAAc,
|
|
1
|
+
{"version":3,"file":"useScheduledEmailDraftFilterWrites.d.ts","sourceRoot":"","sources":["../../../../../src/presentation/automations/scheduledEmail/state/useScheduledEmailDraftFilterWrites.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,KAAK,QAAQ,EAAE,KAAK,cAAc,EAAwB,MAAM,OAAO,CAAC;AAEjF,OAAO,EACH,KAAK,iBAAiB,EACtB,KAAK,yBAAyB,EAC9B,KAAK,mCAAmC,EACxC,KAAK,wBAAwB,EAC7B,KAAK,QAAQ,EACb,KAAK,OAAO,EAIf,MAAM,qBAAqB,CAAC;AAE7B,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,4CAA4C,CAAC;AAUxF;;;GAGG;AACH,MAAM,WAAW,wCAAwC;IACrD,mBAAmB,EAAE,QAAQ,CAAC,cAAc,CAAC,mCAAmC,CAAC,CAAC,CAAC;IACnF,gGAAgG;IAChG,qBAAqB,CAAC,EAAE,yBAAyB,CAAC;IAClD,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB,OAAO,CAAC,EAAE,QAAQ,CAAC;IACnB,YAAY,EAAE,OAAO,CAAC;IACtB,gCAAgC,CAAC,EAAE,wBAAwB,EAAE,GAAG,SAAS,CAAC;IAC1E,qCAAqC,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,wBAAwB,EAAE,CAAC,CAAC;IACnF,YAAY,CAAC,EAAE,qBAAqB,EAAE,GAAG,SAAS,CAAC;CACtD;AAED;;;;;GAKG;AACH,wBAAgB,kCAAkC,CAAC,EAC/C,mBAAmB,EACnB,qBAAqB,EACrB,MAAM,EACN,OAAO,EACP,YAAY,EACZ,gCAAgC,EAChC,qCAAqC,EACrC,YAAY,GACf,EAAE,wCAAwC,GAAG;IAC1C,mBAAmB,EAAE,CAAC,OAAO,EAAE,iBAAiB,EAAE,EAAE,iBAAiB,CAAC,EAAE,OAAO,KAAK,IAAI,CAAC;IACzF,wBAAwB,EAAE,CACtB,eAAe,EAAE,MAAM,CAAC,MAAM,EAAE,iBAAiB,EAAE,CAAC,EACpD,iBAAiB,CAAC,EAAE,OAAO,KAC1B,IAAI,CAAC;CACb,CAyNA"}
|
package/esm/presentation/automations/scheduledEmail/state/useScheduledEmailDraftFilterWrites.js
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
// (C) 2026 GoodData Corporation
|
|
2
|
-
import { useCallback } from "react";
|
|
2
|
+
import { useCallback, useMemo } from "react";
|
|
3
3
|
import { isExportDefinitionDashboardRequestPayload, isExportDefinitionVisualizationObjectRequestPayload, isInsightWidget, } from "@gooddata/sdk-model";
|
|
4
|
+
import { useAutomationsContext } from "../../contexts/AutomationsContext.js";
|
|
4
5
|
import { useScheduledEmailDialogContext } from "../../contexts/ScheduledEmailDialogContext.js";
|
|
5
6
|
import { getAppliedDashboardFilters, getAppliedWidgetFilters, getVisibleFiltersByFilters, getVisibleFiltersByFiltersByTab, } from "../../shared/filters/index.js";
|
|
6
7
|
/**
|
|
@@ -9,8 +10,19 @@ import { getAppliedDashboardFilters, getAppliedWidgetFilters, getVisibleFiltersB
|
|
|
9
10
|
*
|
|
10
11
|
* @internal
|
|
11
12
|
*/
|
|
12
|
-
export function useScheduledEmailDraftFilterWrites({ setEditedAutomation, widget, insight, storeFilters, availableFiltersAsVisibleFilters, availableFiltersAsVisibleFiltersByTab, filtersByTab, }) {
|
|
13
|
+
export function useScheduledEmailDraftFilterWrites({ setEditedAutomation, scheduledExportToEdit, widget, insight, storeFilters, availableFiltersAsVisibleFilters, availableFiltersAsVisibleFiltersByTab, filtersByTab, }) {
|
|
13
14
|
const { hiddenFilters: dashboardHiddenFilters, commonDateFilterId } = useScheduledEmailDialogContext();
|
|
15
|
+
const { isFilterRestricted } = useAutomationsContext();
|
|
16
|
+
// Read from the loaded schedule, not from the draft: turning the store-filters checkbox off
|
|
17
|
+
// empties the draft's entries, and turning it back on must restore them.
|
|
18
|
+
const restrictedFallback = useMemo(() => ({
|
|
19
|
+
storedVisibleFilters: scheduledExportToEdit?.metadata?.visibleFilters,
|
|
20
|
+
isFilterRestricted,
|
|
21
|
+
}), [scheduledExportToEdit, isFilterRestricted]);
|
|
22
|
+
const restrictedFallbackByTab = useMemo(() => ({
|
|
23
|
+
storedVisibleFilters: scheduledExportToEdit?.metadata?.visibleFiltersByTab,
|
|
24
|
+
isFilterRestricted,
|
|
25
|
+
}), [scheduledExportToEdit, isFilterRestricted]);
|
|
14
26
|
// Re-derived locally (not passed as a prop) so that the `if (isWidget)` branch below narrows
|
|
15
27
|
// `widget`/`insight` via TS's aliased-condition control-flow analysis — this requires the boolean
|
|
16
28
|
// to be declared from those exact variables in this same scope, same as in the parent.
|
|
@@ -25,7 +37,7 @@ export function useScheduledEmailDraftFilterWrites({ setEditedAutomation, widget
|
|
|
25
37
|
const appliedDashboardFilters = getAppliedDashboardFilters(filters, dashboardHiddenFilters, true);
|
|
26
38
|
const appliedWidgetFiltersWithInsight = getAppliedWidgetFilters(filters, dashboardHiddenFilters, widget, insight, commonDateFilterId, true);
|
|
27
39
|
const appliedWidgetFiltersWithoutInsight = getAppliedWidgetFilters(filters, dashboardHiddenFilters, widget, insight, commonDateFilterId, false);
|
|
28
|
-
const visibleFilters = getVisibleFiltersByFilters(filters, availableFiltersAsVisibleFilters, true);
|
|
40
|
+
const visibleFilters = getVisibleFiltersByFilters(filters, availableFiltersAsVisibleFilters, true, restrictedFallback);
|
|
29
41
|
return {
|
|
30
42
|
...s,
|
|
31
43
|
exportDefinitions: s.exportDefinitions?.map((exportDefinition) => {
|
|
@@ -63,7 +75,7 @@ export function useScheduledEmailDraftFilterWrites({ setEditedAutomation, widget
|
|
|
63
75
|
else {
|
|
64
76
|
setEditedAutomation((s) => {
|
|
65
77
|
const appliedFilters = getAppliedDashboardFilters(filters, dashboardHiddenFilters, shouldStoreFilters);
|
|
66
|
-
const visibleFilters = getVisibleFiltersByFilters(filters, availableFiltersAsVisibleFilters, shouldStoreFilters);
|
|
78
|
+
const visibleFilters = getVisibleFiltersByFilters(filters, availableFiltersAsVisibleFilters, shouldStoreFilters, restrictedFallback);
|
|
67
79
|
return {
|
|
68
80
|
...s,
|
|
69
81
|
exportDefinitions: s.exportDefinitions?.map((exportDefinition) => {
|
|
@@ -99,6 +111,7 @@ export function useScheduledEmailDraftFilterWrites({ setEditedAutomation, widget
|
|
|
99
111
|
insight,
|
|
100
112
|
isWidget,
|
|
101
113
|
commonDateFilterId,
|
|
114
|
+
restrictedFallback,
|
|
102
115
|
]);
|
|
103
116
|
// Callback for per-tab filter changes - updates state AND syncs to export definitions
|
|
104
117
|
const applyFiltersByTabToDraft = useCallback((newFiltersByTab, storeFiltersParam) => {
|
|
@@ -113,7 +126,7 @@ export function useScheduledEmailDraftFilterWrites({ setEditedAutomation, widget
|
|
|
113
126
|
return acc;
|
|
114
127
|
}, {})
|
|
115
128
|
: undefined;
|
|
116
|
-
const newVisibleFiltersByTab = getVisibleFiltersByFiltersByTab(newFiltersByTab, availableFiltersAsVisibleFiltersByTab, shouldStoreFilters);
|
|
129
|
+
const newVisibleFiltersByTab = getVisibleFiltersByFiltersByTab(newFiltersByTab, availableFiltersAsVisibleFiltersByTab, shouldStoreFilters, restrictedFallbackByTab);
|
|
117
130
|
// Sync to export definitions AND metadata
|
|
118
131
|
setEditedAutomation((s) => ({
|
|
119
132
|
...s,
|
|
@@ -137,6 +150,12 @@ export function useScheduledEmailDraftFilterWrites({ setEditedAutomation, widget
|
|
|
137
150
|
visibleFiltersByTab: newVisibleFiltersByTab,
|
|
138
151
|
},
|
|
139
152
|
}));
|
|
140
|
-
}, [
|
|
153
|
+
}, [
|
|
154
|
+
storeFilters,
|
|
155
|
+
setEditedAutomation,
|
|
156
|
+
availableFiltersAsVisibleFiltersByTab,
|
|
157
|
+
filtersByTab,
|
|
158
|
+
restrictedFallbackByTab,
|
|
159
|
+
]);
|
|
141
160
|
return { applyFiltersToDraft, applyFiltersByTabToDraft };
|
|
142
161
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AutomationAttributeFilter.d.ts","sourceRoot":"","sources":["../../../../../../src/presentation/automations/shared/automationFilters/components/AutomationAttributeFilter.tsx"],"names":[],"mappings":"AAMA,OAAO,
|
|
1
|
+
{"version":3,"file":"AutomationAttributeFilter.d.ts","sourceRoot":"","sources":["../../../../../../src/presentation/automations/shared/automationFilters/components/AutomationAttributeFilter.tsx"],"names":[],"mappings":"AAMA,OAAO,EACH,KAAK,4BAA4B,EACjC,KAAK,iBAAiB,EACtB,KAAK,MAAM,EAEd,MAAM,qBAAqB,CAAC;AAO7B,OAAO,EACH,KAAK,mBAAmB,EAM3B,MAAM,sBAAsB,CAAC;AAW9B,wBAAgB,yBAAyB,CAAC,EACtC,MAAM,EACN,QAAQ,EACR,QAAQ,EACR,QAAQ,EACR,cAAc,EACd,mBAAmB,EACnB,QAAQ,EACR,KAAK,GACR,EAAE;IACC,MAAM,EAAE,4BAA4B,CAAC;IACrC,QAAQ,EAAE,CAAC,MAAM,EAAE,iBAAiB,KAAK,IAAI,CAAC;IAC9C,QAAQ,EAAE,CAAC,MAAM,EAAE,iBAAiB,KAAK,IAAI,CAAC;IAC9C,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,mBAAmB,CAAC,EAAE,mBAAmB,CAAC;IAC1C,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,KAAK,CAAC,EAAE,MAAM,CAAC;CAClB,2CAwBA"}
|
|
@@ -1,9 +1,13 @@
|
|
|
1
1
|
import { Fragment as _Fragment, jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
2
|
// (C) 2025-2026 GoodData Corporation
|
|
3
|
-
import { useCallback } from "react";
|
|
3
|
+
import { useCallback, useMemo } from "react";
|
|
4
4
|
import { useIntl } from "react-intl";
|
|
5
|
+
import { isDashboardAttributeFilter, } from "@gooddata/sdk-model";
|
|
6
|
+
import { useBackendStrict } from "@gooddata/sdk-ui";
|
|
5
7
|
import { AttributeFilterButton, } from "@gooddata/sdk-ui-filters";
|
|
6
8
|
import { UiChip, UiSkeleton, UiTooltip, isActionKey, useIdPrefixed, } from "@gooddata/sdk-ui-kit";
|
|
9
|
+
import { convertDashboardAttributeFilterElementsUrisToValues } from "../../../../../_staging/dashboard/legacyFilterConvertors.js";
|
|
10
|
+
import { useDashboardComponentsContext } from "../../../../dashboardContexts/DashboardComponentsContext.js";
|
|
7
11
|
import { DefaultDashboardAttributeFilter } from "../../../../filterBar/attributeFilter/DefaultDashboardAttributeFilter.js";
|
|
8
12
|
import { AutomationAttributeFilterProvider, useAutomationAttributeFilterContext, } from "./AutomationAttributeFilterContext.js";
|
|
9
13
|
export function AutomationAttributeFilter({ filter, onChange, onDelete, isLocked, displayAsLabel, overlayPositionType, readonly, tabId, }) {
|
|
@@ -15,10 +19,20 @@ export function AutomationAttributeFilter({ filter, onChange, onDelete, isLocked
|
|
|
15
19
|
}
|
|
16
20
|
function AttributeFilterWrapper({ displayAsLabel, overlayPositionType, readonly, tabId, }) {
|
|
17
21
|
const { onChange, filter } = useAutomationAttributeFilterContext();
|
|
22
|
+
const { AttributeFilterComponentSet } = useDashboardComponentsContext();
|
|
23
|
+
const supportElementUris = useBackendStrict().capabilities.supportsElementUris ?? false;
|
|
18
24
|
const handleFilterChanged = useCallback((newFilter) => {
|
|
19
25
|
onChange(newFilter);
|
|
20
26
|
}, [onChange]);
|
|
21
|
-
|
|
27
|
+
const filterToUse = useMemo(() => {
|
|
28
|
+
if (supportElementUris || !isDashboardAttributeFilter(filter)) {
|
|
29
|
+
return filter;
|
|
30
|
+
}
|
|
31
|
+
return convertDashboardAttributeFilterElementsUrisToValues(filter);
|
|
32
|
+
}, [filter, supportElementUris]);
|
|
33
|
+
// Mirrors the resolution in filterBar/filterBar/DefaultFilterBarItem.tsx
|
|
34
|
+
const DashboardAttributeFilter = AttributeFilterComponentSet?.MainComponentProvider(filterToUse) ?? DefaultDashboardAttributeFilter;
|
|
35
|
+
return (_jsx(DashboardAttributeFilter, { filter: filterToUse, onFilterChanged: handleFilterChanged, displayAsLabel: displayAsLabel, AttributeFilterComponent: AttributeFilter, overlayPositionType: overlayPositionType, readonly: readonly, tabId: tabId }));
|
|
22
36
|
}
|
|
23
37
|
function AttributeFilter(props) {
|
|
24
38
|
return (_jsx(AttributeFilterButton, { ...props, LoadingComponent: AutomationAttributeFilterLoadingComponent, DropdownButtonComponent: AutomationAttributeFilterDropdownButtonComponent }));
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AutomationFiltersSelect.d.ts","sourceRoot":"","sources":["../../../../../../src/presentation/automations/shared/automationFilters/components/AutomationFiltersSelect.tsx"],"names":[],"mappings":"AAMA,OAAO,EACH,KAAK,iBAAiB,EACtB,KAAK,iBAAiB,EACtB,KAAK,mBAAmB,EAGxB,KAAK,+BAA+B,EACpC,KAAK,8BAA8B,EAEnC,KAAK,aAAa,EAClB,KAAK,MAAM,EACX,KAAK,cAAc,EAYtB,MAAM,qBAAqB,CAAC;AAC7B,OAAO,EAGH,KAAK,mBAAmB,EAO3B,MAAM,sBAAsB,CAAC;AAE9B,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,+CAA+C,CAAC;AAU3F,OAAO,EAAE,KAAK,oBAAoB,EAAE,MAAM,4BAA4B,CAAC;
|
|
1
|
+
{"version":3,"file":"AutomationFiltersSelect.d.ts","sourceRoot":"","sources":["../../../../../../src/presentation/automations/shared/automationFilters/components/AutomationFiltersSelect.tsx"],"names":[],"mappings":"AAMA,OAAO,EACH,KAAK,iBAAiB,EACtB,KAAK,iBAAiB,EACtB,KAAK,mBAAmB,EAGxB,KAAK,+BAA+B,EACpC,KAAK,8BAA8B,EAEnC,KAAK,aAAa,EAClB,KAAK,MAAM,EACX,KAAK,cAAc,EAYtB,MAAM,qBAAqB,CAAC;AAC7B,OAAO,EAGH,KAAK,mBAAmB,EAO3B,MAAM,sBAAsB,CAAC;AAE9B,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,+CAA+C,CAAC;AAU3F,OAAO,EAAE,KAAK,oBAAoB,EAAE,MAAM,4BAA4B,CAAC;AAYvE,MAAM,WAAW,uBAAuB;IACpC,EAAE,CAAC,EAAE,MAAM,CAAC;IACZ,OAAO,EAAE,iBAAiB,EAAE,GAAG,SAAS,CAAC;IACzC,gBAAgB,EAAE,+BAA+B,EAAE,CAAC;IACpD,WAAW,EAAE,8BAA8B,EAAE,CAAC;IAC9C,UAAU,EAAE,iBAAiB,EAAE,CAAC;IAChC,YAAY,EAAE,mBAAmB,EAAE,CAAC;IACpC,kBAAkB,EAAE,CAAC,MAAM,EAAE,iBAAiB,GAAG,SAAS,KAAK,IAAI,CAAC;IACpE,kBAAkB,EAAE,CAAC,MAAM,EAAE,iBAAiB,KAAK,IAAI,CAAC;IACxD,eAAe,EAAE,CACb,WAAW,EAAE,MAAM,EACnB,UAAU,EAAE,iBAAiB,EAAE,EAC/B,YAAY,EAAE,mBAAmB,EAAE,KAClC,IAAI,CAAC;IACV,YAAY,EAAE,OAAO,CAAC;IACtB,wBAAwB,EAAE,CAAC,KAAK,EAAE,OAAO,KAAK,IAAI,CAAC;IACnD,qBAAqB,CAAC,EAAE,OAAO,CAAC;IAChC,iBAAiB,CAAC,EAAE,OAAO,CAAC;CAC/B;AAED,MAAM,WA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AAG,EAAE,aAAa,KAAK,IAAI,CAAC;IACjD;;OAEG;IACH,eAAe,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,oBAAoB,EAAE,CAAC,CAAC;IACzD;;OAEG;IACH,wBAAwB,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,oBAAoB,EAAE,CAAC,CAAC;IAClE;;OAEG;IACH,mBAAmB,CAAC,EAAE,CAAC,KAAK,EAAE,MAAM,EAAE,GAAG,EAAE,aAAa,KAAK,IAAI,CAAC;IAClE;;OAEG;IACH,sBAAsB,CAAC,EAAE,CAAC,KAAK,EAAE,MAAM,EAAE,GAAG,EAAE,aAAa,EAAE,KAAK,EAAE,cAAc,KAAK,IAAI,CAAC;IAC5F;;OAEG;IACH,sBAAsB,CAAC,EAAE,CAAC,KAAK,EAAE,MAAM,EAAE,GAAG,EAAE,aAAa,KAAK,IAAI,CAAC;IACrE;;OAEG;IACH,iBAAiB,CAAC,EAAE,OAAO,CAAC;CAC/B;AA2ED,wBAAgB,uBAAuB,CAAC,EACpC,gBAAqB,EACrB,eAAoB,EACpB,eAAe,EACf,qBAAqB,EACrB,YAAY,EACZ,oBAAoB,EACpB,iBAAiB,EACjB,mBAAmB,EACnB,SAAiB,EACjB,cAAsB,EACtB,kBAA0B,EAC1B,YAAY,EACZ,kBAAkB,EAClB,oBAAoB,EACpB,UAAe,EACf,mBAAwB,EACxB,cAAc,EACd,iBAAiB,EACjB,iBAAiB,EACjB,eAAe,EACf,wBAAwB,EACxB,mBAAmB,EACnB,sBAAsB,EACtB,sBAAsB,EACtB,iBAAiB,GACpB,EAAE,6BAA6B,2CAwe/B"}
|
package/esm/presentation/automations/shared/automationFilters/components/AutomationFiltersSelect.js
CHANGED
|
@@ -12,6 +12,7 @@ import { AutomationAttributeFilter } from "./AutomationAttributeFilter.js";
|
|
|
12
12
|
import { AutomationDateFilter } from "./AutomationDateFilter.js";
|
|
13
13
|
import { AutomationMeasureValueFilter } from "./AutomationMeasureValueFilter.js";
|
|
14
14
|
import { AutomationParameter } from "./AutomationParameter.js";
|
|
15
|
+
import { AutomationRestrictedFilters } from "./AutomationRestrictedFilters.js";
|
|
15
16
|
const COLLAPSED_FILTERS_COUNT = 2;
|
|
16
17
|
function AutomationCheckboxOrNote({ isDashboardAutomation, storeFilters, handleStoreFiltersChange, handleKeyDown, automationFilterSelectTooltipId, parametersEnabled, }) {
|
|
17
18
|
const intl = useIntl();
|
|
@@ -51,6 +52,7 @@ export function AutomationFiltersSelect({ availableFilters = [], selectedFilters
|
|
|
51
52
|
const { commonDateFilterId, lockedFilters, attributeConfigs, dateConfigs, filterAnnouncement, filterGroupRef, makeFilterGroupUnfocusable, setAddFilterButtonRefs, } = shouldRenderByTab && tabFiltersData.processedFiltersByTab ? tabFiltersData : flatFiltersData;
|
|
52
53
|
const { focusAddFilterButton } = flatFiltersData;
|
|
53
54
|
const filters = shouldRenderByTab ? [] : flatFiltersData.visibleFilters;
|
|
55
|
+
const restrictedFilterCount = shouldRenderByTab ? 0 : flatFiltersData.restrictedFilterCount;
|
|
54
56
|
const visibleParameters = shouldRenderByTab ? [] : parameters;
|
|
55
57
|
const attributes = shouldRenderByTab ? [] : flatFiltersData.attributes;
|
|
56
58
|
const dateDatasets = shouldRenderByTab ? [] : flatFiltersData.dateDatasets;
|
|
@@ -69,7 +71,7 @@ export function AutomationFiltersSelect({ availableFilters = [], selectedFilters
|
|
|
69
71
|
: flatFiltersData.handleStoreFiltersChange;
|
|
70
72
|
const intl = useIntl();
|
|
71
73
|
const [isExpanded, setIsExpanded] = useState(showAllFilters);
|
|
72
|
-
const chipCount = filters.length + visibleParameters.length;
|
|
74
|
+
const chipCount = filters.length + visibleParameters.length + (restrictedFilterCount > 0 ? 1 : 0);
|
|
73
75
|
const isExpandable = !showAllFilters && chipCount > COLLAPSED_FILTERS_COUNT;
|
|
74
76
|
const handleKeyDown = (e) => {
|
|
75
77
|
if (isActionKey(e)) {
|
|
@@ -83,7 +85,9 @@ export function AutomationFiltersSelect({ availableFilters = [], selectedFilters
|
|
|
83
85
|
ref: parameter.ref,
|
|
84
86
|
title: parameter.title,
|
|
85
87
|
}));
|
|
86
|
-
|
|
88
|
+
// Counting availableFilters would overcount: it keeps the restricted filters, which the dropdown
|
|
89
|
+
// never offers, so the button would stay enabled over an empty dropdown.
|
|
90
|
+
const isAddButtonDisabled = !flatFiltersData.hasFiltersToAdd && availableParameters.length === 0;
|
|
87
91
|
const tooltipTextValues = {
|
|
88
92
|
add: intl.formatMessage({ id: "dialogs.automation.filters.add" }),
|
|
89
93
|
addDisabled: intl.formatMessage({ id: "dialogs.automation.filters.addDisabled" }),
|
|
@@ -104,9 +108,6 @@ export function AutomationFiltersSelect({ availableFilters = [], selectedFilters
|
|
|
104
108
|
}),
|
|
105
109
|
iconAriaHidden: true,
|
|
106
110
|
} }), _jsx(Bubble, { className: "bubble-primary", alignPoints: [{ align: "bc tc" }], children: isExpanded ? (_jsx(FormattedMessage, { id: "dialogs.automation.filters.showLess" })) : (_jsx(FormattedMessage, { id: "dialogs.automation.filters.showAll" })) })] })) : (_jsx(FormattedMessage, { id: "dialogs.schedule.email.filters", values: { count: chipCount } })) })), _jsxs("div", { className: "gd-automation-filters", children: [showAllFilters ? (_jsxs(_Fragment, { children: [_jsx(AutomationCheckboxOrNote, { isDashboardAutomation: isDashboardAutomation, storeFilters: storeFilters, handleStoreFiltersChange: handleStoreFiltersChange, handleKeyDown: handleKeyDown, automationFilterSelectTooltipId: automationFilterSelectTooltipId, parametersEnabled: parametersEnabled }), _jsx(Divider, {})] })) : null, _jsxs("div", { className: `gd-automation-filters__wrapper${storeFilters || !isDashboardAutomation ? "" : " gd-automation-filters__wrapper--disabled"}`, children: [disableFilters ? _jsx("div", { className: "gd-automation-filters__overlay" }) : null, shouldRenderByTab && tabFiltersData.processedFiltersByTab ? (_jsx("div", { className: "gd-automation-filters__list gd-automation-filters__list--tabbed", role: "group", "aria-labelledby": AUTOMATION_FILTERS_GROUP_LABEL_ID, ref: filterGroupRef, onBlur: makeFilterGroupUnfocusable, children: tabFiltersData.processedFiltersByTab.map((tab, index) => {
|
|
107
|
-
// Check if all filters for this tab are already selected
|
|
108
|
-
const tabEditedFilters = editedFiltersByTab?.[tab.tabId] ?? [];
|
|
109
|
-
const tabAvailableFilters = filtersByTab?.find((t) => t.tabId === tab.tabId)?.availableFilters ?? [];
|
|
110
111
|
const tabParameters = parametersByTab?.[tab.tabId] ?? [];
|
|
111
112
|
const tabAvailableParameters = availableParametersByTab?.[tab.tabId] ?? [];
|
|
112
113
|
const tabParameterDropdownItems = tabAvailableParameters.map((parameter) => ({
|
|
@@ -114,12 +115,11 @@ export function AutomationFiltersSelect({ availableFilters = [], selectedFilters
|
|
|
114
115
|
ref: parameter.ref,
|
|
115
116
|
title: parameter.title,
|
|
116
117
|
}));
|
|
117
|
-
const isTabAddButtonDisabled =
|
|
118
|
-
tabAvailableParameters.length === 0;
|
|
118
|
+
const isTabAddButtonDisabled = !tab.hasFiltersToAdd && tabAvailableParameters.length === 0;
|
|
119
119
|
const tabTooltipText = isTabAddButtonDisabled
|
|
120
120
|
? tooltipTextValues.addDisabled
|
|
121
121
|
: tooltipTextValues.add;
|
|
122
|
-
return (_jsx(AutomationFiltersTabSection, { tabTitle: tab.tabTitle, tabId: tab.tabId, canAddItems: !isTabAddButtonDisabled, filters: tab.visibleFilters, attributeConfigs: tab.attributeConfigs, commonDateFilterId: commonDateFilterId, lockedFilters: tab.lockedFilters, onChange: (filter) => tabFiltersData.handleTabFilterChange(tab.tabId, filter), onDelete: (filter) => tabFiltersData.handleTabFilterDelete(tab.tabId, filter), parameters: tabParameters, onParameterChange: (ref, value) => {
|
|
122
|
+
return (_jsx(AutomationFiltersTabSection, { tabTitle: tab.tabTitle, tabId: tab.tabId, canAddItems: !isTabAddButtonDisabled, filters: tab.visibleFilters, restrictedFilterCount: tab.restrictedFilterCount, onRestrictedFiltersRemove: () => tabFiltersData.handleTabRestrictedFiltersRemove(tab.tabId), attributeConfigs: tab.attributeConfigs, commonDateFilterId: commonDateFilterId, lockedFilters: tab.lockedFilters, onChange: (filter) => tabFiltersData.handleTabFilterChange(tab.tabId, filter), onDelete: (filter) => tabFiltersData.handleTabFilterDelete(tab.tabId, filter), parameters: tabParameters, onParameterChange: (ref, value) => {
|
|
123
123
|
announceParameterChanged(tabParameters, ref, value);
|
|
124
124
|
onParameterChangeByTab?.(tab.tabId, ref, value);
|
|
125
125
|
}, onParameterDelete: (ref) => {
|
|
@@ -148,6 +148,11 @@ export function AutomationFiltersSelect({ availableFilters = [], selectedFilters
|
|
|
148
148
|
ariaHaspopup: "dialog",
|
|
149
149
|
} }) }) })), DropdownTitleComponent: () => (_jsx("div", { className: "gd-automation-filters__dropdown-header", children: _jsx(Typography, { tagName: "h3", id: AUTOMATION_FILTERS_DIALOG_TITLE_ID, children: _jsx(FormattedMessage, { id: "dialogs.automation.filters.title" }) }) })), renderNoData: () => (_jsx("div", { className: "gd-automation-filters__dropdown-no-filters", children: _jsx(FormattedMessage, { id: "dialogs.automation.filters.noFilters" }) })) }) }, tab.tabId));
|
|
150
150
|
}) })) : (_jsxs("div", { className: "gd-automation-filters__list", role: "group", "aria-labelledby": AUTOMATION_FILTERS_GROUP_LABEL_ID, ref: filterGroupRef, onBlur: makeFilterGroupUnfocusable, children: [[
|
|
151
|
+
...(restrictedFilterCount > 0
|
|
152
|
+
? [
|
|
153
|
+
_jsx(AutomationRestrictedFilters, { count: restrictedFilterCount, onRemove: flatFiltersData.handleRemoveRestrictedFilters, isReadOnly: disableFilters }, "restricted-filters"),
|
|
154
|
+
]
|
|
155
|
+
: []),
|
|
151
156
|
...filters.map((filter) => {
|
|
152
157
|
const isCommonDateFilter = isDashboardCommonDateFilter(filter) ||
|
|
153
158
|
(isDashboardDateFilter(filter) &&
|
|
@@ -211,17 +216,17 @@ function AutomationFilter({ filter, attributeConfigs, onChange, onDelete, isComm
|
|
|
211
216
|
* Renders filters for a single tab with a tab title header.
|
|
212
217
|
* Used when displaying filters grouped by tab for whole dashboard automations.
|
|
213
218
|
*/
|
|
214
|
-
function AutomationFiltersTabSection({ tabId, tabTitle, filters, attributeConfigs, commonDateFilterId, lockedFilters, onChange, onDelete, parameters, onParameterChange, onParameterDelete, overlayPositionType, showDivider = false, addFilterButton, canAddItems, readonlyFilters, }) {
|
|
219
|
+
function AutomationFiltersTabSection({ tabId, tabTitle, filters, attributeConfigs, commonDateFilterId, lockedFilters, restrictedFilterCount, onRestrictedFiltersRemove, onChange, onDelete, parameters, onParameterChange, onParameterDelete, overlayPositionType, showDivider = false, addFilterButton, canAddItems, readonlyFilters, }) {
|
|
215
220
|
const intl = useIntl();
|
|
216
221
|
const tabSectionLabelId = useIdPrefixed(`automation-filters-tab-${tabId}`);
|
|
217
222
|
// Display tab title or fallback to generic "Tab" label
|
|
218
223
|
const displayTitle = tabTitle || intl.formatMessage({ id: "dialogs.automation.filters.tab.untitled" });
|
|
219
224
|
const tabLabel = intl.formatMessage({ id: "dialogs.automation.filters.tab.label" });
|
|
220
|
-
if (filters.length === 0 && parameters.length === 0 && !canAddItems) {
|
|
225
|
+
if (filters.length === 0 && parameters.length === 0 && restrictedFilterCount === 0 && !canAddItems) {
|
|
221
226
|
return null;
|
|
222
227
|
}
|
|
223
228
|
const content = (_jsx("span", { className: "gd-automation-filters__tab-title s-automation-filters-tab-title", children: displayTitle }));
|
|
224
|
-
return (_jsxs(_Fragment, { children: [_jsxs("div", { className: "gd-automation-filters__tab-section s-automation-filters-tab-section", role: "group", "aria-labelledby": tabSectionLabelId, children: [_jsxs("div", { className: "gd-automation-filters__tab-header", children: [_jsx("span", { className: "gd-automation-filters__tab-label", children: tabLabel }), _jsx(UiTooltip, { content: content, triggerBy: ["hover", "focus"], optimalPlacement: true, anchor: _jsx("span", { className: "gd-automation-filters__tab-title s-automation-filters-tab-title", id: tabSectionLabelId, children: displayTitle }) })] }), _jsxs("div", { className: "gd-automation-filters__tab-filters", children: [filters.map((filter) => {
|
|
229
|
+
return (_jsxs(_Fragment, { children: [_jsxs("div", { className: "gd-automation-filters__tab-section s-automation-filters-tab-section", role: "group", "aria-labelledby": tabSectionLabelId, children: [_jsxs("div", { className: "gd-automation-filters__tab-header", children: [_jsx("span", { className: "gd-automation-filters__tab-label", children: tabLabel }), _jsx(UiTooltip, { content: content, triggerBy: ["hover", "focus"], optimalPlacement: true, anchor: _jsx("span", { className: "gd-automation-filters__tab-title s-automation-filters-tab-title", id: tabSectionLabelId, children: displayTitle }) })] }), _jsxs("div", { className: "gd-automation-filters__tab-filters", children: [restrictedFilterCount > 0 ? (_jsx(AutomationRestrictedFilters, { count: restrictedFilterCount, onRemove: onRestrictedFiltersRemove, isReadOnly: readonlyFilters })) : null, filters.map((filter) => {
|
|
225
230
|
const isCommonDateFilter = isDashboardCommonDateFilter(filter) ||
|
|
226
231
|
(isDashboardDateFilter(filter) &&
|
|
227
232
|
commonDateFilterId === filter.dateFilter.localIdentifier);
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Stands in for the automation filters the current user may not read, without naming them.
|
|
3
|
+
*/
|
|
4
|
+
export declare function AutomationRestrictedFilters({ count, onRemove, isReadOnly, }: {
|
|
5
|
+
count: number;
|
|
6
|
+
onRemove: () => void;
|
|
7
|
+
isReadOnly?: boolean;
|
|
8
|
+
}): import("react/jsx-runtime").JSX.Element;
|
|
9
|
+
//# sourceMappingURL=AutomationRestrictedFilters.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"AutomationRestrictedFilters.d.ts","sourceRoot":"","sources":["../../../../../../src/presentation/automations/shared/automationFilters/components/AutomationRestrictedFilters.tsx"],"names":[],"mappings":"AAWA;;GAEG;AACH,wBAAgB,2BAA2B,CAAC,EACxC,KAAK,EACL,QAAQ,EACR,UAAU,GACb,EAAE;IACC,KAAK,EAAE,MAAM,CAAC;IACd,QAAQ,EAAE,MAAM,IAAI,CAAC;IACrB,UAAU,CAAC,EAAE,OAAO,CAAC;CACxB,2CA8CA"}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { useIntl } from "react-intl";
|
|
3
|
+
import { UiChip, UiTooltip, useIdPrefixed } from "@gooddata/sdk-ui-kit";
|
|
4
|
+
const CHIP_ANCHOR_STYLES = { display: "flex", width: "100%", height: "100%", minWidth: 0 };
|
|
5
|
+
const DELETE_ANCHOR_STYLES = { height: "100%" };
|
|
6
|
+
/**
|
|
7
|
+
* Stands in for the automation filters the current user may not read, without naming them.
|
|
8
|
+
*/
|
|
9
|
+
export function AutomationRestrictedFilters({ count, onRemove, isReadOnly, }) {
|
|
10
|
+
const intl = useIntl();
|
|
11
|
+
const tooltipId = useIdPrefixed("automation-restricted-filters-tooltip");
|
|
12
|
+
const label = intl.formatMessage({ id: "filterBar.restrictedFilters" }, { count });
|
|
13
|
+
const reason = intl.formatMessage({ id: "filterBar.restrictedFilters.reason" }, { count });
|
|
14
|
+
const deleteTooltip = intl.formatMessage({ id: "dialogs.automation.filters.restricted.deleteTooltip" }, { count });
|
|
15
|
+
return (_jsx(UiChip, { label: label,
|
|
16
|
+
// the entry has nothing to open; isLocked also renders the lock icon
|
|
17
|
+
isLocked: true, isExpandable: false, isDeletable: !isReadOnly, onDelete: onRemove, dataTestId: "automation-restricted-filters", accessibilityConfig: {
|
|
18
|
+
ariaLabel: `${label} ${reason}`,
|
|
19
|
+
deleteAriaLabel: deleteTooltip,
|
|
20
|
+
deleteAriaDescribedBy: tooltipId,
|
|
21
|
+
}, renderChipContent: (content) => (_jsx(UiTooltip, { id: tooltipId, arrowPlacement: "top-start", content: reason, triggerBy: ["hover", "focus"], anchor: content, anchorWrapperStyles: CHIP_ANCHOR_STYLES })), renderActionButton: (button) => (_jsx(UiTooltip, { arrowPlacement: "top-start", content: deleteTooltip, triggerBy: ["hover", "focus"], anchor: button, anchorWrapperStyles: DELETE_ANCHOR_STYLES })) }));
|
|
22
|
+
}
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { type FilterContextItem, type IAutomationMetadataObject, type IAutomationVisibleFilter } from "@gooddata/sdk-model";
|
|
2
2
|
import { type ExtendedDashboardWidget } from "../../../../../model/types/layoutTypes.js";
|
|
3
|
-
export declare function useDefaultSelectedFiltersForExistingAutomation(automationToEdit?: IAutomationMetadataObject, availableVisibleFilters?: IAutomationVisibleFilter[], widget?: ExtendedDashboardWidget):
|
|
3
|
+
export declare function useDefaultSelectedFiltersForExistingAutomation(automationToEdit?: IAutomationMetadataObject, availableVisibleFilters?: IAutomationVisibleFilter[], widget?: ExtendedDashboardWidget): FilterContextItem[];
|
|
4
4
|
/**
|
|
5
5
|
* Reconstructs filters per tab from saved visibleFiltersByTab and filtersByTab.
|
|
6
6
|
* Applies the same matching logic as getDefaultSelectedFiltersByVisibleFilters to each tab.
|
|
7
7
|
*
|
|
8
8
|
* @internal
|
|
9
9
|
*/
|
|
10
|
-
export declare function getDefaultSelectedFiltersByTabForExistingAutomation(automationToEdit: IAutomationMetadataObject | undefined, availableDashboardFiltersByTab?: Record<string, FilterContextItem[]>, commonDateFilterId?: string): Record<string, FilterContextItem[]> | undefined;
|
|
10
|
+
export declare function getDefaultSelectedFiltersByTabForExistingAutomation(automationToEdit: IAutomationMetadataObject | undefined, availableDashboardFiltersByTab?: Record<string, FilterContextItem[]>, commonDateFilterId?: string, isFilterRestricted?: (filter: FilterContextItem) => boolean): Record<string, FilterContextItem[]> | undefined;
|
|
11
11
|
//# sourceMappingURL=useDefaultSelectedFiltersForExistingAutomation.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useDefaultSelectedFiltersForExistingAutomation.d.ts","sourceRoot":"","sources":["../../../../../../src/presentation/automations/shared/automationFilters/hooks/useDefaultSelectedFiltersForExistingAutomation.ts"],"names":[],"mappings":"AAIA,OAAO,EACH,KAAK,iBAAiB,EACtB,KAAK,yBAAyB,EAC9B,KAAK,wBAAwB,EAShC,MAAM,qBAAqB,CAAC;AAE7B,OAAO,EAAE,KAAK,uBAAuB,EAAE,MAAM,2CAA2C,CAAC;
|
|
1
|
+
{"version":3,"file":"useDefaultSelectedFiltersForExistingAutomation.d.ts","sourceRoot":"","sources":["../../../../../../src/presentation/automations/shared/automationFilters/hooks/useDefaultSelectedFiltersForExistingAutomation.ts"],"names":[],"mappings":"AAIA,OAAO,EACH,KAAK,iBAAiB,EACtB,KAAK,yBAAyB,EAC9B,KAAK,wBAAwB,EAShC,MAAM,qBAAqB,CAAC;AAE7B,OAAO,EAAE,KAAK,uBAAuB,EAAE,MAAM,2CAA2C,CAAC;AA6BzF,wBAAgB,8CAA8C,CAC1D,gBAAgB,CAAC,EAAE,yBAAyB,EAC5C,uBAAuB,CAAC,EAAE,wBAAwB,EAAE,EACpD,MAAM,CAAC,EAAE,uBAAuB,uBAkDnC;AAwED;;;;;GAKG;AACH,wBAAgB,mDAAmD,CAC/D,gBAAgB,EAAE,yBAAyB,GAAG,SAAS,EACvD,8BAA8B,GAAE,MAAM,CAAC,MAAM,EAAE,iBAAiB,EAAE,CAAM,EACxE,kBAAkB,CAAC,EAAE,MAAM,EAC3B,kBAAkB,GAAE,CAAC,MAAM,EAAE,iBAAiB,KAAK,OAAqB,GACzE,MAAM,CAAC,MAAM,EAAE,iBAAiB,EAAE,CAAC,GAAG,SAAS,CAyCjD"}
|
|
@@ -6,8 +6,17 @@ import { isDashboardFilter } from "../../../../../types.js";
|
|
|
6
6
|
import { useAutomationsContext } from "../../../contexts/AutomationsContext.js";
|
|
7
7
|
import { dashboardFilterToFilterContextItem } from "../../filters/index.js";
|
|
8
8
|
import { getAutomationAlertFilters, getAutomationDashboardFilters, getAutomationDashboardFiltersByTab, getAutomationVisualizationFilters, } from "../../utils/automationUtils.js";
|
|
9
|
+
/**
|
|
10
|
+
* Keeps the restricted filters the automation stores but the reconstruction above cannot find: one the
|
|
11
|
+
* author had already hidden when it was saved never got a visible-filter entry to match on.
|
|
12
|
+
*/
|
|
13
|
+
function withStoredRestrictedFilters(reconstructed, savedFilters, isFilterRestricted) {
|
|
14
|
+
const presentIds = new Set(reconstructed.map(dashboardFilterLocalIdentifier));
|
|
15
|
+
const missing = (savedFilters ?? []).filter((filter) => isFilterRestricted(filter) && !presentIds.has(dashboardFilterLocalIdentifier(filter)));
|
|
16
|
+
return missing.length > 0 ? [...reconstructed, ...missing] : reconstructed;
|
|
17
|
+
}
|
|
9
18
|
export function useDefaultSelectedFiltersForExistingAutomation(automationToEdit, availableVisibleFilters, widget) {
|
|
10
|
-
const { automationAvailableFilters: availableDashboardFilters, commonDateFilterId } = useAutomationsContext();
|
|
19
|
+
const { automationAvailableFilters: availableDashboardFilters, commonDateFilterId, isFilterRestricted, } = useAutomationsContext();
|
|
11
20
|
const savedWidgetAlertFilters = getAutomationAlertFilters(automationToEdit);
|
|
12
21
|
const { executionFilters: savedWidgetScheduleFilters, filterContextItems: savedWidgetScheduleFilterContextItems, } = getAutomationVisualizationFilters(automationToEdit);
|
|
13
22
|
const savedDashboardScheduleFilters = getAutomationDashboardFilters(automationToEdit);
|
|
@@ -30,7 +39,7 @@ export function useDefaultSelectedFiltersForExistingAutomation(automationToEdit,
|
|
|
30
39
|
]);
|
|
31
40
|
const availableWidgetFilters = removeIgnoredWidgetFilters(availableDashboardFilters, widget);
|
|
32
41
|
const savedVisibleFilters = automationToEdit?.metadata?.visibleFilters ?? [];
|
|
33
|
-
return getDefaultSelectedFiltersByVisibleFilters(savedVisibleFilters, availableWidgetFilters, savedFilterContextItems, commonDateFilterId);
|
|
42
|
+
return withStoredRestrictedFilters(getDefaultSelectedFiltersByVisibleFilters(savedVisibleFilters, availableWidgetFilters, savedFilterContextItems, commonDateFilterId), savedFilterContextItems, isFilterRestricted);
|
|
34
43
|
}
|
|
35
44
|
/**
|
|
36
45
|
* Reconstructs default filters selection for the AutomationFiltersSelect component from existing widget automation.
|
|
@@ -87,7 +96,7 @@ function getDefaultSelectedFiltersByVisibleFilters(savedVisibleFilters, availabl
|
|
|
87
96
|
*
|
|
88
97
|
* @internal
|
|
89
98
|
*/
|
|
90
|
-
export function getDefaultSelectedFiltersByTabForExistingAutomation(automationToEdit, availableDashboardFiltersByTab = {}, commonDateFilterId) {
|
|
99
|
+
export function getDefaultSelectedFiltersByTabForExistingAutomation(automationToEdit, availableDashboardFiltersByTab = {}, commonDateFilterId, isFilterRestricted = () => false) {
|
|
91
100
|
if (!automationToEdit) {
|
|
92
101
|
return undefined;
|
|
93
102
|
}
|
|
@@ -98,10 +107,13 @@ export function getDefaultSelectedFiltersByTabForExistingAutomation(automationTo
|
|
|
98
107
|
}
|
|
99
108
|
// If we have visibleFiltersByTab, use it to properly reconstruct filters
|
|
100
109
|
if (savedVisibleFiltersByTab) {
|
|
101
|
-
|
|
110
|
+
// A tab whose only stored filter was hidden has no visible-filter entries, so take the tab ids
|
|
111
|
+
// from both sides or that tab would be skipped entirely.
|
|
112
|
+
const tabIds = new Set([...Object.keys(savedVisibleFiltersByTab), ...Object.keys(savedFiltersByTab)]);
|
|
113
|
+
return [...tabIds].reduce((acc, tabId) => {
|
|
102
114
|
const availableFiltersForTab = availableDashboardFiltersByTab[tabId] ?? [];
|
|
103
115
|
const savedFiltersForTab = savedFiltersByTab[tabId] ?? [];
|
|
104
|
-
const reconstructedFilters = getDefaultSelectedFiltersByVisibleFilters(
|
|
116
|
+
const reconstructedFilters = withStoredRestrictedFilters(getDefaultSelectedFiltersByVisibleFilters(savedVisibleFiltersByTab[tabId] ?? [], availableFiltersForTab, savedFiltersForTab, commonDateFilterId), savedFiltersForTab, isFilterRestricted);
|
|
105
117
|
if (reconstructedFilters.length > 0) {
|
|
106
118
|
acc[tabId] = reconstructedFilters;
|
|
107
119
|
}
|
|
@@ -11,6 +11,10 @@ export interface IProcessedAutomationFiltersTab {
|
|
|
11
11
|
tabTitle: string;
|
|
12
12
|
/** Visible filters after applying hidden filter logic */
|
|
13
13
|
visibleFilters: FilterContextItem[];
|
|
14
|
+
/** How many of the tab's selected filters the user is forbidden to access */
|
|
15
|
+
restrictedFilterCount: number;
|
|
16
|
+
/** Whether the add-filter dropdown has anything left to offer */
|
|
17
|
+
hasFiltersToAdd: boolean;
|
|
14
18
|
/** Locked filters for this tab */
|
|
15
19
|
lockedFilters: FilterContextItem[];
|
|
16
20
|
/** Catalog attributes available for Add filter dropdown */
|
|
@@ -39,6 +43,9 @@ export declare const useAutomationFilters: ({ availableFilters, selectedFilters,
|
|
|
39
43
|
commonDateFilterId: string | undefined;
|
|
40
44
|
lockedFilters: FilterContextItem[];
|
|
41
45
|
visibleFilters: FilterContextItem[];
|
|
46
|
+
restrictedFilterCount: number;
|
|
47
|
+
hasFiltersToAdd: boolean;
|
|
48
|
+
handleRemoveRestrictedFilters: () => void;
|
|
42
49
|
attributes: ICatalogAttribute[];
|
|
43
50
|
dateDatasets: ICatalogDateDataset[];
|
|
44
51
|
measures: ICatalogMeasure[];
|
|
@@ -76,6 +83,7 @@ export declare const useAutomationFiltersByTab: ({ filtersByTab, editedFiltersBy
|
|
|
76
83
|
handleTabFilterChange: (tabId: string, updatedFilter: FilterContextItem | undefined) => void;
|
|
77
84
|
handleTabFilterDelete: (tabId: string, filterToDelete: FilterContextItem) => void;
|
|
78
85
|
handleTabFilterAdd: (tabId: string, displayForm: ObjRef, attributes: ICatalogAttribute[], dateDatasets: ICatalogDateDataset[]) => void;
|
|
86
|
+
handleTabRestrictedFiltersRemove: (tabId: string) => void;
|
|
79
87
|
handleStoreFiltersChange: (value: boolean) => void;
|
|
80
88
|
makeFilterGroupUnfocusable: () => void;
|
|
81
89
|
setAddFilterButtonRefs: (element: HTMLButtonElement | HTMLDivElement | null, dropdownButtonRef?: MutableRefObject<HTMLElement>) => void;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useAutomationFilters.d.ts","sourceRoot":"","sources":["../../../../../src/presentation/automations/shared/automationFilters/useAutomationFilters.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,KAAK,gBAAgB,EAA0C,MAAM,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"useAutomationFilters.d.ts","sourceRoot":"","sources":["../../../../../src/presentation/automations/shared/automationFilters/useAutomationFilters.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,KAAK,gBAAgB,EAA0C,MAAM,OAAO,CAAC;AAKtF,OAAO,EACH,KAAK,iBAAiB,EACtB,KAAK,iBAAiB,EACtB,KAAK,mBAAmB,EACxB,KAAK,eAAe,EACpB,KAAK,+BAA+B,EACpC,KAAK,8BAA8B,EAEnC,KAAK,MAAM,EACd,MAAM,qBAAqB,CAAC;AAE7B,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,4CAA4C,CAAC;AA0FxF;;GAEG;AACH,MAAM,WAAW,8BAA8B;IAC3C,2BAA2B;IAC3B,KAAK,EAAE,MAAM,CAAC;IACd,gBAAgB;IAChB,QAAQ,EAAE,MAAM,CAAC;IACjB,yDAAyD;IACzD,cAAc,EAAE,iBAAiB,EAAE,CAAC;IACpC,6EAA6E;IAC7E,qBAAqB,EAAE,MAAM,CAAC;IAC9B,iEAAiE;IACjE,eAAe,EAAE,OAAO,CAAC;IACzB,kCAAkC;IAClC,aAAa,EAAE,iBAAiB,EAAE,CAAC;IACnC,2DAA2D;IAC3D,UAAU,EAAE,iBAAiB,EAAE,CAAC;IAChC,8DAA8D;IAC9D,YAAY,EAAE,mBAAmB,EAAE,CAAC;IACpC,sFAAsF;IACtF,QAAQ,EAAE,eAAe,EAAE,CAAC;IAC5B,4DAA4D;IAC5D,kBAAkB,EAAE,iBAAiB,EAAE,CAAC;IACxC,4CAA4C;IAC5C,gBAAgB,EAAE,+BAA+B,EAAE,CAAC;IACpD,uCAAuC;IACvC,WAAW,EAAE,8BAA8B,EAAE,CAAC;CACjD;AAED;;GAEG;AACH,eAAO,MAAM,oBAAoB,sGAM9B;IACC,gBAAgB,EAAE,iBAAiB,EAAE,CAAC;IACtC,eAAe,EAAE,iBAAiB,EAAE,CAAC;IACrC,kBAAkB,CAAC,EAAE,OAAO,CAAC;IAC7B,eAAe,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