mirror of
https://github.com/getredash/redash.git
synced 2026-03-22 01:00:14 -04:00
* Prettier all the JS files * Add GitHub Action to autoformat code pushed to master * Fix eslint violation due to formatting. * Remove GitHub actions for styling * Add restyled.io config
42 lines
1000 B
JavaScript
42 lines
1000 B
JavaScript
import React from "react";
|
|
import Modal from "antd/lib/modal";
|
|
import Input from "antd/lib/input";
|
|
import { wrap as wrapDialog, DialogPropType } from "@/components/DialogWrapper";
|
|
import { Group } from "@/services/group";
|
|
|
|
class CreateGroupDialog extends React.Component {
|
|
static propTypes = {
|
|
dialog: DialogPropType.isRequired,
|
|
};
|
|
|
|
state = {
|
|
name: "",
|
|
};
|
|
|
|
save = () => {
|
|
this.props.dialog.close(
|
|
new Group({
|
|
name: this.state.name,
|
|
})
|
|
);
|
|
};
|
|
|
|
render() {
|
|
const { dialog } = this.props;
|
|
return (
|
|
<Modal {...dialog.props} title="Create a New Group" okText="Create" onOk={() => this.save()}>
|
|
<Input
|
|
className="form-control"
|
|
defaultValue={this.state.name}
|
|
onChange={event => this.setState({ name: event.target.value })}
|
|
onPressEnter={() => this.save()}
|
|
placeholder="Group Name"
|
|
autoFocus
|
|
/>
|
|
</Modal>
|
|
);
|
|
}
|
|
}
|
|
|
|
export default wrapDialog(CreateGroupDialog);
|