From 0110fd86c2f166de5be8d675ffa34ab815463b2d Mon Sep 17 00:00:00 2001 From: tusooa Date: Wed, 27 Dec 2023 22:30:19 -0500 Subject: Allow user to mark account as group --- src/components/settings_modal/tabs/profile_tab.js | 10 ++++++++-- src/components/settings_modal/tabs/profile_tab.vue | 15 ++++++++++++--- 2 files changed, 20 insertions(+), 5 deletions(-) (limited to 'src/components') diff --git a/src/components/settings_modal/tabs/profile_tab.js b/src/components/settings_modal/tabs/profile_tab.js index eeacad48..3cb3ae45 100644 --- a/src/components/settings_modal/tabs/profile_tab.js +++ b/src/components/settings_modal/tabs/profile_tab.js @@ -9,6 +9,7 @@ import suggestor from 'src/components/emoji_input/suggestor.js' import Autosuggest from 'src/components/autosuggest/autosuggest.vue' import Checkbox from 'src/components/checkbox/checkbox.vue' import InterfaceLanguageSwitcher from 'src/components/interface_language_switcher/interface_language_switcher.vue' +import Select from 'src/components/select/select.vue' import BooleanSetting from '../helpers/boolean_setting.vue' import SharedComputedObject from '../helpers/shared_computed_object.js' import localeService from 'src/services/locale/locale.service.js' @@ -39,6 +40,7 @@ const ProfileTab = { showRole: this.$store.state.users.currentUser.show_role, role: this.$store.state.users.currentUser.role, bot: this.$store.state.users.currentUser.bot, + actorType: this.$store.state.users.currentUser.actor_type, pickAvatarBtnVisible: true, bannerUploading: false, backgroundUploading: false, @@ -57,7 +59,8 @@ const ProfileTab = { ProgressButton, Checkbox, BooleanSetting, - InterfaceLanguageSwitcher + InterfaceLanguageSwitcher, + Select }, computed: { user () { @@ -116,6 +119,9 @@ const ProfileTab = { bannerImgSrc () { const src = this.$store.state.users.currentUser.cover_photo return (!src) ? this.defaultBanner : src + }, + availableActorTypes () { + return this.$store.state.instance.groupActorAvailable ? ['Person', 'Service', 'Group'] : ['Person', 'Service'] } }, methods: { @@ -127,7 +133,7 @@ const ProfileTab = { /* eslint-disable camelcase */ display_name: this.newName, fields_attributes: this.newFields.filter(el => el != null), - bot: this.bot, + actor_type: this.actorType, show_role: this.showRole, birthday: this.newBirthday || '', show_birthday: this.showBirthday diff --git a/src/components/settings_modal/tabs/profile_tab.vue b/src/components/settings_modal/tabs/profile_tab.vue index 1cc850cb..e6dc5987 100644 --- a/src/components/settings_modal/tabs/profile_tab.vue +++ b/src/components/settings_modal/tabs/profile_tab.vue @@ -109,9 +109,18 @@

- - {{ $t('settings.bot') }} - +

Date: Wed, 27 Dec 2023 22:36:13 -0500 Subject: Add a description on what groups do --- src/components/settings_modal/tabs/profile_tab.js | 5 ++++- src/components/settings_modal/tabs/profile_tab.vue | 5 +++++ src/i18n/en.json | 1 + 3 files changed, 10 insertions(+), 1 deletion(-) (limited to 'src/components') diff --git a/src/components/settings_modal/tabs/profile_tab.js b/src/components/settings_modal/tabs/profile_tab.js index 3cb3ae45..dee17450 100644 --- a/src/components/settings_modal/tabs/profile_tab.js +++ b/src/components/settings_modal/tabs/profile_tab.js @@ -120,8 +120,11 @@ const ProfileTab = { const src = this.$store.state.users.currentUser.cover_photo return (!src) ? this.defaultBanner : src }, + groupActorAvailable () { + return this.$store.state.instance.groupActorAvailable + }, availableActorTypes () { - return this.$store.state.instance.groupActorAvailable ? ['Person', 'Service', 'Group'] : ['Person', 'Service'] + return this.groupActorAvailable ? ['Person', 'Service', 'Group'] : ['Person', 'Service'] } }, methods: { diff --git a/src/components/settings_modal/tabs/profile_tab.vue b/src/components/settings_modal/tabs/profile_tab.vue index e6dc5987..de5219a7 100644 --- a/src/components/settings_modal/tabs/profile_tab.vue +++ b/src/components/settings_modal/tabs/profile_tab.vue @@ -122,6 +122,11 @@

+
+ + {{ $t('settings.actor_type_description') }} + +

Date: Wed, 27 Dec 2023 22:40:07 -0500 Subject: Make user card group-aware --- src/components/user_card/user_card.vue | 8 +++++++- src/i18n/en.json | 1 + 2 files changed, 8 insertions(+), 1 deletion(-) (limited to 'src/components') diff --git a/src/components/user_card/user_card.vue b/src/components/user_card/user_card.vue index 2de14063..2c76a220 100644 --- a/src/components/user_card/user_card.vue +++ b/src/components/user_card/user_card.vue @@ -124,11 +124,17 @@ {{ $t(`general.role.${visibleRole}`) }} {{ $t('user_card.bot') }} + + {{ $t('user_card.group') }} + Date: Wed, 27 Dec 2023 22:54:44 -0500 Subject: Implement indicator for groups --- src/components/settings_modal/tabs/filtering_tab.vue | 2 +- src/components/status/status.js | 10 ++-------- src/components/status/status.vue | 6 +++--- src/components/user_avatar/user_avatar.js | 8 +++++--- src/components/user_avatar/user_avatar.vue | 11 ++++++++--- src/i18n/en.json | 2 +- 6 files changed, 20 insertions(+), 19 deletions(-) (limited to 'src/components') diff --git a/src/components/settings_modal/tabs/filtering_tab.vue b/src/components/settings_modal/tabs/filtering_tab.vue index 89fdef1a..9e82fcfd 100644 --- a/src/components/settings_modal/tabs/filtering_tab.vue +++ b/src/components/settings_modal/tabs/filtering_tab.vue @@ -51,7 +51,7 @@

  • - {{ $t('settings.hide_bot_indication') }} + {{ $t('settings.hide_actor_type_indication') }}
  • @@ -133,7 +133,7 @@ >
    diff --git a/src/components/user_avatar/user_avatar.js b/src/components/user_avatar/user_avatar.js index 33d9a258..ffd81f87 100644 --- a/src/components/user_avatar/user_avatar.js +++ b/src/components/user_avatar/user_avatar.js @@ -3,11 +3,13 @@ import StillImage from '../still-image/still-image.vue' import { library } from '@fortawesome/fontawesome-svg-core' import { - faRobot + faRobot, + faPeopleGroup } from '@fortawesome/free-solid-svg-icons' library.add( - faRobot + faRobot, + faPeopleGroup ) const UserAvatar = { @@ -15,7 +17,7 @@ const UserAvatar = { 'user', 'betterShadow', 'compact', - 'bot' + 'showActorTypeIndicator' ], data () { return { diff --git a/src/components/user_avatar/user_avatar.vue b/src/components/user_avatar/user_avatar.vue index 91c17611..3cbccec3 100644 --- a/src/components/user_avatar/user_avatar.vue +++ b/src/components/user_avatar/user_avatar.vue @@ -18,9 +18,14 @@ :class="{ '-compact': compact }" /> + @@ -79,7 +84,7 @@ height: 100%; } - .bot-indicator { + .actor-type-indicator { position: absolute; bottom: 0; right: 0; diff --git a/src/i18n/en.json b/src/i18n/en.json index bb93f26f..71098822 100644 --- a/src/i18n/en.json +++ b/src/i18n/en.json @@ -499,7 +499,7 @@ "hide_media_previews": "Hide media previews", "hide_muted_posts": "Hide posts of muted users", "mute_bot_posts": "Mute bot posts", - "hide_bot_indication": "Hide bot indication in posts", + "hide_actor_type_indication": "Hide actor type (bots, groups, etc.) indication in posts", "hide_scrobbles": "Hide scrobbles", "hide_all_muted_posts": "Hide muted posts", "max_thumbnails": "Maximum amount of thumbnails per post (empty = no limit)", -- cgit v1.2.3-70-g09d2 From a709127a3c9b20d9d6cca6d9d4f00754a4726428 Mon Sep 17 00:00:00 2001 From: tusooa Date: Wed, 27 Dec 2023 22:55:58 -0500 Subject: Use actor type to determine whether a user is a bot --- src/components/status/status.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/components') diff --git a/src/components/status/status.js b/src/components/status/status.js index 458c8554..8f22b708 100644 --- a/src/components/status/status.js +++ b/src/components/status/status.js @@ -233,7 +233,7 @@ const Status = { return muteWordHits(this.status, this.muteWords) }, botStatus () { - return this.status.user.bot + return this.status.user.actor_type === 'Service' }, showActorTypeIndicator () { return !this.hideBotIndication -- cgit v1.2.3-70-g09d2 From 6f452d672fe740035cf1d29d03bcda0d39438753 Mon Sep 17 00:00:00 2001 From: marcin mikołajczak Date: Thu, 28 Dec 2023 10:43:06 +0100 Subject: Display public favorites on user profiles MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: marcin mikołajczak --- changelog.d/public-favorites.add | 1 + src/components/user_profile/user_profile.js | 5 +++++ src/components/user_profile/user_profile.vue | 3 ++- src/services/api/api.service.js | 6 ++++++ src/services/entity_normalizer/entity_normalizer.service.js | 1 + 5 files changed, 15 insertions(+), 1 deletion(-) create mode 100644 changelog.d/public-favorites.add (limited to 'src/components') diff --git a/changelog.d/public-favorites.add b/changelog.d/public-favorites.add new file mode 100644 index 00000000..183fcc85 --- /dev/null +++ b/changelog.d/public-favorites.add @@ -0,0 +1 @@ +Display public favorites on user profiles \ No newline at end of file diff --git a/src/components/user_profile/user_profile.js b/src/components/user_profile/user_profile.js index acb612ed..751bfd5a 100644 --- a/src/components/user_profile/user_profile.js +++ b/src/components/user_profile/user_profile.js @@ -80,6 +80,9 @@ const UserProfile = { followersTabVisible () { return this.isUs || !this.user.hide_followers }, + favoritesTabVisible () { + return this.isUs || !this.user.hide_favorites + }, formattedBirthday () { const browserLocale = localeService.internalToBrowserLocale(this.$i18n.locale) return this.user.birthday && new Date(Date.parse(this.user.birthday)).toLocaleDateString(browserLocale, { timeZone: 'UTC', day: 'numeric', month: 'long', year: 'numeric' }) @@ -103,6 +106,8 @@ const UserProfile = { startFetchingTimeline('user', userId) startFetchingTimeline('media', userId) if (this.isUs) { + startFetchingTimeline('favorites') + } else if (!this.user.hide_favorites) { startFetchingTimeline('favorites', userId) } // Fetch all pinned statuses immediately diff --git a/src/components/user_profile/user_profile.vue b/src/components/user_profile/user_profile.vue index c63a303c..d0618dbb 100644 --- a/src/components/user_profile/user_profile.vue +++ b/src/components/user_profile/user_profile.vue @@ -109,7 +109,7 @@ :footer-slipgate="footerRef" /> diff --git a/src/services/api/api.service.js b/src/services/api/api.service.js index bde2e163..19de07f7 100644 --- a/src/services/api/api.service.js +++ b/src/services/api/api.service.js @@ -108,6 +108,7 @@ const PLEROMA_POST_ANNOUNCEMENT_URL = '/api/v1/pleroma/admin/announcements' const PLEROMA_EDIT_ANNOUNCEMENT_URL = id => `/api/v1/pleroma/admin/announcements/${id}` const PLEROMA_DELETE_ANNOUNCEMENT_URL = id => `/api/v1/pleroma/admin/announcements/${id}` const PLEROMA_SCROBBLES_URL = id => `/api/v1/pleroma/accounts/${id}/scrobbles` +const PLEROMA_USER_FAVORITES_TIMELINE_URL = id => `/api/v1/pleroma/accounts/${id}/favourites` const PLEROMA_ADMIN_CONFIG_URL = '/api/pleroma/admin/config' const PLEROMA_ADMIN_DESCRIPTIONS_URL = '/api/pleroma/admin/config/descriptions' @@ -690,6 +691,7 @@ const fetchTimeline = ({ media: MASTODON_USER_TIMELINE_URL, list: MASTODON_LIST_TIMELINE_URL, favorites: MASTODON_USER_FAVORITES_TIMELINE_URL, + publicFavorites: PLEROMA_USER_FAVORITES_TIMELINE_URL, tag: MASTODON_TAG_TIMELINE_URL, bookmarks: MASTODON_BOOKMARK_TIMELINE_URL } @@ -698,6 +700,10 @@ const fetchTimeline = ({ let url = timelineUrls[timeline] + if (timeline === 'favorites' && userId) { + url = timelineUrls.publicFavorites(userId) + } + if (timeline === 'user' || timeline === 'media') { url = url(userId) } diff --git a/src/services/entity_normalizer/entity_normalizer.service.js b/src/services/entity_normalizer/entity_normalizer.service.js index 85da5223..97b5beb5 100644 --- a/src/services/entity_normalizer/entity_normalizer.service.js +++ b/src/services/entity_normalizer/entity_normalizer.service.js @@ -107,6 +107,7 @@ export const parseUser = (data) => { output.allow_following_move = data.pleroma.allow_following_move + output.hide_favorites = data.pleroma.hide_favorites output.hide_follows = data.pleroma.hide_follows output.hide_followers = data.pleroma.hide_followers output.hide_follows_count = data.pleroma.hide_follows_count -- cgit v1.2.3-70-g09d2 From 82c00449638a7aa06b63454f6dc5a44924a6d36e Mon Sep 17 00:00:00 2001 From: tusooa Date: Tue, 25 Jul 2023 10:46:27 -0400 Subject: Show a dedicated registration notice page when further action is required after registering --- changelog.d/registration-notice.add | 1 + src/components/registration/registration.js | 10 ++++++++-- src/components/registration/registration.vue | 14 +++++++++++++- src/modules/users.js | 21 ++++++++++++++++++--- 4 files changed, 40 insertions(+), 6 deletions(-) create mode 100644 changelog.d/registration-notice.add (limited to 'src/components') diff --git a/changelog.d/registration-notice.add b/changelog.d/registration-notice.add new file mode 100644 index 00000000..b2777ba2 --- /dev/null +++ b/changelog.d/registration-notice.add @@ -0,0 +1 @@ +Show a dedicated registration notice page when further action is required after registering diff --git a/src/components/registration/registration.js b/src/components/registration/registration.js index b88bdeec..ca1fed94 100644 --- a/src/components/registration/registration.js +++ b/src/components/registration/registration.js @@ -83,6 +83,8 @@ const registration = { signedIn: (state) => !!state.users.currentUser, isPending: (state) => state.users.signUpPending, serverValidationErrors: (state) => state.users.signUpErrors, + signUpNotice: (state) => state.users.signUpNotice, + hasSignUpNotice: (state) => !!state.users.signUpNotice.message, termsOfService: (state) => state.instance.tos, accountActivationRequired: (state) => state.instance.accountActivationRequired, accountApprovalRequired: (state) => state.instance.accountApprovalRequired, @@ -107,8 +109,12 @@ const registration = { if (!this.v$.$invalid) { try { - await this.signUp(this.user) - this.$router.push({ name: 'friends' }) + const status = await this.signUp(this.user) + if (status === 'ok') { + this.$router.push({ name: 'friends' }) + } else { + // display sign up notice, do not switch anywhere + } } catch (error) { console.warn('Registration failed: ', error) this.setCaptcha() diff --git a/src/components/registration/registration.vue b/src/components/registration/registration.vue index 7438a5f4..5c913f94 100644 --- a/src/components/registration/registration.vue +++ b/src/components/registration/registration.vue @@ -3,7 +3,10 @@
    {{ $t('registration.registration') }}
    -
    +
    +
    +

    + {{ signUpNotice.message }} +

    +
    @@ -404,6 +412,10 @@ $validations-cRed: #f04124; } } +.registration-notice { + margin: 0.6em; +} + @media all and (max-width: 800px) { .registration-form .container { flex-direction: column-reverse; diff --git a/src/modules/users.js b/src/modules/users.js index 6467d732..b8f49f15 100644 --- a/src/modules/users.js +++ b/src/modules/users.js @@ -250,6 +250,7 @@ export const mutations = { signUpPending (state) { state.signUpPending = true state.signUpErrors = [] + state.signUpNotice = {} }, signUpSuccess (state) { state.signUpPending = false @@ -257,6 +258,12 @@ export const mutations = { signUpFailure (state, errors) { state.signUpPending = false state.signUpErrors = errors + state.signUpNotice = {} + }, + signUpNotice (state, notice) { + state.signUpPending = false + state.signUpErrors = [] + state.signUpNotice = notice } } @@ -287,6 +294,7 @@ export const defaultState = { usersByNameObject: {}, signUpPending: false, signUpErrors: [], + signUpNotice: {}, relationships: {} } @@ -524,9 +532,16 @@ const users = { const data = await rootState.api.backendInteractor.register( { params: { ...userInfo } } ) - store.commit('signUpSuccess') - store.commit('setToken', data.access_token) - store.dispatch('loginUser', data.access_token) + + if (data.access_token) { + store.commit('signUpSuccess') + store.commit('setToken', data.access_token) + store.dispatch('loginUser', data.access_token) + return 'ok' + } else { // Request succeeded, but user cannot login yet. + store.commit('signUpNotice', data) + return 'request_sent' + } } catch (e) { const errors = e.message store.commit('signUpFailure', errors) -- cgit v1.2.3-70-g09d2 From 209c0a83325b9475b5ff9a4fd1ebede17d06ed63 Mon Sep 17 00:00:00 2001 From: tusooa Date: Sat, 13 Jan 2024 17:44:13 -0500 Subject: Remove empty else branch and detail the comments --- src/components/registration/registration.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/components') diff --git a/src/components/registration/registration.js b/src/components/registration/registration.js index ca1fed94..78d31980 100644 --- a/src/components/registration/registration.js +++ b/src/components/registration/registration.js @@ -112,9 +112,9 @@ const registration = { const status = await this.signUp(this.user) if (status === 'ok') { this.$router.push({ name: 'friends' }) - } else { - // display sign up notice, do not switch anywhere } + // If status is not 'ok' (i.e. it needs further actions to be done + // before you can login), display sign up notice, do not switch anywhere } catch (error) { console.warn('Registration failed: ', error) this.setCaptcha() -- cgit v1.2.3-70-g09d2 From 88a006eb1afeb6cad26daffa428baf706210f008 Mon Sep 17 00:00:00 2001 From: Phantasm Date: Wed, 17 Jan 2024 13:23:33 +0000 Subject: Add ability to hide custom emojis in picker --- changelog.d/hide-custom-emojis-in-picker.add | 1 + src/components/emoji_picker/emoji_picker.js | 3 ++- src/components/emoji_picker/emoji_picker.scss | 7 ++++++- src/components/emoji_picker/emoji_picker.vue | 11 +++++++++++ src/i18n/en.json | 1 + 5 files changed, 21 insertions(+), 2 deletions(-) create mode 100644 changelog.d/hide-custom-emojis-in-picker.add (limited to 'src/components') diff --git a/changelog.d/hide-custom-emojis-in-picker.add b/changelog.d/hide-custom-emojis-in-picker.add new file mode 100644 index 00000000..4cfd2ca8 --- /dev/null +++ b/changelog.d/hide-custom-emojis-in-picker.add @@ -0,0 +1 @@ +Allow hiding custom emojis in picker. diff --git a/src/components/emoji_picker/emoji_picker.js b/src/components/emoji_picker/emoji_picker.js index 30c01aa5..eb665c40 100644 --- a/src/components/emoji_picker/emoji_picker.js +++ b/src/components/emoji_picker/emoji_picker.js @@ -114,6 +114,7 @@ const EmojiPicker = { groupsScrolledClass: 'scrolled-top', keepOpen: false, customEmojiTimeout: null, + hideCustomEmojiInPicker: false, // Lazy-load only after the first time `showing` becomes true. contentLoaded: false, groupRefs: {}, @@ -286,7 +287,7 @@ const EmojiPicker = { return 0 }, allCustomGroups () { - if (this.hideCustomEmoji) { + if (this.hideCustomEmoji || this.hideCustomEmojiInPicker) { return {} } const emojis = this.$store.getters.groupedCustomEmojis diff --git a/src/components/emoji_picker/emoji_picker.scss b/src/components/emoji_picker/emoji_picker.scss index 5bcff33b..aab9251d 100644 --- a/src/components/emoji_picker/emoji_picker.scss +++ b/src/components/emoji_picker/emoji_picker.scss @@ -39,11 +39,16 @@ $emoji-picker-emoji-size: 32px; } .keep-open, - .too-many-emoji { + .too-many-emoji, + .hide-custom-emoji { padding: 7px; line-height: normal; } + .hide-custom-emoji { + padding-top: 0; + } + .too-many-emoji { display: flex; flex-direction: column; diff --git a/src/components/emoji_picker/emoji_picker.vue b/src/components/emoji_picker/emoji_picker.vue index 0788f34c..1231ce2b 100644 --- a/src/components/emoji_picker/emoji_picker.vue +++ b/src/components/emoji_picker/emoji_picker.vue @@ -142,6 +142,17 @@ {{ $t('emoji.keep_open') }}
    +
    + + {{ $t('emoji.hide_custom_emoji') }} + +