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
90d33b83
Commit
90d33b83
authored
10 months ago
by
Jens Christian Aanestad
Browse files
Options
Downloads
Patches
Plain Diff
feat/Created new confirm modal when upon deleting a budget
parent
dedbb5db
No related branches found
Branches containing commit
No related tags found
1 merge request
!53
Refactor/integration budgetview
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/components/Budget/Modal/ConfirmDeleteModal.vue
+62
-0
62 additions, 0 deletions
src/components/Budget/Modal/ConfirmDeleteModal.vue
with
62 additions
and
0 deletions
src/components/Budget/Modal/ConfirmDeleteModal.vue
0 → 100644
+
62
−
0
View file @
90d33b83
<
script
setup
lang=
"ts"
>
import
{
UserService
}
from
'
@/api
'
const
emit
=
defineEmits
([
'
errorEvent
'
,
'
deletedEvent
'
])
const
props
=
defineProps
({
modalId
:
{
type
:
String
,
required
:
true
},
budgetId
:
{
type
:
Number
,
required
:
true
},
budgetTitle
:
{
type
:
String
,
default
:
''
}
})
/**
* Deletes a budget with the specified ID and emits a delete event.
*/
const
deleteBudget
=
async
()
=>
{
try
{
await
UserService
.
deleteBudget
({
budgetId
:
props
.
budgetId
})
emit
(
'
deletedEvent
'
)
}
catch
(
error
)
{
emit
(
'
errorEvent
'
,
error
)
}
}
</
script
>
<
template
>
<div
class=
"modal fade"
:id=
"modalId"
>
<div
class=
"modal-dialog modal-dialog-centered"
>
<div
class=
"modal-content"
>
<div
class=
"modal-header"
>
<h3>
Are you sure you want to delete this budget
<i>
{{
budgetTitle
}}
?
</i></h3>
<button
class=
"btn btn-close"
data-bs-dismiss=
"modal"
></button>
</div>
<div
class=
"modal-body"
>
<button
class=
"btn btn-primary"
data-bs-dismiss=
"modal"
@
click=
"deleteBudget"
>
Yes
</button>
<button
class=
"btn btn-primary"
data-bs-dismiss=
"modal"
>
No
</button>
</div>
</div>
</div>
</div>
</
template
>
<
style
scoped
>
.modal-header
{
display
:
flex
;
}
.modal-body
{
display
:
grid
;
gap
:
10px
}
</
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