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
Binary file
|
@@ -1,22 +0,0 @@
|
|
1
|
-
import React from 'react';
|
2
|
-
|
3
|
-
import Tabs from './tabs';
|
4
|
-
|
5
|
-
import Box from 'grommet/components/Box';
|
6
|
-
import Paragraph from 'grommet/components/Paragraph';
|
7
|
-
|
8
|
-
export default class Content extends React.Component {
|
9
|
-
|
10
|
-
render() {
|
11
|
-
return (
|
12
|
-
<Box className="content-pane" justify="start" align="stretch" pad="none" direction="column" full="vertical">
|
13
|
-
<Tabs />
|
14
|
-
|
15
|
-
<Box justify="start" align="stretch" pad="none" flex="grow">
|
16
|
-
{this.props.children}
|
17
|
-
</Box>
|
18
|
-
|
19
|
-
</Box>
|
20
|
-
);
|
21
|
-
}
|
22
|
-
}
|
@@ -1,60 +0,0 @@
|
|
1
|
-
import React from 'react';
|
2
|
-
import PropTypes from 'prop-types';
|
3
|
-
import { observer } from 'mobx-react';
|
4
|
-
import classnames from 'classnames';
|
5
|
-
import Icon from '../components/icon';
|
6
|
-
import ScreenInstances from '../screens/instance';
|
7
|
-
|
8
|
-
import Tabs from 'grommet/components/Tabs';
|
9
|
-
import Tab from 'grommet/components/Tab';
|
10
|
-
|
11
|
-
@observer
|
12
|
-
export class ScreenTab extends React.Component {
|
13
|
-
static propTypes = {
|
14
|
-
screen: PropTypes.shape({
|
15
|
-
title: PropTypes.string.isRequired,
|
16
|
-
definition: PropTypes.shape({
|
17
|
-
icon: PropTypes.string.isRequired,
|
18
|
-
}).isRequired,
|
19
|
-
}).isRequired,
|
20
|
-
}
|
21
|
-
|
22
|
-
setModelState(nextState) {
|
23
|
-
if (this.model.active) {
|
24
|
-
_.dom(document.head).qs('title').text = this.model.title();
|
25
|
-
this.context.viewport.history.replace(this.model.historyUrl());
|
26
|
-
}
|
27
|
-
if (Hippo.Screens.Definitions.displaying.length === 0) {
|
28
|
-
this.context.viewport.history.push('/');
|
29
|
-
}
|
30
|
-
return (
|
31
|
-
this.setState(nextState)
|
32
|
-
);
|
33
|
-
}
|
34
|
-
|
35
|
-
activate() {
|
36
|
-
this.model.active = true;
|
37
|
-
this.context.viewport.history.push(this.model.historyUrl());
|
38
|
-
return (
|
39
|
-
null
|
40
|
-
);
|
41
|
-
}
|
42
|
-
|
43
|
-
close() { return this.model.remove(); }
|
44
|
-
|
45
|
-
render() {
|
46
|
-
const { screen } = this.props;
|
47
|
-
// const title = <span><Icon type="hourglass" />{screen.title}</span>
|
48
|
-
return (
|
49
|
-
<Tab title={screen.title} />
|
50
|
-
);
|
51
|
-
}
|
52
|
-
}
|
53
|
-
|
54
|
-
const ScreenTabs = observer(() => (
|
55
|
-
<Tabs justify="start">
|
56
|
-
{ScreenInstances.displaying.map(s => <ScreenTab key={s.id} screen={s} />)}
|
57
|
-
</Tabs>
|
58
|
-
));
|
59
|
-
ScreenTabs.displayName = 'NavbarTabs';
|
60
|
-
export default ScreenTabs;
|
@@ -1,82 +0,0 @@
|
|
1
|
-
import React from 'react';
|
2
|
-
|
3
|
-
/* const Screen = React.createClass({
|
4
|
-
*
|
5
|
-
* displayName: 'Screen',
|
6
|
-
* shouldComponentUpdate() {
|
7
|
-
* return (
|
8
|
-
* false
|
9
|
-
* );
|
10
|
-
* },
|
11
|
-
* render() {
|
12
|
-
* return (
|
13
|
-
* React.createElement(this.props.screen.component(), this.props.screen.props)
|
14
|
-
* );
|
15
|
-
* },
|
16
|
-
* });*/
|
17
|
-
|
18
|
-
export default class ScreenView extends React.Component {
|
19
|
-
/* contextTypes: {
|
20
|
-
* uistate: React.PropTypes.object.isRequired,
|
21
|
-
* },*/
|
22
|
-
|
23
|
-
/* static modelBindings: {
|
24
|
-
* displaying() { return Hippo.Screens.Definitions.displaying; },
|
25
|
-
* allScreens() { return Hippo.Screens.Definitions.all; },
|
26
|
-
* },
|
27
|
-
|
28
|
-
* bindEvents: {
|
29
|
-
* displaying: 'add remove reset change:active',
|
30
|
-
* allScreens: 'change:loading',
|
31
|
-
* },
|
32
|
-
*/
|
33
|
-
renderScreen(screen) {
|
34
|
-
return (
|
35
|
-
<div
|
36
|
-
key={screen.id}
|
37
|
-
className={_.classnames('screen', { active: screen.active })}
|
38
|
-
>
|
39
|
-
<Screen screen={screen} />
|
40
|
-
</div>
|
41
|
-
);
|
42
|
-
}
|
43
|
-
|
44
|
-
renderLoading() {
|
45
|
-
const screen = Hippo.Screens.Definitions.all.findWhere({ loading: true });
|
46
|
-
return (
|
47
|
-
<LC.NetworkActivityOverlay visible message={`Loading ${screen.title}…`} />
|
48
|
-
);
|
49
|
-
}
|
50
|
-
|
51
|
-
BaseView() {
|
52
|
-
const Base = __guardMethod__(Hippo.Extensions.controlling(), 'initialScreen', o => o.initialScreen()) || Hippo.Workspace.FirstRun;
|
53
|
-
return (
|
54
|
-
<div className="screen active base">
|
55
|
-
<Base />
|
56
|
-
</div>
|
57
|
-
);
|
58
|
-
}
|
59
|
-
|
60
|
-
render() {
|
61
|
-
const child = this.displaying.isEmpty() ? React.createElement(this.BaseView, null) : this.displaying.map(this.renderScreen);
|
62
|
-
return (
|
63
|
-
<div className={`page-content ${this.context.uistate.layout_size}`}>
|
64
|
-
{this.allScreens.isLoading() ? this.renderLoading() : undefined}
|
65
|
-
{child}
|
66
|
-
</div>
|
67
|
-
);
|
68
|
-
}
|
69
|
-
}
|
70
|
-
|
71
|
-
/*
|
72
|
-
* function __guardMethod__(obj, methodName, transform) {
|
73
|
-
* if (typeof obj !== 'undefined' && obj !== null && typeof obj[methodName] === 'function') {
|
74
|
-
* return (
|
75
|
-
* transform(obj, methodName)
|
76
|
-
* );
|
77
|
-
* } else {
|
78
|
-
* return (
|
79
|
-
* undefined
|
80
|
-
* );
|
81
|
-
* }
|
82
|
-
* }*/
|
@@ -1,127 +0,0 @@
|
|
1
|
-
// Jest Snapshot v1, https://goo.gl/fbAQLP
|
2
|
-
|
3
|
-
exports[`Workspace Navbar renders a tab 1`] = `
|
4
|
-
<li
|
5
|
-
className="grommetux-tab"
|
6
|
-
id={undefined}
|
7
|
-
>
|
8
|
-
<button
|
9
|
-
aria-expanded={undefined}
|
10
|
-
aria-label={undefined}
|
11
|
-
aria-selected={undefined}
|
12
|
-
className="grommetux-button grommetux-button--plain grommetux-tab__button"
|
13
|
-
disabled={false}
|
14
|
-
href={undefined}
|
15
|
-
onBlur={[Function]}
|
16
|
-
onClick={[Function]}
|
17
|
-
onFocus={[Function]}
|
18
|
-
onMouseDown={[Function]}
|
19
|
-
onMouseUp={[Function]}
|
20
|
-
role="tab"
|
21
|
-
type="button"
|
22
|
-
>
|
23
|
-
<label
|
24
|
-
className="grommetux-tab__label"
|
25
|
-
htmlFor={undefined}
|
26
|
-
>
|
27
|
-
title
|
28
|
-
</label>
|
29
|
-
</button>
|
30
|
-
</li>
|
31
|
-
`;
|
32
|
-
|
33
|
-
exports[`Workspace Navbar renders and adds/removes tabs 1`] = `
|
34
|
-
<div
|
35
|
-
role="tablist"
|
36
|
-
>
|
37
|
-
<ul
|
38
|
-
className="grommetux-tabs grommetux-tabs--justify-start grommetux-tabs--responsive"
|
39
|
-
>
|
40
|
-
<li
|
41
|
-
className="grommetux-tab"
|
42
|
-
id={undefined}
|
43
|
-
>
|
44
|
-
<button
|
45
|
-
aria-expanded={undefined}
|
46
|
-
aria-label={undefined}
|
47
|
-
aria-selected={undefined}
|
48
|
-
className="grommetux-button grommetux-button--plain grommetux-tab__button"
|
49
|
-
disabled={false}
|
50
|
-
href={undefined}
|
51
|
-
onBlur={[Function]}
|
52
|
-
onClick={[Function]}
|
53
|
-
onFocus={[Function]}
|
54
|
-
onMouseDown={[Function]}
|
55
|
-
onMouseUp={[Function]}
|
56
|
-
role="tab"
|
57
|
-
type="button"
|
58
|
-
>
|
59
|
-
<label
|
60
|
-
className="grommetux-tab__label"
|
61
|
-
htmlFor={undefined}
|
62
|
-
>
|
63
|
-
title
|
64
|
-
</label>
|
65
|
-
</button>
|
66
|
-
</li>
|
67
|
-
<li
|
68
|
-
className="grommetux-tab"
|
69
|
-
id={undefined}
|
70
|
-
>
|
71
|
-
<button
|
72
|
-
aria-expanded={undefined}
|
73
|
-
aria-label={undefined}
|
74
|
-
aria-selected={undefined}
|
75
|
-
className="grommetux-button grommetux-button--plain grommetux-tab__button"
|
76
|
-
disabled={false}
|
77
|
-
href={undefined}
|
78
|
-
onBlur={[Function]}
|
79
|
-
onClick={[Function]}
|
80
|
-
onFocus={[Function]}
|
81
|
-
onMouseDown={[Function]}
|
82
|
-
onMouseUp={[Function]}
|
83
|
-
role="tab"
|
84
|
-
type="button"
|
85
|
-
>
|
86
|
-
<label
|
87
|
-
className="grommetux-tab__label"
|
88
|
-
htmlFor={undefined}
|
89
|
-
>
|
90
|
-
title
|
91
|
-
</label>
|
92
|
-
</button>
|
93
|
-
</li>
|
94
|
-
<li
|
95
|
-
className="grommetux-tab"
|
96
|
-
id={undefined}
|
97
|
-
>
|
98
|
-
<button
|
99
|
-
aria-expanded={undefined}
|
100
|
-
aria-label={undefined}
|
101
|
-
aria-selected={undefined}
|
102
|
-
className="grommetux-button grommetux-button--plain grommetux-tab__button"
|
103
|
-
disabled={false}
|
104
|
-
href={undefined}
|
105
|
-
onBlur={[Function]}
|
106
|
-
onClick={[Function]}
|
107
|
-
onFocus={[Function]}
|
108
|
-
onMouseDown={[Function]}
|
109
|
-
onMouseUp={[Function]}
|
110
|
-
role="tab"
|
111
|
-
type="button"
|
112
|
-
>
|
113
|
-
<label
|
114
|
-
className="grommetux-tab__label"
|
115
|
-
htmlFor={undefined}
|
116
|
-
>
|
117
|
-
title
|
118
|
-
</label>
|
119
|
-
</button>
|
120
|
-
</li>
|
121
|
-
</ul>
|
122
|
-
<div
|
123
|
-
aria-label="Tab Contents"
|
124
|
-
role="tabpanel"
|
125
|
-
/>
|
126
|
-
</div>
|
127
|
-
`;
|
@@ -1,36 +0,0 @@
|
|
1
|
-
import React from 'react';
|
2
|
-
import { each, range } from 'lodash';
|
3
|
-
|
4
|
-
import Tabs, { ScreenTab } from 'hippo/workspace/tabs';
|
5
|
-
import Instance from 'hippo/screens/instance';
|
6
|
-
|
7
|
-
import { getTestScreen } from '../test-models';
|
8
|
-
import { Context, Snapshot } from 'hippo/testing/screens';
|
9
|
-
|
10
|
-
const addTab = () =>
|
11
|
-
new Instance({ definition: getTestScreen() });
|
12
|
-
|
13
|
-
describe('Workspace Navbar', () => {
|
14
|
-
beforeEach(() => {
|
15
|
-
each(range(0, 3), addTab);
|
16
|
-
});
|
17
|
-
|
18
|
-
it('renders and adds/removes tabs', () => {
|
19
|
-
const options = new Context();
|
20
|
-
const tabs = shallow(<Tabs />, options);
|
21
|
-
expect(tabs.find('ScreenTab').length).toEqual(3);
|
22
|
-
addTab();
|
23
|
-
expect(tabs.find('ScreenTab').length).toEqual(4);
|
24
|
-
Instance.displaying[2].remove();
|
25
|
-
expect(tabs.find('ScreenTab').length).toEqual(3);
|
26
|
-
expect(Snapshot(<Tabs />)).toMatchSnapshot();
|
27
|
-
});
|
28
|
-
|
29
|
-
it('renders a tab', () => {
|
30
|
-
const options = new Context();
|
31
|
-
const screen = Instance.displaying[2];
|
32
|
-
const tab = shallow(<ScreenTab screen={screen} />, options);
|
33
|
-
expect(tab).toHaveRendered(`Tab[title="${screen.title}"]`);
|
34
|
-
expect(Snapshot(<ScreenTab screen={Instance.displaying[2]} />)).toMatchSnapshot();
|
35
|
-
});
|
36
|
-
});
|