decidim-admin 0.27.4 → 0.27.6
Sign up to get free protection for your applications and to get access to all the features.
Potentially problematic release.
This version of decidim-admin might be problematic. Click here for more details.
- checksums.yaml +4 -4
- data/app/commands/decidim/admin/destroy_category.rb +1 -1
- data/app/controllers/concerns/decidim/admin/needs_admin_tos_accepted.rb +36 -0
- data/app/controllers/concerns/decidim/moderations/admin/filterable.rb +4 -0
- data/app/controllers/decidim/admin/application_controller.rb +1 -0
- data/app/controllers/decidim/admin/conflicts_controller.rb +6 -0
- data/app/controllers/decidim/admin/impersonatable_users_controller.rb +1 -1
- data/app/controllers/decidim/admin/managed_users/impersonation_logs_controller.rb +2 -0
- data/app/events/decidim/component_published_event.rb +11 -0
- data/app/events/decidim/resource_hidden_event.rb +5 -1
- data/app/forms/decidim/admin/organization_form.rb +2 -2
- data/app/helpers/decidim/admin/admin_terms_helper.rb +1 -1
- data/app/helpers/decidim/admin/newsletters_helper.rb +1 -1
- data/app/packs/images/decidim/admin/.keep +0 -0
- data/app/packs/stylesheets/decidim/admin/_variables.scss +1 -1
- data/app/views/decidim/admin/categories/index.html.erb +7 -1
- data/app/views/decidim/admin/components/_actions.html.erb +43 -0
- data/app/views/decidim/admin/components/_component.html.erb +3 -41
- data/app/views/decidim/admin/resource_permissions/edit.html.erb +2 -2
- data/app/views/layouts/decidim/admin/_header.html.erb +3 -0
- data/app/views/layouts/decidim/admin/_js_configuration.html.erb +1 -0
- data/config/locales/ar.yml +8 -19
- data/config/locales/bg.yml +153 -1
- data/config/locales/ca.yml +9 -9
- data/config/locales/cs.yml +8 -8
- data/config/locales/de.yml +27 -27
- data/config/locales/el.yml +1 -20
- data/config/locales/en.yml +2 -2
- data/config/locales/es-MX.yml +10 -10
- data/config/locales/es-PY.yml +10 -10
- data/config/locales/es.yml +10 -10
- data/config/locales/eu.yml +311 -284
- data/config/locales/fi-plain.yml +5 -5
- data/config/locales/fi.yml +6 -6
- data/config/locales/fr-CA.yml +10 -10
- data/config/locales/fr.yml +11 -11
- data/config/locales/ga-IE.yml +0 -5
- data/config/locales/gl.yml +3 -20
- data/config/locales/he-IL.yml +53 -0
- data/config/locales/hu.yml +20 -18
- data/config/locales/id-ID.yml +5 -7
- data/config/locales/is-IS.yml +4 -3
- data/config/locales/it.yml +0 -19
- data/config/locales/ja.yml +11 -11
- data/config/locales/kaa.yml +15 -1
- data/config/locales/ko.yml +720 -0
- data/config/locales/lb.yml +3 -22
- data/config/locales/lt.yml +31 -21
- data/config/locales/lv.yml +5 -9
- data/config/locales/nl.yml +2 -21
- data/config/locales/no.yml +2 -17
- data/config/locales/pl.yml +42 -9
- data/config/locales/pt-BR.yml +36 -19
- data/config/locales/pt.yml +4 -23
- data/config/locales/ro-RO.yml +2 -21
- data/config/locales/ru.yml +5 -8
- data/config/locales/sk.yml +2 -10
- data/config/locales/sl.yml +3 -1
- data/config/locales/sq-AL.yml +133 -0
- data/config/locales/sr-CS.yml +13 -6
- data/config/locales/sv.yml +1 -19
- data/config/locales/th-TH.yml +1 -0
- data/config/locales/tr-TR.yml +7 -13
- data/config/locales/uk.yml +3 -8
- data/config/locales/zh-CN.yml +2 -10
- data/config/locales/zh-TW.yml +0 -19
- data/config/routes.rb +2 -0
- data/decidim-admin.gemspec +36 -0
- data/lib/decidim/admin/test/admin_participatory_space_access_examples.rb +49 -0
- data/lib/decidim/admin/test/commands/destroy_category_examples.rb +9 -0
- data/lib/decidim/admin/version.rb +1 -1
- metadata +26 -15
- data/app/controllers/decidim/admin/space_publications_controller.rb +0 -63
- data/config/environment.rb +0 -1
@@ -0,0 +1,49 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
shared_examples "accessing the participatory space" do
|
4
|
+
it "shows the page" do
|
5
|
+
expect(page).to have_content("View public page")
|
6
|
+
expect(page).to have_content("My space")
|
7
|
+
end
|
8
|
+
end
|
9
|
+
|
10
|
+
shared_examples "showing the unauthorized error message" do
|
11
|
+
it "redirects to the relevant unauthorized page" do
|
12
|
+
expect(page).to have_content("You are not authorized to perform this action")
|
13
|
+
expect(page).to have_current_path("/admin/")
|
14
|
+
end
|
15
|
+
end
|
16
|
+
|
17
|
+
shared_examples "admin participatory space access" do
|
18
|
+
before do
|
19
|
+
switch_to_host(organization.host)
|
20
|
+
login_as user, scope: :user
|
21
|
+
end
|
22
|
+
|
23
|
+
context "when the user is a normal user" do
|
24
|
+
let(:user) { create(:user, :confirmed, organization: organization) }
|
25
|
+
let(:unauthorized_path) { "/" }
|
26
|
+
|
27
|
+
it_behaves_like "a 404 page"
|
28
|
+
end
|
29
|
+
|
30
|
+
context "when the user has the role" do
|
31
|
+
let(:user) { role }
|
32
|
+
|
33
|
+
context "and has permission" do
|
34
|
+
before do
|
35
|
+
visit target_path
|
36
|
+
end
|
37
|
+
|
38
|
+
it_behaves_like "accessing the participatory space"
|
39
|
+
end
|
40
|
+
|
41
|
+
context "and does not have permission" do
|
42
|
+
before do
|
43
|
+
visit unauthorized_target_path
|
44
|
+
end
|
45
|
+
|
46
|
+
it_behaves_like "showing the unauthorized error message"
|
47
|
+
end
|
48
|
+
end
|
49
|
+
end
|
@@ -19,6 +19,15 @@ module Decidim
|
|
19
19
|
end
|
20
20
|
end
|
21
21
|
|
22
|
+
context "when the category is being used by a resource" do
|
23
|
+
let(:component) { create(:dummy_component, participatory_space: participatory_space) }
|
24
|
+
let!(:resource) { create(:dummy_resource, component: component, category: category) }
|
25
|
+
|
26
|
+
it "broadcasts invalid" do
|
27
|
+
expect { command.call }.to broadcast(:invalid)
|
28
|
+
end
|
29
|
+
end
|
30
|
+
|
22
31
|
context "when the category is not empty" do
|
23
32
|
let!(:subcategory) { create :subcategory, parent: category }
|
24
33
|
|
metadata
CHANGED
@@ -1,16 +1,16 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: decidim-admin
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.27.
|
4
|
+
version: 0.27.6
|
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:
|
13
|
+
date: 2024-04-30 00:00:00.000000000 Z
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|
16
16
|
name: active_link_to
|
@@ -32,14 +32,14 @@ dependencies:
|
|
32
32
|
requirements:
|
33
33
|
- - '='
|
34
34
|
- !ruby/object:Gem::Version
|
35
|
-
version: 0.27.
|
35
|
+
version: 0.27.6
|
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.6
|
43
43
|
- !ruby/object:Gem::Dependency
|
44
44
|
name: devise
|
45
45
|
requirement: !ruby/object:Gem::Requirement
|
@@ -75,6 +75,9 @@ dependencies:
|
|
75
75
|
- - "~>"
|
76
76
|
- !ruby/object:Gem::Version
|
77
77
|
version: '2.0'
|
78
|
+
- - ">="
|
79
|
+
- !ruby/object:Gem::Version
|
80
|
+
version: 2.0.9
|
78
81
|
type: :runtime
|
79
82
|
prerelease: false
|
80
83
|
version_requirements: !ruby/object:Gem::Requirement
|
@@ -82,34 +85,37 @@ dependencies:
|
|
82
85
|
- - "~>"
|
83
86
|
- !ruby/object:Gem::Version
|
84
87
|
version: '2.0'
|
88
|
+
- - ">="
|
89
|
+
- !ruby/object:Gem::Version
|
90
|
+
version: 2.0.9
|
85
91
|
- !ruby/object:Gem::Dependency
|
86
92
|
name: decidim-dev
|
87
93
|
requirement: !ruby/object:Gem::Requirement
|
88
94
|
requirements:
|
89
95
|
- - '='
|
90
96
|
- !ruby/object:Gem::Version
|
91
|
-
version: 0.27.
|
97
|
+
version: 0.27.6
|
92
98
|
type: :development
|
93
99
|
prerelease: false
|
94
100
|
version_requirements: !ruby/object:Gem::Requirement
|
95
101
|
requirements:
|
96
102
|
- - '='
|
97
103
|
- !ruby/object:Gem::Version
|
98
|
-
version: 0.27.
|
104
|
+
version: 0.27.6
|
99
105
|
- !ruby/object:Gem::Dependency
|
100
106
|
name: decidim-participatory_processes
|
101
107
|
requirement: !ruby/object:Gem::Requirement
|
102
108
|
requirements:
|
103
109
|
- - '='
|
104
110
|
- !ruby/object:Gem::Version
|
105
|
-
version: 0.27.
|
111
|
+
version: 0.27.6
|
106
112
|
type: :development
|
107
113
|
prerelease: false
|
108
114
|
version_requirements: !ruby/object:Gem::Requirement
|
109
115
|
requirements:
|
110
116
|
- - '='
|
111
117
|
- !ruby/object:Gem::Version
|
112
|
-
version: 0.27.
|
118
|
+
version: 0.27.6
|
113
119
|
description: Organization administration to manage a single organization.
|
114
120
|
email:
|
115
121
|
- josepjaume@gmail.com
|
@@ -251,7 +257,6 @@ files:
|
|
251
257
|
- app/controllers/decidim/admin/scope_types_controller.rb
|
252
258
|
- app/controllers/decidim/admin/scopes_controller.rb
|
253
259
|
- app/controllers/decidim/admin/share_tokens_controller.rb
|
254
|
-
- app/controllers/decidim/admin/space_publications_controller.rb
|
255
260
|
- app/controllers/decidim/admin/static_page_topics_controller.rb
|
256
261
|
- app/controllers/decidim/admin/static_pages_controller.rb
|
257
262
|
- app/controllers/decidim/admin/user_groups_controller.rb
|
@@ -326,6 +331,7 @@ files:
|
|
326
331
|
- app/models/decidim/admin/fake_newsletter.rb
|
327
332
|
- app/packs/entrypoints/decidim_admin.js
|
328
333
|
- app/packs/entrypoints/decidim_admin.scss
|
334
|
+
- app/packs/images/decidim/admin/.keep
|
329
335
|
- app/packs/src/decidim/admin/admin_autocomplete.js
|
330
336
|
- app/packs/src/decidim/admin/application.js
|
331
337
|
- app/packs/src/decidim/admin/auto_buttons_by_position.component.js
|
@@ -472,6 +478,7 @@ files:
|
|
472
478
|
- app/views/decidim/admin/categories/index.html.erb
|
473
479
|
- app/views/decidim/admin/categories/new.html.erb
|
474
480
|
- app/views/decidim/admin/categories/show.html.erb
|
481
|
+
- app/views/decidim/admin/components/_actions.html.erb
|
475
482
|
- app/views/decidim/admin/components/_component.html.erb
|
476
483
|
- app/views/decidim/admin/components/_form.html.erb
|
477
484
|
- app/views/decidim/admin/components/_settings_fields.html.erb
|
@@ -583,7 +590,6 @@ files:
|
|
583
590
|
- app/views/layouts/decidim/admin/users.html.erb
|
584
591
|
- config/assets.rb
|
585
592
|
- config/brakeman.ignore
|
586
|
-
- config/environment.rb
|
587
593
|
- config/locales/am-ET.yml
|
588
594
|
- config/locales/ar-SA.yml
|
589
595
|
- config/locales/ar.yml
|
@@ -616,6 +622,7 @@ files:
|
|
616
622
|
- config/locales/ga-IE.yml
|
617
623
|
- config/locales/gl.yml
|
618
624
|
- config/locales/gn-PY.yml
|
625
|
+
- config/locales/he-IL.yml
|
619
626
|
- config/locales/hr-HR.yml
|
620
627
|
- config/locales/hr.yml
|
621
628
|
- config/locales/hu.yml
|
@@ -650,9 +657,11 @@ files:
|
|
650
657
|
- config/locales/sk.yml
|
651
658
|
- config/locales/sl.yml
|
652
659
|
- config/locales/so-SO.yml
|
660
|
+
- config/locales/sq-AL.yml
|
653
661
|
- config/locales/sr-CS.yml
|
654
662
|
- config/locales/sv.yml
|
655
663
|
- config/locales/sw-KE.yml
|
664
|
+
- config/locales/th-TH.yml
|
656
665
|
- config/locales/ti-ER.yml
|
657
666
|
- config/locales/tr-TR.yml
|
658
667
|
- config/locales/uk.yml
|
@@ -667,6 +676,7 @@ files:
|
|
667
676
|
- db/migrate/20171219154507_add_officialization_to_users.rb
|
668
677
|
- db/migrate/20180413233318_add_reason_to_decidim_impersonation_logs.rb
|
669
678
|
- db/migrate/20191118112040_add_accepted_admin_terms_at_field_to_users.rb
|
679
|
+
- decidim-admin.gemspec
|
670
680
|
- lib/decidim/admin.rb
|
671
681
|
- lib/decidim/admin/components.rb
|
672
682
|
- lib/decidim/admin/engine.rb
|
@@ -682,6 +692,7 @@ files:
|
|
682
692
|
- lib/decidim/admin/import/readers/xlsx.rb
|
683
693
|
- lib/decidim/admin/import/verifier.rb
|
684
694
|
- lib/decidim/admin/test.rb
|
695
|
+
- lib/decidim/admin/test/admin_participatory_space_access_examples.rb
|
685
696
|
- lib/decidim/admin/test/commands/create_attachment_collection_examples.rb
|
686
697
|
- lib/decidim/admin/test/commands/create_category_examples.rb
|
687
698
|
- lib/decidim/admin/test/commands/destroy_category_examples.rb
|
@@ -705,15 +716,15 @@ homepage: https://github.com/decidim/decidim
|
|
705
716
|
licenses:
|
706
717
|
- AGPL-3.0
|
707
718
|
metadata: {}
|
708
|
-
post_install_message:
|
719
|
+
post_install_message:
|
709
720
|
rdoc_options: []
|
710
721
|
require_paths:
|
711
722
|
- lib
|
712
723
|
required_ruby_version: !ruby/object:Gem::Requirement
|
713
724
|
requirements:
|
714
|
-
- - "
|
725
|
+
- - "~>"
|
715
726
|
- !ruby/object:Gem::Version
|
716
|
-
version:
|
727
|
+
version: 3.0.0
|
717
728
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
718
729
|
requirements:
|
719
730
|
- - ">="
|
@@ -721,7 +732,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
721
732
|
version: '0'
|
722
733
|
requirements: []
|
723
734
|
rubygems_version: 3.2.22
|
724
|
-
signing_key:
|
735
|
+
signing_key:
|
725
736
|
specification_version: 4
|
726
737
|
summary: Decidim organization administration
|
727
738
|
test_files: []
|
@@ -1,63 +0,0 @@
|
|
1
|
-
# frozen_string_literal: true
|
2
|
-
|
3
|
-
module Decidim
|
4
|
-
module Admin
|
5
|
-
# Base controller that can be inherited by other spaces to publish and unpublish the Space
|
6
|
-
#
|
7
|
-
class SpacePublicationsController < Decidim::Assemblies::Admin::ApplicationController
|
8
|
-
def create
|
9
|
-
enforce_permission_to_publish
|
10
|
-
|
11
|
-
publish_command.call(current_assembly, current_user) do
|
12
|
-
on(:ok) do
|
13
|
-
flash[:notice] = I18n.t("create.success", scope: i18n_scope)
|
14
|
-
end
|
15
|
-
|
16
|
-
on(:invalid) do
|
17
|
-
flash.now[:alert] = I18n.t("create.error", scope: i18n_scope)
|
18
|
-
end
|
19
|
-
|
20
|
-
redirect_back(fallback_location: assemblies_path)
|
21
|
-
end
|
22
|
-
end
|
23
|
-
|
24
|
-
def destroy
|
25
|
-
enforce_permission_to_publish
|
26
|
-
|
27
|
-
unpublish_command.call(current_assembly, current_user) do
|
28
|
-
on(:ok) do
|
29
|
-
flash[:notice] = I18n.t("destroy.success", scope: i18n_scope)
|
30
|
-
end
|
31
|
-
|
32
|
-
on(:invalid) do
|
33
|
-
flash.now[:alert] = I18n.t("destroy.error", scope: i18n_scope)
|
34
|
-
end
|
35
|
-
|
36
|
-
redirect_back(fallback_location: assemblies_path)
|
37
|
-
end
|
38
|
-
end
|
39
|
-
|
40
|
-
private
|
41
|
-
|
42
|
-
def current_participatory_space
|
43
|
-
raise "Not implemented"
|
44
|
-
end
|
45
|
-
|
46
|
-
def enforce_permission_to_publish
|
47
|
-
raise "Not implemented"
|
48
|
-
end
|
49
|
-
|
50
|
-
def publish_command
|
51
|
-
raise "Not implemented"
|
52
|
-
end
|
53
|
-
|
54
|
-
def unpublish_command
|
55
|
-
raise "Not implemented"
|
56
|
-
end
|
57
|
-
|
58
|
-
def i18n_scope
|
59
|
-
raise "Not implemented"
|
60
|
-
end
|
61
|
-
end
|
62
|
-
end
|
63
|
-
end
|
data/config/environment.rb
DELETED
@@ -1 +0,0 @@
|
|
1
|
-
# frozen_string_literal: true
|