@gooddata/sdk-ui-dashboard 11.69.0-alpha.4 → 11.69.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/NOTICE +248 -49
- package/esm/__version.d.ts +1 -1
- package/esm/__version.d.ts.map +1 -1
- package/esm/__version.js +1 -1
- package/esm/_staging/automation/index.d.ts +2 -2
- package/esm/_staging/automation/index.d.ts.map +1 -1
- package/esm/model/commandHandlers/common/validateDrillToCustomUrlParams.d.ts.map +1 -1
- package/esm/model/commandHandlers/common/validateDrillToCustomUrlParams.js +4 -5
- package/esm/model/commandHandlers/dashboard/common/parameterHydration.d.ts +4 -4
- package/esm/model/commandHandlers/dashboard/common/parameterHydration.d.ts.map +1 -1
- package/esm/model/commandHandlers/dashboard/common/stateInitializers.d.ts +3 -3
- package/esm/model/commandHandlers/dashboard/common/stateInitializers.d.ts.map +1 -1
- package/esm/model/commandHandlers/dashboard/common/stateInitializers.js +3 -0
- package/esm/model/commandHandlers/dashboard/initializeDashboardHandler/loadDashboardParameters.d.ts +2 -2
- package/esm/model/commandHandlers/dashboard/initializeDashboardHandler/loadDashboardParameters.d.ts.map +1 -1
- package/esm/model/commandHandlers/dashboard/initializeDashboardHandler/loadDashboardParameters.js +4 -3
- package/esm/model/commandHandlers/dashboard/initializeDashboardHandler/resolveDashboardConfig.d.ts.map +1 -1
- package/esm/model/commandHandlers/dashboard/initializeDashboardHandler/resolveDashboardConfig.js +8 -1
- package/esm/model/commandHandlers/parameters/customUrlDrillParametersWorker.d.ts.map +1 -1
- package/esm/model/commandHandlers/parameters/customUrlDrillParametersWorker.js +12 -1
- package/esm/model/commandHandlers/parameters/parameterDependenciesWorker.d.ts.map +1 -1
- package/esm/model/commandHandlers/parameters/parameterDependenciesWorker.js +1 -10
- package/esm/model/commandHandlers/scheduledEmail/automationParametersRestore.d.ts +2 -2
- package/esm/model/commandHandlers/scheduledEmail/automationParametersRestore.d.ts.map +1 -1
- package/esm/model/store/_infra/unbatched.d.ts +6 -0
- package/esm/model/store/_infra/unbatched.d.ts.map +1 -0
- package/esm/model/store/_infra/unbatched.js +14 -0
- package/esm/model/store/catalog/catalogSelectors.d.ts +3 -3
- package/esm/model/store/catalog/catalogSelectors.d.ts.map +1 -1
- package/esm/model/store/catalog/catalogState.d.ts +2 -2
- package/esm/model/store/catalog/catalogState.d.ts.map +1 -1
- package/esm/model/store/meta/metaSelectors.d.ts +4 -3
- package/esm/model/store/meta/metaSelectors.d.ts.map +1 -1
- package/esm/model/store/meta/metaSelectors.js +19 -14
- package/esm/model/store/tabs/parameters/parametersHelpers.d.ts +27 -15
- package/esm/model/store/tabs/parameters/parametersHelpers.d.ts.map +1 -1
- package/esm/model/store/tabs/parameters/parametersHelpers.js +34 -0
- package/esm/model/store/tabs/parameters/parametersSelectors.d.ts +18 -7
- package/esm/model/store/tabs/parameters/parametersSelectors.d.ts.map +1 -1
- package/esm/model/store/tabs/parameters/parametersSelectors.js +15 -17
- package/esm/model/store/tabs/parameters/parametersState.d.ts +5 -1
- package/esm/model/store/tabs/parameters/parametersState.d.ts.map +1 -1
- package/esm/model/store/tabs/parameters/parametersState.js +9 -0
- package/esm/model/types/commonTypes.d.ts +7 -0
- package/esm/model/types/commonTypes.d.ts.map +1 -1
- package/esm/presentation/automations/contexts/AutomationsContext.d.ts +2 -2
- package/esm/presentation/automations/contexts/AutomationsContext.d.ts.map +1 -1
- package/esm/presentation/automations/shared/automationFilters/automationParameters.d.ts +7 -7
- package/esm/presentation/automations/shared/automationFilters/automationParameters.d.ts.map +1 -1
- package/esm/presentation/automations/shared/automationFilters/hooks/useValidateExistingAutomationFilters.d.ts +2 -2
- package/esm/presentation/automations/shared/automationFilters/hooks/useValidateExistingAutomationFilters.d.ts.map +1 -1
- package/esm/presentation/dashboard/components/DashboardContentScrollContainer.d.ts +17 -0
- package/esm/presentation/dashboard/components/DashboardContentScrollContainer.d.ts.map +1 -0
- package/esm/presentation/dashboard/components/DashboardContentScrollContainer.js +97 -0
- package/esm/presentation/dashboard/components/DashboardInner.d.ts.map +1 -1
- package/esm/presentation/dashboard/components/DashboardInner.js +22 -5
- package/esm/presentation/dragAndDrop/useDashboardDragScroll.d.ts +1 -1
- package/esm/presentation/dragAndDrop/useDashboardDragScroll.d.ts.map +1 -1
- package/esm/presentation/dragAndDrop/useDashboardDragScroll.js +72 -12
- package/esm/presentation/drill/DrillConfigPanel/DrillToUrl/CustomUrlEditor.js +12 -12
- package/esm/presentation/drill/DrillConfigPanel/DrillToUrl/CustomUrlEditorParameters.d.ts +1 -1
- package/esm/presentation/drill/DrillConfigPanel/DrillToUrl/CustomUrlEditorParameters.d.ts.map +1 -1
- package/esm/presentation/drill/DrillConfigPanel/DrillToUrl/CustomUrlEditorParameters.js +2 -2
- package/esm/presentation/drill/DrillConfigPanel/DrillToUrl/CustomUrlEditorParametersSections/ParameterParametersSection.d.ts +2 -2
- package/esm/presentation/drill/DrillConfigPanel/DrillToUrl/CustomUrlEditorParametersSections/ParameterParametersSection.d.ts.map +1 -1
- package/esm/presentation/drill/DrillConfigPanel/DrillToUrl/CustomUrlEditorParametersSections/ParameterParametersSection.js +2 -2
- package/esm/presentation/drill/DrillSelect/WithDrillSelect.d.ts.map +1 -1
- package/esm/presentation/drill/DrillSelect/WithDrillSelect.js +12 -2
- package/esm/presentation/flexibleLayout/dragAndDrop/DragLayer.d.ts +10 -1
- package/esm/presentation/flexibleLayout/dragAndDrop/DragLayer.d.ts.map +1 -1
- package/esm/presentation/flexibleLayout/dragAndDrop/DragLayer.js +20 -8
- package/esm/presentation/flexibleLayout/dragAndDrop/Resize/BulletsBar.d.ts.map +1 -1
- package/esm/presentation/flexibleLayout/dragAndDrop/Resize/BulletsBar.js +5 -1
- package/esm/presentation/localization/bundles/de-DE.localization-bundle.d.ts +1 -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 +1 -0
- package/esm/presentation/localization/bundles/en-AU.localization-bundle.d.ts +1 -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 +1 -0
- package/esm/presentation/localization/bundles/en-GB.localization-bundle.d.ts +1 -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 +1 -0
- package/esm/presentation/localization/bundles/en-US.localization-bundle.d.ts +8 -0
- package/esm/presentation/localization/bundles/en-US.localization-bundle.d.ts.map +1 -1
- package/esm/presentation/localization/bundles/en-US.localization-bundle.js +8 -0
- package/esm/presentation/localization/bundles/es-419.localization-bundle.d.ts +1 -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 +1 -0
- package/esm/presentation/localization/bundles/es-ES.localization-bundle.d.ts +1 -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 +1 -0
- package/esm/presentation/localization/bundles/fi-FI.localization-bundle.d.ts +1 -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 +1 -0
- package/esm/presentation/localization/bundles/fr-CA.localization-bundle.d.ts +1 -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 +1 -0
- package/esm/presentation/localization/bundles/fr-FR.localization-bundle.d.ts +1 -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 +1 -0
- package/esm/presentation/localization/bundles/id-ID.localization-bundle.d.ts +1 -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 +1 -0
- package/esm/presentation/localization/bundles/it-IT.localization-bundle.d.ts +1 -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 +1 -0
- package/esm/presentation/localization/bundles/ja-JP.localization-bundle.d.ts +1 -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 +1 -0
- package/esm/presentation/localization/bundles/ko-KR.localization-bundle.d.ts +1 -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 +1 -0
- package/esm/presentation/localization/bundles/nl-NL.localization-bundle.d.ts +1 -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 +1 -0
- package/esm/presentation/localization/bundles/pl-PL.localization-bundle.d.ts +1 -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 +1 -0
- package/esm/presentation/localization/bundles/pt-BR.localization-bundle.d.ts +1 -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 +1 -0
- package/esm/presentation/localization/bundles/pt-PT.localization-bundle.d.ts +1 -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 +1 -0
- package/esm/presentation/localization/bundles/ru-RU.localization-bundle.d.ts +1 -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 +1 -0
- package/esm/presentation/localization/bundles/sl-SI.localization-bundle.d.ts +1 -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 +1 -0
- package/esm/presentation/localization/bundles/th-TH.localization-bundle.d.ts +1 -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 +1 -0
- package/esm/presentation/localization/bundles/tr-TR.localization-bundle.d.ts +1 -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 +1 -0
- package/esm/presentation/localization/bundles/uk-UA.localization-bundle.d.ts +1 -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 +1 -0
- package/esm/presentation/localization/bundles/vi-VN.localization-bundle.d.ts +1 -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 +1 -0
- package/esm/presentation/localization/bundles/zh-HK.localization-bundle.d.ts +1 -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 +1 -0
- package/esm/presentation/localization/bundles/zh-Hans.localization-bundle.d.ts +1 -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 +1 -0
- package/esm/presentation/localization/bundles/zh-Hant.localization-bundle.d.ts +1 -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 +1 -0
- package/esm/presentation/saveAs/DefaultSaveAsDialog/SaveAsDialogRenderer.d.ts +6 -2
- package/esm/presentation/saveAs/DefaultSaveAsDialog/SaveAsDialogRenderer.d.ts.map +1 -1
- package/esm/presentation/saveAs/DefaultSaveAsDialog/SaveAsDialogRenderer.js +28 -3
- package/esm/presentation/saveAs/DefaultSaveAsDialog/index.d.ts.map +1 -1
- package/esm/presentation/saveAs/DefaultSaveAsDialog/index.js +19 -5
- package/esm/presentation/saveAs/DefaultSaveAsDialog/useSaveAs.d.ts +1 -1
- package/esm/presentation/saveAs/DefaultSaveAsDialog/useSaveAs.d.ts.map +1 -1
- package/esm/presentation/widget/insight/ViewModeDashboardInsight/DashboardInsightWithDrillDialog.d.ts.map +1 -1
- package/esm/presentation/widget/insight/ViewModeDashboardInsight/DashboardInsightWithDrillDialog.js +3 -1
- package/esm/presentation/widget/insight/configuration/DrillFilters/TargetDashboardFiltersContext.d.ts +2 -1
- package/esm/presentation/widget/insight/configuration/DrillFilters/TargetDashboardFiltersContext.d.ts.map +1 -1
- package/esm/presentation/widget/insight/configuration/DrillFilters/TargetDashboardFiltersContext.js +3 -0
- package/esm/presentation/widget/insight/configuration/DrillFilters/messages.d.ts +3 -0
- package/esm/presentation/widget/insight/configuration/DrillFilters/messages.d.ts.map +1 -1
- package/esm/presentation/widget/insight/configuration/DrillFilters/messages.js +3 -0
- package/esm/presentation/widget/insight/configuration/DrillFilters/useDrillFiltersConfig.d.ts.map +1 -1
- package/esm/presentation/widget/insight/configuration/DrillFilters/useDrillFiltersConfig.js +2 -2
- package/esm/presentation/widget/insight/configuration/DrillFilters/useDrillParameterOptions.d.ts +2 -2
- package/esm/presentation/widget/insight/configuration/DrillFilters/useDrillParameterOptions.d.ts.map +1 -1
- package/esm/presentation/widget/insight/configuration/DrillFilters/useDrillParameterOptions.js +18 -20
- package/esm/presentation/widget/insight/configuration/DrillFilters/useFetchTargetDashboardFilters.d.ts +2 -1
- package/esm/presentation/widget/insight/configuration/DrillFilters/useFetchTargetDashboardFilters.d.ts.map +1 -1
- package/esm/presentation/widget/insight/configuration/DrillFilters/useFetchTargetDashboardFilters.js +7 -0
- package/esm/presentation/widget/insight/configuration/DrillTargets/useInvalidFilteringParametersIdentifiers.d.ts +1 -1
- package/esm/presentation/widget/insight/configuration/DrillTargets/useInvalidFilteringParametersIdentifiers.d.ts.map +1 -1
- package/esm/presentation/widget/insight/configuration/DrillTargets/useInvalidFilteringParametersIdentifiers.js +3 -3
- package/esm/presentation/widget/insightMenu/DefaultDashboardInsightMenu/DashboardInsightMenu/CustomUiMenuComponents.d.ts +4 -0
- package/esm/presentation/widget/insightMenu/DefaultDashboardInsightMenu/DashboardInsightMenu/CustomUiMenuComponents.d.ts.map +1 -1
- package/esm/presentation/widget/insightMenu/DefaultDashboardInsightMenu/DashboardInsightMenu/CustomUiMenuComponents.js +2 -2
- package/esm/presentation/widget/insightMenu/DefaultDashboardInsightMenu/DashboardInsightMenu/DashboardInsightMenuItemButton.d.ts +5 -0
- package/esm/presentation/widget/insightMenu/DefaultDashboardInsightMenu/DashboardInsightMenu/DashboardInsightMenuItemButton.d.ts.map +1 -1
- package/esm/presentation/widget/insightMenu/DefaultDashboardInsightMenu/DashboardInsightMenu/DashboardInsightMenuItemButton.js +4 -4
- package/esm/presentation/widget/insightMenu/DefaultDashboardInsightMenu/DashboardInsightMenu/index.d.ts.map +1 -1
- package/esm/presentation/widget/insightMenu/DefaultDashboardInsightMenu/DashboardInsightMenu/index.js +17 -5
- package/esm/sdk-ui-dashboard.d.ts +17 -9
- package/package.json +24 -25
- package/styles/css/dashboard.css +40 -4
- package/styles/css/dashboard.css.map +1 -1
- package/styles/css/filterBar.css.map +1 -1
- package/styles/css/main.css +78 -8
- package/styles/css/main.css.map +1 -1
- package/styles/css/resizing.css +16 -0
- package/styles/css/resizing.css.map +1 -1
- package/styles/scss/_zIndexes.scss +3 -0
- package/styles/scss/dashboard.scss +50 -2
- package/styles/scss/resizing.scss +18 -1
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
2
|
// (C) 2019-2026 GoodData Corporation
|
|
3
|
-
import { useCallback } from "react";
|
|
3
|
+
import { useCallback, useState } from "react";
|
|
4
4
|
import { useToastMessage } from "@gooddata/sdk-ui-kit";
|
|
5
5
|
import { messages } from "../../../locales.js";
|
|
6
6
|
import { useDashboardDispatch, useDashboardSelector } from "../../../model/react/DashboardStoreProvider.js";
|
|
@@ -17,9 +17,9 @@ export function useSaveAsDialogProps() {
|
|
|
17
17
|
const closeSaveAsDialog = useCallback(() => dispatch(uiActions.closeSaveAsDialog()), [dispatch]);
|
|
18
18
|
const isSaveAsDialogOpen = useDashboardSelector(selectIsSaveAsDialogOpen);
|
|
19
19
|
const onSaveAsError = useCallback(() => {
|
|
20
|
-
|
|
20
|
+
// keep the dialog open so the user is not left in an unknown state and can retry or cancel
|
|
21
21
|
addError(messages.messagesDashboardSaveFailed, { id: "message_dashboard_save_failed" });
|
|
22
|
-
}, [
|
|
22
|
+
}, [addError]);
|
|
23
23
|
const onSaveAsSuccess = useCallback(() => {
|
|
24
24
|
closeSaveAsDialog();
|
|
25
25
|
addSuccess(messages.messagesDashboardSaveSuccess, { id: "message_dashboard_save_success" });
|
|
@@ -38,9 +38,23 @@ export function useSaveAsDialogProps() {
|
|
|
38
38
|
* @alpha
|
|
39
39
|
*/
|
|
40
40
|
export function DefaultSaveAsDialog({ onSubmit, onCancel, onError, isVisible, onSuccess, }) {
|
|
41
|
-
const
|
|
41
|
+
const [hasSaveError, setHasSaveError] = useState(false);
|
|
42
|
+
// the command handlers are bound once, so only the stable state setter is used here besides the props
|
|
43
|
+
const handleSubmitError = useCallback((error) => {
|
|
44
|
+
setHasSaveError(true);
|
|
45
|
+
onError?.(error);
|
|
46
|
+
}, [onError]);
|
|
47
|
+
const { locale, dashboardTitle, isKpiWidgetEnabled, isDashboardSaving, isDashboardLoaded, handleSaveAs, isInEditMode, } = useSaveAs({ onSubmit, onSubmitSuccess: onSuccess, onSubmitError: handleSubmitError });
|
|
48
|
+
const handleSubmit = useCallback((title, switchToCopy, useOriginalFilterContext) => {
|
|
49
|
+
setHasSaveError(false);
|
|
50
|
+
handleSaveAs(title, switchToCopy, useOriginalFilterContext);
|
|
51
|
+
}, [handleSaveAs]);
|
|
52
|
+
// forget the previous failure once the dialog is closed
|
|
53
|
+
if (!isVisible && hasSaveError) {
|
|
54
|
+
setHasSaveError(false);
|
|
55
|
+
}
|
|
42
56
|
if (!isVisible) {
|
|
43
57
|
return null;
|
|
44
58
|
}
|
|
45
|
-
return (_jsx(SaveAsDialogRenderer, { locale: locale, dashboardTitle: dashboardTitle, isKpiWidgetEnabled: isKpiWidgetEnabled, isDashboardLoaded: isDashboardLoaded, isDashboardSaving: isDashboardSaving, isInEditMode: isInEditMode, onSubmit:
|
|
59
|
+
return (_jsx(SaveAsDialogRenderer, { locale: locale, dashboardTitle: dashboardTitle, isKpiWidgetEnabled: isKpiWidgetEnabled, isDashboardLoaded: isDashboardLoaded, isDashboardSaving: isDashboardSaving, isInEditMode: isInEditMode, hasSaveError: hasSaveError, onSubmit: handleSubmit, onCancel: onCancel }));
|
|
46
60
|
}
|
|
@@ -15,7 +15,7 @@ interface IUseSaveAsResult {
|
|
|
15
15
|
*
|
|
16
16
|
* Default is false.
|
|
17
17
|
*/
|
|
18
|
-
handleSaveAs: (title: string, switchToCopy?: boolean) => void;
|
|
18
|
+
handleSaveAs: (title: string, switchToCopy?: boolean, useOriginalFilterContext?: boolean) => void;
|
|
19
19
|
/**
|
|
20
20
|
* Status of the save as operation.
|
|
21
21
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useSaveAs.d.ts","sourceRoot":"","sources":["../../../../src/presentation/saveAs/DefaultSaveAsDialog/useSaveAs.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,KAAK,UAAU,EAAE,MAAM,qBAAqB,CAAC;AACtD,OAAO,EAAE,KAAK,OAAO,EAAE,MAAM,kBAAkB,CAAC;AAKhD,OAAO,EACH,KAAK,uBAAuB,EAE/B,MAAM,uDAAuD,CAAC;AAO/D,UAAU,gBAAgB;IACtB,MAAM,EAAE,OAAO,CAAC;IAChB,cAAc,EAAE,MAAM,CAAC;IACvB,iBAAiB,EAAE,OAAO,CAAC;IAC3B,iBAAiB,EAAE,OAAO,CAAC;IAC3B,kBAAkB,EAAE,OAAO,CAAC;IAC5B,YAAY,EAAE,OAAO,CAAC;IAEtB;;;;;;OAMG;IACH,YAAY,EAAE,CAAC,KAAK,EAAE,MAAM,EAAE,YAAY,CAAC,EAAE,OAAO,KAAK,IAAI,CAAC;
|
|
1
|
+
{"version":3,"file":"useSaveAs.d.ts","sourceRoot":"","sources":["../../../../src/presentation/saveAs/DefaultSaveAsDialog/useSaveAs.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,KAAK,UAAU,EAAE,MAAM,qBAAqB,CAAC;AACtD,OAAO,EAAE,KAAK,OAAO,EAAE,MAAM,kBAAkB,CAAC;AAKhD,OAAO,EACH,KAAK,uBAAuB,EAE/B,MAAM,uDAAuD,CAAC;AAO/D,UAAU,gBAAgB;IACtB,MAAM,EAAE,OAAO,CAAC;IAChB,cAAc,EAAE,MAAM,CAAC;IACvB,iBAAiB,EAAE,OAAO,CAAC;IAC3B,iBAAiB,EAAE,OAAO,CAAC;IAC3B,kBAAkB,EAAE,OAAO,CAAC;IAC5B,YAAY,EAAE,OAAO,CAAC;IAEtB;;;;;;OAMG;IACH,YAAY,EAAE,CAAC,KAAK,EAAE,MAAM,EAAE,YAAY,CAAC,EAAE,OAAO,EAAE,wBAAwB,CAAC,EAAE,OAAO,KAAK,IAAI,CAAC;IAElG;;OAEG;IACH,YAAY,CAAC,EAAE,uBAAuB,CAAC;CAC1C;AAED;;GAEG;AACH,MAAM,WAAW,eAAe;IAC5B;;OAEG;IACH,QAAQ,CAAC,EAAE,CAAC,KAAK,EAAE,MAAM,EAAE,YAAY,CAAC,EAAE,OAAO,KAAK,IAAI,CAAC;IAE3D;;OAEG;IACH,eAAe,CAAC,EAAE,CAAC,SAAS,EAAE,UAAU,KAAK,IAAI,CAAC;IAElD;;OAEG;IACH,aAAa,CAAC,EAAE,CAAC,KAAK,EAAE,GAAG,KAAK,IAAI,CAAC;CACxC;AAED,eAAO,MAAM,SAAS,UAAW,eAAe,KAAG,gBA8ClD,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DashboardInsightWithDrillDialog.d.ts","sourceRoot":"","sources":["../../../../../src/presentation/widget/insight/ViewModeDashboardInsight/DashboardInsightWithDrillDialog.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAE,KAAK,YAAY,EAAkC,MAAM,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"DashboardInsightWithDrillDialog.d.ts","sourceRoot":"","sources":["../../../../../src/presentation/widget/insight/ViewModeDashboardInsight/DashboardInsightWithDrillDialog.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAE,KAAK,YAAY,EAAkC,MAAM,OAAO,CAAC;AAyB1E,OAAO,EAAE,KAAK,sBAAsB,EAAE,MAAM,aAAa,CAAC;AAS1D;;GAEG;AACH,wBAAgB,+BAA+B,CAAC,KAAK,EAAE,sBAAsB,GAAG,YAAY,CAyJ3F"}
|
package/esm/presentation/widget/insight/ViewModeDashboardInsight/DashboardInsightWithDrillDialog.js
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { Fragment as _Fragment, jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
2
|
// (C) 2020-2026 GoodData Corporation
|
|
3
3
|
import { useCallback, useMemo, useState } from "react";
|
|
4
|
+
import { useIntl } from "react-intl";
|
|
4
5
|
import { isIdentifierRef } from "@gooddata/sdk-model";
|
|
5
6
|
import { createFocusHighchartsDatapointEvent } from "@gooddata/sdk-ui";
|
|
6
7
|
import { KdaDialogController } from "../../../../kdaDialog/dialog/KdaDialogController.js";
|
|
@@ -19,13 +20,14 @@ export function DashboardInsightWithDrillDialog(props) {
|
|
|
19
20
|
const activeDrillStep = drillSteps.at(-1);
|
|
20
21
|
const insight = activeDrillStep?.insight;
|
|
21
22
|
const widget = props.widget;
|
|
23
|
+
const intl = useIntl();
|
|
22
24
|
const separators = useDashboardSelector(selectSeparators);
|
|
23
25
|
const attributeDisplayForms = useDashboardSelector(selectCatalogAttributeDisplayFormsById);
|
|
24
26
|
const breadcrumbs = useMemo(() => drillSteps
|
|
25
27
|
.filter((s) => isDrillDownDefinition(s.drillDefinition))
|
|
26
28
|
.map((s) => getDrillDownTitle(s.drillDefinition, s.drillEvent, widget.drillDownIntersectionIgnoredAttributes, attributeDisplayForms[isIdentifierRef(s.drillDefinition.target)
|
|
27
29
|
? s.drillDefinition.target.identifier
|
|
28
|
-
: s.drillDefinition.target.uri])
|
|
30
|
+
: s.drillDefinition.target.uri]) || `(${intl.formatMessage({ id: "empty_value" })})`), [drillSteps, attributeDisplayForms, widget.drillDownIntersectionIgnoredAttributes, intl]);
|
|
29
31
|
const locale = useDashboardSelector(selectLocale);
|
|
30
32
|
const objectAvailability = useDashboardSelector(selectObjectAvailabilityConfig);
|
|
31
33
|
const setNextDrillStep = useCallback((drillStep) => {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { type ReactNode } from "react";
|
|
2
|
-
import { type DashboardTextAttributeFilter, type FilterContextItem, type IDashboardAttributeFilter, type IDashboardAttributeFilterConfig, type IDashboardMeasureValueFilter, type ObjRef } from "@gooddata/sdk-model";
|
|
2
|
+
import { type DashboardTextAttributeFilter, type FilterContextItem, type IDashboardAttributeFilter, type IDashboardAttributeFilterConfig, type IDashboardMeasureValueFilter, type IDashboardParameter, type ObjRef } from "@gooddata/sdk-model";
|
|
3
3
|
type TTargetDashboardFiltersCacheStatus = "loading" | "success" | "error";
|
|
4
4
|
interface ITargetDashboardFiltersCacheEntry {
|
|
5
5
|
status: TTargetDashboardFiltersCacheStatus;
|
|
@@ -8,6 +8,7 @@ interface ITargetDashboardFiltersCacheEntry {
|
|
|
8
8
|
targetDashboardTextAttributeFilters: DashboardTextAttributeFilter[];
|
|
9
9
|
targetDashboardMeasureValueFilters: IDashboardMeasureValueFilter[];
|
|
10
10
|
targetDashboardAttributeFilterConfigs: IDashboardAttributeFilterConfig[];
|
|
11
|
+
targetDashboardParameters: IDashboardParameter[];
|
|
11
12
|
}
|
|
12
13
|
interface ITargetDashboardFiltersContextValue {
|
|
13
14
|
cache: Record<string, ITargetDashboardFiltersCacheEntry>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TargetDashboardFiltersContext.d.ts","sourceRoot":"","sources":["../../../../../../src/presentation/widget/insight/configuration/DrillFilters/TargetDashboardFiltersContext.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAE,KAAK,SAAS,EAAqE,MAAM,OAAO,CAAC;AAE1G,OAAO,EACH,KAAK,4BAA4B,EACjC,KAAK,iBAAiB,EAEtB,KAAK,yBAAyB,EAC9B,KAAK,+BAA+B,EACpC,KAAK,4BAA4B,EACjC,KAAK,MAAM,EAId,MAAM,qBAAqB,CAAC;
|
|
1
|
+
{"version":3,"file":"TargetDashboardFiltersContext.d.ts","sourceRoot":"","sources":["../../../../../../src/presentation/widget/insight/configuration/DrillFilters/TargetDashboardFiltersContext.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAE,KAAK,SAAS,EAAqE,MAAM,OAAO,CAAC;AAE1G,OAAO,EACH,KAAK,4BAA4B,EACjC,KAAK,iBAAiB,EAEtB,KAAK,yBAAyB,EAC9B,KAAK,+BAA+B,EACpC,KAAK,4BAA4B,EACjC,KAAK,mBAAmB,EACxB,KAAK,MAAM,EAId,MAAM,qBAAqB,CAAC;AAQ7B,KAAK,kCAAkC,GAAG,SAAS,GAAG,SAAS,GAAG,OAAO,CAAC;AAE1E,UAAU,iCAAiC;IACvC,MAAM,EAAE,kCAAkC,CAAC;IAC3C,sBAAsB,EAAE,iBAAiB,EAAE,CAAC;IAC5C,+BAA+B,EAAE,yBAAyB,EAAE,CAAC;IAC7D,mCAAmC,EAAE,4BAA4B,EAAE,CAAC;IACpE,kCAAkC,EAAE,4BAA4B,EAAE,CAAC;IACnE,qCAAqC,EAAE,+BAA+B,EAAE,CAAC;IACzE,yBAAyB,EAAE,mBAAmB,EAAE,CAAC;CACpD;AAED,UAAU,mCAAmC;IACzC,KAAK,EAAE,MAAM,CAAC,MAAM,EAAE,iCAAiC,CAAC,CAAC;IACzD,2BAA2B,EAAE,CAAC,YAAY,EAAE,MAAM,EAAE,YAAY,CAAC,EAAE,MAAM,KAAK,IAAI,CAAC;CACtF;AAED,UAAU,oCAAoC;IAC1C,QAAQ,EAAE,SAAS,CAAC;CACvB;AAgDD,wBAAgB,iCAAiC,CAAC,YAAY,EAAE,MAAM,EAAE,YAAY,CAAC,EAAE,MAAM,GAAG,MAAM,CAErG;AAOD;;GAEG;AACH,wBAAgB,8BAA8B,CAAC,EAAE,QAAQ,EAAE,EAAE,oCAAoC,2CAgEhG;AAED,wBAAgB,gCAAgC,IAAI,mCAAmC,CAUtF"}
|
package/esm/presentation/widget/insight/configuration/DrillFilters/TargetDashboardFiltersContext.js
CHANGED
|
@@ -6,6 +6,7 @@ import { useBackendStrict, useWorkspaceStrict } from "@gooddata/sdk-ui";
|
|
|
6
6
|
import { dashboardFilterContextDefinition } from "../../../../../_staging/dashboard/dashboardFilterContext.js";
|
|
7
7
|
import { defaultDateFilterConfig } from "../../../../../_staging/dateFilterConfig/defaultConfig.js";
|
|
8
8
|
import { safeSerializeObjRef } from "../../../../../_staging/metadata/safeSerializeObjRef.js";
|
|
9
|
+
import { pickDashboardTabParameters } from "../../../../../model/store/tabs/parameters/parametersState.js";
|
|
9
10
|
function getTargetDashboardFilterData(dashboard, targetTabLocalIdentifier) {
|
|
10
11
|
const targetTab = targetTabLocalIdentifier
|
|
11
12
|
? dashboard.tabs?.find((tab) => tab.localIdentifier === targetTabLocalIdentifier)
|
|
@@ -26,6 +27,7 @@ function getTargetDashboardFilterData(dashboard, targetTabLocalIdentifier) {
|
|
|
26
27
|
targetDashboardTextAttributeFilters: targetDashboardFilters.filter(isDashboardTextAttributeFilter),
|
|
27
28
|
targetDashboardMeasureValueFilters: targetDashboardFilters.filter(isDashboardMeasureValueFilter),
|
|
28
29
|
targetDashboardAttributeFilterConfigs: targetDashboard.attributeFilterConfigs ?? [],
|
|
30
|
+
targetDashboardParameters: pickDashboardTabParameters(dashboard, targetTab),
|
|
29
31
|
};
|
|
30
32
|
}
|
|
31
33
|
function createEmptyCacheEntry(status) {
|
|
@@ -36,6 +38,7 @@ function createEmptyCacheEntry(status) {
|
|
|
36
38
|
targetDashboardTextAttributeFilters: [],
|
|
37
39
|
targetDashboardMeasureValueFilters: [],
|
|
38
40
|
targetDashboardAttributeFilterConfigs: [],
|
|
41
|
+
targetDashboardParameters: [],
|
|
39
42
|
};
|
|
40
43
|
}
|
|
41
44
|
export function getTargetDashboardFiltersCacheKey(dashboardRef, dashboardTab) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"messages.d.ts","sourceRoot":"","sources":["../../../../../../src/presentation/widget/insight/configuration/DrillFilters/messages.ts"],"names":[],"mappings":"AAIA,eAAO,MAAM,QAAQ;;QAEb,EAAE;;;QAGF,EAAE;;;QAGF,EAAE;;;QAGF,EAAE;;;QAGF,EAAE;;;QAGF,EAAE;;;QAGF,EAAE;;;QAGF,EAAE;;;QAGF,EAAE;;;QAGF,EAAE;;;QAGF,EAAE;;;QAGF,EAAE;;;QAGF,EAAE;;;QAGF,EAAE;;;QAGF,EAAE;;;QAGF,EAAE;;;QAGF,EAAE;;;QAGF,EAAE;;;QAGF,EAAE;;;QAGF,EAAE;;CAER,CAAC"}
|
|
1
|
+
{"version":3,"file":"messages.d.ts","sourceRoot":"","sources":["../../../../../../src/presentation/widget/insight/configuration/DrillFilters/messages.ts"],"names":[],"mappings":"AAIA,eAAO,MAAM,QAAQ;;QAEb,EAAE;;;QAGF,EAAE;;;QAGF,EAAE;;;QAGF,EAAE;;;QAGF,EAAE;;;QAGF,EAAE;;;QAGF,EAAE;;;QAGF,EAAE;;;QAGF,EAAE;;;QAGF,EAAE;;;QAGF,EAAE;;;QAGF,EAAE;;;QAGF,EAAE;;;QAGF,EAAE;;;QAGF,EAAE;;;QAGF,EAAE;;;QAGF,EAAE;;;QAGF,EAAE;;;QAGF,EAAE;;;QAGF,EAAE;;;QAGF,EAAE;;CAER,CAAC"}
|
|
@@ -52,6 +52,9 @@ export const messages = defineMessages({
|
|
|
52
52
|
drillParameterTooltip: {
|
|
53
53
|
id: "configurationPanel.drillConfig.filterSelection.drillParameter.tooltip",
|
|
54
54
|
},
|
|
55
|
+
drillToDashboardParameterNotOnTargetTooltip: {
|
|
56
|
+
id: "configurationPanel.drillConfig.filterSelection.drillToDashboardParameterNotOnTarget.tooltip",
|
|
57
|
+
},
|
|
55
58
|
drillToDashboardRankingFilterTooltip: {
|
|
56
59
|
id: "configurationPanel.drillConfig.filterSelection.drillToDashboardRankingFilter.tooltip",
|
|
57
60
|
},
|
package/esm/presentation/widget/insight/configuration/DrillFilters/useDrillFiltersConfig.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useDrillFiltersConfig.d.ts","sourceRoot":"","sources":["../../../../../../src/presentation/widget/insight/configuration/DrillFilters/useDrillFiltersConfig.ts"],"names":[],"mappings":"AAMA,OAAO,EAGH,KAAK,sBAAsB,EAU9B,MAAM,qBAAqB,CAAC;AAoB7B,OAAO,EAEH,KAAK,gBAAgB,EAErB,KAAK,sCAAsC,EAI9C,MAAM,4BAA4B,CAAC;AAQpC,OAAO,EAAE,KAAK,yBAAyB,EAAsC,MAAM,YAAY,CAAC;AAChG,OAAO,EAAE,KAAK,4BAA4B,EAAE,MAAM,iCAAiC,CAAC;AAIpF,UAAU,4BAA4B;IAClC,IAAI,EAAE,gBAAgB,CAAC;IACvB,iBAAiB,EAAE,CACf,KAAK,EAAE,sBAAsB,GAAG,sCAAsC,EACtE,WAAW,EAAE,gBAAgB,KAC5B,IAAI,CAAC;CACb;AAED,wBAAgB,qBAAqB,CAAC,EAAE,IAAI,EAAE,iBAAiB,EAAE,EAAE,4BAA4B;;;;;;;;;;;
|
|
1
|
+
{"version":3,"file":"useDrillFiltersConfig.d.ts","sourceRoot":"","sources":["../../../../../../src/presentation/widget/insight/configuration/DrillFilters/useDrillFiltersConfig.ts"],"names":[],"mappings":"AAMA,OAAO,EAGH,KAAK,sBAAsB,EAU9B,MAAM,qBAAqB,CAAC;AAoB7B,OAAO,EAEH,KAAK,gBAAgB,EAErB,KAAK,sCAAsC,EAI9C,MAAM,4BAA4B,CAAC;AAQpC,OAAO,EAAE,KAAK,yBAAyB,EAAsC,MAAM,YAAY,CAAC;AAChG,OAAO,EAAE,KAAK,4BAA4B,EAAE,MAAM,iCAAiC,CAAC;AAIpF,UAAU,4BAA4B;IAClC,IAAI,EAAE,gBAAgB,CAAC;IACvB,iBAAiB,EAAE,CACf,KAAK,EAAE,sBAAsB,GAAG,sCAAsC,EACtE,WAAW,EAAE,gBAAgB,KAC5B,IAAI,CAAC;CACb;AAED,wBAAgB,qBAAqB,CAAC,EAAE,IAAI,EAAE,iBAAiB,EAAE,EAAE,4BAA4B;;;;;;;;;;;sCA6S3E,4BAA4B;EAiG/C"}
|
|
@@ -44,10 +44,10 @@ export function useDrillFiltersConfig({ item, onUpdateDrillItem }) {
|
|
|
44
44
|
const dateFilterConfigOverride = useDashboardSelector(selectDateFilterConfigOverrides);
|
|
45
45
|
const allCatalogMeasures = useDashboardSelector(selectCatalogMeasures);
|
|
46
46
|
const allDateFilterConfigsOverrides = useDashboardSelector(selectDateFilterConfigsOverrides);
|
|
47
|
-
const { targetDashboardFilters, targetDashboardAttributeFilters, targetDashboardTextAttributeFilters, targetDashboardAttributeFilterConfigs, targetDashboardMeasureValueFilters, isLoading: isTargetDashboardFiltersLoading, } = useFetchTargetDashboardFilters(item);
|
|
47
|
+
const { targetDashboardFilters, targetDashboardAttributeFilters, targetDashboardTextAttributeFilters, targetDashboardAttributeFilterConfigs, targetDashboardMeasureValueFilters, targetDashboardParameters, isLoading: isTargetDashboardFiltersLoading, } = useFetchTargetDashboardFilters(item);
|
|
48
48
|
// A drill-down executes the source insight with a different attribute.
|
|
49
49
|
const executedInsight = isDrillDown ? insight : targetInsight;
|
|
50
|
-
const { options: parameterOptions, isLoading: isParameterOptionsLoading } = useDrillParameterOptions(item, executedInsight);
|
|
50
|
+
const { options: parameterOptions, isLoading: isParameterOptionsLoading } = useDrillParameterOptions(item, executedInsight, targetDashboardParameters);
|
|
51
51
|
const sourceInsightAttributes = useMemo(() => bucketsAttributes(insight ? insightBuckets(insight) : []), [insight]);
|
|
52
52
|
const sourceInsightMeasures = useMemo(() => (insight ? insightMeasures(insight) : []), [insight]);
|
|
53
53
|
const allCatalogDateAttributeDisplayForms = useMemo(() => allCatalogDateDatasets.flatMap((ds) => ds.dateAttributes).flatMap((da) => da.defaultDisplayForm), [allCatalogDateDatasets]);
|
package/esm/presentation/widget/insight/configuration/DrillFilters/useDrillParameterOptions.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { type IInsight } from "@gooddata/sdk-model";
|
|
1
|
+
import { type IDashboardParameter, type IInsight } from "@gooddata/sdk-model";
|
|
2
2
|
import { type IDrillConfigItem } from "../../../../drill/types.js";
|
|
3
3
|
import { type IDrillFiltersConfigOption } from "./types.js";
|
|
4
4
|
interface IUseDrillParameterOptionsResult {
|
|
@@ -8,6 +8,6 @@ interface IUseDrillParameterOptionsResult {
|
|
|
8
8
|
/**
|
|
9
9
|
* @internal
|
|
10
10
|
*/
|
|
11
|
-
export declare function useDrillParameterOptions(item: IDrillConfigItem, executedInsight: IInsight | undefined): IUseDrillParameterOptionsResult;
|
|
11
|
+
export declare function useDrillParameterOptions(item: IDrillConfigItem, executedInsight: IInsight | undefined, targetDashboardParameters: IDashboardParameter[]): IUseDrillParameterOptionsResult;
|
|
12
12
|
export {};
|
|
13
13
|
//# sourceMappingURL=useDrillParameterOptions.d.ts.map
|
package/esm/presentation/widget/insight/configuration/DrillFilters/useDrillParameterOptions.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useDrillParameterOptions.d.ts","sourceRoot":"","sources":["../../../../../../src/presentation/widget/insight/configuration/DrillFilters/useDrillParameterOptions.ts"],"names":[],"mappings":"AAMA,OAAO,EACH,KAAK,QAAQ,EAKhB,MAAM,qBAAqB,CAAC;
|
|
1
|
+
{"version":3,"file":"useDrillParameterOptions.d.ts","sourceRoot":"","sources":["../../../../../../src/presentation/widget/insight/configuration/DrillFilters/useDrillParameterOptions.ts"],"names":[],"mappings":"AAMA,OAAO,EACH,KAAK,mBAAmB,EACxB,KAAK,QAAQ,EAKhB,MAAM,qBAAqB,CAAC;AAU7B,OAAO,EAAqB,KAAK,gBAAgB,EAAE,MAAM,4BAA4B,CAAC;AAGtF,OAAO,EAAE,KAAK,yBAAyB,EAAE,MAAM,YAAY,CAAC;AAE5D,UAAU,+BAA+B;IACrC,OAAO,EAAE,yBAAyB,EAAE,CAAC;IACrC,SAAS,EAAE,OAAO,CAAC;CACtB;AAED;;GAEG;AACH,wBAAgB,wBAAwB,CACpC,IAAI,EAAE,gBAAgB,EACtB,eAAe,EAAE,QAAQ,GAAG,SAAS,EACrC,yBAAyB,EAAE,mBAAmB,EAAE,GACjD,+BAA+B,CAsDjC"}
|
package/esm/presentation/widget/insight/configuration/DrillFilters/useDrillParameterOptions.js
CHANGED
|
@@ -4,28 +4,20 @@ import { useIntl } from "react-intl";
|
|
|
4
4
|
import { areObjRefsEqual, insightRef, objRefToString, serializeObjRef, } from "@gooddata/sdk-model";
|
|
5
5
|
import { useDashboardSelector } from "../../../../../model/react/DashboardStoreProvider.js";
|
|
6
6
|
import { selectCatalogRequestedParameterRoots } from "../../../../../model/store/catalog/catalogSelectors.js";
|
|
7
|
-
import { selectDashboardRef } from "../../../../../model/store/meta/metaSelectors.js";
|
|
8
7
|
import { collectAppliedParameterEntriesForRoots, hasAppliedParameterValue, resolveParameterTitle, } from "../../../../../model/store/tabs/parameters/parametersHelpers.js";
|
|
9
|
-
import {
|
|
10
|
-
import { DRILL_TARGET_TYPE
|
|
8
|
+
import { selectWidgetParameterContext } from "../../../../../model/store/tabs/parameters/parametersSelectors.js";
|
|
9
|
+
import { DRILL_TARGET_TYPE } from "../../../../drill/types.js";
|
|
11
10
|
import { messages } from "./messages.js";
|
|
12
11
|
/**
|
|
13
12
|
* @internal
|
|
14
13
|
*/
|
|
15
|
-
export function useDrillParameterOptions(item, executedInsight) {
|
|
14
|
+
export function useDrillParameterOptions(item, executedInsight, targetDashboardParameters) {
|
|
16
15
|
const intl = useIntl();
|
|
17
16
|
const parameterContext = useDashboardSelector(selectWidgetParameterContext(item.widgetRef));
|
|
18
17
|
const requestedRoots = useDashboardSelector(selectCatalogRequestedParameterRoots);
|
|
19
|
-
const sourceDashboardRef = useDashboardSelector(selectDashboardRef);
|
|
20
|
-
const parametersByTab = useDashboardSelector(selectDashboardParametersByTab);
|
|
21
18
|
const isDrillToDashboard = item.drillTargetType === DRILL_TARGET_TYPE.DRILL_TO_DASHBOARD;
|
|
22
|
-
|
|
23
|
-
const
|
|
24
|
-
item.dashboardTab &&
|
|
25
|
-
areObjRefsEqual(item.dashboard, sourceDashboardRef)
|
|
26
|
-
? parametersByTab[item.dashboardTab]
|
|
27
|
-
: undefined;
|
|
28
|
-
const message = intl.formatMessage(messages.drillParameterTooltip);
|
|
19
|
+
const passedMessage = intl.formatMessage(messages.drillParameterTooltip);
|
|
20
|
+
const notOnTargetMessage = intl.formatMessage(messages.drillToDashboardParameterNotOnTargetTooltip);
|
|
29
21
|
const options = useMemo(() => {
|
|
30
22
|
const result = [];
|
|
31
23
|
if (!parameterContext) {
|
|
@@ -37,19 +29,25 @@ export function useDrillParameterOptions(item, executedInsight) {
|
|
|
37
29
|
? collectAppliedParameterEntriesForRoots(parameterContext, [insightRef(executedInsight)])
|
|
38
30
|
: [];
|
|
39
31
|
for (const entry of sentEntries) {
|
|
40
|
-
const isDefinedOnTarget = !
|
|
41
|
-
|
|
42
|
-
if (!isDefinedOnTarget) {
|
|
43
|
-
continue;
|
|
44
|
-
}
|
|
32
|
+
const isDefinedOnTarget = !isDrillToDashboard ||
|
|
33
|
+
targetDashboardParameters.some((parameter) => areObjRefsEqual(parameter.ref, entry.parameter.ref));
|
|
45
34
|
result.push({
|
|
46
35
|
id: `parameter:${entry.parameter.ref.identifier}`,
|
|
47
36
|
title: resolveParameterTitle(entry.parameter, parameterContext.workspaceParameterByRef.get(objRefToString(entry.parameter.ref))),
|
|
48
|
-
disabled:
|
|
37
|
+
disabled: isDefinedOnTarget
|
|
38
|
+
? { message: passedMessage, selected: true }
|
|
39
|
+
: { message: notOnTargetMessage, selected: false },
|
|
49
40
|
});
|
|
50
41
|
}
|
|
51
42
|
return result;
|
|
52
|
-
}, [
|
|
43
|
+
}, [
|
|
44
|
+
isDrillToDashboard,
|
|
45
|
+
parameterContext,
|
|
46
|
+
targetDashboardParameters,
|
|
47
|
+
executedInsight,
|
|
48
|
+
passedMessage,
|
|
49
|
+
notOnTargetMessage,
|
|
50
|
+
]);
|
|
53
51
|
const rootsCheckedForPending = isDrillToDashboard || !executedInsight
|
|
54
52
|
? []
|
|
55
53
|
: [insightRef(executedInsight), ...(parameterContext?.filterRoots ?? [])];
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { type DashboardTextAttributeFilter, type FilterContextItem, type IDashboardAttributeFilter, type IDashboardAttributeFilterConfig, type IDashboardMeasureValueFilter } from "@gooddata/sdk-model";
|
|
1
|
+
import { type DashboardTextAttributeFilter, type FilterContextItem, type IDashboardAttributeFilter, type IDashboardAttributeFilterConfig, type IDashboardMeasureValueFilter, type IDashboardParameter } from "@gooddata/sdk-model";
|
|
2
2
|
import { type IDrillConfigItem } from "../../../../drill/types.js";
|
|
3
3
|
interface IUseFetchTargetDashboardFiltersResult {
|
|
4
4
|
targetDashboardFilters: FilterContextItem[];
|
|
@@ -6,6 +6,7 @@ interface IUseFetchTargetDashboardFiltersResult {
|
|
|
6
6
|
targetDashboardTextAttributeFilters: DashboardTextAttributeFilter[];
|
|
7
7
|
targetDashboardMeasureValueFilters: IDashboardMeasureValueFilter[];
|
|
8
8
|
targetDashboardAttributeFilterConfigs: IDashboardAttributeFilterConfig[];
|
|
9
|
+
targetDashboardParameters: IDashboardParameter[];
|
|
9
10
|
isLoading: boolean;
|
|
10
11
|
}
|
|
11
12
|
export declare function useFetchTargetDashboardFilters(item: IDrillConfigItem): IUseFetchTargetDashboardFiltersResult;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useFetchTargetDashboardFilters.d.ts","sourceRoot":"","sources":["../../../../../../src/presentation/widget/insight/configuration/DrillFilters/useFetchTargetDashboardFilters.ts"],"names":[],"mappings":"AAIA,OAAO,EACH,KAAK,4BAA4B,EACjC,KAAK,iBAAiB,EACtB,KAAK,yBAAyB,EAC9B,KAAK,+BAA+B,EACpC,KAAK,4BAA4B,
|
|
1
|
+
{"version":3,"file":"useFetchTargetDashboardFilters.d.ts","sourceRoot":"","sources":["../../../../../../src/presentation/widget/insight/configuration/DrillFilters/useFetchTargetDashboardFilters.ts"],"names":[],"mappings":"AAIA,OAAO,EACH,KAAK,4BAA4B,EACjC,KAAK,iBAAiB,EACtB,KAAK,yBAAyB,EAC9B,KAAK,+BAA+B,EACpC,KAAK,4BAA4B,EACjC,KAAK,mBAAmB,EAK3B,MAAM,qBAAqB,CAAC;AAQ7B,OAAO,EAEH,KAAK,gBAAgB,EAExB,MAAM,4BAA4B,CAAC;AAOpC,UAAU,qCAAqC;IAC3C,sBAAsB,EAAE,iBAAiB,EAAE,CAAC;IAC5C,+BAA+B,EAAE,yBAAyB,EAAE,CAAC;IAC7D,mCAAmC,EAAE,4BAA4B,EAAE,CAAC;IACpE,kCAAkC,EAAE,4BAA4B,EAAE,CAAC;IACnE,qCAAqC,EAAE,+BAA+B,EAAE,CAAC;IACzE,yBAAyB,EAAE,mBAAmB,EAAE,CAAC;IACjD,SAAS,EAAE,OAAO,CAAC;CACtB;AAED,wBAAgB,8BAA8B,CAC1C,IAAI,EAAE,gBAAgB,GACvB,qCAAqC,CAgFvC"}
|
package/esm/presentation/widget/insight/configuration/DrillFilters/useFetchTargetDashboardFilters.js
CHANGED
|
@@ -5,12 +5,16 @@ import { useDashboardSelector } from "../../../../../model/react/DashboardStoreP
|
|
|
5
5
|
import { selectDashboardRef } from "../../../../../model/store/meta/metaSelectors.js";
|
|
6
6
|
import { selectAttributeFilterConfigsOverrides } from "../../../../../model/store/tabs/attributeFilterConfigs/attributeFilterConfigsSelectors.js";
|
|
7
7
|
import { selectFilterContextFilters } from "../../../../../model/store/tabs/filterContext/filterContextSelectors.js";
|
|
8
|
+
import { selectDashboardParametersByTab } from "../../../../../model/store/tabs/parameters/parametersSelectors.js";
|
|
9
|
+
import { selectActiveOrDefaultTabLocalIdentifier } from "../../../../../model/store/tabs/tabsSelectors.js";
|
|
8
10
|
import { DRILL_TARGET_TYPE, } from "../../../../drill/types.js";
|
|
9
11
|
import { getTargetDashboardFiltersCacheKey, useTargetDashboardFiltersContext, } from "./TargetDashboardFiltersContext.js";
|
|
10
12
|
export function useFetchTargetDashboardFilters(item) {
|
|
11
13
|
const sourceDashboardRef = useDashboardSelector(selectDashboardRef);
|
|
12
14
|
const sourceDashboardFilters = useDashboardSelector(selectFilterContextFilters);
|
|
13
15
|
const sourceDashboardAttributeFilterConfigs = useDashboardSelector(selectAttributeFilterConfigsOverrides);
|
|
16
|
+
const sourceParametersByTab = useDashboardSelector(selectDashboardParametersByTab);
|
|
17
|
+
const activeTabId = useDashboardSelector(selectActiveOrDefaultTabLocalIdentifier);
|
|
14
18
|
const { cache, fetchTargetDashboardFilters } = useTargetDashboardFiltersContext();
|
|
15
19
|
const isDrillToDashboard = item.drillTargetType === DRILL_TARGET_TYPE.DRILL_TO_DASHBOARD;
|
|
16
20
|
const drillToDashboardItem = isDrillToDashboard ? item : undefined;
|
|
@@ -48,6 +52,7 @@ export function useFetchTargetDashboardFilters(item) {
|
|
|
48
52
|
targetDashboardTextAttributeFilters: [],
|
|
49
53
|
targetDashboardMeasureValueFilters: [],
|
|
50
54
|
targetDashboardAttributeFilterConfigs: [],
|
|
55
|
+
targetDashboardParameters: [],
|
|
51
56
|
isLoading: false,
|
|
52
57
|
};
|
|
53
58
|
}
|
|
@@ -58,6 +63,7 @@ export function useFetchTargetDashboardFilters(item) {
|
|
|
58
63
|
targetDashboardTextAttributeFilters: sourceDashboardFilters.filter(isDashboardTextAttributeFilter),
|
|
59
64
|
targetDashboardMeasureValueFilters: sourceDashboardFilters.filter(isDashboardMeasureValueFilter),
|
|
60
65
|
targetDashboardAttributeFilterConfigs: sourceDashboardAttributeFilterConfigs,
|
|
66
|
+
targetDashboardParameters: sourceParametersByTab[targetDashboardTab ?? activeTabId] ?? [],
|
|
61
67
|
isLoading: false,
|
|
62
68
|
};
|
|
63
69
|
}
|
|
@@ -67,6 +73,7 @@ export function useFetchTargetDashboardFilters(item) {
|
|
|
67
73
|
targetDashboardTextAttributeFilters: targetDashboardFiltersCacheEntry?.targetDashboardTextAttributeFilters ?? [],
|
|
68
74
|
targetDashboardMeasureValueFilters: targetDashboardFiltersCacheEntry?.targetDashboardMeasureValueFilters ?? [],
|
|
69
75
|
targetDashboardAttributeFilterConfigs: targetDashboardFiltersCacheEntry?.targetDashboardAttributeFilterConfigs ?? [],
|
|
76
|
+
targetDashboardParameters: targetDashboardFiltersCacheEntry?.targetDashboardParameters ?? [],
|
|
70
77
|
isLoading: !targetDashboardFiltersCacheEntry || targetDashboardFiltersCacheEntry.status === "loading",
|
|
71
78
|
};
|
|
72
79
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import { type IAttributeFilter, type IDashboardAttributeFilterConfig, type IDashboardMeasureValueFilter, type IMeasureValueFilter } from "@gooddata/sdk-model";
|
|
2
2
|
import { type UrlDrillTarget } from "../../../../drill/types.js";
|
|
3
|
-
export declare function useInvalidFilteringParametersIdentifiers(urlDrillTarget: UrlDrillTarget | undefined, insightFilters: IAttributeFilter[] | undefined, dashboardFilters: IAttributeFilter[] | undefined, dashboardMeasureValueFilters: IDashboardMeasureValueFilter[] | undefined, insightMeasureValueFilters: IMeasureValueFilter[] | undefined, enableInsightMeasureValueFilters: boolean, attributeFilterConfigs: IDashboardAttributeFilterConfig[] | undefined,
|
|
3
|
+
export declare function useInvalidFilteringParametersIdentifiers(urlDrillTarget: UrlDrillTarget | undefined, insightFilters: IAttributeFilter[] | undefined, dashboardFilters: IAttributeFilter[] | undefined, dashboardMeasureValueFilters: IDashboardMeasureValueFilter[] | undefined, insightMeasureValueFilters: IMeasureValueFilter[] | undefined, enableInsightMeasureValueFilters: boolean, attributeFilterConfigs: IDashboardAttributeFilterConfig[] | undefined, widgetParameterIdentifiers: string[]): string[];
|
|
4
4
|
//# sourceMappingURL=useInvalidFilteringParametersIdentifiers.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useInvalidFilteringParametersIdentifiers.d.ts","sourceRoot":"","sources":["../../../../../../src/presentation/widget/insight/configuration/DrillTargets/useInvalidFilteringParametersIdentifiers.ts"],"names":[],"mappings":"AAIA,OAAO,EACH,KAAK,gBAAgB,EACrB,KAAK,+BAA+B,EACpC,KAAK,4BAA4B,EACjC,KAAK,mBAAmB,EAG3B,MAAM,qBAAqB,CAAC;AAoB7B,OAAO,EAAE,KAAK,cAAc,EAA4B,MAAM,4BAA4B,CAAC;AAE3F,wBAAgB,wCAAwC,CACpD,cAAc,EAAE,cAAc,GAAG,SAAS,EAC1C,cAAc,EAAE,gBAAgB,EAAE,GAAG,SAAS,EAC9C,gBAAgB,EAAE,gBAAgB,EAAE,GAAG,SAAS,EAChD,4BAA4B,EAAE,4BAA4B,EAAE,GAAG,SAAS,EACxE,0BAA0B,EAAE,mBAAmB,EAAE,GAAG,SAAS,EAC7D,gCAAgC,EAAE,OAAO,EACzC,sBAAsB,EAAE,+BAA+B,EAAE,GAAG,SAAS,EACrE,
|
|
1
|
+
{"version":3,"file":"useInvalidFilteringParametersIdentifiers.d.ts","sourceRoot":"","sources":["../../../../../../src/presentation/widget/insight/configuration/DrillTargets/useInvalidFilteringParametersIdentifiers.ts"],"names":[],"mappings":"AAIA,OAAO,EACH,KAAK,gBAAgB,EACrB,KAAK,+BAA+B,EACpC,KAAK,4BAA4B,EACjC,KAAK,mBAAmB,EAG3B,MAAM,qBAAqB,CAAC;AAoB7B,OAAO,EAAE,KAAK,cAAc,EAA4B,MAAM,4BAA4B,CAAC;AAE3F,wBAAgB,wCAAwC,CACpD,cAAc,EAAE,cAAc,GAAG,SAAS,EAC1C,cAAc,EAAE,gBAAgB,EAAE,GAAG,SAAS,EAC9C,gBAAgB,EAAE,gBAAgB,EAAE,GAAG,SAAS,EAChD,4BAA4B,EAAE,4BAA4B,EAAE,GAAG,SAAS,EACxE,0BAA0B,EAAE,mBAAmB,EAAE,GAAG,SAAS,EAC7D,gCAAgC,EAAE,OAAO,EACzC,sBAAsB,EAAE,+BAA+B,EAAE,GAAG,SAAS,EACrE,0BAA0B,EAAE,MAAM,EAAE,YA6GvC"}
|
|
@@ -7,7 +7,7 @@ import { useDashboardSelector } from "../../../../../model/react/DashboardStoreP
|
|
|
7
7
|
import { selectAllCatalogDisplayFormsMap, selectAllCatalogMeasuresMap, } from "../../../../../model/store/catalog/catalogSelectors.js";
|
|
8
8
|
import { dashboardMeasureValueFilterMatchesIdentifier, insightMeasureValueFilterMatchesIdentifier, } from "../../../../../model/utils/measureValueFilterUtils.js";
|
|
9
9
|
import { isDrillToCustomUrlConfig } from "../../../../drill/types.js";
|
|
10
|
-
export function useInvalidFilteringParametersIdentifiers(urlDrillTarget, insightFilters, dashboardFilters, dashboardMeasureValueFilters, insightMeasureValueFilters, enableInsightMeasureValueFilters, attributeFilterConfigs,
|
|
10
|
+
export function useInvalidFilteringParametersIdentifiers(urlDrillTarget, insightFilters, dashboardFilters, dashboardMeasureValueFilters, insightMeasureValueFilters, enableInsightMeasureValueFilters, attributeFilterConfigs, widgetParameterIdentifiers) {
|
|
11
11
|
const displayForms = useDashboardSelector(selectAllCatalogDisplayFormsMap);
|
|
12
12
|
const measures = useDashboardSelector(selectAllCatalogMeasuresMap);
|
|
13
13
|
return useMemo(() => {
|
|
@@ -60,7 +60,7 @@ export function useInvalidFilteringParametersIdentifiers(urlDrillTarget, insight
|
|
|
60
60
|
})
|
|
61
61
|
.map(({ identifier }) => identifier)
|
|
62
62
|
: insightMeasureValueFilterParameters.map(({ identifier }) => identifier);
|
|
63
|
-
const invalidParameterIdentifiers = getUnknownParameterIdentifiers(urlDrillTarget.customUrl,
|
|
63
|
+
const invalidParameterIdentifiers = getUnknownParameterIdentifiers(urlDrillTarget.customUrl, widgetParameterIdentifiers);
|
|
64
64
|
return _uniq([
|
|
65
65
|
...invalidDashboardParameters,
|
|
66
66
|
...invalidInsightParameters,
|
|
@@ -80,6 +80,6 @@ export function useInvalidFilteringParametersIdentifiers(urlDrillTarget, insight
|
|
|
80
80
|
insightMeasureValueFilters,
|
|
81
81
|
enableInsightMeasureValueFilters,
|
|
82
82
|
attributeFilterConfigs,
|
|
83
|
-
|
|
83
|
+
widgetParameterIdentifiers,
|
|
84
84
|
]);
|
|
85
85
|
}
|
|
@@ -5,6 +5,10 @@ export type FocusableItemData = {
|
|
|
5
5
|
icon?: ReactElement | string;
|
|
6
6
|
className?: string;
|
|
7
7
|
tooltip?: string | ReactNode;
|
|
8
|
+
/**
|
|
9
|
+
* Id of the element holding the disabled reason, referenced by the item's aria-describedby.
|
|
10
|
+
*/
|
|
11
|
+
descriptionId?: string;
|
|
8
12
|
onClick?: (event: MouseEvent) => void;
|
|
9
13
|
subMenu?: boolean;
|
|
10
14
|
renderSubmenuComponentOnly?: boolean;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CustomUiMenuComponents.d.ts","sourceRoot":"","sources":["../../../../../../src/presentation/widget/insightMenu/DefaultDashboardInsightMenu/DashboardInsightMenu/CustomUiMenuComponents.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAE,KAAK,UAAU,EAAE,KAAK,YAAY,EAAE,KAAK,SAAS,EAAe,MAAM,OAAO,CAAC;AAKxF,OAAO,EAGH,KAAK,uBAAuB,EAC5B,KAAK,mBAAmB,EACxB,KAAK,2BAA2B,EAInC,MAAM,sBAAsB,CAAC;AAG9B,OAAO,EAAE,KAAK,+BAA+B,EAAE,MAAM,gBAAgB,CAAC;AAKtE,MAAM,MAAM,iBAAiB,GAAG;IAC5B,IAAI,CAAC,EAAE,YAAY,GAAG,MAAM,CAAC;IAC7B,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,OAAO,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IAC7B,OAAO,CAAC,EAAE,CAAC,KAAK,EAAE,UAAU,KAAK,IAAI,CAAC;IACtC,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,0BAA0B,CAAC,EAAE,OAAO,CAAC;CACxC,CAAC;AAEF,MAAM,MAAM,aAAa,GAAG;IACxB,WAAW,EAAE,iBAAiB,CAAC;IAC/B,OAAO,EAAE,iBAAiB,CAAC;CAC9B,CAAC;AAEF,MAAM,MAAM,SAAS,GAAG,+BAA+B,CAAC;
|
|
1
|
+
{"version":3,"file":"CustomUiMenuComponents.d.ts","sourceRoot":"","sources":["../../../../../../src/presentation/widget/insightMenu/DefaultDashboardInsightMenu/DashboardInsightMenu/CustomUiMenuComponents.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAE,KAAK,UAAU,EAAE,KAAK,YAAY,EAAE,KAAK,SAAS,EAAe,MAAM,OAAO,CAAC;AAKxF,OAAO,EAGH,KAAK,uBAAuB,EAC5B,KAAK,mBAAmB,EACxB,KAAK,2BAA2B,EAInC,MAAM,sBAAsB,CAAC;AAG9B,OAAO,EAAE,KAAK,+BAA+B,EAAE,MAAM,gBAAgB,CAAC;AAKtE,MAAM,MAAM,iBAAiB,GAAG;IAC5B,IAAI,CAAC,EAAE,YAAY,GAAG,MAAM,CAAC;IAC7B,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,OAAO,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IAC7B;;OAEG;IACH,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,OAAO,CAAC,EAAE,CAAC,KAAK,EAAE,UAAU,KAAK,IAAI,CAAC;IACtC,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,0BAA0B,CAAC,EAAE,OAAO,CAAC;CACxC,CAAC;AAEF,MAAM,MAAM,aAAa,GAAG;IACxB,WAAW,EAAE,iBAAiB,CAAC;IAC/B,OAAO,EAAE,iBAAiB,CAAC;CAC9B,CAAC;AAEF,MAAM,MAAM,SAAS,GAAG,+BAA+B,CAAC;AAiCxD,wBAAgB,oCAAoC,CAAC,EACjD,IAAI,EACJ,SAAS,GACZ,EAAE,2BAA2B,CAAC,aAAa,CAAC,2CAE5C;AAED,wBAAgB,gCAAgC,CAAC,EAC7C,IAAI,EACJ,SAAS,GACZ,EAAE,uBAAuB,CAAC,aAAa,CAAC,2CAExC;AAED,wBAAgB,4BAA4B,CAAC,EAAE,IAAI,EAAE,EAAE,mBAAmB,CAAC,aAAa,CAAC,2CAyCxF;AAED;;;GAGG;AACH,wBAAgB,uCAAuC,mDAQtD;AAED,wBAAgB,2BAA2B,mDAmC1C"}
|
|
@@ -9,12 +9,12 @@ import { DashboardInsightMenuItemButton } from "./DashboardInsightMenuItemButton
|
|
|
9
9
|
import { DashboardInsightSubmenuContainer } from "./DashboardInsightSubmenuContainer.js";
|
|
10
10
|
function FocusableItemComponent({ item, isFocused, }) {
|
|
11
11
|
const { id, isDisabled, stringTitle } = item;
|
|
12
|
-
const { icon, className, subMenu, tooltip } = item.data ?? {};
|
|
12
|
+
const { icon, className, subMenu, tooltip, descriptionId } = item.data ?? {};
|
|
13
13
|
const itemClassName = cx("gd-menu-item", className, {
|
|
14
14
|
"gd-ui-kit-menu__item--isFocused": isFocused,
|
|
15
15
|
"is-disabled": isDisabled,
|
|
16
16
|
});
|
|
17
|
-
return (_jsx(DashboardInsightMenuItemButton, { itemId: id, itemName: stringTitle, disabled: isDisabled, submenu: subMenu, icon: icon, className: itemClassName, tooltip: tooltip, isFocused: isFocused }, id));
|
|
17
|
+
return (_jsx(DashboardInsightMenuItemButton, { itemId: id, itemName: stringTitle, disabled: isDisabled, submenu: subMenu, icon: icon, className: itemClassName, tooltip: tooltip, descriptionId: descriptionId, isFocused: isFocused }, id));
|
|
18
18
|
}
|
|
19
19
|
export function CustomUiMenuInteractiveItemComponent({ item, isFocused, }) {
|
|
20
20
|
return _jsx(FocusableItemComponent, { item: item, isFocused: isFocused });
|
|
@@ -1,5 +1,10 @@
|
|
|
1
1
|
import { type IInsightMenuItemButton } from "../../types.js";
|
|
2
2
|
export declare const DashboardInsightMenuItemButton: (props: Omit<IInsightMenuItemButton, "type"> & {
|
|
3
3
|
submenu?: boolean;
|
|
4
|
+
/**
|
|
5
|
+
* Id for the element holding the disabled reason. When set, the menu item references it with
|
|
6
|
+
* aria-describedby, so the reason is rendered once as the description and kept out of the name.
|
|
7
|
+
*/
|
|
8
|
+
descriptionId?: string;
|
|
4
9
|
}) => import("react/jsx-runtime").JSX.Element;
|
|
5
10
|
//# sourceMappingURL=DashboardInsightMenuItemButton.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DashboardInsightMenuItemButton.d.ts","sourceRoot":"","sources":["../../../../../../src/presentation/widget/insightMenu/DefaultDashboardInsightMenu/DashboardInsightMenu/DashboardInsightMenuItemButton.tsx"],"names":[],"mappings":"AAQA,OAAO,EAAE,KAAK,sBAAsB,EAAE,MAAM,gBAAgB,CAAC;AAE7D,eAAO,MAAM,8BAA8B,UAChC,IAAI,CAAC,sBAAsB,EAAE,MAAM,CAAC,GAAG;
|
|
1
|
+
{"version":3,"file":"DashboardInsightMenuItemButton.d.ts","sourceRoot":"","sources":["../../../../../../src/presentation/widget/insightMenu/DefaultDashboardInsightMenu/DashboardInsightMenu/DashboardInsightMenuItemButton.tsx"],"names":[],"mappings":"AAQA,OAAO,EAAE,KAAK,sBAAsB,EAAE,MAAM,gBAAgB,CAAC;AAE7D,eAAO,MAAM,8BAA8B,UAChC,IAAI,CAAC,sBAAsB,EAAE,MAAM,CAAC,GAAG;IAC1C,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB;;;OAGG;IACH,aAAa,CAAC,EAAE,MAAM,CAAC;CAC1B,4CAkCJ,CAAC"}
|
|
@@ -2,13 +2,13 @@ import { Fragment as _Fragment, jsx as _jsx, jsxs as _jsxs } from "react/jsx-run
|
|
|
2
2
|
import cx from "classnames";
|
|
3
3
|
import { Item, UiTooltip } from "@gooddata/sdk-ui-kit";
|
|
4
4
|
export const DashboardInsightMenuItemButton = (props) => {
|
|
5
|
-
const { itemName, itemId, disabled, icon, onClick, tooltip, isFocused, className, submenu = false, } = props;
|
|
5
|
+
const { itemName, itemId, disabled, icon, onClick, tooltip, isFocused, className, submenu = false, descriptionId, } = props;
|
|
6
6
|
// for JSX icons we need an extra gd-icon-wrapper class to align the icon and the text vertically
|
|
7
|
-
return renderButtonWithTooltip(_jsx(Item, { className: className, testId: itemId, onClick: disabled ? undefined : onClick, disabled: disabled, subMenu: submenu, children: _jsxs("span", { className: cx({ "gd-icon-wrapper": icon && typeof icon !== "string" }), children: [icon ? typeof icon === "string" ? _jsx("i", { "aria-hidden": true, className: icon }) : icon : null, itemName] }) }), disabled, tooltip, isFocused);
|
|
7
|
+
return renderButtonWithTooltip(_jsx(Item, { className: className, testId: itemId, onClick: disabled ? undefined : onClick, disabled: disabled, subMenu: submenu, children: _jsxs("span", { className: cx({ "gd-icon-wrapper": icon && typeof icon !== "string" }), children: [icon ? typeof icon === "string" ? _jsx("i", { "aria-hidden": true, className: icon }) : icon : null, itemName] }) }), disabled, tooltip, isFocused, descriptionId);
|
|
8
8
|
};
|
|
9
|
-
function renderButtonWithTooltip(button, disabled, tooltip, isFocused) {
|
|
9
|
+
function renderButtonWithTooltip(button, disabled, tooltip, isFocused, descriptionId) {
|
|
10
10
|
if (tooltip && disabled) {
|
|
11
|
-
return (_jsxs(_Fragment, { children: [_jsx(UiTooltip, { triggerBy: isFocused ? [] : ["hover", "focus"], arrowPlacement: "left", optimalPlacement: true, content: tooltip, anchor: button }), _jsx("
|
|
11
|
+
return (_jsxs(_Fragment, { children: [_jsx(UiTooltip, { triggerBy: isFocused ? [] : ["hover", "focus"], arrowPlacement: "left", optimalPlacement: true, content: tooltip, anchor: button, accessibilityHidden: true }), _jsx("span", { id: descriptionId, className: "sr-only", "aria-hidden": descriptionId ? true : undefined, children: tooltip })] }));
|
|
12
12
|
}
|
|
13
13
|
else {
|
|
14
14
|
return button;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../../src/presentation/widget/insightMenu/DefaultDashboardInsightMenu/DashboardInsightMenu/index.tsx"],"names":[],"mappings":"AAEA,OAAO,EACH,KAAK,QAAQ,EAGb,KAAK,cAAc,EAItB,MAAM,OAAO,CAAC;AAef,OAAO,EAAE,KAAK,UAAU,EAAE,MAAM,yBAAyB,CAAC;AAC1D,OAAO,EACH,KAAK,0BAA0B,EAE/B,KAAK,mBAAmB,EAE3B,MAAM,gBAAgB,CAAC;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../../src/presentation/widget/insightMenu/DefaultDashboardInsightMenu/DashboardInsightMenu/index.tsx"],"names":[],"mappings":"AAEA,OAAO,EACH,KAAK,QAAQ,EAGb,KAAK,cAAc,EAItB,MAAM,OAAO,CAAC;AAef,OAAO,EAAE,KAAK,UAAU,EAAE,MAAM,yBAAyB,CAAC;AAC1D,OAAO,EACH,KAAK,0BAA0B,EAE/B,KAAK,mBAAmB,EAE3B,MAAM,gBAAgB,CAAC;AAkJxB,wBAAgB,wBAAwB,CAAC,EACrC,KAAK,EACL,MAAM,EACN,OAAO,EACP,OAAO,EACP,UAAU,EACV,UAAU,EACV,SAAgB,GACnB,EAAE,0BAA0B,GAAG;IAC5B,UAAU,CAAC,EAAE,QAAQ,CAAC,cAAc,CAAC,mBAAmB,GAAG,IAAI,CAAC,CAAC,CAAC;IAClE,UAAU,EAAE,UAAU,CAAC;IACvB;;;OAGG;IACH,SAAS,CAAC,EAAE,OAAO,CAAC;CACvB,2CAuGA;AAED,wBAAgB,oBAAoB,CAAC,KAAK,EAAE,0BAA0B,2CAcrE"}
|
|
@@ -26,7 +26,15 @@ function getWrappedSubmenuComponent(item, latestWidgetRef, submenuComponentCache
|
|
|
26
26
|
});
|
|
27
27
|
return WrappedSubmenuComponent;
|
|
28
28
|
}
|
|
29
|
-
|
|
29
|
+
/**
|
|
30
|
+
* Custom item ids may contain whitespace, which aria-describedby would split into several IDREFs.
|
|
31
|
+
* Escapes whitespace (and the escape character itself) so the result has no whitespace and distinct
|
|
32
|
+
* inputs stay distinct ids.
|
|
33
|
+
*/
|
|
34
|
+
function toIdref(value) {
|
|
35
|
+
return value.replace(/[\s%]/g, (char) => `%${char.charCodeAt(0).toString(16).padStart(4, "0")}`);
|
|
36
|
+
}
|
|
37
|
+
const convertToUiMenuItems = (items, latestWidgetRef, submenuComponentCache, menuId) => {
|
|
30
38
|
return items.map((item) => {
|
|
31
39
|
if (item.type === "separator") {
|
|
32
40
|
return { type: "separator", id: item.itemId };
|
|
@@ -38,18 +46,22 @@ const convertToUiMenuItems = (items, latestWidgetRef, submenuComponentCache) =>
|
|
|
38
46
|
data: null,
|
|
39
47
|
stringTitle: item.itemName,
|
|
40
48
|
subItems: item.items
|
|
41
|
-
? convertToUiMenuItems(item.items, latestWidgetRef, submenuComponentCache)
|
|
49
|
+
? convertToUiMenuItems(item.items, latestWidgetRef, submenuComponentCache, menuId)
|
|
42
50
|
: [],
|
|
43
51
|
};
|
|
44
52
|
}
|
|
53
|
+
// The disabled reason is the item's description, not part of its name.
|
|
54
|
+
const descriptionId = item.disabled && item.tooltip ? toIdref(`${menuId}-${item.itemId}-description`) : undefined;
|
|
45
55
|
const baseFocusableItem = {
|
|
46
56
|
id: item.itemId,
|
|
47
57
|
stringTitle: item.itemName,
|
|
48
58
|
isDisabled: item.disabled,
|
|
59
|
+
ariaAttributes: descriptionId ? { "aria-describedby": descriptionId } : undefined,
|
|
49
60
|
data: {
|
|
50
61
|
icon: item.icon,
|
|
51
62
|
className: item.className,
|
|
52
63
|
tooltip: item.tooltip,
|
|
64
|
+
descriptionId,
|
|
53
65
|
onClick: item.onClick,
|
|
54
66
|
},
|
|
55
67
|
};
|
|
@@ -58,7 +70,7 @@ const convertToUiMenuItems = (items, latestWidgetRef, submenuComponentCache) =>
|
|
|
58
70
|
return {
|
|
59
71
|
...baseFocusableItem,
|
|
60
72
|
type: "interactive",
|
|
61
|
-
subItems: convertToUiMenuItems(item.items, latestWidgetRef, submenuComponentCache),
|
|
73
|
+
subItems: convertToUiMenuItems(item.items, latestWidgetRef, submenuComponentCache, menuId),
|
|
62
74
|
data: {
|
|
63
75
|
...baseFocusableItem.data,
|
|
64
76
|
subMenu: true,
|
|
@@ -91,7 +103,8 @@ export function DashboardInsightMenuBody({ items, widget, insight, onClose, rend
|
|
|
91
103
|
latestWidgetRef.current = widget;
|
|
92
104
|
// Cache submenu components to prevent remounting caused by component identity change.
|
|
93
105
|
const submenuComponentCache = useRef(new Map());
|
|
94
|
-
const
|
|
106
|
+
const menuId = `insight-menu-${widgetRefAsString}`;
|
|
107
|
+
const uiMenuItems = useMemo(() => convertToUiMenuItems(items, latestWidgetRef, submenuComponentCache.current, menuId), [items, menuId]);
|
|
95
108
|
const handleSelect = (item) => {
|
|
96
109
|
if (item.type === "interactive" && item.data?.onClick) {
|
|
97
110
|
// Call onClick directly - the event properties are not used in the handlers
|
|
@@ -109,7 +122,6 @@ export function DashboardInsightMenuBody({ items, widget, insight, onClose, rend
|
|
|
109
122
|
setSubmenu?.(null);
|
|
110
123
|
}
|
|
111
124
|
};
|
|
112
|
-
const menuId = `insight-menu-${widgetRefAsString}`;
|
|
113
125
|
const menuLabelId = `${menuId}-label`;
|
|
114
126
|
// without the title there is no element carrying menuLabelId, so the name goes on the menu itself
|
|
115
127
|
const menuLabel = showTitle
|