Skip to content

Commit

Permalink
Run spotlessApply
Browse files Browse the repository at this point in the history
Signed-off-by: Elly Kitoto <junkmailstoelly@gmail.com>
  • Loading branch information
ellykits committed Sep 17, 2024
1 parent b3f838a commit 77d1662
Show file tree
Hide file tree
Showing 51 changed files with 408 additions and 294 deletions.
4 changes: 1 addition & 3 deletions android/engine/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -176,9 +176,7 @@ dependencies {
api(libs.timber)
api(libs.converter.gson)
api(libs.json.path)
api(libs.easy.rules.jexl) {
exclude(group = "commons-logging", module = "commons-logging")
}
api(libs.easy.rules.jexl) { exclude(group = "commons-logging", module = "commons-logging") }
api(libs.data.capture) {
isTransitive = true
exclude(group = "ca.uhn.hapi.fhir")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,15 @@ import com.google.android.fhir.get
import com.google.android.fhir.knowledge.KnowledgeManager
import com.google.android.fhir.sync.download.ResourceSearchParams
import dagger.hilt.android.qualifiers.ApplicationContext
import java.io.File
import java.io.FileNotFoundException
import java.io.InputStreamReader
import java.net.UnknownHostException
import java.util.Locale
import java.util.PropertyResourceBundle
import java.util.ResourceBundle
import javax.inject.Inject
import javax.inject.Singleton
import kotlinx.coroutines.withContext
import kotlinx.serialization.json.Json
import okhttp3.RequestBody.Companion.toRequestBody
Expand Down Expand Up @@ -71,15 +80,6 @@ import org.smartregister.fhircore.engine.util.extension.updateLastUpdated
import org.smartregister.fhircore.engine.util.helper.LocalizationHelper
import retrofit2.HttpException
import timber.log.Timber
import java.io.File
import java.io.FileNotFoundException
import java.io.InputStreamReader
import java.net.UnknownHostException
import java.util.Locale
import java.util.PropertyResourceBundle
import java.util.ResourceBundle
import javax.inject.Inject
import javax.inject.Singleton

@Singleton
class ConfigurationRegistry
Expand Down Expand Up @@ -378,14 +378,18 @@ constructor(
context.assets.list(String.format(BASE_CONFIG_PATH, appId))?.onEach {
if (!supportedFileExtensions.contains(it.fileExtension)) {
filesQueue.addLast(String.format(BASE_CONFIG_PATH, appId) + "/$it")
} else configFiles.add(String.format(BASE_CONFIG_PATH, appId) + "/$it")
} else {
configFiles.add(String.format(BASE_CONFIG_PATH, appId) + "/$it")
}
}
while (filesQueue.isNotEmpty()) {
val currentPath = filesQueue.removeFirst()
context.assets.list(currentPath)?.onEach {
if (!supportedFileExtensions.contains(it.fileExtension)) {
filesQueue.addLast("$currentPath/$it")
} else configFiles.add("$currentPath/$it")
} else {
configFiles.add("$currentPath/$it")
}
}
}
return configFiles
Expand Down Expand Up @@ -507,13 +511,14 @@ constructor(
val resultBundle =
if (isNonProxy()) {
fhirResourceDataSourceGetBundle(resourceType, resourceIdList)
} else
} else {
fhirResourceDataSource.post(
requestBody =
generateRequestBundle(resourceType, resourceIdList)
.encodeResourceToString()
.toRequestBody(NetworkModule.JSON_MEDIA_TYPE),
)
}

processResultBundleEntries(resultBundle.entry)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@ import kotlinx.serialization.Serializable
import org.smartregister.fhircore.engine.domain.model.ActionConfig
import org.smartregister.fhircore.engine.util.extension.interpolate


const val ICON_TYPE_LOCAL = "local"
const val ICON_TYPE_REMOTE = "remote"

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ data class RegisterConfiguration(
val filterDataByRelatedEntityLocation: Boolean = false,
val topScreenSection: TopScreenSectionConfig? = null,
val onSearchByQrSingleResultActions: List<ActionConfig>? = null,
val infiniteScroll: Boolean = true
val infiniteScroll: Boolean = true,
) : Configuration() {
val onSearchByQrSingleResultValidActions =
onSearchByQrSingleResultActions?.filter { it.trigger == ActionTrigger.ON_SEARCH_SINGLE_RESULT }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,9 @@ data class ButtonProperties(
val interpolated = this.status.interpolate(computedValuesMap)
return if (ServiceStatus.values().map { it.name }.contains(interpolated)) {
ServiceStatus.valueOf(interpolated)
} else ServiceStatus.UPCOMING
} else {
ServiceStatus.UPCOMING
}
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -56,8 +56,7 @@ fun List<ViewProperties>.retrieveListProperties(): List<ListProperties> {
ViewType.COLUMN -> viewPropertiesQueue.addAll((properties as ColumnProperties).children)
ViewType.ROW -> viewPropertiesQueue.addAll((properties as RowProperties).children)
ViewType.CARD -> viewPropertiesQueue.addAll((properties as CardViewProperties).content)
ViewType.LIST ->
viewPropertiesQueue.addAll((properties as ListProperties).registerCard.views)
ViewType.LIST -> viewPropertiesQueue.addAll((properties as ListProperties).registerCard.views)
else -> {}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,9 @@ object ViewPropertiesSerializer :
): DeserializationStrategy<ViewProperties> {
val jsonObject = element.jsonObject
val viewType = jsonObject[VIEW_TYPE]?.jsonPrimitive?.content
require(viewType != null && ViewType.entries.toTypedArray().contains(ViewType.valueOf(viewType))) {
require(
viewType != null && ViewType.entries.toTypedArray().contains(ViewType.valueOf(viewType)),
) {
"""Ensure that supported `viewType` property is included in your register view properties configuration.
Supported types: ${ViewType.entries.toTypedArray()}
Parsed JSON: $jsonObject
Expand Down
Loading

0 comments on commit 77d1662

Please sign in to comment.