diff --git a/playlet-lib/src/components/Screens/AppInfoScreen/AppInfoScreen.bs b/playlet-lib/src/components/Screens/AppInfoScreen/AppInfoScreen.bs index 6744d318..ad37aa0d 100644 --- a/playlet-lib/src/components/Screens/AppInfoScreen/AppInfoScreen.bs +++ b/playlet-lib/src/components/Screens/AppInfoScreen/AppInfoScreen.bs @@ -1,17 +1,32 @@ import "pkg:/source/asyncTask/asyncTask.bs" function Init() - ' TODO:P2 rename Add tooltip to each field with description of what it means - m.displayNames = { - "app_version": "Playlet App Version", - "lib_version": "Playlet Library Version", - "lib_version_latest": "Playlet Library Latest Version", - "lib_url": "Playlet Library URL", - "lib_url_type": "Playlet Library URL Type", - "git_commit_hash": "Playlet Git Commit Hash", - "lib_git_commit_hash": "Playlet Library Git Commit Hash", - "id": "App ID" - } + ' TODO:P2 Add tooltip to each field with description of what it means + m.displayNames = [{ + key: "app_version", + displayText: "Playlet App Version" + }, { + key: "lib_version", + displayText: "Playlet Library Version" + }, { + key: "lib_version_latest", + displayText: "Playlet Library Latest Version" + }, { + key: "lib_url", + displayText: "Playlet Library URL" + }, { + key: "lib_url_type", + displayText: "Playlet Library URL Type" + }, { + key: "app_git_commit_hash", + displayText: "Playlet App Git Commit Hash" + }, { + key: "lib_git_commit_hash", + displayText: "Playlet Library Git Commit Hash" + }, { + key: "id", + displayText: "App ID" + }] m.keyValueList = m.top.findNode("KeyValueListContent") end function @@ -36,8 +51,8 @@ function UpdateKeyValueList() m.keyValueList.removeChildIndex(0) end while - for each item in m.appInfo - value = `${m.displayNames[item]}: ${m.appInfo[item]}` + for each item in m.displayNames + value = `${item.displayText}: ${m.appInfo[item.key]}` contentNode = m.keyValueList.createChild("ContentNode") contentNode.title = value end for diff --git a/playlet-lib/src/source/services/ApplicationInfo.bs b/playlet-lib/src/source/services/ApplicationInfo.bs index deec6827..3a49a07c 100644 --- a/playlet-lib/src/source/services/ApplicationInfo.bs +++ b/playlet-lib/src/source/services/ApplicationInfo.bs @@ -34,7 +34,7 @@ class ApplicationInfo m.appInfo = { id: m.roAppInfo.GetID(), app_version: m.roAppInfo.GetVersion(), - git_commit_hash: m.roAppInfo.GetValue("git_commit_sha"), + app_git_commit_hash: m.roAppInfo.GetValue("git_commit_sha"), lib_version: m.GetLibVersion(), lib_git_commit_hash: m.GetLibGitCommitHash() } diff --git a/playlet-web/src/lib/Screens/InfoScreen.svelte b/playlet-web/src/lib/Screens/InfoScreen.svelte index 9e709583..cb54d8fd 100644 --- a/playlet-web/src/lib/Screens/InfoScreen.svelte +++ b/playlet-web/src/lib/Screens/InfoScreen.svelte @@ -3,16 +3,40 @@ export let visibility: boolean; - const displayNames = { - app_version: "Playlet App Version", - lib_version: "Playlet Library Version", - lib_version_latest: "Playlet Library Latest Version", - lib_url: "Playlet Library URL", - lib_url_type: "Playlet Library URL Type", - git_commit_hash: "Playlet Git Commit Hash", - lib_git_commit_hash: "Playlet Library Git Commit Hash", - id: "App ID", - }; + const displayNames = [ + { + key: "app_version", + displayText: "Playlet App Version", + }, + { + key: "lib_version", + displayText: "Playlet Library Version", + }, + { + key: "lib_version_latest", + displayText: "Playlet Library Latest Version", + }, + { + key: "lib_url", + displayText: "Playlet Library URL", + }, + { + key: "lib_url_type", + displayText: "Playlet Library URL Type", + }, + { + key: "app_git_commit_hash", + displayText: "Playlet App Git Commit Hash", + }, + { + key: "lib_git_commit_hash", + displayText: "Playlet Library Git Commit Hash", + }, + { + key: "id", + displayText: "App ID", + }, + ]; function transformValue(key, value) { switch (key) { @@ -110,10 +134,10 @@ ${JSON.stringify(preferencesInfo, null, 2)}
- {#each Object.entries(displayNames) as [key, value]} + {#each displayNames as item}