From 3dae95d5c83c0984bf999eb70e0dde6e96bd75a7 Mon Sep 17 00:00:00 2001 From: bluecloud <96812901+pitb2022@users.noreply.github.com> Date: Thu, 29 Aug 2024 14:31:54 +0800 Subject: [PATCH 1/9] fix(MomentDigest): set referrer --- src/components/MomentDigest/Feed/index.tsx | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/components/MomentDigest/Feed/index.tsx b/src/components/MomentDigest/Feed/index.tsx index ec347c6fb4..b4569a68c3 100644 --- a/src/components/MomentDigest/Feed/index.tsx +++ b/src/components/MomentDigest/Feed/index.tsx @@ -45,13 +45,18 @@ export const MomentDigestFeed = ({ }) const goToMomentDetail = () => { + setReferrer() router.push(momentDetailPath.href) } - const handleClickDateTime = () => { + const setReferrer = () => { sessionStorage.set(MOMENT_DIGEST_REFERRER, true) } + const handleClickDateTime = () => { + setReferrer() + } + const Container = ({ openMomentDetail, hasAuthor, From d26135af2b8c60a206949ee5c98513efee12a2b9 Mon Sep 17 00:00:00 2001 From: bluecloud <96812901+pitb2022@users.noreply.github.com> Date: Thu, 29 Aug 2024 14:34:12 +0800 Subject: [PATCH 2/9] fix(Announcements): remove unused field --- src/views/Home/Announcements/gql.ts | 3 --- 1 file changed, 3 deletions(-) diff --git a/src/views/Home/Announcements/gql.ts b/src/views/Home/Announcements/gql.ts index cc3db45dc7..37b95f5df9 100644 --- a/src/views/Home/Announcements/gql.ts +++ b/src/views/Home/Announcements/gql.ts @@ -2,9 +2,6 @@ import gql from 'graphql-tag' export const VISIBLE_ANNOUNCEMENTS = gql` query VisibleAnnouncements($input: AnnouncementsInput!) { - viewer { - id - } official { announcements(input: $input) { id From 4296a8e9e22057cb20b0bed894500f0c07c499c8 Mon Sep 17 00:00:00 2001 From: bluecloud <96812901+pitb2022@users.noreply.github.com> Date: Thu, 29 Aug 2024 16:55:49 +0800 Subject: [PATCH 3/9] feat(MomentLiked): add moment archive state --- lang/default.json | 4 ++++ lang/en.json | 4 ++++ lang/zh-Hans.json | 4 ++++ lang/zh-Hant.json | 4 ++++ .../Notice/MomentNotice/MomentLiked.tsx | 19 ++++++++++++++++++- 5 files changed, 34 insertions(+), 1 deletion(-) diff --git a/lang/default.json b/lang/default.json index a8ab374467..e436ecb0d9 100644 --- a/lang/default.json +++ b/lang/default.json @@ -440,6 +440,10 @@ "defaultMessage": "This tag is already taken", "description": "DUPLICATE_TAG" }, + "5RPoaZ": { + "defaultMessage": "liked your deleted moment", + "description": "src/components/Notice/MomentNotice/MomentLiked.tsx" + }, "5UglrB": { "defaultMessage": "Successfully delivered" }, diff --git a/lang/en.json b/lang/en.json index 1f0039c5c9..fddaab364d 100644 --- a/lang/en.json +++ b/lang/en.json @@ -440,6 +440,10 @@ "defaultMessage": "This tag is already taken", "description": "DUPLICATE_TAG" }, + "5RPoaZ": { + "defaultMessage": "liked your deleted moment", + "description": "src/components/Notice/MomentNotice/MomentLiked.tsx" + }, "5UglrB": { "defaultMessage": "Successfully delivered" }, diff --git a/lang/zh-Hans.json b/lang/zh-Hans.json index 8aa568f5c2..6dd41f269a 100644 --- a/lang/zh-Hans.json +++ b/lang/zh-Hans.json @@ -440,6 +440,10 @@ "defaultMessage": "标签名称已被使用", "description": "DUPLICATE_TAG" }, + "5RPoaZ": { + "defaultMessage": "喜欢你已删除的动态", + "description": "src/components/Notice/MomentNotice/MomentLiked.tsx" + }, "5UglrB": { "defaultMessage": "送出成功" }, diff --git a/lang/zh-Hant.json b/lang/zh-Hant.json index 4b7f8c7f41..bec18a3759 100644 --- a/lang/zh-Hant.json +++ b/lang/zh-Hant.json @@ -440,6 +440,10 @@ "defaultMessage": "標籤名稱已被使用", "description": "DUPLICATE_TAG" }, + "5RPoaZ": { + "defaultMessage": "喜歡你已刪除的動態", + "description": "src/components/Notice/MomentNotice/MomentLiked.tsx" + }, "5UglrB": { "defaultMessage": "送出成功" }, diff --git a/src/components/Notice/MomentNotice/MomentLiked.tsx b/src/components/Notice/MomentNotice/MomentLiked.tsx index 4e66241a5f..2e76a91827 100644 --- a/src/components/Notice/MomentNotice/MomentLiked.tsx +++ b/src/components/Notice/MomentNotice/MomentLiked.tsx @@ -2,7 +2,7 @@ import gql from 'graphql-tag' import { FormattedMessage } from 'react-intl' import { TEST_ID } from '~/common/enums' -import { MomentLikedNoticeFragment } from '~/gql/graphql' +import { MomentLikedNoticeFragment, MomentState } from '~/gql/graphql' import NoticeActorAvatar from '../NoticeActorAvatar' import NoticeDate from '../NoticeDate' @@ -15,6 +15,22 @@ const MomentLikedNotice = ({ }: { notice: MomentLikedNoticeFragment }) => { + if (notice.moment.state === MomentState.Archived) { + return ( + + } + testId={TEST_ID.NOTICE_MOMENT_LIKED} + /> + ) + } + return ( Date: Thu, 29 Aug 2024 17:04:44 +0800 Subject: [PATCH 4/9] feat(MomentNewCommentNotice): add moment archive state --- lang/default.json | 4 ++++ lang/en.json | 4 ++++ lang/zh-Hans.json | 4 ++++ lang/zh-Hant.json | 4 ++++ .../CommentNotice/MomentNewCommentNotice.tsx | 19 ++++++++++++++++++- 5 files changed, 34 insertions(+), 1 deletion(-) diff --git a/lang/default.json b/lang/default.json index e436ecb0d9..0f7ad0d904 100644 --- a/lang/default.json +++ b/lang/default.json @@ -975,6 +975,10 @@ "E048/V": { "defaultMessage": "Save as Draft" }, + "E0xjVb": { + "defaultMessage": "commented on a deleted moment", + "description": "src/components/Notice/CommentNotice/MomentNewCommentNotice.tsx" + }, "E3uFyt": { "defaultMessage": "Moment", "description": "src/components/Forms/MomentForm/index.tsx" diff --git a/lang/en.json b/lang/en.json index fddaab364d..ed935bf2bc 100644 --- a/lang/en.json +++ b/lang/en.json @@ -975,6 +975,10 @@ "E048/V": { "defaultMessage": "Save as Draft" }, + "E0xjVb": { + "defaultMessage": "commented on a deleted moment", + "description": "src/components/Notice/CommentNotice/MomentNewCommentNotice.tsx" + }, "E3uFyt": { "defaultMessage": "Moment", "description": "src/components/Forms/MomentForm/index.tsx" diff --git a/lang/zh-Hans.json b/lang/zh-Hans.json index 6dd41f269a..29ed021625 100644 --- a/lang/zh-Hans.json +++ b/lang/zh-Hans.json @@ -975,6 +975,10 @@ "E048/V": { "defaultMessage": "存至草稿" }, + "E0xjVb": { + "defaultMessage": "在已删除动态中留言", + "description": "src/components/Notice/CommentNotice/MomentNewCommentNotice.tsx" + }, "E3uFyt": { "defaultMessage": "动态", "description": "src/components/Forms/MomentForm/index.tsx" diff --git a/lang/zh-Hant.json b/lang/zh-Hant.json index bec18a3759..2261a6ed83 100644 --- a/lang/zh-Hant.json +++ b/lang/zh-Hant.json @@ -975,6 +975,10 @@ "E048/V": { "defaultMessage": "存至草稿" }, + "E0xjVb": { + "defaultMessage": "在已刪除動態中留言", + "description": "src/components/Notice/CommentNotice/MomentNewCommentNotice.tsx" + }, "E3uFyt": { "defaultMessage": "動態", "description": "src/components/Forms/MomentForm/index.tsx" diff --git a/src/components/Notice/CommentNotice/MomentNewCommentNotice.tsx b/src/components/Notice/CommentNotice/MomentNewCommentNotice.tsx index 6a73f4d535..d6232bf265 100644 --- a/src/components/Notice/CommentNotice/MomentNewCommentNotice.tsx +++ b/src/components/Notice/CommentNotice/MomentNewCommentNotice.tsx @@ -2,7 +2,7 @@ import gql from 'graphql-tag' import { FormattedMessage } from 'react-intl' import { TEST_ID } from '~/common/enums' -import { MomentNewCommentNoticeFragment } from '~/gql/graphql' +import { MomentNewCommentNoticeFragment, MomentState } from '~/gql/graphql' import NoticeActorAvatar from '../NoticeActorAvatar' import NoticeComment from '../NoticeComment' @@ -25,6 +25,23 @@ const MomentNewCommentNotice = ({ ? notice.comment.node : undefined + if (commentMoment?.state === MomentState.Archived) { + return ( + + } + content={} + testId={TEST_ID.NOTICE_MOMENT_NEW_COMMENT} + /> + ) + } + return ( Date: Thu, 29 Aug 2024 17:15:10 +0800 Subject: [PATCH 5/9] feat(CommentLikedNotice): add moment archive state --- lang/default.json | 4 ++++ lang/en.json | 4 ++++ lang/zh-Hans.json | 4 ++++ lang/zh-Hant.json | 4 ++++ .../CommentNotice/CommentLikedNotice.tsx | 20 ++++++++++++++++++- 5 files changed, 35 insertions(+), 1 deletion(-) diff --git a/lang/default.json b/lang/default.json index 0f7ad0d904..f6246138b9 100644 --- a/lang/default.json +++ b/lang/default.json @@ -3067,6 +3067,10 @@ "quRPwZ": { "defaultMessage": "Payment request has been sent" }, + "qw7tLA": { + "defaultMessage": "liked your comment on a deleted moment", + "description": "src/components/Notice/CommentNotice/CommentLikedNotice.tsx" + }, "r5pj/5": { "defaultMessage": "Drag" }, diff --git a/lang/en.json b/lang/en.json index ed935bf2bc..6958c1ba9e 100644 --- a/lang/en.json +++ b/lang/en.json @@ -3067,6 +3067,10 @@ "quRPwZ": { "defaultMessage": "Payment request has been sent" }, + "qw7tLA": { + "defaultMessage": "liked your comment on a deleted moment", + "description": "src/components/Notice/CommentNotice/CommentLikedNotice.tsx" + }, "r5pj/5": { "defaultMessage": "Drag" }, diff --git a/lang/zh-Hans.json b/lang/zh-Hans.json index 29ed021625..9987fe61cc 100644 --- a/lang/zh-Hans.json +++ b/lang/zh-Hans.json @@ -3067,6 +3067,10 @@ "quRPwZ": { "defaultMessage": "支付请求已送出" }, + "qw7tLA": { + "defaultMessage": "喜欢你在已删除动态中的留言", + "description": "src/components/Notice/CommentNotice/CommentLikedNotice.tsx" + }, "r5pj/5": { "defaultMessage": "拖拽" }, diff --git a/lang/zh-Hant.json b/lang/zh-Hant.json index 2261a6ed83..b50d7d0e83 100644 --- a/lang/zh-Hant.json +++ b/lang/zh-Hant.json @@ -3067,6 +3067,10 @@ "quRPwZ": { "defaultMessage": "支付請求已送出" }, + "qw7tLA": { + "defaultMessage": "喜歡你在已刪除動態中的留言", + "description": "src/components/Notice/CommentNotice/CommentLikedNotice.tsx" + }, "r5pj/5": { "defaultMessage": "拖拽" }, diff --git a/src/components/Notice/CommentNotice/CommentLikedNotice.tsx b/src/components/Notice/CommentNotice/CommentLikedNotice.tsx index 25455998d4..1816c06529 100644 --- a/src/components/Notice/CommentNotice/CommentLikedNotice.tsx +++ b/src/components/Notice/CommentNotice/CommentLikedNotice.tsx @@ -2,7 +2,7 @@ import gql from 'graphql-tag' import { FormattedMessage } from 'react-intl' import { TEST_ID } from '~/common/enums' -import { CommentNoticeFragment } from '~/gql/graphql' +import { CommentNoticeFragment, MomentState } from '~/gql/graphql' import NoticeActorAvatar from '../NoticeActorAvatar' import NoticeArticleTitle from '../NoticeArticleTitle' @@ -23,6 +23,23 @@ const CommentLikedNotice = ({ notice }: { notice: CommentNoticeFragment }) => { ? notice.comment.node : undefined + if (isMoment && commentMoment?.state === MomentState.Archived) { + return ( + + } + content={} + testId={TEST_ID.NOTICE_COMMENT_LIKED} + /> + ) + } + return ( Date: Thu, 29 Aug 2024 17:17:11 +0800 Subject: [PATCH 6/9] feat: remove 'state' property from CommentLikedNotice and MomentLikedNotice components --- src/components/Notice/CommentNotice/CommentLikedNotice.tsx | 1 - src/components/Notice/MomentNotice/MomentLiked.tsx | 1 - src/components/Notice/NoticeMomentTitle.tsx | 1 + 3 files changed, 1 insertion(+), 2 deletions(-) diff --git a/src/components/Notice/CommentNotice/CommentLikedNotice.tsx b/src/components/Notice/CommentNotice/CommentLikedNotice.tsx index 1816c06529..cf5fc69fc1 100644 --- a/src/components/Notice/CommentNotice/CommentLikedNotice.tsx +++ b/src/components/Notice/CommentNotice/CommentLikedNotice.tsx @@ -77,7 +77,6 @@ CommentLikedNotice.fragments = { ...NoticeArticleTitle } ... on Moment { - state ...NoticeMomentTitle } } diff --git a/src/components/Notice/MomentNotice/MomentLiked.tsx b/src/components/Notice/MomentNotice/MomentLiked.tsx index 2e76a91827..4b80a6580f 100644 --- a/src/components/Notice/MomentNotice/MomentLiked.tsx +++ b/src/components/Notice/MomentNotice/MomentLiked.tsx @@ -54,7 +54,6 @@ MomentLikedNotice.fragments = { } moment: target { id - state ...NoticeMomentTitle } } diff --git a/src/components/Notice/NoticeMomentTitle.tsx b/src/components/Notice/NoticeMomentTitle.tsx index aeea1cff37..99dd343478 100644 --- a/src/components/Notice/NoticeMomentTitle.tsx +++ b/src/components/Notice/NoticeMomentTitle.tsx @@ -49,6 +49,7 @@ NoticeMomentTitle.fragments = { moment: gql` fragment NoticeMomentTitle on Moment { id + state content shortHash assets { From 61233d91018ef3bd944f0719ad3a458e93de4c59 Mon Sep 17 00:00:00 2001 From: bluecloud <96812901+pitb2022@users.noreply.github.com> Date: Thu, 29 Aug 2024 18:41:02 +0800 Subject: [PATCH 7/9] fix(MomentDetailDialog): fix moment archive state --- .../Dialogs/MomentDetailDialog/Content.tsx | 22 ++++++++++++++++++- .../MomentDetailDialog/styles.module.css | 6 +++++ 2 files changed, 27 insertions(+), 1 deletion(-) diff --git a/src/components/Dialogs/MomentDetailDialog/Content.tsx b/src/components/Dialogs/MomentDetailDialog/Content.tsx index 7cba2afdcc..95f049a879 100644 --- a/src/components/Dialogs/MomentDetailDialog/Content.tsx +++ b/src/components/Dialogs/MomentDetailDialog/Content.tsx @@ -2,6 +2,7 @@ import { useQuery } from '@apollo/react-hooks' import { Editor } from '@matters/matters-editor' import classNames from 'classnames' import { useEffect, useState } from 'react' +import { FormattedMessage } from 'react-intl' import { ADD_MOMENT_COMMENT_MENTION, @@ -16,6 +17,8 @@ import { toPath, } from '~/common/utils' import { + BackToHomeButton, + Error, MomentDigestDetail, QueryError, useEventListener, @@ -24,7 +27,7 @@ import { import MomentCommentForm from '~/components/Forms/MomentCommentForm' import Assets from '~/components/MomentDigest/Assets' import LikeButton from '~/components/MomentDigest/FooterActions/LikeButton' -import { MomentDetailQuery } from '~/gql/graphql' +import { MomentDetailQuery, MomentState } from '~/gql/graphql' import Comments from './Comments' import { MOMENT_DETAIL } from './gql' @@ -99,6 +102,23 @@ const MomentDetailDialogContent = ({ return null } + if (data.moment.state === MomentState.Archived) { + return ( +
+ + } + > + + +
+ ) + } + const moment = data.moment const { content, assets } = moment diff --git a/src/components/Dialogs/MomentDetailDialog/styles.module.css b/src/components/Dialogs/MomentDetailDialog/styles.module.css index 331ca03720..636f10fb2e 100644 --- a/src/components/Dialogs/MomentDetailDialog/styles.module.css +++ b/src/components/Dialogs/MomentDetailDialog/styles.module.css @@ -146,3 +146,9 @@ } } } + +.error { + @media (--sm-up) { + padding: var(--sp24); + } +} From 244395397fd844437787dff6f788dffe93ceda8e Mon Sep 17 00:00:00 2001 From: bluecloud <96812901+pitb2022@users.noreply.github.com> Date: Thu, 29 Aug 2024 21:03:30 +0800 Subject: [PATCH 8/9] chore: bump version --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index abfa795bf4..7e2a021cd7 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "matters-web", - "version": "5.6.0", + "version": "5.6.1", "description": "codebase of Matters' website", "author": "Matters ", "engines": { From b7874a09cf017e1bfabd15b1040ad1338f2c0aee Mon Sep 17 00:00:00 2001 From: devformatters2 <177856586+devformatters2@users.noreply.github.com> Date: Fri, 30 Aug 2024 10:19:00 +0800 Subject: [PATCH 9/9] fix(editor): support to match and replace query parameters and hash for article links --- src/components/Editor/Article/extensions/smartLink/utils.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/components/Editor/Article/extensions/smartLink/utils.ts b/src/components/Editor/Article/extensions/smartLink/utils.ts index 9ee8340ced..f610cc7d27 100644 --- a/src/components/Editor/Article/extensions/smartLink/utils.ts +++ b/src/components/Editor/Article/extensions/smartLink/utils.ts @@ -10,7 +10,7 @@ export const makeSmartLinkOptions = ({ }) => { return { findRule: new RegExp( - `https://${process.env.NEXT_PUBLIC_SITE_DOMAIN}/a/(?[a-zA-Z0-9]+)`, + `https://${process.env.NEXT_PUBLIC_SITE_DOMAIN}/a/(?[a-zA-Z0-9]+)(?:\\?.*|#.*)?`, 'g' ), search: async ({