Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(ui): Do not show threshold type on session alerts #29206

Merged
merged 2 commits into from
Oct 11, 2021
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
39 changes: 21 additions & 18 deletions static/app/views/alerts/incidentRules/ruleConditionsForm.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -148,6 +148,7 @@ class RuleConditionsForm extends React.PureComponent<Props, State> {
comparisonDelta,
onComparisonDeltaChange,
onComparisonTypeChange,
dataset,
} = this.props;
const {environments} = this.state;

Expand Down Expand Up @@ -282,9 +283,9 @@ class RuleConditionsForm extends React.PureComponent<Props, State> {
: model.setValue('aggregate', DEFAULT_AGGREGATE);

// set the value of the dataset and event type from data source
const {dataset, eventTypes} =
const {dataset: datasetFromDataSource, eventTypes} =
DATA_SOURCE_TO_SET_AND_EVENT_TYPES[optionValue] ?? {};
model.setValue('dataset', dataset);
model.setValue('dataset', datasetFromDataSource);
model.setValue('eventTypes', eventTypes);
}}
options={dataSourceOptions}
Expand Down Expand Up @@ -337,27 +338,29 @@ class RuleConditionsForm extends React.PureComponent<Props, State> {
{...(this.searchSupportedTags
? {supportedTags: this.searchSupportedTags}
: {})}
hasRecentSearches={this.props.dataset !== Dataset.SESSIONS}
hasRecentSearches={dataset !== Dataset.SESSIONS}
/>
</SearchContainer>
)}
</FormField>
</FormRow>
<Feature features={['organizations:change-alerts']} organization={organization}>
<StyledListItem>{t('Select threshold type')}</StyledListItem>
<FormRow>
<RadioGroup
style={{flex: 1}}
choices={[
[AlertRuleComparisonType.COUNT, 'Count'],
[AlertRuleComparisonType.CHANGE, 'Percent Change'],
]}
value={comparisonType}
label={t('Threshold Type')}
onChange={onComparisonTypeChange}
/>
</FormRow>
</Feature>
{dataset !== Dataset.SESSIONS && (
<Feature features={['organizations:change-alerts']} organization={organization}>
<StyledListItem>{t('Select threshold type')}</StyledListItem>
<FormRow>
<RadioGroup
style={{flex: 1}}
choices={[
[AlertRuleComparisonType.COUNT, 'Count'],
[AlertRuleComparisonType.CHANGE, 'Percent Change'],
]}
value={comparisonType}
label={t('Threshold Type')}
onChange={onComparisonTypeChange}
/>
</FormRow>
</Feature>
)}
<StyledListItem>
<StyledListTitle>
<div>{intervalLabelText}</div>
Expand Down