Skip to content

Commit

Permalink
Proper error message and group order fix in select
Browse files Browse the repository at this point in the history
Signed-off-by: John Molakvoæ (skjnldsv) <[email protected]>
  • Loading branch information
skjnldsv committed May 16, 2018
1 parent e23e28b commit 746f3c9
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 6 deletions.
4 changes: 2 additions & 2 deletions settings/js/main.js

Large diffs are not rendered by default.

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

Large diffs are not rendered by default.

4 changes: 3 additions & 1 deletion settings/src/components/userList.vue
Original file line number Diff line number Diff line change
Expand Up @@ -183,7 +183,9 @@ export default {
},
groups() {
// data provided php side + remove the disabled group
return this.$store.getters.getGroups.filter(group => group.id !== 'disabled');
return this.$store.getters.getGroups
.filter(group => group.id !== 'disabled')
.sort((a, b) => a.name.localeCompare(b.name));
},
subAdminsGroups() {
// data provided php side
Expand Down
6 changes: 4 additions & 2 deletions settings/src/store/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,11 @@ const debug = process.env.NODE_ENV !== 'production';

const mutations = {
API_FAILURE(state, error) {
OC.Notification.showTemporary(t('settings','An error occured during the request. Unable to proceed.'));
let message = error.error.response.data.ocs.meta.message;
OC.Notification.showHtml(t('settings','An error occured during the request. Unable to proceed.')+'<br>'+message, {timeout: 7});
// throw to raise exception of the promise and allow a `.then` in the Vue methods
throw error;
console.log(state, error);
throw new Error(error);
}
};

Expand Down

0 comments on commit 746f3c9

Please sign in to comment.