diff --git a/app/client/src/components/editorComponents/CodeEditor/EvaluatedValuePopup.tsx b/app/client/src/components/editorComponents/CodeEditor/EvaluatedValuePopup.tsx index 383fe3a1de..c921c70fb8 100644 --- a/app/client/src/components/editorComponents/CodeEditor/EvaluatedValuePopup.tsx +++ b/app/client/src/components/editorComponents/CodeEditor/EvaluatedValuePopup.tsx @@ -116,7 +116,6 @@ interface Props { useValidationMessage?: boolean; hideEvaluatedValue?: boolean; evaluationSubstitutionType?: EvaluationSubstitutionType; - jsError?: string; } interface PopoverContentProps { @@ -130,7 +129,6 @@ interface PopoverContentProps { onMouseLeave: () => void; hideEvaluatedValue?: boolean; preparedStatementViewer: boolean; - jsError?: string; } const PreparedStatementViewerContainer = styled.span` @@ -274,9 +272,7 @@ function PopoverContent(props: PopoverContentProps) { {props.hasError && ( - {props.jsError && props.jsError.length - ? props.jsError - : props.useValidationMessage && props.error + {props.useValidationMessage && props.error ? props.error : `This value does not evaluate to type "${props.expected}". Transform it using JS inside '{{ }}'`} @@ -339,7 +335,6 @@ function EvaluatedValuePopup(props: Props) { expected={props.expected} hasError={props.hasError} hideEvaluatedValue={props.hideEvaluatedValue} - jsError={props.jsError} onMouseEnter={() => { setContentHovered(true); }} diff --git a/app/client/src/components/editorComponents/CodeEditor/index.tsx b/app/client/src/components/editorComponents/CodeEditor/index.tsx index f61fe0dc66..8f98ea1af4 100644 --- a/app/client/src/components/editorComponents/CodeEditor/index.tsx +++ b/app/client/src/components/editorComponents/CodeEditor/index.tsx @@ -88,7 +88,6 @@ export type EditorStyleProps = { fill?: boolean; useValidationMessage?: boolean; evaluationSubstitutionType?: EvaluationSubstitutionType; - jsErrorMessage?: string; }; export type EditorProps = EditorStyleProps & @@ -358,9 +357,8 @@ class CodeEditor extends Component { useValidationMessage, hideEvaluatedValue, evaluationSubstitutionType, - jsErrorMessage, } = this.props; - const hasError = !!(meta && meta.error) || !!jsErrorMessage; + const hasError = !!(meta && meta.error); let evaluated = evaluatedValue; if (dataTreePath) { evaluated = _.get(dynamicData, dataTreePath); @@ -404,7 +402,6 @@ class CodeEditor extends Component { hasError={hasError} hideEvaluatedValue={hideEvaluatedValue} isOpen={showEvaluatedValue} - jsError={jsErrorMessage} theme={theme || EditorTheme.LIGHT} useValidationMessage={useValidationMessage} > diff --git a/app/client/src/components/propertyControls/BaseControl.tsx b/app/client/src/components/propertyControls/BaseControl.tsx index 4bf0a88e52..8647dbb6bd 100644 --- a/app/client/src/components/propertyControls/BaseControl.tsx +++ b/app/client/src/components/propertyControls/BaseControl.tsx @@ -41,7 +41,6 @@ export interface ControlData validationMessage?: string; widgetProperties: any; useValidationMessage?: boolean; - jsErrorMessage?: string; } export interface ControlFunctions { onPropertyChange?: (propertyName: string, propertyValue: string) => void; diff --git a/app/client/src/components/propertyControls/CodeEditorControl.tsx b/app/client/src/components/propertyControls/CodeEditorControl.tsx index 5bc78adb25..e081757ed0 100644 --- a/app/client/src/components/propertyControls/CodeEditorControl.tsx +++ b/app/client/src/components/propertyControls/CodeEditorControl.tsx @@ -18,7 +18,6 @@ class CodeEditorControl extends BaseControl { dataTreePath, evaluatedValue, useValidationMessage, - jsErrorMessage, } = this.props; const props: Partial = {}; if (dataTreePath) props.dataTreePath = dataTreePath; @@ -28,7 +27,6 @@ class CodeEditorControl extends BaseControl { return ( >; theme?: EditorTheme; hideEvaluatedValue?: boolean; - jsErrorMessage?: string; }) { const { errorMessage, @@ -35,7 +34,6 @@ export function InputText(props: { dataTreePath, evaluatedValue, hideEvaluatedValue, - jsErrorMessage, } = props; return ( @@ -50,7 +48,6 @@ export function InputText(props: { value: value, onChange: onChange, }} - jsErrorMessage={jsErrorMessage} meta={{ error: isValid ? "" : errorMessage, touched: true, @@ -78,7 +75,6 @@ class InputTextControl extends BaseControl { defaultValue, additionalAutoComplete, hideEvaluatedValue, - jsErrorMessage, } = this.props; return ( @@ -89,7 +85,6 @@ class InputTextControl extends BaseControl { expected={expected} hideEvaluatedValue={hideEvaluatedValue} isValid={isValid} - jsErrorMessage={jsErrorMessage} label={label} onChange={this.onTextChange} placeholder={placeholderText} diff --git a/app/client/src/entities/AppsmithConsole/logtype.ts b/app/client/src/entities/AppsmithConsole/logtype.ts index dfbe511f23..8fc202ca15 100644 --- a/app/client/src/entities/AppsmithConsole/logtype.ts +++ b/app/client/src/entities/AppsmithConsole/logtype.ts @@ -4,7 +4,6 @@ enum LOG_TYPE { ACTION_EXECUTION_ERROR, ACTION_EXECUTION_SUCCESS, ENTITY_DELETED, - EVAL_ERROR, } export default LOG_TYPE; diff --git a/app/client/src/pages/Editor/PropertyPane/PropertyControl.tsx b/app/client/src/pages/Editor/PropertyPane/PropertyControl.tsx index 658cbf62f3..c5297e4b87 100644 --- a/app/client/src/pages/Editor/PropertyPane/PropertyControl.tsx +++ b/app/client/src/pages/Editor/PropertyPane/PropertyControl.tsx @@ -244,14 +244,9 @@ const PropertyControl = memo((props: Props) => { const getPropertyValidation = ( propertyName: string, - ): { - isValid: boolean; - validationMessage?: string; - jsErrorMessage?: string; - } => { + ): { isValid: boolean; validationMessage?: string } => { let isValid = true; let validationMessage = ""; - let jsErrorMessage = ""; if (widgetProperties) { isValid = widgetProperties.invalidProps ? !_.has(widgetProperties.invalidProps, propertyName) @@ -259,17 +254,11 @@ const PropertyControl = memo((props: Props) => { const validationMsgPresent = widgetProperties.validationMessages && _.has(widgetProperties.validationMessages, propertyName); - const jsValidationMessagePresent = - widgetProperties.jsErrorMessages && - _.has(widgetProperties.jsErrorMessages, propertyName); validationMessage = validationMsgPresent ? _.get(widgetProperties.validationMessages, propertyName) : ""; - jsErrorMessage = jsValidationMessagePresent - ? _.get(widgetProperties.jsErrorMessages, propertyName) - : ""; } - return { isValid, validationMessage, jsErrorMessage }; + return { isValid, validationMessage }; }; const { propertyName, label } = props; @@ -281,18 +270,13 @@ const PropertyControl = memo((props: Props) => { `evaluatedValues.${propertyName}`, ); - const { - isValid, - validationMessage, - jsErrorMessage, - } = getPropertyValidation(propertyName); + const { isValid, validationMessage } = getPropertyValidation(propertyName); const { additionalAutoComplete, ...rest } = props; const config = { ...rest, isValid, propertyValue, validationMessage, - jsErrorMessage, dataTreePath, evaluatedValue, widgetProperties, @@ -309,7 +293,6 @@ const PropertyControl = memo((props: Props) => { delete config.dataTreePath; delete config.evaluatedValue; delete config.expected; - config.jsErrorMessage = ""; } const isDynamic: boolean = isPathADynamicProperty( diff --git a/app/client/src/reducers/uiReducers/debuggerReducer.ts b/app/client/src/reducers/uiReducers/debuggerReducer.ts index 369ea2d1ed..4ad5fa9126 100644 --- a/app/client/src/reducers/uiReducers/debuggerReducer.ts +++ b/app/client/src/reducers/uiReducers/debuggerReducer.ts @@ -49,8 +49,7 @@ const debuggerReducer = createReducer(initialState, { const entityId = action.payload.source.id; const id = - action.payload.logType === LOG_TYPE.WIDGET_PROPERTY_VALIDATION_ERROR || - action.payload.logType === LOG_TYPE.EVAL_ERROR + action.payload.logType === LOG_TYPE.WIDGET_PROPERTY_VALIDATION_ERROR ? `${entityId}-${action.payload.source.propertyPath}` : entityId; const previousState = get(state.errors, id, {}); @@ -74,8 +73,7 @@ const debuggerReducer = createReducer(initialState, { const entityId = action.payload.source.id; const isWidgetErrorLog = - action.payload.logType === LOG_TYPE.WIDGET_PROPERTY_VALIDATION_ERROR || - action.payload.logType === LOG_TYPE.EVAL_ERROR; + action.payload.logType === LOG_TYPE.WIDGET_PROPERTY_VALIDATION_ERROR; const id = isWidgetErrorLog ? `${entityId}-${action.payload.source.propertyPath}` : entityId; diff --git a/app/client/src/sagas/ActionExecutionSagas.ts b/app/client/src/sagas/ActionExecutionSagas.ts index fb64fcdacf..dcd97f86c4 100644 --- a/app/client/src/sagas/ActionExecutionSagas.ts +++ b/app/client/src/sagas/ActionExecutionSagas.ts @@ -932,18 +932,6 @@ function* executePageLoadAction(pageAction: PageAction) { message += `\nERROR: "${body}"`; } - AppsmithConsole.error({ - logType: LOG_TYPE.ACTION_EXECUTION_ERROR, - text: `Execution failed with status ${response.data.statusCode}`, - source: { - type: ENTITY_TYPE.ACTION, - name: pageAction.name, - id: pageAction.id, - }, - state: response.data?.request ?? null, - message: JSON.stringify(body), - }); - yield put( executeActionError({ actionId: pageAction.id, diff --git a/app/client/src/sagas/DebuggerSagas.ts b/app/client/src/sagas/DebuggerSagas.ts index a4a565a07b..d072aad539 100644 --- a/app/client/src/sagas/DebuggerSagas.ts +++ b/app/client/src/sagas/DebuggerSagas.ts @@ -27,12 +27,7 @@ function* onWidgetUpdateSaga(payload: LogActionPayload) { const dataTree: DataTree = yield select(getDataTree); const widget = dataTree[payload.source.name]; - if ( - !isWidget(widget) || - !widget.validationMessages || - !widget.jsErrorMessages - ) - return; + if (!isWidget(widget) || !widget.validationMessages) return; // Ignore canvas widget updates if (widget.type === WidgetTypes.CANVAS_WIDGET) { @@ -46,17 +41,14 @@ function* onWidgetUpdateSaga(payload: LogActionPayload) { const validationMessages = widget.validationMessages; const validationMessage = validationMessages[propertyPath]; - const jsErrorMessages = widget.jsErrorMessages; - const jsErrorMessage = jsErrorMessages[propertyPath]; const errors = yield select(getDebuggerErrors); const errorId = `${source.id}-${propertyPath}`; const widgetErrorLog = errors[errorId]; if (!widgetErrorLog) return; const noError = isEmpty(validationMessage); - const noJsError = isEmpty(jsErrorMessage); - if (noError && noJsError) { + if (noError) { delete errors[errorId]; yield put({ @@ -129,7 +121,6 @@ function* debuggerLogSaga(action: ReduxAction) { yield call(onWidgetUpdateSaga, payload); yield put(debuggerLog(payload)); return; - case LOG_TYPE.EVAL_ERROR: case LOG_TYPE.WIDGET_PROPERTY_VALIDATION_ERROR: if (payload.source && payload.source.propertyPath) { if (payload.text) { diff --git a/app/client/src/sagas/EvaluationsSaga.ts b/app/client/src/sagas/EvaluationsSaga.ts index 4975f8a06d..f9a34de445 100644 --- a/app/client/src/sagas/EvaluationsSaga.ts +++ b/app/client/src/sagas/EvaluationsSaga.ts @@ -103,12 +103,6 @@ const evalErrorHandler = (errors: EvalError[]) => { } case EvalErrorTypes.EVAL_ERROR: { log.debug(error); - AppsmithConsole.error({ - logType: LOG_TYPE.EVAL_ERROR, - text: `The value at ${error.context?.source.propertyPath} is invalid`, - message: error.message, - source: error.context?.source, - }); break; } case EvalErrorTypes.WIDGET_PROPERTY_VALIDATION_ERROR: { diff --git a/app/client/src/selectors/propertyPaneSelectors.tsx b/app/client/src/selectors/propertyPaneSelectors.tsx index fbcfa0bb27..0c8d3b453e 100644 --- a/app/client/src/selectors/propertyPaneSelectors.tsx +++ b/app/client/src/selectors/propertyPaneSelectors.tsx @@ -49,14 +49,9 @@ export const getWidgetPropsForPropertyPane = createSelector( } if (evaluatedWidget.invalidProps) { - const { - invalidProps, - validationMessages, - jsErrorMessages, - } = evaluatedWidget; + const { invalidProps, validationMessages } = evaluatedWidget; widgetProperties.invalidProps = invalidProps; widgetProperties.validationMessages = validationMessages; - widgetProperties.jsErrorMessages = jsErrorMessages; } } return widgetProperties; diff --git a/app/client/src/utils/DynamicBindingUtils.ts b/app/client/src/utils/DynamicBindingUtils.ts index d8cf9ce8e8..a3db79aa8e 100644 --- a/app/client/src/utils/DynamicBindingUtils.ts +++ b/app/client/src/utils/DynamicBindingUtils.ts @@ -158,7 +158,6 @@ export interface WidgetEvaluatedProps { invalidProps?: Record; validationMessages?: Record; evaluatedValues?: Record; - jsErrorMessages?: Record; } export interface EntityWithBindings { diff --git a/app/client/src/workers/DataTreeEvaluator.ts b/app/client/src/workers/DataTreeEvaluator.ts index f3593d836d..052b98e9ed 100644 --- a/app/client/src/workers/DataTreeEvaluator.ts +++ b/app/client/src/workers/DataTreeEvaluator.ts @@ -391,11 +391,6 @@ export default class DataTreeEvaluator { let evalPropertyValue; const requiresEval = isABindingPath && isDynamicValue(unEvalPropertyValue); - _.set( - currentTree, - `${entityName}.jsErrorMessages.${propertyPath}`, - "", - ); if (requiresEval) { const evaluationSubstitutionType = entity.bindingPaths[propertyPath] || @@ -406,8 +401,6 @@ export default class DataTreeEvaluator { currentTree, evaluationSubstitutionType, false, - undefined, - fullPropertyPath, ); } catch (e) { this.errors.push({ @@ -552,7 +545,6 @@ export default class DataTreeEvaluator { evaluationSubstitutionType: EvaluationSubstitutionType, returnTriggers: boolean, callBackData?: Array, - fullPropertyPath?: string, ) { // Get the {{binding}} bound values const { stringSegments, jsSnippets } = getDynamicBindings(dynamicBinding); @@ -561,7 +553,6 @@ export default class DataTreeEvaluator { data, jsSnippets[0], callBackData, - fullPropertyPath, ); return result.triggers; } @@ -573,7 +564,6 @@ export default class DataTreeEvaluator { data, jsSnippet, callBackData, - fullPropertyPath, ); return result.result; } else { @@ -600,32 +590,17 @@ export default class DataTreeEvaluator { data: DataTree, js: string, callbackData?: Array, - fullPropertyPath?: string, ): EvalResult { try { return evaluate(js, data, callbackData); } catch (e) { - if (fullPropertyPath) { - const { propertyPath, entityName } = getEntityNameAndPropertyPath( - fullPropertyPath, - ); - _.set(data, `${entityName}.jsErrorMessages.${propertyPath}`, e.message); - const entity = data[entityName]; - if (isWidget(entity)) { - this.errors.push({ - type: EvalErrorTypes.EVAL_ERROR, - message: e.message, - context: { - source: { - id: entity.widgetId, - name: entity.widgetName, - type: ENTITY_TYPE.WIDGET, - propertyPath: propertyPath, - }, - }, - }); - } - } + this.errors.push({ + type: EvalErrorTypes.EVAL_ERROR, + message: e.message, + context: { + binding: js, + }, + }); return { result: undefined, triggers: [] }; } } @@ -647,7 +622,6 @@ export default class DataTreeEvaluator { EvaluationSubstitutionType.TEMPLATE, true, undefined, - fullPropertyPath, ); valueToValidate = triggers; } @@ -666,22 +640,19 @@ export default class DataTreeEvaluator { : transformed; const safeEvaluatedValue = removeFunctions(evaluatedValue); _.set(widget, `evaluatedValues.${propertyPath}`, safeEvaluatedValue); - const jsError = _.get(widget, `jsErrorMessages.${propertyPath}`); if (!isValid) { - if (!jsError) { - this.errors.push({ - type: EvalErrorTypes.WIDGET_PROPERTY_VALIDATION_ERROR, - message: message || "", - context: { - source: { - id: widget.widgetId, - name: widget.widgetName, - type: ENTITY_TYPE.WIDGET, - propertyPath: propertyPath, - }, + this.errors.push({ + type: EvalErrorTypes.WIDGET_PROPERTY_VALIDATION_ERROR, + message: message || "", + context: { + source: { + id: widget.widgetId, + name: widget.widgetName, + type: ENTITY_TYPE.WIDGET, + propertyPath: propertyPath, }, - }); - } + }, + }); _.set(widget, `invalidProps.${propertyPath}`, true); _.set(widget, `validationMessages.${propertyPath}`, message); } else {