@gooddata/sdk-ui-ext 11.58.0-alpha.0 → 11.58.0-alpha.2

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.
@@ -5,6 +5,9 @@ import { type IHeaderPredicate } from "@gooddata/sdk-ui";
5
5
  * uris, identifiers and composedFrom uris and identifiers, this function will create instances of
6
6
  * uriMatch(), identifierMatch(), composedFromUri(), composedFromIdentifier() predicates.
7
7
  *
8
+ * An identifier may come as a bare string, matching any object of that identifier, or as a qualifier
9
+ * naming the object type as well, which the matched object then has to carry too.
10
+ *
8
11
  * @param postMessageData - input received via post message
9
12
  * @internal
10
13
  */
@@ -1 +1 @@
1
- {"version":3,"file":"drillablePredicates.d.ts","sourceRoot":"","sources":["../../../src/internal/utils/drillablePredicates.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,KAAK,0BAA0B,EAAE,MAAM,yBAAyB,CAAC;AAC1E,OAAO,EAAoB,KAAK,gBAAgB,EAAE,MAAM,kBAAkB,CAAC;AAE3E;;;;;;;GAOG;AACH,wBAAgB,uCAAuC,CAAC,EACpD,IAAI,EACJ,WAAW,EACX,YAAY,GACf,EAAE,0BAA0B,GAAG,gBAAgB,EAAE,CAqBjD;AAED,eAAO,MAAM,wBAAwB;;CAEpC,CAAC"}
1
+ {"version":3,"file":"drillablePredicates.d.ts","sourceRoot":"","sources":["../../../src/internal/utils/drillablePredicates.ts"],"names":[],"mappings":"AAIA,OAAO,EACH,KAAK,0BAA0B,EAGlC,MAAM,yBAAyB,CAAC;AACjC,OAAO,EAAoB,KAAK,gBAAgB,EAAE,MAAM,kBAAkB,CAAC;AAgB3E;;;;;;;;;;GAUG;AACH,wBAAgB,uCAAuC,CAAC,EACpD,IAAI,EACJ,WAAW,EACX,YAAY,GACf,EAAE,0BAA0B,GAAG,gBAAgB,EAAE,CAsBjD;AAED,eAAO,MAAM,wBAAwB;;CAEpC,CAAC"}
@@ -1,28 +1,37 @@
1
1
  // (C) 2019-2026 GoodData Corporation
2
- import { uniq } from "lodash-es";
2
+ import { uniq, uniqBy } from "lodash-es";
3
3
  import { HeaderPredicates } from "@gooddata/sdk-ui";
4
+ const toQualifier = (identifier) => typeof identifier === "string" ? { identifier } : identifier;
5
+ /**
6
+ * An untyped entry stays distinct from the same identifier typed, and two types of one identifier stay
7
+ * distinct from each other, because each activates drilling on a different object.
8
+ */
9
+ const uniqueQualifiers = (identifiers) => Array.isArray(identifiers)
10
+ ? uniqBy(identifiers.map(toQualifier), ({ identifier, type }) => `${type ?? ""}.${identifier}`)
11
+ : [];
4
12
  /**
5
13
  * Converts post message with drilling specification into header predicates. Given the message with
6
14
  * uris, identifiers and composedFrom uris and identifiers, this function will create instances of
7
15
  * uriMatch(), identifierMatch(), composedFromUri(), composedFromIdentifier() predicates.
8
16
  *
17
+ * An identifier may come as a bare string, matching any object of that identifier, or as a qualifier
18
+ * naming the object type as well, which the matched object then has to carry too.
19
+ *
9
20
  * @param postMessageData - input received via post message
10
21
  * @internal
11
22
  */
12
23
  export function convertPostMessageToDrillablePredicates({ uris, identifiers, composedFrom, }) {
13
24
  const simpleUris = Array.isArray(uris) ? uniq(uris) : [];
14
- const simpleIdentifiers = Array.isArray(identifiers) ? uniq(identifiers) : [];
25
+ const simpleIdentifiers = uniqueQualifiers(identifiers);
15
26
  const composedFromUris = composedFrom?.uris && Array.isArray(composedFrom.uris) ? uniq(composedFrom.uris) : [];
16
- const composedFromIdentifiers = composedFrom?.identifiers && Array.isArray(composedFrom.identifiers)
17
- ? uniq(composedFrom.identifiers)
18
- : [];
27
+ const composedFromIdentifiers = uniqueQualifiers(composedFrom?.identifiers);
19
28
  // note: not passing factory function to maps to make testing assertions simpler (passing factory fun-as-is
20
29
  // will call the factory with 3 args (value, index and all values)
21
30
  return [
22
31
  ...simpleUris.map((uri) => HeaderPredicates.uriMatch(uri)),
23
- ...simpleIdentifiers.map((identifier) => HeaderPredicates.identifierMatch(identifier)),
32
+ ...simpleIdentifiers.map(({ identifier, type }) => HeaderPredicates.identifierMatch(identifier, type)),
24
33
  ...composedFromUris.map((uri) => HeaderPredicates.composedFromUri(uri)),
25
- ...composedFromIdentifiers.map((identifier) => HeaderPredicates.composedFromIdentifier(identifier)),
34
+ ...composedFromIdentifiers.map(({ identifier, type }) => HeaderPredicates.composedFromIdentifier(identifier, type)),
26
35
  ];
27
36
  }
28
37
  export const DrillablePredicatesUtils = {
@@ -1 +1 @@
1
- {"version":3,"file":"dateFilterNaming.d.ts","sourceRoot":"","sources":["../../../src/notificationsPanel/data/dateFilterNaming.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,KAAK,SAAS,EAAE,MAAM,YAAY,CAAC;AAE5C,OAAO,EAGH,KAAK,WAAW,EAKnB,MAAM,qBAAqB,CAAC;AAa7B,wBAAgB,mBAAmB,CAAC,IAAI,EAAE,SAAS,EAAE,MAAM,EAAE,WAAW,EAAE,UAAU,EAAE,MAAM,GAAG,MAAM,CA4CpG"}
1
+ {"version":3,"file":"dateFilterNaming.d.ts","sourceRoot":"","sources":["../../../src/notificationsPanel/data/dateFilterNaming.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,KAAK,SAAS,EAAE,MAAM,YAAY,CAAC;AAE5C,OAAO,EAGH,KAAK,WAAW,EAKnB,MAAM,qBAAqB,CAAC;AAa7B,wBAAgB,mBAAmB,CAAC,IAAI,EAAE,SAAS,EAAE,MAAM,EAAE,WAAW,EAAE,UAAU,EAAE,MAAM,GAAG,MAAM,CAoDpG"}
@@ -7,6 +7,14 @@ export function translateDateFilter(intl, filter, dateFormat) {
7
7
  // - Special case for "All time" with excluded empty values.
8
8
  // - For included empty values, decorate the base representation.
9
9
  // - For "only" empty values, use the dedicated title.
10
+ //
11
+ // Week granularity is the one deliberate divergence: `getDateFilterTitleUsingTranslator` renders an
12
+ // absolute week filter as "Week 15/2026 - Week 17/2026", which needs both the filter's granularity and
13
+ // the workspace week start. The AFM shape carries no granularity at all today, and the week start is a
14
+ // workspace setting this function cannot reach either, so an absolute week filter is spelled out here
15
+ // as the plain day range it resolves to. MC-5254 gives the absolute AFM filter an optional granularity;
16
+ // even then the missing week start keeps this branch on the day range, which is exactly what
17
+ // `getDateFilterTitleUsingTranslator` itself falls back to when no week start reaches it.
10
18
  if (metadata.type === "relative" &&
11
19
  metadata.granularity === "ALL_TIME_GRANULARITY" &&
12
20
  metadata.emptyValueHandling === "exclude") {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@gooddata/sdk-ui-ext",
3
- "version": "11.58.0-alpha.0",
3
+ "version": "11.58.0-alpha.2",
4
4
  "description": "GoodData.UI SDK - Extensions",
5
5
  "license": "LicenseRef-LICENSE",
6
6
  "author": "GoodData Corporation",
@@ -63,20 +63,20 @@
63
63
  "ts-invariant": "0.10.3",
64
64
  "tslib": "2.8.1",
65
65
  "uuid": "11.1.1",
66
- "@gooddata/sdk-backend-base": "11.58.0-alpha.0",
67
- "@gooddata/sdk-backend-spi": "11.58.0-alpha.0",
68
- "@gooddata/sdk-embedding": "11.58.0-alpha.0",
69
- "@gooddata/sdk-model": "11.58.0-alpha.0",
70
- "@gooddata/sdk-ui": "11.58.0-alpha.0",
71
- "@gooddata/sdk-ui-charts": "11.58.0-alpha.0",
72
- "@gooddata/sdk-ui-filters": "11.58.0-alpha.0",
73
- "@gooddata/sdk-ui-geo": "11.58.0-alpha.0",
74
- "@gooddata/sdk-ui-kit": "11.58.0-alpha.0",
75
- "@gooddata/sdk-ui-pivot": "11.58.0-alpha.0",
76
- "@gooddata/sdk-ui-semantic-search": "11.58.0-alpha.0",
77
- "@gooddata/sdk-ui-theme-provider": "11.58.0-alpha.0",
78
- "@gooddata/sdk-ui-vis-commons": "11.58.0-alpha.0",
79
- "@gooddata/util": "11.58.0-alpha.0"
66
+ "@gooddata/sdk-backend-base": "11.58.0-alpha.2",
67
+ "@gooddata/sdk-backend-spi": "11.58.0-alpha.2",
68
+ "@gooddata/sdk-embedding": "11.58.0-alpha.2",
69
+ "@gooddata/sdk-ui": "11.58.0-alpha.2",
70
+ "@gooddata/sdk-model": "11.58.0-alpha.2",
71
+ "@gooddata/sdk-ui-filters": "11.58.0-alpha.2",
72
+ "@gooddata/sdk-ui-charts": "11.58.0-alpha.2",
73
+ "@gooddata/sdk-ui-kit": "11.58.0-alpha.2",
74
+ "@gooddata/sdk-ui-pivot": "11.58.0-alpha.2",
75
+ "@gooddata/sdk-ui-geo": "11.58.0-alpha.2",
76
+ "@gooddata/sdk-ui-semantic-search": "11.58.0-alpha.2",
77
+ "@gooddata/sdk-ui-theme-provider": "11.58.0-alpha.2",
78
+ "@gooddata/sdk-ui-vis-commons": "11.58.0-alpha.2",
79
+ "@gooddata/util": "11.58.0-alpha.2"
80
80
  },
81
81
  "devDependencies": {
82
82
  "@microsoft/api-documenter": "7.30.10",
@@ -116,16 +116,16 @@
116
116
  "react-dom": "19.1.1",
117
117
  "sass": "1.104.1",
118
118
  "stylelint": "16.26.1",
119
- "svgo": "2.8.3",
119
+ "svgo": "2.8.4",
120
120
  "typescript": "7.0.2",
121
- "vitest": "4.1.8",
121
+ "vitest": "4.1.11",
122
122
  "vitest-dom": "0.1.1",
123
- "@gooddata/eslint-config": "11.58.0-alpha.0",
124
- "@gooddata/i18n-toolkit": "11.58.0-alpha.0",
125
- "@gooddata/oxlint-config": "11.58.0-alpha.0",
126
- "@gooddata/reference-workspace": "11.58.0-alpha.0",
127
- "@gooddata/sdk-backend-mockingbird": "11.58.0-alpha.0",
128
- "@gooddata/stylelint-config": "11.58.0-alpha.0"
123
+ "@gooddata/i18n-toolkit": "11.58.0-alpha.2",
124
+ "@gooddata/eslint-config": "11.58.0-alpha.2",
125
+ "@gooddata/oxlint-config": "11.58.0-alpha.2",
126
+ "@gooddata/sdk-backend-mockingbird": "11.58.0-alpha.2",
127
+ "@gooddata/reference-workspace": "11.58.0-alpha.2",
128
+ "@gooddata/stylelint-config": "11.58.0-alpha.2"
129
129
  },
130
130
  "peerDependencies": {
131
131
  "react": "^18.0.0 || ^19.0.0",