Skip to content

Commit

Permalink
Set display name (if specified) when a new user is created
Browse files Browse the repository at this point in the history
Although the form to create a new user included a field to set the
display name its value was not taken into account, so the new user ended
with the default display name (the same as the user name).

Signed-off-by: Daniel Calviño Sánchez <danxuliu@gmail.com>
  • Loading branch information
danxuliu committed Jul 31, 2018
1 parent 36326e3 commit ab6688f
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 12 deletions.
16 changes: 8 additions & 8 deletions settings/js/settings-vue.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion settings/js/settings-vue.js.map

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions settings/src/components/userList.vue
Original file line number Diff line number Diff line change
Expand Up @@ -324,6 +324,7 @@ export default {
this.$store.dispatch('addUser', {
userid: this.newUser.id,
password: this.newUser.password,
displayName: this.newUser.displayName,
email: this.newUser.mailAddress,
groups: this.newUser.groups.map(group => group.id),
subadmin: this.newUser.subAdminsGroups.map(group => group.id),
Expand Down
7 changes: 4 additions & 3 deletions settings/src/store/users.js
Original file line number Diff line number Diff line change
Expand Up @@ -415,16 +415,17 @@ const actions = {
* @param {Object} context
* @param {Object} options
* @param {string} options.userid User id
* @param {string} options.password User password
* @param {string} options.password User password
* @param {string} options.displayName User display name
* @param {string} options.email User email
* @param {string} options.groups User groups
* @param {string} options.subadmin User subadmin groups
* @param {string} options.quota User email
* @returns {Promise}
*/
addUser({commit, dispatch}, { userid, password, email, groups, subadmin, quota, language }) {
addUser({commit, dispatch}, { userid, password, displayName, email, groups, subadmin, quota, language }) {
return api.requireAdmin().then((response) => {
return api.post(OC.linkToOCS(`cloud/users`, 2), { userid, password, email, groups, subadmin, quota, language })
return api.post(OC.linkToOCS(`cloud/users`, 2), { userid, password, displayName, email, groups, subadmin, quota, language })
.then((response) => dispatch('addUserData', userid))
.catch((error) => {throw error;});
}).catch((error) => commit('API_FAILURE', { userid, error }));
Expand Down

0 comments on commit ab6688f

Please sign in to comment.