decidim-core 0.24.2 → 0.24.3

Sign up to get free protection for your applications and to get access to all the features.

Potentially problematic release.


This version of decidim-core might be problematic. Click here for more details.

checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: ab5095df3a838b44266df05ea2907b58743c104adb1a61af39919a003ceeab25
4
- data.tar.gz: 79816ce45c6d0d505cefd28199a8271b40cefa88d057d0c25df9abae4a5a6b1a
3
+ metadata.gz: f3951a2b1d212641b4f8d6d237c46f04a51acdba30baaf937d051ddc1a5a657b
4
+ data.tar.gz: 91ede7442a9ba6ccc60328bcea6384962e93ebffa195efca31a0ba27aae35eac
5
5
  SHA512:
6
- metadata.gz: c9d199e7ba25fb0fe25b650672c9a1c275080377e4df96378953462056342efc078849648a3c7421fab19541eecfc7d35cb96ac23a7dfd6850f131e2b01e29c6
7
- data.tar.gz: 9076c3518c1b64cc06a16a95f562342fb5b75d6b6592f2c8c55e2cb74003f2da6bad11521da43a89890485e8daeb49e7502967b2e94e5ac688e4ce26c852412d
6
+ metadata.gz: dd77e400d4d79c85b294f128a401f9408e2b8acf964cba301cf88cb53ca4305683bebf735e3e66092a3f7a66c774f9be3db6244eae9367b90c54e6a51ddfb4d5
7
+ data.tar.gz: 9fb9dede7ce22aebcb6d83fd83e076d1926cbaceefecc033fce2ff19d4837a759abb82dc67caf5438435d1e868df77c1481d0e59d28952f0a4942dfe1a4f0675
@@ -10,6 +10,8 @@
10
10
  const Delta = Quill.import("delta");
11
11
  const Break = Quill.import("blots/break");
12
12
  const Embed = Quill.import("blots/embed");
13
+ const Scroll = Quill.import("blots/scroll");
14
+ const Parchment = Quill.import("parchment");
13
15
  const { HistoryOverride } = exports.Decidim.Editor
14
16
  Quill.register({"modules/history": HistoryOverride}, true)
15
17
  let icons = Quill.import("ui/icons");
@@ -31,6 +33,101 @@
31
33
  }
32
34
  Quill.register(SmartBreak);
33
35
 
36
+ // Override quill/blots/scroll.js
37
+ class ScrollOvderride extends Scroll {
38
+ optimize(mutations = [], context = {}) {
39
+ if (this.batch === true) {
40
+ return;
41
+ }
42
+
43
+ this.parchmentOptimize(mutations, context);
44
+
45
+ if (mutations.length > 0) {
46
+ // quill/core/emitter.js, Emitter.events.SCROLL_OPTIMIZE = "scroll-optimize"
47
+ this.emitter.emit("scroll-optimize", mutations, context);
48
+ }
49
+ }
50
+
51
+ // Override parchment/src/blot/scroll.ts
52
+ parchmentOptimize(mutations = [], context = {}) {
53
+ // super.optimize(context);
54
+ Reflect.apply(Parchment.Container.prototype.optimize, this, [context]);
55
+
56
+ // We must modify mutations directly, cannot make copy and then modify
57
+ // let records = [].slice.call(this.observer.takeRecords());
58
+ let records = [...this.observer.takeRecords()];
59
+ // Array.push currently seems to be implemented by a non-tail recursive function
60
+ // so we cannot just mutations.push.apply(mutations, this.observer.takeRecords());
61
+ while (records.length > 0) {
62
+ mutations.push(records.pop());
63
+ }
64
+ let mark = (blot, markParent) => {
65
+ if (!blot || blot === this) {
66
+ return;
67
+ }
68
+ if (!blot.domNode.parentNode) {
69
+ return;
70
+ }
71
+ if (blot.domNode.__blot && blot.domNode.__blot.mutations === null) {
72
+ blot.domNode.__blot.mutations = [];
73
+ }
74
+ if (markParent) {
75
+ mark(blot.parent);
76
+ }
77
+ };
78
+ let optimize = (blot) => {
79
+ // Post-order traversal
80
+ if (!blot.domNode.__blot) {
81
+ return;
82
+ }
83
+
84
+ if (blot instanceof Parchment.Container) {
85
+ blot.children.forEach(optimize);
86
+ }
87
+ blot.optimize(context);
88
+ };
89
+ let remaining = mutations;
90
+ for (let ind = 0; remaining.length > 0; ind += 1) {
91
+ // MAX_OPTIMIZE_ITERATIONS = 100
92
+ if (ind >= 100) {
93
+ throw new Error("[Parchment] Maximum optimize iterations reached");
94
+ }
95
+ remaining.forEach((mutation) => {
96
+ let blot = Parchment.find(mutation.target, true);
97
+ if (!blot) {
98
+ return;
99
+ }
100
+ if (blot.domNode === mutation.target) {
101
+ if (mutation.type === "childList") {
102
+ mark(Parchment.find(mutation.previousSibling, false));
103
+
104
+ mutation.addedNodes.forEach((node) => {
105
+ let child = Parchment.find(node, false);
106
+ mark(child, false);
107
+ if (child instanceof Parchment.Container) {
108
+ child.children.forEach(function(grandChild) {
109
+ mark(grandChild, false);
110
+ });
111
+ }
112
+ });
113
+ } else if (mutation.type === "attributes") {
114
+ mark(blot.prev);
115
+ }
116
+ }
117
+ mark(blot);
118
+ });
119
+ this.children.forEach(optimize);
120
+ remaining = [...this.observer.takeRecords()];
121
+ records = remaining.slice();
122
+ while (records.length > 0) {
123
+ mutations.push(records.pop());
124
+ }
125
+ }
126
+ }
127
+ }
128
+ Quill.register("blots/scroll", ScrollOvderride, true);
129
+ Parchment.register(ScrollOvderride);
130
+
34
131
  const lineBreakButtonHandler = (quill) => {
35
132
  let range = quill.selection.getRange()[0];
36
133
  let currentLeaf = quill.getLeaf(range.index)[0];
@@ -0,0 +1,40 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Decidim
4
+ # Shared behaviour for signed_in users that require the latest TOS accepted
5
+ module HasStoredPath
6
+ extend ActiveSupport::Concern
7
+
8
+ included do
9
+ # Saves the location before loading each page so we can return to the
10
+ # right page.
11
+ before_action :store_current_location
12
+ end
13
+
14
+ # Stores the url where the user will be redirected after login.
15
+ #
16
+ # Uses the `redirect_url` param or the current url if there's no param.
17
+ # In Devise controllers we only store the URL if it's from the params, we don't
18
+ # want to overwrite the stored URL for a Devise one.
19
+ def store_current_location
20
+ return if skip_store_location?
21
+
22
+ value = redirect_url || request.url
23
+ store_location_for(:user, value)
24
+ end
25
+
26
+ def skip_store_location?
27
+ # Skip if Devise already handles the redirection
28
+ return true if devise_controller? && redirect_url.blank?
29
+ # Skip for all non-HTML requests"
30
+ return true unless request.format.html?
31
+ # Skip if a signed in user requests the TOS page without having agreed to
32
+ # the TOS. Most of the times this is because of a redirect to the TOS
33
+ # page (in which case the desired location is somewhere else after the
34
+ # TOS is agreed).
35
+ return true if current_user && !current_user.tos_accepted? && request.path == URI(tos_path).path
36
+
37
+ false
38
+ end
39
+ end
40
+ end
@@ -11,6 +11,7 @@ module Decidim
11
11
  include NeedsPermission
12
12
  include PayloadInfo
13
13
  include ImpersonateUsers
14
+ include HasStoredPath
14
15
  include NeedsTosAccepted
15
16
  include HttpCachingDisabler
16
17
  include ActionAuthorization
@@ -36,10 +37,6 @@ module Decidim
36
37
  ::Decidim::Admin::Permissions,
37
38
  ::Decidim::Permissions)
38
39
 
39
- # Saves the location before loading each page so we can return to the
40
- # right page.
41
- before_action :store_current_location
42
-
43
40
  before_action :store_machine_translations_toggle
44
41
  helper_method :machine_translations_toggled?
45
42
 
@@ -52,18 +49,6 @@ module Decidim
52
49
 
53
50
  private
54
51
 
55
- # Stores the url where the user will be redirected after login.
56
- #
57
- # Uses the `redirect_url` param or the current url if there's no param.
58
- # In Devise controllers we only store the URL if it's from the params, we don't
59
- # want to overwrite the stored URL for a Devise one.
60
- def store_current_location
61
- return if skip_store_location?
62
-
63
- value = redirect_url || request.url
64
- store_location_for(:user, value)
65
- end
66
-
67
52
  # This overrides Devise's method for extracting the path from the URL. We
68
53
  # want to ensure the path to be stored in the cookie is not too long in
69
54
  # order to avoid ActionDispatch::Cookies::CookieOverflow exception. If the
@@ -97,20 +82,6 @@ module Decidim
97
82
  RequestStore.store[:toggle_machine_translations]
98
83
  end
99
84
 
100
- def skip_store_location?
101
- # Skip if Devise already handles the redirection
102
- return true if devise_controller? && redirect_url.blank?
103
- # Skip for all non-HTML requests"
104
- return true unless request.format.html?
105
- # Skip if a signed in user requests the TOS page without having agreed to
106
- # the TOS. Most of the times this is because of a redirect to the TOS
107
- # page (in which case the desired location is somewhere else after the
108
- # TOS is agreed).
109
- return true if current_user && !current_user.tos_accepted? && request.path == tos_path
110
-
111
- false
112
- end
113
-
114
85
  def user_has_no_permission_path
115
86
  decidim.root_path
116
87
  end
@@ -29,15 +29,6 @@ module Decidim
29
29
  end
30
30
  end
31
31
 
32
- def filter_cache_hash(filter, type = nil)
33
- hash = []
34
- hash << "decidim/proposals/filters"
35
- hash << type.to_s if type.present?
36
- hash << Digest::MD5.hexdigest(filter.to_json)
37
-
38
- hash.join("/")
39
- end
40
-
41
32
  private
42
33
 
43
34
  # Creates a unique namespace for a filter form to prevent dupliacte IDs in
@@ -10,7 +10,7 @@ module Decidim
10
10
  # options - An optional hash of options (default: { zoom: 17 })
11
11
  # * zoom: A number to represent the zoom value of the map
12
12
  def static_map_link(resource, options = {}, map_html_options = {}, &block)
13
- return unless resource.geocoded?
13
+ return unless resource.geocoded_and_valid?
14
14
  return unless map_utility_static || map_utility_dynamic
15
15
 
16
16
  address_text = resource.try(:address)
@@ -1,5 +1,5 @@
1
1
  <% @cell = cell(
2
- "decidim/newsletter_templates/basic_only_text",
2
+ "decidim/newsletter_templates/#{newsletter.template.manifest_name}",
3
3
  newsletter.template,
4
4
  organization: @organization,
5
5
  newsletter: newsletter,
@@ -462,7 +462,7 @@ cs:
462
462
  registrations:
463
463
  new:
464
464
  already_have_an_account?: Máte již účet?
465
- newsletter: Dostávejte příležitostný zpravodaj s relevantními informacemi
465
+ newsletter: Chci dostávat příležitostný zpravodaj s relevantními informacemi
466
466
  newsletter_title: Povolení kontaktu
467
467
  nickname_help: Váš alias v %{organization}. Může obsahovat pouze písmena, číslice, '-' a '_'.
468
468
  password_help: "%{minimun_characters} minimum znaků, nesmí být příliš běžné (např. 123456) a musí být jiné než vaše přezdívka a váš e-mail."
@@ -383,7 +383,7 @@ pl:
383
383
  dummy_global_attribute_1: Przykładowy atrybut 1
384
384
  dummy_global_attribute_2: Przykładowy atrybut 2
385
385
  dummy_global_translatable_text: Przykładowy tekst do tłumaczenia
386
- enable_pads_creation: Włącz tworzenie klocków
386
+ enable_pads_creation: Włącz tworzenie padów
387
387
  resources_permissions_enabled: Włączono uprawnienia do zasobów
388
388
  scope_id: Zakres
389
389
  scopes_enabled: Zakresy włączone
@@ -658,7 +658,7 @@ pl:
658
658
  email_outro: Otrzymałeś to powiadomienie, ponieważ jesteś autorem usuniętego zasobu.
659
659
  email_subject: '%{resource_type} został usunięty'
660
660
  notification_title: |-
661
- Administrator usunął %{resource_type}, ponieważ zasób został zgłoszony jako %{report_reasons}.</br>
661
+ Administrator usunął %{resource_type}, ponieważ treść została zgłoszona jako %{report_reasons}.</br>
662
662
  <i>%{resource_content}</i>
663
663
  resource_endorsed:
664
664
  email_intro: '%{endorser_name} %{endorser_nickname}, którego śledzisz, właśnie zarekomendował(a) „%{resource_title}” i uważamy, że może Cię to zainteresować. Sprawdź i zadecyduj:'
@@ -1191,8 +1191,8 @@ pl:
1191
1191
  subject: Zasób został zgłoszony
1192
1192
  reports:
1193
1193
  create:
1194
- error: Wystąpił błąd podczas tworzenia raportu. Proszę spróbować ponownie.
1195
- success: Raport został utworzony z powodzeniem i zostanie zweryfikowany przez administratora.
1194
+ error: Wystąpił błąd podczas tworzenia zgłoszenia. Proszę spróbować ponownie.
1195
+ success: Zgłoszenie zostało utworzone z powodzeniem i zostanie zweryfikowane przez administratora.
1196
1196
  resource_endorsements:
1197
1197
  create:
1198
1198
  error: Wystąpił błąd podczas udzielania rekomendacji.
@@ -1259,7 +1259,7 @@ pl:
1259
1259
  description: Czy ta treść jest nieodpowiednia?
1260
1260
  does_not_belong: Promuje nielegalną działalność, groźby samobójcze, informacje osobiste lub coś innego, co według Ciebie nie powinno pojawić się w %{organization_name}.
1261
1261
  offensive: Promuje rasizm, seksizm, nienawiść, ataki osobiste, groźby śmierci, groźby samobójcze jakąkolwiek formę mowy nienawiści.
1262
- report: Raport
1262
+ report: Zgłoś
1263
1263
  spam: Zawiera clickbaity, reklamy, oszustwa lub wrogie skrypty.
1264
1264
  title: Zgłoś nieodpowiednią zawartość
1265
1265
  flag_user_modal:
@@ -1265,6 +1265,8 @@ ro:
1265
1265
  does_not_belong: Conține activitate ilegală, amenințări de sinucidere, informații personale sau altceva care credeți că nu aparțin de %{organization_name}.
1266
1266
  offensive: Conține rasism, sexism, insulte, atacuri personale, amenințări cu moartea, cereri de sinucidere sau orice formă de discurs de incitare la ură.
1267
1267
  report: Raportează
1268
+ spam: Conține clickbait, publicitate, escrocherii sau roboți script.
1269
+ title: Raportează un utilizator nepotrivit
1268
1270
  floating_help:
1269
1271
  close: Închide Ajutor
1270
1272
  help: Ajutor
@@ -1293,6 +1295,10 @@ ro:
1293
1295
  tags:
1294
1296
  filter_results_for_category: 'Filtrează rezultatele pentru categoria: %{resource}'
1295
1297
  filter_results_for_scope: 'Filtrează rezultatele pentru scope: %{resource}'
1298
+ translation_bar:
1299
+ help_text: "<strong>Avertisment:</strong> Conținutul poate fi tradus automat și nu este 100% exact."
1300
+ show_original: Afișați textul original
1301
+ show_translated: Arată textul tradus automat
1296
1302
  user_activity:
1297
1303
  index:
1298
1304
  no_activities_warning: Acest participant nu a avut încă nicio activitate.
@@ -1336,6 +1342,13 @@ ro:
1336
1342
  update:
1337
1343
  error: A apărut o eroare la actualizarea intereselor tale.
1338
1344
  success: Interesele tale au fost actualizate cu succes.
1345
+ user_report_mailer:
1346
+ notify:
1347
+ body_1: Utilizatorul %{user} a fost raportat de %{token}
1348
+ body_2: 'Motiv: %{reason}'
1349
+ greetings: Salutări,<br/>%{organization_name}<br/><a href="%{organization_url}">%{organization_url}</a>
1350
+ hello: Bună ziua %{admin},
1351
+ subject: Un nou utilizator a fost raportat în %{organization_name}
1339
1352
  version:
1340
1353
  show:
1341
1354
  back_to_resource: Mergi înapoi
@@ -1346,9 +1359,13 @@ ro:
1346
1359
  version_created_at: Versiune creată la
1347
1360
  version_number: Număr versiune
1348
1361
  version_number_out_of_total: "%{current_version} din %{total_count}"
1362
+ version_author:
1363
+ show:
1364
+ deleted: Participant șters
1349
1365
  versions:
1350
1366
  resource_version:
1351
1367
  of_versions: "(din %{number})"
1368
+ see_other_versions: afișați alte versiuni
1352
1369
  version: Versiunea %{number}
1353
1370
  versions_list:
1354
1371
  show:
@@ -1360,6 +1377,7 @@ ro:
1360
1377
  show:
1361
1378
  version_index: Versiunea %{index}
1362
1379
  welcome_notification:
1380
+ default_body: <p>Bună ziua {{name}}, vă mulțumin că v-ați alăturat {{organization}} și bine ați venit!</p><ul><li>Dacă doriți să aveți o idee despre ceea ce puteți face aici, examinați secțiunea de <a href="{{help_url}}">Ajutor</a>.</li><li>După citirea acesteia veți primi primul ecuson. Aici este <a href="{{badges_url}}">lista tuturor ecusoanelor</a> pe care le puteți obține pe măsură ce participați în cadrul {{organization}}</li><li>Nu în ultimul rând, puteți să vă alăturați altor persoane, să împărtășiți cu acestea experiența dvs. de implicare și participare în cadrul {{organization}}. Formulați propuneri și comentarii, dezbateți, reflectați asupra modului de a contribui la binele comun, oferiți argumente pentru a convinge, ascultați și citiți pentru a vă lăsa convinși, exprimați-vă ideile în mod concret și direct, răspundeți ferm și cu răbdare, apărați-vă ideile și mențineți o atitudine deschisă pentru a colabora și a participa la ideile altora.</li></ul>
1363
1381
  default_subject: Îți mulțumim că te-ai alăturat {{organization}}!
1364
1382
  wizard_step_form:
1365
1383
  wizard_aside:
@@ -1574,6 +1592,11 @@ ro:
1574
1592
  instagram: "%{organization} la Instagram"
1575
1593
  twitter: "%{organization} pe Twitter"
1576
1594
  youtube: "%{organization} pe YouTube"
1595
+ timeout_modal:
1596
+ body: Ai fost inactiv de %{minutes} minute. Dacă continui să fii inactiv, vei fi deconectat automat pentru propria ta securitate.
1597
+ continue_session: Continuă sesiunea
1598
+ sign_out: Ieșiți
1599
+ title: Vreți să continuați sesiunea?
1577
1600
  user_menu:
1578
1601
  account: 'Cont de utilizator: %{name}'
1579
1602
  admin_dashboard: Panou de administrare
@@ -1595,6 +1618,7 @@ ro:
1595
1618
  see_more: Vezi mai multe
1596
1619
  locale:
1597
1620
  name: Română
1621
+ name_with_error: Română (eroare!)
1598
1622
  password_validator:
1599
1623
  domain_included_in_password: este prea similar cu acest nume de domeniu
1600
1624
  email_included_in_password: este prea asemănător cu adresa de e-mail
@@ -4,7 +4,7 @@ module Decidim
4
4
  # This holds the decidim-core version.
5
5
  module Core
6
6
  def self.version
7
- "0.24.2"
7
+ "0.24.3"
8
8
  end
9
9
  end
10
10
  end
@@ -27,6 +27,10 @@ module Decidim
27
27
  included do
28
28
  include Geocoder::Store::ActiveRecord
29
29
 
30
+ def geocoded_and_valid?
31
+ geocoded? && to_coordinates.none?(&:nan?)
32
+ end
33
+
30
34
  private
31
35
 
32
36
  # rubocop:disable Style/OptionalBooleanParameter
@@ -26,14 +26,14 @@ module Decidim
26
26
  #
27
27
  # Returns Boolean.
28
28
  def hidden?
29
- moderation&.hidden_at&.present?
29
+ moderation&.hidden_at&.present? || false
30
30
  end
31
31
 
32
32
  # Public: Checks if the reportable has been reported or not.
33
33
  #
34
34
  # Returns Boolean.
35
35
  def reported?
36
- moderation&.report_count&.positive?
36
+ moderation&.report_count&.positive? || false
37
37
  end
38
38
 
39
39
  # Public: The reported content url
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: decidim-core
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.24.2
4
+ version: 0.24.3
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: 2021-05-07 00:00:00.000000000 Z
13
+ date: 2021-06-01 00:00:00.000000000 Z
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: active_link_to
@@ -858,28 +858,28 @@ dependencies:
858
858
  requirements:
859
859
  - - '='
860
860
  - !ruby/object:Gem::Version
861
- version: 0.24.2
861
+ version: 0.24.3
862
862
  type: :runtime
863
863
  prerelease: false
864
864
  version_requirements: !ruby/object:Gem::Requirement
865
865
  requirements:
866
866
  - - '='
867
867
  - !ruby/object:Gem::Version
868
- version: 0.24.2
868
+ version: 0.24.3
869
869
  - !ruby/object:Gem::Dependency
870
870
  name: decidim-dev
871
871
  requirement: !ruby/object:Gem::Requirement
872
872
  requirements:
873
873
  - - '='
874
874
  - !ruby/object:Gem::Version
875
- version: 0.24.2
875
+ version: 0.24.3
876
876
  type: :development
877
877
  prerelease: false
878
878
  version_requirements: !ruby/object:Gem::Requirement
879
879
  requirements:
880
880
  - - '='
881
881
  - !ruby/object:Gem::Version
882
- version: 0.24.2
882
+ version: 0.24.3
883
883
  description: Adds core features so other engines can hook into the framework.
884
884
  email:
885
885
  - josepjaume@gmail.com
@@ -1371,6 +1371,7 @@ files:
1371
1371
  - app/controllers/concerns/decidim/flaggable.rb
1372
1372
  - app/controllers/concerns/decidim/force_authentication.rb
1373
1373
  - app/controllers/concerns/decidim/form_factory.rb
1374
+ - app/controllers/concerns/decidim/has_stored_path.rb
1374
1375
  - app/controllers/concerns/decidim/http_caching_disabler.rb
1375
1376
  - app/controllers/concerns/decidim/impersonate_users.rb
1376
1377
  - app/controllers/concerns/decidim/locale_switcher.rb