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
data/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "hippo-fw",
3
- "version": "0.9.4",
3
+ "version": "0.9.5",
4
4
  "description": "Hippo is a framework for easily writing single page web applications",
5
5
  "main": "client/hippo/index.js",
6
6
  "repository": "https://github.com/argosity/hippo",
@@ -10,18 +10,18 @@
10
10
  "client"
11
11
  ],
12
12
  "dependencies": {
13
- "actioncable": "^5.1.1",
13
+ "actioncable": "^5.1.2",
14
14
  "babel-core": "^6.25.0",
15
15
  "babel-eslint": "^7.2.3",
16
16
  "babel-jest": "^20.0.3",
17
- "babel-loader": "^7.1.0",
17
+ "babel-loader": "^7.1.1",
18
18
  "babel-plugin-lodash": "^3.2.11",
19
19
  "babel-plugin-transform-decorators-legacy": "^1.3.4",
20
20
  "babel-plugin-transform-es2015-modules-commonjs": "^6.23.0",
21
21
  "babel-plugin-transform-flow-strip-types": "^6.22.0",
22
22
  "babel-plugin-transform-function-bind": "^6.22.0",
23
23
  "babel-plugin-transform-runtime": "^6.15.0",
24
- "babel-preset-env": "^1.5.2",
24
+ "babel-preset-env": "^1.6.0",
25
25
  "babel-preset-es2015-loose": "^8.0.0",
26
26
  "babel-preset-jest": "^20.0.3",
27
27
  "babel-preset-latest": "^6.16.0",
@@ -30,64 +30,66 @@
30
30
  "babel-preset-stage-1": "^6.16.0",
31
31
  "big.js": "^3.1.3",
32
32
  "classnames": "^2.2.5",
33
- "compression-webpack-plugin": "^0.4.0",
33
+ "compression-webpack-plugin": "^1.0.0",
34
34
  "core-decorators": "^0.19.0",
35
35
  "create-react-class": "^15.6.0",
36
36
  "css-loader": "^0.28.4",
37
- "domtastic": "^0.15.0",
38
- "enzyme": "^2.9.0",
39
- "eslint": "^4.0.0",
40
- "eslint-config-argosity": "^1.1.3",
37
+ "domtastic": "^0.15.1",
38
+ "enzyme": "^2.9.1",
39
+ "eslint": "^4.2.0",
40
+ "eslint-config-argosity": "^1.1.5",
41
41
  "file-loader": "^0.11.2",
42
42
  "flexboxgrid": "^6.3.1",
43
- "grommet": "^1.4.0",
43
+ "grommet": "^1.5.0",
44
44
  "history": "^4.6.3",
45
45
  "identity-obj-proxy": "^3.0.0",
46
46
  "invariant": "^2.2.2",
47
47
  "jest": "^20.0.4",
48
48
  "jest-cli": "^20.0.4",
49
- "jest-enzyme": "^3.3.0",
50
- "jest-fetch-mock": "^1.0.7",
51
- "js-yaml": "^3.8.2",
52
- "jsdom": "^11.0.0",
49
+ "jest-enzyme": "^3.6.0",
50
+ "jest-fetch-mock": "^1.2.0",
51
+ "js-yaml": "^3.9.0",
52
+ "jsdom": "^11.1.0",
53
53
  "lodash": "^4.17.4",
54
54
  "loglevel": "^1.4.1",
55
- "mobx": "^3.1.16",
56
- "mobx-decorated-models": "^0.5.2",
55
+ "mobx": "^3.2.1",
56
+ "mobx-decorated-models": "^0.6.3",
57
57
  "mobx-persist": "^0.3.3",
58
- "mobx-react": "^4.1.0",
58
+ "mobx-react": "^4.2.2",
59
59
  "node-sass": "^4.5.0",
60
60
  "ory-editor": "^0.2.12",
61
- "pluralize": "^5.0.0",
61
+ "pluralize": "^6.0.0",
62
62
  "prop-types": "^15.5.8",
63
- "qs": "^6.3.0",
63
+ "qs": "^6.5.0",
64
64
  "react": "^15.6.1",
65
65
  "react-addons-shallow-compare": "^15.6.0",
66
66
  "react-addons-test-utils": "^15.6.0",
67
67
  "react-async-component": "^1.0.0-beta.3",
68
+ "react-braintree-fields": "^0.6.0",
68
69
  "react-dom": "^15.6.1",
69
70
  "react-dropzone": "^3.13.3",
70
- "react-flexbox-grid": "git+https://github.com/nathanstitt/react-flexbox-grid.git#devel",
71
+ "react-flexbox-grid": "1.1.3",
72
+ "react-fontawesome": "^1.6.1",
71
73
  "react-hot-loader": "3.0.0-beta.6",
72
- "react-input-slider": "^1.6.0",
74
+ "react-input-slider": "^2.0.0",
73
75
  "react-motion": "^0.5.0",
74
76
  "react-native-storage": "^0.2.2",
75
- "react-router": "^4.1.1",
76
- "react-router-dom": "^4.1.1",
77
+ "react-router": "^4.1.2",
78
+ "react-router-dom": "^4.1.2",
77
79
  "react-sidebar": "^2.3.0",
80
+ "react-tap-event-plugin": "^2.0.1",
78
81
  "react-test-renderer": "^15.6.1",
79
- "react-tippy": "^0.14.0",
80
- "react-virtualized": "^9.8.0",
81
- "resolve-url-loader": "^2.0.3",
82
- "rsvp": "^3.3.3",
82
+ "react-tippy": "^1.0.2",
83
+ "react-virtualized": "^9.9.0",
84
+ "resolve-url-loader": "^2.1.0",
83
85
  "sass-loader": "^6.0.6",
84
86
  "sockjs-client": "^1.1.4",
85
87
  "sprintf-js": "^1.0.3",
86
88
  "style-loader": "^0.18.2",
87
89
  "url-loader": "^0.5.9",
88
- "validator": "^7.1.0",
89
- "webpack": "^3.0.0",
90
- "webpack-dev-server": "^2.5.0",
90
+ "validator": "^8.0.0",
91
+ "webpack": "^3.3.0",
92
+ "webpack-dev-server": "^2.5.1",
91
93
  "whatwg-fetch": "^2.0.2",
92
94
  "when-dom-ready": "^1.2.4"
93
95
  }
@@ -1,12 +1,11 @@
1
- jest.mock('hippo/models/sync');
2
- jest.mock('hippo/config');
3
-
4
- import React from 'react';
5
-
1
+ import React from 'react'; // eslint-disable-line no-unused-vars
6
2
  import User from 'hippo/user';
7
3
  import Config from 'hippo/config';
8
4
  import LoginDialog from 'hippo/access/login-dialog';
9
5
 
6
+ jest.mock('hippo/models/sync');
7
+ jest.mock('hippo/config');
8
+
10
9
  describe('Login Dialog', () => {
11
10
  beforeEach(() => (Config.access_token = '0123456789'));
12
11
  afterEach(() => (Config.access_token = ''));
@@ -66,8 +66,8 @@ exports[`Query Builder Component renders and matches snapshot 1`] = `
66
66
  autoFocus={true}
67
67
  className="grommetux-text-input grommetux-input"
68
68
  defaultValue={undefined}
69
- onChange={[Function]}
70
69
  onFocus={[Function]}
70
+ onInput={[Function]}
71
71
  onKeyDown={[Function]}
72
72
  placeholder={undefined}
73
73
  style={
@@ -0,0 +1,72 @@
1
+ // Jest Snapshot v1, https://goo.gl/fbAQLP
2
+
3
+ exports[`RecordFinder Component renders 1`] = `
4
+ <div
5
+ className="form-field record-finder"
6
+ >
7
+ <div
8
+ className="grommetux-form-field grommetux-form-field--size-medium"
9
+ onClick={[Function]}
10
+ >
11
+ <label
12
+ className="grommetux-form-field__label"
13
+ htmlFor={undefined}
14
+ >
15
+ Name
16
+ </label>
17
+ <span
18
+ className="grommetux-form-field__contents"
19
+ >
20
+ <input
21
+ autoComplete="off"
22
+ autoFocus={undefined}
23
+ className="grommetux-text-input grommetux-input"
24
+ defaultValue={undefined}
25
+ name="name"
26
+ onBlur={[Function]}
27
+ onChange={[Function]}
28
+ onFocus={[Function]}
29
+ onInput={[Function]}
30
+ onKeyDown={[Function]}
31
+ onKeyPress={[Function]}
32
+ placeholder={undefined}
33
+ type="text"
34
+ value=""
35
+ />
36
+ <button
37
+ aria-label={undefined}
38
+ className="grommetux-button grommetux-button--plain grommetux-control-icon-search"
39
+ disabled={false}
40
+ href={undefined}
41
+ onBlur={[Function]}
42
+ onClick={[Function]}
43
+ onFocus={[Function]}
44
+ onMouseDown={[Function]}
45
+ onMouseUp={[Function]}
46
+ type="button"
47
+ >
48
+ <span
49
+ className="grommetux-button__icon"
50
+ >
51
+ <svg
52
+ aria-label="search"
53
+ className="grommetux-control-icon grommetux-control-icon-search grommetux-control-icon--responsive"
54
+ height="24px"
55
+ role="img"
56
+ version="1.1"
57
+ viewBox="0 0 24 24"
58
+ width="24px"
59
+ >
60
+ <path
61
+ d="M15,15 L22,22 L15,15 Z M9.5,17 C13.6421356,17 17,13.6421356 17,9.5 C17,5.35786438 13.6421356,2 9.5,2 C5.35786438,2 2,5.35786438 2,9.5 C2,13.6421356 5.35786438,17 9.5,17 Z"
62
+ fill="none"
63
+ stroke="#000"
64
+ strokeWidth="2"
65
+ />
66
+ </svg>
67
+ </span>
68
+ </button>
69
+ </span>
70
+ </div>
71
+ </div>
72
+ `;
@@ -1,12 +1,8 @@
1
- import React from 'react';
2
-
3
- import { Col } from 'react-flexbox-grid';
1
+ import React from 'react'; // eslint-disable-line no-unused-vars
4
2
  import Asset from 'hippo/components/asset';
5
-
6
3
  import { TestImage } from '../test-models';
7
- import { Snapshot } from 'hippo/testing/screens';
8
4
 
9
- describe("Asset Component", () => {
5
+ describe('Asset Component', () => {
10
6
  it('renders', () => {
11
7
  const image = new TestImage();
12
8
  const asset = mount(<Asset model={image} name="asset" />);
@@ -1,16 +1,12 @@
1
- import React from 'react';
1
+ import React from 'react'; // eslint-disable-line no-unused-vars
2
2
  import { range } from 'lodash';
3
-
4
3
  import Query from 'hippo/models/query';
5
-
6
4
  import DataList from 'hippo/components/data-list';
7
-
8
5
  import { Container } from '../test-models';
9
- import { Snapshot } from 'hippo/testing/screens';
10
6
 
11
7
  jest.mock('hippo/models/sync');
12
8
 
13
- describe("DataList Component", () => {
9
+ describe('DataList Component', () => {
14
10
  let query;
15
11
 
16
12
  beforeEach(() => {
@@ -1,16 +1,14 @@
1
- import React from 'react';
2
- import { first, map, find, range } from 'lodash';
1
+ import React from 'react'; // eslint-disable-line no-unused-vars
2
+ import { range } from 'lodash';
3
3
  import { autorun } from 'mobx';
4
- import Sync from 'hippo/models/sync';
5
4
  import Query from 'hippo/models/query';
6
-
7
5
  import DataTable from 'hippo/components/data-table';
8
6
 
9
7
  import { Container } from '../test-models';
10
8
 
11
9
  jest.mock('hippo/models/sync');
12
10
 
13
- describe("DataTable Component", () => {
11
+ describe('DataTable Component', () => {
14
12
  let query;
15
13
 
16
14
  beforeEach(() => {
@@ -1,4 +1,4 @@
1
- import React from 'react';
1
+ import React from 'react'; // eslint-disable-line no-unused-vars
2
2
  import DateTime from 'hippo/components/date-time/date-time-drop';
3
3
  import moment from 'moment';
4
4
 
@@ -1,4 +1,4 @@
1
- import React from 'react';
1
+ import React from 'react'; // eslint-disable-line no-unused-vars
2
2
  import {
3
3
  nonBlank, validEmail, hasLength, validURL, FormState,
4
4
  } from 'hippo/components/form';
@@ -10,7 +10,7 @@ describe('Form Validation functions', () => {
10
10
  email: { validate: validEmail },
11
11
  name: { validate: hasLength({ length: 3 }) },
12
12
  });
13
- expect(form.get('email.isValid')).toBe(false);
13
+ expect(form.get('email').isValid).toBe(false);
14
14
  expect(form.isValid).toBe(false);
15
15
  expect(form.isTouched).toBe(false);
16
16
 
@@ -1,5 +1,4 @@
1
- import React from 'react';
2
-
1
+ import React from 'react'; // eslint-disable-line no-unused-vars
3
2
  import { Snapshot } from 'hippo/testing/screens';
4
3
  import MasterDetail from 'hippo/components/master-detail';
5
4
 
@@ -1,8 +1,7 @@
1
- import React from 'react';
2
-
1
+ import React from 'react'; // eslint-disable-line no-unused-vars
2
+ import { Snapshot } from 'hippo/testing/screens';
3
3
  import NetworkActivityOverlay from 'hippo/components/network-activity-overlay';
4
4
  import { Box } from '../test-models';
5
- import { Snapshot } from 'hippo/testing/screens';
6
5
 
7
6
  jest.useFakeTimers();
8
7
 
@@ -1,15 +1,12 @@
1
- import React from 'react';
2
-
1
+ import React from 'react'; // eslint-disable-line no-unused-vars
3
2
  import QueryBuilder from 'hippo/components/query-builder';
4
-
5
- import { Box } from '../test-models';
6
3
  import { Snapshot } from 'hippo/testing/screens';
7
4
  import Query from 'hippo/models/query';
5
+ import { Box } from '../test-models';
8
6
 
9
7
  jest.useFakeTimers();
10
8
 
11
- describe("Query Builder Component", () => {
12
-
9
+ describe('Query Builder Component', () => {
13
10
  let query;
14
11
 
15
12
  beforeEach(() => {
@@ -1,17 +1,16 @@
1
- import React from 'react';
1
+ import React from 'react'; // eslint-disable-line no-unused-vars
2
2
  import { range } from 'lodash';
3
3
 
4
4
  import Query from 'hippo/models/query';
5
5
 
6
6
  import { Snapshot } from 'hippo/testing/screens';
7
7
  import RecordFinder from 'hippo/components/record-finder';
8
-
8
+ import { FormState } from 'hippo/components/form';
9
9
  import { Container } from '../test-models';
10
10
 
11
11
  jest.mock('hippo/models/sync');
12
- import { FormState, stringValue } from 'hippo/components/form';
13
12
 
14
- describe("RecordFinder Component", () => {
13
+ describe('RecordFinder Component', () => {
15
14
  let query;
16
15
  let props;
17
16
  let formState;
@@ -44,5 +43,6 @@ describe("RecordFinder Component", () => {
44
43
  <RecordFinder {...props} />,
45
44
  );
46
45
  expect(finder).toHaveRendered('TextInput');
46
+ expect(Snapshot(<RecordFinder {...props} />)).toMatchSnapshot();
47
47
  });
48
48
  });
@@ -1,15 +1,17 @@
1
1
  import { onBoot, observePubSub } from 'hippo/models/pub_sub';
2
2
  import PubSubChannel from 'hippo/models/pub_sub/channel';
3
-
3
+ import Config from 'hippo/config';
4
4
  import { Ship, Container } from '../test-models';
5
5
 
6
6
  jest.mock('hippo/user', () => ({
7
7
  isLoggedIn: true,
8
8
  }));
9
9
  jest.mock('hippo/models/pub_sub/channel');
10
+ jest.mock('hippo/config');
10
11
 
11
12
  describe('PubSub', () => {
12
13
  it('watches and checks in and out', () => {
14
+ Config.api_host = 'testing';
13
15
  const ship = new Ship();
14
16
  const container = new Container({ id: '2' });
15
17
  onBoot();
@@ -1,7 +1,5 @@
1
1
  import Sync from 'hippo/models/sync';
2
2
  import { map, find, range, shuffle } from 'lodash';
3
-
4
- import Clause from 'hippo/models/query/clause';
5
3
  import Query from 'hippo/models/query';
6
4
  import { Box } from '../test-models';
7
5
 
@@ -42,12 +40,9 @@ describe('Model Queries', () => {
42
40
  });
43
41
 
44
42
  it('calculates fields', () => {
45
- const q = new Query({ src: Box });
46
- expect(q.src).toEqual(Box);
47
- expect(q.clauses).toHaveLength(1);
48
- const clause = q.clauses[0];
49
- expect(clause).toBeInstanceOf(Clause);
50
- expect(clause.query).toBe(q);
43
+ expect(query.clauses).toHaveLength(1);
44
+ expect(query.clauses[0].field).toBe(query.fields[1]);
45
+ expect(query.clauses[0].operator.id).toBe('like');
51
46
  });
52
47
 
53
48
  it('calculates min width', () => {
@@ -78,7 +73,7 @@ describe('Model Queries', () => {
78
73
  const clause = query.clauses[0];
79
74
  expect(clause.field.id).toEqual('computed');
80
75
  expect(clause.operator.id).toEqual('like');
81
- expect(map(clause.validOperators, 'id')).toEqual(['like', 'eq']);
76
+ expect(map(clause.validOperators, 'id')).toEqual(['like', 'eq', 'contains']);
82
77
  clause.field = query.fields[3];
83
78
  expect(clause.operator.id).toEqual('eq');
84
79
  expect(map(clause.validOperators, 'id')).toEqual(['eq', 'lt', 'gt']);
@@ -1,4 +1,4 @@
1
- import React from 'react';
1
+ import React from 'react'; // eslint-disable-line no-unused-vars
2
2
 
3
3
  import TenantModel from 'hippo/models/tenant';
4
4
  import Tenant from 'hippo/screens/system-settings/tenant';
@@ -1,7 +1,4 @@
1
- import React from 'react';
2
-
3
- import { Snapshot } from 'hippo/testing/screens';
4
-
1
+ import React from 'react'; // eslint-disable-line no-unused-vars
5
2
  import Settings from 'hippo/screens/system-settings';
6
3
  import Instance from 'hippo/screens/instance';
7
4
  import { getTestScreen } from '../test-models';
@@ -29,10 +29,9 @@ exports[`Workspace Menu has groups with screens 1`] = `
29
29
  className="grommetux-heading grommetux-heading--strong"
30
30
  >
31
31
  Settings
32
- <i
33
- className="icon icon-wrench"
34
- onClick={undefined}
35
- style={undefined}
32
+ <span
33
+ aria-hidden={true}
34
+ className="fa fa-wrench"
36
35
  />
37
36
  </h4>
38
37
  </header>
@@ -44,10 +43,9 @@ exports[`Workspace Menu has groups with screens 1`] = `
44
43
  onClick={[Function]}
45
44
  >
46
45
  User Management
47
- <i
48
- className="icon icon-group"
49
- onClick={undefined}
50
- style={undefined}
46
+ <span
47
+ aria-hidden={true}
48
+ className="fa fa-group"
51
49
  />
52
50
  </a>
53
51
  <a
@@ -57,10 +55,9 @@ exports[`Workspace Menu has groups with screens 1`] = `
57
55
  onClick={[Function]}
58
56
  >
59
57
  System Settings
60
- <i
61
- className="icon icon-cogs"
62
- onClick={undefined}
63
- style={undefined}
58
+ <span
59
+ aria-hidden={true}
60
+ className="fa fa-cogs"
64
61
  />
65
62
  </a>
66
63
  <a
@@ -70,10 +67,9 @@ exports[`Workspace Menu has groups with screens 1`] = `
70
67
  onClick={[Function]}
71
68
  >
72
69
  title
73
- <i
74
- className="icon icon-red"
75
- onClick={undefined}
76
- style={undefined}
70
+ <span
71
+ aria-hidden={true}
72
+ className="fa fa-red"
77
73
  />
78
74
  </a>
79
75
  </nav>
@@ -87,10 +83,9 @@ exports[`Workspace Menu has renders menu options 1`] = `
87
83
  onClick={[Function]}
88
84
  >
89
85
  title
90
- <i
91
- className="icon icon-red"
92
- onClick={undefined}
93
- style={undefined}
86
+ <span
87
+ aria-hidden={true}
88
+ className="fa fa-red"
94
89
  />
95
90
  </a>
96
91
  `;