From f629ab3abbd61d63b2b88130527acc14aea9d1ba Mon Sep 17 00:00:00 2001 From: Przemyslaw Jozwik Date: Tue, 5 Nov 2024 09:16:02 +0100 Subject: [PATCH] feat: Add feature flag for remove group --- server/config/client.config.ts | 1 + server/config/env.ts | 3 +++ .../ConversationDetails/utils/getConversationActions.ts | 6 +++++- 3 files changed, 9 insertions(+), 1 deletion(-) diff --git a/server/config/client.config.ts b/server/config/client.config.ts index c70c0b59d19..5966226fd9c 100644 --- a/server/config/client.config.ts +++ b/server/config/client.config.ts @@ -48,6 +48,7 @@ export function generateConfig(params: ConfigGeneratorParams, env: Env) { CHECK_CONSENT: env.FEATURE_CHECK_CONSENT != 'false', CONFERENCE_AUTO_MUTE: env.FEATURE_CONFERENCE_AUTO_MUTE == 'true', ENABLE_IN_CALL_REACTIONS: env.FEATURE_ENABLE_IN_CALL_REACTIONS == 'true', + ENABLE_REMOVE_GROUP_CONVERSATION: env.FEATURE_ENABLE_REMOVE_GROUP_CONVERSATION == 'true', ENABLE_DETACHED_CALLING_WINDOW: env.FEATURE_ENABLE_DETACHED_CALLING_WINDOW == 'true', ENABLE_TEAM_CREATION: env.FEATURE_ENABLE_TEAM_CREATION == 'true', DEFAULT_LOGIN_TEMPORARY_CLIENT: env.FEATURE_DEFAULT_LOGIN_TEMPORARY_CLIENT == 'true', diff --git a/server/config/env.ts b/server/config/env.ts index 2c9b55c18db..b82aaf81294 100644 --- a/server/config/env.ts +++ b/server/config/env.ts @@ -164,6 +164,9 @@ export type Env = { /** Feature to enable in call reactions */ FEATURE_ENABLE_IN_CALL_REACTIONS: string; + /** Feature to enable remove conversation locally */ + FEATURE_ENABLE_REMOVE_GROUP_CONVERSATION: string; + /** Feature to enable calling popout window */ FEATURE_ENABLE_DETACHED_CALLING_WINDOW: string; diff --git a/src/script/page/RightSidebar/ConversationDetails/utils/getConversationActions.ts b/src/script/page/RightSidebar/ConversationDetails/utils/getConversationActions.ts index ae262041af5..5d1912483e6 100644 --- a/src/script/page/RightSidebar/ConversationDetails/utils/getConversationActions.ts +++ b/src/script/page/RightSidebar/ConversationDetails/utils/getConversationActions.ts @@ -25,6 +25,7 @@ import * as Icon from 'Components/Icon'; import {MenuItem} from 'Components/panel/PanelActions'; import {t} from 'Util/LocalizerUtil'; +import {Config} from '../../../../Config'; import {ConversationRepository} from '../../../../conversation/ConversationRepository'; import {Conversation} from '../../../../entity/Conversation'; import * as UserPermission from '../../../../user/UserPermission'; @@ -164,7 +165,10 @@ const getConversationActions = ({ }, }, { - condition: conversationEntity.isGroup() && conversationEntity.isSelfUserRemoved(), + condition: + conversationEntity.isGroup() && + conversationEntity.isSelfUserRemoved() && + Config.getConfig().FEATURE.ENABLE_REMOVE_GROUP_CONVERSATION, item: { click: () => actionsViewModel.removeConversation(conversationEntity), Icon: Icon.CloseIcon,