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
@@ -33,7 +33,7 @@ const PublishContentViewWizard = ({
33
33
  const steps = [
34
34
  {
35
35
  id: 1,
36
- name: 'Publish',
36
+ name: __('Publish'),
37
37
  component: <CVPublishForm
38
38
  description={description}
39
39
  setDescription={setDescription}
@@ -47,11 +47,11 @@ const PublishContentViewWizard = ({
47
47
  />,
48
48
  },
49
49
  {
50
- id: 2, name: 'Review', component: <CVPublishReview details={details} userCheckedItems={userCheckedItems} show={show} />, nextButtonText: 'Finish',
50
+ id: 2, name: __('Review details'), component: <CVPublishReview details={details} userCheckedItems={userCheckedItems} show={show} />, nextButtonText: 'Finish',
51
51
  },
52
52
  {
53
53
  id: 3,
54
- name: 'Finish',
54
+ name: __('Finish'),
55
55
  component: <CVPublishFinish
56
56
  description={description}
57
57
  setDescription={setDescription}
@@ -23,9 +23,9 @@ test('Can call API and show Wizard', async (done) => {
23
23
  const { getByText } = renderWithRedux(<PublishContentViewWizard
24
24
  details={cvDetailData}
25
25
  show
26
- setIsOpen={() => {}}
26
+ setIsOpen={() => { }}
27
27
  currentStep={1}
28
- setCurrentStep={() => {}}
28
+ setCurrentStep={() => { }}
29
29
  />);
30
30
 
31
31
  await patientlyWaitFor(() => expect(getByText('Publish new version - 6.0')).toBeInTheDocument());
@@ -44,9 +44,9 @@ test('Can show Wizard and show environment paths', async (done) => {
44
44
  const { getByText, getByLabelText } = renderWithRedux(<PublishContentViewWizard
45
45
  details={cvDetailData}
46
46
  show
47
- setIsOpen={() => {}}
47
+ setIsOpen={() => { }}
48
48
  currentStep={1}
49
- setCurrentStep={() => {}}
49
+ setCurrentStep={() => { }}
50
50
  />);
51
51
 
52
52
  await patientlyWaitFor(() => expect(getByText('Publish new version - 6.0')).toBeInTheDocument());
@@ -75,9 +75,9 @@ test('Can show and hide force promotion alert', async (done) => {
75
75
  } = renderWithRedux(<PublishContentViewWizard
76
76
  details={cvDetailData}
77
77
  show
78
- setIsOpen={() => {}}
78
+ setIsOpen={() => { }}
79
79
  currentStep={1}
80
- setCurrentStep={() => {}}
80
+ setCurrentStep={() => { }}
81
81
  />);
82
82
 
83
83
  await patientlyWaitFor(() => expect(getByText('Publish new version - 6.0')).toBeInTheDocument());
@@ -95,24 +95,24 @@ test('Can show and hide force promotion alert', async (done) => {
95
95
 
96
96
  // check outOfOrderEnv
97
97
  fireEvent.click(getByLabelText(outOfOrderEnv));
98
- expect(getByText('Force Promotion')).toBeInTheDocument();
98
+ expect(getByText('Force promotion')).toBeInTheDocument();
99
99
  expect(getAllByText(outOfOrderEnv)[0].closest('a'))
100
100
  .toHaveAttribute('href', '/lifecycle_environments/5');
101
101
 
102
102
  // check outOfOrder env in 2nd path
103
103
  fireEvent.click(getByLabelText(outOfOrderEnv2));
104
- expect(getByText('Force Promotion')).toBeInTheDocument();
104
+ expect(getByText('Force promotion')).toBeInTheDocument();
105
105
  expect(getAllByText(outOfOrderEnv2)[0].closest('a'))
106
106
  .toHaveAttribute('href', '/lifecycle_environments/7');
107
107
 
108
108
  // uncheck outOfOrderEnv
109
109
  fireEvent.click(getByLabelText(outOfOrderEnv));
110
110
  fireEvent.click(getByLabelText(outOfOrderEnv2));
111
- expect(queryByText('Force Promotion')).not.toBeInTheDocument();
111
+ expect(queryByText('Force promotion')).not.toBeInTheDocument();
112
112
 
113
113
  // Check inOrderEnv
114
114
  fireEvent.click(getByLabelText(inOrderEnv));
115
- expect(queryByText('Force Promotion')).not.toBeInTheDocument();
115
+ expect(queryByText('Force promotion')).not.toBeInTheDocument();
116
116
 
117
117
  useSelectorMock.mockClear();
118
118
  assertNockRequest(scope, done);
@@ -128,9 +128,9 @@ test('Can show Wizard form and move to review', async (done) => {
128
128
  const { getByText } = renderWithRedux(<PublishContentViewWizard
129
129
  details={cvDetailData}
130
130
  show
131
- setIsOpen={() => {}}
131
+ setIsOpen={() => { }}
132
132
  currentStep={1}
133
- setCurrentStep={() => {}}
133
+ setCurrentStep={() => { }}
134
134
  />);
135
135
  const useSelectorMock = jest.spyOn(reactRedux, 'useSelector');
136
136
  useSelectorMock.mockReturnValue(environmentPathsData);
@@ -164,9 +164,9 @@ test('Can move to Finish step and publish CV', async (done) => {
164
164
  const { getByText } = renderWithRedux(<PublishContentViewWizard
165
165
  details={cvDetailData}
166
166
  show
167
- setIsOpen={() => {}}
167
+ setIsOpen={() => { }}
168
168
  currentStep={1}
169
- setCurrentStep={() => {}}
169
+ setCurrentStep={() => { }}
170
170
  />);
171
171
  const useSelectorMock = jest.spyOn(reactRedux, 'useSelector');
172
172
  useSelectorMock.mockReturnValue(environmentPathsData);
@@ -1,3 +1,9 @@
1
1
  .pf-c-switch {
2
2
  --pf-c-switch__input--focus__toggle--OutlineWidth: 0;
3
+ }
4
+
5
+ .pf-c-wizard__main-body {
6
+ display: flex;
7
+ grid-gap: 16px;
8
+ flex-direction: column;
3
9
  }
@@ -1,7 +1,7 @@
1
1
  import React, { useState, useCallback } from 'react';
2
2
  import useDeepCompareEffect from 'use-deep-compare-effect';
3
3
  import { useSelector, useDispatch } from 'react-redux';
4
- import { omit } from 'lodash';
4
+ import { omit, upperCase } from 'lodash';
5
5
  import { translate as __ } from 'foremanReact/common/I18n';
6
6
  import { STATUS } from 'foremanReact/constants';
7
7
  import { Button } from '@patternfly/react-core';
@@ -24,6 +24,7 @@ const ContentViewTable = () => {
24
24
  const status = useSelector(selectContentViewStatus);
25
25
  const error = useSelector(selectContentViewError);
26
26
  const [table, setTable] = useState({ rows: [], columns: [] });
27
+ const [sortBy, setSortBy] = useState({});
27
28
  const [rowMappingIds, setRowMappingIds] = useState([]);
28
29
  const [searchQuery, updateSearchQuery] = useState('');
29
30
  const loadingResponse = status === STATUS.PENDING;
@@ -104,12 +105,16 @@ const ContentViewTable = () => {
104
105
  setRowMappingIds(newRowMappingIds);
105
106
  setCvTableStatus(tableStatus());
106
107
  }
108
+ return () => {
109
+ // This sets the loading state so that the table doesn't flicker on return
110
+ setCvTableStatus(STATUS.PENDING);
111
+ };
107
112
  },
108
113
  [response, status, loadingResponse, setTable, setRowMappingIds,
109
114
  setCvResults, setCvTableStatus, setCurrentStep, cvResults, rowMappingIds],
110
115
  );
111
116
 
112
- const onCollapse = (event, rowId, isOpen) => {
117
+ const onCollapse = (_event, rowId, isOpen) => {
113
118
  let rows;
114
119
  if (rowId === -1) {
115
120
  rows = table.rows.map(row => ({ ...row, isOpen }));
@@ -159,11 +164,45 @@ const ContentViewTable = () => {
159
164
  ];
160
165
  };
161
166
 
162
- const additionalListeners = new Array(isPublishModalOpen);
167
+ const indexToSortVariable = (key) => {
168
+ switch (key) {
169
+ case 2:
170
+ return 'name';
171
+ default:
172
+ return undefined;
173
+ }
174
+ };
175
+
176
+ const onSort = (_event, index, direction) => {
177
+ setCvTableStatus(STATUS.PENDING);
178
+ setSortBy({ index, direction });
179
+ };
180
+
181
+ const { index: sortByIndex, direction } = sortBy;
182
+ const fetchItems = useCallback(
183
+ params =>
184
+ getContentViews({
185
+ ...params,
186
+ ...sortByIndex ? {
187
+ sort_by: indexToSortVariable(sortByIndex),
188
+ sort_order: upperCase(direction),
189
+ } : {},
190
+ }),
191
+ [sortByIndex, direction],
192
+ );
193
+
163
194
  const emptyContentTitle = __("You currently don't have any Content Views.");
164
195
  const emptyContentBody = __('A content view can be added by using the "Create content view" button above.');
165
196
  const emptySearchTitle = __('No matching content views found');
166
197
  const emptySearchBody = __('Try changing your search settings.');
198
+ const {
199
+ id,
200
+ latestVersionId,
201
+ latestVersionName,
202
+ latestVersionEnvironments,
203
+ environments,
204
+ versions,
205
+ } = actionableCvDetails;
167
206
 
168
207
  const { rows, columns } = table;
169
208
  return (
@@ -179,12 +218,14 @@ const ContentViewTable = () => {
179
218
  actionResolver,
180
219
  searchQuery,
181
220
  updateSearchQuery,
182
- additionalListeners,
221
+ fetchItems,
183
222
  }}
223
+ additionalListeners={[isPublishModalOpen, sortByIndex, direction]}
224
+ sortBy={sortBy}
225
+ onSort={onSort}
184
226
  bookmarkController="katello_content_views"
185
227
  variant={TableVariant.compact}
186
228
  status={cvTableStatus}
187
- fetchItems={useCallback(getContentViews, [])}
188
229
  onCollapse={onCollapse}
189
230
  canSelectAll={false}
190
231
  cells={columns}
@@ -210,17 +251,17 @@ const ContentViewTable = () => {
210
251
  }
211
252
  {isPromoteModalOpen &&
212
253
  <ContentViewVersionPromote
213
- cvId={actionableCvDetails.id}
214
- versionIdToPromote={actionableCvDetails.latestVersionId}
215
- versionNameToPromote={actionableCvDetails.latestVersionName}
216
- versionEnvironments={actionableCvDetails.latestVersionEnvironments}
254
+ cvId={id && Number(id)}
255
+ versionIdToPromote={latestVersionId}
256
+ versionNameToPromote={latestVersionName}
257
+ versionEnvironments={latestVersionEnvironments}
217
258
  setIsOpen={setIsPromoteModalOpen}
218
259
  />
219
260
  }
220
261
  {isDeleteModalOpen && <ContentViewDeleteWizard
221
- cvId={actionableCvDetails.id}
222
- cvEnvironments={actionableCvDetails.environments}
223
- cvVersions={actionableCvDetails.versions}
262
+ cvId={id && Number(id)}
263
+ cvEnvironments={environments}
264
+ cvVersions={versions}
224
265
  show={isDeleteModalOpen}
225
266
  setIsOpen={setIsDeleteModalOpen}
226
267
  currentStep={currentStep}
@@ -1,5 +1,5 @@
1
1
  import React from 'react';
2
- import { fitContent, expandable } from '@patternfly/react-table';
2
+ import { fitContent, expandable, sortable } from '@patternfly/react-table';
3
3
  import { Link } from 'react-router-dom';
4
4
  import { urlBuilder } from 'foremanReact/common/urlHelpers';
5
5
  import { translate as __ } from 'foremanReact/common/I18n';
@@ -12,7 +12,13 @@ import LastSync from '../Details/Repositories/LastSync';
12
12
 
13
13
  export const buildColumns = () => [
14
14
  { title: __('Type'), cellFormatters: [expandable], transforms: [fitContent] },
15
- __('Name'), __('Last published'), __('Last task'), __('Latest version'),
15
+ {
16
+ title: __('Name'),
17
+ transforms: [sortable],
18
+ },
19
+ __('Last published'),
20
+ __('Last task'),
21
+ __('Latest version'),
16
22
  ];
17
23
 
18
24
  const buildRow = (contentView) => {
@@ -22,12 +28,12 @@ const buildRow = (contentView) => {
22
28
  latest_version_environments: latestVersionEnvironments, last_task: lastTask,
23
29
  } = contentView;
24
30
  /* eslint-enable max-len */
25
- const { last_sync_words: lastSyncWords } = lastTask || {};
31
+ const { last_sync_words: lastSyncWords, started_at: startedAt } = lastTask || {};
26
32
  const row = [
27
33
  { title: <ContentViewIcon composite={composite ? true : undefined} /> },
28
34
  { title: <Link to={`${urlBuilder('content_views', '')}${id}`}>{name}</Link> },
29
35
  { title: lastPublished ? <LongDateTime date={lastPublished} showRelativeTimeTooltip /> : <InactiveText text={__('Not yet published')} /> },
30
- { title: <LastSync lastSync={lastTask} lastSyncWords={lastSyncWords} emptyMessage="N/A" /> },
36
+ { title: <LastSync startedAt={startedAt} lastSync={lastTask} lastSyncWords={lastSyncWords} emptyMessage="N/A" /> },
31
37
  {
32
38
  title: latestVersion ? <ContentViewVersionCell {...{
33
39
  id, latestVersion, latestVersionId, latestVersionEnvironments,
@@ -87,8 +93,8 @@ const buildExpandableRows = (contentViews) => {
87
93
  cvName={name}
88
94
  cvComposite={composite}
89
95
  {...{
90
- activationKeys, hosts, relatedCVCount, relatedCompositeCVs,
91
- }}
96
+ activationKeys, hosts, relatedCVCount, relatedCompositeCVs,
97
+ }}
92
98
  />,
93
99
  props: {
94
100
  colSpan: 2,
@@ -355,9 +355,9 @@ test('Displays Create Content View and opens modal with Form', async () => {
355
355
  expect(queryByText('Label')).not.toBeInTheDocument();
356
356
  expect(queryByText('Composite content view')).not.toBeInTheDocument();
357
357
  expect(queryByText('Component content view')).not.toBeInTheDocument();
358
- expect(queryByText('Solve Dependencies')).not.toBeInTheDocument();
359
- expect(queryByText('Auto Publish')).not.toBeInTheDocument();
360
- expect(queryByText('Import Only')).not.toBeInTheDocument();
358
+ expect(queryByText('Solve dependencies')).not.toBeInTheDocument();
359
+ expect(queryByText('Auto publish')).not.toBeInTheDocument();
360
+ expect(queryByText('Import only')).not.toBeInTheDocument();
361
361
 
362
362
  getByLabelText('create_content_view').click();
363
363
 
@@ -366,9 +366,9 @@ test('Displays Create Content View and opens modal with Form', async () => {
366
366
  expect(getByText('Label')).toBeInTheDocument();
367
367
  expect(getByText('Composite content view')).toBeInTheDocument();
368
368
  expect(getByText('Component content view')).toBeInTheDocument();
369
- expect(getByText('Solve Dependencies')).toBeInTheDocument();
370
- expect(queryByText('Auto Publish')).not.toBeInTheDocument();
371
- expect(getByText('Import Only')).toBeInTheDocument();
369
+ expect(getByText('Solve dependencies')).toBeInTheDocument();
370
+ expect(queryByText('Auto publish')).not.toBeInTheDocument();
371
+ expect(getByText('Import only')).toBeInTheDocument();
372
372
  });
373
373
 
374
374
  /* eslint-enable no-useless-escape */
@@ -1,18 +1,19 @@
1
1
  import React from 'react';
2
+ import { translate as __ } from 'foremanReact/common/I18n';
2
3
  import PropTypes from 'prop-types';
3
4
  import { EnterpriseIcon, RegistryIcon } from '@patternfly/react-icons';
4
5
  import './contentViewIcon.scss';
5
6
 
6
7
  const ContentViewIcon = ({ composite, count, description }) => {
7
8
  const props = {
8
- title: composite ? 'composite' : 'component',
9
- className: 'svg-icon-centered',
9
+ title: composite ? __('Composite') : __('Component'),
10
+ className: composite ? 'svg-icon-composite' : 'svg-icon-component',
10
11
  };
11
12
  return (
12
13
  <div aria-label="content_view_icon" className="svg-centered-container">
13
- {count}
14
- {composite ? <RegistryIcon {...props} /> : <EnterpriseIcon {...props} />}
15
- {description}
14
+ {count && <span className="composite-component-count">{count}</span>}
15
+ {composite ? <RegistryIcon size="md" {...props} /> : <EnterpriseIcon size="sm" {...props} />}
16
+ <span>{description}</span>
16
17
  </div>
17
18
  );
18
19
  };
@@ -18,7 +18,7 @@ const ContentViewsCounter = () => {
18
18
  <b>
19
19
  <Flex>
20
20
  <FlexItem spacer={{ default: 'spacerXs' }}>
21
- <ContentViewIcon composite={false} description={__('Component content views')} count={component || <InProgressIcon />} />
21
+ <ContentViewIcon composite={false} description={__('Component content views')} count={(component || component === 0) ? component : <InProgressIcon />} />
22
22
  </FlexItem>
23
23
  <FlexItem>
24
24
  <Tooltip
@@ -37,7 +37,7 @@ const ContentViewsCounter = () => {
37
37
  <b>
38
38
  <Flex>
39
39
  <FlexItem spacer={{ default: 'spacerXs' }}>
40
- <ContentViewIcon composite description={__('Composite content views')} count={composite || <InProgressIcon />} />
40
+ <ContentViewIcon composite description={__('Composite content views')} count={(composite || composite === 0) ? composite : <InProgressIcon />} />
41
41
  </FlexItem>
42
42
  <FlexItem>
43
43
  <Tooltip
@@ -3,7 +3,7 @@ import { useSelector } from 'react-redux';
3
3
  import { STATUS } from 'foremanReact/constants';
4
4
  import PropTypes from 'prop-types';
5
5
  import { translate as __ } from 'foremanReact/common/I18n';
6
- import { Form, FormGroup, Checkbox } from '@patternfly/react-core';
6
+ import { FormGroup, Checkbox, TextContent } from '@patternfly/react-core';
7
7
  import { selectEnvironmentPaths, selectEnvironmentPathsStatus } from './EnvironmentPathSelectors';
8
8
  import EnvironmentLabels from '../EnvironmentLabels';
9
9
  import './EnvironmentPaths.scss';
@@ -36,41 +36,40 @@ const EnvironmentPaths = ({
36
36
  /* eslint-disable react/no-array-index-key */
37
37
  return (
38
38
  <>
39
- <b
40
- style={{ marginBottom: '1em' }}
41
- >{headerText}
42
- </b>
43
- <Form style={{ marginTop: '1em' }}>{results.map((path, count) => {
44
- const {
45
- environments,
46
- } = path || {};
47
- return (
48
- <React.Fragment key={count}>
49
- <FormGroup key={`fg-${count}`} isInline fieldId="environment-checkbox-group">
50
- {environments.map(env =>
39
+ <TextContent>{headerText}</TextContent>
40
+ <div>
41
+ {results.map((path, index) => {
42
+ const {
43
+ environments,
44
+ } = path || {};
45
+ return (
46
+ <div className="env-path" key={index}>
47
+ {index === 0 && <hr />}
48
+ <FormGroup key={`fg-${index}`} isInline fieldId="environment-checkbox-group">
49
+ {environments.map(env =>
51
50
  (<Checkbox
52
51
  isChecked={(publishing && env.library) ||
53
- envCheckedInList(env, userCheckedItems) ||
54
- envCheckedInList(env, promotedEnvironments)}
52
+ envCheckedInList(env, userCheckedItems) ||
53
+ envCheckedInList(env, promotedEnvironments)}
55
54
  isDisabled={(publishing && env.library)
56
- || envCheckedInList(env, promotedEnvironments)}
57
- style={{ marginRight: '3px', marginBottom: '1px' }}
58
- className="env-labels-with-pointer"
59
- key={`${env.id}${count}`}
60
- id={`${env.id}${count}`}
55
+ || envCheckedInList(env, promotedEnvironments)}
56
+ className="env-path__labels-with-pointer"
57
+ key={`${env.id}${index}`}
58
+ id={`${env.id}${index}`}
61
59
  label={<EnvironmentLabels environments={env} />}
62
60
  aria-label={env.label}
63
61
  onChange={checked => oncheckedChange(checked, env)}
64
62
  />))}
65
- </FormGroup>
66
- <hr key={`hr${count}`} style={{ margin: '0em' }} />
67
- </React.Fragment>
68
- );
69
- })}
70
- </Form>
63
+ </FormGroup>
64
+ <hr />
65
+ </div>
66
+ );
67
+ })
68
+ /* eslint-enable react/no-array-index-key */
69
+ }
70
+ </div>
71
71
  </>
72
72
  );
73
- /* eslint-enable react/no-array-index-key */
74
73
  };
75
74
 
76
75
  EnvironmentPaths.propTypes = {
@@ -1,8 +1,20 @@
1
- .env-labels-with-pointer {
2
- &:not(:last-child):after {
3
- content: '>';
4
- margin-top: 3px;
1
+ .env-path {
2
+ .pf-c-form__group {
3
+ margin: 20px 0;
4
+ }
5
+
6
+ .env-path__labels-with-pointer {
7
+ &:not(:last-child):after {
8
+ content: '>';
9
+ margin-top: 3px;
10
+ }
11
+
12
+ display: inline-flex;
13
+ margin: 3px 1px;
14
+ align-items: center;
15
+ }
16
+
17
+ hr {
18
+ margin: 0;
5
19
  }
6
- display: inline-flex;
7
- margin-top: 3px;
8
20
  }
@@ -0,0 +1,44 @@
1
+ import React from 'react';
2
+ import PropTypes from 'prop-types';
3
+ import { Grid, TextContent, Text, TextVariants, Flex, FlexItem } from '@patternfly/react-core';
4
+
5
+ const WizardHeader = ({
6
+ title,
7
+ description,
8
+ }) => (
9
+ <Grid style={{ gridGap: '24px' }}>
10
+ {title &&
11
+ <TextContent>
12
+ <Text component={TextVariants.h2}>{title}</Text>
13
+ </TextContent>}
14
+ {description &&
15
+ <TextContent>
16
+ <Flex flex={{ default: 'inlineFlex' }}>
17
+ <FlexItem>
18
+ <TextContent>
19
+ {description}
20
+ </TextContent>
21
+ </FlexItem>
22
+ </Flex>
23
+ </TextContent>}
24
+ </Grid>
25
+ );
26
+
27
+ WizardHeader.propTypes = {
28
+ title: PropTypes.oneOfType([
29
+ PropTypes.node,
30
+ PropTypes.string,
31
+ ]),
32
+ description: PropTypes.oneOfType([
33
+ PropTypes.node,
34
+ PropTypes.string,
35
+ ]),
36
+ };
37
+
38
+ WizardHeader.defaultProps = {
39
+ title: undefined,
40
+ description: undefined,
41
+ };
42
+
43
+
44
+ export default WizardHeader;
@@ -1,9 +1,20 @@
1
1
  .svg-centered-container {
2
2
  display: flex;
3
3
  align-items: center;
4
+ align-content: center;
5
+
6
+ .composite-component-count {
7
+ min-width: 10px;
8
+ text-align: center;
9
+ }
4
10
  }
5
11
 
6
- .svg-icon-centered {
7
- margin: 0 5px;
12
+ .svg-icon-composite {
13
+ margin: 0 6px;
8
14
  display: block;
9
15
  }
16
+
17
+ .svg-icon-component {
18
+ margin: 0 9px;
19
+ display: block;
20
+ }
@@ -1,4 +1,6 @@
1
+ import { translate as __ } from 'foremanReact/common/I18n';
1
2
  import { propsToSnakeCase } from 'foremanReact/common/helpers';
3
+ import { API_OPERATIONS, put } from 'foremanReact/redux/API';
2
4
 
3
5
  import api, { orgId } from '../../services/api';
4
6
 
@@ -6,10 +8,9 @@ import {
6
8
  GET_ORGANIZATION_REQUEST,
7
9
  GET_ORGANIZATION_SUCCESS,
8
10
  GET_ORGANIZATION_FAILURE,
9
- SAVE_ORGANIZATION_REQUEST,
10
- SAVE_ORGANIZATION_SUCCESS,
11
- SAVE_ORGANIZATION_FAILURE,
11
+ UPDATE_CDN_CONFIGURATION_KEY,
12
12
  } from './OrganizationConstants';
13
+ import { getResponseErrorMsgs } from '../../utils/helpers';
13
14
 
14
15
  export const loadOrganization = (extendedParams = {}) => async (dispatch) => {
15
16
  dispatch({ type: GET_ORGANIZATION_REQUEST });
@@ -32,28 +33,25 @@ export const loadOrganization = (extendedParams = {}) => async (dispatch) => {
32
33
  }
33
34
  };
34
35
 
35
- export const saveOrganization = (extendedParams = {}) => async (dispatch) => {
36
- dispatch({ type: SAVE_ORGANIZATION_REQUEST });
36
+ const updateCdnConfigurationSuccessToast = () => __('CDN Configuration updated.');
37
+ const updateCdnConfigurationErrorToast = (error) => {
38
+ const messages = getResponseErrorMsgs(error.response);
39
+ return messages;
40
+ };
37
41
 
38
- const params = {
39
- ...{ id: orgId() },
40
- ...propsToSnakeCase(extendedParams),
41
- };
42
- try {
43
- const { data } = await api.put(`/organizations/${orgId()}`, params);
44
- const result = dispatch({
45
- type: SAVE_ORGANIZATION_SUCCESS,
46
- response: data,
47
- });
48
- // TODO: Necessary because of https://projects.theforeman.org/issues/26420
49
- dispatch(loadOrganization());
50
- return result;
51
- } catch (error) {
52
- return dispatch({
53
- type: SAVE_ORGANIZATION_FAILURE,
54
- result: error,
55
- });
56
- }
42
+ export const updateCdnConfiguration = (params) => {
43
+ const nonNullParams = Object.keys(params)
44
+ .filter(key => params[key] !== null)
45
+ .reduce((a, k) => ({ ...a, [k]: params[k] }), {});
46
+
47
+ return put({
48
+ type: API_OPERATIONS.PUT,
49
+ key: UPDATE_CDN_CONFIGURATION_KEY,
50
+ url: api.getApiUrl(`/organizations/${orgId()}/cdn_configuration`),
51
+ params: nonNullParams,
52
+ errorToast: error => updateCdnConfigurationErrorToast(error),
53
+ successToast: response => updateCdnConfigurationSuccessToast(response),
54
+ });
57
55
  };
58
56
 
59
57
  export default loadOrganization;
@@ -2,6 +2,4 @@ export const GET_ORGANIZATION_REQUEST = 'GET_ORGANIZATION_REQUEST';
2
2
  export const GET_ORGANIZATION_SUCCESS = 'GET_ORGANIZATION_SUCCESS';
3
3
  export const GET_ORGANIZATION_FAILURE = 'GET_ORGANIZATION_FAILURE';
4
4
 
5
- export const SAVE_ORGANIZATION_REQUEST = 'SAVE_ORGANIZATION_REQUEST';
6
- export const SAVE_ORGANIZATION_SUCCESS = 'SAVE_ORGANIZATION_SUCCESS';
7
- export const SAVE_ORGANIZATION_FAILURE = 'SAVE_ORGANIZATION_FAILURE';
5
+ export const UPDATE_CDN_CONFIGURATION_KEY = 'UPDATE_CDN_CONFIGURATION';
@@ -4,9 +4,6 @@ import {
4
4
  GET_ORGANIZATION_REQUEST,
5
5
  GET_ORGANIZATION_SUCCESS,
6
6
  GET_ORGANIZATION_FAILURE,
7
- SAVE_ORGANIZATION_REQUEST,
8
- SAVE_ORGANIZATION_SUCCESS,
9
- SAVE_ORGANIZATION_FAILURE,
10
7
  } from './OrganizationConstants';
11
8
 
12
9
  const initialState = Immutable({ loading: false });
@@ -14,16 +11,12 @@ const initialState = Immutable({ loading: false });
14
11
  export default (state = initialState, action) => {
15
12
  switch (action.type) {
16
13
  case GET_ORGANIZATION_REQUEST:
17
- case SAVE_ORGANIZATION_REQUEST:
18
14
  return state.set('loading', true);
19
15
 
20
16
  case GET_ORGANIZATION_SUCCESS:
21
- case SAVE_ORGANIZATION_SUCCESS: {
22
17
  return Immutable({ loading: false, ...action.response });
23
- }
24
18
 
25
19
  case GET_ORGANIZATION_FAILURE:
26
- case SAVE_ORGANIZATION_FAILURE:
27
20
  return Immutable({ error: action.error });
28
21
 
29
22
  default:
@@ -1,3 +1,13 @@
1
+ import {
2
+ selectAPIStatus,
3
+ } from 'foremanReact/redux/API/APISelectors';
4
+
5
+ import { STATUS } from 'foremanReact/constants';
6
+
7
+ import {
8
+ UPDATE_CDN_CONFIGURATION_KEY,
9
+ } from './OrganizationConstants';
10
+
1
11
  export const selectOrganizationState = state => state.katello.organization;
2
12
 
3
13
  export const selectManifestName = state =>
@@ -16,3 +26,9 @@ export const selectIsManifestImported = state =>
16
26
 
17
27
  export const selectSimpleContentAccessEnabled = state =>
18
28
  selectOrganizationState(state).simple_content_access;
29
+
30
+ export const selectCdnConfigurationUpdateStatus = state =>
31
+ selectAPIStatus(state, UPDATE_CDN_CONFIGURATION_KEY);
32
+
33
+ export const selectUpdatingCdnConfiguration = state =>
34
+ selectCdnConfigurationUpdateStatus(state) === STATUS.PENDING;