fix silence button size and collapsing escalationchain select

This commit is contained in:
Yulia Shanyrova 2022-07-26 13:59:14 +02:00
parent ce8f4e53fa
commit 2b4b612324
3 changed files with 16 additions and 11 deletions

View file

@ -714,16 +714,18 @@ class AlertRules extends React.Component<AlertRulesProps, AlertRulesState> {
)}
escalate to{' '}
<WithPermissionControl userAction={UserAction.UpdateAlertReceiveChannels}>
<GSelect
showSearch
modelName="escalationChainStore"
displayField="name"
placeholder="Select Escalation Chain"
className={cx('select', 'control', 'no-trigger-collapse-please')}
value={channelFilter.escalation_chain}
onChange={this.getEscalationChainChangeHandler(channelFilterId)}
showWarningIfEmptyValue={true}
/>
<div onClick={(e) => e.stopPropagation()}>
<GSelect
showSearch
modelName="escalationChainStore"
displayField="name"
placeholder="Select Escalation Chain"
className={cx('select', 'control', 'no-trigger-collapse-please')}
value={channelFilter.escalation_chain}
onChange={this.getEscalationChainChangeHandler(channelFilterId)}
showWarningIfEmptyValue={true}
/>
</div>
</WithPermissionControl>
</div>
<div onClick={(e) => e.stopPropagation()}>{this.renderChannelFilterButtons(channelFilterId, index)}</div>

View file

@ -214,6 +214,7 @@ export function getActionButtons(incident: AlertType, cx: any, callbacks: { [key
key="silence"
disabled={incident.loading}
onSelect={onSilence}
buttonSize="sm"
/>
);
}

View file

@ -12,10 +12,11 @@ interface SilenceDropdownProps {
onSelect: (value: number) => void;
className?: string;
disabled?: boolean;
buttonSize?: string;
}
const SilenceDropdown = observer((props: SilenceDropdownProps) => {
const { onSelect, className, disabled = false } = props;
const { onSelect, className, disabled = false, buttonSize } = props;
const onSelectCallback = useCallback(
([value, ...rest]) => {
@ -43,6 +44,7 @@ const SilenceDropdown = observer((props: SilenceDropdownProps) => {
label: silenceOption.display_name,
}))}
value={undefined}
buttonProps={{ size: buttonSize }}
>
Silence
</ButtonCascader>