From 174be975c85ec98021ded62a81272dea4a84b873 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?marcin=20miko=C5=82ajczak?= Date: Sun, 2 Jul 2023 13:18:52 +0200 Subject: [PATCH 1/2] Support Mastodon nightly version MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: marcin mikołajczak --- app/soapbox/utils/__tests__/features.test.ts | 10 ++++++++++ app/soapbox/utils/features.ts | 2 +- 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/app/soapbox/utils/__tests__/features.test.ts b/app/soapbox/utils/__tests__/features.test.ts index 3ba9c90ba..f214393d0 100644 --- a/app/soapbox/utils/__tests__/features.test.ts +++ b/app/soapbox/utils/__tests__/features.test.ts @@ -40,6 +40,7 @@ describe('parseVersion', () => { software: 'TruthSocial', version: '1.0.0', compatVersion: '3.4.1', + build: 'nightly-20230627', }); }); @@ -62,6 +63,15 @@ describe('parseVersion', () => { build: 'cofe', }); }); + + it('with Mastodon nightly build', () => { + const version = '4.1.2+nightly-20230627'; + expect(parseVersion(version)).toEqual({ + software: 'Mastodon', + version: '4.1.2', + compatVersion: '4.1.2', + }); + }); }); describe('getFeatures', () => { diff --git a/app/soapbox/utils/features.ts b/app/soapbox/utils/features.ts index 77ba331cb..126248e5d 100644 --- a/app/soapbox/utils/features.ts +++ b/app/soapbox/utils/features.ts @@ -992,7 +992,7 @@ interface Backend { /** Get information about the software from its version string */ export const parseVersion = (version: string): Backend => { - const regex = /^([\w+.]*)(?: \(compatible; ([\w]*) (.*)\))?$/; + const regex = /^([\w+.-]*)(?: \(compatible; ([\w]*) (.*)\))?$/; const match = regex.exec(version); const semverString = match && (match[3] || match[1]); From 8646aa5572efe3e97844be21bf9bbba09bc5d441 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?marcin=20miko=C5=82ajczak?= Date: Sun, 2 Jul 2023 13:19:27 +0200 Subject: [PATCH 2/2] Add Followed hashtags page MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: marcin mikołajczak --- app/soapbox/components/sidebar-menu.tsx | 10 ++++++++++ .../{followed_tags => followed-tags}/index.tsx | 0 app/soapbox/features/ui/components/link-footer.tsx | 3 +++ app/soapbox/features/ui/index.tsx | 2 ++ app/soapbox/features/ui/util/async-components.ts | 4 ++++ app/soapbox/locales/en.json | 3 +++ .../reducers/{followed_tags.ts => followed-tags.ts} | 0 app/soapbox/reducers/index.ts | 2 +- app/soapbox/utils/__tests__/features.test.ts | 2 +- 9 files changed, 24 insertions(+), 2 deletions(-) rename app/soapbox/features/{followed_tags => followed-tags}/index.tsx (100%) rename app/soapbox/reducers/{followed_tags.ts => followed-tags.ts} (100%) diff --git a/app/soapbox/components/sidebar-menu.tsx b/app/soapbox/components/sidebar-menu.tsx index f77e9f5ed..11786f4ad 100644 --- a/app/soapbox/components/sidebar-menu.tsx +++ b/app/soapbox/components/sidebar-menu.tsx @@ -28,6 +28,7 @@ const messages = defineMessages({ domainBlocks: { id: 'navigation_bar.domain_blocks', defaultMessage: 'Hidden domains' }, mutes: { id: 'navigation_bar.mutes', defaultMessage: 'Muted users' }, filters: { id: 'navigation_bar.filters', defaultMessage: 'Muted words' }, + followedTags: { id: 'navigation_bar.followed_tags', defaultMessage: 'Followed hashtags' }, soapboxConfig: { id: 'navigation_bar.soapbox_config', defaultMessage: 'Soapbox config' }, accountMigration: { id: 'navigation_bar.account_migration', defaultMessage: 'Move account' }, accountAliases: { id: 'navigation_bar.account_aliases', defaultMessage: 'Account aliases' }, @@ -305,6 +306,15 @@ const SidebarMenu: React.FC = (): JSX.Element | null => { /> )} + {features.followedHashtagsList && ( + + )} + {account.admin && ( { {(features.filters || features.filtersV2) && ( )} + {features.followedHashtagsList && ( + + )} {features.federating && ( )} diff --git a/app/soapbox/features/ui/index.tsx b/app/soapbox/features/ui/index.tsx index 847b29d26..f0cc8c561 100644 --- a/app/soapbox/features/ui/index.tsx +++ b/app/soapbox/features/ui/index.tsx @@ -135,6 +135,7 @@ import { GroupMembershipRequests, Announcements, EditGroup, + FollowedTags, } from './util/async-components'; import { WrappedRoute } from './util/react-router-helpers'; @@ -293,6 +294,7 @@ const SwitchingColumnsArea: React.FC = ({ children }) => {(features.filters || features.filtersV2) && } {(features.filters || features.filtersV2) && } {(features.filters || features.filtersV2) && } + {(features.followedHashtagsList) && } diff --git a/app/soapbox/features/ui/util/async-components.ts b/app/soapbox/features/ui/util/async-components.ts index 0b50f0194..4891185fa 100644 --- a/app/soapbox/features/ui/util/async-components.ts +++ b/app/soapbox/features/ui/util/async-components.ts @@ -637,3 +637,7 @@ export function Announcements() { export function EditAnnouncementModal() { return import(/* webpackChunkName: "features/admin/announcements" */'../components/modals/edit-announcement-modal'); } + +export function FollowedTags() { + return import(/* webpackChunkName: "features/followed-tags" */'../../followed-tags'); +} diff --git a/app/soapbox/locales/en.json b/app/soapbox/locales/en.json index d863da71e..123d02398 100644 --- a/app/soapbox/locales/en.json +++ b/app/soapbox/locales/en.json @@ -350,6 +350,7 @@ "column.filters.title": "Title", "column.filters.whole_word": "Whole word", "column.follow_requests": "Follow requests", + "column.followed_tags": "Followed hashtags", "column.followers": "Followers", "column.following": "Following", "column.group_blocked_members": "Banned Members", @@ -676,6 +677,7 @@ "empty_column.filters": "You haven't created any muted words yet.", "empty_column.follow_recommendations": "Looks like no suggestions could be generated for you. You can try using search to look for people you might know or explore trending hashtags.", "empty_column.follow_requests": "You don't have any follow requests yet. When you receive one, it will show up here.", + "empty_column.followed_tags": "You haven't followed any hashtag yet.", "empty_column.group": "There are no posts in this group yet.", "empty_column.group_blocks": "The group hasn't banned any users yet.", "empty_column.group_membership_requests": "There are no pending membership requests for this group.", @@ -1083,6 +1085,7 @@ "navigation_bar.favourites": "Likes", "navigation_bar.filters": "Filters", "navigation_bar.follow_requests": "Follow requests", + "navigation_bar.followed_tags": "Followed hashtags", "navigation_bar.import_data": "Import data", "navigation_bar.in_reply_to": "In reply to", "navigation_bar.invites": "Invites", diff --git a/app/soapbox/reducers/followed_tags.ts b/app/soapbox/reducers/followed-tags.ts similarity index 100% rename from app/soapbox/reducers/followed_tags.ts rename to app/soapbox/reducers/followed-tags.ts diff --git a/app/soapbox/reducers/index.ts b/app/soapbox/reducers/index.ts index e2504a968..a52ea0aa3 100644 --- a/app/soapbox/reducers/index.ts +++ b/app/soapbox/reducers/index.ts @@ -29,7 +29,7 @@ import custom_emojis from './custom-emojis'; import domain_lists from './domain-lists'; import dropdown_menu from './dropdown-menu'; import filters from './filters'; -import followed_tags from './followed_tags'; +import followed_tags from './followed-tags'; import group_memberships from './group-memberships'; import group_relationships from './group-relationships'; import groups from './groups'; diff --git a/app/soapbox/utils/__tests__/features.test.ts b/app/soapbox/utils/__tests__/features.test.ts index f214393d0..da9985b13 100644 --- a/app/soapbox/utils/__tests__/features.test.ts +++ b/app/soapbox/utils/__tests__/features.test.ts @@ -40,7 +40,6 @@ describe('parseVersion', () => { software: 'TruthSocial', version: '1.0.0', compatVersion: '3.4.1', - build: 'nightly-20230627', }); }); @@ -70,6 +69,7 @@ describe('parseVersion', () => { software: 'Mastodon', version: '4.1.2', compatVersion: '4.1.2', + build: 'nightly-20230627', }); }); });