Skip to content

Commit

Permalink
Merge pull request #230 from DependencyTrack/issue-1651
Browse files Browse the repository at this point in the history
  • Loading branch information
nscuro authored Jan 29, 2025
2 parents 4f608b2 + b0dfc8f commit 8c95775
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 15 deletions.
36 changes: 21 additions & 15 deletions src/views/administration/accessmanagement/ManagedUsers.vue
Original file line number Diff line number Diff line change
Expand Up @@ -288,25 +288,31 @@ export default {
},
updatePermissionSelection: function (selections) {
this.$root.$emit('bv::hide::modal', 'selectPermissionModal');
let updatePromise = Promise.resolve();
for (let i = 0; i < selections.length; i++) {
let selection = selections[i];
let url = `${this.$api.BASE_URL}/${this.$api.URL_PERMISSION}/${selection.name}/user/${this.username}`;
this.axios
.post(url)
.then((response) => {
updatePromise = updatePromise.then((response) => {
if (response && response.data) {
this.syncVariables(response.data);
this.$toastr.s(this.$t('message.updated'));
})
.catch((error) => {
if (error.response.status === 304) {
//this.$toastr.w(this.$t('condition.unsuccessful_action'));
} else {
this.$toastr.w(
this.$t('condition.unsuccessful_action'),
);
}
});
}
return this.axios.post(url);
});
}
updatePromise
.then((response) => {
if (response && response.data) {
this.syncVariables(response.data);
}
this.$toastr.s(this.$t('message.updated'));
})
.catch((error) => {
if (error.response.status === 304) {
//this.$toastr.w(this.$t('condition.unsuccessful_action'));
} else {
this.$toastr.w(this.$t('condition.unsuccessful_action'));
}
});
},
removePermission: function (permission) {
let url = `${this.$api.BASE_URL}/${this.$api.URL_PERMISSION}/${permission.name}/user/${this.username}`;
Expand All @@ -316,7 +322,7 @@ export default {
this.syncVariables(response.data);
this.$toastr.s(this.$t('message.updated'));
})
.catch((error) => {
.catch(() => {
this.$toastr.w(this.$t('condition.unsuccessful_action'));
});
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,7 @@ export default {
queryParamsType: 'pageSize',
pageList: '[10, 25, 50, 100]',
pageSize: 10,
maintainMetaData: true,
icons: {
refresh: 'fa-refresh',
},
Expand Down

0 comments on commit 8c95775

Please sign in to comment.