Skip to content

Commit

Permalink
feat: add feature flag for displaying release notes sections (WPB-117…
Browse files Browse the repository at this point in the history
…02) πŸ’ πŸ’ (#3553)

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: Oussama Hassine <[email protected]>
  • Loading branch information
github-actions[bot] and ohassine authored Oct 24, 2024
1 parent ffc0f67 commit 88ffcdd
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 17 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ import androidx.compose.ui.Modifier
import androidx.compose.ui.platform.LocalContext
import androidx.compose.ui.tooling.preview.Preview
import androidx.hilt.navigation.compose.hiltViewModel
import com.wire.android.BuildConfig
import com.wire.android.R
import com.wire.android.model.Clickable
import com.wire.android.navigation.HomeNavGraph
Expand Down Expand Up @@ -73,13 +74,15 @@ fun WhatsNewScreenContent(
state = lazyListState,
modifier = modifier.fillMaxSize()
) {
folderWithElements(
items = buildList {
add(WhatsNewItem.WelcomeToNewAndroidApp)
},
onItemClicked = onItemClicked,
isLoading = false,
)
if (BuildConfig.SHOULD_DISPLAY_RELEASE_NOTES) {
folderWithElements(
items = buildList {
add(WhatsNewItem.WelcomeToNewAndroidApp)
},
onItemClicked = onItemClicked,
isLoading = false,
)
}

folderWithElements(
header = context.getString(R.string.whats_new_release_notes_group_title),
Expand All @@ -99,16 +102,18 @@ fun WhatsNewScreenContent(
}
add(WhatsNewItem.AllAndroidReleaseNotes(id = "placeholder_all"))
} else {
state.releaseNotesItems.forEach {
add(
WhatsNewItem.AndroidReleaseNotes(
id = it.id,
title = UIText.DynamicString(it.title),
boldTitle = true,
text = UIText.DynamicString(it.publishDate),
url = it.link,
if (BuildConfig.SHOULD_DISPLAY_RELEASE_NOTES) {
state.releaseNotesItems.forEach {
add(
WhatsNewItem.AndroidReleaseNotes(
id = it.id,
title = UIText.DynamicString(it.title),
boldTitle = true,
text = UIText.DynamicString(it.publishDate),
url = it.link,
)
)
)
}
}
add(WhatsNewItem.AllAndroidReleaseNotes())
}
Expand Down
2 changes: 2 additions & 0 deletions buildSrc/src/main/kotlin/customization/FeatureConfigs.kt
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,8 @@ enum class FeatureConfigs(val value: String, val configType: ConfigType) {

IS_PASSWORD_PROTECTED_GUEST_LINK_ENABLED("is_password_protected_guest_link_enabled", ConfigType.BOOLEAN),

SHOULD_DISPLAY_RELEASE_NOTES("should_display_release_notes", ConfigType.BOOLEAN),

MAX_REMOTE_SEARCH_RESULT_COUNT("max_remote_search_result_count", ConfigType.INT),
LIMIT_TEAM_MEMBERS_FETCH_DURING_SLOW_SYNC("limit_team_members_fetch_during_slow_sync", ConfigType.INT),

Expand Down
3 changes: 2 additions & 1 deletion default.json
Original file line number Diff line number Diff line change
Expand Up @@ -141,5 +141,6 @@
"team_app_lock_timeout": 60,
"max_remote_search_result_count": 30,
"limit_team_members_fetch_during_slow_sync": 2000,
"picture_in_picture_enabled": false
"picture_in_picture_enabled": false,
"should_display_release_notes": true
}

0 comments on commit 88ffcdd

Please sign in to comment.