added ver to qsurvey url

This commit is contained in:
Danny Coates 2017-12-05 12:45:36 -08:00
parent 28a7e0f717
commit 1849d712b1
No known key found for this signature in database
GPG key ID: 4C442633C62E00CB
3 changed files with 37 additions and 8 deletions

View file

@ -1,5 +1,16 @@
const html = require('choo/html');
const assets = require('../../common/assets');
/*
The current weback config uses package.json to generate
version.json for /__version__ meaning `require` returns the
string 'version.json' in the frontend context but the json
on the server.
We want `version` to be constant at build time so this file
has a custom loader (/build/version_loader.js) just to replace
string with the value from package.json. 🤢
*/
const version = require('../../package.json').version || 'VERSION';
module.exports = function(state) {
return html`<header class="header">
@ -14,8 +25,9 @@ module.exports = function(state) {
<div>${state.translate('siteSubtitle')}</div>
</div>
</div>
<a href="https://qsurvey.mozilla.com/s3/txp-firefox-send" rel="noreferrer noopener" class="feedback" target="_blank">${state.translate(
'siteFeedback'
)}</a>
<a href="https://qsurvey.mozilla.com/s3/txp-firefox-send?ver=${version}"
rel="noreferrer noopener"
class="feedback"
target="_blank">${state.translate('siteFeedback')}</a>
</header>`;
};