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
@@ -7,7 +7,9 @@ import { urlBuilder } from 'foremanReact/common/urlHelpers';
|
|
7
7
|
import { STATUS } from 'foremanReact/constants';
|
8
8
|
import { Link } from 'react-router-dom';
|
9
9
|
import PropTypes from 'prop-types';
|
10
|
+
import { selectIntervals } from 'foremanReact/redux/middlewares/IntervalMiddleware/IntervalSelectors.js';
|
10
11
|
|
12
|
+
import { useSet } from '../../../../components/Table/TableHooks';
|
11
13
|
import TableWrapper from '../../../../components/Table/TableWrapper';
|
12
14
|
import InactiveText from '../../components/InactiveText';
|
13
15
|
import ContentViewVersionEnvironments from './ContentViewVersionEnvironments';
|
@@ -22,9 +24,10 @@ import {
|
|
22
24
|
import getEnvironmentPaths from '../../components/EnvironmentPaths/EnvironmentPathActions';
|
23
25
|
import ContentViewVersionPromote from '../Promote/ContentViewVersionPromote';
|
24
26
|
import TaskPresenter from '../../components/TaskPresenter/TaskPresenter';
|
25
|
-
import { startPollingTask } from '../../../Tasks/TaskActions';
|
27
|
+
import { startPollingTask, stopPollingTask } from '../../../Tasks/TaskActions';
|
26
28
|
import RemoveCVVersionWizard from './Delete/RemoveCVVersionWizard';
|
27
29
|
import { hasPermission } from '../../helpers';
|
30
|
+
import { pollTaskKey } from '../../../Tasks/helpers';
|
28
31
|
|
29
32
|
const ContentViewVersions = ({ cvId, details }) => {
|
30
33
|
const response = useSelector(state => selectCVVersions(state, cvId));
|
@@ -46,6 +49,8 @@ const ContentViewVersions = ({ cvId, details }) => {
|
|
46
49
|
const [deleteVersion, setDeleteVersion] = useState(false);
|
47
50
|
const [currentStep, setCurrentStep] = useState(1);
|
48
51
|
const { permissions } = details;
|
52
|
+
const pendingTaskSet = useSet([]);
|
53
|
+
const intervals = useSelector(state => selectIntervals(state));
|
49
54
|
|
50
55
|
const columnHeaders = [
|
51
56
|
__('Version'),
|
@@ -63,6 +68,16 @@ const ContentViewVersions = ({ cvId, details }) => {
|
|
63
68
|
[dispatch],
|
64
69
|
);
|
65
70
|
|
71
|
+
useEffect(() => { // eslint-disable-line arrow-body-style
|
72
|
+
return () => {
|
73
|
+
if (pendingTaskSet.size) {
|
74
|
+
pendingTaskSet.forEach(id =>
|
75
|
+
dispatch(stopPollingTask(id)));
|
76
|
+
pendingTaskSet.clear();
|
77
|
+
}
|
78
|
+
};
|
79
|
+
}, [pendingTaskSet, dispatch]);
|
80
|
+
|
66
81
|
const buildCells = useCallback((cvVersion) => {
|
67
82
|
const {
|
68
83
|
version,
|
@@ -75,14 +90,18 @@ const ContentViewVersions = ({ cvId, details }) => {
|
|
75
90
|
return [
|
76
91
|
{ title: <Link to={`/versions/${versionId}`}>{__('Version ')}{version}</Link> },
|
77
92
|
{ title: <ContentViewVersionEnvironments {...{ environments }} /> },
|
78
|
-
{
|
93
|
+
{
|
94
|
+
title: Number(packageCount) ?
|
95
|
+
<a href={urlBuilder(`content_views/${cvId}#/versions/${versionId}/packages`, '')}>{packageCount}</a> :
|
96
|
+
<InactiveText text={__('No packages')} />,
|
97
|
+
},
|
79
98
|
{ title: <ContentViewVersionErrata {...{ cvId, versionId, errataCounts }} /> },
|
80
99
|
{ title: <ContentViewVersionContent {...{ cvId, versionId, cvVersion }} /> },
|
81
100
|
{ title: description ? <TableText wrapModifier="truncate">{description}</TableText> : <InactiveText text={__('No description')} /> },
|
82
101
|
];
|
83
102
|
}, [cvId]);
|
84
103
|
|
85
|
-
const buildActiveTaskCells = useCallback((cvVersion) => {
|
104
|
+
const buildActiveTaskCells = useCallback((cvVersion, pollIntervals) => {
|
86
105
|
const {
|
87
106
|
version,
|
88
107
|
description,
|
@@ -91,8 +110,18 @@ const ContentViewVersions = ({ cvId, details }) => {
|
|
91
110
|
} = cvVersion;
|
92
111
|
const { task } = activeHistory[0];
|
93
112
|
const { result } = task || {};
|
94
|
-
|
95
|
-
|
113
|
+
|
114
|
+
if (result !== 'error' && !pollIntervals[pollTaskKey(task.id)]) {
|
115
|
+
pendingTaskSet.add(task.id);
|
116
|
+
dispatch(startPollingTask(
|
117
|
+
task.id, task,
|
118
|
+
({ data: { pending } = {} }) => {
|
119
|
+
if (!pending) {
|
120
|
+
dispatch(stopPollingTask(task.id));
|
121
|
+
pendingTaskSet.delete(task.id);
|
122
|
+
}
|
123
|
+
},
|
124
|
+
));
|
96
125
|
}
|
97
126
|
|
98
127
|
return [
|
@@ -108,7 +137,7 @@ const ContentViewVersions = ({ cvId, details }) => {
|
|
108
137
|
{ title: '' },
|
109
138
|
{ title: description ? <TableText wrapModifier="truncate">{description}</TableText> : <InactiveText text={__('No description')} /> },
|
110
139
|
];
|
111
|
-
}, [dispatch]);
|
140
|
+
}, [dispatch, pendingTaskSet]);
|
112
141
|
|
113
142
|
useDeepCompareEffect(() => {
|
114
143
|
const buildRows = () => {
|
@@ -122,7 +151,7 @@ const ContentViewVersions = ({ cvId, details }) => {
|
|
122
151
|
} = cvVersion;
|
123
152
|
|
124
153
|
const cells = activeHistory.length ?
|
125
|
-
buildActiveTaskCells(cvVersion) :
|
154
|
+
buildActiveTaskCells(cvVersion, intervals) :
|
126
155
|
buildCells(cvVersion);
|
127
156
|
newRows.push({
|
128
157
|
cvVersionId: versionId,
|
@@ -139,7 +168,7 @@ const ContentViewVersions = ({ cvId, details }) => {
|
|
139
168
|
const newRows = buildRows();
|
140
169
|
setRows(newRows);
|
141
170
|
}
|
142
|
-
}, [response, results, buildActiveTaskCells, buildCells, dispatch, loading, setRows]);
|
171
|
+
}, [response, results, buildActiveTaskCells, buildCells, dispatch, loading, setRows, intervals]);
|
143
172
|
|
144
173
|
const onPromote = ({ cvVersionId, cvVersionName, cvVersionEnvironments }) => {
|
145
174
|
setVersionIdToPromote(cvVersionId);
|
@@ -173,7 +202,7 @@ const ContentViewVersions = ({ cvId, details }) => {
|
|
173
202
|
},
|
174
203
|
},
|
175
204
|
{
|
176
|
-
title: __('Remove'),
|
205
|
+
title: __('Remove from environments'),
|
177
206
|
isDisabled: rowData.activeHistory.length,
|
178
207
|
onClick: (_event, rowId, rowInfo) => {
|
179
208
|
onRemoveFromEnv({
|
@@ -17,7 +17,7 @@ import { useSet } from '../../../../../components/Table/TableHooks';
|
|
17
17
|
const RemoveCVVersionWizard = ({
|
18
18
|
cvId, versionIdToRemove, versionNameToRemove,
|
19
19
|
versionEnvironments, show, setIsOpen,
|
20
|
-
currentStep, setCurrentStep, deleteWizard,
|
20
|
+
currentStep, setCurrentStep, deleteWizard, detailsPage,
|
21
21
|
}) => {
|
22
22
|
const [selectedEnvForAK, setSelectedEnvForAK] = useState([]);
|
23
23
|
const [selectedEnvForHost, setSelectedEnvForHost] = useState([]);
|
@@ -133,6 +133,7 @@ const RemoveCVVersionWizard = ({
|
|
133
133
|
selectedEnvForHost,
|
134
134
|
setSelectedEnvForHost,
|
135
135
|
selectedEnvSet,
|
136
|
+
detailsPage,
|
136
137
|
}}
|
137
138
|
>
|
138
139
|
<Wizard
|
@@ -165,12 +166,14 @@ RemoveCVVersionWizard.propTypes = {
|
|
165
166
|
currentStep: PropTypes.number.isRequired,
|
166
167
|
setCurrentStep: PropTypes.func.isRequired,
|
167
168
|
deleteWizard: PropTypes.bool.isRequired,
|
169
|
+
detailsPage: PropTypes.bool,
|
168
170
|
};
|
169
171
|
|
170
172
|
RemoveCVVersionWizard.defaultProps = {
|
171
173
|
versionEnvironments: [],
|
172
174
|
show: false,
|
173
175
|
setIsOpen: null,
|
176
|
+
detailsPage: false,
|
174
177
|
};
|
175
178
|
|
176
179
|
export default RemoveCVVersionWizard;
|
data/webpack/scenes/ContentViews/Details/Versions/Delete/RemoveSteps/CVEnvironmentSelectionForm.js
CHANGED
@@ -1,11 +1,12 @@
|
|
1
|
-
import React, { useContext } from 'react';
|
1
|
+
import React, { useContext, useState } from 'react';
|
2
2
|
import useDeepCompareEffect from 'use-deep-compare-effect';
|
3
|
-
import { Alert, Checkbox, EmptyState, EmptyStateVariant, Title, EmptyStateBody } from '@patternfly/react-core';
|
3
|
+
import { Alert, Checkbox, EmptyState, EmptyStateVariant, Title, EmptyStateBody, AlertActionCloseButton } from '@patternfly/react-core';
|
4
4
|
import { TableVariant, TableComposable, Thead, Tbody, Tr, Th, Td } from '@patternfly/react-table';
|
5
5
|
import { translate as __ } from 'foremanReact/common/I18n';
|
6
6
|
import DeleteContext from '../DeleteContext';
|
7
7
|
|
8
8
|
const CVEnvironmentSelectionForm = () => {
|
9
|
+
const [alertDismissed, setAlertDismissed] = useState(false);
|
9
10
|
const {
|
10
11
|
versionNameToRemove, versionEnvironments, selectedEnvSet,
|
11
12
|
setAffectedActivationKeys, setAffectedHosts, deleteFlow,
|
@@ -51,55 +52,60 @@ const CVEnvironmentSelectionForm = () => {
|
|
51
52
|
'You can delete this version completely and it will no longer be available for promotion.');
|
52
53
|
return (
|
53
54
|
<>
|
54
|
-
{deleteFlow &&
|
55
|
-
|
56
|
-
|
57
|
-
|
55
|
+
{!alertDismissed && deleteFlow &&
|
56
|
+
<Alert
|
57
|
+
variant="warning"
|
58
|
+
isInline
|
59
|
+
title={__('Warning')}
|
60
|
+
actionClose={<AlertActionCloseButton onClose={() => setAlertDismissed(true)} />}
|
61
|
+
>
|
62
|
+
<p style={{ marginBottom: '0.5em' }}>{versionDeleteInfo}</p>
|
63
|
+
</Alert>
|
58
64
|
}
|
59
65
|
{(!deleteFlow &&
|
60
66
|
(removeDeletionFlow || areAllSelected() || versionEnvironments.length === 0))
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
|
67
|
-
|
68
|
-
|
69
|
-
|
70
|
-
/>
|
71
|
-
</Alert>)}
|
72
|
-
{(versionEnvironments.length !== 0) &&
|
73
|
-
<TableComposable variant={TableVariant.compact}>
|
74
|
-
<Thead>
|
75
|
-
<Tr>
|
76
|
-
<Td
|
77
|
-
select={{
|
78
|
-
rowIndex: 0,
|
79
|
-
onSelect: onSelectAll,
|
80
|
-
isSelected: areAllSelected() || deleteFlow || removeDeletionFlow,
|
81
|
-
disable: deleteFlow || removeDeletionFlow,
|
82
|
-
}}
|
67
|
+
&& (
|
68
|
+
<Alert variant="warning" isInline title={__('Warning')}>
|
69
|
+
<p style={{ marginBottom: '0.5em' }}>{removeDeletionFlow ? versionDeleteInfo : versionRemovalInfo}</p>
|
70
|
+
<Checkbox
|
71
|
+
id="delete_version"
|
72
|
+
label={__('Delete version')}
|
73
|
+
isChecked={removeDeletionFlow}
|
74
|
+
onChange={checked => setRemoveDeletionFlow(checked)}
|
75
|
+
style={{ margin: 0 }}
|
83
76
|
/>
|
84
|
-
|
85
|
-
|
86
|
-
|
87
|
-
|
88
|
-
|
89
|
-
|
90
|
-
|
91
|
-
|
92
|
-
|
77
|
+
</Alert>)}
|
78
|
+
{(versionEnvironments.length !== 0) &&
|
79
|
+
<TableComposable variant={TableVariant.compact}>
|
80
|
+
<Thead>
|
81
|
+
<Tr>
|
82
|
+
<Td
|
83
|
+
select={{
|
84
|
+
rowIndex: 0,
|
85
|
+
onSelect: onSelectAll,
|
86
|
+
isSelected: areAllSelected() || deleteFlow || removeDeletionFlow,
|
87
|
+
disable: deleteFlow || removeDeletionFlow,
|
88
|
+
}}
|
89
|
+
/>
|
90
|
+
{columnHeaders.map(col =>
|
91
|
+
<Th key={col}>{col}</Th>)}
|
92
|
+
</Tr>
|
93
|
+
</Thead>
|
94
|
+
<Tbody>
|
95
|
+
{versionEnvironments?.map(({
|
96
|
+
id, name, activation_key_count: akCount,
|
97
|
+
host_count: hostCount,
|
98
|
+
}, rowIndex) =>
|
93
99
|
(
|
94
100
|
<Tr key={`${name}_${id}`}>
|
95
101
|
<Td
|
96
102
|
key={`${name}__${id}_select`}
|
97
103
|
select={{
|
98
|
-
|
99
|
-
|
100
|
-
|
101
|
-
|
102
|
-
|
104
|
+
rowIndex,
|
105
|
+
onSelect: (event, isSelected) => onSelect(event, isSelected, id),
|
106
|
+
isSelected: selectedEnvSet.has(id) || deleteFlow || removeDeletionFlow,
|
107
|
+
disable: deleteFlow || removeDeletionFlow,
|
108
|
+
}}
|
103
109
|
/>
|
104
110
|
<Td>
|
105
111
|
{name}
|
@@ -108,18 +114,18 @@ const CVEnvironmentSelectionForm = () => {
|
|
108
114
|
<Td>{akCount}</Td>
|
109
115
|
</Tr>
|
110
116
|
))
|
111
|
-
|
112
|
-
|
113
|
-
|
117
|
+
}
|
118
|
+
</Tbody>
|
119
|
+
</TableComposable>}
|
114
120
|
{(versionEnvironments.length === 0) &&
|
115
|
-
|
116
|
-
|
117
|
-
|
118
|
-
|
119
|
-
|
120
|
-
|
121
|
-
|
122
|
-
|
121
|
+
<EmptyState variant={EmptyStateVariant.xs}>
|
122
|
+
<Title headingLevel="h4" size="md">
|
123
|
+
{__('This version has not been promoted to any environments.')}
|
124
|
+
</Title>
|
125
|
+
<EmptyStateBody>
|
126
|
+
{versionEnvironmentsEmptyInfo}
|
127
|
+
</EmptyStateBody>
|
128
|
+
</EmptyState>}
|
123
129
|
</>
|
124
130
|
);
|
125
131
|
};
|
data/webpack/scenes/ContentViews/Details/Versions/Delete/RemoveSteps/CVVersionDeleteFinish.js
CHANGED
@@ -1,5 +1,6 @@
|
|
1
1
|
import React, { useState, useContext } from 'react';
|
2
2
|
import { useDispatch, useSelector } from 'react-redux';
|
3
|
+
import { Redirect } from 'react-router-dom';
|
3
4
|
import useDeepCompareEffect from 'use-deep-compare-effect';
|
4
5
|
import { STATUS } from 'foremanReact/constants';
|
5
6
|
import { translate as __ } from 'foremanReact/common/I18n';
|
@@ -13,7 +14,8 @@ const CVVersionDeleteFinish = () => {
|
|
13
14
|
cvId, versionIdToRemove, versionEnvironments,
|
14
15
|
setIsOpen, selectedEnvSet,
|
15
16
|
selectedCVForAK, selectedEnvForAK, selectedCVForHosts,
|
16
|
-
selectedEnvForHost, affectedActivationKeys, affectedHosts,
|
17
|
+
selectedEnvForHost, affectedActivationKeys, affectedHosts,
|
18
|
+
deleteFlow, removeDeletionFlow, detailsPage,
|
17
19
|
} = useContext(DeleteContext);
|
18
20
|
const removeCVVersionResponse = useSelector(state =>
|
19
21
|
selectRemoveCVVersionResponse(state, versionIdToRemove, versionEnvironments));
|
@@ -22,14 +24,20 @@ const CVVersionDeleteFinish = () => {
|
|
22
24
|
const removeResolved = removeCVVersionStatus === STATUS.RESOLVED;
|
23
25
|
const dispatch = useDispatch();
|
24
26
|
const [removeDispatched, setRemoveDispatched] = useState(false);
|
27
|
+
const [redirect, setRedirect] = useState(false);
|
25
28
|
const selectedEnv = versionEnvironments.filter(env => selectedEnvSet.has(env.id));
|
26
29
|
|
27
30
|
useDeepCompareEffect(() => {
|
28
31
|
if (removeResolved && removeCVVersionResponse && removeDispatched) {
|
29
|
-
setIsOpen(false);
|
30
32
|
dispatch(getContentViewVersions(cvId));
|
33
|
+
if (detailsPage) {
|
34
|
+
setRedirect(true);
|
35
|
+
} else {
|
36
|
+
setIsOpen(false);
|
37
|
+
}
|
31
38
|
}
|
32
|
-
}, [removeCVVersionResponse, removeResolved, setIsOpen,
|
39
|
+
}, [removeCVVersionResponse, removeResolved, setIsOpen,
|
40
|
+
dispatch, cvId, removeDispatched, detailsPage, setRedirect]);
|
33
41
|
|
34
42
|
/*
|
35
43
|
The remove version from environment API takes the following params :
|
@@ -88,6 +96,9 @@ const CVVersionDeleteFinish = () => {
|
|
88
96
|
selectedEnvForAK, selectedEnvForHost, selectedEnv,
|
89
97
|
removeCVVersionResponse, removeCVVersionStatus, removeDispatched]);
|
90
98
|
|
99
|
+
if (redirect) {
|
100
|
+
return (<Redirect to="/versions" />);
|
101
|
+
}
|
91
102
|
return <Loading loadingText={__('Please wait while the task starts..')} />;
|
92
103
|
};
|
93
104
|
|
data/webpack/scenes/ContentViews/Details/Versions/Delete/RemoveSteps/CVVersionRemoveReview.js
CHANGED
@@ -1,13 +1,15 @@
|
|
1
|
-
import React, { useContext } from 'react';
|
1
|
+
import React, { useContext, useState } from 'react';
|
2
2
|
import { useSelector } from 'react-redux';
|
3
|
-
import { Alert, Flex, FlexItem, Label } from '@patternfly/react-core';
|
3
|
+
import { Alert, Flex, FlexItem, Label, AlertActionCloseButton } from '@patternfly/react-core';
|
4
4
|
import { ExclamationTriangleIcon } from '@patternfly/react-icons';
|
5
5
|
import { translate as __ } from 'foremanReact/common/I18n';
|
6
6
|
import { selectCVActivationKeys, selectCVHosts } from '../../../ContentViewDetailSelectors';
|
7
7
|
import DeleteContext from '../DeleteContext';
|
8
8
|
import { pluralize } from '../../../../../../utils/helpers';
|
9
|
+
import WizardHeader from '../../../../components/WizardHeader';
|
9
10
|
|
10
11
|
const CVVersionRemoveReview = () => {
|
12
|
+
const [alertDismissed, setAlertDismissed] = useState(false);
|
11
13
|
const {
|
12
14
|
cvId, versionNameToRemove, versionEnvironments, selectedEnvSet,
|
13
15
|
selectedEnvForAK, selectedCVNameForAK, selectedCVNameForHosts,
|
@@ -20,16 +22,21 @@ const CVVersionRemoveReview = () => {
|
|
20
22
|
const selectedEnv = versionEnvironments.filter(env => selectedEnvSet.has(env.id));
|
21
23
|
const versionDeleteInfo = __(`Version ${versionNameToRemove} will be deleted from all environments. It will no longer be available for promotion.`);
|
22
24
|
const removalNotice = __(`Version ${versionNameToRemove} will be removed from the environments listed below, and will remain available for later promotion. ` +
|
23
|
-
|
25
|
+
'Changes listed below will be effective after clicking Remove.');
|
24
26
|
|
25
27
|
return (
|
26
28
|
<>
|
27
|
-
<
|
28
|
-
{(deleteFlow || removeDeletionFlow) &&
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
29
|
+
<WizardHeader title={__('Review Details')} />
|
30
|
+
{!alertDismissed && (deleteFlow || removeDeletionFlow) &&
|
31
|
+
<Alert
|
32
|
+
variant="warning"
|
33
|
+
isInline
|
34
|
+
title={__('Warning')}
|
35
|
+
actionClose={<AlertActionCloseButton onClose={() => setAlertDismissed(true)} />}
|
36
|
+
>
|
37
|
+
<p style={{ marginBottom: '0.5em' }}>{versionDeleteInfo}</p>
|
38
|
+
</Alert>}
|
39
|
+
{!(deleteFlow || removeDeletionFlow) && <WizardHeader description={removalNotice} />}
|
33
40
|
{(selectedEnv.length !== 0) &&
|
34
41
|
<>
|
35
42
|
<h3>{__('Environments')}</h3>
|
@@ -52,14 +59,14 @@ const CVVersionRemoveReview = () => {
|
|
52
59
|
</Flex>
|
53
60
|
</>}
|
54
61
|
{affectedActivationKeys &&
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
|
62
|
+
<>
|
63
|
+
<h3>{__('Activation keys')}</h3>
|
64
|
+
<Flex>
|
65
|
+
<FlexItem><ExclamationTriangleIcon /></FlexItem>
|
66
|
+
<FlexItem><p>{__(`${pluralize(akResponse.length, 'activation key')} will be moved to content view ${selectedCVNameForAK} in `)}</p></FlexItem>
|
67
|
+
<FlexItem><Label isTruncated color="purple" href={`/lifecycle_environments/${selectedEnvForAK[0].id}`}>{selectedEnvForAK[0].name}</Label></FlexItem>
|
68
|
+
</Flex>
|
69
|
+
</>}
|
63
70
|
</>
|
64
71
|
);
|
65
72
|
};
|
@@ -108,7 +108,7 @@ test('Can open Remove wizard and remove version from simple environment', async
|
|
108
108
|
expect(getAllByLabelText('Actions')[0]).toHaveAttribute('aria-expanded', 'false');
|
109
109
|
fireEvent.click(getAllByLabelText('Actions')[0]);
|
110
110
|
expect(getAllByLabelText('Actions')[0]).toHaveAttribute('aria-expanded', 'true');
|
111
|
-
fireEvent.click(getByText('Remove'));
|
111
|
+
fireEvent.click(getByText('Remove from environments'));
|
112
112
|
await patientlyWaitFor(() => {
|
113
113
|
expect(getByText('Remove Version')).toBeInTheDocument();
|
114
114
|
});
|
@@ -180,7 +180,7 @@ test('Can open Remove wizard and remove version from environment with hosts', as
|
|
180
180
|
expect(getAllByLabelText('Actions')[0]).toHaveAttribute('aria-expanded', 'false');
|
181
181
|
fireEvent.click(getAllByLabelText('Actions')[0]);
|
182
182
|
expect(getAllByLabelText('Actions')[0]).toHaveAttribute('aria-expanded', 'true');
|
183
|
-
fireEvent.click(getByText('Remove'));
|
183
|
+
fireEvent.click(getByText('Remove from environments'));
|
184
184
|
await patientlyWaitFor(() => {
|
185
185
|
expect(getByText('Remove Version')).toBeInTheDocument();
|
186
186
|
});
|
@@ -272,7 +272,7 @@ test('Can open Remove wizard and remove version from environment with activation
|
|
272
272
|
expect(getAllByLabelText('Actions')[0]).toHaveAttribute('aria-expanded', 'false');
|
273
273
|
fireEvent.click(getAllByLabelText('Actions')[0]);
|
274
274
|
expect(getAllByLabelText('Actions')[0]).toHaveAttribute('aria-expanded', 'true');
|
275
|
-
fireEvent.click(getByText('Remove'));
|
275
|
+
fireEvent.click(getByText('Remove from environments'));
|
276
276
|
await patientlyWaitFor(() => {
|
277
277
|
expect(getByText('Remove Version')).toBeInTheDocument();
|
278
278
|
});
|
@@ -242,7 +242,6 @@
|
|
242
242
|
"srpm_count": 0,
|
243
243
|
"module_stream_count": 0,
|
244
244
|
"package_count": 8,
|
245
|
-
"ostree_branch_count": null,
|
246
245
|
"ansible_collection_repository_count": 0,
|
247
246
|
"deb_repository_count": 0,
|
248
247
|
"docker_repository_count": 0,
|
@@ -403,7 +402,6 @@
|
|
403
402
|
"srpm_count": 0,
|
404
403
|
"module_stream_count": 0,
|
405
404
|
"package_count": 8,
|
406
|
-
"ostree_branch_count": null,
|
407
405
|
"ansible_collection_repository_count": 0,
|
408
406
|
"deb_repository_count": 0,
|
409
407
|
"docker_repository_count": 0,
|
@@ -562,7 +560,6 @@
|
|
562
560
|
"srpm_count": 0,
|
563
561
|
"module_stream_count": 0,
|
564
562
|
"package_count": 8,
|
565
|
-
"ostree_branch_count": null,
|
566
563
|
"ansible_collection_repository_count": 0,
|
567
564
|
"deb_repository_count": 0,
|
568
565
|
"docker_repository_count": 0,
|
@@ -580,4 +577,4 @@
|
|
580
577
|
}
|
581
578
|
}
|
582
579
|
]
|
583
|
-
}
|
580
|
+
}
|
data/webpack/scenes/ContentViews/Details/Versions/VersionDetails/ContentViewVersionDetails.js
CHANGED
@@ -21,6 +21,7 @@ const ContentViewVersionDetails = ({ cvId, details }) => {
|
|
21
21
|
const { push } = useHistory();
|
22
22
|
const dispatch = useDispatch();
|
23
23
|
const [versionDetails, setVersionDetails] = useState({});
|
24
|
+
const [mounted, setMounted] = useState(true);
|
24
25
|
// Example urls expected:/versions/:id or /versions/:id/repositories.
|
25
26
|
const tab = pathname.split('/')[3];
|
26
27
|
const response = useSelector(state =>
|
@@ -31,10 +32,11 @@ const ContentViewVersionDetails = ({ cvId, details }) => {
|
|
31
32
|
const tableConfigs = getCVVersionTableConfigs({ cvId, versionId });
|
32
33
|
|
33
34
|
useEffect(() => {
|
34
|
-
if (isEmpty(response) && status === STATUS.PENDING) {
|
35
|
+
if (mounted || (isEmpty(response) && status === STATUS.PENDING)) {
|
35
36
|
dispatch(getContentViewVersionDetails(versionId, cvId));
|
36
37
|
}
|
37
|
-
|
38
|
+
return () => { setMounted(false); };
|
39
|
+
}, [dispatch, mounted, setMounted, versionId, cvId, response, status]);
|
38
40
|
|
39
41
|
useDeepCompareEffect(() => {
|
40
42
|
if (loaded) {
|