@gooddata/sdk-ui-analytical-designer 11.65.0-alpha.9 → 11.65.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (100) hide show
  1. package/NOTICE +536 -2137
  2. package/README.md +31 -57
  3. package/esm/components/CustomDragLayer.d.ts.map +1 -1
  4. package/esm/components/CustomDragLayer.js +0 -1
  5. package/esm/components/DragScroller/DragScroller.d.ts.map +1 -1
  6. package/esm/components/DragScroller/DragScroller.js +0 -1
  7. package/esm/components/Messages.d.ts.map +1 -1
  8. package/esm/components/Messages.js +13 -11
  9. package/esm/components/buckets/BucketIcon.d.ts +1 -1
  10. package/esm/components/buckets/BucketIcon.d.ts.map +1 -1
  11. package/esm/components/buckets/BucketIcon.js +11 -161
  12. package/esm/components/buckets/MeasureAttributeFilterPickerBody.d.ts.map +1 -1
  13. package/esm/components/buckets/MeasureAttributeFilterPickerBody.js +0 -1
  14. package/esm/embedding/AnalyticalDesigner.d.ts.map +1 -1
  15. package/esm/embedding/AnalyticalDesigner.js +2 -3
  16. package/esm/embedding/AnalyticalDesignerEmbedded.d.ts +5 -2
  17. package/esm/embedding/AnalyticalDesignerEmbedded.d.ts.map +1 -1
  18. package/esm/embedding/AnalyticalDesignerEmbedded.js +1 -2
  19. package/esm/embedding/analyticalDesignerConfig.d.ts +0 -6
  20. package/esm/embedding/analyticalDesignerConfig.d.ts.map +1 -1
  21. package/esm/embedding/analyticalDesignerConfig.js +0 -36
  22. package/esm/embedding/analyticalDesignerTypes.d.ts +119 -104
  23. package/esm/embedding/analyticalDesignerTypes.d.ts.map +1 -1
  24. package/esm/embedding/hostBridge.d.ts +2 -9
  25. package/esm/embedding/hostBridge.d.ts.map +1 -1
  26. package/esm/index.d.ts +1 -1
  27. package/esm/index.d.ts.map +1 -1
  28. package/esm/models/metadata.d.ts +17 -4
  29. package/esm/models/metadata.d.ts.map +1 -1
  30. package/esm/models/metadata.js +103 -25
  31. package/esm/postMessageApi/outgoing/drill_events.d.ts.map +1 -1
  32. package/esm/postMessageApi/outgoing/drill_events.js +10 -3
  33. package/esm/postMessageApi/outgoing/post_event_helper.d.ts +11 -1
  34. package/esm/postMessageApi/outgoing/post_event_helper.d.ts.map +1 -1
  35. package/esm/postMessageApi/outgoing/post_event_helper.js +22 -13
  36. package/esm/sagas/open_report_sagas.d.ts +6 -0
  37. package/esm/sagas/open_report_sagas.d.ts.map +1 -1
  38. package/esm/sagas/open_report_sagas.js +13 -8
  39. package/esm/sdk-ui-analytical-designer.d.ts +112 -95
  40. package/esm/selectors/buckets_selector.d.ts +44 -4
  41. package/esm/selectors/buckets_selector.d.ts.map +1 -1
  42. package/esm/selectors/buckets_selector.js +5 -5
  43. package/esm/selectors/date_datasets_selector.d.ts +88 -8
  44. package/esm/selectors/date_datasets_selector.d.ts.map +1 -1
  45. package/esm/selectors/dialogs_selector.d.ts +11 -11
  46. package/esm/selectors/insight_selectors.d.ts +110 -10
  47. package/esm/selectors/insight_selectors.d.ts.map +1 -1
  48. package/esm/selectors/report_selector.d.ts +44 -4
  49. package/esm/selectors/report_selector.d.ts.map +1 -1
  50. package/esm/selectors/report_visualization_selector.d.ts +26 -6
  51. package/esm/selectors/report_visualization_selector.d.ts.map +1 -1
  52. package/esm/selectors/save_report_from_kd_dialog_selector.d.ts +11 -11
  53. package/esm/selectors/save_report_selector.d.ts +3 -0
  54. package/esm/selectors/save_report_selector.d.ts.map +1 -1
  55. package/esm/selectors/save_report_selector.js +18 -2
  56. package/esm/selectors/uri_selector.d.ts +5 -6
  57. package/esm/selectors/uri_selector.d.ts.map +1 -1
  58. package/esm/selectors/uri_selector.js +1 -10
  59. package/esm/services/bootstrap_error_service.d.ts.map +1 -1
  60. package/esm/services/bootstrap_error_service.js +5 -14
  61. package/esm/translations/de-DE.json +0 -22
  62. package/esm/translations/en-AU.json +0 -22
  63. package/esm/translations/en-GB.json +3 -25
  64. package/esm/translations/es-419.json +0 -22
  65. package/esm/translations/es-ES.json +13 -35
  66. package/esm/translations/fi-FI.json +0 -22
  67. package/esm/translations/fr-CA.json +0 -22
  68. package/esm/translations/fr-FR.json +21 -43
  69. package/esm/translations/id-ID.json +0 -22
  70. package/esm/translations/it-IT.json +0 -22
  71. package/esm/translations/ja-JP.json +0 -22
  72. package/esm/translations/ko-KR.json +0 -22
  73. package/esm/translations/nl-NL.json +0 -22
  74. package/esm/translations/pl-PL.json +0 -22
  75. package/esm/translations/pt-BR.json +0 -22
  76. package/esm/translations/pt-PT.json +0 -22
  77. package/esm/translations/ru-RU.json +0 -22
  78. package/esm/translations/sl-SI.json +0 -22
  79. package/esm/translations/th-TH.json +0 -22
  80. package/esm/translations/tr-TR.json +0 -22
  81. package/esm/translations/uk-UA.json +0 -22
  82. package/esm/translations/vi-VN.json +0 -22
  83. package/esm/translations/zh-HK.json +0 -22
  84. package/esm/translations/zh-Hans.json +0 -22
  85. package/esm/translations/zh-Hant.json +0 -22
  86. package/package.json +21 -22
  87. package/styles/css/buckets.css +7 -0
  88. package/styles/css/buckets.css.map +1 -1
  89. package/styles/css/editor_header.css +1 -1
  90. package/styles/css/editor_header.css.map +1 -1
  91. package/styles/css/main.css +11 -1
  92. package/styles/css/main.css.map +1 -1
  93. package/styles/css/typo.css +3 -0
  94. package/styles/css/typo.css.map +1 -1
  95. package/styles/scss/buckets.scss +10 -0
  96. package/styles/scss/editor_header.scss +1 -1
  97. package/styles/scss/typo.scss +4 -0
  98. package/esm/embedding/embeddedCallbacks.d.ts +0 -31
  99. package/esm/embedding/embeddedCallbacks.d.ts.map +0 -1
  100. package/esm/embedding/embeddedCallbacks.js +0 -59
@@ -1,7 +1,8 @@
1
1
  import { type Ref } from "react";
2
2
  import { type IAnalyticalBackend, type IUserSettings, type IUserWorkspaceSettings } from "@gooddata/sdk-backend-spi";
3
- import { type AdCommandData, type AdExportFinishedBody, type AdFilterContextChangedBody, type AdInsightChangedBody, type AdInsightRenderedBody, type AdInsightSavedBody, type GdcAdCommandType, type IAdAvailableCommands, type ICommandFailedBody, type IFilterContextContent, type IObjectMeta } from "@gooddata/sdk-embedding";
3
+ import { type AdCatalogLoadedBody, type AdCommandData, type AdExportFinishedBody, type AdFilterContextChangedBody, type AdInsightChangedBody, type AdInsightRenderedBody, type AdInsightSavedBody, type GdcAdCommandType, type IAdAvailableCommands, type ICommandFailedBody, type IFilterContextContent, type IObjectMeta } from "@gooddata/sdk-embedding";
4
4
  import { type IColorPalette, type IEntitlementDescriptor, type IInsight, type IInsightDefinition, type ILocale, type ISeparators, type ITheme, type IUser, type IWorkspacePermissions, type ObjRef } from "@gooddata/sdk-model";
5
+ import { type IDrillEvent } from "@gooddata/sdk-ui";
5
6
  import { type IAnalyticalDesignerSlots } from "./slots.js";
6
7
  /**
7
8
  * An action of the Analytical Designer header that a host can hide.
@@ -143,63 +144,147 @@ export interface IAnalyticalDesignerConfig {
143
144
  telemetryCallbacks?: IAnalyticalDesignerTelemetryCallbacks;
144
145
  }
145
146
  /**
146
- * An event Analytical Designer emits. `name` and `data` follow the `@gooddata/sdk-embedding`
147
- * contract of the embedded Analytical Designer.
147
+ * Payload of the event Analytical Designer emits when it opens an insight.
148
148
  *
149
149
  * @alpha
150
150
  */
151
- export interface IAnalyticalDesignerEvent<TData = unknown> {
152
- /**
153
- * Name of the product that emits the event.
154
- */
155
- product: string;
151
+ export interface IAnalyticalDesignerInsightOpenedData {
156
152
  /**
157
- * Name of the event.
153
+ * Commands Analytical Designer accepts for the open insight.
158
154
  */
159
- name: string;
155
+ availableCommands: GdcAdCommandType[];
160
156
  /**
161
- * Payload of the event.
157
+ * Definition of the open insight.
162
158
  */
163
- data: TData;
159
+ definition: IInsightDefinition;
164
160
  /**
165
- * Identifier of the command the event answers, if any.
161
+ * Metadata of the open insight.
166
162
  */
167
- contextId?: string;
163
+ insight: IObjectMeta;
168
164
  }
169
165
  /**
170
- * Handles the Analytical Designer events that it accepts.
166
+ * Payload of each event Analytical Designer emits, by the type of the event.
167
+ *
168
+ * @remarks
169
+ * The types are the names of the `@gooddata/sdk-embedding` contract of the embedded Analytical
170
+ * Designer, for example `GdcAdEventType.InsightSaved` is `visualizationSaved`.
171
171
  *
172
172
  * @alpha
173
173
  */
174
- export interface IAnalyticalDesignerEventHandler {
174
+ export interface IAnalyticalDesignerEventDataMap {
175
175
  /**
176
- * Returns true for the events the handler accepts.
176
+ * Analytical Designer opened an insight.
177
177
  */
178
- eval: (event: IAnalyticalDesignerEvent) => boolean;
178
+ insightOpened: IAnalyticalDesignerInsightOpenedData;
179
179
  /**
180
- * Called with each accepted event.
180
+ * The insight rendered.
181
181
  */
182
- handler: (event: IAnalyticalDesignerEvent) => void;
183
- }
184
- /**
185
- * Payload of the event Analytical Designer emits when it opens an insight.
186
- *
187
- * @alpha
188
- */
189
- export interface IAnalyticalDesignerInsightOpenedData {
182
+ insightRendered: AdInsightRenderedBody;
190
183
  /**
191
- * Commands Analytical Designer accepts for the open insight.
184
+ * The insight definition changed and its execution started.
185
+ */
186
+ insightChanged: AdInsightChangedBody;
187
+ /**
188
+ * The user or a `save` command saved the insight.
189
+ */
190
+ visualizationSaved: AdInsightSavedBody;
191
+ /**
192
+ * The user cancelled the editing.
193
+ */
194
+ insightEditingCancelled: null;
195
+ /**
196
+ * The catalog loaded.
197
+ */
198
+ catalogLoaded: AdCatalogLoadedBody;
199
+ /**
200
+ * A `clear` command finished.
201
+ */
202
+ clearFinished: IAdAvailableCommands;
203
+ /**
204
+ * A `clearInsight` command finished.
205
+ */
206
+ clearInsightFinished: IAdAvailableCommands;
207
+ /**
208
+ * An `undo` command finished.
209
+ */
210
+ undoFinished: IAdAvailableCommands;
211
+ /**
212
+ * A `redo` command finished.
213
+ */
214
+ redoFinished: IAdAvailableCommands;
215
+ /**
216
+ * An `exportInsight` command finished, with the link to the exported file.
217
+ */
218
+ exportInsightFinished: AdExportFinishedBody;
219
+ /**
220
+ * The user changed a filter of the insight.
221
+ */
222
+ filterContextChanged: AdFilterContextChangedBody;
223
+ /**
224
+ * A `setFilterContext` command finished.
225
+ */
226
+ setFilterContextFinished: IAdAvailableCommands;
227
+ /**
228
+ * A `removeFilterContext` command finished.
229
+ */
230
+ removeFilterContextFinished: IAdAvailableCommands;
231
+ /**
232
+ * The user created, changed or deleted an attribute hierarchy.
233
+ */
234
+ attributeHierarchyModified: IAdAvailableCommands;
235
+ /**
236
+ * A command the host sent failed.
237
+ */
238
+ appCommandFailed: ICommandFailedBody;
239
+ /**
240
+ * The commands Analytical Designer accepts changed.
192
241
  */
193
242
  availableCommands: GdcAdCommandType[];
194
243
  /**
195
- * Definition of the open insight.
244
+ * The user saved or deleted a metric. A host that shares a caching backend with Analytical
245
+ * Designer resets its caches here.
196
246
  */
197
- definition: IInsightDefinition;
247
+ metricsChanged: Record<string, never>;
198
248
  /**
199
- * Metadata of the open insight.
249
+ * The user drilled in the insight.
200
250
  */
201
- insight: IObjectMeta;
251
+ drill: IDrillEvent;
252
+ /**
253
+ * Analytical Designer accepts the `drillableItems` command.
254
+ */
255
+ listeningForDrillableItems: Record<string, never>;
256
+ /**
257
+ * The API token of Analytical Designer expires soon.
258
+ */
259
+ apiTokenIsAboutToExpire: Record<string, never>;
202
260
  }
261
+ /**
262
+ * Type of an event Analytical Designer emits.
263
+ *
264
+ * @alpha
265
+ */
266
+ export type AnalyticalDesignerEventType = keyof IAnalyticalDesignerEventDataMap;
267
+ /**
268
+ * An event Analytical Designer emits. Checking `type` narrows `data` to the payload of the event.
269
+ *
270
+ * @alpha
271
+ */
272
+ export type AnalyticalDesignerEvent<T extends AnalyticalDesignerEventType = AnalyticalDesignerEventType> = {
273
+ [K in T]: {
274
+ /**
275
+ * Type of the event.
276
+ */
277
+ type: K;
278
+ /**
279
+ * Payload of the event.
280
+ */
281
+ data: IAnalyticalDesignerEventDataMap[K];
282
+ /**
283
+ * Identifier of the command the event answers, if any.
284
+ */
285
+ contextId?: string;
286
+ };
287
+ }[T];
203
288
  /**
204
289
  * Commands a host sends to Analytical Designer.
205
290
  *
@@ -293,83 +378,13 @@ export interface IAnalyticalDesignerProps {
293
378
  */
294
379
  slots?: IAnalyticalDesignerSlots;
295
380
  /**
296
- * Called when the user or a `save` command saves the insight. `contextId` identifies the command.
297
- */
298
- onInsightSaved?: (data: AdInsightSavedBody, contextId?: string) => void;
299
- /**
300
- * Called when the user cancels the editing.
301
- */
302
- onInsightEditingCancelled?: () => void;
303
- /**
304
- * Called when Analytical Designer opens an insight.
305
- */
306
- onInsightOpened?: (data: IAnalyticalDesignerInsightOpenedData) => void;
307
- /**
308
- * Called when the insight renders.
309
- */
310
- onInsightRendered?: (data: AdInsightRenderedBody) => void;
311
- /**
312
- * Called when the insight definition changes and its execution starts.
313
- */
314
- onInsightChanged?: (data: AdInsightChangedBody) => void;
315
- /**
316
- * Called when a `clear` command finishes. `contextId` identifies the command.
381
+ * Called with every event Analytical Designer emits. Check `event.type` to narrow `event.data`.
317
382
  */
318
- onClearFinished?: (data: IAdAvailableCommands, contextId?: string) => void;
319
- /**
320
- * Called when a `clearInsight` command finishes. `contextId` identifies the command.
321
- */
322
- onClearInsightFinished?: (data: IAdAvailableCommands, contextId?: string) => void;
323
- /**
324
- * Called when an `undo` command finishes. `contextId` identifies the command.
325
- */
326
- onUndoFinished?: (data: IAdAvailableCommands, contextId?: string) => void;
327
- /**
328
- * Called when a `redo` command finishes. `contextId` identifies the command.
329
- */
330
- onRedoFinished?: (data: IAdAvailableCommands, contextId?: string) => void;
331
- /**
332
- * Called when an `exportInsight` command finishes, with the link to the exported file.
333
- * `contextId` identifies the command.
334
- */
335
- onExportFinished?: (data: AdExportFinishedBody, contextId?: string) => void;
336
- /**
337
- * Called when the user changes a filter of the insight.
338
- */
339
- onFilterContextChanged?: (data: AdFilterContextChangedBody) => void;
340
- /**
341
- * Called when a `setFilterContext` command finishes. `contextId` identifies the command.
342
- */
343
- onSetFilterContextFinished?: (data: IAdAvailableCommands, contextId?: string) => void;
344
- /**
345
- * Called when a `removeFilterContext` command finishes. `contextId` identifies the command.
346
- */
347
- onRemoveFilterContextFinished?: (data: IAdAvailableCommands, contextId?: string) => void;
348
- /**
349
- * Called when the user saves or deletes a metric. A host that shares a caching backend with
350
- * Analytical Designer resets its caches here.
351
- */
352
- onMetricsChanged?: () => void;
353
- /**
354
- * Called when the user creates, changes or deletes an attribute hierarchy.
355
- */
356
- onAttributeHierarchyModified?: () => void;
357
- /**
358
- * Called when a command the host sent fails. `contextId` identifies the command.
359
- */
360
- onCommandFailed?: (data: ICommandFailedBody, contextId?: string) => void;
383
+ onEvent?: (event: AnalyticalDesignerEvent) => void;
361
384
  /**
362
385
  * Called when Analytical Designer cannot start.
363
386
  */
364
387
  onError?: (error: unknown) => void;
365
- /**
366
- * Called with every event, before the typed callback.
367
- */
368
- onEvent?: (event: IAnalyticalDesignerEvent) => void;
369
- /**
370
- * Handlers called with the events they accept.
371
- */
372
- eventHandlers?: IAnalyticalDesignerEventHandler[];
373
388
  /**
374
389
  * Receives the commands the host sends to Analytical Designer.
375
390
  */
@@ -1 +1 @@
1
- {"version":3,"file":"analyticalDesignerTypes.d.ts","sourceRoot":"","sources":["../../src/embedding/analyticalDesignerTypes.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,KAAK,GAAG,EAAE,MAAM,OAAO,CAAC;AAEjC,OAAO,EACH,KAAK,kBAAkB,EACvB,KAAK,aAAa,EAClB,KAAK,sBAAsB,EAC9B,MAAM,2BAA2B,CAAC;AACnC,OAAO,EACH,KAAK,aAAa,EAClB,KAAK,oBAAoB,EACzB,KAAK,0BAA0B,EAC/B,KAAK,oBAAoB,EACzB,KAAK,qBAAqB,EAC1B,KAAK,kBAAkB,EACvB,KAAK,gBAAgB,EACrB,KAAK,oBAAoB,EACzB,KAAK,kBAAkB,EACvB,KAAK,qBAAqB,EAC1B,KAAK,WAAW,EACnB,MAAM,yBAAyB,CAAC;AACjC,OAAO,EACH,KAAK,aAAa,EAClB,KAAK,sBAAsB,EAC3B,KAAK,QAAQ,EACb,KAAK,kBAAkB,EACvB,KAAK,OAAO,EACZ,KAAK,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;IACH,OAAO,CAAC,EAAE,kBAAkB,CAAC;IAE7B;;;OAGG;IACH,SAAS,CAAC,EAAE,MAAM,CAAC;IAEnB;;;OAGG;IACH,UAAU,CAAC,EAAE,6BAA6B,CAAC;IAE3C;;OAEG;IACH,MAAM,CAAC,EAAE,yBAAyB,CAAC;IAEnC;;;OAGG;IACH,WAAW,CAAC,EAAE,qBAAqB,CAAC;IAEpC;;OAEG;IACH,KAAK,CAAC,EAAE,MAAM,CAAC;IAEf;;OAEG;IACH,mBAAmB,CAAC,EAAE,OAAO,CAAC;IAE9B;;OAEG;IACH,aAAa,CAAC,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,MAAM,CAAC;IAE1C;;OAEG;IACH,KAAK,CAAC,EAAE,wBAAwB,CAAC;IAEjC;;OAEG;IACH,OAAO,CAAC,EAAE,CAAC,KAAK,EAAE,uBAAuB,KAAK,IAAI,CAAC;IAEnD;;OAEG;IACH,OAAO,CAAC,EAAE,CAAC,KAAK,EAAE,OAAO,KAAK,IAAI,CAAC;IAEnC;;OAEG;IACH,MAAM,CAAC,EAAE,GAAG,CAAC,sBAAsB,CAAC,CAAC;CACxC"}
@@ -1,14 +1,7 @@
1
1
  import { type AdCommandData } from "@gooddata/sdk-embedding";
2
+ import { type AnalyticalDesignerEvent } from "./analyticalDesignerTypes.js";
2
3
  /** Envelope of an incoming AD command — the exact shape the postMessage transport delivers. */
3
4
  export type AdCommandEnvelope = AdCommandData;
4
- /** One outgoing AD event — exactly what messagingUtils.postEvent would have wrapped. */
5
- export interface IAdOutgoingEvent<TData = unknown> {
6
- product: string;
7
- name: string;
8
- /** the @gooddata/sdk-embedding contract payload for `name` — opaque to the bridge itself */
9
- data: TData;
10
- contextId?: string;
11
- }
12
5
  /**
13
6
  * Transport adapter installed by a host that renders AD in-process (as a React component) instead
14
7
  * of in an iframe. While installed, every outgoing AD event is delivered to onEvent INSTEAD of
@@ -17,7 +10,7 @@ export interface IAdOutgoingEvent<TData = unknown> {
17
10
  * host's own embedded postMessage API).
18
11
  */
19
12
  export interface IAdHostAdapter {
20
- onEvent(event: IAdOutgoingEvent): void;
13
+ onEvent(event: AnalyticalDesignerEvent): void;
21
14
  }
22
15
  /**
23
16
  * Sentinel origin marking commands injected in-process through the host adapter. Commands with
@@ -1 +1 @@
1
- {"version":3,"file":"hostBridge.d.ts","sourceRoot":"","sources":["../../src/embedding/hostBridge.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,KAAK,aAAa,EAAE,MAAM,yBAAyB,CAAC;AAE7D,+FAA+F;AAC/F,MAAM,MAAM,iBAAiB,GAAG,aAAa,CAAC;AAE9C,wFAAwF;AACxF,MAAM,WAAW,gBAAgB,CAAC,KAAK,GAAG,OAAO;IAC7C,OAAO,EAAE,MAAM,CAAC;IAChB,IAAI,EAAE,MAAM,CAAC;IACb,4FAA4F;IAC5F,IAAI,EAAE,KAAK,CAAC;IACZ,SAAS,CAAC,EAAE,MAAM,CAAC;CACtB;AAED;;;;;;GAMG;AACH,MAAM,WAAW,cAAc;IAC3B,OAAO,CAAC,KAAK,EAAE,gBAAgB,GAAG,IAAI,CAAC;CAC1C;AAED;;;;;GAKG;AACH,eAAO,MAAM,mBAAmB,iCAAiC,CAAC;AAIlE,wBAAgB,kBAAkB,CAAC,OAAO,EAAE,cAAc,GAAG,MAAM,IAAI,CAOtE;AAED,wBAAgB,cAAc,IAAI,cAAc,GAAG,IAAI,CAEtD"}
1
+ {"version":3,"file":"hostBridge.d.ts","sourceRoot":"","sources":["../../src/embedding/hostBridge.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,KAAK,aAAa,EAAE,MAAM,yBAAyB,CAAC;AAE7D,OAAO,EAAE,KAAK,uBAAuB,EAAE,MAAM,8BAA8B,CAAC;AAE5E,+FAA+F;AAC/F,MAAM,MAAM,iBAAiB,GAAG,aAAa,CAAC;AAE9C;;;;;;GAMG;AACH,MAAM,WAAW,cAAc;IAC3B,OAAO,CAAC,KAAK,EAAE,uBAAuB,GAAG,IAAI,CAAC;CACjD;AAED;;;;;GAKG;AACH,eAAO,MAAM,mBAAmB,iCAAiC,CAAC;AAIlE,wBAAgB,kBAAkB,CAAC,OAAO,EAAE,cAAc,GAAG,MAAM,IAAI,CAOtE;AAED,wBAAgB,cAAc,IAAI,cAAc,GAAG,IAAI,CAEtD"}
package/esm/index.d.ts CHANGED
@@ -4,6 +4,6 @@
4
4
  * @packageDocumentation
5
5
  */
6
6
  export { AnalyticalDesigner } from "./embedding/AnalyticalDesigner.js";
7
- export { type AnalyticalDesignerHiddenAction, type IAnalyticalDesignerApi, type IAnalyticalDesignerCacheReset, type IAnalyticalDesignerConfig, type IAnalyticalDesignerEvent, type IAnalyticalDesignerEventHandler, type IAnalyticalDesignerInsightOpenedData, type IAnalyticalDesignerProps, type IAnalyticalDesignerTelemetryCallbacks, } from "./embedding/analyticalDesignerTypes.js";
7
+ export { type AnalyticalDesignerEvent, type AnalyticalDesignerEventType, type AnalyticalDesignerHiddenAction, type IAnalyticalDesignerApi, type IAnalyticalDesignerCacheReset, type IAnalyticalDesignerConfig, type IAnalyticalDesignerEventDataMap, type IAnalyticalDesignerInsightOpenedData, type IAnalyticalDesignerProps, type IAnalyticalDesignerTelemetryCallbacks, } from "./embedding/analyticalDesignerTypes.js";
8
8
  export { type AnalyticalDesignerSlotComponent, type IAnalyticalDesignerErrorProps, type IAnalyticalDesignerLoadingProps, type IAnalyticalDesignerSlots, } from "./embedding/slots.js";
9
9
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAIA;;;;GAIG;AAEH,OAAO,EAAE,kBAAkB,EAAE,MAAM,mCAAmC,CAAC;AACvE,OAAO,EACH,KAAK,8BAA8B,EACnC,KAAK,sBAAsB,EAC3B,KAAK,6BAA6B,EAClC,KAAK,yBAAyB,EAC9B,KAAK,wBAAwB,EAC7B,KAAK,+BAA+B,EACpC,KAAK,oCAAoC,EACzC,KAAK,wBAAwB,EAC7B,KAAK,qCAAqC,GAC7C,MAAM,wCAAwC,CAAC;AAChD,OAAO,EACH,KAAK,+BAA+B,EACpC,KAAK,6BAA6B,EAClC,KAAK,+BAA+B,EACpC,KAAK,wBAAwB,GAChC,MAAM,sBAAsB,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAIA;;;;GAIG;AAEH,OAAO,EAAE,kBAAkB,EAAE,MAAM,mCAAmC,CAAC;AACvE,OAAO,EACH,KAAK,uBAAuB,EAC5B,KAAK,2BAA2B,EAChC,KAAK,8BAA8B,EACnC,KAAK,sBAAsB,EAC3B,KAAK,6BAA6B,EAClC,KAAK,yBAAyB,EAC9B,KAAK,+BAA+B,EACpC,KAAK,oCAAoC,EACzC,KAAK,wBAAwB,EAC7B,KAAK,qCAAqC,GAC7C,MAAM,wCAAwC,CAAC;AAChD,OAAO,EACH,KAAK,+BAA+B,EACpC,KAAK,6BAA6B,EAClC,KAAK,+BAA+B,EACpC,KAAK,wBAAwB,GAChC,MAAM,sBAAsB,CAAC"}
@@ -10,9 +10,9 @@ 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 metric date filter stores for the empty date values mode. Like the filter
14
- * bar's `""` attribute filter, only exclude and only are stored: include is the backend default for All
15
- * time and the picker does not offer it with a period.
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.
16
16
  */
17
17
  export declare function emptyValueHandlingToMd(emptyDateValuesFilter: EmptyDateValuesFilterMode | undefined): {
18
18
  emptyValueHandling?: EmptyValues;
@@ -25,7 +25,12 @@ export interface IBucketsToMetadataAdditionalData {
25
25
  activeCalendars?: IActiveCalendars;
26
26
  }
27
27
  export declare function bucketsToMetadata(decoratedBuckets: IDecoratedBuckets, additionalData?: IBucketsToMetadataAdditionalData): IVisualizationObjectBucket[];
28
- export declare function filtersToMetadata(filters: ReadonlyArray<IFilter>, attributeFilterConfigs?: IAttributeFilterConfigs, dateDatasets?: IDateDatasets): VisualizationObjectExtendedFilter[];
28
+ /**
29
+ * @param useEmptyValueHandling - whether the empty date values mode is written as the date filter's
30
+ * `emptyValueHandling` (the `enableImprovedMetricDateFilter` flag) or as the legacy `""` attribute filter,
31
+ * which needs `dateDatasets` to find the date attribute.
32
+ */
33
+ export declare function filtersToMetadata(filters: ReadonlyArray<IFilter>, attributeFilterConfigs?: IAttributeFilterConfigs, dateDatasets?: IDateDatasets, useEmptyValueHandling?: boolean): VisualizationObjectExtendedFilter[];
29
34
  /**
30
35
  * Converts parameter filters from AD state into insight parameter values.
31
36
  * Filters out values that equal the workspace default (smart persistence) so that
@@ -45,6 +50,14 @@ export declare function findItemInCache(uriOrId: string, cache: ICatalogEntries
45
50
  * identifier, so pass it wherever it is at hand.
46
51
  */
47
52
  ref?: ObjRef): ICatalogEntry | undefined;
53
+ /**
54
+ * Rewrites the stored filters so that every representation of the same empty date values mode compares
55
+ * equal: the legacy `""` attribute filter is folded into its date filter's `emptyValueHandling` (the way
56
+ * the reader does), All time with a mode becomes the ALL_TIME_GRANULARITY filter whether it is stored with
57
+ * bounds or without, and the `include` default is dropped as the writer drops it. Only for comparing
58
+ * stored content, the result is never saved.
59
+ */
60
+ export declare function normalizeEmptyDateValuesFilters(visualizationFilters: ReadonlyArray<VisualizationObjectExtendedFilter>, dateDatasets: IDateDatasets | undefined): VisualizationObjectExtendedFilter[];
48
61
  export declare function isMeasureShowOnSecondaryAxis(item: IVisualizationObjectMeasure, properties: IStoredVisualizationProperties | undefined): boolean;
49
62
  export declare function isATotalMeasure(item: IVisualizationObjectMeasure, properties: IStoredVisualizationProperties | undefined): boolean;
50
63
  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"],"names":[],"mappings":"AAKA,OAAO,EAEH,KAAK,WAAW,EAChB,KAAK,gBAAgB,EACrB,KAAK,uBAAuB,EAC5B,KAAK,sBAAsB,EAG3B,KAAK,MAAM,EAOd,MAAM,qBAAqB,CAAC;AAC7B,OAAO,EAEH,KAAK,sBAAsB,EAG9B,MAAM,kBAAkB,CAAC;AAM1B,OAAO,EACH,KAAK,yBAAyB,EAO9B,KAAK,OAAO,EAKf,MAAM,yCAAyC,CAAC;AACjD,OAAO,EAAE,KAAK,gBAAgB,EAAE,MAAM,+CAA+C,CAAC;AACtF,OAAO,EAKH,KAAK,OAAO,IAAI,0BAA0B,EAE1C,KAAK,2BAA2B,EAGhC,KAAK,2BAA2B,EAMhC,KAAK,iCAAiC,EAiBzC,MAAM,8BAA8B,CAAC;AAEtC,OAAO,EAGH,KAAK,iBAAiB,EAEtB,KAAK,WAAW,EACnB,MAAM,uBAAuB,CAAC;AAC/B,OAAO,EAAE,KAAK,aAAa,EAAE,KAAK,iBAAiB,EAAE,MAAM,wBAAwB,CAAC;AAOpF,OAAO,EAAE,KAAK,8BAA8B,EAAE,MAAM,0BAA0B,CAAC;AAC/E,OAAO,EAAE,KAAK,kBAAkB,EAAE,MAAM,sBAAsB,CAAC;AAC/D,OAAO,EAEH,KAAK,eAAe,EACpB,KAAK,aAAa,EACrB,MAAM,6BAA6B,CAAC;AA6BrC,wBAAgB,SAAS,CAAC,CAAC,SAAS,MAAM,EAAE,MAAM,EAAE,CAAC,GAAG,OAAO,CAAC,CAAC,CAAC,CAEjE;AAiCD;;;;GAIG;AACH,wBAAgB,sBAAsB,CAAC,qBAAqB,EAAE,yBAAyB,GAAG,SAAS,GAAG;IAClG,kBAAkB,CAAC,EAAE,WAAW,CAAC;CACpC,CAIA;AAglBD,iGAAiG;AACjG,MAAM,WAAW,gCAAgC;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C,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"}
@@ -46,9 +46,9 @@ function numberOrUndefined(value) {
46
46
  /** The granularity of a stored All time date filter, which the sdk-model types as a literal. */
47
47
  const ALL_TIME_GRANULARITY = "ALL_TIME_GRANULARITY";
48
48
  /**
49
- * The `emptyValueHandling` a metric date filter stores for the empty date values mode. Like the filter
50
- * bar's `""` attribute filter, only exclude and only are stored: include is the backend default for All
51
- * time and the picker does not offer it with a period.
49
+ * The `emptyValueHandling` a date filter stores for the empty date values mode. Like the legacy `""`
50
+ * attribute filter, only exclude and only are stored: include is the backend default for All time and
51
+ * the picker does not offer it with a period.
52
52
  */
53
53
  export function emptyValueHandlingToMd(emptyDateValuesFilter) {
54
54
  return emptyDateValuesFilter === "exclude" || emptyDateValuesFilter === "only"
@@ -165,14 +165,29 @@ function measureFilterToMd(filter) {
165
165
  },
166
166
  };
167
167
  }
168
- function dateFilterToMd({ filterConfig, dateDatasetRef, }) {
168
+ function dateFilterToMd({ filterConfig, dateDatasetRef, emptyDateValuesFilter }, useEmptyValueHandling) {
169
169
  const [from, to] = filterConfig?.interval || [undefined, undefined];
170
+ const emptyValueHandlingProp = useEmptyValueHandling ? emptyValueHandlingToMd(emptyDateValuesFilter) : {};
170
171
  if (filterConfig?.type === "absolute") {
171
172
  return {
172
173
  absoluteDateFilter: {
173
174
  dataSet: dateDatasetRef,
174
175
  from: from,
175
176
  to: to,
177
+ ...emptyValueHandlingProp,
178
+ },
179
+ };
180
+ }
181
+ // All time is stored without bounds, a no-op the execution drops. To carry the empty date values mode
182
+ // it has to be the real All time filter, the one the execution sends.
183
+ if ((from === undefined || to === undefined) && !isEmpty(emptyValueHandlingProp)) {
184
+ return {
185
+ relativeDateFilter: {
186
+ dataSet: dateDatasetRef,
187
+ granularity: ALL_TIME_GRANULARITY,
188
+ from: 0,
189
+ to: 0,
190
+ ...emptyValueHandlingProp,
176
191
  },
177
192
  };
178
193
  }
@@ -184,6 +199,7 @@ function dateFilterToMd({ filterConfig, dateDatasetRef, }) {
184
199
  from: numberOrUndefined(from),
185
200
  to: numberOrUndefined(to),
186
201
  ...(filterConfig?.boundedFilter ? { boundedFilter: filterConfig.boundedFilter } : {}),
202
+ ...emptyValueHandlingProp,
187
203
  }),
188
204
  };
189
205
  }
@@ -293,9 +309,9 @@ function rankingFilterToMd(filter) {
293
309
  },
294
310
  };
295
311
  }
