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
cf50fb05
Commit
cf50fb05
authored
5 years ago
by
Angelina Filippova
Browse files
Options
Downloads
Patches
Plain Diff
Do not render content and statuses rows if there is no data
parent
3657b49a
No related branches found
Branches containing commit
No related tags found
Tags containing commit
1 merge request
!11
Add ability to read reports
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
src/store/modules/reports.js
+2
-18
2 additions, 18 deletions
src/store/modules/reports.js
src/views/reports/components/TimelineItem.vue
+9
-37
9 additions, 37 deletions
src/views/reports/components/TimelineItem.vue
with
11 additions
and
55 deletions
src/store/modules/reports.js
+
2
−
18
View file @
cf50fb05
...
...
@@ -15,9 +15,6 @@ const reports = {
SET_LOADING
:
(
state
,
status
)
=>
{
state
.
loading
=
status
},
SET_REPORT
:
(
state
,
{
reportIndex
,
data
})
=>
{
state
.
fetchedReports
[
reportIndex
]
=
data
},
SET_REPORTS
:
(
state
,
reports
)
=>
{
state
.
fetchedReports
=
reports
},
...
...
@@ -28,8 +25,8 @@ const reports = {
actions
:
{
async
ChangeReportState
({
commit
,
getters
,
state
},
{
reportState
,
reportId
})
{
const
{
data
}
=
await
changeState
(
reportState
,
reportId
,
getters
.
authHost
,
getters
.
token
)
const
reportIndex
=
state
.
fetchedReports
.
findIndex
(
report
=>
report
.
id
===
reportId
)
commit
(
'
SET_REPORT
'
,
{
reportIndex
,
data
}
)
const
updatedReports
=
state
.
fetchedReports
.
map
(
report
=>
report
.
id
===
reportId
?
data
:
report
)
commit
(
'
SET_REPORT
S
'
,
updatedReports
)
},
async
FetchReports
({
commit
,
getters
,
state
})
{
commit
(
'
SET_LOADING
'
,
true
)
...
...
@@ -60,19 +57,6 @@ const reports = {
commit
(
'
SET_LOADING
'
,
false
)
}
}
// async AddNote({ commit, state, getters }, { reportId, note }) {
// const report = state.fetchedReports.find(report => report.id === reportId)
// report.notes = [...report.notes, note]
// const reportIndex = state.fetchedReports.findIndex(report => report.id === reportId)
// commit('SET_REPORT', { reportIndex, report })
// },
// async DeleteNote({ commit, state }, { reportId, noteId }) {
// const response = deleteNote(reportId, noteId)
// const report = state.fetchedReports.find(report => report.id === reportId)
// report.notes = response
// const reportIndex = state.fetchedReports.findIndex(report => report.id === reportId)
// commit('SET_REPORT', { reportIndex, report })
// }
}
}
...
...
This diff is collapsed.
Click to expand it.
src/views/reports/components/TimelineItem.vue
+
9
−
37
View file @
cf50fb05
...
...
@@ -4,21 +4,20 @@
<div
class=
"header-container"
>
<h3
class=
"report-title"
>
Report on
{{
report
.
account
.
display_name
}}
</h3>
<div>
<el-tag
:type=
"getStateType(report.state)"
:key=
"report.state"
size=
"large"
>
{{
capitalizeFirstLetter
(
report
.
state
)
}}
</el-tag>
<el-tag
:type=
"getStateType(report.state)"
size=
"large"
>
{{
capitalizeFirstLetter
(
report
.
state
)
}}
</el-tag>
<el-dropdown>
<el-button
plain
size=
"small"
icon=
"el-icon-edit"
>
{{
$t
(
'
reports.changeState
'
)
}}
<i
class=
"el-icon-arrow-down el-icon--right"
/></el-button>
<el-dropdown-menu
slot=
"dropdown"
>
<el-dropdown-item
v-if=
"report.state !== 'resolved'"
@
click.native=
"changeReportState('resolved', report.id)"
>
Resolve
</el-dropdown-item>
<el-dropdown-item
v-if=
"report.state !== 'open'"
@
click.native=
"changeReportState('open', report.id)"
>
O
pen
</el-dropdown-item>
<el-dropdown-item
v-if=
"report.state !== 'open'"
@
click.native=
"changeReportState('open', report.id)"
>
Reo
pen
</el-dropdown-item>
<el-dropdown-item
v-if=
"report.state !== 'closed'"
@
click.native=
"changeReportState('closed', report.id)"
>
Close
</el-dropdown-item>
</el-dropdown-menu>
</el-dropdown>
<!--
<el-button
plain
size=
"small"
@
click=
"toggleNoteInput"
>
{{
$t
(
'
reports.reply
'
)
}}
</el-button>
-->
</div>
</div>
<h5
class=
"id"
>
ID:
{{
report
.
id
}}
</h5>
<div
class=
"line"
/>
<div>
<div
class=
"line"
/>
<span
class=
"report-row-key"
>
Account:
</span>
<img
:src=
"report.account.avatar"
...
...
@@ -28,14 +27,14 @@
<span
class=
"report-row-value"
>
{{
report
.
account
.
acct
}}
</span>
</a>
</div>
<div
class=
"line"
/
>
<div>
<div
v-if=
"report.content.length > 0"
>
<div
class=
"line"
/
>
<span
class=
"report-row-key"
>
Content:
<span
class=
"report-row-value"
>
{{
report
.
content
.
length
>
0
?
report
.
content
:
'
-
'
}}
</span>
<span
class=
"report-row-value"
>
{{
report
.
content
}}
</span>
</span>
</div>
<div
class=
"line"
/>
<div>
<div
class=
"line"
/>
<span
class=
"report-row-key"
>
Actor:
</span>
<img
:src=
"report.actor.avatar"
...
...
@@ -45,7 +44,7 @@
<span
class=
"report-row-value"
>
{{
report
.
actor
.
acct
}}
</span>
</a>
</div>
<div
class=
"statuses"
>
<div
v-if=
"report.statuses.length > 0"
class=
"statuses"
>
<el-collapse>
<el-collapse-item
:title=
"getStatusesTitle(report.statuses)"
>
<el-card
v-for=
"status in report.statuses"
:key=
"status.id"
class=
"status-card"
>
...
...
@@ -68,33 +67,6 @@
</el-collapse-item>
</el-collapse>
</div>
<!--
<el-collapse
v-model=
"showNotes"
>
<el-collapse-item
:title=
"$t('reports.showNotes')"
name=
"showNotes"
>
<div
v-if=
"report.statuses.length > 0"
>
<div
v-for=
"note in report.statuses"
:key=
"note.id"
>
<el-card
:body-style=
"
{ padding: '6px 14px 0 14px' }" class="note">
<div
class=
"header-container"
>
<h4>
{{
$t
(
'
reports.from
'
)
}}
{{
note
.
author
}}
</h4>
<i
class=
"el-icon-close"
@
click=
"deleteNote(report.id, note.id)"
/>
</div>
<p
class=
"timestamp"
>
{{
note
.
timestamp
}}
</p>
<p>
{{
note
.
text
}}
</p>
</el-card>
</div>
</div>
<div
v-else
>
<p
class=
"no-notes"
>
{{
$t
(
'
reports.noNotes
'
)
}}
</p>
</div>
</el-collapse-item>
<div
v-show=
"showNewNoteInput"
class=
"new-note"
>
<div
class=
"header-container"
>
<p>
{{
$t
(
'
reports.newNote
'
)
}}
</p>
<i
class=
"el-icon-close"
@
click=
"toggleNoteInput"
/>
</div>
<el-input
v-model=
"note"
:rows=
"2"
type=
"textarea"
autofocus
/>
<el-button
class=
"submit-button"
plain
size=
"small"
@
click=
"addNewNote(report.id)"
>
{{
$t
(
'
reports.submit
'
)
}}
</el-button>
</div>
</el-collapse>
-->
</el-card>
</el-timeline-item>
</
template
>
...
...
@@ -162,7 +134,7 @@ export default {
case
'
resolved
'
:
return
'
success
'
default
:
return
''
return
'
primary
'
}
},
getStatusesTitle
(
statuses
)
{
...
...
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