@gooddata/sdk-ui-dashboard 11.41.0-alpha.3 → 11.41.0-alpha.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (26) hide show
  1. package/esm/__version.d.ts +1 -1
  2. package/esm/__version.js +1 -1
  3. package/esm/model/store/config/configSelectors.js +1 -1
  4. package/esm/presentation/automations/alerting/DefaultAlertingDialog/hooks/useEditAlert.js +2 -2
  5. package/esm/presentation/automations/alerting/DefaultAlertingDialog/utils/getters.js +2 -1
  6. package/esm/presentation/automations/shared/automationFilters/useAutomationFiltersSelect.js +1 -1
  7. package/esm/presentation/automations/shared/automationFilters/utils.d.ts +1 -1
  8. package/esm/presentation/automations/shared/automationFilters/utils.js +4 -2
  9. package/esm/presentation/localization/bundles/en-US.localization-bundle.d.ts +64 -0
  10. package/esm/presentation/localization/bundles/en-US.localization-bundle.js +64 -0
  11. package/esm/presentation/topBar/buttonBar/DefaultButtonBar.d.ts +1 -1
  12. package/esm/presentation/topBar/buttonBar/DefaultButtonBar.js +2 -2
  13. package/esm/presentation/topBar/buttonBar/types.d.ts +2 -0
  14. package/esm/presentation/widget/widget/InsightWidget/DefaultDashboardInsightWidget.js +8 -0
  15. package/esm/presentation/widget/widget/InsightWidget/useInsightWarning.d.ts +5 -0
  16. package/esm/presentation/widget/widget/InsightWidget/useInsightWarning.js +11 -0
  17. package/esm/presentation/widget/widget/warningPartialResult/InsightWidgetWarningPartialResult.d.ts +13 -0
  18. package/esm/presentation/widget/widget/warningPartialResult/InsightWidgetWarningPartialResult.js +108 -0
  19. package/esm/sdk-ui-dashboard.d.ts +3 -1
  20. package/package.json +20 -20
  21. package/styles/css/main.css +129 -0
  22. package/styles/css/main.css.map +1 -1
  23. package/styles/css/warningPartialResult.css +16 -0
  24. package/styles/css/warningPartialResult.css.map +1 -0
  25. package/styles/scss/main.scss +1 -0
  26. package/styles/scss/warningPartialResult.scss +16 -0
@@ -1,3 +1,3 @@
1
- export declare const LIB_VERSION = "11.41.0-alpha.3";
1
+ export declare const LIB_VERSION = "11.41.0-alpha.4";
2
2
  export declare const LIB_DESCRIPTION = "GoodData SDK - Dashboard Component";
3
3
  export declare const LIB_NAME = "@gooddata/sdk-ui-dashboard";
package/esm/__version.js CHANGED
@@ -1,5 +1,5 @@
1
1
  // (C) 2021 GoodData Corporation
2
2
  // DO NOT CHANGE THIS FILE, IT IS RE-GENERATED ON EVERY BUILD
3
- export const LIB_VERSION = "11.41.0-alpha.3";
3
+ export const LIB_VERSION = "11.41.0-alpha.4";
4
4
  export const LIB_DESCRIPTION = "GoodData SDK - Dashboard Component";
5
5
  export const LIB_NAME = "@gooddata/sdk-ui-dashboard";
