glib-web 4.33.2 → 4.34.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/app/views/json_ui/garage/forms/selects.json.jbuilder +17 -3
- data/lib/glib/rubocop/cops/localize.rb +26 -0
- data/lib/glib/rubocop.rb +1 -0
- metadata +8 -6
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: c16c0b1492e8c1d4fb291c5d0583ec13c4992ca2b5ec316a62b416d8a28b7d6b
|
4
|
+
data.tar.gz: b66e7297e95ba58a93926d161c545fbe37f4dbf74c9791709918035390c13194
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: ba8ba85ef6ff6fedcd0099bbcd61fc9296b37aafe83b44537583b7fe61c1e1e05a35b72b70850a36b19ae6a04df35ceafad75a4c7d6b8056403960a26db4802c
|
7
|
+
data.tar.gz: a375d20580ee3e4e3df3a2134b1db9ada9758d2e2516b6ce1ce4e80be1bb47514650a2fa017f919da88e0eb267563b15c639099b924c29b7316db734558c1d9e
|
@@ -4,7 +4,7 @@ page = json_ui_page json
|
|
4
4
|
|
5
5
|
render "#{@path_prefix}/nav_menu", json: json, page: page
|
6
6
|
|
7
|
-
page.form url: json_ui_garage_url(path: 'forms/generic_post'), method: 'post', padding: glib_json_padding_body, childViews: ->(form) do
|
7
|
+
page.form id: 'form', url: json_ui_garage_url(path: 'forms/generic_post'), method: 'post', padding: glib_json_padding_body, childViews: ->(form) do
|
8
8
|
|
9
9
|
form.spacer height: 20
|
10
10
|
form.h2 text: 'Basic select fields'
|
@@ -62,7 +62,7 @@ page.form url: json_ui_garage_url(path: 'forms/generic_post'), method: 'post', p
|
|
62
62
|
options: options,
|
63
63
|
value: ['melbourne', 'sydney'],
|
64
64
|
multiple: true,
|
65
|
-
|
65
|
+
onChange: ->(action) do
|
66
66
|
action.dialogs_alert message: 'Options selected'
|
67
67
|
end
|
68
68
|
|
@@ -141,11 +141,25 @@ page.form url: json_ui_garage_url(path: 'forms/generic_post'), method: 'post', p
|
|
141
141
|
end
|
142
142
|
|
143
143
|
form.fields_select \
|
144
|
+
id: 'lang',
|
144
145
|
name: 'user[languages][]',
|
145
146
|
width: 'matchParent',
|
146
147
|
label: 'Primary Language',
|
147
148
|
options: options,
|
148
149
|
value: ['ja', 'de'],
|
150
|
+
accessory: ->(view) do
|
151
|
+
view.footer padding: { x: 16, y: 10 }, width: 'matchParent', styleClass: 'sticky-footer', childViews: ->(footer) do
|
152
|
+
footer.panels_flow width: 'matchParent', styleClass: 'justify-end', childViews: ->(hori) do
|
153
|
+
hori.label text: 'Reset', styleClass: 'text-primary', onClick: ->(action) do
|
154
|
+
action.components_set targetId: 'lang', data: { value: [] }
|
155
|
+
end
|
156
|
+
hori.spacer width: 16
|
157
|
+
hori.label text: 'Apply', styleClass: 'text-primary', onClick: ->(action) do
|
158
|
+
action.forms_submit targetId: 'form'
|
159
|
+
end
|
160
|
+
end
|
161
|
+
end
|
162
|
+
end,
|
149
163
|
multiple: true
|
150
164
|
|
151
165
|
form.spacer height: 6
|
@@ -196,7 +210,7 @@ page.form url: json_ui_garage_url(path: 'forms/generic_post'), method: 'post', p
|
|
196
210
|
label: 'Time Zone',
|
197
211
|
clearable: true,
|
198
212
|
value: 'America/Chicago'
|
199
|
-
|
213
|
+
# value: 'Australia/Melbourne'
|
200
214
|
|
201
215
|
|
202
216
|
form.button text: 'Submit', onClick: ->(action) { action.forms_submit }
|
@@ -0,0 +1,26 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module RuboCop
|
4
|
+
module Cop
|
5
|
+
module Glib
|
6
|
+
class Localize < Base
|
7
|
+
RESTRICT_ON_SEND = %i[h1 h2 h3 h4 h5 p label markdown
|
8
|
+
fields_text fields_number fields_select fields_password
|
9
|
+
fields_textarea fields_check fields_checkGroup fields_chipGroup
|
10
|
+
fields_timeZone fields_radioGroup fields_date fields_datetime].freeze
|
11
|
+
|
12
|
+
def_node_matcher :watched_key?, <<~PATTERN
|
13
|
+
(send _ _ (hash <(pair (sym {:title | :subtitle | :subsubtitle | :label | :placeholder | :text}) $...) ...>))
|
14
|
+
PATTERN
|
15
|
+
|
16
|
+
def on_send(node)
|
17
|
+
watched_key?(node) do |snode|
|
18
|
+
add_offense(snode.first, message: 'Unlocalized string') if snode.first.str_type? || snode.first.dstr_type?
|
19
|
+
end
|
20
|
+
end
|
21
|
+
|
22
|
+
alias on_csend on_send
|
23
|
+
end
|
24
|
+
end
|
25
|
+
end
|
26
|
+
end
|
data/lib/glib/rubocop.rb
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
require_relative 'rubocop/cops/localize'
|
metadata
CHANGED
@@ -1,11 +1,11 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: glib-web
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 4.
|
4
|
+
version: 4.34.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- ''
|
8
|
-
autorequire:
|
8
|
+
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
11
|
date: 2019-10-04 00:00:00.000000000 Z
|
@@ -122,7 +122,7 @@ dependencies:
|
|
122
122
|
- - ">="
|
123
123
|
- !ruby/object:Gem::Version
|
124
124
|
version: '0'
|
125
|
-
description:
|
125
|
+
description:
|
126
126
|
email: ''
|
127
127
|
executables: []
|
128
128
|
extensions: []
|
@@ -417,6 +417,8 @@ files:
|
|
417
417
|
- lib/glib/json_crawler/http.rb
|
418
418
|
- lib/glib/json_crawler/router.rb
|
419
419
|
- lib/glib/mailer_tester.rb
|
420
|
+
- lib/glib/rubocop.rb
|
421
|
+
- lib/glib/rubocop/cops/localize.rb
|
420
422
|
- lib/glib/snapshot.rb
|
421
423
|
- lib/glib/test_helpers.rb
|
422
424
|
- lib/glib/time_freezable_mailer.rb
|
@@ -424,10 +426,10 @@ files:
|
|
424
426
|
- lib/glib/value.rb
|
425
427
|
- lib/glib/version.rb
|
426
428
|
- lib/tasks/db.rake
|
427
|
-
homepage:
|
429
|
+
homepage:
|
428
430
|
licenses: []
|
429
431
|
metadata: {}
|
430
|
-
post_install_message:
|
432
|
+
post_install_message:
|
431
433
|
rdoc_options: []
|
432
434
|
require_paths:
|
433
435
|
- lib
|
@@ -443,7 +445,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
443
445
|
version: '0'
|
444
446
|
requirements: []
|
445
447
|
rubygems_version: 3.4.6
|
446
|
-
signing_key:
|
448
|
+
signing_key:
|
447
449
|
specification_version: 4
|
448
450
|
summary: ''
|
449
451
|
test_files: []
|