-
Notifications
You must be signed in to change notification settings - Fork 1
/
QueuerForm.js
97 lines (85 loc) · 3.12 KB
/
QueuerForm.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
import _ from 'lodash';
import React from 'react';
import PropTypes from 'prop-types';
import { Field, reduxForm } from 'redux-form';
import Link from 'react-router-dom/Link';
import Route from 'react-router-dom/Route';
import Pane from '@folio/stripes-components/lib/Pane';
import PaneMenu from '@folio/stripes-components/lib/PaneMenu';
import Paneset from '@folio/stripes-components/lib/Paneset';
import MultiColumnList from '@folio/stripes-components/lib/MultiColumnList';
import Button from '@folio/stripes-components/lib/Button';
import { Row, Col } from '@folio/stripes-components/lib/LayoutGrid';
import TextField from '@folio/stripes-components/lib/TextField';
import Select from '@folio/stripes-components/lib/Select';
import Layer from '@folio/stripes-components/lib/Layer';
class QueuerForm extends React.Component {
constructor(props) {
super(props);
// logging
const logger = props.stripes.logger;
this.log = logger.log.bind(logger);
};
render() {
this.log('action', `render QueuerForm`);
const {
handleSubmit,
reset, // eslint-disable-line no-unused-vars
submitting,
onCancelNewQueuer,
initialValues,
resources,
stripes,
location
} = this.props;
const containerStyle = {
display: 'flex',
flexDirection: 'column',
justifyContent: 'space-between',
height: '100%',
width: '100%',
position: 'absolute',
};
const closeButton = (
<PaneMenu>
<button onClick={onCancelNewQueuer} title="close" aria-label="Close New Queuer Dialog">
<span style={{ fontSize: '30px', color: '#999', lineHeight: '18px' }} >×</span>
</button>
</PaneMenu>
);
const submitButton = (
<PaneMenu>
<Button
id="clickable-new-queuer"
title="Save"
onClick={handleSubmit}
buttonStyle="primary paneHeaderNewButton"
type="submit"
disabled={submitting}>
Save
</Button>
</PaneMenu>
);
return (
<Paneset isRoot>
<Pane
id="main-pane"
defaultWidth="100%"
firstMenu={closeButton}
lastMenu={submitButton}
paneTitle={'Queuer'}>
<Row>
<Col sm={5} smOffset={1}>
<h2>Queuer Record</h2>
<Field label="Username" name="username" id="addqueuer_username" component={TextField} required fullWidth />
<Field label="Email" name="email" id="addqueuer_email" component={TextField} required fullWidth />
</Col>
</Row>
</Pane>
</Paneset>
);
}
}
export default reduxForm({
form: 'queuerForm',
})(QueuerForm);