Unverified Commit cbecb339 authored by Chris's avatar Chris Committed by GitHub
Browse files

ABC-193: Add webapp commit hash to "about" modal (#751)

* add webapp commit hash to "about" modal

* update snapshots
parent 423c40dd
......@@ -33,7 +33,12 @@ export default class AboutBuildModal extends React.PureComponent {
/**
* Global license object
*/
license: PropTypes.object.isRequired
license: PropTypes.object.isRequired,
/**
* Webapp build hash override. By default, webpack sets this (so it must be overridden in tests).
*/
webappBuildHash: PropTypes.string
};
constructor(props) {
......@@ -209,6 +214,12 @@ export default class AboutBuildModal extends React.PureComponent {
defaultMessage='EE Build Hash:'
/>
 {config.BuildHashEnterprise}
<br/>
<FormattedMessage
id='about.hashwebapp'
defaultMessage='Webapp Build Hash:'
/>
&nbsp;{/* global COMMIT_HASH */ this.props.webappBuildHash || (typeof COMMIT_HASH === 'undefined' ? '' : COMMIT_HASH)}
</p>
<p>
<FormattedMessage
......
......@@ -8,6 +8,7 @@
"about.enterpriseEditione1": "Enterprise Edition",
"about.hash": "Build Hash:",
"about.hashee": "EE Build Hash:",
"about.hashwebapp": "Webapp Build Hash:",
"about.licensed": "Licensed to:",
"about.notice": "Mattermost is made possible by the open source software used in our <a href=\"https://about.mattermost.com/platform-notice-txt/\" target='_blank'>platform</a>, <a href=\"https://about.mattermost.com/desktop-notice-txt/\" target='_blank'>desktop</a> and <a href=\"https://about.mattermost.com/mobile-notice-txt/\" target='_blank'>mobile</a> apps.",
"about.number": "Build Number:",
......
......@@ -162,6 +162,14 @@ exports[`components/AboutBuildModal should hide the build number if it is the sa
values={Object {}}
/>
 
<br />
<FormattedMessage
defaultMessage="Webapp Build Hash:"
id="about.hashwebapp"
values={Object {}}
/>
 
0a1b2c3d4f
</p>
<p>
<FormattedMessage
......@@ -351,6 +359,14 @@ exports[`components/AboutBuildModal should match snapshot for enterprise edition
/>
 
0123456789abcdef
<br />
<FormattedMessage
defaultMessage="Webapp Build Hash:"
id="about.hashwebapp"
values={Object {}}
/>
 
0a1b2c3d4f
</p>
<p>
<FormattedMessage
......@@ -528,6 +544,14 @@ exports[`components/AboutBuildModal should match snapshot for team edition 1`] =
values={Object {}}
/>
 
<br />
<FormattedMessage
defaultMessage="Webapp Build Hash:"
id="about.hashwebapp"
values={Object {}}
/>
 
0a1b2c3d4f
</p>
<p>
<FormattedMessage
......@@ -705,6 +729,14 @@ exports[`components/AboutBuildModal should show the build number if it is the di
values={Object {}}
/>
 
<br />
<FormattedMessage
defaultMessage="Webapp Build Hash:"
id="about.hashwebapp"
values={Object {}}
/>
 
0a1b2c3d4f
</p>
<p>
<FormattedMessage
......
......@@ -101,6 +101,7 @@ describe('components/AboutBuildModal', () => {
<AboutBuildModal
config={config}
license={license}
webappBuildHash='0a1b2c3d4f'
show={true}
onModalDismissed={onHide}
/>
......@@ -116,6 +117,7 @@ describe('components/AboutBuildModal', () => {
const allProps = {
show,
onModalDismissed,
webappBuildHash: '0a1b2c3d4f',
...props
};
......
const childProcess = require('child_process');
const path = require('path');
const CopyWebpackPlugin = require('copy-webpack-plugin');
......@@ -253,6 +254,9 @@ var config = {
minChunks: 2,
children: true
}),
new webpack.DefinePlugin({
COMMIT_HASH: JSON.stringify(childProcess.execSync('git rev-parse HEAD').toString())
}),
extractCSS,
extractSCSS
]
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment