foreman_scc_manager 1.1.2 → 1.1.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/app/models/scc_account.rb +5 -1
- data/app/models/scc_extending.rb +2 -2
- data/app/models/scc_product.rb +2 -1
- data/app/views/scc_accounts/show.html.erb +30 -28
- data/lib/foreman_scc_manager/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: d296a7acbef13daa1e12d2f5fd87cde248487a46
|
4
|
+
data.tar.gz: 8d3377991fc0dded2f0b4e72498bbc90081d6ea8
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 5c94a4f70faeab6138a5d3a41e65d5ea59e17cdea4c5df585ff402bc8118ba01ee9a51783d2213bc287534700ef9a430955b3a18016ebd53f61ffcdd23d24603
|
7
|
+
data.tar.gz: 91b77311d51017259a86f688b9de1491f00603d6cb8e932c2fc1b642be6c698c147a1cfb90611b3d80fc8fcd928eb4002fb7c017b13f1ffb6f5d03ccaa2172e1
|
data/app/models/scc_account.rb
CHANGED
@@ -91,7 +91,11 @@ class SccAccount < ActiveRecord::Base
|
|
91
91
|
# rewire product to product relationships
|
92
92
|
upstream_products.each do |up|
|
93
93
|
extensions = scc_products.where(scc_id: up['extensions'].map { |ext| ext['id'] })
|
94
|
-
|
94
|
+
begin
|
95
|
+
scc_products.find_by!(scc_id: up['id']).update!(scc_extensions: extensions)
|
96
|
+
rescue ActiveRecord::RecordNotFound
|
97
|
+
logger.info "Failed to find parent scc_product '#{up['name']}'."
|
98
|
+
end
|
95
99
|
end
|
96
100
|
end
|
97
101
|
end
|
data/app/models/scc_extending.rb
CHANGED
data/app/models/scc_product.rb
CHANGED
@@ -8,9 +8,10 @@ class SccProduct < ActiveRecord::Base
|
|
8
8
|
belongs_to :product, class_name: 'Katello::Product'
|
9
9
|
has_one :organization, through: :scc_account
|
10
10
|
has_and_belongs_to_many :scc_repositories
|
11
|
-
has_many :scc_extendings, dependent: :destroy
|
11
|
+
has_many :scc_extendings, inverse_of: :scc_product, dependent: :destroy
|
12
12
|
has_many :scc_extensions, through: :scc_extendings
|
13
13
|
has_many :inverse_scc_extendings,
|
14
|
+
inverse_of: :scc_extension,
|
14
15
|
dependent: :destroy,
|
15
16
|
class_name: :SccExtending,
|
16
17
|
foreign_key: :scc_extension_id
|
@@ -1,24 +1,25 @@
|
|
1
|
-
<% javascript 'foreman_scc_manager/scc_accounts'
|
1
|
+
<% javascript 'foreman_scc_manager/scc_accounts' %>
|
2
2
|
<%= form_for([:bulk_subscribe, @scc_account], method: :put) do |f| %>
|
3
|
-
<% def render_list_node(f, scc_product, parent_id = nil) %>
|
4
|
-
<li>
|
5
|
-
|
6
|
-
<% if scc_product.product %>
|
7
|
-
|
8
|
-
<% else %>
|
9
|
-
|
10
|
-
<% end %>
|
11
|
-
|
12
|
-
|
13
|
-
<% if scc_product.scc_extensions.any? %>
|
14
|
-
|
15
|
-
<% scc_product.scc_extensions.order(:friendly_name).each do |scc_extension| %>
|
16
|
-
|
17
|
-
<% end %>
|
18
|
-
|
19
|
-
<% end %>
|
20
|
-
</li>
|
21
|
-
<% end %>
|
3
|
+
<% def render_list_node(f, scc_product, parent_id = nil) %>
|
4
|
+
<li>
|
5
|
+
<span class="scc_product_checkbox" id="<%= "scc_product_span_#{scc_product.id}" %>" <%= "data-parent=scc_product_span_#{parent_id}" if parent_id %>>
|
6
|
+
<% if scc_product.product %>
|
7
|
+
<%= check_box_tag("scc_account[scc_unsubscribe_product_ids][]", scc_product.id, true, disabled: true) %>
|
8
|
+
<% else %>
|
9
|
+
<%= check_box_tag("scc_account[scc_subscribe_product_ids][]", scc_product.id, false) %>
|
10
|
+
<% end %>
|
11
|
+
</span>
|
12
|
+
<%= scc_product.friendly_name %>
|
13
|
+
<% if scc_product.scc_extensions.any? %>
|
14
|
+
<ul>
|
15
|
+
<% scc_product.scc_extensions.order(:friendly_name).each do |scc_extension| %>
|
16
|
+
<% render_list_node(f, scc_extension, scc_product.id) %>
|
17
|
+
<% end %>
|
18
|
+
</ul>
|
19
|
+
<% end %>
|
20
|
+
</li>
|
21
|
+
<% end %>
|
22
|
+
|
22
23
|
<%= f.hidden_field :prevent_missing, value: 1 %>
|
23
24
|
<ul class="nav nav-tabs" data-tabs="tabs">
|
24
25
|
<li class="active"><a href="#primary" data-toggle="tab"><%= _("SUSE Customer Center") %></a></li>
|
@@ -27,15 +28,16 @@
|
|
27
28
|
<div class="tab-content">
|
28
29
|
<div class="tab-pane active pre-scrollable" id="primary">
|
29
30
|
<ul>
|
30
|
-
<% if @scc_account.synced %>
|
31
|
-
<% @scc_account.scc_products.where(product_type: 'base').order(:friendly_name).each do |scc_product| %>
|
32
|
-
|
33
|
-
<% end %>
|
34
|
-
<% else %>
|
35
|
-
|
36
|
-
<%
|
31
|
+
<% if @scc_account.synced %>
|
32
|
+
<% @scc_account.scc_products.where(product_type: 'base').order(:friendly_name).each do |scc_product| %>
|
33
|
+
<% render_list_node(f, scc_product) %>
|
34
|
+
<% end %>
|
35
|
+
<% else %>
|
36
|
+
<%= _('Please sync your SUSE subscriptions first.') %>
|
37
|
+
<% submit_disabled = true %>
|
38
|
+
<% end %>
|
37
39
|
</ul>
|
38
40
|
</div>
|
39
|
-
<%= submit_or_cancel f %>
|
41
|
+
<%= submit_or_cancel f, false, {disabled: submit_disabled || false} %>
|
40
42
|
</div>
|
41
43
|
<% end %>
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: foreman_scc_manager
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.1.
|
4
|
+
version: 1.1.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- ATIX AG
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2017-
|
11
|
+
date: 2017-11-07 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rails
|