[MM-64360] Data retention: optionally preserve pinned posts (#31165)

* add new config to preserve pinned posts during data retention

* more graceful error if the pinned post was a reply in a deleted thread
Этот коммит содержится в:
Ben Cooke
2025-06-09 15:41:07 -04:00
коммит произвёл GitHub
родитель 6eb2128abc
Коммит aac34f6db4
23 изменённых файлов: 388 добавлений и 106 удалений

Просмотреть файл

@@ -60,6 +60,16 @@ const ErrorMessage: React.FC<Props> = ({type, message, service, isGuest}: Props)
</p>
);
break;
case ErrorPageTypes.POST_NOT_FOUND:
errorMessage = (
<p>
<FormattedMessage
id='post.error.access'
defaultMessage="The post you're requesting is private or does not exist."
/>
</p>
);
break;
case ErrorPageTypes.CLOUD_ARCHIVED:
errorMessage = (
<p>

Просмотреть файл

@@ -31,6 +31,14 @@ const ErrorTitle: React.FC<Props> = ({type, title}: Props) => {
/>
);
break;
case ErrorPageTypes.POST_NOT_FOUND:
errorTitle = (
<FormattedMessage
id='post.error.title'
defaultMessage='Post Not Found'
/>
);
break;
case ErrorPageTypes.CLOUD_ARCHIVED:
errorTitle = (
<FormattedMessage

Просмотреть файл

@@ -52,6 +52,11 @@ function focusReplyPost(post: Post, channel: Channel, teamId: string, returnTo:
return async (dispatch, getState) => {
const {data} = await dispatch(getPostThread(post.root_id));
if (!data) {
getHistory().replace(`/error?type=${ErrorPageTypes.POST_NOT_FOUND}&returnTo=${returnTo}`);
return {data: false};
}
if (data!.first_inaccessible_post_time) {
getHistory().replace(`/error?type=${ErrorPageTypes.CLOUD_ARCHIVED}&returnTo=${returnTo}`);
return {data: false};

Просмотреть файл

@@ -5008,6 +5008,8 @@
"post.ariaLabel.reaction": ", 1 reaction",
"post.ariaLabel.reactionMultiple": ", {reactionCount} reactions",
"post.ariaLabel.replyMessage": "At {time} {date}, {authorName} replied, {message}",
"post.error.access": "The post you're requesting is private or does not exist.",
"post.error.title": "Post Not Found",
"post.reminder.acknowledgement": "You will be reminded at {reminderTime}, {reminderDate} about this message from {username}: {permaLink}",
"post.reminder.systemBot": "Hi there, here's your reminder about this message from {username}: {permaLink}",
"post.renderError.message": "An error occurred while rendering this post.",

Просмотреть файл

@@ -927,6 +927,7 @@ export const ErrorPageTypes = {
PERMALINK_NOT_FOUND: 'permalink_not_found',
TEAM_NOT_FOUND: 'team_not_found',
CHANNEL_NOT_FOUND: 'channel_not_found',
POST_NOT_FOUND: 'post_not_found',
CLOUD_ARCHIVED: 'cloud_archived',
};