katello 4.3.0.rc1 → 4.3.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 (208) hide show
  1. checksums.yaml +4 -4
  2. data/app/controllers/katello/api/v2/api_controller.rb +4 -0
  3. data/app/controllers/katello/api/v2/host_errata_controller.rb +5 -0
  4. data/app/controllers/katello/api/v2/host_packages_controller.rb +2 -0
  5. data/app/controllers/katello/api/v2/host_tracer_controller.rb +4 -0
  6. data/app/controllers/katello/api/v2/repository_sets_controller.rb +2 -2
  7. data/app/controllers/katello/api/v2/root_controller.rb +10 -19
  8. data/app/controllers/katello/concerns/api/v2/bulk_extensions.rb +3 -13
  9. data/app/controllers/katello/remote_execution_controller.rb +1 -1
  10. data/app/lib/actions/katello/capsule_content/sync_capsule.rb +7 -5
  11. data/app/lib/actions/katello/repository/destroy.rb +3 -3
  12. data/app/lib/actions/pulp/repository/sync.rb +0 -2
  13. data/app/lib/actions/pulp3/abstract_async_task.rb +16 -4
  14. data/app/lib/katello/resources/cdn.rb +10 -1
  15. data/app/models/katello/concerns/host_managed_extensions.rb +7 -4
  16. data/app/models/katello/concerns/smart_proxy_extensions.rb +6 -2
  17. data/app/models/katello/content_view_version.rb +1 -6
  18. data/app/models/katello/glue/pulp/repo.rb +1 -2
  19. data/app/models/katello/host_tracer.rb +2 -0
  20. data/app/models/katello/repository.rb +2 -30
  21. data/app/models/katello/root_repository.rb +3 -43
  22. data/app/presenters/katello/host_package_presenter.rb +21 -0
  23. data/app/services/katello/bulk_items_helper.rb +35 -0
  24. data/app/services/katello/smart_proxy_helper.rb +10 -1
  25. data/app/views/foreman/job_templates/install_errata.erb +8 -6
  26. data/app/views/foreman/job_templates/resolve_traces.erb +4 -5
  27. data/app/views/foreman/job_templates/resolve_traces_-_katello_ansible_default.erb +3 -5
  28. data/app/views/foreman/smart_proxies/_content_sync.html.erb +7 -0
  29. data/app/views/katello/api/v2/capsule_content/sync_status.json.rabl +4 -0
  30. data/app/views/katello/api/v2/{organizations/cdn_configuration.rabl → cdn_configurations/show.json.rabl} +4 -0
  31. data/app/views/katello/api/v2/content_facet/show.json.rabl +8 -0
  32. data/app/views/katello/api/v2/content_view_filters/show.json.rabl +0 -1
  33. data/app/views/katello/api/v2/content_views/base.json.rabl +1 -1
  34. data/app/views/katello/api/v2/host_packages/base.json.rabl +2 -0
  35. data/app/views/katello/api/v2/organizations/show.json.rabl +1 -1
  36. data/app/views/katello/api/v2/repositories/show.json.rabl +0 -3
  37. data/config/routes/api/v2.rb +0 -10
  38. data/db/migrate/20211115215210_drop_ostree_branches.rb +13 -0
  39. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/bastion-katello-bootstrap.js +0 -2
  40. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/bastion_katello.js +0 -3
  41. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-views/content-views.routes.js +0 -10
  42. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-views/details/views/content-view-versions.html +0 -3
  43. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-views/versions/content-view-version-content.controller.js +0 -10
  44. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-views/versions/content-view-versions.module.js +0 -1
  45. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-views/versions/views/content-view-version.html +0 -7
  46. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/environments/content.service.js +0 -5
  47. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/environments/environments.module.js +0 -1
  48. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/environments/environments.routes.js +0 -11
  49. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/organizations/fenced-pages.service.js +1 -2
  50. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/products/details/repositories/details/repository-details-info.controller.js +2 -4
  51. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/products/details/repositories/details/repository-details-info.filter.js +0 -10
  52. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/products/details/repositories/details/views/repository-info.html +1 -1
  53. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/products/details/repositories/new/new-repository.controller.js +3 -6
  54. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/products/details/repositories/new/views/new-repository.html +4 -1
  55. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/products/details/repositories/os-versions.service.js +1 -0
  56. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/products/details/repositories/repositories.routes.js +0 -9
  57. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/products/details/repositories/views/product-repositories.html +0 -8
  58. data/engines/bastion_katello/lib/bastion_katello/engine.rb +0 -1
  59. data/lib/katello/permission_creator.rb +0 -1
  60. data/lib/katello/plugin.rb +0 -10
  61. data/lib/katello/tasks/reset.rake +2 -2
  62. data/lib/katello/version.rb +1 -1
  63. data/webpack/components/Packages/index.js +63 -0
  64. data/webpack/components/Search/Search.js +7 -1
  65. data/webpack/components/SelectAllCheckbox/index.js +2 -2
  66. data/webpack/components/Table/MainTable.scss +7 -1
  67. data/webpack/components/Table/TableHooks.js +10 -19
  68. data/webpack/components/Table/TableWrapper.js +0 -2
  69. data/webpack/components/WithOrganization/__snapshots__/withOrganization.test.js.snap +3 -3
  70. data/webpack/components/extensions/HostDetails/HostDetailsConstants.js +1 -0
  71. data/webpack/components/extensions/HostDetails/HostDetailsSelectors.js +16 -0
  72. data/webpack/components/extensions/HostDetails/HostErrata/HostErrataConstants.js +2 -0
  73. data/webpack/components/extensions/HostDetails/HostPackages/HostPackagesActions.js +11 -0
  74. data/webpack/components/extensions/HostDetails/HostPackages/HostPackagesConstants.js +2 -0
  75. data/webpack/components/extensions/HostDetails/HostPackages/HostPackagesSelectors.js +16 -0
  76. data/webpack/components/extensions/HostDetails/Tabs/ContentTab/SecondaryTabsRoutes.js +4 -0
  77. data/webpack/components/extensions/HostDetails/Tabs/ContentTab/constants.js +1 -0
  78. data/webpack/components/extensions/HostDetails/Tabs/ErrataTab.js +119 -25
  79. data/webpack/components/extensions/HostDetails/Tabs/HostTracesConstants.js +1 -0
  80. data/webpack/components/extensions/HostDetails/Tabs/PackagesTab.js +127 -0
  81. data/webpack/components/extensions/HostDetails/Tabs/PackagesTab.scss +11 -0
  82. data/webpack/components/extensions/HostDetails/Tabs/RemoteExecutionActions.js +30 -4
  83. data/webpack/components/extensions/HostDetails/Tabs/RemoteExecutionConstants.js +1 -0
  84. data/webpack/components/extensions/HostDetails/Tabs/RepositorySetsTab/RepositorySetsActions.js +73 -0
  85. data/webpack/components/extensions/HostDetails/Tabs/RepositorySetsTab/RepositorySetsConstants.js +2 -0
  86. data/webpack/components/extensions/HostDetails/Tabs/RepositorySetsTab/RepositorySetsSelectors.js +16 -0
  87. data/webpack/components/extensions/HostDetails/Tabs/RepositorySetsTab/RepositorySetsTab.js +347 -0
  88. data/webpack/components/extensions/HostDetails/Tabs/RepositorySetsTab/RepositorySetsTab.scss +7 -0
  89. data/webpack/components/extensions/HostDetails/Tabs/TracesTab.js +38 -31
  90. data/webpack/components/extensions/HostDetails/Tabs/__tests__/bookmarks.fixtures.json +12 -0
  91. data/webpack/components/extensions/HostDetails/Tabs/__tests__/contentOverrides.fixtures.json +227 -0
  92. data/webpack/components/extensions/HostDetails/Tabs/__tests__/errataTab.test.js +423 -2
  93. data/webpack/components/extensions/HostDetails/Tabs/__tests__/packages.fixtures.json +28 -0
  94. data/webpack/components/extensions/HostDetails/Tabs/__tests__/packagesTab.test.js +91 -0
  95. data/webpack/components/extensions/HostDetails/Tabs/__tests__/repositorySets.fixtures.json +120 -0
  96. data/webpack/components/extensions/HostDetails/Tabs/__tests__/repositorySetsTab.test.js +307 -0
  97. data/webpack/components/extensions/HostDetails/Tabs/__tests__/resolveErrata.fixtures.json +35 -0
  98. data/webpack/components/extensions/HostDetails/Tabs/__tests__/tracesTab.test.js +55 -9
  99. data/webpack/components/extensions/HostDetails/Tabs/customizedRexUrlHelpers.js +28 -14
  100. data/webpack/containers/Application/overrides.scss +31 -9
  101. data/webpack/global_index.js +4 -2
  102. data/webpack/redux/reducers/RedHatRepositories/enabled.fixtures.js +0 -2
  103. data/webpack/scenes/Content/ContentConfig.js +23 -7
  104. data/webpack/scenes/ContentCredentials/ContentCredentialActions.js +18 -0
  105. data/webpack/scenes/ContentCredentials/ContentCredentialConstants.js +2 -0
  106. data/webpack/scenes/ContentCredentials/ContentCredentialSelectors.js +12 -0
  107. data/webpack/scenes/ContentCredentials/__tests__/contentCredentials.fixtures.js +73 -0
  108. data/webpack/scenes/ContentViews/Copy/CopyContentViewForm.js +1 -1
  109. data/webpack/scenes/ContentViews/Create/ContentViewFormComponents.js +3 -3
  110. data/webpack/scenes/ContentViews/Create/CreateContentViewForm.js +7 -2
  111. data/webpack/scenes/ContentViews/Create/CreateContentViewForm.scss +7 -0
  112. data/webpack/scenes/ContentViews/Create/__tests__/createContentView.test.js +9 -9
  113. data/webpack/scenes/ContentViews/Delete/ContentViewDeleteWizard.js +6 -6
  114. data/webpack/scenes/ContentViews/Delete/Steps/CVDeleteEnvironmentsSelection.js +39 -37
  115. data/webpack/scenes/ContentViews/Delete/Steps/CVDeletionReview.js +35 -33
  116. data/webpack/scenes/ContentViews/Delete/__tests__/contentViewDelete.test.js +7 -5
  117. data/webpack/scenes/ContentViews/Delete/__tests__/cvVersionsData.fixtures.json +2 -6
  118. data/webpack/scenes/ContentViews/Details/ComponentContentViews/ComponentEnvironments.js +13 -14
  119. data/webpack/scenes/ContentViews/Details/ContentViewDetails.js +18 -9
  120. data/webpack/scenes/ContentViews/Details/ContentViewInfo.js +3 -2
  121. data/webpack/scenes/ContentViews/Details/Filters/Add/__tests__/cvFilterCreateResult.fixtures.json +1 -2
  122. data/webpack/scenes/ContentViews/Details/Filters/__tests__/CVRpmFilterContent.test.js +1 -1
  123. data/webpack/scenes/ContentViews/Details/Filters/__tests__/contentViewErrataByDateDetails.fixtures.json +1 -8
  124. data/webpack/scenes/ContentViews/Details/Filters/__tests__/contentViewFilterDetail.fixtures.json +1 -2
  125. data/webpack/scenes/ContentViews/Details/Filters/__tests__/contentViewFilterDetails.test.js +3 -8
  126. data/webpack/scenes/ContentViews/Details/Filters/__tests__/cvAllRepos.fixtures.json +0 -2
  127. data/webpack/scenes/ContentViews/Details/Filters/__tests__/cvErratumFilterDetails.fixtures.json +1 -2
  128. data/webpack/scenes/ContentViews/Details/Filters/__tests__/cvFilterDetailModuleAffectedRepos.fixtures.json +1 -8
  129. data/webpack/scenes/ContentViews/Details/Filters/__tests__/cvFilterDetailWithAffectedRepos.fixtures.json +1 -8
  130. data/webpack/scenes/ContentViews/Details/Filters/__tests__/cvModuleStreamFilterDetails.fixtures.json +1 -2
  131. data/webpack/scenes/ContentViews/Details/Filters/__tests__/cvPackageFilterDetail.fixtures.json +1 -3
  132. data/webpack/scenes/ContentViews/Details/Promote/ContentViewVersionPromote.js +44 -28
  133. data/webpack/scenes/ContentViews/Details/Repositories/ContentCounts.js +2 -1
  134. data/webpack/scenes/ContentViews/Details/Repositories/ContentViewRepositories.js +1 -1
  135. data/webpack/scenes/ContentViews/Details/Repositories/LastSync.js +46 -8
  136. data/webpack/scenes/ContentViews/Details/Repositories/__tests__/contentViewDetailRepos.fixtures.json +0 -2
  137. data/webpack/scenes/ContentViews/Details/Versions/ContentViewVersionContent.js +19 -3
  138. data/webpack/scenes/ContentViews/Details/Versions/ContentViewVersionEnvironments.js +2 -2
  139. data/webpack/scenes/ContentViews/Details/Versions/ContentViewVersionErrata.js +5 -3
  140. data/webpack/scenes/ContentViews/Details/Versions/ContentViewVersionErrata.scss +5 -2
  141. data/webpack/scenes/ContentViews/Details/Versions/ContentViewVersions.js +7 -4
  142. data/webpack/scenes/ContentViews/Details/Versions/Delete/RemoveSteps/CVEnvironmentSelectionForm.js +59 -53
  143. data/webpack/scenes/ContentViews/Details/Versions/Delete/RemoveSteps/CVVersionRemoveReview.js +24 -17
  144. data/webpack/scenes/ContentViews/Details/Versions/Delete/__tests__/versionsResponseData.fixtures.json +1 -4
  145. data/webpack/scenes/ContentViews/Details/Versions/VersionDetails/ContentViewVersionRepositoryCell.js +8 -3
  146. data/webpack/scenes/ContentViews/Details/Versions/VersionDetails/__tests__/ContentViewVersionComponent.fixtures.json +1 -4
  147. data/webpack/scenes/ContentViews/Details/Versions/VersionDetails/__tests__/ContentViewVersionDetails.fixtures.json +1 -2
  148. data/webpack/scenes/ContentViews/Details/Versions/VersionDetails/__tests__/ContentViewVersionDetailsCounts.fixtures.json +1 -2
  149. data/webpack/scenes/ContentViews/Details/Versions/VersionDetails/__tests__/ContentViewVersionRepositories.fixtures.json +1 -18
  150. data/webpack/scenes/ContentViews/Details/Versions/__tests__/contentViewVersions.fixtures.json +5 -5
  151. data/webpack/scenes/ContentViews/Details/Versions/__tests__/contentViewVersions.test.js +1 -0
  152. data/webpack/scenes/ContentViews/Details/Versions/__tests__/contentViewVersionsWithTask.fixtures.json +1 -3
  153. data/webpack/scenes/ContentViews/Details/contentViewInfo.scss +0 -4
  154. data/webpack/scenes/ContentViews/Publish/CVPublishForm.js +66 -53
  155. data/webpack/scenes/ContentViews/Publish/CVPublishReview.js +40 -28
  156. data/webpack/scenes/ContentViews/Publish/PublishContentViewWizard.js +3 -3
  157. data/webpack/scenes/ContentViews/Publish/__tests__/publishContentView.test.js +14 -14
  158. data/webpack/scenes/ContentViews/Publish/cvPublishForm.scss +6 -0
  159. data/webpack/scenes/ContentViews/Table/ContentViewsTable.js +53 -12
  160. data/webpack/scenes/ContentViews/Table/tableDataGenerator.js +12 -6
  161. data/webpack/scenes/ContentViews/__tests__/contentViewPage.test.js +6 -6
  162. data/webpack/scenes/ContentViews/components/ContentViewIcon.js +6 -5
  163. data/webpack/scenes/ContentViews/components/ContentViewsCounter.js +2 -2
  164. data/webpack/scenes/ContentViews/components/EnvironmentPaths/EnvironmentPaths.js +26 -27
  165. data/webpack/scenes/ContentViews/components/EnvironmentPaths/EnvironmentPaths.scss +18 -6
  166. data/webpack/scenes/ContentViews/components/WizardHeader.js +44 -0
  167. data/webpack/scenes/ContentViews/components/contentViewIcon.scss +13 -2
  168. data/webpack/scenes/Organizations/OrganizationActions.js +22 -24
  169. data/webpack/scenes/Organizations/OrganizationConstants.js +1 -3
  170. data/webpack/scenes/Organizations/OrganizationReducer.js +0 -7
  171. data/webpack/scenes/Organizations/OrganizationSelectors.js +16 -0
  172. data/webpack/scenes/Organizations/__tests__/OrganizationActions.test.js +1 -21
  173. data/webpack/scenes/Organizations/__tests__/OrganizationReducer.test.js +0 -20
  174. data/webpack/scenes/Organizations/__tests__/organizations.fixtures.js +34 -23
  175. data/webpack/scenes/Subscriptions/Manifest/ManageManifestModal.js +151 -14
  176. data/webpack/scenes/Subscriptions/Manifest/__tests__/ManageManifestModal.test.js +150 -31
  177. data/webpack/scenes/Subscriptions/Manifest/index.js +14 -3
  178. data/webpack/utils/dateTimeHelpers.js +7 -0
  179. data/webpack/utils/helpers.js +1 -1
  180. metadata +45 -43
  181. data/app/controllers/katello/api/v2/ostree_branches_controller.rb +0 -16
  182. data/app/lib/actions/pulp/repository/presenters/ostree_presenter.rb +0 -91
  183. data/app/models/katello/ostree_branch.rb +0 -12
  184. data/app/models/katello/repository_ostree_branch.rb +0 -7
  185. data/app/services/katello/pulp/ostree_branch.rb +0 -14
  186. data/app/services/katello/pulp/repository/ostree.rb +0 -48
  187. data/app/views/katello/api/v2/ostree_branches/compare.json.rabl +0 -10
  188. data/app/views/katello/api/v2/ostree_branches/index.json.rabl +0 -7
  189. data/app/views/katello/api/v2/ostree_branches/show.json.rabl +0 -5
  190. data/app/views/katello/api/v2/root/resource_list.json.rabl +0 -3
  191. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-views/versions/views/content-view-version-ostree-branches.html +0 -26
  192. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/environments/details/views/environment-ostree.html +0 -27
  193. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/ostree-branches/details/ostree-branch-repositories.controller.js +0 -77
  194. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/ostree-branches/details/ostree-branch.controller.js +0 -31
  195. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/ostree-branches/details/views/ostree-branch-info.html +0 -15
  196. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/ostree-branches/details/views/ostree-branch-repositories.html +0 -72
  197. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/ostree-branches/details/views/ostree-branch.html +0 -30
  198. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/ostree-branches/ostree-branch.factory.js +0 -27
  199. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/ostree-branches/ostree-branches.controller.js +0 -67
  200. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/ostree-branches/ostree-branches.module.js +0 -15
  201. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/ostree-branches/ostree-branches.routes.js +0 -50
  202. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/ostree-branches/views/ostree-branches.html +0 -40
  203. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/products/details/repositories/details/views/repository-manage-ostree-branches.html +0 -40
  204. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/products/details/repositories/ostree-upstream-sync-policy.service.js +0 -26
  205. data/webpack/components/extensions/HostDetails/Tabs/SubscriptionTab.js +0 -12
  206. data/webpack/scenes/Content/Details/ContentCounts.js +0 -42
  207. data/webpack/scenes/Subscriptions/Manifest/__tests__/SimpleContentAccess.test.js +0 -108
  208. data/webpack/scenes/Subscriptions/Manifest/__tests__/__snapshots__/ManageManifestModal.test.js.snap +0 -158
@@ -1,77 +0,0 @@
1
- /**
2
- * @ngdoc object
3
- * @name Bastion.ostree-branches.controller:OstreeBranchRepositoriesController
4
- *
5
- * @requires $scope
6
- * @requires $q
7
- * @requires Nutupane
8
- * @requires Repository
9
- * @requires Environment
10
- * @requires ContentView
11
- * @requires CurrentOrganization
12
- *
13
- * @description
14
- * Provides the functionality for the OSTree branch repositories page.
15
- */
16
- angular.module('Bastion.ostree-branches').controller('OstreeBranchRepositoriesController',
17
- ['$scope', '$q', 'Nutupane', 'Repository', 'Environment', 'ContentView', 'CurrentOrganization',
18
- function ($scope, $q, Nutupane, Repository, Environment, ContentView, CurrentOrganization) {
19
- var repositoriesNutupane, environment, contentView, params;
20
- params = {
21
- 'ostree_branch_id': $scope.$stateParams.branchId,
22
- 'organization_id': CurrentOrganization,
23
- 'paged': false
24
- };
25
-
26
- repositoriesNutupane = new Nutupane(Repository, params);
27
- $scope.controllerName = 'katello_repositories';
28
- $scope.table = repositoriesNutupane.table;
29
- $scope.table.initialLoad = false;
30
- repositoriesNutupane.primaryOnly = true;
31
- repositoriesNutupane.setSearchKey('repositoriesSearch');
32
-
33
- environment = Environment.queryUnpaged(function (response) {
34
- $scope.environments = response.results;
35
- $scope.environmentFilter = _.find($scope.environments, {library: true}).id;
36
- });
37
-
38
- contentView = ContentView.queryUnpaged(function (response) {
39
- $scope.contentViews = response.results;
40
- _.each($scope.contentViews, function(cv) {
41
- cv['environment_ids'] = _.map(cv.environments, 'id');
42
- });
43
- $scope.contentViewFilter = _.find($scope.contentViews, {'default': true});
44
- });
45
-
46
- $scope.table.working = true;
47
- $q.all([contentView.$promise, environment.$promise]).then(function () {
48
- $scope.filterBranches();
49
- $scope.table.working = false;
50
- });
51
-
52
- $scope.filterBranches = function () {
53
- var foundVersion, env;
54
- params['environment_id'] = $scope.environmentFilter;
55
-
56
- if ($scope.contentViewFilter) {
57
- foundVersion = _.find($scope.contentViewFilter.versions, function(version) {
58
- // Find the version belonging to the environment specified by the enviroment filter
59
- env = _.find(version.environment_ids, function(envId) {
60
- return envId === $scope.environmentFilter;
61
- });
62
-
63
- return !angular.isUndefined(env);
64
- });
65
-
66
- if (!angular.isUndefined(foundVersion)) {
67
- params['content_view_version_id'] = foundVersion.id;
68
- } else {
69
- delete params['content_view_version_id'];
70
- }
71
- }
72
-
73
- repositoriesNutupane.setParams(params);
74
- repositoriesNutupane.refresh();
75
- };
76
- }]
77
- );
@@ -1,31 +0,0 @@
1
- /**
2
- * @ngdoc object
3
- * @name Bastion.ostree-branches.controller:OstreeBranchController
4
- *
5
- * @requires $scope
6
- * @requires OstreeBranch
7
- * @requires ApiErrorHandler
8
- *
9
- * @description
10
- * Provides the functionality for the Ostree Branch action pane.
11
- */
12
- angular.module('Bastion.ostree-branches').controller('OstreeBranchController', ['$scope', 'OstreeBranch', 'ApiErrorHandler',
13
- function ($scope, OstreeBranch, ApiErrorHandler) {
14
- $scope.panel = {
15
- error: false,
16
- loading: true
17
- };
18
-
19
- if ($scope.branch) {
20
- $scope.panel.loading = false;
21
- }
22
-
23
- $scope.branch = OstreeBranch.get({id: $scope.$stateParams.branchId}, function (branch) {
24
- $scope.$broadcast('branch.loaded', branch);
25
- $scope.panel.loading = false;
26
- }, function (response) {
27
- $scope.panel.loading = false;
28
- ApiErrorHandler.handleGETRequestErrors(response, $scope);
29
- });
30
- }
31
- ]);
@@ -1,15 +0,0 @@
1
- <span page-title ng-model="branch">{{ 'OSTree Branch: ' | translate }} {{ branch.name }}</span>
2
-
3
- <div data-extend-template="layouts/two-column-details.html">
4
- <div data-block="left-column">
5
- <h4 translate>Branch Info</h4>
6
-
7
- <dl class="dl-horizontal dl-horizontal-left">
8
- <dt translate>Version</dt>
9
- <dd>{{ branch.version }}</dd>
10
-
11
- <dt translate>Commit</dt>
12
- <dd>{{ branch.commit }}</dd>
13
- </dl>
14
- </div>
15
- </div>
@@ -1,72 +0,0 @@
1
- <span page-title ng-model="branch">{{ 'OSTree Branch: ' | translate }} {{ branch.name }}</span>
2
-
3
- <h3 translate>
4
- Repositories containing branch {{ branch.name }}
5
- </h3>
6
-
7
- <div data-extend-template="layouts/partials/table.html">
8
- <div data-block="search-filter">
9
- <select class="form-control"
10
- placeholder="{{ 'Select Environment' | translate }}"
11
- ng-disabled="!environments"
12
- ng-model="environmentFilter"
13
- ng-options="e.id as e.name for e in environments"
14
- ng-change="filterBranches()">
15
- </select>
16
-
17
- <select class="form-control"
18
- placeholder="{{ 'Select Content View' | translate }}"
19
- ng-disabled="!contentViews || filteredCVs.length === 0"
20
- ng-model="contentViewFilter"
21
- ng-options="cv as cv.name for cv in filteredCVs = (contentViews | filter:{environment_ids: environmentFilter})"
22
- ng-change="filterBranches()">
23
- </select>
24
- <p class="help-block" translate ng-show="filteredCVs.length === 0">
25
- There are no Content Views in this Environment.
26
- </p>
27
- </div>
28
-
29
- <span data-block="no-rows-message" translate>
30
- No Repositories contain this Branch.
31
- </span>
32
-
33
- <div data-block="table">
34
- <table class="table table-striped table-bordered" ng-class="{'table-mask': table.working}">
35
- <thead>
36
- <tr bst-table-head>
37
- <th bst-table-column="name"><span translate>Name</span></th>
38
- <th bst-table-column="product"><span translate>Product</span></th>
39
- <th bst-table-column="lastSync"><span translate>Last Sync</span></th>
40
- </tr>
41
- </thead>
42
-
43
- <tbody>
44
- <tr bst-table-row
45
- ng-repeat="repository in table.rows">
46
- <td bst-table-cell>
47
- <a ng-href="/products/{{ repository.product.id }}/repositories/{{ repository.library_instance_id || repository.id }}">
48
- {{ repository.name }}
49
- </a>
50
- </td>
51
- <td bst-table-cell>
52
- <a ui-sref="product.repositories({productId: repository.product.id})">
53
- {{ repository.product.name }}
54
- </a>
55
- </td>
56
- <td bst-table-cell>
57
- <span ng-show="repository.url">
58
- <span ng-show="repository.last_sync == null" translate>
59
- Not Synced
60
- </span>
61
- <span ng-hide="repository.last_sync == null">
62
- <a href="/foreman_tasks/tasks/{{repository.last_sync.id}}">{{ repository.last_sync.result | capitalize}}</a>
63
- <span translate>{{ repository.last_sync_words }} ago</span>
64
- </span>
65
- </span>
66
- <span ng-hide="repository.url" translate>N/A</span>
67
- </td>
68
- </tr>
69
- </tbody>
70
- </table>
71
- </div>
72
- </div>
@@ -1,30 +0,0 @@
1
- <span page-title ng-model="branch">{{ 'OSTree Branch: ' | translate }} {{ branch.name }}</span>
2
-
3
- <div data-extend-template="layouts/details-page-with-breadcrumbs.html">
4
- <div data-block="header">
5
- {{ branch.name }}
6
- </div>
7
-
8
- <nav data-block="navigation">
9
- <ul class="nav nav-tabs">
10
- <li ng-class="{active: isState('ostree-branch.info')}">
11
- <a ui-sref="ostree-branch.info">
12
- <span translate>
13
- Details
14
- </span>
15
- </a>
16
- </li>
17
- <li ng-class="{active: isState('ostree-branch.repositories')}">
18
- <a ui-sref="ostree-branch.repositories">
19
- <span translate>
20
- Repositories
21
- </span>
22
- </a>
23
- </li>
24
- </ul>
25
- </nav>
26
-
27
- <div data-block="content">
28
- <section ui-view></section>
29
- </div>
30
- </div>
@@ -1,27 +0,0 @@
1
- (function () {
2
- 'use strict';
3
-
4
- /**
5
- * @ngdoc factory
6
- * @name Bastion.ostree-branches.factory:OstreeBranch
7
- *
8
- * @description
9
- * Provides a BastionResource for interacting with Ostree Branches
10
- */
11
- function OstreeBranch(BastionResource) {
12
- return BastionResource('katello/api/v2/ostree_branches/:id',
13
- {'id': '@id'},
14
- {
15
- autocomplete: {method: 'GET', isArray: true, params: {id: 'auto_complete_search'}}
16
- }
17
-
18
- );
19
- }
20
-
21
- angular
22
- .module('Bastion.ostree-branches')
23
- .factory('OstreeBranch', OstreeBranch);
24
-
25
- OstreeBranch.$inject = ['BastionResource'];
26
-
27
- })();
@@ -1,67 +0,0 @@
1
- /**
2
- * @ngdoc object
3
- * @name Bastion.ostree-branches.controller:OstreeBranchesController
4
- *
5
- * @requires $scope
6
- * @requires $location
7
- * @requires translate
8
- * @requires Nutupane
9
- * @requires OstreeBranch
10
- * @requires Repository
11
- * @requires CurrentOrganization
12
- *
13
- * @description
14
- * Provides the functionality specific to ostree branches for use with the Nutupane UI pattern.
15
- * Defines the columns to display and the transform function for how to generate each row
16
- * within the table.
17
- */
18
-
19
- angular.module('Bastion.ostree-branches').controller('OstreeBranchesController',
20
- ['$scope', '$location', 'translate', 'Nutupane', 'OstreeBranch', 'Repository', 'CurrentOrganization',
21
- function ($scope, $location, translate, Nutupane, OstreeBranch, Repository, CurrentOrganization) {
22
- var nutupane, params = {
23
- 'organization_id': CurrentOrganization,
24
- 'search': $location.search().search || "",
25
- 'paged': true
26
- };
27
-
28
- nutupane = $scope.nutupane = new Nutupane(OstreeBranch, params);
29
- $scope.controllerName = 'katello_ostree_branches';
30
- $scope.table = nutupane.table;
31
- $scope.removeRow = nutupane.removeRow;
32
-
33
- $scope.table.closeItem = function () {
34
- $scope.transitionTo('ostree-branches.index');
35
- };
36
-
37
- $scope.repository = {name: translate('All Repositories'), id: 'all'};
38
-
39
- Repository.queryUnpaged({'organization_id': CurrentOrganization, 'content_type': 'ostree'}, function (response) {
40
- $scope.repositories = [$scope.repository];
41
- $scope.repositories = $scope.repositories.concat(response.results);
42
-
43
- if ($location.search().repositoryId) {
44
- $scope.repository = _.find($scope.repositories, function (repository) {
45
- return repository.id === parseInt($location.search().repositoryId, 10);
46
- });
47
- }
48
- });
49
-
50
- $scope.$watch('repository', function (repository) {
51
- var nutupaneParams = nutupane.getParams();
52
-
53
- if (repository.id === 'all') {
54
- nutupaneParams['repository_id'] = null;
55
- nutupane.setParams(nutupaneParams);
56
- } else {
57
- $location.search('repositoryId', repository.id);
58
- nutupaneParams['repository_id'] = repository.id;
59
- nutupane.setParams(nutupaneParams);
60
- }
61
-
62
- if (!nutupane.table.initialLoad) {
63
- nutupane.refresh();
64
- }
65
- });
66
- }]
67
- );
@@ -1,15 +0,0 @@
1
- /**
2
- * @ngdoc module
3
- * @name Bastion.ostree-branches
4
- *
5
- * @description
6
- * Module for Ostree Branch related functionality.
7
- */
8
- angular.module('Bastion.ostree-branches', [
9
- 'ngResource',
10
- 'ui.router',
11
- 'Bastion',
12
- 'Bastion.i18n',
13
- 'Bastion.common',
14
- 'Bastion.components'
15
- ]);
@@ -1,50 +0,0 @@
1
- /**
2
- * @ngdoc object
3
- * @name Bastion.ostree-branches.config
4
- *
5
- * @requires $stateProvider
6
- *
7
- * @description
8
- * State routes defined for the ostree branches module.
9
- */
10
- angular.module('Bastion.ostree-branches').config(['$stateProvider', function ($stateProvider) {
11
- $stateProvider.state('ostree-branches', {
12
- url: '/ostree_branches',
13
- permission: ['view_products', 'view_content_views'],
14
- views: {
15
- '@': {
16
- controller: 'OstreeBranchesController',
17
- templateUrl: 'ostree-branches/views/ostree-branches.html'
18
- }
19
- },
20
- ncyBreadcrumb: {
21
- label: "{{ 'OSTree Branches' | translate }}"
22
- }
23
- })
24
- .state('ostree-branch', {
25
- abstract: true,
26
- url: '/ostree_branches/:branchId',
27
- permission: ['view_products', 'view_content_views'],
28
- controller: 'OstreeBranchController',
29
- templateUrl: 'ostree-branches/details/views/ostree-branch.html'
30
- })
31
- .state('ostree-branch.info', {
32
- url: '',
33
- permission: ['view_products', 'view_content_views'],
34
- templateUrl: 'ostree-branches/details/views/ostree-branch-info.html',
35
- ncyBreadcrumb: {
36
- label: "{{ branch.name }}",
37
- parent: 'ostree-branches'
38
- }
39
- })
40
- .state('ostree-branch.repositories', {
41
- url: '/repositories',
42
- permission: ['view_products', 'view_content_views'],
43
- controller: 'OstreeBranchRepositoriesController',
44
- templateUrl: 'ostree-branches/details/views/ostree-branch-repositories.html',
45
- ncyBreadcrumb: {
46
- label: "{{ 'Repositories' | translate }}",
47
- parent: 'ostree-branch.info'
48
- }
49
- });
50
- }]);
@@ -1,40 +0,0 @@
1
- <span page-title>{{ 'OSTree Branches' | translate }}</span>
2
-
3
- <div data-extend-template="layouts/table-with-header.html">
4
-
5
- <header data-block="header" translate>
6
- OSTree Branches
7
- </header>
8
-
9
- <div data-block="search-filter">
10
- <select class="form-control" ng-model="repository" ng-options="repository.name for (id, repository) in repositories"></select>
11
- </div>
12
-
13
- <span data-block="no-rows-message" translate>
14
- You currently don't have any OSTree Branches.
15
- </span>
16
-
17
- <div data-block="table">
18
- <table class="table table-striped table-bordered" ng-class="{'table-mask': table.working}">
19
- <thead>
20
- <tr bst-table-head>
21
- <th bst-table-column="name">{{ "Name" | translate }}</th>
22
- <th bst-table-column="version">{{ "Version" | translate }}</th>
23
- </tr>
24
- </thead>
25
-
26
- <tbody>
27
- <tr bst-table-row ng-repeat="branch in table.rows">
28
- <td bst-table-cell>
29
- <a ui-sref="ostree-branch.info({branchId: branch.id})">
30
- {{ branch.name }}
31
- </a>
32
- </td>
33
- <td bst-table-cell>
34
- {{ branch.version }}
35
- </td>
36
- </tr>
37
- </tbody>
38
- </table>
39
- </div>
40
- </div>
@@ -1,40 +0,0 @@
1
- <span page-title ng-model="repository">{{ 'Manage OSTree Branches for Repository:' | translate }} {{ repository.name }}</span>
2
-
3
- <div data-block="messages">
4
- <div bst-alert="success" ng-hide="generationTaskId === undefined">
5
- <button type="button" class="close" ng-click="clearTaskId()">&times;</button>
6
- <p translate>
7
- OSTree Branch metadata generation has been initiated in the background. Click
8
- <a ng-href="{{ taskUrl() }}">Here</a> to monitor the progress.
9
- </p>
10
- </div>
11
- </div>
12
-
13
- <div data-extend-template="layouts/partials/table.html">
14
- <div data-block="table">
15
- <table class="table table-striped table-bordered" >
16
-
17
- <thead>
18
- <tr bst-table-head>
19
- <th bst-table-column><span translate>Branch Name</span></th>
20
- <th bst-table-column><span translate>Version</span></th>
21
- <th bst-table-column><span translate>Commit</span></th>
22
- </tr>
23
- </thead>
24
-
25
- <tbody>
26
- <tr bst-table-row ng-repeat="item in table.rows">
27
- <td bst-table-cell>
28
- {{ item.name }}
29
- </td>
30
- <td bst-table-cell>
31
- {{ item.version }}
32
- </td>
33
- <td bst-table-cell>
34
- {{ item.commit }}
35
- </td>
36
- </tr>
37
- </tbody>
38
- </table>
39
- </div>
40
- </div>
@@ -1,26 +0,0 @@
1
- /**
2
- * @ngdoc service
3
- * @name Bastion.repository.service:ostreeUpstreamSyncPolicy
4
- *
5
- * @requires translate
6
- *
7
- * @description
8
- * Provides a ostree upstream syncPolicies for repositories
9
- */
10
- angular.module('Bastion.repositories').service('OstreeUpstreamSyncPolicy',
11
- ['translate', function (translate) {
12
-
13
- this.syncPolicies = {
14
- 'latest': translate('Latest Only'),
15
- 'all': translate('All History'),
16
- 'custom': translate('Custom Depth')
17
- };
18
-
19
- this.syncPolicyName = function (policy, depth) {
20
- if (policy === "custom") {
21
- return translate('Custom Depth (Currently %s)').replace('%s', depth.toString());
22
- }
23
- return this.syncPolicies[policy];
24
- };
25
- }]
26
- );
@@ -1,12 +0,0 @@
1
- import React from 'react';
2
- import EmptyPage from 'foremanReact/components/common/EmptyState/EmptyStatePattern';
3
-
4
- const SubscriptionTab = () => (
5
- <EmptyPage
6
- icon="enterprise"
7
- header="WIP Subscription"
8
- description="This is a demo for adding content to the new host details page"
9
- />
10
- );
11
-
12
- export default SubscriptionTab;
@@ -1,42 +0,0 @@
1
- import React, { Fragment } from 'react';
2
- import PropTypes from 'prop-types';
3
- import { urlBuilder } from 'foremanReact/common/urlHelpers';
4
- import ContentConfig from '../ContentConfig';
5
-
6
- const appendCount = (type, count, info, productId, repoId) => {
7
- const [repoPlural, repoSingular, link] = info;
8
- const displayName = count > 1 ? repoPlural : repoSingular;
9
- const url = urlBuilder(`products/${productId}/repositories/${repoId}/content`, '', link);
10
- const displayInfo = `${count} ${displayName}`;
11
- return (
12
- <div key={`${type}${count}`}>
13
- <a href={url}>{displayInfo}</a>
14
- </div>
15
- );
16
- };
17
-
18
- const ContentCounts = ({
19
- typeSingularLabel, productId, repoId, counts,
20
- }) => {
21
- const config = ContentConfig().find(type =>
22
- type.names.singularLabel === typeSingularLabel);
23
- const { pluralLowercase, singularLowercase, pluralLabel } = config.names;
24
- const info = [pluralLowercase, singularLowercase, pluralLabel];
25
-
26
- const allCounts = [];
27
- Object.keys(counts).forEach((type) => {
28
- const count = counts[typeSingularLabel];
29
- if (count > 0) allCounts.push(appendCount(type, count, info, productId, repoId));
30
- });
31
-
32
- return <Fragment>{allCounts}</Fragment>;
33
- };
34
-
35
- ContentCounts.propTypes = {
36
- typeSingularLabel: PropTypes.string.isRequired,
37
- productId: PropTypes.number.isRequired,
38
- repoId: PropTypes.number.isRequired,
39
- counts: PropTypes.shape({}).isRequired,
40
- };
41
-
42
- export default ContentCounts;
@@ -1,108 +0,0 @@
1
- import React from 'react';
2
- import { cleanup } from '@testing-library/react';
3
- import { renderWithRedux, fireEvent, patientlyWaitFor } from 'react-testing-lib-wrapper';
4
- import ManifestModal from '../../Manifest';
5
- import { manifestHistorySuccessState, manifestHistorySuccessResponse } from './manifest.fixtures';
6
- import { nockInstance, assertNockRequest } from '../../../../test-utils/nockWrapper';
7
- import api from '../../../../services/api';
8
-
9
- afterEach(cleanup);
10
-
11
- const noop = jest.fn();
12
- const organization = {
13
- id: 1,
14
- redhat_repository_url: 'https://redhat.com',
15
- owner_details: {
16
- upstreamConsumer: {
17
- webUrl: 'https://example.com/',
18
- },
19
- },
20
- };
21
-
22
- const defaultProps = {
23
- disableManifestActions: false,
24
- disabledReason: '',
25
- canImportManifest: true,
26
- canDeleteManifest: true,
27
- canEditOrganizations: true,
28
- upload: noop,
29
- refresh: noop,
30
- delete: noop,
31
- enableSimpleContentAccess: noop,
32
- disableSimpleContentAccess: noop,
33
- loadManifestHistory: noop,
34
- organization,
35
- loadOrganization: noop,
36
- saveOrganization: noop,
37
- taskInProgress: false,
38
- simpleContentAccess: true,
39
- manifestHistory: manifestHistorySuccessState,
40
- setModalClosed: noop,
41
- setModalOpen: noop,
42
- };
43
-
44
- const initialState = {
45
- katello: {
46
- organization: {
47
- simple_content_access: false,
48
- ...organization,
49
- },
50
- },
51
- foremanModals: {
52
- manageManifestModal: {
53
- isOpen: true,
54
- },
55
- },
56
- };
57
-
58
- const enableSimpleContetAccessPath = api.getApiUrl('/organizations/1/simple_content_access/enable');
59
- const disableSimpleContetAccessPath = api.getApiUrl('/organizations/1/simple_content_access/disable');
60
- const manifestHistoryPath = api.getApiUrl('/organizations/1/subscriptions/manifest_history');
61
-
62
- test('Enable Simple Content Access after toggle switch value to true', async (done) => {
63
- const { getByTestId } = renderWithRedux(<ManifestModal {...defaultProps} />, { initialState });
64
-
65
- const updatescope = nockInstance
66
- .put(enableSimpleContetAccessPath)
67
- .reply(202, true);
68
-
69
- const getscope = nockInstance
70
- .get(manifestHistoryPath)
71
- .query(true)
72
- .reply(200, manifestHistorySuccessResponse);
73
-
74
- const toggleButton = getByTestId('switch');
75
-
76
- await patientlyWaitFor(() => { expect(toggleButton).toBeInTheDocument(); });
77
- expect(toggleButton.checked).toEqual(false);
78
-
79
- fireEvent.click(toggleButton);
80
-
81
- assertNockRequest(getscope);
82
- assertNockRequest(updatescope, done);
83
- });
84
-
85
- test('Disable Simple Content Access after toggle switch value to false', async (done) => {
86
- initialState.katello.organization.simple_content_access = true;
87
-
88
- const updatescope = nockInstance
89
- .put(disableSimpleContetAccessPath)
90
- .reply(202, true);
91
-
92
- const getscope = nockInstance
93
- .get(manifestHistoryPath)
94
- .query(true)
95
- .reply(200, manifestHistorySuccessResponse);
96
-
97
- const { getByTestId } = renderWithRedux(<ManifestModal {...defaultProps} />, { initialState });
98
-
99
- const toggleButton = getByTestId('switch');
100
-
101
- await patientlyWaitFor(() => { expect(toggleButton).toBeInTheDocument(); });
102
- expect(toggleButton.checked).toEqual(true);
103
-
104
- fireEvent.click(toggleButton);
105
-
106
- assertNockRequest(getscope);
107
- assertNockRequest(updatescope, done);
108
- });