Skip to content

Commit

Permalink
Merge pull request #341 from codeforjapan/develop
Browse files Browse the repository at this point in the history
update some translate & fix some bug
  • Loading branch information
ayuki-joto authored Feb 21, 2022
2 parents 2dd3240 + b9d81bb commit 58ffc97
Show file tree
Hide file tree
Showing 10 changed files with 184 additions and 98 deletions.
14 changes: 14 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,19 @@
# Change Log
## [v0.23.5-2022-01-17](https://github.com/codeforjapan/decidim-cfj/releases/tag/v0.23.5-2022-01-17)

### Fixed
- Fix [#304](https://github.com/codeforjapan/decidim-cfj/issues/304); ignore seeds of DecidimAwesome [#305](https://github.com/codeforjapan/decidim-cfj/pull/305)
- Fix db:seed in docker [#306](https://github.com/codeforjapan/decidim-cfj/pull/306)
- Fix Translation [#313](https://github.com/codeforjapan/decidim-cfj/pull/313)
- Updated translation file for Decidim Awesome [#315](https://github.com/codeforjapan/decidim-cfj/pull/315)
- fix url & remove OriginPath [#321](https://github.com/codeforjapan/decidim-cfj/pull/321)

### Changed
- Extended CloudWatch application log retention period[#308](https://github.com/codeforjapan/decidim-cfj/pull/308)
- chore: enabled AWSManagedRulesCommonRuleSet on AWS WAF [#314](https://github.com/codeforjapan/decidim-cfj/pull/314)

## [v0.23.5-2021-11-08](https://github.com/codeforjapan/decidim-cfj/releases/tag/v0.23.5-2021-11-08)

### Fixed
- Fix messages endorsement in JA [#299](https://github.com/codeforjapan/decidim-cfj/pull/299)

Expand Down
5 changes: 5 additions & 0 deletions app/assets/stylesheets/comment_content.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
/* Fix https://github.com/codeforjapan/decidim-cfj/issues/288 */
.comment__content {
overflow-wrap: break-word;
word-wrap: break-word;
}
29 changes: 29 additions & 0 deletions app/controllers/concerns/decidim/proposals/cookie_orderable.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
# frozen_string_literal: true

module Decidim
module Proposals
module CookieOrderable
private

def default_order
order_by_cookie || super
end

def order_by_cookie
cookie = cookies[order_cookie_name]
cookie if cookie && available_orders.include?(cookie)
end

def order_cookie_name
"proposal_default_order"
end

def detect_order(candidate)
detected = available_orders.detect { |order| order == candidate }
cookies[order_cookie_name] = detected if detected

detected
end
end
end
end
95 changes: 0 additions & 95 deletions app/views/decidim/proposals/admin/proposals/_form.html.erb

This file was deleted.

41 changes: 41 additions & 0 deletions bin/get_user_data.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
#!/bin/bash
#
# A script for retrieving user data from the decidim database
# You need to set below environment variables before running this script
#
# export RDS_DB_NAME=ebdb
# export RDS_PASSWORD=password
# export RDS_HOSTNAME=database-host
# export RDS_USERNAME=decidimapp
#

function print_orgs() {
export PGPASSWORD=$RDS_PASSWORD; psql -h $RDS_HOSTNAME -U $RDS_USERNAME -c "SELECT id, name FROM decidim_organizations" $RDS_DB_NAME
}

if [ "$1" = "" ]; then
print_orgs
echo "-------------------"
echo "please specify ORG_ID ; get_user_data.sh ORG_ID"
exit 1
fi

echo ORG_ID is $1
ORG_ID=$1

out_file=$(mktemp)
json_file=$(mktemp)


echo "[" > ${json_file}
export PGPASSWORD=$RDS_PASSWORD; psql -h $RDS_HOSTNAME -U $RDS_USERNAME -c "SELECT json_build_object('id', B.id, 'nickname',nickname,'email', email, 'created_at', to_char(B.created_at, 'YYYY/MM/DD'),'sign_in_count', sign_in_count, 'last_sign_in_at', to_char(last_sign_in_at, 'YYYY/MM/DD'), 'data', metadata) FROM public.decidim_authorizations as A RIGHT OUTER JOIN decidim_users as B on A.decidim_user_id = B.id where decidim_organization_id = ${ORG_ID} and B.deleted_at is null;" -A -t $RDS_DB_NAME > ${out_file}

awk -v eof=`wc -l ${out_file} | awk '{print $1}'` 'BEGIN{ORS = ",\n"}{if (NR==eof) ORS=""; print $0}' ${out_file} >> ${json_file}
echo "]" >> ${json_file}


echo "id, created_at, sign_in_count, last_sign_in, nickname, real_name, email, gender, address, birth_year, occupation" > /tmp/metadata.csv

cat ${json_file} | jq -r '.[] | [.id,.created_at, .sign_in_count,.last_sign_in_at,.nickname,.data.real_name, .email, .data.gender, .data.address, .data.birth_year, .data.occupation] | @csv' >> /tmp/metadata.csv

echo "/tmp/metadata.csv is created"
9 changes: 9 additions & 0 deletions config/initializers/decidim_override.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
# frozen_string_literal: true

# Override Decidim::Orderable
#
# Use cookies to store default orders
#
Rails.application.config.to_prepare do
Decidim::Proposals::ProposalsController.prepend Decidim::Proposals::CookieOrderable
end
3 changes: 3 additions & 0 deletions config/routes.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@

require "sidekiq/web"
Rails.application.routes.draw do
# Redirect to Metadecidim Japan
get "/", to: redirect("https://meta.diycities.jp/"), constraints: { host: "www.diycities.jp" }

mount Decidim::Core::Engine => "/"
# For details on the DSL available within this file, see http://guides.rubyonrails.org/routing.html
authenticate :user, ->(u) { u.admin? } do
Expand Down
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
<%= f.fields_for :user_extension, f.object.user_extension do |f_ext| %>
<div class="field">
<%= f_ext.text_field :real_name, label: t(:real_name, scope: "activemodel.attributes.user_extension") %>
<%= f_ext.text_field :real_name, label: t(:real_name, scope: "activemodel.attributes.user_extension"), autocomplete: 'name' %>
</div>

<div class="field">
<%= f_ext.text_field :address, label: t(:address, scope: "activemodel.attributes.user_extension") %>
<%= f_ext.text_field :address, label: t(:address, scope: "activemodel.attributes.user_extension"), autocomplete: 'street-address' %>
</div>

<div class="field">
<%= f_ext.text_field :birth_year, label: t(:birth_year, scope: "activemodel.attributes.user_extension") %>
<%= f_ext.text_field :birth_year, label: t(:birth_year, scope: "activemodel.attributes.user_extension"), help_text: t(".birth_year_help"), inputmode: 'numeric', maxlength: 4 %>
</div>

<div class="field">
Expand Down
4 changes: 4 additions & 0 deletions decidim-user_extension/config/locales/ja.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,10 @@ ja:
officializations:
index:
show_user_extension: ユーザー属性を表示
devise:
registrations:
user_extension:
birth_year_help: 数値4桁で入力してください。例) 1997
user_extension:
admin:
officializations:
Expand Down
76 changes: 76 additions & 0 deletions docs/UPGRADE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,76 @@
# 更新作業について

このインスタンスはDecicim本体に依存しており、Decidimが更新された場合、それに合わせて更新作業を行う必要があります。

## Decidimの更新方法

基本的な手順は https://docs.decidim.org/en/install/update/ に書いてある通りです。

## Decidim本体のバージョン更新時に特に注意したい内容

Decidim本体のバージョンを更新する際、特に注意が必要な内容についてまとめておきます。

### 上書き用のファイル・ディレクトリ

このDecidimアプリ内で、Decidim本体やライブラリに含まれる元ファイルを上書きしているファイルがいくつかあります。
これらのファイルについては、Decidim本体のファイルがバージョンアップ時に更新された場合、その更新内容をファイルに反映させなければアプリケーションが壊れる可能性があります。そのため、本体の更新時には確認が必要です。

* `app/assets/javascripts/decidim/decidim_awesome/editors/legacy_quill_editor.js.es6`

QuillエディタでHTML編集ができるようにするために追加されたファイル。現在はDecidim Awesome対応になっています(decidim_awesome内の`app/assets/javascripts/decidim/decidim_awesome/editors/legacy_quill_editor.js.es6`がベースになっています)。

* `app/assets/stylesheets/buttons.scss`

`https://github.com/codeforjapan/decidim-cfj/issues/46` の対応で `https://github.com/codeforjapan/decidim-cfj/pull/96` で追加しています。

* `app/assets/stylesheets/decidim/decidim_awesome/editors/quill_editor.scss`

Decidim Awesomeを追加した際に https://github.com/codeforjapan/decidim-cfj/pull/223 で上書きしています。

* `app/commands/decidim/admin/process_participatory_space_private_user_import_csv.rb`

https://github.com/codeforjapan/decidim-cfj/issues/202 の対応のため追加したファイル。

https://github.com/decidim/decidim/pull/7781 で本家にフィードバックしたので、これが取り込まれたバージョン(v0.25.0以降)になればファイルごと削除できるはずです。

* `app/forms/decidim/proposals/proposal_wizard_create_step_form.rb`, `app/forms/decidim/proposals/admin/proposal_form.rb`

https://github.com/codeforjapan/decidim-cfj/issues/23 の対応のために追加されたもの。対応するPRは https://github.com/codeforjapan/decidim-cfj/pull/60 https://github.com/codeforjapan/decidim-cfj/pull/163 です。
EtiquetteValidatorは修正が入っているので戻せるかもしれませんが、8文字程度のタイトルでも許可するようにする修正はフィードバックできていません。

* `decidim-comments`

https://github.com/codeforjapan/decidim-cfj/issues/319 などの対応のために追加されたディレクトリ(gem)。

本家の https://github.com/decidim/decidim/tree/develop/decidim-comments から切り出して修正を加えたもの。
バージョンアップ時には注意しつつ、変更点を適宜修正する必要があります。

* `app/helpers/decidim/resource_versions_helper.rb`

高速化のために https://github.com/codeforjapan/decidim-cfj/pull/289 で追加されたファイル。

https://github.com/decidim/decidim/pull/8393 でフィードバック済みなので、取り込まれたバージョンでは削除できます。

* `app/uploaders/decidim/application_uploader.rb`

https://github.com/decidim/decidim/issues/6720https://github.com/codeforjapan/decidim-cfj/issues/101 などの対応のために導入。

* `app/views/decidim/application/_collection.html.erb`

https://github.com/codeforjapan/decidim-cfj/issues/192 の対応で https://github.com/codeforjapan/decidim-cfj/pull/210 で追加しています。
本家の https://github.com/decidim/decidim/pull/7418 で対応済みなので、取り込まれたバージョンでは削除できます。

* `app/views/decidim/blogs/posts/show.html.erb`

https://github.com/codeforjapan/decidim-cfj/issues/107 の対応として https://github.com/codeforjapan/decidim-cfj/pull/126 で追加しています。


* `app/views/decidim/proposals/admin/proposals/_form.html.erb`

https://github.com/codeforjapan/decidim-cfj/issues/24 の対応として https://github.com/codeforjapan/decidim-cfj/pull/51 で追加しています。
本家には https://github.com/decidim/decidim/issues/6739 でフィードバック済で、再現まではできていたようですが、修正されたかどうかは不明です。

* `app/views/layouts/decidim/_main_footer.html.erb`

https://github.com/codeforjapan/decidim-cfj/issues/101 の対応として https://github.com/codeforjapan/decidim-cfj/pull/108 で追加しています。
ダウンロードに問題がなければ削除しても大丈夫かと思われます。

0 comments on commit 58ffc97

Please sign in to comment.