Project

General

Profile

Actions

Defect #41712

closed

Fix Path for Plugin Assets Added by Rake Task

Added by Takenori TAKAKI 5 days ago. Updated 2 days ago.

Status:
Closed
Priority:
Normal
Category:
UI
Target version:
-
Start date:
Due date:
% Done:

0%

Estimated time:
Resolution:
Fixed
Affected version:

Description

The Rake task added in Feature #23980 Replace icon images with Tabler SVG icons helps add SVG icons to plugins.
However, there is a mismatch between the path where the Rake task places icons and the path used by asset precompilation.
Because of this, icons added by the Rake task are not available as static assets.

Below, I explain the path difference between the Rake task and asset precompilation, and then suggest a solution.

Path difference:

Where icons are placed by the Rake task (lit/tasks/icons.rake) PLUGINS_ROOT/ app /assets/images/icons.svg
Path expected by asset precompilation PLUGINS_ROOT/assets

Proposed Solution:

To fix this, I suggest updating the Rake task to place icons in the path used by asset precompilation (PLUGINS_ROOT/assets).
A diff with the changes is attached below.

diff --git a/lib/tasks/icons.rake b/lib/tasks/icons.rake
index bda10f2a21..d26f4405ab 100644
--- a/lib/tasks/icons.rake
+++ b/lib/tasks/icons.rake
@@ -75,7 +75,7 @@ unless Rails.env.production?
         end

         input_path = Rails.root.join("tmp", "icons", name)
-        sprite_path = Rails.root.join('plugins', name, 'app', 'assets', 'images', 'icons.svg')
+        sprite_path = Rails.root.join('plugins', name, 'assets', 'images', 'icons.svg')

         generate_svg_sprite(input_path, sprite_path)
       end

Related issues

Related to Redmine - Feature #23980: Replace icon images with Tabler SVG iconsClosedMarius BĂLTEANU

Actions
Related to Redmine - Feature #39111: Enable Asset Pipeline Integration using PropshaftClosedMarius BĂLTEANU

Actions
Actions

Also available in: Atom PDF