decidim-dev 0.27.2 → 0.27.4
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/packs/entrypoints/decidim_dev_test_custom_map.js +1 -0
- data/app/packs/src/decidim/dev/test/custom_map_factory.js +55 -0
- data/config/assets.rb +2 -1
- data/config/environment.rb +0 -0
- data/config/locales/ar.yml +18 -0
- data/config/locales/de.yml +8 -0
- data/config/locales/fa-IR.yml +1 -0
- data/config/locales/kaa.yml +1 -0
- data/config/locales/ro-RO.yml +5 -0
- data/config/locales/zh-TW.yml +64 -0
- data/lib/decidim/dev/assets/icon.ico +0 -0
- data/lib/decidim/dev/test/rspec_support/component_context.rb +20 -0
- data/lib/decidim/dev/test/rspec_support/summary_notification.rb +51 -0
- data/lib/decidim/dev/version.rb +1 -1
- data/lib/rubocop/cop/decidim/hash_shorthand_syntax_backports.rb +175 -0
- data/lib/rubocop/cop/decidim.rb +9 -0
- metadata +17 -8
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: a8418d7ae6e85aa4a658a0c52d2e39954b7b8dec097c38b8f071fa4d51b21fa3
|
4
|
+
data.tar.gz: 96bfc08644fb6a5ab4d34eb6d37e222da103d3fb46ed0668acc321b545009ebc
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 240c26feb4ade240648b8ffb1b180d8d1011e994b82da1f470b7a272ca10cfd27627e2d8a5b5927a87f0bcdee2582089b75b8f0cf760aeb257028e2f7e3cc477
|
7
|
+
data.tar.gz: 80e4c51e2e7bbab875f8c39fad8648e4bda54252f5f0045e3eeb297ab1713b2a529f9a76ca83c706297a596797dbb68c17052bd120482c21052d5e7ce9a09b8e
|
@@ -0,0 +1 @@
|
|
1
|
+
import "src/decidim/dev/test/custom_map_factory";
|
@@ -0,0 +1,55 @@
|
|
1
|
+
/**
|
2
|
+
* Example of a custom map controller and how to override the
|
3
|
+
* `createMapController` factory method. To use it in the ERB view, add the
|
4
|
+
* following snippet to any view:
|
5
|
+
*
|
6
|
+
* <%= dynamic_map_for type: "custom", markers: [{ title: "Test 1", latitude: 41.385063, longitude: 2.173404 }], popup_template_id: "custom-popup" do %>
|
7
|
+
* <% javascript_pack_tag("decidim_dev_test_custom_map") %>
|
8
|
+
* <template id="custom-popup">
|
9
|
+
* <div>
|
10
|
+
* <h3>${title}</h3>
|
11
|
+
* </div>
|
12
|
+
* </template>
|
13
|
+
* <% end %>
|
14
|
+
*/
|
15
|
+
|
16
|
+
import MapMarkersController from "src/decidim/map/controller/markers";
|
17
|
+
|
18
|
+
const appendToBody = (content) => {
|
19
|
+
const p = document.createElement("p");
|
20
|
+
p.innerHTML = content;
|
21
|
+
document.body.appendChild(p);
|
22
|
+
}
|
23
|
+
|
24
|
+
class CustomMapController extends MapMarkersController {
|
25
|
+
start() {
|
26
|
+
this.markerClusters = null;
|
27
|
+
this.addMarkers(this.config.markers);
|
28
|
+
|
29
|
+
appendToBody("Custom map started");
|
30
|
+
}
|
31
|
+
}
|
32
|
+
|
33
|
+
const origCreateMapController = window.Decidim.createMapController;
|
34
|
+
|
35
|
+
const createMapController = (mapId, config) => {
|
36
|
+
if (config.type === "custom") {
|
37
|
+
return new CustomMapController(mapId, config);
|
38
|
+
}
|
39
|
+
|
40
|
+
return origCreateMapController(mapId, config);
|
41
|
+
}
|
42
|
+
|
43
|
+
window.Decidim.createMapController = createMapController;
|
44
|
+
|
45
|
+
// Prevent external requests to the Here URLs during tests
|
46
|
+
if (L.TileLayer.HERE) {
|
47
|
+
L.TileLayer.HERE.prototype.onAdd = function(map) {};
|
48
|
+
}
|
49
|
+
|
50
|
+
// Test that the map events are working correctly
|
51
|
+
$("[data-decidim-map]").on("ready.decidim", (ev, _map, mapConfig) => {
|
52
|
+
appendToBody("Custom map ready");
|
53
|
+
});
|
54
|
+
|
55
|
+
appendToBody("LOADED");
|
data/config/assets.rb
CHANGED
@@ -4,5 +4,6 @@ base_path = File.expand_path("..", __dir__)
|
|
4
4
|
|
5
5
|
Decidim::Webpacker.register_path("#{base_path}/app/packs")
|
6
6
|
Decidim::Webpacker.register_entrypoints(
|
7
|
-
decidim_dev: "#{base_path}/app/packs/entrypoints/decidim_dev.js"
|
7
|
+
decidim_dev: "#{base_path}/app/packs/entrypoints/decidim_dev.js",
|
8
|
+
decidim_dev_test_custom_map: "#{base_path}/app/packs/entrypoints/decidim_dev_test_custom_map.js"
|
8
9
|
)
|
File without changes
|
data/config/locales/ar.yml
CHANGED
@@ -4,6 +4,7 @@ ar:
|
|
4
4
|
attributes:
|
5
5
|
dummy_resource:
|
6
6
|
created_at: أنشئت في
|
7
|
+
decidim_scope_id: نطاق
|
7
8
|
field: مجالي
|
8
9
|
start_date: تاريخ البداية
|
9
10
|
title: العنوان
|
@@ -14,12 +15,29 @@ ar:
|
|
14
15
|
dummy:
|
15
16
|
settings:
|
16
17
|
global:
|
18
|
+
guided: المدخلات الموجهة
|
19
|
+
guided_help: نص المساعدة
|
20
|
+
guided_readonly: تعطيل الإدخال
|
21
|
+
guided_rich: مدخلات غنية موجهة
|
22
|
+
guided_rich_help_html: HTML<strong>مساعدة</strong>نص
|
23
|
+
guided_rich_readonly_html: HTML <strong>مساعدة</strong> للمدخلات المعطلة
|
24
|
+
readonly_attribute: سمة القراءة فقط
|
25
|
+
test: فحص
|
26
|
+
test_choices:
|
27
|
+
a: خيار أ
|
28
|
+
b: خيار ب
|
29
|
+
c: خيار ج
|
17
30
|
test_options:
|
18
31
|
bar: شريط
|
32
|
+
baz: الباز
|
19
33
|
foo: فو
|
20
34
|
step:
|
35
|
+
endorsements_blocked: تم حظر التأييدات
|
36
|
+
endorsements_enabled: تم تمكين التأييدات
|
37
|
+
readonly_step_attribute: سمة خطوة للقراءة فقط
|
21
38
|
test_options:
|
22
39
|
bar: شريط
|
40
|
+
baz: الباز
|
23
41
|
foo: فو
|
24
42
|
dummy:
|
25
43
|
admin:
|
data/config/locales/de.yml
CHANGED
@@ -15,6 +15,12 @@ de:
|
|
15
15
|
dummy:
|
16
16
|
settings:
|
17
17
|
global:
|
18
|
+
guided: Geführte Eingabe
|
19
|
+
guided_help: Hilfetext
|
20
|
+
guided_readonly: Deaktivierte Eingabe
|
21
|
+
guided_rich: Geführte reiche Eingabe
|
22
|
+
guided_rich_help_html: HTML <strong>Hilfe</strong> Text
|
23
|
+
guided_rich_readonly_html: HTML <strong>Hilfe</strong> Text für deaktivierte Eingabe
|
18
24
|
readonly_attribute: Attribut schreibgeschützt
|
19
25
|
test: Test A
|
20
26
|
test_choices:
|
@@ -23,6 +29,7 @@ de:
|
|
23
29
|
c: Wahl C
|
24
30
|
test_options:
|
25
31
|
bar: Bar
|
32
|
+
baz: Baz
|
26
33
|
foo: Foo
|
27
34
|
step:
|
28
35
|
endorsements_blocked: Befürwortungen blockiert
|
@@ -30,6 +37,7 @@ de:
|
|
30
37
|
readonly_step_attribute: Schritt-Attribut schreibgeschützt
|
31
38
|
test_options:
|
32
39
|
bar: Bar
|
40
|
+
baz: Baz
|
33
41
|
foo: Foo
|
34
42
|
dummy:
|
35
43
|
admin:
|
@@ -0,0 +1 @@
|
|
1
|
+
fa:
|
@@ -0,0 +1 @@
|
|
1
|
+
kaa:
|
data/config/locales/ro-RO.yml
CHANGED
@@ -15,7 +15,12 @@ ro:
|
|
15
15
|
dummy:
|
16
16
|
settings:
|
17
17
|
global:
|
18
|
+
guided: Introducere ghidată
|
18
19
|
guided_help: Text de ajutor
|
20
|
+
guided_readonly: Intrare dezactivată
|
21
|
+
guided_rich: Introducere ghidată a conținutului bogat
|
22
|
+
guided_rich_help_html: <strong>Ajutor</strong> text pentru HTML
|
23
|
+
guided_rich_readonly_html: <strong>Ajutor</strong> HTML text pentru intrare dezactivată
|
19
24
|
readonly_attribute: Atribut Readonly
|
20
25
|
test: Un test
|
21
26
|
test_choices:
|
data/config/locales/zh-TW.yml
CHANGED
@@ -1 +1,65 @@
|
|
1
|
+
---
|
1
2
|
zh-TW:
|
3
|
+
activemodel:
|
4
|
+
attributes:
|
5
|
+
dummy_resource:
|
6
|
+
created_at: 建立於
|
7
|
+
decidim_scope_id: 範圍
|
8
|
+
field: 我的欄位
|
9
|
+
start_date: 開始日期
|
10
|
+
title: 標題
|
11
|
+
translatable_text: 可翻譯的文字
|
12
|
+
updated_at: 更新於
|
13
|
+
decidim:
|
14
|
+
components:
|
15
|
+
dummy:
|
16
|
+
settings:
|
17
|
+
global:
|
18
|
+
guided: 導引輸入
|
19
|
+
guided_help: 說明文字
|
20
|
+
guided_readonly: 禁用輸入
|
21
|
+
guided_rich: 導引豐富輸入
|
22
|
+
guided_rich_help_html: HTML <strong>說明</strong> 文字
|
23
|
+
guided_rich_readonly_html: 禁用輸入 HTML <strong>說明</strong> 文字
|
24
|
+
readonly_attribute: 唯讀屬性
|
25
|
+
test: A 測試
|
26
|
+
test_choices:
|
27
|
+
a: A選項
|
28
|
+
b: B選項
|
29
|
+
c: C選項
|
30
|
+
test_options:
|
31
|
+
bar: Bar
|
32
|
+
baz: Baz
|
33
|
+
foo: Foo
|
34
|
+
step:
|
35
|
+
endorsements_blocked: 封鎖支持
|
36
|
+
endorsements_enabled: 啟用支持
|
37
|
+
readonly_step_attribute: 唯讀步驟屬性
|
38
|
+
test_options:
|
39
|
+
bar: Bar
|
40
|
+
baz: Baz
|
41
|
+
foo: Foo
|
42
|
+
dummy:
|
43
|
+
admin:
|
44
|
+
exports:
|
45
|
+
dummies: 測試帳戶
|
46
|
+
gamification:
|
47
|
+
badges:
|
48
|
+
test:
|
49
|
+
conditions:
|
50
|
+
- 在Decidim中使用測試環境。
|
51
|
+
description: 參與者通過建立測試可獲得此徽章。
|
52
|
+
description_another: 此參與者已建立了 %{score} 個測試。
|
53
|
+
description_own: 您已建立了 %{score} 個測試。
|
54
|
+
name: 測試
|
55
|
+
next_level_in: 再建立 %{score} 個測試即可達到下一個等級!
|
56
|
+
unearned_another: 這個參與者尚未創建任何測試。
|
57
|
+
unearned_own: 您尚未建立任何測試。
|
58
|
+
resource_links:
|
59
|
+
test_link:
|
60
|
+
dummy_resource_dummy: 相關的測試帳戶
|
61
|
+
statistics:
|
62
|
+
bar: Bar
|
63
|
+
dummies_count_high: 高級測試帳戶
|
64
|
+
dummies_count_medium: 中級測試帳戶
|
65
|
+
foo: Foo
|
Binary file
|
@@ -1,5 +1,25 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
|
+
shared_examples "has mandatory config setting" do |mandatory_field|
|
4
|
+
let(:edit_component_path) do
|
5
|
+
Decidim::EngineRouter.admin_proxy(component.participatory_space).edit_component_path(component.id)
|
6
|
+
end
|
7
|
+
|
8
|
+
before do
|
9
|
+
visit edit_component_path
|
10
|
+
component.update(settings: { mandatory_field => "" })
|
11
|
+
visit edit_component_path
|
12
|
+
end
|
13
|
+
|
14
|
+
it "does not allow updating the component" do
|
15
|
+
click_button "Update"
|
16
|
+
|
17
|
+
within ".#{mandatory_field}_container" do
|
18
|
+
expect(page).to have_content("There's an error in this field")
|
19
|
+
end
|
20
|
+
end
|
21
|
+
end
|
22
|
+
|
3
23
|
shared_context "with a component" do
|
4
24
|
let(:manifest) { Decidim.find_component_manifest(manifest_name) }
|
5
25
|
let(:user) { create :user, :confirmed, organization: organization }
|
@@ -0,0 +1,51 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module RSpec::Core
|
4
|
+
module Notifications
|
5
|
+
class SummaryNotification
|
6
|
+
# Override the original method to add the full path to the spec file and the correct rspec command to rerun the failed spec
|
7
|
+
# The goal is to be able to copy-paste the command to rerun the failed spec without having to manually add the full path to the spec file
|
8
|
+
#
|
9
|
+
# So, instead of:
|
10
|
+
# > rspec ./spec/system/registration_spec.rb:27
|
11
|
+
#
|
12
|
+
# We get:
|
13
|
+
# > bin/rspec ./decidim-core/spec/system/registration_spec.rb:27
|
14
|
+
#
|
15
|
+
# Original code in rspec-core: https://github.com/rspec/rspec-core/blob/8caecca0b9b299ccbaa5c7ea5dd885ab42cd57d3/lib/rspec/core/notifications.rb#L365
|
16
|
+
def colorized_rerun_commands(colorizer=::RSpec::Core::Formatters::ConsoleCodes)
|
17
|
+
rspec_command = running_with_rspec_wrapper? ? "bin/rspec" : "rspec"
|
18
|
+
"\nFailed examples:\n\n" +
|
19
|
+
failed_examples.map do |example|
|
20
|
+
colorizer.wrap("#{rspec_command} #{rerun_argument_for(example)}", RSpec.configuration.failure_color) + " " +
|
21
|
+
colorizer.wrap("# #{example.full_description}", RSpec.configuration.detail_color)
|
22
|
+
end.join("\n")
|
23
|
+
end
|
24
|
+
|
25
|
+
private
|
26
|
+
|
27
|
+
def running_with_rspec_wrapper?
|
28
|
+
$0 == "bin/rspec"
|
29
|
+
end
|
30
|
+
|
31
|
+
def rerun_argument_for(example)
|
32
|
+
if running_with_rspec_wrapper?
|
33
|
+
location = location_rerun_argument_for_decidim(example)
|
34
|
+
else
|
35
|
+
location = example.location_rerun_argument
|
36
|
+
end
|
37
|
+
return location unless duplicate_rerun_locations.include?(location)
|
38
|
+
|
39
|
+
conditionally_quote(example.id)
|
40
|
+
end
|
41
|
+
|
42
|
+
def location_rerun_argument_for_decidim(example)
|
43
|
+
absolute_file_path = example.metadata[:absolute_file_path]
|
44
|
+
file_path = example.metadata[:file_path][1..-1]
|
45
|
+
module_dir = absolute_file_path.gsub(file_path, "").split("/")[-1]
|
46
|
+
|
47
|
+
"./#{module_dir}#{file_path}:#{example.metadata[:line_number]}"
|
48
|
+
end
|
49
|
+
end
|
50
|
+
end
|
51
|
+
end
|
data/lib/decidim/dev/version.rb
CHANGED
@@ -0,0 +1,175 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
#
|
4
|
+
# Originally copied from https://github.com/koic/rubocop/blob/master/lib/rubocop/cop/mixin/hash_shorthand_syntax.rb
|
5
|
+
# Copyright (c) 2012-22 Bozhidar Batsov
|
6
|
+
# MIT License
|
7
|
+
#
|
8
|
+
|
9
|
+
module RuboCop
|
10
|
+
module Cop
|
11
|
+
# This module checks for Ruby 3.1's hash value omission syntax.
|
12
|
+
#
|
13
|
+
# For using this on Decidim, we have added the Decidim namespace and also the Backports prefix
|
14
|
+
# to the module name
|
15
|
+
module Decidim
|
16
|
+
module HashShorthandSyntaxBackports
|
17
|
+
OMIT_HASH_VALUE_MSG = "Omit the hash value."
|
18
|
+
EXPLICIT_HASH_VALUE_MSG = "Include the hash value."
|
19
|
+
DO_NOT_MIX_MSG_PREFIX = "Do not mix explicit and implicit hash values."
|
20
|
+
DO_NOT_MIX_OMIT_VALUE_MSG = "#{DO_NOT_MIX_MSG_PREFIX} #{OMIT_HASH_VALUE_MSG}".freeze
|
21
|
+
DO_NOT_MIX_EXPLICIT_VALUE_MSG = "#{DO_NOT_MIX_MSG_PREFIX} #{EXPLICIT_HASH_VALUE_MSG}".freeze
|
22
|
+
|
23
|
+
def on_hash_for_mixed_shorthand(hash_node)
|
24
|
+
return if ignore_mixed_hash_shorthand_syntax?(hash_node)
|
25
|
+
|
26
|
+
hash_value_type_breakdown = breakdown_value_types_of_hash(hash_node)
|
27
|
+
|
28
|
+
if hash_with_mixed_shorthand_syntax?(hash_value_type_breakdown)
|
29
|
+
mixed_shorthand_syntax_check(hash_value_type_breakdown)
|
30
|
+
else
|
31
|
+
no_mixed_shorthand_syntax_check(hash_value_type_breakdown)
|
32
|
+
end
|
33
|
+
end
|
34
|
+
|
35
|
+
def on_pair(node)
|
36
|
+
return if ignore_hash_shorthand_syntax?(node)
|
37
|
+
|
38
|
+
hash_key_source = node.key.source
|
39
|
+
|
40
|
+
if enforced_shorthand_syntax == "always"
|
41
|
+
return if node.value_omission? || require_hash_value?(hash_key_source, node)
|
42
|
+
|
43
|
+
message = OMIT_HASH_VALUE_MSG
|
44
|
+
replacement = "#{hash_key_source}:"
|
45
|
+
self.config_to_allow_offenses = { "Enabled" => false }
|
46
|
+
else
|
47
|
+
return unless node.value_omission?
|
48
|
+
|
49
|
+
message = EXPLICIT_HASH_VALUE_MSG
|
50
|
+
replacement = "#{hash_key_source}: #{hash_key_source}"
|
51
|
+
end
|
52
|
+
|
53
|
+
register_offense(node, message, replacement)
|
54
|
+
end
|
55
|
+
|
56
|
+
private
|
57
|
+
|
58
|
+
def register_offense(node, message, replacement)
|
59
|
+
add_offense(node.value, message:) do |corrector|
|
60
|
+
corrector.replace(node, replacement)
|
61
|
+
end
|
62
|
+
end
|
63
|
+
|
64
|
+
def ignore_mixed_hash_shorthand_syntax?(hash_node)
|
65
|
+
target_ruby_version <= 3.0 || enforced_shorthand_syntax != "consistent" ||
|
66
|
+
!hash_node.hash_type?
|
67
|
+
end
|
68
|
+
|
69
|
+
def ignore_hash_shorthand_syntax?(pair_node)
|
70
|
+
target_ruby_version <= 3.0 || enforced_shorthand_syntax == "either" ||
|
71
|
+
enforced_shorthand_syntax == "consistent" ||
|
72
|
+
!pair_node.parent.hash_type?
|
73
|
+
end
|
74
|
+
|
75
|
+
def enforced_shorthand_syntax
|
76
|
+
cop_config.fetch("EnforcedShorthandSyntax", "always")
|
77
|
+
end
|
78
|
+
|
79
|
+
def require_hash_value?(hash_key_source, node)
|
80
|
+
return true if !node.key.sym_type? || require_hash_value_for_around_hash_literal?(node)
|
81
|
+
|
82
|
+
hash_value = node.value
|
83
|
+
return true unless hash_value.send_type? || hash_value.lvar_type?
|
84
|
+
|
85
|
+
hash_key_source != hash_value.source || hash_key_source.end_with?("!", "?")
|
86
|
+
end
|
87
|
+
|
88
|
+
def require_hash_value_for_around_hash_literal?(node)
|
89
|
+
return false unless (ancestor = node.parent.parent)
|
90
|
+
return false if ancestor.send_type? && ancestor.method?(:[])
|
91
|
+
|
92
|
+
!node.parent.braces? && !use_element_of_hash_literal_as_receiver?(ancestor, node.parent) &&
|
93
|
+
(use_modifier_form_without_parenthesized_method_call?(ancestor) ||
|
94
|
+
without_parentheses_call_expr_follows?(ancestor))
|
95
|
+
end
|
96
|
+
|
97
|
+
def use_element_of_hash_literal_as_receiver?(ancestor, parent)
|
98
|
+
# `{value:}.do_something` is a valid syntax.
|
99
|
+
ancestor.send_type? && ancestor.receiver == parent
|
100
|
+
end
|
101
|
+
|
102
|
+
def use_modifier_form_without_parenthesized_method_call?(ancestor)
|
103
|
+
return false if ancestor.respond_to?(:parenthesized?) && ancestor.parenthesized?
|
104
|
+
|
105
|
+
ancestor.ancestors.any? { |node| node.respond_to?(:modifier_form?) && node.modifier_form? }
|
106
|
+
end
|
107
|
+
|
108
|
+
def without_parentheses_call_expr_follows?(ancestor)
|
109
|
+
return false unless ancestor.respond_to?(:parenthesized?) && !ancestor.parenthesized?
|
110
|
+
|
111
|
+
right_sibling = ancestor.right_sibling
|
112
|
+
right_sibling ||= ancestor.each_ancestor.find do |node|
|
113
|
+
node.assignment? || node.send_type?
|
114
|
+
end&.right_sibling
|
115
|
+
|
116
|
+
!!right_sibling
|
117
|
+
end
|
118
|
+
|
119
|
+
def breakdown_value_types_of_hash(hash_node)
|
120
|
+
hash_node.pairs.group_by do |pair_node|
|
121
|
+
if pair_node.value_omission?
|
122
|
+
:value_omitted
|
123
|
+
elsif require_hash_value?(pair_node.key.source, pair_node)
|
124
|
+
:value_needed
|
125
|
+
else
|
126
|
+
:value_omittable
|
127
|
+
end
|
128
|
+
end
|
129
|
+
end
|
130
|
+
|
131
|
+
def hash_with_mixed_shorthand_syntax?(hash_value_type_breakdown)
|
132
|
+
hash_value_type_breakdown.keys.size > 1
|
133
|
+
end
|
134
|
+
|
135
|
+
def hash_with_values_that_cant_be_omitted?(hash_value_type_breakdown)
|
136
|
+
hash_value_type_breakdown[:value_needed]&.any?
|
137
|
+
end
|
138
|
+
|
139
|
+
def each_omitted_value_pair(hash_value_type_breakdown, &)
|
140
|
+
hash_value_type_breakdown[:value_omitted]&.each(&)
|
141
|
+
end
|
142
|
+
|
143
|
+
def each_omittable_value_pair(hash_value_type_breakdown, &)
|
144
|
+
hash_value_type_breakdown[:value_omittable]&.each(&)
|
145
|
+
end
|
146
|
+
|
147
|
+
def mixed_shorthand_syntax_check(hash_value_type_breakdown)
|
148
|
+
if hash_with_values_that_cant_be_omitted?(hash_value_type_breakdown)
|
149
|
+
each_omitted_value_pair(hash_value_type_breakdown) do |pair_node|
|
150
|
+
hash_key_source = pair_node.key.source
|
151
|
+
replacement = "#{hash_key_source}: #{hash_key_source}"
|
152
|
+
register_offense(pair_node, DO_NOT_MIX_EXPLICIT_VALUE_MSG, replacement)
|
153
|
+
end
|
154
|
+
else
|
155
|
+
each_omittable_value_pair(hash_value_type_breakdown) do |pair_node|
|
156
|
+
hash_key_source = pair_node.key.source
|
157
|
+
replacement = "#{hash_key_source}:"
|
158
|
+
register_offense(pair_node, DO_NOT_MIX_OMIT_VALUE_MSG, replacement)
|
159
|
+
end
|
160
|
+
end
|
161
|
+
end
|
162
|
+
|
163
|
+
def no_mixed_shorthand_syntax_check(hash_value_type_breakdown)
|
164
|
+
return if hash_with_values_that_cant_be_omitted?(hash_value_type_breakdown)
|
165
|
+
|
166
|
+
each_omittable_value_pair(hash_value_type_breakdown) do |pair_node|
|
167
|
+
hash_key_source = pair_node.key.source
|
168
|
+
replacement = "#{hash_key_source}:"
|
169
|
+
register_offense(pair_node, OMIT_HASH_VALUE_MSG, replacement)
|
170
|
+
end
|
171
|
+
end
|
172
|
+
end
|
173
|
+
end
|
174
|
+
end
|
175
|
+
end
|
metadata
CHANGED
@@ -1,16 +1,16 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: decidim-dev
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.27.
|
4
|
+
version: 0.27.4
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Josep Jaume Rey Peroy
|
8
8
|
- Marc Riera Casals
|
9
9
|
- Oriol Gual Oliva
|
10
|
-
autorequire:
|
10
|
+
autorequire:
|
11
11
|
bindir: bin
|
12
12
|
cert_chain: []
|
13
|
-
date: 2023-
|
13
|
+
date: 2023-07-27 00:00:00.000000000 Z
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|
16
16
|
name: capybara
|
@@ -32,14 +32,14 @@ dependencies:
|
|
32
32
|
requirements:
|
33
33
|
- - '='
|
34
34
|
- !ruby/object:Gem::Version
|
35
|
-
version: 0.27.
|
35
|
+
version: 0.27.4
|
36
36
|
type: :runtime
|
37
37
|
prerelease: false
|
38
38
|
version_requirements: !ruby/object:Gem::Requirement
|
39
39
|
requirements:
|
40
40
|
- - '='
|
41
41
|
- !ruby/object:Gem::Version
|
42
|
-
version: 0.27.
|
42
|
+
version: 0.27.4
|
43
43
|
- !ruby/object:Gem::Dependency
|
44
44
|
name: factory_bot_rails
|
45
45
|
requirement: !ruby/object:Gem::Requirement
|
@@ -408,15 +408,18 @@ files:
|
|
408
408
|
- app/mailers/decidim/dummy_resources/dummy_resource_mailer.rb
|
409
409
|
- app/packs/entrypoints/decidim_dev.js
|
410
410
|
- app/packs/entrypoints/decidim_dev.scss
|
411
|
+
- app/packs/entrypoints/decidim_dev_test_custom_map.js
|
411
412
|
- app/packs/images/decidim/decidim_dev_dummy.svg
|
412
413
|
- app/packs/images/decidim/gamification/badges/decidim_gamification_badges_test.svg
|
413
414
|
- app/packs/src/decidim/dev/accessibility.js
|
415
|
+
- app/packs/src/decidim/dev/test/custom_map_factory.js
|
414
416
|
- app/packs/stylesheets/decidim/dev.scss
|
415
417
|
- app/packs/stylesheets/decidim/dev/_accessibility.scss
|
416
418
|
- app/views/decidim/dummy_resource/_linked_dummys.html.erb
|
417
419
|
- app/views/decidim/dummy_resources/dummy_resources/foo.html.erb
|
418
420
|
- app/views/decidim/dummy_resources/dummy_resources/show.html.erb
|
419
421
|
- config/assets.rb
|
422
|
+
- config/environment.rb
|
420
423
|
- config/locales/am-ET.yml
|
421
424
|
- config/locales/ar-SA.yml
|
422
425
|
- config/locales/ar.yml
|
@@ -439,6 +442,7 @@ files:
|
|
439
442
|
- config/locales/et-EE.yml
|
440
443
|
- config/locales/et.yml
|
441
444
|
- config/locales/eu.yml
|
445
|
+
- config/locales/fa-IR.yml
|
442
446
|
- config/locales/fi-pl.yml
|
443
447
|
- config/locales/fi-plain.yml
|
444
448
|
- config/locales/fi.yml
|
@@ -457,6 +461,7 @@ files:
|
|
457
461
|
- config/locales/it.yml
|
458
462
|
- config/locales/ja.yml
|
459
463
|
- config/locales/ka-GE.yml
|
464
|
+
- config/locales/kaa.yml
|
460
465
|
- config/locales/ko-KR.yml
|
461
466
|
- config/locales/ko.yml
|
462
467
|
- config/locales/lb-LU.yml
|
@@ -509,6 +514,7 @@ files:
|
|
509
514
|
- lib/decidim/dev/assets/dummy-dummies-example.xlsx
|
510
515
|
- lib/decidim/dev/assets/geocoder_result_here.json
|
511
516
|
- lib/decidim/dev/assets/geocoder_result_osm.json
|
517
|
+
- lib/decidim/dev/assets/icon.ico
|
512
518
|
- lib/decidim/dev/assets/icon.png
|
513
519
|
- lib/decidim/dev/assets/id.jpg
|
514
520
|
- lib/decidim/dev/assets/import_participatory_space_private_users.csv
|
@@ -585,6 +591,7 @@ files:
|
|
585
591
|
- lib/decidim/dev/test/rspec_support/rake_tasks.rb
|
586
592
|
- lib/decidim/dev/test/rspec_support/route_helpers.rb
|
587
593
|
- lib/decidim/dev/test/rspec_support/screenshot_helper.rb
|
594
|
+
- lib/decidim/dev/test/rspec_support/summary_notification.rb
|
588
595
|
- lib/decidim/dev/test/rspec_support/time_helpers.rb
|
589
596
|
- lib/decidim/dev/test/rspec_support/timezone.rb
|
590
597
|
- lib/decidim/dev/test/rspec_support/translation_helpers.rb
|
@@ -596,6 +603,8 @@ files:
|
|
596
603
|
- lib/decidim/dev/test/spec_helper.rb
|
597
604
|
- lib/decidim/dev/test/w3c_rspec_validators_overrides.rb
|
598
605
|
- lib/decidim/dev/version.rb
|
606
|
+
- lib/rubocop/cop/decidim.rb
|
607
|
+
- lib/rubocop/cop/decidim/hash_shorthand_syntax_backports.rb
|
599
608
|
- lib/tasks/generators.rake
|
600
609
|
- lib/tasks/lighthouse_report.rake
|
601
610
|
- lib/tasks/locale_checker.rake
|
@@ -603,7 +612,7 @@ homepage: https://github.com/decidim/decidim
|
|
603
612
|
licenses:
|
604
613
|
- AGPL-3.0
|
605
614
|
metadata: {}
|
606
|
-
post_install_message:
|
615
|
+
post_install_message:
|
607
616
|
rdoc_options: []
|
608
617
|
require_paths:
|
609
618
|
- lib
|
@@ -618,8 +627,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
618
627
|
- !ruby/object:Gem::Version
|
619
628
|
version: '0'
|
620
629
|
requirements: []
|
621
|
-
rubygems_version: 3.
|
622
|
-
signing_key:
|
630
|
+
rubygems_version: 3.2.22
|
631
|
+
signing_key:
|
623
632
|
specification_version: 4
|
624
633
|
summary: Decidim dev tools
|
625
634
|
test_files: []
|