Skip to content

Commit

Permalink
Updated name fields to first name and last name in profile page, closes
Browse files Browse the repository at this point in the history
  • Loading branch information
fjalili committed Jul 30, 2019
1 parent b8500b0 commit ead57b7
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 17 deletions.
2 changes: 1 addition & 1 deletion src/components/UsersForm.vue
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@
<input
type="text"
class="light-primary-input disabled"
v-model="user.firstNamer"
v-model="user.firstName"
readonly
>
</div>
Expand Down
33 changes: 18 additions & 15 deletions src/pages/Profile.vue
Original file line number Diff line number Diff line change
Expand Up @@ -42,32 +42,35 @@
<div class="inputs">
<div class="input-container">
<label
for="title"
for="firstName"
class="label"
>{{ casMemberMetadata.fields.title.label }}</label>
>{{ casMemberMetadata.fields.firstName.label }}</label>
<input
type="text"
id="title"
class="light-primary-input disabled"
v-model.trim="member.title"
readonly
id="firstName"
class="light-primary-input"
v-model.trim="member.firstName"
>
<validation-message
:validation="$v.member.firstName"
:metadata="casMemberMetadata.fields.firstName"
/>
</div>
<div class="input-container">
<label
for="name"
for="lastName"
class="label"
>{{ casMemberMetadata.fields.name.label }}</label>
>{{ casMemberMetadata.fields.lastName.label }}</label>
<input
type="text"
id="name"
id="lastName"
class="light-primary-input"
v-model.trim="member.name"
@input="$v.member.name.$touch"
v-model.trim="member.lastName"
@input="$v.member.lastName.$touch"
>
<validation-message
:validation="$v.member.name"
:metadata="casMemberMetadata.fields.name"
:validation="$v.member.lastName"
:metadata="casMemberMetadata.fields.lastName"
/>
</div>
<div class="input-container">
Expand Down Expand Up @@ -127,8 +130,8 @@ export default {
validations () {
return {
member: {
title: this.casMemberMetadata.fields.title.createValidator(),
name: this.casMemberMetadata.fields.name.createValidator(),
firstName: this.casMemberMetadata.fields.firstName.createValidator(),
lastName: this.casMemberMetadata.fields.lastName.createValidator(),
email: this.casMemberMetadata.fields.email.createValidator()
}
}
Expand Down
2 changes: 1 addition & 1 deletion src/store.js
Original file line number Diff line number Diff line change
Expand Up @@ -2895,7 +2895,7 @@ export default new Vuex.Store({
class Member extends casServer.metadata.models.Member {
prepareForSubmit (verb, url, data) {
if (verb === this.constructor.__verbs__.update) {
let allowedFields = ['name']
let allowedFields = ['firstName', 'lastName']
for (let field in data) {
if (!allowedFields.includes(field)) {
delete data[field]
Expand Down

0 comments on commit ead57b7

Please sign in to comment.