diff --git a/src/components/notification/notification.js b/src/components/notification/notification.js index a920bb3e77..38211bb387 100644 --- a/src/components/notification/notification.js +++ b/src/components/notification/notification.js @@ -4,6 +4,7 @@ import Status from '../status/status.vue' import UserAvatar from '../user_avatar/user_avatar.vue' import UserCard from '../user_card/user_card.vue' import Timeago from '../timeago/timeago.vue' +import Report from '../report/report.vue' import { isStatusNotification } from '../../services/notification_utils/notification_utils.js' import { highlightClass, highlightStyle } from '../../services/user_highlighter/user_highlighter.js' import generateProfileLink from 'src/services/user_profile_link_generator/user_profile_link_generator' @@ -44,7 +45,8 @@ const Notification = { UserAvatar, UserCard, Timeago, - Status + Status, + Report }, methods: { toggleUserExpanded () { diff --git a/src/components/notification/notification.scss b/src/components/notification/notification.scss index b103db861d..f59055604a 100644 --- a/src/components/notification/notification.scss +++ b/src/components/notification/notification.scss @@ -56,34 +56,6 @@ margin: 0 0.1em; } - .report-content { - margin: 0.5em 0; - } - - .reported-status { - border: 1px solid $fallback--faint; - border-color: var(--faint, $fallback--faint); - border-radius: $fallback--inputRadius; - border-radius: var(--inputRadius, $fallback--inputRadius); - color: $fallback--text; - color: var(--text, $fallback--text); - display: block; - padding: 0.5em; - margin: 0.5em 0; - - .status-content { - pointer-events: none; - } - - .reported-status-name { - font-weight: bold; - } - - .reported-status-timeago { - float: right; - } - } - &.-type--repeat .type-icon { color: $fallback--cGreen; color: var(--cGreen, $fallback--cGreen); diff --git a/src/components/notification/notification.vue b/src/components/notification/notification.vue index 39e3bda0bd..3b74249dde 100644 --- a/src/components/notification/notification.vue +++ b/src/components/notification/notification.vue @@ -183,37 +183,10 @@ @{{ notification.target.screen_name }} -
- Reported user: - - @{{ notification.report.acct.screen_name }} - - -
-
- Reported statuses: - - - {{ status.user.name }} - - - -
-
+ :report="notification.report" + /> + + + diff --git a/src/i18n/en.json b/src/i18n/en.json index 5936349aa0..3251de2ae3 100644 --- a/src/i18n/en.json +++ b/src/i18n/en.json @@ -237,6 +237,16 @@ "searching_for": "Searching for", "error": "Not found." }, + "report": { + "reporter": "Reporter:", + "reported_user": "Reported user:", + "reported_statuses": "Reported statuses:", + "notes": "Notes:", + "state": "State:", + "state_open": "Open", + "state_closed": "Closed", + "state_resolved": "Resolved" + }, "selectable_list": { "select_all": "Select all" }, diff --git a/src/services/api/api.service.js b/src/services/api/api.service.js index 9a3494ff49..e1e2615142 100644 --- a/src/services/api/api.service.js +++ b/src/services/api/api.service.js @@ -87,6 +87,7 @@ const PLEROMA_CHAT_URL = id => `/api/v1/pleroma/chats/by-account-id/${id}` const PLEROMA_CHAT_MESSAGES_URL = id => `/api/v1/pleroma/chats/${id}/messages` const PLEROMA_CHAT_READ_URL = id => `/api/v1/pleroma/chats/${id}/read` const PLEROMA_DELETE_CHAT_MESSAGE_URL = (chatId, messageId) => `/api/v1/pleroma/chats/${chatId}/messages/${messageId}` +const PLEROMA_ADMIN_REPORTS = '/api/pleroma/admin/reports' const oldfetch = window.fetch @@ -759,7 +760,18 @@ const report = { "content": "This is the report created by "reporting_account". It reports "reported_account".", "created_at": "2020-09-03T14:22:59.000Z", "id": "9ymggNcUyfIW8Cq1zM", - "notes": [], + "notes": [ + { + "content": "Some note left here.", + "created_at": "2020-09-03T14:22:59.000Z", + "id": "1" + }, + { + "content": "Some other note that is much much much longer than the previous note left here.", + "created_at": "2020-09-03T14:23:59.000Z", + "id": "2" + } + ], "state": "open", "statuses": [ { @@ -1553,6 +1565,21 @@ const deleteChatMessage = ({ chatId, messageId, credentials }) => { }) } +const setReportState = ({ id, state, credentials }) => { + return promisedRequest({ + url: PLEROMA_ADMIN_REPORTS, + method: 'PATCH', + payload: { + 'reports': [ + { + id, + state + } + ] + } + }) +} + const apiService = { verifyCredentials, fetchTimeline, @@ -1638,7 +1665,8 @@ const apiService = { chatMessages, sendChatMessage, readChat, - deleteChatMessage + deleteChatMessage, + setReportState } export default apiService