feat: add password requirements validation and indicators in ChangePasswordModal and DetailUser components

This commit is contained in:
2025-10-14 15:42:28 +07:00
parent eb90d89e0e
commit 9f6cb66c37
4 changed files with 214 additions and 27 deletions

View File

@@ -50,7 +50,13 @@ const getRoleColor = (role_name, role_level) => {
return 'default';
};
const columns = (showPreviewModal, showEditModal, showDeleteDialog, showApproveDialog, showChangePasswordModal) => [
const columns = (
showPreviewModal,
showEditModal,
showDeleteDialog,
showApproveDialog,
showChangePasswordModal
) => [
{
title: 'ID',
dataIndex: 'user_id',
@@ -257,7 +263,7 @@ const ListUser = memo(function ListUser(props) {
icon: 'question',
title: 'Konfirmasi',
message: 'Apakah anda yakin hapus user "' + param.user_fullname + '" ?',
onConfirm: () => handleDelete(param.user_id),
onConfirm: () => handleDelete(param.user_id, param.user_fullname),
onCancel: () => props.setSelectedData(null),
});
};
@@ -285,14 +291,14 @@ const ListUser = memo(function ListUser(props) {
}
};
const handleDelete = async (user_id) => {
const handleDelete = async (user_id, user_fullname) => {
const response = await deleteUser(user_id);
if (response.statusCode == 200) {
NotifAlert({
icon: 'success',
title: 'Berhasil',
message: 'User "' + response.data.user_fullname + '" berhasil dihapus.',
message: 'User "' + user_fullname + '" berhasil dihapus.',
});
doFilter();
} else {