diff --git a/CHANGELOG.md b/CHANGELOG.md index 3e8dd653..c2ce8f40 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -8,7 +8,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/). ### Added -- Route for single status +- Create `/statuses/:id` route that shows single status ### Changed @@ -20,6 +20,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/). ### Fixed - Send `true` and `false` as booleans if they are values of single selects on the Settings page +- Fix sorting users on Users page if there is an acount with missing nickname or ID ## [2.0.3] - 2020-04-29 diff --git a/src/api/__mocks__/status.js b/src/api/__mocks__/status.js index c8f98545..232ba69a 100644 --- a/src/api/__mocks__/status.js +++ b/src/api/__mocks__/status.js @@ -6,6 +6,29 @@ export async function deleteStatus(id, authHost, token) { return Promise.resolve() } +export async function fetchStatus(id, authHost, token) { + const data = { + account: { + id: '9n1bySks25olxWrku0', + avatar: 'http://localhost:4000/images/avi.png', + display_name: 'dolin', + tags: ['strip_media', 'sandbox', 'disable_any_subscription', 'force_nsfw'], + url: 'http://localhost:4000/users/dolin' + }, + content: 'pizza makes everything better', + created_at: '2020-05-22T17:34:34.000Z', + id: '9vJOO3iFPyjNaEhJ5s', + media_attachments: [], + poll: null, + sensitive: false, + spoiler_text: '', + visibility: 'public', + url: 'http://localhost:4000/notice/9vJOO3iFPyjNaEhJ5s' + } + + return Promise.resolve({ data }) +} + export async function fetchStatusesByInstance({ instance, authHost, token, pageSize, page }) { let data if (pageSize === 1) { diff --git a/src/api/__mocks__/users.js b/src/api/__mocks__/users.js index 9a3afd41..bdcf404a 100644 --- a/src/api/__mocks__/users.js +++ b/src/api/__mocks__/users.js @@ -6,7 +6,11 @@ export let users = [ const userProfile = { avatar: 'avatar.jpg', display_name: 'Allis', nickname: 'allis', id: '2', tags: [], roles: { admin: true, moderator: false }, local: true, external: false } -const userStatuses = [] +const userStatuses = [ + { account: { id: '9n1bySks25olxWrku0', display_name: 'dolin' }, content: 'pizza makes everything better', id: '9vJOO3iFPyjNaEhJ5s', created_at: '2020-05-22T17:34:34.000Z', visibility: 'public' }, + { account: { id: '9n1bySks25olxWrku0', display_name: 'dolin' }, content: 'pizza time', id: '9vJPD5XKOdzQ0bvGLY', created_at: '2020-05-22T17:34:34.000Z', visibility: 'public' }, + { account: { id: '9n1bySks25olxWrku0', display_name: 'dolin' }, content: 'what is yout favorite pizza?', id: '9jop82OBXeFPYulVjM', created_at: '2020-05-22T17:34:34.000Z', visibility: 'public' } +] const filterUsers = (str) => { const filters = str.split(',').filter(item => item.length > 0) diff --git a/src/api/status.js b/src/api/status.js index e3bb3fd4..0f3455c7 100644 --- a/src/api/status.js +++ b/src/api/status.js @@ -21,6 +21,15 @@ export async function deleteStatus(id, authHost, token) { }) } +export async function fetchStatus(id, authHost, token) { + return await request({ + baseURL: baseName(authHost), + url: `/api/pleroma/admin/statuses/${id}`, + method: 'get', + headers: authHeaders(token) + }) +} + export async function fetchStatuses({ godmode, localOnly, authHost, token, pageSize, page }) { return await request({ baseURL: baseName(authHost), diff --git a/src/components/Status/index.vue b/src/components/Status/index.vue index 90058332..ffb8f74c 100644 --- a/src/components/Status/index.vue +++ b/src/components/Status/index.vue @@ -1,85 +1,72 @@ + + diff --git a/src/views/users/components/ModerationDropdown.vue b/src/views/users/components/ModerationDropdown.vue index a893b5d5..f8cf5ee6 100644 --- a/src/views/users/components/ModerationDropdown.vue +++ b/src/views/users/components/ModerationDropdown.vue @@ -1,11 +1,11 @@ - -
-

Password reset token was generated: {{ passwordResetToken }}

-

You can also use this link to reset password: - {{ passwordResetLink }} -

-
-
+ - -
-

Password reset token was generated: {{ passwordResetToken }}

-

You can also use this link to reset password: - {{ passwordResetLink }} -

-
-
+