Skip to content

Conversation

@fzngagan
Copy link
Contributor

No description provided.

@fzngagan
Copy link
Contributor Author

fzngagan commented Dec 7, 2021

@angusmcleod
I've made the backend validation to work properly. The frontend needs some changes to display the errors correctly. Will continue with those later in the week.

@fzngagan fzngagan requested a review from angusmcleod December 8, 2021 07:38
@fzngagan fzngagan marked this pull request as ready for review December 8, 2021 07:38
@fzngagan fzngagan marked this pull request as draft December 8, 2021 07:39
@lgtm-com
Copy link

lgtm-com bot commented Jan 27, 2022

This pull request introduces 1 alert when merging 12b2935 into c9e243f - view on LGTM.com

new alerts:

  • 1 for Useless assignment to local variable

@fzngagan
Copy link
Contributor Author

@angusmcleod
There was an issue(which I've fixed in the last commit) where the server side validation errors wouldn't display on the frontend. Here's why.

Scenario 1

When you call wizard.save like


It rejects the promise if the buildJson method returns wizard.error.

and hence we enter the catch block of the calling method

without even hitting the server.

Scenario 2

Let's say the promise didn't get rejected, in that case we enter


Now this condition would never be satisfied because we return the key errors and not error from the server.
render json: failed_json.merge(errors: template.errors.full_messages)

The last commit fixes this issue.

@lgtm-com
Copy link

lgtm-com bot commented Jan 27, 2022

This pull request introduces 1 alert when merging 2cfd827 into c9e243f - view on LGTM.com

new alerts:

  • 1 for Useless assignment to local variable

@fzngagan
Copy link
Contributor Author

Note: the issue reported by LGTM.com is fixed in the last commit.

@fzngagan fzngagan marked this pull request as ready for review January 27, 2022 14:42
@fzngagan fzngagan changed the title DEV: validate liquid templates on wizard save FEATURE: validate liquid templates on wizard save Jan 31, 2022
@fzngagan fzngagan merged commit 51553bc into main Jan 31, 2022
@fzngagan fzngagan deleted the liquid_template_validation branch January 31, 2022 09:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants