diff --git a/.eslintrc.json b/.eslintrc.json index 7220f0d..aa53130 100644 --- a/.eslintrc.json +++ b/.eslintrc.json @@ -4,20 +4,237 @@ "es2021": true }, "extends": [ - "eslint:recommended" + "eslint:recommended", + "prettier" ], "parserOptions": { "ecmaVersion": 12, "sourceType": "module" }, "globals": { + "require": false, + "L": false, + "Foundation": false, "$": false, "jQuery": false, - "NavigationMapView": false, - "NavigationMapEditor": false, - "L": false, - "Foundation": false + "Rails": false }, - "rules": { - } + "rules": { + "accessor-pairs": "error", + "array-bracket-spacing": "error", + "array-callback-return": "error", + "arrow-body-style": "off", + "arrow-parens": [ + "error", + "always" + ], + "arrow-spacing": [ + "error", + { + "after": true, + "before": true + } + ], + "block-scoped-var": "error", + "block-spacing": "off", + "callback-return": "error", + "class-methods-use-this": "off", + "comma-dangle": ["error", "never"], + "comma-spacing": [ + "error", + { + "after": true, + "before": false + } + ], + "comma-style": [ + "error", + "last" + ], + "complexity": "error", + "computed-property-spacing": [ + "error", + "never" + ], + "consistent-this": "error", + "curly": "error", + "default-case": "error", + "dot-location": "error", + "dot-notation": "error", + "eol-last": "error", + "func-call-spacing": "error", + "func-name-matching": "error", + "func-names": [ + "error", + "never" + ], + "generator-star-spacing": "error", + "global-require": "error", + "handle-callback-err": "error", + "id-blacklist": "error", + "id-match": "error", + "indent": ["error", 2, { "VariableDeclarator": 2 }], + "jsx-quotes": "error", + "key-spacing": "error", + "keyword-spacing": [ + "error", + { + "after": true, + "before": true + } + ], + "linebreak-style": [ + "error", + "unix" + ], + "lines-around-comment": "error", + "lines-around-directive": "error", + "max-len": "off", + "max-lines": "error", + "max-nested-callbacks": "error", + "max-params": "error", + "max-statements": "off", + "max-statements-per-line": "error", + "multiline-ternary": "error", + "new-cap": "error", + "new-parens": "error", + "newline-after-var": "off", + "newline-before-return": "off", + "newline-per-chained-call": "off", + "no-alert": "error", + "no-array-constructor": "error", + "no-bitwise": "error", + "no-caller": "error", + "no-catch-shadow": "error", + "no-confusing-arrow": "error", + "no-continue": "error", + "no-div-regex": "error", + "no-duplicate-imports": "error", + "no-else-return": "error", + "no-eq-null": "error", + "no-eval": "error", + "no-extend-native": "error", + "no-extra-bind": "error", + "no-extra-label": "error", + "no-extra-parens": "off", + "no-floating-decimal": "error", + "no-implicit-coercion": "error", + "no-implicit-globals": "error", + "no-implied-eval": "error", + "no-iterator": "error", + "no-label-var": "error", + "no-labels": "error", + "no-lone-blocks": "error", + "no-lonely-if": "error", + "no-magic-numbers": "off", + "no-mixed-requires": "error", + "no-multi-spaces": "off", + "no-multi-str": "error", + "no-multiple-empty-lines": "error", + "no-native-reassign": "error", + "no-negated-condition": "error", + "no-negated-in-lhs": "error", + "no-nested-ternary": "error", + "no-new": "error", + "no-new-func": "error", + "no-new-object": "error", + "no-new-require": "error", + "no-new-wrappers": "error", + "no-octal-escape": "error", + "no-path-concat": "error", + "no-plusplus": "error", + "no-process-env": "error", + "no-process-exit": "error", + "no-proto": "error", + "no-prototype-builtins": "error", + "no-restricted-globals": "error", + "no-restricted-imports": "error", + "no-restricted-modules": "error", + "no-restricted-properties": "error", + "no-restricted-syntax": "error", + "no-return-assign": "error", + "no-script-url": "error", + "no-self-compare": "error", + "no-sequences": "error", + "no-shadow": "error", + "no-shadow-restricted-names": "error", + "no-spaced-func": "error", + "no-sync": "error", + "no-tabs": "error", + "no-template-curly-in-string": "error", + "no-throw-literal": "error", + "no-trailing-spaces": "off", + "no-undef-init": "error", + "no-undefined": "error", + "no-underscore-dangle": "off", + "no-unmodified-loop-condition": "error", + "no-unneeded-ternary": "error", + "no-unused-expressions": "error", + "no-use-before-define": "error", + "no-useless-call": "error", + "no-useless-computed-key": "error", + "no-useless-concat": "error", + "no-useless-constructor": "error", + "no-useless-escape": "error", + "no-useless-rename": "error", + "no-var": "error", + "no-void": "error", + "no-warning-comments": "error", + "no-whitespace-before-property": "error", + "no-with": "error", + "object-curly-newline": "off", + "object-curly-spacing": "off", + "object-property-newline": [ + "error", + { + "allowMultiplePropertiesPerLine": true + } + ], + "object-shorthand": "off", + "one-var": "off", + "one-var-declaration-per-line": "error", + "operator-assignment": "error", + "operator-linebreak": "error", + "padded-blocks": "off", + "prefer-arrow-callback": "off", + "prefer-const": "off", + "prefer-numeric-literals": "error", + "prefer-rest-params": "error", + "prefer-spread": "error", + "prefer-template": "error", + "quote-props": "off", + "quotes": ["error", "double", { "avoidEscape": true }], + "require-jsdoc": "error", + "rest-spread-spacing": "error", + "semi": "off", + "semi-spacing": "error", + "sort-imports": "off", + "sort-keys": "off", + "space-before-blocks": "error", + "space-before-function-paren": "off", + "space-in-parens": [ + "error", + "never" + ], + "space-infix-ops": "error", + "space-unary-ops": "error", + "spaced-comment": [ + "error", + "always" + ], + "strict": "error", + "symbol-description": "error", + "template-curly-spacing": "error", + "unicode-bom": [ + "error", + "never" + ], + "vars-on-top": "error", + "wrap-iife": "error", + "wrap-regex": "error", + "yield-star-spacing": "error", + "yoda": "error", + "import/no-named-as-default": "off", + "import/no-extraneous-dependencies": "off" + } } diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 738769d..d6f0753 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -4,11 +4,10 @@ on: push: branches: - main - - master pull_request: env: - RUBY_VERSION: 2.7.2 + RUBY_VERSION: 2.7.5 jobs: test: diff --git a/Gemfile b/Gemfile index 5379a81..05e8077 100644 --- a/Gemfile +++ b/Gemfile @@ -4,7 +4,7 @@ source "https://rubygems.org" ruby RUBY_VERSION # DECIDIM_VERSION = { git: "https://github.com/decidim/decidim" } -DECIDIM_VERSION = "0.24" +DECIDIM_VERSION = "0.26.1" gem "decidim", DECIDIM_VERSION diff --git a/Gemfile.lock b/Gemfile.lock index 486ed9c..6db755f 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -1,76 +1,89 @@ PATH remote: . specs: - decidim-navigation_maps (1.2.0) - decidim-admin (>= 0.24, < 0.25) - decidim-core (>= 0.24, < 0.25) + decidim-navigation_maps (1.3.0) + decidim-admin (>= 0.25, < 0.27) + decidim-core (>= 0.25, < 0.27) GEM remote: https://rubygems.org/ specs: - actioncable (5.2.4.5) - actionpack (= 5.2.4.5) + actioncable (6.0.4.7) + actionpack (= 6.0.4.7) nio4r (~> 2.0) websocket-driver (>= 0.6.1) - actionmailer (5.2.4.5) - actionpack (= 5.2.4.5) - actionview (= 5.2.4.5) - activejob (= 5.2.4.5) + actionmailbox (6.0.4.7) + actionpack (= 6.0.4.7) + activejob (= 6.0.4.7) + activerecord (= 6.0.4.7) + activestorage (= 6.0.4.7) + activesupport (= 6.0.4.7) + mail (>= 2.7.1) + actionmailer (6.0.4.7) + actionpack (= 6.0.4.7) + actionview (= 6.0.4.7) + activejob (= 6.0.4.7) mail (~> 2.5, >= 2.5.4) rails-dom-testing (~> 2.0) - actionpack (5.2.4.5) - actionview (= 5.2.4.5) - activesupport (= 5.2.4.5) + actionpack (6.0.4.7) + actionview (= 6.0.4.7) + activesupport (= 6.0.4.7) rack (~> 2.0, >= 2.0.8) rack-test (>= 0.6.3) rails-dom-testing (~> 2.0) - rails-html-sanitizer (~> 1.0, >= 1.0.2) - actionview (5.2.4.5) - activesupport (= 5.2.4.5) + rails-html-sanitizer (~> 1.0, >= 1.2.0) + actiontext (6.0.4.7) + actionpack (= 6.0.4.7) + activerecord (= 6.0.4.7) + activestorage (= 6.0.4.7) + activesupport (= 6.0.4.7) + nokogiri (>= 1.8.5) + actionview (6.0.4.7) + activesupport (= 6.0.4.7) builder (~> 3.1) erubi (~> 1.4) rails-dom-testing (~> 2.0) - rails-html-sanitizer (~> 1.0, >= 1.0.3) + rails-html-sanitizer (~> 1.1, >= 1.2.0) active_link_to (1.0.5) actionpack addressable - activejob (5.2.4.5) - activesupport (= 5.2.4.5) + activejob (6.0.4.7) + activesupport (= 6.0.4.7) globalid (>= 0.3.6) - activemodel (5.2.4.5) - activesupport (= 5.2.4.5) - activerecord (5.2.4.5) - activemodel (= 5.2.4.5) - activesupport (= 5.2.4.5) - arel (>= 9.0) - activestorage (5.2.4.5) - actionpack (= 5.2.4.5) - activerecord (= 5.2.4.5) - marcel (~> 0.3.1) - activesupport (5.2.4.5) + activemodel (6.0.4.7) + activesupport (= 6.0.4.7) + activerecord (6.0.4.7) + activemodel (= 6.0.4.7) + activesupport (= 6.0.4.7) + activestorage (6.0.4.7) + actionpack (= 6.0.4.7) + activejob (= 6.0.4.7) + activerecord (= 6.0.4.7) + marcel (~> 1.0.0) + activesupport (6.0.4.7) concurrent-ruby (~> 1.0, >= 1.0.2) i18n (>= 0.7, < 2) minitest (~> 5.1) tzinfo (~> 1.1) + zeitwerk (~> 2.2, >= 2.2.2) acts_as_list (0.9.19) activerecord (>= 3.0) - addressable (2.7.0) + addressable (2.8.0) public_suffix (>= 2.0.2, < 5.0) - anchored (1.1.0) - arel (9.0.0) ast (2.4.2) - autoprefixer-rails (8.6.5) - execjs + axe-core-api (4.4.0) + dumb_delegator + virtus + axe-core-rspec (4.1.0) + axe-core-api + dumb_delegator + virtus axiom-types (0.1.1) descendants_tracker (~> 0.0.4) ice_nine (~> 0.11.0) thread_safe (~> 0.3, >= 0.3.1) - babel-source (5.8.35) - babel-transpiler (0.7.0) - babel-source (>= 4.0, < 6) - execjs (~> 2.0) batch-loader (1.5.0) - bcrypt (3.1.16) + bcrypt (3.1.17) better_html (1.0.16) actionview (>= 4.0) activesupport (>= 4.0) @@ -80,25 +93,26 @@ GEM parser (>= 2.4) smart_properties bindex (0.8.1) - bootsnap (1.7.3) - msgpack (~> 1.0) + bootsnap (1.11.1) + msgpack (~> 1.2) browser (2.7.1) builder (3.2.4) byebug (11.1.3) - capybara (3.35.3) + capybara (3.36.0) addressable + matrix mini_mime (>= 0.1.3) nokogiri (~> 1.8) rack (>= 1.6.0) rack-test (>= 0.6.3) regexp_parser (>= 1.5, < 3.0) xpath (~> 3.2) - carrierwave (2.2.0) + carrierwave (2.2.2) activemodel (>= 5.0.0) activesupport (>= 5.0.0) addressable (~> 2.6) image_processing (~> 1.1) - mimemagic (>= 0.3.0) + marcel (~> 1.0.0) mini_mime (>= 0.1.3) ssrf_filter (~> 1.0) cells (4.1.7) @@ -109,13 +123,14 @@ GEM cells-erb (0.1.0) cells (~> 4.0) erbse (>= 0.1.1) - cells-rails (0.0.9) - actionpack (>= 3.0) + cells-rails (0.1.4) + actionpack (>= 5.0) cells (>= 4.1.6, < 5.0.0) charlock_holmes (0.7.7) - chef-utils (16.12.3) + chef-utils (17.10.0) + concurrent-ruby childprocess (3.0.0) - codecov (0.5.1) + codecov (0.6.0) simplecov (>= 0.15, < 0.22) coercible (1.0.0) descendants_tracker (~> 0.0.1) @@ -126,258 +141,212 @@ GEM coffee-script-source execjs coffee-script-source (1.12.2) - concurrent-ruby (1.1.8) - cookiejar (0.3.3) + concurrent-ruby (1.1.10) crack (0.4.5) rexml crass (1.0.6) - css_parser (1.9.0) + css_parser (1.11.0) addressable date_validator (0.9.0) activemodel activesupport - db-query-matchers (0.9.0) - activesupport (>= 4.0, <= 6.0) + db-query-matchers (0.10.0) + activesupport (>= 4.0, < 7) rspec (~> 3.0) - decidim (0.24.0) - decidim-accountability (= 0.24.0) - decidim-admin (= 0.24.0) - decidim-api (= 0.24.0) - decidim-assemblies (= 0.24.0) - decidim-blogs (= 0.24.0) - decidim-budgets (= 0.24.0) - decidim-comments (= 0.24.0) - decidim-core (= 0.24.0) - decidim-debates (= 0.24.0) - decidim-forms (= 0.24.0) - decidim-generators (= 0.24.0) - decidim-meetings (= 0.24.0) - decidim-pages (= 0.24.0) - decidim-participatory_processes (= 0.24.0) - decidim-proposals (= 0.24.0) - decidim-sortitions (= 0.24.0) - decidim-surveys (= 0.24.0) - decidim-system (= 0.24.0) - decidim-templates (= 0.24.0) - decidim-verifications (= 0.24.0) - decidim-accountability (0.24.0) - decidim-comments (= 0.24.0) - decidim-core (= 0.24.0) - kaminari (~> 1.2, >= 1.2.1) - searchlight (~> 4.1) - decidim-admin (0.24.0) + decidim (0.26.1) + decidim-accountability (= 0.26.1) + decidim-admin (= 0.26.1) + decidim-api (= 0.26.1) + decidim-assemblies (= 0.26.1) + decidim-blogs (= 0.26.1) + decidim-budgets (= 0.26.1) + decidim-comments (= 0.26.1) + decidim-core (= 0.26.1) + decidim-debates (= 0.26.1) + decidim-forms (= 0.26.1) + decidim-generators (= 0.26.1) + decidim-meetings (= 0.26.1) + decidim-pages (= 0.26.1) + decidim-participatory_processes (= 0.26.1) + decidim-proposals (= 0.26.1) + decidim-sortitions (= 0.26.1) + decidim-surveys (= 0.26.1) + decidim-system (= 0.26.1) + decidim-templates (= 0.26.1) + decidim-verifications (= 0.26.1) + decidim-accountability (0.26.1) + decidim-comments (= 0.26.1) + decidim-core (= 0.26.1) + decidim-admin (0.26.1) active_link_to (~> 1.0) - decidim-core (= 0.24.0) + decidim-core (= 0.26.1) devise (~> 4.7) devise-i18n (~> 1.2) - devise_invitable (~> 1.7) - jquery-rails (~> 4.4) - sassc (~> 2.4.0) - sassc-rails (~> 2.1.2) - decidim-api (0.24.0) - graphiql-rails (~> 1.4, < 1.5) - graphql (~> 1.12, >= 1.12.3) + devise_invitable (~> 2.0) + decidim-api (0.26.1) + graphql (~> 1.12, < 1.13) rack-cors (~> 1.0) redcarpet (~> 3.5, >= 3.5.1) - sprockets-es6 (~> 0.9.2) - decidim-assemblies (0.24.0) - decidim-core (= 0.24.0) - decidim-blogs (0.24.0) - decidim-admin (= 0.24.0) - decidim-comments (= 0.24.0) - decidim-core (= 0.24.0) - jquery-tmpl-rails (~> 1.1) - kaminari (~> 1.2, >= 1.2.1) - decidim-budgets (0.24.0) - decidim-comments (= 0.24.0) - decidim-core (= 0.24.0) - kaminari (~> 1.2, >= 1.2.1) - searchlight (~> 4.1) - decidim-comments (0.24.0) - decidim-core (= 0.24.0) - jquery-rails (~> 4.4) + decidim-assemblies (0.26.1) + decidim-core (= 0.26.1) + decidim-blogs (0.26.1) + decidim-admin (= 0.26.1) + decidim-comments (= 0.26.1) + decidim-core (= 0.26.1) + decidim-budgets (0.26.1) + decidim-comments (= 0.26.1) + decidim-core (= 0.26.1) + decidim-comments (0.26.1) + decidim-core (= 0.26.1) redcarpet (~> 3.5, >= 3.5.1) - decidim-core (0.24.0) + decidim-core (0.26.1) active_link_to (~> 1.0) - anchored (~> 1.1) - autoprefixer-rails (~> 8.0) + acts_as_list (~> 0.9) batch-loader (~> 1.2) browser (~> 2.7) - carrierwave (~> 2.2.0) + carrierwave (~> 2.2.1) cells-erb (~> 0.1.0) - cells-rails (~> 0.0.9) + cells-rails (~> 0.1.3) charlock_holmes (~> 0.7) date_validator (~> 0.9.0) - decidim-api (= 0.24.0) + decidim-api (= 0.26.1) devise (~> 4.7) devise-i18n (~> 1.2) diffy (~> 3.3) doorkeeper (~> 5.1) doorkeeper-i18n (~> 4.0) - etherpad-lite (~> 0.3) file_validators (~> 2.1) fog-local (~> 0.6) - foundation-rails (~> 6.6, < 6.7) - foundation_rails_helper (~> 3.0) + foundation_rails_helper geocoder (~> 1.5) hashdiff (>= 0.4.0, < 2.0.0) invisible_captcha (~> 0.12) - jquery-rails (~> 4.4) kaminari (~> 1.2, >= 1.2.1) loofah (~> 2.3.1) + mime-types (>= 1.16, < 4.0) mini_magick (~> 4.9) mustache (~> 1.1.0) - nobspw (~> 0.6.0) - omniauth (~> 1.9) + omniauth (~> 2.0) omniauth-facebook (~> 5.0) - omniauth-google-oauth2 (~> 0.7) - omniauth-rails_csrf_protection (~> 0.1) + omniauth-google-oauth2 (~> 1.0) + omniauth-rails_csrf_protection (~> 1.0) omniauth-twitter (~> 1.4) - paper_trail (~> 10.3) + paper_trail (~> 12.0) pg (~> 1.1.4, < 2) pg_search (~> 2.2) premailer-rails (~> 1.10) rack (~> 2.2, >= 2.2.3) rack-attack (~> 6.0) - rails (~> 5.2.4.5) - rails-i18n (~> 5.0) + rails (~> 6.0.4) + rails-i18n (~> 6.0) + ransack (~> 2.4.1) rectify (~> 0.13.0) redis (~> 4.1) request_store (~> 1.5.0) + rubyXL (~> 3.4) rubyzip (~> 2.0) - sassc (~> 2.4.0) - sassc-rails (~> 2.1.2) + searchlight (~> 4.1) seven_zip_ruby (~> 1.3) social-share-button (~> 1.2, >= 1.2.1) - spreadsheet (~> 1.2) - sprockets (~> 3.7, < 4) - sprockets-es6 (~> 0.9.2) - truncato (~> 0.7) - uglifier (~> 4.1) valid_email2 (~> 2.1) + webpacker (= 6.0.0.rc.5) wisper (~> 2.0) - decidim-debates (0.24.0) - decidim-comments (= 0.24.0) - decidim-core (= 0.24.0) - kaminari (~> 1.2, >= 1.2.1) - searchlight (~> 4.1) - decidim-dev (0.24.0) + decidim-debates (0.26.1) + decidim-comments (= 0.26.1) + decidim-core (= 0.26.1) + decidim-dev (0.26.1) + axe-core-rspec (~> 4.1.0) byebug (~> 11.0) capybara (~> 3.24) - db-query-matchers (~> 0.9.0) - decidim (= 0.24.0) - erb_lint (~> 0.0.28) + db-query-matchers (~> 0.10.0) + decidim (= 0.26.1) + erb_lint (~> 0.0.35) factory_bot_rails (~> 4.8) i18n-tasks (~> 0.9.18) mdl (~> 0.5) - nokogiri (~> 1.11, >= 1.11.1) - puffing-billy (~> 2.4.0) + nokogiri (~> 1.12) puma (~> 5.0) rails-controller-testing (~> 1.0) rspec-cells (~> 0.3.4) rspec-html-matchers (~> 0.9.1) - rspec-rails (~> 3.7) + rspec-rails (~> 4.0) rspec-retry (~> 0.6.2) rspec_junit_formatter (~> 0.3.0) rubocop (~> 0.92.0) - rubocop-rails (~> 2.0) - rubocop-rspec (~> 1.21) + rubocop-rails (~> 2.8) + rubocop-rspec (= 1.43.2) selenium-webdriver (~> 3.142) simplecov (~> 0.19.0) simplecov-cobertura (~> 1.3.1) - system_test_html_screenshots (~> 0.1.1) - vcr (~> 6.0) + system_test_html_screenshots (~> 0.2) + w3c_rspec_validators (~> 0.3.0) webmock (~> 3.6) wisper-rspec (~> 1.0) - decidim-forms (0.24.0) - decidim-core (= 0.24.0) - wicked_pdf (~> 1.4) + decidim-forms (0.26.1) + decidim-core (= 0.26.1) + wicked_pdf (~> 2.1) wkhtmltopdf-binary (~> 0.12) - decidim-generators (0.24.0) - decidim-core (= 0.24.0) - decidim-meetings (0.24.0) - cells-erb (~> 0.1.0) - cells-rails (~> 0.0.9) - decidim-core (= 0.24.0) - decidim-forms (= 0.24.0) + decidim-generators (0.26.1) + decidim-core (= 0.26.1) + decidim-meetings (0.26.1) + decidim-core (= 0.26.1) + decidim-forms (= 0.26.1) icalendar (~> 2.5) - jquery-tmpl-rails (~> 1.1) - kaminari (~> 1.2, >= 1.2.1) - searchlight (~> 4.1) - decidim-pages (0.24.0) - decidim-core (= 0.24.0) - decidim-participatory_processes (0.24.0) - decidim-core (= 0.24.0) - decidim-proposals (0.24.0) - acts_as_list (~> 0.9) - cells-erb (~> 0.1.0) - cells-rails (~> 0.0.9) - decidim-comments (= 0.24.0) - decidim-core (= 0.24.0) - doc2text (~> 0.4.3) - kaminari (~> 1.2, >= 1.2.1) - ransack (~> 2.1.1) + decidim-pages (0.26.1) + decidim-core (= 0.26.1) + decidim-participatory_processes (0.26.1) + decidim-core (= 0.26.1) + decidim-proposals (0.26.1) + decidim-comments (= 0.26.1) + decidim-core (= 0.26.1) + doc2text (~> 0.4.4) redcarpet (~> 3.5, >= 3.5.1) - decidim-sortitions (0.24.0) - decidim-admin (= 0.24.0) - decidim-comments (= 0.24.0) - decidim-core (= 0.24.0) - decidim-proposals (= 0.24.0) - decidim-surveys (0.24.0) - decidim-core (= 0.24.0) - decidim-forms (= 0.24.0) - decidim-templates (= 0.24.0) - decidim-system (0.24.0) + decidim-sortitions (0.26.1) + decidim-admin (= 0.26.1) + decidim-comments (= 0.26.1) + decidim-core (= 0.26.1) + decidim-proposals (= 0.26.1) + decidim-surveys (0.26.1) + decidim-core (= 0.26.1) + decidim-forms (= 0.26.1) + decidim-templates (= 0.26.1) + decidim-system (0.26.1) active_link_to (~> 1.0) - decidim-core (= 0.24.0) + decidim-core (= 0.26.1) devise (~> 4.7) devise-i18n (~> 1.2) - devise_invitable (~> 1.7) - jquery-rails (~> 4.4) - sassc (~> 2.4.0) - sassc-rails (~> 2.1.2) - decidim-templates (0.24.0) - decidim-core (= 0.24.0) - decidim-forms (= 0.24.0) - decidim-verifications (0.24.0) - decidim-core (= 0.24.0) + devise_invitable (~> 2.0) + decidim-templates (0.26.1) + decidim-core (= 0.26.1) + decidim-forms (= 0.26.1) + decidim-verifications (0.26.1) + decidim-core (= 0.26.1) declarative-builder (0.1.0) declarative-option (< 0.2.0) declarative-option (0.1.0) descendants_tracker (0.0.4) thread_safe (~> 0.3, >= 0.3.1) - devise (4.7.3) + devise (4.8.1) bcrypt (~> 3.0) orm_adapter (~> 0.1) railties (>= 4.1.0) responders warden (~> 1.2.3) - devise-i18n (1.9.3) - devise (>= 4.7.1) - devise_invitable (1.7.5) - actionmailer (>= 4.1.0) - devise (>= 4.0.0) - diff-lcs (1.4.4) + devise-i18n (1.10.2) + devise (>= 4.8.0) + devise_invitable (2.0.6) + actionmailer (>= 5.0) + devise (>= 4.6) + diff-lcs (1.5.0) diffy (3.4.0) - doc2text (0.4.3) - nokogiri (~> 1.11.1) + doc2text (0.4.5) + nokogiri (>= 1.13.2, < 1.14.0) rubyzip (~> 2.3.0) - docile (1.3.5) - domain_name (0.5.20190701) - unf (>= 0.0.5, < 1.0.0) - doorkeeper (5.5.1) + docile (1.4.0) + doorkeeper (5.5.4) railties (>= 5) doorkeeper-i18n (4.0.1) - em-http-request (1.1.7) - addressable (>= 2.3.4) - cookiejar (!= 0.3.1) - em-socksify (>= 0.3) - eventmachine (>= 1.0.3) - http_parser.rb (>= 0.6.0) - em-socksify (0.3.2) - eventmachine (>= 1.0.0.beta.4) - em-synchrony (1.0.6) - eventmachine (>= 1.0.0.beta.1) + dumb_delegator (1.0.0) equalizer (0.0.11) erb_lint (0.0.37) activesupport @@ -390,65 +359,48 @@ GEM erbse (0.1.4) temple erubi (1.10.0) - etherpad-lite (0.3.0) - rest-client (>= 1.6) - eventmachine (1.2.7) - eventmachine_httpserver (0.2.1) - excon (0.79.0) - execjs (2.7.0) + excon (0.92.2) + execjs (2.8.1) factory_bot (4.11.1) activesupport (>= 3.0.0) factory_bot_rails (4.11.1) factory_bot (~> 4.11.1) railties (>= 3.0.0) - faker (2.17.0) - i18n (>= 1.6, < 2) - faraday (1.3.0) - faraday-net_http (~> 1.0) - multipart-post (>= 1.2, < 3) - ruby2_keywords - faraday-net_http (1.0.1) - ffi (1.15.0) + faker (2.20.0) + i18n (>= 1.8.11, < 2) + faraday (2.2.0) + faraday-net_http (~> 2.0) + ruby2_keywords (>= 0.0.4) + faraday-net_http (2.0.1) + ffi (1.15.5) file_validators (2.3.0) activemodel (>= 3.2) mime-types (>= 1.0) - fog-core (2.2.3) + fog-core (2.3.0) builder excon (~> 0.71) - formatador (~> 0.2) + formatador (>= 0.2, < 2.0) mime-types - fog-local (0.6.0) + fog-local (0.8.0) fog-core (>= 1.27, < 3.0) - formatador (0.2.5) - foundation-rails (6.6.2.0) - railties (>= 3.1.0) - sass (>= 3.3.0) - sprockets-es6 (>= 0.9.0) - foundation_rails_helper (3.0.0) - actionpack (>= 4.1, < 6.0) - activemodel (>= 4.1, < 6.0) - activesupport (>= 4.1, < 6.0) - railties (>= 4.1, < 6.0) - tzinfo (~> 1.2, >= 1.2.2) - geocoder (1.6.6) - globalid (0.4.2) - activesupport (>= 4.2.0) - graphiql-rails (1.4.11) - railties - sprockets-rails - graphql (1.12.7) + formatador (1.1.0) + foundation_rails_helper (4.0.1) + actionpack (>= 4.1, < 7.1) + activemodel (>= 4.1, < 7.1) + activesupport (>= 4.1, < 7.1) + railties (>= 4.1, < 7.1) + geocoder (1.7.5) + globalid (1.0.0) + activesupport (>= 5.0) + graphql (1.12.24) hashdiff (1.0.1) - hashie (4.1.0) + hashie (5.0.0) highline (2.0.3) html_tokenizer (0.0.7) htmlentities (4.3.4) - http-accept (1.7.0) - http-cookie (1.0.3) - domain_name (~> 0.5) - http_parser.rb (0.6.0) - i18n (1.8.10) + i18n (1.10.0) concurrent-ruby (~> 1.0) - i18n-tasks (0.9.34) + i18n-tasks (0.9.37) activesupport (>= 4.0.2) ast (>= 2.1.0) erubi @@ -460,45 +412,40 @@ GEM terminal-table (>= 1.5.1) icalendar (2.7.1) ice_cube (~> 0.16) - ice_cube (0.16.3) + ice_cube (0.16.4) ice_nine (0.11.2) - image_processing (1.12.1) + image_processing (1.12.2) mini_magick (>= 4.9.5, < 5) ruby-vips (>= 2.0.17, < 3) invisible_captcha (0.13.0) rails (>= 3.2.0) - jquery-rails (4.4.0) - rails-dom-testing (>= 1, < 3) - railties (>= 4.2.0) - thor (>= 0.14, < 2.0) - jquery-tmpl-rails (1.1.0) - rails (>= 3.1.0) - jwt (2.2.2) - kaminari (1.2.1) + json (2.6.1) + jwt (2.3.0) + kaminari (1.2.2) activesupport (>= 4.1.0) - kaminari-actionview (= 1.2.1) - kaminari-activerecord (= 1.2.1) - kaminari-core (= 1.2.1) - kaminari-actionview (1.2.1) + kaminari-actionview (= 1.2.2) + kaminari-activerecord (= 1.2.2) + kaminari-core (= 1.2.2) + kaminari-actionview (1.2.2) actionview - kaminari-core (= 1.2.1) - kaminari-activerecord (1.2.1) + kaminari-core (= 1.2.2) + kaminari-activerecord (1.2.2) activerecord - kaminari-core (= 1.2.1) - kaminari-core (1.2.1) - kramdown (2.3.1) + kaminari-core (= 1.2.2) + kaminari-core (1.2.2) + kramdown (2.3.2) rexml kramdown-parser-gfm (1.1.0) kramdown (~> 2.0) launchy (2.5.0) addressable (~> 2.7) - letter_opener (1.7.0) - launchy (~> 2.2) - letter_opener_web (1.4.0) + letter_opener (1.8.1) + launchy (>= 2.2, < 3) + letter_opener_web (1.4.1) actionmailer (>= 3.2) letter_opener (~> 1.0) railties (>= 3.2) - listen (3.5.1) + listen (3.7.1) rb-fsevent (~> 0.10, >= 0.10.3) rb-inotify (~> 0.9, >= 0.9.10) loofah (2.3.1) @@ -506,8 +453,8 @@ GEM nokogiri (>= 1.5.9) mail (2.7.1) mini_mime (>= 0.1.1) - marcel (0.3.3) - mimemagic (~> 0.3.2) + marcel (1.0.2) + matrix (0.4.2) mdl (0.11.0) kramdown (~> 2.3) kramdown-parser-gfm (~> 1.1) @@ -515,73 +462,68 @@ GEM mixlib-config (>= 2.2.1, < 4) mixlib-shellout method_source (1.0.0) - mime-types (3.3.1) + mime-types (3.4.1) mime-types-data (~> 3.2015) - mime-types-data (3.2021.0225) - mimemagic (0.3.10) - nokogiri (~> 1) - rake + mime-types-data (3.2022.0105) mini_magick (4.11.0) - mini_mime (1.1.0) - mini_portile2 (2.5.0) - minitest (5.14.4) + mini_mime (1.1.2) + mini_portile2 (2.8.0) + minitest (5.15.0) mixlib-cli (2.1.8) mixlib-config (3.0.9) tomlrb - mixlib-shellout (3.2.5) + mixlib-shellout (3.2.6) chef-utils - msgpack (1.4.2) + msgpack (1.4.5) multi_json (1.15.0) multi_xml (0.6.0) - multipart-post (2.1.1) mustache (1.1.1) - netrc (0.11.0) - nio4r (2.5.7) - nobspw (0.6.2) - nokogiri (1.11.3) - mini_portile2 (~> 2.5.0) + nio4r (2.5.8) + nokogiri (1.13.3) + mini_portile2 (~> 2.8.0) racc (~> 1.4) - oauth (0.5.6) - oauth2 (1.4.7) - faraday (>= 0.8, < 2.0) + oauth (0.5.8) + oauth2 (1.4.9) + faraday (>= 0.17.3, < 3.0) jwt (>= 1.0, < 3.0) multi_json (~> 1.3) multi_xml (~> 0.5) rack (>= 1.2, < 3) - omniauth (1.9.1) + omniauth (2.0.4) hashie (>= 3.4.6) rack (>= 1.6.2, < 3) + rack-protection omniauth-facebook (5.0.0) omniauth-oauth2 (~> 1.2) - omniauth-google-oauth2 (0.8.2) + omniauth-google-oauth2 (1.0.1) jwt (>= 2.0) oauth2 (~> 1.1) - omniauth (~> 1.1) - omniauth-oauth2 (>= 1.6) + omniauth (~> 2.0) + omniauth-oauth2 (~> 1.7.1) omniauth-oauth (1.2.0) oauth omniauth (>= 1.0, < 3) - omniauth-oauth2 (1.7.1) + omniauth-oauth2 (1.7.2) oauth2 (~> 1.4) omniauth (>= 1.9, < 3) - omniauth-rails_csrf_protection (0.1.2) + omniauth-rails_csrf_protection (1.0.1) actionpack (>= 4.2) - omniauth (>= 1.3.1) + omniauth (~> 2.0) omniauth-twitter (1.4.0) omniauth-oauth (~> 1.1) rack orm_adapter (0.5.0) - paper_trail (10.3.1) - activerecord (>= 4.2) + paper_trail (12.3.0) + activerecord (>= 5.2) request_store (~> 1.1) - parallel (1.20.1) - parser (3.0.1.0) + parallel (1.22.1) + parser (3.1.1.0) ast (~> 2.4.1) pg (1.1.4) - pg_search (2.3.5) + pg_search (2.3.6) activerecord (>= 5.2) activesupport (>= 5.2) - premailer (1.14.2) + premailer (1.15.0) addressable css_parser (>= 1.6.0) htmlentities (>= 4.0.0) @@ -589,36 +531,34 @@ GEM actionmailer (>= 3) premailer (~> 1.7, >= 1.7.9) public_suffix (4.0.6) - puffing-billy (2.4.1) - addressable (~> 2.5) - em-http-request (~> 1.1, >= 1.1.0) - em-synchrony - eventmachine (~> 1.2) - eventmachine_httpserver - http_parser.rb (~> 0.6.0) - multi_json - puma (5.2.2) + puma (5.6.4) nio4r (~> 2.0) - racc (1.5.2) + racc (1.6.0) rack (2.2.3) - rack-attack (6.5.0) + rack-attack (6.6.0) rack (>= 1.0, < 3) rack-cors (1.1.1) rack (>= 2.0.0) + rack-protection (2.2.0) + rack + rack-proxy (0.7.2) + rack rack-test (1.1.0) rack (>= 1.0, < 3) - rails (5.2.4.5) - actioncable (= 5.2.4.5) - actionmailer (= 5.2.4.5) - actionpack (= 5.2.4.5) - actionview (= 5.2.4.5) - activejob (= 5.2.4.5) - activemodel (= 5.2.4.5) - activerecord (= 5.2.4.5) - activestorage (= 5.2.4.5) - activesupport (= 5.2.4.5) + rails (6.0.4.7) + actioncable (= 6.0.4.7) + actionmailbox (= 6.0.4.7) + actionmailer (= 6.0.4.7) + actionpack (= 6.0.4.7) + actiontext (= 6.0.4.7) + actionview (= 6.0.4.7) + activejob (= 6.0.4.7) + activemodel (= 6.0.4.7) + activerecord (= 6.0.4.7) + activestorage (= 6.0.4.7) + activesupport (= 6.0.4.7) bundler (>= 1.3.0) - railties (= 5.2.4.5) + railties (= 6.0.4.7) sprockets-rails (>= 2.0.0) rails-controller-testing (1.0.5) actionpack (>= 5.0.1.rc1) @@ -627,25 +567,24 @@ GEM rails-dom-testing (2.0.3) activesupport (>= 4.2.0) nokogiri (>= 1.6) - rails-html-sanitizer (1.3.0) + rails-html-sanitizer (1.4.2) loofah (~> 2.3) - rails-i18n (5.1.3) + rails-i18n (6.0.0) i18n (>= 0.7, < 2) - railties (>= 5.0, < 6) - railties (5.2.4.5) - actionpack (= 5.2.4.5) - activesupport (= 5.2.4.5) + railties (>= 6.0.0, < 7) + railties (6.0.4.7) + actionpack (= 6.0.4.7) + activesupport (= 6.0.4.7) method_source rake (>= 0.8.7) - thor (>= 0.19.0, < 2.0) - rainbow (3.0.0) - rake (13.0.3) - ransack (2.1.1) - actionpack (>= 5.0) - activerecord (>= 5.0) - activesupport (>= 5.0) + thor (>= 0.20.3, < 2.0) + rainbow (3.1.1) + rake (13.0.6) + ransack (2.4.2) + activerecord (>= 5.2.4) + activesupport (>= 5.2.4) i18n - rb-fsevent (0.10.4) + rb-fsevent (0.11.1) rb-inotify (0.10.1) ffi (~> 1.0) rectify (0.13.0) @@ -655,48 +594,43 @@ GEM virtus (~> 1.0.5) wisper (>= 1.6.1) redcarpet (3.5.1) - redis (4.2.5) - regexp_parser (2.1.1) - request_store (1.5.0) + redis (4.6.0) + regexp_parser (2.2.1) + request_store (1.5.1) rack (>= 1.4) responders (3.0.1) actionpack (>= 5.0) railties (>= 5.0) - rest-client (2.1.0) - http-accept (>= 1.7.0, < 2.0) - http-cookie (>= 1.0.2, < 2.0) - mime-types (>= 1.16, < 4.0) - netrc (~> 0.8) rexml (3.2.5) - rspec (3.9.0) - rspec-core (~> 3.9.0) - rspec-expectations (~> 3.9.0) - rspec-mocks (~> 3.9.0) - rspec-cells (0.3.5) + rspec (3.11.0) + rspec-core (~> 3.11.0) + rspec-expectations (~> 3.11.0) + rspec-mocks (~> 3.11.0) + rspec-cells (0.3.7) cells (>= 4.0.0, < 6.0.0) - rspec-rails (< 5.0) - rspec-core (3.9.3) - rspec-support (~> 3.9.3) - rspec-expectations (3.9.4) + rspec-rails (< 6.0) + rspec-core (3.11.0) + rspec-support (~> 3.11.0) + rspec-expectations (3.11.0) diff-lcs (>= 1.2.0, < 2.0) - rspec-support (~> 3.9.0) + rspec-support (~> 3.11.0) rspec-html-matchers (0.9.4) nokogiri (~> 1) rspec (>= 3.0.0.a, < 4) - rspec-mocks (3.9.1) + rspec-mocks (3.11.1) diff-lcs (>= 1.2.0, < 2.0) - rspec-support (~> 3.9.0) - rspec-rails (3.9.1) - actionpack (>= 3.0) - activesupport (>= 3.0) - railties (>= 3.0) - rspec-core (~> 3.9.0) - rspec-expectations (~> 3.9.0) - rspec-mocks (~> 3.9.0) - rspec-support (~> 3.9.0) + rspec-support (~> 3.11.0) + rspec-rails (4.1.2) + actionpack (>= 4.2) + activesupport (>= 4.2) + railties (>= 4.2) + rspec-core (~> 3.10) + rspec-expectations (~> 3.10) + rspec-mocks (~> 3.10) + rspec-support (~> 3.10) rspec-retry (0.6.2) rspec-core (> 3.3) - rspec-support (3.9.4) + rspec-support (3.11.0) rspec_junit_formatter (0.3.0) rspec-core (>= 2, < 4, != 2.12.0) rubocop (0.92.0) @@ -708,8 +642,8 @@ GEM rubocop-ast (>= 0.5.0) ruby-progressbar (~> 1.7) unicode-display_width (>= 1.4.0, < 2.0) - rubocop-ast (1.4.1) - parser (>= 2.7.1.5) + rubocop-ast (1.16.0) + parser (>= 3.1.1.0) rubocop-faker (1.1.0) faker (>= 2.12.0) rubocop (>= 0.82.0) @@ -717,32 +651,21 @@ GEM activesupport (>= 4.2.0) rack (>= 1.1) rubocop (>= 0.90.0, < 2.0) - rubocop-rspec (1.44.1) + rubocop-rspec (1.43.2) rubocop (~> 0.87) - rubocop-ast (>= 0.7.1) - ruby-ole (1.2.12.2) ruby-progressbar (1.11.0) - ruby-vips (2.1.0) + ruby-vips (2.1.4) ffi (~> 1.12) - ruby2_keywords (0.0.4) - rubyzip (2.3.0) - sass (3.7.4) - sass-listen (~> 4.0.0) - sass-listen (4.0.0) - rb-fsevent (~> 0.9, >= 0.9.4) - rb-inotify (~> 0.9, >= 0.9.7) - sassc (2.4.0) - ffi (~> 1.9) - sassc-rails (2.1.2) - railties (>= 4.0.0) - sassc (>= 2.0) - sprockets (> 3.0) - sprockets-rails - tilt + ruby2_keywords (0.0.5) + rubyXL (3.4.22) + nokogiri (>= 1.10.8) + rubyzip (>= 1.3.0) + rubyzip (2.3.2) searchlight (4.1.0) selenium-webdriver (3.142.7) childprocess (>= 0.5, < 4.0) rubyzip (>= 1.2.2) + semantic_range (3.0.0) seven_zip_ruby (1.3.0) simplecov (0.19.1) docile (~> 1.1) @@ -750,57 +673,52 @@ GEM simplecov-cobertura (1.3.1) simplecov (~> 0.8) simplecov-html (0.12.3) - smart_properties (1.15.0) + smart_properties (1.17.0) social-share-button (1.2.4) coffee-rails - spreadsheet (1.2.8) - ruby-ole spring (2.1.1) spring-watcher-listen (2.0.1) listen (>= 2.7, < 4.0) spring (>= 1.2, < 3.0) - sprockets (3.7.2) + sprockets (4.0.3) concurrent-ruby (~> 1.0) rack (> 1, < 3) - sprockets-es6 (0.9.2) - babel-source (>= 5.8.11) - babel-transpiler - sprockets (>= 3.0.0) - sprockets-rails (3.2.2) - actionpack (>= 4.0) - activesupport (>= 4.0) + sprockets-rails (3.4.2) + actionpack (>= 5.2) + activesupport (>= 5.2) sprockets (>= 3.0.0) ssrf_filter (1.0.7) - system_test_html_screenshots (0.1.2) - actionpack (>= 5.2, < 6.0.a) + system_test_html_screenshots (0.2.0) + actionpack (>= 5.2, < 6.1.a) temple (0.8.2) - terminal-table (3.0.0) - unicode-display_width (~> 1.1, >= 1.1.1) - thor (1.1.0) + terminal-table (3.0.2) + unicode-display_width (>= 1.1.1, < 3) + thor (1.2.1) thread_safe (0.3.6) tilt (2.0.10) tomlrb (2.0.1) - truncato (0.7.11) - htmlentities (~> 4.3.1) - nokogiri (>= 1.7.0, <= 2.0) tzinfo (1.2.9) thread_safe (~> 0.1) uber (0.1.0) uglifier (4.2.0) execjs (>= 0.3.0, < 3) - unf (0.1.4) - unf_ext - unf_ext (0.0.7.7) - unicode-display_width (1.7.0) + unicode-display_width (1.8.0) valid_email2 (2.3.1) activemodel (>= 3.2) mail (~> 2.5) - vcr (6.0.0) virtus (1.0.5) axiom-types (~> 0.1) coercible (~> 1.0) descendants_tracker (~> 0.0, >= 0.0.3) equalizer (~> 0.0, >= 0.0.9) + w3c_rspec_validators (0.3.0) + rails + rspec + w3c_validators + w3c_validators (1.3.7) + json (>= 1.8) + nokogiri (~> 1.6) + rexml (~> 3.2) warden (1.2.9) rack (>= 2.0.9) web-console (3.7.0) @@ -808,20 +726,26 @@ GEM activemodel (>= 5.0) bindex (>= 0.4.0) railties (>= 5.0) - webmock (3.12.2) - addressable (>= 2.3.6) + webmock (3.14.0) + addressable (>= 2.8.0) crack (>= 0.3.2) hashdiff (>= 0.4.0, < 2.0.0) - websocket-driver (0.7.3) + webpacker (6.0.0.rc.5) + activesupport (>= 5.2) + rack-proxy (>= 0.6.1) + railties (>= 5.2) + semantic_range (>= 2.3.0) + websocket-driver (0.7.5) websocket-extensions (>= 0.1.0) websocket-extensions (0.1.5) - wicked_pdf (1.4.0) + wicked_pdf (2.1.0) activesupport wisper (2.0.1) wisper-rspec (1.1.0) wkhtmltopdf-binary (0.12.6.5) xpath (3.2.0) nokogiri (~> 1.8) + zeitwerk (2.5.4) PLATFORMS ruby @@ -830,8 +754,8 @@ DEPENDENCIES bootsnap (~> 1.4) byebug (~> 11.0) codecov - decidim (= 0.24) - decidim-dev (= 0.24) + decidim (= 0.26.1) + decidim-dev (= 0.26.1) decidim-navigation_maps! faker (~> 2.14) letter_opener_web (~> 1.3) @@ -844,7 +768,7 @@ DEPENDENCIES web-console (~> 3.5) RUBY VERSION - ruby 2.7.2p137 + ruby 2.7.4p191 BUNDLED WITH 2.1.4 diff --git a/README.md b/README.md index b5a6d69..734f619 100644 --- a/README.md +++ b/README.md @@ -24,7 +24,7 @@ homepage only). Add this line to your application's Gemfile: ```ruby -gem "decidim-navigation_maps", "~> 1.2.0" +gem "decidim-navigation_maps" ``` And then execute (remember to repeat this if you are upgrading from version 1.1): @@ -32,16 +32,35 @@ And then execute (remember to repeat this if you are upgrading from version 1.1) ```bash bundle bundle exec rails decidim_navigation_maps:install:migrations +bundle exec rails decidim_navigation_maps:webpacker:install bundle exec rails db:migrate ``` +> NOTE: the `decidim_notify:webpacker:install` is only necessary for Decidim versions starting at 0.25. + +If you are upgrading from a version prior to 1.3, make sure that you migrate your existing images to Active Storae: + +``` +RAILS_ENV=production bin/rails navigation_maps:active_storage_migrations:migrate_from_carrierwave +``` + +Or check your migration status with: +``` +RAILS_ENV=production bin/rails navigation_maps:active_storage_migrations:check_migration_from_carrierwave +``` + +The correct version of Navigation Maps should resolved automatically by the Bundler. +However you can force some specific version using `gem "decidim-navigation_maps", "~> 1.3.0"` in the Gemfile. + + Depending on your Decidim version, choose the corresponding Plugin version to ensure compatibility: | Navigation Maps version | Compatible Decidim versions | |---|---| -| 1.0.x | 0.18.x - 0.21.x | -| 1.1.x | 0.22.x, 0.23.x | +| 1.3.x | 0.25.x, 0.26.x | | 1.2.x | 0.24.x | +| 1.1.x | 0.22.x, 0.23.x | +| 1.0.x | 0.18.x - 0.21.x | ## Contributing diff --git a/Rakefile b/Rakefile index 7b3bf0b..557b6c1 100644 --- a/Rakefile +++ b/Rakefile @@ -9,6 +9,12 @@ def install_module(path) end end +def override_webpacker_config_files(path) + Dir.chdir(path) do + system("bundle exec rake decidim_navigation_maps:webpacker:install") + end +end + def seed_db(path) Dir.chdir(path) do system("bundle exec rake db:seed") @@ -25,6 +31,7 @@ desc "Generates a dummy app for testing" task test_app: "decidim:generate_external_test_app" do ENV["RAILS_ENV"] = "test" install_module("spec/decidim_dummy_app") + override_webpacker_config_files("spec/decidim_dummy_app") end desc "Generates a development app" @@ -42,6 +49,7 @@ task :development_app do end install_module("development_app") + override_webpacker_config_files("development_app") ENV["SKIP_MODULE_SEEDS"] = "1" seed_db("development_app") # manually seed navigation maps to ensure participatory process groups are created diff --git a/app/assets/config/admin/decidim_navigation_maps_manifest.css b/app/assets/config/admin/decidim_navigation_maps_manifest.css deleted file mode 100644 index 0dce296..0000000 --- a/app/assets/config/admin/decidim_navigation_maps_manifest.css +++ /dev/null @@ -1,3 +0,0 @@ -/* - *= link decidim/navigation_maps/admin/navigation_maps.css - */ \ No newline at end of file diff --git a/app/assets/config/admin/decidim_navigation_maps_manifest.js b/app/assets/config/admin/decidim_navigation_maps_manifest.js deleted file mode 100644 index 45886eb..0000000 --- a/app/assets/config/admin/decidim_navigation_maps_manifest.js +++ /dev/null @@ -1,3 +0,0 @@ -//= link decidim/navigation_maps/admin/navigation_maps.js -//= require jquery.form -//= require leaflet diff --git a/app/assets/config/decidim_navigation_maps_manifest.css b/app/assets/config/decidim_navigation_maps_manifest.css deleted file mode 100644 index cf723e1..0000000 --- a/app/assets/config/decidim_navigation_maps_manifest.css +++ /dev/null @@ -1,3 +0,0 @@ -/* - *= link decidim/navigation_maps/navigation_maps.css - */ \ No newline at end of file diff --git a/app/assets/config/decidim_navigation_maps_manifest.js b/app/assets/config/decidim_navigation_maps_manifest.js deleted file mode 100644 index e070ad9..0000000 --- a/app/assets/config/decidim_navigation_maps_manifest.js +++ /dev/null @@ -1 +0,0 @@ -//= link decidim/navigation_maps/navigation_maps.js diff --git a/app/assets/images/decidim/navigation_maps/icon.svg b/app/assets/images/decidim/navigation_maps/icon.svg deleted file mode 100644 index d89f656..0000000 --- a/app/assets/images/decidim/navigation_maps/icon.svg +++ /dev/null @@ -1 +0,0 @@ - \ No newline at end of file diff --git a/app/assets/javascripts/decidim/navigation_maps/admin/map_editor.js b/app/assets/javascripts/decidim/navigation_maps/admin/map_editor.js deleted file mode 100644 index 7227a8c..0000000 --- a/app/assets/javascripts/decidim/navigation_maps/admin/map_editor.js +++ /dev/null @@ -1,88 +0,0 @@ -// Creates a map -//= require decidim/navigation_maps/map_view - -function NavigationMapEditor(map_object, table_object) { - var self = this; - // Call constructor of superclass to initialize superclass-derived members. - NavigationMapView.call(self, map_object, function() { - self.createControls(); - if(self.blueprint) { - self.createAreas(); - } - }); - self.table_object = table_object; - this.createAreaCallback = function () {}; - this.editAreaCallback = function () {}; - this.removeAreaCallback = function () {}; -} - -// NavigationMapEditor derives from NavigationMapView -NavigationMapEditor.prototype = Object.create(NavigationMapView.prototype); -NavigationMapEditor.prototype.constructor = NavigationMapEditor; - -NavigationMapEditor.prototype.createControls = function() { - var self = this; - self.map.pm.addControls({ - position: 'topleft', - drawCircle: false, - drawMarker: false, - drawCircleMarker: false, - drawPolyline: false, - cutPolygon: false - }); - - self.map.on('pm:create', function(e) { - var geojson = e.layer.toGeoJSON(); - self.blueprint[e.layer._leaflet_id] = geojson; - self.attachEditorEvents(e.layer); - self.createAreaCallback(e.layer._leaflet_id, e.layer, self); - }); - - self.map.on('pm:remove', function(e) { - delete self.blueprint[e.layer._leaflet_id]; - self.removeAreaCallback(e.layer._leaflet_id, e.layer, self); - }); -}; - -NavigationMapEditor.prototype.editing = function() { - var pm = this.map.pm; - return pm.globalRemovalEnabled() || pm.globalDragModeEnabled() || pm.globalEditEnabled(); -}; - -// register callback to handle area edits,removals and creations -NavigationMapView.prototype.onCreateArea = function(callback) { - this.createAreaCallback = callback; -}; -NavigationMapView.prototype.onEditArea = function(callback) { - this.editAreaCallback = callback; -}; -NavigationMapView.prototype.onRemoveArea = function(callback) { - this.removeCreateCallback = callback; -}; - -NavigationMapEditor.prototype.attachEditorEvents = function (layer) { - var self = this; - - layer.on('mouseover', function(e) { - e.target.getElement().classList.add('selected') - }); - - layer.on('mouseout', function(e) { - e.target.getElement().classList.remove('selected') - }); - - layer.on('pm:edit', function(e) { - self.blueprint[e.target._leaflet_id] = e.target.toGeoJSON(); - self.editAreaCallback(e.target._leaflet_id, e.target, self); - }); - - layer.on('click', function(e) { - if(!self.editing()) { - self.clickAreaCallback(e.target._leaflet_id, e.target, self); - } - }); -}; - -NavigationMapEditor.prototype.getBlueprint = function () { - return this.blueprint; -}; diff --git a/app/assets/javascripts/decidim/navigation_maps/admin/navigation_maps.js b/app/assets/javascripts/decidim/navigation_maps/admin/navigation_maps.js deleted file mode 100644 index daef7e3..0000000 --- a/app/assets/javascripts/decidim/navigation_maps/admin/navigation_maps.js +++ /dev/null @@ -1,143 +0,0 @@ -// Place all the behaviors and hooks related to the matching controller here. -// All this logic will automatically be available in application.js. -//= require jquery.form -//= require decidim/navigation_maps/admin/map_editor -//= require_self - -$(function() { - - var $maps = $('.navigation_maps.admin .map'); - var $progress = $('.navigation_maps.admin .progress'); - var $bar = $('.navigation_maps.admin .progress-meter'); - var $loading = $('.navigation_maps.admin .loading'); - var $callout = $('.navigation_maps.admin .callout'); - var $modal = $('#mapEditModal'); - var $form = $('form'); - var $tabs = $('#navigation_maps-tabs'); - var $accordion = $('.navigation_maps.admin .accordion'); - var editors = {}; - var new_areas = {}; - - $maps.each(function() { - var id = $(this).data('id'); - var table = document.getElementById("navigation_maps-table-" + id); - editors[id] = new NavigationMapEditor(this, table); - editors[id].onCreateArea(function(area_id) { - new_areas[area_id] = true; - }); - - editors[id].onClickArea(function(area_id, area) { - $modal.find('.modal-content').html(''); - $modal.addClass('loading').foundation('open'); - $callout.hide(); - $callout.removeClass('alert success'); - // "new" form insted of editing - var rel = new_areas[area_id] ? 'new' : area_id; - $modal.find('.modal-content').load(`/admin/navigation_maps/blueprints/${id}/areas/${rel}`, function() { - var $input1 = $modal.find('input[name="blueprint_area[area_id]"]'); - var $input2 = $modal.find('input[name="blueprint_area[area_type]"]'); - var $input3 = $modal.find('input[name="blueprint_area[area]"]'); - var a = area.toGeoJSON(); - $modal.removeClass('loading'); - if($input1.length) $input1.val(area_id); - if($input2.length) $input2.val(a.type); - if($input3.length) $input3.val(JSON.stringify(a)); - $modal.find('ul[data-tabs=true]').each(function() { - new Foundation.Tabs($(this)); - }); - }); - }); - }); - - // Rails AJAX events - document.body.addEventListener('ajax:error', function(responseText) { - $callout.contents('p').html(responseText.detail[0].message + ": " + responseText.detail[0].error + ""); - $callout.addClass('alert'); - }); - - document.body.addEventListener('ajax:success', function(responseText) { - if(new_areas[responseText.detail[0].area]) { - delete new_areas[responseText.detail[0].area] - } - var blueprint_id = responseText.detail[0].blueprint_id; - var area_id = responseText.detail[0].area_id; - var area = responseText.detail[0].area; - editors[blueprint_id].setLayerProperties(editors[blueprint_id].map._layers[area_id], area); - editors[blueprint_id].blueprint[area_id] = area; - $callout.contents('p').html(responseText.detail[0].message); - $callout.addClass('success'); - }); - - document.body.addEventListener('ajax:complete', function() { - $callout.show(); - $modal.foundation('close'); - }) - - $tabs.on('change.zf.tabs', function(e, $tab, $content) { - var id = $content.find('.map').data('id'); - if(id) { - editors[id].reload(); - } - }); - - $accordion.on('down.zf.accordion', function(e, $accordion) { - var id = $accordion.find('.map').data('id'); - if(id) { - editors[id].reload(); - } - }); - - // If a new item si going to be created o the image is changed a reload is needed - var needsReload = function() { - var reload = false; - if($form.find('#map-new input:checked').length) return true; - if($form.find('.delete-tab input[type=checkbox]:checked').length) return true; - - $form.find('input[type=file],input[tabs_id=blueprints___title]').each(function() { - if($(this).val()) { - reload = true; - return false; - } - }); - return reload; - }; - - $form.ajaxForm({ - url: $form.find('[name=action]').val(), - beforeSerialize: function() { - Object.keys(editors).forEach(function(key) { - var editor = editors[key]; - $(`#blueprints_${editor.id}_blueprint`).val(JSON.stringify(editor.getBlueprint())); - }); - }, - beforeSend: function() { - var percentVal = '0%'; - $bar.width(percentVal).html(percentVal); - $progress.show(); - $callout.hide(); - $callout.removeClass('alert success'); - $loading.show(); - }, - uploadProgress: function(event, position, total, percentComplete) { - var percentVal = percentComplete + '%'; - $bar.width(percentVal).html(percentVal); - }, - success: function(responseText) { - $callout.show(); - $progress.hide(); - $callout.contents('p').html(responseText); - $callout.addClass('success'); - $loading.hide(); - if(needsReload()) { - $loading.show(); - location.reload(); - } - }, - error: function(xhr) { - $loading.hide(); - $callout.show(); - $callout.contents('p').html(xhr.responseText); - $callout.addClass('alert'); - } - }); -}); diff --git a/app/assets/javascripts/decidim/navigation_maps/map_view.js b/app/assets/javascripts/decidim/navigation_maps/map_view.js deleted file mode 100644 index 74e045d..0000000 --- a/app/assets/javascripts/decidim/navigation_maps/map_view.js +++ /dev/null @@ -1,123 +0,0 @@ -// Creates a map view -//= require leaflet -//= require leaflet-geoman.min - -function NavigationMapView(map_object, callback) { - var self = this; - self.features = {}; - self.map_object = map_object; - self.id = map_object.dataset.id; - self.image_path = map_object.dataset.image; - self.blueprint = map_object.dataset.blueprint ? JSON.parse(map_object.dataset.blueprint) : {}; - self.image = new Image(); - self.image.onload = function() { - self.createMap(); - if(typeof callback === "function") { - callback(self); - } else { - if(self.blueprint) { - self.createAreas(); - } - } - }; - self.image.src = self.image_path; - this.clickAreaCallback = function () {}; - this.setLayerPropertiesCallback = function () {}; -} - -NavigationMapView.prototype.createMap = function() { - var bounds = [[0,0], [this.image.height,this.image.width]]; - this.map = L.map(this.map_object, { - minZoom: -1, - maxZoom: 2, - crs: L.CRS.Simple, - noWrap: true, - zoomSnap: 0, - // zoomDelta: 0.1, - maxBounds: [[0,0], [this.image.height,this.image.width]], - center: [this.image.height/2, this.image.width/2], - zoom: -1, - scrollWheelZoom: false, - attributionControl: false - }); - - L.imageOverlay(this.image.src, bounds).addTo(this.map); - this.fitBounds(); -}; - -NavigationMapView.prototype.fitBounds = function() { - var image_ratio = this.image.height / this.image.width; - var map_ratio = this.map_object.offsetHeight / this.map_object.offsetWidth; - - if(image_ratio > map_ratio) { - this.map.fitBounds([[0,0], [0,this.image.width]]); - } - else { - this.map.fitBounds([[0,0], [this.image.height,0]]); - } - this.map.setView([this.image.height/2, this.image.width/2]); -}; - -NavigationMapView.prototype.createAreas = function() { - var self = this; - self.forEachBlueprint(function(id, geoarea) { - new L.GeoJSON(geoarea, { - onEachFeature: function(feature, layer) { - layer._leaflet_id = id; - self.setLayerProperties(layer, geoarea); - self.attachEditorEvents(layer); - } - }).addTo(self.map); - }); -}; - -NavigationMapView.prototype.setLayerProperties = function (layer, area) { - var props = area.properties; - if(props) { - if(props.color) { - layer.setStyle({fillColor: props.color, color: props.color}); - } - this.setLayerPropertiesCallback(layer, props); - } -}; - -NavigationMapView.prototype.attachEditorEvents = function (layer) { - var self = this; - - layer.on('mouseover', function(e) { - e.target.getElement().classList.add('selected') - }); - - layer.on('mouseout', function(e) { - e.target.getElement().classList.remove('selected') - }); - - layer.on('click', function(e) { - self.clickAreaCallback(e.target, self); - }); -}; - -// register callback to handle area clicks -NavigationMapView.prototype.onClickArea = function(callback) { - this.clickAreaCallback = callback; -}; - -NavigationMapView.prototype.onSetLayerProperties = function(callback) { - this.setLayerPropertiesCallback = callback; -}; - -NavigationMapView.prototype.forEachBlueprint = function (callback) { - for (var id in this.blueprint) { - var geoarea = this.blueprint[id]; - // avoid non-polygons for the moment - if(!geoarea.geometry || geoarea.geometry.type !== 'Polygon') continue; - callback(id, geoarea); - } -}; - -NavigationMapView.prototype.reload = function () { - if(this.map) { - this.map.invalidateSize(true); - this.fitBounds(); - } -}; diff --git a/app/assets/javascripts/decidim/navigation_maps/navigation_maps.js b/app/assets/javascripts/decidim/navigation_maps/navigation_maps.js deleted file mode 100644 index a4b2439..0000000 --- a/app/assets/javascripts/decidim/navigation_maps/navigation_maps.js +++ /dev/null @@ -1,44 +0,0 @@ -// Place all the behaviors and hooks related to the matching controller here. -// All this logic will automatically be available in application.js. -//= require decidim/navigation_maps/map_view -//= require jsrender.min -//= require_self - -$(function() { - - var $maps = $('.navigation_maps .map'); - var $tabs = $('#navigation_maps-tabs'); - var maps = {}; - var tmpl = $.templates("#navigation_maps-popup"); - - $maps.each(function() { - var id = $(this).data('id'); - maps[id] = new NavigationMapView(this); - maps[id].onSetLayerProperties(function(layer, props) { - if(!props.popup) { - var node = document.createElement("div"); - var html = tmpl.render(props); - $(node).html(html); - - layer.bindPopup(node, { - maxHeight: 400, - // autoPan: false, - maxWidth: 640, - minWidth: 200, - keepInView: true, - className: `navigation_map-info map-info-${id}-${layer._leaflet_id}` - }); - } - }); - maps[id].onClickArea(function(area) { - var popup = area.feature.properties && area.feature.properties.link && area.feature.properties.popup; - if(popup) location = area.feature.properties.link; - }); - }); - - $tabs.on('change.zf.tabs', function(e, $tab, $content) { - var id = $content.find('.map').data('id'); - maps[id].reload(); - }); - -}); diff --git a/app/cells/decidim/navigation_maps/content_blocks/navigation_map/_tabs_content.erb b/app/cells/decidim/navigation_maps/content_blocks/navigation_map/_tabs_content.erb index b538bdc..1a36216 100644 --- a/app/cells/decidim/navigation_maps/content_blocks/navigation_map/_tabs_content.erb +++ b/app/cells/decidim/navigation_maps/content_blocks/navigation_map/_tabs_content.erb @@ -2,7 +2,7 @@
<% tabs.each_with_index do |item, index| %>
" id="map<%= index %>"> - <%= content_tag(:div, "", id: "navigation_maps-map-#{item.id}", class: "map", style: "height: #{item.height}px", data: { id: item.id, image: item.image.url, blueprint: item.blueprint }) %> + <%= content_tag(:div, "", id: "navigation_maps-map-#{item.id}", class: "map", style: "height: #{item.height}px", data: { id: item.id, image: image_path(item.image), blueprint: item.blueprint }) %>
<% end %>
diff --git a/app/cells/decidim/navigation_maps/content_blocks/navigation_map/show.erb b/app/cells/decidim/navigation_maps/content_blocks/navigation_map/show.erb index 9f6814e..466bb7c 100644 --- a/app/cells/decidim/navigation_maps/content_blocks/navigation_map/show.erb +++ b/app/cells/decidim/navigation_maps/content_blocks/navigation_map/show.erb @@ -1,4 +1,4 @@ -<%= stylesheet_link_tag "decidim/navigation_maps/navigation_maps" %> +<%= stylesheet_pack_tag "decidim_navigation_maps" %> <%= render partial: "styles", locals: { blueprints: valid_blueprints } %> > @@ -18,4 +18,4 @@ <%= render partial: "template" %> -<%= javascript_include_tag "decidim/navigation_maps/navigation_maps" %> +<%= javascript_pack_tag "decidim_navigation_maps" %> diff --git a/app/cells/decidim/navigation_maps/content_blocks/navigation_map_cell.rb b/app/cells/decidim/navigation_maps/content_blocks/navigation_map_cell.rb index 886c59c..edeac36 100644 --- a/app/cells/decidim/navigation_maps/content_blocks/navigation_map_cell.rb +++ b/app/cells/decidim/navigation_maps/content_blocks/navigation_map_cell.rb @@ -42,6 +42,11 @@ def class_tag(class_string) " class=\"#{class_string}\"" end + + def image_path(image, options = {}) + options.merge!({ only_path: true }) + Rails.application.routes.url_helpers.rails_blob_url(image, options) + end end end end diff --git a/app/cells/decidim/navigation_maps/content_blocks/navigation_map_settings_form/_form.erb b/app/cells/decidim/navigation_maps/content_blocks/navigation_map_settings_form/_form.erb index 2d7307f..75c480c 100644 --- a/app/cells/decidim/navigation_maps/content_blocks/navigation_map_settings_form/_form.erb +++ b/app/cells/decidim/navigation_maps/content_blocks/navigation_map_settings_form/_form.erb @@ -1,5 +1,5 @@