glib-web 4.1.5 → 4.3.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (103) hide show
  1. checksums.yaml +4 -4
  2. data/app/controllers/concerns/glib/json/new_dynamic_text.rb +0 -0
  3. data/app/controllers/glib/glib_direct_uploads_controller.rb +52 -0
  4. data/app/helpers/glib/app_feature_support_helper.rb +0 -0
  5. data/app/helpers/glib/dynamic_texts_helper.rb +0 -0
  6. data/app/helpers/glib/json_ui/abstract_builder.rb +17 -2
  7. data/app/helpers/glib/json_ui/action_builder/components.rb +7 -1
  8. data/app/helpers/glib/json_ui/action_builder/logics.rb +22 -0
  9. data/app/helpers/glib/json_ui/action_builder/sheets.rb +0 -0
  10. data/app/helpers/glib/json_ui/analytics_helper.rb +0 -0
  11. data/app/helpers/glib/json_ui/generic_builders.rb +0 -0
  12. data/app/helpers/glib/json_ui/page_helper.rb +10 -1
  13. data/app/helpers/glib/json_ui/view_builder/fields.rb +3 -2
  14. data/app/helpers/glib/json_ui/view_builder/panels.rb +17 -1
  15. data/app/helpers/glib/json_ui/view_builder.rb +1 -1
  16. data/app/models/glib/active_storage/attachment.rb +0 -0
  17. data/app/models/glib/active_storage/blob.rb +0 -0
  18. data/app/models/glib/dummy_job_application.rb +1 -1
  19. data/app/models/glib/dynamic_text_record.rb +0 -0
  20. data/app/models/glib/text.rb +0 -0
  21. data/app/validators/email_typo_validator.rb +0 -0
  22. data/app/validators/email_validator.rb +0 -0
  23. data/app/validators/url_validator.rb +0 -0
  24. data/app/views/json_ui/garage/actions/dialogs_oauth_post.json.jbuilder +0 -0
  25. data/app/views/json_ui/garage/forms/conditional_value.json.jbuilder +1 -5
  26. data/app/views/json_ui/garage/forms/dialogs_update3.json.jbuilder +1 -1
  27. data/app/views/json_ui/garage/forms/dynamic_group.json.jbuilder +35 -13
  28. data/app/views/json_ui/garage/forms/dynamic_select_data.json.jbuilder +0 -0
  29. data/app/views/json_ui/garage/forms/file_upload.json.jbuilder +27 -11
  30. data/app/views/json_ui/garage/forms/generic_post.json.jbuilder +0 -0
  31. data/app/views/json_ui/garage/forms/new_rich_text.json.jbuilder +4 -4
  32. data/app/views/json_ui/garage/forms/rich_text.json.jbuilder +2 -2
  33. data/app/views/json_ui/garage/forms/selects.json.jbuilder +39 -5
  34. data/app/views/json_ui/garage/forms/show_hide.json.jbuilder +34 -0
  35. data/app/views/json_ui/garage/forms/submission_flow.json.jbuilder +0 -0
  36. data/app/views/json_ui/garage/forms/submission_flow_post.json.jbuilder +0 -0
  37. data/app/views/json_ui/garage/forms/submission_indicator.json.jbuilder +0 -0
  38. data/app/views/json_ui/garage/forms/submission_indicator_post.json.jbuilder +0 -0
  39. data/app/views/json_ui/garage/forms/submit_on_change.json.jbuilder +1 -1
  40. data/app/views/json_ui/garage/forms/text_validation.json.jbuilder +10 -9
  41. data/app/views/json_ui/garage/home/blank.json.jbuilder +0 -0
  42. data/app/views/json_ui/garage/home/slow.json.jbuilder +0 -0
  43. data/app/views/json_ui/garage/lists/autoload_all.json.jbuilder +0 -0
  44. data/app/views/json_ui/garage/lists/autoload_as_needed.json.jbuilder +0 -0
  45. data/app/views/json_ui/garage/lists/chat_ui.json.jbuilder +0 -0
  46. data/app/views/json_ui/garage/lists/fab.json.jbuilder +0 -0
  47. data/app/views/json_ui/garage/notifications/web_socket.json.jbuilder +0 -0
  48. data/app/views/json_ui/garage/pages/custom_style_class.json.jbuilder +0 -0
  49. data/app/views/json_ui/garage/pages/full_width.json.jbuilder +0 -0
  50. data/app/views/json_ui/garage/pages/full_width_height.json.jbuilder +0 -0
  51. data/app/views/json_ui/garage/pages/layout.json.jbuilder +0 -0
  52. data/app/views/json_ui/garage/pages/loading_indicator.json.jbuilder +0 -0
  53. data/app/views/json_ui/garage/pages/nested_scroll.json.jbuilder +0 -0
  54. data/app/views/json_ui/garage/pages/paste_file.jbuilder +1 -1
  55. data/app/views/json_ui/garage/pages/redirect_onload.json.jbuilder +0 -0
  56. data/app/views/json_ui/garage/panels/_styled.json.jbuilder +0 -0
  57. data/app/views/json_ui/garage/panels/card.json.jbuilder +0 -0
  58. data/app/views/json_ui/garage/panels/custom.json.jbuilder +0 -0
  59. data/app/views/json_ui/garage/panels/flow.json.jbuilder +13 -0
  60. data/app/views/json_ui/garage/panels/horizontal.json.jbuilder +13 -0
  61. data/app/views/json_ui/garage/panels/outlined.json.jbuilder +0 -0
  62. data/app/views/json_ui/garage/panels/responsive.json.jbuilder +12 -0
  63. data/app/views/json_ui/garage/panels/ul.json.jbuilder +13 -0
  64. data/app/views/json_ui/garage/panels/vertical.json.jbuilder +13 -0
  65. data/app/views/json_ui/garage/services/dynamic_text.json.jbuilder +0 -0
  66. data/app/views/json_ui/garage/services/image.json.jbuilder +0 -0
  67. data/app/views/json_ui/garage/services/index.json.jbuilder +0 -0
  68. data/app/views/json_ui/garage/tables/_autoload_section.json.jbuilder +0 -0
  69. data/app/views/json_ui/garage/tables/autoload_all.json.jbuilder +0 -0
  70. data/app/views/json_ui/garage/tables/autoload_as_needed.json.jbuilder +0 -0
  71. data/app/views/json_ui/garage/tables/export_import.json.jbuilder +0 -0
  72. data/app/views/json_ui/garage/tables/index.json.jbuilder +0 -0
  73. data/app/views/json_ui/garage/views/calendar_data.json.jbuilder +0 -0
  74. data/app/views/json_ui/garage/views/icon_names.json.jbuilder +1 -1
  75. data/app/views/json_ui/garage/views/map_data.json.jbuilder +0 -0
  76. data/app/views/json_ui/garage/views/multimedia.json.jbuilder +0 -0
  77. data/app/views/json_ui/garage/views/treeView.json.jbuilder +1 -1
  78. data/app/views/layouts/json_ui/no_custom.html.erb +0 -0
  79. data/config/routes.rb +2 -0
  80. data/lib/active_storage/service/glib_s3_service.rb +22 -0
  81. data/lib/generators/glib/install_generator.rb +0 -0
  82. data/lib/generators/templates/20191017062519_create_texts.rb +0 -0
  83. data/lib/generators/templates/20191024063257_add_scope_to_texts.rb +0 -0
  84. data/lib/generators/templates/20191112095018_add_lang_to_texts.rb +0 -0
  85. data/lib/generators/templates/20191126071051_create_active_storage_tables.active_storage.rb +0 -0
  86. data/lib/generators/templates/database.yml +0 -0
  87. data/lib/generators/templates/dynamic_text.rb +0 -0
  88. data/lib/glib/dynamic_text/config.rb +0 -0
  89. data/lib/glib/dynamic_text.rb +0 -0
  90. data/lib/glib/engine.rb +0 -7
  91. data/lib/glib/json_crawler/action_crawler.rb +0 -0
  92. data/lib/glib/json_crawler/action_crawlers/action_http.rb +0 -0
  93. data/lib/glib/json_crawler/action_crawlers/dialogs_alert.rb +0 -0
  94. data/lib/glib/json_crawler/action_crawlers/menu.rb +0 -0
  95. data/lib/glib/json_crawler/action_crawlers/run_multiple.rb +0 -0
  96. data/lib/glib/json_crawler/action_crawlers/windows_open.rb +0 -0
  97. data/lib/glib/json_crawler/coverage.rb +0 -0
  98. data/lib/glib/value.rb +0 -0
  99. data/lib/glib/version.rb +0 -0
  100. metadata +27 -13
  101. data/lib/glib/blob.rb +0 -23
  102. data/lib/glib/direct_uploads_controller.rb +0 -32
  103. data/lib/glib/s3_service.rb +0 -30
