Skip to content
This repository has been archived by the owner on Sep 11, 2024. It is now read-only.

adds validation for fields. #2550

Closed
wants to merge 1 commit into from
Closed

Conversation

ara4n
Copy link
Member

@ara4n ara4n commented Jan 31, 2019

  • renames RoomTooltip to be a generic Tooltip (which it is)
  • hooks it into Field to show validation results
  • adds onValidate to Field to let Field instances call an arbitrary validation function

screenshot 2019-02-01 at 00 59 17

screenshot 2019-02-01 at 00 59 13

 * renames RoomTooltip to be a generic Tooltip (which it is)
 * hooks it into Field to show validation results
 * adds onValidate to Field to let Field instances call an arbitrary validation function
@ara4n ara4n requested a review from jryans January 31, 2019 23:37
@@ -90,6 +90,15 @@ export default class ServerConfig extends React.PureComponent {
this.setState({ hsUrl });
}

onHomeserverValidate = (value) => {
Copy link
Member Author

Choose a reason for hiding this comment

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

This is placeholder to show how it's meant to be used.

Copy link
Collaborator

@jryans jryans left a comment

Choose a reason for hiding this comment

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

Looks great overall, just added a few questions.

Would be nice to have a screenshot in the future as well. 😁

src/components/views/auth/ServerConfig.js Show resolved Hide resolved
.mx_Field_valid input,
.mx_Field_valid select,
.mx_Field_valid textarea {
border-color: $input-valid-border-color ! important;
Copy link
Collaborator

Choose a reason for hiding this comment

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

What triggered all the important? Would adding an extra selector like .mx_Field.mx_Field_valid avoid the need for it?

Copy link
Member Author

Choose a reason for hiding this comment

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

it's so that the valid/invalid state clobbers the focus-selected colour. i can't remember the specificity of :focus, hence clobbering with !important, which i agree is ugly. someone with more css-fu would be welcome to switch the selectors to be more elegant ;)

@ara4n
Copy link
Member Author

ara4n commented Feb 1, 2019

@jryans can i hand this over to you to either tweak & land, or land and tweak & use?

@jryans
Copy link
Collaborator

jryans commented Feb 1, 2019

@jryans can i hand this over to you to either tweak & land, or land and tweak & use?

Sure, works for me!

@jryans jryans assigned jryans and unassigned ara4n Feb 1, 2019
jryans pushed a commit to jryans/matrix-react-sdk that referenced this pull request Mar 12, 2019
 * renames RoomTooltip to be a generic Tooltip (which it is)
 * hooks it into Field to show validation results
 * adds onValidate to Field to let Field instances call an arbitrary validation function

Rebased from @ara4n's matrix-org#2550
by @jryans. Subsequent commits revise and adapt this work.
jryans added a commit to jryans/matrix-react-sdk that referenced this pull request Mar 12, 2019
This is example code from @ara4n's work in
matrix-org#2550. We're not ready to
actually apply validation yet, so removing this for now.
@jryans
Copy link
Collaborator

jryans commented Mar 12, 2019

I have rebased and extended this work in #2780, so the story continues over there.

@jryans jryans closed this Mar 12, 2019
@weeman1337 weeman1337 mentioned this pull request Nov 21, 2022
3 tasks
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants