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

Allow hotlink to organization-specific sign-up form #2898

Merged
merged 8 commits into from
Jul 19, 2018
Merged

Conversation

philippotto
Copy link
Member

@philippotto philippotto commented Jul 16, 2018

URL of deployed dev instance (used for testing):

Steps to test:

  • use the registration form as normal

  • visit users list and click on "invite users" button to copy the shown url
  • use the url to create a new account (the organization should not be visible in the form as its pre-defined via the url)
  • ensure the account was created for the correct organization

  • visit /onboarding to create a new organization (use a name with spaces and some special characters, such as "#")
  • in the last step, click the "invite users" button, copy the link and follow the steps from above for sign-up

Issues:

Screenshots

image

image

image


@philippotto philippotto changed the title Signuphotlink Allow hotlink to organization-specific sign-up form Jul 16, 2018
Copy link
Member

@daniel-wer daniel-wer left a comment

Choose a reason for hiding this comment

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

Very nice and clean :) I like your solution with the popover for the registration link 👍

onRegistered={() => {
Toast.success(messages["auth.account_created"]);
this.props.history.push("/auth/login");
}}
onOrganizationNameNotFound={() => {
Toast.error(messages["auth.invalid_organization_name"]);
this.props.history.push("/auth/register");
Copy link
Member

Choose a reason for hiding this comment

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

In my understanding this error can only be triggered if the user already is on the register page. So I'd say there's no need to push this to the history.

Copy link
Member Author

@philippotto philippotto Jul 16, 2018

Choose a reason for hiding this comment

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

Hm, I'm not sure I get what you mean. If this error happens, the user is on /auth/register?organizationName=someInvalidOrgName. Then, he should be redirected to /auth/register, so that the dropdown appears again. Or do you mean that something like history.replace should be used?

Copy link
Member

Choose a reason for hiding this comment

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

No, you're right. I didn't get that this line was being used to "get rid" of the organizationName url parameter :)

.substring(1)
.split("&")
.reduce((result, value): void => {
.reduce((result: UrlParamsType, value: string): UrlParamsType => {
Copy link
Member

Choose a reason for hiding this comment

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

👍

<Route
path="/auth/register"
render={({ location }: ContextRouter) => {
const params = Utils.getUrlParamsObjectFromString(location.search);
Copy link
Member

Choose a reason for hiding this comment

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

Why did you split up this method in the utils module, but then you're calling it with location.search anyways? Couldn't you use the original method then? Maybe I'm missing something here!

Copy link
Member Author

Choose a reason for hiding this comment

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

location is here passed from the router (see line 351). window.location might have worked here, too, but to be precise, I used the value passed by react-router :)

Copy link
Member

Choose a reason for hiding this comment

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

Ah I see, now it makes sense :)

@philippotto philippotto merged commit 461edbf into master Jul 19, 2018
@philippotto philippotto deleted the signuphotlink branch August 13, 2018 11:42
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.

Hidden sign up page
2 participants