Unverified Commit b1a22ac7 authored by Christopher Speller's avatar Christopher Speller Committed by GitHub
Browse files

Modifying about Mattermost dialog to show app version, db version, and build...

Modifying about Mattermost dialog to show app version, db version, and build number explicitly. (#973)
parent 2ff193e2
......@@ -135,9 +135,23 @@ export default class AboutBuildModal extends React.PureComponent {
}
}
let version = config.Version;
if (config.BuildNumber !== config.Version) {
version += ' (' + config.BuildNumber + ')';
// Only show build number if it's a number (so only builds from Jenkins)
let buildnumber = (
<div>
<FormattedMessage
id='about.buildnumber'
defaultMessage='Build Number:'
/>
<span id='buildnumberString'>{'\u00a0' + config.BuildNumber}</span>
</div>
);
if (isNaN(config.BuildNumber)) {
buildnumber = null;
}
let mmversion = config.BuildNumber;
if (!isNaN(config.BuildNumber)) {
mmversion = 'ci';
}
return (
......@@ -166,10 +180,18 @@ export default class AboutBuildModal extends React.PureComponent {
<div>
<FormattedMessage
id='about.version'
defaultMessage='Version:'
defaultMessage='Mattermost Version:'
/>
<span id='versionString'>{'\u00a0' + mmversion}</span>
</div>
<div>
<FormattedMessage
id='about.dbversion'
defaultMessage='Database Schema Version:'
/>
<span id='versionString'>{'\u00a0' + version}</span>
<span id='dbversionString'>{'\u00a0' + config.Version}</span>
</div>
{buildnumber}
<div>
<FormattedMessage
id='about.database'
......
......@@ -17,7 +17,9 @@
"about.teamEditiont0": "Team Edition",
"about.teamEditiont1": "Enterprise Edition",
"about.title": "About Mattermost",
"about.version": "Version:",
"about.version": "Mattermost Version:",
"about.dbversion": "Database Schema Version:",
"about.buildnumber": "Build Number:",
"access_history.title": "Access History",
"activity_log.activeSessions": "Active Sessions",
"activity_log.browser": "Browser: {browser}",
......@@ -1968,7 +1970,7 @@
"mfa.setupTitle": "Multi-factor Authentication Setup",
"mobile.about.appVersion": "App Version: {version} (Build {number})",
"mobile.about.copyright": "Copyright 2015-{currentYear} Mattermost, Inc. All rights reserved",
"mobile.about.database": "Database: {type}",
"mobile.about.database": "Database type: {type}",
"mobile.about.licensed": "Licensed to: {company}",
"mobile.about.powered_by": "{site} is powered by Mattermost",
"mobile.about.serverVersion": "Server Version: {version} (Build {number})",
......
// Jest Snapshot v1, https://goo.gl/fbAQLP
exports[`components/AboutBuildModal should hide the build number if it is the same as the version number 1`] = `
exports[`components/AboutBuildModal should match snapshot for enterprise edition 1`] = `
<Modal
animation={true}
autoFocus={true}
......@@ -62,8 +62,8 @@ exports[`components/AboutBuildModal should hide the build number if it is the sa
Mattermost
<FormattedMessage
defaultMessage="Team Edition"
id="about.teamEditiont0"
defaultMessage="Enterprise Edition"
id="about.enterpriseEditione1"
values={Object {}}
/>
</h3>
......@@ -71,8 +71,8 @@ exports[`components/AboutBuildModal should hide the build number if it is the sa
className="about-modal__subtitle padding-bottom"
>
<FormattedMessage
defaultMessage="All your team communication in one place, instantly searchable and accessible anywhere."
id="about.teamEditionSt"
defaultMessage="Modern communication from behind your firewall."
id="about.enterpriseEditionSt"
values={Object {}}
/>
</p>
......@@ -81,12 +81,24 @@ exports[`components/AboutBuildModal should hide the build number if it is the sa
>
<div>
<FormattedMessage
defaultMessage="Version:"
defaultMessage="Mattermost Version:"
id="about.version"
values={Object {}}
/>
<span
id="versionString"
>
 3.6.2
</span>
</div>
<div>
<FormattedMessage
defaultMessage="Database Schema Version:"
id="about.dbversion"
values={Object {}}
/>
<span
id="dbversionString"
>
 3.6.0
</span>
......@@ -100,6 +112,17 @@ exports[`components/AboutBuildModal should hide the build number if it is the sa
 Postgres
</div>
</div>
<div
className="form-group"
>
<FormattedMessage
defaultMessage="Licensed to:"
id="about.licensed"
values={Object {}}
/>
 
Mattermost Inc
</div>
</div>
</div>
<div
......@@ -107,16 +130,16 @@ exports[`components/AboutBuildModal should hide the build number if it is the sa
>
<div>
<FormattedMessage
defaultMessage="Join the Mattermost community at "
id="about.teamEditionLearn"
defaultMessage="Learn more about Enterprise Edition at "
id="about.enterpriseEditionLearn"
values={Object {}}
/>
<a
href="http://www.mattermost.org/"
href="http://about.mattermost.com/"
rel="noopener noreferrer"
target="_blank"
>
mattermost.org
about.mattermost.com
</a>
</div>
<div
......@@ -162,6 +185,7 @@ exports[`components/AboutBuildModal should hide the build number if it is the sa
values={Object {}}
/>
 
0123456789abcdef
<br />
<FormattedMessage
defaultMessage="Webapp Build Hash:"
......@@ -185,7 +209,7 @@ exports[`components/AboutBuildModal should hide the build number if it is the sa
</Modal>
`;
exports[`components/AboutBuildModal should match snapshot for enterprise edition 1`] = `
exports[`components/AboutBuildModal should match snapshot for team edition 1`] = `
<Modal
animation={true}
autoFocus={true}
......@@ -247,8 +271,8 @@ exports[`components/AboutBuildModal should match snapshot for enterprise edition
Mattermost
<FormattedMessage
defaultMessage="Enterprise Edition"
id="about.enterpriseEditione1"
defaultMessage="Team Edition"
id="about.teamEditiont0"
values={Object {}}
/>
</h3>
......@@ -256,8 +280,8 @@ exports[`components/AboutBuildModal should match snapshot for enterprise edition
className="about-modal__subtitle padding-bottom"
>
<FormattedMessage
defaultMessage="Modern communication from behind your firewall."
id="about.enterpriseEditionSt"
defaultMessage="All your team communication in one place, instantly searchable and accessible anywhere."
id="about.teamEditionSt"
values={Object {}}
/>
</p>
......@@ -266,14 +290,26 @@ exports[`components/AboutBuildModal should match snapshot for enterprise edition
>
<div>
<FormattedMessage
defaultMessage="Version:"
defaultMessage="Mattermost Version:"
id="about.version"
values={Object {}}
/>
<span
id="versionString"
>
 3.6.0 (3.6.2)
 3.6.2
</span>
</div>
<div>
<FormattedMessage
defaultMessage="Database Schema Version:"
id="about.dbversion"
values={Object {}}
/>
<span
id="dbversionString"
>
 3.6.0
</span>
</div>
<div>
......@@ -285,17 +321,6 @@ exports[`components/AboutBuildModal should match snapshot for enterprise edition
 Postgres
</div>
</div>
<div
className="form-group"
>
<FormattedMessage
defaultMessage="Licensed to:"
id="about.licensed"
values={Object {}}
/>
 
Mattermost Inc
</div>
</div>
</div>
<div
......@@ -303,16 +328,16 @@ exports[`components/AboutBuildModal should match snapshot for enterprise edition
>
<div>
<FormattedMessage
defaultMessage="Learn more about Enterprise Edition at "
id="about.enterpriseEditionLearn"
defaultMessage="Join the Mattermost community at "
id="about.teamEditionLearn"
values={Object {}}
/>
<a
href="http://about.mattermost.com/"
href="http://www.mattermost.org/"
rel="noopener noreferrer"
target="_blank"
>
about.mattermost.com
mattermost.org
</a>
</div>
<div
......@@ -358,7 +383,6 @@ exports[`components/AboutBuildModal should match snapshot for enterprise edition
values={Object {}}
/>
 
0123456789abcdef
<br />
<FormattedMessage
defaultMessage="Webapp Build Hash:"
......@@ -382,7 +406,7 @@ exports[`components/AboutBuildModal should match snapshot for enterprise edition
</Modal>
`;
exports[`components/AboutBuildModal should match snapshot for team edition 1`] = `
exports[`components/AboutBuildModal should show ci if a ci build 1`] = `
<Modal
animation={true}
autoFocus={true}
......@@ -463,14 +487,38 @@ exports[`components/AboutBuildModal should match snapshot for team edition 1`] =
>
<div>
<FormattedMessage
defaultMessage="Version:"
defaultMessage="Mattermost Version:"
id="about.version"
values={Object {}}
/>
<span
id="versionString"
>
 3.6.0 (3.6.2)
 ci
</span>
</div>
<div>
<FormattedMessage
defaultMessage="Database Schema Version:"
id="about.dbversion"
values={Object {}}
/>
<span
id="dbversionString"
>
 3.6.0
</span>
</div>
<div>
<FormattedMessage
defaultMessage="Build Number:"
id="about.buildnumber"
values={Object {}}
/>
<span
id="buildnumberString"
>
 123
</span>
</div>
<div>
......@@ -567,7 +615,7 @@ exports[`components/AboutBuildModal should match snapshot for team edition 1`] =
</Modal>
`;
exports[`components/AboutBuildModal should show the build number if it is the different from the version number 1`] = `
exports[`components/AboutBuildModal should show dev if this is a dev build 1`] = `
<Modal
animation={true}
autoFocus={true}
......@@ -648,14 +696,26 @@ exports[`components/AboutBuildModal should show the build number if it is the di
>
<div>
<FormattedMessage
defaultMessage="Version:"
defaultMessage="Mattermost Version:"
id="about.version"
values={Object {}}
/>
<span
id="versionString"
>
 3.6.0 (3.6.2)
 dev
</span>
</div>
<div>
<FormattedMessage
defaultMessage="Database Schema Version:"
id="about.dbversion"
values={Object {}}
/>
<span
id="dbversionString"
>
 3.6.0
</span>
</div>
<div>
......
......@@ -49,7 +49,8 @@ describe('components/AboutBuildModal', () => {
test('should match snapshot for enterprise edition', () => {
const wrapper = shallowAboutBuildModal({config, license});
expect(wrapper.find('#versionString').text()).toBe('\u00a03.6.0 (3.6.2)');
expect(wrapper.find('#versionString').text()).toBe('\u00a03.6.2');
expect(wrapper.find('#dbversionString').text()).toBe('\u00a03.6.0');
expect(wrapper).toMatchSnapshot();
});
......@@ -61,35 +62,40 @@ describe('components/AboutBuildModal', () => {
};
const wrapper = shallowAboutBuildModal({config: teamConfig, license: {}});
expect(wrapper.find('#versionString').text()).toBe('\u00a03.6.2');
expect(wrapper.find('#dbversionString').text()).toBe('\u00a03.6.0');
expect(wrapper).toMatchSnapshot();
});
test('should hide the build number if it is the same as the version number', () => {
test('should show dev if this is a dev build', () => {
const sameBuildConfig = {
...config,
BuildEnterpriseReady: 'false',
BuildHashEnterprise: '',
Version: '3.6.0',
BuildNumber: '3.6.0',
BuildNumber: 'dev',
};
const wrapper = shallowAboutBuildModal({config: sameBuildConfig, license: {}});
expect(wrapper).toMatchSnapshot();
expect(wrapper.find('#versionString').text()).toBe('\u00a03.6.0');
expect(wrapper.find('#versionString').text()).toBe('\u00a0dev');
expect(wrapper.find('#dbversionString').text()).toBe('\u00a03.6.0');
});
test('should show the build number if it is the different from the version number', () => {
test('should show ci if a ci build', () => {
const differentBuildConfig = {
...config,
BuildEnterpriseReady: 'false',
BuildHashEnterprise: '',
Version: '3.6.0',
BuildNumber: '3.6.2',
BuildNumber: '123',
};
const wrapper = shallowAboutBuildModal({config: differentBuildConfig, license: {}});
expect(wrapper).toMatchSnapshot();
expect(wrapper.find('#versionString').text()).toBe('\u00a03.6.0 (3.6.2)');
expect(wrapper.find('#versionString').text()).toBe('\u00a0ci');
expect(wrapper.find('#dbversionString').text()).toBe('\u00a03.6.0');
expect(wrapper.find('#buildnumberString').text()).toBe('\u00a0123');
});
test('should call onModalDismissed callback when the modal is hidden', (done) => {
......
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