Skip to content

Commit

Permalink
Problems: don't limit ack message, fix #1122
Browse files Browse the repository at this point in the history
  • Loading branch information
alexanderzobnin committed Dec 28, 2020
1 parent 47471fd commit e6bf021
Showing 1 changed file with 7 additions and 8 deletions.
15 changes: 7 additions & 8 deletions src/panel-triggers/components/AckModal.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import React, { PureComponent } from 'react';
import { cx, css } from 'emotion';
import { ZBX_ACK_ACTION_ADD_MESSAGE, ZBX_ACK_ACTION_ACK, ZBX_ACK_ACTION_CHANGE_SEVERITY, ZBX_ACK_ACTION_CLOSE } from '../../datasource-zabbix/constants';
import { Button, VerticalGroup, Spinner, Modal, Input, Checkbox, RadioButtonGroup, stylesFactory, withTheme, Themeable } from '@grafana/ui';
import { Button, VerticalGroup, Spinner, Modal, Input, Checkbox, RadioButtonGroup, stylesFactory, withTheme, Themeable, TextArea } from '@grafana/ui';
import { FAIcon } from '../../components';
import { GrafanaTheme } from '@grafana/data';

Expand Down Expand Up @@ -65,13 +65,13 @@ export class AckModalUnthemed extends PureComponent<Props, State> {
};
}

handleChange = (event: React.ChangeEvent<HTMLInputElement>) => {
handleChange = (event: React.ChangeEvent<HTMLTextAreaElement>) => {
this.setState({ value: event.target.value, error: false });
}

handleKeyUp = (event: React.KeyboardEvent<HTMLInputElement>) => {
handleKeyPress = (event: React.KeyboardEvent<HTMLTextAreaElement>) => {
if (event.which === KEYBOARD_ENTER_KEY || event.key === 'Enter') {
this.submit();
// this.submit();
} else if (event.which === KEYBOARD_ESCAPE_KEY || event.key === 'Escape') {
this.dismiss();
}
Expand Down Expand Up @@ -196,17 +196,16 @@ export class AckModalUnthemed extends PureComponent<Props, State> {
>
<div className={inputGroupClass}>
<label className="gf-form-hint">
<Input className={inputClass}
<TextArea className={inputClass}
type="text"
name="message"
placeholder="Message"
maxLength={64}
autoComplete="off"
autoFocus={true}
value={this.state.value}
onChange={this.handleChange}
onKeyUp={this.handleKeyUp}>
</Input>
onKeyDown={this.handleKeyPress}>
</TextArea>
<small className={inputHintClass}>Press Enter to submit</small>
{this.state.error &&
<small className={inputErrorClass}>{this.state.errorMessage}</small>
Expand Down

0 comments on commit e6bf021

Please sign in to comment.