diff --git a/csharp/App/Backend/DbBackups/db.sqlite b/csharp/App/Backend/DbBackups/db.sqlite deleted file mode 100644 index 55d2bbbeb..000000000 Binary files a/csharp/App/Backend/DbBackups/db.sqlite and /dev/null differ diff --git a/csharp/App/Backend/Properties/launchSettings.json b/csharp/App/Backend/Properties/launchSettings.json index d04542990..c1c45c271 100644 --- a/csharp/App/Backend/Properties/launchSettings.json +++ b/csharp/App/Backend/Properties/launchSettings.json @@ -7,7 +7,7 @@ "dotnetRunMessages": true, "launchUrl": "swagger", - "applicationUrl": "https://localhost:8000", + "applicationUrl": "https://localhost:7087", "environmentVariables": { "ASPNETCORE_ENVIRONMENT": "Development" } diff --git a/typescript/Frontend/src/components/Layout/Checkmark.tsx b/typescript/Frontend/src/components/Layout/Checkmark.tsx new file mode 100644 index 000000000..4574d2323 --- /dev/null +++ b/typescript/Frontend/src/components/Layout/Checkmark.tsx @@ -0,0 +1,30 @@ +import UserProps from "./UserProps"; +import { Grid, InputLabel, TextField, Checkbox } from "@mui/material"; +import { I_InnovenergyTextfieldProps } from "./InnovenergyTextfield"; + +export type CheckmarkProps = UserProps & { + value:boolean; +} + + +const Checkmark = (props: CheckmarkProps) => { + return ( + + + {props.label} + + + + + + ); +}; + +export default CheckmarkProps; \ No newline at end of file diff --git a/typescript/Frontend/src/components/Layout/InnovenergyPropertyGrid.tsx b/typescript/Frontend/src/components/Layout/InnovenergyPropertyGrid.tsx index 8e12272ff..21992caac 100644 --- a/typescript/Frontend/src/components/Layout/InnovenergyPropertyGrid.tsx +++ b/typescript/Frontend/src/components/Layout/InnovenergyPropertyGrid.tsx @@ -1,11 +1,14 @@ -import { InputLabel, TextField } from "@mui/material"; +import {Checkbox, InputLabel, TextField} from "@mui/material"; import { colors } from "../../index"; import { I_InnovenergyTextfieldProps } from "./InnovenergyTextfield"; +import { CheckmarkProps } from "./Checkmark"; interface I_InnovenergyPropertyGridProps { - rows: I_InnovenergyTextfieldProps[]; + rows: Array; +} +function isTextfieldProps(type: I_InnovenergyTextfieldProps | CheckmarkProps): type is I_InnovenergyTextfieldProps{ + return typeof((type as I_InnovenergyTextfieldProps).value) === "string"; } - export const InnovenergyPropertyGrid = ( props: I_InnovenergyPropertyGridProps ) => { @@ -25,7 +28,8 @@ export const InnovenergyPropertyGrid = (
{props.rows.map((element) => { - return ( + if(isTextfieldProps(element)){ + return ( - ); + );} + else{ + return( + + ) + } })}
diff --git a/typescript/Frontend/src/components/Layout/InnovenergyTextfield.tsx b/typescript/Frontend/src/components/Layout/InnovenergyTextfield.tsx index 14abdfb7d..573ed73c0 100644 --- a/typescript/Frontend/src/components/Layout/InnovenergyTextfield.tsx +++ b/typescript/Frontend/src/components/Layout/InnovenergyTextfield.tsx @@ -1,16 +1,12 @@ import { Grid, InputLabel, TextField } from "@mui/material"; +import UserProps from "./UserProps"; -export interface I_InnovenergyTextfieldProps { - id: string; - label: string; + + +export type I_InnovenergyTextfieldProps = UserProps & { value: string; - name: string; - handleChange: (e: React.ChangeEvent) => void; type?: string; - readOnly?: boolean; - disabled?: boolean; helperText?: string; - error?: boolean; } const InnovenergyTextfield = (props: I_InnovenergyTextfieldProps) => { diff --git a/typescript/Frontend/src/components/Layout/UserProps.tsx b/typescript/Frontend/src/components/Layout/UserProps.tsx new file mode 100644 index 000000000..98a01aafb --- /dev/null +++ b/typescript/Frontend/src/components/Layout/UserProps.tsx @@ -0,0 +1,13 @@ + + +export type UserProps = { + id: string; + label: string; + name: string; + handleChange: (e: React.ChangeEvent) => void; + readOnly?: boolean; + disabled?: boolean; + error?: boolean; +} + +export default UserProps; \ No newline at end of file diff --git a/typescript/Frontend/src/components/Users/UserForm.tsx b/typescript/Frontend/src/components/Users/UserForm.tsx index 08c118baf..bb1b00833 100644 --- a/typescript/Frontend/src/components/Users/UserForm.tsx +++ b/typescript/Frontend/src/components/Users/UserForm.tsx @@ -15,6 +15,7 @@ import { I_InnovenergyTextfieldProps } from "../Layout/InnovenergyTextfield"; import { UserContext } from "../Context/UserContextProvider"; import { UsersContext } from "../Context/UsersContextProvider"; import InnovenergyPropertyGrid from "../Layout/InnovenergyPropertyGrid"; +import CheckmarkProps from "../Layout/Checkmark"; interface I_UserFormProps { handleSubmit: (formikValues: Partial) => Promise; @@ -62,7 +63,7 @@ const UserForm = (props: I_UserFormProps) => { setOpen(false); }; - const rows: I_InnovenergyTextfieldProps[] = [ + const rows: (I_InnovenergyTextfieldProps | CheckmarkProps)[] = [ { id: "name-textfield", label: intl.formatMessage({ @@ -96,20 +97,20 @@ 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, -// }, + { + id: "mustResetPassword-checkbox", + label: intl.formatMessage({ + id: "mustResetPassword", + defaultMessage: "Must reset password", + }), + name: "mustResetPassword", + value:formik.values.mustResetPassword, + handleChange: formik.handleChange, + disabled: readOnly, + }, ]; + return (
diff --git a/typescript/Frontend/src/config/axiosConfig.tsx b/typescript/Frontend/src/config/axiosConfig.tsx index 9b47c3c8a..7a223fd19 100644 --- a/typescript/Frontend/src/config/axiosConfig.tsx +++ b/typescript/Frontend/src/config/axiosConfig.tsx @@ -1,11 +1,11 @@ import axios from "axios"; export const axiosConfigWithoutToken = axios.create({ - baseURL: "https://localhost:7087", + baseURL: "https://localhost:7087/api", }); const axiosConfig = axios.create({ - baseURL: "https://localhost:7087", + baseURL: "https://localhost:7087/api", }); axiosConfig.defaults.params = {};