diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 6c607eeea..692e71fd5 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -73,7 +73,7 @@ test: e2e-pleroma: stage: test - image: mcr.microsoft.com/playwright:v1.61.0-jammy + image: mcr.microsoft.com/playwright:v1.57.0-jammy services: - name: postgres:15-alpine alias: db diff --git a/.woodpecker/test-e2e.yaml b/.woodpecker/test-e2e.yaml index 2a7d1511d..a5289bd78 100644 --- a/.woodpecker/test-e2e.yaml +++ b/.woodpecker/test-e2e.yaml @@ -25,7 +25,7 @@ variables: steps: test: - image: mcr.microsoft.com/playwright:v1.61.0-jammy + image: mcr.microsoft.com/playwright:v1.57.0-jammy entrypoint: *script_file_entrypoint environment: APT_CACHE_DIR: apt-cache diff --git a/.woodpecker/test.yaml b/.woodpecker/test.yaml index 89f6f2f93..acc48aacc 100644 --- a/.woodpecker/test.yaml +++ b/.woodpecker/test.yaml @@ -25,7 +25,7 @@ variables: steps: test: - image: mcr.microsoft.com/playwright:v1.61.0-jammy + image: mcr.microsoft.com/playwright:v1.57.0-jammy environment: APT_CACHE_DIR: apt-cache DEBIAN_FRONTEND: noninteractive diff --git a/biome.json b/biome.json index 5ef6f79ee..6a464a0e5 100644 --- a/biome.json +++ b/biome.json @@ -46,7 +46,6 @@ "noUnusedLabels": "error", "noUnusedPrivateClassMembers": "error", "noUnusedVariables": "error", - "noUnusedImports": "error", "useIsNan": "error", "useValidForDirection": "error", "useValidTypeof": "error", diff --git a/build/sw_plugin.js b/build/sw_plugin.js index 2f0a4819d..f278d55f6 100644 --- a/build/sw_plugin.js +++ b/build/sw_plugin.js @@ -1,3 +1,4 @@ +import { readFile } from 'node:fs/promises' import { dirname, resolve } from 'node:path' import { fileURLToPath } from 'node:url' import { exactRegex } from '@rolldown/pluginutils' diff --git a/docker/e2e/Dockerfile.e2e b/docker/e2e/Dockerfile.e2e index 7e3fbfbf1..e84359ceb 100644 --- a/docker/e2e/Dockerfile.e2e +++ b/docker/e2e/Dockerfile.e2e @@ -1,4 +1,4 @@ -FROM mcr.microsoft.com/playwright:v1.61.0-jammy +FROM mcr.microsoft.com/playwright:v1.57.0-jammy WORKDIR /app diff --git a/src/App.js b/src/App.js index 7de7a0696..ea2271a75 100644 --- a/src/App.js +++ b/src/App.js @@ -21,6 +21,9 @@ import { useInterfaceStore } from 'src/stores/interface.js' import { useMergedConfigStore } from 'src/stores/merged_config.js' import { useShoutStore } from 'src/stores/shout.js' +import messages from 'src/i18n/messages' +import localeService from 'src/services/locale/locale.service.js' + // Helper to unwrap reactive proxies window.toValue = (x) => JSON.parse(JSON.stringify(x)) diff --git a/src/api/admin.js b/src/api/admin.js index 79eac9bd6..975a7386e 100644 --- a/src/api/admin.js +++ b/src/api/admin.js @@ -1,5 +1,7 @@ import { promisedRequest } from './helpers.js' +import { RegistrationError, StatusCodeError } from 'src/services/errors/errors' + const REPORTS = '/api/v1/pleroma/admin/reports' const CONFIG_URL = '/api/v1/pleroma/admin/config' const DESCRIPTIONS_URL = '/api/v1/pleroma/admin/config/descriptions' diff --git a/src/api/helpers.js b/src/api/helpers.js index 40b879232..5fb11a183 100644 --- a/src/api/helpers.js +++ b/src/api/helpers.js @@ -1,6 +1,6 @@ import { snakeCase } from 'lodash' -import { StatusCodeError } from 'src/services/errors/errors' +import { RegistrationError, StatusCodeError } from 'src/services/errors/errors' export const paramsString = (params = {}) => { if (params == null || params === undefined) return '' diff --git a/src/api/oauth.js b/src/api/oauth.js index f0fd2950d..b774b3f6c 100644 --- a/src/api/oauth.js +++ b/src/api/oauth.js @@ -1,3 +1,5 @@ +import { reduce } from 'lodash' + import { paramsString, promisedRequest } from './helpers.js' const REDIRECT_URI = `${window.location.origin}/oauth-callback` diff --git a/src/api/public.js b/src/api/public.js index e001ba749..bd3f56fce 100644 --- a/src/api/public.js +++ b/src/api/public.js @@ -1,11 +1,13 @@ import { paramsString, promisedRequest } from './helpers.js' -import { MASTODON_USER_TIMELINE_URL } from './timelines.js' import { + parseLinkHeaderPagination, + parseNotification, parseSource, parseStatus, parseUser, } from 'src/services/entity_normalizer/entity_normalizer.service.js' +import { RegistrationError, StatusCodeError } from 'src/services/errors/errors' const MASTODON_SUGGESTIONS_URL = '/api/v1/suggestions' const MASTODON_LOGIN_URL = '/api/v1/accounts/verify_credentials' @@ -13,6 +15,15 @@ const MASTODON_REGISTRATION_URL = '/api/v1/accounts' const MASTODON_PASSWORD_RESET_URL = ({ email }) => `/auth/password${paramsString({ email })}` +const MASTODON_USER_NOTIFICATIONS_URL = ({ + minId, + sinceId, + maxId, + limit, + includeTypes, + replyVisibility, +}) => + `/api/v1/notifications${paramsString({ minId, sinceId, maxId, limit, includeTypes, replyVisibility })}` const MASTODON_FOLLOWING_URL = ( id, { minId, maxId, sinceId, limit, withRelationships }, @@ -24,6 +35,84 @@ const MASTODON_FOLLOWERS_URL = ( ) => `/api/v1/accounts/${id}/followers${paramsString({ minId, maxId, sinceId, limit, withRelationships })}` +const MASTODON_USER_HOME_TIMELINE_URL = ({ + minId, + sinceId, + maxId, + limit, + replyVisibility, +}) => + `/api/v1/timelines/home${paramsString({ minId, sinceId, maxId, limit, replyVisibility })}` +const MASTODON_LIST_TIMELINE_URL = ( + id, + { minId, sinceId, maxId, limit, replyVisibility }, +) => + `/api/v1/timelines/list/${id}${paramsString({ minId, sinceId, maxId, limit, replyVisibility })}` +const MASTODON_DIRECT_MESSAGES_TIMELINE_URL = ({ + minId, + sinceId, + maxId, + limit, + replyVisibility, +}) => + `/api/v1/timelines/direct${paramsString({ minId, sinceId, maxId, limit, replyVisibility })}` +const MASTODON_PUBLIC_TIMELINE = ({ + minId, + sinceId, + maxId, + limit, + replyVisibility, + local, + remote, + onlyMedia, +}) => + `/api/v1/timelines/public${paramsString({ minId, sinceId, maxId, limit, replyVisibility, local, remote, onlyMedia })}` +const MASTODON_TAG_TIMELINE_URL = ( + tag, + { minId, sinceId, maxId, limit, replyVisibility }, +) => + `/api/v1/timelines/tag/${tag}${paramsString({ minId, sinceId, maxId, limit, replyVisibility })}` +const MASTODON_USER_TIMELINE_URL = ( + id, + { minId, sinceId, maxId, limit, replyVisibility, pinned, onlyMedia }, +) => + `/api/v1/accounts/${id}/statuses${paramsString({ minId, sinceId, maxId, limit, replyVisibility, pinned, onlyMedia })}` +const MASTODON_USER_FAVORITES_TIMELINE_URL = ({ + minId, + sinceId, + maxId, + limit, + replyVisibility, +}) => + `/api/v1/favourites${paramsString({ minId, sinceId, maxId, limit, replyVisibility })}` +const MASTODON_BOOKMARK_TIMELINE_URL = ({ + minId, + sinceId, + maxId, + limit, + replyVisibility, + folderId, +}) => + `/api/v1/bookmarks${paramsString({ minId, sinceId, maxId, limit, replyVisibility, folderId })}` +const PLEROMA_STATUS_QUOTES_URL = ( + id, + { minId, sinceId, maxId, limit, replyVisibility }, +) => + `/api/v1/pleroma/statuses/${id}/quotes${paramsString({ minId, sinceId, maxId, limit, replyVisibility })}` +const PLEROMA_USER_FAVORITES_TIMELINE_URL = ( + id, + { minId, sinceId, maxId, limit, replyVisibility }, +) => + `/api/v1/pleroma/accounts/${id}/favourites${paramsString({ minId, sinceId, maxId, limit, replyVisibility })}` +const AKKOMA_BUBBLE_TIMELINE_URL = ({ + minId, + sinceId, + maxId, + limit, + replyVisibility, +}) => + `/api/v1/timelines/bubble${paramsString({ minId, sinceId, maxId, limit, replyVisibility })}` + export const MASTODON_STATUS_URL = (id) => `/api/v1/statuses/${id}` const MASTODON_STATUS_CONTEXT_URL = (id) => `/api/v1/statuses/${id}/context` const MASTODON_STATUS_SOURCE_URL = (id) => `/api/v1/statuses/${id}/source` @@ -142,26 +231,38 @@ export const fetchConversation = ({ id, credentials }) => promisedRequest({ url: MASTODON_STATUS_CONTEXT_URL(id), credentials, - }).then((result) => ({ - ...result, - data: { - ...result.data, - ancestors: result.data.ancestors.map(parseStatus), - descendants: result.data.descendants.map(parseStatus), - }, - })) + }) + .then((result) => ({ + ...result, + data: { + ...result.data, + ancestors: result.data.ancestors.map(parseStatus), + descendants: result.data.descendants.map(parseStatus), + }, + })) + .catch((error) => { + throw new Error('Error fetching timeline', error) + }) export const fetchStatus = ({ id, credentials }) => promisedRequest({ url: MASTODON_STATUS_URL(id), credentials, - }).then(({ data, ...rest }) => ({ ...rest, data: parseStatus(data) })) + }) + .then(({ data, ...rest }) => ({ ...rest, data: parseStatus(data) })) + .catch((error) => { + throw new Error('Error fetching timeline', error) + }) export const fetchStatusSource = ({ id, credentials }) => promisedRequest({ url: MASTODON_STATUS_SOURCE_URL(id), credentials, - }).then(({ data, ...rest }) => ({ ...rest, data: parseSource(data) })) + }) + .then(({ data, ...rest }) => ({ ...rest, data: parseSource(data) })) + .catch((error) => { + throw new Error('Error fetching timeline', error) + }) export const fetchStatusHistory = ({ status, credentials }) => promisedRequest({ @@ -174,6 +275,109 @@ export const fetchStatusHistory = ({ status, credentials }) => }) }) +export const fetchTimeline = ({ + timeline, + credentials, + sinceId, + minId, + maxId, + userId, + listId, + statusId, + tag, + withMuted, + replyVisibility = 'all', + includeTypes = [], + bookmarkFolderId, +}) => { + const timelineUrls = { + friends: MASTODON_USER_HOME_TIMELINE_URL, + public: MASTODON_PUBLIC_TIMELINE, + publicAndExternal: MASTODON_PUBLIC_TIMELINE, + dms: MASTODON_DIRECT_MESSAGES_TIMELINE_URL, + user: MASTODON_USER_TIMELINE_URL, + media: MASTODON_USER_TIMELINE_URL, + list: MASTODON_LIST_TIMELINE_URL, + favorites: MASTODON_USER_FAVORITES_TIMELINE_URL, + publicFavorites: PLEROMA_USER_FAVORITES_TIMELINE_URL, + bookmarks: MASTODON_BOOKMARK_TIMELINE_URL, + bubble: AKKOMA_BUBBLE_TIMELINE_URL, + tag: MASTODON_TAG_TIMELINE_URL, + quotes: PLEROMA_STATUS_QUOTES_URL, + + notifications: MASTODON_USER_NOTIFICATIONS_URL, + } + const urlFunc = timelineUrls[timeline] + + const twoArgs = new Set([ + 'user', + 'media', + 'list', + 'publicFavorites', + 'tag', + 'quotes', + ]) + + const params = { + minId, + sinceId, + maxId, + limit: 20, + } + + const id = (() => { + switch (timeline) { + case 'user': + case 'media': + return userId + case 'list': + return listId + case 'quotes': + return statusId + case 'tag': + return tag + } + })() + + const isNotifications = timeline === 'notifications' + + if (timeline === 'media') { + params.onlyMedia = true + } + if (timeline === 'public') { + params.local = true + } + if (timeline !== 'favorites' && timeline !== 'bookmarks') { + params.withMuted = withMuted + } + if (replyVisibility !== 'all') { + params.replyVisibility = replyVisibility + } + if (timeline === 'bookmarks' && bookmarkFolderId) { + params.folderId = bookmarkFolderId + } + + if (isNotifications && includeTypes.length > 0) { + params.includeTypes = includeTypes + } + + const url = twoArgs.has(timeline) ? urlFunc(id, params) : urlFunc(params) + return promisedRequest({ url, credentials }).then((result) => { + const pagination = parseLinkHeaderPagination( + result.response.headers.get('Link'), + { + flakeId: timeline !== 'bookmarks' && timeline !== 'notifications', + }, + ) + + return { + ...result, + data: result.data.map(isNotifications ? parseNotification : parseStatus), + pagination, + } + }) +} + export const listEmojiPacks = ({ page, pageSize, credentials }) => promisedRequest({ url: EMOJI_PACKS_URL(page, pageSize), @@ -263,11 +467,15 @@ export const search2 = ({ withRelationships: true, }), credentials, - }).then(({ data, ...rest }) => { - data.accounts = data.accounts.slice(0, limit).map((u) => parseUser(u)) - data.statuses = data.statuses.slice(0, limit).map((s) => parseStatus(s)) - return { ...rest, data } }) + .then(({ data, ...rest }) => { + data.accounts = data.accounts.slice(0, limit).map((u) => parseUser(u)) + data.statuses = data.statuses.slice(0, limit).map((s) => parseStatus(s)) + return { ...rest, data } + }) + .catch((error) => { + throw new Error('Error fetching timeline', error) + }) } export const fetchKnownDomains = ({ credentials }) => diff --git a/src/api/timelines.js b/src/api/timelines.js deleted file mode 100644 index 0679b1eec..000000000 --- a/src/api/timelines.js +++ /dev/null @@ -1,198 +0,0 @@ -import { paramsString, promisedRequest } from './helpers.js' - -import { - parseLinkHeaderPagination, - parseNotification, - parseStatus, -} from 'src/services/entity_normalizer/entity_normalizer.service.js' - -const MASTODON_USER_HOME_TIMELINE_URL = ({ - minId, - sinceId, - maxId, - limit, - replyVisibility, -}) => - `/api/v1/timelines/home${paramsString({ minId, sinceId, maxId, limit, replyVisibility })}` -const MASTODON_LIST_TIMELINE_URL = ( - id, - { minId, sinceId, maxId, limit, replyVisibility }, -) => - `/api/v1/timelines/list/${id}${paramsString({ minId, sinceId, maxId, limit, replyVisibility })}` -const MASTODON_DIRECT_MESSAGES_TIMELINE_URL = ({ - minId, - sinceId, - maxId, - limit, - replyVisibility, -}) => - `/api/v1/timelines/direct${paramsString({ minId, sinceId, maxId, limit, replyVisibility })}` -const MASTODON_PUBLIC_TIMELINE = ({ - minId, - sinceId, - maxId, - limit, - replyVisibility, - local, - remote, - onlyMedia, -}) => - `/api/v1/timelines/public${paramsString({ minId, sinceId, maxId, limit, replyVisibility, local, remote, onlyMedia })}` -const MASTODON_TAG_TIMELINE_URL = ( - tag, - { minId, sinceId, maxId, limit, replyVisibility }, -) => - `/api/v1/timelines/tag/${tag}${paramsString({ minId, sinceId, maxId, limit, replyVisibility })}` -export const MASTODON_USER_TIMELINE_URL = ( - id, - { minId, sinceId, maxId, limit, replyVisibility, pinned, onlyMedia }, -) => - `/api/v1/accounts/${id}/statuses${paramsString({ minId, sinceId, maxId, limit, replyVisibility, pinned, onlyMedia })}` -const MASTODON_USER_FAVORITES_TIMELINE_URL = ({ - minId, - sinceId, - maxId, - limit, - replyVisibility, -}) => - `/api/v1/favourites${paramsString({ minId, sinceId, maxId, limit, replyVisibility })}` -const MASTODON_BOOKMARK_TIMELINE_URL = ({ - minId, - sinceId, - maxId, - limit, - replyVisibility, - folderId, -}) => - `/api/v1/bookmarks${paramsString({ minId, sinceId, maxId, limit, replyVisibility, folderId })}` -const PLEROMA_STATUS_QUOTES_URL = ( - id, - { minId, sinceId, maxId, limit, replyVisibility }, -) => - `/api/v1/pleroma/statuses/${id}/quotes${paramsString({ minId, sinceId, maxId, limit, replyVisibility })}` -const PLEROMA_USER_FAVORITES_TIMELINE_URL = ( - id, - { minId, sinceId, maxId, limit, replyVisibility }, -) => - `/api/v1/pleroma/accounts/${id}/favourites${paramsString({ minId, sinceId, maxId, limit, replyVisibility })}` -const AKKOMA_BUBBLE_TIMELINE_URL = ({ - minId, - sinceId, - maxId, - limit, - replyVisibility, -}) => - `/api/v1/timelines/bubble${paramsString({ minId, sinceId, maxId, limit, replyVisibility })}` - -const MASTODON_USER_NOTIFICATIONS_URL = ({ - minId, - sinceId, - maxId, - limit, - includeTypes, - replyVisibility, -}) => - `/api/v1/notifications${paramsString({ minId, sinceId, maxId, limit, includeTypes, replyVisibility })}` - -export const fetchTimeline = ({ - timeline, - credentials, - sinceId, - minId, - maxId, - userId, - listId, - statusId, - tag, - withMuted, - replyVisibility = 'all', - includeTypes = [], - bookmarkFolderId, -}) => { - const timelineUrls = { - friends: MASTODON_USER_HOME_TIMELINE_URL, - public: MASTODON_PUBLIC_TIMELINE, - publicAndExternal: MASTODON_PUBLIC_TIMELINE, - dms: MASTODON_DIRECT_MESSAGES_TIMELINE_URL, - user: MASTODON_USER_TIMELINE_URL, - media: MASTODON_USER_TIMELINE_URL, - list: MASTODON_LIST_TIMELINE_URL, - favorites: MASTODON_USER_FAVORITES_TIMELINE_URL, - publicFavorites: PLEROMA_USER_FAVORITES_TIMELINE_URL, - bookmarks: MASTODON_BOOKMARK_TIMELINE_URL, - bubble: AKKOMA_BUBBLE_TIMELINE_URL, - tag: MASTODON_TAG_TIMELINE_URL, - quotes: PLEROMA_STATUS_QUOTES_URL, - - notifications: MASTODON_USER_NOTIFICATIONS_URL, - } - const urlFunc = timelineUrls[timeline] - - const twoArgs = new Set([ - 'user', - 'media', - 'list', - 'publicFavorites', - 'tag', - 'quotes', - ]) - - const params = { - minId, - sinceId, - maxId, - limit: 20, - } - - const id = (() => { - switch (timeline) { - case 'user': - case 'media': - return userId - case 'list': - return listId - case 'quotes': - return statusId - case 'tag': - return tag - } - })() - - const isNotifications = timeline === 'notifications' - - if (timeline === 'media') { - params.onlyMedia = true - } - if (timeline === 'public') { - params.local = true - } - if (timeline !== 'favorites' && timeline !== 'bookmarks') { - params.withMuted = withMuted - } - if (replyVisibility !== 'all') { - params.replyVisibility = replyVisibility - } - if (timeline === 'bookmarks' && bookmarkFolderId) { - params.folderId = bookmarkFolderId - } - - if (isNotifications && includeTypes.length > 0) { - params.includeTypes = includeTypes - } - - const url = twoArgs.has(timeline) ? urlFunc(id, params) : urlFunc(params) - return promisedRequest({ url, credentials }).then((result) => { - const pagination = parseLinkHeaderPagination( - result.response.headers.get('Link'), - { - flakeId: timeline !== 'bookmarks' && timeline !== 'notifications', - }, - ) - - return { - ...result, - data: result.data.map(isNotifications ? parseNotification : parseStatus), - pagination, - } - }) -} diff --git a/src/api/websocket.js b/src/api/websocket.js index d952372e5..44f3d391a 100644 --- a/src/api/websocket.js +++ b/src/api/websocket.js @@ -1,4 +1,4 @@ -import { paramsString } from './helpers.js' +import { paramsString, promisedRequest } from './helpers.js' import { parseChat, diff --git a/src/boot/after_store.js b/src/boot/after_store.js index 0b4825ca0..95fb3e9ea 100644 --- a/src/boot/after_store.js +++ b/src/boot/after_store.js @@ -28,6 +28,7 @@ import { } from '../services/window_utils/window_utils' import routes from './routes' +import { useAnnouncementsStore } from 'src/stores/announcements' import { useAuthFlowStore } from 'src/stores/auth_flow' import { useEmojiStore } from 'src/stores/emoji.js' import { useI18nStore } from 'src/stores/i18n' diff --git a/src/components/attachment/attachment.js b/src/components/attachment/attachment.js index d5bce12a7..4b733258f 100644 --- a/src/components/attachment/attachment.js +++ b/src/components/attachment/attachment.js @@ -2,6 +2,7 @@ import { mapState } from 'pinia' import { defineAsyncComponent } from 'vue' import Popover from 'src/components/popover/popover.vue' +import VideoAttachment from 'src/components/video_attachment/video_attachment.vue' import nsfwImage from '../../assets/nsfw.png' import { useInstanceStore } from 'src/stores/instance.js' diff --git a/src/components/chat_message/chat_message.js b/src/components/chat_message/chat_message.js index 2066a8194..ba06172ed 100644 --- a/src/components/chat_message/chat_message.js +++ b/src/components/chat_message/chat_message.js @@ -1,5 +1,6 @@ import { mapState as mapPiniaState } from 'pinia' -import { mapState } from 'vuex' +import { defineAsyncComponent } from 'vue' +import { mapGetters, mapState } from 'vuex' import Attachment from 'src/components/attachment/attachment.vue' import ChatMessageDate from 'src/components/chat_message_date/chat_message_date.vue' diff --git a/src/components/chat_new/chat_new.js b/src/components/chat_new/chat_new.js index 0ee4e292b..ec2656e5c 100644 --- a/src/components/chat_new/chat_new.js +++ b/src/components/chat_new/chat_new.js @@ -5,6 +5,8 @@ import UserAvatar from 'src/components/user_avatar/user_avatar.vue' import { useOAuthStore } from 'src/stores/oauth.js' +import { chats } from 'src/api/chats.js' + import { library } from '@fortawesome/fontawesome-svg-core' import { faChevronLeft, faSearch } from '@fortawesome/free-solid-svg-icons' diff --git a/src/components/chat_title/chat_title.js b/src/components/chat_title/chat_title.js index 1d12384cc..52d4445b6 100644 --- a/src/components/chat_title/chat_title.js +++ b/src/components/chat_title/chat_title.js @@ -1,3 +1,5 @@ +import { defineAsyncComponent } from 'vue' + import UserAvatar from 'src/components/user_avatar/user_avatar.vue' import UserPopover from 'src/components/user_popover/user_popover.vue' diff --git a/src/components/emoji_input/suggestor.js b/src/components/emoji_input/suggestor.js index fe8e9e105..c9a6abcf1 100644 --- a/src/components/emoji_input/suggestor.js +++ b/src/components/emoji_input/suggestor.js @@ -1,3 +1,5 @@ +import { useEmojiStore } from 'src/stores/emoji.js' + /** * suggest - generates a suggestor function to be used by emoji-input * data: object providing source information for specific types of suggestions: diff --git a/src/components/emoji_picker/emoji_picker.js b/src/components/emoji_picker/emoji_picker.js index 6889fb8b0..bc2bb092b 100644 --- a/src/components/emoji_picker/emoji_picker.js +++ b/src/components/emoji_picker/emoji_picker.js @@ -6,6 +6,7 @@ import Popover from 'src/components/popover/popover.vue' import { ensureFinalFallback } from '../../i18n/languages.js' import { useEmojiStore } from 'src/stores/emoji.js' +import { useInstanceStore } from 'src/stores/instance.js' import { useMergedConfigStore } from 'src/stores/merged_config.js' import { library } from '@fortawesome/fontawesome-svg-core' diff --git a/src/components/lists_menu/lists_menu_content.js b/src/components/lists_menu/lists_menu_content.js index 337ee4d4f..d96f14599 100644 --- a/src/components/lists_menu/lists_menu_content.js +++ b/src/components/lists_menu/lists_menu_content.js @@ -4,6 +4,7 @@ import { mapState } from 'vuex' import { getListEntries } from 'src/components/navigation/filter.js' import NavigationEntry from 'src/components/navigation/navigation_entry.vue' +import { useInstanceStore } from 'src/stores/instance.js' import { useListsStore } from 'src/stores/lists.js' export const ListsMenuContent = { diff --git a/src/components/login_form/login_form.js b/src/components/login_form/login_form.js index a333e6970..a00db03cf 100644 --- a/src/components/login_form/login_form.js +++ b/src/components/login_form/login_form.js @@ -1,4 +1,4 @@ -import { mapActions, mapState as mapPiniaState } from 'pinia' +import { mapActions, mapState as mapPiniaState, mapStores } from 'pinia' import { mapState } from 'vuex' import { useAuthFlowStore } from 'src/stores/auth_flow.js' diff --git a/src/components/media_modal/media_modal.js b/src/components/media_modal/media_modal.js index fe5994f7c..ad53b6e31 100644 --- a/src/components/media_modal/media_modal.js +++ b/src/components/media_modal/media_modal.js @@ -1,6 +1,7 @@ import { defineAsyncComponent } from 'vue' import Modal from 'src/components/modal/modal.vue' +import StillImage from 'src/components/still-image/still-image.vue' import GestureService from '../../services/gesture_service/gesture_service' import { useMediaViewerStore } from 'src/stores/media_viewer.js' diff --git a/src/components/mention_link/mention_link.js b/src/components/mention_link/mention_link.js index 48f6d1d8e..877e83c12 100644 --- a/src/components/mention_link/mention_link.js +++ b/src/components/mention_link/mention_link.js @@ -1,5 +1,6 @@ import { mapState as mapPiniaState } from 'pinia' -import { mapState } from 'vuex' +import { defineAsyncComponent } from 'vue' +import { mapGetters, mapState } from 'vuex' import UnicodeDomainIndicator from 'src/components/unicode_domain_indicator/unicode_domain_indicator.vue' import UserAvatar from 'src/components/user_avatar/user_avatar.vue' diff --git a/src/components/moderation_tools/moderation_tools.js b/src/components/moderation_tools/moderation_tools.js index ca4852ab3..b819c72aa 100644 --- a/src/components/moderation_tools/moderation_tools.js +++ b/src/components/moderation_tools/moderation_tools.js @@ -4,6 +4,7 @@ import ConfirmModal from 'src/components/confirm_modal/confirm_modal.vue' import Popover from 'src/components/popover/popover.vue' import { useAdminSettingsStore } from 'src/stores/admin_settings.js' +import { useInstanceStore } from 'src/stores/instance.js' import { useInstanceCapabilitiesStore } from 'src/stores/instance_capabilities.js' import { library } from '@fortawesome/fontawesome-svg-core' diff --git a/src/components/post_status_form/post_status_form.js b/src/components/post_status_form/post_status_form.js index 4d9c34546..c564355f3 100644 --- a/src/components/post_status_form/post_status_form.js +++ b/src/components/post_status_form/post_status_form.js @@ -1,6 +1,7 @@ import { debounce, map, reject, uniqBy } from 'lodash' import { mapActions, mapState } from 'pinia' import { defineAsyncComponent } from 'vue' +import { mapGetters } from 'vuex' import Attachment from 'src/components/attachment/attachment.vue' import Checkbox from 'src/components/checkbox/checkbox.vue' diff --git a/src/components/post_status_modal/post_status_modal.js b/src/components/post_status_modal/post_status_modal.js index 973c2b1a5..6011281cf 100644 --- a/src/components/post_status_modal/post_status_modal.js +++ b/src/components/post_status_modal/post_status_modal.js @@ -1,4 +1,5 @@ import { get } from 'lodash' +import { defineAsyncComponent } from 'vue' import Modal from 'src/components/modal/modal.vue' import PostStatusForm from 'src/components/post_status_form/post_status_form.vue' diff --git a/src/components/quote/quote.js b/src/components/quote/quote.js index 439d3440a..3b771b3f2 100644 --- a/src/components/quote/quote.js +++ b/src/components/quote/quote.js @@ -1,3 +1,5 @@ +import { defineAsyncComponent } from 'vue' + import { library } from '@fortawesome/fontawesome-svg-core' import { faCircleNotch } from '@fortawesome/free-solid-svg-icons' diff --git a/src/components/settings_modal/admin_tabs/admin_user_card.js b/src/components/settings_modal/admin_tabs/admin_user_card.js index ba0f0e9f7..a075db010 100644 --- a/src/components/settings_modal/admin_tabs/admin_user_card.js +++ b/src/components/settings_modal/admin_tabs/admin_user_card.js @@ -1,3 +1,5 @@ +import { defineAsyncComponent } from 'vue' + import BasicUserCard from 'src/components/basic_user_card/basic_user_card.vue' import ModerationTools from 'src/components/moderation_tools/moderation_tools.vue' diff --git a/src/components/settings_modal/admin_tabs/emoji_tab.js b/src/components/settings_modal/admin_tabs/emoji_tab.js index 56361587d..f64128c57 100644 --- a/src/components/settings_modal/admin_tabs/emoji_tab.js +++ b/src/components/settings_modal/admin_tabs/emoji_tab.js @@ -2,7 +2,7 @@ import Checkbox from 'components/checkbox/checkbox.vue' import Popover from 'components/popover/popover.vue' import Select from 'components/select/select.vue' import StillImage from 'components/still-image/still-image.vue' -import { clone } from 'lodash' +import { assign, clone } from 'lodash' import { defineAsyncComponent } from 'vue' import TabSwitcher from 'src/components/tab_switcher/tab_switcher.jsx' diff --git a/src/components/settings_modal/admin_tabs/users_tab.js b/src/components/settings_modal/admin_tabs/users_tab.js index 68bc46aa2..ab40c723a 100644 --- a/src/components/settings_modal/admin_tabs/users_tab.js +++ b/src/components/settings_modal/admin_tabs/users_tab.js @@ -1,3 +1,5 @@ +import { isEmpty } from 'lodash' + import BasicUserCard from 'src/components/basic_user_card/basic_user_card.vue' import Checkbox from 'src/components/checkbox/checkbox.vue' import List from 'src/components/list/list.vue' diff --git a/src/components/settings_modal/helpers/setting.js b/src/components/settings_modal/helpers/setting.js index 3b76708fe..b9ff08bb5 100644 --- a/src/components/settings_modal/helpers/setting.js +++ b/src/components/settings_modal/helpers/setting.js @@ -5,6 +5,7 @@ import LocalSettingIndicator from './local_setting_indicator.vue' import ModifiedIndicator from './modified_indicator.vue' import { useAdminSettingsStore } from 'src/stores/admin_settings.js' +import { useInstanceStore } from 'src/stores/instance.js' import { useInterfaceStore } from 'src/stores/interface.js' import { useLocalConfigStore } from 'src/stores/local_config.js' import { useMergedConfigStore } from 'src/stores/merged_config.js' diff --git a/src/components/settings_modal/helpers/vertical_tab_switcher.jsx b/src/components/settings_modal/helpers/vertical_tab_switcher.jsx index 61ed6bee1..cbe1be158 100644 --- a/src/components/settings_modal/helpers/vertical_tab_switcher.jsx +++ b/src/components/settings_modal/helpers/vertical_tab_switcher.jsx @@ -1,7 +1,8 @@ // eslint-disable-next-line no-unused -import { mapState as mapPiniaState } from 'pinia' -import { Fragment } from 'vue' +import { throttle } from 'lodash' +import { mapState as mapPiniaState, mapState } from 'pinia' +import { Fragment, h } from 'vue' import { FontAwesomeIcon as FAIcon } from '@fortawesome/vue-fontawesome' diff --git a/src/components/settings_modal/settings_modal_admin_content.js b/src/components/settings_modal/settings_modal_admin_content.js index 22ba0e16c..fb2d26778 100644 --- a/src/components/settings_modal/settings_modal_admin_content.js +++ b/src/components/settings_modal/settings_modal_admin_content.js @@ -1,3 +1,4 @@ +import TabSwitcher from 'src/components/tab_switcher/tab_switcher.jsx' import AuthTab from './admin_tabs/auth_tab.vue' import EmojiTab from './admin_tabs/emoji_tab.vue' import FederationTab from './admin_tabs/federation_tab.vue' diff --git a/src/components/settings_modal/tabs/general_tab.js b/src/components/settings_modal/tabs/general_tab.js index 3ab3846d2..bed6f6500 100644 --- a/src/components/settings_modal/tabs/general_tab.js +++ b/src/components/settings_modal/tabs/general_tab.js @@ -8,6 +8,7 @@ import FloatSetting from '../helpers/float_setting.vue' import SharedComputedObject from '../helpers/shared_computed_object.js' import UnitSetting from '../helpers/unit_setting.vue' +import { useInstanceStore } from 'src/stores/instance.js' import { useInstanceCapabilitiesStore } from 'src/stores/instance_capabilities.js' import { useLocalConfigStore } from 'src/stores/local_config.js' import { useMergedConfigStore } from 'src/stores/merged_config.js' diff --git a/src/components/settings_modal/tabs/mutes_and_blocks_tab.js b/src/components/settings_modal/tabs/mutes_and_blocks_tab.js index c45d6ad76..781412249 100644 --- a/src/components/settings_modal/tabs/mutes_and_blocks_tab.js +++ b/src/components/settings_modal/tabs/mutes_and_blocks_tab.js @@ -1,4 +1,4 @@ -import { get, map, reject } from 'lodash' +import { get, isEmpty, map, reject } from 'lodash' import Autosuggest from 'src/components/autosuggest/autosuggest.vue' import BlockCard from 'src/components/block_card/block_card.vue' diff --git a/src/components/settings_modal/tabs/posts_tab.js b/src/components/settings_modal/tabs/posts_tab.js index 640ba5084..dbf284d93 100644 --- a/src/components/settings_modal/tabs/posts_tab.js +++ b/src/components/settings_modal/tabs/posts_tab.js @@ -6,6 +6,7 @@ import SharedComputedObject from '../helpers/shared_computed_object.js' import UnitSetting from '../helpers/unit_setting.vue' import { useLocalConfigStore } from 'src/stores/local_config.js' +import { useSyncConfigStore } from 'src/stores/sync_config.js' const PostsTab = { data() { diff --git a/src/components/settings_modal/tabs/security_tab/mfa.js b/src/components/settings_modal/tabs/security_tab/mfa.js index 1277b42ec..20c28419d 100644 --- a/src/components/settings_modal/tabs/security_tab/mfa.js +++ b/src/components/settings_modal/tabs/security_tab/mfa.js @@ -1,4 +1,5 @@ import VueQrcode from '@chenfengyuan/vue-qrcode' +import { mapState } from 'vuex' import Confirm from './confirm.vue' import RecoveryCodes from './mfa_backup_codes.vue' diff --git a/src/components/settings_modal/tabs/security_tab/mfa_totp.js b/src/components/settings_modal/tabs/security_tab/mfa_totp.js index 2c4c194bc..bbe06c217 100644 --- a/src/components/settings_modal/tabs/security_tab/mfa_totp.js +++ b/src/components/settings_modal/tabs/security_tab/mfa_totp.js @@ -1,3 +1,5 @@ +import { mapState } from 'vuex' + import Confirm from './confirm.vue' import { useOAuthStore } from 'src/stores/oauth.js' diff --git a/src/components/settings_modal/tabs/security_tab/security_tab.js b/src/components/settings_modal/tabs/security_tab/security_tab.js index a2571bd54..45876f848 100644 --- a/src/components/settings_modal/tabs/security_tab/security_tab.js +++ b/src/components/settings_modal/tabs/security_tab/security_tab.js @@ -2,6 +2,7 @@ import Checkbox from 'src/components/checkbox/checkbox.vue' import ProgressButton from 'src/components/progress_button/progress_button.vue' import Mfa from './mfa.vue' +import { useInstanceStore } from 'src/stores/instance.js' import { useInstanceCapabilitiesStore } from 'src/stores/instance_capabilities.js' import { useOAuthStore } from 'src/stores/oauth.js' import { useOAuthTokensStore } from 'src/stores/oauth_tokens' diff --git a/src/components/side_drawer/side_drawer.js b/src/components/side_drawer/side_drawer.js index 27e9a5249..840beeb7c 100644 --- a/src/components/side_drawer/side_drawer.js +++ b/src/components/side_drawer/side_drawer.js @@ -1,4 +1,5 @@ import { mapActions, mapState } from 'pinia' +import { defineAsyncComponent } from 'vue' import { mapGetters } from 'vuex' import { USERNAME_ROUTES } from 'src/components/navigation/navigation.js' diff --git a/src/components/status_content/status_content.js b/src/components/status_content/status_content.js index 2186498ef..0f02bb6fb 100644 --- a/src/components/status_content/status_content.js +++ b/src/components/status_content/status_content.js @@ -1,5 +1,6 @@ import { mapState as mapPiniaState } from 'pinia' -import { mapState } from 'vuex' +import { defineAsyncComponent } from 'vue' +import { mapGetters, mapState } from 'vuex' import Attachment from 'src/components/attachment/attachment.vue' import Gallery from 'src/components/gallery/gallery.vue' diff --git a/src/components/status_popover/status_popover.js b/src/components/status_popover/status_popover.js index 95da91ba7..fe0056305 100644 --- a/src/components/status_popover/status_popover.js +++ b/src/components/status_popover/status_popover.js @@ -1,6 +1,7 @@ import { find } from 'lodash' import Popover from 'src/components/popover/popover.vue' +import Status from 'src/components/status/status.vue' import { library } from '@fortawesome/fontawesome-svg-core' import { faCircleNotch } from '@fortawesome/free-solid-svg-icons' diff --git a/src/components/sticker_picker/sticker_picker.js b/src/components/sticker_picker/sticker_picker.js index 482aacb81..949d2ecf9 100644 --- a/src/components/sticker_picker/sticker_picker.js +++ b/src/components/sticker_picker/sticker_picker.js @@ -4,6 +4,7 @@ import statusPosterService from '../../services/status_poster/status_poster.serv import TabSwitcher from '../tab_switcher/tab_switcher.jsx' import { useEmojiStore } from 'src/stores/emoji.js' +import { useInstanceStore } from 'src/stores/instance.js' const StickerPicker = { components: { diff --git a/src/components/tab_switcher/tab_switcher.jsx b/src/components/tab_switcher/tab_switcher.jsx index a3c5b61cd..b485b3ff8 100644 --- a/src/components/tab_switcher/tab_switcher.jsx +++ b/src/components/tab_switcher/tab_switcher.jsx @@ -1,11 +1,14 @@ // eslint-disable-next-line no-unused -import { Fragment } from 'vue' +import { mapState } from 'pinia' +import { Fragment, h } from 'vue' import { FontAwesomeIcon as FAIcon } from '@fortawesome/vue-fontawesome' import './tab_switcher.scss' +import { useInterfaceStore } from 'src/stores/interface.js' + const findFirstUsable = (slots) => slots.findIndex((_) => _.props) export default { diff --git a/src/components/user_card/user_card.js b/src/components/user_card/user_card.js index 31a513130..70fb057af 100644 --- a/src/components/user_card/user_card.js +++ b/src/components/user_card/user_card.js @@ -22,6 +22,7 @@ import { useInstanceCapabilitiesStore } from 'src/stores/instance_capabilities.j import { useInterfaceStore } from 'src/stores/interface' import { useMediaViewerStore } from 'src/stores/media_viewer' import { useMergedConfigStore } from 'src/stores/merged_config.js' +import { useOAuthStore } from 'src/stores/oauth.js' import { usePostStatusStore } from 'src/stores/post_status' import { useUserHighlightStore } from 'src/stores/user_highlight.js' diff --git a/src/components/user_list_popover/user_list_popover.js b/src/components/user_list_popover/user_list_popover.js index 7f9ba4ffb..8a4612690 100644 --- a/src/components/user_list_popover/user_list_popover.js +++ b/src/components/user_list_popover/user_list_popover.js @@ -1,3 +1,5 @@ +import { defineAsyncComponent } from 'vue' + import Popover from 'src/components/popover/popover.vue' import UnicodeDomainIndicator from 'src/components/unicode_domain_indicator/unicode_domain_indicator.vue' import UserAvatar from 'src/components/user_avatar/user_avatar.vue' diff --git a/src/components/user_popover/user_popover.js b/src/components/user_popover/user_popover.js index 67c75be50..de354d676 100644 --- a/src/components/user_popover/user_popover.js +++ b/src/components/user_popover/user_popover.js @@ -1,4 +1,5 @@ import { mapState } from 'pinia' +import { defineAsyncComponent } from 'vue' import Popover from 'src/components/popover/popover.vue' import UserCard from 'src/components/user_card/user_card.vue' diff --git a/src/components/user_profile/user_profile.js b/src/components/user_profile/user_profile.js index eb1d8e068..d2d766a7f 100644 --- a/src/components/user_profile/user_profile.js +++ b/src/components/user_profile/user_profile.js @@ -1,4 +1,5 @@ import { get } from 'lodash' +import { mapState } from 'pinia' import FollowCard from 'src/components/follow_card/follow_card.vue' import List from 'src/components/list/list.vue' @@ -6,6 +7,7 @@ import TabSwitcher from 'src/components/tab_switcher/tab_switcher.jsx' import Timeline from 'src/components/timeline/timeline.vue' import UserCard from 'src/components/user_card/user_card.vue' +import { useInstanceStore } from 'src/stores/instance.js' import { useInstanceCapabilitiesStore } from 'src/stores/instance_capabilities.js' import { useInterfaceStore } from 'src/stores/interface.js' import { useMergedConfigStore } from 'src/stores/merged_config.js' diff --git a/src/components/user_profile/user_profile_admin_view.js b/src/components/user_profile/user_profile_admin_view.js index da2c6c322..94092b155 100644 --- a/src/components/user_profile/user_profile_admin_view.js +++ b/src/components/user_profile/user_profile_admin_view.js @@ -1,3 +1,6 @@ +import { get } from 'lodash' +import { mapState } from 'pinia' + import Checkbox from 'src/components/checkbox/checkbox.vue' import List from 'src/components/list/list.vue' import Status from 'src/components/status/status.vue' diff --git a/src/components/who_to_follow/who_to_follow.js b/src/components/who_to_follow/who_to_follow.js index 28b63c973..6f00b3e5e 100644 --- a/src/components/who_to_follow/who_to_follow.js +++ b/src/components/who_to_follow/who_to_follow.js @@ -1,5 +1,6 @@ import FollowCard from 'src/components/follow_card/follow_card.vue' +import { useInstanceStore } from 'src/stores/instance.js' import { useOAuthStore } from 'src/stores/oauth.js' import { fetchUser, suggestions } from 'src/api/public.js' diff --git a/src/lib/language.js b/src/lib/language.js index dc5121452..af53eeffd 100644 --- a/src/lib/language.js +++ b/src/lib/language.js @@ -1,3 +1,5 @@ +import Cookies from 'js-cookie' + import { useEmojiStore } from 'src/stores/emoji.js' import { useI18nStore } from 'src/stores/i18n.js' diff --git a/src/modules/api.js b/src/modules/api.js index 72d7fb4d7..ca1aacf05 100644 --- a/src/modules/api.js +++ b/src/modules/api.js @@ -2,12 +2,13 @@ import { Socket } from 'phoenix' import { maybeShowChatNotification } from '../services/chat_utils/chat_utils.js' +import { useInstanceStore } from 'src/stores/instance.js' import { useInstanceCapabilitiesStore } from 'src/stores/instance_capabilities.js' import { useInterfaceStore } from 'src/stores/interface.js' import { useOAuthStore } from 'src/stores/oauth.js' import { useShoutStore } from 'src/stores/shout.js' -import { fetchTimeline } from 'src/api/timelines.js' +import { fetchTimeline } from 'src/api/public.js' import { getMastodonSocketURI, ProcessedWS, diff --git a/src/modules/default_config_state.js b/src/modules/default_config_state.js index ec190af28..6a970ef0f 100644 --- a/src/modules/default_config_state.js +++ b/src/modules/default_config_state.js @@ -1,4 +1,4 @@ -import { get } from 'lodash' +import { get, set } from 'lodash' const browserLocale = (navigator.language || 'en').split('-')[0] diff --git a/src/services/notifications_fetcher/notifications_fetcher.service.js b/src/services/notifications_fetcher/notifications_fetcher.service.js index 8530c468c..f787b92e4 100644 --- a/src/services/notifications_fetcher/notifications_fetcher.service.js +++ b/src/services/notifications_fetcher/notifications_fetcher.service.js @@ -1,10 +1,11 @@ import { promiseInterval } from '../promise_interval/promise_interval.js' +import { useInstanceStore } from 'src/stores/instance.js' import { useInstanceCapabilitiesStore } from 'src/stores/instance_capabilities.js' import { useInterfaceStore } from 'src/stores/interface.js' import { useMergedConfigStore } from 'src/stores/merged_config.js' -import { fetchTimeline } from 'src/api/timelines.js' +import { fetchTimeline } from 'src/api/public.js' const update = ({ store, notifications, older }) => { store.dispatch('addNewNotifications', { notifications, older }) diff --git a/src/services/timeline_fetcher/timeline_fetcher.service.js b/src/services/timeline_fetcher/timeline_fetcher.service.js index 80dbc75d0..ff75ea704 100644 --- a/src/services/timeline_fetcher/timeline_fetcher.service.js +++ b/src/services/timeline_fetcher/timeline_fetcher.service.js @@ -2,11 +2,12 @@ import { camelCase } from 'lodash' import { promiseInterval } from '../promise_interval/promise_interval.js' +import { useInstanceStore } from 'src/stores/instance.js' import { useInstanceCapabilitiesStore } from 'src/stores/instance_capabilities.js' import { useInterfaceStore } from 'src/stores/interface.js' import { useMergedConfigStore } from 'src/stores/merged_config.js' -import { fetchTimeline } from 'src/api/timelines.js' +import { fetchTimeline } from 'src/api/public.js' const update = ({ store, diff --git a/src/stores/instance.js b/src/stores/instance.js index 02edd1235..ea3419e80 100644 --- a/src/stores/instance.js +++ b/src/stores/instance.js @@ -1,4 +1,4 @@ -import { set } from 'lodash' +import { get, set } from 'lodash' import { defineStore } from 'pinia' import { diff --git a/src/stores/local_config.js b/src/stores/local_config.js index 786da657b..5b15c6ff1 100644 --- a/src/stores/local_config.js +++ b/src/stores/local_config.js @@ -1,5 +1,8 @@ import { cloneDeep, set } from 'lodash' import { defineStore } from 'pinia' +import { toRaw } from 'vue' + +import { useInstanceStore } from 'src/stores/instance' import { LOCAL_DEFAULT_CONFIG, diff --git a/src/stores/sync_config.js b/src/stores/sync_config.js index 47c6978d5..ccc4bbd4d 100644 --- a/src/stores/sync_config.js +++ b/src/stores/sync_config.js @@ -20,6 +20,7 @@ import { toRaw } from 'vue' import { CURRENT_UPDATE_COUNTER } from 'src/components/update_notification/update_notification.js' +import { useInstanceStore } from 'src/stores/instance.js' import { useLocalConfigStore } from 'src/stores/local_config.js' import { useOAuthStore } from 'src/stores/oauth.js' diff --git a/src/stores/user_highlight.js b/src/stores/user_highlight.js index 759ebd509..b056ca808 100644 --- a/src/stores/user_highlight.js +++ b/src/stores/user_highlight.js @@ -1,11 +1,15 @@ import { merge as _merge, + clamp, clone, cloneDeep, + findLastIndex, flatten, + get, groupBy, isEqual, takeRight, + uniqWith, } from 'lodash' import { defineStore } from 'pinia' import { toRaw } from 'vue' @@ -29,6 +33,17 @@ export const defaultState = { cache: null, } +export const _moveItemInArray = (array, value, movement) => { + const oldIndex = array.indexOf(value) + const newIndex = oldIndex + movement + const newArray = [...array] + // remove old + newArray.splice(oldIndex, 1) + // add new + newArray.splice(clamp(newIndex, 0, newArray.length + 1), 0, value) + return newArray +} + const _wrapData = (data, userName) => { return { ...data, diff --git a/test/unit/specs/services/entity_normalizer/entity_normalizer.spec.js b/test/unit/specs/services/entity_normalizer/entity_normalizer.spec.js index afd17e56b..a9cb3fd27 100644 --- a/test/unit/specs/services/entity_normalizer/entity_normalizer.spec.js +++ b/test/unit/specs/services/entity_normalizer/entity_normalizer.spec.js @@ -2,6 +2,7 @@ import mastoapidata from '../../../../fixtures/mastoapi.json' import { parseLinkHeaderPagination, + parseNotification, parseStatus, parseUser, } from 'src/services/entity_normalizer/entity_normalizer.service.js' diff --git a/test/unit/specs/stores/lists.spec.js b/test/unit/specs/stores/lists.spec.js index 3720aa776..c71cce555 100644 --- a/test/unit/specs/stores/lists.spec.js +++ b/test/unit/specs/stores/lists.spec.js @@ -12,7 +12,7 @@ describe('The lists store', () => { let store beforeEach(() => { - setActivePinia(createTestingPinia({ stubActions: false })) + createTestingPinia({ stubActions: false }) store = useListsStore() }) diff --git a/test/unit/specs/stores/oauth.spec.js b/test/unit/specs/stores/oauth.spec.js index 6e61fea79..828175c9f 100644 --- a/test/unit/specs/stores/oauth.spec.js +++ b/test/unit/specs/stores/oauth.spec.js @@ -9,6 +9,8 @@ import { useOAuthStore } from 'src/stores/oauth.js' import { MASTODON_APP_URL, MASTODON_APP_VERIFY_URL, + OAUTH_MFA_CHALLENGE_URL, + OAUTH_REVOKE_URL, OAUTH_TOKEN_URL, } from 'src/api/oauth.js' diff --git a/test/unit/specs/stores/user_highlight.spec.js b/test/unit/specs/stores/user_highlight.spec.js index f80143b6e..c46852256 100644 --- a/test/unit/specs/stores/user_highlight.spec.js +++ b/test/unit/specs/stores/user_highlight.spec.js @@ -1,8 +1,10 @@ +import { cloneDeep } from 'lodash' import { createPinia, setActivePinia } from 'pinia' import { _getRecentData, _mergeHighlights, + _moveItemInArray, useUserHighlightStore, } from 'src/stores/user_highlight.js' diff --git a/vite.config.js b/vite.config.js index beff5fe76..64859ebb1 100644 --- a/vite.config.js +++ b/vite.config.js @@ -1,5 +1,6 @@ import { dirname, resolve } from 'node:path' import { fileURLToPath } from 'node:url' +import { DevTools } from '@vitejs/devtools' import vue from '@vitejs/plugin-vue' import vueJsx from '@vitejs/plugin-vue-jsx' import { playwright } from '@vitest/browser-playwright'