hippo-fw 0.9.5 → 0.9.6
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.nvmrc +2 -0
- data/.travis.yml +1 -1
- data/client/hippo/access/login-dialog.jsx +3 -5
- data/client/hippo/boot.jsx +2 -2
- data/client/hippo/components/asset.jsx +0 -1
- data/client/hippo/components/data-list.jsx +16 -15
- data/client/hippo/components/data-list/data-list.scss +10 -0
- data/client/hippo/components/data-table.jsx +14 -14
- data/client/hippo/components/data-table/header-cell.jsx +0 -1
- data/client/hippo/components/data-table/table-styles.scss +7 -0
- data/client/hippo/components/date-time.jsx +19 -16
- data/client/hippo/components/date-time/calendar.jsx +5 -7
- data/client/hippo/components/date-time/date-time-drop.jsx +0 -2
- data/client/hippo/components/date-time/time.jsx +0 -1
- data/client/hippo/components/form.jsx +1 -1
- data/client/hippo/components/form/{model.js → api.js} +25 -7
- data/client/hippo/components/form/fields.jsx +12 -11
- data/client/hippo/components/form/fields/date-wrapper.jsx +1 -1
- data/client/hippo/components/form/fields/form-field.scss +9 -1
- data/client/hippo/components/form/fields/label.jsx +14 -0
- data/client/hippo/components/form/fields/select-wrapper.jsx +2 -3
- data/client/hippo/components/form/wrapper.jsx +1 -3
- data/client/hippo/components/icon.jsx +2 -69
- data/client/hippo/components/master-detail.jsx +0 -2
- data/client/hippo/components/network-activity-overlay.jsx +1 -4
- data/client/hippo/components/query-builder.jsx +15 -16
- data/client/hippo/components/record-finder.jsx +2 -5
- data/client/hippo/components/record-finder/query-layer.jsx +1 -5
- data/client/hippo/components/screen.jsx +7 -3
- data/client/hippo/components/text-editor.jsx +2 -8
- data/client/hippo/components/tool-tip.jsx +2 -3
- data/client/hippo/components/warning-notification.jsx +3 -3
- data/client/hippo/lib/date-range.js +28 -0
- data/client/hippo/lib/util.js +6 -0
- data/client/hippo/models/asset.js +6 -3
- data/client/hippo/models/config.js +1 -1
- data/client/hippo/models/pub_sub.js +12 -7
- data/client/hippo/models/pub_sub/channel.js +6 -4
- data/client/hippo/models/query.js +19 -4
- data/client/hippo/models/query/array-result.js +9 -8
- data/client/hippo/models/query/clause.js +21 -13
- data/client/hippo/models/query/field.js +7 -2
- data/client/hippo/models/query/info.js +7 -3
- data/client/hippo/models/sync.js +11 -14
- data/client/hippo/react/Root.jsx +1 -2
- data/client/hippo/react/{DefaultComponentNotFound.jsx → component-not-found.jsx} +1 -3
- data/client/hippo/screens/index.js +6 -2
- data/client/hippo/screens/system-settings.jsx +10 -6
- data/client/hippo/screens/system-settings/mailer-config.jsx +0 -2
- data/client/hippo/screens/system-settings/tenant.jsx +1 -4
- data/client/hippo/screens/user-management.jsx +0 -1
- data/client/hippo/screens/user-management/edit-form.jsx +1 -2
- data/client/hippo/workspace/index.jsx +21 -12
- data/client/hippo/workspace/menu-group.jsx +4 -7
- data/client/hippo/workspace/menu-option.jsx +1 -3
- data/client/hippo/workspace/menu.jsx +29 -11
- data/client/hippo/workspace/navbar.jsx +1 -2
- data/client/hippo/workspace/root-view.jsx +5 -2
- data/client/hippo/workspace/screen.jsx +2 -3
- data/client/hippo/workspace/styles.scss +17 -0
- data/command-reference-files/screen/client/appy-app/screens/ready-set-go.jsx +2 -1
- data/db/migrate/20170530120004_create_users.rb +1 -1
- data/hippo-fw.gemspec +3 -2
- data/lib/hippo/api/cable.rb +13 -13
- data/lib/hippo/api/controller_base.rb +1 -0
- data/lib/hippo/api/handlers/tenant.rb +1 -1
- data/lib/hippo/api/handlers/user_session.rb +2 -1
- data/lib/hippo/api/helper_methods.rb +4 -1
- data/lib/hippo/api/pub_sub.rb +7 -6
- data/lib/hippo/api/to_json.rb +1 -1
- data/lib/hippo/api/updates.rb +2 -0
- data/lib/hippo/command/console.rb +11 -3
- data/lib/hippo/command/jest.rb +2 -0
- data/lib/hippo/configuration.rb +4 -7
- data/lib/hippo/rake_tasks.rb +1 -1
- data/lib/hippo/screen.rb +31 -93
- data/lib/hippo/screen/definition.rb +76 -0
- data/lib/hippo/screen/group.rb +26 -0
- data/lib/hippo/spec_helper.rb +3 -0
- data/lib/hippo/system_settings.rb +6 -0
- data/lib/hippo/user.rb +11 -3
- data/lib/hippo/version.rb +1 -1
- data/package-lock.json +419 -533
- data/package.json +32 -30
- data/spec/client/access/login-dialog.spec.jsx +4 -5
- data/spec/client/components/__snapshots__/query-builder.spec.jsx.snap +1 -1
- data/spec/client/components/__snapshots__/record-finder.spec.jsx.snap +72 -0
- data/spec/client/components/asset.spec.jsx +2 -6
- data/spec/client/components/data-list.spec.jsx +2 -6
- data/spec/client/components/data-table.spec.jsx +3 -5
- data/spec/client/components/date-time.spec.jsx +1 -1
- data/spec/client/components/form.spec.jsx +2 -2
- data/spec/client/components/master-detail.spec.jsx +1 -2
- data/spec/client/components/network-activity-overlay.spec.jsx +2 -3
- data/spec/client/components/query-builder.spec.jsx +3 -6
- data/spec/client/components/record-finder.spec.jsx +4 -4
- data/spec/client/models/pub_sub.spec.js +3 -1
- data/spec/client/models/query.spec.js +4 -9
- data/spec/client/screens/system-settings-tenants.spec.jsx +1 -1
- data/spec/client/screens/system-settings.spec.jsx +1 -4
- data/spec/client/workspace/__snapshots__/menu.spec.jsx.snap +15 -20
- data/spec/client/workspace/menu.spec.jsx +1 -2
- data/spec/server/api/user_sessions_spec.rb +15 -0
- data/templates/client/screens/screen.jsx +2 -1
- data/views/hippo_root_view.erb +1 -0
- metadata +30 -52
- data/client/hippo/components/calendar/Calendar.jsx +0 -25
- data/client/hippo/components/calendar/index.js +0 -3
- data/client/hippo/components/calendar/styles.scss +0 -3
- data/client/hippo/components/shared/AssetsListing.jsx +0 -23
- data/client/hippo/components/shared/Checkbox.jsx +0 -49
- data/client/hippo/components/shared/CountBadge.jsx +0 -13
- data/client/hippo/components/shared/DateTime.jsx +0 -58
- data/client/hippo/components/shared/DisplayValue.jsx +0 -15
- data/client/hippo/components/shared/ErrorDisplay.jsx +0 -37
- data/client/hippo/components/shared/FieldMixin.jsx +0 -254
- data/client/hippo/components/shared/FieldSet.jsx +0 -52
- data/client/hippo/components/shared/FieldWrapper.jsx +0 -94
- data/client/hippo/components/shared/FormGroup.jsx +0 -41
- data/client/hippo/components/shared/GenericField.jsx +0 -7
- data/client/hippo/components/shared/IconButton.jsx +0 -13
- data/client/hippo/components/shared/ImageAsset.jsx +0 -78
- data/client/hippo/components/shared/IndeterminateCheckbox.jsx +0 -31
- data/client/hippo/components/shared/Input.jsx +0 -16
- data/client/hippo/components/shared/InputFieldMixin.jsx +0 -78
- data/client/hippo/components/shared/JobProgress.jsx +0 -46
- data/client/hippo/components/shared/NumberInput.jsx +0 -37
- data/client/hippo/components/shared/PanelHeader.jsx +0 -15
- data/client/hippo/components/shared/RadioField.jsx +0 -33
- data/client/hippo/components/shared/ResizeSensor.jsx +0 -18
- data/client/hippo/components/shared/ScreenWrapper.jsx +0 -17
- data/client/hippo/components/shared/TextArea.jsx +0 -19
- data/client/hippo/components/shared/Throbber.jsx +0 -8
- data/client/hippo/components/shared/ToggleField.jsx +0 -2
- data/client/hippo/components/shared/Tooltip.jsx +0 -23
- data/client/hippo/components/shared/fields.scss +0 -58
- data/client/hippo/components/shared/fieldset.scss +0 -27
- data/client/hippo/components/shared/image-asset.scss +0 -53
- data/client/hippo/components/shared/index.js +0 -5
- data/client/hippo/components/shared/overlay.scss +0 -83
- data/client/hippo/components/shared/resize-sensor.scss +0 -30
- data/client/hippo/components/shared/styles.scss +0 -64
- data/client/hippo/components/shared/throbber.scss +0 -53
- data/client/hippo/fonts/fontawesome-webfont.woff +0 -0
- data/client/hippo/fonts/fontawesome-webfont.woff2 +0 -0
- data/client/hippo/workspace/content.jsx +0 -22
- data/client/hippo/workspace/tabs.jsx +0 -60
- data/client/hippo/workspace/viewport.jsx +0 -82
- data/spec/client/screens/__snapshots__/tabs.spec.jsx.snap +0 -127
- data/spec/client/screens/tabs.spec.jsx +0 -36
@@ -1,34 +1,29 @@
|
|
1
1
|
import React from 'react';
|
2
2
|
import PropTypes from 'prop-types';
|
3
|
-
|
3
|
+
import invariant from 'invariant';
|
4
|
+
import { action } from 'mobx';
|
4
5
|
import { inject, observer } from 'mobx-react';
|
5
6
|
import classnames from 'classnames';
|
6
7
|
import { Col, getColumnProps } from 'react-flexbox-grid';
|
7
|
-
|
8
|
-
import invariant from 'invariant';
|
9
8
|
import Field from 'grommet/components/FormField';
|
10
9
|
import NumberInput from 'grommet/components/NumberInput';
|
11
|
-
|
12
10
|
import { titleize } from '../../lib/util';
|
13
|
-
|
14
|
-
import { FormField as FormFieldModel } from './model';
|
15
11
|
import DateWrapper from './fields/date-wrapper';
|
16
12
|
import SelectWrapper from './fields/select-wrapper';
|
17
13
|
import TextWrapper from './fields/text-wrapper';
|
18
14
|
import CheckBoxWrapper from './fields/checkbox-wrapper';
|
19
|
-
|
15
|
+
import Label from './fields/label';
|
20
16
|
import './fields/form-field.scss';
|
21
17
|
|
22
18
|
const TypesMapping = {
|
23
19
|
text: TextWrapper,
|
24
20
|
date: DateWrapper,
|
21
|
+
label: Label,
|
25
22
|
select: SelectWrapper,
|
26
23
|
number: NumberInput,
|
27
24
|
checkbox: CheckBoxWrapper,
|
28
|
-
|
29
25
|
};
|
30
26
|
|
31
|
-
|
32
27
|
@inject('formState')
|
33
28
|
@observer
|
34
29
|
export default class FormField extends React.PureComponent {
|
@@ -55,15 +50,21 @@ export default class FormField extends React.PureComponent {
|
|
55
50
|
|
56
51
|
componentWillReceiveProps(nextProps) {
|
57
52
|
invariant(nextProps.name === this.props.name,
|
58
|
-
|
53
|
+
`cannot update 'name' prop from ${this.props.name} to ${nextProps.name}`);
|
59
54
|
this.field.update(this.props);
|
60
55
|
}
|
61
56
|
|
57
|
+
@action.bound
|
58
|
+
setRef(input) {
|
59
|
+
this.inputRef = input;
|
60
|
+
}
|
61
|
+
|
62
62
|
render() {
|
63
63
|
const {
|
64
64
|
name, className, autoFocus, type, children, label,
|
65
65
|
validate: _, formState: __, help: ___, ...otherProps
|
66
66
|
} = getColumnProps(this.props);
|
67
|
+
|
67
68
|
const InputTag = TypesMapping[type] || TypesMapping.text;
|
68
69
|
|
69
70
|
return (
|
@@ -76,7 +77,7 @@ export default class FormField extends React.PureComponent {
|
|
76
77
|
<InputTag
|
77
78
|
name={name}
|
78
79
|
autoFocus={autoFocus}
|
79
|
-
ref={
|
80
|
+
ref={this.setRef}
|
80
81
|
value={this.field.value || ''}
|
81
82
|
type={InputTag === TypesMapping.text ? this.props.type : undefined}
|
82
83
|
{...this.field.events}
|
@@ -8,7 +8,7 @@ import DateTime from '../../date-time';
|
|
8
8
|
@observer
|
9
9
|
export default class DateWrapper extends React.PureComponent {
|
10
10
|
static defaultProps = {
|
11
|
-
format: 'M/D/YYYY h:mm a'
|
11
|
+
format: 'M/D/YYYY h:mm a',
|
12
12
|
}
|
13
13
|
static childContextTypes = { onDropChange: PropTypes.func }
|
14
14
|
@observable isSelecting;
|
@@ -0,0 +1,14 @@
|
|
1
|
+
import React from 'react';
|
2
|
+
import { observer } from 'mobx-react';
|
3
|
+
import Value from 'grommet/components/Value';
|
4
|
+
|
5
|
+
@observer
|
6
|
+
export default class LabelWrapper extends React.PureComponent {
|
7
|
+
render() {
|
8
|
+
const { value } = this.props;
|
9
|
+
|
10
|
+
return (
|
11
|
+
<Value value={value} />
|
12
|
+
);
|
13
|
+
}
|
14
|
+
}
|
@@ -1,9 +1,8 @@
|
|
1
1
|
import React from 'react';
|
2
|
-
import PropTypes from 'prop-types';
|
3
2
|
import { observer } from 'mobx-react';
|
4
|
-
import { action, computed
|
3
|
+
import { action, computed } from 'mobx';
|
5
4
|
import Select from 'grommet/components/Select';
|
6
|
-
import { get, find
|
5
|
+
import { get, find } from 'lodash';
|
7
6
|
|
8
7
|
@observer
|
9
8
|
export default class SelectFieldWrapper extends React.PureComponent {
|
@@ -2,11 +2,10 @@ import React from 'react';
|
|
2
2
|
import PropTypes from 'prop-types';
|
3
3
|
import { PropTypes as MobxPropTypes, Provider, observer } from 'mobx-react';
|
4
4
|
import { observePubSub } from '../../models/pub_sub';
|
5
|
-
import { FormState } from './
|
5
|
+
import { FormState } from './api';
|
6
6
|
|
7
7
|
@observer
|
8
8
|
export default class FormWrapper extends React.PureComponent {
|
9
|
-
|
10
9
|
static propTypes = {
|
11
10
|
tag: PropTypes.string,
|
12
11
|
className: PropTypes.string,
|
@@ -54,5 +53,4 @@ export default class FormWrapper extends React.PureComponent {
|
|
54
53
|
if (this.props.model) { observePubSub(this.props.model); }
|
55
54
|
return this.props.tag ? this.renderTagged() : this.renderTagless();
|
56
55
|
}
|
57
|
-
|
58
56
|
}
|
@@ -1,70 +1,3 @@
|
|
1
|
-
import
|
1
|
+
import Icon from 'react-fontawesome';
|
2
2
|
|
3
|
-
|
4
|
-
|
5
|
-
import { uniqueId, extend } from 'lodash';
|
6
|
-
import classnames from 'classnames';
|
7
|
-
|
8
|
-
const DEFAULT_TOOLTIP_PROPS = { placement: 'top', trigger: 'click' };
|
9
|
-
|
10
|
-
export default class Icon extends React.PureComponent {
|
11
|
-
|
12
|
-
static propTypes = {
|
13
|
-
type: PropTypes.string.isRequired,
|
14
|
-
animated: PropTypes.bool,
|
15
|
-
spinner: PropTypes.bool,
|
16
|
-
className: PropTypes.string,
|
17
|
-
tooltip: PropTypes.oneOfType([
|
18
|
-
PropTypes.string, PropTypes.element
|
19
|
-
]),
|
20
|
-
tooltipProps: PropTypes.object,
|
21
|
-
};
|
22
|
-
|
23
|
-
static defaultProps = {
|
24
|
-
tooltipProps: DEFAULT_TOOLTIP_PROPS,
|
25
|
-
}
|
26
|
-
|
27
|
-
constructor(props) {
|
28
|
-
super(props);
|
29
|
-
this.state = {
|
30
|
-
uniqueId: uniqueId('icon-tooltip-'),
|
31
|
-
};
|
32
|
-
}
|
33
|
-
|
34
|
-
render() {
|
35
|
-
const classes = classnames('icon', `icon-${this.props.type}`, this.props.className, {
|
36
|
-
'non-printable': this.props.noPrint,
|
37
|
-
'with-action' : this.props.onClick,
|
38
|
-
[`icon-${this.props.size}`] : this.props.size,
|
39
|
-
'icon-pulse' : this.props.animated,
|
40
|
-
'icon-spin' : this.props.spin || (this.props.type === 'spinner'),
|
41
|
-
'flush' : this.props.flush,
|
42
|
-
'icon-lg' : this.props['lg'],
|
43
|
-
'icon-2x' : this.props['2x'],
|
44
|
-
'icon-3x' : this.props['3x'],
|
45
|
-
'icon-4x' : this.props['4x'],
|
46
|
-
'icon-5x' : this.props['5x'],
|
47
|
-
'clickable' : this.props.clickable || (this.props.tooltip && (this.props.tooltipProps.trigger === 'click'))
|
48
|
-
}
|
49
|
-
);
|
50
|
-
|
51
|
-
const icon =
|
52
|
-
React.createElement("i", {"style": (this.props.style), "className": (classes), "onClick": (this.props.onClick)});
|
53
|
-
|
54
|
-
if (this.props.tooltip) {
|
55
|
-
const props = extend({}, DEFAULT_TOOLTIP_PROPS, this.props.tooltipProps);
|
56
|
-
return (
|
57
|
-
React.createElement(LC.Tooltip, Object.assign({"id": (this.state.uniqueId),
|
58
|
-
"content": (this.props.tooltip)
|
59
|
-
}, props
|
60
|
-
),
|
61
|
-
(icon)
|
62
|
-
)
|
63
|
-
);
|
64
|
-
} else {
|
65
|
-
return (
|
66
|
-
icon
|
67
|
-
);
|
68
|
-
}
|
69
|
-
}
|
70
|
-
}
|
3
|
+
export default Icon;
|
@@ -1,13 +1,11 @@
|
|
1
1
|
import React from 'react';
|
2
2
|
import PropTypes from 'prop-types';
|
3
3
|
import { observer, PropTypes as MobxPropTypes } from 'mobx-react';
|
4
|
-
import { autorun, action } from 'mobx';
|
4
|
+
import { autorun, action, observable, computed } from 'mobx';
|
5
5
|
import Spinning from 'grommet/components/icons/Spinning';
|
6
6
|
import CircleInformationIcon from 'grommet/components/icons/base/CircleInformation';
|
7
7
|
import { delay, isEmpty, includes, get } from 'lodash';
|
8
8
|
import classnames from 'classnames';
|
9
|
-
import { BaseModel, observable, computed } from '../models/base';
|
10
|
-
|
11
9
|
import './network-activity-overlay.scss';
|
12
10
|
|
13
11
|
function Indicator({ error }) {
|
@@ -16,7 +14,6 @@ function Indicator({ error }) {
|
|
16
14
|
|
17
15
|
@observer
|
18
16
|
export default class NetworkActivityOverlay extends React.PureComponent {
|
19
|
-
|
20
17
|
static defaultProps = {
|
21
18
|
timeout: 30000,
|
22
19
|
errorTimeout: 2000,
|
@@ -1,7 +1,7 @@
|
|
1
1
|
import React from 'react';
|
2
2
|
|
3
3
|
import PropTypes from 'prop-types';
|
4
|
-
|
4
|
+
import { find } from 'lodash';
|
5
5
|
import { observer } from 'mobx-react';
|
6
6
|
import { action } from 'mobx';
|
7
7
|
import Box from 'grommet/components/Box';
|
@@ -9,16 +9,12 @@ import Menu from 'grommet/components/Menu';
|
|
9
9
|
import RadioButton from 'grommet/components/RadioButton';
|
10
10
|
import TextInput from 'grommet/components/TextInput';
|
11
11
|
import DownIcon from 'grommet/components/icons/base/Down';
|
12
|
-
|
13
|
-
import BaseModel from '../models/base';
|
12
|
+
import { BaseModel } from '../models/base';
|
14
13
|
import Query from '../models/query';
|
15
14
|
import ClauseModel from '../models/query/clause';
|
16
|
-
import FieldModel from '../models/query/field';
|
17
|
-
import OperatorModel from '../models/query/operator';
|
18
15
|
|
19
16
|
@observer
|
20
17
|
class Radio extends React.PureComponent {
|
21
|
-
|
22
18
|
static propTypes = {
|
23
19
|
name: PropTypes.string.isRequired,
|
24
20
|
onSelect: PropTypes.func.isRequired,
|
@@ -34,13 +30,13 @@ class Radio extends React.PureComponent {
|
|
34
30
|
|
35
31
|
render() {
|
36
32
|
const { model } = this.props;
|
37
|
-
const checked = (this.props.clause[this.props.name] === model);
|
38
33
|
return (
|
39
34
|
<RadioButton
|
35
|
+
id={model.id}
|
40
36
|
name={model.id}
|
41
37
|
label={model.label}
|
42
38
|
onChange={this.onChange}
|
43
|
-
checked={
|
39
|
+
checked={(this.props.clause[this.props.name] === model)}
|
44
40
|
/>
|
45
41
|
);
|
46
42
|
}
|
@@ -48,7 +44,6 @@ class Radio extends React.PureComponent {
|
|
48
44
|
|
49
45
|
@observer
|
50
46
|
class ClauseFilter extends React.PureComponent {
|
51
|
-
|
52
47
|
static propTypes = {
|
53
48
|
clause: PropTypes.instanceOf(ClauseModel).isRequired,
|
54
49
|
}
|
@@ -65,7 +60,6 @@ class ClauseFilter extends React.PureComponent {
|
|
65
60
|
|
66
61
|
@observer
|
67
62
|
class Clause extends React.PureComponent {
|
68
|
-
|
69
63
|
static propTypes = {
|
70
64
|
clause: PropTypes.instanceOf(ClauseModel).isRequired,
|
71
65
|
}
|
@@ -96,7 +90,7 @@ class Clause extends React.PureComponent {
|
|
96
90
|
<Radio
|
97
91
|
key={f.id} model={f} clause={clause}
|
98
92
|
onSelect={this.onSelect} name='field' />,
|
99
|
-
|
93
|
+
)}
|
100
94
|
</Box>
|
101
95
|
<Box size="small" pad={{ between: 'small' }}>
|
102
96
|
{clause.validOperators.map(o =>
|
@@ -104,7 +98,7 @@ class Clause extends React.PureComponent {
|
|
104
98
|
key={o.id} model={o} clause={clause}
|
105
99
|
onSelect={this.onSelect} name='operator'
|
106
100
|
/>,
|
107
|
-
|
101
|
+
)}
|
108
102
|
</Box>
|
109
103
|
</Box>
|
110
104
|
</Menu>
|
@@ -121,7 +115,6 @@ class Clause extends React.PureComponent {
|
|
121
115
|
|
122
116
|
@observer
|
123
117
|
export default class QueryBuilder extends React.PureComponent {
|
124
|
-
|
125
118
|
static defaultProps = {
|
126
119
|
autoFetch: false,
|
127
120
|
}
|
@@ -134,7 +127,14 @@ export default class QueryBuilder extends React.PureComponent {
|
|
134
127
|
constructor(props) {
|
135
128
|
super(props);
|
136
129
|
this.previousQueryAutoFetch = this.props.query.autoFetch;
|
137
|
-
this.props.query.
|
130
|
+
if (0 === this.props.query.info.visibleClauses.length) {
|
131
|
+
const field = find(this.props.query.fields, { visible: true });
|
132
|
+
this.props.query.clauses.push({ field, operator: field.preferredOperator });
|
133
|
+
}
|
134
|
+
}
|
135
|
+
|
136
|
+
componentWillMount() {
|
137
|
+
this.props.query.autoFetch = this.props.autoFetch;
|
138
138
|
}
|
139
139
|
|
140
140
|
componentWillReceiveProps(nextProps) {
|
@@ -149,9 +149,8 @@ export default class QueryBuilder extends React.PureComponent {
|
|
149
149
|
const { query } = this.props;
|
150
150
|
return (
|
151
151
|
<div className="query-builder">
|
152
|
-
{query.
|
152
|
+
{query.info.visibleClauses.map(c => <Clause key={c.id} clause={c} />)}
|
153
153
|
</div>
|
154
154
|
);
|
155
155
|
}
|
156
|
-
|
157
156
|
}
|
@@ -9,11 +9,7 @@ import { Field } from 'hippo/components/form';
|
|
9
9
|
import Button from 'grommet/components/Button';
|
10
10
|
import SearchIcon from 'grommet/components/icons/base/Search';
|
11
11
|
|
12
|
-
import { Col } from 'react-flexbox-grid';
|
13
|
-
|
14
|
-
import { titleize } from '../lib/util';
|
15
12
|
import Query from '../models/query';
|
16
|
-
|
17
13
|
import './record-finder/record-finder.scss';
|
18
14
|
import QueryLayer from './record-finder/query-layer';
|
19
15
|
|
@@ -43,7 +39,8 @@ export default class RecordFinder extends React.PureComponent {
|
|
43
39
|
@action.bound
|
44
40
|
onRecordSelect(model) {
|
45
41
|
this.showingSearch = false;
|
46
|
-
|
42
|
+
const value = get(model, this.props.name);
|
43
|
+
this.props.formState.get(this.props.name).value = value;
|
47
44
|
this.props.onRecordFound(model);
|
48
45
|
}
|
49
46
|
|
@@ -3,7 +3,7 @@ import React from 'react';
|
|
3
3
|
import PropTypes from 'prop-types';
|
4
4
|
|
5
5
|
import { observer } from 'mobx-react';
|
6
|
-
import { action
|
6
|
+
import { action } from 'mobx';
|
7
7
|
|
8
8
|
import Heading from 'grommet/components/Heading';
|
9
9
|
import Layer from 'grommet/components/Layer';
|
@@ -16,8 +16,6 @@ import QueryBuilder from '../query-builder';
|
|
16
16
|
|
17
17
|
@observer
|
18
18
|
export default class QueryLayer extends React.PureComponent {
|
19
|
-
|
20
|
-
|
21
19
|
static propTypes = {
|
22
20
|
title: PropTypes.string.isRequired,
|
23
21
|
onClose: PropTypes.func.isRequired,
|
@@ -69,6 +67,4 @@ export default class QueryLayer extends React.PureComponent {
|
|
69
67
|
</Layer>
|
70
68
|
);
|
71
69
|
}
|
72
|
-
|
73
|
-
|
74
70
|
}
|
@@ -23,9 +23,13 @@ export default class Screen extends React.Component {
|
|
23
23
|
return (
|
24
24
|
<div
|
25
25
|
data-screen-id={this.props.screen.definition.id}
|
26
|
-
className={classnames(
|
27
|
-
|
28
|
-
|
26
|
+
className={classnames(
|
27
|
+
'screen',
|
28
|
+
this.props.screen.definition.id,
|
29
|
+
this.props.className, {
|
30
|
+
'is-active': this.props.screen.isActive,
|
31
|
+
},
|
32
|
+
)}
|
29
33
|
>
|
30
34
|
{this.props.children}
|
31
35
|
</div>
|
@@ -2,28 +2,23 @@ import React from 'react';
|
|
2
2
|
import PropTypes from 'prop-types';
|
3
3
|
import { action, observable, toJS } from 'mobx';
|
4
4
|
import { isEmpty } from 'lodash';
|
5
|
-
import { observer } from 'mobx-react';
|
6
|
-
import { Provider, PropTypes as MobxPropTypes } from 'mobx-react';
|
5
|
+
import { observer, Provider, PropTypes as MobxPropTypes } from 'mobx-react';
|
7
6
|
|
8
7
|
// The editor core
|
9
8
|
import Editor, { Editable, createEmptyState } from 'ory-editor-core';
|
10
9
|
|
11
10
|
// Require our ui components (optional). You can implement and use your own ui too!
|
12
11
|
import { Trash, Toolbar } from 'ory-editor-ui';
|
13
|
-
import tapEventPlugin from 'react-tap-event-plugin';
|
14
|
-
|
15
|
-
import { plugins, defaultPlugin } from './text-editor/plugins';
|
16
|
-
|
17
12
|
import 'ory-editor-ui/lib/index.css';
|
18
13
|
import 'ory-editor-core/lib/index.css';
|
19
14
|
|
15
|
+
import { plugins, defaultPlugin } from './text-editor/plugins';
|
20
16
|
import DisplayModeToggle from './text-editor/display-modes';
|
21
17
|
import './text-editor/text-editor.scss';
|
22
18
|
|
23
19
|
|
24
20
|
@observer
|
25
21
|
export default class TextEditor extends React.PureComponent {
|
26
|
-
|
27
22
|
static defaultProps = {
|
28
23
|
assets: observable.array(),
|
29
24
|
}
|
@@ -42,7 +37,6 @@ export default class TextEditor extends React.PureComponent {
|
|
42
37
|
editables: [this.content],
|
43
38
|
defaultPlugin,
|
44
39
|
});
|
45
|
-
tapEventPlugin();
|
46
40
|
}
|
47
41
|
|
48
42
|
@action.bound
|