Skip to content

EspoCRM – Open Source CRM Application

Check syntax error close button

Yuriib5307a07eedc
diff --git a/client/src/views/fields/formula.js b/client/src/views/fields/formula.js
index ae52fdd5f1..5bb48eda0f 100644
--- a/client/src/views/fields/formula.js
+++ b/client/src/views/fields/formula.js
@@ -27,6 +27,8 @@
************************************************************************/
import TextFieldView from 'views/fields/text';
+import Ajax from 'ajax';
+import Ui from 'ui';
/**
* @type {{
@@ -454,20 +456,16 @@ class FormulaFieldView extends TextFieldView {
const expression = this.editor.getValue();
if (!expression) {
- Espo.Ui.success(
- this.translate('checkSyntaxSuccess', 'messages', 'Formula')
- );
+ Ui.success(this.translate('checkSyntaxSuccess', 'messages', 'Formula'));
return;
}
- Espo.Ajax
+ Ajax
.postRequest('Formula/action/checkSyntax', {expression: expression})
.then(/** Record */response => {
if (response.isSuccess) {
- Espo.Ui.success(
- this.translate('checkSyntaxSuccess', 'messages', 'Formula')
- );
+ Ui.success(this.translate('checkSyntaxSuccess', 'messages', 'Formula'));
return;
}
@@ -478,7 +476,9 @@ class FormulaFieldView extends TextFieldView {
message += ' ' + response.message;
}
- Espo.Ui.error(message);
+ Ui.error(message, {
+ closeButton: true,
+ });
});
}
}