templates/homepage: Fix counters display when storage is empty
This is a simple fix for the counters display in the webapp homepage.
When the storage is empty (for instance after booting the docker env), the
/api/1/stat/counters
endpoint returns an empty dict.
So handle that corner case to avoid a JavaScript error when homepage is loading.
Migrated from D2913 (view on Phabricator)
Merge request reports
Activity
Build is green See https://jenkins.softwareheritage.org/job/DWAPPS/job/tox/1041/ for more details.
Build is green See https://jenkins.softwareheritage.org/job/DWAPPS/job/cypress-diff/654/ for more details.
Build is green See https://jenkins.softwareheritage.org/job/DWAPPS/job/cypress-diff/657/ for more details.
Build has FAILED
Patch application report for D2913 (id=10380)
Rebasing onto d4446bca...
Current branch diff-target is up to date.
Changes applied before test
commit e0e2f4f7ea0ca54770b6fc0fa99bfb378c520c63 Author: Antoine Lambert <antoine.lambert@inria.fr> Date: Fri Mar 27 15:02:44 2020 +0100 templates/homepage: Fix counters display when storage is empty
Link to build: https://jenkins.softwareheritage.org/job/DWAPPS/job/tests-on-diff/11/ See console output for more information: https://jenkins.softwareheritage.org/job/DWAPPS/job/tests-on-diff/11/console
Build is green
Patch application report for D2913 (id=10380)
Rebasing onto d4446bca...
Current branch diff-target is up to date.
Changes applied before test
commit e0e2f4f7ea0ca54770b6fc0fa99bfb378c520c63 Author: Antoine Lambert <antoine.lambert@inria.fr> Date: Fri Mar 27 15:02:44 2020 +0100 templates/homepage: Fix counters display when storage is empty
See https://jenkins.softwareheritage.org/job/DWAPPS/job/tests-on-diff/12/ for more details.
Build is green
Patch application report for D2913 (id=10380)
Rebasing onto d4446bca...
Current branch diff-target is up to date.
Changes applied before test
commit e0e2f4f7ea0ca54770b6fc0fa99bfb378c520c63 Author: Antoine Lambert <antoine.lambert@inria.fr> Date: Fri Mar 27 15:02:44 2020 +0100 templates/homepage: Fix counters display when storage is empty
See https://jenkins.softwareheritage.org/job/DWAPPS/job/tests-on-diff/15/ for more details.
Build is green
Patch application report for D2913 (id=10407)
Rebasing onto 9aa7f44e...
Current branch diff-target is up to date.
Changes applied before test
commit f8ac17e10778b028aa794a4a4a1935e857d46406 Author: Antoine Lambert <antoine.lambert@inria.fr> Date: Fri Mar 27 15:02:44 2020 +0100 templates/homepage: Fix counters display when storage is empty
See https://jenkins.softwareheritage.org/job/DWAPPS/job/tests-on-diff/22/ for more details.