@gooddata/sdk-ui 11.54.0-alpha.0 → 11.54.0-alpha.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"withEntireDataView.d.ts","sourceRoot":"","sources":["../../../../src/base/react/legacy/withEntireDataView.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAuB,KAAK,aAAa,EAA4C,MAAM,OAAO,CAAC;AAG1G,OAAO,EAAE,KAAK,SAAS,EAAc,MAAM,YAAY,CAAC;AAExD,OAAO,EAEH,KAAK,SAAS,EAOjB,MAAM,2BAA2B,CAAC;AAInC,OAAO,EAIH,KAAK,gBAAgB,EAIxB,MAAM,kCAAkC,CAAC;AAG1C,OAAO,EAAE,KAAK,eAAe,EAAsB,MAAM,qBAAqB,CAAC;AAE/E,OAAO,EAAE,KAAK,uBAAuB,EAAE,MAAM,iCAAiC,CAAC;AAkC/E;;;;;GAKG;AACH,MAAM,WAAW,qBAAqB;IAClC;;;OAGG;IACH,SAAS,EAAE,OAAO,CAAC;IAEnB;;OAEG;IACH,QAAQ,CAAC,EAAE,SAAS,CAAC;IAErB;;OAEG;IACH,KAAK,CAAC,EAAE,MAAM,CAAC;IACf;;OAEG;IACH,MAAM,CAAC,EAAE,gBAAgB,CAAC,QAAQ,CAAC,CAAC;IAGpC,IAAI,EAAE,SAAS,CAAC;IAEhB;;OAEG;IACH,aAAa,CAAC,cAAc,EAAE,eAAe,GAAG,IAAI,CAAC;IAErD;;OAEG;IACH,cAAc,CAAC,IAAI,EAAE,GAAG,EAAE,YAAY,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAEvD;;OAEG;IACH,gBAAgB,IAAI,IAAI,CAAC;CAC5B;AAED;;;;;;;;;GASG;AACH,wBAAgB,kBAAkB,CAAC,CAAC,SAAS,uBAAuB,EAChE,cAAc,EAAE,aAAa,CAAC,CAAC,GAAG,qBAAqB,CAAC,GACzD,aAAa,CAAC,CAAC,CAAC,
|
|
1
|
+
{"version":3,"file":"withEntireDataView.d.ts","sourceRoot":"","sources":["../../../../src/base/react/legacy/withEntireDataView.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAuB,KAAK,aAAa,EAA4C,MAAM,OAAO,CAAC;AAG1G,OAAO,EAAE,KAAK,SAAS,EAAc,MAAM,YAAY,CAAC;AAExD,OAAO,EAEH,KAAK,SAAS,EAOjB,MAAM,2BAA2B,CAAC;AAInC,OAAO,EAIH,KAAK,gBAAgB,EAIxB,MAAM,kCAAkC,CAAC;AAG1C,OAAO,EAAE,KAAK,eAAe,EAAsB,MAAM,qBAAqB,CAAC;AAE/E,OAAO,EAAE,KAAK,uBAAuB,EAAE,MAAM,iCAAiC,CAAC;AAkC/E;;;;;GAKG;AACH,MAAM,WAAW,qBAAqB;IAClC;;;OAGG;IACH,SAAS,EAAE,OAAO,CAAC;IAEnB;;OAEG;IACH,QAAQ,CAAC,EAAE,SAAS,CAAC;IAErB;;OAEG;IACH,KAAK,CAAC,EAAE,MAAM,CAAC;IACf;;OAEG;IACH,MAAM,CAAC,EAAE,gBAAgB,CAAC,QAAQ,CAAC,CAAC;IAGpC,IAAI,EAAE,SAAS,CAAC;IAEhB;;OAEG;IACH,aAAa,CAAC,cAAc,EAAE,eAAe,GAAG,IAAI,CAAC;IAErD;;OAEG;IACH,cAAc,CAAC,IAAI,EAAE,GAAG,EAAE,YAAY,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAEvD;;OAEG;IACH,gBAAgB,IAAI,IAAI,CAAC;CAC5B;AAED;;;;;;;;;GASG;AACH,wBAAgB,kBAAkB,CAAC,CAAC,SAAS,uBAAuB,EAChE,cAAc,EAAE,aAAa,CAAC,CAAC,GAAG,qBAAqB,CAAC,GACzD,aAAa,CAAC,CAAC,CAAC,CAoclB"}
|
|
@@ -57,9 +57,18 @@ export function withEntireDataView(InnerComponent) {
|
|
|
57
57
|
const hasUnmounted = useRef(false);
|
|
58
58
|
const abortController = useRef(new AbortController());
|
|
59
59
|
/**
|
|
60
|
-
*
|
|
60
|
+
* Identity of the last initialize request.
|
|
61
|
+
*
|
|
62
|
+
* This has to identify the REQUEST, not the execution definition it was made with. The same
|
|
63
|
+
* definition can legitimately be requested again after a different one - Analytical Designer
|
|
64
|
+
* does exactly that when a saved insight with a persisted sort is opened: it executes the
|
|
65
|
+
* insight WITH the sort, then once WITHOUT it (the pluggable visualization's initial-properties
|
|
66
|
+
* push briefly clears the extended reference point) and then WITH it again. Keyed by
|
|
67
|
+
* definition fingerprint, the first request stops looking superseded the moment the third one
|
|
68
|
+
* re-registers the same fingerprint, so the cancellation error of that already-aborted request
|
|
69
|
+
* is reported as a genuine execution failure.
|
|
61
70
|
*/
|
|
62
|
-
const
|
|
71
|
+
const lastInitRequestId = useRef(0);
|
|
63
72
|
const updateState = useCallback((newState) => {
|
|
64
73
|
setState((s) => ({ ...s, ...newState }));
|
|
65
74
|
}, []);
|
|
@@ -110,8 +119,8 @@ export function withEntireDataView(InnerComponent) {
|
|
|
110
119
|
const onNegativeValues = useCallback(() => {
|
|
111
120
|
onError(new NegativeValuesSdkError());
|
|
112
121
|
}, [onError]);
|
|
113
|
-
const isRequestStale = useCallback((
|
|
114
|
-
return
|
|
122
|
+
const isRequestStale = useCallback((requestId) => {
|
|
123
|
+
return lastInitRequestId.current !== requestId || hasUnmounted.current;
|
|
115
124
|
}, []);
|
|
116
125
|
const loadClusteringData = useCallback(async (dataView, executionResult, clusteringConfig) => {
|
|
117
126
|
let result = dataView.withClustering(clusteringConfig);
|
|
@@ -193,8 +202,8 @@ export function withEntireDataView(InnerComponent) {
|
|
|
193
202
|
pushData({ dataView, availableDrillTargets });
|
|
194
203
|
}
|
|
195
204
|
}, [onDataView, onLoadingChanged, updateState]);
|
|
196
|
-
const handleLoadingError = useCallback((error,
|
|
197
|
-
if (isRequestStale(
|
|
205
|
+
const handleLoadingError = useCallback((error, requestId) => {
|
|
206
|
+
if (isRequestStale(requestId)) {
|
|
198
207
|
return;
|
|
199
208
|
}
|
|
200
209
|
const { pushData } = latestPropsRef.current;
|
|
@@ -217,10 +226,11 @@ export function withEntireDataView(InnerComponent) {
|
|
|
217
226
|
onLoadingChanged({ isLoading: true });
|
|
218
227
|
updateState({ dataView: null });
|
|
219
228
|
const fingerprint = defFingerprint(execution.definition);
|
|
220
|
-
|
|
229
|
+
const requestId = lastInitRequestId.current + 1;
|
|
230
|
+
lastInitRequestId.current = requestId;
|
|
221
231
|
try {
|
|
222
232
|
const executionResult = await execution.execute();
|
|
223
|
-
if (isRequestStale(
|
|
233
|
+
if (isRequestStale(requestId)) {
|
|
224
234
|
return;
|
|
225
235
|
}
|
|
226
236
|
const originalDataView = await executionResult.readAll().catch((err) => {
|
|
@@ -235,10 +245,12 @@ export function withEntireDataView(InnerComponent) {
|
|
|
235
245
|
}
|
|
236
246
|
throw err;
|
|
237
247
|
});
|
|
238
|
-
if (isRequestStale(
|
|
248
|
+
if (isRequestStale(requestId) ||
|
|
249
|
+
defFingerprint(originalDataView.definition) !== fingerprint) {
|
|
239
250
|
/*
|
|
240
251
|
* Stop right now if the data are not relevant anymore because there was another
|
|
241
|
-
* initialize request in the meantime
|
|
252
|
+
* initialize request in the meantime, or because they do not belong to the
|
|
253
|
+
* definition this request asked for.
|
|
242
254
|
*/
|
|
243
255
|
return;
|
|
244
256
|
}
|
|
@@ -270,7 +282,7 @@ export function withEntireDataView(InnerComponent) {
|
|
|
270
282
|
}
|
|
271
283
|
}
|
|
272
284
|
catch (error) {
|
|
273
|
-
handleLoadingError(error,
|
|
285
|
+
handleLoadingError(error, requestId);
|
|
274
286
|
}
|
|
275
287
|
}, [
|
|
276
288
|
handleLoadingError,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@gooddata/sdk-ui",
|
|
3
|
-
"version": "11.54.0-alpha.
|
|
3
|
+
"version": "11.54.0-alpha.1",
|
|
4
4
|
"description": "GoodData.UI SDK - Core",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"author": "GoodData Corporation",
|
|
@@ -42,9 +42,9 @@
|
|
|
42
42
|
"ts-invariant": "0.10.3",
|
|
43
43
|
"tslib": "2.8.1",
|
|
44
44
|
"uuid": "11.1.1",
|
|
45
|
-
"@gooddata/sdk-backend-spi": "11.54.0-alpha.
|
|
46
|
-
"@gooddata/sdk-model": "11.54.0-alpha.
|
|
47
|
-
"@gooddata/util": "11.54.0-alpha.
|
|
45
|
+
"@gooddata/sdk-backend-spi": "11.54.0-alpha.1",
|
|
46
|
+
"@gooddata/sdk-model": "11.54.0-alpha.1",
|
|
47
|
+
"@gooddata/util": "11.54.0-alpha.1"
|
|
48
48
|
},
|
|
49
49
|
"devDependencies": {
|
|
50
50
|
"@microsoft/api-documenter": "^7.17.0",
|
|
@@ -87,13 +87,13 @@
|
|
|
87
87
|
"typescript": "5.9.3",
|
|
88
88
|
"vitest": "4.1.8",
|
|
89
89
|
"vitest-dom": "0.1.1",
|
|
90
|
-
"@gooddata/eslint-config": "11.54.0-alpha.
|
|
91
|
-
"@gooddata/i18n-toolkit": "11.54.0-alpha.
|
|
92
|
-
"@gooddata/oxlint-config": "11.54.0-alpha.
|
|
93
|
-
"@gooddata/
|
|
94
|
-
"@gooddata/
|
|
95
|
-
"@gooddata/stylelint-config": "11.54.0-alpha.
|
|
96
|
-
"@gooddata/sdk-backend-mockingbird": "11.54.0-alpha.
|
|
90
|
+
"@gooddata/eslint-config": "11.54.0-alpha.1",
|
|
91
|
+
"@gooddata/i18n-toolkit": "11.54.0-alpha.1",
|
|
92
|
+
"@gooddata/oxlint-config": "11.54.0-alpha.1",
|
|
93
|
+
"@gooddata/sdk-backend-base": "11.54.0-alpha.1",
|
|
94
|
+
"@gooddata/reference-workspace": "11.54.0-alpha.1",
|
|
95
|
+
"@gooddata/stylelint-config": "11.54.0-alpha.1",
|
|
96
|
+
"@gooddata/sdk-backend-mockingbird": "11.54.0-alpha.1"
|
|
97
97
|
},
|
|
98
98
|
"peerDependencies": {
|
|
99
99
|
"react": "^18.0.0 || ^19.0.0",
|