From a4e3cccf1cba238e5bfd96ea8c60f0d12bc6b7aa Mon Sep 17 00:00:00 2001 From: Shpuld Shpuldson Date: Wed, 6 Jan 2021 18:31:34 +0200 Subject: somewhat workign version still with fixture --- src/components/notification/notification.js | 3 +++ 1 file changed, 3 insertions(+) (limited to 'src/components/notification/notification.js') diff --git a/src/components/notification/notification.js b/src/components/notification/notification.js index 4aa9affd..a920bb3e 100644 --- a/src/components/notification/notification.js +++ b/src/components/notification/notification.js @@ -76,6 +76,9 @@ const Notification = { this.$store.dispatch('dismissNotificationLocal', { id: this.notification.id }) this.$store.dispatch('removeFollowRequest', this.user) }) + }, + testlog (a) { + console.log(a) } }, computed: { -- cgit v1.2.3-70-g09d2 From 8674f2002320aaa6c380488b0eab636a53c76705 Mon Sep 17 00:00:00 2001 From: Shpuld Shpuldson Date: Mon, 11 Jan 2021 19:32:58 +0200 Subject: separated component --- src/components/notification/notification.js | 4 +- src/components/notification/notification.scss | 28 ------------ src/components/notification/notification.vue | 33 ++------------ src/components/report/report.js | 23 ++++++++++ src/components/report/report.scss | 39 +++++++++++++++++ src/components/report/report.vue | 63 +++++++++++++++++++++++++++ src/i18n/en.json | 10 +++++ src/services/api/api.service.js | 32 +++++++++++++- 8 files changed, 171 insertions(+), 61 deletions(-) create mode 100644 src/components/report/report.js create mode 100644 src/components/report/report.scss create mode 100644 src/components/report/report.vue (limited to 'src/components/notification/notification.js') diff --git a/src/components/notification/notification.js b/src/components/notification/notification.js index a920bb3e..38211bb3 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 b103db86..f5905560 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 39e3bda0..3b74249d 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 5936349a..3251de2a 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 9a3494ff..e1e26151 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 -- cgit v1.2.3-70-g09d2 From 3e6309ef94c72770dc83cc53fd05f66e69538bc7 Mon Sep 17 00:00:00 2001 From: Shpuld Shpuldson Date: Mon, 1 Feb 2021 14:43:01 +0200 Subject: remove logs --- src/components/notification/notification.js | 3 --- src/components/notifications/notifications.js | 1 - src/components/report/report.js | 1 - 3 files changed, 5 deletions(-) (limited to 'src/components/notification/notification.js') diff --git a/src/components/notification/notification.js b/src/components/notification/notification.js index 38211bb3..1634c035 100644 --- a/src/components/notification/notification.js +++ b/src/components/notification/notification.js @@ -78,9 +78,6 @@ const Notification = { this.$store.dispatch('dismissNotificationLocal', { id: this.notification.id }) this.$store.dispatch('removeFollowRequest', this.user) }) - }, - testlog (a) { - console.log(a) } }, computed: { diff --git a/src/components/notifications/notifications.js b/src/components/notifications/notifications.js index 25773fe0..49258563 100644 --- a/src/components/notifications/notifications.js +++ b/src/components/notifications/notifications.js @@ -66,7 +66,6 @@ const Notifications = { return this.$store.state.statuses.notifications.loading }, notificationsToDisplay () { - console.log(this.notifications) return this.filteredNotifications.slice(0, this.unseenCount + this.seenToDisplayCount) }, ...mapGetters(['unreadChatCount']) diff --git a/src/components/report/report.js b/src/components/report/report.js index 4d9108af..14b0cfd4 100644 --- a/src/components/report/report.js +++ b/src/components/report/report.js @@ -24,7 +24,6 @@ const Report = { return generateProfileLink(user.id, user.screen_name, this.$store.state.instance.restrictedNicknames) }, setReportState (state) { - console.log('setting state', state) return this.$store.dispatch('setReportState', { id: this.report.id, state }) } } -- cgit v1.2.3-70-g09d2 From 30c4a66518329b307d06f1fcfc39a7bf0c453f28 Mon Sep 17 00:00:00 2001 From: Henry Jameson Date: Wed, 15 Jun 2022 04:01:46 +0300 Subject: use user popovers in notifications as well --- src/components/notification/notification.js | 4 ++- src/components/notification/notification.vue | 39 +++++++++++++++++++--------- 2 files changed, 30 insertions(+), 13 deletions(-) (limited to 'src/components/notification/notification.js') diff --git a/src/components/notification/notification.js b/src/components/notification/notification.js index 398bb7a9..9408b217 100644 --- a/src/components/notification/notification.js +++ b/src/components/notification/notification.js @@ -5,6 +5,7 @@ import UserAvatar from '../user_avatar/user_avatar.vue' import UserCard from '../user_card/user_card.vue' import Timeago from '../timeago/timeago.vue' import RichContent from 'src/components/rich_content/rich_content.jsx' +import Popover from '../popover/popover.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' @@ -46,7 +47,8 @@ const Notification = { UserCard, Timeago, Status, - RichContent + RichContent, + Popover }, methods: { toggleUserExpanded () { diff --git a/src/components/notification/notification.vue b/src/components/notification/notification.vue index 7d3d0c69..a44481c9 100644 --- a/src/components/notification/notification.vue +++ b/src/components/notification/notification.vue @@ -34,21 +34,36 @@ - + + + +
-
-- cgit v1.2.3-70-g09d2 From d84cda7009d486a047953b1ca2d27acf35b8ddc1 Mon Sep 17 00:00:00 2001 From: Henry Jameson Date: Thu, 16 Jun 2022 16:30:05 +0300 Subject: unify user popovers into a separate component --- src/components/mention_link/mention_link.js | 3 +- src/components/mention_link/mention_link.vue | 115 ++++++++++++--------------- src/components/notification/notification.js | 4 +- src/components/notification/notification.vue | 36 +++------ src/components/popover/popover.js | 2 +- src/components/status/status.js | 6 +- src/components/status/status.vue | 43 +++------- src/components/user_popover/user_popover.js | 14 ++++ src/components/user_popover/user_popover.vue | 34 ++++++++ 9 files changed, 127 insertions(+), 130 deletions(-) create mode 100644 src/components/user_popover/user_popover.js create mode 100644 src/components/user_popover/user_popover.vue (limited to 'src/components/notification/notification.js') diff --git a/src/components/mention_link/mention_link.js b/src/components/mention_link/mention_link.js index 4b088f88..7e47625a 100644 --- a/src/components/mention_link/mention_link.js +++ b/src/components/mention_link/mention_link.js @@ -16,8 +16,7 @@ const MentionLink = { name: 'MentionLink', components: { UserAvatar, - Popover: defineAsyncComponent(() => import('../popover/popover.vue')), - UserCard: defineAsyncComponent(() => import('../user_card/user_card.vue')) + UserPopover: defineAsyncComponent(() => import('../user_popover/user_popover.vue')) }, props: { url: { diff --git a/src/components/mention_link/mention_link.vue b/src/components/mention_link/mention_link.vue index 686ad27f..0cff50ab 100644 --- a/src/components/mention_link/mention_link.vue +++ b/src/components/mention_link/mention_link.vue @@ -10,84 +10,71 @@ target="_blank" v-html="content" /> - - - - + + + diff --git a/src/components/notification/notification.js b/src/components/notification/notification.js index 9408b217..77cdfa73 100644 --- a/src/components/notification/notification.js +++ b/src/components/notification/notification.js @@ -5,7 +5,7 @@ import UserAvatar from '../user_avatar/user_avatar.vue' import UserCard from '../user_card/user_card.vue' import Timeago from '../timeago/timeago.vue' import RichContent from 'src/components/rich_content/rich_content.jsx' -import Popover from '../popover/popover.vue' +import UserPopover from '../user_popover/user_popover.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' @@ -48,7 +48,7 @@ const Notification = { Timeago, Status, RichContent, - Popover + UserPopover }, methods: { toggleUserExpanded () { diff --git a/src/components/notification/notification.vue b/src/components/notification/notification.vue index a44481c9..6427d117 100644 --- a/src/components/notification/notification.vue +++ b/src/components/notification/notification.vue @@ -36,32 +36,18 @@ :href="$router.resolve(userProfileLink).href" @click.prevent > - - - - + +
diff --git a/src/components/popover/popover.js b/src/components/popover/popover.js index 7f4c1cac..f6527624 100644 --- a/src/components/popover/popover.js +++ b/src/components/popover/popover.js @@ -80,7 +80,7 @@ const Popover = { y: anchorScreenBox.top + anchorHeight * 0.5 } const content = this.$refs.content - const overlayCenter = this.overlayCentersSelector + const overlayCenter = this.overlayCenters ? this.$refs.content.querySelector(this.overlayCentersSelector) : null diff --git a/src/components/status/status.js b/src/components/status/status.js index 06496258..053c9441 100644 --- a/src/components/status/status.js +++ b/src/components/status/status.js @@ -4,14 +4,13 @@ import ReactButton from '../react_button/react_button.vue' import RetweetButton from '../retweet_button/retweet_button.vue' import ExtraButtons from '../extra_buttons/extra_buttons.vue' import PostStatusForm from '../post_status_form/post_status_form.vue' -import UserCard from '../user_card/user_card.vue' import UserAvatar from '../user_avatar/user_avatar.vue' import AvatarList from '../avatar_list/avatar_list.vue' import Timeago from '../timeago/timeago.vue' import StatusContent from '../status_content/status_content.vue' import RichContent from 'src/components/rich_content/rich_content.jsx' import StatusPopover from '../status_popover/status_popover.vue' -import Popover from '../popover/popover.vue' +import UserPopover from '../user_popover/user_popover.vue' import UserListPopover from '../user_list_popover/user_list_popover.vue' import EmojiReactions from '../emoji_reactions/emoji_reactions.vue' import MentionsLine from 'src/components/mentions_line/mentions_line.vue' @@ -106,7 +105,6 @@ const Status = { RetweetButton, ExtraButtons, PostStatusForm, - UserCard, UserAvatar, AvatarList, Timeago, @@ -117,7 +115,7 @@ const Status = { RichContent, MentionLink, MentionsLine, - Popover + UserPopover }, props: [ 'statusoid', diff --git a/src/components/status/status.vue b/src/components/status/status.vue index 624960fe..771d336a 100644 --- a/src/components/status/status.vue +++ b/src/components/status/status.vue @@ -123,42 +123,21 @@ class="left-side" > - - - - + +
-
import('../user_card/user_card.vue')), + Popover: defineAsyncComponent(() => import('../popover/popover.vue')) + } +} + +export default UserPopover diff --git a/src/components/user_popover/user_popover.vue b/src/components/user_popover/user_popover.vue new file mode 100644 index 00000000..7ad5c234 --- /dev/null +++ b/src/components/user_popover/user_popover.vue @@ -0,0 +1,34 @@ + + + + + -- cgit v1.2.3-70-g09d2 From fddb531ed20b31c44e6911418e7bbb884836c40a Mon Sep 17 00:00:00 2001 From: Henry Jameson Date: Sun, 31 Jul 2022 12:35:48 +0300 Subject: --fix --- src/App.vue | 20 ++++-- src/boot/after_store.js | 4 +- src/boot/routes.js | 9 ++- src/components/about/about.vue | 2 +- src/components/account_actions/account_actions.vue | 4 +- src/components/avatar_list/avatar_list.vue | 2 +- src/components/basic_user_card/basic_user_card.vue | 11 ++-- src/components/chat/chat.js | 2 +- src/components/chat_list/chat_list.vue | 2 +- src/components/chat_message/chat_message.vue | 10 +-- src/components/chat_title/chat_title.vue | 4 +- src/components/checkbox/checkbox.vue | 4 +- src/components/color_input/color_input.vue | 2 +- src/components/conversation/conversation.js | 2 +- src/components/conversation/conversation.vue | 2 +- src/components/desktop_nav/desktop_nav.js | 24 +++++--- .../domain_mute_card/domain_mute_card.vue | 4 +- src/components/emoji_input/emoji_input.js | 2 +- src/components/emoji_picker/emoji_picker.js | 2 +- src/components/emoji_reactions/emoji_reactions.vue | 2 +- src/components/extra_buttons/extra_buttons.js | 2 +- src/components/extra_buttons/extra_buttons.vue | 6 +- src/components/favorite_button/favorite_button.vue | 2 +- src/components/features_panel/features_panel.vue | 2 +- src/components/flash/flash.js | 2 +- src/components/font_control/font_control.vue | 2 +- src/components/hashtag_link/hashtag_link.vue | 4 +- src/components/image_cropper/image_cropper.js | 2 +- .../instance_specific_panel.vue | 2 +- src/components/interactions/interactions.js | 2 +- .../interface_language_switcher.vue | 1 + src/components/login_form/login_form.js | 2 +- src/components/login_form/login_form.vue | 2 +- src/components/media_upload/media_upload.js | 5 +- src/components/media_upload/media_upload.vue | 2 +- src/components/mention_link/mention_link.vue | 17 ++--- src/components/mentions_line/mentions_line.vue | 14 ++--- src/components/mfa_form/recovery_form.vue | 2 +- src/components/mobile_nav/mobile_nav.vue | 5 +- src/components/modal/modal.vue | 8 +-- .../moderation_tools/moderation_tools.vue | 8 +-- .../mrf_transparency_panel.js | 6 +- src/components/nav_panel/nav_panel.vue | 2 +- src/components/notification/notification.js | 2 +- src/components/notification/notification.vue | 4 +- .../notifications/notification_filters.vue | 4 +- src/components/notifications/notifications.vue | 5 +- src/components/popover/popover.js | 34 +++++----- .../post_status_form/post_status_form.js | 16 ++--- src/components/react_button/react_button.js | 2 +- src/components/react_button/react_button.vue | 8 +-- src/components/remote_follow/remote_follow.js | 2 +- src/components/retweet_button/retweet_button.vue | 2 +- src/components/search_bar/search_bar.js | 2 +- src/components/selectable_list/selectable_list.vue | 4 +- .../settings_modal/helpers/modified_indicator.vue | 4 +- .../helpers/server_side_indicator.vue | 4 +- src/components/settings_modal/settings_modal.vue | 4 +- src/components/settings_modal/tabs/general_tab.vue | 10 ++- .../settings_modal/tabs/mutes_and_blocks_tab.vue | 34 +++++----- src/components/settings_modal/tabs/profile_tab.js | 10 +-- src/components/settings_modal/tabs/profile_tab.vue | 2 +- .../settings_modal/tabs/security_tab/mfa.js | 6 +- .../settings_modal/tabs/security_tab/mfa_totp.js | 2 +- .../tabs/security_tab/security_tab.js | 2 +- .../settings_modal/tabs/theme_tab/preview.vue | 5 +- .../settings_modal/tabs/theme_tab/theme_tab.js | 8 +-- src/components/shadow_control/shadow_control.js | 8 ++- src/components/shadow_control/shadow_control.vue | 2 +- src/components/shout_panel/shout_panel.js | 2 +- src/components/side_drawer/side_drawer.js | 2 +- src/components/side_drawer/side_drawer.vue | 2 +- src/components/staff_panel/staff_panel.js | 4 +- src/components/staff_panel/staff_panel.vue | 2 +- src/components/status/status.js | 6 +- src/components/status/status.vue | 11 ++-- src/components/status_body/status_body.vue | 2 +- src/components/status_content/status_content.vue | 2 +- src/components/status_popover/status_popover.vue | 8 +-- src/components/sticker_picker/sticker_picker.js | 4 +- .../terms_of_service_panel.vue | 2 +- src/components/timeline/timeline.vue | 5 +- .../timeline/timeline_quick_settings.vue | 4 +- src/components/timeline_menu/timeline_menu.js | 6 +- src/components/timeline_menu/timeline_menu.vue | 6 +- .../timeline_menu/timeline_menu_content.vue | 2 +- src/components/user_card/user_card.js | 2 +- src/components/user_card/user_card.vue | 2 +- .../user_list_popover/user_list_popover.vue | 6 +- src/components/user_popover/user_popover.vue | 42 ++++++------- src/components/user_profile/user_profile.vue | 15 +++-- .../user_reporting_modal/user_reporting_modal.vue | 2 +- src/components/who_to_follow/who_to_follow.js | 2 +- .../who_to_follow_panel/who_to_follow_panel.js | 10 +-- .../who_to_follow_panel/who_to_follow_panel.vue | 2 +- src/i18n/messages.js | 2 +- src/lib/notification-i18n-loader.js | 4 +- src/lib/persisted_state.js | 12 ++-- src/modules/api.js | 4 +- src/modules/config.js | 2 +- src/modules/errors.js | 4 +- src/modules/serverSideConfig.js | 28 ++++----- src/modules/statuses.js | 20 +++--- src/modules/users.js | 24 ++++---- src/services/api/api.service.js | 72 +++++++++++----------- src/services/chat_service/chat_service.js | 12 ++-- src/services/chat_utils/chat_utils.js | 2 +- src/services/color_convert/color_convert.js | 12 ++-- src/services/completion/completion.js | 2 +- src/services/date_utils/date_utils.js | 2 +- .../entity_normalizer/entity_normalizer.service.js | 4 +- src/services/file_size_format/file_size_format.js | 8 +-- .../html_converter/html_line_converter.service.js | 4 +- src/services/html_converter/utility.service.js | 2 +- src/services/locale/locale.service.js | 14 ++--- src/services/new_api/password_reset.js | 2 +- .../notifications_fetcher.service.js | 12 ++-- src/services/push/push.js | 4 +- src/services/theme_data/theme_data.service.js | 2 +- .../timeline_fetcher/timeline_fetcher.service.js | 16 ++--- src/services/user_highlighter/user_highlighter.js | 2 +- src/sw.js | 4 +- test/e2e/custom-assertions/elementCount.js | 2 +- test/e2e/nightwatch.conf.js | 54 ++++++++-------- test/e2e/runner.js | 8 +-- test/unit/karma.conf.js | 14 ++--- test/unit/specs/components/emoji_input.spec.js | 2 +- test/unit/specs/components/rich_content.spec.js | 2 +- test/unit/specs/components/user_profile.spec.js | 6 +- test/unit/specs/modules/statuses.spec.js | 4 +- .../services/chat_service/chat_service.spec.js | 24 ++++---- .../entity_normalizer/entity_normalizer.spec.js | 8 +-- .../file_size_format/file_size_format.spec.js | 4 +- 133 files changed, 508 insertions(+), 449 deletions(-) (limited to 'src/components/notification/notification.js') diff --git a/src/App.vue b/src/App.vue index 7d4a8e1e..0efadaf0 100644 --- a/src/App.vue +++ b/src/App.vue @@ -15,8 +15,12 @@ class="app-layout container" :class="classes" > -
-