katello 3.0.0.rc1 → 3.0.0.rc2

Sign up to get free protection for your applications and to get access to all the features.

Potentially problematic release.


This version of katello might be problematic. Click here for more details.

Files changed (161) hide show
  1. checksums.yaml +4 -4
  2. data/app/assets/stylesheets/katello/katello.scss +5 -5
  3. data/app/controllers/katello/api/rhsm/candlepin_proxies_controller.rb +3 -3
  4. data/app/controllers/katello/api/v2/activation_keys_controller.rb +12 -12
  5. data/app/controllers/katello/api/v2/api_controller.rb +13 -5
  6. data/app/controllers/katello/api/v2/content_view_versions_controller.rb +30 -27
  7. data/app/controllers/katello/api/v2/content_views_controller.rb +4 -1
  8. data/app/controllers/katello/api/v2/host_subscriptions_controller.rb +100 -3
  9. data/app/controllers/katello/api/v2/repositories_controller.rb +2 -2
  10. data/app/controllers/katello/api/v2/repository_sets_controller.rb +1 -1
  11. data/app/controllers/katello/api/v2/subscriptions_controller.rb +0 -1
  12. data/app/controllers/katello/api/v2/systems_controller.rb +1 -88
  13. data/app/controllers/katello/concerns/api/v2/bulk_hosts_extensions.rb +10 -4
  14. data/app/controllers/katello/remote_execution_controller.rb +1 -1
  15. data/app/helpers/katello/concerns/settings_helper_extensions.rb +50 -0
  16. data/app/helpers/katello/hosts_and_hostgroups_helper.rb +17 -4
  17. data/app/helpers/katello/katello_urls_helper.rb +3 -2
  18. data/app/helpers/katello/providers_helper.rb +2 -5
  19. data/app/lib/actions/katello/capsule_content/configure_capsule.rb +1 -1
  20. data/app/lib/actions/katello/capsule_content/{create_or_update.rb → create_repos.rb} +2 -7
  21. data/app/lib/actions/katello/capsule_content/remove_orphans.rb +15 -0
  22. data/app/lib/actions/katello/capsule_content/remove_unneeded_repos.rb +6 -5
  23. data/app/lib/actions/katello/capsule_content/sync.rb +32 -0
  24. data/app/lib/actions/katello/content_view/incremental_updates.rb +4 -3
  25. data/app/lib/actions/katello/content_view/promote.rb +4 -0
  26. data/app/lib/actions/katello/content_view/publish.rb +4 -0
  27. data/app/lib/actions/katello/content_view_puppet_module/destroy.rb +4 -5
  28. data/app/lib/actions/katello/content_view_version/incremental_update.rb +5 -3
  29. data/app/lib/actions/katello/host/erratum/applicable_errata_install.rb +2 -2
  30. data/app/lib/actions/katello/host/generate_applicability.rb +1 -1
  31. data/app/lib/actions/katello/host/hypervisors_update.rb +1 -1
  32. data/app/lib/actions/katello/host/register.rb +10 -4
  33. data/app/lib/actions/katello/repository/destroy.rb +2 -1
  34. data/app/lib/actions/katello/repository/import_applicability.rb +23 -0
  35. data/app/lib/actions/katello/repository/sync.rb +1 -8
  36. data/app/lib/actions/pulp/abstract_async_task.rb +8 -0
  37. data/app/lib/actions/pulp/consumer/content_install.rb +14 -0
  38. data/app/lib/actions/pulp/repository/create.rb +2 -1
  39. data/app/lib/actions/pulp/repository/delete_distributor.rb +18 -0
  40. data/app/lib/actions/pulp/repository/refresh.rb +25 -7
  41. data/app/lib/katello/api/v2/error_handling.rb +2 -2
  42. data/app/lib/katello/capsule_content.rb +11 -0
  43. data/app/lib/katello/errors.rb +1 -1
  44. data/app/mailers/katello/errata_mailer.rb +3 -3
  45. data/app/models/katello/activation_key.rb +6 -6
  46. data/app/models/katello/candlepin/product_content.rb +15 -0
  47. data/app/models/katello/concerns/content_facet_host_extensions.rb +13 -0
  48. data/app/models/katello/concerns/operatingsystem_extensions.rb +17 -1
  49. data/app/models/katello/concerns/pulp_database_unit.rb +3 -1
  50. data/app/models/katello/concerns/setting_extensions.rb +12 -0
  51. data/app/models/katello/content_view.rb +2 -2
  52. data/app/models/katello/erratum.rb +7 -0
  53. data/app/models/katello/glue/candlepin/product.rb +4 -0
  54. data/app/models/katello/glue/candlepin/subscription.rb +1 -1
  55. data/app/models/katello/glue/pulp/repo.rb +31 -3
  56. data/app/models/katello/host/content_facet.rb +43 -16
  57. data/app/models/katello/host/subscription_facet.rb +1 -0
  58. data/app/models/katello/pool.rb +6 -11
  59. data/app/models/katello/repository.rb +20 -15
  60. data/app/models/katello/subscription.rb +14 -0
  61. data/app/models/katello/sync_plan.rb +5 -0
  62. data/app/models/katello/system.rb +0 -10
  63. data/app/models/setting/katello.rb +2 -1
  64. data/app/presenters/katello/product_content_presenter.rb +16 -0
  65. data/app/services/katello/candlepin/consumer.rb +22 -1
  66. data/app/services/katello/repository_type_manager.rb +4 -0
  67. data/app/views/dashboard/_content_views_widget.html.erb +2 -2
  68. data/app/views/dashboard/_errata_widget.html.erb +1 -1
  69. data/app/views/dashboard/_host_collection_widget.html.erb +2 -2
  70. data/app/views/dashboard/_subscription_status_widget.html.erb +5 -5
  71. data/app/views/dashboard/_subscription_widget.html.erb +1 -1
  72. data/app/views/dashboard/_sync_widget.html.erb +2 -2
  73. data/app/views/foreman/unattended/finish-katello.erb +2 -0
  74. data/app/views/foreman/unattended/kickstart-katello-atomic.erb +42 -0
  75. data/app/views/foreman/unattended/kickstart-katello.erb +2 -0
  76. data/app/views/foreman/unattended/snippets/_subscription_manager_registration.erb +15 -9
  77. data/app/views/foreman/unattended/userdata-katello.erb +6 -1
  78. data/app/views/katello/api/v2/activation_keys/show.json.rabl +2 -2
  79. data/app/views/katello/api/v2/common/_metadata.json.rabl +1 -0
  80. data/app/views/katello/api/v2/content_facet/show.json.rabl +4 -0
  81. data/app/views/katello/api/v2/host_subscriptions/content_override.json.rabl +3 -0
  82. data/app/views/katello/api/v2/{systems/_content.json.rabl → host_subscriptions/product_content.json.rabl} +1 -3
  83. data/app/views/katello/api/v2/sync_plans/show.json.rabl +5 -1
  84. data/app/views/katello/errata_mailer/host_errata.html.erb +2 -2
  85. data/app/views/katello/errata_mailer/promote_errata.html.erb +1 -1
  86. data/app/views/katello/errata_mailer/promote_errata.text.erb +1 -1
  87. data/app/views/katello/errata_mailer/sync_errata.html.erb +1 -1
  88. data/app/views/katello/errata_mailer/sync_errata.text.erb +1 -1
  89. data/app/views/overrides/activation_keys/_host_environment_select.html.erb +21 -11
  90. data/config/katello.yaml.example +1 -0
  91. data/config/routes/api/v2.rb +0 -6
  92. data/config/routes/overrides.rb +3 -0
  93. data/db/migrate/20140117160939_refactor_content_views.rb +1 -0
  94. data/db/migrate/20140222022712_remove_provider_discovery.rb +2 -0
  95. data/db/migrate/20140502164009_rename_system_groups_to_host_collections.rb +7 -0
  96. data/db/migrate/20141210173220_create_docker_tables.rb +4 -3
  97. data/db/migrate/20151219203225_rename_index_repository_puppet_module.rb +1 -1
  98. data/db/migrate/20160203195736_remove_docker_image_schema.rb +1 -0
  99. data/db/migrate/20160317171813_change_activation_key_column_names.rb +11 -0
  100. data/db/migrate/20160323065901_increase_cdn_length.rb +11 -0
  101. data/db/migrate/20160404132250_remove_katello_from_notification_name.rb +26 -0
  102. data/db/seeds.d/103-provisioning_templates.rb +3 -1
  103. data/db/seeds.d/106-mail_notifications.rb +3 -3
  104. data/db/seeds.d/109-atomic_os.rb +11 -0
  105. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/activation-keys/activationKeyConsumed.filter.js +1 -1
  106. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/activation-keys/details/activation-key-associations.controller.js +21 -9
  107. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/activation-keys/details/views/activation-key-add-subscriptions.html +3 -3
  108. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/activation-keys/details/views/activation-key-associations-content-hosts.html +41 -40
  109. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/activation-keys/details/views/activation-key-details.html +1 -1
  110. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/activation-keys/details/views/activation-key-info.html +7 -7
  111. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/activation-keys/details/views/activation-key-subscriptions-list.html +3 -3
  112. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/activation-keys/new/new-activation-key.controller.js +1 -1
  113. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/activation-keys/new/views/activation-key-new.html +8 -8
  114. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/capsule-content/capsule-content.routes.js +2 -2
  115. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-hosts/content-hosts.controller.js +0 -8
  116. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-hosts/content/content-host-errata.controller.js +19 -16
  117. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-hosts/content/views/content-host-errata.html +1 -1
  118. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-hosts/details/content-host-details-info.controller.js +5 -3
  119. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-hosts/details/content-host-details.controller.js +27 -3
  120. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-hosts/details/content-host-products.controller.js +79 -26
  121. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-hosts/details/views/content-host-add-subscriptions.html +3 -3
  122. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-hosts/details/views/content-host-details.html +32 -10
  123. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-hosts/details/views/content-host-info.html +8 -8
  124. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-hosts/details/views/content-host-products.html +11 -11
  125. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-hosts/details/views/content-host-subscriptions-list.html +3 -3
  126. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-views/details/views/content-view-promotion.html +1 -1
  127. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-views/versions/views/content-view-version-puppet-modules.html +3 -3
  128. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/errata/apply-errata.controller.js +1 -1
  129. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/errata/details/errata-content-hosts.controller.js +33 -10
  130. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/errata/details/views/errata-details-content-hosts.html +5 -5
  131. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/errata/views/apply-errata-confirm.html +2 -2
  132. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/gpg-keys/details/views/gpg-key-details.html +1 -1
  133. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/gpg-keys/new/new-gpg-key.controller.js +7 -3
  134. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/host-collections/details/views/host-collection-details.html +1 -1
  135. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/host-collections/new/views/host-collection-new-form.html +1 -1
  136. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/hosts/host-subscription.factory.js +3 -1
  137. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/organizations/check-current-organization.run.js +3 -15
  138. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/organizations/fenced-pages.service.js +36 -0
  139. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/organizations/organization.factory.js +1 -1
  140. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/products/bulk/views/bulk-actions.html +14 -3
  141. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/products/details/views/product-details.html +1 -1
  142. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/products/details/views/product-repositories.html +13 -3
  143. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/repositories/details/views/repository-info.html +1 -1
  144. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/repositories/details/views/repository-manage-docker-manifests.html +3 -1
  145. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/repositories/details/views/repository-manage-packages.html +7 -5
  146. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/repositories/details/views/repository-manage-puppet-modules.html +5 -3
  147. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/subscriptions/manifest/manifest-import.controller.js +16 -6
  148. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/sync-plans/details/sync-plan-details-info.controller.js +7 -2
  149. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/sync-plans/details/views/sync-plan-details.html +1 -1
  150. data/engines/bastion_katello/app/assets/stylesheets/bastion_katello/bastion_katello.scss +6 -0
  151. data/lib/katello/engine.rb +4 -3
  152. data/lib/katello/permissions/host_permissions.rb +1 -0
  153. data/lib/katello/version.rb +1 -1
  154. metadata +17 -11
  155. data/app/controllers/katello/concerns/api/v2/bulk_systems_extensions.rb +0 -39
  156. data/app/views/katello/api/v2/systems/content_override.json.rabl +0 -3
  157. data/app/views/katello/api/v2/systems/product_content.json.rabl +0 -3
  158. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-hosts/details/content-host-product-details.controller.js +0 -97
  159. data/lib/katello/tasks/upgrades/2.1/import_errata.rake +0 -45
  160. data/lib/katello/tasks/upgrades/2.2/update_gpg_key_urls.rake +0 -20
  161. data/lib/katello/tasks/upgrades/2.2/update_metadata_expire.rake +0 -18
@@ -18,9 +18,10 @@ class CreateDockerTables < ActiveRecord::Migration
18
18
 
19
19
  add_index :katello_docker_tags, [:docker_image_id, :repository_id, :name],
20
20
  :name => :docker_tag_docker_image_repo_name, :unique => true
21
-
22
- add_foreign_key :katello_repository_docker_images, :katello_docker_images,
23
- :column => :docker_image_id
21
+ unless foreign_key_exists?(:katello_repository_docker_images, :column => :docker_image_id)
22
+ add_foreign_key :katello_repository_docker_images, :katello_docker_images,
23
+ :column => :docker_image_id
24
+ end
24
25
  end
25
26
 
26
27
  def down
@@ -3,7 +3,7 @@ class RenameIndexRepositoryPuppetModule < ActiveRecord::Migration
3
3
  original_name = 'index_katello_repository_puppet_module_on_module_id_and_repo_id'
4
4
  shorter_name = 'index_katello_repo_puppet_module_on_module_id_and_repo_id'
5
5
 
6
- if index_exists?(:katello_repository_puppet_module, [:module_id, :repo_id], :name => original_name)
6
+ if index_exists?(:katello_repository_puppet_modules, [:module_id, :repo_id], :name => original_name)
7
7
  rename_index :katello_repository_puppet_modules, original_name, shorter_name
