diff --git a/app/client/rest/posts.ts b/app/client/rest/posts.ts index 44a777286..764e8011e 100644 --- a/app/client/rest/posts.ts +++ b/app/client/rest/posts.ts @@ -17,7 +17,7 @@ export interface ClientPostsMix { getPostsBefore: (channelId: string, postId: string, page?: number, perPage?: number) => Promise; getPostsAfter: (channelId: string, postId: string, page?: number, perPage?: number) => Promise; getFileInfosForPost: (postId: string) => Promise; - getFlaggedPosts: (userId: string, channelId?: string, teamId?: string, page?: number, perPage?: number) => Promise; + getSavedPosts: (userId: string, channelId?: string, teamId?: string, page?: number, perPage?: number) => Promise; getPinnedPosts: (channelId: string) => Promise; markPostAsUnread: (userId: string, postId: string) => Promise; pinPost: (postId: string) => Promise; @@ -125,7 +125,7 @@ const ClientPosts = (superclass: any) => class extends superclass { ); }; - getFlaggedPosts = async (userId: string, channelId = '', teamId = '', page = 0, perPage = PER_PAGE_DEFAULT) => { + getSavedPosts = async (userId: string, channelId = '', teamId = '', page = 0, perPage = PER_PAGE_DEFAULT) => { this.analytics.trackAPI('api_posts_get_flagged', {team_id: teamId}); return this.doFetch( diff --git a/app/components/post_list/post/index.ts b/app/components/post_list/post/index.ts index b81162243..1bfac3c05 100644 --- a/app/components/post_list/post/index.ts +++ b/app/components/post_list/post/index.ts @@ -100,7 +100,7 @@ const withPost = withObservables( const author = post.author.observe(); const canDelete = from$(hasPermissionForPost(post, currentUser, isOwner ? Permissions.DELETE_POST : Permissions.DELETE_OTHERS_POSTS, false)); const isEphemeral = of$(isPostEphemeral(post)); - const isFlagged = database.get(PREFERENCE).query( + const isSaved = database.get(PREFERENCE).query( Q.where('category', Preferences.CATEGORY_SAVED_POST), Q.where('name', post.id), ).observe().pipe(switchMap((pref) => of$(Boolean(pref.length)))); @@ -149,7 +149,7 @@ const withPost = withObservables( isConsecutivePost, isEphemeral, isFirstReply: of$(isFirstReply(post, previousPost)), - isFlagged, + isSaved, isJumboEmoji, isLastReply, isPostAddChannelMember, diff --git a/app/components/post_list/post/post.tsx b/app/components/post_list/post/post.tsx index 1edd0ea79..e8fba0733 100644 --- a/app/components/post_list/post/post.tsx +++ b/app/components/post_list/post/post.tsx @@ -42,7 +42,7 @@ type PostProps = { isConsecutivePost?: boolean; isEphemeral: boolean; isFirstReply?: boolean; - isFlagged?: boolean; + isSaved?: boolean; isJumboEmoji: boolean; isLastReply?: boolean; isPostAddChannelMember: boolean; @@ -52,7 +52,7 @@ type PostProps = { reactionsCount: number; shouldRenderReplyButton?: boolean; showAddReaction?: boolean; - skipFlaggedHeader?: boolean; + skipSavedHeader?: boolean; skipPinnedHeader?: boolean; style?: StyleProp; testID?: string; @@ -97,8 +97,8 @@ const getStyleSheet = makeStyleSheetFromTheme((theme: Theme) => { const Post = ({ appsEnabled, canDelete, currentUser, differentThreadSequence, files, hasReplies, highlight, highlightPinnedOrSaved = true, highlightReplyBar, - isConsecutivePost, isEphemeral, isFirstReply, isFlagged, isJumboEmoji, isLastReply, isPostAddChannelMember, - location, post, reactionsCount, shouldRenderReplyButton, skipFlaggedHeader, skipPinnedHeader, showAddReaction = true, style, + isConsecutivePost, isEphemeral, isFirstReply, isSaved, isJumboEmoji, isLastReply, isPostAddChannelMember, + location, post, reactionsCount, shouldRenderReplyButton, skipSavedHeader, skipPinnedHeader, showAddReaction = true, style, testID, previousPost, }: PostProps) => { const pressDetected = useRef(false); @@ -176,7 +176,7 @@ const Post = ({ } }; - const highlightFlagged = isFlagged && !skipFlaggedHeader; + const highlightSaved = isSaved && !skipSavedHeader; const hightlightPinned = post.isPinned && !skipPinnedHeader; const itemTestID = `${testID}.${post.id}`; const rightColumnStyle = [styles.rightColumn, (post.rootId && isLastReply && styles.rightColumnPadding)]; @@ -185,7 +185,7 @@ const Post = ({ let highlightedStyle: StyleProp; if (highlight) { highlightedStyle = styles.highlight; - } else if ((highlightFlagged || hightlightPinned) && highlightPinnedOrSaved) { + } else if ((highlightSaved || hightlightPinned) && highlightPinnedOrSaved) { highlightedStyle = styles.highlightPinnedOrSaved; } @@ -279,9 +279,9 @@ const Post = ({ <> diff --git a/app/components/post_list/post/pre_header/index.tsx b/app/components/post_list/post/pre_header/index.tsx index 53a724273..c4f045a00 100644 --- a/app/components/post_list/post/pre_header/index.tsx +++ b/app/components/post_list/post/pre_header/index.tsx @@ -12,9 +12,9 @@ import {makeStyleSheetFromTheme} from '@utils/theme'; type PreHeaderProps = { isConsecutivePost?: boolean; - isFlagged?: boolean; + isSaved?: boolean; isPinned: boolean; - skipFlaggedHeader?: boolean; + skipSavedHeader?: boolean; skipPinnedHeader?: boolean; } @@ -56,15 +56,15 @@ const getStyleSheet = makeStyleSheetFromTheme((theme: Theme) => { }; }); -const PreHeader = ({isConsecutivePost, isFlagged, isPinned, skipFlaggedHeader, skipPinnedHeader}: PreHeaderProps) => { +const PreHeader = ({isConsecutivePost, isSaved, isPinned, skipSavedHeader, skipPinnedHeader}: PreHeaderProps) => { const theme = useTheme(); const style = getStyleSheet(theme); - const isPinnedAndFlagged = isPinned && isFlagged && !skipFlaggedHeader && !skipPinnedHeader; + const isPinnedAndSaved = isPinned && isSaved && !skipSavedHeader && !skipPinnedHeader; let text; - if (isPinnedAndFlagged) { + if (isPinnedAndSaved) { text = { - id: t('mobile.post_pre_header.pinned_flagged'), + id: t('mobile.post_pre_header.pinned_saved'), defaultMessage: 'Pinned and Saved', }; } else if (isPinned && !skipPinnedHeader) { @@ -72,9 +72,9 @@ const PreHeader = ({isConsecutivePost, isFlagged, isPinned, skipFlaggedHeader, s id: t('mobile.post_pre_header.pinned'), defaultMessage: 'Pinned', }; - } else if (isFlagged && !skipFlaggedHeader) { + } else if (isSaved && !skipSavedHeader) { text = { - id: t('mobile.post_pre_header.flagged'), + id: t('mobile.post_pre_header.saved'), defaultMessage: 'Saved', }; } @@ -93,10 +93,10 @@ const PreHeader = ({isConsecutivePost, isFlagged, isPinned, skipFlaggedHeader, s style={style.icon} /> } - {isPinnedAndFlagged && + {isPinnedAndSaved && } - {isFlagged && !skipFlaggedHeader && + {isSaved && !skipSavedHeader && { defaultMessage={defaultMessage} iconName='bookmark-outline' onPress={onHandlePress} - testID='post.options.flag.unflag' + testID={id} /> ); }; diff --git a/assets/base/i18n/en.json b/assets/base/i18n/en.json index b44132565..aa78cba6b 100644 --- a/assets/base/i18n/en.json +++ b/assets/base/i18n/en.json @@ -126,6 +126,7 @@ "emoji_skin.medium_light_skin_tone": "medium light skin tone", "emoji_skin.medium_skin_tone": "medium skin tone", "file_upload.fileAbove": "Files must be less than {max}", + "gallery.copy_link.failed": "Failed to copy link to clipboard", "gallery.downloading": "Downloading...", "gallery.footer.channel_name": "Shared in {channelName}", "gallery.image_saved": "Image saved", @@ -286,9 +287,9 @@ "mobile.post_info.save": "Save", "mobile.post_info.unpin": "Unpin from Channel", "mobile.post_info.unsave": "Unsave", - "mobile.post_pre_header.flagged": "Saved", "mobile.post_pre_header.pinned": "Pinned", - "mobile.post_pre_header.pinned_flagged": "Pinned and Saved", + "mobile.post_pre_header.pinned_saved": "Pinned and Saved", + "mobile.post_pre_header.saved": "Saved", "mobile.post_textbox.entire_channel_here.message": "By using @here you are about to send notifications to up to {totalMembers, number} {totalMembers, plural, one {person} other {people}}. Are you sure you want to do this?", "mobile.post_textbox.entire_channel_here.message.with_timezones": "By using @here you are about to send notifications up to {totalMembers, number} {totalMembers, plural, one {person} other {people}} in {timezones, number} {timezones, plural, one {timezone} other {timezones}}. Are you sure you want to do this?", "mobile.post_textbox.entire_channel.cancel": "Cancel",