mirror of
https://github.com/scinote-eln/scinote-web.git
synced 2025-10-26 22:16:28 +08:00
Merge pull request #5207 from artoscinote/ma_SCI_8131
Add error flash when assignment update fails [SCI-8131]
This commit is contained in:
commit
2bcb9d0639
4 changed files with 11 additions and 1 deletions
|
|
@ -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);
|
||||
|
|
|
|||
|
|
@ -10,7 +10,7 @@
|
|||
position: fixed;
|
||||
top: 0;
|
||||
width: 100%;
|
||||
z-index: 1100;
|
||||
z-index: 3000;
|
||||
|
||||
.alert-floating {
|
||||
align-items: center;
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue