Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
F
frontend
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
idatt2106-2024-07
frontend
Commits
1721d77c
Commit
1721d77c
authored
10 months ago
by
Anders Høvik
Browse files
Options
Downloads
Patches
Plain Diff
Added dynamic text to history from endpoints
parent
f314d311
No related branches found
Branches containing commit
No related tags found
1 merge request
!86
Feature/history endpoint
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
src/components/UserProfile/ExternalProfile.vue
+5
-4
5 additions, 4 deletions
src/components/UserProfile/ExternalProfile.vue
src/components/UserProfile/MyProfile.vue
+17
-10
17 additions, 10 deletions
src/components/UserProfile/MyProfile.vue
with
22 additions
and
14 deletions
src/components/UserProfile/ExternalProfile.vue
+
5
−
4
View file @
1721d77c
...
...
@@ -12,6 +12,7 @@ let cardTitles = ["Spain tour", "Food waste", "Coffee", "Concert", "New book", "
let
hasHistory
=
ref
(
true
)
let
firstname
=
ref
();
let
lastname
=
ref
();
let
goals
=
ref
([]);
let
username
=
ref
()
...
...
@@ -40,7 +41,7 @@ function toRoadmap(){
//todo Make a store of a friend-instance
onMounted
(
async
()
=>
{
try
{
let
response
=
await
UserService
.
getProfile
({
goals
=
await
UserService
.
getProfile
({
userId
:
id
.
value
.
id
})
profile
=
response
;
...
...
@@ -186,9 +187,9 @@ onMounted(() =>{
</div>
<div
class=
"col-md-8"
>
<div
class=
"card-body"
>
<h5
class=
"card-title"
>
{{
cardTitles
[
index
-
1
]
}}
</h5>
<p
class=
"card-text"
>
Penger spart: 200
<br
/>
Du har fullført en utfordring: 21
</p>
<p
class=
"card-text"
><small
class=
"text-muted"
>
Sist oppdatert for 3 minutter siden
</small></p>
<h5
class=
"card-title"
>
{{
goals
[
index
][
'
name
'
]
}}
</h5>
<p
class=
"card-text"
>
{{
goals
[
index
][
'
description
'
]
}}
</p>
<p
class=
"card-text"
><small
class=
"text-muted"
>
{{
goals
[
index
][
'
targetAmount
'
]
}}
</small></p>
<a
href=
"#"
class=
"btn stretched-link"
@
click=
"toRoadmap"
></a>
</div>
</div>
...
...
This diff is collapsed.
Click to expand it.
src/components/UserProfile/MyProfile.vue
+
17
−
10
View file @
1721d77c
...
...
@@ -19,12 +19,20 @@ const badges = ref([] as any);
const
backgroundName
=
ref
(
""
);
let
goalName
=
ref
(
''
);
let
goalDescription
=
ref
(
''
);
let
targetAmount
=
ref
(
''
);
let
targetDate
=
ref
(
''
);
let
createdAt
=
ref
(
''
);
let
goals
=
ref
([])
async
function
getGoals
()
{
let
response
=
await
GoalService
.
getGoals
();
console
.
log
(
"
number of goals:
"
,
response
.
length
)
console
.
log
(
'
The id of a goal:
'
,
response
[
0
])
if
(
response
.
length
>
0
)
{
goals
=
await
GoalService
.
getGoals
();
console
.
log
(
"
number of goals:
"
,
goals
.
length
)
console
.
log
(
'
The id of a goal:
'
,
goals
[
0
])
if
(
goals
.
length
>
0
)
{
hasHistory
.
value
=
true
goalName
.
value
=
goals
...
...
@@ -180,8 +188,8 @@ onMounted(()=>{
<div
class=
"container-fluid mb-5"
>
<h1
class=
"mt-1 text-start history-text"
>
Historie
</h1>
<div
v-if=
"hasHistory"
class=
"row scrolling-wrapper-history"
>
<div
v-for=
"index in
numberOfHistory
"
:key=
"index"
class=
"col-md-4 col-sm-4 col-lg-4 col-xs-4 col-xl-4 control-label"
>
<div
v-for=
"index in
goals
"
:key=
"index"
class=
"col-md-4 col-sm-4 col-lg-4 col-xs-4 col-xl-4 control-label"
>
<div
class=
"card history-block"
>
<div
class=
"card mb-3"
style=
"max-width: 540px;"
>
<div
class=
"row g-0"
>
...
...
@@ -191,10 +199,9 @@ onMounted(()=>{
</div>
<div
class=
"col-md-8"
>
<div
class=
"card-body"
>
<h5
class=
"card-title"
>
{{
cardTitles
[
index
-
1
]
}}
</h5>
<p
class=
"card-text"
>
Penger spart: 200
<br
/>
Du har fullført en utfordring: 21
</p>
<p
class=
"card-text"
><small
class=
"text-muted"
>
Sist oppdatert for 3 minutter
siden
</small></p>
<h5
class=
"card-title"
>
{{
goals
[
index
][
'
name
'
]
}}
</h5>
<p
class=
"card-text"
>
{{
goals
[
index
][
'
description
'
]
}}
</p>
<p
class=
"card-text"
><small
class=
"text-muted"
>
{{
goals
[
index
][
'
targetAmount
'
]
}}
</small></p>
<a
href=
"#"
class=
"btn stretched-link"
@
click=
"toRoadmap"
></a>
</div>
</div>
...
...
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