|
@@ -1,13 +1,16 @@
|
|
|
import PropTypes from 'prop-types';
|
|
|
import React from 'react';
|
|
|
|
|
|
+import {t} from '../locale';
|
|
|
import ApiMixin from '../mixins/apiMixin';
|
|
|
+import Button from '../components/buttons/button';
|
|
|
+import Confirm from '../components/confirm';
|
|
|
import Duration from '../components/duration';
|
|
|
import IndicatorStore from '../stores/indicatorStore';
|
|
|
import ListLink from '../components/listLink';
|
|
|
import LoadingError from '../components/loadingError';
|
|
|
import LoadingIndicator from '../components/loadingIndicator';
|
|
|
-import {t} from '../locale';
|
|
|
+import SpreadLayout from '../components/spreadLayout';
|
|
|
|
|
|
const RuleRow = React.createClass({
|
|
|
propTypes: {
|
|
@@ -27,8 +30,6 @@ const RuleRow = React.createClass({
|
|
|
},
|
|
|
|
|
|
onDelete() {
|
|
|
- /* eslint no-alert:0*/
|
|
|
- if (!confirm('Are you sure you want to remove this rule?')) return;
|
|
|
if (this.state.loading) return;
|
|
|
|
|
|
let loadingIndicator = IndicatorStore.add(t('Saving changes..'));
|
|
@@ -57,10 +58,17 @@ const RuleRow = React.createClass({
|
|
|
<div className="box">
|
|
|
<div className="box-header">
|
|
|
<div className="pull-right">
|
|
|
- <a className="btn btn-sm btn-default" href={editLink}>{t('Edit Rule')}</a>
|
|
|
- <a className="btn btn-sm btn-default" onClick={this.onDelete}>
|
|
|
- <span className="icon-trash" style={{marginRight: 3}} />
|
|
|
- </a>
|
|
|
+ <Button style={{marginRight: 5}} size="small" href={editLink}>
|
|
|
+ {t('Edit Rule')}
|
|
|
+ </Button>
|
|
|
+
|
|
|
+ <Confirm
|
|
|
+ message={t('Are you sure you want to remove this rule?')}
|
|
|
+ onConfirm={this.onDelete}>
|
|
|
+ <Button size="small">
|
|
|
+ <span className="icon-trash" />
|
|
|
+ </Button>
|
|
|
+ </Confirm>
|
|
|
</div>
|
|
|
<h3><a href={editLink}>{data.name}</a></h3>
|
|
|
</div>
|
|
@@ -202,13 +210,17 @@ const ProjectAlertRules = React.createClass({
|
|
|
let {orgId, projectId} = this.props.params;
|
|
|
return (
|
|
|
<div>
|
|
|
- <a
|
|
|
- href={`/${orgId}/${projectId}/settings/alerts/rules/new/`}
|
|
|
- className="btn pull-right btn-primary btn-sm">
|
|
|
- <span className="icon-plus" />
|
|
|
- {t('New Alert Rule')}
|
|
|
- </a>
|
|
|
- <h2>{t('Alerts')}</h2>
|
|
|
+ <SpreadLayout style={{marginBottom: 20}}>
|
|
|
+ <h2 style={{margin: 0}}>{t('Alerts')}</h2>
|
|
|
+ <Button
|
|
|
+ href={`/${orgId}/${projectId}/settings/alerts/rules/new/`}
|
|
|
+ priority="primary"
|
|
|
+ size="small"
|
|
|
+ className="pull-right">
|
|
|
+ <span className="icon-plus" />
|
|
|
+ {t('New Alert Rule')}
|
|
|
+ </Button>
|
|
|
+ </SpreadLayout>
|
|
|
|
|
|
<ul className="nav nav-tabs" style={{borderBottom: '1px solid #ddd'}}>
|
|
|
<ListLink to={`/${orgId}/${projectId}/settings/alerts/`} index={true}>
|