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

ref(ui): Rename RuleConditionsFormForWizard and change legacy choices to options #28662

Merged
merged 1 commit into from
Sep 21, 2021
Merged
Show file tree
Hide file tree
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
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ type State = {
environments: Environment[] | null;
};

class RuleConditionsFormForWizard extends React.PureComponent<Props, State> {
class RuleConditionsForm extends React.PureComponent<Props, State> {
state: State = {
environments: null,
};
Expand Down Expand Up @@ -316,7 +316,10 @@ class RuleConditionsFormForWizard extends React.PureComponent<Props, State> {
minWidth: 130,
maxWidth: 300,
}}
choices={Object.entries(TIME_WINDOW_MAP)}
options={Object.entries(TIME_WINDOW_MAP).map(([value, label]) => ({
value,
label,
}))}
required
isDisabled={disabled}
getValue={value => Number(value)}
Expand Down Expand Up @@ -374,4 +377,4 @@ const FormRowText = styled('div')`
margin: ${space(1)};
`;

export default RuleConditionsFormForWizard;
export default RuleConditionsForm;
4 changes: 2 additions & 2 deletions static/app/views/alerts/incidentRules/ruleForm/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ import FormModel from 'app/views/settings/components/forms/model';

import {addOrUpdateRule} from '../actions';
import {createDefaultTrigger} from '../constants';
import RuleConditionsFormForWizard from '../ruleConditionsFormForWizard';
import RuleConditionsForm from '../ruleConditionsForm';
import {
AlertRuleThresholdType,
Dataset,
Expand Down Expand Up @@ -700,7 +700,7 @@ class RuleFormContainer extends AsyncComponent<Props, State> {
submitLabel={t('Save Rule')}
>
<List symbol="colored-numeric">
<RuleConditionsFormForWizard
<RuleConditionsForm
api={this.api}
projectSlug={params.projectId}
organization={organization}
Expand Down