diff --git a/.credo.exs b/.credo.exs index e4a3bc12a..bb63ed529 100644 --- a/.credo.exs +++ b/.credo.exs @@ -39,6 +39,9 @@ # to `false` below: # color: true, + plugins: [ + {CredoCodeClimate, []} + ], # # You can customize the parameters of any check by adding a second element # to the tuple. diff --git a/.formatter.exs b/.formatter.exs index deac09627..c69ead3e3 100644 --- a/.formatter.exs +++ b/.formatter.exs @@ -1,4 +1,5 @@ [ + import_deps: [:ecto, :ecto_sql, :phoenix], plugins: [Phoenix.LiveView.HTMLFormatter], inputs: ["{mix,.formatter}.exs", "{config,lib,test,priv}/**/*.{ex,exs,heex}"] ] diff --git a/.gitignore b/.gitignore index 5e1d85557..8f2fa3108 100644 --- a/.gitignore +++ b/.gitignore @@ -49,3 +49,4 @@ test-junit-report.xml js/junit.xml .env demo/ +codeclimate.json diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 9e748a66e..38c3e43b1 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -67,6 +67,10 @@ lint-elixir: - mix credo diff --from-git-merge-base $TARGET_SHA1 --strict -a || export EXITVALUE=1 - mix sobelow --config || export EXITVALUE=1 - exit $EXITVALUE + artifacts: + reports: + codequality: codeclimate.json + lint-front: image: node:16 diff --git a/.sobelow-skips b/.sobelow-skips index 3eabeecae..840e346bb 100644 --- a/.sobelow-skips +++ b/.sobelow-skips @@ -13,4 +13,31 @@ B9AF8A342CD7FF39E10CC10A408C28E1 C042E87389F7BDCFF4E076E95731AE69 C42BFAEF7100F57BED75998B217C857A D11958E86F1B6D37EF656B63405CA8A4 -F16F054F2628609A726B9FF2F089D484 \ No newline at end of file +F16F054F2628609A726B9FF2F089D484 +26E816A7B054CB0347A2C6451F03B92B +2B76BDDB2BB4D36D69FAE793EBD63894 +301A837DE24C6AEE1DA812DF9E5486C1 +395A2740CB468F93F6EBE6E90EE08291 +4013C9866943B9381D9F9F97027F88A9 +4C796DD588A4B1C98E86BBCD0349949A +51289D8D7BDB59CB6473E0DED0591ED7 +5A70DC86895DB3610C605EA9F31ED300 +705C17F9C852F546D886B20DB2C4D0D1 +75D2074B6F771BA8C032008EC18CABDF +7B1C6E35A374C38FF5F07DBF23B3EAE2 +955ACF52ADD8FCAA450FB8138CB1FD1A +A092A563729E1F2C1C8D5D809A31F754 +BFA12FDEDEAD7DEAB6D44DF6FDFBD5E1 +D9A08930F140F9BA494BB90B3F812C87 +FE1EEB91EA633570F703B251AE2D4D4E +02B15A0FE85181E2470E4E1E6740DFF6 +128653EA565172F81FD177D1D6491CF3 +2EB031217231C480C89EA0C1576EF3CA +39CFFBCF3FD4F6DB0E4DE4A9A78D3961 +40C6EAD7C05ABB6A85BB904589DEF72F +49DE9560D506F9E7EF3AFD8DA6E5564B +759F752FA0768CCC7871895DC2A5CD51 +7EEC79571F3F7CEEB04A8B86D908382A +E7967805C1EA5301F2722C7BDB2F25F3 +BDFB0FB1AAF69C18212CBCFD42F8B717 +40220A533CCACB3A1CE9DBF1A8A430A1 \ No newline at end of file diff --git a/config/config.exs b/config/config.exs index 77591db87..67536ba98 100644 --- a/config/config.exs +++ b/config/config.exs @@ -312,11 +312,18 @@ config :mobilizon, Oban, {"@hourly", Mobilizon.Service.Workers.CleanUnconfirmedUsersWorker, queue: :background}, {"@hourly", Mobilizon.Service.Workers.ExportCleanerWorker, queue: :background}, {"@hourly", Mobilizon.Service.Workers.SendActivityRecapWorker, queue: :notifications}, - {"@daily", Mobilizon.Service.Workers.CleanOldActivityWorker, queue: :background} + {"@daily", Mobilizon.Service.Workers.CleanOldActivityWorker, queue: :background}, + {"@hourly", Mobilizon.Service.Workers.CleanApplicationData, + queue: :background, args: %{type: :application_token}}, + {"@hourly", Mobilizon.Service.Workers.CleanApplicationData, + queue: :background, args: %{type: :application_device_activation}} ]}, {Oban.Plugins.Pruner, max_age: 300} ] +config :hammer, + backend: {Hammer.Backend.ETS, [expiry_ms: 60_000 * 60 * 4, cleanup_interval_ms: 60_000 * 10]} + config :mobilizon, :rich_media, parsers: [ Mobilizon.Service.RichMedia.Parsers.OEmbed, diff --git a/config/test.exs b/config/test.exs index 62901358f..b5995e94a 100644 --- a/config/test.exs +++ b/config/test.exs @@ -78,7 +78,7 @@ config :tesla, Mobilizon.Service.HTTP.HostMetaClient, config :mobilizon, Mobilizon.Service.Geospatial, service: Mobilizon.Service.Geospatial.Mock -config :mobilizon, Oban, queues: false, plugins: false +config :mobilizon, Oban, testing: :manual config :mobilizon, Mobilizon.Web.Auth.Guardian, secret_key: "some secret" diff --git a/js/package.json b/js/package.json index d73a875ce..d186ea5c7 100644 --- a/js/package.json +++ b/js/package.json @@ -45,11 +45,12 @@ "@tiptap/extension-strike": "^2.0.0-beta.26", "@tiptap/extension-text": "^2.0.0-beta.15", "@tiptap/extension-underline": "^2.0.0-beta.7", + "@tiptap/pm": "^2.0.0-beta.220", "@tiptap/suggestion": "^2.0.0-beta.195", "@tiptap/vue-3": "^2.0.0-beta.96", "@vue-a11y/announcer": "^2.1.0", "@vue-a11y/skip-to": "^2.1.2", - "@vue-leaflet/vue-leaflet": "^0.8.0", + "@vue-leaflet/vue-leaflet": "^0.9.0", "@vue/apollo-composable": "^4.0.0-beta.1", "@vue/compiler-sfc": "^3.2.37", "@vueuse/core": "^9.1.0", @@ -59,7 +60,7 @@ "autoprefixer": "^10", "blurhash": "^2.0.0", "date-fns": "^2.16.0", - "date-fns-tz": "^1.1.6", + "date-fns-tz": "^2.0.0", "floating-vue": "^2.0.0-beta.17", "graphql": "^15.8.0", "graphql-tag": "^2.10.3", @@ -74,16 +75,6 @@ "p-debounce": "^4.0.0", "phoenix": "^1.6", "postcss": "^8", - "prosemirror-commands": "^1.5.0", - "prosemirror-dropcursor": "^1.6.1", - "prosemirror-gapcursor": "^1.3.1", - "prosemirror-history": "^1.3.0", - "prosemirror-keymap": "^1.2.0", - "prosemirror-model": "^1.19.0", - "prosemirror-schema-list": "^1.2.2", - "prosemirror-state": "^1.4.2", - "prosemirror-transform": "^1.7.1", - "prosemirror-view": "^1.30.0", "register-service-worker": "^1.7.2", "sanitize-html": "^2.5.3", "tailwindcss": "^3", @@ -100,7 +91,7 @@ "zhyswan-vuedraggable": "^4.1.3" }, "devDependencies": { - "@histoire/plugin-vue": "^0.12.4", + "@histoire/plugin-vue": "^0.15.8", "@playwright/test": "^1.25.1", "@rushstack/eslint-patch": "^1.1.4", "@tailwindcss/forms": "^0.5.2", @@ -114,8 +105,8 @@ "@types/phoenix": "^1.5.2", "@types/sanitize-html": "^2.5.0", "@vitejs/plugin-vue": "^4.0.0", - "@vitest/coverage-c8": "^0.28.2", - "@vitest/ui": "^0.28.2", + "@vitest/coverage-c8": "^0.29.2", + "@vitest/ui": "^0.29.2", "@vue/eslint-config-prettier": "^7.0.0", "@vue/eslint-config-typescript": "^11.0.0", "@vue/test-utils": "^2.0.2", @@ -125,17 +116,17 @@ "eslint-plugin-prettier": "^4.0.0", "eslint-plugin-vue": "^9.3.0", "flush-promises": "^1.0.2", - "histoire": "^0.12.4", + "histoire": "^0.15.8", "jsdom": "^21.1.0", "mock-apollo-client": "^1.1.0", "prettier": "^2.2.1", "prettier-eslint": "^15.0.1", "rollup-plugin-visualizer": "^5.7.1", "sass": "^1.34.1", - "typescript": "~4.9.4", + "typescript": "~5.0.0", "vite": "^4.0.4", "vite-plugin-pwa": "^0.14.1", - "vitest": "^0.28.2", + "vitest": "^0.29.2", "vue-i18n-extract": "^2.0.4" } } diff --git a/js/src/components/Event/EventMetadataList.vue b/js/src/components/Event/EventMetadataList.vue index d3fb4abd0..2258db5a8 100644 --- a/js/src/components/Event/EventMetadataList.vue +++ b/js/src/components/Event/EventMetadataList.vue @@ -65,18 +65,21 @@ -