decidim-admin 0.29.0.rc2 → 0.29.0.rc4

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 84e3cd62d56492d5c74d5c9f4a8bcdae31eb80f698c592ac4a0b08a61a6897d6
4
- data.tar.gz: fd0c3ff54c73c7da35802fd23d10f4bf96497526a3fd80eb821e5779bb982ee7
3
+ metadata.gz: c877f632437efb1ca6924a56a4d1c69a627dd579b13b4f3aaad1e4968265f94b
4
+ data.tar.gz: 5091d36c76fd1be662162c90c851fb6e92d72e9aa983ce6676765b6b375d3af6
5
5
  SHA512:
6
- metadata.gz: acd7ea54ff83475e46329b3708c475d9952b2326f8ba78030356c1985f03d1ebc4377a9246fb3c3ee69c36c53190a2d429d1ba510e53fa8a299a66c1ac3a60ac
7
- data.tar.gz: 0be29b327109a17ac6f0d081ce0d3f20b8b5153a6f840a485425a0557358c3926b228fca0aea3527afd3cf0090683c963b329d921de48a3267124fcc866a48a9
6
+ metadata.gz: 9084ab29f342406ebd1ea041ce3f4b466257db1a191c4b433d32bbf2eb704b26cdcae8de99bd14238ae973c9427e27dd1a774721e079fd62fed31479bc0581ba
7
+ data.tar.gz: 4dfbfc46e584d15f1cadeab09cbe7fe2419d6d541882da5c9d8cd3fc9e705e628c9ea0e22c6e20ce17af74534df16f2894301f803a847fc4c33ef1eb916e3f34
@@ -0,0 +1,31 @@
1
+ # frozen_string_literal: true
2
+
3
+ require "active_support/concern"
4
+
5
+ module Decidim
6
+ module Admin
7
+ module VerificationConflicts
8
+ module Filterable
9
+ extend ActiveSupport::Concern
10
+
11
+ included do
12
+ include Decidim::Admin::Filterable
13
+
14
+ private
15
+
16
+ def base_query
17
+ collection
18
+ end
19
+
20
+ def search_field_predicate
21
+ :current_user_name_or_current_user_nickname_or_current_user_email_cont
22
+ end
23
+
24
+ def filters
25
+ []
26
+ end
27
+ end
28
+ end
29
+ end
30
+ end
31
+ end
@@ -18,6 +18,7 @@ module Decidim
18
18
  include Headers::ContentSecurityPolicy
19
19
  include DisableRedirectionToExternalHost
20
20
  include Decidim::Admin::Concerns::HasBreadcrumbItems
21
+ include ActiveStorage::SetCurrent
21
22
 
22
23
  helper Decidim::Admin::ApplicationHelper
23
24
  helper Decidim::Admin::AttributesDisplayHelper
@@ -3,18 +3,16 @@
3
3
  module Decidim
4
4
  module Admin
5
5
  class ConflictsController < Decidim::Admin::ApplicationController
6
+ include Decidim::Admin::VerificationConflicts::Filterable
7
+
6
8
  layout "decidim/admin/users"
7
9
 
8
- helper_method :context_breadcrumb_items
10
+ helper_method :context_breadcrumb_items, :conflicts
9
11
 
10
12
  add_breadcrumb_item_from_menu :impersonate_menu
11
13
 
12
14
  def index
13
15
  enforce_permission_to :index, :impersonatable_user
14
-
15
- @conflicts = Decidim::Verifications::Conflict.joins(:current_user).where(
16
- decidim_users: { decidim_organization_id: current_organization.id }
17
- )
18
16
  end
19
17
 
20
18
  def edit
@@ -66,6 +64,16 @@ module Decidim
66
64
  url: decidim_admin.impersonatable_users_path
67
65
  }
68
66
  end
67
+
68
+ def collection
69
+ @collection ||= Decidim::Verifications::Conflict.joins(:current_user).where(
70
+ decidim_users: { decidim_organization_id: current_organization.id }
71
+ )
72
+ end
73
+
74
+ def conflicts
75
+ @conflicts ||= filtered_collection.order(created_at: :desc)
76
+ end
69
77
  end
70
78
  end
71
79
  end
@@ -14,8 +14,12 @@
14
14
  <div class="dropdown-pane" id="add-component-dropdown" data-dropdown data-auto-focus="true" data-close-on-click="true">
15
15
  <ul class="vertical menu add-components font-normal">
16
16
  <% @manifests.each do |manifest| %>
