fix: several inconsistencies
This commit is contained in:
@@ -134,7 +134,10 @@ class FeaturesRootSection : Routes.Route() {
|
||||
val containers = mutableMapOf<String, PropertyPair<*>>()
|
||||
fun queryContainerRecursive(container: ConfigContainer) {
|
||||
container.properties.forEach {
|
||||
if (it.key.dataType.type == DataProcessors.Type.CONTAINER) {
|
||||
if (
|
||||
it.key.dataType.type == DataProcessors.Type.CONTAINER &&
|
||||
!it.key.params.flags.contains(ConfigFlag.HIDDEN)
|
||||
) {
|
||||
containers[it.key.name] = PropertyPair(it.key, it.value)
|
||||
queryContainerRecursive(it.value.get() as ConfigContainer)
|
||||
}
|
||||
@@ -155,10 +158,15 @@ class FeaturesRootSection : Routes.Route() {
|
||||
properties
|
||||
}
|
||||
|
||||
private fun isSearchVisibleProperty(propertyKey: PropertyKey<*>): Boolean {
|
||||
return !propertyKey.params.flags.contains(ConfigFlag.HIDDEN)
|
||||
}
|
||||
|
||||
private data class SearchEntry(val keyword: String, val tokens: List<String>)
|
||||
|
||||
private fun buildSearchEntries(): List<SearchEntry> {
|
||||
return allProperties.keys.mapNotNull { key ->
|
||||
if (!isSearchVisibleProperty(key)) return@mapNotNull null
|
||||
val name = context.translation[key.propertyName()]
|
||||
val description = context.translation[key.propertyDescription()]
|
||||
val tokens = listOfNotNull(name, description, key.name).map { it.trim() }.filter { it.isNotEmpty() }
|
||||
@@ -280,9 +288,11 @@ class FeaturesRootSection : Routes.Route() {
|
||||
composable(SEARCH_FEATURE_ROUTE) { backStackEntry ->
|
||||
backStackEntry.arguments?.getString("keyword")?.let { keyword ->
|
||||
val properties = allProperties.filter {
|
||||
it.key.name.contains(keyword, ignoreCase = true) ||
|
||||
isSearchVisibleProperty(it.key) && (
|
||||
it.key.name.contains(keyword, ignoreCase = true) ||
|
||||
context.translation[it.key.propertyName()].contains(keyword, ignoreCase = true) ||
|
||||
context.translation[it.key.propertyDescription()].contains(keyword, ignoreCase = true)
|
||||
)
|
||||
}.map { PropertyPair(it.key, it.value) }
|
||||
|
||||
PropertiesView(
|
||||
@@ -1573,7 +1583,7 @@ class FeaturesRootSection : Routes.Route() {
|
||||
val isActiveSearch = isSearchResults || liveSearchQuery.isNotBlank()
|
||||
val globalSearchProperties = remember(enableGlobalSearch) {
|
||||
if (enableGlobalSearch) {
|
||||
allProperties.map { PropertyPair(it.key, it.value) }
|
||||
allProperties.filter { isSearchVisibleProperty(it.key) }.map { PropertyPair(it.key, it.value) }
|
||||
} else {
|
||||
emptyList()
|
||||
}
|
||||
|
||||
@@ -639,6 +639,7 @@
|
||||
"scope_blacklist": "Everyone except",
|
||||
"events_section_title": "Events",
|
||||
"events_suffix": "events",
|
||||
"scopes_suffix": "scopes",
|
||||
"no_events_text": "No events added yet",
|
||||
"add_event_dialog_title": "Add Event",
|
||||
"event_type_label": "Event Type",
|
||||
@@ -2984,7 +2985,7 @@
|
||||
}
|
||||
},
|
||||
"profile_picture_downloader": {
|
||||
"button": "Download Profile Picture",
|
||||
"button": "⬇",
|
||||
"title": "Profile Picture Downloader",
|
||||
"avatar_option": "Avatar",
|
||||
"background_option": "Background"
|
||||
|
||||
@@ -99,4 +99,4 @@ class ProfilePictureDownloader : Feature("ProfilePictureDownloader") {
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user