decidim-dev 0.21.0 → 0.22.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/assets/images/decidim/dummy.svg +1 -4
- data/app/assets/images/decidim/gamification/badges/test.svg +1 -145
- data/app/commands/decidim/dummy_resources/create_dummy_resource.rb +48 -0
- data/app/forms/decidim/dummy_resources/dummy_resource_form.rb +3 -0
- data/config/locales/bg-BG.yml +56 -0
- data/config/locales/ca.yml +15 -0
- data/config/locales/cs.yml +16 -1
- data/config/locales/da-DK.yml +1 -0
- data/config/locales/de.yml +16 -0
- data/config/locales/el.yml +55 -0
- data/config/locales/en.yml +15 -0
- data/config/locales/es-MX.yml +15 -0
- data/config/locales/es-PY.yml +15 -0
- data/config/locales/es.yml +15 -0
- data/config/locales/et-EE.yml +1 -0
- data/config/locales/fi-plain.yml +15 -0
- data/config/locales/fi.yml +15 -0
- data/config/locales/fr-CA.yml +56 -0
- data/config/locales/fr.yml +15 -0
- data/config/locales/ga-IE.yml +1 -0
- data/config/locales/hr-HR.yml +1 -0
- data/config/locales/hu.yml +9 -0
- data/config/locales/it.yml +17 -2
- data/config/locales/ja-JP.yml +56 -0
- data/config/locales/lt-LT.yml +1 -0
- data/config/locales/lv-LV.yml +54 -0
- data/config/locales/mt-MT.yml +1 -0
- data/config/locales/nl.yml +15 -0
- data/config/locales/pl.yml +26 -10
- data/config/locales/pt-BR.yml +1 -1
- data/config/locales/pt.yml +26 -10
- data/config/locales/ro-RO.yml +56 -0
- data/config/locales/sk-SK.yml +47 -0
- data/config/locales/sk.yml +47 -0
- data/config/locales/sl.yml +5 -0
- data/config/locales/sr-CS.yml +8 -0
- data/config/locales/sv.yml +15 -0
- data/lib/decidim/dev/assets/city.jpeg +0 -0
- data/lib/decidim/dev/assets/city2.jpeg +0 -0
- data/lib/decidim/dev/assets/city3.jpeg +0 -0
- data/lib/decidim/dev/test/rspec_support/authorization.rb +3 -0
- data/lib/decidim/dev/test/rspec_support/capybara_data_picker.rb +15 -5
- data/lib/decidim/dev/test/rspec_support/capybara_scopes_picker.rb +5 -5
- data/lib/decidim/dev/test/rspec_support/component.rb +71 -2
- data/lib/decidim/dev/test/rspec_support/confirmation_helpers.rb +60 -0
- data/lib/decidim/dev/test/rspec_support/helpers.rb +2 -2
- data/lib/decidim/dev/version.rb +1 -1
- metadata +23 -7
- data/lib/decidim/dev/test/rspec_support/capybara_proposals_picker.rb +0 -51
data/config/locales/pt-BR.yml
CHANGED
data/config/locales/pt.yml
CHANGED
|
@@ -3,11 +3,27 @@ pt:
|
|
|
3
3
|
attributes:
|
|
4
4
|
dummy_resource:
|
|
5
5
|
created_at: Criado em
|
|
6
|
-
|
|
6
|
+
decidim_scope_id: Âmbito
|
|
7
|
+
field: O meu campo
|
|
7
8
|
start_date: Data de início
|
|
8
9
|
title: Título
|
|
10
|
+
translatable_text: Texto traduzível
|
|
9
11
|
updated_at: Atualizado em
|
|
10
12
|
decidim:
|
|
13
|
+
components:
|
|
14
|
+
dummy:
|
|
15
|
+
settings:
|
|
16
|
+
global:
|
|
17
|
+
readonly_attribute: Atributo só de leitura
|
|
18
|
+
test: Teste A
|
|
19
|
+
test_choices:
|
|
20
|
+
a: Escolha A
|
|
21
|
+
b: Escolha B
|
|
22
|
+
c: Escolha C
|
|
23
|
+
step:
|
|
24
|
+
endorsements_blocked: Endossamentos bloqueados
|
|
25
|
+
endorsements_enabled: Endossamentos ativados
|
|
26
|
+
readonly_step_attribute: Atributo de passo só de leitura
|
|
11
27
|
dummy:
|
|
12
28
|
admin:
|
|
13
29
|
exports:
|
|
@@ -16,24 +32,24 @@ pt:
|
|
|
16
32
|
badges:
|
|
17
33
|
test:
|
|
18
34
|
conditions:
|
|
19
|
-
-
|
|
20
|
-
description: Os
|
|
21
|
-
description_another: Este
|
|
22
|
-
description_own:
|
|
35
|
+
- Utilize um ambiente de teste para decidim.
|
|
36
|
+
description: Os participantes obtêm este distintivo ao criarem testes.
|
|
37
|
+
description_another: Este participante criou %{score} testes.
|
|
38
|
+
description_own: Criou %{score} testes.
|
|
23
39
|
name: Testes
|
|
24
40
|
next_level_in: Crie mais %{score} testes para alcançar o próximo nível!
|
|
25
|
-
unearned_another: Este
|
|
26
|
-
unearned_own:
|
|
41
|
+
unearned_another: Este participante ainda não criou nenhum teste.
|
|
42
|
+
unearned_own: Ainda não criou qualquer teste.
|
|
27
43
|
pages:
|
|
28
44
|
home:
|
|
29
45
|
statistics:
|
|
30
46
|
bar: Barra
|
|
31
|
-
dummies_count_high:
|
|
32
|
-
dummies_count_medium:
|
|
47
|
+
dummies_count_high: Fictícias alto
|
|
48
|
+
dummies_count_medium: Fictícias médio
|
|
33
49
|
foo: Foo
|
|
34
50
|
participatory_processes:
|
|
35
51
|
statistics:
|
|
36
|
-
dummies_count_high:
|
|
52
|
+
dummies_count_high: Fictícias alto
|
|
37
53
|
dummies_count_medium: Dummies médio
|
|
38
54
|
resource_links:
|
|
39
55
|
test_link:
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
ro:
|
|
2
|
+
activemodel:
|
|
3
|
+
attributes:
|
|
4
|
+
dummy_resource:
|
|
5
|
+
created_at: Creat la
|
|
6
|
+
decidim_scope_id: Domeniu
|
|
7
|
+
field: Câmpul meu
|
|
8
|
+
start_date: Data de început
|
|
9
|
+
title: Titlu
|
|
10
|
+
translatable_text: Text traductibil
|
|
11
|
+
updated_at: Actualizat la
|
|
12
|
+
decidim:
|
|
13
|
+
components:
|
|
14
|
+
dummy:
|
|
15
|
+
settings:
|
|
16
|
+
global:
|
|
17
|
+
readonly_attribute: Atribut Readonly
|
|
18
|
+
test: Un test
|
|
19
|
+
test_choices:
|
|
20
|
+
a: O alegere
|
|
21
|
+
b: Alegere B
|
|
22
|
+
c: Alegere C
|
|
23
|
+
step:
|
|
24
|
+
endorsements_blocked: Aprobări blocate
|
|
25
|
+
endorsements_enabled: Aprobări activate
|
|
26
|
+
readonly_step_attribute: Atribut pas Readonly
|
|
27
|
+
dummy:
|
|
28
|
+
admin:
|
|
29
|
+
exports:
|
|
30
|
+
dummies: Dummieri
|
|
31
|
+
gamification:
|
|
32
|
+
badges:
|
|
33
|
+
test:
|
|
34
|
+
conditions:
|
|
35
|
+
- Utilizaţi un mediu de testare pentru decidim.
|
|
36
|
+
description: Participanții obțin această insignă prin crearea de teste.
|
|
37
|
+
description_another: Acest participant a creat %{score} teste.
|
|
38
|
+
description_own: Ați creat %{score} teste.
|
|
39
|
+
name: Teste
|
|
40
|
+
next_level_in: Crează încă %{score} teste pentru a atinge următorul nivel!
|
|
41
|
+
unearned_another: Acest participant nu a creat încă niciun test.
|
|
42
|
+
unearned_own: Nu ați creat încă niciun test.
|
|
43
|
+
pages:
|
|
44
|
+
home:
|
|
45
|
+
statistics:
|
|
46
|
+
bar: Bară
|
|
47
|
+
dummies_count_high: Dummieri mari
|
|
48
|
+
dummies_count_medium: Medie de ficare
|
|
49
|
+
foo: Foo
|
|
50
|
+
participatory_processes:
|
|
51
|
+
statistics:
|
|
52
|
+
dummies_count_high: Dummieri mari
|
|
53
|
+
dummies_count_medium: Medie de ficare
|
|
54
|
+
resource_links:
|
|
55
|
+
test_link:
|
|
56
|
+
dummy_resource_dummy: Legat de manechin
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
sk:
|
|
2
|
+
activemodel:
|
|
3
|
+
attributes:
|
|
4
|
+
dummy_resource:
|
|
5
|
+
created_at: Vytvorené
|
|
6
|
+
field: Moje pole
|
|
7
|
+
start_date: Dátum začatia
|
|
8
|
+
title: Názov
|
|
9
|
+
translatable_text: Text na preloženie
|
|
10
|
+
updated_at: Aktualizované
|
|
11
|
+
decidim:
|
|
12
|
+
components:
|
|
13
|
+
dummy:
|
|
14
|
+
settings:
|
|
15
|
+
step:
|
|
16
|
+
endorsements_blocked: Zablokovanie podpory
|
|
17
|
+
endorsements_enabled: Povolenie podpory
|
|
18
|
+
dummy:
|
|
19
|
+
admin:
|
|
20
|
+
exports:
|
|
21
|
+
dummies: Indikátory (dummy variable)
|
|
22
|
+
gamification:
|
|
23
|
+
badges:
|
|
24
|
+
test:
|
|
25
|
+
conditions:
|
|
26
|
+
- Použiť testovacie prostredie pre decidim.
|
|
27
|
+
description: Účastníci dostanú tento odznak za vytváranie testov.
|
|
28
|
+
description_another: Tento účastník vytvoril %{score} testov.
|
|
29
|
+
description_own: Vytvorili ste %{score} testov.
|
|
30
|
+
name: Testy
|
|
31
|
+
next_level_in: Vytvorte o %{score} testov viac pre dosiahnutie ďalšej úrovne!
|
|
32
|
+
unearned_another: Tento účastník nevytvoril žiadny test.
|
|
33
|
+
unearned_own: Zatiaľ ste nevytvorili žiadny test.
|
|
34
|
+
pages:
|
|
35
|
+
home:
|
|
36
|
+
statistics:
|
|
37
|
+
bar: Stĺpec
|
|
38
|
+
dummies_count_high: Vysoký počet testovacích premenných
|
|
39
|
+
dummies_count_medium: Stredný počet testovacích premenných
|
|
40
|
+
foo: Test
|
|
41
|
+
participatory_processes:
|
|
42
|
+
statistics:
|
|
43
|
+
dummies_count_high: Vysoký počet testovacích premenných
|
|
44
|
+
dummies_count_medium: Stredný počet testovacích premenných
|
|
45
|
+
resource_links:
|
|
46
|
+
test_link:
|
|
47
|
+
dummy_resource_dummy: Súvisiace indikátory
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
sk:
|
|
2
|
+
activemodel:
|
|
3
|
+
attributes:
|
|
4
|
+
dummy_resource:
|
|
5
|
+
created_at: Vytvorené
|
|
6
|
+
field: Moje pole
|
|
7
|
+
start_date: Dátum začatia
|
|
8
|
+
title: Názov
|
|
9
|
+
translatable_text: Text na preloženie
|
|
10
|
+
updated_at: Aktualizované
|
|
11
|
+
decidim:
|
|
12
|
+
components:
|
|
13
|
+
dummy:
|
|
14
|
+
settings:
|
|
15
|
+
step:
|
|
16
|
+
endorsements_blocked: Zablokovanie podpory
|
|
17
|
+
endorsements_enabled: Povolenie podpory
|
|
18
|
+
dummy:
|
|
19
|
+
admin:
|
|
20
|
+
exports:
|
|
21
|
+
dummies: Indikátory (dummy variable)
|
|
22
|
+
gamification:
|
|
23
|
+
badges:
|
|
24
|
+
test:
|
|
25
|
+
conditions:
|
|
26
|
+
- Použiť testovacie prostredie pre decidim.
|
|
27
|
+
description: Účastníci dostanú tento odznak za vytváranie testov.
|
|
28
|
+
description_another: Tento účastník vytvoril %{score} testov.
|
|
29
|
+
description_own: Vytvorili ste %{score} testov.
|
|
30
|
+
name: Testy
|
|
31
|
+
next_level_in: Vytvorte o %{score} testov viac pre dosiahnutie ďalšej úrovne!
|
|
32
|
+
unearned_another: Tento účastník nevytvoril žiadny test.
|
|
33
|
+
unearned_own: Zatiaľ ste nevytvorili žiadny test.
|
|
34
|
+
pages:
|
|
35
|
+
home:
|
|
36
|
+
statistics:
|
|
37
|
+
bar: Stĺpec
|
|
38
|
+
dummies_count_high: Vysoký počet testovacích premenných
|
|
39
|
+
dummies_count_medium: Stredný počet testovacích premenných
|
|
40
|
+
foo: Test
|
|
41
|
+
participatory_processes:
|
|
42
|
+
statistics:
|
|
43
|
+
dummies_count_high: Vysoký počet testovacích premenných
|
|
44
|
+
dummies_count_medium: Stredný počet testovacích premenných
|
|
45
|
+
resource_links:
|
|
46
|
+
test_link:
|
|
47
|
+
dummy_resource_dummy: Súvisiace indikátory
|
data/config/locales/sv.yml
CHANGED
|
@@ -3,12 +3,27 @@ sv:
|
|
|
3
3
|
attributes:
|
|
4
4
|
dummy_resource:
|
|
5
5
|
created_at: Skapad
|
|
6
|
+
decidim_scope_id: Omfattning
|
|
6
7
|
field: Mitt fält
|
|
7
8
|
start_date: Startdatum
|
|
8
9
|
title: Titel
|
|
9
10
|
translatable_text: Översättningsbar text
|
|
10
11
|
updated_at: Uppdaterad
|
|
11
12
|
decidim:
|
|
13
|
+
components:
|
|
14
|
+
dummy:
|
|
15
|
+
settings:
|
|
16
|
+
global:
|
|
17
|
+
readonly_attribute: Skrivskyddat attribut
|
|
18
|
+
test: Ett test
|
|
19
|
+
test_choices:
|
|
20
|
+
a: Ett val
|
|
21
|
+
b: B val
|
|
22
|
+
c: C val
|
|
23
|
+
step:
|
|
24
|
+
endorsements_blocked: Instämmanden är blockerade
|
|
25
|
+
endorsements_enabled: Instämmanden tillåtna
|
|
26
|
+
readonly_step_attribute: Skrivskyddade steg attribut
|
|
12
27
|
dummy:
|
|
13
28
|
admin:
|
|
14
29
|
exports:
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
@@ -14,6 +14,7 @@ module Decidim
|
|
|
14
14
|
routes do
|
|
15
15
|
root to: proc { [200, {}, ["DUMMY VERIFICATION ENGINE"]] }
|
|
16
16
|
get :edit_authorization, to: proc { [200, {}, ["CONTINUE YOUR VERIFICATION"]] }
|
|
17
|
+
get :renew_authorization, to: proc { [200, {}, ["RENEW YOUR VERIFICATION"]] }
|
|
17
18
|
end
|
|
18
19
|
end
|
|
19
20
|
end
|
|
@@ -23,6 +24,8 @@ end
|
|
|
23
24
|
Decidim::Verifications.register_workflow(:dummy_authorization_workflow) do |workflow|
|
|
24
25
|
workflow.engine = Decidim::Verifications::DummyVerification::Engine
|
|
25
26
|
workflow.expires_in = 1.hour
|
|
27
|
+
workflow.renewable = true
|
|
28
|
+
workflow.time_between_renewals = 5.minutes
|
|
26
29
|
end
|
|
27
30
|
|
|
28
31
|
RSpec.configure do |config|
|
|
@@ -6,15 +6,13 @@ module Capybara
|
|
|
6
6
|
Struct.new(:data_picker, :global_value).new(find_data_picker(id, multiple: multiple), global_value)
|
|
7
7
|
end
|
|
8
8
|
|
|
9
|
-
private
|
|
10
|
-
|
|
11
9
|
def find_data_picker(id, multiple: nil)
|
|
12
10
|
if multiple.nil?
|
|
13
|
-
expect(page).to have_selector("div.data-picker
|
|
11
|
+
expect(page).to have_selector("div.data-picker[id$='#{id}']")
|
|
14
12
|
else
|
|
15
|
-
expect(page).to have_selector("div.data-picker.picker-#{multiple ? "multiple" : "single"}
|
|
13
|
+
expect(page).to have_selector("div.data-picker.picker-#{multiple ? "multiple" : "single"}[id$='#{id}']")
|
|
16
14
|
end
|
|
17
|
-
|
|
15
|
+
first("div.data-picker[id$='#{id}']")
|
|
18
16
|
end
|
|
19
17
|
|
|
20
18
|
def data_picker_pick_current
|
|
@@ -22,5 +20,17 @@ module Capybara
|
|
|
22
20
|
expect(body).to have_selector("#data_picker-modal .picker-footer a[data-picker-choose]")
|
|
23
21
|
body.find("#data_picker-modal .picker-footer a[data-picker-choose]").click
|
|
24
22
|
end
|
|
23
|
+
|
|
24
|
+
def data_picker_choose_value(value)
|
|
25
|
+
body = find(:xpath, "//body")
|
|
26
|
+
expect(body).to have_selector("#data_picker-modal input[data-picker-choose][type=checkbox][value=\"#{value}\"]")
|
|
27
|
+
body.find("#data_picker-modal input[data-picker-choose][type=checkbox][value=\"#{value}\"]").click
|
|
28
|
+
end
|
|
29
|
+
|
|
30
|
+
def data_picker_close
|
|
31
|
+
body = find(:xpath, "//body")
|
|
32
|
+
expect(body).to have_selector("#data_picker-modal .picker-footer a[data-close]")
|
|
33
|
+
body.find("#data_picker-modal .picker-footer a[data-close]").click
|
|
34
|
+
end
|
|
25
35
|
end
|
|
26
36
|
end
|
|
@@ -10,7 +10,7 @@ module Capybara
|
|
|
10
10
|
match do |scope_picker|
|
|
11
11
|
data_picker = scope_picker.data_picker
|
|
12
12
|
scope_name = expected ? translated(expected.name) : t("decidim.scopes.global")
|
|
13
|
-
expect(data_picker).to have_selector(".picker-values div input[value='#{expected&.id || scope_picker.global_value}']", visible:
|
|
13
|
+
expect(data_picker).to have_selector(".picker-values div input[value='#{expected&.id || scope_picker.global_value}']", visible: :all)
|
|
14
14
|
expect(data_picker).to have_selector(:xpath, "//div[contains(@class,'picker-values')]/div/a[text()[contains(.,'#{scope_name}')]]")
|
|
15
15
|
end
|
|
16
16
|
end
|
|
@@ -19,7 +19,7 @@ module Capybara
|
|
|
19
19
|
match do |scope_picker|
|
|
20
20
|
data_picker = scope_picker.data_picker
|
|
21
21
|
scope_name = expected ? translated(expected.name) : t("decidim.scopes.global")
|
|
22
|
-
expect(data_picker).not_to have_selector(".picker-values div input[value='#{expected&.id || scope_picker.global_value}']", visible:
|
|
22
|
+
expect(data_picker).not_to have_selector(".picker-values div input[value='#{expected&.id || scope_picker.global_value}']", visible: :all)
|
|
23
23
|
expect(data_picker).not_to have_selector(:xpath, "//div[contains(@class,'picker-values')]/div/a[text()[contains(.,'#{scope_name}')]]")
|
|
24
24
|
end
|
|
25
25
|
end
|
|
@@ -27,7 +27,7 @@ module Capybara
|
|
|
27
27
|
def scope_pick(scope_picker, scope)
|
|
28
28
|
data_picker = scope_picker.data_picker
|
|
29
29
|
# use scope_repick to change single scope picker selected scope
|
|
30
|
-
expect(data_picker).to have_selector(".picker-values:empty", visible:
|
|
30
|
+
expect(data_picker).to have_selector(".picker-values:empty", visible: :all) if data_picker.has_css?(".picker-single")
|
|
31
31
|
|
|
32
32
|
expect(data_picker).to have_selector(".picker-prompt")
|
|
33
33
|
data_picker.find(".picker-prompt").click
|
|
@@ -41,7 +41,7 @@ module Capybara
|
|
|
41
41
|
def scope_repick(scope_picker, old_scope, new_scope)
|
|
42
42
|
data_picker = scope_picker.data_picker
|
|
43
43
|
|
|
44
|
-
expect(data_picker).to have_selector(".picker-values div input[value='#{old_scope&.id || scope_picker.global_value}']", visible:
|
|
44
|
+
expect(data_picker).to have_selector(".picker-values div input[value='#{old_scope&.id || scope_picker.global_value}']", visible: :all)
|
|
45
45
|
data_picker.find(:xpath, "//div[contains(@class,'picker-values')]/div/input[@value='#{old_scope&.id || scope_picker.global_value}']/../a").click
|
|
46
46
|
|
|
47
47
|
# browse to lowest common parent between old and new scope
|
|
@@ -57,7 +57,7 @@ module Capybara
|
|
|
57
57
|
def scope_unpick(scope_picker, scope)
|
|
58
58
|
data_picker = scope_picker.data_picker
|
|
59
59
|
|
|
60
|
-
expect(data_picker).to have_selector(".picker-values div input[value='#{scope&.id || scope_picker.global_value}']", visible:
|
|
60
|
+
expect(data_picker).to have_selector(".picker-values div input[value='#{scope&.id || scope_picker.global_value}']", visible: :all)
|
|
61
61
|
data_picker.find(".picker-values div input[value='#{scope&.id || scope_picker.global_value}']").click
|
|
62
62
|
|
|
63
63
|
expect(scope_picker).to have_scope_not_picked(scope)
|
|
@@ -64,6 +64,8 @@ module Decidim
|
|
|
64
64
|
include Amendable
|
|
65
65
|
include Decidim::NewsletterParticipant
|
|
66
66
|
include Hashtaggable
|
|
67
|
+
include ::Decidim::Endorsable
|
|
68
|
+
include Decidim::HasAttachments
|
|
67
69
|
|
|
68
70
|
searchable_fields(
|
|
69
71
|
scope_id: { scope: :id },
|
|
@@ -103,6 +105,39 @@ module Decidim
|
|
|
103
105
|
.pluck(:decidim_author_id).flatten.compact.uniq
|
|
104
106
|
end
|
|
105
107
|
end
|
|
108
|
+
|
|
109
|
+
class CoauthorableDummyResource < ApplicationRecord
|
|
110
|
+
include ::Decidim::Coauthorable
|
|
111
|
+
include HasComponent
|
|
112
|
+
end
|
|
113
|
+
|
|
114
|
+
class OfficialAuthorPresenter
|
|
115
|
+
def name
|
|
116
|
+
self.class.name
|
|
117
|
+
end
|
|
118
|
+
|
|
119
|
+
def nickname
|
|
120
|
+
UserBaseEntity.nicknamize(name)
|
|
121
|
+
end
|
|
122
|
+
|
|
123
|
+
def deleted?
|
|
124
|
+
false
|
|
125
|
+
end
|
|
126
|
+
|
|
127
|
+
def respond_to_missing?
|
|
128
|
+
true
|
|
129
|
+
end
|
|
130
|
+
|
|
131
|
+
def method_missing(method, *args)
|
|
132
|
+
if method.to_s.ends_with?("?")
|
|
133
|
+
false
|
|
134
|
+
elsif [:avatar_url, :profile_path, :badge, :followers_count].include?(method)
|
|
135
|
+
""
|
|
136
|
+
else
|
|
137
|
+
super
|
|
138
|
+
end
|
|
139
|
+
end
|
|
140
|
+
end
|
|
106
141
|
end
|
|
107
142
|
end
|
|
108
143
|
|
|
@@ -131,7 +166,8 @@ Decidim.register_component(:dummy) do |component|
|
|
|
131
166
|
settings.attribute :comments_enabled, type: :boolean, default: true
|
|
132
167
|
settings.attribute :resources_permissions_enabled, type: :boolean, default: true
|
|
133
168
|
settings.attribute :dummy_global_attribute_1, type: :boolean
|
|
134
|
-
settings.attribute :dummy_global_attribute_2, type: :boolean
|
|
169
|
+
settings.attribute :dummy_global_attribute_2, type: :boolean, readonly: ->(_context) { false }
|
|
170
|
+
settings.attribute :readonly_attribute, type: :boolean, default: true, readonly: ->(_context) { true }
|
|
135
171
|
settings.attribute :enable_pads_creation, type: :boolean, default: false
|
|
136
172
|
settings.attribute :amendments_enabled, type: :boolean, default: false
|
|
137
173
|
settings.attribute :dummy_global_translatable_text, type: :text, translated: true, editor: true, required: true
|
|
@@ -140,12 +176,15 @@ Decidim.register_component(:dummy) do |component|
|
|
|
140
176
|
component.settings(:step) do |settings|
|
|
141
177
|
settings.attribute :comments_blocked, type: :boolean, default: false
|
|
142
178
|
settings.attribute :dummy_step_attribute_1, type: :boolean
|
|
143
|
-
settings.attribute :dummy_step_attribute_2, type: :boolean
|
|
179
|
+
settings.attribute :dummy_step_attribute_2, type: :boolean, readonly: ->(_context) { false }
|
|
144
180
|
settings.attribute :dummy_step_translatable_text, type: :text, translated: true, editor: true, required: true
|
|
181
|
+
settings.attribute :readonly_step_attribute, type: :boolean, default: true, readonly: ->(_context) { true }
|
|
145
182
|
settings.attribute :amendment_creation_enabled, type: :boolean, default: true
|
|
146
183
|
settings.attribute :amendment_reaction_enabled, type: :boolean, default: true
|
|
147
184
|
settings.attribute :amendment_promotion_enabled, type: :boolean, default: true
|
|
148
185
|
settings.attribute :amendments_visibility, type: :string, default: "all"
|
|
186
|
+
settings.attribute :endorsements_enabled, type: :boolean, default: false
|
|
187
|
+
settings.attribute :endorsements_blocked, type: :boolean, default: false
|
|
149
188
|
end
|
|
150
189
|
|
|
151
190
|
component.register_resource(:dummy_resource) do |resource|
|
|
@@ -156,6 +195,14 @@ Decidim.register_component(:dummy) do |component|
|
|
|
156
195
|
resource.searchable = true
|
|
157
196
|
end
|
|
158
197
|
|
|
198
|
+
component.register_resource(:coauthorable_dummy_resource) do |resource|
|
|
199
|
+
resource.name = :coauthorable_dummy
|
|
200
|
+
resource.model_class_name = "Decidim::DummyResources::CoauthorableDummyResource"
|
|
201
|
+
resource.template = "decidim/coauthorabledummy_resource/linked_dummys"
|
|
202
|
+
resource.actions = %w(foo-coauthorable)
|
|
203
|
+
resource.searchable = false
|
|
204
|
+
end
|
|
205
|
+
|
|
159
206
|
component.register_stat :dummies_count_high, primary: true, priority: Decidim::StatsRegistry::HIGH_PRIORITY do |components, _start_at, _end_at|
|
|
160
207
|
components.count * 10
|
|
161
208
|
end
|
|
@@ -186,6 +233,7 @@ RSpec.configure do |config|
|
|
|
186
233
|
t.float :longitude
|
|
187
234
|
t.datetime :published_at
|
|
188
235
|
t.integer :coauthorships_count, null: false, default: 0
|
|
236
|
+
t.integer :endorsements_count, null: false, default: 0
|
|
189
237
|
|
|
190
238
|
t.references :decidim_component, index: false
|
|
191
239
|
t.integer :decidim_author_id, index: false
|
|
@@ -198,6 +246,27 @@ RSpec.configure do |config|
|
|
|
198
246
|
t.timestamps
|
|
199
247
|
end
|
|
200
248
|
end
|
|
249
|
+
|
|
250
|
+
unless ActiveRecord::Base.connection.data_source_exists?("decidim_dummy_resources_coauthorable_dummy_resources")
|
|
251
|
+
ActiveRecord::Migration.create_table :decidim_dummy_resources_coauthorable_dummy_resources do |t|
|
|
252
|
+
t.jsonb :translatable_text
|
|
253
|
+
t.string :title
|
|
254
|
+
t.string :body
|
|
255
|
+
t.text :address
|
|
256
|
+
t.float :latitude
|
|
257
|
+
t.float :longitude
|
|
258
|
+
t.datetime :published_at
|
|
259
|
+
t.integer :coauthorships_count, null: false, default: 0
|
|
260
|
+
t.integer :endorsements_count, null: false, default: 0
|
|
261
|
+
|
|
262
|
+
t.references :decidim_component, index: false
|
|
263
|
+
t.references :decidim_category, index: false
|
|
264
|
+
t.references :decidim_scope, index: false
|
|
265
|
+
t.string :reference
|
|
266
|
+
|
|
267
|
+
t.timestamps
|
|
268
|
+
end
|
|
269
|
+
end
|
|
201
270
|
end
|
|
202
271
|
end
|
|
203
272
|
|