* Added scaffolding for unrevealed BoR post * Displayed reveal UI * Displayed expiry timer * WIP * Displayed own post indicator and blur text * restored button * Ungrouped BoR posts * WIP * WIP * DIsplayed error message on revealing * Added last run check on mobile app cleanup job * Cleanup * lint fix * i18n-fix * Added tests * test: add test suite for revealBoRPost function * test: add unrevealed burn on read post test file * feat: add tests for UnrevealedBurnOnReadPost component * test: update UnrevealedBurnOnReadPost test with PostModel type * test: replace toBeTruthy with toBeVisible for component visibility assertions * test: add initial test file for expiry timer component * test: add comprehensive tests for ExpiryCountdown component * refactor: clean up test formatting and remove redundant test case * fix: adjust test timing for ExpiryCountdown onExpiry callback * test: fix timer test by advancing timers in smaller increments * Added tests * Updated tests * fixed accidental change * restored package.resolved * WIP review fixes * Review fixes * Review fixes * Fixed tests * restored package.resolved * WIP * test: add test for skipping BoR post cleanup within 15 minutes * test: add comprehensive test cases for expiredBoRPostCleanup * WIP * WIP * test: add bor.test.ts placeholder file * test: add comprehensive tests for BoR utility functions * test: add comprehensive tests for formatTime function * WIP * test: add comprehensive tests for getLastBoRPostCleanupRun function * Added tests * removed a commented code * post list optimization * test: add test case for updating unrevealed burn-on-read post * fix: handle error logging in expiredBoRPostCleanup test * test: add test case for updateLastBoRCleanupRun error handling * review fixes * lint fixes * Added WS event handling (#9320) * Added WS event handling * test: add burn on read websocket action test * test: add tests for handleBoRPostRevealedEvent in burn_on_read * Added tests * test: add comprehensive error handling test cases for burn on read * Added tests and error handling * BoR post - restricted actions (#9315) * Restricted post actions for BoR post type * Prevent opening thread fr nBoR post * WIP * fix: remove redundant observable wrapping in post options * fixed a change * removed broken * restored package.resolved * Added tests * Awaiting for last run to be set * Added tests for validating expiry timer behaviour (#9338) * Added tests for validating expiry timer behaviour * No need of use event setup * Bor ux fixes (#9336) * WIP * UI and delete fixes * lint fixes * fixed tests * Improved mocking * Improved test
88 lines
2.7 KiB
TypeScript
88 lines
2.7 KiB
TypeScript
// Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved.
|
|
// See LICENSE.txt for license information.
|
|
|
|
import {toMilliseconds} from '@utils/datetime';
|
|
|
|
export const PostTypes = {
|
|
CHANNEL_DELETED: 'system_channel_deleted',
|
|
CHANNEL_UNARCHIVED: 'system_channel_restored',
|
|
DISPLAYNAME_CHANGE: 'system_displayname_change',
|
|
CONVERT_CHANNEL: 'system_convert_channel',
|
|
EPHEMERAL: 'system_ephemeral',
|
|
EPHEMERAL_ADD_TO_CHANNEL: 'system_ephemeral_add_to_channel',
|
|
HEADER_CHANGE: 'system_header_change',
|
|
PURPOSE_CHANGE: 'system_purpose_change',
|
|
|
|
SYSTEM_MESSAGE_PREFIX: 'system_',
|
|
JOIN_LEAVE: 'system_join_leave',
|
|
JOIN_CHANNEL: 'system_join_channel',
|
|
GUEST_JOIN_CHANNEL: 'system_guest_join_channel',
|
|
LEAVE_CHANNEL: 'system_leave_channel',
|
|
ADD_REMOVE: 'system_add_remove',
|
|
ADD_TO_CHANNEL: 'system_add_to_channel',
|
|
ADD_GUEST_TO_CHANNEL: 'system_add_guest_to_chan',
|
|
REMOVE_FROM_CHANNEL: 'system_remove_from_channel',
|
|
|
|
JOIN_TEAM: 'system_join_team',
|
|
LEAVE_TEAM: 'system_leave_team',
|
|
ADD_TO_TEAM: 'system_add_to_team',
|
|
REMOVE_FROM_TEAM: 'system_remove_from_team',
|
|
|
|
COMBINED_USER_ACTIVITY: 'system_combined_user_activity',
|
|
ME: 'me',
|
|
ADD_BOT_TEAMS_CHANNELS: 'add_bot_teams_channels',
|
|
|
|
SYSTEM_AUTO_RESPONDER: 'system_auto_responder',
|
|
CUSTOM_CALLS: 'custom_calls',
|
|
CUSTOM_CALLS_RECORDING: 'custom_calls_recording',
|
|
|
|
CUSTOM_LLMBOT: 'custom_llmbot',
|
|
CUSTOM_LLM_POSTBACK: 'custom_llm_postback',
|
|
|
|
BURN_ON_READ: 'burn_on_read',
|
|
} as const;
|
|
|
|
export const PostPriorityColors = {
|
|
URGENT: '#D24B4E',
|
|
IMPORTANT: '#5D89EA',
|
|
};
|
|
|
|
export enum PostPriorityType {
|
|
STANDARD = '',
|
|
URGENT = 'urgent',
|
|
IMPORTANT = 'important',
|
|
}
|
|
|
|
export const POST_TIME_TO_FAIL = toMilliseconds({seconds: 10});
|
|
|
|
export const BOR_POST_CLEANUP_MIN_RUN_INTERVAL = toMilliseconds({minutes: 15});
|
|
|
|
export default {
|
|
POST_COLLAPSE_TIMEOUT: toMilliseconds({minutes: 5}),
|
|
POST_TYPES: PostTypes,
|
|
USER_ACTIVITY_POST_TYPES: [
|
|
PostTypes.ADD_TO_CHANNEL,
|
|
PostTypes.JOIN_CHANNEL,
|
|
PostTypes.LEAVE_CHANNEL,
|
|
PostTypes.REMOVE_FROM_CHANNEL,
|
|
PostTypes.ADD_TO_TEAM,
|
|
PostTypes.JOIN_TEAM,
|
|
PostTypes.LEAVE_TEAM,
|
|
PostTypes.REMOVE_FROM_TEAM,
|
|
],
|
|
IGNORE_POST_TYPES: [
|
|
PostTypes.ADD_REMOVE,
|
|
PostTypes.ADD_TO_CHANNEL,
|
|
PostTypes.CHANNEL_DELETED,
|
|
PostTypes.CHANNEL_UNARCHIVED,
|
|
PostTypes.JOIN_LEAVE,
|
|
PostTypes.JOIN_CHANNEL,
|
|
PostTypes.LEAVE_CHANNEL,
|
|
PostTypes.REMOVE_FROM_CHANNEL,
|
|
PostTypes.JOIN_TEAM,
|
|
PostTypes.LEAVE_TEAM,
|
|
PostTypes.ADD_TO_TEAM,
|
|
PostTypes.REMOVE_FROM_TEAM,
|
|
],
|
|
POST_TIME_TO_FAIL,
|
|
};
|