hippo-fw 0.9.8 → 0.9.9

Sign up to get free protection for your applications and to get access to all the features.
Files changed (167) hide show
  1. checksums.yaml +4 -4
  2. data/client/hippo/access/subscription-choice-layer.jsx +170 -0
  3. data/client/hippo/access/subscription-choice-layer/cancel-subscription.jsx +111 -0
  4. data/client/hippo/access/subscription-choice-layer/payment-form.jsx +154 -0
  5. data/client/hippo/access/subscription-choice-layer/subscription-choice.scss +29 -0
  6. data/client/hippo/boot.jsx +1 -1
  7. data/client/hippo/components/asset.jsx +1 -1
  8. data/client/hippo/components/asset.scss +1 -0
  9. data/client/hippo/components/data-table.jsx +36 -38
  10. data/client/hippo/components/date-time.jsx +25 -9
  11. data/client/hippo/components/form/api.js +1 -0
  12. data/client/hippo/components/form/fields.jsx +3 -2
  13. data/client/hippo/components/form/fields/checkbox-wrapper.jsx +1 -1
  14. data/client/hippo/components/form/fields/date-wrapper.jsx +1 -1
  15. data/client/hippo/components/form/fields/email-wrapper.jsx +31 -0
  16. data/client/hippo/components/form/fields/form-field.scss +8 -0
  17. data/client/hippo/components/form/fields/label.jsx +5 -7
  18. data/client/hippo/components/form/fields/select-wrapper.jsx +1 -1
  19. data/client/hippo/components/form/fields/tags-wrapper.jsx +1 -1
  20. data/client/hippo/components/form/fields/text-wrapper.jsx +1 -1
  21. data/client/hippo/components/form/fields/textarea-wrapper.jsx +1 -1
  22. data/client/hippo/components/form/wrapper.jsx +1 -1
  23. data/client/hippo/components/grid.js +1 -0
  24. data/client/hippo/components/master-detail.jsx +1 -1
  25. data/client/hippo/components/network-activity-overlay.jsx +6 -6
  26. data/client/hippo/components/payments/field.jsx +64 -0
  27. data/client/hippo/components/payments/field.scss +18 -0
  28. data/client/hippo/components/popout-window.jsx +1 -1
  29. data/client/hippo/components/query-builder.jsx +1 -1
  30. data/client/hippo/components/query-builder/boolean-picker.jsx +1 -1
  31. data/client/hippo/components/query-builder/clause-filter.jsx +2 -2
  32. data/client/hippo/components/query-builder/clause.jsx +16 -10
  33. data/client/hippo/components/query-builder/date-picker.jsx +1 -1
  34. data/client/hippo/components/query-builder/query-builder.scss +23 -2
  35. data/client/hippo/components/record-finder.jsx +5 -2
  36. data/client/hippo/components/record-finder/query-layer.jsx +1 -1
  37. data/client/hippo/components/save-button.jsx +1 -1
  38. data/client/hippo/components/screen.jsx +1 -1
  39. data/client/hippo/components/text-editor.jsx +82 -40
  40. data/client/hippo/components/text-editor/renderer.jsx +15 -35
  41. data/client/hippo/components/text-editor/renderer.scss +15 -0
  42. data/client/hippo/components/text-editor/text-editor.scss +2 -15
  43. data/client/hippo/components/text-editor/upload-adapter.js +66 -0
  44. data/client/hippo/components/time-zone-select.jsx +1 -1
  45. data/client/hippo/components/tool-tip.jsx +9 -14
  46. data/client/hippo/components/toolbar.jsx +16 -0
  47. data/client/hippo/components/warning-notification.jsx +1 -1
  48. data/client/hippo/extensions/base.js +3 -2
  49. data/client/hippo/extensions/index.js +1 -1
  50. data/client/hippo/lib/action_cable.js +8 -0
  51. data/client/hippo/lib/action_cable/cable.js +47 -0
  52. data/client/hippo/lib/action_cable/connection.js +192 -0
  53. data/client/hippo/lib/action_cable/connection_monitor.js +135 -0
  54. data/client/hippo/lib/action_cable/consumer.js +56 -0
  55. data/client/hippo/lib/action_cable/subscription.js +98 -0
  56. data/client/hippo/lib/action_cable/subscriptions.js +129 -0
  57. data/client/hippo/lib/date-range.js +22 -5
  58. data/client/hippo/lib/lazy-getter.js +31 -0
  59. data/client/hippo/lib/util.js +6 -1
  60. data/client/hippo/models/base.js +8 -3
  61. data/client/hippo/models/config.js +7 -2
  62. data/client/hippo/models/date-type.js +14 -0
  63. data/client/hippo/models/decorators.js +5 -5
  64. data/client/hippo/models/pub_sub.js +1 -1
  65. data/client/hippo/models/query/array-result.js +4 -1
  66. data/client/hippo/models/subscription.js +35 -0
  67. data/client/hippo/models/sync.js +1 -1
  68. data/client/hippo/models/tenant.js +14 -1
  69. data/client/hippo/react/component-not-found.jsx +14 -18
  70. data/client/hippo/screens/async-loading.jsx +46 -0
  71. data/client/hippo/screens/definition.js +2 -1
  72. data/client/hippo/screens/preferences.jsx +57 -0
  73. data/client/hippo/screens/system-settings.jsx +4 -6
  74. data/client/hippo/screens/system-settings/mailer-config.jsx +1 -1
  75. data/client/hippo/screens/system-settings/tenant.jsx +57 -4
  76. data/client/hippo/screens/user-management.jsx +2 -2
  77. data/client/hippo/screens/user-management/edit-form.jsx +1 -1
  78. data/client/hippo/styles/global/fancy-header.scss +2 -1
  79. data/client/hippo/styles/global/mixins.scss +14 -1
  80. data/client/hippo/testing/index.js +7 -0
  81. data/client/hippo/user.js +9 -2
  82. data/client/hippo/workspace/index.jsx +29 -8
  83. data/client/hippo/workspace/menu-group.jsx +1 -1
  84. data/client/hippo/workspace/menu-option.jsx +2 -0
  85. data/client/hippo/workspace/menu.jsx +30 -6
  86. data/client/hippo/workspace/screen.jsx +5 -1
  87. data/client/hippo/workspace/styles.scss +22 -3
  88. data/command-reference-files/initial/Gemfile +1 -1
  89. data/config/routes.rb +6 -0
  90. data/config/screens.rb +9 -17
  91. data/db/migrate/20171129024737_create_subscriptions.rb +12 -0
  92. data/fixtures/vcr_cassettes/Tenant_changes/sends_email_when_tenant_identifier_changes.yml +72 -0
  93. data/fixtures/vcr_cassettes/Tenant_isoloation/disallows_using_a_user_s_token_on_incorrect_domain.yml +141 -0
  94. data/fixtures/vcr_cassettes/Tenant_isoloation/isolates_bar_s_tenant_data_from_foo.yml +141 -0
  95. data/fixtures/vcr_cassettes/Tenant_isoloation/isolates_foo_s_tenant_data_from_bar.yml +141 -0
  96. data/hippo-fw.gemspec +4 -3
  97. data/lib/hippo.rb +1 -0
  98. data/lib/hippo/access/roles/basic_user.rb +1 -0
  99. data/lib/hippo/api/authentication_provider.rb +4 -5
  100. data/lib/hippo/api/handlers/asset.rb +9 -4
  101. data/lib/hippo/api/handlers/subscription.rb +39 -0
  102. data/lib/hippo/api/handlers/user_session.rb +0 -1
  103. data/lib/hippo/api/helper_methods.rb +8 -4
  104. data/lib/hippo/api/request_wrapper.rb +12 -1
  105. data/lib/hippo/command/console.rb +3 -3
  106. data/lib/hippo/concerns/asset_uploader.rb +8 -2
  107. data/lib/hippo/concerns/pub_sub.rb +8 -8
  108. data/lib/hippo/configuration.rb +6 -4
  109. data/lib/hippo/extension.rb +3 -2
  110. data/lib/hippo/model.rb +1 -0
  111. data/lib/hippo/models/subscription.rb +7 -0
  112. data/lib/hippo/payments.rb +129 -0
  113. data/lib/hippo/screen.rb +4 -2
  114. data/lib/hippo/screen/definition.rb +4 -0
  115. data/lib/hippo/spec_helper.rb +4 -4
  116. data/lib/hippo/templates/liquid/precision.rb +9 -0
  117. data/lib/hippo/tenant.rb +4 -5
  118. data/lib/hippo/user.rb +5 -5
  119. data/lib/hippo/version.rb +1 -1
  120. data/lib/hippo/webpack.rb +5 -1
  121. data/package-lock.json +437 -881
  122. data/package.json +19 -5
  123. data/spec/client/components/__snapshots__/query-builder.spec.jsx.snap +34 -1
  124. data/spec/client/components/__snapshots__/record-finder.spec.jsx.snap +1 -0
  125. data/spec/client/models/base.spec.js +7 -0
  126. data/spec/client/models/subscription.spec.js +8 -0
  127. data/spec/client/screens/__snapshots__/preferences.spec.jsx.snap +223 -0
  128. data/spec/client/screens/preferences.spec.jsx +10 -0
  129. data/spec/client/test-models.js +1 -1
  130. data/spec/client/workspace/__snapshots__/menu.spec.jsx.snap +12 -0
  131. data/spec/factories/subscription.rb +6 -0
  132. data/spec/factories/tenant.rb +1 -1
  133. data/spec/factories/user.rb +1 -1
  134. data/spec/server/api/tenant_change_spec.rb +11 -8
  135. data/spec/server/api/tenant_isolation_spec.rb +11 -8
  136. data/spec/server/api/user_sessions_spec.rb +10 -7
  137. data/spec/server/api/user_spec.rb +45 -0
  138. data/spec/server/models/subscription_spec.rb +10 -0
  139. data/spec/server/payment_helpers.rb +13 -0
  140. data/spec/server/print/form_spec.rb +1 -1
  141. data/spec/server/spec_helper.rb +3 -11
  142. data/templates/js/screen-definitions.js +4 -1
  143. data/templates/spec/factories/model.rb +1 -1
  144. data/views/hippo_root_view.erb +5 -5
  145. metadata +84 -25
  146. data/client/hippo/components/grid/config.json +0 -3
  147. data/client/hippo/components/grid/editors.scss +0 -78
  148. data/client/hippo/components/grid/index.js +0 -2
  149. data/client/hippo/components/grid/row-editor.scss +0 -74
  150. data/client/hippo/components/grid/styles.scss +0 -118
  151. data/client/hippo/components/text-editor/display-modes/Button.jsx +0 -20
  152. data/client/hippo/components/text-editor/display-modes/ToggleEdit.jsx +0 -23
  153. data/client/hippo/components/text-editor/display-modes/ToggleInsert.jsx +0 -22
  154. data/client/hippo/components/text-editor/display-modes/ToggleLayout.jsx +0 -22
  155. data/client/hippo/components/text-editor/display-modes/TogglePreview.jsx +0 -22
  156. data/client/hippo/components/text-editor/display-modes/ToggleResize.jsx +0 -22
  157. data/client/hippo/components/text-editor/display-modes/index.css +0 -0
  158. data/client/hippo/components/text-editor/display-modes/index.js +0 -30
  159. data/client/hippo/components/text-editor/image-plugin/Component/Display/index.js +0 -82
  160. data/client/hippo/components/text-editor/image-plugin/Component/Form/index.js +0 -42
  161. data/client/hippo/components/text-editor/image-plugin/Component/index.js +0 -16
  162. data/client/hippo/components/text-editor/image-plugin/Component/index.scss +0 -0
  163. data/client/hippo/components/text-editor/image-plugin/index.js +0 -32
  164. data/client/hippo/components/text-editor/image-plugin/index.scss +0 -25
  165. data/client/hippo/components/toolbar/changes-notification.scss +0 -63
  166. data/client/hippo/components/toolbar/index.js +0 -3
  167. data/client/hippo/components/toolbar/styles.scss +0 -74
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "hippo-fw",
3
- "version": "0.9.7",
3
+ "version": "0.9.8",
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,7 +10,20 @@
10
10
  "client"
11
11
  ],
12
12
  "dependencies": {
13
- "actioncable": "^5.1.2",
13
+ "@ckeditor/ckeditor5-autoformat": "^1.0.0-alpha.2",
14
+ "@ckeditor/ckeditor5-basic-styles": "^1.0.0-alpha.2",
15
+ "@ckeditor/ckeditor5-block-quote": "^1.0.0-alpha.2",
16
+ "@ckeditor/ckeditor5-core": "^1.0.0-alpha.2",
17
+ "@ckeditor/ckeditor5-editor-balloon": "^1.0.0-alpha.2",
18
+ "@ckeditor/ckeditor5-editor-classic": "^1.0.0-alpha.2",
19
+ "@ckeditor/ckeditor5-engine": "^1.0.0-alpha.2",
20
+ "@ckeditor/ckeditor5-essentials": "^1.0.0-alpha.2",
21
+ "@ckeditor/ckeditor5-heading": "^1.0.0-alpha.2",
22
+ "@ckeditor/ckeditor5-image": "^1.0.0-alpha.2",
23
+ "@ckeditor/ckeditor5-link": "^1.0.0-alpha.2",
24
+ "@ckeditor/ckeditor5-list": "^1.0.0-alpha.2",
25
+ "@ckeditor/ckeditor5-paragraph": "^1.0.0-alpha.2",
26
+ "@ckeditor/ckeditor5-upload": "^1.0.0-alpha.2",
14
27
  "babel-core": "^6.25.0",
15
28
  "babel-jest": "^20.0.3",
16
29
  "babel-loader": "^7.1.1",
@@ -35,7 +48,7 @@
35
48
  "domtastic": "^0.15.1",
36
49
  "enzyme": "^2.9.1",
37
50
  "eslint": "^4.9.0",
38
- "eslint-config-argosity": "^1.4.1",
51
+ "eslint-config-argosity": "^1.4.2",
39
52
  "file-loader": "^0.11.2",
40
53
  "flatpickr": "^3.0.7",
41
54
  "flexboxgrid": "^6.3.1",
@@ -52,12 +65,13 @@
52
65
  "lodash": "^4.17.4",
53
66
  "loglevel": "^1.4.1",
54
67
  "mobx": "^3.2.1",
55
- "mobx-decorated-models": "^0.7.1",
68
+ "mobx-decorated-models": "^0.8.1",
69
+ "mobx-persist": "^0.3.4",
56
70
  "mobx-react": "^4.2.2",
57
71
  "moment-timezone": "^0.5.13",
58
72
  "node-sass": "^4.5.0",
59
73
  "object-hash": "^1.1.8",
60
- "ory-editor": "^0.2.25",
74
+ "payment-fields": "^0.4.0",
61
75
  "pluralize": "^6.0.0",
62
76
  "prop-types": "^15.5.8",
63
77
  "qs": "^6.5.0",
@@ -5,7 +5,7 @@ exports[`Query Builder Component renders and matches snapshot 1`] = `
5
5
  className="query-builder"
6
6
  >
7
7
  <div
8
- className="grommetux-box grommetux-box--direction-row grommetux-box--align-center grommetux-box--responsive grommetux-box--pad-between-small clause"
8
+ className="grommetux-box grommetux-box--direction-row grommetux-box--align-center grommetux-box--pad-between-small grommetux-box--pad-between-thirds clause"
9
9
  id={undefined}
10
10
  onClick={undefined}
11
11
  role={undefined}
@@ -77,6 +77,39 @@ exports[`Query Builder Component renders and matches snapshot 1`] = `
77
77
  }
