hippo-fw 0.9.4 → 0.9.5

Sign up to get free protection for your applications and to get access to all the features.
Files changed (107) hide show
  1. checksums.yaml +4 -4
  2. data/.gitignore +1 -0
  3. data/.travis.yml +2 -3
  4. data/Gemfile +1 -1
  5. data/client/hippo/__mocks__/config.js +4 -4
  6. data/client/hippo/boot.jsx +1 -0
  7. data/client/hippo/components/asset.jsx +4 -4
  8. data/client/hippo/components/date-time.jsx +169 -0
  9. data/client/hippo/components/date-time.scss +38 -0
  10. data/client/hippo/components/date-time/calendar.jsx +115 -0
  11. data/client/hippo/components/date-time/date-time-drop.jsx +77 -0
  12. data/client/hippo/components/date-time/date-time.scss +157 -0
  13. data/client/hippo/components/date-time/time.jsx +120 -0
  14. data/client/hippo/components/form/fields/date-wrapper.jsx +4 -3
  15. data/client/hippo/components/form/model.js +0 -2
  16. data/client/hippo/components/text-editor.jsx +85 -0
  17. data/client/hippo/components/text-editor/display-modes/Button.jsx +17 -0
  18. data/client/hippo/components/text-editor/display-modes/SaveState.jsx +17 -0
  19. data/client/hippo/components/text-editor/display-modes/ToggleEdit.jsx +22 -0
  20. data/client/hippo/components/text-editor/display-modes/ToggleInsert.jsx +21 -0
  21. data/client/hippo/components/text-editor/display-modes/ToggleLayout.jsx +21 -0
  22. data/client/hippo/components/text-editor/display-modes/TogglePreview.jsx +21 -0
  23. data/client/hippo/components/text-editor/display-modes/ToggleResize.jsx +21 -0
  24. data/client/hippo/components/text-editor/display-modes/index.css +0 -0
  25. data/client/hippo/components/text-editor/display-modes/index.js +30 -0
  26. data/client/hippo/components/text-editor/image-plugin/Component/Display/index.js +80 -0
  27. data/client/hippo/components/text-editor/image-plugin/Component/Form/index.js +40 -0
  28. data/client/hippo/components/text-editor/image-plugin/Component/index.js +16 -0
  29. data/client/hippo/components/text-editor/image-plugin/Component/index.scss +0 -0
  30. data/client/hippo/components/text-editor/image-plugin/index.js +32 -0
  31. data/client/hippo/components/text-editor/image-plugin/index.scss +25 -0
  32. data/client/hippo/components/text-editor/plugins.js +22 -0
  33. data/client/hippo/components/text-editor/renderer.jsx +37 -0
  34. data/client/hippo/components/text-editor/text-editor.scss +49 -0
  35. data/client/hippo/extensions/base.js +5 -2
  36. data/client/hippo/extensions/hippo.js +5 -2
  37. data/client/hippo/extensions/index.js +9 -3
  38. data/client/hippo/lib/__mocks__/request-assets.js +2 -2
  39. data/client/hippo/lib/bootstrap.js +0 -1
  40. data/client/hippo/lib/smooth-scroll.js +0 -1
  41. data/client/hippo/lib/util.js +4 -4
  42. data/client/hippo/models/asset.js +43 -23
  43. data/client/hippo/models/base.js +1 -2
  44. data/client/hippo/models/config.js +0 -1
  45. data/client/hippo/models/decorators.js +3 -3
  46. data/client/hippo/models/pub_sub.js +2 -5
  47. data/client/hippo/models/pub_sub/channel.js +0 -1
  48. data/client/hippo/models/query.js +0 -1
  49. data/client/hippo/models/query/array-result.js +0 -1
  50. data/client/hippo/models/query/clause.js +0 -1
  51. data/client/hippo/models/query/field.js +0 -1
  52. data/client/hippo/models/query/info.js +0 -3
  53. data/client/hippo/models/query/operator.js +0 -2
  54. data/client/hippo/models/query/result.js +0 -1
  55. data/client/hippo/models/sync.js +1 -1
  56. data/client/hippo/models/system-setting.js +0 -2
  57. data/client/hippo/models/tenant.js +0 -1
  58. data/client/hippo/screens/definition.js +0 -2
  59. data/client/hippo/screens/group.js +0 -2
  60. data/client/hippo/screens/instance.js +0 -3
  61. data/client/hippo/screens/system-settings/mailer-config.jsx +0 -3
  62. data/client/hippo/styles/global.scss +3 -0
  63. data/client/hippo/testing/mocks/fetch.js +6 -6
  64. data/client/hippo/user.js +4 -4
  65. data/client/hippo/workspace/index.jsx +12 -5
  66. data/client/hippo/workspace/root-view.jsx +10 -0
  67. data/command-reference-files/initial/.gitignore +1 -0
  68. data/command-reference-files/initial/Gemfile +1 -1
  69. data/command-reference-files/initial/client/appy-app/extension.js +4 -0
  70. data/command-reference-files/initial/config/webpack.config.js +25 -23
  71. data/config/routes.rb +4 -1
  72. data/config/webpack.config.js +1 -2
  73. data/hippo-fw.gemspec +4 -2
  74. data/lib/hippo.rb +0 -1
  75. data/lib/hippo/api/handlers/asset.rb +9 -0
  76. data/lib/hippo/api/updates.rb +2 -2
  77. data/lib/hippo/configuration.rb +0 -4
  78. data/lib/hippo/db.rb +2 -2
  79. data/lib/hippo/{rails.rb → db/fake_rails.rb} +0 -0
  80. data/lib/hippo/extension.rb +1 -2
  81. data/lib/hippo/mailer.rb +1 -0
  82. data/lib/hippo/spec_helper.rb +1 -0
  83. data/lib/hippo/version.rb +1 -1
  84. data/package-lock.json +626 -68
  85. data/package.json +14 -13
  86. data/spec/client/access/login-dialog.spec.jsx +1 -0
  87. data/spec/client/components/asset.spec.jsx +1 -2
  88. data/spec/client/components/date-time.spec.jsx +20 -0
  89. data/spec/client/extension/base.spec.js +0 -2
  90. data/spec/client/models/base.spec.js +4 -4
  91. data/spec/client/models/query.spec.js +2 -2
  92. data/spec/client/models/sync.spec.js +1 -1
  93. data/spec/client/screens/system-settings.spec.jsx +2 -1
  94. data/spec/client/setup.js +3 -0
  95. data/spec/client/test-models.js +0 -2
  96. data/spec/server/api/tenant_change_spec.rb +1 -1
  97. data/spec/server/api/tenant_isolation_spec.rb +6 -3
  98. data/spec/server/concerns/api_path_spec.rb +2 -2
  99. data/templates/.gitignore +1 -0
  100. data/templates/client/extension.js +4 -0
  101. data/templates/config/webpack.config.js +25 -23
  102. metadata +48 -12
  103. data/client/hippo/lib/pub_sub.js +0 -34
  104. data/client/hippo/react/viewport-root.jsx +0 -44
  105. data/spec/client/components/__snapshots__/asset.spec.jsx.snap +0 -48
  106. data/spec/client/screens/__snapshots__/system-settings.spec.jsx.snap +0 -443
  107. data/templates/gitignore +0 -4
