- Add grant check (46, 'X') to password change navigation handlers - Add grant check (45, 'X') to user management save/add operations - Add grant check (64, 'X') to QNA registration - Refactor inline onClick handlers to separate methods for better maintainability - Add debug logging to checkGrant function Changes: - password-manage-wrap: Extract changeLoginPassword and changeCancelPassword methods - user-account-auth-wrap: Extract handleSave method with permission check - user-login-auth-info-wrap: Add permission check to handleSave - user-manage-wrap: Add permission check to onClickToNavigation, simplify onClick - qna/register-page: Add permission check to onClickToRegisterQna 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
47 lines
1.3 KiB
TypeScript
47 lines
1.3 KiB
TypeScript
import { useTranslation } from 'react-i18next';
|
|
import { PATHS } from '@/shared/constants/paths';
|
|
import { useNavigate } from '@/shared/lib/hooks/use-navigate';
|
|
import { checkGrant } from '@/shared/lib/check-grant';
|
|
import { showAlert } from '@/widgets/show-alert';
|
|
|
|
export const PasswordManageWrap = () => {
|
|
const { t } = useTranslation();
|
|
const { navigate } = useNavigate();
|
|
|
|
const changeLoginPassword = () => {
|
|
if (!checkGrant(46, 'X')) {
|
|
showAlert(t('common.nopermission'));
|
|
return;
|
|
}
|
|
navigate(PATHS.account.password.modifyLoginPassword);
|
|
};
|
|
|
|
const changeCancelPassword = () => {
|
|
if (!checkGrant(46, 'X')) {
|
|
showAlert(t('common.nopermission'));
|
|
return;
|
|
}
|
|
navigate(PATHS.account.password.modifyCancelPassword);
|
|
};
|
|
|
|
return (
|
|
<>
|
|
<div className="ing-list">
|
|
<div className="pwd-manage mt-20">
|
|
<div className="pwd-buttons">
|
|
<button
|
|
className="btn-44 btn-white pwd-btn"
|
|
type="button"
|
|
onClick={changeLoginPassword}
|
|
>{t('account.changeLoginPassword')}</button>
|
|
<button
|
|
className="btn-44 btn-white pwd-btn"
|
|
type="button"
|
|
onClick={changeCancelPassword}
|
|
>{t('account.changeCancelPassword')}</button>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</>
|
|
)
|
|
}; |