Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
I
idatt2106_2024_03_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
Scrum_Team_3
idatt2106_2024_03_frontend
Commits
201ea29a
Commit
201ea29a
authored
11 months ago
by
vildemv
Browse files
Options
Downloads
Patches
Plain Diff
Created pop up for deleting a challenge.
parent
ef9386ac
No related branches found
No related tags found
1 merge request
!53
Frontend improvements
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/components/popups/DeleteChallengePopUp.vue
+134
-0
134 additions, 0 deletions
src/components/popups/DeleteChallengePopUp.vue
with
134 additions
and
0 deletions
src/components/popups/DeleteChallengePopUp.vue
0 → 100644
+
134
−
0
View file @
201ea29a
<
script
setup
lang=
"ts"
>
import
{
onMounted
,
ref
}
from
'
vue
'
import
{
useTokenStore
}
from
'
@/stores/token
'
import
{
getAllMilestones
}
from
'
@/utils/MilestoneUtils
'
import
{
completeChallenge
,
deleteChallenge
}
from
'
@/utils/challengeutils
'
interface
Milestone
{
'
milestoneId
'
:
number
,
'
milestoneTitle
'
:
string
}
const
props
=
defineProps
({
challengeId
:
Number
,
});
const
token
:
string
=
useTokenStore
().
jwtToken
;
const
emit
=
defineEmits
([
'
closeDeletePopUp
'
,
'
challengeDeleted
'
]);
const
cancelCompleteThisChallenge
=
()
=>
{
emit
(
'
closeDeletePopUp
'
);
}
const
deleteThisChallenge
=
async
()
=>
{
if
(
props
.
challengeId
){
try
{
await
deleteChallenge
(
token
,
props
.
challengeId
);
emit
(
'
challengeDeleted
'
);
}
catch
(
error
){
console
.
log
(
error
)
}
}
}
</
script
>
<
template
>
<div
class=
"popup-content"
>
<!-- Pop-up content goes here -->
<h2>
Er du sikker på at du vil slette utfordringen?
</h2>
<div
class=
"content"
>
<img
class=
"sad-pig-img"
src=
"/src/assets/png/sad-pig.png"
alt=
"sad-pig"
>
<h3>
Husk! Dagens små sparinger kan føre til morgendagens store drømmer.
</h3>
</div>
<div
class=
"option-buttons"
>
<button
class=
"option-button"
id=
"cancel-button"
@
click=
"cancelCompleteThisChallenge()"
>
<h2
class=
"option-button-title"
>
Avbryt
</h2>
</button>
<button
class=
"option-button"
id=
"delete-button"
@
click=
"deleteThisChallenge()"
>
<h2
class=
"option-button-title"
>
Slett
</h2>
</button>
</div>
</div>
</
template
>
<
style
scoped
>
.popup-content
{
display
:
flex
;
flex-direction
:
column
;
width
:
50%
;
height
:
50%
;
background-color
:
var
(
--color-background
);
padding
:
20px
;
border-radius
:
10px
;
border
:
2px
solid
var
(
--color-border
);
place-content
:
space-between
;
}
.content
{
display
:
flex
;
flex-direction
:
row
;
place-items
:
center
;
}
.sad-pig-img
{
width
:
30%
;
}
.option-buttons
{
display
:
flex
;
flex-direction
:
row
;
width
:
100%
;
place-content
:
space-between
;
}
.option-button
{
border
:
none
;
border-radius
:
20px
;
width
:
35%
;
}
.option-button-title
{
color
:
var
(
--color-headerText
);
font-weight
:
bold
;
}
#cancel-button
{
background-color
:
var
(
--color-cancel-button
);
}
#cancel-button
:active
{
background-color
:
var
(
--color-cancel-button-click
);
}
#delete-button
{
background-color
:
var
(
--color-confirm-button
);
}
#delete-button
:active
{
background-color
:
var
(
--color-confirm-button-click
);
}
#delete-button
:hover
,
#cancel-button
:hover
{
transform
:
scale
(
1.02
);
}
@media
only
screen
and
(
max-width
:
1000px
){
.popup-content
{
width
:
90%
;
height
:
60%
;
}
}
</
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