katello 3.17.3 → 3.18.0.rc1

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.

Potentially problematic release.


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

Files changed (193) hide show
  1. checksums.yaml +4 -4
  2. data/app/controllers/katello/api/registry/registry_proxies_controller.rb +38 -21
  3. data/app/controllers/katello/api/rhsm/candlepin_proxies_controller.rb +3 -1
  4. data/app/controllers/katello/api/v2/activation_keys_controller.rb +10 -15
  5. data/app/controllers/katello/api/v2/api_controller.rb +2 -1
  6. data/app/controllers/katello/api/v2/content_credentials_controller.rb +1 -8
  7. data/app/controllers/katello/api/v2/content_view_components_controller.rb +31 -14
  8. data/app/controllers/katello/api/v2/content_view_repositories_controller.rb +1 -0
  9. data/app/controllers/katello/api/v2/content_view_versions_controller.rb +65 -36
  10. data/app/controllers/katello/api/v2/content_views_controller.rb +27 -25
  11. data/app/controllers/katello/api/v2/environments_controller.rb +8 -8
  12. data/app/controllers/katello/api/v2/gpg_keys_controller.rb +5 -5
  13. data/app/controllers/katello/api/v2/host_collections_controller.rb +19 -16
  14. data/app/controllers/katello/api/v2/hosts_bulk_actions_controller.rb +17 -0
  15. data/app/controllers/katello/api/v2/repositories_bulk_actions_controller.rb +1 -1
  16. data/app/controllers/katello/api/v2/repositories_controller.rb +8 -5
  17. data/app/controllers/katello/api/v2/subscriptions_controller.rb +1 -1
  18. data/app/controllers/katello/api/v2/sync_plans_controller.rb +8 -9
  19. data/app/controllers/katello/api/v2/upstream_subscriptions_controller.rb +9 -2
  20. data/app/controllers/katello/concerns/api/v2/authorization.rb +9 -5
  21. data/app/controllers/katello/concerns/api/v2/registration_controller_extensions.rb +21 -0
  22. data/app/controllers/katello/concerns/api/v2/repository_content_controller.rb +1 -1
  23. data/app/controllers/katello/concerns/organizations_controller_extensions.rb +2 -1
  24. data/app/helpers/katello/katello_urls_helper.rb +5 -2
  25. data/app/lib/actions/candlepin/product/content_create.rb +2 -0
  26. data/app/lib/actions/candlepin/product/content_update.rb +2 -0
  27. data/app/lib/actions/katello/applicability/hosts/bulk_generate.rb +2 -6
  28. data/app/lib/actions/katello/capsule_content/sync_capsule.rb +2 -6
  29. data/app/lib/actions/katello/content_view/publish.rb +3 -4
  30. data/app/lib/actions/katello/content_view_version/import.rb +4 -3
  31. data/app/lib/actions/katello/content_view_version/incremental_update.rb +18 -3
  32. data/app/lib/actions/katello/host/update_system_purpose.rb +31 -0
  33. data/app/lib/actions/katello/organization/manifest_delete.rb +0 -1
  34. data/app/lib/actions/katello/organization/manifest_import.rb +0 -1
  35. data/app/lib/actions/katello/organization/manifest_refresh.rb +0 -1
  36. data/app/lib/actions/katello/product/content_create.rb +7 -6
  37. data/app/lib/actions/katello/repository/filtered_index_content.rb +10 -1
  38. data/app/lib/actions/katello/repository/import_upload.rb +2 -1
  39. data/app/lib/actions/katello/repository/update.rb +4 -1
  40. data/app/lib/actions/pulp3/abstract_async_task.rb +0 -1
  41. data/app/lib/actions/pulp3/content_view/delete_repository_references.rb +1 -1
  42. data/app/lib/actions/pulp3/content_view_version/create_importer.rb +7 -3
  43. data/app/lib/actions/pulp3/content_view_version/export.rb +2 -1
  44. data/app/lib/actions/pulp3/content_view_version/import.rb +7 -3
  45. data/app/lib/actions/pulp3/orchestration/content_view_version/export.rb +15 -10
  46. data/app/lib/actions/pulp3/orchestration/content_view_version/import.rb +16 -10
  47. data/app/lib/actions/pulp3/repository/commit_upload.rb +2 -1
  48. data/app/lib/actions/pulp3/repository/delete.rb +1 -1
  49. data/app/lib/actions/pulp3/repository/save_artifact.rb +1 -1
  50. data/app/lib/katello/resources/candlepin/consumer.rb +2 -2
  51. data/app/lib/katello/resources/candlepin/owner.rb +5 -0
  52. data/app/lib/katello/resources/candlepin/upstream_consumer.rb +6 -0
  53. data/app/lib/katello/resources/registry.rb +3 -3
  54. data/app/models/katello/authorization/activation_key.rb +4 -0
  55. data/app/models/katello/authorization/content_view.rb +13 -0
  56. data/app/models/katello/authorization/content_view_component.rb +15 -0
  57. data/app/models/katello/authorization/gpg_key.rb +12 -4
  58. data/app/models/katello/authorization/lifecycle_environment.rb +8 -0
  59. data/app/models/katello/authorization/sync_plan.rb +16 -0
  60. data/app/models/katello/concerns/organization_extensions.rb +4 -5
  61. data/app/models/katello/concerns/redhat_extensions.rb +2 -2
  62. data/app/models/katello/concerns/smart_proxy_extensions.rb +1 -3
  63. data/app/models/katello/content_view_component.rb +2 -0
  64. data/app/models/katello/content_view_version_export_history.rb +2 -0
  65. data/app/models/katello/glue/candlepin/pool.rb +9 -14
  66. data/app/models/katello/glue/pulp/repo.rb +8 -0
  67. data/app/models/katello/gpg_key.rb +1 -1
  68. data/app/models/katello/root_repository.rb +26 -1
  69. data/app/services/katello/applicability/applicable_content_helper.rb +1 -12
  70. data/app/services/katello/candlepin/event_handler.rb +2 -0
  71. data/app/services/katello/candlepin/message_handler.rb +34 -0
  72. data/app/services/katello/candlepin/upstream_consumer.rb +28 -0
  73. data/app/services/katello/host_status_manager.rb +9 -0
  74. data/app/services/katello/pulp3/api/apt.rb +57 -0
  75. data/app/services/katello/pulp3/api/core.rb +8 -0
  76. data/app/services/katello/pulp3/content_view_version/export.rb +4 -3
  77. data/app/services/katello/pulp3/content_view_version/import.rb +5 -15
  78. data/app/services/katello/pulp3/deb.rb +38 -0
  79. data/app/services/katello/pulp3/erratum.rb +1 -2
  80. data/app/services/katello/pulp3/pulp_content_unit.rb +5 -0
  81. data/app/services/katello/pulp3/repository/ansible_collection.rb +9 -0
  82. data/app/services/katello/pulp3/repository/apt.rb +63 -0
  83. data/app/services/katello/pulp3/repository/docker.rb +4 -0
  84. data/app/services/katello/pulp3/repository/yum.rb +2 -1
  85. data/app/services/katello/pulp3/repository.rb +11 -9
  86. data/app/services/katello/pulp3/repository_mirror.rb +9 -4
  87. data/app/services/katello/pulp3/task.rb +3 -3
  88. data/app/services/katello/pulp3/task_group.rb +0 -6
  89. data/app/views/dashboard/_subscription_widget.html.erb +0 -5
  90. data/app/views/katello/api/v2/content_view_version_export_histories/show.json.rabl +1 -1
  91. data/app/views/katello/api/v2/repositories/base.json.rabl +1 -1
  92. data/app/views/overrides/organizations/_index_row_override.html.erb +1 -1
  93. data/config/routes/api/v2.rb +2 -0
  94. data/config/routes/overrides.rb +1 -0
  95. data/db/migrate/20150930183738_migrate_content_hosts.rb +1 -1
  96. data/db/migrate/20200514092553_move_katello_fields_from_hostgroups.katello.rb +2 -5
  97. data/db/migrate/20201008204114_add_os_versions_to_katello_root_repositories.rb +5 -0
  98. data/db/migrate/20201012172713_remove_gpg_key_perms.rb +23 -0
  99. data/db/migrate/20201012192035_add_metadata_to_katello_content_view_version_export_history.rb +5 -0
  100. data/db/seeds.d/111-upgrade_tasks.rb +2 -1
  101. data/engines/bastion/app/assets/javascripts/bastion/components/notification.service.js +1 -1
  102. data/engines/bastion/app/assets/javascripts/bastion/components/nutupane.factory.js +8 -13
  103. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/common/views/katello-agent-notice.html +1 -1
  104. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-hosts/bulk/content-hosts-bulk-system-purpose-modal.controller.js +112 -0
  105. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-hosts/bulk/views/content-hosts-bulk-system-purpose-modal.html +78 -0
  106. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-hosts/content/content-host-debs-installed.controller.js +2 -42
  107. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-hosts/content-host-modal-helper.service.js +11 -0
  108. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-hosts/content-hosts.controller.js +5 -0
  109. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-hosts/views/content-hosts.html +4 -0
  110. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-hosts/views/register-client.html +1 -1
  111. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/host-collections/details/host-collection-details.controller.js +4 -0
  112. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/host-collections/details/views/host-collection-info.html +6 -0
  113. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/hosts/host-bulk-action.factory.js +2 -1
  114. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/i18n/bastion_katello.pot +16 -14
  115. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/products/bulk/products-bulk-advanced-sync-modal.controller.js +6 -7
  116. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/products/details/repositories/details/repository-details-info.controller.js +168 -155
  117. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/products/details/repositories/details/views/repository-info.html +17 -2
  118. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/products/details/repositories/new/new-repository.controller.js +125 -113
  119. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/products/details/repositories/new/views/new-repository.html +15 -3
  120. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/products/details/repositories/os-versions.service.js +46 -0
  121. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/subscriptions/views/content-access-mode-banner.html +1 -1
  122. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/sync-plans/details/views/sync-plan-details.html +1 -1
  123. data/lib/katello/engine.rb +1 -0
  124. data/lib/katello/permission_creator.rb +68 -59
  125. data/lib/katello/permissions/host_permissions.rb +1 -0
  126. data/lib/katello/plugin.rb +4 -1
  127. data/lib/katello/repository_types/deb.rb +9 -1
  128. data/lib/katello/tasks/pulp3_content_switchover.rake +1 -3
  129. data/lib/katello/tasks/pulp3_migration_stats.rake +21 -0
  130. data/lib/katello/tasks/reports.rake +1 -4
  131. data/lib/katello/tasks/reset.rake +2 -1
  132. data/lib/katello/tasks/upgrades/3.18/add_cvv_export_history_metadata.rb +18 -0
  133. data/lib/katello/version.rb +1 -1
  134. data/locale/action_names.rb +54 -47
  135. data/locale/bn/katello.po +165 -26
  136. data/locale/cs/katello.po +164 -24
  137. data/locale/de/katello.po +165 -26
  138. data/locale/en/katello.po +164 -23
  139. data/locale/es/katello.po +165 -25
  140. data/locale/fr/katello.po +165 -25
  141. data/locale/gu/katello.po +165 -26
  142. data/locale/hi/katello.po +165 -26
  143. data/locale/it/katello.po +165 -25
  144. data/locale/ja/katello.po +165 -26
  145. data/locale/katello.pot +1036 -802
  146. data/locale/kn/katello.po +165 -26
  147. data/locale/ko/katello.po +165 -25
  148. data/locale/mr/katello.po +165 -26
  149. data/locale/or/katello.po +165 -26
  150. data/locale/pa/katello.po +165 -26
  151. data/locale/pt/katello.po +164 -23
  152. data/locale/pt_BR/katello.po +165 -25
  153. data/locale/ru/katello.po +165 -25
  154. data/locale/ta/katello.po +165 -26
  155. data/locale/te/katello.po +165 -26
  156. data/locale/zh_CN/katello.po +165 -25
  157. data/locale/zh_TW/katello.po +165 -26
  158. data/webpack/components/ActionableDetail.js +2 -1
  159. data/webpack/components/Search/Search.js +1 -1
  160. data/webpack/components/Table/MainTable.js +6 -2
  161. data/webpack/components/Table/TableWrapper.js +46 -9
  162. data/webpack/scenes/ContentViews/ContentViewSelectors.js +7 -3
  163. data/webpack/scenes/ContentViews/ContentViewsConstants.js +8 -0
  164. data/webpack/scenes/ContentViews/ContentViewsPage.js +2 -9
  165. data/webpack/scenes/ContentViews/Details/ContentViewDetailActions.js +25 -3
  166. data/webpack/scenes/ContentViews/Details/ContentViewDetailSelectors.js +14 -4
  167. data/webpack/scenes/ContentViews/Details/ContentViewDetails.js +2 -1
  168. data/webpack/scenes/ContentViews/Details/Repositories/ContentCounts.js +56 -0
  169. data/webpack/scenes/ContentViews/Details/Repositories/ContentViewRepositories.js +169 -0
  170. data/webpack/scenes/ContentViews/Details/Repositories/LastSync.js +47 -0
  171. data/webpack/scenes/ContentViews/Details/Repositories/RepoAddedStatus.js +17 -0
  172. data/webpack/scenes/ContentViews/Details/Repositories/RepoIcon.js +23 -0
  173. data/webpack/scenes/ContentViews/Details/Repositories/SelectableDropdown.js +49 -0
  174. data/webpack/scenes/ContentViews/Details/Repositories/__tests__/contentViewDetailRepos.fixtures.json +154 -0
  175. data/webpack/scenes/ContentViews/Details/Repositories/__tests__/contentViewDetailRepos.test.js +131 -0
  176. data/webpack/scenes/ContentViews/Details/__tests__/contentViewDetail.test.js +3 -0
  177. data/webpack/scenes/ContentViews/Table/ContentViewsTable.js +4 -1
  178. data/webpack/scenes/ContentViews/__tests__/contentViewPage.test.js +2 -2
  179. data/webpack/scenes/Subscriptions/Manifest/ManageManifestModal.js +16 -8
  180. data/webpack/scenes/Subscriptions/Manifest/ManifestActions.js +17 -0
  181. data/webpack/scenes/Subscriptions/Manifest/ManifestConstants.js +4 -0
  182. data/webpack/scenes/Subscriptions/Manifest/SimpleContentAccess.js +19 -2
  183. data/webpack/scenes/Subscriptions/Manifest/__tests__/SimpleContentAccess.test.js +9 -1
  184. data/webpack/scenes/Subscriptions/Manifest/index.js +2 -1
  185. data/webpack/scenes/Subscriptions/SubscriptionConstants.js +1 -1
  186. data/webpack/scenes/Subscriptions/SubscriptionReducer.js +3 -0
  187. data/webpack/scenes/Subscriptions/SubscriptionsPage.js +8 -2
  188. data/webpack/scenes/Subscriptions/SubscriptionsSelectors.js +3 -0
  189. data/webpack/scenes/Subscriptions/__tests__/SubscriptionsPage.test.js +3 -0
  190. data/webpack/scenes/Subscriptions/__tests__/SubscriptionsSelectors.test.js +6 -0
  191. data/webpack/scenes/Subscriptions/__tests__/__snapshots__/SubscriptionsSelectors.test.js.snap +6 -0
  192. data/webpack/scenes/Subscriptions/components/SubscriptionsToolbar/SubscriptionsToolbar.js +1 -13
  193. metadata +69 -26
@@ -14,194 +14,207 @@
14
14
  * @requires Architecture
15
15
  * @requires YumContentUnits
16
16
  * @requires HttpProxyPolicy
17
+ * @requires OSVersions
17
18
  *
18
19
  * @description
19
20
  * Provides the functionality for the repository details info page.
20
21
  */
21
22
  angular.module('Bastion.repositories').controller('RepositoryDetailsInfoController',
22
- ['$scope', '$q', 'translate', 'Notification', 'ContentCredential', 'CurrentOrganization', 'Checksum', 'DownloadPolicy', 'YumContentUnits', 'OstreeUpstreamSyncPolicy', 'Architecture', 'HttpProxy', 'HttpProxyPolicy',
23
- function ($scope, $q, translate, Notification, ContentCredential, CurrentOrganization, Checksum, DownloadPolicy, YumContentUnits, OstreeUpstreamSyncPolicy, Architecture, HttpProxy, HttpProxyPolicy) {
24
- $scope.organization = CurrentOrganization;
23
+ ['$scope', '$q', 'translate', 'Notification', 'ContentCredential', 'CurrentOrganization', 'Checksum', 'DownloadPolicy', 'YumContentUnits', 'OstreeUpstreamSyncPolicy', 'Architecture', 'HttpProxy', 'HttpProxyPolicy', 'OSVersions',
24
+ function ($scope, $q, translate, Notification, ContentCredential, CurrentOrganization, Checksum, DownloadPolicy, YumContentUnits, OstreeUpstreamSyncPolicy, Architecture, HttpProxy, HttpProxyPolicy, OSVersions) {
25
+ $scope.organization = CurrentOrganization;
25
26
 
26
- $scope.progress = {uploading: false};
27
+ $scope.progress = {uploading: false};
27
28
 
28
- $scope.repository.$promise.then(function () {
29
- $scope.uploadURL = 'katello/api/v2/repositories/' + $scope.repository.id + '/upload_content';
30
- });
29
+ $scope.repository.$promise.then(function () {
30
+ $scope.uploadURL = 'katello/api/v2/repositories/' + $scope.repository.id + '/upload_content';
31
+ });
31
32
 
32
- $scope.gpgKeys = function () {
33
- var deferred = $q.defer();
33
+ $scope.gpgKeys = function () {
34
+ var deferred = $q.defer();
34
35
 
35
- ContentCredential.queryUnpaged(function (contentCredentials) {
36
- var results = contentCredentials.results;
36
+ ContentCredential.queryUnpaged(function (contentCredentials) {
37
+ var results = contentCredentials.results;
37
38
 
38
- results = results.filter(function(obj) {
39
- if (obj.content_type === "gpg_key") {
40
- return true;
41
- }
42
- return false;
39
+ results = results.filter(function(obj) {
40
+ if (obj.content_type === "gpg_key") {
41
+ return true;
42
+ }
43
+ return false;
44
+ });
45
+
46
+ results.unshift({id: null, name: ''});
47
+ deferred.resolve(results);
43
48
  });
44
49
 
45
- results.unshift({id: null, name: ''});
46
- deferred.resolve(results);
47
- });
50
+ return deferred.promise;
51
+ };
48
52
 
49
- return deferred.promise;
50
- };
53
+ $scope.certs = function () {
54
+ var deferred = $q.defer();
51
55
 
52
- $scope.certs = function () {
53
- var deferred = $q.defer();
56
+ ContentCredential.queryUnpaged(function (contentCredentials) {
57
+ var results = contentCredentials.results;
54
58
 
55
- ContentCredential.queryUnpaged(function (contentCredentials) {
56
- var results = contentCredentials.results;
59
+ results = results.filter(function(obj) {
60
+ if (obj.content_type === "cert") {
61
+ return true;
62
+ }
63
+ return false;
64
+ });
57
65
 
58
- results = results.filter(function(obj) {
59
- if (obj.content_type === "cert") {
60
- return true;
61
- }
62
- return false;
66
+ results.unshift({id: null, name: ''});
67
+ deferred.resolve(results);
63
68
  });
64
69
 
65
- results.unshift({id: null, name: ''});
66
- deferred.resolve(results);
67
- });
68
-
69
- return deferred.promise;
70
- };
71
-
72
- $scope.architectures = function () {
73
- var deferred = $q.defer();
74
- Architecture.queryUnpaged(function (architectures) {
75
- var results = architectures.results;
76
- results.map(function(i) {
77
- i.id = i.name;
78
- });
79
- results.unshift({
80
- id: 'noarch',
81
- name: translate('Default'),
82
- value: null
70
+ return deferred.promise;
71
+ };
72
+
73
+ $scope.architectures = function () {
74
+ var deferred = $q.defer();
75
+ Architecture.queryUnpaged(function (architectures) {
76
+ var results = architectures.results;
77
+ results.map(function(i) {
78
+ i.id = i.name;
79
+ });
80
+ results.unshift({
81
+ id: 'noarch',
82
+ name: translate('No restriction'),
83
+ value: null
84
+ });
85
+ deferred.resolve(results);
83
86
  });
84
- deferred.resolve(results);
85
- });
86
- return deferred.promise;
87
- };
87
+ return deferred.promise;
88
+ };
88
89
 
89
- $scope.save = function (repository, saveUpstreamAuth) {
90
- var deferred = $q.defer();
90
+ $scope.save = function (repository, saveUpstreamAuth) {
91
+ var deferred = $q.defer();
91
92
 
92
- if (!saveUpstreamAuth) {
93
- delete repository.upstream_username;
94
- delete repository.upstream_password;
95
- }
93
+ if (!saveUpstreamAuth) {
94
+ delete repository.upstream_username;
95
+ delete repository.upstream_password;
96
+ }
96
97
 
97
- if (!_.isEmpty(repository.commaTagsWhitelist)) {
98
- repository["docker_tags_whitelist"] = repository.commaTagsWhitelist.split(",").map(function(tag) {
99
- return tag.trim();
100
- });
101
- } else {
102
- repository["docker_tags_whitelist"] = [];
103
- }
104
-
105
- repository.$update(function (response) {
106
- deferred.resolve(response);
107
- if (!_.isEmpty(response["docker_tags_whitelist"])) {
108
- repository.commaTagsWhitelist = repository["docker_tags_whitelist"].join(", ");
98
+ if (!_.isEmpty(repository.commaTagsWhitelist)) {
99
+ repository["docker_tags_whitelist"] = repository.commaTagsWhitelist.split(",").map(function(tag) {
100
+ return tag.trim();
101
+ });
109
102
  } else {
110
- repository.commaTagsWhitelist = null;
103
+ repository["docker_tags_whitelist"] = [];
111
104
  }
112
- Notification.setSuccessMessage(translate('Repository Saved.'));
113
- }, function (response) {
114
- deferred.reject(response);
115
- _.each(response.data.errors, function (errorMessage) {
116
- Notification.setErrorMessage(translate("An error occurred saving the Repository: ") + errorMessage);
105
+ /* eslint-disable camelcase */
106
+ repository.os_versions = $scope.osVersionsParam();
107
+ repository.$update(function (response) {
108
+ deferred.resolve(response);
109
+ if (!_.isEmpty(response["docker_tags_whitelist"])) {
110
+ repository.commaTagsWhitelist = repository["docker_tags_whitelist"].join(", ");
111
+ } else {
112
+ repository.commaTagsWhitelist = null;
113
+ }
114
+ Notification.setSuccessMessage(translate('Repository Saved.'));
115
+ }, function (response) {
116
+ deferred.reject(response);
117
+ Notification.setErrorMessage(translate("An error occurred saving the Repository: ") + response.data.displayMessage);
117
118
  });
118
- });
119
119
 
120
- return deferred.promise;
121
- };
120
+ return deferred.promise;
121
+ };
122
122
 
123
- $scope.uploadContent = function (content) {
124
- var returnData, error, uploaded;
123
+ $scope.uploadContent = function (content) {
124
+ var returnData, error, uploaded;
125
125
 
126
- if (content) {
127
- try {
128
- returnData = angular.fromJson(angular.element(content).html());
129
- } catch (err) {
130
- returnData = content;
131
- }
126
+ if (content) {
127
+ try {
128
+ returnData = angular.fromJson(angular.element(content).html());
129
+ } catch (err) {
130
+ returnData = content;
131
+ }
132
+
133
+ if (!returnData) {
134
+ returnData = content;
135
+ }
132
136
 
133
- if (!returnData) {
134
- returnData = content;
137
+ if (returnData !== null && returnData.status === 'success') {
138
+ uploaded = returnData.filenames.join(', ');
139
+ Notification.setSuccessMessage(translate('Successfully uploaded content: ') + uploaded);
140
+ $scope.repository.$get();
141
+ } else {
142
+ error = returnData.displayMessage;
143
+ Notification.setErrorMessage(translate('Error during upload: ') + error);
144
+ }
145
+
146
+ $scope.progress.uploading = false;
135
147
  }
148
+ };
136
149
 
137
- if (returnData !== null && returnData.status === 'success') {
138
- uploaded = returnData.filenames.join(', ');
139
- Notification.setSuccessMessage(translate('Successfully uploaded content: ') + uploaded);
140
- $scope.repository.$get();
150
+ $scope.uploadError = function (error, content) {
151
+ if (angular.isString(content) && content.indexOf("Request Entity Too Large")) {
152
+ error = translate('File too large. Please use the CLI instead.');
141
153
  } else {
142
- error = returnData.displayMessage;
143
- Notification.setErrorMessage(translate('Error during upload: ') + error);
154
+ error = content;
144
155
  }
145
-
156
+ Notification.setErrorMessage(translate('Error during upload: ') + error);
146
157
  $scope.progress.uploading = false;
147
- }
148
- };
149
-
150
- $scope.uploadError = function (error, content) {
151
- if (angular.isString(content) && content.indexOf("Request Entity Too Large")) {
152
- error = translate('File too large. Please use the CLI instead.');
153
- } else {
154
- error = content;
155
- }
156
- Notification.setErrorMessage(translate('Error during upload: ') + error);
157
- $scope.progress.uploading = false;
158
- };
159
-
160
- $scope.handleFiles = function (element) {
161
- var reader = new FileReader();
162
- $scope.uploadedFile = true;
163
- reader.addEventListener("loadend", function() {
164
- var data = reader.result;
165
- /* eslint-disable camelcase */
166
- $scope.repository.ansible_collection_requirements = data;
167
- $scope.$apply();
158
+ };
159
+
160
+ $scope.handleFiles = function (element) {
161
+ var reader = new FileReader();
162
+ $scope.uploadedFile = true;
163
+ reader.addEventListener("loadend", function() {
164
+ var data = reader.result;
165
+ $scope.repository.ansible_collection_requirements = data;
166
+ $scope.$apply();
167
+ });
168
+ reader.readAsText(element.files[0]);
169
+ };
170
+
171
+ $scope.checksums = Checksum.checksums;
172
+ $scope.downloadPolicies = DownloadPolicy.downloadPolicies;
173
+ $scope.ostreeUpstreamSyncPolicies = OstreeUpstreamSyncPolicy.syncPolicies;
174
+ $scope.ignorableYumContentUnits = YumContentUnits.units;
175
+
176
+ $scope.checksumTypeDisplay = function (checksum) {
177
+ return Checksum.checksumType(checksum);
178
+ };
179
+
180
+ $scope.downloadPolicyDisplay = function (downloadPolicy) {
181
+ return DownloadPolicy.downloadPolicyName(downloadPolicy);
182
+ };
183
+
184
+ $scope.clearUpstreamAuth = function () {
185
+ $scope.repository['upstream_password'] = null;
186
+ $scope.repository['upstream_auth_exists'] = false;
187
+ $scope.repository['upstream_username'] = null;
188
+ $scope.save($scope.repository);
189
+ };
190
+
191
+ $scope.policies = HttpProxyPolicy.policies;
192
+ $scope.proxies = [];
193
+
194
+ $scope.displayHttpProxyPolicyName = function (policy) {
195
+ return HttpProxyPolicy.displayHttpProxyPolicyName(policy);
196
+ };
197
+
198
+ $scope.displayHttpProxyName = function (proxyId) {
199
+ return HttpProxyPolicy.displayHttpProxyName($scope.proxies, proxyId);
200
+ };
201
+
202
+ $scope.osVersionsOptions = function () {
203
+ $scope.selectedOSVersion = $scope.formatOSVersions();
204
+ return OSVersions.getOSVersionsOptions();
205
+ };
206
+
207
+ $scope.formatOSVersions = function () {
208
+ return OSVersions.formatOSVersions($scope.repository.os_versions);
209
+ };
210
+
211
+ $scope.osVersionsParam = function () {
212
+ return OSVersions.osVersionsParam($scope.selectedOSVersion);
213
+ };
214
+
215
+ HttpProxy.queryUnpaged(function (proxies) {
216
+ $scope.proxies = proxies.results;
168
217
  });
169
- reader.readAsText(element.files[0]);
170
- };
171
-
172
- $scope.checksums = Checksum.checksums;
173
- $scope.downloadPolicies = DownloadPolicy.downloadPolicies;
174
- $scope.ostreeUpstreamSyncPolicies = OstreeUpstreamSyncPolicy.syncPolicies;
175
- $scope.ignorableYumContentUnits = YumContentUnits.units;
176
-
177
- $scope.checksumTypeDisplay = function (checksum) {
178
- return Checksum.checksumType(checksum);
179
- };
180
-
181
- $scope.downloadPolicyDisplay = function (downloadPolicy) {
182
- return DownloadPolicy.downloadPolicyName(downloadPolicy);
183
- };
184
-
185
- $scope.clearUpstreamAuth = function () {
186
- $scope.repository['upstream_password'] = null;
187
- $scope.repository['upstream_auth_exists'] = false;
188
- $scope.repository['upstream_username'] = null;
189
- $scope.save($scope.repository);
190
- };
191
-
192
- $scope.policies = HttpProxyPolicy.policies;
193
- $scope.proxies = [];
194
-
195
- $scope.displayHttpProxyPolicyName = function (policy) {
196
- return HttpProxyPolicy.displayHttpProxyPolicyName(policy);
197
- };
198
-
199
- $scope.displayHttpProxyName = function (proxyId) {
200
- return HttpProxyPolicy.displayHttpProxyName($scope.proxies, proxyId);
201
- };
202
-
203
- HttpProxy.queryUnpaged(function (proxies) {
204
- $scope.proxies = proxies.results;
205
- });
206
- }]
218
+
219
+ }]
207
220
  );
@@ -36,14 +36,29 @@
36
36
  <h4 translate>Sync Settings</h4>
37
37
  <dl class="dl-horizontal dl-horizontal-left">
38
38
  <span ng-show="repository.content_type === 'yum'" >
39
- <dt translate>Restrict to architecture</dt>
40
- <dd bst-edit-select="repository.arch==='noarch'?'Default':repository.arch"
39
+ <dt>
40
+ <span translate>Restrict to architecture</span>
41
+ <i class="pficon-info" title="{{ 'The repository will be enabled by default on content hosts with the selected architecture.' | translate }}"></i>
42
+ </dt>
43
+ <dd bst-edit-select="repository.arch==='noarch'?'No restriction':repository.arch"
41
44
  selector="repository.arch"
42
45
  options="architectures()"
43
46
  on-save="save(repository)">
44
47
  </dd>
45
48
  </span>
46
49
 
50
+ <span ng-show="repository.content_type === 'yum'" >
51
+ <dt>
52
+ <span translate>Restrict to <br />OS version</span>
53
+ <i class="pficon-info" title="{{ 'The repository will be enabled by default on content hosts with the selected OS version.' | translate }}"></i>
54
+ </dt>
55
+ <dd bst-edit-select="repository.os_versions.length ? formatOSVersions() : 'No restriction'"
56
+ selector="selectedOSVersion"
57
+ options="osVersionsOptions()"
58
+ on-save="save(repository)">
59
+ </dd>
60
+ </span>
61
+
47
62
  <dt ng-show="repository.content_type !== 'docker'" translate>Upstream URL</dt>
48
63
  <dt ng-show="repository.content_type === 'docker'" translate>Registry URL</dt>
49
64
  <dd bst-edit-text="repository.url"