killbill-kpm-ui 4.0.2 → 4.0.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: b35ac4715be2450d712be969820d8a0ea0707b96b53318726c3dc1218c189a2d
4
- data.tar.gz: 9afcb4db769506ca8059bf868b1292b814af5928bdbe1ea08b23f52ca12a1d6f
3
+ metadata.gz: 3058de80c2d277d18556fbcf0b361203bb65859956266cd39532e97b1d78d878
4
+ data.tar.gz: 5112d0511883b2083f3c58c435d88324718bbc776ef822757570f58dca3e52ff
5
5
  SHA512:
6
- metadata.gz: b33c9958bd2084c240703b7c8e8dfe3738cb11f93bb47948c37e5ccf467584e7f59b7582224d3c6bf5a79e26f31fe7618b37a023e42bbdd6e2ed3b68771f93e2
7
- data.tar.gz: 6e1f2a7bb95a4d2ffd8461b41c72ed0cf84cf3a6b9e0709e5f99eeab8236bacb54792992dbbaef11211955df15767ab9ff72112233797df1b4522f8cb913bb61
6
+ metadata.gz: '099d94f25430bce25313e8f5637882daa2990f187928ef1062c9678186ca1935b30faa9b847b01aa9780f02506f66398004af8ab3669fa2aa050d810f32635b4'
7
+ data.tar.gz: f24666f75b89b7eb8417245d9e6b3adab3d786611984851912b9351db529cd6d5c7d0c6ab0286e55db2d2b4947489becae39bd934b4a097bbe7e56ab31bdaa76
@@ -10,9 +10,21 @@ module KPM
10
10
  @plugins = {}
11
11
 
12
12
  @installed_plugin_keys = Set.new
13
+ # Map of installed plugin_key => highest installed version found across nodes
14
+ @installed_plugins = {}
13
15
  (nodes_info || []).each do |node_info|
14
16
  (node_info.plugins_info || []).each do |plugin_info|
15
- @installed_plugin_keys.add(plugin_info.plugin_key) unless plugin_info.plugin_key.nil?
17
+ next if plugin_info.plugin_key.nil?
18
+
19
+ @installed_plugin_keys.add(plugin_info.plugin_key)
20
+ next if plugin_info.version.nil?
21
+
22
+ current = @installed_plugins[plugin_info.plugin_key]
23
+ begin
24
+ @installed_plugins[plugin_info.plugin_key] = plugin_info.version if current.nil? || Gem::Version.new(plugin_info.version) > Gem::Version.new(current)
25
+ rescue ArgumentError
26
+ @installed_plugins[plugin_info.plugin_key] ||= plugin_info.version
27
+ end
16
28
  end
17
29
  end
18
30
 
@@ -13,11 +13,16 @@
13
13
  <td><%= name %></td>
14
14
  <td><%= version %></td>
15
15
  <td>
16
- <% if @installed_plugin_keys.include?(name) %>
17
- <span class="label label-success">Installed</span>
18
- <% else %>
19
- <%= link_to 'Install', plugin_install_path(:plugin_key => name), :method => :post, :title => 'Install' %>
20
- <% end %>
16
+ <% if @installed_plugin_keys.include?(name) %>
17
+ <% installed_version = @installed_plugins && @installed_plugins[name] %>
18
+ <% if installed_version.present? && version.present? && Gem::Version.correct?(installed_version) && Gem::Version.new(installed_version) < Gem::Version.new(version) %>
19
+ <%= link_to 'Update', plugin_install_path(:plugin_key => name), :method => :post, :title => 'Update' %>
20
+ <% else %>
21
+ <span class="label label-success">Installed</span>
22
+ <% end %>
23
+ <% else %>
24
+ <%= link_to 'Install', plugin_install_path(:plugin_key => name), :method => :post, :title => 'Install' %>
25
+ <% end %>
21
26
  </td>
22
27
  </tr>
23
28
  <% end %>
data/lib/kpm/version.rb CHANGED
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module KPM
4
- VERSION = '4.0.2'
4
+ VERSION = '4.0.3'
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: killbill-kpm-ui
3
3
  version: !ruby/object:Gem::Version
4
- version: 4.0.2
4
+ version: 4.0.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Kill Bill core team
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2026-03-25 00:00:00.000000000 Z
11
+ date: 2026-04-01 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: killbill-assets-ui