Skip to content

Commit

Permalink
Remove phone number from sign up and make optional on request demo form
Browse files Browse the repository at this point in the history
  • Loading branch information
shubhi1092 committed May 21, 2018
1 parent e73ab4d commit 34f0b81
Show file tree
Hide file tree
Showing 6 changed files with 9 additions and 28 deletions.
13 changes: 1 addition & 12 deletions app/templates/core/create-account-modal/teacher-role-panel.jade
@@ -1,24 +1,13 @@
div.school-info-panel.text-left
.row
.col-xs-offset-3.col-xs-6
.form-group(v-bind:class="{ 'has-error': showRequired && (!phoneNumber || !validPhoneNumber) }")
span.control-label
| {{ $t("teachers_quote.phone_number") }}
=" "
strong(v-if="showRequired && !phoneNumber") {{ $t("common.required_field") }}
input.form-control(
v-bind:placeholder="$t('teachers_quote.phone_number_help')"
v-model="phoneNumber"
ref='focus'
name="phoneNumber"
)

.form-group(v-bind:class="{ 'has-error': showRequired && !role }")
span.control-label
| {{ $t("teachers_quote.primary_role_label") }}
=" "
strong(v-if="showRequired && !role") {{ $t("common.required_field") }}
select.form-control(v-model="role", name="role")
select.form-control(v-model="role", name="role", ref='focus')
option(value='') {{ $t("teachers_quote.primary_role_default") }}
option(value="Teacher") {{ $t("courses.teacher") }}
option(value="Technology coordinator") {{ $t("teachers_quote.tech_coordinator") }}
Expand Down
7 changes: 1 addition & 6 deletions app/templates/teachers/create-teacher-account-view.jade
Expand Up @@ -90,13 +90,8 @@ block content
input.form-control(name="password2", type="password")

.row.m-y-2
.col-md-offset-2.col-md-4.col-sm-6
.form-group
span.control-label
span(data-i18n="teachers_quote.phone_number")
input.form-control(name="phoneNumber", data-i18n="[placeholder]teachers_quote.phone_number_help")

.col-md-4.col-sm-6
.col-md-offset-2.col-md-4.col-sm-6
.form-group
span.control-label(data-i18n="teachers_quote.primary_role_label")
select.form-control(name="role")
Expand Down
2 changes: 2 additions & 0 deletions app/templates/teachers/request-quote-view.jade
Expand Up @@ -89,6 +89,7 @@ block content
.col-md-offset-2.col-md-4.col-sm-6
.form-group
span.control-label(data-i18n="teachers_quote.phone_number")
span.spl.text-muted(data-i18n="signup.optional")
input.form-control(name="phoneNumber", data-i18n="[placeholder]teachers_quote.phone_number_help")

if me.isAnonymous()
Expand Down Expand Up @@ -116,6 +117,7 @@ block content
.form-group
span.control-label
span(data-i18n="teachers_quote.phone_number")
span.spl.text-muted(data-i18n="signup.optional")
.help-block.small
em.text-info(data-i18n="teachers_quote.phone_number_help")
input.form-control(name="phoneNumber")
Expand Down
Expand Up @@ -5,7 +5,6 @@ TeacherRolePanel = Vue.extend
template: require('templates/core/create-account-modal/teacher-role-panel')()
data: ->
formData = _.pick(@$store.state.modal.trialRequestProperties, [
'phoneNumber'
'role'
'numStudents'
'notes'
Expand All @@ -15,16 +14,12 @@ TeacherRolePanel = Vue.extend
showRequired: false
})

computed: {
validPhoneNumber: ->
return forms.validatePhoneNumber(@phoneNumber)
}
methods:
clickContinue: ->
# Make sure to add conditions if we change this to be used on non-teacher path
window.tracker?.trackEvent 'CreateAccountModal Teacher TeacherRolePanel Continue Clicked', category: 'Teachers'
requiredAttrs = _.pick(@, 'phoneNumber', 'role', 'numStudents')
unless _.all(requiredAttrs) and @validPhoneNumber
requiredAttrs = _.pick(@, 'role', 'numStudents')
unless _.all(requiredAttrs)
@showRequired = true
return
@commitValues()
Expand All @@ -37,7 +32,7 @@ TeacherRolePanel = Vue.extend
@$emit('back')

commitValues: ->
attrs = _.pick(@, 'phoneNumber', 'role', 'numStudents', 'notes', 'referrer')
attrs = _.pick(@, 'role', 'numStudents', 'notes', 'referrer')
@$store.commit('modal/updateTrialRequestProperties', attrs)

mounted: ->
Expand Down
2 changes: 1 addition & 1 deletion app/views/teachers/CreateTeacherAccountView.coffee
Expand Up @@ -447,7 +447,7 @@ module.exports = class CreateTeacherAccountView extends RootView

formSchema = {
type: 'object'
required: ['firstName', 'lastName', 'email', 'role', 'numStudents', 'numStudentsTotal', 'city', 'state', 'country', 'phoneNumber']
required: ['firstName', 'lastName', 'email', 'role', 'numStudents', 'numStudentsTotal', 'city', 'state', 'country']
properties:
password1: { type: 'string' }
password2: { type: 'string' }
Expand Down
2 changes: 1 addition & 1 deletion app/views/teachers/RequestQuoteView.coffee
Expand Up @@ -392,7 +392,7 @@ requestFormSchemaAnonymous = {
type: 'object'
required: [
'firstName', 'lastName', 'email', 'role', 'purchaserRole', 'numStudents',
'numStudentsTotal', 'phoneNumber', 'city', 'state', 'country']
'numStudentsTotal', 'city', 'state', 'country']
properties:
firstName: { type: 'string' }
lastName: { type: 'string' }
Expand Down

0 comments on commit 34f0b81

Please sign in to comment.