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

add failing tests cases for situations that we want the transform to support #7

Open
mansona opened this issue Nov 3, 2021 · 10 comments

Comments

@mansona
Copy link
Contributor

mansona commented Nov 3, 2021

Now that we have a test suite with unit tests (added in #1) we can now develop the transform in somewhat of a TDD approach. We can create a number of failing tests that we can then go through and fix one-by-one.

This issue differs from #5 because we want to add tests for situations that we already know that we want to support, not things that are on the edge of the 80-20 split of work.

The deliverable for this task is to create PRs that will have failing tests because the code isn't actually doing what it's supposed to. The work associated with this task is not to fix the issue with the transform but instead collect failing examples that can be incorporated into the next iterations 👍

@mansona mansona changed the title add failing tests cases for situations that we want the transform to support (in a WIP PR) add failing tests cases for situations that we want the transform to support Nov 3, 2021
@candunaj candunaj self-assigned this Nov 5, 2021
@mansona
Copy link
Contributor Author

mansona commented Nov 5, 2021

Issue: there might be something wrong with named blocks 🤔 it could very well be something wrong with ember-template-recast because of the nature of the output

File: app/components/audit-frequencies/page/edit.hbs

Impact: searching for <: (the telltale sign of using named blocks) there are a total of ~300 cases in 74 files


Edit actually it turns out it seems to only be affecting this one file 🤔 it doesn't seem to be a systematic problem

@mansona
Copy link
Contributor Author

mansona commented Nov 5, 2021

Issue: it seems that we can't use the {{link-to}} "helper" as a actual helper argument like this:

{{t "some text {link_to_more_text}" link_to_more_text=(link-to "Link Text" "some.route")}}.

writing out the minimal example here make it clear why there is an issue 🙈 we would need to use the href-to helper instead here, or something super complex. It might just have to be an example of one that we won't fix

File: app/components/user/modals/thankyou-form.hbs

Impact: it seems like we only have exactly one occurrence of this 🎉

Fixed with #14

@candunaj
Copy link
Contributor

candunaj commented Nov 5, 2021

Issue: there are components with text arguments like:

<Datatables::DatatableColumn @Label="Created By User" />
<AppAdmin::Datafield::FormTemplates::FormTemplateField @Label="Control Information" />

We should probably have a list of components with attributes that need to be translated.

1329 occurrences
[^\s]*label[^\s]*="

320 occurrences
[^\s]*title[^\s]*="

Fixed with #22

@candunaj
Copy link
Contributor

candunaj commented Nov 5, 2021

Issue: translate of concat helper is not supported yet

<span title={{concat "text1" "text2"}}>{{concat "aaa" "bbb"}}

@candunaj
Copy link
Contributor

candunaj commented Nov 5, 2021

Issue: material-icon should not be translated
{{t " content_cut Cut " htmlSafe=true}}

Fixed with #23

@candunaj
Copy link
Contributor

candunaj commented Nov 5, 2021

Issue: &middot; should not be considered as text. Same as &nbsp; which is currently supported.

{{t "<span> {audit_user_fullName} &nbsp;&nbsp;&middot;&nbsp;&nbsp; " audit_user_fullName=audit.user.fullName htmlSafe=true}}

Fixed with #24

@candunaj
Copy link
Contributor

candunaj commented Nov 8, 2021

Text elements inside specific elements (flex-col,...) should not be merged:

<div class="flex flex-col">
<span class="text-gray-500">
Period: {{opsAudit.opsAuditPeriod.name}}
</span>
<span class="text-gray-500">
Category: {{opsAudit.opsAuditCategory.name}}
</span>
</div>

@candunaj
Copy link
Contributor

candunaj commented Nov 8, 2021

Issue: Components with curly braces invocation are sometimes merged with text as mustache element!

{{input @value='aaa'}} Text

{{t "{input ...} Text"}}

fixed with PR #14

@mansona
Copy link
Contributor Author

mansona commented Nov 15, 2021

Note: we're keeping this open because it's a good resource of issues that we want to tackle, but we will decide which problems to fix closer to the end of the project when the MVP is working and we're in the "optimisation phase" 👍

@BobrImperator
Copy link
Contributor

Will keep open along with #5 for documentation.
But seems like both threads can be closed.

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

No branches or pull requests

3 participants