Small fixes from the todo list
This commit is contained in:
parent
107a439e44
commit
f0dc84e3ba
|
@ -1,4 +1,4 @@
|
|||
import React, { useContext, useState } from "react";
|
||||
import React, { useContext, useState, KeyboardEvent } from "react";
|
||||
import { Alert, CircularProgress, Grid, useTheme } from "@mui/material";
|
||||
import Container from "@mui/material/Container";
|
||||
import { axiosConfigWithoutToken } from "./config/axiosConfig";
|
||||
|
@ -31,6 +31,12 @@ const Login = ({ setToken, setLanguage }: I_LoginProps) => {
|
|||
params: { authToken: token },
|
||||
});
|
||||
};
|
||||
const handleKeypress = (e: KeyboardEvent) => {
|
||||
//it triggers by pressing the enter key
|
||||
if (e.keyCode === 13) {
|
||||
handleSubmit();
|
||||
}
|
||||
};
|
||||
|
||||
const handleSubmit = () => {
|
||||
setLoading(true);
|
||||
|
@ -68,7 +74,7 @@ const Login = ({ setToken, setLanguage }: I_LoginProps) => {
|
|||
</Grid>
|
||||
</Grid>
|
||||
</Container>
|
||||
<Container maxWidth="sm" sx={{ p: 2, alignContent: "center" }}>
|
||||
<Container maxWidth="sm" sx={{ p: 2, alignContent: "center" }} onKeyDown={handleKeypress}>
|
||||
<InnovenergyTextfield
|
||||
id="username-textfield"
|
||||
label="Username"
|
||||
|
|
|
@ -121,7 +121,7 @@ const InstallationList = (props: InstallationListProps) => {
|
|||
} else if (data.length === 0) {
|
||||
return (
|
||||
<Alert severity="info" sx={{ mt: 1 }}>
|
||||
<FormattedMessage id="noData" defaultMessage="No data found" />
|
||||
<FormattedMessage id="noData" defaultMessage="No installations matching your search found" />
|
||||
</Alert>
|
||||
);
|
||||
}
|
||||
|
|
|
@ -40,6 +40,7 @@ const UserForm = (props: I_UserFormProps) => {
|
|||
email: values ? values.email : "",
|
||||
information: values ? values.information : "",
|
||||
name: values ? values.name : "",
|
||||
mustResetPassword: values ? true:false,
|
||||
},
|
||||
onSubmit: (formikValues) => {
|
||||
setLoading(true);
|
||||
|
@ -95,6 +96,18 @@ const UserForm = (props: I_UserFormProps) => {
|
|||
handleChange: formik.handleChange,
|
||||
disabled: readOnly,
|
||||
},
|
||||
// This does not work as each field must be a textfield, great....
|
||||
// {
|
||||
// id: "mustResetPassword-checkbox",
|
||||
// label: intl.formatMessage({
|
||||
// id: "mustResetPassword",
|
||||
// defaultMessage: "Must reset password",
|
||||
// }),
|
||||
// name: "mustResetPassword",
|
||||
// checked:formik.values.mustResetPassword,
|
||||
// handleChange: formik.handleChange,
|
||||
// disabled: readOnly,
|
||||
// },
|
||||
];
|
||||
|
||||
return (
|
||||
|
|
|
@ -90,7 +90,7 @@ const UserList = (props: I_UserListProps) => {
|
|||
} else if (filteredData?.length === 0) {
|
||||
return (
|
||||
<Alert severity="info" sx={{ mt: 1 }}>
|
||||
<FormattedMessage id="noData" defaultMessage="No data found" />
|
||||
<FormattedMessage id="noData" defaultMessage="No users matching your search found" />
|
||||
</Alert>
|
||||
);
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue