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
10ee11be
Commit
10ee11be
authored
1 year ago
by
Victor Ekholt Gunrell Kaste
Browse files
Options
Downloads
Patches
Plain Diff
feat: Added regeneration to the roadmap challenges.
parent
0ce5bf15
Branches
feat/regenerate_challenge
Branches containing commit
No related tags found
1 merge request
!92
Feat/regenerate challenge
Pipeline
#284205
passed with warnings
1 year ago
Stage: install
Stage: build
Stage: test
Stage: lint
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/components/SavingGoal/SavingGoalRoadmap.vue
+48
-3
48 additions, 3 deletions
src/components/SavingGoal/SavingGoalRoadmap.vue
with
48 additions
and
3 deletions
src/components/SavingGoal/SavingGoalRoadmap.vue
+
48
−
3
View file @
10ee11be
...
@@ -10,7 +10,7 @@ import {
...
@@ -10,7 +10,7 @@ import {
UserService
UserService
}
from
"
@/api
"
;
}
from
"
@/api
"
;
import
{
GoalService
}
from
'
@/api
'
import
{
GoalService
}
from
'
@/api
'
import
{
useUserInfoStore
}
from
"
@/
stores/UserStore
"
;
import
handleUnknownError
from
'
@/
components/Exceptions/unkownErrorHandler
'
ChartJS
.
register
(
ChartJS
.
register
(
CategoryScale
,
CategoryScale
,
...
@@ -181,6 +181,7 @@ export default {
...
@@ -181,6 +181,7 @@ export default {
await
this
.
transferMoney
(
amount
)
await
this
.
transferMoney
(
amount
)
this
.
calculateSavedSoFar
();
this
.
calculateSavedSoFar
();
}
catch
(
error
:
any
)
{
}
catch
(
error
:
any
)
{
handleUnknownError
(
error
)
console
.
log
(
error
.
message
);
console
.
log
(
error
.
message
);
}
}
},
},
...
@@ -306,7 +307,9 @@ export default {
...
@@ -306,7 +307,9 @@ export default {
};
};
try
{
try
{
await
GoalService
.
updateChallengeAmount
({
requestBody
:
createGoalPayload
})
await
GoalService
.
updateChallengeAmount
({
requestBody
:
createGoalPayload
})
this
.
$emit
(
'
refreshSavingGoal
'
);
}
catch
(
e
:
any
)
{
}
catch
(
e
:
any
)
{
handleUnknownError
(
e
)
console
.
log
(
e
.
message
)
console
.
log
(
e
.
message
)
}
}
},
},
...
@@ -355,6 +358,17 @@ export default {
...
@@ -355,6 +358,17 @@ export default {
await
TransactionControllerService
.
transferToSelf
({
requestBody
:
transactionPayload
})
await
TransactionControllerService
.
transferToSelf
({
requestBody
:
transactionPayload
})
},
},
async
regenerateChallenge
(
challenge
:
ChallengeDTO
)
{
let
challengeId
=
challenge
.
id
as
number
try
{
let
response
=
await
GoalService
.
regenerateChallenge
({
id
:
challengeId
})
console
.
log
(
response
)
this
.
$emit
(
'
refreshSavingGoal
'
);
}
catch
(
e
)
{
handleUnknownError
(
e
)
}
},
},
},
};
};
</
script
>
</
script
>
...
@@ -383,8 +397,15 @@ export default {
...
@@ -383,8 +397,15 @@ export default {
</div>
</div>
<div
class=
"timeline-panel z-3"
:id=
"'panel-' + index"
v-show=
"challenge.showPanel"
>
<div
class=
"timeline-panel z-3"
:id=
"'panel-' + index"
v-show=
"challenge.showPanel"
>
<div
class=
"timeline-heading"
>
<div
class=
"timeline-heading"
>
<h5
style=
"margin-top: 12px"
>
{{
challenge
.
points
}}
<img
src=
"../../assets/items/pigcoin.png"
alt=
"pig coint"
style=
"width: 2rem"
></h5>
<div
class=
"coinAndRegen"
>
<h4>
Utfordring
{{
index
+
1
}}
</h4>
<div
class=
"coinCoin"
>
<h5
style=
"margin-top: 12px"
>
{{
challenge
.
points
}}
<img
src=
"../../assets/items/pigcoin.png"
alt=
"pig coin"
style=
"width: 2rem"
></h5>
</div>
<div
class=
"coinButton"
>
<a
@
click=
"regenerateChallenge(challenge)"
style=
"cursor: pointer"
><img
src=
"../../assets/icons/refresh.svg"
/>
Regenerer
</a>
</div>
</div>
<h4>
{{
challenge
.
challengeTemplate
.
templateName
}}
</h4>
<p
style=
"font-size: 12px"
>
{{
formatDate
(
challenge
.
startDate
)
}}
til
{{
formatDate
(
challenge
.
endDate
)
}}
</p>
<p
style=
"font-size: 12px"
>
{{
formatDate
(
challenge
.
startDate
)
}}
til
{{
formatDate
(
challenge
.
endDate
)
}}
</p>
<h4
class=
"subheading"
>
{{
convertTemplateTextToChallengeText
(
challenge
)
}}
</h4>
<h4
class=
"subheading"
>
{{
convertTemplateTextToChallengeText
(
challenge
)
}}
</h4>
</div>
</div>
...
@@ -800,4 +821,28 @@ export default {
...
@@ -800,4 +821,28 @@ export default {
margin-top
:
10px
;
margin-top
:
10px
;
padding
:
12px
;
padding
:
12px
;
}
}
.timeline
.coinAndRegen
{
margin-top
:
8px
;
display
:
flex
;
flex-direction
:
row-reverse
;
}
.timeline-inverted
.coinAndRegen
{
margin-top
:
8px
;
display
:
flex
;
flex-direction
:
row
;
}
.coinCoin
{
width
:
40%
;
}
.coinButton
{
width
:
60%
;
color
:
white
;
align-content
:
center
;
align-items
:
center
;
text-align
:
center
;
}
</
style
>
</
style
>
\ No newline at end of file
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