diff --git a/lib/datapacksexpanddefinition.yaml b/lib/datapacksexpanddefinition.yaml index fcbf16fd..035866ef 100644 --- a/lib/datapacksexpanddefinition.yaml +++ b/lib/datapacksexpanddefinition.yaml @@ -1185,7 +1185,7 @@ SObjects: FilterFields: - VersionNumber - IsActive - - LightningWebComponentId + - WebComponentKey FolderName: - Type - SubType diff --git a/lib/datapacksjob.js b/lib/datapacksjob.js index 8dc831bc..301966e1 100644 --- a/lib/datapacksjob.js +++ b/lib/datapacksjob.js @@ -2783,6 +2783,9 @@ DataPacksJob.prototype.deployJob = async function(jobInfo) { VlocityUtils.error('Can\'t find compiled LWC components path. Skipping...'); }else{ try { + if (fs.readdirSync(tempSfdxLwcFolder+'/lwc').length === 0){ + return; + } VlocityUtils.log('Deploying generated LWC components'); this.vlocity.datapacksutils.addPackageDirToSfdxProjectJson(tempSfdxLwcFolder); const mdapiTempFolder = path.join(jobInfo.tempFolder, 'mdapi'); @@ -2815,6 +2818,7 @@ DataPacksJob.prototype.deployJob = async function(jobInfo) { var metadataKey = `${metadata.componentType}/${metadata.fullName}`; VlocityUtils.success('Metadata Deployed', metadataKey); jobInfo.currentStatus[metadataKey] = 'Success'; + this.rmdirCustom(tempSfdxLwcFolder+'/lwc/'+metadata.fullName); } } ); @@ -2828,6 +2832,7 @@ DataPacksJob.prototype.deployJob = async function(jobInfo) { var metadataKey = `${metadata.componentType}/${metadata.fullName}`; VlocityUtils.success('Metadata Deployed', metadataKey); jobInfo.currentStatus[metadataKey] = 'Success'; + this.rmdirCustom(tempSfdxLwcFolder+'/lwc/'+metadata.fullName); } } ); diff --git a/lib/datapacktypes/vlocitycard.js b/lib/datapacktypes/vlocitycard.js index 387875f3..212bf658 100644 --- a/lib/datapacktypes/vlocitycard.js +++ b/lib/datapacktypes/vlocitycard.js @@ -175,34 +175,35 @@ VlocityCard.prototype.onDeployFinish = async function(jobInfo) { return; } - //--------Load Flexcard compiler------- - // Make sure we load the package version - await this.vlocity.utilityservice.getPackageVersion(); - - const compilerName = 'flexcard-compiler'; - const namespace = this.vlocity.namespace; - const packageVersion = this.vlocity.PackageVersion; - - const flexCardsCompiler = await VlocityUtils.loadCompiler(compilerName, - jobInfo, packageVersion, namespace); - if(flexCardsCompiler){ - for (let i = 0; i < idsArray.length; i++) { - let flexCardID = idsArray[i]; - await this.compileFlexCardsLwc(flexCardID,jobInfo,flexCardsCompiler) ; - } + if (!jobInfo.ignoreLocalCompilationCards){ + //--------Load Flexcard compiler------- + // Make sure we load the package version + await this.vlocity.utilityservice.getPackageVersion(); + + const compilerName = 'flexcard-compiler'; + const namespace = this.vlocity.namespace; + const packageVersion = this.vlocity.PackageVersion; + + const flexCardsCompiler = await VlocityUtils.loadCompiler(compilerName, + jobInfo, packageVersion, namespace); + if(flexCardsCompiler){ + for (let i = 0; i < idsArray.length; i++) { + let flexCardID = idsArray[i]; + await this.compileFlexCardsLwc(flexCardID,jobInfo,flexCardsCompiler) ; + } + } else{ + hasFlexCardCompiler= false; + } } else{ - hasFlexCardCompiler= false; - } - + hasFlexCardCompiler= false; + } } catch (e) { - hasFlexCardCompiler= false; VlocityUtils.error('Error while loading Flexcard Compiler', e); } // If we were unable to load the compiler package, use the legacy method if(!hasFlexCardCompiler){ - await this.flexCardDeployWithPuppeteer(jobInfo) ; return; }