@gooddata/sdk-ui-dashboard 11.70.0 → 11.71.0-alpha.1
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 +49 -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/dashboard/absoluteGranularityDateFilters.d.ts +0 -7
- package/esm/_staging/dashboard/absoluteGranularityDateFilters.d.ts.map +1 -1
- package/esm/_staging/dashboard/absoluteGranularityDateFilters.js +0 -17
- package/esm/_staging/sharedHooks/useDateFiltersTitles.d.ts +2 -2
- package/esm/_staging/sharedHooks/useDateFiltersTitles.d.ts.map +1 -1
- package/esm/_staging/sharedHooks/useDateFiltersTitles.js +7 -5
- package/esm/_staging/sharedHooks/useFiltersNamings.d.ts.map +1 -1
- package/esm/_staging/sharedHooks/useFiltersNamings.js +7 -7
- package/esm/index.d.ts +2 -2
- package/esm/index.d.ts.map +1 -1
- package/esm/index.js +2 -2
- package/esm/kdaDialog/composition/KeyDriversPanel.d.ts.map +1 -1
- package/esm/kdaDialog/composition/KeyDriversPanel.js +1 -1
- package/esm/kdaDialog/dialog/KdaDialog.d.ts.map +1 -1
- package/esm/kdaDialog/dialog/KdaDialog.js +4 -3
- package/esm/kdaDialog/dialog/KdaDialogActionButtons.d.ts +5 -1
- package/esm/kdaDialog/dialog/KdaDialogActionButtons.d.ts.map +1 -1
- package/esm/kdaDialog/dialog/KdaDialogActionButtons.js +33 -5
- package/esm/kdaDialog/dialog/KdaDialogFloatingStatusBar.d.ts +5 -1
- package/esm/kdaDialog/dialog/KdaDialogFloatingStatusBar.d.ts.map +1 -1
- package/esm/kdaDialog/dialog/KdaDialogFloatingStatusBar.js +2 -2
- package/esm/kdaDialog/dialog/KdaReplaceConfirmationDialog.d.ts.map +1 -1
- package/esm/kdaDialog/dialog/KdaReplaceConfirmationDialog.js +9 -1
- package/esm/model/commandHandlers/dashboard/changeDashboardDefinitionHandler.d.ts.map +1 -1
- package/esm/model/commandHandlers/dashboard/changeDashboardDefinitionHandler.js +5 -5
- package/esm/model/commandHandlers/dashboard/changeDateFilterTitleHandler.d.ts.map +1 -1
- package/esm/model/commandHandlers/dashboard/changeDateFilterTitleHandler.js +8 -6
- package/esm/model/commandHandlers/dashboard/changeDateFilterWithDimensionModeHandler.d.ts.map +1 -1
- package/esm/model/commandHandlers/dashboard/changeDateFilterWithDimensionModeHandler.js +10 -6
- package/esm/model/commandHandlers/dashboard/common/filterViews.d.ts.map +1 -1
- package/esm/model/commandHandlers/dashboard/common/filterViews.js +22 -12
- package/esm/model/commandHandlers/dashboard/common/stateInitializers.d.ts.map +1 -1
- package/esm/model/commandHandlers/dashboard/common/stateInitializers.js +6 -6
- package/esm/model/commandHandlers/dashboard/initializeDashboardHandler/index.d.ts.map +1 -1
- package/esm/model/commandHandlers/dashboard/initializeDashboardHandler/index.js +0 -3
- package/esm/model/commandHandlers/drill/crossFilteringHandler.d.ts.map +1 -1
- package/esm/model/commandHandlers/drill/crossFilteringHandler.js +1 -0
- package/esm/model/commandHandlers/drill/drillToDashboardHandler.js +1 -0
- package/esm/model/commandHandlers/filterContext/changeFilterContextSelectionHandler.d.ts.map +1 -1
- package/esm/model/commandHandlers/filterContext/changeFilterContextSelectionHandler.js +28 -54
- package/esm/model/commandHandlers/filterContext/dateFilter/addDateFilterHandler.js +2 -2
- package/esm/model/commandHandlers/filterContext/dateFilter/changeDateFilterSelectionHandler.d.ts.map +1 -1
- package/esm/model/commandHandlers/filterContext/dateFilter/changeDateFilterSelectionHandler.js +2 -6
- package/esm/model/commandHandlers/filterContext/dateFilter/moveDateFilterHandler.d.ts.map +1 -1
- package/esm/model/commandHandlers/filterContext/dateFilter/moveDateFilterHandler.js +8 -4
- package/esm/model/commandHandlers/filterContext/dateFilter/removeDateFiltersHandler.d.ts.map +1 -1
- package/esm/model/commandHandlers/filterContext/dateFilter/removeDateFiltersHandler.js +21 -17
- package/esm/model/commandHandlers/filterContext/dateFilter/validation/uniqueFiltersValidation.d.ts +2 -2
- package/esm/model/commandHandlers/filterContext/dateFilter/validation/uniqueFiltersValidation.d.ts.map +1 -1
- package/esm/model/commandHandlers/filterContext/dateFilter/validation/uniqueFiltersValidation.js +2 -2
- package/esm/model/commandHandlers/filterContext/filterViewHandler.d.ts.map +1 -1
- package/esm/model/commandHandlers/filterContext/filterViewHandler.js +1 -6
- package/esm/model/commandHandlers/filterContext/removeRestrictedFiltersHandler.d.ts.map +1 -1
- package/esm/model/commandHandlers/filterContext/removeRestrictedFiltersHandler.js +3 -3
- package/esm/model/commandHandlers/filterContext/tabSync/tabSyncRules.d.ts.map +1 -1
- package/esm/model/commandHandlers/filterContext/tabSync/tabSyncRules.js +5 -3
- package/esm/model/commandHandlers/widgets/changeInsightWidgetFilterSettingsHandler.d.ts.map +1 -1
- package/esm/model/commandHandlers/widgets/changeInsightWidgetFilterSettingsHandler.js +2 -2
- package/esm/model/commandHandlers/widgets/changeRichTextWidgetFilterSettingsHandler.d.ts.map +1 -1
- package/esm/model/commandHandlers/widgets/changeRichTextWidgetFilterSettingsHandler.js +2 -2
- package/esm/model/commandHandlers/widgets/common/filterOperations.d.ts +3 -3
- package/esm/model/commandHandlers/widgets/common/filterOperations.d.ts.map +1 -1
- package/esm/model/commandHandlers/widgets/common/filterOperations.js +14 -14
- package/esm/model/commandHandlers/widgets/common/filterReferences.d.ts +2 -2
- package/esm/model/commandHandlers/widgets/common/filterReferences.d.ts.map +1 -1
- package/esm/model/commandHandlers/widgets/common/filterReferences.js +1 -1
- package/esm/model/commandHandlers/widgets/validation/filterValidation.d.ts +2 -2
- package/esm/model/commandHandlers/widgets/validation/filterValidation.d.ts.map +1 -1
- package/esm/model/commandHandlers/widgets/validation/filterValidation.js +4 -4
- package/esm/model/commands/filters.d.ts +1 -2
- package/esm/model/commands/filters.d.ts.map +1 -1
- package/esm/model/events/base.d.ts +1 -1
- package/esm/model/events/base.d.ts.map +1 -1
- package/esm/model/events/filters.d.ts +107 -0
- package/esm/model/events/filters.d.ts.map +1 -1
- package/esm/model/events/filters.js +54 -0
- package/esm/model/events/index.d.ts +2 -2
- package/esm/model/events/index.d.ts.map +1 -1
- package/esm/model/events/insight.d.ts +12 -2
- package/esm/model/events/insight.d.ts.map +1 -1
- package/esm/model/events/insight.js +2 -1
- package/esm/model/events/richText.d.ts +12 -2
- package/esm/model/events/richText.d.ts.map +1 -1
- package/esm/model/events/richText.js +2 -1
- package/esm/model/react/useWidgetFilters.d.ts.map +1 -1
- package/esm/model/react/useWidgetFilters.js +6 -5
- package/esm/model/store/filtering/dashboardFilterSelectors.d.ts.map +1 -1
- package/esm/model/store/filtering/dashboardFilterSelectors.js +20 -39
- package/esm/model/store/insights/insightsSelectors.d.ts.map +1 -1
- package/esm/model/store/insights/insightsSelectors.js +9 -3
- package/esm/model/store/meta/metaSelectors.js +3 -3
- package/esm/model/store/tabs/filterContext/filterContextReducers.d.ts +5 -1
- package/esm/model/store/tabs/filterContext/filterContextReducers.d.ts.map +1 -1
- package/esm/model/store/tabs/filterContext/filterContextReducers.js +26 -18
- package/esm/model/store/tabs/filterContext/filterContextSelectors.d.ts +43 -3
- package/esm/model/store/tabs/filterContext/filterContextSelectors.d.ts.map +1 -1
- package/esm/model/store/tabs/filterContext/filterContextSelectors.js +53 -9
- package/esm/model/store/tabs/filterContext/filterContextUtils.d.ts.map +1 -1
- package/esm/model/store/tabs/filterContext/filterContextUtils.js +21 -19
- package/esm/model/store/tabs/filterContext/filterSync.d.ts +7 -0
- package/esm/model/store/tabs/filterContext/filterSync.d.ts.map +1 -1
- package/esm/model/store/tabs/filterContext/filterSync.js +30 -42
- package/esm/model/utils/widgetFilters.d.ts.map +1 -1
- package/esm/model/utils/widgetFilters.js +4 -3
- package/esm/presentation/automations/shared/automationFilters/components/AutomationFiltersSelect.d.ts.map +1 -1
- package/esm/presentation/automations/shared/automationFilters/components/AutomationFiltersSelect.js +6 -4
- package/esm/presentation/automations/shared/automationFilters/useAutomationFilters.d.ts +2 -1
- package/esm/presentation/automations/shared/automationFilters/useAutomationFilters.d.ts.map +1 -1
- package/esm/presentation/automations/shared/automationFilters/useAutomationFilters.js +43 -7
- package/esm/presentation/automations/shared/hooks/useFiltersNamings.d.ts.map +1 -1
- package/esm/presentation/automations/shared/hooks/useFiltersNamings.js +1 -0
- package/esm/presentation/dragAndDrop/draggableDateFilter/DefaultDateFilterDraggingComponent.d.ts.map +1 -1
- package/esm/presentation/dragAndDrop/draggableDateFilter/DefaultDateFilterDraggingComponent.js +3 -2
- package/esm/presentation/dragAndDrop/draggableDateFilter/DraggableDateFilter.d.ts +3 -3
- package/esm/presentation/dragAndDrop/draggableDateFilter/DraggableDateFilter.d.ts.map +1 -1
- package/esm/presentation/dragAndDrop/draggableDateFilter/DraggableDateFilter.js +1 -1
- package/esm/presentation/dragAndDrop/draggableFilterDropZone/DraggableFilterDropZoneHint.d.ts.map +1 -1
- package/esm/presentation/dragAndDrop/draggableFilterDropZone/DraggableFilterDropZoneHint.js +2 -2
- package/esm/presentation/dragAndDrop/types.d.ts +2 -2
- package/esm/presentation/dragAndDrop/types.d.ts.map +1 -1
- package/esm/presentation/dragAndDrop/useFilterDeleteDrop.d.ts.map +1 -1
- package/esm/presentation/dragAndDrop/useFilterDeleteDrop.js +2 -2
- package/esm/presentation/filterBar/attributeFilter/AttributeFilterParentFilteringContext.d.ts.map +1 -1
- package/esm/presentation/filterBar/attributeFilter/AttributeFilterParentFilteringContext.js +3 -3
- package/esm/presentation/filterBar/attributeFilter/dashboardDropdownBody/configuration/hooks/useDependentDateFilterConfigurationState.d.ts +15 -3
- package/esm/presentation/filterBar/attributeFilter/dashboardDropdownBody/configuration/hooks/useDependentDateFilterConfigurationState.d.ts.map +1 -1
- package/esm/presentation/filterBar/attributeFilter/dashboardDropdownBody/configuration/hooks/useDependentDateFilterConfigurationState.js +27 -31
- package/esm/presentation/filterBar/attributeFilter/dashboardDropdownBody/configuration/hooks/useDependentDateFiltersConfiguration.d.ts +3 -3
- package/esm/presentation/filterBar/attributeFilter/dashboardDropdownBody/configuration/hooks/useDependentDateFiltersConfiguration.d.ts.map +1 -1
- package/esm/presentation/filterBar/attributeFilter/dashboardDropdownBody/configuration/hooks/useDependentDateFiltersConfiguration.js +3 -2
- package/esm/presentation/filterBar/attributeFilter/dashboardDropdownBody/configuration/limitValues/LimitValuesConfiguration.d.ts +2 -2
- package/esm/presentation/filterBar/attributeFilter/dashboardDropdownBody/configuration/limitValues/LimitValuesConfiguration.d.ts.map +1 -1
- package/esm/presentation/filterBar/attributeFilter/dashboardDropdownBody/configuration/limitValues/dialog/AddLimitingItemDialog.d.ts +2 -2
- package/esm/presentation/filterBar/attributeFilter/dashboardDropdownBody/configuration/limitValues/dialog/AddLimitingItemDialog.d.ts.map +1 -1
- package/esm/presentation/filterBar/attributeFilter/dashboardDropdownBody/configuration/limitValues/dialog/DateFiltersPage.d.ts +2 -2
- package/esm/presentation/filterBar/attributeFilter/dashboardDropdownBody/configuration/limitValues/dialog/DateFiltersPage.d.ts.map +1 -1
- package/esm/presentation/filterBar/attributeFilter/dashboardDropdownBody/configuration/limitValues/dialog/DateFiltersPage.js +1 -1
- package/esm/presentation/filterBar/attributeFilter/dashboardDropdownBody/configuration/limitValues/dialog/ParentFiltersPage.d.ts +2 -2
- package/esm/presentation/filterBar/attributeFilter/dashboardDropdownBody/configuration/limitValues/dialog/ParentFiltersPage.d.ts.map +1 -1
- package/esm/presentation/filterBar/attributeFilter/dashboardDropdownBody/configuration/limitValues/shared/limitingItemsHook.d.ts +3 -3
- package/esm/presentation/filterBar/attributeFilter/dashboardDropdownBody/configuration/limitValues/shared/limitingItemsHook.d.ts.map +1 -1
- package/esm/presentation/filterBar/attributeFilter/dashboardDropdownBody/configuration/limitValues/shared/limitingItemsHook.js +2 -4
- package/esm/presentation/filterBar/attributeFilter/useDependentDateFilters.d.ts.map +1 -1
- package/esm/presentation/filterBar/attributeFilter/useDependentDateFilters.js +42 -20
- package/esm/presentation/filterBar/filterBar/DefaultFilterBar.d.ts.map +1 -1
- package/esm/presentation/filterBar/filterBar/DefaultFilterBar.js +3 -3
- package/esm/presentation/filterBar/filterBar/DefaultFilterBarContainer.d.ts.map +1 -1
- package/esm/presentation/filterBar/filterBar/DefaultFilterBarContainer.js +13 -4
- package/esm/presentation/filterBar/filterBar/DefaultFilterBarItem.d.ts.map +1 -1
- package/esm/presentation/filterBar/filterBar/DefaultFilterBarItem.js +9 -8
- package/esm/presentation/filterBar/filterBar/filterGroupUtils.js +3 -3
- package/esm/presentation/filterBar/filterBar/filterViews/FilterViews.d.ts.map +1 -1
- package/esm/presentation/filterBar/filterBar/filterViews/FilterViews.js +13 -2
- package/esm/presentation/filterBar/filterBar/useFiltersWithAddedPlaceholder.d.ts +3 -3
- package/esm/presentation/filterBar/filterBar/useFiltersWithAddedPlaceholder.d.ts.map +1 -1
- package/esm/presentation/filterBar/filterBar/useFiltersWithAddedPlaceholder.js +9 -9
- package/esm/presentation/filterBar/utils.d.ts.map +1 -1
- package/esm/presentation/filterBar/utils.js +2 -2
- package/esm/presentation/topBar/menuButton/DefaultMenuButton.d.ts.map +1 -1
- package/esm/presentation/topBar/menuButton/DefaultMenuButton.js +33 -6
- package/esm/presentation/widget/common/configuration/DateDatasetFilter.js +2 -2
- package/esm/presentation/widget/common/configuration/FilterConfiguration.d.ts.map +1 -1
- package/esm/presentation/widget/common/configuration/FilterConfiguration.js +5 -4
- package/esm/presentation/widget/insight/ViewModeDashboardInsight/InsightDrillDialog/DrillDialogInsight.d.ts.map +1 -1
- package/esm/presentation/widget/insight/ViewModeDashboardInsight/InsightDrillDialog/DrillDialogInsight.js +9 -2
- package/esm/presentation/widget/insight/ViewModeDashboardInsight/InsightDrillDialog/InsightDrillDialog.d.ts.map +1 -1
- package/esm/presentation/widget/insight/ViewModeDashboardInsight/InsightDrillDialog/InsightDrillDialog.js +3 -21
- package/esm/presentation/widget/insight/ViewModeDashboardInsight/InsightDrillDialog/getDrillDialogInsightDescription.d.ts +6 -0
- package/esm/presentation/widget/insight/ViewModeDashboardInsight/InsightDrillDialog/getDrillDialogInsightDescription.d.ts.map +1 -0
- package/esm/presentation/widget/insight/ViewModeDashboardInsight/InsightDrillDialog/getDrillDialogInsightDescription.js +24 -0
- package/esm/sdk-ui-dashboard.d.ts +192 -12
- package/package.json +23 -23
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DefaultFilterBar.d.ts","sourceRoot":"","sources":["../../../../src/presentation/filterBar/filterBar/DefaultFilterBar.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAE,KAAK,YAAY,EAAe,MAAM,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"DefaultFilterBar.d.ts","sourceRoot":"","sources":["../../../../src/presentation/filterBar/filterBar/DefaultFilterBar.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAE,KAAK,YAAY,EAAe,MAAM,OAAO,CAAC;AAsFvD,OAAO,EAAE,KAAK,eAAe,EAAE,MAAM,YAAY,CAAC;AAGlD;;GAEG;AACH,eAAO,MAAM,iBAAiB,QAAO,eA+PpC,CAAC;AAEF;;GAEG;AACH,wBAAgB,gBAAgB,CAAC,KAAK,EAAE,eAAe,GAAG,YAAY,CA+IrE"}
|
|
@@ -3,7 +3,7 @@ import { Fragment as _Fragment, jsx as _jsx, jsxs as _jsxs } from "react/jsx-run
|
|
|
3
3
|
import { useCallback } from "react";
|
|
4
4
|
import classNames from "classnames";
|
|
5
5
|
import { generateDateFilterLocalIdentifier } from "@gooddata/sdk-backend-base";
|
|
6
|
-
import { DashboardDateFilterConfigModeValues, DashboardParameterModeValues, areObjRefsEqual, dashboardAttributeFilterItemDisplayForm, dashboardAttributeFilterItemLocalIdentifier, dashboardFilterLocalIdentifier, isAllTimeDashboardDateFilter, isDashboardAbsoluteGranularityDateFilter, isDashboardAttributeFilter, isDashboardAttributeFilterItem,
|
|
6
|
+
import { DashboardDateFilterConfigModeValues, DashboardParameterModeValues, areObjRefsEqual, dashboardAttributeFilterItemDisplayForm, dashboardAttributeFilterItemLocalIdentifier, dashboardFilterLocalIdentifier, dashboardFilterObjRef, isAllTimeDashboardDateFilter, isDashboardAbsoluteGranularityDateFilter, isDashboardAttributeFilter, isDashboardAttributeFilterItem, isDashboardDateFilterOfAnyType, isDashboardMeasureValueFilter, isDashboardParameterizedDateFilter, objRefToString, } from "@gooddata/sdk-model";
|
|
7
7
|
import { convertDashboardAttributeFilterElementsValuesToUris } from "../../../_staging/dashboard/legacyFilterConvertors.js";
|
|
8
8
|
import { setDashboardAttributeFilterConfigDisplayAsLabel } from "../../../model/commands/dashboard.js";
|
|
9
9
|
import { changeAttributeFilterSelection, changeDateFilterSelection, changeDateFilterSelectionOfAnyType, changeMeasureValueFilterCondition, changeMigratedAttributeFilterSelection, changeWorkingAttributeFilterSelection, changeWorkingMeasureValueFilterCondition, clearDateFilterSelection, removeRestrictedFilters, replaceAttributeFilterItemSelection, replaceWorkingAttributeFilterItemSelection, setAttributeFilterDisplayForm, } from "../../../model/commands/filters.js";
|
|
@@ -133,8 +133,8 @@ export const useFilterBarProps = () => {
|
|
|
133
133
|
else {
|
|
134
134
|
const { type, granularity, from, to, dataSet, localIdentifier, boundedFilter, emptyValueHandling, } = filter.dateFilter;
|
|
135
135
|
const filterIndex = filters
|
|
136
|
-
.filter(
|
|
137
|
-
.findIndex((filter) => areObjRefsEqual(filter
|
|
136
|
+
.filter(isDashboardDateFilterOfAnyType)
|
|
137
|
+
.findIndex((filter) => areObjRefsEqual(dashboardFilterObjRef(filter), dataSet));
|
|
138
138
|
const sanitizedFilterIndex = filterIndex < 0 ? 0 : filterIndex;
|
|
139
139
|
const newLocalIdentifier = generateDateFilterLocalIdentifier(sanitizedFilterIndex, dataSet);
|
|
140
140
|
dispatch(changeDateFilterSelection(type, granularity, from, to, dateFilterOptionLocalId, undefined, dataSet, isWorkingSelectionChange && isApplyAllAtOnceEnabledAndSet, localIdentifier ?? newLocalIdentifier, boundedFilter, emptyValueHandling));
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DefaultFilterBarContainer.d.ts","sourceRoot":"","sources":["../../../../src/presentation/filterBar/filterBar/DefaultFilterBarContainer.tsx"],"names":[],"mappings":"AAEA,OAAO,EAGH,KAAK,SAAS,EAOjB,MAAM,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"DefaultFilterBarContainer.d.ts","sourceRoot":"","sources":["../../../../src/presentation/filterBar/filterBar/DefaultFilterBarContainer.tsx"],"names":[],"mappings":"AAEA,OAAO,EAGH,KAAK,SAAS,EAOjB,MAAM,OAAO,CAAC;AA+ff;;GAEG;AACH,wBAAgB,yBAAyB,CAAC,EAAE,QAAQ,EAAE,EAAE;IAAE,QAAQ,CAAC,EAAE,SAAS,CAAA;CAAE,2CAQ/E"}
|
|
@@ -6,7 +6,7 @@ import cx from "classnames";
|
|
|
6
6
|
import { defaultImport } from "default-import";
|
|
7
7
|
import { FormattedMessage, useIntl } from "react-intl";
|
|
8
8
|
import DefaultMeasure from "react-measure";
|
|
9
|
-
import { Bubble, BubbleHoverTrigger, Message, UiButton, UiTooltip, makeHorizontalKeyboardNavigation, } from "@gooddata/sdk-ui-kit";
|
|
9
|
+
import { Bubble, BubbleHoverTrigger, Message, UiButton, UiTooltip, findFocusableElementOutsideContainer, makeHorizontalKeyboardNavigation, } from "@gooddata/sdk-ui-kit";
|
|
10
10
|
import { applyFilterContextWorkingSelection } from "../../../model/commands/filters.js";
|
|
11
11
|
import { isDashboardFilterContextSelectionReset, isDashboardFilterContextWorkingSelectionApplied, } from "../../../model/events/filters.js";
|
|
12
12
|
import { isDashboardParametersSelectionReset } from "../../../model/events/parameters.js";
|
|
@@ -214,15 +214,24 @@ function MeasuredDiv({ measureRef, isAutoExpanded, children, }) {
|
|
|
214
214
|
}
|
|
215
215
|
}
|
|
216
216
|
// The bar is a toolbar: one Tab stop, items (including the reset button) are reached
|
|
217
|
-
// with the arrow keys, so
|
|
217
|
+
// with the arrow keys, so Tab from any item leaves the bar instead of visiting the others.
|
|
218
218
|
if (activeFilterIndex === -1) {
|
|
219
219
|
// First tab into bar: focus first filter
|
|
220
220
|
e.preventDefault();
|
|
221
221
|
filterElements[0]?.focus();
|
|
222
222
|
}
|
|
223
223
|
else {
|
|
224
|
-
|
|
225
|
-
|
|
224
|
+
const container = containerRef.current;
|
|
225
|
+
const outside = container
|
|
226
|
+
? findFocusableElementOutsideContainer(container, e.shiftKey ? "backward" : "forward")
|
|
227
|
+
: null;
|
|
228
|
+
if (outside) {
|
|
229
|
+
e.preventDefault();
|
|
230
|
+
outside.focus();
|
|
231
|
+
return;
|
|
232
|
+
}
|
|
233
|
+
// Nothing focusable outside the bar in that direction: move focus to the edge of the
|
|
234
|
+
// bar and let the browser's default Tab take it out of the page content.
|
|
226
235
|
if (e.shiftKey) {
|
|
227
236
|
const first = filterElements[0];
|
|
228
237
|
first?.focus();
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DefaultFilterBarItem.d.ts","sourceRoot":"","sources":["../../../../src/presentation/filterBar/filterBar/DefaultFilterBarItem.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAE,KAAK,SAAS,EAAW,MAAM,OAAO,CAAC;AAIhD,OAAO,EAGH,KAAK,MAAM,
|
|
1
|
+
{"version":3,"file":"DefaultFilterBarItem.d.ts","sourceRoot":"","sources":["../../../../src/presentation/filterBar/filterBar/DefaultFilterBarItem.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAE,KAAK,SAAS,EAAW,MAAM,OAAO,CAAC;AAIhD,OAAO,EAGH,KAAK,MAAM,EASd,MAAM,qBAAqB,CAAC;AAoC7B,OAAO,EAAE,KAAK,4BAA4B,EAAE,MAAM,4BAA4B,CAAC;AAG/E,OAAO,EAAE,KAAK,eAAe,EAAE,MAAM,YAAY,CAAC;AAClD,OAAO,EACH,KAAK,aAAa,EAMrB,MAAM,qCAAqC,CAAC;AAE7C;;GAEG;AACH,MAAM,WAAW,mBAAoB,SAAQ,eAAe;IACxD,IAAI,EAAE,aAAa,CAAC;IACpB,cAAc,EAAE,MAAM,GAAG,SAAS,CAAC;IACnC,6BAA6B,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;IACvD,qBAAqB,EAAE,CAAC,GAAG,EAAE,MAAM,EAAE,aAAa,CAAC,EAAE,4BAA4B,KAAK,IAAI,CAAC;IAC3F,uBAAuB,EAAE,MAAM,IAAI,CAAC;IACpC,sBAAsB,EAAE,MAAM,IAAI,CAAC;CACtC;AAED;;GAEG;AACH,wBAAgB,oBAAoB,CAAC,KAAK,EAAE,mBAAmB,GAAG,SAAS,CA4O1E"}
|
|
@@ -2,7 +2,7 @@ import { jsx as _jsx } from "react/jsx-runtime";
|
|
|
2
2
|
// (C) 2021-2026 GoodData Corporation
|
|
3
3
|
import { useMemo } from "react";
|
|
4
4
|
import { invariant } from "ts-invariant";
|
|
5
|
-
import { DashboardAttributeFilterConfigModeValues, DashboardDateFilterConfigModeValues, areObjRefsEqual, dashboardAttributeFilterItemDisplayForm, dashboardAttributeFilterItemLocalIdentifier, dashboardFilterLocalIdentifier, isDashboardAttributeFilter, objRefToString, serializeObjRef, } from "@gooddata/sdk-model";
|
|
5
|
+
import { DashboardAttributeFilterConfigModeValues, DashboardDateFilterConfigModeValues, areObjRefsEqual, dashboardAttributeFilterItemDisplayForm, dashboardAttributeFilterItemLocalIdentifier, dashboardFilterLocalIdentifier, dashboardFilterObjRef, isDashboardAttributeFilter, objRefToString, serializeObjRef, } from "@gooddata/sdk-model";
|
|
6
6
|
import { convertDashboardAttributeFilterElementsUrisToValues } from "../../../_staging/dashboard/legacyFilterConvertors.js";
|
|
7
7
|
import { useDashboardSelector } from "../../../model/react/DashboardStoreProvider.js";
|
|
8
8
|
import { selectSupportsElementUris } from "../../../model/store/backendCapabilities/backendCapabilitiesSelectors.js";
|
|
@@ -58,7 +58,7 @@ export function DefaultFilterBarItem(props) {
|
|
|
58
58
|
availableGranularities,
|
|
59
59
|
dateFilterOptions,
|
|
60
60
|
};
|
|
61
|
-
const dateFilterConfigNarrowedToDimension = useDateFilterConfigNarrowedToDimension(commonDateFilterComponentConfig, allDateDatasets, isFilterBarDateFilterWithDimension(item) ? item.filter
|
|
61
|
+
const dateFilterConfigNarrowedToDimension = useDateFilterConfigNarrowedToDimension(commonDateFilterComponentConfig, allDateDatasets, isFilterBarDateFilterWithDimension(item) ? dashboardFilterObjRef(item.filter) : undefined);
|
|
62
62
|
if (isFilterBarFilterPlaceholder(item)) {
|
|
63
63
|
const CreatingPlaceholderComponent = AttributeFilterComponentSet.creating.CreatingPlaceholderComponent;
|
|
64
64
|
return (_jsx(CreatingPlaceholderComponent, { onClose: closeAttributeSelection, onSelect: selectDraggableFilter, attributes: attributes, dateDatasets: allDateDatasets, measures: measures }, item.filterIndex));
|
|
@@ -121,19 +121,20 @@ export function DefaultFilterBarItem(props) {
|
|
|
121
121
|
const CustomMeasureValueFilterComponent = DashboardMeasureValueFilterComponentProvider(filter);
|
|
122
122
|
return (_jsx(DraggableMeasureValueFilter, { autoOpen: areObjRefsEqual(measure, autoOpenFilter), filter: filter, filterIndex: filterIndex, readonly: isReadonly, FilterComponent: CustomMeasureValueFilterComponent, onMeasureValueFilterChanged: onMeasureValueFilterChanged, onMeasureValueFilterAdded: addDraggableFilterPlaceholder, onMeasureValueFilterClose: onCloseAttributeFilter }, localId));
|
|
123
123
|
}
|
|
124
|
-
if (item
|
|
124
|
+
if (isFilterBarDateFilterWithDimension(item)) {
|
|
125
125
|
const { filter, workingFilter, filterIndex } = item;
|
|
126
|
+
const dataSet = dashboardFilterObjRef(filter);
|
|
126
127
|
const CustomDateFilterComponent = DashboardDateFilterOfAnyTypeComponentProvider(filter);
|
|
127
|
-
const dateFilterMode = dateFiltersModeMap.get(serializeObjRef(
|
|
128
|
-
DashboardDateFilterConfigModeValues.ACTIVE;
|
|
128
|
+
const dateFilterMode = dateFiltersModeMap.get(serializeObjRef(dataSet)) || DashboardDateFilterConfigModeValues.ACTIVE;
|
|
129
129
|
if (dateFilterMode === DashboardDateFilterConfigModeValues.HIDDEN) {
|
|
130
130
|
return null;
|
|
131
131
|
}
|
|
132
|
-
const defaultDateFilterName = allDateDatasets.find((ds) => areObjRefsEqual(ds.dataSet.ref,
|
|
133
|
-
|
|
132
|
+
const defaultDateFilterName = allDateDatasets.find((ds) => areObjRefsEqual(ds.dataSet.ref, dataSet))
|
|
133
|
+
?.dataSet?.title;
|
|
134
|
+
return (_jsx(DraggableDateFilter, { autoOpen: areObjRefsEqual(dataSet, autoOpenFilter), filter: filter, workingFilter: isApplyAllAtOnceEnabledAndSet ? workingFilter : undefined, filterIndex: filterIndex, config: {
|
|
134
135
|
...dateFilterConfigNarrowedToDimension,
|
|
135
136
|
customFilterName: defaultDateFilterName,
|
|
136
|
-
}, readonly: dateFilterMode === DashboardDateFilterConfigModeValues.READONLY, FilterComponent: CustomDateFilterComponent, onDateFilterChanged: onDateFilterChanged, onDateFilterAdded: addDraggableFilterPlaceholder, onDateFilterClose: onCloseAttributeFilter }, objRefToString(
|
|
137
|
+
}, readonly: dateFilterMode === DashboardDateFilterConfigModeValues.READONLY, FilterComponent: CustomDateFilterComponent, onDateFilterChanged: onDateFilterChanged, onDateFilterAdded: addDraggableFilterPlaceholder, onDateFilterClose: onCloseAttributeFilter }, objRefToString(dataSet)));
|
|
137
138
|
}
|
|
138
139
|
return null;
|
|
139
140
|
}
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
// (C) 2021-2026 GoodData Corporation
|
|
2
|
-
import { dashboardAttributeFilterItemLocalIdentifier, dashboardFilterLocalIdentifier, isDashboardAttributeFilterItem,
|
|
2
|
+
import { dashboardAttributeFilterItemLocalIdentifier, dashboardFilterLocalIdentifier, isDashboardAttributeFilterItem, isDashboardDateFilterOfAnyType, isDashboardMeasureValueFilter, } from "@gooddata/sdk-model";
|
|
3
3
|
import { isFilterBarFilterGroupItem, isFilterBarFilterPlaceholder, } from "./useFiltersWithAddedPlaceholder.js";
|
|
4
4
|
function findGroupForFilter(item, filterGroupsConfig) {
|
|
5
5
|
return filterGroupsConfig?.groups.find((group) => group.filters.some((filter) => {
|
|
6
6
|
if (isDashboardAttributeFilterItem(item)) {
|
|
7
7
|
return filter.filterLocalIdentifier === dashboardAttributeFilterItemLocalIdentifier(item);
|
|
8
8
|
}
|
|
9
|
-
if (
|
|
10
|
-
return filter.filterLocalIdentifier === item
|
|
9
|
+
if (isDashboardDateFilterOfAnyType(item)) {
|
|
10
|
+
return filter.filterLocalIdentifier === dashboardFilterLocalIdentifier(item);
|
|
11
11
|
}
|
|
12
12
|
if (isDashboardMeasureValueFilter(item)) {
|
|
13
13
|
return filter.filterLocalIdentifier === dashboardFilterLocalIdentifier(item);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"FilterViews.d.ts","sourceRoot":"","sources":["../../../../../src/presentation/filterBar/filterBar/filterViews/FilterViews.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"FilterViews.d.ts","sourceRoot":"","sources":["../../../../../src/presentation/filterBar/filterBar/filterViews/FilterViews.tsx"],"names":[],"mappings":"AAoHA,wBAAgB,WAAW,mDAiI1B"}
|
|
@@ -4,7 +4,7 @@ import { useCallback, useMemo } from "react";
|
|
|
4
4
|
import cx from "classnames";
|
|
5
5
|
import { useIntl } from "react-intl";
|
|
6
6
|
import { v4 as uuid } from "uuid";
|
|
7
|
-
import { UiButton, UiReturnFocusOnUnmount, useIdPrefixed, useMediaQuery, } from "@gooddata/sdk-ui-kit";
|
|
7
|
+
import { UiButton, UiReturnFocusOnUnmount, getFocusableElements, useIdPrefixed, useMediaQuery, } from "@gooddata/sdk-ui-kit";
|
|
8
8
|
import { useDashboardDispatch, useDashboardSelector, } from "../../../../model/react/DashboardStoreProvider.js";
|
|
9
9
|
import { useDashboardUserInteraction } from "../../../../model/react/useDashboardUserInteraction.js";
|
|
10
10
|
import { selectIsAiMode, selectIsApplyFiltersAllAtOnceEnabledAndSet, selectIsReadOnly, } from "../../../../model/store/config/configSelectors.js";
|
|
@@ -97,11 +97,22 @@ export function FilterViews() {
|
|
|
97
97
|
});
|
|
98
98
|
const triggerId = useIdPrefixed("FilterViewsTrigger");
|
|
99
99
|
const dropdownId = useIdPrefixed("FilterViewsDropdown");
|
|
100
|
+
// The panel is portalled to the end of <body>, so Tab from the trigger would follow the DOM order
|
|
101
|
+
// into the dashboard behind the open panel. Send it into the panel instead. While the overlay is
|
|
102
|
+
// still hidden for positioning, focus stays on the trigger and the panel's autofocus takes it as
|
|
103
|
+
// soon as the panel becomes visible.
|
|
104
|
+
const handleTriggerKeyDown = useCallback((event) => {
|
|
105
|
+
if (!isDialogOpen || event.key !== "Tab" || event.shiftKey) {
|
|
106
|
+
return;
|
|
107
|
+
}
|
|
108
|
+
event.preventDefault();
|
|
109
|
+
getFocusableElements(document.getElementById(dropdownId), true).firstElement?.focus();
|
|
110
|
+
}, [isDialogOpen, dropdownId]);
|
|
100
111
|
const isReadOnly = useDashboardSelector(selectIsReadOnly);
|
|
101
112
|
if (isReadOnly) {
|
|
102
113
|
return null;
|
|
103
114
|
}
|
|
104
|
-
return (_jsxs("div", { className: "gd-filter-views", children: [showDropdownButton ? (_jsxs(_Fragment, { children: [_jsx("div", { className: buttonWrapperClassNames, children: _jsx(UiButton, { id: triggerId, variant: "tertiary",
|
|
115
|
+
return (_jsxs("div", { className: "gd-filter-views", children: [showDropdownButton ? (_jsxs(_Fragment, { children: [_jsx("div", { className: buttonWrapperClassNames, onKeyDown: handleTriggerKeyDown, children: _jsx(UiButton, { id: triggerId, variant: "tertiary",
|
|
105
116
|
// tertiary has no padding, so size only drives font-size and height;
|
|
106
117
|
// "medium" keeps the 14px label the button had in both densities
|
|
107
118
|
size: "medium", label: getButtonLabel(intl, filterViews), iconAfter: isDialogOpen ? "navigateUp" : "navigateDown", onClick: toggleDialog, dataTestId: "filter-views-button", accessibilityConfig: {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { type DashboardAttributeFilterItem, type DashboardDateFilterOfAnyType, type FilterContextItem, type
|
|
1
|
+
import { type DashboardAttributeFilterItem, type DashboardDateFilterOfAnyType, type FilterContextItem, type IDashboardFilterGroup, type IDashboardMeasureValueFilter, type ObjRef } from "@gooddata/sdk-model";
|
|
2
2
|
import { type DashboardFilterSelectionType } from "../filterSelectionTypes.js";
|
|
3
3
|
/**
|
|
4
4
|
* @internal
|
|
@@ -33,9 +33,9 @@ export type FilterBarAttributeItems = FilterBarAttributeItem[];
|
|
|
33
33
|
* @internal
|
|
34
34
|
*/
|
|
35
35
|
export type FilterBarDateFilterIndexed = {
|
|
36
|
-
filter:
|
|
36
|
+
filter: DashboardDateFilterOfAnyType;
|
|
37
37
|
filterIndex: number;
|
|
38
|
-
workingFilter?:
|
|
38
|
+
workingFilter?: DashboardDateFilterOfAnyType;
|
|
39
39
|
};
|
|
40
40
|
/**
|
|
41
41
|
* @internal
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useFiltersWithAddedPlaceholder.d.ts","sourceRoot":"","sources":["../../../../src/presentation/filterBar/filterBar/useFiltersWithAddedPlaceholder.tsx"],"names":[],"mappings":"AAIA,OAAO,EACH,KAAK,4BAA4B,EACjC,KAAK,4BAA4B,EACjC,KAAK,iBAAiB,EACtB,KAAK,
|
|
1
|
+
{"version":3,"file":"useFiltersWithAddedPlaceholder.d.ts","sourceRoot":"","sources":["../../../../src/presentation/filterBar/filterBar/useFiltersWithAddedPlaceholder.tsx"],"names":[],"mappings":"AAIA,OAAO,EACH,KAAK,4BAA4B,EACjC,KAAK,4BAA4B,EACjC,KAAK,iBAAiB,EACtB,KAAK,qBAAqB,EAC1B,KAAK,4BAA4B,EACjC,KAAK,MAAM,EASd,MAAM,qBAAqB,CAAC;AAiB7B,OAAO,EAAE,KAAK,4BAA4B,EAAE,MAAM,4BAA4B,CAAC;AAE/E;;GAEG;AACH,MAAM,MAAM,0BAA0B,GAAG;IACrC,IAAI,EAAE,mBAAmB,CAAC;IAC1B,WAAW,EAAE,MAAM,CAAC;IACpB,WAAW,CAAC,EAAE,MAAM,CAAC;CACxB,CAAC;AAEF;;GAEG;AACH,wBAAgB,4BAA4B,CAAC,MAAM,EAAE,GAAG,GAAG,MAAM,IAAI,0BAA0B,CAE9F;AAED;;GAEG;AACH,MAAM,MAAM,+BAA+B,GAAG;IAC1C,MAAM,EAAE,4BAA4B,CAAC;IACrC,WAAW,EAAE,MAAM,CAAC;IACpB,aAAa,CAAC,EAAE,4BAA4B,CAAC;CAChD,CAAC;AAEF;;GAEG;AACH,MAAM,MAAM,sBAAsB,GAAG,0BAA0B,GAAG,+BAA+B,CAAC;AAClG,wBAAgB,0BAA0B,CAAC,MAAM,EAAE,GAAG,GAAG,MAAM,IAAI,+BAA+B,CAEjG;AAED;;GAEG;AACH,MAAM,MAAM,uBAAuB,GAAG,sBAAsB,EAAE,CAAC;AAE/D;;GAEG;AACH,MAAM,MAAM,0BAA0B,GAAG;IACrC,MAAM,EAAE,4BAA4B,CAAC;IACrC,WAAW,EAAE,MAAM,CAAC;IACpB,aAAa,CAAC,EAAE,4BAA4B,CAAC;CAChD,CAAC;AAEF;;GAEG;AACH,wBAAgB,kCAAkC,CAC9C,MAAM,EAAE,aAAa,GACtB,MAAM,IAAI,0BAA0B,CAUtC;AAED;;GAEG;AACH,MAAM,MAAM,kCAAkC,GAAG;IAC7C,MAAM,EAAE,4BAA4B,CAAC;IACrC,WAAW,EAAE,MAAM,CAAC;CACvB,CAAC;AAEF;;GAEG;AACH,wBAAgB,6BAA6B,CACzC,MAAM,EAAE,aAAa,GACtB,MAAM,IAAI,kCAAkC,CAK9C;AAED;;GAEG;AACH,MAAM,WAAW,yBAAyB;IACtC,WAAW,EAAE,MAAM,CAAC;IACpB,WAAW,EAAE,qBAAqB,CAAC;IACnC,OAAO,EAAE,aAAa,EAAE,CAAC;CAC5B;AAED;;GAEG;AACH,wBAAgB,0BAA0B,CAAC,MAAM,CAAC,EAAE,aAAa,uCAEhE;AAED;;GAEG;AACH,MAAM,MAAM,aAAa,GACnB,0BAA0B,GAC1B,+BAA+B,GAC/B,0BAA0B,GAC1B,kCAAkC,GAClC,yBAAyB,CAAC;AAEhC;;GAEG;AACH,MAAM,MAAM,uBAAuB,GAAG,aAAa,EAAE,CAAC;AAYtD;;GAEG;AACH,wBAAgB,8BAA8B,CAC1C,OAAO,EAAE,iBAAiB,EAAE,EAC5B,cAAc,CAAC,EAAE,iBAAiB,EAAE,GACrC;IACC;QACI,gBAAgB,EAAE,4BAA4B,CAAC;QAC/C,uBAAuB,CAAC,EAAE,4BAA4B,CAAC;QACvD,+BAA+B,EAAE,uBAAuB,CAAC;QACzD,qBAAqB,EAAE,MAAM,CAAC;QAC9B,cAAc,EAAE,MAAM,GAAG,SAAS,CAAC;KACtC;IACD;QACI,6BAA6B,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;QACvD,qBAAqB,EAAE,CAAC,GAAG,EAAE,MAAM,EAAE,aAAa,CAAC,EAAE,4BAA4B,KAAK,IAAI,CAAC;QAC3F,uBAAuB,EAAE,MAAM,IAAI,CAAC;QACpC,sBAAsB,EAAE,MAAM,IAAI,CAAC;KACtC;CACJ,CA2OA"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
// (C) 2021-2026 GoodData Corporation
|
|
2
2
|
import { useCallback, useMemo, useState } from "react";
|
|
3
|
-
import { areObjRefsEqual, dashboardAttributeFilterItemDisplayForm, dashboardFilterObjRef, isDashboardAttributeFilterItem, isDashboardCommonDateFilterOfAnyType,
|
|
3
|
+
import { areObjRefsEqual, dashboardAttributeFilterItemDisplayForm, dashboardFilterObjRef, isDashboardAttributeFilterItem, isDashboardCommonDateFilterOfAnyType, isDashboardDateFilterOfAnyType, isDashboardDateFilterWithDimensionOfAnyType, isDashboardMeasureValueFilter, } from "@gooddata/sdk-model";
|
|
4
4
|
import { _partition } from "@gooddata/util";
|
|
5
5
|
import { addAttributeFilter as addAttributeFilterAction, addDateFilter as addDateFilterAction, addMeasureValueFilter as addMeasureValueFilterAction, } from "../../../model/commands/filters.js";
|
|
6
6
|
import { useDashboardDispatch, useDashboardSelector } from "../../../model/react/DashboardStoreProvider.js";
|
|
@@ -25,8 +25,8 @@ export function isFilterBarDateFilterWithDimension(object) {
|
|
|
25
25
|
if (!isFilterBarFilterPlaceholder(object) &&
|
|
26
26
|
!isFilterBarFilterGroupItem(object) &&
|
|
27
27
|
!isFilterBarMeasureValueFilter(object) &&
|
|
28
|
-
|
|
29
|
-
return
|
|
28
|
+
isDashboardDateFilterOfAnyType(object.filter)) {
|
|
29
|
+
return isDashboardDateFilterWithDimensionOfAnyType(object.filter);
|
|
30
30
|
}
|
|
31
31
|
return false;
|
|
32
32
|
}
|
|
@@ -47,7 +47,7 @@ export function isFilterBarFilterGroupItem(object) {
|
|
|
47
47
|
}
|
|
48
48
|
function isNotDashboardCommonDateFilter(obj) {
|
|
49
49
|
return (isDashboardAttributeFilterItem(obj) ||
|
|
50
|
-
|
|
50
|
+
isDashboardDateFilterWithDimensionOfAnyType(obj) ||
|
|
51
51
|
isDashboardMeasureValueFilter(obj));
|
|
52
52
|
}
|
|
53
53
|
/**
|
|
@@ -63,7 +63,7 @@ export function useFiltersWithAddedPlaceholder(filters, workingFilters) {
|
|
|
63
63
|
// nonDraggableFilters may contain new filter types (arbitrary, match) alongside the common date filter.
|
|
64
64
|
// Use a cast since TypeScript cannot narrow FilterContextItem exclusions through .find().
|
|
65
65
|
const commonDateFilter = nonDraggableFilters.find((f) => isDashboardCommonDateFilterOfAnyType(f));
|
|
66
|
-
const [dateFiltersWithDimensions, attributeFilters] = _partition(draggableFilters,
|
|
66
|
+
const [dateFiltersWithDimensions, attributeFilters] = _partition(draggableFilters, isDashboardDateFilterWithDimensionOfAnyType);
|
|
67
67
|
const [selectedDisplayForm, setSelectedDisplayForm] = useState();
|
|
68
68
|
const [autoOpenFilter, setAutoOpenFilter] = useState();
|
|
69
69
|
const addedAttributeFilter = useMemo(() => {
|
|
@@ -114,7 +114,7 @@ export function useFiltersWithAddedPlaceholder(filters, workingFilters) {
|
|
|
114
114
|
};
|
|
115
115
|
}
|
|
116
116
|
const workingFilter = workingFilters
|
|
117
|
-
?.filter(
|
|
117
|
+
?.filter(isDashboardDateFilterOfAnyType)
|
|
118
118
|
.find((wf) => getFilterIdentifier(wf) === getFilterIdentifier(filter)) ?? filter;
|
|
119
119
|
return {
|
|
120
120
|
filter,
|
|
@@ -130,7 +130,7 @@ export function useFiltersWithAddedPlaceholder(filters, workingFilters) {
|
|
|
130
130
|
if (isDashboardMeasureValueFilter(draggableFilter)) {
|
|
131
131
|
return areObjRefsEqual(dashboardFilterObjRef(draggableFilter), selectedDisplayForm);
|
|
132
132
|
}
|
|
133
|
-
return areObjRefsEqual(draggableFilter
|
|
133
|
+
return areObjRefsEqual(dashboardFilterObjRef(draggableFilter), selectedDisplayForm);
|
|
134
134
|
});
|
|
135
135
|
if (addedAttributeFilter === undefined || containsAddedAttributeDisplayForm) {
|
|
136
136
|
return filterObjects;
|
|
@@ -162,10 +162,10 @@ export function useFiltersWithAddedPlaceholder(filters, workingFilters) {
|
|
|
162
162
|
// date filter added
|
|
163
163
|
if (selectionType === "dateDataset") {
|
|
164
164
|
const relatedDateDataset = dateDatasetsMap.get(ref);
|
|
165
|
-
const usedDateDataset = dateFiltersWithDimensions.find((df) => areObjRefsEqual(df
|
|
165
|
+
const usedDateDataset = dateFiltersWithDimensions.find((df) => areObjRefsEqual(dashboardFilterObjRef(df), relatedDateDataset?.dataSet.ref));
|
|
166
166
|
// We allowed just one dateFilter for one date dimension,
|
|
167
167
|
if (usedDateDataset) {
|
|
168
|
-
setAutoOpenFilter(usedDateDataset
|
|
168
|
+
setAutoOpenFilter(dashboardFilterObjRef(usedDateDataset));
|
|
169
169
|
clearAddedFilter();
|
|
170
170
|
}
|
|
171
171
|
else {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../../src/presentation/filterBar/utils.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,KAAK,SAAS,EAAE,MAAM,YAAY,CAAC;AAE5C,OAAO,EACH,KAAK,kCAAkC,EAEvC,KAAK,6BAA6B,
|
|
1
|
+
{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../../src/presentation/filterBar/utils.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,KAAK,SAAS,EAAE,MAAM,YAAY,CAAC;AAE5C,OAAO,EACH,KAAK,kCAAkC,EAEvC,KAAK,6BAA6B,EAOrC,MAAM,qBAAqB,CAAC;AAC7B,OAAO,EAAE,KAAK,uBAAuB,EAAE,KAAK,cAAc,EAAE,MAAM,0BAA0B,CAAC;AAI7F,OAAO,EACH,KAAK,uBAAuB,EAM/B,MAAM,+CAA+C,CAAC;AAGvD,eAAO,MAAM,6BAA6B,WAAY,OAAO,KAAG,OACN,CAAC;AAM3D,eAAO,MAAM,iBAAiB,SACpB,cAAc,GAAG,SAAS,gBAClB,OAAO,sCACe,OAAO,QACrC,SAAS,KAChB,uBAAuB,GAAG,SA0B5B,CAAC;AAEF,eAAO,MAAM,mBAAmB,qBACV,uBAAuB,0BACjB,6BAA6B,mCACpB,GAAG,CAAC,MAAM,EAAE,kCAAkC,CAAC,8BACpD,GAAG,CAAC,MAAM,EAAE,6BAA6B,CAAC,uCAClC,GAAG,CAAC,MAAM,EAAE,kCAAkC,CAAC,YAetF,CAAC"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
// (C) 2023-2026 GoodData Corporation
|
|
2
|
-
import { DashboardAttributeFilterConfigModeValues, DashboardDateFilterConfigModeValues, dashboardAttributeFilterItemLocalIdentifier, dashboardFilterLocalIdentifier, isDashboardDateFilter, serializeObjRef, } from "@gooddata/sdk-model";
|
|
2
|
+
import { DashboardAttributeFilterConfigModeValues, DashboardDateFilterConfigModeValues, dashboardAttributeFilterItemLocalIdentifier, dashboardFilterLocalIdentifier, dashboardFilterObjRef, isDashboardDateFilter, serializeObjRef, } from "@gooddata/sdk-model";
|
|
3
3
|
import { messages } from "../../locales.js";
|
|
4
4
|
import { isFilterBarAttributeFilter, isFilterBarDateFilterWithDimension, isFilterBarFilterPlaceholder, isFilterBarMeasureValueFilter, } from "./filterBar/useFiltersWithAddedPlaceholder.js";
|
|
5
5
|
// callers without types can pass another date filter type, which the filter bar cannot apply
|
|
@@ -71,7 +71,7 @@ const isDateFilterHidden = (filter, dateFiltersModeMap) => {
|
|
|
71
71
|
return false;
|
|
72
72
|
}
|
|
73
73
|
if (isFilterBarDateFilterWithDimension(filter)) {
|
|
74
|
-
const dateFilterMode = dateFiltersModeMap.get(serializeObjRef(filter.filter
|
|
74
|
+
const dateFilterMode = dateFiltersModeMap.get(serializeObjRef(dashboardFilterObjRef(filter.filter)));
|
|
75
75
|
return dateFilterMode === DashboardDateFilterConfigModeValues.HIDDEN;
|
|
76
76
|
}
|
|
77
77
|
return false;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DefaultMenuButton.d.ts","sourceRoot":"","sources":["../../../../src/presentation/topBar/menuButton/DefaultMenuButton.tsx"],"names":[],"mappings":"AAEA,OAAO,EAGH,KAAK,YAAY,EAOpB,MAAM,OAAO,CAAC;AA4Bf,OAAO,EAIH,KAAK,gBAAgB,EACxB,MAAM,YAAY,CAAC;AASpB;;GAEG;AACH,wBAAgB,iBAAiB,CAAC,EAAE,SAAS,EAAE,SAAgB,EAAE,EAAE,gBAAgB,GAAG,YAAY,GAAG,IAAI,
|
|
1
|
+
{"version":3,"file":"DefaultMenuButton.d.ts","sourceRoot":"","sources":["../../../../src/presentation/topBar/menuButton/DefaultMenuButton.tsx"],"names":[],"mappings":"AAEA,OAAO,EAGH,KAAK,YAAY,EAOpB,MAAM,OAAO,CAAC;AA4Bf,OAAO,EAIH,KAAK,gBAAgB,EACxB,MAAM,YAAY,CAAC;AASpB;;GAEG;AACH,wBAAgB,iBAAiB,CAAC,EAAE,SAAS,EAAE,SAAgB,EAAE,EAAE,gBAAgB,GAAG,YAAY,GAAG,IAAI,CAySxG"}
|
|
@@ -45,10 +45,14 @@ export function DefaultMenuButton({ menuItems, isEnabled = true }) {
|
|
|
45
45
|
// autofocus is retried once the alignment is done (same as Dropdown does with `autofocusOnOpen`).
|
|
46
46
|
const [isOverlayAligned, setIsOverlayAligned] = useState(false);
|
|
47
47
|
const onOverlayAlign = useCallback(() => setIsOverlayAligned(true), []);
|
|
48
|
+
// Set when the menu is opened from the keyboard: focus moves to the first item as soon as
|
|
49
|
+
// the menu is aligned and visible (focus cannot move into the hidden Overlay before that).
|
|
50
|
+
const [shouldFocusFirstItem, setShouldFocusFirstItem] = useState(false);
|
|
48
51
|
const onMenuButtonClick = useCallback(() => {
|
|
49
52
|
setIsOpen((prevIsOpen) => !prevIsOpen);
|
|
50
53
|
setSelectedMenuItem(null);
|
|
51
54
|
setIsOverlayAligned(false);
|
|
55
|
+
setShouldFocusFirstItem(false);
|
|
52
56
|
}, []);
|
|
53
57
|
// Returns the menu items in the order they are rendered. The map order is not reliable,
|
|
54
58
|
// because an item whose ref callback changes is removed from the map and added again at its end.
|
|
@@ -58,6 +62,7 @@ export function DefaultMenuButton({ menuItems, isEnabled = true }) {
|
|
|
58
62
|
setSelectedMenuItem(null);
|
|
59
63
|
setParentItemId(null);
|
|
60
64
|
setAutofocusSubmenu(false);
|
|
65
|
+
setShouldFocusFirstItem(false);
|
|
61
66
|
}, []);
|
|
62
67
|
const openSubmenu = useCallback((menuItem) => {
|
|
63
68
|
setAutofocusSubmenu(true);
|
|
@@ -139,21 +144,43 @@ export function DefaultMenuButton({ menuItems, isEnabled = true }) {
|
|
|
139
144
|
setParentItemId(null);
|
|
140
145
|
}
|
|
141
146
|
}, [selectedMenuItem, parentItemId, menuItemRefs, autofocusSubmenu, getMenuItemElements]);
|
|
142
|
-
//
|
|
143
|
-
|
|
144
|
-
|
|
147
|
+
// Header items are registered too, but they are not focusable, so skip them.
|
|
148
|
+
const focusFirstMenuItem = useCallback(() => {
|
|
149
|
+
const firstItem = getMenuItemElements().find((element) => element.getAttribute("role") === "menuitem");
|
|
150
|
+
firstItem?.focus();
|
|
151
|
+
return !!firstItem && document.activeElement === firstItem;
|
|
152
|
+
}, [getMenuItemElements]);
|
|
153
|
+
useEffect(() => {
|
|
154
|
+
if (shouldFocusFirstItem && isOpen && isOverlayAligned && focusFirstMenuItem()) {
|
|
155
|
+
setShouldFocusFirstItem(false);
|
|
156
|
+
}
|
|
157
|
+
}, [shouldFocusFirstItem, isOpen, isOverlayAligned, focusFirstMenuItem]);
|
|
158
|
+
// Menu button pattern: Enter, Space and Down Arrow on the trigger open the menu and move focus
|
|
159
|
+
// to its first item. When the menu is already open, focus moves to its first item directly.
|
|
160
|
+
// The key is consumed here (no native click, no further handling), so a single keypress moves
|
|
161
|
+
// focus by exactly one step.
|
|
145
162
|
const onTriggerKeyDown = useCallback((event) => {
|
|
146
|
-
|
|
163
|
+
const isArrowDown = event.code === "ArrowDown" || event.key === "ArrowDown";
|
|
164
|
+
if (!isArrowDown && !isActionKey(event)) {
|
|
147
165
|
return;
|
|
148
166
|
}
|
|
149
167
|
event.preventDefault();
|
|
150
168
|
event.stopPropagation();
|
|
169
|
+
if (event.repeat) {
|
|
170
|
+
return;
|
|
171
|
+
}
|
|
151
172
|
if (isOpen) {
|
|
152
|
-
|
|
173
|
+
if (isArrowDown) {
|
|
174
|
+
focusFirstMenuItem();
|
|
175
|
+
}
|
|
176
|
+
else {
|
|
177
|
+
onClose();
|
|
178
|
+
}
|
|
153
179
|
return;
|
|
154
180
|
}
|
|
155
181
|
onMenuButtonClick();
|
|
156
|
-
|
|
182
|
+
setShouldFocusFirstItem(true);
|
|
183
|
+
}, [isOpen, focusFirstMenuItem, onMenuButtonClick, onClose]);
|
|
157
184
|
useEffect(() => {
|
|
158
185
|
if (!isEnabled && isOpen) {
|
|
159
186
|
onClose();
|
|
@@ -4,7 +4,7 @@ import { useCallback, useState } from "react";
|
|
|
4
4
|
import { useDashboardSelector } from "../../../../model/react/DashboardStoreProvider.js";
|
|
5
5
|
import { selectAllCatalogDateDatasetsMap, selectCatalogDateDatasets, } from "../../../../model/store/catalog/catalogSelectors.js";
|
|
6
6
|
import { selectEnableUnavailableItemsVisibility } from "../../../../model/store/config/configSelectors.js";
|
|
7
|
-
import {
|
|
7
|
+
import { selectFilterContextDateFilterOfAnyTypeByDataSet } from "../../../../model/store/tabs/filterContext/filterContextSelectors.js";
|
|
8
8
|
import { DateDatasetDuplicityWarning } from "./DateDatasetDuplicityWarning.js";
|
|
9
9
|
import { DateDatasetPicker } from "./DateDatasetPicker.js";
|
|
10
10
|
import { DateFilterCheckbox } from "./DateFilterCheckbox.js";
|
|
@@ -16,7 +16,7 @@ export function DateDatasetFilter({ relatedDateDatasets, widget, dateFilterCheck
|
|
|
16
16
|
const catalogDatasetsMap = useDashboardSelector(selectAllCatalogDateDatasetsMap);
|
|
17
17
|
const selectedDateDataset = widget.dateDataSet && catalogDatasetsMap.get(widget.dateDataSet);
|
|
18
18
|
const dateDatasets = useDashboardSelector(selectCatalogDateDatasets);
|
|
19
|
-
const duplicatedDateDatasetFilter = useDashboardSelector(
|
|
19
|
+
const duplicatedDateDatasetFilter = useDashboardSelector(selectFilterContextDateFilterOfAnyTypeByDataSet(widget.dateDataSet));
|
|
20
20
|
const { selectedDateDatasetHiddenByObjectAvailability, status: visibleDateDatasetsStatus } = useIsSelectedDatasetHidden(selectedDateDataset?.dataSet.ref);
|
|
21
21
|
const [isDateFilterEnabled, setIsDateFilterEnabled] = useState(!!widget.dateDataSet || shouldPickDateDataset || isLoadingAdditionalData);
|
|
22
22
|
const { handleDateDatasetChanged: handleDateDatasetChangedCore, handleDateFilterEnabled, status, } = useDateFilterConfigurationHandling(widget, relatedDateDatasets, setIsDateFilterEnabled);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"FilterConfiguration.d.ts","sourceRoot":"","sources":["../../../../../src/presentation/widget/common/configuration/FilterConfiguration.tsx"],"names":[],"mappings":"AAMA,OAAO,EACH,KAAK,OAAO,
|
|
1
|
+
{"version":3,"file":"FilterConfiguration.d.ts","sourceRoot":"","sources":["../../../../../src/presentation/widget/common/configuration/FilterConfiguration.tsx"],"names":[],"mappings":"AAMA,OAAO,EACH,KAAK,OAAO,EAaf,MAAM,qBAAqB,CAAC;AAqB7B,UAAU,yBAAyB;IAC/B,MAAM,EAAE,OAAO,CAAC;CACnB;AAED,wBAAgB,mBAAmB,CAAC,EAAE,MAAM,EAAE,EAAE,yBAAyB,kDA2HxE"}
|
|
@@ -2,7 +2,7 @@ import { jsx as _jsx } from "react/jsx-runtime";
|
|
|
2
2
|
// (C) 2022-2026 GoodData Corporation
|
|
3
3
|
import { useMemo } from "react";
|
|
4
4
|
import { invariant } from "ts-invariant";
|
|
5
|
-
import { dashboardAttributeFilterItemDisplayForm, dashboardAttributeFilterItemLocalIdentifier, dashboardAttributeFilterItemTitle, insightFilters, isAttributeMetadataObject, isDashboardAttributeFilterItem,
|
|
5
|
+
import { dashboardAttributeFilterItemDisplayForm, dashboardAttributeFilterItemLocalIdentifier, dashboardAttributeFilterItemTitle, dashboardFilterObjRef, insightFilters, isAttributeMetadataObject, isDashboardAttributeFilterItem, isDashboardDateFilterWithDimensionOfAnyType, isDashboardMeasureValueFilter, isInsightWidget, isRankingFilter, objRefToString, } from "@gooddata/sdk-model";
|
|
6
6
|
import { useAttributeFilterDisplayFormFromMap } from "../../../../_staging/sharedHooks/useAttributeFilterDisplayFormFromMap.js";
|
|
7
7
|
import { useAttributes } from "../../../../_staging/sharedHooks/useAttributes.js";
|
|
8
8
|
import { useDashboardSelector } from "../../../../model/react/DashboardStoreProvider.js";
|
|
@@ -25,7 +25,7 @@ export function FilterConfiguration({ widget }) {
|
|
|
25
25
|
const displayAsLabelMap = useDashboardSelector(selectAttributeFilterConfigsDisplayAsLabelMap);
|
|
26
26
|
const draggableFilters = useMemo(() => {
|
|
27
27
|
return filters.filter((f) => isDashboardAttributeFilterItem(f) ||
|
|
28
|
-
|
|
28
|
+
isDashboardDateFilterWithDimensionOfAnyType(f) ||
|
|
29
29
|
isDashboardMeasureValueFilter(f));
|
|
30
30
|
}, [filters]);
|
|
31
31
|
const attributeFilters = useMemo(() => {
|
|
@@ -67,8 +67,9 @@ export function FilterConfiguration({ widget }) {
|
|
|
67
67
|
: undefined;
|
|
68
68
|
return (_jsx(AttributeFilterConfigurationItem, { displayFormRef: displayForm.ref, displayAsLabel: displayAsLabel, title: dashboardAttributeFilterItemTitle(filter) ?? attributeTitle, widget: widget }, objRefToString(displayForm.ref)));
|
|
69
69
|
}
|
|
70
|
-
else if (
|
|
71
|
-
|
|
70
|
+
else if (isDashboardDateFilterWithDimensionOfAnyType(filter)) {
|
|
71
|
+
const dataSet = dashboardFilterObjRef(filter);
|
|
72
|
+
return (_jsx(DateFilterConfigurationItem, { dataSetRef: dataSet, widget: widget }, objRefToString(dataSet)));
|
|
72
73
|
}
|
|
73
74
|
else if (isDashboardMeasureValueFilter(filter)) {
|
|
74
75
|
const { measure, localIdentifier, title } = filter.dashboardMeasureValueFilter;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DrillDialogInsight.d.ts","sourceRoot":"","sources":["../../../../../../src/presentation/widget/insight/ViewModeDashboardInsight/InsightDrillDialog/DrillDialogInsight.tsx"],"names":[],"mappings":"AAEA,OAAO,EAEH,KAAK,YAAY,EAMpB,MAAM,OAAO,CAAC;AAsCf,OAAO,EAAE,KAAK,sBAAsB,EAAE,MAAM,gBAAgB,CAAC;
|
|
1
|
+
{"version":3,"file":"DrillDialogInsight.d.ts","sourceRoot":"","sources":["../../../../../../src/presentation/widget/insight/ViewModeDashboardInsight/InsightDrillDialog/DrillDialogInsight.tsx"],"names":[],"mappings":"AAEA,OAAO,EAEH,KAAK,YAAY,EAMpB,MAAM,OAAO,CAAC;AAsCf,OAAO,EAAE,KAAK,sBAAsB,EAAE,MAAM,gBAAgB,CAAC;AAyC7D;;GAEG;AACH,wBAAgB,kBAAkB,CAAC,EAC/B,OAAO,EACP,MAAM,EACN,OAAO,EACP,SAAS,EACT,SAAS,EACT,OAAO,EACP,OAAO,EAAE,SAAS,EAClB,eAAe,EACf,aAAa,EACb,gBAAgB,EAChB,oBAAoB,EACpB,QAAQ,EACR,cAAc,EACd,gBAAgB,GACnB,EAAE,sBAAsB,GAAG,YAAY,CAoKvC"}
|
|
@@ -2,7 +2,7 @@ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
|
2
2
|
// (C) 2020-2026 GoodData Corporation
|
|
3
3
|
import { useCallback, useEffect, useMemo, useRef, useState, } from "react";
|
|
4
4
|
import { createSelector } from "@reduxjs/toolkit";
|
|
5
|
-
import { insightSetFilters } from "@gooddata/sdk-model";
|
|
5
|
+
import { insightSetFilters, insightTitle } from "@gooddata/sdk-model";
|
|
6
6
|
import { useBackendStrict, useWorkspaceStrict, } from "@gooddata/sdk-ui";
|
|
7
7
|
import { convertInsightToLayerTables, convertInsightToTableDefinition, getGeoTableDisplayFormRefs, } from "@gooddata/sdk-ui-ext";
|
|
8
8
|
import { useDashboardSelector } from "../../../../../model/react/DashboardStoreProvider.js";
|
|
@@ -18,6 +18,7 @@ import { InsightBody } from "../../InsightBody.js";
|
|
|
18
18
|
import { CustomError } from "../CustomError/CustomError.js";
|
|
19
19
|
import { useInsightPositionStyle } from "../useInsightPositionStyle.js";
|
|
20
20
|
import { useResolveDashboardInsightProperties } from "../useResolveDashboardInsightProperties.js";
|
|
21
|
+
import { getDrillDialogInsightDescription } from "./getDrillDialogInsightDescription.js";
|
|
21
22
|
import { useDrillDialogInsightDrills } from "./useDrillDialogInsightDrills.js";
|
|
22
23
|
import { useDrillDialogSyncInsightProperties } from "./useDrillDialogSyncInsightProperties.js";
|
|
23
24
|
import { useExcludedDrillDefinitionFilters } from "./useExcludedDrillDefinitionFilters.js";
|
|
@@ -116,7 +117,13 @@ export function DrillDialogInsight({ insight, widget, backend, workspace, drillS
|
|
|
116
117
|
onWidgetFiltersReady?.(filtersForInsight);
|
|
117
118
|
}, [filtersForInsight, onWidgetFiltersReady]);
|
|
118
119
|
const execConfig = useWidgetExecConfig(widget.ref, insight);
|
|
120
|
+
// The widget is the drill source; the visualization rendered here is the drilled insight,
|
|
121
|
+
// so its accessible name must come from the insight, not from the source widget. The description
|
|
122
|
+
// is the same one the drill dialog shows (it respects the widget's description configuration).
|
|
123
|
+
const drilledInsightTitle = insightTitle(insight);
|
|
124
|
+
const drilledInsightDescription = getDrillDialogInsightDescription(widget, insight.insight) ?? "";
|
|
125
|
+
const insightBodyWidget = useMemo(() => ({ ...widget, title: drilledInsightTitle, description: drilledInsightDescription }), [widget, drilledInsightTitle, drilledInsightDescription]);
|
|
119
126
|
return (_jsx("div", { style: insightStyle, children: _jsx("div", { style: insightPositionStyle, children: _jsxs(IntlWrapper, { locale: locale, children: [filtersStatus === "running" || isVisualizationLoading ? _jsx(LoadingComponent, {}) : null, effectiveError ? (_jsx(CustomError, { error: effectiveError, widget: widget,
|
|
120
127
|
// drill dialog does not measure its size but is always large enough to fit the full content
|
|
121
|
-
forceFullContent: true })) : null, filtersStatus === "success" ? (_jsx("div", { ref: visualizationContainerRef, className: "insight-view-visualization", style: insightWrapperStyle, children: _jsx(InsightBody, { widget:
|
|
128
|
+
forceFullContent: true })) : null, filtersStatus === "success" ? (_jsx("div", { ref: visualizationContainerRef, className: "insight-view-visualization", style: insightWrapperStyle, children: _jsx(InsightBody, { widget: insightBodyWidget, insight: finalInsight, layerTables: layerTables && layerTables.length > 1 ? layerTables : undefined, backend: effectiveBackend, workspace: effectiveWorkspace, drillableItems: drillableItems, onDrill: onDrill, config: chartConfig, onLoadingChanged: handleLoadingChanged, locale: locale, settings: settings, permissions: permissions, colorPalette: colorPalette, onError: handleError, onExportReady: onExportReady, pushData: handlePushData, ErrorComponent: ErrorComponent, LoadingComponent: LoadingComponent, execConfig: execConfig, drillStep: drillStep }) })) : null] }) }) }));
|
|
122
129
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"InsightDrillDialog.d.ts","sourceRoot":"","sources":["../../../../../../src/presentation/widget/insight/ViewModeDashboardInsight/InsightDrillDialog/InsightDrillDialog.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAsB,KAAK,YAAY,EAAyB,MAAM,OAAO,CAAC;AAKrF,OAAO,EAEH,KAAK,QAAQ,EACb,KAAK,cAAc,
|
|
1
|
+
{"version":3,"file":"InsightDrillDialog.d.ts","sourceRoot":"","sources":["../../../../../../src/presentation/widget/insight/ViewModeDashboardInsight/InsightDrillDialog/InsightDrillDialog.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAsB,KAAK,YAAY,EAAyB,MAAM,OAAO,CAAC;AAKrF,OAAO,EAEH,KAAK,QAAQ,EACb,KAAK,cAAc,EAItB,MAAM,qBAAqB,CAAC;AAC7B,OAAO,EAAE,KAAK,OAAO,EAAyB,MAAM,kBAAkB,CAAC;AAwBvE,OAAO,EAAE,KAAK,UAAU,EAAE,KAAK,gBAAgB,EAAE,KAAK,kBAAkB,EAAE,MAAM,4BAA4B,CAAC;AAgB7G;;GAEG;AACH,MAAM,WAAW,wBAAwB;IACrC,sBAAsB,EAAE,OAAO,CAAC;IAChC,MAAM,EAAE,OAAO,CAAC;IAChB,WAAW,EAAE,MAAM,EAAE,CAAC;IACtB,MAAM,EAAE,cAAc,CAAC;IACvB,OAAO,EAAE,QAAQ,CAAC;IAClB,SAAS,EAAE,UAAU,CAAC;IACtB,WAAW,CAAC,EAAE,kBAAkB,CAAC;IACjC,OAAO,EAAE,MAAM,IAAI,CAAC;IACpB,iBAAiB,EAAE,MAAM,IAAI,CAAC;IAC9B,oBAAoB,CAAC,EAAE,CAAC,KAAK,CAAC,EAAE,OAAO,KAAK,IAAI,CAAC;IACjD,YAAY,CAAC,EAAE,gBAAgB,CAAC;CACnC;AAWD,wBAAgB,kBAAkB,CAAC,KAAK,EAAE,wBAAwB,GAAG,YAAY,CA4MhF"}
|
|
@@ -3,7 +3,7 @@ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
|
3
3
|
import { useCallback, useState } from "react";
|
|
4
4
|
import cx from "classnames";
|
|
5
5
|
import { useIntl } from "react-intl";
|
|
6
|
-
import { insightTitle, insightVisualizationType,
|
|
6
|
+
import { insightTitle, insightVisualizationType, } from "@gooddata/sdk-model";
|
|
7
7
|
import { supportsShowAsTable } from "@gooddata/sdk-ui-ext";
|
|
8
8
|
import { Button, FLOATING_ELEMENT_DATA_ATTR, FullScreenOverlay, Overlay, OverlayController, OverlayControllerProvider, RichText, UiIcon, UiTooltip, isNotDocumentFocused, useIdPrefixed, useMediaQuery, } from "@gooddata/sdk-ui-kit";
|
|
9
9
|
import { DOWNLOADER_ID } from "../../../../../_staging/fileUtils/downloadFile.js";
|
|
@@ -21,6 +21,7 @@ import { useInsightWarning } from "../../../widget/InsightWidget/useInsightWarni
|
|
|
21
21
|
import { InsightWidgetWarningPartialResult } from "../../../widget/warningPartialResult/InsightWidgetWarningPartialResult.js";
|
|
22
22
|
import { DrillDialog } from "./DrillDialog.js";
|
|
23
23
|
import { DrillDialogInsight } from "./DrillDialogInsight.js";
|
|
24
|
+
import { getDrillDialogInsightDescription } from "./getDrillDialogInsightDescription.js";
|
|
24
25
|
import { getTitleWithBreadcrumbs } from "./getTitleWithBreadcrumbs.js";
|
|
25
26
|
// Header z-index start at 6000 so we need force all overlays z-indexes start at 6000 to be above header
|
|
26
27
|
const overlayController = OverlayController.getInstance(DASHBOARD_HEADER_OVERLAYS_Z_INDEX);
|
|
@@ -32,24 +33,6 @@ const overlayIgnoredClasses = [
|
|
|
32
33
|
`#${DOWNLOADER_ID}`,
|
|
33
34
|
`[${FLOATING_ELEMENT_DATA_ATTR}]`,
|
|
34
35
|
];
|
|
35
|
-
const defaultDescriptionConfig = {
|
|
36
|
-
source: "insight",
|
|
37
|
-
includeMetrics: false,
|
|
38
|
-
visible: true,
|
|
39
|
-
};
|
|
40
|
-
const getInsightWidgetDescription = (descriptionConfig, widget, insight) => {
|
|
41
|
-
// We will handler description configuration only for insight widget that is
|
|
42
|
-
// same as insight in dialog
|
|
43
|
-
if (isInsight(widget) && widget.insight.identifier === insight?.identifier) {
|
|
44
|
-
if (!descriptionConfig.visible) {
|
|
45
|
-
return undefined;
|
|
46
|
-
}
|
|
47
|
-
const useInsightDescription = descriptionConfig.source === "insight";
|
|
48
|
-
return useInsightDescription ? insight?.summary : widget?.description;
|
|
49
|
-
}
|
|
50
|
-
// If widget is not insight or insight is not same as insight in dialog, we will use insight summary as default
|
|
51
|
-
return insight?.summary;
|
|
52
|
-
};
|
|
53
36
|
export function InsightDrillDialog(props) {
|
|
54
37
|
const { widget, locale, breadcrumbs, insight, enableDrillDescription, drillStep, returnFocusToInsight, onClose, onBackButtonClick, onDrillDown, onDrillStart, } = props;
|
|
55
38
|
const isMobileDevice = useMediaQuery("mobileDevice");
|
|
@@ -82,8 +65,7 @@ export function InsightDrillDialog(props) {
|
|
|
82
65
|
const descriptionId = useIdPrefixed(`description-${breadcrumbs.length}`);
|
|
83
66
|
const OverlayComponent = isMobileDevice ? FullScreenOverlay : Overlay;
|
|
84
67
|
const [isOpen, setIsOpen] = useState(false);
|
|
85
|
-
const
|
|
86
|
-
const description = getInsightWidgetDescription(descriptionConfig, widget, insight.insight);
|
|
68
|
+
const description = getDrillDialogInsightDescription(widget, insight.insight);
|
|
87
69
|
// Get original widget state but don't use its toggleWidgetAsTable to avoid affecting original widget
|
|
88
70
|
const originalWidgetShowAsTableState = useShowAsTable(widget).isWidgetAsTable;
|
|
89
71
|
// Use local state for drill dialog to isolate from original widget
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { type IInsight, type IInsightWidget } from "@gooddata/sdk-model";
|
|
2
|
+
/**
|
|
3
|
+
* Returns the description of the insight shown in the drill dialog.
|
|
4
|
+
*/
|
|
5
|
+
export declare const getDrillDialogInsightDescription: (widget: IInsightWidget | undefined, insight: IInsight["insight"] | undefined) => string | undefined;
|
|
6
|
+
//# sourceMappingURL=getDrillDialogInsightDescription.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"getDrillDialogInsightDescription.d.ts","sourceRoot":"","sources":["../../../../../../src/presentation/widget/insight/ViewModeDashboardInsight/InsightDrillDialog/getDrillDialogInsightDescription.ts"],"names":[],"mappings":"AAEA,OAAO,EACH,KAAK,QAAQ,EACb,KAAK,cAAc,EAGtB,MAAM,qBAAqB,CAAC;AAQ7B;;GAEG;AACH,eAAO,MAAM,gCAAgC,WACjC,cAAc,GAAG,SAAS,WACzB,QAAQ,CAAC,SAAS,CAAC,GAAG,SAAS,KACzC,MAAM,GAAG,SAaX,CAAC"}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
// (C) 2026 GoodData Corporation
|
|
2
|
+
import { isInsight, } from "@gooddata/sdk-model";
|
|
3
|
+
const defaultDescriptionConfig = {
|
|
4
|
+
source: "insight",
|
|
5
|
+
includeMetrics: false,
|
|
6
|
+
visible: true,
|
|
7
|
+
};
|
|
8
|
+
/**
|
|
9
|
+
* Returns the description of the insight shown in the drill dialog.
|
|
10
|
+
*/
|
|
11
|
+
export const getDrillDialogInsightDescription = (widget, insight) => {
|
|
12
|
+
const descriptionConfig = widget?.configuration?.description ?? defaultDescriptionConfig;
|
|
13
|
+
// We will handler description configuration only for insight widget that is
|
|
14
|
+
// same as insight in dialog
|
|
15
|
+
if (isInsight(widget) && widget.insight.identifier === insight?.identifier) {
|
|
16
|
+
if (!descriptionConfig.visible) {
|
|
17
|
+
return undefined;
|
|
18
|
+
}
|
|
19
|
+
const useInsightDescription = descriptionConfig.source === "insight";
|
|
20
|
+
return useInsightDescription ? insight?.summary : widget?.description;
|
|
21
|
+
}
|
|
22
|
+
// If widget is not insight or insight is not same as insight in dialog, we will use insight summary as default
|
|
23
|
+
return insight?.summary;
|
|
24
|
+
};
|