Skip to content

Commit 47b80c4

Browse files
committed
feat: moving feature flags to default.json (WPB-21978)
1 parent 0f2175f commit 47b80c4

File tree

5 files changed

+20
-8
lines changed

5 files changed

+20
-8
lines changed

app/src/main/kotlin/com/wire/android/di/KaliumConfigsModule.kt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,8 @@ class KaliumConfigsModule {
6262
maxRemoteSearchResultCount = BuildConfig.MAX_REMOTE_SEARCH_RESULT_COUNT,
6363
limitTeamMembersFetchDuringSlowSync = BuildConfig.LIMIT_TEAM_MEMBERS_FETCH_DURING_SLOW_SYNC,
6464
isMlsResetEnabled = BuildConfig.IS_MLS_RESET_ENABLED,
65+
securePublicLinkSettings = BuildConfig.SECURE_PUBLIC_LINK_SETTINGS,
66+
collaboraIntegration = BuildConfig.COLLABORA_INTEGRATION_ENABLED,
6567
)
6668
}
6769
}

buildSrc/src/main/kotlin/customization/FeatureConfigs.kt

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -125,4 +125,7 @@ enum class FeatureConfigs(val value: String, val configType: ConfigType) {
125125
MEETINGS_ENABLED("meetings_enabled", ConfigType.BOOLEAN),
126126

127127
USE_ASYNC_FLUSH_LOGGING("use_async_flush_logging", ConfigType.BOOLEAN),
128+
129+
SECURE_PUBLIC_LINK_SETTINGS("secure_public_link_settings", ConfigType.BOOLEAN),
130+
COLLABORA_INTEGRATION_ENABLED("collabora_integration", ConfigType.BOOLEAN),
128131
}

default.json

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,9 @@
3434
"analytics_server_url": "https://wire.count.ly/",
3535
"enable_new_registration": true,
3636
"channels_history_options_enabled": true,
37-
"meetings_enabled": true
37+
"meetings_enabled": true,
38+
"secure_public_link_settings": true,
39+
"collabora_integration": true
3840
},
3941
"staging": {
4042
"application_id": "com.waz.zclient.dev",
@@ -67,7 +69,8 @@
6769
"analytics_enabled": true,
6870
"analytics_app_key": "8ffae535f1836ed5f58fd5c8a11c00eca07c5438",
6971
"analytics_server_url": "https://wire.count.ly/",
70-
"enable_new_registration": true
72+
"enable_new_registration": true,
73+
"secure_public_link_settings": true
7174
},
7275
"internal": {
7376
"application_id": "com.wire.internal",
@@ -78,7 +81,8 @@
7881
"analytics_enabled": true,
7982
"analytics_app_key": "8ffae535f1836ed5f58fd5c8a11c00eca07c5438",
8083
"analytics_server_url": "https://wire.count.ly/",
81-
"enable_new_registration": true
84+
"enable_new_registration": true,
85+
"secure_public_link_settings": true
8286
},
8387
"fdroid": {
8488
"application_id": "com.wire",
@@ -149,5 +153,7 @@
149153
"is_mls_reset_enabled": true,
150154
"use_strict_mls_filter": false,
151155
"meetings_enabled": false,
152-
"emm_support_enabled": true
156+
"emm_support_enabled": true,
157+
"secure_public_link_settings": false,
158+
"collabora_integration": false
153159
}

features/cells/src/main/java/com/wire/android/feature/cells/ui/publiclink/PublicLinkViewModel.kt

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -27,9 +27,9 @@ import com.wire.kalium.cells.domain.model.PublicLink
2727
import com.wire.kalium.cells.domain.usecase.publiclink.CreatePublicLinkUseCase
2828
import com.wire.kalium.cells.domain.usecase.publiclink.DeletePublicLinkUseCase
2929
import com.wire.kalium.cells.domain.usecase.publiclink.GetPublicLinkUseCase
30-
import com.wire.kalium.cells.domain.usecase.publiclink.SECURE_PUBLIC_LINK_ENABLED
3130
import com.wire.kalium.common.functional.onFailure
3231
import com.wire.kalium.common.functional.onSuccess
32+
import com.wire.kalium.logic.featureFlags.KaliumConfigs
3333
import dagger.hilt.android.lifecycle.HiltViewModel
3434
import kotlinx.coroutines.flow.MutableStateFlow
3535
import kotlinx.coroutines.flow.asStateFlow
@@ -44,6 +44,7 @@ class PublicLinkViewModel @Inject constructor(
4444
private val getPublicLinkUseCase: GetPublicLinkUseCase,
4545
private val deletePublicLinkUseCase: DeletePublicLinkUseCase,
4646
private val fileHelper: FileHelper,
47+
private val config: KaliumConfigs,
4748
) : ActionsViewModel<PublicLinkViewAction>() {
4849

4950
private val navArgs: PublicLinkNavArgs = savedStateHandle.navArgs()
@@ -108,7 +109,7 @@ class PublicLinkViewModel @Inject constructor(
108109
linkState = PublicLinkState.READY
109110
)
110111
}
111-
if (SECURE_PUBLIC_LINK_ENABLED) {
112+
if (config.securePublicLinkSettings) {
112113
_state.update {
113114
it.copy(
114115
settings = PublicLinkSettings()
@@ -129,7 +130,7 @@ class PublicLinkViewModel @Inject constructor(
129130

130131
_state.update { it.copy(linkState = PublicLinkState.READY) }
131132

132-
if (SECURE_PUBLIC_LINK_ENABLED) {
133+
if (config.securePublicLinkSettings) {
133134
_state.update {
134135
it.copy(
135136
settings = PublicLinkSettings(

0 commit comments

Comments
 (0)