From d5e11e279ff70aab7f82611cdbafec6b6d6c252a Mon Sep 17 00:00:00 2001 From: Angelina Filippova Date: Wed, 8 Apr 2020 18:56:01 +0300 Subject: [PATCH] Update displaying accounts in reports and statuses --- src/api/__mocks__/reports.js | 14 +-- src/components/Status/index.vue | 21 +++- src/views/reports/components/NoteCard.vue | 2 +- src/views/reports/components/Report.vue | 15 ++- src/views/reports/components/ReportCard.vue | 127 -------------------- src/views/statuses/index.vue | 1 + src/views/users/show.vue | 2 +- 7 files changed, 36 insertions(+), 146 deletions(-) delete mode 100644 src/views/reports/components/ReportCard.vue diff --git a/src/api/__mocks__/reports.js b/src/api/__mocks__/reports.js index 36fc2008..5c6fe3a1 100644 --- a/src/api/__mocks__/reports.js +++ b/src/api/__mocks__/reports.js @@ -1,14 +1,14 @@ const reports = [ - { created_at: '2019-05-21T21:35:33.000Z', account: { acct: 'benj', display_name: 'Benjamin Fame', tags: [] }, actor: { acct: 'admin' }, state: 'open', id: '2', content: 'This is a report', statuses: [] }, - { created_at: '2019-05-20T22:45:33.000Z', account: { acct: 'alice', display_name: 'Alice Pool', tags: [] }, actor: { acct: 'admin2' }, state: 'resolved', id: '1', content: 'Please block this user', statuses: [] }, - { created_at: '2019-05-18T13:01:33.000Z', account: { acct: 'nick', display_name: 'Nick Keys', tags: [] }, actor: { acct: 'admin' }, state: 'closed', id: '3', content: '', statuses: [] }, - { created_at: '2019-05-21T21:35:33.000Z', account: { acct: 'benj', display_name: 'Benjamin Fame', tags: [] }, actor: { acct: 'admin' }, state: 'open', id: '5', content: 'This is a report', statuses: [] }, - { created_at: '2019-05-20T22:45:33.000Z', account: { acct: 'alice', display_name: 'Alice Pool', tags: [] }, actor: { acct: 'admin2' }, state: 'resolved', id: '7', content: 'Please block this user', statuses: [ + { created_at: '2019-05-21T21:35:33.000Z', account: { display_name: 'Benjamin Fame', tags: [] }, actor: {}, state: 'open', id: '2', content: 'This is a report', statuses: [] }, + { created_at: '2019-05-20T22:45:33.000Z', account: { display_name: 'Alice Pool', tags: [] }, actor: {}, state: 'resolved', id: '1', content: 'Please block this user', statuses: [] }, + { created_at: '2019-05-18T13:01:33.000Z', account: { display_name: 'Nick Keys', tags: [] }, actor: {}, state: 'closed', id: '3', content: '', statuses: [] }, + { created_at: '2019-05-21T21:35:33.000Z', account: { display_name: 'Benjamin Fame', tags: [] }, actor: {}, state: 'open', id: '5', content: 'This is a report', statuses: [] }, + { created_at: '2019-05-20T22:45:33.000Z', account: { display_name: 'Alice Pool', tags: [] }, actor: {}, state: 'resolved', id: '7', content: 'Please block this user', statuses: [ { account: { display_name: 'Alice Pool', avatar: '' }, visibility: 'public', sensitive: false, id: '11', content: 'Hey!', url: '', created_at: '2019-05-10T21:35:33.000Z' }, { account: { display_name: 'Alice Pool', avatar: '' }, visibility: 'unlisted', sensitive: true, id: '10', content: 'Bye!', url: '', created_at: '2019-05-10T21:00:33.000Z' } ] }, - { created_at: '2019-05-18T13:01:33.000Z', account: { acct: 'nick', display_name: 'Nick Keys', tags: [] }, actor: { acct: 'admin' }, state: 'closed', id: '6', content: '', statuses: [] }, - { created_at: '2019-05-18T13:01:33.000Z', account: { acct: 'nick', display_name: 'Nick Keys', tags: [] }, actor: { acct: 'admin' }, state: 'closed', id: '4', content: '', statuses: [] } + { created_at: '2019-05-18T13:01:33.000Z', account: { display_name: 'Nick Keys', tags: [] }, actor: {}, state: 'closed', id: '6', content: '', statuses: [] }, + { created_at: '2019-05-18T13:01:33.000Z', account: { display_name: 'Nick Keys', tags: [] }, actor: {}, state: 'closed', id: '4', content: '', statuses: [] } ] export async function fetchReports(filter, page, pageSize, authHost, token) { diff --git a/src/components/Status/index.vue b/src/components/Status/index.vue index 50fbcfb0..90058332 100644 --- a/src/components/Status/index.vue +++ b/src/components/Status/index.vue @@ -5,13 +5,17 @@
{{ $t('reports.sensitive') }} @@ -121,6 +125,11 @@ import moment from 'moment' export default { name: 'Status', props: { + account: { + type: Object, + required: false, + default: () => { return {} } + }, fetchStatusesByInstance: { type: Boolean, required: false, diff --git a/src/views/reports/components/NoteCard.vue b/src/views/reports/components/NoteCard.vue index 379e752b..79637f16 100644 --- a/src/views/reports/components/NoteCard.vue +++ b/src/views/reports/components/NoteCard.vue @@ -8,7 +8,7 @@

{{ note.user.display_name }}

- @{{ note.user.acct }} + @{{ note.user.display_name }}
diff --git a/src/views/reports/components/Report.vue b/src/views/reports/components/Report.vue index 4df72383..b0cb6eb2 100644 --- a/src/views/reports/components/Report.vue +++ b/src/views/reports/components/Report.vue @@ -33,9 +33,13 @@ :src="report.account.avatar" alt="avatar" class="avatar-img"> - + + {{ report.account.display_name }} + (deactivated) +
@@ -51,14 +55,14 @@ alt="avatar" class="avatar-img">
- +
@@ -183,6 +187,9 @@ export default { .divider { margin: 15px 0; } + .deactivated { + color: gray; + } .el-card__body { padding: 17px; } diff --git a/src/views/reports/components/ReportCard.vue b/src/views/reports/components/ReportCard.vue deleted file mode 100644 index 430b58bb..00000000 --- a/src/views/reports/components/ReportCard.vue +++ /dev/null @@ -1,127 +0,0 @@ - - - - - diff --git a/src/views/statuses/index.vue b/src/views/statuses/index.vue index 88bfab6c..fab0c221 100644 --- a/src/views/statuses/index.vue +++ b/src/views/statuses/index.vue @@ -40,6 +40,7 @@
diff --git a/src/views/users/show.vue b/src/views/users/show.vue index 23c87247..e6a27458 100644 --- a/src/views/users/show.vue +++ b/src/views/users/show.vue @@ -91,7 +91,7 @@ - +

{{ $t('userProfile.noStatuses') }}