Skip to content

Commit

Permalink
Merge branch 'release-3.0'
Browse files Browse the repository at this point in the history
  • Loading branch information
crspeller committed May 12, 2016
2 parents aeed20d + 7802e7a commit 30de216
Show file tree
Hide file tree
Showing 16 changed files with 292 additions and 216 deletions.
2 changes: 1 addition & 1 deletion client/client.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -1203,7 +1203,7 @@ export default class Client {
end(this.handleResponse.bind(this, 'listTeamCommands', success, error));
}

regenCommandToken = (commandId, suggest, success, error) => {
regenCommandToken = (commandId, success, error) => {
request.
post(`${this.getCommandsRoute()}/regen_token`).
set(this.defaultHeaders).
Expand Down
27 changes: 14 additions & 13 deletions components/admin_console/audits.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -75,24 +75,25 @@ export default class Audits extends React.Component {
<div>
<ComplianceReports/>

<div className='panel'>
<div className='panel audit-panel'>
<h3>
<FormattedMessage
id='admin.audits.title'
defaultMessage='User Activity'
defaultMessage='User Activity Logs'
/>
<button
type='submit'
className='btn btn-link pull-right'
onClick={this.reload}
>
<i className='fa fa-refresh'></i>
<FormattedMessage
id='admin.audits.reload'
defaultMessage='Reload User Activity Logs'
/>
</button>
</h3>
<button
type='submit'
className='btn btn-primary'
onClick={this.reload}
>
<FormattedMessage
id='admin.audits.reload'
defaultMessage='Reload'
/>
</button>
<div className='audit__panel'>
<div className='audit-panel__table'>
{content}
</div>
</div>
Expand Down
197 changes: 98 additions & 99 deletions components/admin_console/compliance_reports.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -266,121 +266,120 @@ export default class ComplianceReports extends React.Component {
}

return (
<div className='panel'>
<div className='panel compliance-panel'>
<h3>
<FormattedMessage
id='admin.compliance_reports.title'
defaultMessage='Compliance Reports'
/>
</h3>

<table>
<tbody>
<tr>
<td
colSpan='5'
style={{paddingBottom: '6px'}}
>
<FormattedMessage
id='admin.compliance_reports.desc'
defaultMessage='Job Name:'
/>
<input
style={{width: '425px'}}
type='text'
className='form-control'
id='desc'
ref='desc'
placeholder={Utils.localizeMessage('admin.compliance_reports.desc_placeholder', 'Ex "Audit 445 for HR"')}
/>
</td>
</tr>
<tr>
<td>
<FormattedMessage
id='admin.compliance_reports.from'
defaultMessage='From:'
/>
<input
type='text'
className='form-control'
id='from'
ref='from'
placeholder={Utils.localizeMessage('admin.compliance_reports.from_placeholder', 'Ex "2016-03-11"')}
/>
</td>
<td style={{paddingLeft: '4px'}}>
<FormattedMessage
id='admin.compliance_reports.to'
defaultMessage='To:'
/>
<input
type='text'
className='form-control'
id='to'
ref='to'
placeholder={Utils.localizeMessage('admin.compliance_reports.to_placeholder', 'Ex "2016-03-15"')}
/>
</td>
<td style={{paddingLeft: '4px'}}>
<FormattedMessage
id='admin.compliance_reports.emails'
defaultMessage='Emails:'
/>
<input
style={{width: '325px'}}
type='text'
className='form-control'
id='emails'
ref='emails'
placeholder={Utils.localizeMessage('admin.compliance_reports.emails_placeholder', 'Ex "[email protected], [email protected]"')}
/>
</td>
<td style={{paddingLeft: '4px'}}>
<FormattedMessage
id='admin.compliance_reports.keywords'
defaultMessage='Keywords:'
/>
<input
style={{width: '250px'}}
type='text'
className='form-control'
id='keywords'
ref='keywords'
placeholder={Utils.localizeMessage('admin.compliance_reports.keywords_placeholder', 'Ex "shorting stock"')}
/>
</td>
<td>
<button
id='run-button'
type='submit'
className='btn btn-primary'
onClick={this.runReport}
style={{marginTop: '20px', marginLeft: '20px'}}
>
<FormattedMessage
id='admin.compliance_reports.run'
defaultMessage='Run'
/>
</button>
</td>
</tr>
</tbody>
</table>
{serverError}
<div style={{marginTop: '20px'}}>
<div className='row'>
<div className='col-sm-6 col-md-4 form-group'>
<label>
<FormattedMessage
id='admin.compliance_reports.desc'
defaultMessage='Job Name:'
/>
</label>
<input
type='text'
className='form-control'
id='desc'
ref='desc'
placeholder={Utils.localizeMessage('admin.compliance_reports.desc_placeholder', 'E.g. "Audit 445 for HR"')}
/>
</div>
<div className='col-sm-3 col-md-2 form-group'>
<label>
<FormattedMessage
id='admin.compliance_reports.from'
defaultMessage='From:'
/>
</label>
<input
type='text'
className='form-control'
id='from'
ref='from'
placeholder={Utils.localizeMessage('admin.compliance_reports.from_placeholder', 'E.g. "2016-03-11"')}
/>
</div>
<div className='col-sm-3 col-md-2 form-group'>
<label>
<FormattedMessage
id='admin.compliance_reports.to'
defaultMessage='To:'
/>
</label>
<input
type='text'
className='form-control'
id='to'
ref='to'
placeholder={Utils.localizeMessage('admin.compliance_reports.to_placeholder', 'E.g. "2016-03-15"')}
/>
</div>
</div>
<div className='row'>
<div className='col-sm-6 col-md-4 form-group'>
<label>
<FormattedMessage
id='admin.compliance_reports.emails'
defaultMessage='Emails:'
/>
</label>
<input
type='text'
className='form-control'
id='emails'
ref='emails'
placeholder={Utils.localizeMessage('admin.compliance_reports.emails_placeholder', 'E.g. "[email protected], [email protected]"')}
/>
</div>
<div className='col-sm-6 col-md-4 form-group'>
<label>
<FormattedMessage
id='admin.compliance_reports.keywords'
defaultMessage='Keywords:'
/>
</label>
<input
type='text'
className='form-control'
id='keywords'
ref='keywords'
placeholder={Utils.localizeMessage('admin.compliance_reports.keywords_placeholder', 'E.g. "shorting stock"')}
/>
</div>
</div>
<div className='clearfix'>
<button
id='run-button'
type='submit'
className='btn btn-primary'
onClick={this.runReport}
>
<FormattedMessage
id='admin.compliance_reports.run'
defaultMessage='Run Compliance Report'
/>
</button>
</div>
{serverError}
<div className='text-right'>
<button
type='submit'
className='btn btn-link'
onClick={this.reload}
>
<i className='fa fa-refresh'></i>
<FormattedMessage
id='admin.compliance_reports.reload'
defaultMessage='Reload'
defaultMessage='Reload Completed Compliance Reports'
/>
</button>
</div>
<div className='compliance__panel'>
<div className='compliance-panel__table'>
{content}
</div>
</div>
Expand Down
15 changes: 10 additions & 5 deletions components/backstage/installed_commands.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import React from 'react';

import * as AsyncClient from 'utils/async_client.jsx';
import IntegrationStore from 'stores/integration_store.jsx';
import TeamStore from 'stores/team_store.jsx';
import * as Utils from 'utils/utils.jsx';

import {FormattedMessage} from 'react-intl';
Expand All @@ -20,16 +21,18 @@ export default class InstalledCommands extends React.Component {
this.regenCommandToken = this.regenCommandToken.bind(this);
this.deleteCommand = this.deleteCommand.bind(this);

const teamId = TeamStore.getCurrentId();

this.state = {
commands: IntegrationStore.getCommands(),
loading: !IntegrationStore.hasReceivedCommands()
commands: IntegrationStore.getCommands(teamId),
loading: !IntegrationStore.hasReceivedCommands(teamId)
};
}

componentDidMount() {
IntegrationStore.addChangeListener(this.handleIntegrationChange);

if (window.mm_config.EnableCommands === 'true' && this.state.loading) {
if (window.mm_config.EnableCommands === 'true') {
AsyncClient.listTeamCommands();
}
}
Expand All @@ -39,9 +42,11 @@ export default class InstalledCommands extends React.Component {
}

handleIntegrationChange() {
const teamId = TeamStore.getCurrentId();

this.setState({
commands: IntegrationStore.getCommands(),
loading: !IntegrationStore.hasReceivedCommands()
commands: IntegrationStore.getCommands(teamId),
loading: !IntegrationStore.hasReceivedCommands(teamId)
});
}

Expand Down
15 changes: 10 additions & 5 deletions components/backstage/installed_incoming_webhooks.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import React from 'react';

import * as AsyncClient from 'utils/async_client.jsx';
import IntegrationStore from 'stores/integration_store.jsx';
import TeamStore from 'stores/team_store.jsx';
import * as Utils from 'utils/utils.jsx';

import {FormattedMessage} from 'react-intl';
Expand All @@ -19,16 +20,18 @@ export default class InstalledIncomingWebhooks extends React.Component {

this.deleteIncomingWebhook = this.deleteIncomingWebhook.bind(this);

const teamId = TeamStore.getCurrentId();

this.state = {
incomingWebhooks: IntegrationStore.getIncomingWebhooks(),
loading: !IntegrationStore.hasReceivedIncomingWebhooks()
incomingWebhooks: IntegrationStore.getIncomingWebhooks(teamId),
loading: !IntegrationStore.hasReceivedIncomingWebhooks(teamId)
};
}

componentDidMount() {
IntegrationStore.addChangeListener(this.handleIntegrationChange);

if (window.mm_config.EnableIncomingWebhooks === 'true' && this.state.loading) {
if (window.mm_config.EnableIncomingWebhooks === 'true') {
AsyncClient.listIncomingHooks();
}
}
Expand All @@ -38,9 +41,11 @@ export default class InstalledIncomingWebhooks extends React.Component {
}

handleIntegrationChange() {
const teamId = TeamStore.getCurrentId();

this.setState({
incomingWebhooks: IntegrationStore.getIncomingWebhooks(),
loading: !IntegrationStore.hasReceivedIncomingWebhooks()
incomingWebhooks: IntegrationStore.getIncomingWebhooks(teamId),
loading: !IntegrationStore.hasReceivedIncomingWebhooks(teamId)
});
}

Expand Down
15 changes: 10 additions & 5 deletions components/backstage/installed_outgoing_webhooks.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import React from 'react';

import * as AsyncClient from 'utils/async_client.jsx';
import IntegrationStore from 'stores/integration_store.jsx';
import TeamStore from 'stores/team_store.jsx';
import * as Utils from 'utils/utils.jsx';

import {FormattedMessage} from 'react-intl';
Expand All @@ -20,16 +21,18 @@ export default class InstalledOutgoingWebhooks extends React.Component {
this.regenOutgoingWebhookToken = this.regenOutgoingWebhookToken.bind(this);
this.deleteOutgoingWebhook = this.deleteOutgoingWebhook.bind(this);

const teamId = TeamStore.getCurrentId();

this.state = {
outgoingWebhooks: IntegrationStore.getOutgoingWebhooks(),
loading: !IntegrationStore.hasReceivedOutgoingWebhooks()
outgoingWebhooks: IntegrationStore.getOutgoingWebhooks(teamId),
loading: !IntegrationStore.hasReceivedOutgoingWebhooks(teamId)
};
}

componentDidMount() {
IntegrationStore.addChangeListener(this.handleIntegrationChange);

if (window.mm_config.EnableOutgoingWebhooks === 'true' && this.state.loading) {
if (window.mm_config.EnableOutgoingWebhooks === 'true') {
AsyncClient.listOutgoingHooks();
}
}
Expand All @@ -39,9 +42,11 @@ export default class InstalledOutgoingWebhooks extends React.Component {
}

handleIntegrationChange() {
const teamId = TeamStore.getCurrentId();

this.setState({
outgoingWebhooks: IntegrationStore.getOutgoingWebhooks(),
loading: !IntegrationStore.hasReceivedOutgoingWebhooks()
outgoingWebhooks: IntegrationStore.getOutgoingWebhooks(teamId),
loading: !IntegrationStore.hasReceivedOutgoingWebhooks(teamId)
});
}

Expand Down
Loading

0 comments on commit 30de216

Please sign in to comment.