decidim-admin 0.27.5 → 0.27.7
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/app/commands/decidim/admin/destroy_category.rb +1 -1
- data/app/controllers/decidim/admin/application_controller.rb +1 -0
- data/app/controllers/decidim/admin/authorization_workflows_controller.rb +3 -1
- 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/impersonations_controller.rb +1 -0
- data/app/controllers/decidim/admin/managed_users/impersonation_logs_controller.rb +2 -0
- data/app/controllers/decidim/admin/organization_controller.rb +7 -4
- data/app/events/decidim/component_published_event.rb +11 -0
- data/app/events/decidim/resource_hidden_event.rb +5 -1
- 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/views/decidim/admin/categories/index.html.erb +7 -1
- 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 +1 -7
- data/config/locales/bg.yml +986 -3
- data/config/locales/cs.yml +2 -2
- data/config/locales/de.yml +10 -10
- data/config/locales/el.yml +0 -8
- data/config/locales/es-MX.yml +2 -2
- data/config/locales/es-PY.yml +2 -2
- data/config/locales/es.yml +3 -3
- data/config/locales/eu.yml +2 -2
- data/config/locales/fi.yml +2 -2
- data/config/locales/fr-CA.yml +1 -1
- data/config/locales/ga-IE.yml +0 -4
- data/config/locales/gl.yml +1 -7
- data/config/locales/he-IL.yml +53 -0
- data/config/locales/hu.yml +24 -11
- data/config/locales/id-ID.yml +3 -0
- data/config/locales/is-IS.yml +3 -0
- data/config/locales/it.yml +0 -8
- data/config/locales/ja.yml +2 -2
- data/config/locales/ko.yml +720 -0
- data/config/locales/lb.yml +1 -9
- data/config/locales/lt.yml +0 -8
- data/config/locales/lv.yml +6 -0
- data/config/locales/nl.yml +0 -8
- data/config/locales/no.yml +4 -8
- data/config/locales/pl.yml +12 -3
- data/config/locales/pt-BR.yml +19 -9
- data/config/locales/pt.yml +1 -9
- data/config/locales/ro-RO.yml +0 -8
- data/config/locales/ru.yml +3 -0
- data/config/locales/sk.yml +3 -0
- data/config/locales/sl.yml +3 -0
- data/config/locales/sq-AL.yml +479 -0
- data/config/locales/sr-CS.yml +3 -0
- data/config/locales/sv.yml +0 -8
- data/config/locales/th-TH.yml +100 -0
- data/config/locales/tr-TR.yml +3 -0
- data/config/locales/uk.yml +3 -0
- data/config/locales/zh-CN.yml +3 -0
- data/config/locales/zh-TW.yml +0 -8
- data/decidim-admin.gemspec +36 -0
- data/lib/decidim/admin/test/commands/destroy_category_examples.rb +9 -0
- data/lib/decidim/admin/test/manage_attachment_collections_examples.rb +15 -14
- data/lib/decidim/admin/test/manage_attachments_examples.rb +3 -3
- data/lib/decidim/admin/test/manage_categories_examples.rb +12 -9
- data/lib/decidim/admin/test/manage_moderations_examples.rb +0 -9
- data/lib/decidim/admin/version.rb +1 -1
- metadata +14 -13
- data/app/mailers/decidim/admin/application_mailer.rb +0 -12
- data/config/environment.rb +0 -3
@@ -0,0 +1,36 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
$LOAD_PATH.push File.expand_path("lib", __dir__)
|
4
|
+
|
5
|
+
# Maintain your gem's version:
|
6
|
+
require "decidim/admin/version"
|
7
|
+
|
8
|
+
# Describe your gem and declare its dependencies:
|
9
|
+
Gem::Specification.new do |s|
|
10
|
+
s.version = Decidim::Admin.version
|
11
|
+
s.authors = ["Josep Jaume Rey Peroy", "Marc Riera Casals", "Oriol Gual Oliva"]
|
12
|
+
s.email = ["josepjaume@gmail.com", "mrc2407@gmail.com", "oriolgual@gmail.com"]
|
13
|
+
s.license = "AGPL-3.0"
|
14
|
+
s.homepage = "https://github.com/decidim/decidim"
|
15
|
+
s.required_ruby_version = "~> 3.0.0"
|
16
|
+
|
17
|
+
s.name = "decidim-admin"
|
18
|
+
s.summary = "Decidim organization administration"
|
19
|
+
s.description = "Organization administration to manage a single organization."
|
20
|
+
|
21
|
+
s.files = Dir.chdir(__dir__) do
|
22
|
+
`git ls-files -z`.split("\x0").select do |f|
|
23
|
+
(File.expand_path(f) == __FILE__) ||
|
24
|
+
f.start_with?(*%w(app/ config/ db/ lib/ Rakefile README.md))
|
25
|
+
end
|
26
|
+
end
|
27
|
+
|
28
|
+
s.add_dependency "active_link_to", "~> 1.0"
|
29
|
+
s.add_dependency "decidim-core", Decidim::Admin.version
|
30
|
+
s.add_dependency "devise", "~> 4.7"
|
31
|
+
s.add_dependency "devise-i18n", "~> 1.2"
|
32
|
+
s.add_dependency "devise_invitable", "~> 2.0", ">= 2.0.9"
|
33
|
+
|
34
|
+
s.add_development_dependency "decidim-dev", Decidim::Admin.version
|
35
|
+
s.add_development_dependency "decidim-participatory_processes", Decidim::Admin.version
|
36
|
+
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
|
|
@@ -2,6 +2,7 @@
|
|
2
2
|
|
3
3
|
shared_examples "manage attachment collections examples" do
|
4
4
|
let!(:attachment_collection) { create(:attachment_collection, collection_for: collection_for) }
|
5
|
+
let(:attributes) { attributes_for(:attachment_collection) }
|
5
6
|
|
6
7
|
before do
|
7
8
|
visit current_path
|
@@ -18,9 +19,9 @@ shared_examples "manage attachment collections examples" do
|
|
18
19
|
click_link translated(attachment_collection.name, locale: :en)
|
19
20
|
end
|
20
21
|
|
21
|
-
expect(page).to have_selector(
|
22
|
-
expect(page).to have_selector(
|
23
|
-
expect(page).to have_selector(
|
22
|
+
expect(page).to have_selector(%(input#attachment_collection_name_en[value="#{translated(attachment_collection.name, locale: :en)}"]))
|
23
|
+
expect(page).to have_selector(%(input#attachment_collection_weight[value="#{attachment_collection.weight}"]))
|
24
|
+
expect(page).to have_selector(%(input#attachment_collection_description_en[value="#{translated(attachment_collection.description, locale: :en)}"]))
|
24
25
|
end
|
25
26
|
|
26
27
|
it "can add attachment collections to a process" do
|
@@ -30,17 +31,13 @@ shared_examples "manage attachment collections examples" do
|
|
30
31
|
fill_in_i18n(
|
31
32
|
:attachment_collection_name,
|
32
33
|
"#attachment_collection-name-tabs",
|
33
|
-
|
34
|
-
es: "Formularios de solicitud",
|
35
|
-
ca: "Formularis de sol·licitud"
|
34
|
+
**attributes[:name].except("machine_translations")
|
36
35
|
)
|
37
36
|
|
38
37
|
fill_in_i18n(
|
39
38
|
:attachment_collection_description,
|
40
39
|
"#attachment_collection-description-tabs",
|
41
|
-
|
42
|
-
es: "Contiene los formularios de solicitud",
|
43
|
-
ca: "Conté els formularis de sol·licitud"
|
40
|
+
**attributes[:description].except("machine_translations")
|
44
41
|
)
|
45
42
|
|
46
43
|
find("*[type=submit]").click
|
@@ -49,8 +46,11 @@ shared_examples "manage attachment collections examples" do
|
|
49
46
|
expect(page).to have_admin_callout("successfully")
|
50
47
|
|
51
48
|
within "#attachment_collections table" do
|
52
|
-
expect(page).to
|
49
|
+
expect(page).to have_content(translated(attributes[:name]))
|
53
50
|
end
|
51
|
+
|
52
|
+
visit decidim_admin.root_path
|
53
|
+
expect(page).to have_content("created the #{translated(attributes[:name])} attachment collection")
|
54
54
|
end
|
55
55
|
|
56
56
|
it "can update an attachment collection" do
|
@@ -64,9 +64,7 @@ shared_examples "manage attachment collections examples" do
|
|
64
64
|
fill_in_i18n(
|
65
65
|
:attachment_collection_name,
|
66
66
|
"#attachment_collection-name-tabs",
|
67
|
-
|
68
|
-
es: "Últimos formularios de solicitud",
|
69
|
-
ca: "Últims formularis de sol·licitud"
|
67
|
+
**attributes[:name].except("machine_translations")
|
70
68
|
)
|
71
69
|
|
72
70
|
find("*[type=submit]").click
|
@@ -75,8 +73,11 @@ shared_examples "manage attachment collections examples" do
|
|
75
73
|
expect(page).to have_admin_callout("successfully")
|
76
74
|
|
77
75
|
within "#attachment_collections table" do
|
78
|
-
expect(page).to
|
76
|
+
expect(page).to have_content(translated(attributes[:name]))
|
79
77
|
end
|
78
|
+
|
79
|
+
visit decidim_admin.root_path
|
80
|
+
expect(page).to have_content("updated the #{translated(attributes[:name])} attachment collection")
|
80
81
|
end
|
81
82
|
|
82
83
|
context "when deleting a attachment collection" do
|
@@ -22,9 +22,9 @@ shared_examples "manage attachments examples" do
|
|
22
22
|
click_link translated(attachment.title, locale: :en)
|
23
23
|
end
|
24
24
|
|
25
|
-
expect(page).to have_selector(
|
26
|
-
expect(page).to have_selector(
|
27
|
-
expect(page).to have_selector(
|
25
|
+
expect(page).to have_selector(%(input#attachment_title_en[value="#{translated(attachment.title, locale: :en)}"]))
|
26
|
+
expect(page).to have_selector(%(input#attachment_description_en[value="#{translated(attachment.description, locale: :en)}"]))
|
27
|
+
expect(page).to have_selector(%(input#attachment_weight[value="#{attachment.weight}"]))
|
28
28
|
expect(page).to have_select("attachment_attachment_collection_id", selected: translated(attachment_collection.name, locale: :en))
|
29
29
|
expect(page).to have_css("img[src~='#{attachment.url}']")
|
30
30
|
end
|
@@ -1,6 +1,7 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
3
|
shared_examples "manage categories examples" do
|
4
|
+
let(:attributes) { attributes_for(:category) }
|
4
5
|
it "lists all the categories for the process" do
|
5
6
|
within "#categories table" do
|
6
7
|
expect(page).to have_content(translated(category.name, locale: :en))
|
@@ -12,7 +13,7 @@ shared_examples "manage categories examples" do
|
|
12
13
|
click_link translated(category.name, locale: :en)
|
13
14
|
end
|
14
15
|
|
15
|
-
expect(page).to have_selector(
|
16
|
+
expect(page).to have_selector(%(input#category_name_en[value="#{translated(category.name, locale: :en)}"]))
|
16
17
|
expect(page).to have_selector("input#category_weight[value='#{category.weight}']")
|
17
18
|
|
18
19
|
expect(page).to have_selector("select#category_parent_id")
|
@@ -25,9 +26,7 @@ shared_examples "manage categories examples" do
|
|
25
26
|
fill_in_i18n(
|
26
27
|
:category_name,
|
27
28
|
"#category-name-tabs",
|
28
|
-
|
29
|
-
es: "Mi categoría",
|
30
|
-
ca: "La meva categoria"
|
29
|
+
**attributes[:name].except("machine_translations")
|
31
30
|
)
|
32
31
|
|
33
32
|
find("*[type=submit]").click
|
@@ -36,8 +35,11 @@ shared_examples "manage categories examples" do
|
|
36
35
|
expect(page).to have_admin_callout("successfully")
|
37
36
|
|
38
37
|
within "#categories table" do
|
39
|
-
expect(page).to have_content(
|
38
|
+
expect(page).to have_content(translated(attributes[:name]))
|
40
39
|
end
|
40
|
+
|
41
|
+
visit decidim_admin.root_path
|
42
|
+
expect(page).to have_content("added the #{translated(attributes[:name])} category to the")
|
41
43
|
end
|
42
44
|
|
43
45
|
it "updates a category" do
|
@@ -51,9 +53,7 @@ shared_examples "manage categories examples" do
|
|
51
53
|
fill_in_i18n(
|
52
54
|
:category_name,
|
53
55
|
"#category-name-tabs",
|
54
|
-
|
55
|
-
es: "Mi nuevo nombre",
|
56
|
-
ca: "El meu nou nom"
|
56
|
+
**attributes[:name].except("machine_translations")
|
57
57
|
)
|
58
58
|
|
59
59
|
find("*[type=submit]").click
|
@@ -62,8 +62,11 @@ shared_examples "manage categories examples" do
|
|
62
62
|
expect(page).to have_admin_callout("successfully")
|
63
63
|
|
64
64
|
within "#categories table" do
|
65
|
-
expect(page).to have_content(
|
65
|
+
expect(page).to have_content(translated(attributes[:name]))
|
66
66
|
end
|
67
|
+
|
68
|
+
visit decidim_admin.root_path
|
69
|
+
expect(page).to have_content("updated the #{translated(attributes[:name])} category in the")
|
67
70
|
end
|
68
71
|
|
69
72
|
context "when deleting a category" do
|
@@ -77,15 +77,6 @@ shared_examples "manage moderations" do
|
|
77
77
|
expect(page).to have_admin_callout("Resource successfully unreported")
|
78
78
|
end
|
79
79
|
|
80
|
-
it "user can hide a resource" do
|
81
|
-
within "tr[data-id=\"#{moderation.id}\"]" do
|
82
|
-
click_link "Hide"
|
83
|
-
end
|
84
|
-
|
85
|
-
expect(page).to have_admin_callout("Resource successfully hidden")
|
86
|
-
expect(page).to have_no_content(moderation.reportable.reported_content_url)
|
87
|
-
end
|
88
|
-
|
89
80
|
it "user can sort by report count" do
|
90
81
|
moderations.each_with_index { |moderation, index| moderation.update(report_count: index + 1) }
|
91
82
|
moderations_ordered_by_report_count_asc = moderations.sort_by(&:report_count)
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
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.7
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Josep Jaume Rey Peroy
|
@@ -10,7 +10,7 @@ authors:
|
|
10
10
|
autorequire:
|
11
11
|
bindir: bin
|
12
12
|
cert_chain: []
|
13
|
-
date:
|
13
|
+
date: 2024-07-16 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.7
|
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.7
|
43
43
|
- !ruby/object:Gem::Dependency
|
44
44
|
name: devise
|
45
45
|
requirement: !ruby/object:Gem::Requirement
|
@@ -94,28 +94,28 @@ dependencies:
|
|
94
94
|
requirements:
|
95
95
|
- - '='
|
96
96
|
- !ruby/object:Gem::Version
|
97
|
-
version: 0.27.
|
97
|
+
version: 0.27.7
|
98
98
|
type: :development
|
99
99
|
prerelease: false
|
100
100
|
version_requirements: !ruby/object:Gem::Requirement
|
101
101
|
requirements:
|
102
102
|
- - '='
|
103
103
|
- !ruby/object:Gem::Version
|
104
|
-
version: 0.27.
|
104
|
+
version: 0.27.7
|
105
105
|
- !ruby/object:Gem::Dependency
|
106
106
|
name: decidim-participatory_processes
|
107
107
|
requirement: !ruby/object:Gem::Requirement
|
108
108
|
requirements:
|
109
109
|
- - '='
|
110
110
|
- !ruby/object:Gem::Version
|
111
|
-
version: 0.27.
|
111
|
+
version: 0.27.7
|
112
112
|
type: :development
|
113
113
|
prerelease: false
|
114
114
|
version_requirements: !ruby/object:Gem::Requirement
|
115
115
|
requirements:
|
116
116
|
- - '='
|
117
117
|
- !ruby/object:Gem::Version
|
118
|
-
version: 0.27.
|
118
|
+
version: 0.27.7
|
119
119
|
description: Organization administration to manage a single organization.
|
120
120
|
email:
|
121
121
|
- josepjaume@gmail.com
|
@@ -327,10 +327,10 @@ files:
|
|
327
327
|
- app/jobs/decidim/admin/newsletter_delivery_job.rb
|
328
328
|
- app/jobs/decidim/admin/newsletter_job.rb
|
329
329
|
- app/jobs/decidim/admin/verify_user_group_from_csv_job.rb
|
330
|
-
- app/mailers/decidim/admin/application_mailer.rb
|
331
330
|
- app/models/decidim/admin/fake_newsletter.rb
|
332
331
|
- app/packs/entrypoints/decidim_admin.js
|
333
332
|
- app/packs/entrypoints/decidim_admin.scss
|
333
|
+
- app/packs/images/decidim/admin/.keep
|
334
334
|
- app/packs/src/decidim/admin/admin_autocomplete.js
|
335
335
|
- app/packs/src/decidim/admin/application.js
|
336
336
|
- app/packs/src/decidim/admin/auto_buttons_by_position.component.js
|
@@ -589,7 +589,6 @@ files:
|
|
589
589
|
- app/views/layouts/decidim/admin/users.html.erb
|
590
590
|
- config/assets.rb
|
591
591
|
- config/brakeman.ignore
|
592
|
-
- config/environment.rb
|
593
592
|
- config/locales/am-ET.yml
|
594
593
|
- config/locales/ar-SA.yml
|
595
594
|
- config/locales/ar.yml
|
@@ -622,6 +621,7 @@ files:
|
|
622
621
|
- config/locales/ga-IE.yml
|
623
622
|
- config/locales/gl.yml
|
624
623
|
- config/locales/gn-PY.yml
|
624
|
+
- config/locales/he-IL.yml
|
625
625
|
- config/locales/hr-HR.yml
|
626
626
|
- config/locales/hr.yml
|
627
627
|
- config/locales/hu.yml
|
@@ -675,6 +675,7 @@ files:
|
|
675
675
|
- db/migrate/20171219154507_add_officialization_to_users.rb
|
676
676
|
- db/migrate/20180413233318_add_reason_to_decidim_impersonation_logs.rb
|
677
677
|
- db/migrate/20191118112040_add_accepted_admin_terms_at_field_to_users.rb
|
678
|
+
- decidim-admin.gemspec
|
678
679
|
- lib/decidim/admin.rb
|
679
680
|
- lib/decidim/admin/components.rb
|
680
681
|
- lib/decidim/admin/engine.rb
|
@@ -720,16 +721,16 @@ require_paths:
|
|
720
721
|
- lib
|
721
722
|
required_ruby_version: !ruby/object:Gem::Requirement
|
722
723
|
requirements:
|
723
|
-
- - "
|
724
|
+
- - "~>"
|
724
725
|
- !ruby/object:Gem::Version
|
725
|
-
version:
|
726
|
+
version: 3.0.0
|
726
727
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
727
728
|
requirements:
|
728
729
|
- - ">="
|
729
730
|
- !ruby/object:Gem::Version
|
730
731
|
version: '0'
|
731
732
|
requirements: []
|
732
|
-
rubygems_version: 3.
|
733
|
+
rubygems_version: 3.5.14
|
733
734
|
signing_key:
|
734
735
|
specification_version: 4
|
735
736
|
summary: Decidim organization administration
|
@@ -1,12 +0,0 @@
|
|
1
|
-
# frozen_string_literal: true
|
2
|
-
|
3
|
-
module Decidim
|
4
|
-
module Admin
|
5
|
-
# Custom application mailer, scoped to the admin mailer.
|
6
|
-
#
|
7
|
-
class ApplicationMailer < ActionMailer::Base
|
8
|
-
default from: Decidim.config.mailer_sender
|
9
|
-
layout "mailer"
|
10
|
-
end
|
11
|
-
end
|
12
|
-
end
|
data/config/environment.rb
DELETED