@gooddata/sdk-ui-analytical-designer 11.70.0-alpha.1 → 11.70.0-alpha.3

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 (117) hide show
  1. package/NOTICE +48 -81
  2. package/esm/components/DeleteReportDialog.d.ts.map +1 -1
  3. package/esm/components/DeleteReportDialog.js +2 -4
  4. package/esm/components/DeleteReportDialogUsageList.d.ts.map +1 -1
  5. package/esm/components/DeleteReportDialogUsageList.js +2 -2
  6. package/esm/components/DeleteReportDialogUsageListItem.d.ts +2 -4
  7. package/esm/components/DeleteReportDialogUsageListItem.d.ts.map +1 -1
  8. package/esm/components/DeleteReportDialogUsageListItem.js +3 -3
  9. package/esm/components/InsightUsageOnDashboards.js +3 -3
  10. package/esm/components/buckets/MeasureDateFilterPicker.d.ts +0 -4
  11. package/esm/components/buckets/MeasureDateFilterPicker.d.ts.map +1 -1
  12. package/esm/components/buckets/MeasureDateFilterPicker.js +8 -3
  13. package/esm/components/buckets/MeasureDateFilterTitle.d.ts.map +1 -1
  14. package/esm/components/buckets/MeasureDateFilterTitle.js +5 -14
  15. package/esm/components/filterBar/dateFilter/AdditionalFiltersSection/AdditionalDateAttributes.d.ts +2 -1
  16. package/esm/components/filterBar/dateFilter/AdditionalFiltersSection/AdditionalDateAttributes.d.ts.map +1 -1
  17. package/esm/components/filterBar/dateFilter/AdditionalFiltersSection/AdditionalDateAttributes.js +6 -2
  18. package/esm/components/filterBar/dateFilter/AdditionalFiltersSection/AdditionalDateFilters.d.ts +2 -1
  19. package/esm/components/filterBar/dateFilter/AdditionalFiltersSection/AdditionalDateFilters.d.ts.map +1 -1
  20. package/esm/components/filterBar/dateFilter/AdditionalFiltersSection/AdditionalDateFilters.js +2 -2
  21. package/esm/components/filterBar/dateFilter/AdditionalFiltersSection/EmptyDateValuesFilter.d.ts +6 -1
  22. package/esm/components/filterBar/dateFilter/AdditionalFiltersSection/EmptyDateValuesFilter.d.ts.map +1 -1
  23. package/esm/components/filterBar/dateFilter/AdditionalFiltersSection/EmptyDateValuesFilter.js +2 -2
  24. package/esm/components/filterBar/dateFilter/Buttons/applyButtonHook.d.ts +2 -2
  25. package/esm/components/filterBar/dateFilter/Buttons/applyButtonHook.d.ts.map +1 -1
  26. package/esm/components/filterBar/dateFilter/Buttons/applyButtonHook.js +16 -8
  27. package/esm/components/filterBar/dateFilter/DateFilter.d.ts.map +1 -1
  28. package/esm/components/filterBar/dateFilter/DateFilter.js +11 -3
  29. package/esm/components/filterBar/dateFilter/FilterButton/SelectedPresetName.d.ts +1 -1
  30. package/esm/components/filterBar/dateFilter/FilterButton/SelectedPresetName.d.ts.map +1 -1
  31. package/esm/components/filterBar/dateFilter/FilterButton/SelectedPresetName.js +10 -16
  32. package/esm/components/report/executionProgress/ExecutionProgressPanel.js +6 -4
  33. package/esm/components/report/executionProgress/ExecutionProgressSteps.d.ts +2 -1
  34. package/esm/components/report/executionProgress/ExecutionProgressSteps.d.ts.map +1 -1
  35. package/esm/components/report/executionProgress/ExecutionProgressSteps.js +10 -7
  36. package/esm/components/report/executionProgress/ExecutionStats.d.ts.map +1 -1
  37. package/esm/components/report/executionProgress/ExecutionStats.js +14 -13
  38. package/esm/components/report/executionProgress/timeline.d.ts +5 -1
  39. package/esm/components/report/executionProgress/timeline.d.ts.map +1 -1
  40. package/esm/components/report/executionProgress/timeline.js +19 -3
  41. package/esm/components/saveReportFromKD/DocumentItem.d.ts.map +1 -1
  42. package/esm/components/saveReportFromKD/DocumentItem.js +3 -3
  43. package/esm/components/saveReportFromKD/InsightUsageOnDashboardsList.js +1 -1
  44. package/esm/models/date_filter.d.ts +1 -5
  45. package/esm/models/date_filter.d.ts.map +1 -1
  46. package/esm/models/date_filter.js +2 -13
  47. package/esm/models/empty_date_values_title.d.ts +15 -0
  48. package/esm/models/empty_date_values_title.d.ts.map +1 -0
  49. package/esm/models/empty_date_values_title.js +25 -0
  50. package/esm/models/metadata.d.ts +12 -6
  51. package/esm/models/metadata.d.ts.map +1 -1
  52. package/esm/models/metadata.js +30 -17
  53. package/esm/postMessageApi/outgoing/control_filtering_events.d.ts +1 -0
  54. package/esm/postMessageApi/outgoing/control_filtering_events.d.ts.map +1 -1
  55. package/esm/postMessageApi/outgoing/control_filtering_events.js +5 -0
  56. package/esm/postMessageApi/sagas/api_token_origin_check.d.ts +23 -0
  57. package/esm/postMessageApi/sagas/api_token_origin_check.d.ts.map +1 -0
  58. package/esm/postMessageApi/sagas/api_token_origin_check.js +58 -0
  59. package/esm/postMessageApi/sagas/api_token_received_saga.d.ts +10 -2
  60. package/esm/postMessageApi/sagas/api_token_received_saga.d.ts.map +1 -1
  61. package/esm/postMessageApi/sagas/api_token_received_saga.js +19 -2
  62. package/esm/postMessageApi/sagas/command_received_saga.d.ts +0 -6
  63. package/esm/postMessageApi/sagas/command_received_saga.d.ts.map +1 -1
  64. package/esm/postMessageApi/sagas/command_received_saga.js +14 -3
  65. package/esm/postMessageApi/sagas/control_filtering_saga.d.ts.map +1 -1
  66. package/esm/postMessageApi/sagas/control_filtering_saga.js +7 -1
  67. package/esm/postMessageApi/sagas/incoming_command_sagas.d.ts +0 -3
  68. package/esm/postMessageApi/sagas/incoming_command_sagas.d.ts.map +1 -1
  69. package/esm/sagas/catalog/catalog_saga.d.ts +2 -3
  70. package/esm/sagas/catalog/catalog_saga.d.ts.map +1 -1
  71. package/esm/sagas/catalog/catalog_saga.js +26 -18
  72. package/esm/sagas/open_report_sagas.d.ts.map +1 -1
  73. package/esm/sagas/open_report_sagas.js +1 -3
  74. package/esm/sagas/sagas.d.ts +0 -3
  75. package/esm/sagas/sagas.d.ts.map +1 -1
  76. package/esm/selectors/feature_flag_selector.d.ts +23 -2
  77. package/esm/selectors/feature_flag_selector.d.ts.map +1 -1
  78. package/esm/selectors/feature_flag_selector.js +2 -0
  79. package/esm/selectors/report_visualization_selector.d.ts +4 -8
  80. package/esm/selectors/report_visualization_selector.d.ts.map +1 -1
  81. package/esm/selectors/save_report_selector.d.ts +2 -0
  82. package/esm/selectors/save_report_selector.d.ts.map +1 -1
  83. package/esm/selectors/save_report_selector.js +8 -6
  84. package/esm/selectors/uri_selector.d.ts +6 -1
  85. package/esm/selectors/uri_selector.d.ts.map +1 -1
  86. package/esm/selectors/uri_selector.js +4 -1
  87. package/esm/store/catalog/catalog_reducer.d.ts +2 -1
  88. package/esm/store/catalog/catalog_reducer.d.ts.map +1 -1
  89. package/esm/store/catalog/catalog_reducer.js +3 -0
  90. package/esm/store/catalog/catalog_selector.d.ts +124 -0
  91. package/esm/store/catalog/catalog_selector.d.ts.map +1 -1
  92. package/esm/store/catalog/catalog_selector.js +6 -2
  93. package/esm/store/catalog/catalog_store_actions.d.ts +3 -4
  94. package/esm/store/catalog/catalog_store_actions.d.ts.map +1 -1
  95. package/esm/store/catalog/catalog_store_actions.js +1 -1
  96. package/esm/store/catalog/catalog_types.d.ts +2 -1
  97. package/esm/store/catalog/catalog_types.d.ts.map +1 -1
  98. package/esm/store/execution_progress/execution_loading_view_model.d.ts +4 -6
  99. package/esm/store/execution_progress/execution_loading_view_model.d.ts.map +1 -1
  100. package/esm/store/execution_progress/execution_loading_view_model.js +5 -9
  101. package/esm/store/insight_usage/insight_usage_helpers.d.ts +12 -6
  102. package/esm/store/insight_usage/insight_usage_helpers.d.ts.map +1 -1
  103. package/esm/store/insight_usage/insight_usage_helpers.js +10 -20
  104. package/esm/store/insight_usage/insight_usage_state.d.ts +4 -2
  105. package/esm/store/insight_usage/insight_usage_state.d.ts.map +1 -1
  106. package/esm/store/metric_editor/metric_editor_sagas.d.ts.map +1 -1
  107. package/esm/store/metric_editor/metric_editor_sagas.js +10 -2
  108. package/esm/store/report/open_report_operation.js +1 -1
  109. package/esm/translations/en-US.json +12 -0
  110. package/esm/utils/api.d.ts +3 -3
  111. package/esm/utils/api.d.ts.map +1 -1
  112. package/esm/utils/api.js +6 -6
  113. package/esm/utils/custom_mouse_backend.d.ts.map +1 -1
  114. package/esm/utils/custom_mouse_backend.js +9 -2
  115. package/esm/utils/sdkModelToADRep/FilterConverter.d.ts.map +1 -1
  116. package/esm/utils/sdkModelToADRep/FilterConverter.js +9 -2
  117. package/package.json +21 -21
