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,11 +1,14 @@
|
|
1
1
|
import React, { useState, useMemo, useCallback } from 'react';
|
2
2
|
import useDeepCompareEffect from 'use-deep-compare-effect';
|
3
3
|
import { useDispatch, useSelector } from 'react-redux';
|
4
|
+
import { Redirect } from 'react-router-dom';
|
4
5
|
import { STATUS } from 'foremanReact/constants';
|
5
6
|
import PropTypes from 'prop-types';
|
6
|
-
import {
|
7
|
+
import {
|
8
|
+
Form, FormGroup, TextArea, ActionGroup, Button,
|
9
|
+
Modal, ModalVariant, Alert, TextContent, AlertActionCloseButton,
|
10
|
+
} from '@patternfly/react-core';
|
7
11
|
import { translate as __ } from 'foremanReact/common/I18n';
|
8
|
-
|
9
12
|
import {
|
10
13
|
selectEnvironmentPaths,
|
11
14
|
selectEnvironmentPathsStatus,
|
@@ -20,12 +23,15 @@ import ComponentEnvironments from '../ComponentContentViews/ComponentEnvironment
|
|
20
23
|
import Loading from '../../../../components/Loading';
|
21
24
|
|
22
25
|
const ContentViewVersionPromote = ({
|
23
|
-
cvId, versionIdToPromote, versionNameToPromote,
|
26
|
+
cvId, versionIdToPromote, versionNameToPromote,
|
27
|
+
versionEnvironments, setIsOpen, detailsPage,
|
24
28
|
}) => {
|
25
29
|
const [description, setDescription] = useState('');
|
26
30
|
const [userCheckedItems, setUserCheckedItems] = useState([]);
|
27
|
-
const [
|
31
|
+
const [alertDismissed, setAlertDismissed] = useState(false);
|
32
|
+
const [loading, setLoading] = useState(false);
|
28
33
|
const [forcePromote, setForcePromote] = useState([]);
|
34
|
+
const [redirect, setRedirect] = useState(false);
|
29
35
|
const environmentPathResponse = useSelector(selectEnvironmentPaths);
|
30
36
|
const environmentPathStatus = useSelector(selectEnvironmentPathsStatus);
|
31
37
|
const environmentPathLoading = environmentPathStatus === STATUS.PENDING;
|
@@ -39,7 +45,7 @@ const ContentViewVersionPromote = ({
|
|
39
45
|
const dispatch = useDispatch();
|
40
46
|
|
41
47
|
const onPromote = () => {
|
42
|
-
|
48
|
+
setLoading(true);
|
43
49
|
dispatch(promoteContentViewVersion({
|
44
50
|
id: versionIdToPromote,
|
45
51
|
description,
|
@@ -51,13 +57,18 @@ const ContentViewVersionPromote = ({
|
|
51
57
|
|
52
58
|
useDeepCompareEffect(() => {
|
53
59
|
if (promoteResolved && promoteResponse) {
|
54
|
-
setIsOpen(false);
|
55
60
|
dispatch(getContentViewVersions(cvId));
|
61
|
+
if (detailsPage) {
|
62
|
+
setRedirect(true);
|
63
|
+
} else {
|
64
|
+
setIsOpen(false);
|
65
|
+
}
|
56
66
|
}
|
57
67
|
if (promoteError) {
|
58
|
-
|
68
|
+
setLoading(false);
|
59
69
|
}
|
60
|
-
}, [promoteResponse, promoteResolved, promoteError,
|
70
|
+
}, [promoteResponse, promoteResolved, promoteError, detailsPage,
|
71
|
+
setRedirect, setLoading, setIsOpen, dispatch, cvId]);
|
61
72
|
|
62
73
|
const envPathFlat = useMemo(() => {
|
63
74
|
if (!environmentPathLoading) {
|
@@ -88,6 +99,12 @@ const ContentViewVersionPromote = ({
|
|
88
99
|
setForcePromote(userCheckedItems.filter(item => !isValid(item)));
|
89
100
|
}, [userCheckedItems, setForcePromote, isValid]);
|
90
101
|
|
102
|
+
const submitDisabled = loading || userCheckedItems.length === 0;
|
103
|
+
|
104
|
+
if (redirect && detailsPage) {
|
105
|
+
return (<Redirect to="/versions" />);
|
106
|
+
}
|
107
|
+
|
91
108
|
return (
|
92
109
|
<Modal
|
93
110
|
title={__(`Promote version ${versionNameToPromote}`)}
|
@@ -98,10 +115,14 @@ const ContentViewVersionPromote = ({
|
|
98
115
|
}}
|
99
116
|
appendTo={document.body}
|
100
117
|
>
|
101
|
-
{
|
102
|
-
|
103
|
-
<Form
|
104
|
-
|
118
|
+
{loading ?
|
119
|
+
<Loading loadingText={__('Please wait while the task starts..')} /> :
|
120
|
+
<Form onSubmit={(e) => {
|
121
|
+
e.preventDefault();
|
122
|
+
onPromote();
|
123
|
+
}}
|
124
|
+
>
|
125
|
+
<FormGroup label={__('Description')} fieldId="description">
|
105
126
|
<TextArea
|
106
127
|
isRequired
|
107
128
|
type="text"
|
@@ -112,28 +133,34 @@ const ContentViewVersionPromote = ({
|
|
112
133
|
onChange={value => setDescription(value)}
|
113
134
|
/>
|
114
135
|
</FormGroup>
|
115
|
-
|
116
|
-
|
117
|
-
|
118
|
-
|
119
|
-
|
120
|
-
|
121
|
-
|
122
|
-
|
123
|
-
|
124
|
-
|
125
|
-
|
126
|
-
|
127
|
-
|
128
|
-
|
129
|
-
|
130
|
-
|
131
|
-
<
|
136
|
+
{!alertDismissed && forcePromote.length > 0 && (
|
137
|
+
<Alert
|
138
|
+
variant="info"
|
139
|
+
isInline
|
140
|
+
title={__('Force promotion')}
|
141
|
+
actionClose={<AlertActionCloseButton onClose={() => setAlertDismissed(true)} />}
|
142
|
+
>
|
143
|
+
<TextContent>
|
144
|
+
{forcePromote.length > 1 ? __('Selected environments ') : __('Selected environment ')}
|
145
|
+
<ComponentEnvironments environments={forcePromote} />
|
146
|
+
{forcePromote.length > 1 ?
|
147
|
+
__(' are out of the environment path order. The recommended practice is to promote to the next environment in the path.') :
|
148
|
+
__(' is out of the environment path order. The recommended practice is to promote to the next environment in the path.')
|
149
|
+
}
|
150
|
+
</TextContent>
|
151
|
+
</Alert>)}
|
152
|
+
<EnvironmentPaths
|
153
|
+
userCheckedItems={userCheckedItems}
|
154
|
+
setUserCheckedItems={setUserCheckedItems}
|
155
|
+
promotedEnvironments={versionEnvironments}
|
156
|
+
publishing={false}
|
157
|
+
/>
|
158
|
+
<ActionGroup style={{ margin: 0 }}>
|
132
159
|
<Button
|
133
160
|
aria-label="promote_content_view"
|
134
161
|
variant="primary"
|
135
|
-
isDisabled={
|
136
|
-
|
162
|
+
isDisabled={submitDisabled}
|
163
|
+
type="submit"
|
137
164
|
>
|
138
165
|
{__('Promote')}
|
139
166
|
</Button>
|
@@ -142,7 +169,7 @@ const ContentViewVersionPromote = ({
|
|
142
169
|
</Button>
|
143
170
|
</ActionGroup>
|
144
171
|
</Form>
|
145
|
-
|
172
|
+
}
|
146
173
|
</Modal>
|
147
174
|
);
|
148
175
|
};
|
@@ -153,11 +180,13 @@ ContentViewVersionPromote.propTypes = {
|
|
153
180
|
versionNameToPromote: PropTypes.string.isRequired,
|
154
181
|
versionEnvironments: PropTypes.arrayOf(PropTypes.shape({})),
|
155
182
|
setIsOpen: PropTypes.func,
|
183
|
+
detailsPage: PropTypes.bool,
|
156
184
|
};
|
157
185
|
|
158
186
|
ContentViewVersionPromote.defaultProps = {
|
159
187
|
versionEnvironments: [],
|
160
188
|
setIsOpen: null,
|
189
|
+
detailsPage: false,
|
161
190
|
};
|
162
191
|
|
163
192
|
export default ContentViewVersionPromote;
|
@@ -1,7 +1,9 @@
|
|
1
1
|
import React, { Fragment } from 'react';
|
2
2
|
import PropTypes from 'prop-types';
|
3
3
|
import { urlBuilder } from 'foremanReact/common/urlHelpers';
|
4
|
+
import { translate as __ } from 'foremanReact/common/I18n';
|
4
5
|
import ContentConfig from '../../../Content/ContentConfig';
|
6
|
+
import InactiveText from '../../components/InactiveText';
|
5
7
|
|
6
8
|
// type: [plural_name, singular_name, link]
|
7
9
|
const repoLabels = {
|
@@ -14,7 +16,6 @@ const repoLabels = {
|
|
14
16
|
docker_manifest_list: ['container manifest lists', 'container manifest list', 'content/docker_manifest_lists'],
|
15
17
|
docker_tag: ['container tags', 'container tag', 'content/docker_tags'],
|
16
18
|
file: ['files', 'file', 'content/files'],
|
17
|
-
ostree_branch: ['ostree branches', 'ostree branch', 'content/ostree_branches'],
|
18
19
|
package_group: ['package groups', 'package group', 'package_groups'],
|
19
20
|
srpm: ['source RPMs', 'source RPM', 'source_rpms'], // no link?
|
20
21
|
};
|
@@ -46,11 +47,15 @@ const ContentCounts = ({ productId, repoId, counts }) => {
|
|
46
47
|
if (config) {
|
47
48
|
const { pluralLowercase, singularLowercase, pluralLabel } = config.names;
|
48
49
|
info = [pluralLowercase, singularLowercase, pluralLabel];
|
50
|
+
} else if (!info) {
|
51
|
+
info = ['unknown units', 'unknown unit', ''];
|
49
52
|
}
|
50
53
|
// package and rpm are the same
|
51
54
|
if (type !== 'package' && count > 0) allCounts.push(appendCount(type, count, info, productId, repoId));
|
52
55
|
});
|
53
56
|
|
57
|
+
if (!allCounts.length) return <InactiveText text={__('No content')} />;
|
58
|
+
|
54
59
|
return <Fragment>{allCounts}</Fragment>;
|
55
60
|
};
|
56
61
|
|
@@ -1,5 +1,6 @@
|
|
1
1
|
import React, { useState, useEffect, useCallback } from 'react';
|
2
2
|
import useDeepCompareEffect from 'use-deep-compare-effect';
|
3
|
+
import { lowerCase, upperFirst } from 'lodash';
|
3
4
|
import { useSelector, shallowEqual, useDispatch } from 'react-redux';
|
4
5
|
import {
|
5
6
|
Bullseye,
|
@@ -34,7 +35,6 @@ import LastSync from './LastSync';
|
|
34
35
|
import RepoIcon from './RepoIcon';
|
35
36
|
import AddedStatusLabel from '../../../../components/AddedStatusLabel';
|
36
37
|
import SelectableDropdown from '../../../../components/SelectableDropdown';
|
37
|
-
import { capitalize } from '../../../../utils/helpers';
|
38
38
|
import { hasPermission } from '../../helpers';
|
39
39
|
|
40
40
|
const allRepositories = 'All repositories';
|
@@ -95,7 +95,7 @@ const ContentViewRepositories = ({ cvId, details }) => {
|
|
95
95
|
{ title: <Bullseye><RepoIcon type={contentType} /></Bullseye> },
|
96
96
|
{ title: <a href={urlBuilder(`products/${productId}/repositories`, '', id)}>{name}</a> },
|
97
97
|
productName,
|
98
|
-
{ title: <LastSync {...{ lastSyncWords, lastSync }} /> },
|
98
|
+
{ title: <LastSync {...{ startedAt: lastSync?.started_at, lastSyncWords, lastSync }} /> },
|
99
99
|
{ title: <ContentCounts {...{ counts, productId }} repoId={id} /> },
|
100
100
|
{
|
101
101
|
title: <AddedStatusLabel added={addedToCV || statusSelected === ADDED} />,
|
@@ -129,8 +129,8 @@ const ContentViewRepositories = ({ cvId, details }) => {
|
|
129
129
|
allRepoTypes[allRepositories] = 'all';
|
130
130
|
repoTypesResponse.forEach((type) => {
|
131
131
|
const { name } = type;
|
132
|
-
const typeFullName =
|
133
|
-
repoTypeNames[name] :
|
132
|
+
const typeFullName = name in repoTypeNames ?
|
133
|
+
repoTypeNames[name] : upperFirst(lowerCase(name));
|
134
134
|
allRepoTypes[`${typeFullName} Repositories`] = name;
|
135
135
|
});
|
136
136
|
setRepoTypes(allRepoTypes);
|
@@ -209,9 +209,6 @@ const ContentViewRepositories = ({ cvId, details }) => {
|
|
209
209
|
const defaultFilters = [allRepositories, ALL_STATUSES];
|
210
210
|
|
211
211
|
const dropdownItems = [
|
212
|
-
<DropdownItem aria-label="bulk_add" key="bulk_add" isDisabled={!hasNotAddedSelected} component="button" onClick={addBulk}>
|
213
|
-
{__('Add')}
|
214
|
-
</DropdownItem>,
|
215
212
|
<DropdownItem aria-label="bulk_remove" key="bulk_remove" isDisabled={!hasAddedSelected} component="button" onClick={removeBulk}>
|
216
213
|
{__('Remove')}
|
217
214
|
</DropdownItem>,
|
@@ -255,7 +252,7 @@ const ContentViewRepositories = ({ cvId, details }) => {
|
|
255
252
|
</SplitItem>
|
256
253
|
<SplitItem>
|
257
254
|
<SelectableDropdown
|
258
|
-
items={[ADDED, NOT_ADDED
|
255
|
+
items={[ALL_STATUSES, ADDED, NOT_ADDED]}
|
259
256
|
title={__('Status')}
|
260
257
|
selected={statusSelected}
|
261
258
|
setSelected={setStatusSelected}
|
@@ -1,10 +1,21 @@
|
|
1
1
|
import React, { Fragment } from 'react';
|
2
|
-
import {
|
2
|
+
import {
|
3
|
+
CheckCircleIcon,
|
4
|
+
ExclamationTriangleIcon,
|
5
|
+
ExclamationCircleIcon,
|
6
|
+
InProgressIcon,
|
7
|
+
} from '@patternfly/react-icons';
|
8
|
+
import { FormattedDate } from 'react-intl';
|
9
|
+
import { Tooltip, TooltipPosition } from '@patternfly/react-core';
|
10
|
+
|
3
11
|
import { foremanUrl } from 'foremanReact/common/helpers';
|
4
12
|
import PropTypes from 'prop-types';
|
13
|
+
import { translate as __ } from 'foremanReact/common/I18n';
|
5
14
|
import InactiveText from '../../components/InactiveText';
|
6
15
|
|
7
|
-
const LastSync = ({
|
16
|
+
const LastSync = ({
|
17
|
+
lastSyncWords, lastSync, emptyMessage, startedAt,
|
18
|
+
}) => {
|
8
19
|
if (lastSync && lastSyncWords) {
|
9
20
|
let Icon;
|
10
21
|
let color = 'black';
|
@@ -26,16 +37,50 @@ const LastSync = ({ lastSyncWords, lastSync, emptyMessage }) => {
|
|
26
37
|
Icon = Fragment;
|
27
38
|
}
|
28
39
|
|
40
|
+
if (startedAt) {
|
41
|
+
return (
|
42
|
+
<Tooltip
|
43
|
+
position={TooltipPosition.top}
|
44
|
+
content={
|
45
|
+
<FormattedDate
|
46
|
+
value={startedAt}
|
47
|
+
day="2-digit"
|
48
|
+
month="long"
|
49
|
+
hour="2-digit"
|
50
|
+
minute="2-digit"
|
51
|
+
year="numeric"
|
52
|
+
/>}
|
53
|
+
>
|
54
|
+
<a
|
55
|
+
href={foremanUrl(`/foreman_tasks/tasks/${id}/`)}
|
56
|
+
style={{
|
57
|
+
display: 'inline-flex', alignItems: 'center', margin: 0,
|
58
|
+
}}
|
59
|
+
>
|
60
|
+
<Icon style={{ color, marginRight: '5px' }} />
|
61
|
+
<span>{lastSyncWords}{__(' ago')}</span>
|
62
|
+
</a >
|
63
|
+
</Tooltip >
|
64
|
+
);
|
65
|
+
}
|
66
|
+
|
29
67
|
return (
|
30
|
-
<a
|
31
|
-
|
32
|
-
|
33
|
-
|
68
|
+
<a
|
69
|
+
href={foremanUrl(`/foreman_tasks/tasks/${id}/`)}
|
70
|
+
style={{
|
71
|
+
display: 'flex', alignItems: 'center',
|
72
|
+
}}
|
73
|
+
>
|
74
|
+
<Icon style={{ color, marginRight: '5px' }} />
|
75
|
+
<span>{lastSyncWords}{__(' ago')}</span>
|
76
|
+
</a >);
|
34
77
|
}
|
78
|
+
|
35
79
|
return <InactiveText text={emptyMessage} />;
|
36
80
|
};
|
37
81
|
|
38
82
|
LastSync.propTypes = {
|
83
|
+
startedAt: PropTypes.string,
|
39
84
|
lastSyncWords: PropTypes.string,
|
40
85
|
lastSync: PropTypes.shape({
|
41
86
|
id: PropTypes.string, // API returns string
|
@@ -45,9 +90,10 @@ LastSync.propTypes = {
|
|
45
90
|
};
|
46
91
|
|
47
92
|
LastSync.defaultProps = {
|
48
|
-
|
49
|
-
|
50
|
-
|
93
|
+
startedAt: undefined,
|
94
|
+
lastSyncWords: undefined,
|
95
|
+
lastSync: undefined,
|
96
|
+
emptyMessage: 'Not synced',
|
51
97
|
};
|
52
98
|
|
53
99
|
export default LastSync;
|
data/webpack/scenes/ContentViews/Details/Repositories/__tests__/contentViewAddRemove.test.js
CHANGED
@@ -38,6 +38,8 @@ afterEach(() => {
|
|
38
38
|
assertNockRequest(autoSearchScope);
|
39
39
|
});
|
40
40
|
|
41
|
+
jest.mock('react-intl', () => ({ addLocaleData: () => { }, FormattedDate: () => 'mocked' }));
|
42
|
+
|
41
43
|
test('Can enable and disable add repositories button', async (done) => {
|
42
44
|
const autocompleteScope = mockAutocomplete(nockInstance, autocompleteUrl);
|
43
45
|
|
data/webpack/scenes/ContentViews/Details/Repositories/__tests__/contentViewDetailRepos.fixtures.json
CHANGED
@@ -62,7 +62,6 @@
|
|
62
62
|
},
|
63
63
|
"content_label": "Orion_Lagoon_Nebula_Butterfly",
|
64
64
|
"content_counts": {
|
65
|
-
"ostree_branch": 0,
|
66
65
|
"docker_manifest": 0,
|
67
66
|
"docker_manifest_list": 0,
|
68
67
|
"docker_tag": 0,
|
@@ -131,7 +130,6 @@
|
|
131
130
|
},
|
132
131
|
"content_label": "Orion_Lagoon_Nebula_Coma",
|
133
132
|
"content_counts": {
|
134
|
-
"ostree_branch": 1,
|
135
133
|
"docker_manifest": 2,
|
136
134
|
"docker_manifest_list": 2,
|
137
135
|
"docker_tag": 0,
|
@@ -1,47 +1,68 @@
|
|
1
1
|
import React from 'react';
|
2
2
|
import PropTypes from 'prop-types';
|
3
3
|
import { Link } from 'react-router-dom';
|
4
|
-
import {
|
5
|
-
Text,
|
6
|
-
TextContent,
|
7
|
-
TextVariants,
|
8
|
-
} from '@patternfly/react-core';
|
9
4
|
import { translate as __ } from 'foremanReact/common/I18n';
|
10
5
|
import { urlBuilder } from 'foremanReact/common/urlHelpers';
|
6
|
+
import ContentConfig from './../../../Content/ContentConfig';
|
7
|
+
import InactiveText from '../../components/InactiveText';
|
11
8
|
|
12
9
|
const ContentViewVersionContent = ({ cvId, versionId, cvVersion }) => {
|
13
10
|
const {
|
14
|
-
deb_count: debCount,
|
15
|
-
docker_manifest_count: dockerManifestCount,
|
16
|
-
docker_tag_count: dockerTagCount,
|
17
|
-
file_count: fileCount,
|
18
|
-
module_stream_count: moduleStreamCount,
|
19
|
-
ansible_collection_count: ansibleCollectionCount,
|
11
|
+
deb_count: debCount = 0,
|
12
|
+
docker_manifest_count: dockerManifestCount = 0,
|
13
|
+
docker_tag_count: dockerTagCount = 0,
|
14
|
+
file_count: fileCount = 0,
|
15
|
+
module_stream_count: moduleStreamCount = 0,
|
16
|
+
ansible_collection_count: ansibleCollectionCount = 0,
|
20
17
|
} = cvVersion;
|
21
18
|
|
19
|
+
|
20
|
+
const genericContentTypes = ContentConfig().filter(({ names: { singularLabel } }) => {
|
21
|
+
// Ansible Collections has a tab in version details so it's handled separately below.
|
22
|
+
if (singularLabel === 'ansible_collection') return false;
|
23
|
+
const countLabel = `${singularLabel}_count`;
|
24
|
+
return !!cvVersion[countLabel];
|
25
|
+
}).map(({ names: { singularLabel, singularLowercase, pluralLowercase } }) => {
|
26
|
+
const countParam = `${singularLabel}_count`;
|
27
|
+
const count = cvVersion[countParam];
|
28
|
+
return {
|
29
|
+
label: count > 1 ? pluralLowercase : singularLowercase,
|
30
|
+
count,
|
31
|
+
};
|
32
|
+
});
|
33
|
+
|
34
|
+
const noCounts =
|
35
|
+
!Number(debCount) && !Number(dockerManifestCount) && !Number(dockerTagCount) &&
|
36
|
+
!Number(fileCount) && !Number(moduleStreamCount) && !Number(ansibleCollectionCount) &&
|
37
|
+
!genericContentTypes?.length;
|
38
|
+
|
39
|
+
if (noCounts) {
|
40
|
+
return <InactiveText text={__('No content')} />;
|
41
|
+
}
|
42
|
+
|
22
43
|
return (
|
23
|
-
|
24
|
-
{
|
44
|
+
<>
|
45
|
+
{moduleStreamCount > 0 &&
|
25
46
|
<>
|
26
47
|
<Link to={`/versions/${versionId}/moduleStreams`}>
|
27
48
|
{`${moduleStreamCount} Module streams`}
|
28
49
|
</Link><br />
|
29
|
-
</>
|
50
|
+
</>
|
30
51
|
}
|
31
|
-
{
|
52
|
+
{debCount > 0 &&
|
32
53
|
<>
|
33
54
|
<Link to={`/versions/${versionId}/debPackages`}>
|
34
55
|
{`${debCount} Deb packages`}
|
35
56
|
</Link><br />
|
36
|
-
</>
|
57
|
+
</>
|
37
58
|
}
|
38
|
-
{
|
59
|
+
{dockerManifestCount > 0 && dockerTagCount > 0 &&
|
39
60
|
<>
|
40
61
|
<Link to={`/versions/${versionId}/dockerTags`}>
|
41
62
|
{`${dockerTagCount} Docker tags`}
|
42
63
|
</Link><br />
|
43
64
|
<a href={urlBuilder(`content_views/${cvId}#/versions/${versionId}/dockerTags`, '')}>{`${dockerManifestCount} Container manifests`}</a><br />
|
44
|
-
</>
|
65
|
+
</>
|
45
66
|
}
|
46
67
|
{fileCount > 0 &&
|
47
68
|
<>
|
@@ -49,19 +70,17 @@ const ContentViewVersionContent = ({ cvId, versionId, cvVersion }) => {
|
|
49
70
|
</>
|
50
71
|
}
|
51
72
|
{ansibleCollectionCount > 0 &&
|
52
|
-
|
53
|
-
|
54
|
-
|
73
|
+
<>
|
74
|
+
<a href={urlBuilder(`content_views/${cvId}#/versions/${versionId}/ansibleCollections`, '')}>{`${ansibleCollectionCount} Collections`}</a><br />
|
75
|
+
</>
|
55
76
|
}
|
56
|
-
{
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
</TextContent>
|
62
|
-
)
|
77
|
+
{genericContentTypes?.length > 0 &&
|
78
|
+
genericContentTypes.map(({ label, count }) => (
|
79
|
+
<span key={label} style={{ whiteSpace: 'pre-line' }}>
|
80
|
+
{`${count} ${label}`}
|
81
|
+
</span>))
|
63
82
|
}
|
64
|
-
|
83
|
+
</>
|
65
84
|
);
|
66
85
|
};
|
67
86
|
|
@@ -13,12 +13,12 @@ const ContentViewVersionEnvironments = ({ environments }) => {
|
|
13
13
|
|
14
14
|
return environments.map(env => (
|
15
15
|
<React.Fragment key={env.id}>
|
16
|
-
<Flex>
|
16
|
+
<Flex style={{ margin: '4px 0' }} >
|
17
17
|
<FlexItem>
|
18
18
|
<Label isTruncated color="purple" href={`/lifecycle_environments/${env.id}`}>{env.name}</Label>
|
19
19
|
</FlexItem>
|
20
20
|
<FlexItem>
|
21
|
-
<InactiveText text={` ${env.publish_date} ago`}
|
21
|
+
<InactiveText text={` ${env.publish_date} ago`} />
|
22
22
|
</FlexItem>
|
23
23
|
</Flex>
|
24
24
|
</React.Fragment>));
|
@@ -15,6 +15,10 @@ const ContentViewVersionErrata = ({ cvId, versionId, errataCounts }) => {
|
|
15
15
|
total,
|
16
16
|
} = errataCounts;
|
17
17
|
|
18
|
+
if (!Number(total)) {
|
19
|
+
return <InactiveText text={__('No applicable errata')} />;
|
20
|
+
}
|
21
|
+
|
18
22
|
const errataIcons = {
|
19
23
|
security: SecurityIcon,
|
20
24
|
bugfix: BugIcon,
|
@@ -31,15 +35,13 @@ const ContentViewVersionErrata = ({ cvId, versionId, errataCounts }) => {
|
|
31
35
|
);
|
32
36
|
});
|
33
37
|
|
34
|
-
if (total === 0) {
|
35
|
-
return <InactiveText text={__('No errata')} />;
|
36
|
-
}
|
37
|
-
|
38
38
|
return (
|
39
|
-
|
40
|
-
<a href={urlBuilder(`content_views/${cvId}#/versions/${versionId}/errata`, '')}>
|
39
|
+
<>
|
40
|
+
<a href={urlBuilder(`content_views/${cvId}#/versions/${versionId}/errata`, '')}>
|
41
|
+
{total || 0}{' '}
|
42
|
+
</a>
|
41
43
|
( <ErrataLinkwithIcon /> )
|
42
|
-
|
44
|
+
</>
|
43
45
|
);
|
44
46
|
};
|
45
47
|
|