17
- <li><%= link_to t("#{manifest.name}.name", scope: "decidim.components"), new_component_path(type: manifest.name), class: manifest.name %></li>
17
+ <%= link_to new_component_path(type: manifest.name), class: manifest.name do %>
18
+ <li>
19
+ <%= t("#{manifest.name}.name", scope: "decidim.components") %>
20
+ </li>
18
21
  <% end %>
22
+ <% end %>
19
23
  </ul>
20
24
  </div>
21
25
  </div>
@@ -1,10 +1,32 @@
1
1
  <% add_decidim_page_title(t("title", scope: "decidim.admin.conflicts")) %>
2
- <div class="card">
3
- <div class="item_show__header">
4
- <h1 class="item_show__header-title">
5
- <%= t("title", scope: "decidim.admin.conflicts") %>
6
- </h1>
2
+ <div class="item_show__header">
3
+ <h1 class="item_show__header-title">
4
+ <%= t("title", scope: "decidim.admin.conflicts") %>
5
+ </h1>
6
+ </div>
7
+
8
+ <div class="filters__section">
9
+ <div class="fcell search">
10
+ <%= search_form_for(query, url: url_for) do |form| %>
11
+ <%= applied_filters_hidden_field_tags %>
12
+ <div class="input-group">
13
+ <%= form.search_field(
14
+ search_field_predicate,
15
+ class: "input-group-field",
16
+ label: false,
17
+ placeholder: t(".text")
18
+ ) %>
19
+ <div class="input-group-button">
20
+ <button type="submit" class="text-secondary" aria-label="<%= t("decidim.search.term_input_placeholder") %>">
21
+ <%= icon "search-line", class: "fill-secondary w-4 h-4" %>
22
+ </button>
23
+ </div>
24
+ </div>
25
+ <% end %>
7
26
  </div>
27
+ </div>
28
+
29
+ <div class="card">
8
30
  <div class="table-scroll">
9
31
  <table class="table-list">
10
32
  <thead>
@@ -17,7 +39,7 @@
17
39
  </tr>
18
40
  </thead>
19
41
  <tbody>
20
- <% @conflicts.each do |conflict| %>
42
+ <% conflicts.each do |conflict| %>
21
43
  <tr>
22
44
  <td><%= conflict.current_user.name %></td>
23
45
  <td><%= conflict.managed_user.name %></td>
@@ -30,3 +52,4 @@
30
52
  </table>
31
53
  </div>
32
54
  </div>
55
+ <%= decidim_paginate conflicts %>
@@ -10,11 +10,11 @@
10
10
  <ul class="vertical menu add-components">
11
11
  <% component.manifest.export_manifests.each do |manifest| %>
12
12
  <% manifest.formats.each do |format| %>
13
- <li class="exports--format--<%= format.downcase %> exports--<%= manifest.name %>">
14
- <%= link_to t("decidim.admin.exports.export_as", name: t("decidim.#{component.manifest.name}.admin.exports.#{manifest.name}"), export_format: t("decidim.admin.exports.formats.#{format}")),
15
- exports_path(component, id: manifest.name, format:, resource_id:, filters:),
16
- method: :post %>
17
- </li>
13
+ <%= link_to exports_path(component, id: manifest.name, format:, resource_id:, filters:), method: :post do %>
14
+ <li class="exports--format--<%= format.downcase %> exports--<%= manifest.name %>">
15
+ <%= t("decidim.admin.exports.export_as", name: t("decidim.#{component.manifest.name}.admin.exports.#{manifest.name}"), export_format: t("decidim.admin.exports.formats.#{format}")) %>
16
+ </li>
17
+ <% end %>
18
18
  <% end %>
19
19
  <% end %>
20
20
  </ul>
@@ -7,10 +7,12 @@
7
7
  <% if custom %>
8
8
  <%= yield %>
9
9
  <% else %>
10
- <% component.manifest.import_manifests.each do |import_manifest| %>
11
- <li class="imports--file imports--<%= import_manifest.name %>">
12
- <%= link_to import_manifest.message(:label, self), admin_imports_path(component, resource_id:, name: import_manifest.name) %>
13
- </li>
10
+ <% component.manifest.import_manifests.each do |import_manifest| %>
11
+ <%= link_to admin_imports_path(component, resource_id:, name: import_manifest.name) do %>
12
+ <li class="imports--file imports--<%= import_manifest.name %>">
13
+ <%= import_manifest.message(:label, self) %>
14
+ </li>
15
+ <% end %>
14
16
  <% end %>
15
17
  <% end %>
16
18
  </ul>
