From 6f108370ceec5f013ca287830db752ff1829ea2b Mon Sep 17 00:00:00 2001 From: "Juan Picado @jotadeveloper" Date: Sat, 13 Apr 2019 23:27:44 +0200 Subject: [PATCH] fix: takes the app version from verdaccio --- src/webui/components/Footer/index.js | 3 +-- src/webui/template/index.html | 1 + test/unit/webui/components/__snapshots__/footer.spec.js.snap | 2 +- test/unit/webui/components/footer.spec.js | 4 +++- tools/webpack.prod.config.babel.js | 1 + 5 files changed, 7 insertions(+), 4 deletions(-) diff --git a/src/webui/components/Footer/index.js b/src/webui/components/Footer/index.js index b8ad369..24bc4b3 100644 --- a/src/webui/components/Footer/index.js +++ b/src/webui/components/Footer/index.js @@ -6,7 +6,6 @@ import React from 'react'; import type { Element } from 'react'; -import { version } from '../../../../package.json'; import { Wrapper, Left, Right, Earth, Flags, Love, Flag, Logo, Inner, ToolTip } from './styles'; import { goToVerdaccioWebsite } from '../../utils/windows.js'; @@ -28,7 +27,7 @@ const MADEWITH_LABEL = ' Made with'; const ON_LABEL = 'on'; const HEARTH_EMOJI = '♥'; -const renderRight = () => ( +const renderRight = (version = window.VERDACCIO_VERSION) => ( {POWERED_LABEL} diff --git a/src/webui/template/index.html b/src/webui/template/index.html index 4f3a5af..7c6b22d 100644 --- a/src/webui/template/index.html +++ b/src/webui/template/index.html @@ -12,6 +12,7 @@ window.VERDACCIO_API_URL = '<%= htmlWebpackPlugin.options.verdaccioURL %>/-/verdaccio/'; window.VERDACCIO_SCOPE = '<%= htmlWebpackPlugin.options.scope %>'; window.VERDACCIO_LOGO = '<%= htmlWebpackPlugin.options.logo %>'; + window.VERDACCIO_VERSION = '<%= htmlWebpackPlugin.options.version_app %>'; diff --git a/test/unit/webui/components/__snapshots__/footer.spec.js.snap b/test/unit/webui/components/__snapshots__/footer.spec.js.snap index 6fd3401..16341e3 100644 --- a/test/unit/webui/components/__snapshots__/footer.spec.js.snap +++ b/test/unit/webui/components/__snapshots__/footer.spec.js.snap @@ -1,3 +1,3 @@ // Jest Snapshot v1, https://goo.gl/fbAQLP -exports[`