@@ -4,8 +4,8 @@ import { useSelector } from "react-redux";
4
4
  import { isAllowedDashboardLinks } from "../../selectors/route_selector.js";
5
5
  import { documentUriFactorySelector } from "../../selectors/uri_selector.js";
6
6
  export function DocumentItem({ item }) {
7
- const isLinkable = useSelector(isAllowedDashboardLinks);
7
+ const isLinkAllowed = useSelector(isAllowedDashboardLinks);
8
8
  const documentUriFactory = useSelector(documentUriFactorySelector);
9
- const { id, title } = item;
10
- return (_jsx("li", { className: "s-insight-usage-document-item", children: isLinkable ? (_jsx("a", { className: "dashboard-item", href: documentUriFactory(id), rel: "noopener noreferrer", target: "_blank", children: _jsx("span", { children: title }) })) : (_jsx("span", { children: title })) }));
9
+ const href = isLinkAllowed ? documentUriFactory(item) : undefined;
10
+ return (_jsx("li", { className: "s-insight-usage-document-item", children: href ? (_jsx("a", { className: "dashboard-item", href: href, rel: "noopener noreferrer", target: "_blank", children: _jsx("span", { children: item.title }) })) : (_jsx("span", { children: item.title })) }));
11
11
  }
@@ -22,6 +22,6 @@ export function Component({ insightUsedOnDashboards, insightUsedInDocuments, })
22
22
  const renderListOfAccessible = accessibleDashboards.length > 0;
23
23
  const renderInaccessibleOnly = accessibleDashboards.length === 0 && inaccessibleDashboardsCount > 0;
24
24
  const renderAlsoInaccessible = accessibleDashboards.length > 0 && inaccessibleDashboardsCount > 0;
25
- return (_jsxs("div", { className: "view-usage-wrapper s-view-usage", children: [allDashboardsCount > 0 ? (_jsxs("details", { className: "gd-collapsible-section s-view-usage-dashboards", children: [_jsx("summary", { children: intl.formatMessage({ id: "dialogs.saveReportFromKD.usage.dashboards" }, { count: allDashboardsCount }) }), _jsxs("div", { className: "gd-collapsible-content gd-state-text", children: [renderListOfAccessible ? (_jsx("ul", { children: accessibleDashboards.map((dash) => (_jsx(DashboardItem, { dashboard: dash }, dash.id))) })) : null, renderAlsoInaccessible ? (_jsx(InaccessibleMessage, { message: inaccessibleMessages.dashboards, count: inaccessibleDashboardsCount })) : null, renderInaccessibleOnly ? (_jsx(OnlyInaccessibleMessage, { message: inaccessibleMessages.dashboardsOnly, count: inaccessibleDashboardsCount })) : null] })] })) : null, allDocumentsCount > 0 ? (_jsxs("details", { className: "gd-collapsible-section s-view-usage-documents", children: [_jsx("summary", { children: intl.formatMessage({ id: "dialogs.saveReportFromKD.usage.documents" }, { count: allDocumentsCount }) }), _jsxs("div", { className: "gd-collapsible-content gd-state-text", children: [accessibleDocuments.length > 0 ? (_jsx("ul", { children: accessibleDocuments.map((item) => (_jsx(DocumentItem, { item: item }, item.id))) })) : null, accessibleDocuments.length > 0 && inaccessibleDocumentsCount > 0 ? (_jsx(InaccessibleMessage, { message: inaccessibleMessages.documents, count: inaccessibleDocumentsCount })) : null, accessibleDocuments.length === 0 ? (_jsx(OnlyInaccessibleMessage, { message: inaccessibleMessages.documentsOnly, count: inaccessibleDocumentsCount })) : null] })] })) : null] }));
25
+ return (_jsxs("div", { className: "view-usage-wrapper s-view-usage", children: [allDashboardsCount > 0 ? (_jsxs("details", { className: "gd-collapsible-section s-view-usage-dashboards", children: [_jsx("summary", { children: intl.formatMessage({ id: "dialogs.saveReportFromKD.usage.dashboards" }, { count: allDashboardsCount }) }), _jsxs("div", { className: "gd-collapsible-content gd-state-text", children: [renderListOfAccessible ? (_jsx("ul", { children: accessibleDashboards.map((dash) => (_jsx(DashboardItem, { dashboard: dash }, dash.id))) })) : null, renderAlsoInaccessible ? (_jsx(InaccessibleMessage, { message: inaccessibleMessages.dashboards, count: inaccessibleDashboardsCount })) : null, renderInaccessibleOnly ? (_jsx(OnlyInaccessibleMessage, { message: inaccessibleMessages.dashboardsOnly, count: inaccessibleDashboardsCount })) : null] })] })) : null, allDocumentsCount > 0 ? (_jsxs("details", { className: "gd-collapsible-section s-view-usage-documents", children: [_jsx("summary", { children: intl.formatMessage({ id: "dialogs.saveReportFromKD.usage.documents" }, { count: allDocumentsCount }) }), _jsxs("div", { className: "gd-collapsible-content gd-state-text", children: [accessibleDocuments.length > 0 ? (_jsx("ul", { children: accessibleDocuments.map((item) => (_jsx(DocumentItem, { item: item }, `${item.type}/${item.id}`))) })) : null, accessibleDocuments.length > 0 && inaccessibleDocumentsCount > 0 ? (_jsx(InaccessibleMessage, { message: inaccessibleMessages.documents, count: inaccessibleDocumentsCount })) : null, accessibleDocuments.length === 0 ? (_jsx(OnlyInaccessibleMessage, { message: inaccessibleMessages.documentsOnly, count: inaccessibleDocumentsCount })) : null] })] })) : null] }));
26
26
  }
27
27
  export const InsightUsageOnDashboardsList = Component;
@@ -15,11 +15,7 @@ export interface IDecoratedDateFilter {
15
15
  isDate: true;
16
16
  }
17
17
  declare function getAttributeTitle(filter: IDecoratedDateFilter): string | undefined;
18
- /**
19
- * Words the empty date values mode like the metric date filter chip and the filter bar's button:
20
- * "Empty values" for only, "All time except Empty values" for exclude on All time.
21
- */
22
- declare function getIntervalTitle(filter: IDecoratedDateFilter, intl: IntlShape, formatLocale?: string): string | null;
18
+ declare function getIntervalTitle(filter: IDecoratedDateFilter, intl: IntlShape, formatLocale?: string): string;
23
19
  declare function getTitle(filter: IDecoratedDateFilter, intl: IntlShape, formatLocale?: string): string;
