decidim-admin 0.29.0.rc3 → 0.29.0.rc4

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 3755945bdc10745894992e7421e07e21b4e26dbec55a3a1abff2b1994179d65d
4
- data.tar.gz: 93285a182323d16be1c639b99f5fc5ccf495bdce8cb047531c5eb5f5021bb712
3
+ metadata.gz: c877f632437efb1ca6924a56a4d1c69a627dd579b13b4f3aaad1e4968265f94b
4
+ data.tar.gz: 5091d36c76fd1be662162c90c851fb6e92d72e9aa983ce6676765b6b375d3af6
5
5
  SHA512:
6
- metadata.gz: e2eabc789e1c41eb8696e7b05420bbf7211a28ffb7cc6492fe41aedf6da6f7ea126ff5ce014ad86eed98b2aa2cc753effa1ebfb1763967d909576a66dfaf0212
7
- data.tar.gz: 4cb4075884fbe8c7e9c2b88de2d5a0218058f749844af0a7107d7e508b394235d914a4455f3f2a5ce1b577434a2e020cd43d4b01bbfca34761063596ad887b57
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
@@ -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 %>
@@ -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.rc3"
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.rc3
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-22 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.rc3
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.rc3
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.rc3
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.rc3
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.rc3
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.rc3
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