diff --git a/client/src/pages/admin/dashboard/components/CurrentUser.tsx b/client/src/pages/admin/dashboard/components/CurrentUser.tsx index 933a320b30e637d8100e29226f4bd41a49a48572..61d6e5f084fe22efdbceef0d6f638d7f60164b0b 100644 --- a/client/src/pages/admin/dashboard/components/CurrentUser.tsx +++ b/client/src/pages/admin/dashboard/components/CurrentUser.tsx @@ -6,6 +6,17 @@ import { useAppSelector } from '../../../../hooks' const CurrentUser: React.FC = () => { const currentUser = useAppSelector((state: { user: { userInfo: any } }) => state.user.userInfo) + const roles = useAppSelector((state) => state.roles.roles) + const region = useAppSelector((state) => state.cities.cities) + + const handleRole = (id: number) => { + return id + } + + const handleRegion = (id: number) => { + return id + } + return ( <div> <Box display="flex" flexDirection="column" alignContent="flex-start"> @@ -20,10 +31,10 @@ const CurrentUser: React.FC = () => { </Typography> </div> <div> - <Typography variant="h6">Region: {currentUser && currentUser.city && currentUser.city.name}</Typography> + <Typography variant="h6">Region: {handleRegion(currentUser.city_id)}</Typography> </div> <div> - <Typography variant="h6">Roll: {currentUser && currentUser.role && currentUser.role.name}</Typography> + <Typography variant="h6">Roll: {handleRole(currentUser.role_id)}</Typography> </div> </Box> </div> diff --git a/metrics/README.md b/metrics/README.md index 401002d0635b4f7208d4d43ddba8dd5ce01756b8..8686aaab743940fbfcae7f7152cca2d8684342ea 100644 --- a/metrics/README.md +++ b/metrics/README.md @@ -50,7 +50,7 @@ For each function space, rust-code-analysis computes the list of metrics describ # Metrics -Now the tool has analyzed the projekt and has outputted json files which the script will extrac the metrics from. +Now the tool has analyzed the project and has outputted json files which the script will extract the metrics from. Don't forget to change the path in the script. ```bash diff --git a/server/app/database/models.py b/server/app/database/models.py index 90eabf2432b874638d593139af06bff2a3a00314..97eb6097c2403cf4d32d01106e2ae906d9d788d5 100644 --- a/server/app/database/models.py +++ b/server/app/database/models.py @@ -66,10 +66,7 @@ class User(db.Model): locked = db.Column(db.DateTime(timezone=True), nullable=True, default=None) role_id = db.Column(db.Integer, db.ForeignKey("role.id"), nullable=False) - role_name = db.Column(db.Integer, db.ForeignKey("role.name"), nullable=False) - city_id = db.Column(db.Integer, db.ForeignKey("city.id"), nullable=False) - city_name = db.Column(db.Integer, db.ForeignKey("city.name"), nullable=False) media = db.relationship("Media", backref="upload_by") @@ -77,9 +74,7 @@ class User(db.Model): self._password = bcrypt.generate_password_hash(plaintext_password) self.email = email self.role_id = role_id - self.role_name = role_name self.city_id = city_id - self.city_name = city_name self.authenticated = False self.name = name