glib-web 3.15.0 → 3.16.1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 3d4698a3bbea4d4960e782ad29170fbb049247d745085663b37d8c2e72f05be6
4
- data.tar.gz: 34958e58ee0067170f948af7fba0aebbd9406e35ac7e34f590f8ac6649b43478
3
+ metadata.gz: a6506d01810212bd6a00ece4f282642215269a2f959748bc89c6f6f030c1b89c
4
+ data.tar.gz: 8d882c41d4155f53e3d6a41b2de5b96c98fbd03fb9d6419fc23c0ec67e9155d8
5
5
  SHA512:
6
- metadata.gz: 74d23493798bec86ec387059376a1cc3e4696938f0eb9c3e9de88c9947c9685bcda9aa6f497a04088ce18d276e57ab62b4733151801f8959501aef8c5a52cc57
7
- data.tar.gz: c0ece3eebef55739e9f5a8baa756594704851eebea6e91232370e9471cfa260f8c04b83fc6ac512957c7c5f4b12c3dbb79cdd3a24601b7e2cde7fdfd7b78205f
6
+ metadata.gz: a1edf3c7be0d464dbe4969b14e5355c623703ea3b6824891cb055cf186e1c019b9057fb125d85d9c4e223679ca145f9a1bb37dec0c4a8f775b67360d761813a9
7
+ data.tar.gz: 9a460d9990353da55df488ec6675178be435296ce2e846da4284e9fc0a758b46b2b51a698450e1eca5ee3ffeddca4b3e265e63ec3fa845a4e5ebf2574e67f64b
@@ -17,6 +17,10 @@ module Glib::Auth
17
17
  helper_method :policy, :can?, :cannot?
18
18
  end
19
19
 
20
+ def assert_current_user_present
21
+ raise UnauthorizedError unless current_user
22
+ end
23
+
20
24
  module Overrides
21
25
 
22
26
  public # Override
@@ -0,0 +1,44 @@
1
+ module Glib::Auth
2
+ # Keep this module small because it needs to be compatible with Devise::FailureApp, which
3
+ # is not a Rails controller.
4
+ module Response
5
+ extend ActiveSupport::Concern
6
+
7
+ included do
8
+ end
9
+
10
+ def glib_json_dialog_mode?
11
+ params[:_dialog].present? # E.g. _dialog=v1
12
+ end
13
+
14
+ def __glib_error_dialog(title, message)
15
+ {
16
+ action: 'dialogs/show',
17
+ # Don't show another dialog, just use the current one since it's a new dialog anyway, which means
18
+ # that it wouldn't contain existing user data.
19
+ updateExisting: glib_json_dialog_mode?,
20
+ title: title,
21
+ body: {
22
+ childViews: [
23
+ {
24
+ "view": "label",
25
+ "text": message
26
+ },
27
+ ],
28
+ "padding": {
29
+ "x": 20,
30
+ "y": 22,
31
+ },
32
+ }
33
+ }
34
+ end
35
+
36
+ def json_ui_401_response
37
+ {
38
+ # Handle dialogs_open and windows_open
39
+ glib_json_dialog_mode? ? :onLoad : :onResponse => __glib_error_dialog(
40
+ 'Your session has ended', 'Please refresh the page and re-login.')
41
+ }
42
+ end
43
+ end
44
+ end
@@ -8,6 +8,8 @@ module Glib::Json::Libs
8
8
  helper_method :json_ui_app_is_android?, :json_ui_app_is_ios?, :json_ui_app_is_web?
9
9
  helper_method :json_ui_redirect_back_or_to
10
10
 
11
+ include Glib::Auth::Response
12
+ helper_method :glib_json_dialog_mode?
11
13
  end
12
14
 
13
15
  def json_ui_app_bundle_id
@@ -77,29 +79,6 @@ module Glib::Json::Libs
77
79
  end
78
80
  end
79
81
 
80
- # The behaviour provided by this convenience method assumes that user is logged in.
81
- # When accessing a forbidden page, redirects to `user_default_url` because we don't
82
- # want the user to get confused in the scenario where after logging in,
83
- # glib_redirect_back_or_to tries to open a page that the user doesn't have access of.
84
- def glib_handle_403(user_default_url)
85
- respond_to do |format|
86
- format.html do
87
- redirect_to user_default_url
88
- end
89
- format.json do
90
- render json: if glib_json_dialog_mode?
91
- { onLoad: __glib_error_dialog('Access denied', "Make sure you're logged in with the correct account.") }
92
- else
93
- {
94
- onResponse: {
95
- action: 'windows/open', url: user_default_url
96
- }
97
- }
98
- end, status: Rails.env.test? ? :forbidden : :ok
99
- end
100
- end
101
- end
102
-
103
82
  def glib_handle_404
104
83
  raise ActionController::RoutingError.new('Not Found')
105
84
 
@@ -122,11 +101,30 @@ module Glib::Json::Libs
122
101
  redirect_to sign_in_url
123
102
  end
124
103
  format.json do
125
- render json: {
126
- # Handle dialogs_open and windows_open
127
- glib_json_dialog_mode? ? :onLoad : :onResponse => __glib_error_dialog(
128
- 'Your session has ended', 'Please refresh the page and re-login.')
129
- }, status: Rails.env.test? ? :unauthorized : :ok
104
+ render json: json_ui_401_response, status: Rails.env.test? ? :unauthorized : :ok
105
+ end
106
+ end
107
+ end
108
+
109
+ # The behaviour provided by this convenience method assumes that user is logged in.
110
+ # When accessing a forbidden page, redirects to `user_default_url` because we don't
111
+ # want the user to get confused in the scenario where after logging in,
112
+ # glib_redirect_back_or_to tries to open a page that the user doesn't have access of.
113
+ def glib_handle_403(user_default_url)
114
+ respond_to do |format|
115
+ format.html do
116
+ redirect_to user_default_url
117
+ end
118
+ format.json do
119
+ render json: if glib_json_dialog_mode?
120
+ { onLoad: __glib_error_dialog('Access denied', "Make sure you're logged in with the correct account.") }
121
+ else
122
+ {
123
+ onResponse: {
124
+ action: 'windows/open', url: user_default_url
125
+ }
126
+ }
127
+ end, status: Rails.env.test? ? :forbidden : :ok
130
128
  end
131
129
  end
132
130
  end
@@ -135,11 +133,6 @@ module Glib::Json::Libs
135
133
  session.delete(REDIRECT_BACK_KEY) || url
136
134
  end
137
135
 
138
- # def glib_redirect_back_or_to(default_url)
139
- # redirect_url = __delete_redirect_back_url(default_url)
140
- # glib_redirect_to redirect_url
141
- # end
142
-
143
136
  def html_ui_redirect_back_or_to(default_url)
144
137
  redirect_url = __delete_redirect_back_url(default_url)
145
138
  redirect_to redirect_url
@@ -152,10 +145,6 @@ module Glib::Json::Libs
152
145
  end
153
146
  end
154
147
 
155
- def glib_json_dialog_mode?
156
- params[:_dialog].present? # E.g. _dialog=v1
157
- end
158
-
159
148
  def __glib_error_dialog(title, message)
160
149
  {
161
150
  action: 'dialogs/show',
@@ -239,7 +228,7 @@ module Glib::Json::Libs
239
228
 
240
229
  def json_libs_rescue_csrf
241
230
  rescue_from ActionController::InvalidAuthenticityToken do |exception|
242
- sign_out(:user)
231
+ # sign_out(:user)
243
232
 
244
233
  # respond_to do |format|
245
234
  # format.json do
@@ -4,13 +4,7 @@ module Glib
4
4
  enum_name = enum_field.to_s
5
5
  keys ||= clazz.defined_enums[enum_name].keys
6
6
  keys.map do |i|
7
- text = clazz.glib_enum_humanize(enum_field, i)
8
- if include_hints
9
- i18n_key = clazz.model_name.i18n_key
10
- if (hint = I18n.t("dt_models.#{i18n_key}.#{enum_name.pluralize}.#{i}.hint")).present?
11
- text += " #{hint}"
12
- end
13
- end
7
+ text = clazz.glib_enum_humanize(enum_field, i, include_hints: include_hints)
14
8
  { text: text, value: i }
15
9
  end
16
10
  end
@@ -258,21 +258,65 @@ class Glib::JsonUi::ViewBuilder
258
258
  string :fileUrl
259
259
  string :fileTitle
260
260
  string :uploadText
261
- string :uploadIcon
261
+ string :uploadIcon # deprecated
262
262
  hash :placeholderView
263
263
  hash :infoSpec
264
+
265
+ def buttonLabels(obj)
266
+ @buttonLabels = ActiveSupport::HashWithIndifferentAccess.new(obj)
267
+ end
268
+
269
+ def created
270
+ @buttonLabels ||= ActiveSupport::HashWithIndifferentAccess.new
271
+ @buttonLabels['change'] ||= I18n.t('common.change') if I18n.exists?('common.change')
272
+ @buttonLabels['upload'] ||= I18n.t('common.upload') if I18n.exists?('common.upload')
273
+ @buttonLabels['delete'] ||= I18n.t('common.delete') if I18n.exists?('common.delete')
274
+
275
+ json.set! :buttonLabels, @buttonLabels
276
+
277
+ super
278
+ end
264
279
  end
265
280
 
266
- class MultipleUpload < AbstractField
281
+ class MultiUpload < AbstractField
267
282
  hash :accepts
268
283
  array :files
269
284
  string :directUploadUrl
270
- string :title
271
- string :subtitle
272
285
  string :uploadTitle
273
286
  string :uploadFailedText
274
287
 
275
288
  required :accepts, :directUploadUrl
289
+
290
+ # deprecated
291
+ def title(value)
292
+ @placeholder = value
293
+ end
294
+
295
+ # deprecated
296
+ def subtitle(value)
297
+ @hint = value
298
+ end
299
+
300
+ def files(values)
301
+ @files = values
302
+ end
303
+
304
+ def created
305
+ super
306
+
307
+ @placeholder ||= I18n.t('common.multi_upload.placeholder', default: nil)
308
+ @hint ||= I18n.t('common.multi_upload.hint', default: nil)
309
+
310
+ json.placeholder @placeholder if @placeholder
311
+ json.hint @hint if @hint
312
+
313
+ if @prop && (form = page.current_form)
314
+ model = form.instance_variable_get(:@model)
315
+ @files ||= model.send(@prop).to_a.map { |file| { name: file.blob&.filename, signed_id: file.signed_id } }
316
+ end
317
+
318
+ json.files @files if @files.present?
319
+ end
276
320
  end
277
321
 
278
322
  # TODO
@@ -337,7 +381,7 @@ class Glib::JsonUi::ViewBuilder
337
381
  class Otp < AbstractField
338
382
  int :length
339
383
  string :type
340
- string :align
384
+ string :align # deprecated
341
385
  end
342
386
 
343
387
  class Rating < AbstractField
@@ -24,7 +24,7 @@ class Glib::JsonUi::ViewBuilder
24
24
  # false
25
25
 
26
26
  # Not all model is ActiveRecord
27
- model.class.try(:reflect_on_association, prop)&.macro == :has_many
27
+ model.class.try(:reflect_on_association, prop)&.macro == :has_many || model.class.try(:reflect_on_attachment, prop)&.macro == :has_many_attached
28
28
  end
29
29
 
30
30
  def self.is_single_association?(model, prop)
@@ -11,21 +11,30 @@ module Glib
11
11
  extend ClassMethods
12
12
  end
13
13
 
14
- def glib_enum_humanize(enum_name, default_enum_value = nil)
15
- self.class.glib_enum_humanize(enum_name, send(enum_name) || default_enum_value)
14
+ def glib_enum_humanize(enum_name, default_enum_value = nil, include_hints: false)
15
+ self.class.glib_enum_humanize(enum_name, send(enum_name) || default_enum_value, include_hints: include_hints)
16
16
  end
17
17
  end
18
18
 
19
19
  module ClassMethods
20
- def glib_enum_humanize(enum_name, enum_value, default_translation = nil)
20
+ def glib_enum_humanize(enum_name, enum_value, default_translation = nil, include_hints: false)
21
21
  if enum_value
22
22
  translation_key = "activerecord.attributes.#{model_name.i18n_key}.#{enum_name.to_s.pluralize}.#{enum_value}"
23
23
 
24
24
  if default_translation.nil? && Rails.env.development?
25
- I18n.t(translation_key, raise: I18n::MissingTranslationData)
25
+ text = I18n.t(translation_key, raise: I18n::MissingTranslationData)
26
26
  else
27
- I18n.t(translation_key, default: default_translation)
27
+ text = I18n.t(translation_key, default: default_translation)
28
28
  end
29
+
30
+ if include_hints
31
+ i18n_key = self.model_name.i18n_key
32
+ if (hint = I18n.t("dt_models.#{i18n_key}.#{enum_name.to_s.pluralize}.#{enum_value}.hint")).present?
33
+ text += " #{hint}"
34
+ end
35
+ end
36
+
37
+ text
29
38
  end
30
39
  end
31
40
  end
@@ -37,12 +37,10 @@ page.form options.merge(childViews: ->(form) do
37
37
  # placeholderView: { type: 'avatar', width: 100, height: 100, url: 'data:image/jpeg;base64,/9j/4AAQSkZJRgABAQAAAQABAAD/2wCEAAkGBxMREBUREhAWFhUWGBcVFRgXFxUVFxcWGRUWFxYVFRUYHSggGB0lHRgVITEhJSkrLi4uGB8zODMtNygtLisBCgoKBQUFDgUFDisZExkrKysrKysrKysrKysrKysrKysrKysrKysrKysrKysrKysrKysrKysrKysrKysrKysrK//AABEIAOMA3gMBIgACEQEDEQH/xAAbAAEAAgMBAQAAAAAAAAAAAAAABgcBAwQFAv/EAEAQAAECAwMKAwYEBAYDAAAAAAEAAgMRIQQSMQUGIjJBUWFxgZEHE6FCUnKxwdEUI2LwM4KSskNzg6LC4WOz8f/EABQBAQAAAAAAAAAAAAAAAAAAAAD/xAAUEQEAAAAAAAAAAAAAAAAAAAAA/9oADAMBAAIRAxEAPwC6XuvCQRj7okcUe27UYoxt4TOKDDG3Knkjm3jeGCMdeoeaOcWmQwQZe6/Qc0a+6Lpx+6PbcqOSNbeF44oMMbcqeSOZeN4YIx1+h5oXEG6MEGXuv0HNGuui6cfuvMytl6zWTXi6XuN039hh1koflPxDe4nyILW/qfpO/pFB6oLDhMLTX0XLbLbChmcSNDZ8T2tPqVUNuy/aY38S0PI3A3W/0tkF5qC4bVnZYsPxLT8Ic71AWgZ72ICXmuP+m/7KpUQWzAzzsQP8Y9Ybx9F0szlsb3TFqhjDW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w7eiA11+hptQvu6P7qsvIOrj2ojSAJOx7+qAW3KiuxAy9pfuiwwEa2HeqOBJmMO3OiAHX6Gm1C65QV2rLzPVx7IwgUdj3QfVp1eqWfVREGqy49PskfW7IiDZasOv3WYGr3REGuy49FiPrdkRBstWHX7rMHV7rKINVlx6LEXX7IiDZasBzWYOp3+qyiDVZcTyWIuv2+iIg2WrAc1mHqdD9URB8WXEr5fr9R9ERBttOr1Sz6vdZRBpsuPT7JH1uyIg2WrDqswdTuiINdlxPJYtOt0REH//2Q==' }
38
38
 
39
39
  form.spacer height: 16
40
- form.fields_multipleUpload \
40
+ form.fields_multiUpload \
41
41
  name: 'user[multi][]',
42
- accepts: rules,
42
+ accepts: { fileType: 'image', maxFileSize: 5000 },
43
43
  directUploadUrl: rails_direct_uploads_url,
44
- title: 'Select file or drag and drop here',
45
- subtitle: 'JPG, PNG or PDF, file size no more than 10MB',
46
44
  uploadTitle: 'File added:',
47
45
  uploadFailedText: '(UPLOAD FAILED)',
48
46
  files: [
@@ -45,10 +45,6 @@ page.form \
45
45
  ]
46
46
  }
47
47
 
48
- form.spacer height: 20
49
- form.h2 text: 'OTP with Alignment right'
50
- form.fields_otp name: 'user[otp_summary6]', width: 'matchParent', type: 'text', value: '1234', align: 'right', length: 5
51
-
52
48
  form.spacer height: 20
53
49
  form.fields_submit text: 'Submit'
54
50
  end
@@ -124,6 +124,20 @@ else
124
124
  end
125
125
  ], legend: 'bottom'
126
126
 
127
+ scroll.h2 text: 'Donut chart'
128
+ scroll.charts_pie \
129
+ styleClasses: ['donut'],
130
+ dataSeries: [
131
+ -> do
132
+ json.title 'Straberry'
133
+ json.value 25
134
+ end,
135
+ -> do
136
+ json.title 'Banana'
137
+ json.value 25
138
+ end
139
+ ], legend: 'bottom'
140
+
127
141
  scroll.h2 text: 'Area chart'
128
142
  scroll.charts_area dataSeries: [
129
143
  -> do
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: 3.15.0
4
+ version: 3.16.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - ''
@@ -78,6 +78,7 @@ files:
78
78
  - app/channels/glib/channel/online_channel.rb
79
79
  - app/controllers/concerns/glib/analytics/funnel.rb
80
80
  - app/controllers/concerns/glib/auth/policy.rb
81
+ - app/controllers/concerns/glib/auth/response.rb
81
82
  - app/controllers/concerns/glib/json/dynamic_text.rb
82
83
  - app/controllers/concerns/glib/json/libs.rb
83
84
  - app/controllers/concerns/glib/json/new_dynamic_text.rb