mirror of
https://github.com/mattermost/mattermost-mobile.git
synced 2026-11-05 10:28:54 +00:00
* MM-70299 - display channel attributes in header, info and banner
* cover and expand channel attributes feature with UI and E2E tests
* Implement channel attributes lock and update related tests and API methods
* Enhance error logging and improve type definitions for channel attributes
* Handle error from setAccessControlGroupId in fetchAccessControlAttributeFields
* Refactor fetchAccessControlAttributeFields to include system ID handling and improve batch record persistence
* Address code review feedback: extract feature-flag constants, move DB-only helpers to query/local layers, refactor attribute chip styles, fix colour spelling, and add test coverage for value pruning and subtitle component
* Fix error handling in removeStoredFields function and delete obsolete end-to-end test file
* Add tests for removeStoredFields function and enhance property queries
* Fix removeStoredFields to recover group ID from classification anchor and clean all owned fields
* Fix batchRecords silently swallowing write errors in fetchAccessControlAttributeFields
* Remove unused visibility check for ChannelAttributeLabels in e2e tests
* Fix classification fetch cache and channel-attributes E2E lock contention
Do not stamp the classification banner cache when both access-control flags
are off, so turning a flag back on after a reload refetches fields.
Share the classification lock with the channel-attributes Detox suite and
stop unsetting ClassificationMarkings. Skip flag-on tests when the server
cannot enable ChannelAttributes.
* Scope access_control field prune to owned object types
handlePropertyFields(groupId) deletes every field in the group. The fetch
only returns system and channel fields, so same-group user/session rows
were removed on each refresh. Prune only system and channel fields, matching
removeStoredFields.
* fail channel attributes tests when feature enablement fails instead of silently reporting them as passed
* Compose all channel attribute values in banners with template resolution, mixed field support, and matching web colors
---------
(cherry picked from commit 54731fa6ac)
Co-authored-by: Pablo Vélez <pablovv2016@gmail.com>
Co-authored-by: Cursor Agent <cursoragent@cursor.com>
Co-authored-by: mattermost-code <matty-code@mattermost.com>
124 lines
3.9 KiB
TypeScript
124 lines
3.9 KiB
TypeScript
// Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved.
|
|
// See LICENSE.txt for license information.
|
|
|
|
import keyMirror from '@utils/key_mirror';
|
|
|
|
export const MM_TABLES = {
|
|
APP: {
|
|
INFO: 'Info',
|
|
GLOBAL: 'Global',
|
|
SERVERS: 'Servers',
|
|
},
|
|
SERVER: {
|
|
CATEGORY: 'Category',
|
|
CATEGORY_CHANNEL: 'CategoryChannel',
|
|
CHANNEL: 'Channel',
|
|
CHANNEL_BOOKMARK: 'ChannelBookmark',
|
|
CHANNEL_INFO: 'ChannelInfo',
|
|
CHANNEL_MEMBERSHIP: 'ChannelMembership',
|
|
CONFIG: 'Config',
|
|
CUSTOM_EMOJI: 'CustomEmoji',
|
|
CUSTOM_PROFILE_FIELD: 'CustomProfileField',
|
|
CUSTOM_PROFILE_ATTRIBUTE: 'CustomProfileAttribute',
|
|
DRAFT: 'Draft',
|
|
FILE: 'File',
|
|
GROUP: 'Group',
|
|
GROUP_CHANNEL: 'GroupChannel',
|
|
GROUP_MEMBERSHIP: 'GroupMembership',
|
|
GROUP_TEAM: 'GroupTeam',
|
|
MY_CHANNEL: 'MyChannel',
|
|
MY_CHANNEL_SETTINGS: 'MyChannelSettings',
|
|
MY_TEAM: 'MyTeam',
|
|
POST: 'Post',
|
|
POSTS_IN_CHANNEL: 'PostsInChannel',
|
|
POSTS_IN_THREAD: 'PostsInThread',
|
|
PREFERENCE: 'Preference',
|
|
PROPERTY_FIELD: 'PropertyField',
|
|
PROPERTY_VALUE: 'PropertyValue',
|
|
REACTION: 'Reaction',
|
|
ROLE: 'Role',
|
|
SCHEDULED_POST: 'ScheduledPost',
|
|
SYSTEM: 'System',
|
|
TEAM: 'Team',
|
|
TEAM_CHANNEL_HISTORY: 'TeamChannelHistory',
|
|
TEAM_MEMBERSHIP: 'TeamMembership',
|
|
TEAM_SEARCH_HISTORY: 'TeamSearchHistory',
|
|
THREAD: 'Thread',
|
|
THREADS_IN_TEAM: 'ThreadsInTeam',
|
|
THREAD_PARTICIPANT: 'ThreadParticipant',
|
|
TEAM_THREADS_SYNC: 'TeamThreadsSync',
|
|
USER: 'User',
|
|
},
|
|
};
|
|
|
|
export const MIGRATION_EVENTS = keyMirror({
|
|
MIGRATION_ERROR: null,
|
|
MIGRATION_STARTED: null,
|
|
MIGRATION_SUCCESS: null,
|
|
});
|
|
|
|
export const SYSTEM_IDENTIFIERS = {
|
|
CURRENT_CHANNEL_ID: 'currentChannelId',
|
|
LAST_UNREAD_CHANNEL_ID: 'lastUnreadChannelId',
|
|
CURRENT_TEAM_ID: 'currentTeamId',
|
|
CURRENT_USER_ID: 'currentUserId',
|
|
DATA_RETENTION_POLICIES: 'dataRetentionPolicies',
|
|
DISCONNECTED_SINCE: 'disconnectedSince',
|
|
EXPANDED_LINKS: 'expandedLinks',
|
|
GRANULAR_DATA_RETENTION_POLICIES: 'granularDataRetentionPolicies',
|
|
LAST_DATA_RETENTION_RUN: 'lastDataRetentionRun',
|
|
GLOBAL_THREADS_TAB: 'globalThreadsTab',
|
|
LAST_DISMISSED_BANNER: 'lastDismissedBanner',
|
|
LAST_SEEN_TIME: 'lastSeenTime',
|
|
LAST_SERVER_VERSION_CHECK: 'LastServerVersionCheck',
|
|
LICENSE: 'license',
|
|
OFFLINE_SINCE: 'offlineSince',
|
|
ONLY_UNREADS: 'onlyUnreads',
|
|
PUSH_VERIFICATION_STATUS: 'pushVerificationStatus',
|
|
RECENT_CUSTOM_STATUS: 'recentCustomStatus',
|
|
RECENT_MENTIONS: 'recentMentions',
|
|
RECENT_REACTIONS: 'recentReactions',
|
|
SESSION_EXPIRATION: 'sessionExpiration',
|
|
TEAM_HISTORY: 'teamHistory',
|
|
WEBSOCKET: 'WebSocket',
|
|
PLAYBOOKS_VERSION: 'playbooks_version',
|
|
AGENTS_VERSION: 'agents_version',
|
|
LAST_BOR_POST_CLEANUP_RUN: 'lastBoRPostCleanupRun',
|
|
ACCESS_CONTROL_GROUP_ID: 'accessControlGroupId',
|
|
LAST_AUTO_CACHE_CLEANUP_RUN: 'lastAutoCacheCleanupRun',
|
|
};
|
|
|
|
export const GLOBAL_IDENTIFIERS = {
|
|
DEVICE_TOKEN: 'deviceToken',
|
|
VOIP_DEVICE_TOKEN: 'voipDeviceToken',
|
|
DONT_ASK_FOR_REVIEW: 'dontAskForReview',
|
|
FIRST_LAUNCH: 'firstLaunch',
|
|
LAST_ASK_FOR_REVIEW: 'lastAskForReview',
|
|
ONBOARDING: 'onboarding',
|
|
LAST_VIEWED_TEAM: 'lastViewedTeam',
|
|
LAST_VIEWED_CHANNEL: 'lastViewedChannel',
|
|
LAST_VIEWED_THREAD: 'lastViewedThread',
|
|
PUSH_DISABLED_ACK: 'pushDisabledAck',
|
|
CACHE_MIGRATION: 'cacheMigration',
|
|
PUSH_SIGNING_KEY: 'pushSigningKey',
|
|
};
|
|
|
|
export enum OperationType {
|
|
CREATE = 'CREATE',
|
|
UPDATE = 'UPDATE',
|
|
DELETE = 'DELETE',
|
|
}
|
|
|
|
// The only two types of databases in the app
|
|
export enum DatabaseType {
|
|
DEFAULT,
|
|
SERVER,
|
|
}
|
|
|
|
export default {
|
|
GLOBAL_IDENTIFIERS,
|
|
MM_TABLES,
|
|
MIGRATION_EVENTS,
|
|
SYSTEM_IDENTIFIERS,
|
|
};
|