katello 4.3.0.rc1 → 4.3.0.rc4
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.
- checksums.yaml +4 -4
- data/app/controllers/katello/api/v2/api_controller.rb +4 -0
- data/app/controllers/katello/api/v2/capsule_content_controller.rb +11 -3
- data/app/controllers/katello/api/v2/content_uploads_controller.rb +1 -1
- data/app/controllers/katello/api/v2/generic_content_units_controller.rb +10 -4
- data/app/controllers/katello/api/v2/host_errata_controller.rb +5 -0
- data/app/controllers/katello/api/v2/host_packages_controller.rb +2 -0
- data/app/controllers/katello/api/v2/host_tracer_controller.rb +4 -0
- data/app/controllers/katello/api/v2/repositories_bulk_actions_controller.rb +8 -0
- data/app/controllers/katello/api/v2/repositories_controller.rb +35 -3
- data/app/controllers/katello/api/v2/repository_sets_controller.rb +2 -2
- data/app/controllers/katello/api/v2/root_controller.rb +10 -19
- data/app/controllers/katello/concerns/api/v2/bulk_extensions.rb +3 -13
- data/app/controllers/katello/concerns/api/v2/registration_controller_extensions.rb +1 -9
- data/app/controllers/katello/remote_execution_controller.rb +1 -1
- data/app/lib/actions/katello/capsule_content/refresh_repos.rb +1 -1
- data/app/lib/actions/katello/capsule_content/sync_capsule.rb +7 -5
- data/app/lib/actions/katello/repository/destroy.rb +3 -3
- data/app/lib/actions/katello/repository/import_upload.rb +12 -2
- data/app/lib/actions/pulp/repository/sync.rb +0 -2
- data/app/lib/actions/pulp3/abstract_async_task.rb +16 -4
- data/app/lib/actions/pulp3/capsule_content/generate_metadata.rb +5 -4
- data/app/lib/actions/pulp3/capsule_content/reclaim_space.rb +25 -0
- data/app/lib/actions/pulp3/orchestration/repository/import_repository_upload.rb +36 -0
- data/app/lib/actions/pulp3/orchestration/repository/import_upload.rb +1 -1
- data/app/lib/actions/pulp3/repository/commit_upload.rb +3 -1
- data/app/lib/actions/pulp3/repository/import_upload.rb +4 -2
- data/app/lib/actions/pulp3/repository/reclaim_space.rb +25 -0
- data/app/lib/actions/pulp3/repository/save_artifact.rb +12 -8
- data/app/lib/katello/resources/cdn.rb +10 -1
- data/app/lib/katello/resources/registry.rb +1 -1
- data/app/models/katello/concerns/host_managed_extensions.rb +7 -4
- data/app/models/katello/concerns/smart_proxy_extensions.rb +21 -9
- data/app/models/katello/content_view_version.rb +1 -6
- data/app/models/katello/glue/pulp/repo.rb +1 -2
- data/app/models/katello/host_tracer.rb +2 -0
- data/app/models/katello/pulp3/repository_reference.rb +7 -0
- data/app/models/katello/repository.rb +2 -30
- data/app/models/katello/root_repository.rb +3 -44
- data/app/models/setting/content.rb +2 -8
- data/app/presenters/katello/host_package_presenter.rb +21 -0
- data/app/services/katello/bulk_items_helper.rb +35 -0
- data/app/services/katello/pulp3/api/core.rb +16 -2
- data/app/services/katello/pulp3/content.rb +4 -2
- data/app/services/katello/pulp3/pulp_content_unit.rb +9 -3
- data/app/services/katello/pulp3/repository.rb +9 -4
- data/app/services/katello/pulp3/repository_mirror.rb +1 -1
- data/app/services/katello/repository_type.rb +2 -1
- data/app/services/katello/smart_proxy_helper.rb +10 -1
- data/app/views/foreman/job_templates/change_content_source.erb +42 -0
- data/app/views/foreman/job_templates/install_errata.erb +8 -6
- data/app/views/foreman/job_templates/resolve_traces.erb +4 -5
- data/app/views/foreman/job_templates/resolve_traces_-_katello_ansible_default.erb +3 -5
- data/app/views/foreman/smart_proxies/_content_sync.html.erb +17 -4
- data/app/views/foreman/smart_proxies/_reclaim_space.html.erb +12 -0
- data/app/views/foreman/smart_proxies/show.html.erb +4 -2
- data/app/views/katello/api/v2/capsule_content/sync_status.json.rabl +6 -0
- data/app/views/katello/api/v2/{organizations/cdn_configuration.rabl → cdn_configurations/show.json.rabl} +4 -0
- data/app/views/katello/api/v2/content_facet/show.json.rabl +8 -0
- data/app/views/katello/api/v2/content_view_filters/show.json.rabl +0 -1
- data/app/views/katello/api/v2/content_views/base.json.rabl +1 -1
- data/app/views/katello/api/v2/host_packages/base.json.rabl +2 -0
- data/app/views/katello/api/v2/organizations/show.json.rabl +1 -1
- data/app/views/katello/api/v2/repositories/show.json.rabl +0 -3
- data/config/routes/api/v2.rb +5 -10
- data/db/migrate/20210331180353_katello_pool_organization_id_not_nullable.rb +2 -0
- data/db/migrate/20211115215210_drop_ostree_branches.rb +13 -0
- data/db/migrate/20211129200124_remove_dependency_solving_algorithm_setting.rb +5 -0
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/bastion-katello-bootstrap.js +1 -2
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/bastion_katello.js +3 -3
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/capsule-content/capsule-content.controller.js +21 -1
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/capsule-content/capsule-content.factory.js +2 -1
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/capsule-content/sync-state.service.js +2 -0
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-views/content-views.routes.js +0 -10
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-views/details/views/content-view-versions.html +0 -3
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-views/versions/content-view-version-content.controller.js +0 -10
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-views/versions/content-view-versions.module.js +0 -1
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-views/versions/views/content-view-version.html +0 -7
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/environments/content.service.js +0 -5
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/environments/environments.module.js +0 -1
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/environments/environments.routes.js +0 -11
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/organizations/fenced-pages.service.js +1 -2
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/products/details/product-repositories.controller.js +14 -2
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/products/details/repositories/details/repository-details-info.controller.js +2 -4
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/products/details/repositories/details/repository-details-info.filter.js +0 -10
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/products/details/repositories/details/repository-details-reclaim-space-modal.controller.js +36 -0
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/products/details/repositories/details/repository-details.controller.js +16 -2
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/products/details/repositories/details/views/repository-details-reclaim-space-modal.html +18 -0
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/products/details/repositories/details/views/repository-details.html +13 -0
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/products/details/repositories/details/views/repository-info.html +1 -1
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/products/details/repositories/new/new-repository.controller.js +3 -6
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/products/details/repositories/new/views/new-repository.html +4 -1
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/products/details/repositories/os-versions.service.js +1 -0
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/products/details/repositories/product-repositories-reclaim-space-modal.controller.js +35 -0
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/products/details/repositories/repositories.routes.js +0 -9
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/products/details/repositories/repository.factory.js +3 -1
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/products/details/repositories/views/product-repositories-reclaim-space-modal.html +18 -0
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/products/details/repositories/views/product-repositories.html +7 -8
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/pulp-primary/pulp-primary.controller.js +35 -0
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/pulp-primary/pulp-primary.factory.js +18 -0
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/pulp-primary/pulp-primary.module.js +14 -0
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/pulp-primary/pulp-primary.routes.js +16 -0
- data/engines/bastion_katello/lib/bastion_katello/engine.rb +0 -1
- data/lib/katello/permission_creator.rb +3 -4
- data/lib/katello/plugin.rb +4 -10
- data/lib/katello/repository_types/ostree.rb +3 -1
- data/lib/katello/tasks/reset.rake +2 -2
- data/lib/katello/tasks/upgrades/4.3/fix_url_auth.rake +25 -0
- data/lib/katello/version.rb +1 -1
- data/package.json +1 -0
- data/webpack/components/AddedStatusLabel.js +2 -1
- data/webpack/components/EditableTextInput/EditableTextInput.js +76 -17
- data/webpack/components/EditableTextInput/__tests__/editableTextInput.test.js +82 -0
- data/webpack/components/EditableTextInput/editableTextInput.scss +4 -0
- data/webpack/components/Packages/index.js +63 -0
- data/webpack/components/RoutedTabs/index.js +3 -1
- data/webpack/components/Search/Search.js +7 -1
- data/webpack/components/SelectAllCheckbox/index.js +2 -2
- data/webpack/components/Table/EmptyStateMessage.js +4 -2
- data/webpack/components/Table/MainTable.scss +7 -1
- data/webpack/components/Table/TableHooks.js +10 -19
- data/webpack/components/Table/TableWrapper.js +3 -3
- data/webpack/components/WithOrganization/__snapshots__/withOrganization.test.js.snap +3 -3
- data/webpack/components/extensions/HostDetails/Cards/ContentViewDetailsCard.js +24 -30
- data/webpack/components/extensions/HostDetails/HostDetailsConstants.js +1 -0
- data/webpack/components/extensions/HostDetails/HostDetailsSelectors.js +16 -0
- data/webpack/components/extensions/HostDetails/HostErrata/HostErrataConstants.js +2 -0
- data/webpack/components/extensions/HostDetails/HostPackages/HostPackagesActions.js +11 -0
- data/webpack/components/extensions/HostDetails/HostPackages/HostPackagesConstants.js +2 -0
- data/webpack/components/extensions/HostDetails/HostPackages/HostPackagesSelectors.js +16 -0
- data/webpack/components/extensions/HostDetails/Tabs/ContentTab/SecondaryTabsRoutes.js +4 -0
- data/webpack/components/extensions/HostDetails/Tabs/ContentTab/constants.js +1 -0
- data/webpack/components/extensions/HostDetails/Tabs/ErrataTab.js +119 -25
- data/webpack/components/extensions/HostDetails/Tabs/HostTracesConstants.js +1 -0
- data/webpack/components/extensions/HostDetails/Tabs/PackagesTab.js +127 -0
- data/webpack/components/extensions/HostDetails/Tabs/PackagesTab.scss +11 -0
- data/webpack/components/extensions/HostDetails/Tabs/RemoteExecutionActions.js +30 -4
- data/webpack/components/extensions/HostDetails/Tabs/RemoteExecutionConstants.js +1 -0
- data/webpack/components/extensions/HostDetails/Tabs/RepositorySetsTab/RepositorySetsActions.js +73 -0
- data/webpack/components/extensions/HostDetails/Tabs/RepositorySetsTab/RepositorySetsConstants.js +2 -0
- data/webpack/components/extensions/HostDetails/Tabs/RepositorySetsTab/RepositorySetsSelectors.js +16 -0
- data/webpack/components/extensions/HostDetails/Tabs/RepositorySetsTab/RepositorySetsTab.js +347 -0
- data/webpack/components/extensions/HostDetails/Tabs/RepositorySetsTab/RepositorySetsTab.scss +7 -0
- data/webpack/components/extensions/HostDetails/Tabs/TracesTab.js +38 -31
- data/webpack/components/extensions/HostDetails/Tabs/__tests__/bookmarks.fixtures.json +12 -0
- data/webpack/components/extensions/HostDetails/Tabs/__tests__/contentOverrides.fixtures.json +227 -0
- data/webpack/components/extensions/HostDetails/Tabs/__tests__/errataTab.test.js +423 -2
- data/webpack/components/extensions/HostDetails/Tabs/__tests__/packages.fixtures.json +28 -0
- data/webpack/components/extensions/HostDetails/Tabs/__tests__/packagesTab.test.js +91 -0
- data/webpack/components/extensions/HostDetails/Tabs/__tests__/repositorySets.fixtures.json +120 -0
- data/webpack/components/extensions/HostDetails/Tabs/__tests__/repositorySetsTab.test.js +307 -0
- data/webpack/components/extensions/HostDetails/Tabs/__tests__/resolveErrata.fixtures.json +35 -0
- data/webpack/components/extensions/HostDetails/Tabs/__tests__/tracesTab.test.js +55 -9
- data/webpack/components/extensions/HostDetails/Tabs/customizedRexUrlHelpers.js +28 -14
- data/webpack/containers/Application/overrides.scss +31 -9
- data/webpack/global_index.js +11 -4
- data/webpack/redux/reducers/RedHatRepositories/enabled.fixtures.js +0 -2
- data/webpack/scenes/Content/ContentConfig.js +23 -7
- data/webpack/scenes/Content/Details/__tests__/contentDetail.test.js +2 -0
- data/webpack/scenes/ContentCredentials/ContentCredentialActions.js +18 -0
- data/webpack/scenes/ContentCredentials/ContentCredentialConstants.js +2 -0
- data/webpack/scenes/ContentCredentials/ContentCredentialSelectors.js +12 -0
- data/webpack/scenes/ContentCredentials/__tests__/contentCredentials.fixtures.js +73 -0
- data/webpack/scenes/ContentViews/Copy/CopyContentViewForm.js +8 -12
- data/webpack/scenes/ContentViews/Copy/CopyContentViewModal.js +1 -1
- data/webpack/scenes/ContentViews/Copy/__tests__/copyContentView.test.js +1 -1
- data/webpack/scenes/ContentViews/Create/ContentViewFormComponents.js +3 -3
- data/webpack/scenes/ContentViews/Create/CreateContentViewForm.js +7 -2
- data/webpack/scenes/ContentViews/Create/CreateContentViewForm.scss +7 -0
- data/webpack/scenes/ContentViews/Create/__tests__/createContentView.test.js +9 -9
- data/webpack/scenes/ContentViews/Delete/ContentViewDeleteWizard.js +6 -6
- data/webpack/scenes/ContentViews/Delete/Steps/CVDeleteEnvironmentsSelection.js +39 -37
- data/webpack/scenes/ContentViews/Delete/Steps/CVDeletionFinish.js +10 -4
- data/webpack/scenes/ContentViews/Delete/Steps/CVDeletionReview.js +35 -33
- data/webpack/scenes/ContentViews/Delete/__tests__/contentViewDelete.test.js +12 -7
- data/webpack/scenes/ContentViews/Delete/__tests__/cvVersionsData.fixtures.json +2 -6
- data/webpack/scenes/ContentViews/Details/ComponentContentViews/ComponentEnvironments.js +13 -14
- data/webpack/scenes/ContentViews/Details/ComponentContentViews/ContentViewComponents.js +36 -31
- data/webpack/scenes/ContentViews/Details/ContentViewDetailActions.js +8 -8
- data/webpack/scenes/ContentViews/Details/ContentViewDetails.js +108 -41
- data/webpack/scenes/ContentViews/Details/ContentViewInfo.js +3 -2
- data/webpack/scenes/ContentViews/Details/Filters/Add/CVFilterAddModal.js +2 -2
- data/webpack/scenes/ContentViews/Details/Filters/Add/__tests__/cvFilterCreateResult.fixtures.json +1 -2
- data/webpack/scenes/ContentViews/Details/Filters/AffectedRepositories/AffectedRepositoryTable.js +1 -4
- data/webpack/scenes/ContentViews/Details/Filters/CVContainerImageFilterContent.js +6 -6
- data/webpack/scenes/ContentViews/Details/Filters/CVErrataDateFilterContent.js +11 -5
- data/webpack/scenes/ContentViews/Details/Filters/CVErrataIDFilterContent.js +6 -9
- data/webpack/scenes/ContentViews/Details/Filters/CVModuleStreamFilterContent.js +5 -8
- data/webpack/scenes/ContentViews/Details/Filters/CVPackageGroupFilterContent.js +40 -43
- data/webpack/scenes/ContentViews/Details/Filters/CVRpmFilterContent.js +2 -2
- data/webpack/scenes/ContentViews/Details/Filters/ContentType.js +4 -4
- data/webpack/scenes/ContentViews/Details/Filters/ContentViewFilterDetailsHeader.js +6 -8
- data/webpack/scenes/ContentViews/Details/Filters/ContentViewFilters.js +6 -1
- data/webpack/scenes/ContentViews/Details/Filters/Rules/ContainerTag/AddEditContainerTagRuleModal.js +1 -1
- data/webpack/scenes/ContentViews/Details/Filters/Rules/Package/AddEditPackageRuleModal.js +16 -22
- data/webpack/scenes/ContentViews/Details/Filters/__tests__/CVRpmFilterContent.test.js +8 -8
- data/webpack/scenes/ContentViews/Details/Filters/__tests__/ContentViewPackageGroupFilter.test.js +3 -5
- data/webpack/scenes/ContentViews/Details/Filters/__tests__/contentViewErrataByDateDetails.fixtures.json +1 -8
- data/webpack/scenes/ContentViews/Details/Filters/__tests__/contentViewFilterDetail.fixtures.json +1 -2
- data/webpack/scenes/ContentViews/Details/Filters/__tests__/contentViewFilterDetails.test.js +5 -9
- data/webpack/scenes/ContentViews/Details/Filters/__tests__/cvAllRepos.fixtures.json +0 -2
- data/webpack/scenes/ContentViews/Details/Filters/__tests__/cvErrataDateFilterContent.test.js +1 -9
- data/webpack/scenes/ContentViews/Details/Filters/__tests__/cvErrataIDFilter.test.js +2 -4
- data/webpack/scenes/ContentViews/Details/Filters/__tests__/cvErratumFilterDetails.fixtures.json +1 -2
- data/webpack/scenes/ContentViews/Details/Filters/__tests__/cvFilterDetailModuleAffectedRepos.fixtures.json +1 -8
- data/webpack/scenes/ContentViews/Details/Filters/__tests__/cvFilterDetailWithAffectedRepos.fixtures.json +1 -8
- data/webpack/scenes/ContentViews/Details/Filters/__tests__/cvModuleStreamFilter.test.js +2 -4
- data/webpack/scenes/ContentViews/Details/Filters/__tests__/cvModuleStreamFilterDetails.fixtures.json +1 -2
- data/webpack/scenes/ContentViews/Details/Filters/__tests__/cvPackageFilterDetail.fixtures.json +1 -3
- data/webpack/scenes/ContentViews/Details/Promote/ContentViewVersionPromote.js +61 -32
- data/webpack/scenes/ContentViews/Details/Repositories/ContentCounts.js +6 -1
- data/webpack/scenes/ContentViews/Details/Repositories/ContentViewRepositories.js +5 -8
- data/webpack/scenes/ContentViews/Details/Repositories/LastSync.js +55 -9
- data/webpack/scenes/ContentViews/Details/Repositories/__tests__/contentViewAddRemove.test.js +2 -0
- data/webpack/scenes/ContentViews/Details/Repositories/__tests__/contentViewDetailRepos.fixtures.json +0 -2
- data/webpack/scenes/ContentViews/Details/Versions/ContentViewVersionContent.js +48 -29
- data/webpack/scenes/ContentViews/Details/Versions/ContentViewVersionEnvironments.js +2 -2
- data/webpack/scenes/ContentViews/Details/Versions/ContentViewVersionErrata.js +9 -7
- data/webpack/scenes/ContentViews/Details/Versions/ContentViewVersionErrata.scss +5 -2
- data/webpack/scenes/ContentViews/Details/Versions/ContentViewVersions.js +38 -9
- data/webpack/scenes/ContentViews/Details/Versions/Delete/RemoveCVVersionWizard.js +4 -1
- data/webpack/scenes/ContentViews/Details/Versions/Delete/RemoveSteps/CVEnvironmentSelectionForm.js +59 -53
- data/webpack/scenes/ContentViews/Details/Versions/Delete/RemoveSteps/CVVersionDeleteFinish.js +14 -3
- data/webpack/scenes/ContentViews/Details/Versions/Delete/RemoveSteps/CVVersionRemoveReview.js +24 -17
- data/webpack/scenes/ContentViews/Details/Versions/Delete/__tests__/cvVersionRemove.test.js +3 -3
- data/webpack/scenes/ContentViews/Details/Versions/Delete/__tests__/versionsResponseData.fixtures.json +1 -4
- data/webpack/scenes/ContentViews/Details/Versions/VersionDetails/ContentViewVersionDetails.js +4 -2
- data/webpack/scenes/ContentViews/Details/Versions/VersionDetails/ContentViewVersionDetailsHeader.js +134 -32
- data/webpack/scenes/ContentViews/Details/Versions/VersionDetails/ContentViewVersionRepositoryCell.js +8 -3
- data/webpack/scenes/ContentViews/Details/Versions/VersionDetails/__tests__/ContentViewVersionComponent.fixtures.json +1 -4
- data/webpack/scenes/ContentViews/Details/Versions/VersionDetails/__tests__/ContentViewVersionDetails.fixtures.json +1 -2
- data/webpack/scenes/ContentViews/Details/Versions/VersionDetails/__tests__/ContentViewVersionDetails.test.js +21 -1
- data/webpack/scenes/ContentViews/Details/Versions/VersionDetails/__tests__/ContentViewVersionDetailsCounts.fixtures.json +1 -2
- data/webpack/scenes/ContentViews/Details/Versions/VersionDetails/__tests__/ContentViewVersionDetailsEmpty.test.js +22 -1
- data/webpack/scenes/ContentViews/Details/Versions/VersionDetails/__tests__/ContentViewVersionRepositories.fixtures.json +1 -18
- data/webpack/scenes/ContentViews/Details/Versions/__tests__/contentViewVersions.fixtures.json +5 -5
- data/webpack/scenes/ContentViews/Details/Versions/__tests__/contentViewVersions.test.js +2 -0
- data/webpack/scenes/ContentViews/Details/Versions/__tests__/contentViewVersionsWithTask.fixtures.json +1 -3
- data/webpack/scenes/ContentViews/Details/contentViewInfo.scss +0 -4
- data/webpack/scenes/ContentViews/Publish/CVPublishForm.js +66 -53
- data/webpack/scenes/ContentViews/Publish/CVPublishReview.js +40 -28
- data/webpack/scenes/ContentViews/Publish/PublishContentViewWizard.js +3 -3
- data/webpack/scenes/ContentViews/Publish/__tests__/publishContentView.test.js +14 -14
- data/webpack/scenes/ContentViews/Publish/cvPublishForm.scss +6 -0
- data/webpack/scenes/ContentViews/Table/ContentViewsTable.js +53 -12
- data/webpack/scenes/ContentViews/Table/tableDataGenerator.js +12 -6
- data/webpack/scenes/ContentViews/__tests__/contentViewPage.test.js +6 -6
- data/webpack/scenes/ContentViews/components/ContentViewIcon.js +12 -7
- data/webpack/scenes/ContentViews/components/ContentViewsCounter.js +2 -2
- data/webpack/scenes/ContentViews/components/EnvironmentPaths/EnvironmentPaths.js +26 -27
- data/webpack/scenes/ContentViews/components/EnvironmentPaths/EnvironmentPaths.scss +18 -6
- data/webpack/scenes/ContentViews/components/WizardHeader.js +44 -0
- data/webpack/scenes/ContentViews/components/contentViewIcon.scss +13 -2
- data/webpack/scenes/Organizations/OrganizationActions.js +22 -24
- data/webpack/scenes/Organizations/OrganizationConstants.js +1 -3
- data/webpack/scenes/Organizations/OrganizationReducer.js +0 -7
- data/webpack/scenes/Organizations/OrganizationSelectors.js +16 -0
- data/webpack/scenes/Organizations/__tests__/OrganizationActions.test.js +1 -21
- data/webpack/scenes/Organizations/__tests__/OrganizationReducer.test.js +0 -20
- data/webpack/scenes/Organizations/__tests__/organizations.fixtures.js +34 -23
- data/webpack/scenes/Subscriptions/Manifest/CdnConfigurationForm.js +185 -0
- data/webpack/scenes/Subscriptions/Manifest/CdnConfigurationForm.scss +3 -0
- data/webpack/scenes/Subscriptions/Manifest/ManageManifestModal.js +112 -146
- data/webpack/scenes/Subscriptions/Manifest/__tests__/CdnConfigurationForm.test.js +114 -0
- data/webpack/scenes/Subscriptions/Manifest/__tests__/ManageManifestModal.test.js +121 -31
- data/webpack/scenes/Subscriptions/Manifest/index.js +14 -3
- data/webpack/scenes/Subscriptions/__tests__/__snapshots__/SubscriptionsActions.test.js.snap +1 -0
- data/webpack/scenes/Tasks/TaskActions.js +4 -3
- data/webpack/scenes/Tasks/__tests__/__snapshots__/TaskActions.test.js.snap +1 -0
- data/webpack/utils/helpers.js +2 -2
- metadata +62 -43
- data/app/controllers/katello/api/v2/ostree_branches_controller.rb +0 -16
- data/app/lib/actions/pulp/repository/presenters/ostree_presenter.rb +0 -91
- data/app/models/katello/ostree_branch.rb +0 -12
- data/app/models/katello/repository_ostree_branch.rb +0 -7
- data/app/services/katello/pulp/ostree_branch.rb +0 -14
- data/app/services/katello/pulp/repository/ostree.rb +0 -48
- data/app/views/katello/api/v2/ostree_branches/compare.json.rabl +0 -10
- data/app/views/katello/api/v2/ostree_branches/index.json.rabl +0 -7
- data/app/views/katello/api/v2/ostree_branches/show.json.rabl +0 -5
- data/app/views/katello/api/v2/root/resource_list.json.rabl +0 -3
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-views/versions/views/content-view-version-ostree-branches.html +0 -26
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/environments/details/views/environment-ostree.html +0 -27
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/ostree-branches/details/ostree-branch-repositories.controller.js +0 -77
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/ostree-branches/details/ostree-branch.controller.js +0 -31
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/ostree-branches/details/views/ostree-branch-info.html +0 -15
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/ostree-branches/details/views/ostree-branch-repositories.html +0 -72
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/ostree-branches/details/views/ostree-branch.html +0 -30
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/ostree-branches/ostree-branch.factory.js +0 -27
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/ostree-branches/ostree-branches.controller.js +0 -67
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/ostree-branches/ostree-branches.module.js +0 -15
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/ostree-branches/ostree-branches.routes.js +0 -50
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/ostree-branches/views/ostree-branches.html +0 -40
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/products/details/repositories/details/views/repository-manage-ostree-branches.html +0 -40
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/products/details/repositories/ostree-upstream-sync-policy.service.js +0 -26
- data/webpack/components/extensions/HostDetails/Tabs/SubscriptionTab.js +0 -12
- data/webpack/scenes/Content/Details/ContentCounts.js +0 -42
- data/webpack/scenes/Subscriptions/Manifest/__tests__/SimpleContentAccess.test.js +0 -108
- data/webpack/scenes/Subscriptions/Manifest/__tests__/__snapshots__/ManageManifestModal.test.js.snap +0 -158
@@ -1,6 +1,6 @@
|
|
1
1
|
import React, { Component } from 'react';
|
2
2
|
import PropTypes from 'prop-types';
|
3
|
-
import { Grid, Col, Row, Tabs, Tab,
|
3
|
+
import { Grid, Col, Row, Tabs, Tab, FormControl, ControlLabel } from 'react-bootstrap';
|
4
4
|
import { Button, Spinner } from 'patternfly-react';
|
5
5
|
import ForemanModal from 'foremanReact/components/ForemanModal';
|
6
6
|
import Slot from 'foremanReact/components/common/Slot';
|
@@ -12,21 +12,16 @@ import { Table } from '../../../components/pf3Table';
|
|
12
12
|
import { columns } from './ManifestHistoryTableSchema';
|
13
13
|
import DeleteManifestModalText from './DeleteManifestModalText';
|
14
14
|
import { MANAGE_MANIFEST_MODAL_ID, DELETE_MANIFEST_MODAL_ID } from './ManifestConstants';
|
15
|
+
import { CONTENT_CREDENTIAL_CERT_TYPE } from '../../ContentCredentials/ContentCredentialConstants';
|
15
16
|
import SimpleContentAccess from './SimpleContentAccess';
|
17
|
+
import CdnConfigurationForm from './CdnConfigurationForm';
|
16
18
|
|
17
19
|
import './ManageManifestModal.scss';
|
18
20
|
|
19
21
|
class ManageManifestModal extends Component {
|
20
|
-
constructor(props) {
|
21
|
-
super(props);
|
22
|
-
|
23
|
-
this.state = {
|
24
|
-
redhat_repository_url: null,
|
25
|
-
};
|
26
|
-
}
|
27
|
-
|
28
22
|
componentDidMount() {
|
29
23
|
this.props.loadManifestHistory();
|
24
|
+
this.props.getContentCredentials({ content_type: CONTENT_CREDENTIAL_CERT_TYPE });
|
30
25
|
}
|
31
26
|
|
32
27
|
componentDidUpdate(prevProps) {
|
@@ -57,14 +52,6 @@ class ManageManifestModal extends Component {
|
|
57
52
|
}
|
58
53
|
};
|
59
54
|
|
60
|
-
updateRepositoryUrl = (event) => {
|
61
|
-
this.setState({ redhat_repository_url: event.target.value });
|
62
|
-
};
|
63
|
-
|
64
|
-
saveOrganization = () => {
|
65
|
-
this.props.saveOrganization({ redhat_repository_url: this.state.redhat_repository_url });
|
66
|
-
};
|
67
|
-
|
68
55
|
uploadManifest = (fileList) => {
|
69
56
|
if (fileList.length > 0) {
|
70
57
|
this.props.upload(fileList[0]);
|
@@ -102,12 +89,13 @@ class ManageManifestModal extends Component {
|
|
102
89
|
disableSimpleContentAccess,
|
103
90
|
taskInProgress,
|
104
91
|
manifestActionStarted,
|
92
|
+
contentCredentials,
|
105
93
|
} = this.props;
|
106
94
|
|
107
95
|
const actionInProgress = (taskInProgress || manifestActionStarted);
|
108
|
-
const
|
96
|
+
const showCdnConfigurationTab = canEditOrganizations;
|
109
97
|
const showSubscriptionManifest = (canImportManifest || canDeleteManifest);
|
110
|
-
const showManifestTab = (
|
98
|
+
const showManifestTab = (canEditOrganizations || showSubscriptionManifest);
|
111
99
|
const disableSCASwitch = (
|
112
100
|
// allow users to turn SCA off even if they are not eligible to turn it back on
|
113
101
|
(!simpleContentAccessEligible && !simpleContentAccess) ||
|
@@ -125,11 +113,7 @@ class ManageManifestModal extends Component {
|
|
125
113
|
url: 'http://redhat.com',
|
126
114
|
},
|
127
115
|
});
|
128
|
-
|
129
|
-
<span>
|
130
|
-
{__('Updating...')}
|
131
|
-
<span className="fa fa-spinner fa-spin" />
|
132
|
-
</span>);
|
116
|
+
|
133
117
|
const getManifestName = () => {
|
134
118
|
let name = __('No Manifest Uploaded');
|
135
119
|
|
@@ -156,136 +140,94 @@ class ManageManifestModal extends Component {
|
|
156
140
|
<Tabs id="manifest-history-tabs">
|
157
141
|
{showManifestTab &&
|
158
142
|
<Tab eventKey={1} title={__('Manifest')}>
|
159
|
-
<Form className="form-horizontal">
|
160
|
-
{showRedHatProviderDetails &&
|
161
|
-
<React.Fragment>
|
162
|
-
<h3>{__('Red Hat Provider Details')}</h3>
|
163
|
-
<hr />
|
164
|
-
<FormGroup>
|
165
|
-
<Grid>
|
166
|
-
<Row>
|
167
|
-
<Col sm={5}>
|
168
|
-
<ControlLabel htmlFor="cdnUrl">
|
169
|
-
{__('Red Hat CDN URL')}
|
170
|
-
</ControlLabel>
|
171
|
-
</Col>
|
172
|
-
<Col sm={7}>
|
173
|
-
<FormControl
|
174
|
-
id="cdnUrl"
|
175
|
-
type="text"
|
176
|
-
defaultValue={this.state.redhat_repository_url || organization.redhat_repository_url || ''}
|
177
|
-
onBlur={this.updateRepositoryUrl}
|
178
|
-
/>
|
179
|
-
</Col>
|
180
|
-
</Row>
|
181
|
-
</Grid>
|
182
|
-
</FormGroup>
|
183
|
-
<FormGroup>
|
184
|
-
<Grid>
|
185
|
-
<Row>
|
186
|
-
<Col smOffset={5} sm={7}>
|
187
|
-
<Button onClick={this.saveOrganization} disabled={organization.loading}>
|
188
|
-
{organization.loading ? buttonLoading : __('Update')}
|
189
|
-
</Button>
|
190
|
-
</Col>
|
191
|
-
</Row>
|
192
|
-
</Grid>
|
193
|
-
</FormGroup>
|
194
|
-
<br />
|
195
|
-
</React.Fragment>
|
196
|
-
}
|
197
143
|
{showSubscriptionManifest &&
|
198
144
|
<React.Fragment>
|
199
|
-
|
200
|
-
|
201
|
-
<
|
202
|
-
|
203
|
-
|
204
|
-
|
205
|
-
|
206
|
-
|
207
|
-
|
208
|
-
|
209
|
-
|
210
|
-
|
211
|
-
|
212
|
-
/>
|
213
|
-
</Row>
|
145
|
+
<Grid>
|
146
|
+
<h3>{__('Subscription Manifest')}</h3>
|
147
|
+
<hr />
|
148
|
+
{ isManifestImported &&
|
149
|
+
<Row>
|
150
|
+
<SimpleContentAccess
|
151
|
+
enableSimpleContentAccess={enableSimpleContentAccess}
|
152
|
+
disableSimpleContentAccess={disableSimpleContentAccess}
|
153
|
+
isSimpleContentAccessEnabled={simpleContentAccess}
|
154
|
+
canToggleSimpleContentAccess={!disableSCASwitch}
|
155
|
+
simpleContentAccessEligible={simpleContentAccessEligible}
|
156
|
+
/>
|
157
|
+
</Row>
|
214
158
|
}
|
215
|
-
|
216
|
-
|
217
|
-
|
218
|
-
|
219
|
-
|
220
|
-
|
221
|
-
|
222
|
-
|
223
|
-
|
224
|
-
|
225
|
-
|
226
|
-
|
227
|
-
|
228
|
-
|
229
|
-
|
230
|
-
|
159
|
+
<Row>
|
160
|
+
<Col sm={5}>
|
161
|
+
<strong>{__('Subscription Allocation')}</strong>
|
162
|
+
</Col>
|
163
|
+
<Col sm={7}>
|
164
|
+
{getManifestName()}
|
165
|
+
</Col>
|
166
|
+
</Row>
|
167
|
+
<Row>
|
168
|
+
<Col sm={5}>
|
169
|
+
{canImportManifest &&
|
170
|
+
<ControlLabel
|
171
|
+
style={{ paddingTop: '10px' }}
|
172
|
+
>
|
173
|
+
<div>{__('Import New Manifest')}</div>
|
174
|
+
</ControlLabel>
|
231
175
|
}
|
232
|
-
|
233
|
-
|
234
|
-
|
235
|
-
|
236
|
-
|
237
|
-
|
238
|
-
|
239
|
-
|
240
|
-
|
241
|
-
|
242
|
-
|
176
|
+
</Col>
|
177
|
+
<Col sm={7} className="manifest-actions">
|
178
|
+
<Spinner loading={actionInProgress} />
|
179
|
+
{canImportManifest &&
|
180
|
+
<FormControl
|
181
|
+
id="usmaFile"
|
182
|
+
type="file"
|
183
|
+
accept=".zip"
|
184
|
+
disabled={actionInProgress}
|
185
|
+
onChange={e => this.uploadManifest(e.target.files)}
|
186
|
+
/>
|
243
187
|
}
|
244
|
-
|
245
|
-
|
246
|
-
|
247
|
-
|
248
|
-
|
249
|
-
|
250
|
-
|
251
|
-
|
252
|
-
|
188
|
+
<div id="manifest-actions-row">
|
189
|
+
{canImportManifest &&
|
190
|
+
<TooltipButton
|
191
|
+
onClick={this.refreshManifest}
|
192
|
+
tooltipId="refresh-manifest-button-tooltip"
|
193
|
+
tooltipText={disabledReason}
|
194
|
+
tooltipPlacement="top"
|
195
|
+
title={__('Refresh')}
|
196
|
+
disabled={!isManifestImported ||
|
253
197
|
actionInProgress || disableManifestActions}
|
254
|
-
|
198
|
+
/>
|
255
199
|
}
|
256
|
-
|
257
|
-
|
258
|
-
|
259
|
-
|
260
|
-
|
261
|
-
|
262
|
-
|
263
|
-
|
264
|
-
|
265
|
-
|
266
|
-
|
267
|
-
|
200
|
+
{canDeleteManifest &&
|
201
|
+
<React.Fragment>
|
202
|
+
<TooltipButton
|
203
|
+
disabled={!isManifestImported || actionInProgress}
|
204
|
+
bsStyle="danger"
|
205
|
+
onClick={this.showDeleteManifestModal}
|
206
|
+
title={__('Delete')}
|
207
|
+
tooltipId="delete-manifest-button-tooltip"
|
208
|
+
tooltipText={this.disabledTooltipText()}
|
209
|
+
tooltipPlacement="top"
|
210
|
+
/>
|
211
|
+
</React.Fragment>
|
268
212
|
}
|
269
|
-
|
270
|
-
|
271
|
-
|
272
|
-
|
273
|
-
|
274
|
-
|
275
|
-
|
276
|
-
|
277
|
-
|
278
|
-
|
279
|
-
|
280
|
-
|
281
|
-
|
282
|
-
|
283
|
-
|
284
|
-
</FormGroup>
|
213
|
+
</div>
|
214
|
+
<ForemanModal title={__('Confirm delete manifest')} id={DELETE_MANIFEST_MODAL_ID}>
|
215
|
+
<DeleteManifestModalText />
|
216
|
+
<ForemanModal.Footer>
|
217
|
+
<Button bsStyle="default" onClick={this.hideDeleteManifestModal}>
|
218
|
+
{__('Cancel')}
|
219
|
+
</Button>
|
220
|
+
<Button bsStyle="danger" onClick={this.deleteManifest}>
|
221
|
+
{__('Delete')}
|
222
|
+
</Button>
|
223
|
+
</ForemanModal.Footer>
|
224
|
+
</ForemanModal>
|
225
|
+
</Col>
|
226
|
+
</Row>
|
227
|
+
</Grid>
|
285
228
|
</React.Fragment>
|
286
229
|
}
|
287
|
-
|
288
|
-
</Form>
|
230
|
+
<Slot id="katello-manage-manifest-form" multi />
|
289
231
|
</Tab>
|
290
232
|
}
|
291
233
|
<Tab eventKey={2} title={__('Manifest History')}>
|
@@ -297,6 +239,18 @@ class ManageManifestModal extends Component {
|
|
297
239
|
/>
|
298
240
|
</LoadingState>
|
299
241
|
</Tab>
|
242
|
+
{showCdnConfigurationTab &&
|
243
|
+
<Tab eventKey={3} title={__('CDN Configuration')}>
|
244
|
+
<Grid>
|
245
|
+
<h3>{__('CDN Configuration for Red Hat Content')}</h3>
|
246
|
+
<hr />
|
247
|
+
<CdnConfigurationForm
|
248
|
+
cdnConfiguration={organization.cdn_configuration}
|
249
|
+
contentCredentials={contentCredentials}
|
250
|
+
/>
|
251
|
+
</Grid>
|
252
|
+
</Tab>
|
253
|
+
}
|
300
254
|
</Tabs>
|
301
255
|
<ForemanModal.Footer>
|
302
256
|
<Button bsStyle="primary" onClick={this.hideModal}>
|
@@ -315,9 +269,17 @@ ManageManifestModal.propTypes = {
|
|
315
269
|
enableSimpleContentAccess: PropTypes.func.isRequired,
|
316
270
|
disableSimpleContentAccess: PropTypes.func.isRequired,
|
317
271
|
loadManifestHistory: PropTypes.func.isRequired,
|
272
|
+
getContentCredentials: PropTypes.func.isRequired,
|
318
273
|
organization: PropTypes.shape({
|
274
|
+
id: PropTypes.number,
|
319
275
|
loading: PropTypes.bool,
|
320
|
-
|
276
|
+
cdn_configuration: PropTypes.shape({
|
277
|
+
url: PropTypes.string,
|
278
|
+
username: PropTypes.string,
|
279
|
+
upstream_organization_label: PropTypes.string,
|
280
|
+
ssl_ca_credential_id: PropTypes.number,
|
281
|
+
password_exists: PropTypes.bool,
|
282
|
+
}),
|
321
283
|
owner_details: PropTypes.shape({
|
322
284
|
upstreamConsumer: PropTypes.shape({
|
323
285
|
uuid: PropTypes.string,
|
@@ -334,7 +296,6 @@ ManageManifestModal.propTypes = {
|
|
334
296
|
disableManifestActions: PropTypes.bool,
|
335
297
|
disabledReason: PropTypes.string,
|
336
298
|
loadOrganization: PropTypes.func.isRequired,
|
337
|
-
saveOrganization: PropTypes.func.isRequired,
|
338
299
|
taskInProgress: PropTypes.bool.isRequired,
|
339
300
|
simpleContentAccess: PropTypes.bool,
|
340
301
|
simpleContentAccessEligible: PropTypes.bool,
|
@@ -347,6 +308,10 @@ ManageManifestModal.propTypes = {
|
|
347
308
|
setModalClosed: PropTypes.func.isRequired,
|
348
309
|
setModalOpen: PropTypes.func.isRequired,
|
349
310
|
manifestActionStarted: PropTypes.bool,
|
311
|
+
contentCredentials: PropTypes.arrayOf(PropTypes.shape({
|
312
|
+
id: PropTypes.number,
|
313
|
+
name: PropTypes.string,
|
314
|
+
})),
|
350
315
|
};
|
351
316
|
|
352
317
|
ManageManifestModal.defaultProps = {
|
@@ -360,6 +325,7 @@ ManageManifestModal.defaultProps = {
|
|
360
325
|
simpleContentAccess: false,
|
361
326
|
simpleContentAccessEligible: undefined,
|
362
327
|
manifestActionStarted: false,
|
328
|
+
contentCredentials: [],
|
363
329
|
};
|
364
330
|
|
365
331
|
export default ManageManifestModal;
|
@@ -0,0 +1,114 @@
|
|
1
|
+
import React from 'react';
|
2
|
+
import { cleanup } from '@testing-library/react';
|
3
|
+
import { renderWithRedux, fireEvent, patientlyWaitFor } from 'react-testing-lib-wrapper';
|
4
|
+
import userEvent from '@testing-library/user-event';
|
5
|
+
import CdnConfigurationForm from '../CdnConfigurationForm';
|
6
|
+
import { nockInstance, assertNockRequest } from '../../../../test-utils/nockWrapper';
|
7
|
+
import { updateCdnConfigurationSuccessResponse } from '../../../Organizations/__tests__/organizations.fixtures';
|
8
|
+
import api from '../../../../services/api';
|
9
|
+
|
10
|
+
afterEach(cleanup);
|
11
|
+
const updateCdnConfigurationPath = api.getApiUrl('/organizations/1/cdn_configuration');
|
12
|
+
|
13
|
+
const cdnConfiguration = {
|
14
|
+
url: 'http://currentcdn.example.com',
|
15
|
+
username: 'CurrentUser',
|
16
|
+
password_exists: false,
|
17
|
+
upstream_organization_label: 'CurrentOrg',
|
18
|
+
ssl_ca_credential_id: 2,
|
19
|
+
};
|
20
|
+
|
21
|
+
const organization = {
|
22
|
+
id: 1,
|
23
|
+
};
|
24
|
+
|
25
|
+
const initialState = {
|
26
|
+
katello: {
|
27
|
+
organization,
|
28
|
+
},
|
29
|
+
};
|
30
|
+
|
31
|
+
const contentCredentials = [
|
32
|
+
{
|
33
|
+
name: 'Credential1',
|
34
|
+
id: 1,
|
35
|
+
},
|
36
|
+
{
|
37
|
+
name: 'Credential2',
|
38
|
+
id: 2,
|
39
|
+
},
|
40
|
+
];
|
41
|
+
|
42
|
+
test('Can update the CDN configuration', async (done) => {
|
43
|
+
const { getByLabelText } = renderWithRedux(<CdnConfigurationForm
|
44
|
+
cdnConfiguration={cdnConfiguration}
|
45
|
+
contentCredentials={contentCredentials}
|
46
|
+
/>, { initialState });
|
47
|
+
|
48
|
+
const updateCdnConfigurationRequest = nockInstance
|
49
|
+
.put(updateCdnConfigurationPath, {
|
50
|
+
url: 'http://cdn.example.com',
|
51
|
+
username: 'admin',
|
52
|
+
password: 'changeme',
|
53
|
+
upstream_organization_label: 'Default_Organization',
|
54
|
+
ssl_ca_credential_id: '1',
|
55
|
+
})
|
56
|
+
.reply(200, updateCdnConfigurationSuccessResponse);
|
57
|
+
|
58
|
+
const url = getByLabelText('cdn-url');
|
59
|
+
fireEvent.change(url, { target: { value: 'http://cdn.example.com' } });
|
60
|
+
|
61
|
+
const username = getByLabelText('cdn-username');
|
62
|
+
fireEvent.change(username, { target: { value: 'admin' } });
|
63
|
+
|
64
|
+
fireEvent.click(getByLabelText('edit cdn-password'));
|
65
|
+
fireEvent.change(getByLabelText('cdn-password text input'), { target: { value: 'changeme' } });
|
66
|
+
fireEvent.click(getByLabelText('submit cdn-password'));
|
67
|
+
await patientlyWaitFor(() => expect(getByLabelText('cdn-password text value')).toBeInTheDocument());
|
68
|
+
|
69
|
+
const orgLabel = getByLabelText('cdn-organization-label');
|
70
|
+
fireEvent.change(orgLabel, { target: { value: 'Default_Organization' } });
|
71
|
+
|
72
|
+
userEvent.selectOptions(
|
73
|
+
getByLabelText('cdn-ssl-ca-content-credential'),
|
74
|
+
'1',
|
75
|
+
);
|
76
|
+
|
77
|
+
const updateButton = getByLabelText('update-cdn-configuration');
|
78
|
+
fireEvent.click(updateButton);
|
79
|
+
|
80
|
+
assertNockRequest(updateCdnConfigurationRequest, done);
|
81
|
+
});
|
82
|
+
|
83
|
+
test('the form shall reflect the given cdnConfiguration', () => {
|
84
|
+
const { getAllByTestId, getByLabelText } = renderWithRedux(<CdnConfigurationForm
|
85
|
+
cdnConfiguration={cdnConfiguration}
|
86
|
+
contentCredentials={contentCredentials}
|
87
|
+
/>, { initialState });
|
88
|
+
|
89
|
+
const username = getByLabelText('cdn-username');
|
90
|
+
expect(username).toHaveValue('CurrentUser');
|
91
|
+
|
92
|
+
const options = getAllByTestId('ssl-ca-content-credential-option');
|
93
|
+
|
94
|
+
expect(options).toHaveLength(contentCredentials.length);
|
95
|
+
expect(options[0].selected).toBeFalsy();
|
96
|
+
expect(options[1].selected).toBeTruthy();
|
97
|
+
});
|
98
|
+
|
99
|
+
test('resetting the password sends nothing to the API', async (done) => {
|
100
|
+
const { getByLabelText } = renderWithRedux(<CdnConfigurationForm />, { initialState });
|
101
|
+
|
102
|
+
const updateCdnConfigurationRequest = nockInstance
|
103
|
+
.put(updateCdnConfigurationPath, {}) // note the empty request body
|
104
|
+
.reply(200, updateCdnConfigurationSuccessResponse);
|
105
|
+
|
106
|
+
fireEvent.click(getByLabelText('edit cdn-password'));
|
107
|
+
fireEvent.change(getByLabelText('cdn-password text input'), { target: { value: 'changeme' } });
|
108
|
+
fireEvent.click(getByLabelText('clear cdn-password'));
|
109
|
+
|
110
|
+
const updateButton = getByLabelText('update-cdn-configuration');
|
111
|
+
fireEvent.click(updateButton);
|
112
|
+
|
113
|
+
assertNockRequest(updateCdnConfigurationRequest, done);
|
114
|
+
});
|
@@ -1,33 +1,123 @@
|
|
1
1
|
import React from 'react';
|
2
|
-
import {
|
3
|
-
import
|
4
|
-
import
|
5
|
-
import { manifestHistorySuccessState } from './manifest.fixtures';
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
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
|
+
cdn_configuration: {
|
16
|
+
|
17
|
+
},
|
18
|
+
owner_details: {
|
19
|
+
upstreamConsumer: {
|
20
|
+
webUrl: 'https://example.com/',
|
21
|
+
},
|
22
|
+
},
|
23
|
+
};
|
24
|
+
|
25
|
+
const defaultProps = {
|
26
|
+
disableManifestActions: false,
|
27
|
+
disabledReason: '',
|
28
|
+
canImportManifest: true,
|
29
|
+
canDeleteManifest: true,
|
30
|
+
canEditOrganizations: true,
|
31
|
+
upload: noop,
|
32
|
+
refresh: noop,
|
33
|
+
delete: noop,
|
34
|
+
enableSimpleContentAccess: noop,
|
35
|
+
disableSimpleContentAccess: noop,
|
36
|
+
loadManifestHistory: noop,
|
37
|
+
organization,
|
38
|
+
loadOrganization: noop,
|
39
|
+
taskInProgress: false,
|
40
|
+
simpleContentAccess: true,
|
41
|
+
manifestHistory: manifestHistorySuccessState,
|
42
|
+
setModalClosed: noop,
|
43
|
+
setModalOpen: noop,
|
44
|
+
updateCdnConfiguration: noop,
|
45
|
+
getContentCredentials: noop,
|
46
|
+
};
|
47
|
+
|
48
|
+
const initialState = {
|
49
|
+
katello: {
|
50
|
+
organization: {
|
51
|
+
simple_content_access: false,
|
52
|
+
...organization,
|
53
|
+
},
|
54
|
+
},
|
55
|
+
foremanModals: {
|
56
|
+
manageManifestModal: {
|
57
|
+
isOpen: true,
|
58
|
+
},
|
59
|
+
},
|
60
|
+
};
|
61
|
+
|
62
|
+
const enableSimpleContetAccessPath = api.getApiUrl('/organizations/1/simple_content_access/enable');
|
63
|
+
const disableSimpleContetAccessPath = api.getApiUrl('/organizations/1/simple_content_access/disable');
|
64
|
+
const manifestHistoryPath = api.getApiUrl('/organizations/1/subscriptions/manifest_history');
|
65
|
+
const getContentCredentialsPath = api.getApiUrl('/content_credentials?organization_id=1&content_type=cert');
|
66
|
+
|
67
|
+
test('Enable Simple Content Access after toggle switch value to true', async (done) => {
|
68
|
+
const { getByTestId } = renderWithRedux(<ManifestModal {...defaultProps} />, { initialState });
|
69
|
+
|
70
|
+
const updatescope = nockInstance
|
71
|
+
.put(enableSimpleContetAccessPath)
|
72
|
+
.reply(202, true);
|
73
|
+
|
74
|
+
const getscope = nockInstance
|
75
|
+
.get(manifestHistoryPath)
|
76
|
+
.query(true)
|
77
|
+
.reply(200, manifestHistorySuccessResponse);
|
78
|
+
|
79
|
+
const contentCredentialsRequest = nockInstance
|
80
|
+
.get(getContentCredentialsPath)
|
81
|
+
.reply(200, {});
|
82
|
+
|
83
|
+
const toggleButton = getByTestId('switch');
|
84
|
+
|
85
|
+
await patientlyWaitFor(() => { expect(toggleButton).toBeInTheDocument(); });
|
86
|
+
expect(toggleButton.checked).toEqual(false);
|
87
|
+
|
88
|
+
fireEvent.click(toggleButton);
|
89
|
+
|
90
|
+
assertNockRequest(contentCredentialsRequest);
|
91
|
+
assertNockRequest(getscope);
|
92
|
+
assertNockRequest(updatescope, done);
|
93
|
+
});
|
94
|
+
|
95
|
+
test('Disable Simple Content Access after toggle switch value to false', async (done) => {
|
96
|
+
initialState.katello.organization.simple_content_access = true;
|
97
|
+
|
98
|
+
const updatescope = nockInstance
|
99
|
+
.put(disableSimpleContetAccessPath)
|
100
|
+
.reply(202, true);
|
101
|
+
|
102
|
+
const getscope = nockInstance
|
103
|
+
.get(manifestHistoryPath)
|
104
|
+
.query(true)
|
105
|
+
.reply(200, manifestHistorySuccessResponse);
|
106
|
+
|
107
|
+
const contentCredentialsRequest = nockInstance
|
108
|
+
.get(getContentCredentialsPath)
|
109
|
+
.reply(200, {});
|
110
|
+
|
111
|
+
const { getByTestId } = renderWithRedux(<ManifestModal {...defaultProps} />, { initialState });
|
112
|
+
|
113
|
+
const toggleButton = getByTestId('switch');
|
114
|
+
|
115
|
+
await patientlyWaitFor(() => { expect(toggleButton).toBeInTheDocument(); });
|
116
|
+
expect(toggleButton.checked).toEqual(true);
|
117
|
+
|
118
|
+
fireEvent.click(toggleButton);
|
119
|
+
|
120
|
+
assertNockRequest(contentCredentialsRequest);
|
121
|
+
assertNockRequest(getscope);
|
122
|
+
assertNockRequest(updatescope, done);
|
33
123
|
});
|
@@ -4,10 +4,16 @@ import { connect } from 'react-redux';
|
|
4
4
|
import * as foremanModalActions from 'foremanReact/components/ForemanModal/ForemanModalActions';
|
5
5
|
import * as manifestActions from './ManifestActions';
|
6
6
|
import * as organizationActions from '../../Organizations/OrganizationActions';
|
7
|
+
import * as contentCredentialActions from '../../ContentCredentials/ContentCredentialActions';
|
7
8
|
import * as tasksActions from '../../Tasks/TaskActions';
|
8
9
|
import history from './ManifestHistoryReducer';
|
9
|
-
import {
|
10
|
+
import {
|
11
|
+
selectSimpleContentAccessEnabled,
|
12
|
+
selectIsManifestImported,
|
13
|
+
selectUpdatingCdnConfiguration,
|
14
|
+
} from '../../Organizations/OrganizationSelectors';
|
10
15
|
import { selectManifestActionStarted, selectSimpleContentAccessEligible } from '../SubscriptionsSelectors';
|
16
|
+
import { selectContentCredentials } from '../../ContentCredentials/ContentCredentialSelectors';
|
11
17
|
|
12
18
|
import ManifestModal from './ManageManifestModal';
|
13
19
|
|
@@ -19,15 +25,20 @@ const mapStateToProps = state => ({
|
|
19
25
|
manifestHistory: state.katello.manifestHistory,
|
20
26
|
simpleContentAccess: selectSimpleContentAccessEnabled(state),
|
21
27
|
isManifestImported: selectIsManifestImported(state),
|
22
|
-
modalOpenState: state.foremanModals.ManageManifestModal,
|
23
28
|
deleteManifestModalExists: !!state.foremanModals.deleteManifestModal,
|
24
29
|
manifestActionStarted: selectManifestActionStarted(state),
|
25
30
|
simpleContentAccessEligible: selectSimpleContentAccessEligible(state),
|
31
|
+
updatingCdnConfiguration: selectUpdatingCdnConfiguration(state),
|
32
|
+
contentCredentials: selectContentCredentials(state),
|
26
33
|
});
|
27
34
|
|
28
35
|
// map action dispatchers to props
|
29
36
|
const actions = {
|
30
|
-
...manifestActions,
|
37
|
+
...manifestActions,
|
38
|
+
...organizationActions,
|
39
|
+
...tasksActions,
|
40
|
+
...foremanModalActions,
|
41
|
+
...contentCredentialActions,
|
31
42
|
};
|
32
43
|
const mapDispatchToProps = dispatch => bindActionCreators(actions, dispatch);
|
33
44
|
|