diff --git a/CHANGELOG.md b/CHANGELOG.md index 20043b246..59f52599a 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,14 @@ # Change Log +## [1.2.4](https://github.com/codeforjapan/decidim-cfj/compare/v1.2.3...v1.2.4) (2024-08-06) + + +### Bug Fixes + +* local docker postgres ([287786f](https://github.com/codeforjapan/decidim-cfj/commit/287786f30ab050c9fd32ade9d4e31f8795e4bd16)) +* use `decidim_sanitize_admin` instead of `decidim_escape_translated` ([863bcb7](https://github.com/codeforjapan/decidim-cfj/commit/863bcb756cf9cc4ad9139b84662df8efeb69b28e)) +* Use Redis with docker compose ([a97e0ed](https://github.com/codeforjapan/decidim-cfj/commit/a97e0ed328246933bb8e98f863d350b1bc7e1959)) + ## [1.2.3](https://github.com/codeforjapan/decidim-cfj/compare/v1.2.2...v1.2.3) (2024-07-30) diff --git a/Dockerfile b/Dockerfile index bc104d83e..f7328e5a4 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,4 +1,4 @@ -FROM node:18.17.1-bullseye-slim as node +FROM node:18.17.1-bullseye-slim AS node FROM ruby:3.1.1-slim-bullseye diff --git a/app/views/decidim/accountability/results/_timeline.html.erb b/app/views/decidim/accountability/results/_timeline.html.erb new file mode 100644 index 000000000..8f31f24ed --- /dev/null +++ b/app/views/decidim/accountability/results/_timeline.html.erb @@ -0,0 +1,30 @@ +
+
+

<%= t(".title") %>

+
    + <% result.timeline_entries.each_with_index do |timeline_entry, i| %> +
  1. +
    + <%= i + 1 %> +
    +
    +
    + + <%= l timeline_entry.entry_date, format: :decidim_short %> + +

    + <%= translated_attribute timeline_entry.title %> +

    + + <% if translated_attribute(timeline_entry.description).present? %> +
    + <%= decidim_sanitize_admin translated_attribute(timeline_entry.description) %> +
    + <% end %> +
    +
    +
  2. + <% end %> +
+
+
diff --git a/docker-compose.yml b/docker-compose.yml index 5cf53ae1a..fdd8e7f11 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -1,6 +1,7 @@ x-custom: app: - &rails_env "development" + - &redis_cache_url "${REDIS_CACHE_URL:-redis://redis:6379/0}" postgres: - &postgres_user "${DATABASE_USERNAME:-postgres}" - &postgres_password "${DATABASE_PASSWORD:-password}" @@ -29,9 +30,9 @@ services: volumes: - .:/app - node_modules:/app/node_modules + - rails-tmp:/app/tmp # exclude volumes - /app/vendor - - /app/tmp - /app/log - /app/.git environment: @@ -40,8 +41,11 @@ services: DATABASE_USERNAME: *postgres_user DATABASE_PASSWORD: *postgres_password RAILS_ENV: *rails_env + REDIS_URL: *redis_cache_url + REDIS_CACHE_URL: *redis_cache_url links: - pg + - redis pg: image: "ghcr.io/codeforjapan/postgresql_bigm:12-latest" volumes: @@ -51,7 +55,15 @@ services: POSTGRES_PASSWORD: *postgres_password ports: - 5433:5432 + redis: + image: redis + ports: + - 6379:6379 + volumes: + - redis-data:/data volumes: node_modules: {} pg-data: {} + redis-data: {} + rails-tmp: {} diff --git a/docs/DEVELOPMENT.md b/docs/DEVELOPMENT.md index b95e38123..c5acb359f 100644 --- a/docs/DEVELOPMENT.md +++ b/docs/DEVELOPMENT.md @@ -106,3 +106,19 @@ http://localhost:3000 にアクセス * サービス画面 (http://localhost:3000/users/sign_in?locale=ja) * admin@example.org (組織管理者) * user@example.org (通常ユーザ) + +## 5. キャッシュとRedisについて + +Railsのキャッシュはproduction環境ではRedis Cache Store(`ActiveSupport::Cache::RedisCacheStore`)を使うようになっています。 + +Redisの設定は環境変数 `REDIS_CACHE_URL` を使用しています。 + +development環境でのRailsの標準機能として、キャッシュのオン・オフをトグルで制御できます。オン・オフを切り替えたい場合、以下のコマンドを実行してください。 + +```console +# dockerを使っている場合 +docker compose run app rails dev:cache + +# localで動かしている場合 +bin/rails dev:cache +```