Skip to content

Added confirmation page for joining pd workshop sections.#9548

Merged
aoby merged 2 commits into
stagingfrom
pd-workshop-join-section-confirmation
Jul 19, 2016
Merged

Added confirmation page for joining pd workshop sections.#9548
aoby merged 2 commits into
stagingfrom
pd-workshop-join-section-confirmation

Conversation

@aoby

@aoby aoby commented Jul 15, 2016

Copy link
Copy Markdown
Contributor

Now, joining a workshop session behaves differently from joining a normal class section.

  1. If not logged in, the user will be redirected to the normal login page, rather than the custom section new user page. This could perhaps be improved further (in a subsequent change) by adding a support for a default user type and setting it to teacher for an even better workflow for new users.
  2. Once logged in, a confirmation page will display. This will be pre-populated with the existing enrollment form, or with user details (name & email) if no enrollment exists:

image

If an email exists for the user, it will be locked in this form, with a tooltip that it can be changed in account settings. However, if there is no email (student account, or former student account turned teacher before we required email) it will be open. Then, email is required, and the hash of the supplied email must match the user's hashed_email or it will display an error. Once it matches, the student user will be converted to teacher and the plaintext email set.

@breville FYI I moved the workshop enrollment form into a partial, shared by this and the existing new enrollment view. I also removed the requirement for enrollment.school until we can solidify that and require district, and I removed the * for district and school on the form since they are not actually required yet.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

So this basically means "return to me"?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

correct :)

@breville

Copy link
Copy Markdown
Member

big change! lgtm

Comment thread dashboard/app/models/section.rb Outdated

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

s/TYPE_PD_WORKSHOP/PD_WORKSHOP

The name is already in an array called TYPES...

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Still, each constant is defined separately and is not referenced as a member of the container array. This pattern is a shorthand for:

TYPE_PD_WORKSHOP = 'pd_workshop'
TYPES = [TYPE_PD_WORKSHOP]

I'm declaring TYPES as the list of all options for the validation, similar to here.

Unfortunately we can't refer to it as something like TYPES.PD_WORKSHOP. If we wanted that, we could use a hash of symbol keys instead of constants? Would this be preferable?

TYPES = {
  pd_workshop: 'pd_workshop'
}

# referenced by
TYPES[:pd_workshop]

@aoby aoby force-pushed the pd-workshop-join-section-confirmation branch from 2deb679 to 8bc1306 Compare July 19, 2016 20:39
@aoby

aoby commented Jul 19, 2016

Copy link
Copy Markdown
Contributor Author

Updated with PR feedback and fixed the failing tests. PTAL

@breville

Copy link
Copy Markdown
Member

Second commit lgtm

@aoby aoby merged commit 7b5f359 into staging Jul 19, 2016
@aoby aoby deleted the pd-workshop-join-section-confirmation branch July 19, 2016 22:58
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.

4 participants