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
data/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "hippo-fw",
|
3
|
-
"version": "0.9.
|
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.
|
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.
|
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.
|
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.
|
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.
|
38
|
-
"enzyme": "^2.9.
|
39
|
-
"eslint": "^4.
|
40
|
-
"eslint-config-argosity": "^1.1.
|
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.
|
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.
|
50
|
-
"jest-fetch-mock": "^1.0
|
51
|
-
"js-yaml": "^3.
|
52
|
-
"jsdom": "^11.
|
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
|
56
|
-
"mobx-decorated-models": "^0.
|
55
|
+
"mobx": "^3.2.1",
|
56
|
+
"mobx-decorated-models": "^0.6.3",
|
57
57
|
"mobx-persist": "^0.3.3",
|
58
|
-
"mobx-react": "^4.
|
58
|
+
"mobx-react": "^4.2.2",
|
59
59
|
"node-sass": "^4.5.0",
|
60
60
|
"ory-editor": "^0.2.12",
|
61
|
-
"pluralize": "^
|
61
|
+
"pluralize": "^6.0.0",
|
62
62
|
"prop-types": "^15.5.8",
|
63
|
-
"qs": "^6.
|
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": "
|
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": "^
|
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.
|
76
|
-
"react-router-dom": "^4.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.
|
80
|
-
"react-virtualized": "^9.
|
81
|
-
"resolve-url-loader": "^2.0
|
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": "^
|
89
|
-
"webpack": "^3.
|
90
|
-
"webpack-dev-server": "^2.5.
|
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
|
-
|
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(
|
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(
|
9
|
+
describe('DataList Component', () => {
|
14
10
|
let query;
|
15
11
|
|
16
12
|
beforeEach(() => {
|
@@ -1,16 +1,14 @@
|
|
1
|
-
import React from 'react';
|
2
|
-
import {
|
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(
|
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 {
|
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
|
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,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(
|
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(
|
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
|
-
|
46
|
-
expect(
|
47
|
-
expect(
|
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,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
|
-
<
|
33
|
-
|
34
|
-
|
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
|
-
<
|
48
|
-
|
49
|
-
|
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
|
-
<
|
61
|
-
|
62
|
-
|
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
|
-
<
|
74
|
-
|
75
|
-
|
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
|
-
<
|
91
|
-
|
92
|
-
|
93
|
-
style={undefined}
|
86
|
+
<span
|
87
|
+
aria-hidden={true}
|
88
|
+
className="fa fa-red"
|
94
89
|
/>
|
95
90
|
</a>
|
96
91
|
`;
|