Skip to content

Commit

Permalink
Merge pull request #4968 from thematters/develop
Browse files Browse the repository at this point in the history
Release: v5.7.0
  • Loading branch information
gitwoz authored Dec 4, 2024
2 parents 6e5b368 + ec73302 commit b595732
Show file tree
Hide file tree
Showing 153 changed files with 1,466 additions and 4,737 deletions.
184 changes: 31 additions & 153 deletions lang/default.json

Large diffs are not rendered by default.

184 changes: 31 additions & 153 deletions lang/en.json

Large diffs are not rendered by default.

184 changes: 31 additions & 153 deletions lang/zh-Hans.json

Large diffs are not rendered by default.

184 changes: 31 additions & 153 deletions lang/zh-Hant.json

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "matters-web",
"version": "5.6.6",
"version": "5.7.0",
"description": "codebase of Matters' website",
"author": "Matters <[email protected]>",
"engines": {
Expand Down
1 change: 1 addition & 0 deletions src/common/enums/events.ts
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@ export const SUPPORT_SUCCESS_ANIMATION = 'supportSuccessAnimation'
export enum UNIVERSAL_AUTH_TRIGGER {
appreciation = 'appreciation',
bookmark = 'bookmark',
bookmarkTag = 'bookmarkTag',
circlePrice = 'circlePrice',
circleSubscription = 'circleSubscription',
collectArticle = 'collectArticle',
Expand Down
30 changes: 3 additions & 27 deletions src/common/enums/oauth.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ export const OAUTH_SCOPE_TREE = {
zh_hans: '草稿',
},
},
subscriptions: {
bookmarkedArticles: {
_t: {
zh_hant: '收藏作品',
zh_hans: '收藏作品',
Expand Down Expand Up @@ -87,42 +87,18 @@ export const OAUTH_SCOPE_TREE = {
zh_hant: '管理個人資料、標籤、評論、封鎖、追蹤等',
zh_hans: '管理个人资料、标签、评论、封锁、关注等',
},
toggleSubscribeArticle: {
toggleBookmarkArticle: {
_t: {
zh_hant: '收藏作品',
zh_hans: '收藏作品',
},
},
toggleFollowTag: {
toggleBookmarkTag: {
_t: {
zh_hant: '追蹤標籤',
zh_hans: '关注标签',
},
},
updateTagSetting: {
_t: {
zh_hant: '管理標籤',
zh_hans: '管理标签',
},
},
addArticlesTags: {
_t: {
zh_hant: '添加作品到標籤',
zh_hans: '添加作品到标签',
},
},
updateArticlesTags: {
_t: {
zh_hant: '管理標籤作品',
zh_hans: '管理标签作品',
},
},
deleteArticlesTags: {
_t: {
zh_hant: '移除標籤作品',
zh_hans: '移除标签作品',
},
},
togglePinComment: {
_t: {
zh_hant: '精选評論',
Expand Down
6 changes: 4 additions & 2 deletions src/common/enums/route.ts
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,8 @@ type ROUTE_KEY =
| 'ME_DRAFTS'
| 'ME_PUBLISHED'
| 'ME_ARCHIVED'
| 'ME_BOOKMARKS'
| 'ME_BOOKMARKS_ARTICLES'
| 'ME_BOOKMARKS_TAGS'
| 'ME_HISTORY'
| 'ME_HISTORY_COMMENTS'
| 'ME_HISTORY_LIKES_SENT'
Expand Down Expand Up @@ -146,7 +147,8 @@ export const ROUTES: {
{ key: 'ME_DRAFTS', pathname: '/me/drafts' },
{ key: 'ME_PUBLISHED', pathname: '/me/published' },
{ key: 'ME_ARCHIVED', pathname: '/me/archived' },
{ key: 'ME_BOOKMARKS', pathname: '/me/bookmarks' },
{ key: 'ME_BOOKMARKS_ARTICLES', pathname: '/me/bookmarks/articles' },
{ key: 'ME_BOOKMARKS_TAGS', pathname: '/me/bookmarks/tags' },
{ key: 'ME_HISTORY', pathname: '/me/history' },
{ key: 'ME_HISTORY_COMMENTS', pathname: '/me/history/comments' },
{ key: 'ME_HISTORY_LIKES_SENT', pathname: '/me/history/likes/sent' },
Expand Down
4 changes: 2 additions & 2 deletions src/common/enums/test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,9 @@ export enum TEST_ID {
DIGEST_USER_RICH_DISPLAY_NAME = 'digest/user/rich/display-name',
DIGEST_USER_VERBOSE = 'digest/user/verbose',
DIGEST_TAG_CONCISE = 'digest/tag/concise',
DIGEST_TAG_BOOKMARK = 'digest/tag/bookmark',
DIGEST_TAG_FEED = 'digest/tag/feed',
DIGEST_TAG_FEED_COVER = 'digest/tag/feed/cover',
DIGEST_TAG_FEED_NUM_ARTICLES = 'digest/tag/feed/num-articles',
DIGEST_TAG_RICH = 'digest/tag/rich',
DIGEST_TAG_SIDEBAR = 'digest/tag/sidebar',
DIGRET_CIRCLE_PLAIN = 'digest/circle/plain',
Expand All @@ -44,7 +45,6 @@ export enum TEST_ID {
DIGEST_CIRCLE_MEMBER_COUNT = 'digest/circle/member-count',
DIGEST_CIRCLE_ARTICLE_COUNT = 'digest/circle/article-count',
DIGEST_CIRCLE_PRICE = 'digest/circle/price',
DIGEST_TAG_SIDEBAR_COVER = 'digest/tag/sidebar/cover',
DIGEST_COLLECTION_FEED = 'digest/collection/feed',
DIGEST_DRAFT_FEED = 'digest/draft/feed',
// dialogs
Expand Down
1 change: 1 addition & 0 deletions src/common/styles/variables/spacing.css
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
--sp12: 0.75rem; /* 12px */
--sp14: 0.875rem; /* 14px */
--sp16: 1rem; /* 16px */
--sp18: 1.125rem; /* 18px */
--sp20: 1.25rem; /* 20px */
--sp24: 1.5rem; /* 24px */
--sp32: 2rem; /* 32px */
Expand Down
7 changes: 7 additions & 0 deletions src/common/utils/analytics.ts
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ type EventArgs =
| ['authenticate', AuthenticateProp]
| ['billboard_exposure', BillboardExposureProp]
| ['click_billboard', ClickBillboardProp]
| ['read_time', ReadTimeProp]

/**
* Event: Page View
Expand Down Expand Up @@ -239,6 +240,11 @@ interface AuthenticateProp {
trigger?: string
}

interface ReadTimeProp {
articleId: string
time: number
}

// content type
export type ContentType =
| 'article'
Expand Down Expand Up @@ -340,6 +346,7 @@ type UserFeedType =
| 'tag_detail_latest'
| 'tag_detail_selected'
| 'tag_detail_community'
| 'tag_detail_recommended_authors'
| 'transaction'

type TagFeedType =
Expand Down
2 changes: 1 addition & 1 deletion src/common/utils/text/tag.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ const stripTagAllPunct = (content: string) => {
return words[0]
default:
const [first, ...rest] = words
return `${first} ${rest.join('')}`
return `${first} ${rest.join(' ')}`
}
}

Expand Down
2 changes: 1 addition & 1 deletion src/common/utils/url.ts
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ const changeExt = ({ key, ext }: { key: string; ext?: 'webp' }) => {
}

export const toSizedImageURL = ({
url,
url = '',
width,
height,
ext,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@ const ARCHIVE_ARTICLE = gql`
editArticle(input: { id: $id, state: archived }) {
id
articleState: state
sticky
}
}
`
Expand Down Expand Up @@ -52,7 +51,6 @@ const ArchiveArticleDialog = ({
editArticle: {
id: article.id,
articleState: 'archived' as any,
sticky: false,
__typename: 'Article',
},
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -190,19 +190,8 @@ describe('<ArticleDigest/DropdownActions>', () => {
expect($archiveButton).toBeInTheDocument()
})

// hasSetTagSelected
// hasSetTagUnselected
// hasRemoveTag
it('should render tag buttons', async () => {
render(
<DropdownActions
article={MOCK_ARTILCE}
tagDetailId="1"
hasSetTagSelected
hasSetTagUnselected
hasRemoveTag
/>
)
render(<DropdownActions article={MOCK_ARTILCE} tagDetailId="1" />)

const $button = screen.getByLabelText('More Actions')
expect($button).toBeInTheDocument()
Expand All @@ -211,24 +200,6 @@ describe('<ArticleDigest/DropdownActions>', () => {
$button.click()
const $menu = screen.getByRole('menu')
expect($menu).toBeInTheDocument()

// hasSetTagSelected
const $setTagSelectedBtn = screen.getByRole('menuitem', {
name: 'Add to Featured',
})
expect($setTagSelectedBtn).toBeInTheDocument()

// hasUnsetTagSelected
const $setTagUnselectedBtn = screen.getByRole('menuitem', {
name: 'Unpin from Trending',
})
expect($setTagUnselectedBtn).toBeInTheDocument()

// hasRemoveTag
const $removeTagBtn = screen.getByRole('menuitem', {
name: 'Remove Article',
})
expect($removeTagBtn).toBeInTheDocument()
})

// hasSetTopCollection
Expand Down
86 changes: 0 additions & 86 deletions src/components/ArticleDigest/DropdownActions/RemoveTagButton.tsx

This file was deleted.

This file was deleted.

Loading

0 comments on commit b595732

Please sign in to comment.