diff --git a/expression-components/main/ui/components/base/lwc/expressionSiteElement/expressionSiteElement.js b/expression-components/main/ui/components/base/lwc/expressionSiteElement/expressionSiteElement.js index 2d4c9f1b..1c0924d5 100644 --- a/expression-components/main/ui/components/base/lwc/expressionSiteElement/expressionSiteElement.js +++ b/expression-components/main/ui/components/base/lwc/expressionSiteElement/expressionSiteElement.js @@ -1,8 +1,8 @@ import TwElement from "c/twElement"; -import { refreshApex } from '@salesforce/apex'; +import {refreshApex} from '@salesforce/apex'; import evaluate from '@salesforce/apex/FormulaEvaluatorUiController.evaluate'; -import { CurrentPageReference } from "lightning/navigation"; -import { wire } from "lwc"; +import {CurrentPageReference} from "lightning/navigation"; +import {wire} from "lwc"; export default class ExpressionSiteElement extends TwElement { // These 4 need to be set by the extending class as `@api` properties. @@ -16,6 +16,7 @@ export default class ExpressionSiteElement extends TwElement { error; contextId = null evaluatedWire; + connectedCallback() { window.addEventListener('expression_refresh', this.refreshHandler); } @@ -46,7 +47,6 @@ export default class ExpressionSiteElement extends TwElement { } refreshHandler = () => { - console.log('refreshHandler'); return refreshApex(this.evaluatedWire); } @@ -80,5 +80,6 @@ export default class ExpressionSiteElement extends TwElement { return false; } - validate() {} + validate() { + } } diff --git a/expression-src/main/src/helpers/tests/AstPrinterTest.cls b/expression-src/main/src/helpers/tests/AstPrinterTest.cls new file mode 100644 index 00000000..1d0199e4 --- /dev/null +++ b/expression-src/main/src/helpers/tests/AstPrinterTest.cls @@ -0,0 +1,6 @@ +@IsTest +private class AstPrinterTest { + @IsTest + static void testBehavior() { + } +} \ No newline at end of file diff --git a/src-pull/classes/UpdateAccount.cls-meta.xml b/expression-src/main/src/helpers/tests/AstPrinterTest.cls-meta.xml similarity index 100% rename from src-pull/classes/UpdateAccount.cls-meta.xml rename to expression-src/main/src/helpers/tests/AstPrinterTest.cls-meta.xml diff --git a/src-pull/classes/UpdateAccount.cls b/src-pull/classes/UpdateAccount.cls deleted file mode 100644 index 5c6a8972..00000000 --- a/src-pull/classes/UpdateAccount.cls +++ /dev/null @@ -1,13 +0,0 @@ -/** - * Created by cesar on 11/3/2023. - */ - -global without sharing class UpdateAccount implements IExpressionFunction { - global Object execute(List args) { - Id accountId = (Id) args[0]; - Map extra = (Map) args[1]; - String newName = (String) extra.get('name'); - update new Account(Id = accountId, Name = newName); - return null; - } -} \ No newline at end of file