Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
A
admin-fe
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
Container 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
Sean King
admin-fe
Commits
727f72f0
Commit
727f72f0
authored
4 years ago
by
Angelina Filippova
Browse files
Options
Downloads
Patches
Plain Diff
Add confirmation fot note deletion
parent
789fa36e
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
src/views/reports/components/NoteCard.vue
+33
-21
33 additions, 21 deletions
src/views/reports/components/NoteCard.vue
src/views/users/components/ModerationDropdown.vue
+2
-2
2 additions, 2 deletions
src/views/users/components/ModerationDropdown.vue
with
35 additions
and
23 deletions
src/views/reports/components/NoteCard.vue
+
33
−
21
View file @
727f72f0
...
...
@@ -2,22 +2,14 @@
<el-card
class=
"note-card"
>
<div
slot=
"header"
>
<div
class=
"note-header"
>
<div
class=
"note-actor-container"
>
<div
class=
"note-actor"
>
<img
v-if=
"isValid(note.user)"
:src=
"note.user.avatar"
class=
"note-avatar-img"
>
<h3
v-if=
"isValid(note.user)"
class=
"note-actor-name"
>
{{
note
.
user
.
nickname
}}
</h3>
</div>
<div
class=
"note-actor"
>
<img
v-if=
"propertyExists(note.user, 'avatar')"
:src=
"note.user.avatar"
class=
"note-avatar-img"
>
<span
v-if=
"propertyExists(note.user, 'nickname')"
class=
"note-actor-name"
>
{{
note
.
user
.
nickname
}}
</span>
</div>
<div>
<el-popconfirm
title=
"Are you sure to delete this?"
confirm-button-text=
"Yes"
cancel-button-text=
"No"
@
onConfirm=
"handleNoteDeletion(note.id, report.id)"
>
<el-button
slot=
"reference"
size=
"mini"
>
{{
$t
(
'
reports.deleteNote
'
)
}}
</el-button>
</el-popconfirm>
<el-button
size=
"mini"
@
click.native=
"handleNoteDeletion(note.id, report.id)"
>
{{
$t
(
'
reports.deleteNote
'
)
}}
</el-button>
</div>
</div>
</div>
...
...
@@ -44,14 +36,29 @@ export default {
}
},
methods
:
{
isValid
(
account
)
{
return
account
.
nickname
&&
account
.
id
handleNoteDeletion
(
noteID
,
reportID
)
{
this
.
$confirm
(
'
Are you sure you want to delete this note?
'
,
'
Warning
'
,
{
confirmButtonText
:
'
OK
'
,
cancelButtonText
:
'
Cancel
'
,
type
:
'
warning
'
}).
then
(()
=>
{
this
.
$store
.
dispatch
(
'
DeleteReportNote
'
,
{
noteID
,
reportID
})
this
.
$message
({
type
:
'
success
'
,
message
:
'
Delete completed
'
})
}).
catch
(()
=>
{
this
.
$message
({
type
:
'
info
'
,
message
:
'
Delete canceled
'
})
})
},
parseTimestamp
(
timestamp
)
{
return
moment
(
timestamp
).
format
(
'
YYYY-MM-DD HH:mm
'
)
},
handleNoteDeletion
(
noteID
,
reportID
)
{
this
.
$store
.
dispatch
(
'
DeleteReportNote
'
,
{
noteID
,
reportID
})
propertyExists
(
account
,
property
)
{
return
account
[
property
]
}
}
}
...
...
@@ -76,7 +83,7 @@ export default {
}
.note-actor-name
{
margin
:
0
;
height
:
2
2
px
;
height
:
2
8
px
;
}
.note-avatar-img
{
width
:
15px
;
...
...
@@ -96,6 +103,10 @@ export default {
.note-header
{
display
:
flex
;
justify-content
:
space-between
;
align-items
:
center
;
height
:
28px
;
font-size
:
15px
;
font-weight
:
500
;
}
@media
only
screen
and
(
max-width
:
480px
)
{
...
...
@@ -105,14 +116,15 @@ export default {
.note-header
{
display
:
flex
;
flex-direction
:
column
;
height
:
80
px
;
height
:
65
px
;
}
.note-actor
-container
{
.note-actor
{
margin-bottom
:
5px
;
}
.note-header
{
display
:
flex
;
flex-direction
:
column
;
align-items
:
flex-start
;
}
}
</
style
>
This diff is collapsed.
Click to expand it.
src/views/users/components/ModerationDropdown.vue
+
2
−
2
View file @
727f72f0
<
template
>
<el-dropdown
:hide-on-click=
"false"
size=
"small"
trigger=
"click"
@
click.native.stop
>
<div>
<
spa
n
v-if=
"page === 'users'"
class=
"el-dropdown-link"
>
<
el-butto
n
v-if=
"page === 'users'"
type=
"text"
class=
"el-dropdown-link"
>
{{
$t
(
'
users.moderation
'
)
}}
<i
v-if=
"isDesktop"
class=
"el-icon-arrow-down el-icon--right"
/>
</
spa
n>
</
el-butto
n>
<el-button
v-if=
"page === 'userPage'"
class=
"moderate-user-button"
>
<span
class=
"moderate-user-button-container"
>
<span>
...
...
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