Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
A
admin-fe
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Incidents
Environments
Packages & Registries
Packages & Registries
Container Registry
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Angelina Filippova
admin-fe
Commits
c9d6402c
Commit
c9d6402c
authored
May 25, 2019
by
Angelina Filippova
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add ability to delete status
parent
93866e78
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
47 additions
and
3 deletions
+47
-3
src/api/reports.js
src/api/reports.js
+9
-0
src/lang/en.js
src/lang/en.js
+2
-1
src/store/modules/reports.js
src/store/modules/reports.js
+13
-1
src/views/reports/components/Statuses.vue
src/views/reports/components/Statuses.vue
+22
-0
src/views/reports/components/TimelineItem.vue
src/views/reports/components/TimelineItem.vue
+1
-1
No files found.
src/api/reports.js
View file @
c9d6402c
...
@@ -22,6 +22,15 @@ export async function changeStatusScope(id, sensitive, visibility, authHost, tok
...
@@ -22,6 +22,15 @@ export async function changeStatusScope(id, sensitive, visibility, authHost, tok
})
})
}
}
export
async
function
deleteStatus
(
id
,
authHost
,
token
)
{
return
await
request
({
baseURL
:
baseName
(
authHost
),
url
:
`/api/pleroma/admin/statuses/
${
id
}
`
,
method
:
'
delete
'
,
headers
:
authHeaders
(
token
)
})
}
export
async
function
fetchReports
(
limit
,
max_id
,
authHost
,
token
)
{
export
async
function
fetchReports
(
limit
,
max_id
,
authHost
,
token
)
{
return
await
request
({
return
await
request
({
baseURL
:
baseName
(
authHost
),
baseURL
:
baseName
(
authHost
),
...
...
src/lang/en.js
View file @
c9d6402c
...
@@ -223,7 +223,8 @@ export default {
...
@@ -223,7 +223,8 @@ export default {
public
:
'
Make status public
'
,
public
:
'
Make status public
'
,
private
:
'
Make status private
'
,
private
:
'
Make status private
'
,
unlisted
:
'
Make status unlisted
'
,
unlisted
:
'
Make status unlisted
'
,
sensitive
:
'
Sensitive
'
sensitive
:
'
Sensitive
'
,
deleteStatus
:
'
Delete status
'
},
},
reportsFilter
:
{
reportsFilter
:
{
inputPlaceholder
:
'
Select filter
'
,
inputPlaceholder
:
'
Select filter
'
,
...
...
src/store/modules/reports.js
View file @
c9d6402c
import
{
changeState
,
changeStatusScope
,
fetchReports
,
filterReports
}
from
'
@/api/reports
'
import
{
changeState
,
changeStatusScope
,
deleteStatus
,
fetchReports
,
filterReports
}
from
'
@/api/reports
'
const
reports
=
{
const
reports
=
{
state
:
{
state
:
{
...
@@ -40,6 +40,18 @@ const reports = {
...
@@ -40,6 +40,18 @@ const reports = {
})
})
commit
(
'
SET_REPORTS
'
,
updatedReports
)
commit
(
'
SET_REPORTS
'
,
updatedReports
)
},
},
async
DeleteStatus
({
commit
,
getters
,
state
},
{
statusId
,
reportId
})
{
deleteStatus
(
statusId
,
getters
.
authHost
,
getters
.
token
)
const
updatedReports
=
state
.
fetchedReports
.
map
(
report
=>
{
if
(
report
.
id
===
reportId
)
{
const
statuses
=
report
.
statuses
.
filter
(
status
=>
status
.
id
!==
statusId
)
return
{
...
report
,
statuses
}
}
else
{
return
report
}
})
commit
(
'
SET_REPORTS
'
,
updatedReports
)
},
async
FetchReports
({
commit
,
getters
,
state
})
{
async
FetchReports
({
commit
,
getters
,
state
})
{
commit
(
'
SET_LOADING
'
,
true
)
commit
(
'
SET_LOADING
'
,
true
)
const
response
=
await
fetchReports
(
state
.
page_limit
,
state
.
idOfLastReport
,
getters
.
authHost
,
getters
.
token
)
const
response
=
await
fetchReports
(
state
.
page_limit
,
state
.
idOfLastReport
,
getters
.
authHost
,
getters
.
token
)
...
...
src/views/reports/components/Statuses.vue
View file @
c9d6402c
...
@@ -38,6 +38,10 @@
...
@@ -38,6 +38,10 @@
@
click.native=
"changeStatus(status.id, status.sensitive, 'unlisted', report.id)"
>
@
click.native=
"changeStatus(status.id, status.sensitive, 'unlisted', report.id)"
>
{{
$t
(
'
reports.unlisted
'
)
}}
{{
$t
(
'
reports.unlisted
'
)
}}
</el-dropdown-item>
</el-dropdown-item>
<el-dropdown-item
@
click.native=
"deleteStatus(status.id, report.id)"
>
{{
$t
(
'
reports.deleteStatus
'
)
}}
</el-dropdown-item>
</el-dropdown-menu>
</el-dropdown-menu>
</el-dropdown>
</el-dropdown>
</div>
</div>
...
@@ -74,6 +78,24 @@ export default {
...
@@ -74,6 +78,24 @@ export default {
changeStatus
(
statusId
,
isSensitive
,
visibility
,
reportId
)
{
changeStatus
(
statusId
,
isSensitive
,
visibility
,
reportId
)
{
this
.
$store
.
dispatch
(
'
ChangeStatusScope
'
,
{
statusId
,
isSensitive
,
visibility
,
reportId
})
this
.
$store
.
dispatch
(
'
ChangeStatusScope
'
,
{
statusId
,
isSensitive
,
visibility
,
reportId
})
},
},
deleteStatus
(
statusId
,
reportId
)
{
this
.
$confirm
(
'
Are you sure you want to delete this status?
'
,
'
Warning
'
,
{
confirmButtonText
:
'
OK
'
,
cancelButtonText
:
'
Cancel
'
,
type
:
'
warning
'
}).
then
(()
=>
{
this
.
$store
.
dispatch
(
'
DeleteStatus
'
,
{
statusId
,
reportId
})
this
.
$message
({
type
:
'
success
'
,
message
:
'
Delete completed
'
})
}).
catch
(()
=>
{
this
.
$message
({
type
:
'
info
'
,
message
:
'
Delete canceled
'
})
})
},
getStatusesTitle
(
statuses
)
{
getStatusesTitle
(
statuses
)
{
return
`Reported statuses:
${
statuses
.
length
}
item(s)`
return
`Reported statuses:
${
statuses
.
length
}
item(s)`
},
},
...
...
src/views/reports/components/TimelineItem.vue
View file @
c9d6402c
...
@@ -21,7 +21,7 @@
...
@@ -21,7 +21,7 @@
<span
class=
"report-row-key"
>
Account:
</span>
<span
class=
"report-row-key"
>
Account:
</span>
<img
<img
:src=
"report.account.avatar"
:src=
"report.account.avatar"
alt=
"
User's
avatar"
alt=
"avatar"
class=
"avatar-img"
>
class=
"avatar-img"
>
<a
:href=
"report.account.url"
target=
"_blank"
class=
"account"
>
<a
:href=
"report.account.url"
target=
"_blank"
class=
"account"
>
<span
class=
"report-row-value"
>
{{
report
.
account
.
acct
}}
</span>
<span
class=
"report-row-value"
>
{{
report
.
account
.
acct
}}
</span>
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment