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.
Files changed (151) hide show
  1. checksums.yaml +4 -4
  2. data/.nvmrc +2 -0
  3. data/.travis.yml +1 -1
  4. data/client/hippo/access/login-dialog.jsx +3 -5
  5. data/client/hippo/boot.jsx +2 -2
  6. data/client/hippo/components/asset.jsx +0 -1
  7. data/client/hippo/components/data-list.jsx +16 -15
  8. data/client/hippo/components/data-list/data-list.scss +10 -0
  9. data/client/hippo/components/data-table.jsx +14 -14
  10. data/client/hippo/components/data-table/header-cell.jsx +0 -1
  11. data/client/hippo/components/data-table/table-styles.scss +7 -0
  12. data/client/hippo/components/date-time.jsx +19 -16
  13. data/client/hippo/components/date-time/calendar.jsx +5 -7
  14. data/client/hippo/components/date-time/date-time-drop.jsx +0 -2
  15. data/client/hippo/components/date-time/time.jsx +0 -1
  16. data/client/hippo/components/form.jsx +1 -1
  17. data/client/hippo/components/form/{model.js → api.js} +25 -7
  18. data/client/hippo/components/form/fields.jsx +12 -11
  19. data/client/hippo/components/form/fields/date-wrapper.jsx +1 -1
  20. data/client/hippo/components/form/fields/form-field.scss +9 -1
  21. data/client/hippo/components/form/fields/label.jsx +14 -0
  22. data/client/hippo/components/form/fields/select-wrapper.jsx +2 -3
  23. data/client/hippo/components/form/wrapper.jsx +1 -3
  24. data/client/hippo/components/icon.jsx +2 -69
  25. data/client/hippo/components/master-detail.jsx +0 -2
  26. data/client/hippo/components/network-activity-overlay.jsx +1 -4
  27. data/client/hippo/components/query-builder.jsx +15 -16
  28. data/client/hippo/components/record-finder.jsx +2 -5
  29. data/client/hippo/components/record-finder/query-layer.jsx +1 -5
  30. data/client/hippo/components/screen.jsx +7 -3
  31. data/client/hippo/components/text-editor.jsx +2 -8
  32. data/client/hippo/components/tool-tip.jsx +2 -3
  33. data/client/hippo/components/warning-notification.jsx +3 -3
  34. data/client/hippo/lib/date-range.js +28 -0
  35. data/client/hippo/lib/util.js +6 -0
  36. data/client/hippo/models/asset.js +6 -3
  37. data/client/hippo/models/config.js +1 -1
  38. data/client/hippo/models/pub_sub.js +12 -7
  39. data/client/hippo/models/pub_sub/channel.js +6 -4
  40. data/client/hippo/models/query.js +19 -4
  41. data/client/hippo/models/query/array-result.js +9 -8
  42. data/client/hippo/models/query/clause.js +21 -13
  43. data/client/hippo/models/query/field.js +7 -2
  44. data/client/hippo/models/query/info.js +7 -3
  45. data/client/hippo/models/sync.js +11 -14
  46. data/client/hippo/react/Root.jsx +1 -2
  47. data/client/hippo/react/{DefaultComponentNotFound.jsx → component-not-found.jsx} +1 -3
  48. data/client/hippo/screens/index.js +6 -2
  49. data/client/hippo/screens/system-settings.jsx +10 -6
  50. data/client/hippo/screens/system-settings/mailer-config.jsx +0 -2
  51. data/client/hippo/screens/system-settings/tenant.jsx +1 -4
  52. data/client/hippo/screens/user-management.jsx +0 -1
  53. data/client/hippo/screens/user-management/edit-form.jsx +1 -2
  54. data/client/hippo/workspace/index.jsx +21 -12
  55. data/client/hippo/workspace/menu-group.jsx +4 -7
  56. data/client/hippo/workspace/menu-option.jsx +1 -3
  57. data/client/hippo/workspace/menu.jsx +29 -11
  58. data/client/hippo/workspace/navbar.jsx +1 -2
  59. data/client/hippo/workspace/root-view.jsx +5 -2
  60. data/client/hippo/workspace/screen.jsx +2 -3
  61. data/client/hippo/workspace/styles.scss +17 -0
  62. data/command-reference-files/screen/client/appy-app/screens/ready-set-go.jsx +2 -1
  63. data/db/migrate/20170530120004_create_users.rb +1 -1
  64. data/hippo-fw.gemspec +3 -2
  65. data/lib/hippo/api/cable.rb +13 -13
  66. data/lib/hippo/api/controller_base.rb +1 -0
  67. data/lib/hippo/api/handlers/tenant.rb +1 -1
  68. data/lib/hippo/api/handlers/user_session.rb +2 -1
  69. data/lib/hippo/api/helper_methods.rb +4 -1
  70. data/lib/hippo/api/pub_sub.rb +7 -6
  71. data/lib/hippo/api/to_json.rb +1 -1
  72. data/lib/hippo/api/updates.rb +2 -0
  73. data/lib/hippo/command/console.rb +11 -3
  74. data/lib/hippo/command/jest.rb +2 -0
  75. data/lib/hippo/configuration.rb +4 -7
  76. data/lib/hippo/rake_tasks.rb +1 -1
  77. data/lib/hippo/screen.rb +31 -93
  78. data/lib/hippo/screen/definition.rb +76 -0
  79. data/lib/hippo/screen/group.rb +26 -0
  80. data/lib/hippo/spec_helper.rb +3 -0
  81. data/lib/hippo/system_settings.rb +6 -0
  82. data/lib/hippo/user.rb +11 -3
  83. data/lib/hippo/version.rb +1 -1
  84. data/package-lock.json +419 -533
  85. data/package.json +32 -30
  86. data/spec/client/access/login-dialog.spec.jsx +4 -5
  87. data/spec/client/components/__snapshots__/query-builder.spec.jsx.snap +1 -1
  88. data/spec/client/components/__snapshots__/record-finder.spec.jsx.snap +72 -0
  89. data/spec/client/components/asset.spec.jsx +2 -6
  90. data/spec/client/components/data-list.spec.jsx +2 -6
  91. data/spec/client/components/data-table.spec.jsx +3 -5
  92. data/spec/client/components/date-time.spec.jsx +1 -1
  93. data/spec/client/components/form.spec.jsx +2 -2
  94. data/spec/client/components/master-detail.spec.jsx +1 -2
  95. data/spec/client/components/network-activity-overlay.spec.jsx +2 -3
  96. data/spec/client/components/query-builder.spec.jsx +3 -6
  97. data/spec/client/components/record-finder.spec.jsx +4 -4
  98. data/spec/client/models/pub_sub.spec.js +3 -1
  99. data/spec/client/models/query.spec.js +4 -9
  100. data/spec/client/screens/system-settings-tenants.spec.jsx +1 -1
  101. data/spec/client/screens/system-settings.spec.jsx +1 -4
  102. data/spec/client/workspace/__snapshots__/menu.spec.jsx.snap +15 -20
  103. data/spec/client/workspace/menu.spec.jsx +1 -2
  104. data/spec/server/api/user_sessions_spec.rb +15 -0
  105. data/templates/client/screens/screen.jsx +2 -1
  106. data/views/hippo_root_view.erb +1 -0
  107. metadata +30 -52
  108. data/client/hippo/components/calendar/Calendar.jsx +0 -25
  109. data/client/hippo/components/calendar/index.js +0 -3
  110. data/client/hippo/components/calendar/styles.scss +0 -3
  111. data/client/hippo/components/shared/AssetsListing.jsx +0 -23
  112. data/client/hippo/components/shared/Checkbox.jsx +0 -49
  113. data/client/hippo/components/shared/CountBadge.jsx +0 -13
  114. data/client/hippo/components/shared/DateTime.jsx +0 -58
  115. data/client/hippo/components/shared/DisplayValue.jsx +0 -15
  116. data/client/hippo/components/shared/ErrorDisplay.jsx +0 -37
  117. data/client/hippo/components/shared/FieldMixin.jsx +0 -254
  118. data/client/hippo/components/shared/FieldSet.jsx +0 -52
  119. data/client/hippo/components/shared/FieldWrapper.jsx +0 -94
  120. data/client/hippo/components/shared/FormGroup.jsx +0 -41
  121. data/client/hippo/components/shared/GenericField.jsx +0 -7
  122. data/client/hippo/components/shared/IconButton.jsx +0 -13
  123. data/client/hippo/components/shared/ImageAsset.jsx +0 -78
  124. data/client/hippo/components/shared/IndeterminateCheckbox.jsx +0 -31
  125. data/client/hippo/components/shared/Input.jsx +0 -16
  126. data/client/hippo/components/shared/InputFieldMixin.jsx +0 -78
  127. data/client/hippo/components/shared/JobProgress.jsx +0 -46
  128. data/client/hippo/components/shared/NumberInput.jsx +0 -37
  129. data/client/hippo/components/shared/PanelHeader.jsx +0 -15
  130. data/client/hippo/components/shared/RadioField.jsx +0 -33
  131. data/client/hippo/components/shared/ResizeSensor.jsx +0 -18
  132. data/client/hippo/components/shared/ScreenWrapper.jsx +0 -17
  133. data/client/hippo/components/shared/TextArea.jsx +0 -19
  134. data/client/hippo/components/shared/Throbber.jsx +0 -8
  135. data/client/hippo/components/shared/ToggleField.jsx +0 -2
  136. data/client/hippo/components/shared/Tooltip.jsx +0 -23
  137. data/client/hippo/components/shared/fields.scss +0 -58
  138. data/client/hippo/components/shared/fieldset.scss +0 -27
  139. data/client/hippo/components/shared/image-asset.scss +0 -53
  140. data/client/hippo/components/shared/index.js +0 -5
  141. data/client/hippo/components/shared/overlay.scss +0 -83
  142. data/client/hippo/components/shared/resize-sensor.scss +0 -30
  143. data/client/hippo/components/shared/styles.scss +0 -64
  144. data/client/hippo/components/shared/throbber.scss +0 -53
  145. data/client/hippo/fonts/fontawesome-webfont.woff +0 -0
  146. data/client/hippo/fonts/fontawesome-webfont.woff2 +0 -0
  147. data/client/hippo/workspace/content.jsx +0 -22
  148. data/client/hippo/workspace/tabs.jsx +0 -60
  149. data/client/hippo/workspace/viewport.jsx +0 -82
  150. data/spec/client/screens/__snapshots__/tabs.spec.jsx.snap +0 -127
  151. 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
