From ea12b02b93de446998ff843384044bd8d06c792d Mon Sep 17 00:00:00 2001
From: Martin Felber <45291671+FelberMartin@users.noreply.github.com>
Date: Tue, 19 Nov 2024 22:16:56 +0100
Subject: [PATCH] `Chore`: Display server url in settings (#122)
---
.../artemis/native_app/feature/settings/SettingsScreen.kt | 8 ++++++++
feature/settings/src/main/res/values/settings_strings.xml | 1 +
2 files changed, 9 insertions(+)
diff --git a/feature/settings/src/main/kotlin/de/tum/informatics/www1/artemis/native_app/feature/settings/SettingsScreen.kt b/feature/settings/src/main/kotlin/de/tum/informatics/www1/artemis/native_app/feature/settings/SettingsScreen.kt
index e17afc751..dfba46ced 100644
--- a/feature/settings/src/main/kotlin/de/tum/informatics/www1/artemis/native_app/feature/settings/SettingsScreen.kt
+++ b/feature/settings/src/main/kotlin/de/tum/informatics/www1/artemis/native_app/feature/settings/SettingsScreen.kt
@@ -207,6 +207,7 @@ private fun SettingsScreen(
AboutSection(
modifier = Modifier.fillMaxWidth(),
hasUserSelectedInstance = hasUserSelectedInstance,
+ serverUrl = serverUrl,
onOpenPrivacyPolicy = {
val link = URLBuilder(serverUrl).appendPathSegments("privacy").buildString()
@@ -334,6 +335,7 @@ private fun NotificationSection(modifier: Modifier, onOpenNotificationSettings:
private fun AboutSection(
modifier: Modifier,
hasUserSelectedInstance: Boolean,
+ serverUrl: String,
onRequestSelectServerInstance: () -> Unit,
onOpenPrivacyPolicy: () -> Unit,
onOpenImprint: () -> Unit,
@@ -352,6 +354,12 @@ private fun AboutSection(
}
if (hasUserSelectedInstance) {
+ PreferenceEntry(
+ modifier = Modifier.fillMaxWidth(),
+ text = stringResource(R.string.settings_server_url, serverUrl),
+ onClick = {}
+ )
+
PreferenceEntry(
modifier = Modifier.fillMaxWidth(),
text = stringResource(id = R.string.settings_about_privacy_policy),
diff --git a/feature/settings/src/main/res/values/settings_strings.xml b/feature/settings/src/main/res/values/settings_strings.xml
index 3954c4b7c..ec4a71b13 100644
--- a/feature/settings/src/main/res/values/settings_strings.xml
+++ b/feature/settings/src/main/res/values/settings_strings.xml
@@ -12,6 +12,7 @@
About
Imprint and privacy policy depend on the server you have currently selected.
+ Server URL: %1$s
Imprint and privacy policy are unavailable as you have not yet selected a server instance. Please select a server instance to view their privacy policy and imprint.
Select instance
Privacy policy