Merge pull request #5207 from artoscinote/ma_SCI_8131

Add error flash when assignment update fails [SCI-8131]
This commit is contained in:
Alex Kriuchykhin 2023-03-27 12:43:40 +02:00 committed by GitHub
commit 2bcb9d0639
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 11 additions and 1 deletions

View file

@ -1,3 +1,5 @@
/* global HelperModule */
(function() {
'use strict';
@ -46,6 +48,10 @@
$('.user-assignments-modal').modal('show');
});
$(document).on('ajax:error', 'form.member-item', function(_e, data) {
HelperModule.flashAlertMsg(data.responseJSON.flash, 'danger');
});
$(document).on('click', '.user-assignment-dropdown .user-role-selector', function() {
let roleId = $(this).data('role-id');
$(this).closest('.dropdown').find('#user_assignment_user_role_id, .default-public-user-role-id').val(roleId);

View file

@ -10,7 +10,7 @@
position: fixed;
top: 0;
width: 100%;
z-index: 1100;
z-index: 3000;
.alert-floating {
align-items: center;

View file

@ -55,6 +55,8 @@ module AccessPermissions
render :project_member
end
end
rescue ActiveRecord::RecordInvalid
render json: { flash: t('access_permissions.update.failure') }, status: :unprocessable_entity
end
def create

View file

@ -51,6 +51,8 @@ module AccessPermissions
render :protocol_member
end
end
rescue ActiveRecord::RecordInvalid
render json: { flash: t('access_permissions.update.failure') }, status: :unprocessable_entity
end
def create