78
78
  value=""
79
79
  />
80
+ <button
81
+ aria-label={undefined}
82
+ className="grommetux-button grommetux-button--plain"
83
+ disabled={false}
84
+ href={undefined}
85
+ onBlur={[Function]}
86
+ onClick={[Function]}
87
+ onFocus={[Function]}
88
+ onMouseDown={[Function]}
89
+ onMouseUp={[Function]}
90
+ type="button"
91
+ >
92
+ <span
93
+ className="grommetux-button__icon"
94
+ >
95
+ <svg
96
+ aria-label="refresh"
97
+ className="grommetux-control-icon grommetux-control-icon-refresh grommetux-control-icon--responsive"
98
+ height="24px"
99
+ role="img"
100
+ version="1.1"
101
+ viewBox="0 0 24 24"
102
+ width="24px"
103
+ >
104
+ <path
105
+ d="M20,8 C18.5974037,5.04031171 15.536972,3 12,3 C7.02943725,3 3,7.02943725 3,12 C3,16.9705627 7.02943725,21 12,21 L12,21 C16.9705627,21 21,16.9705627 21,12 M21,3 L21,9 L15,9"
106
+ fill="none"
107
+ stroke="#000"
108
+ strokeWidth="2"
109
+ />
110
+ </svg>
111
+ </span>
112
+ </button>
80
113
  </div>
81
114
  </div>
82
115
  `;
@@ -30,6 +30,7 @@ exports[`RecordFinder Component renders 1`] = `
30
30
  onKeyDown={[Function]}
31
31
  onKeyPress={[Function]}
32
32
  placeholder={undefined}
33
+ readOnly={false}
33
34
  tabIndex={0}
34
35
  type="text"
35
36
  value=""
@@ -1,4 +1,5 @@
1
1
  import { autorun, observe } from 'mobx';
2
+ import moment from 'moment';
2
3
  import { Ship, Container, Box } from '../test-models';
3
4
 
4
5
  describe('BaseModel Test', () => {
@@ -84,4 +85,10 @@ describe('BaseModel Test', () => {
84
85
  box.errors = { foo: 'cannot be blank', baz: 'is very invalid' };
85
86
  expect(box.errorMessage).toEqual('Foo cannot be blank and Baz is very invalid');
86
87
  });
88
+
89
+ it('uses momentjs for dates', () => {
90
+ const ship = Ship.deserialize({ sail_date: '2012-11-14T01:03:42.415Z' });
91
+ expect(moment.isMoment(ship.sail_date)).toBe(true);
92
+ expect(ship.sail_date.toISOString()).toEqual('2012-11-14T01:03:42.415Z');
93
+ });
87
94
  });
@@ -0,0 +1,8 @@
1
+ import Subscription from 'hippo/models/subscription';
2
+
3
+ describe('Model Subscription', () => {
4
+ it('can be instantiated', () => {
5
+ const model = new Subscription();
6
+ expect(model).toBeInstanceOf(Subscription);
7
+ });
8
+ });
@@ -0,0 +1,223 @@
1
+ // Jest Snapshot v1, https://goo.gl/fbAQLP
2
+
3
+ exports[`Screen Preferences renders and matches snapshot 1`] = `
4
+ <div
5
+ className="hippo-screen preferences is-active"
6
+ data-screen-id="preferences"
7
+ >
8
+ <div
9
+ className="grommetux-header__container grommetux-header__container--fixed"
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-small grommetux-box--pad-vertical-small grommetux-box--pad-between-small grommetux-background-color-index-light-2 grommetux-background-color-index--light grommetux-header hippo-toolbar"
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 save-button"
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
+ <h4>
76
+ Account information:
77
+ </h4>
78
+ <div
79
+ className="row"
80
+ >
81
+ <div
82
+ className="form-field text col-xs-6"
83
+ >
84
+ <div
85
+ className="grommetux-form-field grommetux-form-field--size-medium"
86
+ onClick={[Function]}
87
+ >
88
+ <label
89
+ className="grommetux-form-field__label"
90
+ htmlFor={undefined}
91
+ >
92
+ Login
93
+ </label>
94
+ <span
95
+ className="grommetux-form-field__contents"
96
+ >
97
+ <input
98
+ autoComplete="off"
99
+ autoFocus={undefined}
100
+ className="grommetux-text-input grommetux-input"
101
+ defaultValue={undefined}
102
+ name="login"
103
+ onBlur={[Function]}
104
+ onChange={[Function]}
105
+ onFocus={[Function]}
106
+ onInput={[Function]}
107
+ onKeyDown={[Function]}
108
+ placeholder={undefined}
109
+ tabIndex={0}
110
+ type="text"
111
+ value=""
112
+ />
113
+ </span>
114
+ </div>
115
+ </div>
116
+ <div
117
+ className="form-field text col-xs-6"
118
+ >
119
+ <div
120
+ className="grommetux-form-field grommetux-form-field--size-medium"
121
+ onClick={[Function]}
122
+ >
123
+ <label
124
+ className="grommetux-form-field__label"
125
+ htmlFor={undefined}
126
+ >
127
+ Name
128
+ </label>
129
+ <span
130
+ className="grommetux-form-field__contents"
131
+ >
132
+ <input
133
+ autoComplete="off"
134
+ autoFocus={undefined}
135
+ className="grommetux-text-input grommetux-input"
136
+ defaultValue={undefined}
137
+ name="name"
138
+ onBlur={[Function]}
139
+ onChange={[Function]}
140
+ onFocus={[Function]}
141
+ onInput={[Function]}
142
+ onKeyDown={[Function]}
143
+ placeholder={undefined}
144
+ tabIndex={0}
145
+ type="text"
146
+ value=""
147
+ />
148
+ </span>
149
+ </div>
150
+ </div>
151
+ <div
152
+ className="form-field text col-sm-6 col-xs-12"
153
+ >
154
+ <div
155
+ className="grommetux-form-field grommetux-form-field--size-medium"
156
+ onClick={[Function]}
157
+ >
158
+ <label
159
+ className="grommetux-form-field__label"
160
+ htmlFor={undefined}
161
+ >
162
+ Email
163
+ </label>
164
+ <span
165
+ className="grommetux-form-field__contents"
166
+ >
167
+ <input
168
+ autoComplete="off"
169
+ autoFocus={undefined}
170
+ className="grommetux-text-input grommetux-input"
171
+ defaultValue={undefined}
172
+ name="email"
173
+ onBlur={[Function]}
174
+ onChange={[Function]}
175
+ onFocus={[Function]}
176
+ onInput={[Function]}
177
+ onKeyDown={[Function]}
178
+ placeholder={undefined}
179
+ tabIndex={0}
180
+ type="text"
181
+ value=""
182
+ />
183
+ </span>
184
+ </div>
185
+ </div>
186
+ <div
187
+ className="form-field password col-sm-6 col-xs-12"
188
+ >
189
+ <div
190
+ className="grommetux-form-field grommetux-form-field--size-medium"
191
+ onClick={[Function]}
192
+ >
193
+ <label
194
+ className="grommetux-form-field__label"
195
+ htmlFor={undefined}
196
+ >
197
+ Password
198
+ </label>
199
+ <span
200
+ className="grommetux-form-field__contents"
201
+ >
202
+ <input
203
+ autoComplete="off"
204
+ autoFocus={undefined}
205
+ className="grommetux-text-input grommetux-input"
206
+ defaultValue={undefined}
207
+ name="password"
208
+ onBlur={[Function]}
209
+ onChange={[Function]}
210
+ onFocus={[Function]}
211
+ onInput={[Function]}
212
+ onKeyDown={[Function]}
213
+ placeholder={undefined}
214
+ tabIndex={0}
215
+ type="password"
216
+ value=""
217
+ />
218
+ </span>
219
+ </div>
220
+ </div>
221
+ </div>
222
+ </div>
223
+ `;
@@ -0,0 +1,10 @@
1
+ import { React, Snapshot, getScreenInstance } from 'hippo/testing/index'; // eslint-disable-line
2
+ import Preferences from 'hippo/screens/preferences';
3
+
4
+ const screenInstance = getScreenInstance('preferences');
5
+
6
+ describe('Screen Preferences', () => {
7
+ it('renders and matches snapshot', () => {
8
+ expect(Snapshot(<Preferences screen={screenInstance} />)).toMatchSnapshot();
9
+ });
10
+ });
@@ -12,7 +12,7 @@ import ScreenDefinition from 'hippo/screens/definition';
12
12
  export class Ship extends BaseModel {
13
13
 
14
14
  @identifier({ type: 'string' }) name;
15
-
15
+ @field({ type: 'date' }) sail_date;
16
16
  @belongsTo({ model: 'test/container', inverseOf: 'vessel' }) container;
17
17
 
18
18
  }
@@ -36,6 +36,18 @@ exports[`Workspace Menu has groups with screens 1`] = `
36
36
  </h4>
37
37
  </header>
38
38
  </div>
39
+ <a
40
+ aria-label={undefined}
41
+ className="grommetux-anchor"
42
+ href={undefined}
43
+ onClick={[Function]}
44
+ >
45
+ <span
46
+ aria-hidden={true}
47
+ className="fa fa-heartbeat icon"
48
+ />
49
+ Preferences
50
+ </a>
39
51
  <a
40
52
  aria-label={undefined}
41
53
  className="grommetux-anchor"
@@ -0,0 +1,6 @@
1
+ FactoryBot.define do
2
+ factory :subscription, class: Hippo::Subscription do
3
+ tenant { Hippo::Tenant.current }
4
+
5
+ end
6
+ end
@@ -1,6 +1,6 @@
1
1
  require 'faker'
2
2
 
3
- FactoryGirl.define do
3
+ FactoryBot.define do
4
4
  factory :tenant, class: Hippo::Tenant do
5
5
  slug { Faker::Internet.domain_word }
6
6
  name { Faker::Company.name }
@@ -1,4 +1,4 @@
1
- FactoryGirl.define do
1
+ FactoryBot.define do
2
2
  factory :user, class: Hippo::User do
3
3
  name { Faker::Name.name }
4
4
  email { Faker::Internet.email }
@@ -3,18 +3,21 @@ require_relative '../spec_helper'
3
3
 
4
4
  describe "Tenant changes", api: true, vcr: VCR_OPTS do
5
5
 
6
- let(:tenant) { FactoryGirl.create :tenant, slug: 'foo' }
6
+ let(:tenant) { FactoryBot.create :tenant, slug: 'foo' }
7
7
 
8
- let!(:user) { FactoryGirl.create :user, tenant: tenant, role_names: ['administrator'] }
8
+ let!(:user) { FactoryBot.create :user, tenant: tenant, role_names: ['administrator'] }
9
+
10
+ around(:each){ |spec| with_payment_proccessor { spec.run } }
9
11
 
10
12
  it 'sends email when tenant identifier changes' do
11
13
  put "/api/hippo/tenant/#{tenant.identifier}.json", {
12
- 'slug' => 'RED'
13
- }.to_json, {
14
- 'HTTP_AUTHORIZATION' => user.jwt_token,
15
- 'HTTP_ACCEPT' => 'application/json',
16
- 'SERVER_NAME' => "#{tenant.slug}.example.ua",
17
- }
14
+ 'slug' => 'RED'
15
+ }.to_json, {
16
+ 'HTTP_AUTHORIZATION' => user.jwt_token,
17
+ 'HTTP_ACCEPT' => 'application/json',
18
+ 'CONTENT_TYPE' => 'application/json',
19
+ 'SERVER_NAME' => "#{tenant.slug}.example.ua",
20
+ }
18
21
  expect(tenant.reload.slug).to eq('red')
19
22
  email = Mail::TestMailer.deliveries.last
20
23
  expect(email).not_to be_nil