Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
idatt2106_2024_02_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 - Gruppe 2
idatt2106_2024_02_frontend
Commits
fc6e6e66
Commit
fc6e6e66
authored
11 months ago
by
Trygve Jørgensen
Browse files
Options
Downloads
Patches
Plain Diff
feat(user): finished profile view
parent
5f0aadee
No related branches found
Branches containing commit
No related tags found
3 merge requests
!66
Final merge
,
!39
Added view and edit profile
,
!4
Pipeline fix
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/views/EditProfileView.vue
+94
-0
94 additions, 0 deletions
src/views/EditProfileView.vue
with
94 additions
and
0 deletions
src/views/EditProfileView.vue
0 → 100644
+
94
−
0
View file @
fc6e6e66
<
script
lang=
"ts"
setup
>
import
authInterceptor
from
'
@/services/authInterceptor
'
import
{
computed
,
onMounted
,
ref
}
from
'
vue
'
import
type
{
Profile
}
from
'
@/types/profile
'
import
CardTemplate
from
'
@/views/CardTemplate.vue
'
import
InteractiveSpare
from
'
@/components/InteractiveSpare.vue
'
import
CardGoal
from
'
@/components/CardGoal.vue
'
const
profile
=
ref
<
Profile
>
()
onMounted
(
async
()
=>
{
await
authInterceptor
(
'
/profile
'
)
.
then
((
response
)
=>
{
profile
.
value
=
response
.
data
console
.
log
(
profile
.
value
)
})
.
catch
((
error
)
=>
{
return
console
.
log
(
error
)
})
})
const
welcome
=
computed
(()
=>
{
return
[
`Velkommen,
${
profile
.
value
?.
firstName
}
${
profile
.
value
?.
lastName
}
!`
]
})
</
script
>
<
template
>
<div
class=
"w-full flex px-10 justify-center"
>
<div
class=
"flex flex-row flex-wrap justify-center w-full max-w-screen-xl gap-20"
>
<div
class=
"flex flex-col max-w-96 w-full gap-5"
>
<h1>
Profile
</h1>
<div
class=
"flex flex-row gap-5"
>
<div
class=
"w-32 h-32 border-black border-2 rounded-full shrink-0"
></div>
<div
class=
"w-full flex flex-col justify-between"
>
<h3
class=
"font-thin my-0"
>
{{
profile
?.
username
}}
</h3>
<h3
class=
"font-thin my-0"
>
{{
profile
?.
firstName
+
'
'
+
profile
?.
lastName
}}
</h3>
<h3
class=
"font-thin my-0"
>
{{
profile
?.
email
}}
</h3>
</div>
</div>
<h3
class=
"font-bold"
v-text=
"'Du har spart ' + '
<
totalSaved
>
' + 'kr'" />
<CardTemplate>
<div
class=
"bg-red-300"
>
<p
class=
"font-bold mx-3"
v-text=
"'Brukskonto'"
/>
</div>
<p
class=
"mx-3"
v-text=
"profile?.spendingAccount.accNumber || 'Ingen brukskonto oppkoblet'"
/>
</CardTemplate>
<CardTemplate>
<div
class=
"bg-red-300"
>
<p
class=
"font-bold mx-3"
v-text=
"'Sparekonto'"
/>
</div>
<p
class=
"mx-3"
v-text=
"profile?.savingAccount.accNumber || 'Ingen sparekonto oppkoblet'"
/>
</CardTemplate>
<button
v-text=
"'Rediger bruker'"
/>
</div>
<div
class=
"flex flex-col"
>
<InteractiveSpare
:png-size=
"10"
:speech=
"welcome"
direction=
"left"
/>
<div
class=
"flex flex-row justify-between mx-4"
>
<p
class=
"font-bold"
>
Fullførte sparemål
</p>
<a
class=
"hover:p-0 cursor-pointer"
v-text=
"'Se alle'"
/>
</div>
<CardTemplate
class=
"p-4 flex flex-row flex-wrap justify-center gap-2 mb-4 mt-2"
>
<CardGoal
v-for=
"goal in completedGoals"
:key=
"goal.id"
:goal-instance=
"goal"
/>
</CardTemplate>
<div
class=
"flex flex-row justify-between mx-4"
>
<p
class=
"font-bold"
>
Fullførte utfordringer
</p>
<a
class=
"hover:p-0 cursor-pointer"
v-text=
"'Se alle'"
/>
</div>
<CardTemplate
class=
"p-4 flex flex-row flex-wrap justify-center gap-2 mb-4 mt-2"
>
<CardGoal
v-for=
"challenge in completedChallenges"
:key=
"challenge.id"
:goal-instance=
"challenge"
/>
</CardTemplate>
</div>
</div>
</div>
</
template
>
<
style
scoped
></
style
>
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