[status-im#12603] Show short hash near build number in About page

Signed-off-by: andrey <motor4ik@gmail.com>
This commit is contained in:
Audrius Molis 2022-02-07 18:44:10 +02:00 committed by andrey
parent 8f52b9b63c
commit f0302e7cbf
No known key found for this signature in database
GPG Key ID: 89B67245FD2F0272
5 changed files with 21 additions and 7 deletions

View File

@ -610,19 +610,19 @@
(defn- node-version [web3-node-version]
(or web3-node-version "N/A"))
(def app-short-version
(let [version build/build-no]
(str build/version " (" version ")")))
(re-frame/reg-sub
:get-app-version
:<- [:web3-node-version]
(fn [web3-node-version]
(str app-short-version "; " (node-version web3-node-version))))
(str build/app-short-version "; " (node-version web3-node-version))))
(re-frame/reg-sub
:get-app-short-version
(fn [_] app-short-version))
(fn [_] build/app-short-version))
(re-frame/reg-sub
:get-commit-hash
(fn [_] build/commit-hash))
(re-frame/reg-sub
:get-app-node-version

View File

@ -12,6 +12,7 @@
(views/defview about-app []
(views/letsubs [app-version [:get-app-short-version]
commit-hash [:get-commit-hash]
node-version [:get-app-node-version]]
[react/scroll-view
[quo/list-item
@ -35,6 +36,14 @@
:title (i18n/label :t/version)
:accessory :text
:accessory-text app-version}]]
[copyable-text/copyable-text-view
{:copied-text commit-hash}
[quo/list-item
{:size :small
:accessibility-label :commit-hash
:title (i18n/label :t/app-commit)
:accessory :text
:accessory-text commit-hash}]]
[copyable-text/copyable-text-view
{:copied-text node-version}
[quo/list-item

View File

@ -29,7 +29,7 @@
(defmacro get-current-sha
"fetches the latest commit sha from the current branch"
[]
(-> (shell/sh "git" "rev-parse" "--short" "HEAD")
(-> (shell/sh "git" "rev-parse" "HEAD")
:out
(string/replace "\n" "")))

View File

@ -1,5 +1,9 @@
(ns status-im.utils.build
(:require-macros [status-im.utils.build :as build]))
(def commit-hash (build/get-current-sha))
(def version (build/git-short-version))
(def build-no (build/get-build-no))
(def app-short-version
(str version " (" build-no ")"))

View File

@ -1304,6 +1304,7 @@
"validation-amount-invalid-number": "Amount is not a valid number",
"validation-amount-is-too-precise": "Amount is too precise. Max number of decimals is {{decimals}}.",
"version": "App version",
"app-commit": "App commit",
"view": "View",
"view-cryptokitties": "View in CryptoKitties",
"view-cryptostrikers": "View in CryptoStrikers",