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

Generic parent letter (story) #34016

Merged
merged 10 commits into from Apr 3, 2020
Merged

Generic parent letter (story) #34016

merged 10 commits into from Apr 3, 2020

Conversation

islemaster
Copy link
Contributor

Introduces a generic parent letter component designed to be rendered by itself on a page, ready for printing or PDF generation; along with associated storybook entries. Implements most of Part 1, Requirement 5 of this spec.

I figured this was a good spot to stop, get a review, and merge in content that we can wire up to the dialog or PDF generation later.

The letter has variants for each login type:

Login type Letter
Picture passwords: image
Secret words: image
Personal logins: image
Clever: image
Google Classroom: image

Non-goals

We're intentionally not worrying about making this letter translatable yet. That follow-up work is tracked here.

Testing story

Developed entirely in storybook - nothing here will reach production yet.

Reviewer Checklist:

  • Tests provide adequate coverage
  • Code is well-commented
  • New features are translatable or updates will not break translations
  • Relevant documentation has been added or updated
  • User impact is well-understood and desirable
  • Pull Request is labeled appropriately
  • Follow-up work items (including potential tech debt) are tracked and linked

Copy link

@clareconstantine clareconstantine left a comment

Choose a reason for hiding this comment

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

Thanks for jumping on this!


const Header = () => {
return (
<header style={{backgroundColor: color.teal, marginBottom: 30}}>

Choose a reason for hiding this comment

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

nit - our styleguide prefers extracting these to a style object rather than doing it inline.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

👍 Will update.

Independent of this PR, would love to have a conversation at some point about whether people actually like this rule: It's one we introduced without much discussion and I mostly find it annoying now. It makes composing styles a little unintuitive. I'm also not sure it's enforceable by any existing linter rule, and in general we try to cut things from our styleguide that we can't automatically enforce. What are your thoughts on it?

).
</p>
<h1>Step 2 - Get your child set up to use Code.org at home</h1>
<SignInInstructions loginType={loginType} sectionCode={sectionCode} />

Choose a reason for hiding this comment

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

I like the extraction here - makes this much more readable!

</li>
<li>
If your student does not remember their password, they can reset it
from the Sign in screen

Choose a reason for hiding this comment

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

also nit - should 'In' be capitalized?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Whoops! Pulled this as-is from the spec, but you're right, it's weird. I'd actually lower "sign." Our convention seems to be "Sign in" when quoting the button, and "sign in" everywhere else.

Comment on lines +168 to +169
email me and I will provide it
</li>
Copy link
Contributor

Choose a reason for hiding this comment

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

tiny nit: punctuation here? and line 181

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Which punctuation are you expecting? The convention in the spec was no punctuation at the end of any list items.

);

const GoToSectionSignIn = ({sectionCode}) => {
const sectionUrl = `studio.code.org/sections/${sectionCode}`;
Copy link
Contributor

Choose a reason for hiding this comment

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

usually this and other urls would be relative using urlHelpers, but doesn't seem that important right now.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

🤦‍♂️ Oh, we should totally do that. Thanks for the reminder!

storybook = storybook.storiesOf('ParentLetter', module);

// Make a story for every login type
Object.values(SectionLoginType).forEach(loginType => {
Copy link
Contributor

Choose a reason for hiding this comment

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

well, that's handy.

<ParentLetter
loginType={loginType}
sectionCode="ABCDEF"
teacherName="Minerva McGonagall"
Copy link
Contributor

Choose a reason for hiding this comment

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

🌟

@islemaster islemaster merged commit a28c3ba into staging Apr 3, 2020
@islemaster islemaster mentioned this pull request Apr 3, 2020
7 tasks
@fisher-alice fisher-alice deleted the generic-parent-letter branch July 13, 2022 22:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants