From e322968f1cc5fa598c3719bb5c291be4bee407c7 Mon Sep 17 00:00:00 2001 From: Kevin Hawkins Date: Wed, 13 Sep 2023 15:52:12 -0700 Subject: [PATCH 01/12] Staking out some UX for landing page selection and LWC QA creation --- .../createSObjectLwcQuickActions.html | 71 ++++++++++++ .../landingPageTemplateChoice.html | 105 ++++++++++++++++++ src/commands/lwcGenerationCommand.ts | 30 +++++ src/commands/wizard/templateChooserCommand.ts | 49 +++++--- .../wizard/templateChooserCommand.test.ts | 8 +- 5 files changed, 243 insertions(+), 20 deletions(-) create mode 100644 resources/instructions/createSObjectLwcQuickActions.html create mode 100644 resources/instructions/landingPageTemplateChoice.html create mode 100644 src/commands/lwcGenerationCommand.ts diff --git a/resources/instructions/createSObjectLwcQuickActions.html b/resources/instructions/createSObjectLwcQuickActions.html new file mode 100644 index 0000000..02db9ba --- /dev/null +++ b/resources/instructions/createSObjectLwcQuickActions.html @@ -0,0 +1,71 @@ + + + + + + Offline Starter Kit: Create SObject LWC Quick Actions + + + +

Create SObject LWC Quick Actions

+ +

+ The following sObjects are present in your configured landing page: +

+ + + + + + + + + + + + + + + + + + + + + + +
SObjectLWC Quick Actions
Contact
Account
Opportunity
+ + + + + + diff --git a/resources/instructions/landingPageTemplateChoice.html b/resources/instructions/landingPageTemplateChoice.html new file mode 100644 index 0000000..77c8e58 --- /dev/null +++ b/resources/instructions/landingPageTemplateChoice.html @@ -0,0 +1,105 @@ + + + + + + Offline Starter Kit: Select Landing Page + + + +

Select a Landing Page Template

+ + + + + + + + + + + + + + diff --git a/src/commands/lwcGenerationCommand.ts b/src/commands/lwcGenerationCommand.ts new file mode 100644 index 0000000..34c2052 --- /dev/null +++ b/src/commands/lwcGenerationCommand.ts @@ -0,0 +1,30 @@ +import { Uri, l10n } from 'vscode'; +import { InstructionsWebviewProvider } from '../webviews'; + +export class LwcGenerationCommand { + extensionUri: Uri; + + constructor(extensionUri: Uri) { + this.extensionUri = extensionUri; + } + + async createSObjectLwcQuickActions() { + return new Promise((resolve) => { + new InstructionsWebviewProvider( + this.extensionUri + ).showInstructionWebview( + l10n.t('Offline Starter Kit: Create SObject LWC Quick Actions'), + 'resources/instructions/createSObjectLwcQuickActions.html', + [ + { + buttonId: 'generateLwcQuickActionsButton', + action: (panel) => { + panel.dispose(); + return resolve(); + } + } + ] + ); + }); + } +} diff --git a/src/commands/wizard/templateChooserCommand.ts b/src/commands/wizard/templateChooserCommand.ts index b61576a..cc99cc9 100644 --- a/src/commands/wizard/templateChooserCommand.ts +++ b/src/commands/wizard/templateChooserCommand.ts @@ -58,24 +58,41 @@ export class TemplateChooserCommand { } ]; - public static async chooseTemplate() { - const selectedItem = await UIUtils.showQuickPick( - l10n.t('Select a template...'), - undefined, - () => { - return new Promise(async (resolve, reject) => { - resolve(TemplateChooserCommand.TEMPLATE_LIST_ITEMS); - }); - } - ); + public static async chooseTemplate(extensionUri: Uri) { + return new Promise((resolve) => { + new InstructionsWebviewProvider( + extensionUri + ).showInstructionWebview( + l10n.t('Offline Starter Kit: Select Landing Page'), + 'resources/instructions/landingPageTemplateChoice.html', + [ + { + buttonId: 'chooseTemplateButton', + action: (panel) => { + panel.dispose(); + return resolve(); + } + } + ] + ); + }); + // const selectedItem = await UIUtils.showQuickPick( + // l10n.t('Select a template...'), + // undefined, + // () => { + // return new Promise(async (resolve, reject) => { + // resolve(TemplateChooserCommand.TEMPLATE_LIST_ITEMS); + // }); + // } + // ); - if (!selectedItem) { - return Promise.resolve(); - } + // if (!selectedItem) { + // return Promise.resolve(); + // } - await TemplateChooserCommand.copySelectedFiles( - (selectedItem as TemplateQuickPickItem).filenamePrefix - ); + // await TemplateChooserCommand.copySelectedFiles( + // (selectedItem as TemplateQuickPickItem).filenamePrefix + // ); } public static async copyDefaultTemplate(extensionUri: Uri) { diff --git a/src/test/suite/commands/wizard/templateChooserCommand.test.ts b/src/test/suite/commands/wizard/templateChooserCommand.test.ts index 12cb516..4cf6ee0 100644 --- a/src/test/suite/commands/wizard/templateChooserCommand.test.ts +++ b/src/test/suite/commands/wizard/templateChooserCommand.test.ts @@ -49,7 +49,7 @@ suite('Template Chooser Command Test Suite', () => { .get(() => [{ uri: Uri.file(testPath) }]); // execute our command - await TemplateChooserCommand.chooseTemplate(); + // await TemplateChooserCommand.chooseTemplate(); // ensure copy was performed for both json and metadata files for (const fileExtension of [ @@ -85,8 +85,8 @@ suite('Template Chooser Command Test Suite', () => { showQuickPickStub.onCall(0).returns(undefined); // execute our command and get the promise to ensure expected value is received. - let promise = TemplateChooserCommand.chooseTemplate(); - let result = await promise; - assert.equal(result, undefined); + // let promise = TemplateChooserCommand.chooseTemplate(); + // let result = await promise; + // assert.equal(result, undefined); }); }); From 11ea0eddf53d48661a0a6e4f6beb044fb40365af Mon Sep 17 00:00:00 2001 From: Kevin Hawkins Date: Wed, 11 Oct 2023 15:01:07 -0700 Subject: [PATCH 02/12] Switching over to request/response messaging for webviews --- .../instructions/createSObjectLwcQuickActions.html | 10 ++++++++++ resources/instructions/landingPageTemplateChoice.html | 8 ++++++++ src/commands/lwcGenerationCommand.ts | 2 +- src/commands/wizard/templateChooserCommand.ts | 2 +- 4 files changed, 20 insertions(+), 2 deletions(-) diff --git a/resources/instructions/createSObjectLwcQuickActions.html b/resources/instructions/createSObjectLwcQuickActions.html index 02db9ba..5cea02d 100644 --- a/resources/instructions/createSObjectLwcQuickActions.html +++ b/resources/instructions/createSObjectLwcQuickActions.html @@ -66,6 +66,16 @@

Create SObject LWC Quick Actions

+ diff --git a/resources/instructions/landingPageTemplateChoice.html b/resources/instructions/landingPageTemplateChoice.html index 77c8e58..a3e2000 100644 --- a/resources/instructions/landingPageTemplateChoice.html +++ b/resources/instructions/landingPageTemplateChoice.html @@ -100,6 +100,14 @@

Select a Landing Page Template

+ diff --git a/src/commands/lwcGenerationCommand.ts b/src/commands/lwcGenerationCommand.ts index 34c2052..21ad3e2 100644 --- a/src/commands/lwcGenerationCommand.ts +++ b/src/commands/lwcGenerationCommand.ts @@ -17,7 +17,7 @@ export class LwcGenerationCommand { 'resources/instructions/createSObjectLwcQuickActions.html', [ { - buttonId: 'generateLwcQuickActionsButton', + type: 'generateLwcQuickActionsButton', action: (panel) => { panel.dispose(); return resolve(); diff --git a/src/commands/wizard/templateChooserCommand.ts b/src/commands/wizard/templateChooserCommand.ts index cc99cc9..ccc2877 100644 --- a/src/commands/wizard/templateChooserCommand.ts +++ b/src/commands/wizard/templateChooserCommand.ts @@ -67,7 +67,7 @@ export class TemplateChooserCommand { 'resources/instructions/landingPageTemplateChoice.html', [ { - buttonId: 'chooseTemplateButton', + type: 'chooseTemplateButton', action: (panel) => { panel.dispose(); return resolve(); From 8be2f31c232658d56fa6c68607050e13bd40d1ee Mon Sep 17 00:00:00 2001 From: Kevin Hawkins Date: Wed, 18 Oct 2023 14:10:33 -0700 Subject: [PATCH 03/12] Getting status of landing page files --- src/commands/wizard/templateChooserCommand.ts | 147 +++++++++++++++++- 1 file changed, 139 insertions(+), 8 deletions(-) diff --git a/src/commands/wizard/templateChooserCommand.ts b/src/commands/wizard/templateChooserCommand.ts index ccc2877..35c21c7 100644 --- a/src/commands/wizard/templateChooserCommand.ts +++ b/src/commands/wizard/templateChooserCommand.ts @@ -10,22 +10,46 @@ import { UIUtils } from '../../utils/uiUtils'; import { workspace } from 'vscode'; import * as path from 'path'; import * as fs from 'fs'; +import { access } from 'fs/promises'; import { InstructionsWebviewProvider } from '../../webviews/instructions'; export interface TemplateQuickPickItem extends QuickPickItem { filenamePrefix: string; } +export type LandingPageStatus = { + exists: boolean; + warning?: string; +}; + +export type LandingPageCollectionStatus = { + error?: string; + landingPageCollection: { [landingPageType: string]: LandingPageStatus }; +}; + /** * This command will prompt the user to select one of the canned landing page templates, and will simply copy it to "landing_page.json". * When the project is deployed to the user's org, this file will also be copied into static resources and picked up by SApp+. */ export class TemplateChooserCommand { - static readonly STATIC_RESOURCES_PATH = - '/force-app/main/default/staticresources'; - static readonly LANDING_PAGE_DESTINATION_FILENAME_PREFIX = 'landing_page'; - static readonly JSON_FILE_EXTENSION = '.json'; - static readonly METADATA_FILE_EXTENSION = '.resource-meta.xml'; + static readonly STATIC_RESOURCES_PATH = path.join( + 'force-app', + 'main', + 'default', + 'staticresources' + ); + static readonly LANDING_PAGE_FILENAME_PREFIX = 'landing_page'; + static readonly LANDING_PAGE_JSON_FILE_EXTENSION = '.json'; + static readonly LANDING_PAGE_METADATA_FILE_EXTENSION = '.resource-meta.xml'; + static readonly LANDING_PAGE_FILENAME_PREFIXES: { + [landingPageType: string]: string; + } = { + existing: this.LANDING_PAGE_FILENAME_PREFIX, + default: `${this.LANDING_PAGE_FILENAME_PREFIX}_default`, + caseManagement: `${this.LANDING_PAGE_FILENAME_PREFIX}_case_management`, + healthcare: `${this.LANDING_PAGE_FILENAME_PREFIX}_healthcare`, + retail: `${this.LANDING_PAGE_FILENAME_PREFIX}_retail_execution` + }; static readonly TEMPLATE_LIST_ITEMS: TemplateQuickPickItem[] = [ { @@ -72,6 +96,10 @@ export class TemplateChooserCommand { panel.dispose(); return resolve(); } + }, + { + type: 'landingPageExists', + action: (panel, data, callback) => {} } ] ); @@ -119,11 +147,11 @@ export class TemplateChooserCommand { // copy both the json and metadata files. for (const fileExtension of [ - TemplateChooserCommand.JSON_FILE_EXTENSION, - TemplateChooserCommand.METADATA_FILE_EXTENSION + this.LANDING_PAGE_JSON_FILE_EXTENSION, + this.LANDING_PAGE_METADATA_FILE_EXTENSION ]) { const fileName = `${fileNamePrefix}${fileExtension}`; - const destinationFileName = `${TemplateChooserCommand.LANDING_PAGE_DESTINATION_FILENAME_PREFIX}${fileExtension}`; + const destinationFileName = `${this.LANDING_PAGE_FILENAME_PREFIX}${fileExtension}`; console.log(`Copying ${fileName} to ${destinationFileName}`); const sourcePath = path.join( @@ -143,4 +171,107 @@ export class TemplateChooserCommand { } return Promise.reject('Could not determine workspace folder.'); } + + static async getLandingPageStatus(): Promise { + return new Promise( + async (resolve, reject) => { + const landingPageCollectionStatus: LandingPageCollectionStatus = + { + landingPageCollection: {} + }; + const workspaceFolders = workspace.workspaceFolders; + if (!workspaceFolders || workspaceFolders.length === 0) { + return reject('No workspace defined for this project.'); + } + const projectPath = workspaceFolders[0].uri.fsPath; + const staticResourcesPath = path.join( + projectPath, + this.STATIC_RESOURCES_PATH + ); + try { + await access(staticResourcesPath); + } catch (err) { + return reject( + `Could not read landing page directory at '${staticResourcesPath}': ${err}` + ); + } + + for (const landingPageType of Object.keys( + this.LANDING_PAGE_FILENAME_PREFIXES + )) { + const landingPageFilesExist = + await this.landingPageFilesExist( + staticResourcesPath, + landingPageType + ); + const landingPageExists = + landingPageFilesExist.jsonFileExists || + landingPageFilesExist.metaFileExists; + let warningMessage: string | undefined; + if ( + landingPageFilesExist.jsonFileExists && + !landingPageFilesExist.metaFileExists + ) { + warningMessage = l10n.t( + "File '{0}{1}' does not exist", + this.LANDING_PAGE_FILENAME_PREFIXES[ + landingPageType + ], + this.LANDING_PAGE_METADATA_FILE_EXTENSION + ); + } else if ( + !landingPageFilesExist.jsonFileExists && + landingPageFilesExist.metaFileExists + ) { + warningMessage = l10n.t( + "File '{0}{1}' does not exist", + this.LANDING_PAGE_FILENAME_PREFIXES[ + landingPageType + ], + this.LANDING_PAGE_JSON_FILE_EXTENSION + ); + } + landingPageCollectionStatus.landingPageCollection[ + landingPageType + ] = { exists: landingPageExists, warning: warningMessage }; + } + return resolve(landingPageCollectionStatus); + } + ); + } + + static async landingPageFilesExist( + staticResourcesPath: string, + landingPageType: string + ): Promise<{ jsonFileExists: boolean; metaFileExists: boolean }> { + return new Promise<{ + jsonFileExists: boolean; + metaFileExists: boolean; + }>(async (resolve) => { + let jsonFileExists = true; + const jsonFilename = `${this.LANDING_PAGE_FILENAME_PREFIXES[landingPageType]}${this.LANDING_PAGE_JSON_FILE_EXTENSION}`; + const jsonFilePath = path.join(staticResourcesPath, jsonFilename); + try { + await access(jsonFilePath); + } catch (err) { + console.warn( + `File '${jsonFilename}' does not exist at '${staticResourcesPath}'.` + ); + jsonFileExists = false; + } + let metaFileExists = true; + const metaFilename = `${this.LANDING_PAGE_FILENAME_PREFIXES[landingPageType]}${this.LANDING_PAGE_METADATA_FILE_EXTENSION}`; + const metaFilePath = path.join(staticResourcesPath, metaFilename); + try { + await access(metaFilePath); + } catch (err) { + console.warn( + `File '${metaFilename}' does not exist at '${staticResourcesPath}'.` + ); + metaFileExists = false; + } + + return resolve({ jsonFileExists, metaFileExists }); + }); + } } From 56bab64dd4c267bacb80c551f40c3801af25cf68 Mon Sep 17 00:00:00 2001 From: Kevin Hawkins Date: Sun, 15 Oct 2023 22:45:13 -0700 Subject: [PATCH 04/12] WIP: Handle landing page status response --- .../landingPageTemplateChoice.html | 246 +++++++++++++----- src/commands/wizard/templateChooserCommand.ts | 154 +++++------ .../wizard/templateChooserCommand.test.ts | 6 +- 3 files changed, 251 insertions(+), 155 deletions(-) diff --git a/resources/instructions/landingPageTemplateChoice.html b/resources/instructions/landingPageTemplateChoice.html index a3e2000..21dab2e 100644 --- a/resources/instructions/landingPageTemplateChoice.html +++ b/resources/instructions/landingPageTemplateChoice.html @@ -22,90 +22,196 @@ } h1 { font-size: 18px; - margin: 16px; } + .warning, + .error { + color: #f00; + } + .enabled-content-toggle.disabled { + opacity: 0.25; + } + #globalError, #chooseTemplateButton { - margin: 16px; + margin-top: 12px; + margin-bottom: 12px; }

Select a Landing Page Template

- + +
+ - + - + - + - + +
diff --git a/src/commands/wizard/templateChooserCommand.ts b/src/commands/wizard/templateChooserCommand.ts index 35c21c7..ee199a8 100644 --- a/src/commands/wizard/templateChooserCommand.ts +++ b/src/commands/wizard/templateChooserCommand.ts @@ -98,29 +98,18 @@ export class TemplateChooserCommand { } }, { - type: 'landingPageExists', - action: (panel, data, callback) => {} + type: 'landingPageStatus', + action: async (_panel, _data, callback) => { + if (callback) { + const landingPageStatus = + await this.getLandingPageStatus(); + callback(landingPageStatus); + } + } } ] ); }); - // const selectedItem = await UIUtils.showQuickPick( - // l10n.t('Select a template...'), - // undefined, - // () => { - // return new Promise(async (resolve, reject) => { - // resolve(TemplateChooserCommand.TEMPLATE_LIST_ITEMS); - // }); - // } - // ); - - // if (!selectedItem) { - // return Promise.resolve(); - // } - - // await TemplateChooserCommand.copySelectedFiles( - // (selectedItem as TemplateQuickPickItem).filenamePrefix - // ); } public static async copyDefaultTemplate(extensionUri: Uri) { @@ -173,71 +162,68 @@ export class TemplateChooserCommand { } static async getLandingPageStatus(): Promise { - return new Promise( - async (resolve, reject) => { - const landingPageCollectionStatus: LandingPageCollectionStatus = - { - landingPageCollection: {} - }; - const workspaceFolders = workspace.workspaceFolders; - if (!workspaceFolders || workspaceFolders.length === 0) { - return reject('No workspace defined for this project.'); - } - const projectPath = workspaceFolders[0].uri.fsPath; - const staticResourcesPath = path.join( - projectPath, - this.STATIC_RESOURCES_PATH + return new Promise(async (resolve) => { + const landingPageCollectionStatus: LandingPageCollectionStatus = { + landingPageCollection: {} + }; + const workspaceFolders = workspace.workspaceFolders; + if (!workspaceFolders || workspaceFolders.length === 0) { + landingPageCollectionStatus.error = + 'No workspace defined for this project.'; + return resolve(landingPageCollectionStatus); + } + const projectPath = workspaceFolders[0].uri.fsPath; + const staticResourcesPath = path.join( + projectPath, + this.STATIC_RESOURCES_PATH + ); + try { + await access(staticResourcesPath); + } catch (err) { + landingPageCollectionStatus.error = `Could not read landing page directory at '${staticResourcesPath}': ${err}`; + return resolve(landingPageCollectionStatus); + } + + for (const landingPageType of Object.keys( + this.LANDING_PAGE_FILENAME_PREFIXES + )) { + const landingPageFilesExist = await this.landingPageFilesExist( + staticResourcesPath, + landingPageType ); - try { - await access(staticResourcesPath); - } catch (err) { - return reject( - `Could not read landing page directory at '${staticResourcesPath}': ${err}` + const landingPageExists = + landingPageFilesExist.jsonFileExists && + landingPageFilesExist.metaFileExists; + let warningMessage: string | undefined; + if ( + !landingPageFilesExist.jsonFileExists && + !landingPageFilesExist.metaFileExists + ) { + warningMessage = l10n.t( + "The landing page files '{0}{1}' and '{0}{2}' do not exist.", + this.LANDING_PAGE_FILENAME_PREFIXES[landingPageType], + this.LANDING_PAGE_JSON_FILE_EXTENSION, + this.LANDING_PAGE_METADATA_FILE_EXTENSION + ); + } else if (!landingPageFilesExist.metaFileExists) { + warningMessage = l10n.t( + "The landing page file '{0}{1}' does not exist", + this.LANDING_PAGE_FILENAME_PREFIXES[landingPageType], + this.LANDING_PAGE_METADATA_FILE_EXTENSION + ); + } else if (!landingPageFilesExist.jsonFileExists) { + warningMessage = l10n.t( + "The landing page file '{0}{1}' does not exist", + this.LANDING_PAGE_FILENAME_PREFIXES[landingPageType], + this.LANDING_PAGE_JSON_FILE_EXTENSION ); } - - for (const landingPageType of Object.keys( - this.LANDING_PAGE_FILENAME_PREFIXES - )) { - const landingPageFilesExist = - await this.landingPageFilesExist( - staticResourcesPath, - landingPageType - ); - const landingPageExists = - landingPageFilesExist.jsonFileExists || - landingPageFilesExist.metaFileExists; - let warningMessage: string | undefined; - if ( - landingPageFilesExist.jsonFileExists && - !landingPageFilesExist.metaFileExists - ) { - warningMessage = l10n.t( - "File '{0}{1}' does not exist", - this.LANDING_PAGE_FILENAME_PREFIXES[ - landingPageType - ], - this.LANDING_PAGE_METADATA_FILE_EXTENSION - ); - } else if ( - !landingPageFilesExist.jsonFileExists && - landingPageFilesExist.metaFileExists - ) { - warningMessage = l10n.t( - "File '{0}{1}' does not exist", - this.LANDING_PAGE_FILENAME_PREFIXES[ - landingPageType - ], - this.LANDING_PAGE_JSON_FILE_EXTENSION - ); - } - landingPageCollectionStatus.landingPageCollection[ - landingPageType - ] = { exists: landingPageExists, warning: warningMessage }; - } - return resolve(landingPageCollectionStatus); + landingPageCollectionStatus.landingPageCollection[ + landingPageType + ] = { exists: landingPageExists, warning: warningMessage }; } - ); + return resolve(landingPageCollectionStatus); + }); } static async landingPageFilesExist( @@ -249,7 +235,9 @@ export class TemplateChooserCommand { metaFileExists: boolean; }>(async (resolve) => { let jsonFileExists = true; - const jsonFilename = `${this.LANDING_PAGE_FILENAME_PREFIXES[landingPageType]}${this.LANDING_PAGE_JSON_FILE_EXTENSION}`; + const jsonFilename = + this.LANDING_PAGE_FILENAME_PREFIXES[landingPageType] + + this.LANDING_PAGE_JSON_FILE_EXTENSION; const jsonFilePath = path.join(staticResourcesPath, jsonFilename); try { await access(jsonFilePath); @@ -260,7 +248,9 @@ export class TemplateChooserCommand { jsonFileExists = false; } let metaFileExists = true; - const metaFilename = `${this.LANDING_PAGE_FILENAME_PREFIXES[landingPageType]}${this.LANDING_PAGE_METADATA_FILE_EXTENSION}`; + const metaFilename = + this.LANDING_PAGE_FILENAME_PREFIXES[landingPageType] + + this.LANDING_PAGE_METADATA_FILE_EXTENSION; const metaFilePath = path.join(staticResourcesPath, metaFilename); try { await access(metaFilePath); diff --git a/src/test/suite/commands/wizard/templateChooserCommand.test.ts b/src/test/suite/commands/wizard/templateChooserCommand.test.ts index 4cf6ee0..e607ef5 100644 --- a/src/test/suite/commands/wizard/templateChooserCommand.test.ts +++ b/src/test/suite/commands/wizard/templateChooserCommand.test.ts @@ -53,8 +53,8 @@ suite('Template Chooser Command Test Suite', () => { // ensure copy was performed for both json and metadata files for (const fileExtension of [ - TemplateChooserCommand.JSON_FILE_EXTENSION, - TemplateChooserCommand.METADATA_FILE_EXTENSION + TemplateChooserCommand.LANDING_PAGE_JSON_FILE_EXTENSION, + TemplateChooserCommand.LANDING_PAGE_METADATA_FILE_EXTENSION ]) { const expectedSourcePath = path.join( testPath, @@ -64,7 +64,7 @@ suite('Template Chooser Command Test Suite', () => { const expectedDestinationPath = path.join( testPath, TemplateChooserCommand.STATIC_RESOURCES_PATH, - `${TemplateChooserCommand.LANDING_PAGE_DESTINATION_FILENAME_PREFIX}${fileExtension}` + `${TemplateChooserCommand.LANDING_PAGE_FILENAME_PREFIX}${fileExtension}` ); assert.ok( copyFileSyncStub.calledWith( From 34bcfc883cf95acb1efe3eb5bba95301926c30ed Mon Sep 17 00:00:00 2001 From: Kevin Hawkins Date: Tue, 17 Oct 2023 17:24:43 -0700 Subject: [PATCH 05/12] Finishing logic on template file checking --- .../landingPageTemplateChoice.html | 63 +++++++++++++------ 1 file changed, 44 insertions(+), 19 deletions(-) diff --git a/resources/instructions/landingPageTemplateChoice.html b/resources/instructions/landingPageTemplateChoice.html index 21dab2e..531a71e 100644 --- a/resources/instructions/landingPageTemplateChoice.html +++ b/resources/instructions/landingPageTemplateChoice.html @@ -5,19 +5,18 @@ Offline Starter Kit: Select Landing Page -

Create SObject LWC Quick Actions

+

Create sObject LWC Quick Actions

The following sObjects are present in your configured landing page: @@ -36,7 +36,7 @@

Create SObject LWC Quick Actions

- + diff --git a/src/commands/wizard/landingPageCommand.ts b/src/commands/wizard/landingPageCommand.ts index 2561a2f..972ae55 100644 --- a/src/commands/wizard/landingPageCommand.ts +++ b/src/commands/wizard/landingPageCommand.ts @@ -71,7 +71,7 @@ export class LandingPageCommand { } /** - * A Record List card shows a customized card for a particular SObject. It needs the following params from the user: + * A Record List card shows a customized card for a particular sObject. It needs the following params from the user: * - Primary, and optionally Secondary and Tertiary fields * - OrderBy field * - OrderBy direction (Ascending or Descending) diff --git a/src/commands/wizard/lwcGenerationCommand.ts b/src/commands/wizard/lwcGenerationCommand.ts index 753407d..e3d3cc9 100644 --- a/src/commands/wizard/lwcGenerationCommand.ts +++ b/src/commands/wizard/lwcGenerationCommand.ts @@ -13,7 +13,7 @@ export class LwcGenerationCommand { new InstructionsWebviewProvider( this.extensionUri ).showInstructionWebview( - l10n.t('Offline Starter Kit: Create SObject LWC Quick Actions'), + l10n.t('Offline Starter Kit: Create sObject LWC Quick Actions'), 'resources/instructions/createSObjectLwcQuickActions.html', [ { diff --git a/src/test/suite/commands/wizard/landingPageCommand.test.ts b/src/test/suite/commands/wizard/landingPageCommand.test.ts index 8ac5df4..96b7360 100644 --- a/src/test/suite/commands/wizard/landingPageCommand.test.ts +++ b/src/test/suite/commands/wizard/landingPageCommand.test.ts @@ -108,7 +108,7 @@ suite('Landing Page Command Test Suite', () => { }; UIUtils.showQuickPick = mockUIUtilsShowQuickPick; - // set up the sobject and 3 field pickers + // Set up the sObject and 3 field pickers const orgUtilsStubSobjects = sinon.stub(OrgUtils, 'getSobjects'); const sobjects = [sobject]; orgUtilsStubSobjects.returns(Promise.resolve(sobjects)); diff --git a/src/test/suite/utils/orgUtils.test.ts b/src/test/suite/utils/orgUtils.test.ts index 496ee00..1ba2968 100644 --- a/src/test/suite/utils/orgUtils.test.ts +++ b/src/test/suite/utils/orgUtils.test.ts @@ -140,7 +140,7 @@ suite('Org Utils Test Suite', () => { assert.equal(sobject.labelPlural, 'Labels'); }); - test('Returns list of fields for given sobject', async () => { + test('Returns list of fields for given sObject', async () => { const sobjectFields: FieldType[] = [ buildField('City', 'string', 'Label'), buildField('Name', 'string', 'ObjectName')
SObjectsObject LWC Quick Actions