Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
teknikattan-scoring-system
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
tddd96-grupp1
teknikattan-scoring-system
Commits
270b7063
Commit
270b7063
authored
3 years ago
by
Björn Modée
Browse files
Options
Downloads
Patches
Plain Diff
Fix server bug
parent
738dc04c
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Pipeline
#44687
failed
3 years ago
Stage: setup
Stage: test
Changes
3
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
client/src/pages/admin/dashboard/components/CurrentUser.tsx
+13
-2
13 additions, 2 deletions
client/src/pages/admin/dashboard/components/CurrentUser.tsx
metrics/README.md
+1
-1
1 addition, 1 deletion
metrics/README.md
server/app/database/models.py
+0
-5
0 additions, 5 deletions
server/app/database/models.py
with
14 additions
and
8 deletions
client/src/pages/admin/dashboard/components/CurrentUser.tsx
+
13
−
2
View file @
270b7063
...
...
@@ -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
>
...
...
This diff is collapsed.
Click to expand it.
metrics/README.md
+
1
−
1
View file @
270b7063
...
...
@@ -50,7 +50,7 @@ For each function space, rust-code-analysis computes the list of metrics describ
# Metrics
Now the tool has analyzed the proje
k
t and has outputted json files which the script will extrac the metrics from.
Now the tool has analyzed the proje
c
t and has outputted json files which the script will extrac
t
the metrics from.
Don't forget to change the path in the script.
```
bash
...
...
This diff is collapsed.
Click to expand it.
server/app/database/models.py
+
0
−
5
View file @
270b7063
...
...
@@ -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
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment