super 0.0.1 → 0.0.6

Sign up to get free protection for your applications and to get access to all the features.
Files changed (111) hide show
  1. checksums.yaml +4 -4
  2. data/.yardopts +11 -0
  3. data/README.md +64 -78
  4. data/Rakefile +3 -1
  5. data/app/assets/config/super_manifest.js +2 -1
  6. data/app/assets/javascripts/super/application.js +1252 -316
  7. data/app/assets/stylesheets/super/application.css +102704 -17321
  8. data/app/controllers/super/application_controller.rb +50 -42
  9. data/app/helpers/super/application_helper.rb +39 -0
  10. data/app/views/layouts/super/application.html.erb +11 -7
  11. data/app/views/super/application/_collection_header.html.erb +15 -0
  12. data/app/views/super/application/_flash.html.erb +17 -0
  13. data/app/views/super/application/_form_field__destroy.html.erb +9 -0
  14. data/app/views/super/application/_form_field_select.html.erb +23 -0
  15. data/app/views/super/application/_form_field_text.html.erb +13 -0
  16. data/app/views/super/application/_form_fieldset.html.erb +8 -0
  17. data/app/views/super/application/_form_has_many.html.erb +21 -0
  18. data/app/views/super/application/_form_has_one.html.erb +11 -0
  19. data/app/views/super/application/_form_inline_errors.html.erb +10 -0
  20. data/app/views/super/application/_member_header.html.erb +16 -0
  21. data/app/views/super/application/_super_layout.html.erb +29 -0
  22. data/app/views/super/application/_super_panel.html.erb +7 -0
  23. data/app/views/super/application/_super_schema_display_actions.html.erb +5 -0
  24. data/app/views/super/application/_super_schema_display_index.html.erb +39 -0
  25. data/app/views/super/application/_super_schema_display_show.html.erb +8 -0
  26. data/app/views/super/application/_super_schema_form.html.erb +15 -0
  27. data/app/views/super/application/edit.html.erb +4 -5
  28. data/app/views/super/application/index.html.erb +6 -1
  29. data/app/views/super/application/new.html.erb +4 -5
  30. data/app/views/super/application/nothing.html.erb +0 -0
  31. data/app/views/super/application/show.html.erb +6 -10
  32. data/app/views/super/feather/{_chevron_down.svg → _chevron_down.html} +0 -0
  33. data/config/locales/en.yml +5 -0
  34. data/docs/README.md +6 -0
  35. data/docs/cheat.md +41 -0
  36. data/docs/faq.md +44 -0
  37. data/docs/quick_start.md +45 -0
  38. data/docs/webpacker.md +17 -0
  39. data/docs/yard_customizations.rb +41 -0
  40. data/frontend/super-frontend/build.js +14 -12
  41. data/frontend/super-frontend/dist/application.css +102704 -17321
  42. data/frontend/super-frontend/dist/application.js +1252 -316
  43. data/frontend/super-frontend/package.json +11 -4
  44. data/frontend/super-frontend/postcss.config.js +4 -4
  45. data/frontend/super-frontend/src/javascripts/super/application.ts +18 -0
  46. data/frontend/super-frontend/src/javascripts/super/apply_template_controller.ts +19 -0
  47. data/frontend/super-frontend/src/javascripts/super/rails__ujs.d.ts +1 -0
  48. data/frontend/super-frontend/src/javascripts/super/toggle_pending_destruction_controller.ts +15 -0
  49. data/frontend/super-frontend/src/stylesheets/super/application.css +63 -0
  50. data/frontend/super-frontend/tailwind.config.js +12 -4
  51. data/frontend/super-frontend/tsconfig.json +13 -0
  52. data/frontend/super-frontend/yarn.lock +1891 -1798
  53. data/lib/generators/super/install/USAGE +4 -2
  54. data/lib/generators/super/install/install_generator.rb +18 -3
  55. data/lib/generators/super/resource/USAGE +1 -2
  56. data/lib/generators/super/resource/resource_generator.rb +0 -2
  57. data/lib/generators/super/resource/templates/resources_controller.rb.tt +38 -2
  58. data/lib/generators/super/webpacker/webpacker_generator.rb +8 -0
  59. data/lib/super.rb +10 -5
  60. data/lib/super/action_inquirer.rb +101 -0
  61. data/lib/super/assets.rb +1 -0
  62. data/lib/super/client_error.rb +43 -0
  63. data/lib/super/compatibility.rb +13 -0
  64. data/lib/super/configuration.rb +60 -45
  65. data/lib/super/controls.rb +26 -15
  66. data/lib/super/controls/optional.rb +65 -0
  67. data/lib/super/controls/required.rb +41 -0
  68. data/lib/super/controls/steps.rb +115 -0
  69. data/lib/super/display/schema_types.rb +60 -18
  70. data/lib/super/engine.rb +1 -0
  71. data/lib/super/error.rb +10 -1
  72. data/lib/super/form.rb +48 -0
  73. data/lib/super/form/schema_types.rb +96 -21
  74. data/lib/super/layout.rb +47 -0
  75. data/lib/super/link.rb +110 -0
  76. data/lib/super/navigation/automatic.rb +2 -0
  77. data/lib/super/pagination.rb +19 -8
  78. data/lib/super/panel.rb +30 -0
  79. data/lib/super/partial.rb +11 -0
  80. data/lib/super/partial/resolving.rb +24 -0
  81. data/lib/super/schema.rb +64 -1
  82. data/lib/super/version.rb +1 -1
  83. data/lib/super/view_helper.rb +43 -0
  84. metadata +145 -38
  85. data/app/views/super/application/_form.html.erb +0 -13
  86. data/app/views/super/application/_form_field.html.erb +0 -7
  87. data/app/views/super/application/_form_generic_select.html.erb +0 -19
  88. data/app/views/super/application/_form_generic_text.html.erb +0 -7
  89. data/app/views/super/application/_index.html.erb +0 -58
  90. data/frontend/super-frontend/src/javascripts/super/application.js +0 -11
  91. data/lib/generators/super/resource/templates/resource_dashboard.rb.tt +0 -65
  92. data/lib/super/display.rb +0 -9
  93. data/lib/super/inline_callback.rb +0 -82
  94. data/lib/super/test_support/fixtures/members.yml +0 -336
  95. data/lib/super/test_support/fixtures/ships.yml +0 -10
  96. data/lib/super/test_support/setup.rb +0 -79
  97. data/lib/super/test_support/starfleet_seeder.rb +0 -49
  98. data/lib/super/test_support/templates/20190216224956_create_members.rb +0 -11
  99. data/lib/super/test_support/templates/20190803143320_create_ships.rb +0 -11
  100. data/lib/super/test_support/templates/20190806014121_add_ship_to_members.rb +0 -5
  101. data/lib/super/test_support/templates/admin/members_controller.rb +0 -9
  102. data/lib/super/test_support/templates/admin/ships_controller.rb +0 -9
  103. data/lib/super/test_support/templates/admin_controller.rb +0 -2
  104. data/lib/super/test_support/templates/member.rb +0 -16
  105. data/lib/super/test_support/templates/member_dashboard.rb +0 -90
  106. data/lib/super/test_support/templates/routes.rb +0 -10
  107. data/lib/super/test_support/templates/seeds.rb +0 -2
  108. data/lib/super/test_support/templates/ship.rb +0 -3
  109. data/lib/super/test_support/templates/ship_dashboard.rb +0 -79
  110. data/lib/super/view.rb +0 -25
  111. data/lib/tasks/super_tasks.rake +0 -4