@@ -1,34 +0,0 @@
1
- import Cable from 'es6-actioncable';
2
-
3
- import Config from '../config';
4
-
5
- const INSTANCE = null;
6
-
7
- export default class Websocket {
8
- static initialize() {
9
- const INSTANCE = new Websocket()
10
- INSTANCE.connect();
11
- }
12
-
13
- connect() {
14
- console.log('connecting websocket');
15
-
16
- this.consumer = Cable.createConsumer(
17
- `${Config.api_host}${Config.api_path}/cable?token=${Config.access_token}`
18
- );
19
- }
20
-
21
- getConsumer() {
22
- if(!this.consumer) {
23
- this.connect();
24
- }
25
- return this.consumer;
26
- }
27
-
28
- closeConnection() {
29
- if(this.consumer) {
30
- Cable.endConsumer(this.consumer);
31
- }
32
- delete this.consumer;
33
- }
34
- }
@@ -1,44 +0,0 @@
1
- import React from 'react';
2
- import ReactDom from 'react-dom';
3
- import { AppContainer } from 'react-hot-loader';
4
- /* import {
5
- * BrowserRouter as Router,
6
- * Route,
7
- * Link
8
- * } from 'react-router-dom'*/
9
-
10
- // import { Router, Route, match, RouterContext, browserHistory } from 'react-router';
11
-
12
- //import createHistory from 'history/createBrowserHistory';
13
-
14
- /* function NoMatch() {
15
- * return (
16
- * <h1>Not Found</h1>
17
- * );
18
- * }*/
19
-
20
- import Workspace from '../workspace';
21
-
22
- //export default function ViewportRoot(dom){
23
- document.getElementById('root')
24
- function renderer(S) {
25
- ReactDom.render(
26
-
27
- <AppContainer>
28
- <S />
29
- </AppContainer>
30
-
31
- , dom,
32
- );
33
- }
34
-
35
- renderer(Workspace);
36
-
37
- if (module.hot) {
38
- module.hot.accept('hippo/workspace', () => {
39
- console.log("RELOADED", arguments)
40
- renderer(WP)
41
- });
42
- }
43
-
44
- //}
@@ -1,48 +0,0 @@
1
- // Jest Snapshot v1, https://goo.gl/fbAQLP
2
-
3
- exports[`Asset Component renders and matches snapshot 1`] = `
4
- <div
5
- className="asset form-field"
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
- Asset
16
- </label>
17
- <span
18
- className="grommetux-form-field__contents"
19
- >
20
- <div
21
- className="drop-zone"
22
- onClick={[Function]}
23
- onDragEnter={[Function]}
24
- onDragLeave={[Function]}
25
- onDragOver={[Function]}
26
- onDragStart={[Function]}
27
- onDrop={[Function]}
28
- style={Object {}}
29
- >
30
- <div>
31
- Drop a file here, or click to select one to upload.
32
- </div>
33
- <input
34
- accept={undefined}
35
- multiple={false}
36
- onChange={[Function]}
37
- style={
38
- Object {
39
- "display": "none",
40
- }
41
- }
42
- type="file"
43
- />
44
- </div>
45
- </span>
46
- </div>
47
- </div>
48
- `;
@@ -1,443 +0,0 @@
1
- // Jest Snapshot v1, https://goo.gl/fbAQLP
2
-
3
- exports[`SystemSettings Screen renders 1`] = `
4
- <div
5
- className="screen is-active"
6
- data-screen-id="test"
7
- >
8
- <div
9
- className="grommetux-header__container grommetux-header__container--fixed grommetux-header__container--fill"
10
- >
11
- <div
12
- className="grommetux-header__mirror"
13
- />
14
- <div
15
- className="grommetux-header__wrapper"
16
- >
17
- <div
18
- className="grommetux-box grommetux-box--direction-column grommetux-box--responsive grommetux-box--pad-none grommetux-box--flex-off"
19
- id={undefined}
20
- onClick={undefined}
21
- role={undefined}
22
- style={Object {}}
23
- tabIndex={undefined}
24
- >
25
- <header
26
- className="grommetux-box grommetux-box--direction-row grommetux-box--align-center grommetux-box--pad-horizontal-none grommetux-box--pad-vertical-none grommetux-box--pad-between-small grommetux-header"
27
- id={undefined}
28
- onClick={undefined}
29
- role={undefined}
30
- style={Object {}}
31
- tabIndex={undefined}
32
- >
33
- <button
34
- aria-label={undefined}
35
- className="grommetux-button grommetux-button--primary"
36
- disabled={false}
37
- href={undefined}
38
- onBlur={[Function]}
39
- onClick={[Function]}
40
- onFocus={[Function]}
41
- onMouseDown={[Function]}
42
- onMouseUp={[Function]}
43
- type="button"
44
- >
45
- <span
46
- className="grommetux-button__icon"
47
- >
48
- <svg
49
- aria-label="save"
50
- className="grommetux-control-icon grommetux-control-icon-save grommetux-control-icon--responsive"
51
- height="24px"
52
- role="img"
53
- version="1.1"
54
- viewBox="0 0 24 24"
55
- width="24px"
56
- >
57
- <path
58
- d="M3,2 L3,21 L21,21 L21,3 L12,3 L12,14 M8,11 L12,15 L16,11"
59
- fill="none"
60
- stroke="#000"
61
- strokeWidth="2"
62
- />
63
- </svg>
64
- </span>
65
- <span
66
- className="grommetux-button__label"
67
- >
68
- Save
69
- </span>
70
- </button>
71
- </header>
72
- </div>
73
- </div>
74
- </div>
75
- <h1
76
- className="grommetux-heading"
77
- >
78
- title
79
- </h1>
80
- <div
81
- className="tenant-edit-form"
82
- >
83
- <h3
84
- className="grommetux-heading"
85
- >
86
- Account
87
- </h3>
88
- <div
89
- className="row"
90
- >
91
- <div
92
- className="form-field col-md-4 col-xs-6"
93
- >
94
- <div
95
- className="grommetux-form-field grommetux-form-field--size-medium"
96
- onClick={[Function]}
97
- >
98
- <label
99
- className="grommetux-form-field__label"
100
- htmlFor={undefined}
101
- >
102
- Identifier
103
- </label>
104
- <span
105
- className="grommetux-form-field__contents"
106
- >
107
- <input
108
- autoComplete="off"
109
- autoFocus={undefined}
110
- className="grommetux-text-input grommetux-input"
111
- defaultValue={undefined}
112
- name="slug"
113
- onBlur={[Function]}
114
- onChange={[Function]}
115
- onFocus={[Function]}
116
- onKeyDown={[Function]}
117
- placeholder={undefined}
118
- type="text"
119
- value=""
120
- />
121
- </span>
122
- </div>
123
- </div>
124
- <div
125
- className="form-field col-md-4 col-xs-6"
126
- >
127
- <div
128
- className="grommetux-form-field grommetux-form-field--size-medium"
129
- onClick={[Function]}
130
- >
131
- <label
132
- className="grommetux-form-field__label"
133
- htmlFor={undefined}
134
- >
135
- Name
136
- </label>
137
- <span
138
- className="grommetux-form-field__contents"
139
- >
140
- <input
141
- autoComplete="off"
142
- autoFocus={undefined}
143
- className="grommetux-text-input grommetux-input"
144
- defaultValue={undefined}
145
- name="name"
146
- onBlur={[Function]}
147
- onChange={[Function]}
148
- onFocus={[Function]}
149
- onKeyDown={[Function]}
150
- placeholder={undefined}
151
- type="text"
152
- value=""
153
- />
154
- </span>
155
- </div>
156
- </div>
157
- </div>
158
- </div>
159
- <h3
160
- className="grommetux-heading"
161
- >
162
- Images
163
- </h3>
164
- <div
165
- className="row"
166
- >
167
- <div
168
- className="col-sm-4 col-xs-12"
169
- >
170
- <div
171
- className="asset form-field"
172
- >
173
- <div
174
- className="grommetux-form-field grommetux-form-field--size-medium"
175
- onClick={[Function]}
176
- >
177
- <label
178
- className="grommetux-form-field__label"
179
- htmlFor={undefined}
180
- >
181
- Logo
182
- </label>
183
- <span
184
- className="grommetux-form-field__contents"
185
- >
186
- <div
187
- className="drop-zone"
188
- onClick={[Function]}
189
- onDragEnter={[Function]}
190
- onDragLeave={[Function]}
191
- onDragOver={[Function]}
192
- onDragStart={[Function]}
193
- onDrop={[Function]}
194
- style={Object {}}
195
- >
196
- <div>
197
- Drop a file here, or click to select one to upload.
198
- </div>
199
- <input
200
- accept={undefined}
201
- multiple={false}
202
- onChange={[Function]}
203
- style={
204
- Object {
205
- "display": "none",
206
- }
207
- }
208
- type="file"
209
- />
210
- </div>
211
- </span>
212
- </div>
213
- </div>
214
- </div>
215
- <div
216
- className="col-sm-4 col-xs-12"
217
- >
218
- <div
219
- className="asset form-field"
220
- >
221
- <div
222
- className="grommetux-form-field grommetux-form-field--size-medium"
223
- onClick={[Function]}
224
- >
225
- <label
226
- className="grommetux-form-field__label"
227
- htmlFor={undefined}
228
- >
229
- Print Logo
230
- </label>
231
- <span
232
- className="grommetux-form-field__contents"
233
- >
234
- <div
235
- className="drop-zone"
236
- onClick={[Function]}
237
- onDragEnter={[Function]}
238
- onDragLeave={[Function]}
239
- onDragOver={[Function]}
240
- onDragStart={[Function]}
241
- onDrop={[Function]}
242
- style={Object {}}
243
- >
244
- <div>
245
- Drop a file here, or click to select one to upload.
246
- </div>
247
- <input
248
- accept={undefined}
249
- multiple={false}
250
- onChange={[Function]}
251
- style={
252
- Object {
253
- "display": "none",
254
- }
255
- }
256
- type="file"
257
- />
258
- </div>
259
- </span>
260
- </div>
261
- </div>
262
- </div>
263
- </div>
264
- <div
265
- className="section"
266
- >
267
- <h3
268
- className="grommetux-heading"
269
- >
270
- Email settings
271
- </h3>
272
- <div
273
- className="section row"
274
- >
275
- <div
276
- className="form-field col-md-4 col-xs-6"
277
- >
278
- <div
279
- className="grommetux-form-field grommetux-form-field--size-medium"
280
- onClick={[Function]}
281
- >
282
- <label
283
- className="grommetux-form-field__label"
284
- htmlFor={undefined}
285
- >
286
- User Name
287
- </label>
288
- <span
289
- className="grommetux-form-field__contents"
290
- >
291
- <input
292
- autoComplete="off"
293
- autoFocus={undefined}
294
- className="grommetux-text-input grommetux-input"
295
- defaultValue={undefined}
296
- name="user_name"
297
- onBlur={[Function]}
298
- onChange={[Function]}
299
- onFocus={[Function]}
300
- onKeyDown={[Function]}
301
- placeholder={undefined}
302
- type="text"
303
- value=""
304
- />
305
- </span>
306
- </div>
307
- </div>
308
- <div
309
- className="form-field col-md-4 col-xs-6"
310
- >
311
- <div
312
- className="grommetux-form-field grommetux-form-field--size-medium"
313
- onClick={[Function]}
314
- >
315
- <label
316
- className="grommetux-form-field__label"
317
- htmlFor={undefined}
318
- >
319
- Password
320
- </label>
321
- <span
322
- className="grommetux-form-field__contents"
323
- >
324
- <input
325
- autoComplete="off"
326
- autoFocus={undefined}
327
- className="grommetux-text-input grommetux-input"
328
- defaultValue={undefined}
329
- name="password"
330
- onBlur={[Function]}
331
- onChange={[Function]}
332
- onFocus={[Function]}
333
- onKeyDown={[Function]}
334
- placeholder={undefined}
335
- type="password"
336
- value=""
337
- />
338
- </span>
339
- </div>
340
- </div>
341
- <div
342
- className="form-field col-md-4 col-xs-6"
343
- >
344
- <div
345
- className="grommetux-form-field grommetux-form-field--size-medium"
346
- onClick={[Function]}
347
- >
348
- <label
349
- className="grommetux-form-field__label"
350
- htmlFor={undefined}
351
- >
352
- Server Address
353
- </label>
354
- <span
355
- className="grommetux-form-field__contents"
356
- >
357
- <input
358
- autoComplete="off"
359
- autoFocus={undefined}
360
- className="grommetux-text-input grommetux-input"
361
- defaultValue={undefined}
362
- name="address"
363
- onBlur={[Function]}
364
- onChange={[Function]}
365
- onFocus={[Function]}
366
- onKeyDown={[Function]}
367
- placeholder={undefined}
368
- type="text"
369
- value=""
370
- />
371
- </span>
372
- </div>
373
- </div>
374
- <div
375
- className="form-field col-md-4 col-xs-6"
376
- >
377
- <div
378
- className="grommetux-form-field grommetux-form-field--size-medium"
379
- onClick={[Function]}
380
- >
381
- <label
382
- className="grommetux-form-field__label"
383
- htmlFor={undefined}
384
- >
385
- From Email
386
- </label>
387
- <span
388
- className="grommetux-form-field__contents"
389
- >
390
- <input
391
- autoComplete="off"
392
- autoFocus={undefined}
393
- className="grommetux-text-input grommetux-input"
394
- defaultValue={undefined}
395
- name="from_email"
396
- onBlur={[Function]}
397
- onChange={[Function]}
398
- onFocus={[Function]}
399
- onKeyDown={[Function]}
400
- placeholder={undefined}
401
- type="text"
402
- value=""
403
- />
404
- </span>
405
- </div>
406
- </div>
407
- <div
408
- className="form-field col-md-4 col-xs-6"
409
- >
410
- <div
411
- className="grommetux-form-field grommetux-form-field--size-medium"
412
- onClick={[Function]}
413
- >
414
- <label
415
- className="grommetux-form-field__label"
416
- htmlFor={undefined}
417
- >
418
- From Name
419
- </label>
420
- <span
421
- className="grommetux-form-field__contents"
422
- >
423
- <input
424
- autoComplete="off"
425
- autoFocus={undefined}
426
- className="grommetux-text-input grommetux-input"
427
- defaultValue={undefined}
428
- name="from_name"
429
- onBlur={[Function]}
430
- onChange={[Function]}
431
- onFocus={[Function]}
432
- onKeyDown={[Function]}
433
- placeholder={undefined}
434
- type="text"
435
- value=""
436
- />
437
- </span>
438
- </div>
439
- </div>
440
- </div>
441
- </div>
442
- </div>
443
- `;