296
- function filterToMd(filter, attributeFilterConfigs) {
312
+ function filterToMd(filter, attributeFilterConfigs, useEmptyValueHandling) {
297
313
  if (FilterBar.isDateFilter(filter)) {
298
- return dateFilterToMd(filter);
314
+ return dateFilterToMd(filter, useEmptyValueHandling);
299
315
  }
300
316
  else if (FilterBar.isAttributeFilter(filter)) {
301
317
  return attributeFilterToMd(filter, attributeFilterConfigs);
@@ -519,8 +535,10 @@ function findDateAttributeDfRef(dateDatasetRef, dateDatasets, granularity) {
519
535
  return dateAttribute?.dfRef;
520
536
  }
521
537
  /**
522
- * Creates an attribute filter for empty date values based on the emptyDateValuesFilter mode.
523
- * The filter uses the same granularity as the date filter to ensure consistency.
538
+ * LEGACY representation of the empty date values mode, written while `enableImprovedMetricDateFilter` is
539
+ * off: an attribute filter on the date attribute of the date filter's granularity with the single empty
540
+ * string element. With the flag on the mode is written as the date filter's `emptyValueHandling`
541
+ * instead; both representations are always read (see transformVisualizationFilters).
524
542
  * Returns undefined if no filter should be created (e.g., for "include" mode).
525
543
  */
526
544
  function createEmptyDateValuesAttributeFilter(dateFilter, dateDatasets) {
@@ -554,12 +572,16 @@ function createEmptyDateValuesAttributeFilter(dateFilter, dateDatasets) {
554
572
  }
555
573
  return undefined;
556
574
  }
557
- export function filtersToMetadata(filters, attributeFilterConfigs = {}, dateDatasets) {
575
+ /**
576
+ * @param useEmptyValueHandling - whether the empty date values mode is written as the date filter's
577
+ * `emptyValueHandling` (the `enableImprovedMetricDateFilter` flag) or as the legacy `""` attribute filter,
578
+ * which needs `dateDatasets` to find the date attribute.
579
+ */
580
+ export function filtersToMetadata(filters, attributeFilterConfigs = {}, dateDatasets, useEmptyValueHandling = false) {
558
581
  const result = [];
559
582
  filters.forEach((filter) => {
560
- result.push(filterToMd(filter, attributeFilterConfigs));
561
- // Add empty date values attribute filter if applicable
562
- if (FilterBar.isDateFilter(filter)) {
583
+ result.push(filterToMd(filter, attributeFilterConfigs, useEmptyValueHandling));
584
+ if (!useEmptyValueHandling && FilterBar.isDateFilter(filter)) {
563
585
  const emptyValuesFilter = createEmptyDateValuesAttributeFilter(filter, dateDatasets);
564
586
  if (emptyValuesFilter) {
565
587
  result.push(emptyValuesFilter);
@@ -807,7 +829,8 @@ function transformVisualizationFilter(filter, data, overTimeComparisonType) {
807
829
  function transformToDateFilterConfig(visualizationFilter) {
808
830
  if (isVisualizationObjectRelativeDateFilter(visualizationFilter)) {
809
831
  const { granularity, from, to, boundedFilter } = visualizationFilter.relativeDateFilter;
810
- if (from === undefined || to === undefined) {
832
+ // All time: stored without bounds, or as the real All time filter when it carries a mode
833
+ if (granularity === ALL_TIME_GRANULARITY || from === undefined || to === undefined) {
811
834
  return undefined;
812
835
  }
813
836
  const selectedPresetItem = PRESETS.find((presetItem) => presetItem.granularity === granularity &&
@@ -831,9 +854,7 @@ function transformToDateFilterConfig(visualizationFilter) {
831
854
  throw new Error("Unsupported visualization date filter type");
832
855
  }
833
856
  function transformVisualizationDateFilter(visualizationFilter, overTimeComparisonType, ignoreOverTimeComparisonType) {
834
- let datasetRef = isVisualizationObjectRelativeDateFilter(visualizationFilter)
835
- ? visualizationFilter.relativeDateFilter.dataSet
836
- : visualizationFilter.absoluteDateFilter.dataSet;
857
+ let datasetRef = getDateFilterDataSet(visualizationFilter);
837
858
  /**
838
859
  * convertor from SDK returns ref without type
839
860
  */
@@ -841,6 +862,7 @@ function transformVisualizationDateFilter(visualizationFilter, overTimeCompariso
841
862
  ...datasetRef,
842
863
  type: "dataSet",
843
864
  };
865
+ const emptyDateValuesFilter = getDateFilterEmptyValueHandling(visualizationFilter);
844
866
  return {
845
867
  type: "date",
846
868
  localIdentifier: generateBucketItemIdentifier(),
@@ -850,8 +872,15 @@ function transformVisualizationDateFilter(visualizationFilter, overTimeCompariso
850
872
  : { overTimeComparisonType }),
851
873
  filterConfig: transformToDateFilterConfig(visualizationFilter),
852
874
  dateDatasetRef: datasetRef,
875
+ ...(emptyDateValuesFilter ? { emptyDateValuesFilter } : {}),
853
876
  };
854
877
  }
878
+ /** The date dataset a stored date filter filters on. */
879
+ function getDateFilterDataSet(visualizationFilter) {
880
+ return isVisualizationObjectRelativeDateFilter(visualizationFilter)
881
+ ? visualizationFilter.relativeDateFilter.dataSet
882
+ : visualizationFilter.absoluteDateFilter.dataSet;
883
+ }
855
884
  /** The empty date values mode a stored date filter carries as `emptyValueHandling`, if any. */
856
885
  function getDateFilterEmptyValueHandling(visualizationFilter) {
857
886
  return isVisualizationObjectRelativeDateFilter(visualizationFilter)
@@ -1049,23 +1078,71 @@ function detectEmptyDateValuesAttributeFilter(attributeFilter, dateDatasets) {
1049
1078
  }
1050
1079
  return undefined;
1051
1080
  }
1052
- function transformVisualizationFilters(metadataObject, overTimeComparisonType, additionalData) {
1053
- const visualizationFilters = metadataObject.filters || [];
1054
- const dateDatasets = additionalData?.dateDatasets || undefined;
1055
- // First pass: identify empty date values attribute filters
1081
+ /**
1082
+ * Finds the LEGACY empty date values attribute filters (the single-"" element filters on a date
1083
+ * attribute), kept readable so insights saved before the mode moved to `emptyValueHandling` open.
1084
+ */
1085
+ function collectLegacyEmptyDateValuesFilters(visualizationFilters, dateDatasets) {
1086
+ // keyed by the date dataset ref string
1056
1087
  const emptyDateValuesFilters = {};
1057
1088
  const emptyDateValuesFilterIndices = new globalThis.Set();
1058
1089
  visualizationFilters.forEach((filter, index) => {
1059
1090
  if (isVisualizationObjectAttributeFilter(filter)) {
1060
1091
  const detected = detectEmptyDateValuesAttributeFilter(filter, dateDatasets);
1061
1092
  if (detected) {
1062
- // Key by date dataset ref string for lookup
1063
- const key = objRefToString(detected.dateDatasetRef);
1064
- emptyDateValuesFilters[key] = detected;
1093
+ emptyDateValuesFilters[objRefToString(detected.dateDatasetRef)] = detected;
1065
1094
  emptyDateValuesFilterIndices.add(index);
1066
1095
  }
1067
1096
  }
1068
1097
  });
1098
+ return { emptyDateValuesFilters, emptyDateValuesFilterIndices };
1099
+ }
1100
+ /**
1101
+ * Rewrites the stored filters so that every representation of the same empty date values mode compares
1102
+ * equal: the legacy `""` attribute filter is folded into its date filter's `emptyValueHandling` (the way
1103
+ * the reader does), All time with a mode becomes the ALL_TIME_GRANULARITY filter whether it is stored with
1104
+ * bounds or without, and the `include` default is dropped as the writer drops it. Only for comparing
1105
+ * stored content, the result is never saved.
1106
+ */
1107
+ export function normalizeEmptyDateValuesFilters(visualizationFilters, dateDatasets) {
1108
+ const { emptyDateValuesFilters, emptyDateValuesFilterIndices } = collectLegacyEmptyDateValuesFilters(visualizationFilters, dateDatasets);
1109
+ return visualizationFilters
1110
+ .filter((_filter, index) => !emptyDateValuesFilterIndices.has(index))
1111
+ .map((filter) => {
1112
+ if (!isVisualizationObjectDateFilter(filter)) {
1113
+ return filter;
1114
+ }
1115
+ const dataSet = getDateFilterDataSet(filter);
1116
+ const storedMode = getDateFilterEmptyValueHandling(filter);
1117
+ const mode = emptyValueHandlingToMd(storedMode ?? emptyDateValuesFilters[objRefToString(dataSet)]?.mode);
1118
+ if (isVisualizationObjectAbsoluteDateFilter(filter)) {
1119
+ return {
1120
+ absoluteDateFilter: { ...omit(filter.absoluteDateFilter, "emptyValueHandling"), ...mode },
1121
+ };
1122
+ }
1123
+ const { granularity, from, to } = filter.relativeDateFilter;
1124
+ const isAllTime = granularity === ALL_TIME_GRANULARITY || from === undefined || to === undefined;
1125
+ if (isAllTime && !isEmpty(mode)) {
1126
+ return {
1127
+ relativeDateFilter: {
1128
+ dataSet,
1129
+ granularity: ALL_TIME_GRANULARITY,
1130
+ from: 0,
1131
+ to: 0,
1132
+ ...mode,
1133
+ },
1134
+ };
1135
+ }
1136
+ return {
1137
+ relativeDateFilter: { ...omit(filter.relativeDateFilter, "emptyValueHandling"), ...mode },
1138
+ };
1139
+ });
1140
+ }
1141
+ function transformVisualizationFilters(metadataObject, overTimeComparisonType, additionalData) {
1142
+ const visualizationFilters = metadataObject.filters || [];
1143
+ const dateDatasets = additionalData?.dateDatasets || undefined;
1144
+ // First pass: identify the legacy empty date values attribute filters
1145
+ const { emptyDateValuesFilters, emptyDateValuesFilterIndices } = collectLegacyEmptyDateValuesFilters(visualizationFilters, dateDatasets);
1069
1146
  // Second pass: transform filters, setting emptyDateValuesFilter on date filters
1070
1147
  let firstDateFilterTransformed = false;
1071
1148
  const result = [];
@@ -1081,11 +1158,12 @@ function transformVisualizationFilters(metadataObject, overTimeComparisonType, a
1081
1158
  }
1082
1159
  else if (isVisualizationObjectDateFilter(visualizationFilter)) {
1083
1160
  let df = transformVisualizationDateFilter(visualizationFilter, overTimeComparisonType, firstDateFilterTransformed);
1084
- // Check if there's a matching empty date values filter
1161
+ // the legacy "" attribute filter sets the mode unless the date filter carries it itself; either
1162
+ // way the attribute filter is dropped, so re-saving migrates the insight to the field
1085
1163
  const dateDatasetRef = df.dateDatasetRef;
1086
1164
  const key = objRefToString(dateDatasetRef);
1087
1165
  const emptyValuesInfo = emptyDateValuesFilters[key];
1088
- if (emptyValuesInfo) {
1166
+ if (emptyValuesInfo && !df.emptyDateValuesFilter) {
1089
1167
  df = { ...df, emptyDateValuesFilter: emptyValuesInfo.mode };
1090
1168
  }
1091
1169
  firstDateFilterTransformed = true;