@@ -1,65 +0,0 @@
1
- class <%= class_name %>Dashboard
2
- def title
3
- <%= class_name %>.name.pluralize
4
- end
5
-
6
- def model
7
- <%= class_name %>
8
- end
9
-
10
- def index_scope
11
- <%= class_name %>.all
12
- end
13
-
14
- def index_schema
15
- Super::Schema.new(Super::Display::SchemaTypes.new) do |fields, type|
16
- end
17
- end
18
-
19
- def create_scope
20
- <%= class_name %>.all
21
- end
22
-
23
- def create_permitted_params(params)
24
- params.require(:<%= file_name %>).permit()
25
- end
26
-
27
- def new_scope
28
- <%= class_name %>.all
29
- end
30
-
31
- def new_schema
32
- Super::Schema.new(Super::Form::SchemaTypes.new) do |fields, type|
33
- end
34
- end
35
-
36
- def edit_scope
37
- <%= class_name %>.all
38
- end
39
-
40
- def edit_schema
41
- Super::Schema.new(Super::Form::SchemaTypes.new) do |fields, type|
42
- end
43
- end
44
-
45
- def show_scope
46
- <%= class_name %>.all
47
- end
48
-
49
- def show_schema
50
- Super::Schema.new(Super::Display::SchemaTypes.new) do |fields, type|
51
- end
52
- end
53
-
54
- def update_scope
55
- <%= class_name %>.all
56
- end
57
-
58
- def update_permitted_params(params)
59
- params.require(:<%= file_name %>).permit()
60
- end
61
-
62
- def destroy_scope
63
- <%= class_name %>.all
64
- end
65
- end
@@ -1,9 +0,0 @@
1
- module Super
2
- class Display
3
- def self.format(schema, resource, column)
4
- value = resource.public_send(column)
5
-
6
- schema.fields[column].present(value)
7
- end
8
- end
9
- end
@@ -1,82 +0,0 @@
1
- module Super
2
- module InlineCallback
3
- extend ActiveSupport::Concern
4
-
5
- included do
6
- register_inline_callback(:yield, on: :index)
7
- end
8
-
9
- class_methods do
10
- def inline_callback_registry
11
- @inline_callback_registry ||= {}
12
- end
13
-
14
- def inline_callback_defined?(action)
15
- action = action.to_sym
16
-
17
- inline_callback_registry.key?(action)
18
- end
19
-
20
- def inline_callbacks_for(action, check_ancestors = true)
21
- action = action.to_sym
22
-
23
- inline_callback_registry[action] ||= {}
24
-
25
- if check_ancestors
26
- ancestors.each do |ancestor|
27
- if ancestor.respond_to?(:inline_callback_defined?)
28
- if ancestor.inline_callback_defined?(action)
29
- parent_class_callbacks = ancestor.inline_callbacks_for(action, false)
30
- inline_callback_registry[action] = parent_class_callbacks.merge(inline_callback_registry[action])
31
- end
32
- end
33
-
34
- if ancestor == Super::ApplicationController
35
- break
36
- end
37
- end
38
- end
39
-
40
- inline_callback_registry[action]
41
- end
42
-
43
- def register_inline_callback(callback, on:, after: nil)
44
- action = on.to_sym
45
- after = after.to_sym if after.respond_to?(:to_sym)
46
-
47
- callbacks = inline_callbacks_for(action)
48
- if !callbacks.key?(callback)
49
- callbacks[callback] = []
50
- end
51
-
52
- if after
53
- callbacks[callback].push(after)
54
- end
55
- end
56
- end
57
-
58
- def with_inline_callbacks
59
- action = params[:action].to_sym
60
-
61
- callbacks = self.class.inline_callbacks_for(action)
62
-
63
- each_node = -> (&b) { callbacks.each_key(&b) }
64
- each_child = -> (cb, &b) { callbacks[cb].each(&b) }
65
-
66
- yield_called = false
67
-
68
- TSort.tsort_each(each_node, each_child) do |callback|
69
- if callback == :yield
70
- yield_called = true
71
- yield
72
- else
73
- send(callback)
74
- end
75
- end
76
-
77
- if !yield_called
78
- yield
79
- end
80
- end
81
- end
82
- end
@@ -1,336 +0,0 @@
1
- ---
2
- picard:
3
- name: Jean-Luc Picard
4
- rank: Captain
5
- position: Commanding Officer
6
- ship: uss_enterprise_d
7
-
8
- riker:
9
- name: William T. Riker
10
- rank: Commander
11
- position: First Officer
12
- ship: uss_enterprise_d
13
-
14
- data:
15
- name: Data
16
- rank: Lieutenant Commander
17
- position: Second Officer
18
- ship: uss_enterprise_d
19
-
20
- crusher:
21
- name: Beverly Crusher
22
- rank: Commander
23
- position: Chief Medical Officer
24
- ship: uss_enterprise_d
25
-
26
- worf:
27
- name: Worf
28
- rank: Lieutenant Commander
29
- position: Chief of Security
30
- ship: uss_enterprise_d
31
-
32
- la_forge:
33
- name: Geordi La Forge
34
- rank: Lieutenant Commander
35
- position: Chief Engineering Officer
36
- ship: uss_enterprise_d
37
-
38
- troi:
39
- name: Deanna Troi
40
- rank: Commander
41
- position: Counselor
42
- ship: uss_enterprise_d
43
-
44
- tasha:
45
- name: Natasha Yar
46
- rank: Lieutenant
47
- position: Chief of Security
48
- ship: uss_enterprise_d
49
-
50
- miles:
51
- name: Miles O'Brien
52
- rank: NCO
53
- position: Transporter Chief
54
- ship: uss_enterprise_d
55
-
56
- guinan:
57
- name: Guinan
58
- rank: NCO
59
- position: Bartender
60
- ship: uss_enterprise_d
61
-
62
- sepulveda:
63
- name: Fernando Sepulveda
64
- rank: Lieutenant
65
- position: Ops engineer
66
- ship: uss_enterprise_d
67
-
68
- jaxa:
69
- name: Sito Jaxa
70
- rank: Ensign
71
- position: Security officer
72
- ship: uss_enterprise_d
73
-
74
- calloway:
75
- name: Maddy Calloway
76
- rank: Ensign
77
- position: Medical technician
78
- ship: uss_enterprise_d
79
-
80
- mayter:
81
- name: Van Mayter
82
- rank: NCO
83
- position: Engineer
84
- ship: uss_enterprise_d
85
-
86
- sutter:
87
- name: Daniel Sutter
88
- rank: Ensign
89
- position: Engineer
90
- ship: uss_enterprise_d
91
-
92
- bernard:
93
- name: Harry Bernard, Sr.
94
- rank: Lieutenant
95
- position: Oceanographer
96
- ship: uss_enterprise_d
97
-
98
- dangelo:
99
- name: Dick D'Angelo
100
- rank: Lieutenant
101
- position: Ops Engineer
102
- ship: uss_enterprise_d
103
-
104
- ogawa:
105
- name: Alyssa Ogawa
106
- rank: Lieutenant
107
- position: Nurse
108
- ship: uss_enterprise_d
109
-
110
- nesterowicz:
111
- name: John Nesterowicz
112
- rank: Lieutenant
113
- position: WarpField Tech 2
114
- ship: uss_enterprise_d
115
-
116
- keiko:
117
- name: Keiko O'Brien
118
- rank: NCO
119
- position: Botanist
120
- ship: uss_enterprise_d
121
-
122
- anaya:
123
- name: April Anaya
124
- rank: Ensign
125
- position: Flight controller
126
- ship: uss_enterprise_d
127
-
128
- ziff:
129
- name: Anaanda Ziff
130
- rank: Lieutenant
131
- position: Specialist
132
- ship: uss_enterprise_d
133
-
134
- tarses:
135
- name: Simon Tarses
136
- rank: NCO
137
- position: Medical technician
138
- ship: uss_enterprise_d
139
-
140
- wallace:
141
- name: Darien Wallace
142
- rank: Lieutenant
143
- position: Crewmember
144
- ship: uss_enterprise_d
145
-
146
- giddings:
147
- name: Diana Giddings
148
- rank: Lieutenant
149
- position: Junior engineer
150
- ship: uss_enterprise_d
151
-
152
- pulaski:
153
- name: Katherine Pulaski
154
- rank: Commander
155
- position: Medical officer
156
- ship: uss_enterprise_d
157
-
158
- dumont:
159
- name: Suzanne Dumont
160
- rank: Ensign
161
- position: Crewmember
162
- ship: uss_enterprise_d
163
-
164
- tsu:
165
- name: Lian T'Su
166
- rank: Ensign
167
- position: Operations officer
168
- ship: uss_enterprise_d
169
-
170
- lynch:
171
- name: Leland T. Lynch
172
- rank: Lieutenant Commander
173
- position: Chief engineer
174
- ship: uss_enterprise_d
175
-
176
- dsora:
177
- name: Jenna D'Sora
178
- rank: Lieutenant Junior Grade
179
- position: Security officer
180
- ship: uss_enterprise_d
181
-
182
- macdougal:
183
- name: Sarah MacDougal
184
- rank: Lieutenant Commander
185
- position: Chief engineer
186
- ship: uss_enterprise_d
187
-
188
- shimoda:
189
- name: Jim Shimoda
190
- rank: NCO
191
- position: Assistant chief engineer
192
- ship: uss_enterprise_d
193
-
194
- solis:
195
- name: Orfil Solis
196
- rank: Lieutenant Junior Grade
197
- position: Flight controller
198
- ship: uss_enterprise_d
199
-
200
- rhodes:
201
- name: Sandra Rhodes
202
- rank: Lieutenant
203
- position: Security officer
204
- ship: uss_enterprise_d
205
-
206
- fratis:
207
- name: Jeffrey Fratis
208
- rank: Lieutenant
209
- position: Crewmember
210
- ship: uss_enterprise_d
211
-
212
- mees:
213
- name: Jim Mees
214
- rank: Lieutenant Commander
215
- position: Crewmember
216
- ship: uss_enterprise_d
217
-
218
- hubbell:
219
- name: Maggie Hubbell
220
- rank: Ensign
221
- position: Transporter chief
222
- ship: uss_enterprise_d
223
-
224
- rager:
225
- name: Sariel Rager
226
- rank: Ensign
227
- position: Helmsman
228
- ship: uss_enterprise_d
229
-
230
- robinson:
231
- name: B.G. Robinson
232
- rank: Lieutenant
233
- position: Transporter chief
234
- ship: uss_enterprise_d
235
-
236
- allenby:
237
- name: Tess Allenby
238
- rank: Ensign
239
- position: Flight controller
240
- ship: uss_enterprise_d
241
-
242
- brooks:
243
- name: Janet Brooks
244
- rank: Ensign
245
- position: Crewmember
246
- ship: uss_enterprise_d
247
-
248
- foster:
249
- name: Don Foster, Jr.
250
- rank: Lieutenant
251
- position: WarpField Tech 1
252
- ship: uss_enterprise_d
253
-
254
- lefler:
255
- name: Robin Lefler
256
- rank: Ensign
257
- position: Mission Specialist
258
- ship: uss_enterprise_d
259
-
260
- lavelle:
261
- name: Sam Lavelle
262
- rank: Lieutenant Junior Grade
263
- position: Operations officer
264
- ship: uss_enterprise_d
265
-
266
- prieto:
267
- name: Ben Prieto
268
- rank: Lieutenant
269
- position: Shuttlecraft Pilot
270
- ship: uss_enterprise_d
271
-
272
- pacelli:
273
- name: Alfonse Pacelli
274
- rank: Ensign
275
- position: Specialist
276
- ship: uss_enterprise_d
277
-
278
- aster:
279
- name: Marla Aster
280
- rank: Lieutenant
281
- position: Archaeologist
282
- ship: uss_enterprise_d
283
-
284
- barclay:
285
- name: Reginald Barclay
286
- rank: Lieutenant
287
- position: Systems diagnostic engineer
288
- ship: uss_enterprise_d
289
-
290
- salvatore:
291
- name: Bruno Salvatore
292
- rank: Ensign
293
- position: Specialist in biomechanical research
294
- ship: uss_enterprise_d
295
-
296
- juarez:
297
- name: Francisca Juarez
298
- rank: Lieutenant
299
- position: Crewmember
300
- ship: uss_enterprise_d
301
-
302
- finks:
303
- name: Wilbur Finks
304
- rank: Lieutenant
305
- position: Safety officer
306
- ship: uss_enterprise_d
307
-
308
- larson:
309
- name: Linda Larson
310
- rank: Lieutenant Junior Grade
311
- position: Engineer
312
- ship: uss_enterprise_d
313
-
314
- gomez:
315
- name: Sonya Gomez
316
- rank: Ensign
317
- position: Engineer
318
- ship: uss_enterprise_d
319
-
320
- hagler:
321
- name: Edward Hagler
322
- rank: Lieutenant
323
- position: Crewmember
324
- ship: uss_enterprise_d
325
-
326
- lin:
327
- name: Peter Lin
328
- rank: Ensign
329
- position: Flight controller
330
- ship: uss_enterprise_d
331
-
332
- kwan:
333
- name: Daniel Kwan
334
- rank: Lieutenant Junior Grade
335
- position: Specialist
336
- ship: uss_enterprise_d