@@ -12,10 +12,11 @@
12
12
  <div class="dropdown-pane" id="example-dropdown" data-dropdown data-position=bottom data-alignment=right data-auto-focus="true" data-close-on-click="true">
13
13
  <ul class="vertical menu add-components">
14
14
  <% mime_types.each do |format, name| %>
15
- <li class="examples--format--<%= format.downcase %> examples--<%= import_manifest.name %>">
16
- <%= link_to t(".download_example_format", name:),
17
- admin_imports_example_path(@current_component, name: import_manifest.name, format:) %>
18
- </li>
15
+ <%= link_to admin_imports_example_path(@current_component, name: import_manifest.name, format:) do %>
16
+ <li class="examples--format--<%= format.downcase %> examples--<%= import_manifest.name %>">
17
+ <%= t(".download_example_format", name:) %>
18
+ </li>
19
+ <% end %>
19
20
  <% end %>
20
21
  </ul>
21
22
  </div>
@@ -3,7 +3,7 @@
3
3
  <div id="minimap" class="grid grid-cols-1 md:grid-cols-2">
4
4
  <div class="minimap-tab">
5
5
  <% if current_organization.favicon.attached? %>
6
- <%= image_tag current_organization.attached_uploader(:favicon).path, class: "minimap-favicon" %>
6
+ <%= image_tag current_organization.attached_uploader(:favicon).url, class: "minimap-favicon" %>
7
7
  <% else %>
8
8
  <%= content_tag :div, nil, { class: "minimap-favicon placeholder", style: "width: #{image_width(current_organization, :favicon) * size_factor}px; height: #{image_height(current_organization, :favicon) * size_factor}px;" } do %>
9
9
  <span><%= t("favicon", scope: "activemodel.attributes.organization") %></span>
@@ -13,7 +13,7 @@
13
13
 
14
14
  <div class="minimap-header">
15
15
  <% if current_organization.logo.present? %>
16
- <%= image_tag current_organization.attached_uploader(:logo).path, class: "minimap-logo" %>
16
+ <%= image_tag current_organization.attached_uploader(:logo).url, class: "minimap-logo" %>
17
17
  <% else %>
18
18
  <%= content_tag :div, nil, { class: "minimap-logo placeholder", style: "width: #{image_width(current_organization, :logo) * size_factor}px; height: #{image_height(current_organization, :logo) * size_factor}px;" } do %>
19
19
  <span><%= t("logo", scope: "activemodel.attributes.organization") %></span>
@@ -26,7 +26,7 @@
26
26
 
27
27
  <div class="minimap-footer">
28
28
  <% if current_organization.official_img_footer.attached? %>
29
- <%= image_tag current_organization.attached_uploader(:official_img_footer).path, class: "minimap-official_img_footer" %>
29
+ <%= image_tag current_organization.attached_uploader(:official_img_footer).url, class: "minimap-official_img_footer" %>
30
30
  <% else %>
31
31
  <%= content_tag :div, nil, { class: "minimap-official_img_footer placeholder", style: "width: #{image_width(current_organization, :official_img_footer) * size_factor}px; height: #{image_height(current_organization, :official_img_footer) * size_factor}px;" } do %>
32
32
  <span><%= t("official_img_footer", scope: "activemodel.attributes.organization") %></span>
@@ -23,7 +23,7 @@
23
23
  <div class="layout-nav">
24
24
  <%= link_to decidim_admin.root_path, class: "logo hidden md:block", data: { "external-link": false }, aria: { label: t("decidim.accessibility.logo", organization: current_organization_name) } do %>
25
25
  <% if current_organization.logo.present? %>
26
- <%= image_tag current_organization.attached_uploader(:logo).path, alt: current_organization_name %>
26
+ <%= image_tag current_organization.attached_uploader(:logo).url, alt: current_organization_name %>
27
27
  <% else %>
28
28
  <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 134 109">
29
29
  <g fill="#fff">
@@ -351,6 +351,8 @@ ca:
351
351
  conflicts:
352
352
  attempts: Intents
353
353
  'false': 'No'
354
+ index:
355
+ text: Cercar per correu electrònic, nom o àlies.
354
356
  managed_user_name: Usuari gestionat
355
357
  solved: Resolt
356
358
  title: Conflictes de verificació
@@ -351,6 +351,8 @@ de:
351
351
  conflicts:
352
352
  attempts: Versuche
353
353
  'false': 'Nein'
354
+ index:
355
+ text: Suche nach bestehender E-Mail, Name oder Spitzname des Teilnehmenden.
354
356
  managed_user_name: Verwalteter Benutzer
