Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Validate handlebars #15552

Merged
merged 26 commits into from
Feb 17, 2025
Merged

Validate handlebars #15552

merged 26 commits into from
Feb 17, 2025

Conversation

adrinr
Copy link
Collaborator

@adrinr adrinr commented Feb 14, 2025

Description

Validating handlebars on the binding panel. For now, we will be only validating the following:

  1. Fields parameters (TODO in a further PR)
  2. Helpers parameters
  3. If helper required a body, validate it is set
  4. Within a body of a helper, we only validate other helpers (as we don't know what keywords can the helper use, such as index, this...)

Screenshots

No errors

image

Helper with missing parameters

image

Helper with too many parameters

image

Helper with missing required body

image

Wrong helper within a helper

image

Invalid HBS code

image

Launchcontrol

Validate helpers usages in hbs

Copy link

linear bot commented Feb 14, 2025

Copy link

qa-wolf bot commented Feb 14, 2025

QA Wolf here! As you write new code it's important that your test coverage is keeping up.
Click here to request test coverage for this PR!

@adrinr adrinr marked this pull request as draft February 14, 2025 09:59
@github-actions github-actions bot added firestorm Data/Infra/Revenue Team size/m labels Feb 14, 2025
@adrinr adrinr changed the title Budi 9038/validate hbs Validate handlebars Feb 14, 2025
@adrinr adrinr marked this pull request as ready for review February 14, 2025 13:00
@adrinr adrinr requested review from mike12345567 and aptkingston and removed request for mike12345567 February 14, 2025 13:02
@mike12345567
Copy link
Collaborator

Checked this out and had a look at it - ran into a few issues - it seems handlebars statements with spaces in them are not validated correctly, for example the Query Params based on the URL:
image

Also components which have spaces in their name suffer from this same problem, e.g. table - table 1 (auto-generated screens can appear like this).

@adrinr
Copy link
Collaborator Author

adrinr commented Feb 17, 2025

Checked this out and had a look at it - ran into a few issues - it seems handlebars statements with spaces in them are not validated correctly, for example the Query Params based on the URL: image

Also components which have spaces in their name suffer from this same problem, e.g. table - table 1 (auto-generated screens can appear like this).

This is caused by the difference between runtime vs readable values. This required a much bigger job, as we will need to handle whitespaces properly. I will be doing this separately, as it might grow quite a lot. We will need to handle also other type of expressions, such as arrays.
Meanwhile, I updated this branch to only validate hbs helpers, as this will already add value.

@adrinr adrinr requested a review from mike12345567 February 17, 2025 11:48
Copy link
Member

@aptkingston aptkingston left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Works well in my testing 👍 Nice job @adrinr.

@adrinr adrinr enabled auto-merge February 17, 2025 13:01
@adrinr adrinr merged commit da2a7ab into master Feb 17, 2025
20 checks passed
@adrinr adrinr deleted the BUDI-9038/validate-hbs branch February 17, 2025 13:10
@github-actions github-actions bot locked and limited conversation to collaborators Feb 17, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
firestorm Data/Infra/Revenue Team size/m
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants