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

Better modal #2554

Merged
merged 79 commits into from
Jan 11, 2019
Merged

Better modal #2554

merged 79 commits into from
Jan 11, 2019

Conversation

paulmelnikow
Copy link
Member

@paulmelnikow paulmelnikow commented Dec 18, 2018

This is very much a work in progress, though I wanted to surface it so people could start to play with the functionality. Code is definitely not ready for review.

Ref #2496

https://shields-staging-pr-2554.herokuapp.com

@paulmelnikow paulmelnikow added the frontend The Docusaurus app serving the docs site label Dec 18, 2018
@shields-ci
Copy link

shields-ci commented Dec 18, 2018

Warnings
⚠️ This PR modified service code for azure-devops but not its test code.
That's okay so long as it's refactoring existing code.
Messages
📖 ✨ Thanks for your contribution to Shields, @paulmelnikow!

Generated by 🚫 dangerJS against ff37c71

@paulmelnikow
Copy link
Member Author

This pull request introduces 1 alert when merging 0cf9cb9 into 5c7d07f - view on LGTM.com

new alerts:

  • 1 for Unused or undefined state property

Comment posted by LGTM.com

@paulmelnikow paulmelnikow temporarily deployed to shields-staging-pr-2554 December 21, 2018 03:21 Inactive
@paulmelnikow paulmelnikow temporarily deployed to shields-staging-pr-2554 December 21, 2018 04:14 Inactive
@paulmelnikow paulmelnikow temporarily deployed to shields-staging-pr-2554 January 9, 2019 14:03 Inactive
@paulmelnikow paulmelnikow temporarily deployed to shields-staging-pr-2554 January 9, 2019 14:07 Inactive
@paulmelnikow
Copy link
Member Author

This pull request introduces 1 alert when merging d4454bf into 06c6f13 - view on LGTM.com

new alerts:

  • 1 for Unused or undefined state property

Comment posted by LGTM.com

@chris48s
Copy link
Member

chris48s commented Jan 9, 2019

I was contemplating having opinions about this, but there are probably enough cooks having a go at this broth 👨‍🍳

screenshot at 2019-01-09 19-28-40

had a quick browse on staging. Looks like we're heading in a good direction 😄

@paulmelnikow
Copy link
Member Author

Thanks for looking at it!

@paulmelnikow
Copy link
Member Author

I'm really excited to ship this!

@Daniel15 would you have time to take a second pass today?

@paulmelnikow paulmelnikow temporarily deployed to shields-staging-pr-2554 January 10, 2019 18:06 Inactive
@paulmelnikow
Copy link
Member Author

This pull request introduces 1 alert when merging ea53667 into a8629fe - view on LGTM.com

new alerts:

  • 1 for Unused or undefined state property

Comment posted by LGTM.com

Daniel15
Daniel15 previously approved these changes Jan 10, 2019
Copy link
Member

@Daniel15 Daniel15 left a comment

Choose a reason for hiding this comment

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

Looks good to me!

`

const BuilderLabel = styled.label`
${labelFont}
Copy link
Member

Choose a reason for hiding this comment

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

👍

@@ -0,0 +1,74 @@
import React from 'react'
import PropTypes from 'prop-types'
import posed from 'react-pose'
Copy link
Member

Choose a reason for hiding this comment

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

This looks really cool! I haven't done much frontend webdev work in a while (most of the things I work on at work are more backend-related these days), but this library looks really good.

Copy link
Member Author

Choose a reason for hiding this comment

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

I was impressed with how well it worked out of the box! Though I feel like I hit a moderate hill after an initially easy learning curve. I would definitely use it again.

} = this.props

return documentation ? (
<Documentation dangerouslySetInnerHTML={{ __html: documentation }} />
Copy link
Member

@Daniel15 Daniel15 Jan 10, 2019

Choose a reason for hiding this comment

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

This is fine, but usually with dangerouslySetInnerHTML you'll want to wrap the HTML in a {__html} object at the point where the HTML is created rather than in the component itself, and then pass around that object rather than the raw string.

For example, at Facebook if we return raw HTML from the server to render in React, we actually wrap it in the __html object on the server side, and return it as part of the response. This means the client-side won't get confused about which HTML blobs are safe vs which HTML blobs are unsafe - If it's a __html object, it's safe.

Copy link
Member Author

Choose a reason for hiding this comment

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

Thanks! We could consider putting {__html} in the service definition schema. I guess I want to give some thought to whether that seems appropriate for a data schema that is also designed for tools developers (i.e. not specific to React). This isn't related to the PR so I'll open a new issue.

${({ horizPadding }) =>
horizPadding &&
css`
padding-left: ${horizPadding};
Copy link
Member

Choose a reason for hiding this comment

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

Seems like this is only ever set to 8px. Just hard code it? padding: 0 8px

Copy link
Member Author

Choose a reason for hiding this comment

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

In renderLiteral() it's not set so it needs to be conditional. I could do the same as you suggested elsewhere which is to change the parameter to a boolean.

@@ -2,6 +2,13 @@ import React from 'react'
import PropTypes from 'prop-types'
import styled, { css } from 'styled-components'

const noAutocorrect = {
Copy link
Member

Choose a reason for hiding this comment

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

Nit: Maybe do Object.freeze on this to ensure it's not mutated anywhere?

If the repo were using strong typing, it'd be fine (eg. in Flow you can annotate an object as $ReadOnly and then Flow will throw a type error if you try to mutate it.

@paulmelnikow paulmelnikow temporarily deployed to shields-staging-pr-2554 January 10, 2019 19:33 Inactive
@paulmelnikow
Copy link
Member Author

One more 👍 and this'll be on its way! Thanks @Daniel15!

@paulmelnikow
Copy link
Member Author

This pull request introduces 1 alert when merging 9cc1d9c into a8629fe - view on LGTM.com

new alerts:

  • 1 for Unused or undefined state property

Comment posted by LGTM.com

Copy link
Member

@Daniel15 Daniel15 left a comment

Choose a reason for hiding this comment

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

No issues on my end! Nice work :D

@paulmelnikow
Copy link
Member Author

paulmelnikow commented Jan 11, 2019

Looking forward to getting some community feedback on this!

Please respond here: #2496

@paulmelnikow
Copy link
Member Author

This pull request introduces 1 alert when merging ff37c71 into da12f00 - view on LGTM.com

new alerts:

  • 1 for Unused or undefined state property

Comment posted by LGTM.com

@paulmelnikow paulmelnikow merged commit 6c2b040 into master Jan 11, 2019
@shields-deployment
Copy link

This pull request was merged to master branch. This change is now waiting for deployment, which will usually happen within a few days. Stay tuned by joining our #ops channel on Discord!

After deployment, changes are copied to gh-pages branch:

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
blocker PRs and epics which block other work frontend The Docusaurus app serving the docs site
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants