-
Notifications
You must be signed in to change notification settings - Fork 10
Register Hub CE #141
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
base: develop
Are you sure you want to change the base?
Register Hub CE #141
Changes from all commits
3078b9f
4054f2b
d0e488e
18c81ca
20e195c
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| @@ -0,0 +1,112 @@ | ||||||||||||||||||||||
| "use strict"; | ||||||||||||||||||||||
|
|
||||||||||||||||||||||
| // requires newsletter.js | ||||||||||||||||||||||
| const VERIFY_EMAIL_URL = API_BASE_URL + '/connect/email/verify'; | ||||||||||||||||||||||
| const REFRESH_LICENSE_URL = API_BASE_URL + '/licenses/hub/refresh'; | ||||||||||||||||||||||
|
|
||||||||||||||||||||||
| class HubCE { | ||||||||||||||||||||||
|
|
||||||||||||||||||||||
| constructor(form, feedbackData, submitData, searchParams) { | ||||||||||||||||||||||
| this._form = form; | ||||||||||||||||||||||
| this._feedbackData = feedbackData; | ||||||||||||||||||||||
| this._submitData = submitData; | ||||||||||||||||||||||
| this._searchParams = searchParams; | ||||||||||||||||||||||
| this._submitData.oldLicense = searchParams.get('oldLicense'); | ||||||||||||||||||||||
|
|
||||||||||||||||||||||
| // continue after email verified: | ||||||||||||||||||||||
| if (searchParams.get('verifiedEmail')) { | ||||||||||||||||||||||
| feedbackData.currentStep = 1; | ||||||||||||||||||||||
| feedbackData.emailVerified = true; | ||||||||||||||||||||||
| } | ||||||||||||||||||||||
| } | ||||||||||||||||||||||
|
|
||||||||||||||||||||||
| submit() { | ||||||||||||||||||||||
| if (this._feedbackData.currentStep === 0) { | ||||||||||||||||||||||
| this.validateEmail(); | ||||||||||||||||||||||
| } else if (this._feedbackData.currentStep === 1) { | ||||||||||||||||||||||
| this.sendConfirmationEmail(); | ||||||||||||||||||||||
| } else if (this._feedbackData.currentStep === 2) { | ||||||||||||||||||||||
| this.getHubLicense(); | ||||||||||||||||||||||
| } | ||||||||||||||||||||||
| } | ||||||||||||||||||||||
|
|
||||||||||||||||||||||
| validateEmail() { | ||||||||||||||||||||||
| if (!$(this._form)[0].checkValidity()) { | ||||||||||||||||||||||
| $(this._form).find(':input').addClass('show-invalid'); | ||||||||||||||||||||||
| this._feedbackData.errorMessage = 'Please fill in all required fields.'; | ||||||||||||||||||||||
| return; | ||||||||||||||||||||||
| } | ||||||||||||||||||||||
|
||||||||||||||||||||||
| } | |
| } | |
| // Ensure oldLicense is present before allowing progression. | |
| const oldLicense = this._submitData.oldLicense; | |
| if (!oldLicense) { | |
| this._feedbackData.inProgress = false; | |
| this._feedbackData.errorMessage = 'License information is missing. Please open this page using the link provided in your email.'; | |
| return; | |
| } |
| Original file line number | Diff line number | Diff line change | ||||||
|---|---|---|---|---|---|---|---|---|
| @@ -0,0 +1,5 @@ | ||||||||
| --- | ||||||||
| title: "Cryptomator Hub: Registrieren" | ||||||||
| url: "/de/hub/register" | ||||||||
| type: "hub-register" | ||||||||
|
||||||||
| type: "hub-register" | |
| type: "hub-register" | |
| draft: true |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,5 @@ | ||
| --- | ||
| title: "Cryptomator Hub: Register" | ||
| url: "/hub/register" | ||
| type: "hub-register" | ||
| --- |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Unused class HubCE.