decidim-admin 0.32.0.rc1 → 0.32.0.rc3

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.
Files changed (66) hide show
  1. checksums.yaml +4 -4
  2. data/app/commands/decidim/admin/create_newsletter.rb +1 -1
  3. data/app/controllers/decidim/admin/block_user_controller.rb +2 -0
  4. data/app/controllers/decidim/admin/newsletters_controller.rb +1 -0
  5. data/app/controllers/decidim/admin/organization_controller.rb +0 -29
  6. data/app/packs/src/decidim/admin/admin_autocomplete.js +16 -10
  7. data/app/views/decidim/admin/attachment_collections/index.html.erb +1 -1
  8. data/app/views/decidim/admin/components/_actions.html.erb +1 -1
  9. data/app/views/decidim/admin/moderations/_moderation-tr.html.erb +1 -1
  10. data/app/views/decidim/admin/officializations/show_email.html.erb +7 -1
  11. data/app/views/decidim/admin/taxonomy_filters/_table.html.erb +2 -2
  12. data/app/views/layouts/decidim/admin/_application.html.erb +1 -1
  13. data/config/locales/ar.yml +1 -0
  14. data/config/locales/bg.yml +1 -0
  15. data/config/locales/bs-BA.yml +1 -0
  16. data/config/locales/ca-IT.yml +3 -0
  17. data/config/locales/ca.yml +3 -0
  18. data/config/locales/cs.yml +3 -0
  19. data/config/locales/de.yml +5 -0
  20. data/config/locales/el.yml +1 -0
  21. data/config/locales/en.yml +2 -0
  22. data/config/locales/eo.yml +1 -0
  23. data/config/locales/es-MX.yml +3 -0
  24. data/config/locales/es-PY.yml +3 -0
  25. data/config/locales/es.yml +3 -0
  26. data/config/locales/eu.yml +42 -39
  27. data/config/locales/fi-plain.yml +3 -0
  28. data/config/locales/fi.yml +3 -0
  29. data/config/locales/fr-CA.yml +7 -0
  30. data/config/locales/fr.yml +7 -0
  31. data/config/locales/ga-IE.yml +1 -0
  32. data/config/locales/gl.yml +1 -0
  33. data/config/locales/he-IL.yml +1 -0
  34. data/config/locales/hu.yml +1 -0
  35. data/config/locales/id-ID.yml +1 -0
  36. data/config/locales/is-IS.yml +2 -1
  37. data/config/locales/it.yml +2 -0
  38. data/config/locales/ja.yml +1 -0
  39. data/config/locales/kaa.yml +1 -0
  40. data/config/locales/ko.yml +1 -0
  41. data/config/locales/lb.yml +1 -0
  42. data/config/locales/lt.yml +1 -0
  43. data/config/locales/lv.yml +1 -0
  44. data/config/locales/nl.yml +1 -0
  45. data/config/locales/no.yml +1 -0
  46. data/config/locales/pl.yml +1 -0
  47. data/config/locales/pt-BR.yml +7 -6
  48. data/config/locales/pt.yml +1 -0
  49. data/config/locales/ro-RO.yml +1 -0
  50. data/config/locales/ru.yml +1 -0
  51. data/config/locales/sk.yml +837 -0
  52. data/config/locales/sl.yml +1 -0
  53. data/config/locales/sq-AL.yml +1 -0
  54. data/config/locales/sr-CS.yml +1 -0
  55. data/config/locales/sv.yml +2 -0
  56. data/config/locales/th-TH.yml +1 -0
  57. data/config/locales/tr-TR.yml +1 -0
  58. data/config/locales/uk.yml +1 -0
  59. data/config/locales/val-ES.yml +1 -0
  60. data/config/locales/zh-CN.yml +1 -0
  61. data/config/locales/zh-TW.yml +1 -0
  62. data/config/routes.rb +0 -4
  63. data/decidim-admin.gemspec +1 -1
  64. data/lib/decidim/admin/form_builder.rb +1 -3
  65. data/lib/decidim/admin/version.rb +1 -1
  66. metadata +7 -7
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 9da138630750a0739cd6fd8b161f7093193e6293fa32a00e24355c7c0fca9a0c
4
- data.tar.gz: ba05f9d1e15ac506f29ce14428c7952be077fd8f251c886be250267a1b32fbb9
3
+ metadata.gz: 36901230e8c91881b21c0860524d5d6efb35a23046bc3e61dee9a160ac855d9b
4
+ data.tar.gz: 1d5570c6dce765730164a865bcaee1c16041ecd5f1a790e42adec090e565b644
5
5
  SHA512:
6
- metadata.gz: 135c143b735ee0ada94c33046c6f9c5cbf81027b91ee609677a66b3fd04db2051781eab9b465836666acf5b3268ba372ab69ed823509d4cba115f2b600cd1a83
7
- data.tar.gz: 501dd3d2f79cc2b1699830d82b7f411ebeb8656aab4ac0de1da085b7ec5a4882053187796221a38687544a5a24446d4df752bdecee3fd445b581c9ef7481b7fe
6
+ metadata.gz: 9d9cb0bcaec7d4d6543130f006d915e7d4d4fb756da9f0bf894ccdaefd64b32169aeaae9b3d80599e11525435106eed5e13f66214a7a10e9cfd8160306ce500e
7
+ data.tar.gz: 570d5c96c847ae27c440eddbed91477258311eb101ce5ff410be11ec7b1a435ce41034dc5fc85aa97e1dfc5c1269c34b46e7d0963a3d000a4cfeadf1ea02c296
@@ -31,7 +31,7 @@ module Decidim
31
31
  @content_block = content_block
32
32
  end
33
33
  on(:invalid) do
34
- raise "There was a problem persisting the changes to the content block"
34
+ raise Decidim::Commands::HookError, "There was a problem persisting the changes to the content block"
35
35
  end
36
36
  end
37
37
  end
@@ -10,6 +10,8 @@ module Decidim
10
10
  def new
11
11
  enforce_permission_to :block, :admin_user
12
12
 
13
+ return redirect_to(officializations_path, alert: I18n.t("officializations.block.no_user", scope: "decidim.admin")) unless user
14
+
13
15
  @form = form(BlockUserForm).from_model(user)
14
16
  @form.hide = params[:hide] || false
15
17
  end
@@ -56,6 +56,7 @@ module Decidim
56
56
 
57
57
  on(:invalid) do |newsletter|
58
58
  @newsletter = newsletter
59
+ @form.images = content_block.images_container
59
60
  flash.now[:error] = I18n.t("newsletters.create.error", scope: "decidim.admin")
60
61
  render action: :new, status: :unprocessable_content
61
62
  end
@@ -33,35 +33,6 @@ module Decidim
33
33
  end
34
34
  end
35
35
  end
36
-
37
- def users
38
- search(current_organization.users.available)
39
- end
40
-
41
- private
42
-
43
- def search(relation)
44
- respond_to do |format|
45
- format.json do
46
- if (term = params[:term].to_s).present?
47
- query = if term.start_with?("@")
48
- nickname = term.delete("@")
49
- relation.where("nickname LIKE ?", "#{nickname}%")
50
- .order(Arel.sql(ActiveRecord::Base.sanitize_sql_array("similarity(nickname, '#{nickname}') DESC")))
51
- else
52
- relation.where("name ILIKE ?", "%#{term}%").or(
53
- relation.where("email ILIKE ?", "%#{term}%")
54
- )
55
- .order(Arel.sql(ActiveRecord::Base.sanitize_sql_array("GREATEST(similarity(name, '#{term}'), similarity(email, '#{term}')) DESC")))
56
- .order(Arel.sql(ActiveRecord::Base.sanitize_sql_array("(similarity(name, '#{term}') + similarity(email, '#{term}')) / 2 DESC")))
57
- end
58
- render json: query.all.collect { |u| { value: u.id, label: "#{u.name} (@#{u.nickname})" } }
59
- else
60
- render json: []
61
- end
62
- end
63
- end
64
- end
65
36
  end
66
37
  end
67
38
  end
@@ -10,7 +10,6 @@ import AutoComplete from "src/decidim/refactor/moved/autocomplete";
10
10
  * - name: assembly_member[user_id],
11
11
  * - options: [],
12
12
  * - placeholder: "Select a participant",
13
- * - searchURL: "http://..."
14
13
  * - selected: "",
15
14
  *
16
15
  * @param {HTMLElement} el The element to generate the autocomplete for.
@@ -18,7 +17,6 @@ import AutoComplete from "src/decidim/refactor/moved/autocomplete";
18
17
  */
19
18
  const autoConfigure = (el) => {
20
19
  const config = JSON.parse(el.dataset.autocomplete);
21
- const searchUrl = new URL(config.searchURL);
22
20
  const textInput = document.createElement("input");
23
21
  textInput.type = "text";
24
22
  textInput.className = "autocomplete-input";
@@ -46,16 +44,24 @@ const autoConfigure = (el) => {
46
44
  }
47
45
  }
48
46
 
47
+ const graphqlEscapedQuery = (query) => query.replace(/\\/g, "\\\\").replace(/"/g, "\\\"");
48
+
49
49
  const dataSource = (query, callback) => {
50
- const params = new URLSearchParams({
51
- ...Object.fromEntries(searchUrl.searchParams),
52
- term: query
53
- });
54
- fetch(`${searchUrl.origin}${searchUrl.pathname}?${params.toString()}`, {
55
- method: "GET",
56
- headers: { "Content-Type": "application/json" }
50
+ const apiPath = window.Decidim.config.get("api_path");
51
+ fetch(apiPath, {
52
+ method: "POST",
53
+ headers: { "Content-Type": "application/json" },
54
+ body: JSON.stringify({
55
+ query: `{users(filter:{wildcard:"${graphqlEscapedQuery(query)}"}){id,nickname,name,__typename}}`
56
+ })
57
57
  }).then((response) => response.json()).then((data) => {
58
- callback(data)
58
+ const users = data?.data?.users || [];
59
+ callback(users.map((user) => ({
60
+ value: user.id,
61
+ label: `${user.name} (${user.nickname})`
62
+ })))
63
+ }).catch(() => {
64
+ callback([])
59
65
  });
60
66
  };
61
67
 
@@ -51,7 +51,7 @@
51
51
  <% end %>
52
52
  <% else %>
53
53
  <div class="dropdown__button-disabled">
54
- <%= with_tooltip t("tooltips.deleted_attachment_collections_info", scope: "decidim.admin") do %>
54
+ <%= with_tooltip t("tooltips.deleted_attachment_collections_info", scope: "decidim.admin"), class: :left do %>
55
55
  <%= icon "delete-bin-line", class: "text-gray" %>
56
56
  <span>
57
57
  <%= t("actions.destroy", scope: "decidim.admin") %>
@@ -98,7 +98,7 @@
98
98
  <hr>
99
99
  <li class="dropdown__item">
100
100
  <div class="dropdown__button-disabled">
101
- <%= with_tooltip t("tooltips.deleted_component_info", scope: "decidim.admin") do %>
101
+ <%= with_tooltip t("tooltips.deleted_component_info", scope: "decidim.admin"), class: :left do %>
102
102
  <%= icon "delete-bin-line", class: "text-gray" %>
103
103
  <span>
104
104
  <%= t("actions.soft_delete", scope: "decidim.admin") %>
@@ -85,7 +85,7 @@
85
85
  <li class="dropdown__item">
86
86
  <% if moderation.reportable.respond_to?(:commentable) && moderation.reportable.commentable.try(:hidden?) %>
87
87
  <div class="dropdown__button-disabled">
88
- <%= with_tooltip(t("actions.parent_hidden", scope: "decidim.moderations"), title: t("actions.parent_hidden", scope: "decidim.moderations")) do %>
88
+ <%= with_tooltip(t("actions.parent_hidden", scope: "decidim.moderations"), title: t("actions.parent_hidden", scope: "decidim.moderations"), class: :left) do %>
89
89
  <%= icon "eye-line", class: "text-gray" %>
90
90
  <span><%= t("actions.unhide", scope: "decidim.moderations") %></span>
91
91
  <% end %>
@@ -1,3 +1,9 @@
1
1
  <% add_decidim_page_title(t(".title")) %>
2
2
 
3
- <%= link_to user.email, "mailto:#{user.email}" %>
3
+ <% if user.present? %>
4
+ <%= link_to user.email, "mailto:#{user.email}" %>
5
+ <% else %>
6
+ <div class="flash alert my-0">
7
+ <%= t(".no_user") %>
8
+ </div>
9
+ <% end %>
@@ -36,7 +36,7 @@
36
36
  </li>
37
37
  <% else %>
38
38
  <div class="dropdown__button-disabled">
39
- <%= with_tooltip t("tooltips.cannot_edit_taxonomy_filter", scope: "decidim.admin") do %>
39
+ <%= with_tooltip t("tooltips.cannot_edit_taxonomy_filter", scope: "decidim.admin"), class: :left do %>
40
40
  <%= icon "pencil-line", class: "text-gray" %>
41
41
  <%= t(".edit") %>
42
42
  <% end %>
@@ -54,7 +54,7 @@
54
54
  </li>
55
55
  <% else %>
56
56
  <div class="dropdown__button-disabled">
57
- <%= with_tooltip t("tooltips.cannot_destroy_taxonomy_filter", scope: "decidim.admin") do %>
57
+ <%= with_tooltip t("tooltips.cannot_destroy_taxonomy_filter", scope: "decidim.admin"), class: :left do %>
58
58
  <%= icon "delete-bin-line", class: "text-gray" %>
59
59
  <%= t(".destroy") %>
60
60
  <% end %>
@@ -11,7 +11,7 @@
11
11
  </head>
12
12
  <body>
13
13
 
14
- <main class="main">
14
+ <main class="main" role="main">
15
15
  <div class="layout-wrapper">
16
16
  <div class="block md:hidden col-start-1 col-end-2">
17
17
  <%= render partial: "layouts/decidim/admin/title_bar_responsive" %>
@@ -1,3 +1,4 @@
1
+ ---
1
2
  ar:
2
3
  activemodel:
3
4
  attributes:
@@ -1,3 +1,4 @@
1
+ ---
1
2
  bg:
2
3
  activemodel:
3
4
  attributes:
@@ -1,3 +1,4 @@
1
+ ---
1
2
  bs:
2
3
  activemodel:
3
4
  attributes:
@@ -1,3 +1,4 @@
1
+ ---
1
2
  ca-IT:
2
3
  activemodel:
3
4
  attributes:
@@ -899,6 +900,7 @@ ca-IT:
899
900
  officializations:
900
901
  block:
901
902
  error: Hi ha hagut un problema en bloquejar a la participant.
903
+ no_user: No s'ha trobat cap usuària
902
904
  success: Participant bloquejada correctament.
903
905
  bulk_action:
904
906
  block:
@@ -934,6 +936,7 @@ ca-IT:
934
936
  officialize: Oficialitza
935
937
  title: Oficialitza la participant "%{name}"
936
938
  show_email:
939
+ no_user: No s'ha trobat cap usuària
937
940
  title: Mostra el correu electrònic
938
941
  show_email_modal:
939
942
  description: Si necessites contactar a una participant directament pots clicar al botó Mostra per veure la seva adreça de correu electrònic. Aquesta acció es registrarà.
@@ -1,3 +1,4 @@
1
+ ---
1
2
  ca:
2
3
  activemodel:
3
4
  attributes:
@@ -899,6 +900,7 @@ ca:
899
900
  officializations:
900
901
  block:
901
902
  error: Hi ha hagut un problema en bloquejar a la participant.
903
+ no_user: No s'ha trobat cap usuària
902
904
  success: Participant bloquejada correctament.
903
905
  bulk_action:
904
906
  block:
@@ -934,6 +936,7 @@ ca:
934
936
  officialize: Oficialitza
935
937
  title: Oficialitza la participant "%{name}"
936
938
  show_email:
939
+ no_user: No s'ha trobat cap usuària
937
940
  title: Mostra el correu electrònic
938
941
  show_email_modal:
939
942
  description: Si necessites contactar a una participant directament pots clicar al botó Mostra per veure la seva adreça de correu electrònic. Aquesta acció es registrarà.
@@ -1,3 +1,4 @@
1
+ ---
1
2
  cs:
2
3
  activemodel:
3
4
  attributes:
@@ -905,6 +906,7 @@ cs:
905
906
  officializations:
906
907
  block:
907
908
  error: Při blokování účastníka došlo k chybě.
909
+ no_user: Nebyl nalezen žádný uživatel
908
910
  success: Účastník byl úspěšně zablokován.
909
911
  bulk_action:
910
912
  block:
@@ -940,6 +942,7 @@ cs:
940
942
  officialize: Ověřit
941
943
  title: Oficializovat účastníka "%{name}"
942
944
  show_email:
945
+ no_user: Nebyl nalezen žádný uživatel
943
946
  title: Zobrazit e-mail
944
947
  show_email_modal:
945
948
  description: Pokud potřebujete kontaktovat účastníka, můžete kliknout na tlačítko Zobrazit pro zobrazení e-mailové adresy. Tato akce bude zaznamenána.
@@ -1,3 +1,4 @@
1
+ ---
1
2
  de:
2
3
  activemodel:
3
4
  attributes:
@@ -265,6 +266,8 @@ de:
265
266
  edit:
266
267
  title: Ordner bearbeiten
267
268
  update: Aktualisieren
269
+ index:
270
+ title: Ordner für Anhänge
268
271
  new:
269
272
  create: Erstellen
270
273
  title: Neuer Ordner
@@ -280,6 +283,8 @@ de:
280
283
  edit:
281
284
  title: Anhang bearbeiten
282
285
  update: Aktualisieren
286
+ index:
287
+ title: Anhänge
283
288
  new:
284
289
  create: Anhang erstellen
285
290
  title: Neuer Anhang
@@ -1,3 +1,4 @@
1
+ ---
1
2
  el:
2
3
  activemodel:
3
4
  attributes:
@@ -900,6 +900,7 @@ en:
900
900
  officializations:
901
901
  block:
902
902
  error: There was a problem blocking the participant.
903
+ no_user: No user found
903
904
  success: Participant successfully blocked.
904
905
  bulk_action:
905
906
  block:
@@ -935,6 +936,7 @@ en:
935
936
  officialize: Officialize
936
937
  title: Officialize participant "%{name}"
937
938
  show_email:
939
+ no_user: No user found
938
940
  title: Show email
939
941
  show_email_modal:
940
942
  description: If you need to contact a participant directly, you can click on the Show button to see their email address. This action will be logged.
@@ -1,3 +1,4 @@
1
+ ---
1
2
  eo:
2
3
  activemodel:
3
4
  attributes:
@@ -1,3 +1,4 @@
1
+ ---
1
2
  es-MX:
2
3
  activemodel:
3
4
  attributes:
@@ -899,6 +900,7 @@ es-MX:
899
900
  officializations:
900
901
  block:
901
902
  error: Se ha producido un error al bloquear a la participante.
903
+ no_user: No se ha encontrado ninguna usuaria
902
904
  success: Participante bloqueada correctamente.
903
905
  bulk_action:
904
906
  block:
@@ -934,6 +936,7 @@ es-MX:
934
936
  officialize: Oficializar
935
937
  title: Oficializar el usuario "%{name}"
936
938
  show_email:
939
+ no_user: No se ha encontrado ninguna usuaria
937
940
  title: Mostrar el correo electrónico
938
941
  show_email_modal:
939
942
  description: Si necesitas contactar directamente con una participante, puedes hacer clic en el botón Mostrar para ver la dirección de correo electrónico. Esta acción se registrará.
@@ -1,3 +1,4 @@
1
+ ---
1
2
  es-PY:
2
3
  activemodel:
3
4
  attributes:
@@ -899,6 +900,7 @@ es-PY:
899
900
  officializations:
900
901
  block:
901
902
  error: Se ha producido un error al bloquear a la participante.
903
+ no_user: No se ha encontrado ninguna usuaria
902
904
  success: Participante bloqueada correctamente.
903
905
  bulk_action:
904
906
  block:
@@ -934,6 +936,7 @@ es-PY:
934
936
  officialize: Oficializar
935
937
  title: Oficializar el usuario "%{name}"
936
938
  show_email:
939
+ no_user: No se ha encontrado ninguna usuaria
937
940
  title: Mostrar el correo electrónico
938
941
  show_email_modal:
939
942
  description: Si necesitas contactar directamente con una participante, puedes hacer clic en el botón Mostrar para ver la dirección de correo electrónico. Esta acción se registrará.
@@ -1,3 +1,4 @@
1
+ ---
1
2
  es:
2
3
  activemodel:
3
4
  attributes:
@@ -899,6 +900,7 @@ es:
899
900
  officializations:
900
901
  block:
901
902
  error: Se ha producido un error al bloquear a la participante.
903
+ no_user: No se ha encontrado ninguna usuaria
902
904
  success: Participante bloqueada correctamente.
903
905
  bulk_action:
904
906
  block:
@@ -934,6 +936,7 @@ es:
934
936
  officialize: Oficializar
935
937
  title: Oficializar participante "%{name}"
936
938
  show_email:
939
+ no_user: No se ha encontrado ninguna usuaria
937
940
  title: Mostrar el correo electrónico
938
941
  show_email_modal:
939
942
  description: Si necesitas contactar directamente con una participante, puedes hacer clic en el botón Mostrar para ver la dirección de correo electrónico. Esta acción se registrará.