[user_accounts] to add SweetAlert2 reject user #10475
Open
priyavrat7 wants to merge 3 commits intoaces:mainfrom
Open
[user_accounts] to add SweetAlert2 reject user #10475priyavrat7 wants to merge 3 commits intoaces:mainfrom
priyavrat7 wants to merge 3 commits intoaces:mainfrom
Conversation
rejectUser.js was a plain jQuery script that fired the rejection AJAX call immediately on click with no confirmation. This converts it to a webpack-compiled module and adds a swal.fire() confirmation dialog before the action, consistent with the pattern used in other LORIS modules. Changes: - Add jsx/rejectUser.js: new source with swal.fire() confirmation - Compile to js/rejectUser.js: replace old jQuery with webpack bundle - webpack.config.ts: register rejectUser as entry point for user_accounts - Updated .gitignore, to be structurally correct and to prevent any future tracking issues
jeffersoncasimir
requested changes
Apr 28, 2026
Contributor
jeffersoncasimir
left a comment
There was a problem hiding this comment.
You should have either the .js + .gitignore exception or the .jsx + webpack change; not both.
… add swal confirmation. Previously rejectUser.js was a plain jQuery script in /modules/js that fired the rejection AJAX call immediately on click with no confirmation. This converts it to a webpack-compiled module and adds a swal.fire() confirmation dialog before the action, consistent with the pattern used in other LORIS modules. Changes: - Add jsx/rejectUser.js: new source with swal.fire() confirmation - webpack.config.ts: register rejectUser as entry point for user_accounts
09203bb to
c419a66
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Situation:
In the LORIS
user_accountsmodule (edit_userinterface), clicking the "Reject User" button triggers an immediate AJAX call to reject the account. There is no confirmation dialog, making it extremely easy for an administrator to accidentally reject a user with a misclick.Task:
My objective was to introduce a confirmation step before executing the rejection AJAX call, ensuring a better and safer user experience. The implementation needed to adhere strictly to modern LORIS framework standards, specifically utilizing the SweetAlert2 library.
Action:
modules/user_accounts/js/rejectUser.jsinto a modern proper source file atmodules/user_accounts/jsx/rejectUser.js.import swal from 'sweetalert2';) to implement aswal.fire()confirmation modal with a 'warning' type, standardizing the UI with other LORIS modules.rejectUserfile inwebpack.config.tsunder theuser_accountsentry.npm run compile, resulting in a self-contained Webpack JS bundle that replaces the old jQuery file..gitignoreto prevent future tracking conflicts.Result:
Administrators can now see SweetAlert2 warning dialog when attempting to reject a user. The AJAX call is correctly blocked until the user explicitly clicks "Yes, reject user!", completely preventing accidental rejections and fixes #10474.