@gooddata/sdk-backend-tiger 11.40.0-alpha.0 → 11.40.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.
package/esm/__version.d.ts
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
export declare const LIB_VERSION = "11.40.0-alpha.
|
|
1
|
+
export declare const LIB_VERSION = "11.40.0-alpha.1";
|
|
2
2
|
export declare const LIB_DESCRIPTION = "GoodData Backend SPI implementation for GoodData Cloud and GoodData.CN";
|
|
3
3
|
export declare const LIB_NAME = "@gooddata/sdk-backend-tiger";
|
package/esm/__version.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
// (C) 2021 GoodData Corporation
|
|
2
2
|
// DO NOT CHANGE THIS FILE, IT IS RE-GENERATED ON EVERY BUILD
|
|
3
|
-
export const LIB_VERSION = "11.40.0-alpha.
|
|
3
|
+
export const LIB_VERSION = "11.40.0-alpha.1";
|
|
4
4
|
export const LIB_DESCRIPTION = "GoodData Backend SPI implementation for GoodData Cloud and GoodData.CN";
|
|
5
5
|
export const LIB_NAME = "@gooddata/sdk-backend-tiger";
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { type IDashboardExportImageOptions, type IDashboardExportPdfOptions, type IDashboardExportPresentationOptions, type IDashboardExportRawOptions, type IDashboardExportTabularOptions, type IDashboardReferences, type IDashboardSummaryWorkflowStartResult, type IDashboardSummaryWorkflowStatusResult, type IDashboardWithReferences, type IDashboardsQuery, type IExportResult, type IGetDashboardOptions, type IGetDashboardPluginOptions, type IRawExportCustomOverrides, type IWorkspaceDashboardsService, type SupportedDashboardReferenceTypes } from "@gooddata/sdk-backend-spi";
|
|
2
2
|
import { type FilterContextItem, type IDashboard, type IDashboardAttributeFilterConfig, type IDashboardBase, type IDashboardDefinition, type IDashboardFilterView, type IDashboardFilterViewSaveRequest, type IDashboardObjectIdentity, type IDashboardPermissions, type IDashboardPlugin, type IDashboardPluginDefinition, type IDashboardTab, type IDashboardWidget, type IDateFilter, type IExecutionDefinition, type IFilter, type IFilterContext, type IListedDashboard, type IObjectCertificationWrite, type IWidget, type ObjRef } from "@gooddata/sdk-model";
|
|
3
3
|
import { type FiltersByTab, type TigerAuthenticatedCallGuard } from "../../../types/index.js";
|
|
4
|
-
export declare function
|
|
4
|
+
export declare function getOrphanedTabFilterContexts(originalTabs: IDashboardTab[], currentTabs: IDashboardTab[]): IFilterContext[];
|
|
5
5
|
export declare class TigerWorkspaceDashboards implements IWorkspaceDashboardsService {
|
|
6
6
|
private readonly authCall;
|
|
7
7
|
readonly workspace: string;
|
|
@@ -81,6 +81,7 @@ export declare class TigerWorkspaceDashboards implements IWorkspaceDashboardsSer
|
|
|
81
81
|
private processDashboardTabsFilterContexts;
|
|
82
82
|
private processFilterContextUpdate;
|
|
83
83
|
private updateFilterContext;
|
|
84
|
+
private cleanupOrphanedTabFilterContexts;
|
|
84
85
|
private deleteFilterContext;
|
|
85
86
|
private getFilterContext;
|
|
86
87
|
private prepareMetadata;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
// (C) 2020-2026 GoodData Corporation
|
|
2
|
-
import {
|
|
2
|
+
import { isEmpty, isEqual } from "lodash-es";
|
|
3
3
|
import { invariant } from "ts-invariant";
|
|
4
4
|
import { v4 as uuid } from "uuid";
|
|
5
5
|
import { AnalyticalDashboardModelV2, MetadataUtilities, ValidateRelationsHeader, isDashboardPluginsItem, isDataSetItem, isVisualizationObjectsItem, } from "@gooddata/api-client-tiger";
|
|
@@ -27,8 +27,15 @@ import { getSettingsForCurrentUser } from "../settings/index.js";
|
|
|
27
27
|
import { buildDashboardPermissions } from "./dashboardPermissions.js";
|
|
28
28
|
import { DashboardsQuery } from "./dashboardsQuery.js";
|
|
29
29
|
import { resolveWidgetFilters, resolveWidgetFiltersWithMultipleDateFilters } from "./widgetFilters.js";
|
|
30
|
-
export function
|
|
31
|
-
|
|
30
|
+
export function getOrphanedTabFilterContexts(originalTabs, currentTabs) {
|
|
31
|
+
const currentRefs = currentTabs
|
|
32
|
+
.map(({ filterContext }) => filterContext)
|
|
33
|
+
.filter(isFilterContext)
|
|
34
|
+
.map(({ ref }) => ref);
|
|
35
|
+
return originalTabs
|
|
36
|
+
.map(({ filterContext }) => filterContext)
|
|
37
|
+
.filter(isFilterContext)
|
|
38
|
+
.filter((filterContext) => !currentRefs.some((ref) => areObjRefsEqual(ref, filterContext.ref)));
|
|
32
39
|
}
|
|
33
40
|
export class TigerWorkspaceDashboards {
|
|
34
41
|
authCall;
|
|
@@ -300,14 +307,7 @@ export class TigerWorkspaceDashboards {
|
|
|
300
307
|
*
|
|
301
308
|
* The following code prevents the creation of new filter-context orphans.
|
|
302
309
|
*/
|
|
303
|
-
|
|
304
|
-
.map(({ filterContext }) => filterContext)
|
|
305
|
-
.filter(isFilterContext)
|
|
306
|
-
.forEach((filterContext) => {
|
|
307
|
-
this.deleteFilterContext(filterContext).catch((error) => {
|
|
308
|
-
console.warn(`Failed to cleanup orphaned filter context`, filterContext.ref, error);
|
|
309
|
-
});
|
|
310
|
-
});
|
|
310
|
+
await this.cleanupOrphanedTabFilterContexts(originalDashboard.tabs ?? [], dashboard.tabs ?? []);
|
|
311
311
|
return dashboard;
|
|
312
312
|
};
|
|
313
313
|
/**
|
|
@@ -495,6 +495,12 @@ export class TigerWorkspaceDashboards {
|
|
|
495
495
|
}, {}),
|
|
496
496
|
}
|
|
497
497
|
: {};
|
|
498
|
+
const dashboardTabsParametersOverridesObj = options?.dashboardTabsParametersOverrides &&
|
|
499
|
+
Object.keys(options.dashboardTabsParametersOverrides).length > 0
|
|
500
|
+
? {
|
|
501
|
+
dashboardTabsParametersOverrides: options.dashboardTabsParametersOverrides,
|
|
502
|
+
}
|
|
503
|
+
: {};
|
|
498
504
|
const format = options?.format || "XLSX";
|
|
499
505
|
const tabularExport = await ExportApi_CreateDashboardExportRequest(client.axios, client.basePath, {
|
|
500
506
|
exportDashboardTabularExportRequest: {
|
|
@@ -516,6 +522,7 @@ export class TigerWorkspaceDashboards {
|
|
|
516
522
|
widgetIds: options?.widgetIds,
|
|
517
523
|
...dashboardFiltersOverrideObj,
|
|
518
524
|
...dashboardTabsFiltersOverridesObj,
|
|
525
|
+
...dashboardTabsParametersOverridesObj,
|
|
519
526
|
},
|
|
520
527
|
workspaceId: this.workspace,
|
|
521
528
|
dashboardId,
|
|
@@ -1045,6 +1052,11 @@ export class TigerWorkspaceDashboards {
|
|
|
1045
1052
|
});
|
|
1046
1053
|
return convertFilterContextFromBackend(result.data);
|
|
1047
1054
|
};
|
|
1055
|
+
cleanupOrphanedTabFilterContexts = async (originalTabs, currentTabs) => {
|
|
1056
|
+
await Promise.all(getOrphanedTabFilterContexts(originalTabs, currentTabs).map((filterContext) => this.deleteFilterContext(filterContext).catch((error) => {
|
|
1057
|
+
console.warn(`Failed to cleanup orphaned filter context`, filterContext.ref, error);
|
|
1058
|
+
})));
|
|
1059
|
+
};
|
|
1048
1060
|
deleteFilterContext = async (filterContext) => {
|
|
1049
1061
|
await this.authCall((client) => FilterContextApi_DeleteEntityFilterContexts(client.axios, client.basePath, {
|
|
1050
1062
|
workspaceId: this.workspace,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@gooddata/sdk-backend-tiger",
|
|
3
|
-
"version": "11.40.0-alpha.
|
|
3
|
+
"version": "11.40.0-alpha.1",
|
|
4
4
|
"description": "GoodData Backend SPI implementation for GoodData Cloud and GoodData.CN",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"author": "GoodData",
|
|
@@ -33,12 +33,12 @@
|
|
|
33
33
|
"ts-invariant": "0.10.3",
|
|
34
34
|
"tslib": "2.8.1",
|
|
35
35
|
"uuid": "11.1.0",
|
|
36
|
-
"@gooddata/
|
|
37
|
-
"@gooddata/sdk-backend-spi": "11.40.0-alpha.
|
|
38
|
-
"@gooddata/sdk-code-convertors": "11.40.0-alpha.
|
|
39
|
-
"@gooddata/sdk-model": "11.40.0-alpha.
|
|
40
|
-
"@gooddata/
|
|
41
|
-
"@gooddata/util": "11.40.0-alpha.
|
|
36
|
+
"@gooddata/api-client-tiger": "11.40.0-alpha.1",
|
|
37
|
+
"@gooddata/sdk-backend-spi": "11.40.0-alpha.1",
|
|
38
|
+
"@gooddata/sdk-code-convertors": "11.40.0-alpha.1",
|
|
39
|
+
"@gooddata/sdk-model": "11.40.0-alpha.1",
|
|
40
|
+
"@gooddata/sdk-backend-base": "11.40.0-alpha.1",
|
|
41
|
+
"@gooddata/util": "11.40.0-alpha.1"
|
|
42
42
|
},
|
|
43
43
|
"devDependencies": {
|
|
44
44
|
"@gooddata/fixtures": "3.3.12",
|
|
@@ -65,10 +65,10 @@
|
|
|
65
65
|
"oxlint-tsgolint": "0.11.4",
|
|
66
66
|
"typescript": "5.9.3",
|
|
67
67
|
"vitest": "4.1.0",
|
|
68
|
-
"@gooddata/catalog-export": "11.40.0-alpha.
|
|
69
|
-
"@gooddata/
|
|
70
|
-
"@gooddata/
|
|
71
|
-
"@gooddata/
|
|
68
|
+
"@gooddata/catalog-export": "11.40.0-alpha.1",
|
|
69
|
+
"@gooddata/oxlint-config": "11.40.0-alpha.1",
|
|
70
|
+
"@gooddata/reference-workspace": "11.40.0-alpha.1",
|
|
71
|
+
"@gooddata/eslint-config": "11.40.0-alpha.1"
|
|
72
72
|
},
|
|
73
73
|
"scripts": {
|
|
74
74
|
"_phase:build": "npm run build",
|