Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
sparesti-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_01
sparesti-frontend
Commits
a6734e3d
Commit
a6734e3d
authored
1 year ago
by
Lotte Christine Walla Aune
Browse files
Options
Downloads
Patches
Plain Diff
feat: Connected title and deadline in SavingPathView to backend
parent
958dc657
No related branches found
No related tags found
2 merge requests
!56
Sprint 1 done
,
!25
Saving goal store
Pipeline
#277026
failed
1 year ago
Stage: test
Changes
1
Pipelines
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/views/SavingPathView.vue
+21
-3
21 additions, 3 deletions
src/views/SavingPathView.vue
with
21 additions
and
3 deletions
src/views/SavingPathView.vue
+
21
−
3
View file @
a6734e3d
...
...
@@ -17,18 +17,29 @@ import {
TooltipProvider
,
TooltipTrigger
}
from
"
@/components/ui/tooltip/index.js
"
;
import
{
ref
,
onMounted
,
onUnmounted
,
nextTick
}
from
"
vue
"
;
import
{
ref
,
onMounted
,
onUnmounted
,
nextTick
,
computed
}
from
"
vue
"
;
import
{
Popover
,
PopoverContent
,
PopoverTrigger
}
from
"
@/components/ui/popover/index.js
"
;
import
{
useSavingGoalsStore
}
from
"
@/stores/savingGoals.js
"
;
const
savingGoalStore
=
useSavingGoalsStore
();
/**
* Tracks the window width.
*/
const
windowWidth
=
ref
(
window
.
innerWidth
);
/**
* Gets the current saving goal.
*/
const
currentSavingGoal
=
computed
(()
=>
savingGoalStore
.
currentSavingGoal
)
const
loading
=
computed
(()
=>
savingGoalStore
.
loading
)
/**
* Handles click outside the popover.
*/
...
...
@@ -39,6 +50,9 @@ let handlingClickOutside = null;
* If the click is outside the popover, the popover is closed.
*/
onMounted
(()
=>
{
if
(
savingGoalStore
.
currentSavingGoal
===
null
)
{
savingGoalStore
.
fetchSavingGoals
();
}
nextTick
(()
=>
{
handlingClickOutside
=
event
=>
{
if
(
!
event
.
target
.
closest
(
'
.popover
'
))
{
...
...
@@ -76,7 +90,10 @@ const numChallenges = ref(4);
</
script
>
<
template
>
<div
class=
"flex flex-col justify-between items-center max-h-screen p-8"
>
<div
v-if=
"loading"
class=
"flex flex-col justify-center items-center h-screen"
>
<p>
Loading...
</p>
'
</div>
<div
v-else
class=
"flex flex-col justify-between items-center max-h-screen p-8"
>
<div
class=
"flex flex-row justify-between"
>
<h3
class=
"text-2xl font-semibold leading-none tracking-tight"
>
Min sparesti:
...
...
@@ -106,7 +123,8 @@ const numChallenges = ref(4);
</TooltipProvider>
</div>
</div>
<h1
class=
"text-4xl"
>
SPAREMÅL
</h1>
<h1
class=
"text-4xl"
>
{{
currentSavingGoal
.
title
}}
</h1>
<p
class=
"text-lg"
>
{{
currentSavingGoal
.
deadline
}}
</p>
<img
:src=
"VueLogo"
alt=
"Vue logo"
class=
"w-60 h-auto pb-8"
/>
<Card
class=
"w-full max-w-screen-sm md:max-w-xl lg:max-w-2xl xl:max-w-3xl mx-auto"
>
<div
class=
"flex flex-col md:flex-row items-start md:space-x-4 p-4"
>
...
...
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