@@ -806,7 +806,7 @@ export const selectActiveCalendars = createSelector(selectConfig, selectEnableFi
806
806
  * @alpha
807
807
  */
808
808
  export const selectEnableDashboardFilterGroups = createSelector(selectConfig, (state) => {
809
- return state.settings?.enableDashboardFilterGroups ?? false;
809
+ return state.settings?.enableDashboardFilterGroups ?? true;
810
810
  });
811
811
  /**
812
812
  * Selector for enabling empty date values configuration in KPI Dashboards date filter.
@@ -102,7 +102,7 @@ export function useEditAlert({ alertToEdit, notificationChannels, insight, widge
102
102
  };
103
103
  })();
104
104
  const [editedAutomation, setEditedAutomation] = useState(resolvedAlertToEdit ??
105
- createDefaultAlert(getAppliedWidgetFilters(editedAutomationFilters ?? [], dashboardHiddenFilters, widget, insight, commonDateFilterId, true), supportedMeasures, defaultMeasure, defaultNotificationChannelId, defaultRecipient, measureFormatMap, undefined, descriptor.evaluationFrequency
105
+ createDefaultAlert(getAppliedWidgetFilters(editedAutomationFilters ?? [], dashboardHiddenFilters, widget, insight, commonDateFilterId, true, false), supportedMeasures, defaultMeasure, defaultNotificationChannelId, defaultRecipient, measureFormatMap, undefined, descriptor.evaluationFrequency
106
106
  ? {
107
107
  cron: descriptor.evaluationFrequency,
108
108
  timezone: settings.alertDefault?.defaultTimezone,
@@ -232,7 +232,7 @@ export function useEditAlert({ alertToEdit, notificationChannels, insight, widge
232
232
  if (!s) {
233
233
  return undefined;
234
234
  }
235
- const appliedFilters = getAppliedWidgetFilters(filters, dashboardHiddenFilters, widget, insight, commonDateFilterId, true);
235
+ const appliedFilters = getAppliedWidgetFilters(filters, dashboardHiddenFilters, widget, insight, commonDateFilterId, true, !s.metadata?.widget);
236
236
  const visibleFilters = getVisibleFiltersByFilters(filters, availableFiltersAsVisibleFilters, true);
237
237
  const updatedAutomationWithFilters = {
238
238
  ...s,
@@ -243,7 +243,8 @@ export function getFiltersAttribute(datasetsWithGranularity, dataset) {
243
243
  //utils
244
244
  function getAttributeRelatedFilter(attr, alert) {
245
245
  const filter = alert?.alert?.execution.filters.filter((f) => {
246
- return getSliceFilterDisplayFormLocalId(f) === attr?.attribute.attribute.localIdentifier;
246
+ return (attr?.attribute.attribute.localIdentifier &&
247
+ getSliceFilterDisplayFormLocalId(f) === attr.attribute.attribute.localIdentifier);
247
248
  })[0];
248
249
  if (isPositiveAttributeFilter(filter) && isAttributeElementsByValue(filter.positiveAttributeFilter.in)) {
249
250
  return {
@@ -84,7 +84,7 @@ export const useAutomationFiltersSelect = ({ widget, automationToEdit, }) => {
84
84
  return !widget && !storeFilters;
85
85
  }, [widget, storeFilters]);
86
86
  // State of current automation filters to display (and potentially save).
87
- const [editedAutomationFilters, setEditedAutomationFilters] = useState(automationToEdit && !isDashboardAutomationWithoutStoredFilters
87
+ const [editedAutomationFilters, setEditedAutomationFilters] = useState(automationToEdit && (!isDashboardAutomationWithoutStoredFilters || !automationToEdit.metadata?.widget)
88
88
  ? filtersForExistingAutomation
89
89
  : filtersForNewAutomation);
90
90
  const filtersByTabForNewAutomation = getDefaultSelectedFiltersFromFiltersByTab(filtersByTab);
@@ -27,7 +27,7 @@ export declare function resolveMvfDimensionalityLocalRefs(filters: IFilter[], in
27
27
  /**
28
28
  * Get final execution filters for the widget alert or scheduled export.
29
29
  */
30
- export declare const getAppliedWidgetFilters: (selectedAutomationFilters: FilterContextItem[], dashboardHiddenFilters: FilterContextItem[], widget: ExtendedDashboardWidget | undefined, insight: IInsight | undefined, commonDateFilterId: string | undefined, mergeInsightFilters?: boolean) => IFilter[];
30
+ export declare const getAppliedWidgetFilters: (selectedAutomationFilters: FilterContextItem[], dashboardHiddenFilters: FilterContextItem[], widget: ExtendedDashboardWidget | undefined, insight: IInsight | undefined, commonDateFilterId: string | undefined, mergeInsightFilters?: boolean, withoutWidget?: boolean) => IFilter[];
31
31
  /**
32
32
  * Get final filters for the dashboard scheduled export.
33
33
  */
@@ -172,7 +172,7 @@ export function resolveMvfDimensionalityLocalRefs(filters, insight) {
172
172
  /**
173
173
  * Get final execution filters for the widget alert or scheduled export.
174
174
  */
175
- export const getAppliedWidgetFilters = (selectedAutomationFilters, dashboardHiddenFilters, widget, insight, commonDateFilterId, mergeInsightFilters = false) => {
175
+ export const getAppliedWidgetFilters = (selectedAutomationFilters, dashboardHiddenFilters, widget, insight, commonDateFilterId, mergeInsightFilters = false, withoutWidget = false) => {
176
176
  // Hidden filters are never included in selectedAutomationFilters,
177
177
  // but we need them to construct proper execution filters, so merge them.
178
178
  const selectedFiltersWithHiddenFilters = [...selectedAutomationFilters, ...dashboardHiddenFilters];
@@ -181,7 +181,9 @@ export const getAppliedWidgetFilters = (selectedAutomationFilters, dashboardHidd
181
181
  // Now, convert sanitized selected filters to execution filters shape.
182
182
  const selectedExecutionFilters = isInsightWidget(widget)
183
183
  ? filterContextItemsToDashboardFiltersByWidget(selectedFiltersWithoutIgnoredFilters, widget)
184
- : [];
184
+ : withoutWidget
185
+ ? filterContextItemsToDashboardFiltersByWidget(selectedFiltersWithoutIgnoredFilters, undefined)
186
+ : [];
185
187
  const filtersToUse = mergeInsightFilters
186
188
  ? mergeFilters(insight?.insight?.filters ?? [], selectedExecutionFilters, commonDateFilterId)
187
189
  : selectedExecutionFilters;
@@ -1259,6 +1259,70 @@ export declare const en_US: {
1259
1259
  text: string;
1260
1260
  crowdinContext: string;
1261
1261
  };
1262
+ "partial_data_warning.title": {
1263
+ text: string;
1264
+ crowdinContext: string;
1265
+ };
1266
+ "partial_data_warning.show_details": {
1267
+ text: string;
1268
+ crowdinContext: string;
1269
+ };
1270
+ "partial_data_warning.hide_details": {
1271
+ text: string;
1272
+ crowdinContext: string;
1273
+ };
1274
+ "partial_data_warning.close": {
1275
+ text: string;
1276
+ crowdinContext: string;
1277
+ };
1278
+ "partial_data_warning.export_raw": {
1279
+ text: string;
1280
+ crowdinContext: string;
1281
+ };
1282
+ "partial_data_warning.description": {
1283
+ text: string;
1284
+ crowdinContext: string;
1285
+ };
1286
+ "partial_data_warning.rows.description": {
1287
+ text: string;
1288
+ crowdinContext: string;
1289
+ };
1290
+ "partial_data_warning.rows.description.unknown_total": {
1291
+ text: string;
1292
+ crowdinContext: string;
1293
+ };
1294
+ "partial_data_warning.columns.description": {
1295
+ text: string;
1296
+ crowdinContext: string;
1297
+ };
1298
+ "partial_data_warning.columns.description.unknown_total": {
1299
+ text: string;
1300
+ crowdinContext: string;
1301
+ };
1302
+ "partial_data_warning.rows_columns.description": {
1303
+ text: string;
1304
+ crowdinContext: string;
1305
+ };
1306
+ "partial_data_warning.rows_columns.description.unknown_column_total": {
1307
+ text: string;
1308
+ crowdinContext: string;
1309
+ };
1310
+ "partial_data_warning.rows_columns.description.unknown_row_total": {
1311
+ text: string;
1312
+ crowdinContext: string;
1313
+ };
1314
+ "partial_data_warning.rows_columns.description.unknown_total": {
1315
+ text: string;
1316
+ crowdinContext: string;
1317
+ };
1318
+ "partial_data_warning.cells.description": {
1319
+ text: string;
1320
+ crowdinContext: string;
1321
+ };
1322
+ "partial_data_warning.cells.description.unknown_total": {
1323
+ text: string;
1324
+ crowdinContext: string;
1325
+ };
1262
1326
  "export_unsupported.disabled": {
1263
1327
  text: string;
1264
1328
  crowdinContext: string;
@@ -1261,6 +1261,70 @@ export const en_US = {
1261
1261
  "text": "Untitled visualization",
1262
1262
  "crowdinContext": "Default title for exported file"
1263
1263
  },
1264
+ "partial_data_warning.title": {
1265
+ "text": "Partial results only.",
1266
+ "crowdinContext": "Title of a warning displayed when a visualization shows partial data because result limits were exceeded."
1267
+ },
1268
+ "partial_data_warning.show_details": {
1269
+ "text": "Show details",
1270
+ "crowdinContext": "Link to expand partial data warning details."
1271
+ },
1272
+ "partial_data_warning.hide_details": {
1273
+ "text": "Hide details",
1274
+ "crowdinContext": "Link to collapse partial data warning details."
1275
+ },
1276
+ "partial_data_warning.close": {
1277
+ "text": "Dismiss partial data warning",
1278
+ "crowdinContext": "Accessibility label for the close button in partial data warning."
1279
+ },
1280
+ "partial_data_warning.export_raw": {
1281
+ "text": "Export full result as Raw (.csv)",
1282
+ "crowdinContext": "Action link in partial data warning that exports the full raw CSV result."
1283
+ },
1284
+ "partial_data_warning.description": {
1285
+ "text": "The result exceeds a result size limit.",
1286
+ "crowdinContext": "Generic detail text for partial data warning."
1287
+ },
1288
+ "partial_data_warning.rows.description": {
1289
+ "text": "The result exceeds the {rowLimit} row limit by {rowOverflow} rows.",
1290
+ "crowdinContext": "Partial data warning detail when the row limit is exceeded."
1291
+ },
1292
+ "partial_data_warning.rows.description.unknown_total": {
1293
+ "text": "The result exceeds the {rowLimit} row limit.",
1294
+ "crowdinContext": "Partial data warning detail when the row limit is exceeded and the exact total is unknown."
1295
+ },
1296
+ "partial_data_warning.columns.description": {
1297
+ "text": "The result exceeds the {columnLimit} columns limit by {columnOverflow} columns.",
1298
+ "crowdinContext": "Partial data warning detail when the column limit is exceeded."
1299
+ },
1300
+ "partial_data_warning.columns.description.unknown_total": {
1301
+ "text": "The result exceeds the {columnLimit} columns limit.",
1302
+ "crowdinContext": "Partial data warning detail when the column limit is exceeded and the exact total is unknown."
1303
+ },
1304
+ "partial_data_warning.rows_columns.description": {
1305
+ "text": "The result exceeds both the {columnLimit} columns and the {rowLimit} row limit by {columnOverflow} columns and {rowOverflow} rows.",
1306
+ "crowdinContext": "Partial data warning detail when both row and column limits are exceeded."
1307
+ },
1308
+ "partial_data_warning.rows_columns.description.unknown_column_total": {
1309
+ "text": "The result exceeds both the {columnLimit} columns and the {rowLimit} row limit. It exceeds the row limit by {rowOverflow} rows.",
1310
+ "crowdinContext": "Partial data warning detail when both row and column limits are exceeded, but only the row overflow is known."
1311
+ },
1312
+ "partial_data_warning.rows_columns.description.unknown_row_total": {
1313
+ "text": "The result exceeds both the {columnLimit} columns and the {rowLimit} row limit. It exceeds the columns limit by {columnOverflow} columns.",
1314
+ "crowdinContext": "Partial data warning detail when both row and column limits are exceeded, but only the column overflow is known."
1315
+ },
1316
+ "partial_data_warning.rows_columns.description.unknown_total": {
1317
+ "text": "The result exceeds both the {columnLimit} columns and the {rowLimit} row limit.",
1318
+ "crowdinContext": "Partial data warning detail when both row and column limits are exceeded and exact totals are unknown."
1319
+ },
1320
+ "partial_data_warning.cells.description": {
1321
+ "text": "The result exceeds the {cellLimit} datapoint limit by {cellOverflow} datapoints.",
1322
+ "crowdinContext": "Partial data warning detail when the datapoint limit is exceeded."
1323
+ },
1324
+ "partial_data_warning.cells.description.unknown_total": {
1325
+ "text": "The result exceeds the {cellLimit} datapoint limit.",
1326
+ "crowdinContext": "Partial data warning detail when the datapoint limit is exceeded and the exact total is unknown."
1327
+ },
1264
1328
  "export_unsupported.disabled": {
1265
1329
  "text": "Export is not supported",
1266
1330
  "crowdinContext": "Export to the file not supported."
@@ -3,4 +3,4 @@ import { type IButtonBarProps } from "./types.js";
3
3
  /**
4
4
  * @alpha
5
5
  */
6
- export declare function DefaultButtonBar({ children, cancelButtonProps, saveButtonProps, settingButtonProps, editButtonProps, saveAsNewButtonProps, shareButtonProps, childContentPosition }: IButtonBarProps): ReactElement;
6
+ export declare function DefaultButtonBar({ children, cancelButtonProps, saveButtonProps, settingButtonProps, editButtonProps, saveAsNewButtonProps, shareButtonProps, childContentPosition, left, right }: IButtonBarProps): ReactElement;
@@ -8,7 +8,7 @@ import { ShareButton } from "./button/shareButton/ShareButton.js";
8
8
  /**
9
9
  * @alpha
10
10
  */
11
- export function DefaultButtonBar({ children, cancelButtonProps, saveButtonProps, settingButtonProps, editButtonProps, saveAsNewButtonProps, shareButtonProps, childContentPosition = "left", }) {
11
+ export function DefaultButtonBar({ children, cancelButtonProps, saveButtonProps, settingButtonProps, editButtonProps, saveAsNewButtonProps, shareButtonProps, childContentPosition = "left", left, right, }) {
12
12
  // TODO INE allow customization of buttons via getter from props
13
- return (_jsxs("div", { className: "dash-control-buttons", children: [childContentPosition === "left" && children, _jsx(CancelButton, { ...cancelButtonProps }), _jsx(SaveButton, { ...saveButtonProps }), _jsx(SettingButton, { ...settingButtonProps }), _jsx(EditButton, { ...editButtonProps }), _jsx(SaveAsNewButton, { ...saveAsNewButtonProps }), _jsx(ShareButton, { ...shareButtonProps }), childContentPosition === "right" && children] }));
13
+ return (_jsxs("div", { className: "dash-control-buttons", children: [left, childContentPosition === "left" && children, _jsx(CancelButton, { ...cancelButtonProps }), _jsx(SaveButton, { ...saveButtonProps }), _jsx(SettingButton, { ...settingButtonProps }), _jsx(EditButton, { ...editButtonProps }), _jsx(SaveAsNewButton, { ...saveAsNewButtonProps }), _jsx(ShareButton, { ...shareButtonProps }), childContentPosition === "right" && children, right] }));
14
14
  }
@@ -19,6 +19,8 @@ export interface IButtonBarProps {
19
19
  settingButtonProps: ISettingButtonProps;
20
20
  saveAsNewButtonProps: ISaveAsNewButtonProps;
21
21
  children?: ReactNode;
22
+ left?: ReactNode;
23
+ right?: ReactNode;
22
24
  }
23
25
  /**
24
26
  * @beta
@@ -25,9 +25,11 @@ import { getGeoDefaultDisplayFormRefs } from "../../insight/geoDefaultDisplayFor
25
25
  import { canConvertToTable, convertInsightToTableDefinition, supportsShowAsTable, } from "../../insight/insightToTable.js";
26
26
  import { ShowAsTableButton } from "../../showAsTableButton/ShowAsTableButton.js";
27
27
  import { useShowAsTable } from "../../showAsTableButton/useShowAsTable.js";
28
+ import { InsightWidgetWarningPartialResult } from "../warningPartialResult/InsightWidgetWarningPartialResult.js";
28
29
  import { DashboardWidgetInsightGuard } from "./DashboardWidgetInsightGuard.js";
29
30
  import { useAlertingAndScheduling } from "./useAlertingAndScheduling.js";
30
31
  import { useInsightMenu } from "./useInsightMenu.js";
32
+ import { useInsightWarning } from "./useInsightWarning.js";
31
33
  export function DefaultDashboardInsightWidget(props) {
32
34
  return _jsx(DashboardWidgetInsightGuard, { ...props, Component: DefaultDashboardInsightWidgetCore });
33
35
  }
@@ -120,6 +122,7 @@ function DefaultDashboardInsightWidgetCore({ widget, insight, screen, onError, o
120
122
  : insight.insight.summary
121
123
  : "";
122
124
  const titleId = useId();
125
+ const { limitBreaks, executionResult } = useInsightWarning(widget.ref);
123
126
  const { isWidgetAsTable, toggleWidgetAsTable } = useShowAsTable(widget);
124
127
  const accessibilityTableInsight = useMemo(() => {
125
128
  if (!isExportMode)
@@ -155,5 +158,10 @@ function DefaultDashboardInsightWidgetCore({ widget, insight, screen, onError, o
155
158
  return null;
156
159
  }
157
160
  return (_jsx(InsightMenuComponent, { insight: insight, widget: widget, isOpen: isMenuOpen, onClose: closeMenu, items: menuItems }));
161
+ }, renderAfterVisualization: () => {
162
+ if (limitBreaks.length > 0) {
163
+ return (_jsx(InsightWidgetWarningPartialResult, { className: "gd-warning-partial-result", limitBreaks: limitBreaks, onExportRawCSV: onExportRawCSV, isExporting: !exportCSVRawEnabled, isExportRawVisible: isExportRawVisible, executionResult: executionResult, isLoading: executionResult?.isLoading }));
164
+ }
165
+ return null;
158
166
  }, children: ({ clientHeight, clientWidth }) => (_jsx(DashboardInsight, { clientHeight: clientHeight, clientWidth: clientWidth, insight: insight, widget: widget, onExportReady: onExportReady, onLoadingChanged: onLoadingChanged, onError: onError, ErrorComponent: ErrorComponent, LoadingComponent: LoadingComponent, exportData: exportData?.widget })) }) }), accessibilityTableInsight ? (_jsx("div", { className: "accessibility-data-table", "data-widget-id": widget.identifier, "data-export-type": "accessibility-table", "aria-hidden": "true", children: _jsx(DashboardInsight, { insight: accessibilityTableInsight, widget: widget, onExportReady: onExportReady, onLoadingChanged: onLoadingChanged, onError: onError, ErrorComponent: ErrorComponent, LoadingComponent: LoadingComponent, exportData: exportData?.widget }) })) : null] }));
159
167
  }
@@ -0,0 +1,5 @@
1
+ import { type ObjRef } from "@gooddata/sdk-model";
2
+ export declare const useInsightWarning: (ref: ObjRef) => {
3
+ limitBreaks: import("@gooddata/sdk-model").IExecutionResultLimitBreak<import("@gooddata/sdk-model").ExecutionResultLimitType | (string & {})>[];
4
+ executionResult: import("../../../../index.js").IExecutionResultEnvelope | undefined;
5
+ };
@@ -0,0 +1,11 @@
1
+ // (C) 2026 GoodData Corporation
2
+ import { useDashboardSelector } from "../../../../model/react/DashboardStoreProvider.js";
3
+ import { selectExecutionResultByRef, selectExecutionResultLimitBreaksByRef, } from "../../../../model/store/executionResults/executionResultsSelectors.js";
4
+ export const useInsightWarning = (ref) => {
5
+ const executionResult = useDashboardSelector(selectExecutionResultByRef(ref));
6
+ const limitBreaks = useDashboardSelector(selectExecutionResultLimitBreaksByRef(ref));
7
+ return {
8
+ limitBreaks,
9
+ executionResult,
10
+ };
11
+ };
@@ -0,0 +1,13 @@
1
+ import { type IExecutionResultLimitBreak } from "@gooddata/sdk-model";
2
+ import { type IExecutionResultEnvelope } from "../../../../model/store/executionResults/types.js";
3
+ interface IInsightWidgetWarningPartialResultProps {
4
+ className: string;
5
+ limitBreaks: IExecutionResultLimitBreak[];
6
+ isExporting: boolean;
7
+ isExportRawVisible: boolean;
8
+ executionResult: IExecutionResultEnvelope;
9
+ isLoading?: boolean;
10
+ onExportRawCSV: () => void;
11
+ }
12
+ export declare function InsightWidgetWarningPartialResult({ className, limitBreaks, isLoading, isExporting, isExportRawVisible, executionResult, onExportRawCSV }: IInsightWidgetWarningPartialResultProps): import("react/jsx-runtime").JSX.Element;
13
+ export {};
@@ -0,0 +1,108 @@
1
+ import { Fragment as _Fragment, jsx as _jsx } from "react/jsx-runtime";
2
+ // (C) 2022-2026 GoodData Corporation
3
+ import { useEffect, useState } from "react";
4
+ import noop from "lodash-es/noop.js";
5
+ import { FormattedMessage, defineMessage, useIntl, } from "react-intl";
6
+ import { executionResultLimitTypeToKind } from "@gooddata/sdk-model";
7
+ import { DialogBase, UiLink, WidgetNotice } from "@gooddata/sdk-ui-kit";
8
+ const COMPACT_FORMAT_THRESHOLD = 10000;
9
+ const COMPACT_FORMATTING_OPTIONS = { style: "decimal", notation: "compact" };
10
+ export function InsightWidgetWarningPartialResult({ className, limitBreaks, isLoading, isExporting, isExportRawVisible, executionResult, onExportRawCSV, }) {
11
+ const intl = useIntl();
12
+ useEffect(() => {
13
+ setIsOpen(true);
14
+ }, [executionResult]);
15
+ const [isOpen, setIsOpen] = useState(true);
16
+ const handleCloseOverlay = () => {
17
+ setIsOpen(false);
18
+ };
19
+ const exportFullResult = (event) => {
20
+ event.preventDefault();
21
+ onExportRawCSV();
22
+ };
23
+ return (_jsx(_Fragment, { children: isOpen && isLoading === false ? (_jsx(DialogBase, { className: className, onMouseUp: noop, submitOnEnterKey: false, isModal: false, autofocusOnOpen: false, children: _jsx(WidgetNotice, { type: "warning", message: _jsx(FormattedMessage, { id: "partial_data_warning.title" }), detail: getDetailMessage(limitBreaks, intl), detailAction: isExportRawVisible ? (_jsx(UiLink, { isDisabled: isExporting, variant: "primary", href: "#", onClick: exportFullResult, children: _jsx(FormattedMessage, { id: "partial_data_warning.export_raw" }) })) : undefined, expandLabel: _jsx(FormattedMessage, { id: "partial_data_warning.show_details" }), collapseLabel: _jsx(FormattedMessage, { id: "partial_data_warning.hide_details" }), onClose: handleCloseOverlay, closeButtonLabel: intl.formatMessage(defineMessage({ id: "partial_data_warning.close" })) }) })) : null }));
24
+ }
25
+ function getLimitBreakKind(limitBreak) {
26
+ return executionResultLimitTypeToKind(limitBreak.limitType);
27
+ }
28
+ function formatLimit(limitBreak, intl) {
29
+ return formatLimitValue(limitBreak.limit, intl);
30
+ }
31
+ function formatOverflow(limitBreak, intl) {
32
+ if (typeof limitBreak.value !== "number") {
33
+ return undefined;
34
+ }
35
+ const overflow = limitBreak.value - limitBreak.limit;
36
+ return overflow > 0 ? formatLimitValue(overflow, intl) : undefined;
37
+ }
38
+ function formatLimitValue(value, intl) {
39
+ return value >= COMPACT_FORMAT_THRESHOLD
40
+ ? intl.formatNumber(value, COMPACT_FORMATTING_OPTIONS)
41
+ : intl.formatNumber(value);
42
+ }
43
+ function getLimitBreaksByKind(limitBreaks) {
44
+ return limitBreaks.reduce((result, limitBreak) => {
45
+ const kind = getLimitBreakKind(limitBreak);
46
+ if (kind !== "unknown" && !result[kind]) {
47
+ result[kind] = limitBreak;
48
+ }
49
+ return result;
50
+ }, {});
51
+ }
52
+ function getRowsAndColumnsDetailMessage(rowLimitBreak, columnLimitBreak, intl) {
53
+ const values = {
54
+ rowLimit: formatLimit(rowLimitBreak, intl),
55
+ columnLimit: formatLimit(columnLimitBreak, intl),
56
+ rowOverflow: formatOverflow(rowLimitBreak, intl),
57
+ columnOverflow: formatOverflow(columnLimitBreak, intl),
58
+ };
59
+ if (values.rowOverflow && values.columnOverflow) {
60
+ return _jsx(FormattedMessage, { id: "partial_data_warning.rows_columns.description", values: values });
61
+ }
62
+ if (values.rowOverflow) {
63
+ return (_jsx(FormattedMessage, { id: "partial_data_warning.rows_columns.description.unknown_column_total", values: values }));
64
+ }
65
+ if (values.columnOverflow) {
66
+ return (_jsx(FormattedMessage, { id: "partial_data_warning.rows_columns.description.unknown_row_total", values: values }));
67
+ }
68
+ return (_jsx(FormattedMessage, { id: "partial_data_warning.rows_columns.description.unknown_total", values: values }));
69
+ }
70
+ function getRowsDetailMessage(rowLimitBreak, intl) {
71
+ const values = {
72
+ rowLimit: formatLimit(rowLimitBreak, intl),
73
+ rowOverflow: formatOverflow(rowLimitBreak, intl),
74
+ };
75
+ return values.rowOverflow ? (_jsx(FormattedMessage, { id: "partial_data_warning.rows.description", values: values })) : (_jsx(FormattedMessage, { id: "partial_data_warning.rows.description.unknown_total", values: values }));
76
+ }
77
+ function getColumnsDetailMessage(columnLimitBreak, intl) {
78
+ const values = {
79
+ columnLimit: formatLimit(columnLimitBreak, intl),
80
+ columnOverflow: formatOverflow(columnLimitBreak, intl),
81
+ };
82
+ return values.columnOverflow ? (_jsx(FormattedMessage, { id: "partial_data_warning.columns.description", values: values })) : (_jsx(FormattedMessage, { id: "partial_data_warning.columns.description.unknown_total", values: values }));
83
+ }
84
+ function getCellsDetailMessage(cellLimitBreak, intl) {
85
+ const values = {
86
+ cellLimit: formatLimit(cellLimitBreak, intl),
87
+ cellOverflow: formatOverflow(cellLimitBreak, intl),
88
+ };
89
+ return values.cellOverflow ? (_jsx(FormattedMessage, { id: "partial_data_warning.cells.description", values: values })) : (_jsx(FormattedMessage, { id: "partial_data_warning.cells.description.unknown_total", values: values }));
90
+ }
91
+ function getDetailMessage(limitBreaks, intl) {
92
+ const byKind = getLimitBreaksByKind(limitBreaks);
93
+ const rowLimitBreak = byKind.rows;
94
+ const columnLimitBreak = byKind.columns;
95
+ if (rowLimitBreak) {
96
+ return columnLimitBreak
97
+ ? getRowsAndColumnsDetailMessage(rowLimitBreak, columnLimitBreak, intl)
98
+ : getRowsDetailMessage(rowLimitBreak, intl);
99
+ }
100
+ if (columnLimitBreak) {
101
+ return getColumnsDetailMessage(columnLimitBreak, intl);
102
+ }
103
+ const cellLimitBreak = byKind.cells;
104
+ if (cellLimitBreak) {
105
+ return getCellsDetailMessage(cellLimitBreak, intl);
106
+ }
107
+ return _jsx(FormattedMessage, { id: "partial_data_warning.description" });
108
+ }
@@ -3756,7 +3756,7 @@ export declare function DefaultAlertingManagementDialogNew({ onPauseSuccess, onP
3756
3756
  /**
3757
3757
  * @alpha
3758
3758
  */
3759
- export declare function DefaultButtonBar({ children, cancelButtonProps, saveButtonProps, settingButtonProps, editButtonProps, saveAsNewButtonProps, shareButtonProps, childContentPosition }: IButtonBarProps): ReactElement;
3759
+ export declare function DefaultButtonBar({ children, cancelButtonProps, saveButtonProps, settingButtonProps, editButtonProps, saveAsNewButtonProps, shareButtonProps, childContentPosition, left, right }: IButtonBarProps): ReactElement;
3760
3760
 
3761
3761
  /**
3762
3762
  * @internal
@@ -5887,6 +5887,8 @@ export declare interface IButtonBarProps {
5887
5887
  settingButtonProps: ISettingButtonProps;
5888
5888
  saveAsNewButtonProps: ISaveAsNewButtonProps;
5889
5889
  children?: ReactNode;
5890
+ left?: ReactNode;
5891
+ right?: ReactNode;
5890
5892
  }
5891
5893
 
5892
5894
  /**
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@gooddata/sdk-ui-dashboard",
3
- "version": "11.41.0-alpha.3",
3
+ "version": "11.41.0-alpha.4",
4
4
  "description": "GoodData SDK - Dashboard Component",
5
5
  "license": "LicenseRef-LICENSE",
6
6
  "author": "GoodData Corporation",
@@ -60,19 +60,19 @@
60
60
  "ts-invariant": "0.10.3",
61
61
  "tslib": "2.8.1",
62
62
  "uuid": "11.1.1",
63
- "@gooddata/sdk-backend-base": "11.41.0-alpha.3",
64
- "@gooddata/sdk-backend-spi": "11.41.0-alpha.3",
65
- "@gooddata/sdk-model": "11.41.0-alpha.3",
66
- "@gooddata/sdk-ui-charts": "11.41.0-alpha.3",
67
- "@gooddata/sdk-ui": "11.41.0-alpha.3",
68
- "@gooddata/sdk-ui-ext": "11.41.0-alpha.3",
69
- "@gooddata/sdk-ui-filters": "11.41.0-alpha.3",
70
- "@gooddata/sdk-ui-geo": "11.41.0-alpha.3",
71
- "@gooddata/sdk-ui-kit": "11.41.0-alpha.3",
72
- "@gooddata/sdk-ui-pivot": "11.41.0-alpha.3",
73
- "@gooddata/sdk-ui-theme-provider": "11.41.0-alpha.3",
74
- "@gooddata/util": "11.41.0-alpha.3",
75
- "@gooddata/sdk-ui-vis-commons": "11.41.0-alpha.3"
63
+ "@gooddata/sdk-backend-base": "11.41.0-alpha.4",
64
+ "@gooddata/sdk-backend-spi": "11.41.0-alpha.4",
65
+ "@gooddata/sdk-model": "11.41.0-alpha.4",
66
+ "@gooddata/sdk-ui": "11.41.0-alpha.4",
67
+ "@gooddata/sdk-ui-charts": "11.41.0-alpha.4",
68
+ "@gooddata/sdk-ui-ext": "11.41.0-alpha.4",
69
+ "@gooddata/sdk-ui-filters": "11.41.0-alpha.4",
70
+ "@gooddata/sdk-ui-geo": "11.41.0-alpha.4",
71
+ "@gooddata/sdk-ui-kit": "11.41.0-alpha.4",
72
+ "@gooddata/sdk-ui-pivot": "11.41.0-alpha.4",
73
+ "@gooddata/sdk-ui-theme-provider": "11.41.0-alpha.4",
74
+ "@gooddata/sdk-ui-vis-commons": "11.41.0-alpha.4",
75
+ "@gooddata/util": "11.41.0-alpha.4"
76
76
  },
77
77
  "devDependencies": {
78
78
  "@microsoft/api-documenter": "^7.17.0",
@@ -118,12 +118,12 @@
118
118
  "typescript": "5.9.3",
119
119
  "vitest": "4.1.8",
120
120
  "vitest-dom": "0.1.1",
121
- "@gooddata/i18n-toolkit": "11.41.0-alpha.3",
122
- "@gooddata/reference-workspace": "11.41.0-alpha.3",
123
- "@gooddata/oxlint-config": "11.41.0-alpha.3",
124
- "@gooddata/sdk-backend-mockingbird": "11.41.0-alpha.3",
125
- "@gooddata/eslint-config": "11.41.0-alpha.3",
126
- "@gooddata/stylelint-config": "11.41.0-alpha.3"
121
+ "@gooddata/eslint-config": "11.41.0-alpha.4",
122
+ "@gooddata/i18n-toolkit": "11.41.0-alpha.4",
123
+ "@gooddata/oxlint-config": "11.41.0-alpha.4",
124
+ "@gooddata/reference-workspace": "11.41.0-alpha.4",
125
+ "@gooddata/sdk-backend-mockingbird": "11.41.0-alpha.4",
126
+ "@gooddata/stylelint-config": "11.41.0-alpha.4"
127
127
  },
128
128
  "peerDependencies": {
129
129
  "react": "^18.0.0 || ^19.0.0",