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 #1

Updated by Go MAEDA 5 days ago

  • Related to Feature #23980: Replace icon images with Tabler SVG icons added
Actions #2

Updated by Go MAEDA 4 days ago

  • Assignee set to Marius BĂLTEANU

Marius BĂLTEANU, could you handle this issue related to #23980?

Actions #3

Updated by Marius BĂLTEANU 2 days ago

  • Related to Feature #39111: Enable Asset Pipeline Integration using Propshaft added
Actions #4

Updated by Marius BĂLTEANU 2 days ago

  • Status changed from New to Closed
  • Resolution set to Fixed

Thanks Takenori TAKAKI!

Initially, I've defined the path 'plugins', name, 'app', 'assets', 'images', 'icons.svg' by purpose, but it seems that are some issues when the assets are loaded from that path so for now it is safer to use 'plugins', name, 'assets', 'images', 'icons.svg'.

Actions

Also available in: Atom PDF