Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: use domino by default for app create W-10809399 #90

Merged
merged 2 commits into from
Mar 23, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 15 additions & 0 deletions src/lib/analytics/app/folder.ts
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ export type AppFolder = Record<string, unknown> & {
templateSourceId?: string;
templateValues?: Record<string, unknown>;
templateVersion?: string;
templateOptions?: Record<string, unknown>;
};

export type CreateAppBody = {
Expand All @@ -39,15 +40,22 @@ export type CreateAppBody = {
assetIcon?: string;
templateValues?: Record<string, unknown>;
name?: string;
templateOptions?: {
dynamicOptions?: Record<string, unknown>;
appAction?: string;
disableApex?: boolean;
};
};

export default class Folder {
public readonly serverVersion: number;
private readonly connection: Connection;
private readonly foldersUrl: string;

public constructor(organization: Org) {
this.connection = organization.getConnection();
this.foldersUrl = `${this.connection.baseUrl()}/wave/folders/`;
this.serverVersion = +this.connection.getApiVersion();
}

public async fetch(folderid: string, includeLog = false): Promise<AppFolder> {
Expand All @@ -63,6 +71,13 @@ export default class Folder {
}

public async create(body: CreateAppBody): Promise<string | undefined> {
if (this.serverVersion >= 55.0) {
if (!body.templateOptions) {
body.templateOptions = { dynamicOptions: { productionType: 'ATF_3_0', runtimeLogEntryLevel: 'Warning' } };
} else if (!body.templateOptions.dynamicOptions) {
body.templateOptions.dynamicOptions = { productionType: 'ATF_3_0', runtimeLogEntryLevel: 'Warning' };
}
Comment on lines +75 to +79
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Minor -- you should be able to make this one statement, like:

Suggested change
if (!body.templateOptions) {
body.templateOptions = { dynamicOptions: { productionType: 'ATF_3_0', runtimeLogEntryLevel: 'Warning' } };
} else if (!body.templateOptions.dynamicOptions) {
body.templateOptions.dynamicOptions = { productionType: 'ATF_3_0', runtimeLogEntryLevel: 'Warning' };
}
body.templateOptions = {
...body.templateOptions,
dynamicOptions: { productionType: 'ATF_3_0', runtimeLogEntryLevel: 'Warning' }
};

}
const response = await connectRequest<AppFolder>(this.connection, {
method: 'POST',
url: this.foldersUrl,
Expand Down