glib-web 3.18.0 → 3.19.0

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: cbf4af5c0e02aea2238b616b170aa599142eec1ed727bfce9e8a8038a36e977f
4
- data.tar.gz: 84f52100bf5e06d9483b25cac43f0b24348b49fdb1ad48e34e939325ba50d36a
3
+ metadata.gz: 67f1a12f58e636eebfea51213e913bf4a5dcd1f131f6d1fbbb8794391ac9493a
4
+ data.tar.gz: 8facd85fed8676d112978f51b1d7712374f91ba4f99bef116516f69354485ff2
5
5
  SHA512:
6
- metadata.gz: 2e2c42eb2808ebe550d8893ff99da8d53214b881c05e59222344a28e267433653c747412950b367ff83edddb9d3f461f42e0bd6c474cd4d0486ee58787692377
7
- data.tar.gz: 708220ca4f04d992f606bc579e90942b5e625f17e2fe80091396521203a1ef7026c614e7642e6438e7717f468aa8a2fefea46e65a32a27445f5644be98165e1f
6
+ metadata.gz: b0b873948a68e24fd6fc0c2e9d2aaafa11c4f0102bfa33fc9b433703998bf502cda9e0a201bd2112d7f58834ea649846c9b3351e756e58288781c9211741fa9e
7
+ data.tar.gz: 4ea2b19bfbb4e3ae62998ff1fc7db9021c1f5019b93a0b9a4f59ce39d3375b5b6655b48a2e2288881d7802489da27bba0f02ee32ee8bd106ae49a88b1ec8500a
@@ -301,7 +301,7 @@ class Glib::JsonUi::ViewBuilder
301
301
  array :files
302
302
  string :directUploadUrl
303
303
  string :uploadTitle
304
- string :uploadFailedText
304
+ string :uploadFailedText # deprecated
305
305
 
306
306
  required :accepts, :directUploadUrl
307
307
 
@@ -319,12 +319,27 @@ class Glib::JsonUi::ViewBuilder
319
319
  @files = values
320
320
  end
321
321
 
322
+ def responseMessages(values)
323
+ @responseMessages = values
324
+ end
325
+
322
326
  def created
323
327
  super
324
328
 
325
329
  @placeholder ||= I18n.t('common.multi_upload.placeholder', default: nil)
326
330
  @hint ||= I18n.t('common.multi_upload.hint', default: nil)
327
331
 
332
+ ['200', '403', '401', 'else'].each do |status|
333
+ key = "common.multi_upload.responseMessages.#{status}"
334
+ @responseMessages[status] = I18n.t(key) if I18n.exists?(key)
335
+ end
336
+ json.responseMessages (@responseMessages || {}).reverse_merge({
337
+ '200' => 'File uploaded',
338
+ '403' => 'Forbidden',
339
+ '401' => 'Session expired',
340
+ 'else' => 'Upload failed'
341
+ })
342
+
328
343
  json.placeholder @placeholder if @placeholder
329
344
  json.hint @hint if @hint
330
345
 
@@ -39,6 +39,7 @@ page.form options.merge(childViews: ->(form) do
39
39
  form.spacer height: 16
40
40
  form.fields_multiUpload \
41
41
  name: 'user[multi][]',
42
+ width: 360,
42
43
  accepts: { fileType: 'image', maxFileSize: 5000 },
43
44
  directUploadUrl: rails_direct_uploads_url,
44
45
  uploadTitle: 'Files uploaded:',
@@ -3,8 +3,13 @@ json.title 'Forms'
3
3
  page = json_ui_page json
4
4
  render "#{@path_prefix}/nav_menu", json: json, page: page
5
5
 
6
+ if Object.const_defined?('User')
7
+ record = User.first
8
+ end
9
+
6
10
  page.form \
7
11
  url: json_ui_garage_url(path: 'forms/generic_post'),
12
+ model: record,
8
13
  method: 'post',
9
14
  padding: glib_json_padding_body,
10
15
  childViews: ->(form) do
@@ -65,6 +70,14 @@ page.form \
65
70
  max: '2021-03-01',
66
71
  value: '2021-11'
67
72
 
73
+ if record.present?
74
+ form.fields_datetime \
75
+ prop: :created_at,
76
+ label: 'User created at',
77
+ placeholder: 'User created at',
78
+ width: 'matchParent'
79
+ end
80
+
68
81
  form.spacer height: 20
69
82
  form.h2 text: 'Country'
70
83
  form.spacer height: 6
@@ -37,7 +37,7 @@ else
37
37
  'Thu, 15 Nov 2018' => 1,
38
38
  'Fri, 16 Nov 2018' => 5,
39
39
  }
40
- json.points points.map { |k, v| { x: k, y: v } }
40
+ json.points points.map { |k, v| { x: k, y: v, label: v > 5 ? 'Greater than five' : v } }
41
41
  end,
42
42
  -> do
43
43
  json.title 'Line 2'
@@ -51,7 +51,7 @@ else
51
51
  'Thu, 15 Nov 2018' => 5,
52
52
  'Fri, 16 Nov 2018' => 1,
53
53
  }
54
- json.points points.map { |k, v| { x: k, y: v } }
54
+ json.points points.map { |k, v| { x: k, y: v, label: v > 5 ? 'Greater than five' : v } }
55
55
  end
56
56
  ],
57
57
  plugins: default_plugins,
@@ -132,7 +132,7 @@ else
132
132
  legend: { display: false },
133
133
  colors: ['#fc5a8d', '#F5E216'],
134
134
  plugins: plugins,
135
- dataPoints: [{ title: 'Strawberry', value: 25 }, { title: 'Banana', value: 75 }], legend: { display: false }
135
+ dataPoints: [{ title: 'Strawberry', value: 25, label: '❤ Strawberry' }, { title: 'Banana', value: 75, label: '❤ Banana' }], legend: { display: false }
136
136
 
137
137
  scroll.h2 text: 'Donut chart'
138
138
  scroll.charts_pie \
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.18.0
4
+ version: 3.19.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - ''