From d91131be62895e8a87193f16fc2d01777976fd88 Mon Sep 17 00:00:00 2001 From: Ko Nagase Date: Fri, 9 Aug 2024 10:05:34 +0900 Subject: [PATCH 1/3] Limit ol-ext version to 4.0.18 and update yarn.lock --- package.json | 2 +- yarn.lock | 13 ++++--------- 2 files changed, 5 insertions(+), 10 deletions(-) diff --git a/package.json b/package.json index d0b339e..0cc66d0 100644 --- a/package.json +++ b/package.json @@ -26,7 +26,7 @@ "fontfaceobserver": "^2.3.0", "geojson": "^0.5.0", "ol": "^9.1.0", - "ol-ext": "^4.0.21", + "ol-ext": "4.0.18", "ol-mapbox-style": "^12.3.4" }, "devDependencies": { diff --git a/yarn.lock b/yarn.lock index 66012a6..3ab1998 100644 --- a/yarn.lock +++ b/yarn.lock @@ -634,11 +634,6 @@ fastest-levenshtein@^1.0.12: resolved "https://registry.npmjs.org/fastest-levenshtein/-/fastest-levenshtein-1.0.16.tgz" integrity sha512-eRnCtTTtGZFpQCwhJiUOuxPQWRXVKYDn0b2PeHfXL6/Zi53SLAzAHfVhVWK2AryC/WH05kGfxhFIPvTF0SXQzg== -fflate@^0.4.8: - version "0.4.8" - resolved "https://registry.npmjs.org/fflate/-/fflate-0.4.8.tgz" - integrity sha512-FJqqoDBR00Mdj9ppamLa/Y7vxm+PRmNWA67N846RvsoYVMKB4q3y/de5PA7gUmRMYK/8CMz2GDZQmCRN1wBcWA== - fill-range@^7.1.1: version "7.1.1" resolved "https://registry.yarnpkg.com/fill-range/-/fill-range-7.1.1.tgz#44265d3cac07e3ea7dc247516380643754a05292" @@ -900,10 +895,10 @@ normalize-path@^3.0.0, normalize-path@~3.0.0: resolved "https://registry.npmjs.org/normalize-path/-/normalize-path-3.0.0.tgz" integrity sha512-6eZs5Ls3WtCisHWp9S2GUy8dqkpGi4BVSz3GaqiE6ezub0512ESztXUwUB6C6IKbQkY2Pnb/mD4WYojCRwcwLA== -ol-ext@^4.0.21: - version "4.0.21" - resolved "https://registry.yarnpkg.com/ol-ext/-/ol-ext-4.0.21.tgz#78ba613d1b95e66629c3ce252da6f8367ba0f3eb" - integrity sha512-xP4oVD5KBvJW6P9UQwmPcgqMDh6nzUrHjle4qhNqzRW7OkP02mObw5UMGAgz+uhIW8doJ3hYCwy2HcpU1JFpig== +ol-ext@4.0.18: + version "4.0.18" + resolved "https://registry.yarnpkg.com/ol-ext/-/ol-ext-4.0.18.tgz#87e68566bae1a7821e3a1af8b7019409ce922324" + integrity sha512-zzeTAoCg9IocaM7LlXiLNnVCgVmfxxLzlDTWvYn3Y2gFxtICHSfRrIQl/8vumgBjftBksVl1Fds8P5uFReTmew== ol-mapbox-style@^12.3.4: version "12.3.4" From 3d4d2d29772e85f71f9c6bfe1944469d8e603aa2 Mon Sep 17 00:00:00 2001 From: Ko Nagase Date: Fri, 9 Aug 2024 11:28:40 +0900 Subject: [PATCH 2/3] Fix deface overrides for zeitwerk reload --- app/overrides/issues.rb | 33 --------------------------------- app/overrides/issues/index.rb | 15 +++++++++++++++ app/overrides/issues/show.rb | 15 +++++++++++++++ app/overrides/projects.rb | 17 ----------------- app/overrides/projects/show.rb | 15 +++++++++++++++ app/overrides/users.rb | 9 --------- app/overrides/users/show.rb | 7 +++++++ init.rb | 7 ++++--- 8 files changed, 56 insertions(+), 62 deletions(-) delete mode 100644 app/overrides/issues.rb create mode 100644 app/overrides/issues/index.rb create mode 100644 app/overrides/issues/show.rb delete mode 100644 app/overrides/projects.rb create mode 100644 app/overrides/projects/show.rb delete mode 100644 app/overrides/users.rb create mode 100644 app/overrides/users/show.rb diff --git a/app/overrides/issues.rb b/app/overrides/issues.rb deleted file mode 100644 index 83475e8..0000000 --- a/app/overrides/issues.rb +++ /dev/null @@ -1,33 +0,0 @@ -module Issues - Deface::Override.new( - :virtual_path => "issues/index", - :name => "deface_view_issues_index_map", - :insert_after => "h2", - :original => 'b807967c7184cb012c4bd5ccce90893349bc66e3', - :partial => "issues/index/map" - ) - - Deface::Override.new( - :virtual_path => "issues/index", - :name => "deface_view_issues_index_format_geojson", - :insert_after => "erb[loud]:contains('PDF')", - :original => '2b4102bf118f0a9866cf50477dce9cc7a78da6d5', - :partial => "issues/index/geojson" - ) - - Deface::Override.new( - :virtual_path => "issues/show", - :name => "deface_view_issues_show_map", - :insert_before => "div.attributes", - :original => 'c56981aa84b0fee66ff43ea773cf1444193a2862', - :partial => "issues/show/map" - ) - - Deface::Override.new( - :virtual_path => "issues/show", - :name => "deface_view_issues_show_format_geojson", - :insert_after => "erb[loud]:contains('PDF')", - :original => '1419e0dcba37f62ff95372d41d9b73845889d826', - :partial => "issues/show/geojson" - ) -end diff --git a/app/overrides/issues/index.rb b/app/overrides/issues/index.rb new file mode 100644 index 0000000..77dc401 --- /dev/null +++ b/app/overrides/issues/index.rb @@ -0,0 +1,15 @@ +Deface::Override.new( + :virtual_path => "issues/index", + :name => "deface_view_issues_index_map", + :insert_after => "h2", + :original => 'b807967c7184cb012c4bd5ccce90893349bc66e3', + :partial => "issues/index/map" +) + +Deface::Override.new( + :virtual_path => "issues/index", + :name => "deface_view_issues_index_format_geojson", + :insert_after => "erb[loud]:contains('PDF')", + :original => '2b4102bf118f0a9866cf50477dce9cc7a78da6d5', + :partial => "issues/index/geojson" +) diff --git a/app/overrides/issues/show.rb b/app/overrides/issues/show.rb new file mode 100644 index 0000000..b9b0a56 --- /dev/null +++ b/app/overrides/issues/show.rb @@ -0,0 +1,15 @@ +Deface::Override.new( + :virtual_path => "issues/show", + :name => "deface_view_issues_show_map", + :insert_before => "div.attributes", + :original => 'c56981aa84b0fee66ff43ea773cf1444193a2862', + :partial => "issues/show/map" +) + +Deface::Override.new( + :virtual_path => "issues/show", + :name => "deface_view_issues_show_format_geojson", + :insert_after => "erb[loud]:contains('PDF')", + :original => '1419e0dcba37f62ff95372d41d9b73845889d826', + :partial => "issues/show/geojson" +) diff --git a/app/overrides/projects.rb b/app/overrides/projects.rb deleted file mode 100644 index 2ec8baa..0000000 --- a/app/overrides/projects.rb +++ /dev/null @@ -1,17 +0,0 @@ -module Projects - Deface::Override.new( - :virtual_path => "projects/show", - :name => "deface_view_projects_show_map", - :insert_bottom => "div.splitcontentright", - :original => 'b939fb5ea208476399dbfb4b253dcff0ab1ace91', - :partial => "projects/show/map" - ) - - Deface::Override.new( - :virtual_path => "projects/show", - :name => "deface_view_projects_show_other_formats", - :insert_bottom => "div.splitcontentright", - :original => '1d2f0cb0b1439dddc34ac9c50b6b1b111fe702ce', - :partial => "projects/show/other_formats" - ) -end diff --git a/app/overrides/projects/show.rb b/app/overrides/projects/show.rb new file mode 100644 index 0000000..8a61320 --- /dev/null +++ b/app/overrides/projects/show.rb @@ -0,0 +1,15 @@ +Deface::Override.new( + :virtual_path => "projects/show", + :name => "deface_view_projects_show_map", + :insert_bottom => "div.splitcontentright", + :original => 'b939fb5ea208476399dbfb4b253dcff0ab1ace91', + :partial => "projects/show/map" +) + +Deface::Override.new( + :virtual_path => "projects/show", + :name => "deface_view_projects_show_other_formats", + :insert_bottom => "div.splitcontentright", + :original => '1d2f0cb0b1439dddc34ac9c50b6b1b111fe702ce', + :partial => "projects/show/other_formats" +) diff --git a/app/overrides/users.rb b/app/overrides/users.rb deleted file mode 100644 index 824cd4c..0000000 --- a/app/overrides/users.rb +++ /dev/null @@ -1,9 +0,0 @@ -module Users - Deface::Override.new( - :virtual_path => "users/show", - :name => "deface_view_users_show_other_formats", - :insert_bottom => "div.splitcontentleft", - :original => 'abe916df0691ebe8848cfc0dde536abd3bfe39b8', - :partial => "users/show/other_formats" - ) -end diff --git a/app/overrides/users/show.rb b/app/overrides/users/show.rb new file mode 100644 index 0000000..1960a44 --- /dev/null +++ b/app/overrides/users/show.rb @@ -0,0 +1,7 @@ +Deface::Override.new( + :virtual_path => "users/show", + :name => "deface_view_users_show_other_formats", + :insert_bottom => "div.splitcontentleft", + :original => 'abe916df0691ebe8848cfc0dde536abd3bfe39b8', + :partial => "users/show/other_formats" +) diff --git a/init.rb b/init.rb index 4759cdb..fe8b1f5 100644 --- a/init.rb +++ b/init.rb @@ -58,9 +58,10 @@ end if Rails.version > '6.0' && Rails.autoloaders.zeitwerk_enabled? - require File.expand_path('../app/overrides/issues', __FILE__) - require File.expand_path('../app/overrides/projects', __FILE__) - require File.expand_path('../app/overrides/users', __FILE__) + Dir.glob("#{Rails.root}/plugins/redmine_gtt/app/overrides/**/*.rb").each do |path| + Rails.autoloaders.main.ignore(path) + load File.expand_path(path, __FILE__) + end RedmineGtt.setup_normal_patches Rails.application.config.after_initialize do RedmineGtt.setup_controller_patches From cd07727e950f7566128f715c83c0b1afbc57e0d7 Mon Sep 17 00:00:00 2001 From: Ko Nagase Date: Fri, 9 Aug 2024 14:22:49 +0900 Subject: [PATCH 3/3] Use require instead of load to avoid reload issue --- init.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/init.rb b/init.rb index fe8b1f5..53dbac8 100644 --- a/init.rb +++ b/init.rb @@ -60,7 +60,7 @@ if Rails.version > '6.0' && Rails.autoloaders.zeitwerk_enabled? Dir.glob("#{Rails.root}/plugins/redmine_gtt/app/overrides/**/*.rb").each do |path| Rails.autoloaders.main.ignore(path) - load File.expand_path(path, __FILE__) + require path end RedmineGtt.setup_normal_patches Rails.application.config.after_initialize do