24
20
  declare function isAllTime(filter: IDecoratedDateFilter): boolean;
25
21
  export declare const DecoratedDateFilter: {
@@ -1 +1 @@
1
- {"version":3,"file":"date_filter.d.ts","sourceRoot":"","sources":["../../src/models/date_filter.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,KAAK,SAAS,EAAE,MAAM,YAAY,CAAC;AAG5C,OAAO,EAAE,KAAK,iBAAiB,EAAE,MAAM,wCAAwC,CAAC;AAChF,OAAO,EAAE,KAAK,uBAAuB,EAAE,MAAM,kCAAkC,CAAC;AAEhF,OAAO,EAAE,KAAK,yBAAyB,EAAE,MAAM,mBAAmB,CAAC;AACnE,OAAO,EAEH,KAAK,oBAAoB,EAI5B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AoB;IACjC,QAAQ,EAAE,oBAAoB,CAAC;IAC/B;;;OAGG;IACH,QAAQ,EAAE,uBAAuB,GAAG,IAAI,CAAC;IACzC,WAAW,EAAE,yBAAyB,GAAG,IAAI,CAAC;IAC9C,UAAU,EAAE,OAAO,CAAC;IACpB,MAAM,EAAE,IAAI,CAAC;CAChB;AAED,iBAAS,iBAAiB,CAAC,MAAM,EAAE,oBAAoB,sBAEtD;AAED,iBAAS,gBAAgB,CAAC,MAAM,EAAE,oBAAoB,EAAE,IAAI,EAAE,SAAS,EAAE,YAAY,CAAC,EAAE,MAAM,UAc7F;AAED,iBAAS,QAAQ,CAAC,MAAM,EAAE,oBAAoB,EAAE,IAAI,EAAE,SAAS,EAAE,YAAY,CAAC,EAAE,MAAM,UAErF;AAED,iBAAS,SAAS,CAAC,MAAM,EAAE,oBAAoB,WAE9C;AAED,eAAO,MAAM,mBAAmB;;;;;CAK/B,CAAC;AAEF,wBAAgB,yBAAyB,CACrC,MAAM,EAAE,uBAAuB,GAAG,IAAI,EACtC,WAAW,EAAE,yBAAyB,GAAG,IAAI,EAC7C,WAAW,GAAE,OAAO,CAAC,iBAAiB,CAAC,GAAG,SAAqB,EAC/D,SAAS,UAAQ,GAClB,oBAAoB,CAQtB"}
@@ -1,24 +1,13 @@
1
1
  // (C) 2007-2026 GoodData Corporation
2
2
  import { ALL_TIME } from "../constants/presets.js";
3
+ import { getPeriodTitleWithEmptyValues } from "./empty_date_values_title.js";
3
4
  import { DecoratedPresetItem, LOCAL_TIMEZONE_OFFSET, PRESETS, createDecoratedPresetItem, } from "./preset_item.js";
4
5
  function getAttributeTitle(filter) {
5
6
  return filter.dateDataset?.attributeTitle;
6
7
  }
7
- /**
8
- * Words the empty date values mode like the metric date filter chip and the filter bar's button:
9
- * "Empty values" for only, "All time except Empty values" for exclude on All time.
10
- */
11
8
  function getIntervalTitle(filter, intl, formatLocale) {
12
- const mode = filter.original?.emptyDateValuesFilter;
13
- const emptyValuesLabel = () => intl.formatMessage({ id: "filter.date.additional_filter.empty_values" });
14
- if (mode === "only") {
15
- return emptyValuesLabel();
16
- }
17
9
  const periodTitle = DecoratedPresetItem.getTitle(filter.interval, intl, 0, LOCAL_TIMEZONE_OFFSET, formatLocale);
18
- if (mode === "exclude" && isAllTime(filter)) {
19
- return `${periodTitle} ${intl.formatMessage({ id: "gs.list.except" })} ${emptyValuesLabel()}`;
20
- }
21
- return periodTitle;
10
+ return getPeriodTitleWithEmptyValues(periodTitle, isAllTime(filter), filter.original?.emptyDateValuesFilter, intl);
22
11
  }
23
12
  function getTitle(filter, intl, formatLocale) {
24
13
  return `${getAttributeTitle(filter)}: ${getIntervalTitle(filter, intl, formatLocale)}`;
@@ -0,0 +1,15 @@
1
+ import { type IntlShape } from "react-intl";
2
+ import { type EmptyDateValuesFilterMode } from "../store/filter_bar/filter_bar_types.js";
3
+ /**
4
+ * Words the empty date values mode into a date filter title, the same on the filter bar's button and the
5
+ * metric date filter: "Empty values" for only, "All time except Empty values" for exclude on All time,
6
+ * "<period>, empty values" for include with a period. Other combinations are the default for the period,
7
+ * so the period title is returned unchanged.
8
+ *
9
+ * @param periodTitle - the formatted period, e.g. "Last 4 quarters"
10
+ * @param isAllTime - whether the period is All time
11
+ * @param mode - the empty date values mode
12
+ * @param intl - AD intl, which holds the empty values translations
13
+ */
14
+ export declare function getPeriodTitleWithEmptyValues(periodTitle: string, isAllTime: boolean, mode: EmptyDateValuesFilterMode | undefined, intl: IntlShape): string;
15
+ //# sourceMappingURL=empty_date_values_title.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"empty_date_values_title.d.ts","sourceRoot":"","sources":["../../src/models/empty_date_values_title.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,KAAK,SAAS,EAAE,MAAM,YAAY,CAAC;AAE5C,OAAO,EAAE,KAAK,yBAAyB,EAAE,MAAM,yCAAyC,CAAC;AAEzF;;;;;;;;;;GAUG;AACH,wBAAgB,6BAA6B,CACzC,WAAW,EAAE,MAAM,EACnB,SAAS,EAAE,OAAO,EAClB,IAAI,EAAE,yBAAyB,GAAG,SAAS,EAC3C,IAAI,EAAE,SAAS,GAChB,MAAM,CAYR"}
@@ -0,0 +1,25 @@
1
+ // (C) 2026 GoodData Corporation
2
+ /**
3
+ * Words the empty date values mode into a date filter title, the same on the filter bar's button and the
4
+ * metric date filter: "Empty values" for only, "All time except Empty values" for exclude on All time,
5
+ * "<period>, empty values" for include with a period. Other combinations are the default for the period,
6
+ * so the period title is returned unchanged.
7
+ *
8
+ * @param periodTitle - the formatted period, e.g. "Last 4 quarters"
9
+ * @param isAllTime - whether the period is All time
10
+ * @param mode - the empty date values mode
11
+ * @param intl - AD intl, which holds the empty values translations
12
+ */
13
+ export function getPeriodTitleWithEmptyValues(periodTitle, isAllTime, mode, intl) {
14
+ const emptyValuesLabel = () => intl.formatMessage({ id: "filter.date.additional_filter.empty_values" });
15
+ if (mode === "only") {
16
+ return emptyValuesLabel();
17
+ }
18
+ if (mode === "exclude" && isAllTime) {
19
+ return `${periodTitle} ${intl.formatMessage({ id: "gs.list.except" })} ${emptyValuesLabel()}`;
20
+ }
21
+ if (mode === "include" && !isAllTime) {
22
+ return intl.formatMessage({ id: "filter.date.empty_values.include.title" }, { title: periodTitle });
23
+ }
24
+ return periodTitle;
25
+ }
@@ -10,11 +10,11 @@ import { type ILoadedReportItems } from "../typings/report.js";
10
10
  import { type ICatalogEntries, type ICatalogEntry } from "../typings/state_objects.js";
11
11
  export declare function pickValid<T extends object>(object: T): Partial<T>;
12
12
  /**
13
- * The `emptyValueHandling` a date filter stores for the empty date values mode. Like the legacy `""`
14
- * attribute filter, only exclude and only are stored: include is the backend default for All time and
15
- * the picker does not offer it with a period.
13
+ * The `emptyValueHandling` a date filter stores for the empty date values mode. Exclude and only are
14
+ * always stored. Include is stored only with a period, where the backend default is exclude; on All time
15
+ * it is the backend default, so it is dropped to keep a single stored shape.
16
16
  */
17
- export declare function emptyValueHandlingToMd(emptyDateValuesFilter: EmptyDateValuesFilterMode | undefined): {
17
+ export declare function emptyValueHandlingToMd(emptyDateValuesFilter: EmptyDateValuesFilterMode | undefined, isAllTime: boolean): {
18
18
  emptyValueHandling?: EmptyValues;
19
19
  };
20
20
  /** The additional data `constructVisualizationMDObj` threads into the buckets → MD transform. */
@@ -58,11 +58,17 @@ ref?: ObjRef): ICatalogEntry | undefined;
58
58
  * - a legacy `""` attribute filter becomes the empty values mode of its date filter, as when the insight
59
59
  * is loaded,
60
60
  * - every All time filter becomes `ALL_TIME_GRANULARITY` from 0 to 0, however it is stored,
61
- * - the default `include` mode is dropped, as when the insight is saved.
61
+ * - the `include` mode is dropped on All time, where it is the default, as when the insight is saved,
62
+ * and also with a period when the writer cannot store it there (`isIncludeWithPeriodKept` is false).
62
63
  *
63
64
  * Used only to compare stored content; the result is never saved.
65
+ *
66
+ * @param visualizationFilters - the stored filters
67
+ * @param dateDatasets - date datasets, used to recognize the legacy `""` attribute filter
68
+ * @param isIncludeWithPeriodKept - whether the writer keeps `include` with a period: the filter bar only
69
+ * with the `enableImprovedMetricDateFilter` flag, metric date filters always.
64
70
  */
65
- export declare function normalizeEmptyDateValuesFilters(visualizationFilters: ReadonlyArray<VisualizationObjectExtendedFilter>, dateDatasets: IDateDatasets | undefined): VisualizationObjectExtendedFilter[];
71
+ export declare function normalizeEmptyDateValuesFilters(visualizationFilters: ReadonlyArray<VisualizationObjectExtendedFilter>, dateDatasets: IDateDatasets | undefined, isIncludeWithPeriodKept: boolean): VisualizationObjectExtendedFilter[];
66
72
  export declare function isMeasureShowOnSecondaryAxis(item: IVisualizationObjectMeasure, properties: IStoredVisualizationProperties | undefined): boolean;
67
73
  export declare function isATotalMeasure(item: IVisualizationObjectMeasure, properties: IStoredVisualizationProperties | undefined): boolean;
68
74
  export declare function isThresholdMeasure(item: IVisualizationObjectMeasure, properties: IStoredVisualizationProperties | undefined): boolean;
@@ -1 +1 @@
1
- {"version":3,"file":"metadata.d.ts","sourceRoot":"","sources":["../../src/models/metadata.ts"],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uCAAuC,CACnD,QAAQ,EAAE,2BAA2B,GACtC,0CAA0C,CAQ5C;AAED,wBAAgB,2BAA2B,CACvC,cAAc,EAAE,2BAA2B,GAC5C,0CAA0C,CAE5C;AAuBD,wBAAgB,yBAAyB,CACrC,cAAc,EAAE,2BAA2B,GAC5C,2BAA2B,CAK7B;AAwBD,wBAAgB,wBAAwB,CACpC,cAAc,EAAE,2BAA2B,GAC5C,2BAA2B,CAkB7B;AA+BD,wBAAgB,2BAA2B,CACvC,cAAc,EAAE,2BAA2B,GAC5C,2BAA2B,CAgB7B;AAsED,wBAAgB,yBAAyB,CACrC,cAAc,EAAE,2BAA2B,GAAG,SAAS,GACxD,sBAAsB,CAUxB;AAED,2FAA2F;AAC3F,MAAM,WAAW,wBAAwB;IACrC,OAAO,EAAE,WAAW,CAAC;IACrB,OAAO,EAAE,OAAO,EAAE,CAAC;IACnB,cAAc,EAAE,eAAe,CAAC;CACnC;AAED,eAAO,MAAM,iBAAiB,WAAY;IACtC,cAAc,EAAE,2BAA2B,CAAC;IAC5C,cAAc,EAAE,eAAe,CAAC;CACnC,KAAG,wBAA8D,CAAC"}
@@ -47,14 +47,15 @@ function numberOrUndefined(value) {
47
47
  /** The granularity of a stored All time date filter, which the sdk-model types as a literal. */
48
48
  const ALL_TIME_GRANULARITY = "ALL_TIME_GRANULARITY";
49
49
  /**
50
- * The `emptyValueHandling` a date filter stores for the empty date values mode. Like the legacy `""`
51
- * attribute filter, only exclude and only are stored: include is the backend default for All time and
52
- * the picker does not offer it with a period.
50
+ * The `emptyValueHandling` a date filter stores for the empty date values mode. Exclude and only are
51
+ * always stored. Include is stored only with a period, where the backend default is exclude; on All time
52
+ * it is the backend default, so it is dropped to keep a single stored shape.
53
53
  */
54
- export function emptyValueHandlingToMd(emptyDateValuesFilter) {
55
- return emptyDateValuesFilter === "exclude" || emptyDateValuesFilter === "only"
56
- ? { emptyValueHandling: emptyDateValuesFilter }
57
- : {};
54
+ export function emptyValueHandlingToMd(emptyDateValuesFilter, isAllTime) {
55
+ if (emptyDateValuesFilter === "exclude" || emptyDateValuesFilter === "only") {
56
+ return { emptyValueHandling: emptyDateValuesFilter };
57
+ }
58
+ return emptyDateValuesFilter === "include" && !isAllTime ? { emptyValueHandling: "include" } : {};
58
59
  }
59
60
  function measureFilterToMd(filter) {
60
61
  if (isDecoratedDateFilter(filter)) {
@@ -65,7 +66,7 @@ function measureFilterToMd(filter) {
65
66
  }
66
67
  const from = filter.interval?.interval?.[0];
67
68
  const to = filter.interval?.interval?.[1];
68
- const emptyValueHandlingProp = emptyValueHandlingToMd(filter.original?.emptyDateValuesFilter);
69
+ const emptyDateValuesFilter = filter.original?.emptyDateValuesFilter;
69
70
  const absoluteDateFilter = filter.interval?.isStatic ?? false;
70
71
  if (absoluteDateFilter) {
71
72
  // a static (absolute) preset interval is the [string, string] side of the tuple union
@@ -74,7 +75,7 @@ function measureFilterToMd(filter) {
74
75
  dataSet,
75
76
  from: from,
76
77
  to: to,
77
- ...emptyValueHandlingProp,
78
+ ...emptyValueHandlingToMd(emptyDateValuesFilter, false),
78
79
  },
79
80
  };
80
81
  }
@@ -82,6 +83,7 @@ function measureFilterToMd(filter) {
82
83
  const boundedFilter = filter.interval?.boundedFilter;
83
84
  const relativeFrom = numberOrUndefined(from);
84
85
  const relativeTo = numberOrUndefined(to);
86
+ const emptyValueHandlingProp = emptyValueHandlingToMd(emptyDateValuesFilter, relativeFrom === undefined || relativeTo === undefined);
85
87
  // All time is stored without bounds, a no-op the execution drops; to carry the empty date values
86
88
  // mode it has to be the real All time filter, the one the execution sends (as on the filter bar)
87
89
  if ((relativeFrom === undefined || relativeTo === undefined) && !_isEmpty(emptyValueHandlingProp)) {
@@ -168,8 +170,12 @@ function measureFilterToMd(filter) {
168
170
  }
169
171
  function dateFilterToMd({ filterConfig, dateDatasetRef, emptyDateValuesFilter }, useEmptyValueHandling) {
170
172
  const [from, to] = filterConfig?.interval || [undefined, undefined];
171
- const emptyValueHandlingProp = useEmptyValueHandling ? emptyValueHandlingToMd(emptyDateValuesFilter) : {};
172
- if (filterConfig?.type === "absolute") {
173
+ const isAbsolute = filterConfig?.type === "absolute";
174
+ const isAllTime = !isAbsolute && (from === undefined || to === undefined);
175
+ const emptyValueHandlingProp = useEmptyValueHandling
176
+ ? emptyValueHandlingToMd(emptyDateValuesFilter, isAllTime)
177
+ : {};
178
+ if (isAbsolute) {
173
179
  return {
174
180
  absoluteDateFilter: {
175
181
  dataSet: dateDatasetRef,
@@ -181,7 +187,7 @@ function dateFilterToMd({ filterConfig, dateDatasetRef, emptyDateValuesFilter },
181
187
  }
182
188
  // All time is stored without bounds, a no-op the execution drops. To carry the empty date values mode
183
189
  // it has to be the real All time filter, the one the execution sends.
184
- if ((from === undefined || to === undefined) && !_isEmpty(emptyValueHandlingProp)) {
190
+ if (isAllTime && !_isEmpty(emptyValueHandlingProp)) {
185
191
  return {
186
192
  relativeDateFilter: {
187
193
  dataSet: dateDatasetRef,
@@ -1108,11 +1114,17 @@ function collectLegacyEmptyDateValuesFilters(visualizationFilters, dateDatasets)
1108
1114
  * - a legacy `""` attribute filter becomes the empty values mode of its date filter, as when the insight
1109
1115
  * is loaded,
1110
1116
  * - every All time filter becomes `ALL_TIME_GRANULARITY` from 0 to 0, however it is stored,
1111
- * - the default `include` mode is dropped, as when the insight is saved.
1117
+ * - the `include` mode is dropped on All time, where it is the default, as when the insight is saved,
1118
+ * and also with a period when the writer cannot store it there (`isIncludeWithPeriodKept` is false).
1112
1119
  *
1113
1120
  * Used only to compare stored content; the result is never saved.
1121
+ *
1122
+ * @param visualizationFilters - the stored filters
1123
+ * @param dateDatasets - date datasets, used to recognize the legacy `""` attribute filter
1124
+ * @param isIncludeWithPeriodKept - whether the writer keeps `include` with a period: the filter bar only
1125
+ * with the `enableImprovedMetricDateFilter` flag, metric date filters always.
1114
1126
  */
1115
- export function normalizeEmptyDateValuesFilters(visualizationFilters, dateDatasets) {
1127
+ export function normalizeEmptyDateValuesFilters(visualizationFilters, dateDatasets, isIncludeWithPeriodKept) {
1116
1128
  const { emptyDateValuesFilters, emptyDateValuesFilterIndices } = collectLegacyEmptyDateValuesFilters(visualizationFilters, dateDatasets);
1117
1129
  return visualizationFilters
1118
1130
  .filter((_filter, index) => !emptyDateValuesFilterIndices.has(index))
@@ -1121,18 +1133,19 @@ export function normalizeEmptyDateValuesFilters(visualizationFilters, dateDatase
1121
1133
  return filter;
1122
1134
  }
1123
1135
  const dataSet = getDateFilterDataSet(filter);
1124
- const storedMode = getDateFilterEmptyValueHandling(filter);
1125
- const mode = emptyValueHandlingToMd(storedMode ?? emptyDateValuesFilters[objRefToString(dataSet)]?.mode);
1136
+ const storedMode = getDateFilterEmptyValueHandling(filter) ??
1137
+ emptyDateValuesFilters[objRefToString(dataSet)]?.mode;
1126
1138
  if (isVisualizationObjectAbsoluteDateFilter(filter)) {
1127
1139
  return {
1128
1140
  absoluteDateFilter: {
1129
1141
  ..._omit(filter.absoluteDateFilter, "emptyValueHandling"),
1130
- ...mode,
1142
+ ...emptyValueHandlingToMd(storedMode, !isIncludeWithPeriodKept),
1131
1143
  },
1132
1144
  };
1133
1145
  }
1134
1146
  const { granularity, from, to } = filter.relativeDateFilter;
1135
1147
  const isAllTime = granularity === ALL_TIME_GRANULARITY || from === undefined || to === undefined;
1148
+ const mode = emptyValueHandlingToMd(storedMode, isAllTime || !isIncludeWithPeriodKept);
1136
1149
  // AD saves All time as GDC.time.year without from/to, or as ALL_TIME_GRANULARITY 0..0 when it has
1137
1150
  // an empty values mode. API clients can store either shape, e.g. ALL_TIME_GRANULARITY with "include".
1138
1151
  if (isAllTime) {
@@ -18,6 +18,7 @@ export declare const CONTROL_FILTERING_ERRORS: {
18
18
  invalidDateFilterGranularity: ICommandFailedBody;
19
19
  invalidDateFilterFromToValue: ICommandFailedBody;
20
20
  invalidFilterDataFormat: ICommandFailedBody;
21
+ unsupportedAbsoluteGranularityDateFilter: ICommandFailedBody;
21
22
  invalidFilterItemsCount: ICommandFailedBody;
22
23
  invalidRemoveFilterItemsCount: ICommandFailedBody;
23
24
  notExistedDateDataset: ICommandFailedBody;
@@ -1 +1 @@
1
- {"version":3,"file":"control_filtering_events.d.ts","sourceRoot":"","sources":["../../../src/postMessageApi/outgoing/control_filtering_events.ts"],"names":[],"mappings":"AAEA,OAAO,EAEH,KAAK,UAAU,EACf,KAAK,gBAAgB,EAIrB,KAAK,kBAAkB,EAC1B,MAAM,yBAAyB,CAAC;AAIjC,wBAAgB,6BAA6B,CACzC,iBAAiB,EAAE,gBAAgB,EAAE,EACrC,oBAAoB,CAAC,EAAE,MAAM,GAC9B,IAAI,CAGN;AAED,wBAAgB,gCAAgC,CAC5C,iBAAiB,EAAE,gBAAgB,EAAE,EACrC,oBAAoB,CAAC,EAAE,MAAM,GAC9B,IAAI,CAON;AAGD,wBAAgB,wBAAwB,CAAC,iBAAiB,EAAE,gBAAgB,EAAE,EAAE,MAAM,EAAE,UAAU,GAAG,IAAI,CAMxG;AA+ID,eAAO,MAAM,wBAAwB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA6BpC,CAAC"}
1
+ {"version":3,"file":"control_filtering_events.d.ts","sourceRoot":"","sources":["../../../src/postMessageApi/outgoing/control_filtering_events.ts"],"names":[],"mappings":"AAEA,OAAO,EAEH,KAAK,UAAU,EACf,KAAK,gBAAgB,EAIrB,KAAK,kBAAkB,EAC1B,MAAM,yBAAyB,CAAC;AAIjC,wBAAgB,6BAA6B,CACzC,iBAAiB,EAAE,gBAAgB,EAAE,EACrC,oBAAoB,CAAC,EAAE,MAAM,GAC9B,IAAI,CAGN;AAED,wBAAgB,gCAAgC,CAC5C,iBAAiB,EAAE,gBAAgB,EAAE,EACrC,oBAAoB,CAAC,EAAE,MAAM,GAC9B,IAAI,CAON;AAGD,wBAAgB,wBAAwB,CAAC,iBAAiB,EAAE,gBAAgB,EAAE,EAAE,MAAM,EAAE,UAAU,GAAG,IAAI,CAMxG;AAoJD,eAAO,MAAM,wBAAwB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA8BpC,CAAC"}
@@ -73,6 +73,10 @@ const invalidFilterDataFormat = {
73
73
  errorCode: GdcErrorType.InvalidArgument,
74
74
  errorMessage: "The command has invalid filter format",
75
75
  };
76
+ const unsupportedAbsoluteGranularityDateFilter = {
77
+ errorCode: GdcErrorType.InvalidArgument,
78
+ errorMessage: "The command has absolute date filter with granularity which is not supported yet",
79
+ };
76
80
  const invalidFilterItemsCount = {
77
81
  errorCode: GdcErrorType.InvalidArgument,
78
82
  errorMessage: "The app cannot be applied more than 20 items on filter bar",
@@ -145,6 +149,7 @@ export const CONTROL_FILTERING_ERRORS = {
145
149
  invalidDateFilterGranularity,
146
150
  invalidDateFilterFromToValue,
147
151
  invalidFilterDataFormat,
152
+ unsupportedAbsoluteGranularityDateFilter,
148
153
  invalidFilterItemsCount,
149
154
  invalidRemoveFilterItemsCount,
150
155
  notExistedDateDataset,
@@ -0,0 +1,23 @@
1
+ import { type SagaIterator } from "redux-saga";
2
+ /**
3
+ * Returns a description of a failed check that is safe to log. An axios error keeps the request
4
+ * configuration, with the `Authorization` header that carries the token.
5
+ */
6
+ export declare function describeTokenCheckFailure(error: unknown): string;
7
+ /**
8
+ * Checks the origin of a `setApiToken` command with the token that the command carries, not with the
9
+ * token that the application uses now.
10
+ *
11
+ * @remarks
12
+ * The check goes around the live backend, so it works also when the current token has expired, and
13
+ * an invalid new token does not start the authentication flow. The request goes to the current
14
+ * origin, so a token of another organization fails the check.
15
+ *
16
+ * On a denied origin or a failed check the function writes a warning and posts the same error event
17
+ * as for other commands. The caller must then drop the token and keep the current authentication.
18
+ *
19
+ * @returns `true` when the token can be used: the origin is in the embedding origins, or origin
20
+ * validation is off.
21
+ */
22
+ export declare function checkApiTokenOrigin(token: string, origin: string, contextId: string): SagaIterator<boolean>;
23
+ //# sourceMappingURL=api_token_origin_check.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"api_token_origin_check.d.ts","sourceRoot":"","sources":["../../../src/postMessageApi/sagas/api_token_origin_check.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,KAAK,YAAY,EAAE,MAAM,YAAY,CAAC;AAS/C;;;GAGG;AACH,wBAAgB,yBAAyB,CAAC,KAAK,EAAE,OAAO,GAAG,MAAM,CAMhE;AAED;;;;;;;;;;;;;;GAcG;AACH,wBAAiB,mBAAmB,CAChC,KAAK,EAAE,MAAM,EACb,MAAM,EAAE,MAAM,EACd,SAAS,EAAE,MAAM,GAClB,YAAY,CAAC,OAAO,CAAC,CA+BvB"}
@@ -0,0 +1,58 @@
1
+ // (C) 2026 GoodData Corporation
2
+ import { call, put, select } from "redux-saga/effects";
3
+ import { validateEmbeddingOriginWithToken } from "@gooddata/sdk-backend-tiger";
4
+ import { notifyValidatedCommandOrigin } from "@gooddata/sdk-embedding/internal";
5
+ import { isEmbeddingOriginValidationEnabled } from "../../selectors/feature_flag_selector.js";
6
+ import { hostVerificationErrored, hostVerificationFailed } from "../actions/command_error_actions.js";
7
+ /**
8
+ * Returns a description of a failed check that is safe to log. An axios error keeps the request
9
+ * configuration, with the `Authorization` header that carries the token.
10
+ */
11
+ export function describeTokenCheckFailure(error) {
12
+ if (typeof error === "object" && error !== null && "isAxiosError" in error && error.isAxiosError) {
13
+ const { response, code } = error;
14
+ return response?.status === undefined ? (code ?? "network error") : `HTTP ${response.status}`;
15
+ }
16
+ return error instanceof Error ? error.message : String(error);
17
+ }
18
+ /**
19
+ * Checks the origin of a `setApiToken` command with the token that the command carries, not with the
20
+ * token that the application uses now.
21
+ *
22
+ * @remarks
23
+ * The check goes around the live backend, so it works also when the current token has expired, and
24
+ * an invalid new token does not start the authentication flow. The request goes to the current
25
+ * origin, so a token of another organization fails the check.
26
+ *
27
+ * On a denied origin or a failed check the function writes a warning and posts the same error event
28
+ * as for other commands. The caller must then drop the token and keep the current authentication.
29
+ *
30
+ * @returns `true` when the token can be used: the origin is in the embedding origins, or origin
31
+ * validation is off.
32
+ */
33
+ export function* checkApiTokenOrigin(token, origin, contextId) {
34
+ const isValidationEnabled = yield select(isEmbeddingOriginValidationEnabled);
35
+ // Without the flag, no backend call: the token is used, as before the validation existed.
36
+ if (!isValidationEnabled) {
37
+ return true;
38
+ }
39
+ let isValid;
40
+ try {
41
+ isValid = yield call(validateEmbeddingOriginWithToken, { token, origin });
42
+ }
43
+ catch (e) {
44
+ // oxlint-disable-next-line eslint-js/no-console
45
+ console.warn(`Could not check the origin "${origin}" of the new API token (${describeTokenCheckFailure(e)}). The token was not used, the current authentication is kept.`);
46
+ yield put(hostVerificationErrored(contextId));
47
+ return false;
48
+ }
49
+ if (!isValid) {
50
+ // oxlint-disable-next-line eslint-js/no-console
51
+ console.warn(`Denied the new API token from the origin "${origin}". The origin is not in the embedding origins of the organization. The current authentication is kept.`);
52
+ yield put(hostVerificationFailed(contextId));
53
+ return false;
54
+ }
55
+ // The outgoing events may wait for the first command with a valid origin.
56
+ yield call(notifyValidatedCommandOrigin, origin);
57
+ return true;
58
+ }
@@ -1,6 +1,14 @@
1
1
  import { type AdSetApiTokenCommandData } from "@gooddata/sdk-embedding";
2
- export declare function handleReceivedApiToken(setApiTokenContext: AdSetApiTokenCommandData): Generator<import("redux-saga/effects").CallEffect<void> | import("redux-saga/effects").PutEffect<{
2
+ /**
3
+ * Applies the token of a `setApiToken` command to the live authentication.
4
+ *
5
+ * @param setApiTokenContext - the received command.
6
+ * @param origin - origin of the window that sent the command. The token is used only when this origin
7
+ * passes the check with the token itself; see {@link checkApiTokenOrigin}. `undefined` for a command
8
+ * that an installed host adapter injected in-process: no window sent it, so there is no origin to check.
9
+ */
10
+ export declare function handleReceivedApiToken(setApiTokenContext: AdSetApiTokenCommandData, origin: string | undefined): Generator<import("redux-saga/effects").CallEffect<void> | import("redux-saga/effects").CallEffect<boolean> | import("redux-saga/effects").PutEffect<{
3
11
  payload: undefined;
4
12
  type: import("../../sagas/application_context/application_context_actions.js").ApplicationContextActionsTypeKeys;
5
- }> | import("redux-saga/effects").SelectEffect, void, string | undefined>;
13
+ }> | import("redux-saga/effects").SelectEffect, void, never>;
6
14
  //# sourceMappingURL=api_token_received_saga.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"api_token_received_saga.d.ts","sourceRoot":"","sources":["../../../src/postMessageApi/sagas/api_token_received_saga.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,KAAK,wBAAwB,EAAE,MAAM,yBAAyB,CAAC;AAexE,wBAAiB,sBAAsB,CAAC,kBAAkB,EAAE,wBAAwB;;;0EAuCnF"}
1
+ {"version":3,"file":"api_token_received_saga.d.ts","sourceRoot":"","sources":["../../../src/postMessageApi/sagas/api_token_received_saga.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,KAAK,wBAAwB,EAAE,MAAM,yBAAyB,CAAC;AAkBxE;;;;;;;GAOG;AACH,wBAAiB,sBAAsB,CACnC,kBAAkB,EAAE,wBAAwB,EAC5C,MAAM,EAAE,MAAM,GAAG,SAAS;;;6DA+C7B"}
@@ -5,10 +5,21 @@ import { backendInitialized } from "../../sagas/application_context/application_
5
5
  import { storeApiToken } from "../../store/application_context/app_context_actions.js";
6
6
  import { selectApiToken, selectApiTokenType } from "../../store/application_context/app_context_selector.js";
7
7
  import { postInvalidCommandArgument } from "../outgoing/invalid_command_events.js";
8
+ import { checkApiTokenOrigin } from "./api_token_origin_check.js";
8
9
  import { getPostMessageContextIdFromCommandData } from "./post_message_saga_helper.js";
9
10
  const DEFAULT_TOKEN_TYPE = "gooddata";
10
- const isValidToken = (token, type) => token !== undefined && token.length > 0 && (type !== "jwt" || /^[\w-]+\.[\w-]+\.[\w-]+$/.test(token));
11
- export function* handleReceivedApiToken(setApiTokenContext) {
11
+ const isValidToken = (token, type) => typeof token === "string" &&
12
+ token.length > 0 &&
13
+ (type !== "jwt" || /^[\w-]+\.[\w-]+\.[\w-]+$/.test(token));
14
+ /**
15
+ * Applies the token of a `setApiToken` command to the live authentication.
16
+ *
17
+ * @param setApiTokenContext - the received command.
18
+ * @param origin - origin of the window that sent the command. The token is used only when this origin
19
+ * passes the check with the token itself; see {@link checkApiTokenOrigin}. `undefined` for a command
20
+ * that an installed host adapter injected in-process: no window sent it, so there is no origin to check.
21
+ */
22
+ export function* handleReceivedApiToken(setApiTokenContext, origin) {
12
23
  const contextId = getPostMessageContextIdFromCommandData(setApiTokenContext);
13
24
  const { token, type = DEFAULT_TOKEN_TYPE, secondsBeforeTokenExpirationToEmitReminder = 60, } = setApiTokenContext.gdc.event.data;
14
25
  const apiToken = {
@@ -29,6 +40,12 @@ export function* handleReceivedApiToken(setApiTokenContext) {
29
40
  yield call(postInvalidCommandArgument, "Token type is not same as the previous one.", contextId);
30
41
  return;
31
42
  }
43
+ if (origin !== undefined) {
44
+ const isOriginValid = yield call(checkApiTokenOrigin, token, origin, contextId);
45
+ if (!isOriginValid) {
46
+ return;
47
+ }
48
+ }
32
49
  const previousToken = yield select(selectApiToken);
33
50
  // The first token and a renewal take the same path: the host's setter decides whether it renews
34
51
  // its provider in place or switches the backend to the token (a first token over cookie auth).
@@ -11,9 +11,6 @@ export declare function validateHostDomain(organizationId: string, url: string):
11
11
  */
12
12
  type CommandOriginCheckResult = "valid" | "denied" | "failed";
13
13
  export declare function handleReceivedCommand({ payload: { data: commandData, origin: commandOrigin }, }: ICommandReceivedAction): Generator<import("redux-saga/effects").CallEffect<void> | import("redux-saga/effects").CallEffect<CommandOriginCheckResult> | import("redux-saga/effects").CallEffect<boolean> | Generator<import("redux-saga/effects").CallEffect<void> | import("redux-saga/effects").PutEffect<{
14
- payload: undefined;
15
- type: import("../../sagas/application_context/application_context_actions.js").ApplicationContextActionsTypeKeys;
16
- }> | import("redux-saga/effects").SelectEffect, void, string | undefined> | Generator<import("redux-saga/effects").CallEffect<void> | import("redux-saga/effects").PutEffect<{
17
14
  payload: import("../../actions/confirm_unsaved_changes_actions.js").IConfirmUnsavedChangesDialogActionPayload;
18
15
  type: import("../../constants/actions.js").ActionTypeKeys.SAGA_CONFIRM_UNSAVED_CHANGES_REQUEST;
19
16
  }> | import("redux-saga/effects").SelectEffect, void, boolean> | Generator<import("redux-saga/effects").CallEffect<void> | import("redux-saga/effects").PutEffect<{
@@ -63,9 +60,6 @@ export declare function handleReceivedCommand({ payload: { data: commandData, or
63
60
  type: PostEventActionTypeKeys.SET_FILTER_CONTEXT_REQUESTED;
64
61
  }>, void, never>;
65
62
  export declare function watchCommandReceived(): Generator<import("redux-saga/effects").ActionChannelEffect | import("redux-saga/effects").CallEffect<Generator<import("redux-saga/effects").CallEffect<void> | import("redux-saga/effects").CallEffect<CommandOriginCheckResult> | import("redux-saga/effects").CallEffect<boolean> | Generator<import("redux-saga/effects").CallEffect<void> | import("redux-saga/effects").PutEffect<{
66
- payload: undefined;
67
- type: import("../../sagas/application_context/application_context_actions.js").ApplicationContextActionsTypeKeys;
68
- }> | import("redux-saga/effects").SelectEffect, void, string | undefined> | Generator<import("redux-saga/effects").CallEffect<void> | import("redux-saga/effects").PutEffect<{
69
63
  payload: import("../../actions/confirm_unsaved_changes_actions.js").IConfirmUnsavedChangesDialogActionPayload;
70
64
  type: import("../../constants/actions.js").ActionTypeKeys.SAGA_CONFIRM_UNSAVED_CHANGES_REQUEST;
71
65
  }> | import("redux-saga/effects").SelectEffect, void, boolean> | Generator<import("redux-saga/effects").CallEffect<void> | import("redux-saga/effects").PutEffect<{
@@ -1 +1 @@
1
- {"version":3,"file":"command_received_saga.d.ts","sourceRoot":"","sources":["../../../src/postMessageApi/sagas/command_received_saga.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,KAAK,OAAO,EAAqB,MAAM,YAAY,CAAC;AAG7D,OAAO,EAIH,KAAK,0BAA0B,EAgBlC,MAAM,yBAAyB,CAAC;AAcjC,OAAO,EAAE,uBAAuB,EAAE,MAAM,4BAA4B,CAAC;AAQrE,OAAO,EAAE,KAAK,sBAAsB,EAAE,MAAM,wCAAwC,CAAC;AAiBrF,wBAAsB,kBAAkB,CAAC,cAAc,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,GAAG,OAAO,CAA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71,26 @@ function* handleSetTimezoneCommand(commandData) {
71
71
  const resolvedOverride = timezoneId || undefined;
72
72
  yield put(setTimezoneOverride(resolvedOverride));
73
73
  }
74
+ /**
75
+ * Tells if the event data of a command is an object. A type guard checks only the command name.
76
+ */
77
+ function hasEventData(commandData) {
78
+ const data = commandData.gdc.event.data;
79
+ return typeof data === "object" && data !== null;
80
+ }
74
81
  export function* handleReceivedCommand({ payload: { data: commandData, origin: commandOrigin }, }) {
75
82
  const commandType = getEventType(commandData);
76
83
  const contextId = getPostMessageContextIdFromCommandData(commandData);
77
84
  // Commands injected in-process by an installed host adapter carry the sentinel origin — no
78
85
  // host-domain validation applies (the sentinel is unreachable via window messages).
79
86
  const isHostInjected = commandOrigin === HOST_ADAPTER_ORIGIN && !!getHostAdapter();
87
+ // The common check runs with the current token. A new token is checked with the token itself, so
88
+ // that a renewal works also when the current token has expired. A command without data goes
89
+ // through the common path, which rejects it.
90
+ if (isAdSetApiTokenCommandData(commandData) && hasEventData(commandData)) {
91
+ yield call(handleReceivedApiToken, commandData, isHostInjected ? undefined : commandOrigin);
92
+ return;
93
+ }
80
94
  const originCheck = isHostInjected
81
95
  ? "valid"
82
96
  : yield call(checkCommandOrigin, commandOrigin);
@@ -133,9 +147,6 @@ export function* handleReceivedCommand({ payload: { data: commandData, origin: c
133
147
  else if (isAdRequestCancellationCommandData(commandData)) {
134
148
  yield handleCancelEditFromKD();
135
149
  }
136
- else if (isAdSetApiTokenCommandData(commandData)) {
137
- yield handleReceivedApiToken(commandData);
138
- }
139
150
  else if (isAdSetTimezoneCommandData(commandData)) {
140
151
  yield handleSetTimezoneCommand(commandData);
141
152
  }
@@ -1 +1 @@
1
- {"version":3,"file":"control_filtering_saga.d.ts","sourceRoot":"","sources":["../../../src/postMessageApi/sagas/control_filtering_saga.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,KAAK,YAAY,EAAE,MAAM,YAAY,CAAC;AAI/C,OAAO,EACH,KAAK,kBAAkB,EACvB,KAAK,0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AmC9E;AAED,wBAAiB,2BAA2B,CAAC,2BAA2B,CAAC,EAAE,wBAAwB,4IAMlG;AAED,wBAAiB,8BAA8B,CAAC,kBAAkB,EAAE,0BAA0B,EAAE,qXAsF/F;AAED,wBAAiB,qBAAqB,6EAcrC"}
1
+ {"version":3,"file":"control_filtering_saga.d.ts","sourceRoot":"","sources":["../../../src/postMessageApi/sagas/control_filtering_saga.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,KAAK,YAAY,EAAE,MAAM,YAAY,CAAC;AAI/C,OAAO,EACH,KAAK,kBAAkB,EACvB,KAAK,0BAA0B,EAC/B,KAAK,qBAAqB,EAC1B,KAAK,wBAAwB,EAMhC,MAAM,yBAAyB,CAAC;AACjC,OAAO,EAEH,KAAK,oCAAoC,EACzC,KAAK,0BAA0B,EAC/B,KAAK,gCAAgC,EACrC,KAAK,yBAAyB,EAGjC,MAAM,kCAAkC,CAAC;AAC1C,OAAO,EAEH,KAAK,mCAAmC,EACxC,KAAK,wBAAwB,EAC7B,KAAK,gCAAgC,EACrC,KAAK,MAAM,EAMd,MAAM,qBAAqB,CAAC;AAgC7B,OAAO,EACH,KAAK,sCAAsC,EAC3C,KAAK,mCAAmC,EACxC,KAAK,mCAAmC,EACxC,KAAK,8BAA8B,EAEnC,KAAK,+BAA+B,EACpC,KAAK,iCAAiC,EAGzC,MAAM,sDAAsD,CAAC;AAC9D,OAAO,EACH,wBAAwB,EAE3B,MAAM,+DAA+D,CAAC;AAavE,OAAO,EAA+B,KAAK,OAAO,EAAE,MAAM,4CAA4C,CAAC;AACvG,OAAO,EAAE,KAAK,SAAS,EAAE,MAAM,sBAAsB,CAAC;AACtD,OAAO,EAAuB,KAAK,eAAe,EAAE,MAAM,0BAA0B,CAAC;AAGrF,OAAO,EAAE,KAAK,UAAU,EAAE,KAAK,eAAe,EAAE,MAAM,gCAAgC,CAAC;AAOvF,OAAO,EAAE,uBAAuB,EAAE,MAAM,4BAA4B,CAAC;AACrE,OAAO,EAGH,KA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,EAAE,sCAAsC,EACxD,mBAAmB,EAAE,OAAO,WAiE/B;AAED,wBAAgB,wBAAwB,CACpC,KAAK,EAAE,SAAS,EAChB,eAAe,EAAE,+BAA+B,EAAE,EAClD,WAAW,EAAE,eAAe,GAC7B,mBAAmB,CAqCrB;AA0ED,wBAAiB,kCAAkC,CAAC,EAChD,OAAO,EAAE,EAAE,OAAO,EAAE,kBAAkB,EAAE,GAC3C,EAAE,mCAAmC;;;;;;;;;;;;;;;;;;6DA8DrC;AA+BD,wBAAiB,yBAAyB,CAAC,WAAW,EAAE,qBAAqB,EAAE,6EAmC9E;AAED,wBAAiB,2BAA2B,CAAC,2BAA2B,CAAC,EAAE,wBAAwB,4IAMlG;AAED,wBAAiB,8BAA8B,CAAC,kBAAkB,EAAE,0BAA0B,EAAE,qXAsF/F;AAED,wBAAiB,qBAAqB,6EAcrC"}
@@ -2,7 +2,7 @@
2
2
  import moment from "moment";
3
3
  import { all, call, put, race, select, take, takeEvery } from "redux-saga/effects";
4
4
  import { isUnexpectedResponseError } from "@gooddata/sdk-backend-spi";
5
- import { isPositiveAttributeFilter, isRemoveAttributeFilter, isRemoveDateFilter, isRemoveRankingFilter, } from "@gooddata/sdk-embedding";
5
+ import { isAbsoluteGranularityDateFilter, isPositiveAttributeFilter, isRemoveAttributeFilter, isRemoveDateFilter, isRemoveRankingFilter, } from "@gooddata/sdk-embedding";
6
6
  import { filterConverters, toDisplayFormRefType, } from "@gooddata/sdk-embedding/internal";
7
7
  import { areObjRefsEqual, idRef, isComputedAttributeRef, isUriRef, uriRef, } from "@gooddata/sdk-model";
8
8
  import { _partition, _uniq, _uniqBy } from "@gooddata/util";
@@ -47,6 +47,7 @@ const ERROR_DUPLICATED_ATTRIBUTE_FILTER_IDENTIFIERS = "ERROR_DUPLICATED_ATTRIBUT
47
47
  const ERROR_INVALID_DATE_DATASET_URI = "ERROR_INVALID_DATE_DATASET_URI";
48
48
  const ERROR_HAS_NON_DEFAULT_ATTRIBUTE_DISPLAY_FORM = "ERROR_HAS_NON_DEFAULT_ATTRIBUTE_DISPLAY_FORM";
49
49
  const ERROR_INVALID_FILTER_DATA_FORMAT = "ERROR_INVALID_FILTER_DATA_FORMAT";
50
+ const ERROR_UNSUPPORTED_ABSOLUTE_GRANULARITY_DATE_FILTER = "ERROR_UNSUPPORTED_ABSOLUTE_GRANULARITY_DATE_FILTER";
50
51
  const ERROR_INVALID_ATTRIBUTE_FILTER_ID = "ERROR_INVALID_ATTRIBUTE_FILTER_ID";
51
52
  const ERROR_INVALID_ATTRIBUTE_FILTER_VALUE = "ERROR_INVALID_ATTRIBUTE_FILTER_VALUE";
52
53
  const ERROR_BAD_ATTRIBUTE_FILTER_DISPLAY_FORM = "ERROR_BAD_ATTRIBUTE_FILTER_DISPLAY_FORM";
@@ -79,6 +80,8 @@ function getAttributeFilterErrorMessage(error) {
79
80
  return CONTROL_FILTERING_ERRORS.invalidDateDatasetUri;
80
81
  case ERROR_INVALID_FILTER_DATA_FORMAT:
81
82
  return CONTROL_FILTERING_ERRORS.invalidFilterDataFormat;
83
+ case ERROR_UNSUPPORTED_ABSOLUTE_GRANULARITY_DATE_FILTER:
84
+ return CONTROL_FILTERING_ERRORS.unsupportedAbsoluteGranularityDateFilter;
82
85
  case ERROR_INVALID_FILTER_ITEMS_COUNT:
83
86
  return CONTROL_FILTERING_ERRORS.invalidFilterItemsCount;
84
87
  case ERROR_INVALID_REMOVE_FILTER_CONTEXT_COUNT:
@@ -434,6 +437,9 @@ export function* handleSetFilterContextRequested({ payload: { filters, postMessa
434
437
  if (hasInvalidFilters || hasSingleSelectionFilters) {
435
438
  throw new Error(ERROR_INVALID_FILTER_DATA_FORMAT);
436
439
  }
440
+ if (filters.some(isAbsoluteGranularityDateFilter)) {
441
+ throw new Error(ERROR_UNSUPPORTED_ABSOLUTE_GRANULARITY_DATE_FILTER);
442
+ }
437
443
  const { attributeFilters, dateFilters, rankingFilter, arbitraryAttributeFilters, matchAttributeFilters, measureValueFilters, } = filterConverters.transformFilterContext(filters);
438
444
  yield call(rejectComputedAttributesWhenDisabled, [
439
445
  ...attributeFilters,
@@ -1,7 +1,4 @@
1
1
  export declare function watchIncomingCommands(): Generator<import("redux-saga/effects").AllEffect<Generator<import("redux-saga/effects").ForkEffect<never>, void, unknown> | Generator<import("redux-saga/effects").ActionChannelEffect | import("redux-saga/effects").CallEffect<Generator<import("redux-saga/effects").CallEffect<void> | import("redux-saga/effects").CallEffect<"denied" | "failed" | "valid"> | import("redux-saga/effects").CallEffect<boolean> | Generator<import("redux-saga/effects").CallEffect<void> | import("redux-saga/effects").PutEffect<{
2
- payload: undefined;
3
- type: import("../../sagas/application_context/application_context_actions.js").ApplicationContextActionsTypeKeys;
4
- }> | import("redux-saga/effects").SelectEffect, void, string | undefined> | Generator<import("redux-saga/effects").CallEffect<void> | import("redux-saga/effects").PutEffect<{
5
2
  payload: import("../../actions/confirm_unsaved_changes_actions.js").IConfirmUnsavedChangesDialogActionPayload;
6
3
  type: import("../../constants/actions.js").ActionTypeKeys.SAGA_CONFIRM_UNSAVED_CHANGES_REQUEST;
7
4
  }> | import("redux-saga/effects").SelectEffect, void, boolean> | Generator<import("redux-saga/effects").CallEffect<void> | import("redux-saga/effects").PutEffect<{