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

Updates from Court Dashboard #1426

Merged
merged 6 commits into from
May 19, 2020
Merged

Updates from Court Dashboard #1426

merged 6 commits into from
May 19, 2020

Conversation

sohkai
Copy link
Contributor

@sohkai sohkai commented May 15, 2020

Fixes some of #1425 (will repurpose that issue with the single remaining item):

  • Update the email regex
  • Update placeholder email to be example.org

And a few other small items:

  • Updates the email input adornment patter
  • Updates pattern for using transformAddresses()
  • Remove cssgu (only used sparsely, and we should prefer babel plugin in the future)

Comment on lines -135 to -145
// Makes “gu” a CSS unit in a string, e.g.
// cssgu`10px 2gu 4gu`
export function cssgu(strings, ...substitutions) {
return strings
.map((str, i) => str + (substitutions[i] || ''))
.join('')
.replace(/([0-9]+(?:\.[0-9]+)?)gu/g, (match, value) => {
value = parseFloat(value)
return isNaN(value) ? match : `${value * GU}px`
})
}
Copy link
Contributor

Choose a reason for hiding this comment

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

👋 👯

Copy link
Contributor

Choose a reason for hiding this comment

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

is that something that you used before having the grid unit?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes, this was just before the grid unit was introduced (we released the activity panel late April, and began introducing the GU in mid May).

Copy link
Contributor

@Evalir Evalir left a comment

Choose a reason for hiding this comment

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

🔥

export function validateEmail(email) {
// eslint-disable-next-line no-useless-escape
var re = /^(([^<>()\[\]\\.,;:\s@"]+(\.[^<>()\[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/
return re.test(String(email).toLowerCase())
return /^.+\@.+\..+$/.test(email)
Copy link
Contributor

Choose a reason for hiding this comment

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

Quite the simplification!

Copy link
Contributor

@rperez89 rperez89 left a comment

Choose a reason for hiding this comment

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

LGTM!

<IconCheck
css={`
opacity: 0;
opacity: ${inputEmail.trim() ? '1' : '0'};
Copy link
Contributor

Choose a reason for hiding this comment

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

@bpierre hand was around here :)

Comment on lines -135 to -145
// Makes “gu” a CSS unit in a string, e.g.
// cssgu`10px 2gu 4gu`
export function cssgu(strings, ...substitutions) {
return strings
.map((str, i) => str + (substitutions[i] || ''))
.join('')
.replace(/([0-9]+(?:\.[0-9]+)?)gu/g, (match, value) => {
value = parseFloat(value)
return isNaN(value) ? match : `${value * GU}px`
})
}
Copy link
Contributor

Choose a reason for hiding this comment

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

is that something that you used before having the grid unit?

@sohkai sohkai merged commit f4cc9df into master May 19, 2020
@sohkai sohkai deleted the update-notifications branch May 19, 2020 19:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants