Skip to content

Commit

Permalink
feat(environments): Remove environment feature flag from alert rules (#…
Browse files Browse the repository at this point in the history
  • Loading branch information
lynnagara authored Feb 27, 2018
1 parent d585906 commit e8ff7b5
Show file tree
Hide file tree
Showing 2 changed files with 144 additions and 19 deletions.
31 changes: 12 additions & 19 deletions src/sentry/static/sentry/app/views/ruleEditor/index.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -173,9 +173,6 @@ const RuleEditor = createReactClass({
},

render() {
const hasEnvironmentsFeature = new Set(this.props.organization.features).has(
'environments'
);
const activeEnvs = EnvironmentStore.getActive() || [];
const environmentChoices = [
['all', t('All Environments')],
Expand Down Expand Up @@ -246,22 +243,18 @@ const RuleEditor = createReactClass({

<hr />

{hasEnvironmentsFeature && (
<React.Fragment>
<h6>{t('In this environment')}:</h6>
<Select2Field
className={this.hasError('environment') ? ' error' : ''}
style={{marginBottom: 0, marginLeft: 5, marginRight: 5}}
name="environment"
value={environment}
required={true}
choices={environmentChoices}
onChange={val => this.handleEnvironmentChange(val)}
/>

<hr />
</React.Fragment>
)}
<h6>{t('In this environment')}:</h6>
<Select2Field
className={this.hasError('environment') ? ' error' : ''}
style={{marginBottom: 0, marginLeft: 5, marginRight: 5}}
name="environment"
value={environment}
required={true}
choices={environmentChoices}
onChange={val => this.handleEnvironmentChange(val)}
/>

<hr />

<h6>{t('Take these actions:')}</h6>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -286,6 +286,72 @@ exports[`ProjectAlertRuleDetails Edit alert rule renders 1`] = `
</div>
</RuleNodeList>
<hr />
<h6>
In this environment
:
</h6>
<Select2Field
allowClear={false}
allowEmpty={false}
choices={
Array [
Array [
"all",
"All Environments",
],
]
}
className=""
disabled={false}
escapeMarkup={true}
hideErrorMessage={false}
multiple={false}
name="environment"
onChange={[Function]}
placeholder="--"
required={true}
style={
Object {
"marginBottom": 0,
"marginLeft": 5,
"marginRight": 5,
}
}
>
<div
className="control-group required"
style={
Object {
"marginBottom": 0,
"marginLeft": 5,
"marginRight": 5,
}
}
>
<div
className="controls"
>
<select
className="form-control"
disabled={false}
id="id-environment"
multiple={false}
onChange={[Function]}
placeholder="--"
required={true}
value=""
>
<option
key="all"
value="all"
>
All Environments
</option>
</select>
</div>
</div>
</Select2Field>
<hr />
<h6>
Take these actions:
</h6>
Expand Down Expand Up @@ -821,6 +887,72 @@ exports[`ProjectAlertRuleDetails New alert rule renders 1`] = `
</div>
</RuleNodeList>
<hr />
<h6>
In this environment
:
</h6>
<Select2Field
allowClear={false}
allowEmpty={false}
choices={
Array [
Array [
"all",
"All Environments",
],
]
}
className=""
disabled={false}
escapeMarkup={true}
hideErrorMessage={false}
multiple={false}
name="environment"
onChange={[Function]}
placeholder="--"
required={true}
style={
Object {
"marginBottom": 0,
"marginLeft": 5,
"marginRight": 5,
}
}
>
<div
className="control-group required"
style={
Object {
"marginBottom": 0,
"marginLeft": 5,
"marginRight": 5,
}
}
>
<div
className="controls"
>
<select
className="form-control"
disabled={false}
id="id-environment"
multiple={false}
onChange={[Function]}
placeholder="--"
required={true}
value=""
>
<option
key="all"
value="all"
>
All Environments
</option>
</select>
</div>
</div>
</Select2Field>
<hr />
<h6>
Take these actions:
</h6>
Expand Down

0 comments on commit e8ff7b5

Please sign in to comment.