8
8
  end
9
9
  end
@@ -1,5 +1,6 @@
1
1
  class RemoveDockerImageSchema < ActiveRecord::Migration
2
2
  def up
3
+ remove_foreign_key :katello_docker_tags, :name => "katello_docker_tags_docker_image_id_fk"
3
4
  remove_column :katello_docker_tags, :docker_image_id
4
5
  drop_table :katello_repository_docker_images
5
6
  drop_table :katello_docker_images
@@ -0,0 +1,11 @@
1
+ class ChangeActivationKeyColumnNames < ActiveRecord::Migration
2
+ def self.up
3
+ rename_column :katello_activation_keys, :max_content_hosts, :max_hosts
4
+ rename_column :katello_activation_keys, :unlimited_content_hosts, :unlimited_hosts
5
+ end
6
+
7
+ def self.down
8
+ rename_column :katello_activation_keys, :max_hosts, :max_content_hosts
9
+ rename_column :katello_activation_keys, :unlimited_hosts, :unlimited_content_hosts
10
+ end
11
+ end
@@ -0,0 +1,11 @@
1
+ class IncreaseCdnLength < ActiveRecord::Migration
2
+ def up
3
+ change_column :katello_providers, :repository_url, :string, :limit => 1024
4
+ change_column :katello_repositories, :url, :string, :limit => 1024
5
+ end
6
+
7
+ def down
8
+ change_column :katello_providers, :repository_url, :string, :limit => 255
9
+ change_column :katello_repositories, :url, :string, :limit => 255
10
+ end
11
+ end
@@ -0,0 +1,26 @@
1
+ class RemoveKatelloFromNotificationName < ActiveRecord::Migration
2
+ class FakeMailNotification < ActiveRecord::Base
3
+ self.table_name = 'mail_notifications'
4
+ end
5
+
6
+ def up
7
+ FakeMailNotification.all.each do |notification|
8
+ if notification_names.keys.include?(notification.name)
9
+ new_name = notification_names[notification.name]
10
+ FakeMailNotification.where(:name => new_name).destroy_all
11
+ notification.name = new_name
12
+ notification.save!
13
+ end
14
+ end
15
+ end
16
+
17
+ private
18
+
19
+ def notification_names
20
+ {
21
+ :katello_promote_errata => 'promote_errata',
22
+ :katello_sync_errata => 'sync_errata',
23
+ :katello_host_advisory => 'host_errata_advisory'
24
+ }.with_indifferent_access
25
+ end
26
+ end
@@ -16,7 +16,8 @@ end
16
16
  templates = [{:name => "Katello Kickstart Default", :source => "kickstart-katello.erb", :template_kind => kinds[:provision]},
17
17
  {:name => "Katello Kickstart Default User Data", :source => "userdata-katello.erb", :template_kind => kinds[:user_data]},
18
18
  {:name => "Katello Kickstart Default Finish", :source => "finish-katello.erb", :template_kind => kinds[:finish]},
19
- {:name => "subscription_manager_registration", :source => "snippets/_subscription_manager_registration.erb", :snippet => true}]
19
+ {:name => "subscription_manager_registration", :source => "snippets/_subscription_manager_registration.erb", :snippet => true},
20
+ {:name => "Katello Atomic Kickstart Default", :source => "kickstart-katello-atomic.erb", :template_kind => kinds[:provision]}]
20
21
 
21
22
  templates.each do |template|
22
23
  template[:template] = File.read(File.join(Katello::Engine.root, "app/views/foreman/unattended", template.delete(:source)))
@@ -29,6 +30,7 @@ templates.each do |template|
29
30
  pt.template_kind = template[:template_kind] if template[:template_kind]
30
31
  pt.snippet = template[:snippet] if template[:snippet]
31
32
  end
33
+ ProvisioningTemplate.find_by(name: template[:name]).update_attributes!(:template => template[:template])
32
34
  end
33
35
 
34
36
  # Ensure all default templates are seeded into the first org and loc
@@ -7,21 +7,21 @@
7
7
 
8
8
  # Mail Notifications
9
9
  notifications = [
10
- {:name => :katello_host_advisory,
10
+ {:name => :host_errata_advisory,
11
11
  :description => N_('A summary of available and applicable errata for your hosts'),
12
12
  :mailer => 'Katello::ErrataMailer',
13
13
  :method => 'host_errata',
14
14
  :subscription_type => 'report'
15
15
  },
16
16
 
17
- {:name => :katello_sync_errata,
17
+ {:name => :sync_errata,
18
18
  :description => N_('A summary of new errata after a repository is synchronized'),
19
19
  :mailer => 'Katello::ErrataMailer',
20
20
  :method => 'sync_errata',
21
21
  :subscription_type => 'alert'
22
22
  },
23
23
 
24
- {:name => :katello_promote_errata,
24
+ {:name => :promote_errata,
25
25
  :description => N_('A post-promotion summary of hosts with installable errata'),
26
26
  :mailer => 'Katello::ErrataMailer',
27
27
  :method => 'promote_errata',
@@ -0,0 +1,11 @@
1
+ # This file should contain all the record creation needed to seed the database with its default values.
2
+ # The data can then be loaded with the rake db:seed (or created alongside the db with db:setup).
3
+ #
4
+ # !!! PLEASE KEEP THIS SCRIPT IDEMPOTENT !!!
5
+ #
6
+
7
+ ::User.current = ::User.anonymous_api_admin
8
+ os_attributes = {:major => "7", :minor => "2", :name => ::Operatingsystem::REDHAT_ATOMIC_HOST_OS}
9
+ Operatingsystem.where(os_attributes).first_or_create!
10
+
11
+ ::User.current = nil
@@ -6,7 +6,7 @@ angular.module('Bastion.activation-keys').filter('activationKeyConsumedFilter',
6
6
  ['$filter', 'translate',
7
7
  function ($filter, translate) {
8
8
  return function (activationKey) {
9
- var quantity = $filter('unlimitedFilter')(activationKey['max_content_hosts'], activationKey['unlimited_content_hosts']);
9
+ var quantity = $filter('unlimitedFilter')(activationKey['max_hosts'], activationKey['unlimited_hosts']);
10
10
  return translate('%(consumed)s out of %(quantity)s')
11
11
  .replace('%(consumed)s', activationKey['usage_count'])
12
12
  .replace('%(quantity)s', quantity);
@@ -3,7 +3,9 @@
3
3
  * @name Bastion.activation-keys.controller:ActivationKeyAssociationsController
4
4
  *
5
5
  * @requires $scope
6
+ * @requires $location
6
7
  * @requires translate
8
+ * @requires Nutupane
7
9
  * @requires ActivationKey
8
10
  * @requires ContentHostsHelper
9
11
  * @requires CurrentOrganization
@@ -12,21 +14,31 @@
12
14
  * Provides the functionality for activation key associations.
13
15
  */
14
16
  angular.module('Bastion.activation-keys').controller('ActivationKeyAssociationsController',
15
- ['$scope', 'translate', 'ActivationKey', 'ContentHostsHelper', 'CurrentOrganization',
16
- function ($scope, translate, ActivationKey, ContentHostsHelper, CurrentOrganization) {
17
+ ['$scope', '$location', 'translate', 'Nutupane', 'ActivationKey', 'ContentHostsHelper', 'CurrentOrganization',
18
+ function ($scope, $location, translate, Nutupane, ActivationKey, ContentHostsHelper, CurrentOrganization) {
19
+ var contentHostsNutupane, params = {
20
+ 'organization_id': CurrentOrganization,
21
+ 'search': $location.search().search || "",
22
+ 'page': 1,
23
+ 'sort_by': 'name',
24
+ 'sort_order': 'ASC',
25
+ 'paged': true
26
+ };
27
+
28
+ $scope.table.working = true;
17
29
 
18
30
  if ($scope.contentHosts) {
19
31
  $scope.table.working = false;
20
- } else {
21
- $scope.table.working = true;
22
32
  }
23
33
 
34
+ contentHostsNutupane = new Nutupane(ActivationKey, params, 'contentHosts');
35
+ contentHostsNutupane.masterOnly = true;
36
+ $scope.detailsTable = contentHostsNutupane.table;
37
+
24
38
  $scope.activationKey.$promise.then(function () {
25
- ActivationKey.contentHosts({id: $scope.activationKey.id, 'organization_id': CurrentOrganization },
26
- function (response) {
27
- $scope.contentHosts = response.results;
28
- $scope.table.working = false;
29
- });
39
+ params.id = $scope.activationKey.id;
40
+ contentHostsNutupane.setParams(params);
41
+ contentHostsNutupane.load();
30
42
  });
31
43
 
32
44
  $scope.getSubscriptionStatusColor = ContentHostsHelper.getSubscriptionStatusColor;
@@ -36,12 +36,12 @@
36
36
 
37
37
  <tbody>
38
38
  <tr bst-table-row ng-repeat-start="(name, subscriptions) in groupedSubscriptions">
39
- <td class="row-select"></td>
40
- <td bst-table-cell colspan="8">
41
- <a href='/subscriptions/{{ subscription.id }}/info'>
39
+ <td class="row-select">
40
+ <a href='/subscriptions/{{ subscription.id }}/info' class='confined-text'>
42
41
  {{ name }}
43
42
  </a>
44
43
  </td>
44
+ <td bst-table-cell colspan="8"></td>
45
45
  </tr>
46
46
  <tr bst-table-row ng-repeat-end ng-repeat="subscription in subscriptions" row-select="subscription">
47
47
  <td bst-table-cell>
@@ -1,47 +1,48 @@
1
1
  <span page-title ng-model="activationKey">{{ 'Content Hosts for Activation Key:' | translate }} {{ activationKey.name }}</span>
2
2
 
3
- <div class="nutupane">
3
+ <div data-extend-template="layouts/details-nutupane.html">
4
4
 
5
- <h3 translate>
6
- Attached to Content Hosts
7
- </h3>
5
+ <div data-block="messages"></div>
6
+ <div data-block="actions"></div>
7
+ <div data-block="selection-summary"></div>
8
8
 
9
- <div bst-alert="info" ng-show="!table.working && contentHosts.length === 0">
10
- <span translate>This activation key is not associated with any content hosts.</span>
11
- </div>
12
-
13
- <table class="table table-bordered table-striped" bst-table="table" ng-show="contentHosts.length > 0" ng-class="{'table-mask': table.working}">
14
- <thead>
15
- <tr bst-table-head>
16
- <th bst-table-column="name" sortable><span translate>Name</span></th>
17
- <th bst-table-column="status">
18
- {{ "Subscription Status" | translate }}
19
- </th>
20
- <th bst-table-column="environment" sortable><span translate>Environment</span></th>
21
- <th bst-table-column="contentView"><span translate>Content View</span></th>
22
- <th bst-table-column="serviceLevel"><span translate>Service Level</span></th>
23
- <th bst-table-column="releaseVersion"><span translate>Release Version</span></th>
24
- </tr>
25
- </thead>
9
+ <span data-block="no-rows-message" translate>
10
+ This activation key is not associated with any content hosts.
11
+ </span>
26
12
 
27
- <tbody>
28
- <tr bst-table-row ng-repeat="contentHost in contentHosts"
29
- ng-controller="ContentHostStatusController">
30
- <td bst-table-cell>
31
- <a ui-sref="content-hosts.details.info({hostId: contentHost.host_id})">
32
- {{ contentHost.name }}
33
- </a>
34
- </td>
35
- <td bst-table-cell>
36
- <span class="fa fa-circle" ng-class="getSubscriptionStatusColor(contentHost.entitlementStatus)">
37
- </span>
38
- </td>
39
- <td bst-table-cell>{{ contentHost.environment.name }}</td>
40
- <td bst-table-cell>{{ contentHost.content_view.name || "" }}</td>
41
- <td bst-table-cell>{{ contentHost.service_level }}</td>
42
- <td bst-table-cell>{{ contentHost.release_ver }}</td>
43
- </tr>
44
- </tbody>
45
- </table>
13
+ <div data-block="table">
14
+ <table class="table table-bordered table-striped" bst-table="table" ng-class="{'table-mask': detailsTable.working}">
15
+ <thead>
16
+ <tr bst-table-head>
17
+ <th bst-table-column="name" sortable><span translate>Name</span></th>
18
+ <th bst-table-column="status" translate>
19
+ Subscription Status
20
+ </th>
21
+ <th bst-table-column="environment" sortable><span translate>Environment</span></th>
22
+ <th bst-table-column="contentView"><span translate>Content View</span></th>
23
+ <th bst-table-column="serviceLevel"><span translate>Service Level</span></th>
24
+ <th bst-table-column="releaseVersion"><span translate>Release Version</span></th>
25
+ </tr>
26
+ </thead>
46
27
 
28
+ <tbody>
29
+ <tr bst-table-row ng-repeat="contentHost in detailsTable.rows"
30
+ ng-controller="ContentHostStatusController">
31
+ <td bst-table-cell>
32
+ <a ui-sref="content-hosts.details.info({hostId: contentHost.host_id})">
33
+ {{ contentHost.name }}
34
+ </a>
35
+ </td>
36
+ <td bst-table-cell>
37
+ <span class="fa fa-circle" ng-class="getSubscriptionStatusColor(contentHost.entitlementStatus)">
38
+ </span>
39
+ </td>
40
+ <td bst-table-cell>{{ contentHost.environment.name }}</td>
41
+ <td bst-table-cell>{{ contentHost.content_view.name || "" }}</td>
42
+ <td bst-table-cell>{{ contentHost.service_level }}</td>
43
+ <td bst-table-cell>{{ contentHost.release_ver }}</td>
44
+ </tr>
45
+ </tbody>
46
+ </table>
47
+ </div>
47
48
  </div>
@@ -31,7 +31,7 @@
31
31
  {{ "Close" | translate }}
32
32
  </button>
33
33
 
34
- <div bst-modal="removeActivationKey(activationKey)">
34
+ <div bst-modal="removeActivationKey(activationKey)" model="activationKey">
35
35
  <div data-block="modal-header" translate>Remove Activation Key "{{ activationKey.name }}"?</div>
36
36
  <div data-block="modal-body" translate>Are you sure you want to remove Activation Key "{{ activationKey.name }}"?</div>
37
37
  </div>
@@ -36,9 +36,9 @@
36
36
  <span class="info-label" translate>Host Limit</span>
37
37
 
38
38
  <span class="info-value"
39
- bst-edit-custom="activationKey.max_content_hosts"
39
+ bst-edit-custom="activationKey.max_hosts"
40
40
  formatter="unlimitedFilter"
41
- formatter-options="activationKey.unlimited_content_hosts"
41
+ formatter-options="activationKey.unlimited_hosts"
42
42
  readonly="denied('edit_activation_keys', activationKey)"
43
43
  on-save="save(activationKey)">
44
44
 
@@ -47,17 +47,17 @@
47
47
  <span translate>
48
48
  Unlimited Content Hosts:
49
49
  </span>
50
- <input type='checkbox' ng-model="activationKey.unlimited_content_hosts"/>
50
+ <input type='checkbox' ng-model="activationKey.unlimited_hosts"/>
51
51
  </div>
52
- <div ng-hide="activationKey.unlimited_content_hosts" >
52
+ <div ng-hide="activationKey.unlimited_hosts" >
53
53
  <span translate>
54
54
  Limit:
55
55
  </span>
56
- <input ng-model="activationKey.max_content_hosts"
57
- name="max_content_hosts"
56
+ <input ng-model="activationKey.max_hosts"
57
+ name="max_hosts"
58
58
  type="number"
59
59
  min="1"
60
- ng-required="!activationKey.unlimited_content_hosts"
60
+ ng-required="!activationKey.unlimited_hosts"
61
61
  tabindex="2"/>
62
62
  </div>
63
63
  </div>
@@ -48,12 +48,12 @@
48
48
 
49
49
  <tbody>
50
50
  <tr bst-table-row ng-repeat-start="(name, subscriptions) in groupedSubscriptions | groupedFilter: subscriptionSearch">
51
- <td class="row-select"></td>
52
- <td bst-table-cell colspan="8" >
53
- <a href='/subscriptions/{{ subscription.id }}/info'>
51
+ <td class="row-select">
52
+ <a href='/subscriptions/{{ subscription.id }}/info' class="confined-text">
54
53
  {{ name }}
55
54
  </a>
56
55
  </td>
56
+ <td bst-table-cell colspan="8" ></td>
57
57
  </tr>
58
58
  <tr bst-table-row ng-repeat-end ng-repeat="subscription in subscriptions" row-select="subscription">
59
59
  <td bst-table-cell>{{ subscription | subscriptionAttachAmountFilter }}</td>
@@ -31,7 +31,7 @@ angular.module('Bastion.activation-keys').controller('NewActivationKeyController
31
31
  }
32
32
 
33
33
  $scope.activationKey = $scope.activationKey || new ActivationKey();
34
- $scope.activationKey['unlimited_content_hosts'] = true;
34
+ $scope.activationKey['unlimited_hosts'] = true;
35
35
 
36
36
  $scope.panel = {loading: false};
37
37
  $scope.organization = CurrentOrganization;
@@ -29,18 +29,18 @@
29
29
  required/>
30
30
  </div>
31
31
 
32
- <div bst-form-group label="{{ 'Content Host Limit' | translate }}" field="max_content_hosts">
33
- <span translate>Unlimited Content Hosts:</span>
32
+ <div bst-form-group label="{{ 'Host Limit' | translate }}" field="max_hosts">
33
+ <span translate>Unlimited Hosts:</span>
34
34
  <input type="checkbox"
35
35
  name="limit"
36
- ng-model="activationKey.unlimited_content_hosts"/>
36
+ ng-model="activationKey.unlimited_hosts"/>
37
37
 
38
- <div bst-form-group label="{{ 'Limit' | translate }}" ng-hide="activationKey.unlimited_content_hosts">
39
- <input id="max_content_hosts"
40
- name="max_content_hosts"
38
+ <div bst-form-group label="{{ 'Limit' | translate }}" ng-hide="activationKey.unlimited_hosts">
39
+ <input id="max_hosts"
40
+ name="max_hosts"
41
41
  class="form-control"
42
- ng-model="activationKey.max_content_hosts"
43
- ng-required="!activationKey.unlimited_content_hosts"
42
+ ng-model="activationKey.max_hosts"
43
+ ng-required="!activationKey.unlimited_hosts"
44
44
  type="number"
45
45
  min="1"
46
46
  max="2147483648"
@@ -10,10 +10,10 @@
10
10
  angular.module('Bastion.capsule-content').config(['$stateProvider', '$urlRouterProvider', function ($stateProvider, $urlRouterProvider) {
11
11
 
12
12
  // Catch the url to prevent the router to perform redirect.
13
- $urlRouterProvider.when('/smart_proxies/:proxyId', function ($match, $stateParams) {
13
+ $urlRouterProvider.when('/smart_proxies/:proxyId', ['$match', '$stateParams', function ($match, $stateParams) {
14
14
  $stateParams.pageName = 'smart_proxies/detail';
15
15
  return true;
16
- });
16
+ }]);
17
17
 
18
18
  // Add rule to redirect links on the smart proxy detail page.
19
19
  // Changing state doesn't work there since there's no <ui-view> element there
@@ -75,14 +75,6 @@ angular.module('Bastion.content-hosts').controller('ContentHostsController',
75
75
 
76
76
  $scope.table = $scope.contentHostTable;
77
77
 
78
- $scope.unregisterContentHost = function (contentHost) {
79
- contentHost.$remove(function () {
80
- $scope.removeRow(contentHost.id);
81
- $scope.successMessages.push(translate('Content Host %s has been deleted.').replace('%s', contentHost.name));
82
- $scope.transitionTo('content-hosts.index');
83
- });
84
- };
85
-
86
78
  $scope.reloadSearch = function (search) {
87
79
  $scope.table.search(search);
88
80
  $state.go('content-hosts.index');
@@ -58,24 +58,27 @@ angular.module('Bastion.content-hosts').controller('ContentHostErrataController'
58
58
 
59
59
  $scope.setupErrataOptions = function (host) {
60
60
  var libraryString = translate("Library Synced Content"),
61
- currentEnv = translate("Current Environment (%e/%cv)").replace("%e", host.content.lifecycle_environment.name).replace("%cv", host.content.content_view_name),
61
+ currentEnv,
62
62
  previousEnv;
63
63
 
64
- $scope.errataOptions = [{name: currentEnv, label: 'current', order: 3}];
65
-
66
- if (!host.content['lifecycle_environment_library?']) {
67
- Environment.get({id: host.content.lifecycle_environment.id}).$promise.then(function (env) {
68
- previousEnv = translate("Previous Environment (%e/%cv)").replace('%e', env.prior.name).replace("%cv", host.content_view_name);
69
- $scope.errataOptions.push({name: previousEnv,
70
- label: 'prior', order: 2, 'content_view_id': host.content.content_view_id, 'environment_id': env.prior.id});
71
-
72
- });
73
- }
74
- if (!host.content['content_view_default?']) {
75
- Organization.get({id: host.organization_id}).$promise.then(function (org) {
76
- $scope.errataOptions.push({name: libraryString, label: 'library', order: 1,
77
- 'content_view_id': org.default_content_view_id, 'environment_id': org.library_id});
78
- });
64
+ if (host.hasContent()) {
65
+ currentEnv = translate("Current Environment (%e/%cv)").replace("%e", host.content.lifecycle_environment.name).replace("%cv", host.content.content_view_name);
66
+ $scope.errataOptions = [{name: currentEnv, label: 'current', order: 3}];
67
+
68
+ if (!host.content['lifecycle_environment_library?']) {
69
+ Environment.get({id: host.content.lifecycle_environment.id}).$promise.then(function (env) {
70
+ previousEnv = translate("Previous Environment (%e/%cv)").replace('%e', env.prior.name).replace("%cv", host.content_view_name);
71
+ $scope.errataOptions.push({name: previousEnv,
72
+ label: 'prior', order: 2, 'content_view_id': host.content.content_view_id, 'environment_id': env.prior.id});
73
+
74
+ });
75
+ }
76
+ if (!host.content['content_view_default?']) {
77
+ Organization.get({id: host.organization_id}).$promise.then(function (org) {
78
+ $scope.errataOptions.push({name: libraryString, label: 'library', order: 1,
79
+ 'content_view_id': org.default_content_view_id, 'environment_id': org.library_id});
80
+ });
81
+ }
79
82
  }
80
83
  };
81
84