Skip to content

Commit 047ac63

Browse files
committed
Revert "Remove not ready schemas"
This reverts commit 4dee5d0.
1 parent b4402a2 commit 047ac63

File tree

5 files changed

+1802
-3
lines changed

5 files changed

+1802
-3
lines changed

src/server/components/charts-engine/components/storage/united-storage/provider.ts

Lines changed: 25 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@ import {
2727
TRACE_ID_HEADER,
2828
US_PUBLIC_API_TOKEN_HEADER,
2929
WORKBOOK_ID_HEADER,
30+
mapChartsConfigToLatestVersion,
3031
} from '../../../../../../shared';
3132
import {ErrorCode, TIMEOUT_10_SEC} from '../../../../../../shared/constants';
3233
import {createErrorHandler} from '../../error-handler';
@@ -226,7 +227,7 @@ export type ProviderCreateParams = {
226227
recursion?: boolean;
227228
meta?: Record<string, string>;
228229
includePermissionsInfo?: boolean | string;
229-
workbookId: string;
230+
workbookId: string | null;
230231
name: string;
231232
mode?: EntryUpdateMode;
232233
annotation?: EntryAnnotationArgs;
@@ -357,6 +358,29 @@ export class USProvider {
357358
});
358359
}
359360

361+
static async retrieveParsedWizardChart(
362+
ctx: AppContext,
363+
props: {
364+
id: string;
365+
storageApiPath?: string;
366+
extraAllowedHeaders?: string[];
367+
unreleased: boolean | string;
368+
includeLinks?: boolean | string;
369+
includePermissionsInfo?: boolean | string;
370+
revId?: string;
371+
headers: Request['headers'];
372+
workbookId?: WorkbookId;
373+
includeServicePlan?: boolean;
374+
includeTenantFeatures?: boolean;
375+
},
376+
) {
377+
const result = await USProvider.retrieveById(ctx, props);
378+
379+
result.data = mapChartsConfigToLatestVersion(JSON.parse(result.data.shared)) as any;
380+
381+
return result;
382+
}
383+
360384
static retrieveByKey(
361385
ctx: AppContext,
362386
{

src/server/components/sdk/dash.ts

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -283,6 +283,7 @@ class Dash {
283283
params: EntryReadParams | null,
284284
headers: IncomingHttpHeaders,
285285
ctx: AppContext,
286+
options?: {forceMigrate?: boolean},
286287
): Promise<DashEntry> {
287288
try {
288289
const headersWithMetadata = {
@@ -297,7 +298,10 @@ class Dash {
297298
const isServerMigrationEnabled = Boolean(
298299
isEnabledServerFeature(Feature.DashServerMigrationEnable),
299300
);
300-
if (isServerMigrationEnabled && DashSchemeConverter.isUpdateNeeded(result.data)) {
301+
if (
302+
(options?.forceMigrate || isServerMigrationEnabled) &&
303+
DashSchemeConverter.isUpdateNeeded(result.data)
304+
) {
301305
result.data = await Dash.migrate(result.data);
302306
}
303307

@@ -398,6 +402,7 @@ class Dash {
398402
headers: IncomingHttpHeaders,
399403
ctx: AppContext,
400404
I18n: ServerI18n,
405+
options?: {forceMigrate?: boolean},
401406
): Promise<DashEntry> {
402407
try {
403408
const usData: typeof data & {skipSyncLinks?: boolean} = {...data};
@@ -406,7 +411,7 @@ class Dash {
406411
const needDataSend = !(mode === EntryUpdateMode.Publish && data.revId);
407412
if (needDataSend) {
408413
if (needSetDefaultData(usData.data)) {
409-
const initialData = await Dash.read(entryId, null, headers, ctx);
414+
const initialData = await Dash.read(entryId, null, headers, ctx, options);
410415
usData.data = setDefaultData(I18n, usData.data, initialData.data);
411416
}
412417

0 commit comments

Comments
 (0)