mirror of
https://github.com/mattermost/mattermost.git
synced 2025-02-25 18:55:24 -06:00
This migrates the existing webapp tests to using Jest and Enzyme. The infrastructure is put in place for React component testing, and a few simple example component tests are implemented. This also adds snapshot testing of components, coverage checking for the webapp (although that is not yet integrated to Coveralls), and the ability to run npm run test:watch to automatically re-run affected tests when working on the webapp codebase.
201 lines
7.0 KiB
JavaScript
201 lines
7.0 KiB
JavaScript
// Copyright (c) 2015 Mattermost, Inc. All Rights Reserved.
|
|
// See License.txt for license information.
|
|
|
|
import {Modal} from 'react-bootstrap';
|
|
|
|
import {FormattedMessage} from 'react-intl';
|
|
|
|
import React from 'react';
|
|
import Constants from 'utils/constants.jsx';
|
|
|
|
export default class AboutBuildModal extends React.Component {
|
|
constructor(props) {
|
|
super(props);
|
|
this.doHide = this.doHide.bind(this);
|
|
}
|
|
|
|
doHide() {
|
|
this.props.onModalDismissed();
|
|
}
|
|
|
|
render() {
|
|
const config = global.window.mm_config;
|
|
const license = global.window.mm_license;
|
|
const mattermostLogo = Constants.MATTERMOST_ICON_SVG;
|
|
|
|
let title = (
|
|
<FormattedMessage
|
|
id='about.teamEditiont0'
|
|
defaultMessage='Team Edition'
|
|
/>
|
|
);
|
|
|
|
let subTitle = (
|
|
<FormattedMessage
|
|
id='about.teamEditionSt'
|
|
defaultMessage='All your team communication in one place, instantly searchable and accessible anywhere.'
|
|
/>
|
|
);
|
|
|
|
let learnMore = (
|
|
<div>
|
|
<FormattedMessage
|
|
id='about.teamEditionLearn'
|
|
defaultMessage='Join the Mattermost community at '
|
|
/>
|
|
<a
|
|
target='_blank'
|
|
rel='noopener noreferrer'
|
|
href='http://www.mattermost.org/'
|
|
>
|
|
{'mattermost.org'}
|
|
</a>
|
|
</div>
|
|
);
|
|
|
|
let licensee;
|
|
if (config.BuildEnterpriseReady === 'true') {
|
|
title = (
|
|
<FormattedMessage
|
|
id='about.teamEditiont1'
|
|
defaultMessage='Enterprise Edition'
|
|
/>
|
|
);
|
|
|
|
subTitle = (
|
|
<FormattedMessage
|
|
id='about.enterpriseEditionSt'
|
|
defaultMessage='Modern communication from behind your firewall.'
|
|
/>
|
|
);
|
|
|
|
learnMore = (
|
|
<div>
|
|
<FormattedMessage
|
|
id='about.enterpriseEditionLearn'
|
|
defaultMessage='Learn more about Enterprise Edition at '
|
|
/>
|
|
<a
|
|
target='_blank'
|
|
rel='noopener noreferrer'
|
|
href='http://about.mattermost.com/'
|
|
>
|
|
{'about.mattermost.com'}
|
|
</a>
|
|
</div>
|
|
);
|
|
|
|
if (license.IsLicensed === 'true') {
|
|
title = (
|
|
<FormattedMessage
|
|
id='about.enterpriseEditione1'
|
|
defaultMessage='Enterprise Edition'
|
|
/>
|
|
);
|
|
licensee = (
|
|
<div className='form-group'>
|
|
<FormattedMessage
|
|
id='about.licensed'
|
|
defaultMessage='Licensed to:'
|
|
/>
|
|
{license.Company}
|
|
</div>
|
|
);
|
|
}
|
|
}
|
|
|
|
let version = '\u00a0' + config.Version;
|
|
if (config.BuildNumber !== config.Version) {
|
|
version += '\u00a0 (' + config.BuildNumber + ')';
|
|
}
|
|
|
|
return (
|
|
<Modal
|
|
dialogClassName='about-modal'
|
|
show={this.props.show}
|
|
onHide={this.doHide}
|
|
>
|
|
<Modal.Header closeButton={true}>
|
|
<Modal.Title>
|
|
<FormattedMessage
|
|
id='about.title'
|
|
defaultMessage='About Mattermost'
|
|
/>
|
|
</Modal.Title>
|
|
</Modal.Header>
|
|
<Modal.Body>
|
|
<div className='about-modal__content'>
|
|
<div className='about-modal__logo'>
|
|
<span
|
|
className='icon'
|
|
dangerouslySetInnerHTML={{__html: mattermostLogo}}
|
|
/>
|
|
</div>
|
|
<div>
|
|
<h3 className='about-modal__title'>{'Mattermost'} {title}</h3>
|
|
<p className='about-modal__subtitle padding-bottom'>{subTitle}</p>
|
|
<div className='form-group less'>
|
|
<div>
|
|
<FormattedMessage
|
|
id='about.version'
|
|
defaultMessage='Version:'
|
|
/>
|
|
<span id='versionString'>{version}</span>
|
|
</div>
|
|
<div>
|
|
<FormattedMessage
|
|
id='about.database'
|
|
defaultMessage='Database:'
|
|
/>
|
|
{'\u00a0' + config.SQLDriverName}
|
|
</div>
|
|
</div>
|
|
{licensee}
|
|
</div>
|
|
</div>
|
|
<div className='about-modal__footer'>
|
|
{learnMore}
|
|
<div className='form-group about-modal__copyright'>
|
|
<FormattedMessage
|
|
id='about.copyright'
|
|
defaultMessage='Copyright 2016 Mattermost, Inc. All rights reserved'
|
|
/>
|
|
</div>
|
|
</div>
|
|
<div className='about-modal__hash form-group padding-top x2'>
|
|
<p>
|
|
<FormattedMessage
|
|
id='about.hash'
|
|
defaultMessage='Build Hash:'
|
|
/>
|
|
{config.BuildHash}
|
|
<br/>
|
|
<FormattedMessage
|
|
id='about.hashee'
|
|
defaultMessage='EE Build Hash:'
|
|
/>
|
|
{config.BuildHashEnterprise}
|
|
</p>
|
|
<p>
|
|
<FormattedMessage
|
|
id='about.date'
|
|
defaultMessage='Build Date:'
|
|
/>
|
|
{config.BuildDate}
|
|
</p>
|
|
</div>
|
|
</Modal.Body>
|
|
</Modal>
|
|
);
|
|
}
|
|
}
|
|
|
|
AboutBuildModal.defaultProps = {
|
|
show: false
|
|
};
|
|
|
|
AboutBuildModal.propTypes = {
|
|
show: React.PropTypes.bool.isRequired,
|
|
onModalDismissed: React.PropTypes.func.isRequired
|
|
};
|