🔧 chore(Makefile): remove unnecessary semicolon in 'install_frontend' and 'install_frontendc' targets
🔧 chore(Makefile): remove unnecessary 'rm' command in 'install_frontendc' target ✨ feat(App.tsx): set user data in state when auto-login is triggered to ensure consistent user experience 🔧 chore(UserManagementModal/index.tsx): rename 'isDisabled' state variable to 'isActive' for clarity 🔧 chore(UserManagementModal/index.tsx): rename 'isDisabled' prop and label to 'Active' for clarity 🔧 chore(UserManagementModal/index.tsx): rename 'isDisabled' state variable to 'isActive' in handleInput function 🔧 chore(AdminPage/index.tsx): rename 'confirmationText' prop from 'Edit' to 'Save' for clarity
This commit is contained in:
parent
b319b909e4
commit
76c4d4afe7
4 changed files with 10 additions and 9 deletions
4
Makefile
4
Makefile
|
|
@ -32,10 +32,10 @@ lint:
|
|||
poetry run ruff . --fix
|
||||
|
||||
install_frontend:
|
||||
cd src/frontend && npm install;
|
||||
cd src/frontend && npm install
|
||||
|
||||
install_frontendc:
|
||||
cd src/frontend && rm -rf node_modules package-lock.json && npm install;
|
||||
cd src/frontend && rm -rf node_modules package-lock.json && npm install
|
||||
|
||||
run_frontend:
|
||||
cd src/frontend && npm start
|
||||
|
|
|
|||
|
|
@ -143,6 +143,7 @@ export default function App() {
|
|||
if(user && user['access_token']){
|
||||
user['refresh_token'] = "auto";
|
||||
login(user['access_token'], user['refresh_token']);
|
||||
setUserData(user);
|
||||
setAutoLogin(true);
|
||||
setLoading(false);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -31,7 +31,7 @@ export default function UserManagementModal({
|
|||
const [password, setPassword] = useState(data?.password ?? "");
|
||||
const [username, setUserName] = useState(data?.username ?? "");
|
||||
const [confirmPassword, setConfirmPassword] = useState(data?.password ?? "");
|
||||
const [isDisabled, setIsDisabled] = useState(data?.is_active ?? false);
|
||||
const [isActive, setIsActive] = useState(data?.is_active ?? false);
|
||||
const [isSuperUser, setIsSuperUser] = useState(data?.is_superuser ?? false);
|
||||
const [inputState, setInputState] = useState<UserInputType>(CONTROL_NEW_USER);
|
||||
const { userData } = useContext(AuthContext);
|
||||
|
|
@ -47,7 +47,7 @@ export default function UserManagementModal({
|
|||
resetForm();
|
||||
} else {
|
||||
handleInput({ target: { name: "username", value: username } });
|
||||
handleInput({ target: { name: "is_active", value: isDisabled } });
|
||||
handleInput({ target: { name: "is_active", value: isActive } });
|
||||
handleInput({ target: { name: "is_superuser", value: isSuperUser } });
|
||||
}
|
||||
}, [open]);
|
||||
|
|
@ -230,17 +230,17 @@ export default function UserManagementModal({
|
|||
<Form.Field name="is_active">
|
||||
<div>
|
||||
<Form.Label className="data-[invalid]:label-invalid mr-3">
|
||||
Disabled
|
||||
Active
|
||||
</Form.Label>
|
||||
<Form.Control asChild>
|
||||
<Checkbox
|
||||
value={isDisabled}
|
||||
checked={isDisabled}
|
||||
value={isActive}
|
||||
checked={isActive}
|
||||
id="is_active"
|
||||
className="relative top-0.5"
|
||||
onCheckedChange={(value) => {
|
||||
handleInput({ target: { name: "is_active", value } });
|
||||
setIsDisabled(value);
|
||||
setIsActive(value);
|
||||
}}
|
||||
/>
|
||||
</Form.Control>
|
||||
|
|
|
|||
|
|
@ -362,7 +362,7 @@ export default function AdminPage() {
|
|||
title="Edit"
|
||||
titleHeader={`${user.id}`}
|
||||
cancelText="Cancel"
|
||||
confirmationText="Edit"
|
||||
confirmationText="Save"
|
||||
icon={"UserPlus2"}
|
||||
data={user}
|
||||
index={index}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue