-
Notifications
You must be signed in to change notification settings - Fork 23
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
O3-1325: Ability to have arbitrary translations for labels in AMPATH forms. #19
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think a great change - only thing I do not yet understand is how the translations are loaded as the HTTP loader is not configured.
BTW @FlorianRappl this PR is not complete, it still has a hard-coded implementation that I need to remove, but I am not sure how to do that yet, do you have some pointers? |
> | ||
</ofe-number-input> | ||
|
||
<input | ||
<ofe-number-input |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This seems like a mistake no?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think that is the correct one because it was throwing an error as input just so I used the same implementation we did on the form ofe-form
and did the same for input and it stopped showing the error.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So, ofe-number-input
is a custom tag for the custom element defined here. I think this exists largely so we can match the carbon styling for numeric inputs. So we sue it above when a numeric input is being rendered (note the *ngSwitchCase="'number'"
). This component, however, is a simple text input which shouldn't need additional styling and was just using the standard HTML input
tag. If there were errors, we should figure why those errors occurred and fix them, because the numeric input styling is likely to look wrong for text inputs
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Okay, I will look into that.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@ibacher this is the error when it is just input
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
theme
seems to be causing the issue.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I have seen this in the main branch and I have seen another solution you mention for adding carbon design class, it is confusing when we should use ofe-number-input
and when we need to use just input
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The guiding rule here is that this section of the form-renderer.component.html is, in essence, a big switch statement that determines the tag based on the question, so in this context, each tag should only appear once.
In your screenshot, but not in the PR, I see you're missing the ofeTextInput
that was there originally which is why you're seeing the error. ofeTextInput
is the directive that adds the necessary styling to this element, including the theme
attribute. If you just add that back in, the error should go away.
@ibacher I have added some screenshots. |
ae060d8
to
624fd0b
Compare
Requirements
Summary
Screenshots
Spanish
Kmer
French
Failure
Visit date
,Provider
etcIssue
Ability to have arbitrary translations for labels in AMPATH forms
Other