Skip to content

Commit

Permalink
Merge branch 'release/1.2.8'
Browse files Browse the repository at this point in the history
  • Loading branch information
adufr committed Dec 12, 2019
2 parents 5681d45 + eca19c2 commit fdcbe3f
Show file tree
Hide file tree
Showing 6 changed files with 14 additions and 7 deletions.
2 changes: 1 addition & 1 deletion package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "calendz-front",
"version": "1.2.7",
"version": "1.2.8",
"private": true,
"scripts": {
"serve": "vue-cli-service serve",
Expand Down
3 changes: 1 addition & 2 deletions src/components/Inputs/custom/GradeSelect.vue
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,7 @@
<option
v-for="(option, index) in options"
:key="index"
:label="option.value"
:value="option.value"/>
:value="option.value">{{ option.value }}</option>
</select>
</base-input>
</div>
Expand Down
2 changes: 1 addition & 1 deletion src/plugins/veeCustom/customValidators.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { Validator } from 'vee-validate'

Validator.extend('email_valid_school', {
validate: value => value.includes('@epsi.fr') || value.includes('@wis.fr')
validate: value => value.includes('@epsi.fr') || value.includes('@wis.fr') || value.includes('@etudes-wis.net')
})

Validator.extend('contains_one_number', {
Expand Down
6 changes: 5 additions & 1 deletion src/views/Pages/Auth/Register.vue
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@

<GradeSelect
v-model="registerForm.grade"
:school="registerForm.email.includes('@epsi.fr') ? 'EPSI' : registerForm.email.includes('@wis.fr') ? 'WIS' : ''"
:school="registerForm.email ? guessSchoolFromEmail(registerForm.email) : ''"
:disabled="!registerForm.email"/>

<GroupsSelect
Expand Down Expand Up @@ -227,6 +227,10 @@ export default {
}
})
},
guessSchoolFromEmail (email) {
if (email.includes('@epsi.fr')) return 'EPSI'
if (email.includes('@wis.fr') || email.includes('@etudes-wis.net')) return 'WIS'
},
showAlert (title) {
swal({
title,
Expand Down
6 changes: 5 additions & 1 deletion src/views/Pages/Dashboard/Admin/UserManagement.vue
Original file line number Diff line number Diff line change
Expand Up @@ -282,7 +282,7 @@
<div class="col-md-6">
<GradeSelect
v-model="modifyForm.grade"
:school="modifyForm.email && modifyForm.email.includes('@epsi.fr') ? 'EPSI' : modifyForm.email && modifyForm.email.includes('@wis.fr') ? 'WIS' : ''"
:school="modifyForm.email ? guessSchoolFromEmail(modifyForm.email) : ''"
:disabled="false"
label="Classe"/>
</div>
Expand Down Expand Up @@ -525,6 +525,10 @@ export default {
})
}
})
},
guessSchoolFromEmail (email) {
if (email.includes('@epsi.fr')) return 'EPSI'
if (email.includes('@wis.fr') || email.includes('@etudes-wis.net')) return 'WIS'
}
}
}
Expand Down

0 comments on commit fdcbe3f

Please sign in to comment.