Skip to content

Commit 8d46e28

Browse files
fix: formula utils
1 parent c85b416 commit 8d46e28

File tree

4 files changed

+20
-10
lines changed

4 files changed

+20
-10
lines changed

src/migration/related/ApexMigration.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ export class ApexMigration extends BaseRelatedObjectMigration {
3131
private readonly callableInterface: InterfaceImplements;
3232
private readonly vlocityOpenInterface2: InterfaceImplements;
3333
private readonly vlocityOpenInterface: InterfaceImplements;
34-
private updatedNamespace = 'omnistudio';
34+
private updatedNamespace = 'vlocity_ins';
3535
public constructor(projectPath: string, namespace: string, org: Org) {
3636
super(projectPath, namespace, org);
3737
this.callableInterface = new InterfaceImplements(CALLABLE, this.namespace);
@@ -53,7 +53,7 @@ export class ApexMigration extends BaseRelatedObjectMigration {
5353
const targetOrg: Org = this.org;
5454
sfProject.retrieve(APEXCLASS, targetOrg.getUsername());
5555
const apexAssessmentInfos = this.processApexFiles(this.projectPath);
56-
// sfProject.deploy(APEXCLASS, targetOrg.getUsername());
56+
sfProject.deploy(APEXCLASS, targetOrg.getUsername());
5757
shell.cd(pwd);
5858
return apexAssessmentInfos;
5959
}

src/migration/related/LwcMigration.ts

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,16 @@ export class LwcMigration extends BaseRelatedObjectMigration {
6363
const jsonData: LWCAssessmentInfo[] = [];
6464
fileMap.forEach((fileList, dir) => {
6565
const changeInfos: FileChangeInfo[] = [];
66-
if (dir !== 'lwc' && !dir.endsWith('English') && !dir.includes('_') && !dir.startsWith('cf')) {
66+
if (
67+
dir !== 'lwc' &&
68+
!dir.endsWith('MultiLanguage') &&
69+
!dir.endsWith('English') &&
70+
!dir.includes('_') &&
71+
!dir.startsWith('cf') &&
72+
!dir.startsWith('Omniscript') &&
73+
!dir.includes('Util') &&
74+
!dir.includes('lodash')
75+
) {
6776
for (const file of fileList) {
6877
if (this.isValideFile(file.name)) {
6978
const processor = FileProcessorFactory.getFileProcessor(file.ext);
@@ -74,7 +83,7 @@ export class LwcMigration extends BaseRelatedObjectMigration {
7483
// if (fileutil.isAutogenratedFile(path)) { }
7584
}
7685
const diff = processor.process(file, type, this.namespace);
77-
if (diff != null) {
86+
if (diff !== null || diff !== '') {
7887
const fileInfo: FileChangeInfo = {
7988
path,
8089
name,

src/utils/formula/FormulaUtil.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,10 +17,10 @@ function getReplacedformulaString(
1717
const startParanthIndex = startIndex + formulaName.length;
1818
const endParanthIndex = getClosingIndexOfParantheses(formulaExpression, startParanthIndex);
1919
const newFormulaExpression =
20-
'Function(' +
21-
className +
20+
'FUNCTION(' +
21+
`'${className}'` +
2222
',' +
23-
methodName +
23+
`'${methodName}'` +
2424
',' +
2525
formulaExpression.substring(startParanthIndex + 1, endParanthIndex) +
2626
')';

test/utils/formula/formulaUtil.test.ts

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ describe('FormulaUtilTest', () => {
1111
const inputString = "TESTMETHODFIRST('hello','bye')";
1212
// eslint-disable-next-line @typescript-eslint/no-unsafe-call
1313
const result = getReplacedString(namespacePrefix, inputString, mockedFunctionDefinitionMetadata);
14-
const expectedResult = "Function(testClassFirst,testMethodFirst,'hello','bye')";
14+
const expectedResult = "FUNCTION('testClassFirst','testMethodFirst','hello','bye')";
1515

1616
expect(result).to.be.equal(expectedResult);
1717
});
@@ -23,7 +23,8 @@ describe('FormulaUtilTest', () => {
2323
const inputString = "TESTMETHODFIRST('hello',TESTMETHOD('bye'))";
2424
// eslint-disable-next-line @typescript-eslint/no-unsafe-call
2525
const result = getReplacedString(namespacePrefix, inputString, mockedFunctionDefinitionMetadata);
26-
const expectedResult = "Function(testClassFirst,testMethodFirst,'hello',Function(testClass,testMethod,'bye'))";
26+
const expectedResult =
27+
"FUNCTION('testClassFirst','testMethodFirst','hello',FUNCTION('testClass','testMethod','bye'))";
2728

2829
expect(result).to.be.equal(expectedResult);
2930
});
@@ -36,7 +37,7 @@ describe('FormulaUtilTest', () => {
3637
// eslint-disable-next-line @typescript-eslint/no-unsafe-call
3738
const result = getReplacedString(namespacePrefix, inputString, mockedFunctionDefinitionMetadata);
3839
const expectedResult =
39-
"Function(testClassFirst,testMethodFirst,'hello',Function(testClass,testMethod,Function(testClassFirst,testMethodFirst,'bye','check')))";
40+
"FUNCTION('testClassFirst','testMethodFirst','hello',FUNCTION('testClass','testMethod',FUNCTION('testClassFirst','testMethodFirst','bye','check')))";
4041
expect(result).to.be.equal(expectedResult);
4142
});
4243
});

0 commit comments

Comments
 (0)