- `cannot update 'name' prop from ${this.props.name} to ${nextProps.name}`);
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={f => (this.inputRef = f)}
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;
@@ -1,4 +1,12 @@
1
- .form-field {
1
+ .row > .form-field {
2
2
  margin-top: 0.5rem;
3
3
  .grommetux-form-field { width: 100%; }
4
4
  }
5
+
6
+ .grommetux-number-input {
7
+ .grommetux-button {
8
+ .grommetux-button__icon {
9
+ padding: 6px;
10
+ }
11
+ }
12
+ }
@@ -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, observable } from 'mobx';
3
+ import { action, computed } from 'mobx';
5
4
  import Select from 'grommet/components/Select';
6
- import { get, find, defer } from 'lodash';
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 './model';
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 React from 'react';
1
+ import Icon from 'react-fontawesome';
2
2
 
3
- import PropTypes from 'prop-types';
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;
@@ -11,8 +11,6 @@ const DELAY_TIME = 500;
11
11
 
12
12
  @observer
13
13
  export default class MasterDetail extends React.PureComponent {
14
-
15
-
16
14
  static propTypes = {
17
15
  master: PropTypes.element.isRequired,
18
16
  detail: PropTypes.element,
@@ -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={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.autoFetch = props.autoFetch;
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.clauses.map(c => <Clause key={c.id} clause={c} />)}
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
- this.props.formState.get(this.props.name).value = model[this.props.name]
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, observable, computed } from 'mobx';
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('screen', this.props.className, {
27
- 'is-active': this.props.screen.isActive,
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