355
357
  solved: Gelöst
356
358
  title: Überprüfungskonflikte
@@ -351,6 +351,8 @@ en:
351
351
  conflicts:
352
352
  attempts: Attempts
353
353
  'false': 'No'
354
+ index:
355
+ text: Search by current user email, name or nickname.
354
356
  managed_user_name: Managed User
355
357
  solved: Solved
356
358
  title: Verification conflicts
@@ -351,6 +351,8 @@ es:
351
351
  conflicts:
352
352
  attempts: Intentos
353
353
  'false': 'No'
354
+ index:
355
+ text: Buscar por correo electrónico, nombre o alias.
354
356
  managed_user_name: Usuario gestionado
355
357
  solved: Resuelto
356
358
  title: Conflictos de verificación
@@ -351,6 +351,8 @@ fr-CA:
351
351
  conflicts:
352
352
  attempts: Tentatives
353
353
  'false': 'Non'
354
+ index:
355
+ text: Recherche par adresse e-mail, nom ou pseudonyme.
354
356
  managed_user_name: Utilisateur représenté
355
357
  solved: Résolu
356
358
  title: Conflits de vérification
@@ -351,6 +351,8 @@ fr:
351
351
  conflicts:
352
352
  attempts: Tentatives
353
353
  'false': 'Non'
354
+ index:
355
+ text: Recherche par adresse e-mail, nom ou pseudonyme.
354
356
  managed_user_name: Utilisateur représenté
355
357
  solved: Résolu
356
358
  title: Conflits de vérification
@@ -18,6 +18,7 @@ shared_context "when inviting participatory space users" do
18
18
  fill_in "Email", with: email
19
19
  select role, from: "Role"
20
20
  click_on "Create"
21
+ expect(page).to have_content("successfully added")
21
22
  logout :user
22
23
  end
23
24
 
@@ -26,7 +26,19 @@ shared_examples "manage attachments examples" do
26
26
  expect(page).to have_css("input#attachment_description_en[value='#{translated(attachment.description, locale: :en)}']")
27
27
  expect(page).to have_css("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
- expect(page).to have_css("img[src~='#{attachment.url}']")
29
+
30
+ # The image's URL changes every time it is requested because the disk
31
+ # service generates a unique URL based on the expiry time of the link.
32
+ # This expiry time is calculated at the time when the URL is requested
33
+ # which is why it changes every time to different URL. This changes the
34
+ # JSON encoded file identifier which includes the expiry time as well as
35
+ # the digest of the URL because the digest is calculated based on the
36
+ # passed data.
37
+ filename = attachment.file.blob.filename
38
+ within %([data-active-uploads] [data-filename="#{filename}"]) do
39
+ src = page.find("img")["src"]
40
+ expect(src).to be_blob_url(attachment.file.blob)
41
+ end
30
42
  end
31
43
 
32
44
  it "can add attachments without a collection to a process" do
@@ -4,7 +4,7 @@ module Decidim
4
4
  # This holds the decidim-admin version.
5
5
  module Admin
6
6
  def self.version
7
- "0.29.0.rc2"
7
+ "0.29.0.rc4"
8
8
  end
9
9
  end
10
10
  end
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.29.0.rc2
4
+ version: 0.29.0.rc4
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: 2024-07-16 00:00:00.000000000 Z
13
+ date: 2024-07-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.29.0.rc2
35
+ version: 0.29.0.rc4
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.29.0.rc2
42
+ version: 0.29.0.rc4
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.29.0.rc2
97
+ version: 0.29.0.rc4
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.29.0.rc2
104
+ version: 0.29.0.rc4
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.29.0.rc2
111
+ version: 0.29.0.rc4
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.29.0.rc2
118
+ version: 0.29.0.rc4
119
119
  description: Organization administration to manage a single organization.
120
120
  email:
121
121
  - josepjaume@gmail.com
@@ -218,6 +218,7 @@ files:
218
218
  - app/controllers/concerns/decidim/admin/participatory_space_export.rb
219
219
  - app/controllers/concerns/decidim/admin/user_groups.rb
220
220
  - app/controllers/concerns/decidim/admin/user_groups/filterable.rb
221
+ - app/controllers/concerns/decidim/admin/verification_conflicts/filterable.rb
221
222
  - app/controllers/concerns/decidim/moderated_users/admin/filterable.rb
222
223
  - app/controllers/concerns/decidim/moderations/admin/filterable.rb
223
224
  - app/controllers/concerns/decidim/participatory_space_private_users/admin/filterable.rb