Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
T
ToDo-App Jan Schnaidt and Abdullah Kiran
Manage
Activity
Members
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Locked files
Deploy
Releases
Package registry
Container Registry
Model registry
Operate
Terraform modules
Analyze
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
Abdullah Kiran
ToDo-App Jan Schnaidt and Abdullah Kiran
Commits
98f58c88
Commit
98f58c88
authored
8 months ago
by
abdu
Browse files
Options
Downloads
Patches
Plain Diff
add signout modal, update signout button logic, update delete button logic
parent
3f2727e7
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
frontend/src/components/MainPage.vue
+25
-7
25 additions, 7 deletions
frontend/src/components/MainPage.vue
with
25 additions
and
7 deletions
frontend/src/components/MainPage.vue
+
25
−
7
View file @
98f58c88
...
...
@@ -38,6 +38,11 @@ export default {
}
},
methods
:
{
setToDoIdForDeleteModal
(
todoId
){
console
.
log
(
todoId
)
this
.
todoIdForDeleteModal
=
todoId
console
.
log
(
this
.
todoIdForDeleteModal
)
},
async
validateSession
(){
if
(
this
.
$route
.
name
===
'
main
'
)
{
let
url
=
"
http://localhost:9876/user/validateSession
"
...
...
@@ -105,7 +110,7 @@ export default {
headers
:
{
"
Content-Type
"
:
"
application/json
"
},
credentials
:
'
include
'
,
// Ensure credentials are included
credentials
:
'
include
'
,
})
if
(
response
.
status
===
204
)
{
...
...
@@ -164,7 +169,7 @@ export default {
</b-button>
</b-col>
<b-col>
<b-button
class=
"mb-4"
variant=
"danger"
@
click=
"signout"
>
<b-button
v-b-modal.signout-modal
class=
"mb-4"
variant=
"danger"
>
Log out
</b-button>
</b-col>
...
...
@@ -180,7 +185,7 @@ export default {
<div
class=
"badge-container"
>
<b-button
variant=
"link"
@
click=
"setTodoComplete(item.todoId)"
class=
"custom-badge-not-completed"
>
mark as completed
</b-button>
</div>
<b-button
variant=
"danger"
@
click.stop=
"
d
elete
T
od
o
(item.todoId)"
>
Delete
</b-button>
<b-button
v-b-modal.delete-modal
variant=
"danger"
@
click.stop=
"
setToDoIdForD
elete
M
od
al
(item.todoId)"
>
Delete
</b-button>
</div>
</li>
</ul>
...
...
@@ -196,7 +201,7 @@ export default {
<div
class=
"badge-container"
>
<div
class=
"custom-badge-completed"
>
completed
</div>
</div>
<b-button
v-b-modal.delete-modal
variant=
"danger"
@
click=
"se
ndInfoTo
Modal(item.todoId)"
>
Delete
</b-button>
<b-button
v-b-modal.delete-modal
variant=
"danger"
@
click=
"se
tToDoIdForDelete
Modal(item.todoId)"
>
Delete
</b-button>
</div>
</li>
</ul>
...
...
@@ -205,7 +210,7 @@ export default {
</b-tabs>
<!-- details modal -->
<b-modal
v-model=
"showDetailsModal"
title=
"Details"
hide-header
id=
"showDetailsModal"
>
<b-modal
v-model=
"showDetailsModal"
title=
"Details"
hide-header
-close
id=
"showDetailsModal"
>
<h3>
Title:
{{
selectedItem
.
title
}}
</h3>
<p
style=
"overflow-wrap: break-word"
>
Description:
<br>
{{
selectedItem
.
description
}}
</p>
<div>
Status:
<br>
...
...
@@ -213,11 +218,14 @@ export default {
</div>
</b-modal>
<b-modal
@
ok=
"deleteTodo(this.todoIdForDeleteModal)"
hie-header
id=
"delete-modal"
>
<p>
{{
this
.
todoIdForDeleteModal
}}
</p>
<!-- delete modal -->
<b-modal
title=
"Delete ToDo"
@
ok=
"deleteTodo(todoIdForDeleteModal)"
hide-header-close
id=
"delete-modal"
>
<p>
Are you sure you want to delete this ToDo?
</p>
</b-modal>
<b-modal
v-model=
"showAddModal"
title=
"add title"
@
ok=
"addTodo"
hide-header
id=
"showAddModal"
>
<!-- add modal -->
<b-modal
v-model=
"showAddModal"
title=
"add title"
@
ok=
"addTodo"
hide-header-close
id=
"showAddModal"
>
<b-form-group
label=
"Title"
>
<b-form-input
required
v-model=
"todo.title"
placeholder=
"todo title"
></b-form-input>
</b-form-group>
...
...
@@ -225,6 +233,16 @@ export default {
<b-form-input
v-model=
"todo.description"
placeholder=
"todo description"
></b-form-input>
</b-form-group>
</b-modal>
<!-- signout modal -->
<b-modal
title=
"Log out"
@
ok=
"signout"
hide-header-close
id=
"signout-modal"
>
<p>
Are you sure you want to log out?
</p>
</b-modal>
</b-card-body>
</b-card>
</b-col>
...
...
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