@@ -342,6 +342,40 @@ page.form \
342
342
  form.fields_text id: 'field4', name: 'user[loadif_target8]', width: 'matchParent', value: params[:key]
343
343
  end
344
344
 
345
+ # form.fields_check name: 'user[loadif7]', label: 'Show target nested panels', checkValue: 'true', uncheckValue: 'false', value: 'false', onChangeAndLoad: ->(action) do
346
+ # action.logics_set targetId: 'panel7a', conditionalData: { displayed: { "==": [{ "var": 'user[loadif7]' }, 'true'] } }
347
+ # end
348
+
349
+ form.spacer height: 20
350
+ options = [
351
+ { text: 'Option 1', value: 'option1' },
352
+ { text: 'Option 2', value: 'option2' }
353
+ ]
354
+ form.fields_select name: 'user[loadif7]', width: 'matchParent', label: 'Select "show"', options: options, value: '', onChangeAndLoad: ->(action) do
355
+ action.runMultiple childActions: ->(saction) do
356
+ saction.logics_set targetId: 'panel7a', conditionalData: { displayed: { "==": [{ "var": 'user[loadif7]' }, 'option1'] } }
357
+ saction.logics_set targetId: 'panel7b', conditionalData: { displayed: { "==": [{ "var": 'user[loadif7]' }, 'option2'] } }
358
+ end
359
+ end
360
+
361
+ form.panels_vertical \
362
+ id: 'panel7a',
363
+ styleClass: 'border-2',
364
+ width: 'matchParent',
365
+ padding: { top: 8, right: 8, bottom: 8, left: 8 },
366
+ childViews: ->(res) do
367
+ res.fields_text name: 'user[loadif_target9]', width: 'matchParent', value: 'Value 7a'
368
+ end
369
+
370
+ form.panels_vertical \
371
+ id: 'panel7b',
372
+ styleClass: 'border-2',
373
+ width: 'matchParent',
374
+ padding: { top: 8, right: 8, bottom: 8, left: 8 },
375
+ childViews: ->(res) do
376
+ res.fields_text name: 'user[loadif_target9]', width: 'matchParent', value: 'Value 7b'
377
+ end
378
+
345
379
  form.spacer height: 20
346
380
  form.fields_submit text: 'Submit'
347
381
 
@@ -113,7 +113,7 @@ page.scroll childViews: ->(scroll) do
113
113
  width: 'matchParent',
114
114
  label: 'Avatar',
115
115
  accepts: rules,
116
- directUploadUrl: rails_direct_uploads_url,
116
+ directUploadUrl: glib_direct_uploads_url,
117
117
  placeholderView: { type: 'avatar', width: 100, height: 100, url: 'data:image/jpeg;base64,/9j/4AAQSkZJRgABAQAAAQABAAD/2wCEAAkGBxMREBUREhAWFhUWGBcVFRgXFxUVFxcWGRUWFxYVFRUYHSggGB0lHRgVITEhJSkrLi4uGB8zODMtNygtLisBCgoKBQUFDgUFDisZExkrKysrKysrKysrKysrKysrKysrKysrKysrKysrKysrKysrKysrKysrKysrKysrKysrK//AABEIAOMA3gMBIgACEQEDEQH/xAAbAAEAAgMBAQAAAAAAAAAAAAAABgcBAwQFAv/EAEAQAAECAwMKAwYEBAYDAAAAAAEAAgMRIQQSMQUGIjJBUWFxgZEHE6FCUnKxwdEUI2LwM4KSskNzg6LC4WOz8f/EABQBAQAAAAAAAAAAAAAAAAAAAAD/xAAUEQEAAAAAAAAAAAAAAAAAAAAA/9oADAMBAAIRAxEAPwC6XuvCQRj7okcUe27UYoxt4TOKDDG3Knkjm3jeGCMdeoeaOcWmQwQZe6/Qc0a+6Lpx+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pf1QC25UV2IGXtL90WGAjWw71RwJM24dudEBrr9DTasRDLRIn819PIOrj2ojSAJOx7+qD4iWbce60uYRiF0MBGth3qskkmYw/exByIustacBPlRa3QW4TIPGvyQaEW91nl7QWPw53hBpRbhZydo7p5FZFwQaUXSYDRiSshu1rRLf8APFBoZDJwC2CEAZEzO4LbEde1T9FgESkdb67KoPqJo1HKWxfIZe0lhgIq7DujgSZtw7eiA11+hptQvu6P7qsvIOrj2ojSAJOx7+qAW3KiuxAy9pfuiwwEa2HeqOBJmMO3OiAHX6Gm1C65QV2rLzPVx7IwgUdj3QfVp1eqWfVREGqy49PskfW7IiDZasOv3WYGr3REGuy49FiPrdkRBstWHX7rMHV7rKINVlx6LEXX7IiDZasBzWYOp3+qyiDVZcTyWIuv2+iIg2WrAc1mHqdD9URB8WXEr5fr9R9ERBttOr1Sz6vdZRBpsuPT7JH1uyIg2WrDqswdTuiINdlxPJYtOt0REH//2Q==' },
118
118
  onChange: ->(action) do
119
119
  action.sheets_select message: 'Submit data?', buttons: ->(menu) do
@@ -8,13 +8,14 @@ page.form \
8
8
  url: json_ui_garage_url(path: 'forms/generic_post'),
9
9
  method: 'post',
10
10
  padding: glib_json_padding_body,
11
+ autoValidate: true,
11
12
  childViews: ->(form) do
12
13
  form.fields_text \
13
14
  prop: :name,
14
15
  name: 'user[name]',
15
16
  width: 'matchParent',
16
- label: 'Name',
17
- validation: { format: { regex: 'Doe', message: 'This job is only for person named Doe' } }
17
+ label: 'Name'
18
+
18
19
 
19
20
  form.fields_email \
20
21
  name: 'user[email]',
@@ -30,8 +31,8 @@ page.form \
30
31
  prop: :age,
31
32
  name: 'user[age]',
32
33
  width: 'matchParent',
33
- label: 'Age',
34
- autoValidate: true
34
+ label: 'Age'
35
+
35
36
 
36
37
  form.fields_phone \
37
38
  name: 'user[phone1]',
@@ -57,8 +58,8 @@ page.form \
57
58
  name: 'user[words]',
58
59
  width: 'matchParent',
59
60
  label: 'Textarea with maxLength',
60
- maxLength: 1000,
61
- autoValidate: true
61
+ maxLength: 1000
62
+
62
63
 
63
64
  options = ['programmer', 'devops', 'designer', 'ceo', 'office_boy'].map { |v| { text: v.humanize, value: v } }
64
65
  form.fields_select \
@@ -66,8 +67,8 @@ page.form \
66
67
  name: 'user[position]',
67
68
  width: 'matchParent',
68
69
  label: 'Position',
69
- options: options,
70
- autoValidate: true
70
+ options: options
71
+
71
72
 
72
73
  form.spacer height: 10
73
74
  form.h4 text: 'Gender'
@@ -95,7 +96,7 @@ page.form \
95
96
  end
96
97
 
97
98
  form.spacer height: 10
98
- form.fields_check prop: :accept, label: 'Accept terms & condition', name: 'user[accept]', autoValidate: true
99
+ form.fields_check prop: :accept, label: 'Accept terms & condition', name: 'user[accept]'
99
100
 
100
101
  form.spacer height: 30
101
102
  form.fields_submit text: 'Submit'
File without changes
File without changes
File without changes
File without changes
File without changes
@@ -5,7 +5,7 @@ page = json_ui_page json
5
5
  render "#{@path_prefix}/nav_menu", json: json, page: page
6
6
 
7
7
  page.filePaster \
8
- directUploadUrl: rails_direct_uploads_url,
8
+ directUploadUrl: glib_direct_uploads_url,
9
9
  accepts: {
10
10
  fileType: 'image',
11
11
  maxFileSize: 100,
File without changes
File without changes
@@ -4,6 +4,19 @@ page = json_ui_page json
4
4
  render "#{@path_prefix}/nav_menu", json: json, page: page
5
5
 
6
6
  page.scroll padding: glib_json_padding_body, childViews: ->(scroll) do
7
+ scroll.h1 text: 'Show/hide'
8
+ scroll.panels_flow id: 'flow1', width: 300, innerPadding: { top: 0 }, backgroundColor: '#b3bac2', childViews: ->(panel) do
9
+ panel.button text: '1'
10
+ panel.button text: '2'
11
+ panel.button text: '3'
12
+ end
13
+ scroll.button text: 'show', onClick: ->(action) do
14
+ action.components_set targetId: 'flow1', data: { displayed: true }
15
+ end
16
+ scroll.button text: 'hide', onClick: ->(action) do
17
+ action.components_set targetId: 'flow1', data: { displayed: false }
18
+ end
19
+
7
20
  scroll.h1 text: 'Basic'
8
21
  scroll.panels_flow width: 300, innerPadding: { top: 0 }, backgroundColor: '#b3bac2', childViews: ->(panel) do
9
22
  panel.button text: '1'
@@ -4,6 +4,19 @@ json_ui_page json do |page|
4
4
  render "#{@path_prefix}/nav_menu", json: json, page: page
5
5
 
6
6
  page.scroll padding: glib_json_padding_body, childViews: ->(scroll) do
7
+ scroll.h1 text: 'Show/hide'
8
+ scroll.panels_horizontal id: 'hor1', width: 200, height: 100, backgroundColor: '#b3bac2', childViews: ->(panel) do
9
+ panel.button text: '1'
10
+ end
11
+ scroll.button text: 'show', onClick: ->(action) do
12
+ action.components_set targetId: 'hor1', data: { displayed: true }
13
+ end
14
+ scroll.button text: 'hide', onClick: ->(action) do
15
+ action.components_set targetId: 'hor1', data: { displayed: false }
16
+ end
17
+
18
+ scroll.label text: "\n"
19
+
7
20
  scroll.h1 text: 'Basic'
8
21
  scroll.panels_horizontal backgroundColor: '#b3bac2', childViews: ->(panel) do
9
22
  panel.button text: '1'
@@ -4,6 +4,18 @@ page = json_ui_page json
4
4
  render "#{@path_prefix}/nav_menu", json: json, page: page
5
5
 
6
6
  page.scroll padding: glib_json_padding_body, childViews: ->(scroll) do
7
+ scroll.h1 text: 'Show/hide'
8
+ scroll.panels_responsive id: 'res1', width: 300, backgroundColor: '#b3bac2', childViews: ->(panel) do
9
+ panel.button text: '1'
10
+ panel.button text: '2'
11
+ end
12
+ scroll.button text: 'show', onClick: ->(action) do
13
+ action.components_set targetId: 'res1', data: { displayed: true }
14
+ end
15
+ scroll.button text: 'hide', onClick: ->(action) do
16
+ action.components_set targetId: 'res1', data: { displayed: false }
17
+ end
18
+
7
19
  scroll.h1 text: 'Panels Columns'
8
20
  scroll.label text: 'Shrink the browser\'s width to see how the column panels are rearranged. On mobile screens, they are always arranged vertically'
9
21
  scroll.spacer height: 8
@@ -4,6 +4,19 @@ page = json_ui_page json
4
4
  render "#{@path_prefix}/nav_menu", json: json, page: page
5
5
 
6
6
  page.scroll padding: glib_json_padding_body, childViews: ->(scroll) do
7
+ scroll.h2 text: 'Show/hide'
8
+ scroll.spacer height: 6
9
+ scroll.panels_ul id: 'ul', childViews: ->(li) do
10
+ li.label text: 'text1'
11
+ li.label text: 'text2'
12
+ end
13
+ scroll.button text: 'show', onClick: ->(action) do
14
+ action.components_set targetId: 'ul', data: { displayed: true }
15
+ end
16
+ scroll.button text: 'hide', onClick: ->(action) do
17
+ action.components_set targetId: 'ul', data: { displayed: false }
18
+ end
19
+ scroll.spacer height: 14
7
20
  scroll.h2 text: 'Standard Usage'
8
21
  scroll.spacer height: 6
9
22
  scroll.panels_ul childViews: ->(ul) do
@@ -4,6 +4,19 @@ json_ui_page json do |page|
4
4
  render "#{@path_prefix}/nav_menu", json: json, page: page
5
5
 
6
6
  page.scroll padding: glib_json_padding_body, childViews: ->(scroll) do
7
+
8
+ scroll.h1 text: 'Show/Hide'
9
+ scroll.panels_vertical id: 'vert1', width: 200, height: 100, backgroundColor: '#b3bac2', childViews: ->(panel) do
10
+ panel.button text: 'Button1'
11
+ end
12
+ scroll.button text: 'show', onClick: ->(action) do
13
+ action.components_set targetId: 'vert1', data: { displayed: true }
14
+ end
15
+ scroll.button text: 'hide', onClick: ->(action) do
16
+ action.components_set targetId: 'vert1', data: { displayed: false }
17
+ end
18
+
19
+ scroll.label text: "\n"
7
20
  scroll.h1 text: 'Basic'
8
21
  scroll.panels_vertical backgroundColor: '#b3bac2', childViews: ->(panel) do
9
22
  panel.button text: 'Button1'
File without changes
@@ -2257,7 +2257,7 @@ page.scroll padding: glib_json_padding_body, childViews: ->(scroll) do
2257
2257
  icon_names.each do |icon_name|
2258
2258
  scroll.panels_column lg: { cols: 4 }, childViews: ->(column) do
2259
2259
  column.panels_horizontal align: 'middle', childViews: ->(horizontal) do
2260
- horizontal.icon spec: icon_name
2260
+ horizontal.icon name: icon_name
2261
2261
  horizontal.spacer width: 6
2262
2262
  horizontal.label text: icon_name
2263
2263
 
@@ -11,7 +11,7 @@ json_ui_page json do |page|
11
11
  flow.treeView \
12
12
  inputName: 'user',
13
13
  url: json_ui_garage_url(path: 'forms/generic_post'),
14
- directUploadUrl: rails_direct_uploads_url,
14
+ directUploadUrl: glib_direct_uploads_url,
15
15
  width: 240,
16
16
  selected: 'parent-1',
17
17
  items: [
File without changes
data/config/routes.rb CHANGED
@@ -5,5 +5,7 @@ Glib::Web::Engine.routes.draw do
5
5
  patch 'json_ui_garage', to: 'home#json_ui_garage'
6
6
  delete 'json_ui_garage', to: 'home#json_ui_garage'
7
7
  post 'chat', to: 'home#chat'
8
+
9
+ resources :glib_direct_uploads, only: [:create]
8
10
  end
9
11
  end
@@ -0,0 +1,22 @@
1
+ require 'active_storage/service/s3_service'
2
+
3
+ module ActiveStorage
4
+ class Service::GlibS3Service < Service::S3Service
5
+ attr_accessor :tagging
6
+
7
+ # This is cause problem because S3 server ignore `x-amz-tagging` query params so it fails to tagging an object
8
+ # API: https://docs.aws.amazon.com/sdk-for-ruby/v3/api/Aws/S3/Presigner.html#presigned_request-instance_method
9
+ # Detail about problem: https://github.com/aws/aws-sdk/issues/782
10
+ def url_for_direct_upload(key, expires_in:, content_type:, content_length:, checksum:, custom_metadata: {})
11
+ instrument :url, key: key do |payload|
12
+ generated_url, headers = object_for(key).presigned_request :put, expires_in: expires_in.to_i,
13
+ content_type: content_type, content_length: content_length, content_md5: checksum,
14
+ metadata: custom_metadata, whitelist_headers: ['content-length'], tagging: tagging, **upload_options
15
+
16
+ payload[:url] = generated_url
17
+
18
+ [generated_url, headers]
19
+ end
20
+ end
21
+ end
22
+ end
File without changes
File without changes
File without changes
File without changes
File without changes
data/lib/glib/engine.rb CHANGED
@@ -2,13 +2,6 @@ module Glib
2
2
  module Web
3
3
  class Engine < ::Rails::Engine
4
4
  # isolate_namespace Glib::Web
5
-
6
- # modify direct upload
7
- config.to_prepare do
8
- require_relative 's3_service'
9
- require_relative 'blob'
10
- require_relative 'direct_uploads_controller'
11
- end
12
5
  end
13
6
  end
14
7
  end
File without changes
File without changes
File without changes
File without changes
data/lib/glib/value.rb CHANGED
File without changes
data/lib/glib/version.rb CHANGED
File without changes
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: glib-web
3
3
  version: !ruby/object:Gem::Version
4
- version: 4.1.5
4
+ version: 4.3.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - ''
@@ -14,16 +14,16 @@ dependencies:
14
14
  name: activestorage
15
15
  requirement: !ruby/object:Gem::Requirement
16
16
  requirements:
17
- - - ">="
17
+ - - "~>"
18
18
  - !ruby/object:Gem::Version
19
- version: 5.2.3
19
+ version: '7.0'
20
20
  type: :runtime
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
- - - ">="
24
+ - - "~>"
25
25
  - !ruby/object:Gem::Version
26
- version: 5.2.3
26
+ version: '7.0'
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: pundit
29
29
  requirement: !ruby/object:Gem::Requirement
@@ -56,16 +56,30 @@ dependencies:
56
56
  name: actioncable
57
57
  requirement: !ruby/object:Gem::Requirement
58
58
  requirements:
59
- - - ">="
59
+ - - "~>"
60
60
  - !ruby/object:Gem::Version
61
- version: 6.0.1
61
+ version: '7.0'
62
62
  type: :runtime
63
63
  prerelease: false
64
64
  version_requirements: !ruby/object:Gem::Requirement
65
65
  requirements:
66
- - - ">="
66
+ - - "~>"
67
+ - !ruby/object:Gem::Version
68
+ version: '7.0'
69
+ - !ruby/object:Gem::Dependency
70
+ name: js_regex
71
+ requirement: !ruby/object:Gem::Requirement
72
+ requirements:
73
+ - - "~>"
74
+ - !ruby/object:Gem::Version
75
+ version: '3.11'
76
+ type: :runtime
77
+ prerelease: false
78
+ version_requirements: !ruby/object:Gem::Requirement
79
+ requirements:
80
+ - - "~>"
67
81
  - !ruby/object:Gem::Version
68
- version: 6.0.1
82
+ version: '3.11'
69
83
  description:
70
84
  email: ''
71
85
  executables: []
@@ -86,6 +100,7 @@ files:
86
100
  - app/controllers/concerns/glib/json/traversal.rb
87
101
  - app/controllers/concerns/glib/json/ui.rb
88
102
  - app/controllers/concerns/glib/json/validation.rb
103
+ - app/controllers/glib/glib_direct_uploads_controller.rb
89
104
  - app/controllers/glib/home_controller.rb
90
105
  - app/helpers/glib/app_feature_support_helper.rb
91
106
  - app/helpers/glib/dynamic_images_helper.rb
@@ -302,6 +317,7 @@ files:
302
317
  - app/views/layouts/json_ui/no_custom.html.erb
303
318
  - app/views/layouts/json_ui/renderer.html.erb
304
319
  - config/routes.rb
320
+ - lib/active_storage/service/glib_s3_service.rb
305
321
  - lib/generators/glib/install_generator.rb
306
322
  - lib/generators/templates/20191017062519_create_texts.rb
307
323
  - lib/generators/templates/20191024063257_add_scope_to_texts.rb
@@ -310,9 +326,7 @@ files:
310
326
  - lib/generators/templates/database.yml
311
327
  - lib/generators/templates/dynamic_text.rb
312
328
  - lib/glib-web.rb
313
- - lib/glib/blob.rb
314
329
  - lib/glib/crypt/utils.rb
315
- - lib/glib/direct_uploads_controller.rb
316
330
  - lib/glib/dynamic_text.rb
317
331
  - lib/glib/dynamic_text/config.rb
318
332
  - lib/glib/engine.rb
@@ -330,7 +344,6 @@ files:
330
344
  - lib/glib/json_crawler/http.rb
331
345
  - lib/glib/json_crawler/router.rb
332
346
  - lib/glib/mailer_tester.rb
333
- - lib/glib/s3_service.rb
334
347
  - lib/glib/test_helpers.rb
335
348
  - lib/glib/time_freezable_mailer.rb
336
349
  - lib/glib/time_returning_mailer.rb
@@ -355,7 +368,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
355
368
  - !ruby/object:Gem::Version
356
369
  version: '0'
357
370
  requirements: []
358
- rubygems_version: 3.4.6
371
+ rubyforge_project:
372
+ rubygems_version: 2.7.6
359
373
  signing_key:
360
374
  specification_version: 4
361
375
  summary: ''
data/lib/glib/blob.rb DELETED
@@ -1,23 +0,0 @@
1
- ::ActiveStorage::Blob.class_eval do
2
- attr_accessor :tagging
3
-
4
- # removing custom_metadata and add tagging
5
- def service_headers_for_direct_upload
6
- service.headers_for_direct_upload key, filename: filename, content_type: content_type, content_length: byte_size, checksum: checksum, tagging: tagging
7
- end
8
- def service_url_for_direct_upload(expires_in: ActiveStorage.service_urls_expire_in)
9
- service.url_for_direct_upload key, expires_in: expires_in, content_type: content_type, content_length: byte_size, checksum: checksum, custom_metadata: custom_metadata, tagging: tagging
10
- end
11
-
12
- class << self
13
- def create_before_direct_upload!(key: nil, filename:, byte_size:, checksum:, content_type: nil, metadata: nil, service_name: nil, record: nil, prefix: nil, tagging: nil)
14
- key_name = key || generate_unique_secure_token
15
- if prefix.present?
16
- key_name = "#{prefix}/#{key_name}"
17
- end
18
- blob = create! key: key_name, filename: filename, byte_size: byte_size, checksum: checksum, content_type: content_type, metadata: metadata, service_name: service_name
19
- blob.tagging = tagging
20
- blob
21
- end
22
- end
23
- end
@@ -1,32 +0,0 @@
1
- ::ActiveStorage::DirectUploadsController.class_eval do
2
- # include Rails.application.routes.url_helpers
3
- before_action :authenticate_user!
4
-
5
- rescue_from StandardError do |e|
6
- if !Rails.env.production?
7
- raise e
8
- end
9
- render json: { message: 'Upload failed' }, status: 500
10
- end
11
-
12
- rescue_from Glib::Auth::Policy::UnauthorizedError do
13
- render json: { message: 'Forbidden' }, status: 403
14
- end
15
-
16
- rescue_from ActionController::InvalidAuthenticityToken do
17
- render json: { message: 'Session expired. Please refresh page' }, status: 401
18
- end
19
-
20
- private
21
- def blob_args
22
- params.require(:blob).permit(:filename, :byte_size, :checksum, :content_type, :prefix, :tagging, metadata: {}).to_h.symbolize_keys
23
- end
24
-
25
- def authenticate_user!
26
- current_user.present? ? nil : raise_error
27
- end
28
-
29
- def raise_error
30
- raise Glib::Auth::Policy::UnauthorizedError
31
- end
32
- end
@@ -1,30 +0,0 @@
1
- require 'active_storage/service/s3_service'
2
-
3
- ::ActiveStorage::Service::S3Service.class_eval do
4
- attr_reader :headers_for_request
5
-
6
- # Change presigned_url to presigned_request
7
- # appearently presigned_url hoist all header `x-amz-` to query params.
8
- # This is cause problem because S3 server ignore `x-amz-tagging` query params so it fails to tagging an object
9
- # API: https://docs.aws.amazon.com/sdk-for-ruby/v3/api/Aws/S3/Presigner.html#presigned_request-instance_method
10
- # Detail about problem: https://github.com/aws/aws-sdk/issues/782
11
- def url_for_direct_upload(key, expires_in:, content_type:, content_length:, checksum:, tagging: nil, custom_metadata: {})
12
- instrument :url, key: key do |payload|
13
- generated_url, headers = object_for(key).presigned_request :put, expires_in: expires_in.to_i,
14
- content_type: content_type, content_length: content_length, content_md5: checksum,
15
- metadata: custom_metadata, whitelist_headers: ['content-length'], tagging: tagging, **upload_options
16
-
17
- payload[:url] = generated_url
18
- @headers_for_request = headers
19
-
20
- generated_url
21
- end
22
- end
23
-
24
- def headers_for_direct_upload(key, content_type:, checksum:, filename: nil, disposition: nil, tagging: nil, custom_metadata: {}, **)
25
- content_disposition = content_disposition_with(type: disposition, filename: filename) if filename
26
-
27
- headers = { 'Content-Type' => content_type, 'Content-MD5' => checksum, 'Content-Disposition' => content_disposition, **custom_metadata_headers(custom_metadata) }
28
- headers.merge(headers_for_request)
29
- end
30
- end