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
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
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
Pleroma
admin-fe
Commits
b305a1e7
Commit
b305a1e7
authored
5 years ago
by
Maxim Filippov
Browse files
Options
Downloads
Plain Diff
Merge branch 'fix/reports-update' into 'master'
Fix reports management Closes
#50
See merge request
!64
parents
591e30f1
b7c83e06
No related branches found
Branches containing commit
No related tags found
Tags containing commit
1 merge request
!64
Fix reports management
Pipeline
#20154
passed
5 years ago
Stage: lint
Stage: build
Stage: test
Changes
4
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
CHANGELOG.md
+1
-0
1 addition, 0 deletions
CHANGELOG.md
src/api/__mocks__/reports.js
+1
-2
1 addition, 2 deletions
src/api/__mocks__/reports.js
src/api/reports.js
+3
-3
3 additions, 3 deletions
src/api/reports.js
src/store/modules/reports.js
+6
-2
6 additions, 2 deletions
src/store/modules/reports.js
with
11 additions
and
7 deletions
CHANGELOG.md
+
1
−
0
View file @
b305a1e7
...
...
@@ -23,6 +23,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).
### Fixed
-
Show checkmarks when tag is applied
-
Reports update (also, now it's optimistic)
## [1.2.0] - 2019-09-27
...
...
This diff is collapsed.
Click to expand it.
src/api/__mocks__/reports.js
+
1
−
2
View file @
b305a1e7
...
...
@@ -23,8 +23,7 @@ export async function filterReports(filter, limit, max_id, authHost, token) {
}
export
async
function
changeState
(
state
,
id
,
authHost
,
token
)
{
const
report
=
reports
.
find
(
report
=>
report
.
id
===
id
)
return
Promise
.
resolve
({
data
:
{
...
report
,
state
}})
return
Promise
.
resolve
({
data
:
''
})
}
export
async
function
changeStatusScope
(
id
,
sensitive
,
visibility
,
authHost
,
token
)
{
...
...
This diff is collapsed.
Click to expand it.
src/api/reports.js
+
3
−
3
View file @
b305a1e7
...
...
@@ -5,10 +5,10 @@ import { baseName } from './utils'
export
async
function
changeState
(
state
,
id
,
authHost
,
token
)
{
return
await
request
({
baseURL
:
baseName
(
authHost
),
url
:
`/api/pleroma/admin/reports
/
${
id
}
`
,
method
:
'
p
ut
'
,
url
:
`/api/pleroma/admin/reports`
,
method
:
'
p
atch
'
,
headers
:
authHeaders
(
token
),
data
:
{
state
}
data
:
{
reports
:
[{
id
,
state
}
]
}
})
}
...
...
This diff is collapsed.
Click to expand it.
src/store/modules/reports.js
+
6
−
2
View file @
b305a1e7
...
...
@@ -24,8 +24,12 @@ const reports = {
},
actions
:
{
async
ChangeReportState
({
commit
,
getters
,
state
},
{
reportState
,
reportId
})
{
const
{
data
}
=
await
changeState
(
reportState
,
reportId
,
getters
.
authHost
,
getters
.
token
)
const
updatedReports
=
state
.
fetchedReports
.
map
(
report
=>
report
.
id
===
reportId
?
data
:
report
)
changeState
(
reportState
,
reportId
,
getters
.
authHost
,
getters
.
token
)
const
updatedReports
=
state
.
fetchedReports
.
map
(
report
=>
{
return
report
.
id
===
reportId
?
{
...
report
,
state
:
reportState
}
:
report
})
commit
(
'
SET_REPORTS
'
,
updatedReports
)
},
async
ChangeStatusScope
({
commit
,
getters
,
state
},
{
statusId
,
isSensitive
,
visibility
,
reportId
})
{
...
...
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