-
Notifications
You must be signed in to change notification settings - Fork 2.9k
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
[HOLD for payment 2022-11-18] [$500] Standardize form error styles #11908
Comments
Current assignee @shawnborton is eligible for the Design assigner, not assigning anyone new. |
After some brief Slack discussion, let's move forward with making the error text all red as well. I have updated the original comment in this issue with the desired outcome. |
Triggered auto assignment to @dylanexpensify ( |
ProposalWe can reuse App/src/components/DotIndicatorMessage.js Line 61 in 124ab42
And we just have to make changes in BaseTextInput class BaseTextInput extends Component {
constructor(props) {
@@ -198,7 +199,6 @@ class BaseTextInput extends Component {
const inputProps = _.omit(this.props, _.keys(baseTextInputPropTypes.propTypes));
const hasLabel = Boolean(this.props.label.length);
const inputHelpText = this.props.errorText || this.props.hint;
- const formHelpStyles = this.props.errorText ? styles.formError : styles.formHelp;
const placeholder = (this.props.prefixCharacter || this.state.isFocused || !hasLabel || (hasLabel && this.props.forceActiveLabel)) ? this.props.placeholder : null;
const textInputContainerStyles = _.reduce([
styles.textInputContainer,
@@ -304,10 +304,13 @@ class BaseTextInput extends Component {
</View>
</TouchableWithoutFeedback>
</View>
- {!_.isEmpty(inputHelpText) && (
- <Text style={[formHelpStyles, styles.mt1, styles.ph3]}>
- {inputHelpText}
- </Text>
+ {(!_.isEmpty(this.props.hint) && _.isEmpty(this.props.errorText)) && (
+ <Text style={[styles.formHelp, styles.mt1, styles.ph3]}>
+ {inputHelpText}
+ </Text>
+ )}
+ {!_.isEmpty(this.props.errorText) && (
+ <DotIndicatorMessage messages={{0: inputHelpText}} type="error" textStyle={[styles.formError, styles.mt1]} />
)}
</View> We can also use a variable {shouldShowHint && (
<Text style={[formHelpStyles, styles.mt1, styles.ph3]}>
{inputHelpText}
</Text>
)} For bottom error we need to pass App/src/components/FormAlertWrapper.js Line 63 in 124ab42
App/src/components/FormAlertWrapper.js Line 67 in 124ab42
App/src/components/FormAlertWrapper.js Line 76 in 124ab42
and for icon we can use - <Icon src={Expensicons.DotIndicator} fill={colors.red} height={variables.iconSizeSmall} width={variables.iconSizeSmall} /> App/src/components/FormAlertWrapper.js Line 59 in 124ab42
FormAlertWrapper component will be refactored soon with the red dot in #11410 so I think we should leave this part to get fixed there. |
Reviewing now! |
No bot message. Interesting! |
@Puneet-here either customize the To me, this issue is exported first and completely focuses on the styling and mentions it in the requirements so it should be done as part of it. |
Going to be OOO next week so I'm going to re-assign so this can keep moving along |
Current assignee @dylanexpensify is eligible for the External assigner, not assigning anyone new. |
Current assignee @parasharrajat is eligible for the External assigner, not assigning anyone new. |
Triggered auto assignment to @mountiny ( |
@parasharrajat @Puneet-here thanks, waiting for a full proposal |
I agree, that should be simple enough. No need to CP either. |
Yeah, no CP needed. Just a addon PR. |
Do we have an ETA when we could get the add-on PR raised? |
This page is not using Form.js. That's why we missed it. And yes, it's ideal to standardize all non-form error styles as well by using new FormHelpMessage component. I raised PR. I also fixed other issues related this page, needed to test fixes and take screenshots for PR. |
BugZero Checklist: The PR fixing this issue has been merged! The following checklist will need to be completed before the issue can be closed:
|
The solution for this issue has been 🚀 deployed to production 🚀 in version 1.2.26-0 and is now subject to a 7-day regression period 📆. Here is the list of pull requests that resolve this issue: If no regressions arise, payment will be issued on 2022-11-18. 🎊 |
@dylanexpensify lets not forget to increase the bounty here for $750 given @0xmiroslav had to work on this one a bit more. Not sure how you keep track of these, maybe update a title |
reviewing today! |
@parasharrajat @0xmiroslav please apply here! TY! |
@dylanexpensify applied thanks |
Offers sent! @parasharrajat @0xmiroslav |
@0xmiroslav @parasharrajat Has this been all paid up? |
not yet |
@parasharrajat @0xmiroslav paid! (keeping this open for the rest of the checklist) |
I think this was not a bug per se but more so a follow up to our Form refactor and aligning on the styles in other forms/inputs hence I am not linking any PR since this was not a regression. And therefore we dont have to add any new test into testrail either given this is not regression and there are tests covering forms and failure.s |
I think I was not paid the correct amount as per #11908 (comment). @NicMendonca |
@parasharrajat sent over amount missing! |
Problem:
Right now we have mutliple different ways of styling a form error.
Solution:
Let's standardize on how we style these form errors. Ideally this should follow the red brick road (dot indicator) style.
Details:
The text was updated successfully, but these errors were encountered: