diff --git a/.github/workflows/tests-legacy.yml b/.github/workflows/tests-legacy.yml
index a4b4517b5..b866ba1f0 100644
--- a/.github/workflows/tests-legacy.yml
+++ b/.github/workflows/tests-legacy.yml
@@ -59,10 +59,11 @@ jobs:
- name: General RSpec with config vars enabled
run: bundle exec rspec spec/${{ matrix.rspec }}
env:
- SIMPLECOV: 1
- CODECOV: 1
FEATURES: ${{ matrix.features }}
+ - name: Upload coverage reports to Codecov
+ uses: codecov/codecov-action@v3
+
- uses: actions/upload-artifact@v2-preview
if: always()
with:
diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml
index b48d04d03..9ccaf6fe8 100644
--- a/.github/workflows/tests.yml
+++ b/.github/workflows/tests.yml
@@ -59,10 +59,11 @@ jobs:
- name: General RSpec with config vars enabled
run: bundle exec rspec spec/${{ matrix.rspec }}
env:
- SIMPLECOV: 1
- CODECOV: 1
FEATURES: ${{ matrix.features }}
+ - name: Upload coverage reports to Codecov
+ uses: codecov/codecov-action@v3
+
- uses: actions/upload-artifact@v2-preview
if: always()
with:
diff --git a/Gemfile b/Gemfile
index 45a51a5d6..ba7d21ce8 100644
--- a/Gemfile
+++ b/Gemfile
@@ -4,7 +4,7 @@ source "https://rubygems.org"
ruby RUBY_VERSION
-DECIDIM_VERSION = "0.27.0"
+DECIDIM_VERSION = "0.27.1"
gem "decidim", DECIDIM_VERSION
gem "decidim-decidim_awesome", path: "."
diff --git a/Gemfile.lock b/Gemfile.lock
index 7859237ba..62f8543ce 100644
--- a/Gemfile.lock
+++ b/Gemfile.lock
@@ -9,40 +9,40 @@ PATH
GEM
remote: https://rubygems.org/
specs:
- actioncable (6.1.7)
- actionpack (= 6.1.7)
- activesupport (= 6.1.7)
+ actioncable (6.1.7.2)
+ actionpack (= 6.1.7.2)
+ activesupport (= 6.1.7.2)
nio4r (~> 2.0)
websocket-driver (>= 0.6.1)
- actionmailbox (6.1.7)
- actionpack (= 6.1.7)
- activejob (= 6.1.7)
- activerecord (= 6.1.7)
- activestorage (= 6.1.7)
- activesupport (= 6.1.7)
+ actionmailbox (6.1.7.2)
+ actionpack (= 6.1.7.2)
+ activejob (= 6.1.7.2)
+ activerecord (= 6.1.7.2)
+ activestorage (= 6.1.7.2)
+ activesupport (= 6.1.7.2)
mail (>= 2.7.1)
- actionmailer (6.1.7)
- actionpack (= 6.1.7)
- actionview (= 6.1.7)
- activejob (= 6.1.7)
- activesupport (= 6.1.7)
+ actionmailer (6.1.7.2)
+ actionpack (= 6.1.7.2)
+ actionview (= 6.1.7.2)
+ activejob (= 6.1.7.2)
+ activesupport (= 6.1.7.2)
mail (~> 2.5, >= 2.5.4)
rails-dom-testing (~> 2.0)
- actionpack (6.1.7)
- actionview (= 6.1.7)
- activesupport (= 6.1.7)
+ actionpack (6.1.7.2)
+ actionview (= 6.1.7.2)
+ activesupport (= 6.1.7.2)
rack (~> 2.0, >= 2.0.9)
rack-test (>= 0.6.3)
rails-dom-testing (~> 2.0)
rails-html-sanitizer (~> 1.0, >= 1.2.0)
- actiontext (6.1.7)
- actionpack (= 6.1.7)
- activerecord (= 6.1.7)
- activestorage (= 6.1.7)
- activesupport (= 6.1.7)
+ actiontext (6.1.7.2)
+ actionpack (= 6.1.7.2)
+ activerecord (= 6.1.7.2)
+ activestorage (= 6.1.7.2)
+ activesupport (= 6.1.7.2)
nokogiri (>= 1.8.5)
- actionview (6.1.7)
- activesupport (= 6.1.7)
+ actionview (6.1.7.2)
+ activesupport (= 6.1.7.2)
builder (~> 3.1)
erubi (~> 1.4)
rails-dom-testing (~> 2.0)
@@ -50,22 +50,22 @@ GEM
active_link_to (1.0.5)
actionpack
addressable
- activejob (6.1.7)
- activesupport (= 6.1.7)
+ activejob (6.1.7.2)
+ activesupport (= 6.1.7.2)
globalid (>= 0.3.6)
- activemodel (6.1.7)
- activesupport (= 6.1.7)
- activerecord (6.1.7)
- activemodel (= 6.1.7)
- activesupport (= 6.1.7)
- activestorage (6.1.7)
- actionpack (= 6.1.7)
- activejob (= 6.1.7)
- activerecord (= 6.1.7)
- activesupport (= 6.1.7)
+ activemodel (6.1.7.2)
+ activesupport (= 6.1.7.2)
+ activerecord (6.1.7.2)
+ activemodel (= 6.1.7.2)
+ activesupport (= 6.1.7.2)
+ activestorage (6.1.7.2)
+ actionpack (= 6.1.7.2)
+ activejob (= 6.1.7.2)
+ activerecord (= 6.1.7.2)
+ activesupport (= 6.1.7.2)
marcel (~> 1.0)
mini_mime (>= 1.1.0)
- activesupport (6.1.7)
+ activesupport (6.1.7.2)
concurrent-ruby (~> 1.0, >= 1.0.2)
i18n (>= 1.6, < 2)
minitest (>= 5.1)
@@ -76,7 +76,7 @@ GEM
addressable (2.8.1)
public_suffix (>= 2.0.2, < 6.0)
ast (2.4.2)
- axe-core-api (4.5.1)
+ axe-core-api (4.6.0)
dumb_delegator
virtus
axe-core-rspec (4.1.0)
@@ -98,7 +98,7 @@ GEM
parser (>= 2.4)
smart_properties
bindex (0.8.1)
- bootsnap (1.15.0)
+ bootsnap (1.16.0)
msgpack (~> 1.2)
browser (2.7.1)
builder (3.2.4)
@@ -146,8 +146,8 @@ GEM
coffee-script-source
execjs
coffee-script-source (1.12.2)
- commonmarker (0.23.6)
- concurrent-ruby (1.1.10)
+ commonmarker (0.23.8)
+ concurrent-ruby (1.2.0)
crack (0.4.5)
rexml
crass (1.0.6)
@@ -160,53 +160,53 @@ GEM
db-query-matchers (0.10.0)
activesupport (>= 4.0, < 7)
rspec (~> 3.0)
- decidim (0.27.0)
- decidim-accountability (= 0.27.0)
- decidim-admin (= 0.27.0)
- decidim-api (= 0.27.0)
- decidim-assemblies (= 0.27.0)
- decidim-blogs (= 0.27.0)
- decidim-budgets (= 0.27.0)
- decidim-comments (= 0.27.0)
- decidim-core (= 0.27.0)
- decidim-debates (= 0.27.0)
- decidim-forms (= 0.27.0)
- decidim-generators (= 0.27.0)
- decidim-meetings (= 0.27.0)
- decidim-pages (= 0.27.0)
- decidim-participatory_processes (= 0.27.0)
- decidim-proposals (= 0.27.0)
- decidim-sortitions (= 0.27.0)
- decidim-surveys (= 0.27.0)
- decidim-system (= 0.27.0)
- decidim-templates (= 0.27.0)
- decidim-verifications (= 0.27.0)
- decidim-accountability (0.27.0)
- decidim-comments (= 0.27.0)
- decidim-core (= 0.27.0)
- decidim-admin (0.27.0)
+ decidim (0.27.1)
+ decidim-accountability (= 0.27.1)
+ decidim-admin (= 0.27.1)
+ decidim-api (= 0.27.1)
+ decidim-assemblies (= 0.27.1)
+ decidim-blogs (= 0.27.1)
+ decidim-budgets (= 0.27.1)
+ decidim-comments (= 0.27.1)
+ decidim-core (= 0.27.1)
+ decidim-debates (= 0.27.1)
+ decidim-forms (= 0.27.1)
+ decidim-generators (= 0.27.1)
+ decidim-meetings (= 0.27.1)
+ decidim-pages (= 0.27.1)
+ decidim-participatory_processes (= 0.27.1)
+ decidim-proposals (= 0.27.1)
+ decidim-sortitions (= 0.27.1)
+ decidim-surveys (= 0.27.1)
+ decidim-system (= 0.27.1)
+ decidim-templates (= 0.27.1)
+ decidim-verifications (= 0.27.1)
+ decidim-accountability (0.27.1)
+ decidim-comments (= 0.27.1)
+ decidim-core (= 0.27.1)
+ decidim-admin (0.27.1)
active_link_to (~> 1.0)
- decidim-core (= 0.27.0)
+ decidim-core (= 0.27.1)
devise (~> 4.7)
devise-i18n (~> 1.2)
devise_invitable (~> 2.0)
- decidim-api (0.27.0)
+ decidim-api (0.27.1)
graphql (~> 1.12, < 1.13)
graphql-docs (~> 2.1.0)
rack-cors (~> 1.0)
- decidim-assemblies (0.27.0)
- decidim-core (= 0.27.0)
- decidim-blogs (0.27.0)
- decidim-admin (= 0.27.0)
- decidim-comments (= 0.27.0)
- decidim-core (= 0.27.0)
- decidim-budgets (0.27.0)
- decidim-comments (= 0.27.0)
- decidim-core (= 0.27.0)
- decidim-comments (0.27.0)
- decidim-core (= 0.27.0)
+ decidim-assemblies (0.27.1)
+ decidim-core (= 0.27.1)
+ decidim-blogs (0.27.1)
+ decidim-admin (= 0.27.1)
+ decidim-comments (= 0.27.1)
+ decidim-core (= 0.27.1)
+ decidim-budgets (0.27.1)
+ decidim-comments (= 0.27.1)
+ decidim-core (= 0.27.1)
+ decidim-comments (0.27.1)
+ decidim-core (= 0.27.1)
redcarpet (~> 3.5, >= 3.5.1)
- decidim-core (0.27.0)
+ decidim-core (0.27.1)
active_link_to (~> 1.0)
acts_as_list (~> 0.9)
batch-loader (~> 1.2)
@@ -216,7 +216,7 @@ GEM
cells-rails (~> 0.1.3)
charlock_holmes (~> 0.7)
date_validator (~> 0.12.0)
- decidim-api (= 0.27.0)
+ decidim-api (= 0.27.1)
devise (~> 4.7)
devise-i18n (~> 1.2)
diffy (~> 3.3)
@@ -257,15 +257,15 @@ GEM
webpacker (= 6.0.0.rc.5)
webpush (~> 1.1)
wisper (~> 2.0)
- decidim-debates (0.27.0)
- decidim-comments (= 0.27.0)
- decidim-core (= 0.27.0)
- decidim-dev (0.27.0)
+ decidim-debates (0.27.1)
+ decidim-comments (= 0.27.1)
+ decidim-core (= 0.27.1)
+ decidim-dev (0.27.1)
axe-core-rspec (~> 4.1.0)
byebug (~> 11.0)
capybara (~> 3.24)
db-query-matchers (~> 0.10.0)
- decidim (= 0.27.0)
+ decidim (= 0.27.1)
erb_lint (~> 0.0.35)
factory_bot_rails (~> 4.8)
i18n-tasks (~> 0.9.18)
@@ -288,45 +288,45 @@ GEM
w3c_rspec_validators (~> 0.3.0)
webmock (~> 3.6)
wisper-rspec (~> 1.0)
- decidim-forms (0.27.0)
- decidim-core (= 0.27.0)
+ decidim-forms (0.27.1)
+ decidim-core (= 0.27.1)
wicked_pdf (~> 2.1)
wkhtmltopdf-binary (~> 0.12)
- decidim-generators (0.27.0)
- decidim-core (= 0.27.0)
- decidim-meetings (0.27.0)
- decidim-core (= 0.27.0)
- decidim-forms (= 0.27.0)
+ decidim-generators (0.27.1)
+ decidim-core (= 0.27.1)
+ decidim-meetings (0.27.1)
+ decidim-core (= 0.27.1)
+ decidim-forms (= 0.27.1)
icalendar (~> 2.5)
- decidim-pages (0.27.0)
- decidim-core (= 0.27.0)
- decidim-participatory_processes (0.27.0)
- decidim-core (= 0.27.0)
- decidim-proposals (0.27.0)
- decidim-comments (= 0.27.0)
- decidim-core (= 0.27.0)
+ decidim-pages (0.27.1)
+ decidim-core (= 0.27.1)
+ decidim-participatory_processes (0.27.1)
+ decidim-core (= 0.27.1)
+ decidim-proposals (0.27.1)
+ decidim-comments (= 0.27.1)
+ decidim-core (= 0.27.1)
doc2text (~> 0.4.5)
redcarpet (~> 3.5, >= 3.5.1)
- decidim-sortitions (0.27.0)
- decidim-admin (= 0.27.0)
- decidim-comments (= 0.27.0)
- decidim-core (= 0.27.0)
- decidim-proposals (= 0.27.0)
- decidim-surveys (0.27.0)
- decidim-core (= 0.27.0)
- decidim-forms (= 0.27.0)
- decidim-templates (= 0.27.0)
- decidim-system (0.27.0)
+ decidim-sortitions (0.27.1)
+ decidim-admin (= 0.27.1)
+ decidim-comments (= 0.27.1)
+ decidim-core (= 0.27.1)
+ decidim-proposals (= 0.27.1)
+ decidim-surveys (0.27.1)
+ decidim-core (= 0.27.1)
+ decidim-forms (= 0.27.1)
+ decidim-templates (= 0.27.1)
+ decidim-system (0.27.1)
active_link_to (~> 1.0)
- decidim-core (= 0.27.0)
+ decidim-core (= 0.27.1)
devise (~> 4.7)
devise-i18n (~> 1.2)
devise_invitable (~> 2.0)
- decidim-templates (0.27.0)
- decidim-core (= 0.27.0)
- decidim-forms (= 0.27.0)
- decidim-verifications (0.27.0)
- decidim-core (= 0.27.0)
+ decidim-templates (0.27.1)
+ decidim-core (= 0.27.1)
+ decidim-forms (= 0.27.1)
+ decidim-verifications (0.27.1)
+ decidim-core (= 0.27.1)
declarative-builder (0.1.0)
declarative-option (< 0.2.0)
declarative-option (0.1.0)
@@ -349,7 +349,7 @@ GEM
nokogiri (>= 1.13.2, < 1.14.0)
rubyzip (~> 2.3.0)
docile (1.4.0)
- doorkeeper (5.6.2)
+ doorkeeper (5.6.4)
railties (>= 5)
doorkeeper-i18n (4.0.1)
dumb_delegator (1.0.0)
@@ -365,7 +365,7 @@ GEM
temple
erubi (1.12.0)
escape_utils (1.3.0)
- excon (0.97.1)
+ excon (0.99.0)
execjs (2.8.1)
extended-markdown-filter (0.7.0)
html-pipeline (~> 2.9)
@@ -376,7 +376,7 @@ GEM
railties (>= 3.0.0)
faker (2.23.0)
i18n (>= 1.8.11, < 2)
- faraday (2.7.3)
+ faraday (2.7.4)
faraday-net_http (>= 2.0, < 3.1)
ruby2_keywords (>= 0.0.4)
faraday-net_http (3.0.2)
@@ -399,7 +399,7 @@ GEM
railties (>= 4.1, < 7.1)
gemoji (3.0.1)
geocoder (1.8.1)
- globalid (1.0.0)
+ globalid (1.1.0)
activesupport (>= 5.0)
graphql (1.12.24)
graphql-docs (2.1.0)
@@ -441,7 +441,7 @@ GEM
invisible_captcha (0.13.0)
rails (>= 3.2.0)
json (2.6.3)
- jwt (2.6.0)
+ jwt (2.7.0)
kaminari (1.2.2)
activesupport (>= 4.1.0)
kaminari-actionview (= 1.2.2)
@@ -472,7 +472,7 @@ GEM
loofah (2.3.1)
crass (~> 1.0.2)
nokogiri (>= 1.5.9)
- mail (2.8.0.1)
+ mail (2.8.1)
mini_mime (>= 0.1.1)
net-imap
net-pop
@@ -525,7 +525,7 @@ GEM
rack (>= 1.2, < 4)
snaky_hash (~> 2.0)
version_gem (~> 1.1)
- omniauth (2.1.0)
+ omniauth (2.1.1)
hashie (>= 3.4.6)
rack (>= 2.2.3)
rack-protection
@@ -561,7 +561,7 @@ GEM
pg_search (2.3.6)
activerecord (>= 5.2)
activesupport (>= 5.2)
- premailer (1.18.0)
+ premailer (1.19.0)
addressable
css_parser (>= 1.12.0)
htmlentities (>= 4.0.0)
@@ -573,31 +573,31 @@ GEM
puma (5.6.5)
nio4r (~> 2.0)
racc (1.6.2)
- rack (2.2.6)
+ rack (2.2.6.2)
rack-attack (6.6.1)
rack (>= 1.0, < 3)
rack-cors (1.1.1)
rack (>= 2.0.0)
rack-protection (3.0.5)
rack
- rack-proxy (0.7.4)
+ rack-proxy (0.7.6)
rack
rack-test (2.0.2)
rack (>= 1.3)
- rails (6.1.7)
- actioncable (= 6.1.7)
- actionmailbox (= 6.1.7)
- actionmailer (= 6.1.7)
- actionpack (= 6.1.7)
- actiontext (= 6.1.7)
- actionview (= 6.1.7)
- activejob (= 6.1.7)
- activemodel (= 6.1.7)
- activerecord (= 6.1.7)
- activestorage (= 6.1.7)
- activesupport (= 6.1.7)
+ rails (6.1.7.2)
+ actioncable (= 6.1.7.2)
+ actionmailbox (= 6.1.7.2)
+ actionmailer (= 6.1.7.2)
+ actionpack (= 6.1.7.2)
+ actiontext (= 6.1.7.2)
+ actionview (= 6.1.7.2)
+ activejob (= 6.1.7.2)
+ activemodel (= 6.1.7.2)
+ activerecord (= 6.1.7.2)
+ activestorage (= 6.1.7.2)
+ activesupport (= 6.1.7.2)
bundler (>= 1.15.0)
- railties (= 6.1.7)
+ railties (= 6.1.7.2)
sprockets-rails (>= 2.0.0)
rails-controller-testing (1.0.5)
actionpack (>= 5.0.1.rc1)
@@ -611,9 +611,9 @@ GEM
rails-i18n (6.0.0)
i18n (>= 0.7, < 2)
railties (>= 6.0.0, < 7)
- railties (6.1.7)
- actionpack (= 6.1.7)
- activesupport (= 6.1.7)
+ railties (6.1.7.2)
+ actionpack (= 6.1.7.2)
+ activesupport (= 6.1.7.2)
method_source
rake (>= 12.2)
thor (~> 1.0)
@@ -626,14 +626,14 @@ GEM
rb-fsevent (0.11.2)
rb-inotify (0.10.1)
ffi (~> 1.0)
- redcarpet (3.5.1)
+ redcarpet (3.6.0)
redis (4.8.0)
- regexp_parser (2.6.1)
+ regexp_parser (2.6.2)
request_store (1.5.1)
rack (>= 1.4)
- responders (3.0.1)
- actionpack (>= 5.0)
- railties (>= 5.0)
+ responders (3.1.0)
+ actionpack (>= 5.2)
+ railties (>= 5.2)
rexml (3.2.5)
rspec (3.12.0)
rspec-core (~> 3.12.0)
@@ -642,7 +642,7 @@ GEM
rspec-cells (0.3.8)
cells (>= 4.0.0, < 6.0.0)
rspec-rails (>= 3.0.0, < 6.1.0)
- rspec-core (3.12.0)
+ rspec-core (3.12.1)
rspec-support (~> 3.12.0)
rspec-expectations (3.12.2)
diff-lcs (>= 1.2.0, < 2.0)
@@ -734,7 +734,7 @@ GEM
activesupport (>= 5.2)
sprockets (>= 3.0.0)
ssrf_filter (1.1.1)
- temple (0.9.1)
+ temple (0.10.0)
terminal-table (3.0.2)
unicode-display_width (>= 1.1.1, < 3)
thor (1.2.1)
@@ -742,7 +742,7 @@ GEM
tilt (2.0.11)
timeout (0.3.1)
tomlrb (2.0.3)
- tzinfo (2.0.5)
+ tzinfo (2.0.6)
concurrent-ruby (~> 1.0)
uber (0.1.0)
uglifier (4.2.0)
@@ -802,9 +802,9 @@ DEPENDENCIES
bootsnap (~> 1.4)
byebug (~> 11.0)
codecov
- decidim (= 0.27.0)
+ decidim (= 0.27.1)
decidim-decidim_awesome!
- decidim-dev (= 0.27.0)
+ decidim-dev (= 0.27.1)
faker (~> 2.14)
letter_opener_web (~> 1.3)
listen (~> 3.1)
diff --git a/Rakefile b/Rakefile
index 2eab062f1..9d19bb668 100644
--- a/Rakefile
+++ b/Rakefile
@@ -51,6 +51,6 @@ task :development_app do
end
install_module("development_app")
- seed_db("development_app")
override_webpacker_config_files("development_app")
+ seed_db("development_app")
end
diff --git a/app/packs/src/decidim/decidim_awesome/awesome_map/controllers/controller.js b/app/packs/src/decidim/decidim_awesome/awesome_map/controllers/controller.js
index 4c56e80fd..44e9be785 100644
--- a/app/packs/src/decidim/decidim_awesome/awesome_map/controllers/controller.js
+++ b/app/packs/src/decidim/decidim_awesome/awesome_map/controllers/controller.js
@@ -29,13 +29,15 @@ export default class Controller {
this.fetcher.onCollection = (collection) => {
if (collection && collection.edges) {
// Add markers to the main cluster group
+ const collectionEdges = collection.edges.filter((item) => item.node.coordinates && item.node.coordinates.latitude && item.node.coordinates.longitude);
try {
- this.awesomeMap.cluster.addLayers(collection.edges.map((item) => item.node.marker));
+ this.awesomeMap.cluster.addLayers(collectionEdges.map((item) => item.node.marker));
} catch (e) {
- console.error("Failed marker collection assignation", collection);
+ console.error("Failed marker collection assignation", collectionEdges, "error", e);
}
// subgroups don't have th addLayers utility
- collection.edges.forEach((item) => {
+ collectionEdges.forEach((item) => {
+ this.awesomeMap.layers[this.component.type].group.addLayer(item.node.marker);
this.addMarkerCategory(item.node.marker, item.node.category);
this.addMarkerHashtags(item.node.marker, item.node.hashtags);
});
@@ -45,7 +47,8 @@ export default class Controller {
addControls() {
this.awesomeMap.controls.main.addOverlay(this.controls.group, this.controls.label);
- this.awesomeMap.map.addLayer(this.controls.group);
+ this.controls.group.addTo(this.awesomeMap.map);
+ this.awesomeMap.layers[this.component.type] = this.controls;
}
loadNodes() {
diff --git a/app/packs/src/decidim/decidim_awesome/editors/editor.js b/app/packs/src/decidim/decidim_awesome/editors/editor.js
index ee406b0d9..5709888c8 100644
--- a/app/packs/src/decidim/decidim_awesome/editors/editor.js
+++ b/app/packs/src/decidim/decidim_awesome/editors/editor.js
@@ -13,10 +13,9 @@ import "inline-attachment/src/codemirror-4.inline-attachment";
import "inline-attachment/src/jquery.inline-attachment";
import hljs from "highlight.js";
import "highlight.js/styles/github.css";
-
-// In 0.26 these files come with Decidim in the folder src/decidim/vendor so the awesome one's could be removed
-import "src/vendor/image-resize.min"
-import "src/vendor/image-upload.min"
+import "src/decidim/editor/clipboard_override"
+import "src/decidim/vendor/image-resize.min"
+import "src/decidim/vendor/image-upload.min"
const DecidimAwesome = window.DecidimAwesome || {};
const quillFormats = ["bold", "italic", "link", "underline", "header", "list", "video", "image", "alt", "break", "width", "style", "code", "blockquote", "indent"];
@@ -41,6 +40,7 @@ export function destroyQuillEditor(container) {
export function createQuillEditor(container) {
const toolbar = $(container).data("toolbar");
const disabled = $(container).data("disabled");
+ const allowedEmptyContentSelector = "iframe";
let quillToolbar = [
["bold", "italic", "underline", "linebreak"],
@@ -148,6 +148,16 @@ export function createQuillEditor(container) {
} else {
$input.val(quill.root.innerHTML);
}
+ if ((text === "\n" || text === "\n\n") && quill.root.querySelectorAll(allowedEmptyContentSelector).length === 0) {
+ $input.val("");
+ } else {
+ const emptyParagraph = "
";
+ const cleanHTML = quill.root.innerHTML.replace(
+ new RegExp(`^${emptyParagraph}|${emptyParagraph}$`, "g"),
+ ""
+ );
+ $input.val(cleanHTML);
+ }
});
// After editor is ready, linebreak_module deletes two extraneous new lines
quill.emitter.emit("editor-ready");
diff --git a/app/packs/src/vendor/image-resize.min.js b/app/packs/src/vendor/image-resize.min.js
deleted file mode 100644
index 9969f1b9f..000000000
--- a/app/packs/src/vendor/image-resize.min.js
+++ /dev/null
@@ -1 +0,0 @@
-!function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e():"function"==typeof define&&define.amd?define([],e):"object"==typeof exports?exports.ImageResize=e():t.ImageResize=e()}(this,function(){return function(t){function e(o){if(n[o])return n[o].exports;var r=n[o]={i:o,l:!1,exports:{}};return t[o].call(r.exports,r,r.exports,e),r.l=!0,r.exports}var n={};return e.m=t,e.c=n,e.i=function(t){return t},e.d=function(t,n,o){e.o(t,n)||Object.defineProperty(t,n,{configurable:!1,enumerable:!0,get:o})},e.n=function(t){var n=t&&t.__esModule?function(){return t.default}:function(){return t};return e.d(n,"a",n),n},e.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},e.p="",e(e.s=38)}([function(t,e){function n(t){var e=typeof t;return null!=t&&("object"==e||"function"==e)}t.exports=n},function(t,e,n){var o=n(22),r="object"==typeof self&&self&&self.Object===Object&&self,i=o||r||Function("return this")();t.exports=i},function(t,e){function n(t){return null!=t&&"object"==typeof t}t.exports=n},function(t,e,n){function o(t){var e=-1,n=null==t?0:t.length;for(this.clear();++e-1&&t%1==0&&t-1&&t%1==0&&t<=o}var o=9007199254740991;t.exports=n},function(t,e,n){var o=n(49),r=n(54),i=n(86),a=i&&i.isTypedArray,s=a?r(a):o;t.exports=s},function(t,e,n){function o(t){return a(t)?r(t,!0):i(t)}var r=n(43),i=n(50),a=n(12);t.exports=o},function(t,e,n){"use strict";e.a={modules:["DisplaySize","Toolbar","Resize"],overlayStyles:{position:"absolute",boxSizing:"border-box",border:"1px dashed #444"},handleStyles:{position:"absolute",height:"12px",width:"12px",backgroundColor:"white",border:"1px solid #777",boxSizing:"border-box",opacity:"0.80"},displayStyles:{position:"absolute",font:"12px/1.0 Arial, Helvetica, sans-serif",padding:"4px 8px",textAlign:"center",backgroundColor:"white",color:"#333",border:"1px solid #777",boxSizing:"border-box",opacity:"0.80",cursor:"default"},toolbarStyles:{position:"absolute",top:"-12px",right:"0",left:"0",height:"0",minWidth:"100px",font:"12px/1.0 Arial, Helvetica, sans-serif",textAlign:"center",color:"#333",boxSizing:"border-box",cursor:"default"},toolbarButtonStyles:{display:"inline-block",width:"24px",height:"24px",background:"white",border:"1px solid #999",verticalAlign:"middle"},toolbarButtonSvgStyles:{fill:"#444",stroke:"#444",strokeWidth:"2"}}},function(t,e,n){"use strict";function o(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function r(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}function i(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}var a=n(9);n.d(e,"a",function(){return s});var s=function(t){function e(){var t,n,i,a;o(this,e);for(var s=arguments.length,u=Array(s),c=0;c120&&t[1]>30)Object.assign(i.display.style,{right:"4px",bottom:"4px",left:"auto"});else if("right"==i.img.style.float){var e=i.display.getBoundingClientRect();Object.assign(i.display.style,{right:"auto",bottom:"-"+(e.height+4)+"px",left:"-"+(e.width+4)+"px"})}else{var n=i.display.getBoundingClientRect();Object.assign(i.display.style,{right:"-"+(n.width+4)+"px",bottom:"-"+(n.height+4)+"px",left:"auto"})}}},i.getCurrentSize=function(){return[i.img.width,Math.round(i.img.width/i.img.naturalWidth*i.img.naturalHeight)]},a=n,r(i,a)}return i(e,t),e}(a.a)},function(t,e,n){"use strict";function o(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function r(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}function i(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}var a=n(9);n.d(e,"a",function(){return s});var s=function(t){function e(){var t,n,i,a;o(this,e);for(var s=arguments.length,u=Array(s),c=0;c0&&(o.style.borderLeftWidth="0"),Object.assign(o.children[0].style,i.options.toolbarButtonSvgStyles),e.isApplied()&&i._selectButton(o),i.toolbar.appendChild(o)})},i._selectButton=function(t){t.style.filter="invert(20%)"},a=n,r(i,a)}return i(e,t),e}(p.a)},function(t,e,n){var o=n(17),r=n(20),i=n(63),a=n(101),s=r(function(t){return t.push(void 0,i),o(a,void 0,t)});t.exports=s},function(t,e,n){"use strict";function o(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(e,"__esModule",{value:!0});var r=n(37),i=n.n(r),a=n(33),s=n(34),u=n(36),c=n(35),l={DisplaySize:s.a,Toolbar:u.a,Resize:c.a},f=function t(e){var n=this,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};o(this,t),this.initializeModules=function(){n.removeModules(),n.modules=n.moduleClasses.map(function(t){return new(l[t]||t)(n)}),n.modules.forEach(function(t){t.onCreate()}),n.onUpdate()},this.onUpdate=function(){n.repositionElements(),n.modules.forEach(function(t){t.onUpdate()})},this.removeModules=function(){n.modules.forEach(function(t){t.onDestroy()}),n.modules=[]},this.handleClick=function(t){if(t.target&&t.target.tagName&&"IMG"===t.target.tagName.toUpperCase()){if(n.img===t.target)return;n.img&&n.hide(),n.show(t.target)}else n.img&&n.hide()},this.show=function(t){n.img=t,n.showOverlay(),n.initializeModules()},this.showOverlay=function(){n.overlay&&n.hideOverlay(),n.quill.setSelection(null),n.setUserSelect("none"),document.addEventListener("keyup",n.checkImage,!0),n.quill.root.addEventListener("input",n.checkImage,!0),n.overlay=document.createElement("div"),Object.assign(n.overlay.style,n.options.overlayStyles),n.quill.root.parentNode.appendChild(n.overlay),n.repositionElements()},this.hideOverlay=function(){n.overlay&&(n.quill.root.parentNode.removeChild(n.overlay),n.overlay=void 0,document.removeEventListener("keyup",n.checkImage),n.quill.root.removeEventListener("input",n.checkImage),n.setUserSelect(""))},this.repositionElements=function(){if(n.overlay&&n.img){var t=n.quill.root.parentNode,e=n.img.getBoundingClientRect(),o=t.getBoundingClientRect();Object.assign(n.overlay.style,{left:e.left-o.left-1+t.scrollLeft+"px",top:e.top-o.top+t.scrollTop+"px",width:e.width+"px",height:e.height+"px"})}},this.hide=function(){n.hideOverlay(),n.removeModules(),n.img=void 0},this.setUserSelect=function(t){["userSelect","mozUserSelect","webkitUserSelect","msUserSelect"].forEach(function(e){n.quill.root.style[e]=t,document.documentElement.style[e]=t})},this.checkImage=function(t){n.img&&(46!=t.keyCode&&8!=t.keyCode||window.Quill.find(n.img).deleteAt(0),n.hide())},this.quill=e;var s=!1;r.modules&&(s=r.modules.slice()),this.options=i()({},r,a.a),s!==!1&&(this.options.modules=s),document.execCommand("enableObjectResizing",!1,"false"),this.quill.root.addEventListener("click",this.handleClick,!1),this.quill.root.parentNode.style.position=this.quill.root.parentNode.style.position||"relative",this.moduleClasses=this.options.modules,this.modules=[]};e.default=f,window.Quill&&window.Quill.register("modules/imageResize",f)},function(t,e,n){function o(t){var e=-1,n=null==t?0:t.length;for(this.clear();++e1?n[r-1]:void 0,s=r>2?n[2]:void 0;for(a=t.length>3&&"function"==typeof a?(r--,a):void 0,s&&i(n[0],n[1],s)&&(a=r<3?void 0:a,r=1),e=Object(e);++o-1}var r=n(4);t.exports=o},function(t,e,n){function o(t,e){var n=this.__data__,o=r(n,t);return o<0?(++this.size,n.push([t,e])):n[o][1]=e,this}var r=n(4);t.exports=o},function(t,e,n){function o(){this.size=0,this.__data__={hash:new r,map:new(a||i),string:new r}}var r=n(39),i=n(3),a=n(15);t.exports=o},function(t,e,n){function o(t){var e=r(this,t).delete(t);return this.size-=e?1:0,e}var r=n(6);t.exports=o},function(t,e,n){function o(t){return r(this,t).get(t)}var r=n(6);t.exports=o},function(t,e,n){function o(t){return r(this,t).has(t)}var r=n(6);t.exports=o},function(t,e,n){function o(t,e){var n=r(this,t),o=n.size;return n.set(t,e),this.size+=n.size==o?0:1,this}var r=n(6);t.exports=o},function(t,e){function n(t){var e=[];if(null!=t)for(var n in Object(t))e.push(n);return e}t.exports=n},function(t,e,n){(function(t){var o=n(22),r="object"==typeof e&&e&&!e.nodeType&&e,i=r&&"object"==typeof t&&t&&!t.nodeType&&t,a=i&&i.exports===r,s=a&&o.process,u=function(){try{return s&&s.binding&&s.binding("util")}catch(t){}}();t.exports=u}).call(e,n(14)(t))},function(t,e){function n(t){return r.call(t)}var o=Object.prototype,r=o.toString;t.exports=n},function(t,e){function n(t,e){return function(n){return t(e(n))}}t.exports=n},function(t,e,n){function o(t,e,n){return e=i(void 0===e?t.length-1:e,0),function(){for(var o=arguments,a=-1,s=i(o.length-e,0),u=Array(s);++a0){if(++e>=o)return arguments[0]}else e=0;return t.apply(void 0,arguments)}}var o=800,r=16,i=Date.now;t.exports=n},function(t,e,n){function o(){this.__data__=new r,this.size=0}var r=n(3);t.exports=o},function(t,e){function n(t){var e=this.__data__,n=e.delete(t);return this.size=e.size,n}t.exports=n},function(t,e){function n(t){return this.__data__.get(t)}t.exports=n},function(t,e){function n(t){return this.__data__.has(t)}t.exports=n},function(t,e,n){function o(t,e){var n=this.__data__;if(n instanceof r){var o=n.__data__;if(!i||o.length\n \n \n \n'},function(t,e){t.exports=''},function(t,e){t.exports=''},function(t,e){var n;n=function(){return this}();try{n=n||Function("return this")()||(0,eval)("this")}catch(t){"object"==typeof window&&(n=window)}t.exports=n}])});
\ No newline at end of file
diff --git a/app/packs/src/vendor/image-upload.min.js b/app/packs/src/vendor/image-upload.min.js
deleted file mode 100644
index 638f2f527..000000000
--- a/app/packs/src/vendor/image-upload.min.js
+++ /dev/null
@@ -1,6 +0,0 @@
-/* Origin: https://github.com/Platoniq/quill-image-upload */
-(function () {
- var exports = {};
-"use strict";Object.defineProperty(exports,"__esModule",{value:true});var _createClass=function(){function e(e,t){for(var a=0;a1&&arguments[1]!==undefined?arguments[1]:{};_classCallCheck(this,e);this.quill=t;this.options=a;this.quill.getModule("toolbar").addHandler("image",this.selectLocalImage.bind(this));this.handleDrop=this.handleDrop.bind(this);this.handlePaste=this.handlePaste.bind(this);this.quill.root.addEventListener("drop",this.handleDrop,false);this.quill.root.addEventListener("paste",this.handlePaste,false)}_createClass(e,[{key:"selectLocalImage",value:function e(){var t=this;var a=document.createElement("input");a.setAttribute("type","file");a.click();a.onchange=function(){var e=a.files[0];if(/^image\//.test(e.type)){var i=t.options.checkBeforeSend||t.checkBeforeSend.bind(t);i(e,t.sendToServer.bind(t))}else{console.warn("You could only upload images.")}}}},{key:"checkBeforeSend",value:function e(t,a){a(t)}},{key:"sendToServer",value:function e(t){var a=this;if(this.options.customUploader){this.options.customUploader(t,function(e){a.insert(e)})}else{var i=this.options.url,n=this.options.method||"POST",s=this.options.name||"image",o=this.options.headers||{},r=this.options.callbackOK||this.uploadImageCallbackOK.bind(this),l=this.options.callbackKO||this.uploadImageCallbackKO.bind(this);if(i){var d=new FormData;d.append(s,t);if(this.options.csrf){d.append(this.options.csrf.token,this.options.csrf.hash)}var c=new XMLHttpRequest;c.open(n,i,true);for(var u in o){c.setRequestHeader(u,o[u])}c.onload=function(){if(c.status===200){r(JSON.parse(c.responseText),a.insert.bind(a))}else{l({code:c.status,type:c.statusText,body:c.responseText})}};if(this.options.withCredentials){c.withCredentials=true}c.send(d)}else{var f=new FileReader;f.onload=function(e){r(e.target.result,a.insert.bind(a))};f.readAsDataURL(t)}}}},{key:"handleDrop",value:function e(t){t.preventDefault();if(t.dataTransfer&&t.dataTransfer.files&&t.dataTransfer.files.length){if(document.caretRangeFromPoint){var a=document.getSelection();var i=document.caretRangeFromPoint(t.clientX,t.clientY);if(a&&i){a.setBaseAndExtent(i.startContainer,i.startOffset,i.startContainer,i.startOffset)}}this.readFiles(t.dataTransfer.files,this.sendToServer.bind(this))}}},{key:"handlePaste",value:function e(t){var a=this;var i=Quill.import("delta");if(t.clipboardData&&t.clipboardData.items&&t.clipboardData.items.length){this.readFiles(t.clipboardData.items,function(e){var t=a.quill.getSelection();if(t){a.quill.updateContents((new i).retain(t.index-1).delete(1))}setTimeout(function(){return a.sendToServer(e.getAsFile())},0)})}}},{key:"readFiles",value:function e(t,a){var i=this;[].forEach.call(t,function(e){if(!/^image\//.test(e.type)){return}var t=new FileReader;t.onload=function(t){var n=i.options.checkBeforeSend||i.checkBeforeSend.bind(i);n(e,a)};var n=e.getAsFile?e.getAsFile():e;if(n instanceof Blob){t.readAsDataURL(n)}})}},{key:"insert",value:function e(t){var a=(this.quill.getSelection()||{}).index||this.quill.getLength();this.quill.insertEmbed(a,"image",t,"user")}},{key:"uploadImageCallbackOK",value:function e(t,a){a(t)}},{key:"uploadImageCallbackKO",value:function e(t){alert(t)}}]);return e}();
- window.Quill.register('modules/imageUpload', exports.ImageUpload);
-})();
diff --git a/app/packs/src/vendor/leaflet.featuregroup.subgroup.js b/app/packs/src/vendor/leaflet.featuregroup.subgroup.js
deleted file mode 100644
index 427430dd5..000000000
--- a/app/packs/src/vendor/leaflet.featuregroup.subgroup.js
+++ /dev/null
@@ -1,184 +0,0 @@
-L.FeatureGroup.SubGroup = L.FeatureGroup.extend({
-
- /**
- * Instantiates a SubGroup.
- * @param parentGroup (L.LayerGroup) (optional)
- * @param layersArray (L.Layer[]) (optional)
- */
- initialize: function (parentGroup, layersArray) {
- L.FeatureGroup.prototype.initialize.call(this, layersArray);
-
- this.setParentGroup(parentGroup);
- },
-
- /**
- * Changes the parent group into which child markers are added to /
- * removed from.
- * @param parentGroup (L.LayerGroup)
- * @returns {SubGroup} this
- */
- setParentGroup: function (parentGroup) {
- var pgInstanceOfLG = parentGroup instanceof L.LayerGroup;
-
- this._parentGroup = parentGroup;
-
- // onAdd
- this.onAdd =
- pgInstanceOfLG ?
- (
- typeof parentGroup.addLayers === "function" ?
- this._onAddToGroupBatch :
- this._onAddToGroup
- ) :
- this._onAddToMap;
-
- // onRemove
- this.onRemove =
- pgInstanceOfLG ?
- (
- typeof parentGroup.removeLayers === "function" ?
- this._onRemoveFromGroupBatch :
- this._onRemoveFromGroup
- ) :
- this._onRemoveFromMap;
-
- // addLayer
- this.addLayer = pgInstanceOfLG ?
- this._addLayerToGroup :
- this._addLayerToMap;
-
- // removeLayer
- this.removeLayer = pgInstanceOfLG ?
- this._removeLayerFromGroup :
- this._removeLayerFromMap;
-
- return this;
- },
-
- /**
- * Removes the current sub-group from map before changing the parent
- * group. Re-adds the sub-group to map if it was before changing.
- * @param parentGroup (L.LayerGroup)
- * @returns {SubGroup} this
- */
- setParentGroupSafe: function (parentGroup) {
- var map = this._map;
-
- if (map) {
- map.removeLayer(this);
- }
-
- this.setParentGroup(parentGroup);
-
- if (map) {
- map.addLayer(this);
- }
-
- return this;
- },
-
- /**
- * Returns the current parent group.
- * @returns {*}
- */
- getParentGroup: function () {
- return this._parentGroup;
- },
-
-
- // For parent groups with batch methods (addLayers and removeLayers)
- // like MarkerCluster.
- _onAddToGroupBatch: function (map) {
- var layersArray = this.getLayers();
-
- this._map = map;
- this._parentGroup.addLayers(layersArray);
- },
-
- _onRemoveFromGroupBatch: function () {
- var layersArray = this.getLayers();
-
- this._parentGroup.removeLayers(layersArray);
- this._map = null;
- },
-
-
- // For other parent layer groups.
- _onAddToGroup: function (map) {
- var parentGroup = this._parentGroup;
-
- this._map = map;
- this.eachLayer(parentGroup.addLayer, parentGroup);
- },
-
- _onRemoveFromGroup: function () {
- var parentGroup = this._parentGroup;
-
- this.eachLayer(parentGroup.removeLayer, parentGroup);
- this._map = null;
- },
-
-
- // Defaults to standard FeatureGroup behaviour when parent group is not
- // specified or is not a type of LayerGroup.
- _onAddToMap: L.FeatureGroup.prototype.onAdd,
- _onRemoveFromMap: L.FeatureGroup.prototype.onRemove,
-
-
- _addLayerToGroup: function (layer) {
- if (this.hasLayer(layer)) {
- return this;
- }
-
- layer.addEventParent(this);
-
- var id = this.getLayerId(layer);
-console.log("adtogroup id",id,"layer",layer,"this",this)
- this._layers[id] = layer;
-
- if (this._map) {
- // Add to parent group instead of directly to map.
- this._parentGroup.addLayer(layer);
- }
-
- return this.fire("layeradd", {layer: layer});
- },
-
- _removeLayerFromGroup: function (layer) {
- // If unknown layer, skip.
- if (!this.hasLayer(layer)) {
- return this;
- }
-
- // Retrieve the layer id.
- var id = layer in this._layers ? layer : this.getLayerId(layer);
-
- // Retrieve the layer from this._layer.
- layer = this._layers[id];
-
- // Unregister from events parent.
- layer.removeEventParent(this);
-
- if (this._map && layer) {
- // Remove from parent group instead of directly from map.
- this._parentGroup.removeLayer(layer);
- }
-
- delete this._layers[id];
-
- return this.fire("layerremove", {layer: layer});
- },
-
- // Defaults to standard FeatureGroup behaviour when parent group is not
- // specified or is not a type of LayerGroup.
- _addLayerToMap: L.FeatureGroup.prototype.addLayer,
- _removeLayerFromMap: L.FeatureGroup.prototype.removeLayer
-
-});
-
-
-
-// Supply with a factory for consistency with Leaflet.
-L.featureGroup.subGroup = function (parentGroup, options) {
- return new L.FeatureGroup.SubGroup(parentGroup, options);
-};
diff --git a/lib/decidim/decidim_awesome/checksums.yml b/lib/decidim/decidim_awesome/checksums.yml
index e996653bb..763d15630 100644
--- a/lib/decidim/decidim_awesome/checksums.yml
+++ b/lib/decidim/decidim_awesome/checksums.yml
@@ -29,6 +29,7 @@ decidim-proposals:
decidim-0.26: 216c974bc425393c18b01bfc4eed4f0b
decidim-0.26.4: 2e673d2aabe66a80a971d7ff80ebdbb8
decidim-0.27: c0ebeac39ebe4926bf0e5fc585a384d7
+ decidim-0.27.1: a4f902d1c4829a7f7f62299686f8604e
/app/views/decidim/proposals/collaborative_drafts/show.html.erb:
decidim-0.24: 2a7e0a4c65361f238fd1b917f39c8642
/app/views/decidim/proposals/collaborative_drafts/_edit_form_fields.html.erb:
diff --git a/spec/system/admin/scoped_admins_spec.rb b/spec/system/admin/scoped_admins_spec.rb
index d5ce63aa5..0d11f2655 100644
--- a/spec/system/admin/scoped_admins_spec.rb
+++ b/spec/system/admin/scoped_admins_spec.rb
@@ -83,9 +83,7 @@
expect(page).to have_content("Agree to the terms and conditions of use")
- agree_to_terms = "I agree with the following terms"
- agree_to_terms = "I agree with the terms" if legacy_version?
- click_button agree_to_terms
+ click_button "I agree with the terms"
expect(page).to have_content(welcome_text)
expect(page).not_to have_content("Review them now")