katello 4.13.1 → 4.14.0.rc1.1
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/assets/javascripts/katello/hosts/host_and_hostgroup_edit.js +12 -8
- data/app/assets/javascripts/katello/locale/bn/katello.js +274 -22
- data/app/assets/javascripts/katello/locale/bn_IN/katello.js +274 -22
- data/app/assets/javascripts/katello/locale/ca/katello.js +274 -22
- data/app/assets/javascripts/katello/locale/cs/katello.js +274 -22
- data/app/assets/javascripts/katello/locale/cs_CZ/katello.js +275 -23
- data/app/assets/javascripts/katello/locale/de/katello.js +280 -28
- data/app/assets/javascripts/katello/locale/de_AT/katello.js +274 -22
- data/app/assets/javascripts/katello/locale/de_DE/katello.js +274 -22
- data/app/assets/javascripts/katello/locale/el/katello.js +274 -22
- data/app/assets/javascripts/katello/locale/en/katello.js +274 -22
- data/app/assets/javascripts/katello/locale/en_GB/katello.js +274 -22
- data/app/assets/javascripts/katello/locale/en_US/katello.js +274 -22
- data/app/assets/javascripts/katello/locale/es/katello.js +276 -24
- data/app/assets/javascripts/katello/locale/et_EE/katello.js +274 -22
- data/app/assets/javascripts/katello/locale/fr/katello.js +283 -31
- data/app/assets/javascripts/katello/locale/gl/katello.js +274 -22
- data/app/assets/javascripts/katello/locale/gu/katello.js +274 -22
- data/app/assets/javascripts/katello/locale/he_IL/katello.js +274 -22
- data/app/assets/javascripts/katello/locale/hi/katello.js +274 -22
- data/app/assets/javascripts/katello/locale/id/katello.js +274 -22
- data/app/assets/javascripts/katello/locale/it/katello.js +274 -22
- data/app/assets/javascripts/katello/locale/ja/katello.js +283 -31
- data/app/assets/javascripts/katello/locale/ka/katello.js +280 -28
- data/app/assets/javascripts/katello/locale/kn/katello.js +274 -22
- data/app/assets/javascripts/katello/locale/ko/katello.js +274 -22
- data/app/assets/javascripts/katello/locale/ml_IN/katello.js +274 -22
- data/app/assets/javascripts/katello/locale/mr/katello.js +274 -22
- data/app/assets/javascripts/katello/locale/nl_NL/katello.js +274 -22
- data/app/assets/javascripts/katello/locale/or/katello.js +274 -22
- data/app/assets/javascripts/katello/locale/pa/katello.js +274 -22
- data/app/assets/javascripts/katello/locale/pl/katello.js +274 -22
- data/app/assets/javascripts/katello/locale/pl_PL/katello.js +274 -22
- data/app/assets/javascripts/katello/locale/pt/katello.js +274 -22
- data/app/assets/javascripts/katello/locale/pt_BR/katello.js +276 -24
- data/app/assets/javascripts/katello/locale/ro/katello.js +274 -22
- data/app/assets/javascripts/katello/locale/ro_RO/katello.js +274 -22
- data/app/assets/javascripts/katello/locale/ru/katello.js +274 -22
- data/app/assets/javascripts/katello/locale/sl/katello.js +274 -22
- data/app/assets/javascripts/katello/locale/sv_SE/katello.js +274 -22
- data/app/assets/javascripts/katello/locale/ta/katello.js +274 -22
- data/app/assets/javascripts/katello/locale/ta_IN/katello.js +274 -22
- data/app/assets/javascripts/katello/locale/te/katello.js +274 -22
- data/app/assets/javascripts/katello/locale/tr/katello.js +274 -22
- data/app/assets/javascripts/katello/locale/vi/katello.js +274 -22
- data/app/assets/javascripts/katello/locale/vi_VN/katello.js +274 -22
- data/app/assets/javascripts/katello/locale/zh/katello.js +274 -22
- data/app/assets/javascripts/katello/locale/zh_CN/katello.js +283 -31
- data/app/assets/javascripts/katello/locale/zh_TW/katello.js +274 -22
- data/app/controllers/katello/api/registry/registry_proxies_controller.rb +118 -74
- data/app/controllers/katello/api/rhsm/candlepin_proxies_controller.rb +15 -10
- data/app/controllers/katello/api/v2/activation_keys_controller.rb +1 -1
- data/app/controllers/katello/api/v2/api_controller.rb +7 -0
- data/app/controllers/katello/api/v2/content_view_versions_controller.rb +4 -4
- data/app/controllers/katello/api/v2/debs_controller.rb +3 -2
- data/app/controllers/katello/api/v2/environments_controller.rb +2 -4
- data/app/controllers/katello/api/v2/host_contents_controller.rb +8 -3
- data/app/controllers/katello/api/v2/host_errata_controller.rb +4 -4
- data/app/controllers/katello/api/v2/host_packages_controller.rb +2 -2
- data/app/controllers/katello/api/v2/organizations_controller.rb +1 -1
- data/app/controllers/katello/api/v2/packages_controller.rb +13 -3
- data/app/controllers/katello/api/v2/repositories_bulk_actions_controller.rb +6 -2
- data/app/controllers/katello/api/v2/repositories_controller.rb +3 -4
- data/app/controllers/katello/api/v2/repository_sets_controller.rb +13 -14
- data/app/controllers/katello/api/v2/subscriptions_controller.rb +15 -9
- data/app/controllers/katello/api/v2/sync_controller.rb +2 -2
- data/app/controllers/katello/application_controller.rb +1 -1
- data/app/controllers/katello/concerns/api/v2/authorization.rb +3 -2
- data/app/controllers/katello/concerns/api/v2/hosts_controller_extensions.rb +28 -0
- data/app/controllers/katello/concerns/api/v2/registration_commands_controller_extensions.rb +1 -1
- data/app/controllers/katello/concerns/api/v2/registration_controller_extensions.rb +4 -0
- data/app/controllers/katello/concerns/api/v2/repository_content_controller.rb +4 -3
- data/app/controllers/katello/concerns/hosts_controller_extensions.rb +2 -4
- data/app/controllers/katello/remote_execution_controller.rb +53 -58
- data/app/helpers/katello/hosts_and_hostgroups_helper.rb +19 -2
- data/app/helpers/katello/katello_urls_helper.rb +1 -1
- data/app/lib/actions/katello/alternate_content_source/alternate_content_source_common.rb +1 -1
- data/app/lib/actions/katello/alternate_content_source/update.rb +2 -1
- data/app/lib/actions/katello/capsule_content/verify_checksum.rb +1 -2
- data/app/lib/actions/katello/content_view/publish.rb +1 -0
- data/app/lib/actions/katello/content_view_version/create_repos.rb +1 -0
- data/app/lib/actions/katello/content_view_version/incremental_update.rb +3 -2
- data/app/lib/actions/katello/environment/{publish_repositories.rb → publish_container_repositories.rb} +10 -8
- data/app/lib/actions/katello/foreman/content_update.rb +4 -6
- data/app/lib/actions/katello/host/hypervisors_update.rb +6 -4
- data/app/lib/actions/katello/repository/create.rb +4 -4
- data/app/lib/actions/katello/repository/import_upload.rb +4 -6
- data/app/lib/actions/katello/repository/metadata_generate.rb +1 -0
- data/app/lib/actions/katello/repository/update.rb +3 -3
- data/app/lib/actions/katello/repository_set/enable_repository.rb +5 -6
- data/app/lib/actions/middleware/backend_services_check.rb +3 -2
- data/app/lib/actions/pulp3/abstract_async_task.rb +2 -4
- data/app/lib/actions/pulp3/capsule_content/verify_checksum.rb +1 -2
- data/app/lib/actions/pulp3/orchestration/repository/copy_all_units.rb +5 -1
- data/app/lib/actions/pulp3/orchestration/repository/delete.rb +5 -2
- data/app/lib/actions/pulp3/repository/save_version.rb +3 -5
- data/app/lib/katello/concerns/base_template_scope_extensions.rb +5 -9
- data/app/lib/katello/errors.rb +1 -0
- data/app/lib/katello/http_resource.rb +1 -0
- data/app/lib/katello/lazy_accessor.rb +1 -1
- data/app/lib/katello/resources/candlepin/candlepin_ping.rb +0 -5
- data/app/lib/katello/resources/candlepin/owner.rb +1 -1
- data/app/lib/katello/resources/candlepin/pool.rb +1 -2
- data/app/lib/katello/resources/candlepin/upstream_job.rb +1 -1
- data/app/lib/katello/resources/cdn.rb +3 -2
- data/app/lib/katello/resources/discovery/yum.rb +3 -3
- data/app/lib/katello/util/cdn_var_substitutor.rb +5 -3
- data/app/lib/katello/util/data.rb +3 -2
- data/app/lib/katello/util/errata.rb +4 -3
- data/app/lib/katello/util/package.rb +3 -3
- data/app/lib/katello/util/path_with_substitutions.rb +1 -1
- data/app/lib/katello/util/report_table.rb +3 -2
- data/app/lib/katello/util/url_matcher.rb +1 -1
- data/app/lib/katello/validators/alternate_content_source_path_validator.rb +4 -3
- data/app/lib/katello/validators/alternate_content_source_products_validator.rb +5 -7
- data/app/lib/katello/validators/container_image_name_validator.rb +1 -1
- data/app/lib/katello/validators/katello_name_format_validator.rb +2 -2
- data/app/lib/katello/validators/no_trailing_space_validator.rb +2 -2
- data/app/lib/katello/validators/prior_validator.rb +2 -2
- data/app/lib/katello/validators/product_unique_attribute_validator.rb +2 -4
- data/app/models/katello/activation_key.rb +4 -6
- data/app/models/katello/alternate_content_source.rb +1 -1
- data/app/models/katello/authorization/host_tracer.rb +1 -2
- data/app/models/katello/authorization/product.rb +1 -1
- data/app/models/katello/candlepin/repository_mapper.rb +2 -2
- data/app/models/katello/concerns/host_managed_extensions.rb +41 -10
- data/app/models/katello/concerns/hostgroup_extensions.rb +2 -4
- data/app/models/katello/concerns/location_extensions.rb +2 -4
- data/app/models/katello/concerns/operatingsystem_extensions.rb +84 -16
- data/app/models/katello/concerns/smart_proxy_extensions.rb +4 -4
- data/app/models/katello/concerns/subscription_facet_host_extensions.rb +2 -0
- data/app/models/katello/content_view.rb +5 -1
- data/app/models/katello/content_view_environment.rb +19 -4
- data/app/models/katello/content_view_environment_content_facet.rb +11 -0
- data/app/models/katello/erratum.rb +1 -1
- data/app/models/katello/event.rb +1 -1
- data/app/models/katello/glue/provider.rb +1 -2
- data/app/models/katello/hash_util.rb +1 -1
- data/app/models/katello/host/content_facet.rb +16 -3
- data/app/models/katello/host/subscription_facet.rb +27 -4
- data/app/models/katello/host_collection.rb +12 -8
- data/app/models/katello/pool.rb +5 -1
- data/app/models/katello/product.rb +7 -4
- data/app/models/katello/provider.rb +1 -2
- data/app/models/katello/repository.rb +18 -4
- data/app/models/katello/root_repository.rb +19 -0
- data/app/models/katello/rpm.rb +2 -2
- data/app/models/katello/subscription_facet_pool.rb +1 -1
- data/app/models/katello/sync_plan.rb +5 -4
- data/app/models/katello/task_status.rb +18 -18
- data/app/presenters/katello/product_host_count_presenter.rb +10 -0
- data/app/services/katello/candlepin/consumer.rb +11 -11
- data/app/services/katello/candlepin/message_handler.rb +3 -2
- data/app/services/katello/content_unit_indexer.rb +6 -0
- data/app/services/katello/pulp3/alternate_content_source.rb +1 -3
- data/app/services/katello/pulp3/api/core.rb +1 -1
- data/app/services/katello/pulp3/api/docker.rb +10 -0
- data/app/services/katello/pulp3/content_view_version/export.rb +1 -0
- data/app/services/katello/pulp3/content_view_version/import.rb +6 -4
- data/app/services/katello/pulp3/content_view_version/importable_products.rb +1 -3
- data/app/services/katello/pulp3/repository/apt.rb +4 -16
- data/app/services/katello/pulp3/repository/yum.rb +9 -5
- data/app/services/katello/pulp3/repository.rb +2 -2
- data/app/services/katello/pulp3/repository_mirror.rb +2 -9
- data/app/services/katello/pulp3/task.rb +4 -2
- data/app/services/katello/registration_manager.rb +13 -3
- data/app/services/katello/smart_proxy_helper.rb +1 -0
- data/app/views/dashboard/_host_collection_widget.html.erb +5 -4
- data/app/views/foreman/job_templates/install_errata.erb +2 -0
- data/app/views/foreman/job_templates/install_errata_-_katello_ansible_default.erb +2 -0
- data/app/views/foreman/job_templates/install_errata_by_search_query.erb +2 -0
- data/app/views/foreman/job_templates/install_errata_by_search_query_-_katello_ansible_default.erb +3 -1
- data/app/views/foreman/job_templates/install_packages_by_search_query_-_katello_ansible_default.erb +1 -1
- data/app/views/foreman/job_templates/remove_packages_by_search_query_-_katello_ansible_default.erb +2 -2
- data/app/views/foreman/job_templates/resolve_traces.erb +5 -1
- data/app/views/foreman/job_templates/update_packages_by_search_query_-_katello_ansible_default.erb +1 -1
- data/app/views/foreman/job_templates/upload_profile.erb +2 -0
- data/app/views/foreman/smart_proxies/_reclaim_space.html.erb +7 -5
- data/app/views/katello/api/v2/content_facet/base.json.rabl +18 -2
- data/app/views/katello/api/v2/packages/thindex.json.rabl +6 -0
- data/app/views/katello/api/v2/repositories/show.json.rabl +8 -8
- data/app/views/katello/api/v2/repository_sets/show.json.rabl +1 -1
- data/app/views/katello/api/v2/subscription_facet/base.json.rabl +1 -1
- data/app/views/katello/api/v2/subscriptions/index.json.rabl +1 -0
- data/app/views/katello/api/v2/subscriptions/show.json.rabl +1 -0
- data/app/views/overrides/activation_keys/_host_environment_select.html.erb +14 -11
- data/app/views/overrides/activation_keys/_host_synced_content_select.html.erb +4 -4
- data/config/routes/api/v2.rb +3 -1
- data/config/routes.rb +1 -3
- data/db/migrate/20160114200145_add_mirror_on_sync_to_repositories.rb +1 -0
- data/db/migrate/20160131182301_add_download_policy_to_katello_repositories.rb +1 -0
- data/db/migrate/20210119162528_delete_puppet_and_ostree_repos.rb +3 -0
- data/db/migrate/20240522165308_add_priority_to_content_view_environment_content_facet.rb +5 -0
- data/db/migrate/20240621121212_katello_repository_debs_id_bigint.rb +6 -0
- data/db/migrate/20240729192228_add_convert2rhel_to_host_facets.rb +9 -0
- data/db/seeds.d/102-organizations.rb +5 -7
- data/db/seeds.d/150-module_job_templates.rb +7 -9
- data/db/seeds.d/75-job_templates.rb +9 -16
- data/engines/bastion_katello/README.md +3 -0
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-hosts/content/content-host-errata.controller.js +3 -3
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/debs/details/views/deb-info.html +6 -6
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/errata/details/views/erratum-content-hosts.html +2 -2
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/i18n/bastion_katello.pot +4 -4
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/packages/details/views/package-info.html +6 -6
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/products/details/repositories/details/views/repository-info.html +28 -27
- data/engines/bastion_katello/lib/bastion_katello/engine.rb +2 -2
- data/lib/katello/engine.rb +1 -8
- data/lib/katello/permission_creator.rb +3 -2
- data/lib/katello/plugin.rb +31 -27
- data/lib/katello/tasks/clean_old_file_repos.rake +2 -4
- data/lib/katello/tasks/reset.rake +3 -4
- data/lib/katello/version.rb +1 -1
- data/lib/katello.rb +0 -2
- data/lib/monkeys/ar_postgres_evr_t.rb +2 -0
- data/locale/action_names.rb +1 -1
- data/locale/bn/katello.po +274 -22
- data/locale/bn_IN/katello.po +274 -22
- data/locale/ca/katello.po +274 -22
- data/locale/cs/katello.po +274 -22
- data/locale/cs_CZ/katello.po +275 -23
- data/locale/de/katello.po +280 -28
- data/locale/de_AT/katello.po +274 -22
- data/locale/de_DE/katello.po +274 -22
- data/locale/el/katello.po +274 -22
- data/locale/en/katello.po +274 -22
- data/locale/en_GB/katello.po +274 -22
- data/locale/en_US/katello.po +274 -22
- data/locale/es/katello.po +276 -24
- data/locale/et_EE/katello.po +274 -22
- data/locale/fr/katello.po +283 -31
- data/locale/gl/katello.po +274 -22
- data/locale/gu/katello.po +274 -22
- data/locale/he_IL/katello.po +274 -22
- data/locale/hi/katello.po +274 -22
- data/locale/id/katello.po +274 -22
- data/locale/it/katello.po +274 -22
- data/locale/ja/katello.po +283 -31
- data/locale/ka/katello.po +280 -28
- data/locale/katello.pot +1001 -527
- data/locale/kn/katello.po +274 -22
- data/locale/ko/katello.po +274 -22
- data/locale/ml_IN/katello.po +274 -22
- data/locale/mr/katello.po +274 -22
- data/locale/nl_NL/katello.po +274 -22
- data/locale/or/katello.po +274 -22
- data/locale/pa/katello.po +274 -22
- data/locale/pl/katello.po +274 -22
- data/locale/pl_PL/katello.po +274 -22
- data/locale/pt/katello.po +274 -22
- data/locale/pt_BR/katello.po +276 -24
- data/locale/ro/katello.po +274 -22
- data/locale/ro_RO/katello.po +274 -22
- data/locale/ru/katello.po +274 -22
- data/locale/sl/katello.po +274 -22
- data/locale/sv_SE/katello.po +274 -22
- data/locale/ta/katello.po +274 -22
- data/locale/ta_IN/katello.po +274 -22
- data/locale/te/katello.po +274 -22
- data/locale/tr/katello.po +274 -22
- data/locale/vi/katello.po +274 -22
- data/locale/vi_VN/katello.po +274 -22
- data/locale/zh/katello.po +274 -22
- data/locale/zh_CN/katello.po +283 -31
- data/locale/zh_TW/katello.po +274 -22
- data/webpack/ForemanColumnExtensions/index.js +44 -1
- data/webpack/components/Table/TableWrapper.js +6 -0
- data/webpack/components/extensions/HostDetails/Cards/ContentViewDetailsCard/ChangeHostCVModal.js +24 -3
- data/webpack/components/extensions/HostDetails/Cards/ContentViewDetailsCard/ContentViewDetailsCard.js +124 -56
- data/webpack/components/extensions/HostDetails/Cards/ContentViewDetailsCard/HostContentViewActions.js +2 -3
- data/webpack/components/extensions/HostDetails/Cards/ContentViewDetailsCard/__tests__/contentViewDetailsCard.test.js +44 -10
- data/webpack/components/extensions/HostDetails/Tabs/RemoteExecutionActions.js +83 -31
- data/webpack/components/extensions/HostDetails/Tabs/RemoteExecutionConstants.js +1 -0
- data/webpack/components/extensions/HostDetails/Tabs/RemoteExecutionHooks.js +1 -1
- data/webpack/components/extensions/HostDetails/Tabs/__tests__/remoteExecutionActions.test.js +44 -0
- data/webpack/components/extensions/HostDetails/Tabs/customizedRexUrlHelpers.js +22 -7
- data/webpack/components/extensions/Hosts/ActionsBar/ActionsBar.scss +14 -0
- data/webpack/components/extensions/Hosts/ActionsBar/index.js +82 -23
- data/webpack/components/extensions/Hosts/BulkActions/BulkChangeHostCVModal/index.js +5 -2
- data/webpack/components/extensions/Hosts/BulkActions/BulkErrataWizard/02_BulkErrataTable.js +171 -0
- data/webpack/components/extensions/Hosts/BulkActions/BulkErrataWizard/04_Review.js +160 -0
- data/webpack/components/extensions/Hosts/BulkActions/BulkErrataWizard/04_ReviewFooter.js +99 -0
- data/webpack/components/extensions/Hosts/BulkActions/BulkErrataWizard/BulkErrataWizard.js +157 -0
- data/webpack/components/extensions/Hosts/BulkActions/BulkErrataWizard/index.js +24 -0
- data/webpack/components/extensions/Hosts/BulkActions/BulkPackagesWizard/02_BulkPackagesTable.js +157 -0
- data/webpack/components/extensions/Hosts/BulkActions/BulkPackagesWizard/04_Review.js +168 -0
- data/webpack/components/extensions/Hosts/BulkActions/BulkPackagesWizard/04_ReviewFooter.js +141 -0
- data/webpack/components/extensions/Hosts/BulkActions/BulkPackagesWizard/BulkPackagesWizard.js +252 -0
- data/webpack/components/extensions/Hosts/BulkActions/BulkPackagesWizard/index.js +24 -0
- data/webpack/components/extensions/Hosts/BulkActions/HostReview.js +176 -0
- data/webpack/components/extensions/Hosts/TableRowActions/index.js +17 -0
- data/webpack/global_index.js +11 -3
- data/webpack/redux/actions/RedHatRepositories/repositorySetRepositories.js +5 -6
- data/webpack/redux/reducers/RedHatRepositories/__tests__/repositorySetRepositories.test.js +1 -1
- data/webpack/redux/reducers/RedHatRepositories/repositorySetRepositories.js +1 -1
- data/webpack/scenes/ContentViews/Copy/CopyContentViewModal.js +2 -1
- data/webpack/scenes/ContentViews/Details/ComponentContentViews/ComponentContentViewAddModal.js +2 -1
- data/webpack/scenes/ContentViews/Details/ComponentContentViews/ComponentContentViewBulkAddModal.js +2 -1
- data/webpack/scenes/ContentViews/Details/ComponentContentViews/ContentViewComponents.js +2 -1
- data/webpack/scenes/ContentViews/Details/ContentViewDetails.js +2 -1
- data/webpack/scenes/ContentViews/Details/Repositories/ContentViewRepositories.js +2 -2
- data/webpack/scenes/ContentViews/Publish/CVPublishForm.js +2 -1
- data/webpack/scenes/ContentViews/Publish/CVPublishReview.js +3 -2
- data/webpack/scenes/ContentViews/Publish/PublishContentViewWizard.js +2 -1
- data/webpack/scenes/ContentViews/Table/ContentViewsTable.js +2 -1
- data/webpack/scenes/ContentViews/components/CVBreadCrumb.js +2 -1
- data/webpack/scenes/ContentViews/components/ContentViewSelect/ContentViewSelectOption.js +2 -2
- data/webpack/scenes/Subscriptions/Details/SubscriptionAttributes.js +1 -0
- data/webpack/scenes/Subscriptions/Details/__tests__/__snapshots__/SubscriptionDetailInfo.test.js.snap +10 -0
- data/webpack/scenes/Subscriptions/SubscriptionConstants.js +6 -0
- data/webpack/scenes/Subscriptions/__tests__/__snapshots__/SubscriptionsPage.test.js.snap +2 -0
- data/webpack/scenes/Subscriptions/__tests__/subscriptions.fixtures.js +14 -0
- data/webpack/scenes/Subscriptions/components/SubscriptionsTable/SubscriptionsTableHelpers.js +1 -0
- data/webpack/scenes/Subscriptions/components/SubscriptionsTable/SubscriptionsTableSchema.js +10 -0
- data/webpack/scenes/Subscriptions/components/SubscriptionsTable/__tests__/SubscriptionsTable.fixtures.js +1 -0
- data/webpack/scenes/Subscriptions/components/SubscriptionsToolbar/__snapshots__/SubscriptionsToolbar.test.js.snap +10 -0
- data/webpack/scenes/Tasks/helpers.js +1 -1
- metadata +25 -111
- data/app/assets/javascripts/katello/containers/container.js +0 -304
- data/app/lib/katello/util/http_helper.rb +0 -15
- data/app/models/732bd3db9f64c621c64d2be4f2a838727aac0845.patch +0 -61
- data/app/models/katello/repository.rb.bak +0 -978
- data/app/services/katello/pulp3/content_view_version/import_validator.rb.bak +0 -166
- data/app/services/katello/pulp3/content_view_version/importable_repositories.rb.bak +0 -164
- data/lib/katello/tasks/update_repository_expiry.rake +0 -114
- data/locale/bn/LC_MESSAGES/katello.mo +0 -0
- data/locale/bn/katello.po.time_stamp +0 -0
- data/locale/bn_IN/LC_MESSAGES/katello.mo +0 -0
- data/locale/bn_IN/katello.po.time_stamp +0 -0
- data/locale/ca/LC_MESSAGES/katello.mo +0 -0
- data/locale/ca/katello.po.time_stamp +0 -0
- data/locale/cs/LC_MESSAGES/katello.mo +0 -0
- data/locale/cs/katello.po.time_stamp +0 -0
- data/locale/cs_CZ/LC_MESSAGES/katello.mo +0 -0
- data/locale/cs_CZ/katello.po.time_stamp +0 -0
- data/locale/de/LC_MESSAGES/katello.mo +0 -0
- data/locale/de/katello.po.time_stamp +0 -0
- data/locale/de_AT/LC_MESSAGES/katello.mo +0 -0
- data/locale/de_AT/katello.po.time_stamp +0 -0
- data/locale/de_DE/LC_MESSAGES/katello.mo +0 -0
- data/locale/de_DE/katello.po.time_stamp +0 -0
- data/locale/el/LC_MESSAGES/katello.mo +0 -0
- data/locale/el/katello.po.time_stamp +0 -0
- data/locale/en/LC_MESSAGES/katello.mo +0 -0
- data/locale/en/katello.po.time_stamp +0 -0
- data/locale/en_GB/LC_MESSAGES/katello.mo +0 -0
- data/locale/en_GB/katello.po.time_stamp +0 -0
- data/locale/en_US/LC_MESSAGES/katello.mo +0 -0
- data/locale/en_US/katello.po.time_stamp +0 -0
- data/locale/es/LC_MESSAGES/katello.mo +0 -0
- data/locale/es/katello.po.time_stamp +0 -0
- data/locale/et_EE/LC_MESSAGES/katello.mo +0 -0
- data/locale/et_EE/katello.po.time_stamp +0 -0
- data/locale/fr/LC_MESSAGES/katello.mo +0 -0
- data/locale/fr/katello.po.time_stamp +0 -0
- data/locale/gl/LC_MESSAGES/katello.mo +0 -0
- data/locale/gl/katello.po.time_stamp +0 -0
- data/locale/gu/LC_MESSAGES/katello.mo +0 -0
- data/locale/gu/katello.po.time_stamp +0 -0
- data/locale/he_IL/LC_MESSAGES/katello.mo +0 -0
- data/locale/he_IL/katello.po.time_stamp +0 -0
- data/locale/hi/LC_MESSAGES/katello.mo +0 -0
- data/locale/hi/katello.po.time_stamp +0 -0
- data/locale/id/LC_MESSAGES/katello.mo +0 -0
- data/locale/id/katello.po.time_stamp +0 -0
- data/locale/it/LC_MESSAGES/katello.mo +0 -0
- data/locale/it/katello.po.time_stamp +0 -0
- data/locale/ja/LC_MESSAGES/katello.mo +0 -0
- data/locale/ja/katello.po.time_stamp +0 -0
- data/locale/ka/LC_MESSAGES/katello.mo +0 -0
- data/locale/ka/katello.po.time_stamp +0 -0
- data/locale/kn/LC_MESSAGES/katello.mo +0 -0
- data/locale/kn/katello.po.time_stamp +0 -0
- data/locale/ko/LC_MESSAGES/katello.mo +0 -0
- data/locale/ko/katello.po.time_stamp +0 -0
- data/locale/ml_IN/LC_MESSAGES/katello.mo +0 -0
- data/locale/ml_IN/katello.po.time_stamp +0 -0
- data/locale/mr/LC_MESSAGES/katello.mo +0 -0
- data/locale/mr/katello.po.time_stamp +0 -0
- data/locale/nl_NL/LC_MESSAGES/katello.mo +0 -0
- data/locale/nl_NL/katello.po.time_stamp +0 -0
- data/locale/or/LC_MESSAGES/katello.mo +0 -0
- data/locale/or/katello.po.time_stamp +0 -0
- data/locale/pa/LC_MESSAGES/katello.mo +0 -0
- data/locale/pa/katello.po.time_stamp +0 -0
- data/locale/pl/LC_MESSAGES/katello.mo +0 -0
- data/locale/pl/katello.po.time_stamp +0 -0
- data/locale/pl_PL/LC_MESSAGES/katello.mo +0 -0
- data/locale/pl_PL/katello.po.time_stamp +0 -0
- data/locale/pt/LC_MESSAGES/katello.mo +0 -0
- data/locale/pt/katello.po.time_stamp +0 -0
- data/locale/pt_BR/LC_MESSAGES/katello.mo +0 -0
- data/locale/pt_BR/katello.po.time_stamp +0 -0
- data/locale/ro/LC_MESSAGES/katello.mo +0 -0
- data/locale/ro/katello.po.time_stamp +0 -0
- data/locale/ro_RO/LC_MESSAGES/katello.mo +0 -0
- data/locale/ro_RO/katello.po.time_stamp +0 -0
- data/locale/ru/LC_MESSAGES/katello.mo +0 -0
- data/locale/ru/katello.po.time_stamp +0 -0
- data/locale/sl/LC_MESSAGES/katello.mo +0 -0
- data/locale/sl/katello.po.time_stamp +0 -0
- data/locale/sv_SE/LC_MESSAGES/katello.mo +0 -0
- data/locale/sv_SE/katello.po.time_stamp +0 -0
- data/locale/ta/LC_MESSAGES/katello.mo +0 -0
- data/locale/ta/katello.po.time_stamp +0 -0
- data/locale/ta_IN/LC_MESSAGES/katello.mo +0 -0
- data/locale/ta_IN/katello.po.time_stamp +0 -0
- data/locale/te/LC_MESSAGES/katello.mo +0 -0
- data/locale/te/katello.po.time_stamp +0 -0
- data/locale/tr/LC_MESSAGES/katello.mo +0 -0
- data/locale/tr/katello.po.time_stamp +0 -0
- data/locale/vi/LC_MESSAGES/katello.mo +0 -0
- data/locale/vi/katello.po.time_stamp +0 -0
- data/locale/vi_VN/LC_MESSAGES/katello.mo +0 -0
- data/locale/vi_VN/katello.po.time_stamp +0 -0
- data/locale/zh/LC_MESSAGES/katello.mo +0 -0
- data/locale/zh/katello.po.time_stamp +0 -0
- data/locale/zh_CN/LC_MESSAGES/katello.mo +0 -0
- data/locale/zh_CN/katello.po.time_stamp +0 -0
- data/locale/zh_TW/LC_MESSAGES/katello.mo +0 -0
- data/locale/zh_TW/katello.po.time_stamp +0 -0
- data/webpack/global_test_setup.js.bak +0 -59
- data/webpack/utils/useKatelloDocUrl.js +0 -18
@@ -9,16 +9,28 @@ import { PACKAGE_SEARCH_QUERY } from './PackagesTab/YumInstallablePackagesConsta
|
|
9
9
|
import { PACKAGES_SEARCH_QUERY, SELECTED_UPDATE_VERSIONS } from './PackagesTab/HostPackagesConstants';
|
10
10
|
|
11
11
|
// PARAM BUILDING
|
12
|
-
const
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
12
|
+
export const buildHostSearch = ({ hostname, hostSearch }) => {
|
13
|
+
let result = hostSearch ?? `name ^ (${hostname})`;
|
14
|
+
if (result === '') {
|
15
|
+
// user has selected all hosts
|
16
|
+
result = 'set? name'; // the name field is NOT NULL, so this will match all hosts
|
17
|
+
}
|
18
|
+
return result;
|
19
|
+
};
|
20
|
+
export const baseParams = (options) => {
|
21
|
+
const {
|
22
|
+
feature, hostname, hostSearch, descriptionFormat, inputs = {},
|
23
|
+
} = options;
|
24
|
+
const search = buildHostSearch({ hostname, hostSearch });
|
25
|
+
return ({
|
26
|
+
job_invocation: {
|
27
|
+
feature,
|
28
|
+
inputs,
|
29
|
+
description_format: descriptionFormat,
|
30
|
+
search_query: search,
|
31
|
+
},
|
32
|
+
});
|
33
|
+
};
|
22
34
|
|
23
35
|
const runCommandParams = ({ hostname, command }) =>
|
24
36
|
baseParams({
|
@@ -27,6 +39,13 @@ const runCommandParams = ({ hostname, command }) =>
|
|
27
39
|
feature: REX_FEATURES.RUN_COMMAND,
|
28
40
|
});
|
29
41
|
|
42
|
+
const uploadProfileParams = ({ hostname }) =>
|
43
|
+
baseParams({
|
44
|
+
hostname,
|
45
|
+
inputs: {},
|
46
|
+
feature: REX_FEATURES.KATELLO_UPLOAD_PROFILE,
|
47
|
+
});
|
48
|
+
|
30
49
|
// used when we know the package name
|
31
50
|
const katelloPackageInstallParams = ({ hostname, packageName }) =>
|
32
51
|
baseParams({
|
@@ -36,9 +55,12 @@ const katelloPackageInstallParams = ({ hostname, packageName }) =>
|
|
36
55
|
});
|
37
56
|
|
38
57
|
// used when we know package Id(s)
|
39
|
-
const katelloPackageInstallBySearchParams = ({
|
58
|
+
const katelloPackageInstallBySearchParams = ({
|
59
|
+
hostname, hostSearch, search, descriptionFormat,
|
60
|
+
}) =>
|
40
61
|
baseParams({
|
41
62
|
hostname,
|
63
|
+
hostSearch,
|
42
64
|
inputs: { [PACKAGE_SEARCH_QUERY]: search },
|
43
65
|
feature: REX_FEATURES.KATELLO_PACKAGE_INSTALL_BY_SEARCH,
|
44
66
|
descriptionFormat,
|
@@ -51,9 +73,12 @@ const katelloPackageRemoveParams = ({ hostname, packageName }) =>
|
|
51
73
|
feature: REX_FEATURES.KATELLO_PACKAGE_REMOVE,
|
52
74
|
});
|
53
75
|
|
54
|
-
const
|
76
|
+
const katelloPackageRemoveBySearchParams = ({
|
77
|
+
hostname, hostSearch, search, descriptionFormat,
|
78
|
+
}) =>
|
55
79
|
baseParams({
|
56
80
|
hostname,
|
81
|
+
hostSearch,
|
57
82
|
inputs: { [PACKAGES_SEARCH_QUERY]: search },
|
58
83
|
feature: REX_FEATURES.KATELLO_PACKAGES_REMOVE_BY_SEARCH,
|
59
84
|
descriptionFormat,
|
@@ -67,16 +92,21 @@ const katelloPackageUpdateParams = ({ hostname, packageName, descriptionFormat }
|
|
67
92
|
descriptionFormat,
|
68
93
|
});
|
69
94
|
|
70
|
-
const katelloPackagesUpdateParams = ({
|
71
|
-
|
72
|
-
|
73
|
-
|
74
|
-
|
75
|
-
|
76
|
-
|
77
|
-
|
78
|
-
|
79
|
-
}
|
95
|
+
const katelloPackagesUpdateParams = (options) => {
|
96
|
+
// this doesn't use baseParams so looks different from the others
|
97
|
+
const {
|
98
|
+
hostname, search, hostSearch, versions, descriptionFormat,
|
99
|
+
} = options;
|
100
|
+
const searchQuery = buildHostSearch({ hostname, hostSearch });
|
101
|
+
return ({
|
102
|
+
job_invocation: {
|
103
|
+
feature: REX_FEATURES.KATELLO_PACKAGES_UPDATE_BY_SEARCH,
|
104
|
+
inputs: { [PACKAGES_SEARCH_QUERY]: search, [SELECTED_UPDATE_VERSIONS]: versions ?? [] },
|
105
|
+
search_query: searchQuery,
|
106
|
+
description_format: descriptionFormat,
|
107
|
+
},
|
108
|
+
});
|
109
|
+
};
|
80
110
|
|
81
111
|
const katelloTracerResolveParams = ({ hostname, search }) =>
|
82
112
|
baseParams({
|
@@ -86,11 +116,13 @@ const katelloTracerResolveParams = ({ hostname, search }) =>
|
|
86
116
|
});
|
87
117
|
|
88
118
|
const katelloHostErrataInstallParams = ({
|
89
|
-
hostname, search,
|
119
|
+
hostname, hostSearch, search, descriptionFormat,
|
90
120
|
}) => baseParams({
|
91
121
|
hostname,
|
122
|
+
hostSearch,
|
92
123
|
inputs: { [ERRATA_SEARCH_QUERY]: search },
|
93
124
|
feature: REX_FEATURES.KATELLO_HOST_ERRATA_INSTALL_BY_SEARCH,
|
125
|
+
descriptionFormat,
|
94
126
|
});
|
95
127
|
|
96
128
|
const katelloModuleStreamActionsParams = ({ hostname, action, moduleSpec }) =>
|
@@ -131,6 +163,18 @@ export const runCommand = ({ hostname, command, handleSuccess }) => post({
|
|
131
163
|
errorToast,
|
132
164
|
});
|
133
165
|
|
166
|
+
export const uploadProfile = ({ hostname, handleSuccess }) => post({
|
167
|
+
type: API_OPERATIONS.POST,
|
168
|
+
key: REX_JOB_INVOCATIONS_KEY,
|
169
|
+
url: foremanApi.getApiUrl('/job_invocations'),
|
170
|
+
params: uploadProfileParams({ hostname }),
|
171
|
+
handleSuccess: (response) => {
|
172
|
+
showRexToast(response);
|
173
|
+
if (handleSuccess) handleSuccess(response);
|
174
|
+
},
|
175
|
+
errorToast,
|
176
|
+
});
|
177
|
+
|
134
178
|
export const installPackage = ({ hostname, packageName, handleSuccess }) => post({
|
135
179
|
type: API_OPERATIONS.POST,
|
136
180
|
key: REX_JOB_INVOCATIONS_KEY,
|
@@ -143,11 +187,15 @@ export const installPackage = ({ hostname, packageName, handleSuccess }) => post
|
|
143
187
|
errorToast,
|
144
188
|
});
|
145
189
|
|
146
|
-
export const installPackageBySearch = ({
|
190
|
+
export const installPackageBySearch = ({
|
191
|
+
hostname, hostSearch, search, descriptionFormat,
|
192
|
+
}) => post({
|
147
193
|
type: API_OPERATIONS.POST,
|
148
194
|
key: REX_JOB_INVOCATIONS_KEY,
|
149
195
|
url: foremanApi.getApiUrl('/job_invocations'),
|
150
|
-
params: katelloPackageInstallBySearchParams({
|
196
|
+
params: katelloPackageInstallBySearchParams({
|
197
|
+
hostname, hostSearch, search, descriptionFormat,
|
198
|
+
}),
|
151
199
|
handleSuccess: showRexToast,
|
152
200
|
errorToast,
|
153
201
|
});
|
@@ -161,11 +209,15 @@ export const removePackage = ({ hostname, packageName }) => post({
|
|
161
209
|
errorToast,
|
162
210
|
});
|
163
211
|
|
164
|
-
export const
|
212
|
+
export const removePackagesBySearch = ({
|
213
|
+
hostname, hostSearch, search, descriptionFormat,
|
214
|
+
}) => post({
|
165
215
|
type: API_OPERATIONS.POST,
|
166
216
|
key: REX_JOB_INVOCATIONS_KEY,
|
167
217
|
url: foremanApi.getApiUrl('/job_invocations'),
|
168
|
-
params:
|
218
|
+
params: katelloPackageRemoveBySearchParams({
|
219
|
+
hostname, hostSearch, search, descriptionFormat,
|
220
|
+
}),
|
169
221
|
handleSuccess: showRexToast,
|
170
222
|
errorToast,
|
171
223
|
});
|
@@ -180,13 +232,13 @@ export const updatePackage = ({ hostname, packageName }) => post({
|
|
180
232
|
});
|
181
233
|
|
182
234
|
export const updatePackages = ({
|
183
|
-
hostname, search, versions, descriptionFormat,
|
235
|
+
hostname, hostSearch, search, versions, descriptionFormat,
|
184
236
|
}) => post({
|
185
237
|
type: API_OPERATIONS.POST,
|
186
238
|
key: REX_JOB_INVOCATIONS_KEY,
|
187
239
|
url: foremanApi.getApiUrl('/job_invocations'),
|
188
240
|
params: katelloPackagesUpdateParams({
|
189
|
-
hostname, search, versions, descriptionFormat,
|
241
|
+
hostname, search, hostSearch, versions, descriptionFormat,
|
190
242
|
}),
|
191
243
|
handleSuccess: showRexToast,
|
192
244
|
errorToast,
|
@@ -202,13 +254,13 @@ export const resolveTraces = ({ hostname, search }) => post({
|
|
202
254
|
});
|
203
255
|
|
204
256
|
export const installErrata = ({
|
205
|
-
hostname, search,
|
257
|
+
hostname, hostSearch, search, descriptionFormat,
|
206
258
|
}) => post({
|
207
259
|
type: API_OPERATIONS.POST,
|
208
260
|
key: REX_JOB_INVOCATIONS_KEY,
|
209
261
|
url: foremanApi.getApiUrl('/job_invocations'),
|
210
262
|
params: katelloHostErrataInstallParams({
|
211
|
-
hostname, search,
|
263
|
+
hostname, search, hostSearch, descriptionFormat,
|
212
264
|
}),
|
213
265
|
handleSuccess: showRexToast,
|
214
266
|
errorToast,
|
@@ -27,7 +27,7 @@ export const useRexJobPolling = (initialAction, successAction = null, failureAct
|
|
27
27
|
}, [dispatch]);
|
28
28
|
|
29
29
|
const tick = (resp) => {
|
30
|
-
const
|
30
|
+
const data = resp?.data?.data || resp?.data;
|
31
31
|
const { statusLabel, id, description } = propsToCamelCase(data);
|
32
32
|
if (!id) setRexJobId(id);
|
33
33
|
if (statusLabel && statusLabel !== 'running') {
|
@@ -0,0 +1,44 @@
|
|
1
|
+
import { baseParams, buildHostSearch } from '../RemoteExecutionActions';
|
2
|
+
|
3
|
+
describe('buildHostSearch', () => {
|
4
|
+
it('Replaces empty string with special search', () => {
|
5
|
+
const options = {
|
6
|
+
hostname: 'test',
|
7
|
+
hostSearch: '',
|
8
|
+
};
|
9
|
+
expect(buildHostSearch(options)).toEqual('set? name');
|
10
|
+
});
|
11
|
+
it('Composes hostname search when hostSearch is not passed', () => {
|
12
|
+
const options = {
|
13
|
+
hostname: 'test',
|
14
|
+
};
|
15
|
+
expect(buildHostSearch(options)).toEqual('name ^ (test)');
|
16
|
+
});
|
17
|
+
it('Composes hostSearch when hostname is not passed', () => {
|
18
|
+
const options = {
|
19
|
+
hostSearch: 'test',
|
20
|
+
};
|
21
|
+
expect(buildHostSearch(options)).toEqual('test');
|
22
|
+
});
|
23
|
+
});
|
24
|
+
|
25
|
+
describe('baseParams', () => {
|
26
|
+
it('Composes base params', () => {
|
27
|
+
const options = {
|
28
|
+
feature: 'feature',
|
29
|
+
hostname: 'hostname',
|
30
|
+
hostSearch: 'hostSearch',
|
31
|
+
descriptionFormat: 'descriptionFormat',
|
32
|
+
inputs: { input: 'input' },
|
33
|
+
};
|
34
|
+
expect(baseParams(options)).toEqual({
|
35
|
+
job_invocation: {
|
36
|
+
feature: 'feature',
|
37
|
+
inputs: { input: 'input' },
|
38
|
+
description_format: 'descriptionFormat',
|
39
|
+
search_query: 'hostSearch',
|
40
|
+
},
|
41
|
+
});
|
42
|
+
});
|
43
|
+
});
|
44
|
+
|
@@ -4,13 +4,16 @@ import { ERRATA_SEARCH_QUERY } from './ErrataTab/HostErrataConstants';
|
|
4
4
|
import { PACKAGE_SEARCH_QUERY } from './PackagesTab/YumInstallablePackagesConstants';
|
5
5
|
import { PACKAGES_SEARCH_QUERY, SELECTED_UPDATE_VERSIONS } from './PackagesTab/HostPackagesConstants';
|
6
6
|
|
7
|
-
export const createJob = ({
|
8
|
-
|
9
|
-
|
7
|
+
export const createJob = (options) => {
|
8
|
+
const {
|
9
|
+
hostname, hostSearch, feature, inputs,
|
10
|
+
} = options;
|
11
|
+
if (inputs[SELECTED_UPDATE_VERSIONS] === undefined) delete inputs[SELECTED_UPDATE_VERSIONS];
|
10
12
|
const inputParams = Object.keys(inputs).map(key => `inputs[${key}]=${inputs[key]}`);
|
13
|
+
const search = hostSearch ?? `name ^ (${hostname})`;
|
11
14
|
const params = [
|
12
15
|
`feature=${feature}`,
|
13
|
-
`search
|
16
|
+
`search=${search}`,
|
14
17
|
...inputParams,
|
15
18
|
];
|
16
19
|
const urlQuery = encodeURI(params.join('&'));
|
@@ -23,20 +26,31 @@ export const katelloPackageInstallUrl = ({ hostname, packages }) => createJob({
|
|
23
26
|
inputs: { package: packages },
|
24
27
|
});
|
25
28
|
|
26
|
-
export const katelloPackageInstallBySearchUrl = ({ hostname, search }) => createJob({
|
29
|
+
export const katelloPackageInstallBySearchUrl = ({ hostname, hostSearch, search }) => createJob({
|
27
30
|
hostname,
|
31
|
+
hostSearch,
|
28
32
|
feature: REX_FEATURES.KATELLO_PACKAGE_INSTALL_BY_SEARCH,
|
29
33
|
inputs: { [PACKAGE_SEARCH_QUERY]: search },
|
30
34
|
});
|
31
35
|
|
36
|
+
export const katelloPackageRemoveBySearchUrl = ({ hostname, hostSearch, search }) => createJob({
|
37
|
+
hostname,
|
38
|
+
hostSearch,
|
39
|
+
feature: REX_FEATURES.KATELLO_PACKAGES_REMOVE_BY_SEARCH,
|
40
|
+
inputs: { [PACKAGES_SEARCH_QUERY]: search },
|
41
|
+
});
|
42
|
+
|
32
43
|
export const katelloPackageUpdateUrl = ({ hostname, packageName }) => createJob({
|
33
44
|
hostname,
|
34
45
|
feature: REX_FEATURES.KATELLO_PACKAGE_UPDATE,
|
35
46
|
inputs: { package: packageName },
|
36
47
|
});
|
37
48
|
|
38
|
-
export const packagesUpdateUrl = ({
|
49
|
+
export const packagesUpdateUrl = ({
|
50
|
+
hostname, hostSearch, search, versions,
|
51
|
+
}) => createJob({
|
39
52
|
hostname,
|
53
|
+
hostSearch,
|
40
54
|
feature: REX_FEATURES.KATELLO_PACKAGES_UPDATE_BY_SEARCH,
|
41
55
|
inputs: { [PACKAGES_SEARCH_QUERY]: search, [SELECTED_UPDATE_VERSIONS]: versions },
|
42
56
|
});
|
@@ -47,8 +61,9 @@ export const resolveTraceUrl = ({ hostname, search }) => createJob({
|
|
47
61
|
inputs: { [TRACES_SEARCH_QUERY]: search },
|
48
62
|
});
|
49
63
|
|
50
|
-
export const errataInstallUrl = ({ hostname, search }) => createJob({
|
64
|
+
export const errataInstallUrl = ({ hostname, search, hostSearch }) => createJob({
|
51
65
|
hostname,
|
66
|
+
hostSearch,
|
52
67
|
feature: REX_FEATURES.KATELLO_HOST_ERRATA_INSTALL_BY_SEARCH,
|
53
68
|
inputs: { [ERRATA_SEARCH_QUERY]: search },
|
54
69
|
});
|
@@ -1,26 +1,54 @@
|
|
1
1
|
import React, { useContext, useEffect } from 'react';
|
2
|
+
import PropTypes from 'prop-types';
|
2
3
|
import { useDispatch } from 'react-redux';
|
3
|
-
import {
|
4
|
+
import { Menu, MenuItem, MenuContent, MenuList } from '@patternfly/react-core';
|
5
|
+
import { BanIcon } from '@patternfly/react-icons';
|
4
6
|
import { translate as __ } from 'foremanReact/common/I18n';
|
5
7
|
import { foremanUrl } from 'foremanReact/common/helpers';
|
6
8
|
import { ForemanHostsIndexActionsBarContext } from 'foremanReact/components/HostsIndex';
|
7
9
|
import { useForemanModal } from 'foremanReact/components/ForemanModal/ForemanModalHooks';
|
8
10
|
import { addModal } from 'foremanReact/components/ForemanModal/ForemanModalActions';
|
11
|
+
import { useForemanOrganization } from 'foremanReact/Root/Context/ForemanContext';
|
12
|
+
import './ActionsBar.scss';
|
13
|
+
|
14
|
+
const DisabledMenuItemDescription = ({ disabledReason }) => (
|
15
|
+
<span className="disabled-menu-item-span">
|
16
|
+
<span className="disabled-menu-item-icon">
|
17
|
+
<BanIcon />
|
18
|
+
</span>
|
19
|
+
<p className="disabled-menu-item-p">
|
20
|
+
{disabledReason}
|
21
|
+
</p>
|
22
|
+
</span>
|
23
|
+
);
|
24
|
+
|
25
|
+
DisabledMenuItemDescription.propTypes = {
|
26
|
+
disabledReason: PropTypes.string.isRequired,
|
27
|
+
};
|
9
28
|
|
10
29
|
const HostActionsBar = () => {
|
11
30
|
const {
|
12
31
|
fetchBulkParams,
|
13
32
|
selectedCount,
|
14
33
|
selectAllMode,
|
34
|
+
setMenuOpen,
|
15
35
|
} = useContext(ForemanHostsIndexActionsBarContext);
|
16
36
|
|
17
37
|
const dispatch = useDispatch();
|
18
38
|
useEffect(() => {
|
19
|
-
|
20
|
-
|
21
|
-
|
39
|
+
[
|
40
|
+
'bulk-change-cv-modal',
|
41
|
+
'bulk-packages-wizard',
|
42
|
+
'bulk-errata-wizard',
|
43
|
+
].forEach((id) => {
|
44
|
+
dispatch(addModal({ id }));
|
45
|
+
});
|
22
46
|
}, [dispatch]);
|
23
|
-
const { setModalOpen } = useForemanModal({ id: 'bulk-change-cv-modal' });
|
47
|
+
const { setModalOpen: openBulkChangeCVModal } = useForemanModal({ id: 'bulk-change-cv-modal' });
|
48
|
+
const { setModalOpen: openBulkPackagesWizardModal } = useForemanModal({ id: 'bulk-packages-wizard' });
|
49
|
+
const { setModalOpen: openBulkErrataWizardModal } = useForemanModal({ id: 'bulk-errata-wizard' });
|
50
|
+
|
51
|
+
const orgId = useForemanOrganization()?.id;
|
24
52
|
|
25
53
|
let href = '';
|
26
54
|
if (selectAllMode) {
|
@@ -31,24 +59,55 @@ const HostActionsBar = () => {
|
|
31
59
|
}
|
32
60
|
|
33
61
|
return (
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
62
|
+
<MenuItem
|
63
|
+
itemId="content-flyout-item"
|
64
|
+
key="content-flyout"
|
65
|
+
isDisabled={selectedCount === 0}
|
66
|
+
flyoutMenu={(
|
67
|
+
<Menu ouiaId="content-flyout-menu" onSelect={() => setMenuOpen(false)}>
|
68
|
+
<MenuContent>
|
69
|
+
<MenuList>
|
70
|
+
<MenuItem
|
71
|
+
itemId="bulk-packages-wizard-dropdown-item"
|
72
|
+
key="bulk-packages-wizard-dropdown-item"
|
73
|
+
onClick={openBulkPackagesWizardModal}
|
74
|
+
isDisabled={selectedCount === 0 || !orgId}
|
75
|
+
description={!orgId && <DisabledMenuItemDescription disabledReason={__('To manage host packages, a specific organization must be selected from the organization context.')} />}
|
76
|
+
>
|
77
|
+
{__('Packages')}
|
78
|
+
</MenuItem>
|
79
|
+
<MenuItem
|
80
|
+
itemId="bulk-errata-wizard-dropdown-item"
|
81
|
+
key="bulk-errata-wizard-dropdown-item"
|
82
|
+
onClick={openBulkErrataWizardModal}
|
83
|
+
isDisabled={selectedCount === 0}
|
84
|
+
>
|
85
|
+
{__('Errata')}
|
86
|
+
</MenuItem>
|
87
|
+
<MenuItem
|
88
|
+
itemId="change-content-s-dropdown-item"
|
89
|
+
key="change-content-source-dropdown-item"
|
90
|
+
to={href}
|
91
|
+
isDisabled={selectedCount === 0}
|
92
|
+
>
|
93
|
+
{__('Content source')}
|
94
|
+
</MenuItem>
|
95
|
+
<MenuItem
|
96
|
+
itemId="bulk-change-cv-dropdown-item"
|
97
|
+
key="bulk-change-cv-dropdown-item"
|
98
|
+
onClick={openBulkChangeCVModal}
|
99
|
+
isDisabled={selectedCount === 0 || !orgId}
|
100
|
+
description={!orgId && <DisabledMenuItemDescription disabledReason={__('To change content view environments, a specific organization must be selected from the organization context.')} />}
|
101
|
+
>
|
102
|
+
{__('Content view environments')}
|
103
|
+
</MenuItem>
|
104
|
+
</MenuList>
|
105
|
+
</MenuContent>
|
106
|
+
</Menu>
|
107
|
+
)}
|
108
|
+
>
|
109
|
+
{__('Manage content')}
|
110
|
+
</MenuItem>
|
52
111
|
);
|
53
112
|
};
|
54
113
|
|
@@ -5,10 +5,13 @@ import { useForemanModal } from 'foremanReact/components/ForemanModal/ForemanMod
|
|
5
5
|
import BulkChangeHostCVModal from './BulkChangeHostCVModal';
|
6
6
|
|
7
7
|
const BulkChangeHostCVModalScene = () => {
|
8
|
-
const
|
8
|
+
const orgId = useForemanOrganization()?.id;
|
9
9
|
const { selectedCount, fetchBulkParams } = useContext(ForemanActionsBarContext);
|
10
10
|
const { modalOpen, setModalClosed } = useForemanModal({ id: 'bulk-change-cv-modal' });
|
11
11
|
|
12
|
+
if (!orgId) return null;
|
13
|
+
|
14
|
+
|
12
15
|
return (
|
13
16
|
<BulkChangeHostCVModal
|
14
17
|
key="bulk-change-cv-modal"
|
@@ -16,7 +19,7 @@ const BulkChangeHostCVModalScene = () => {
|
|
16
19
|
fetchBulkParams={fetchBulkParams}
|
17
20
|
isOpen={modalOpen}
|
18
21
|
closeModal={setModalClosed}
|
19
|
-
orgId={
|
22
|
+
orgId={orgId}
|
20
23
|
/>
|
21
24
|
|
22
25
|
);
|
@@ -0,0 +1,171 @@
|
|
1
|
+
import React, { useEffect, useContext } from 'react';
|
2
|
+
import {
|
3
|
+
Alert,
|
4
|
+
ToolbarItem,
|
5
|
+
Text,
|
6
|
+
TextContent,
|
7
|
+
TextVariants,
|
8
|
+
} from '@patternfly/react-core';
|
9
|
+
import { TableText } from '@patternfly/react-table';
|
10
|
+
import TableIndexPage from 'foremanReact/components/PF4/TableIndexPage/TableIndexPage';
|
11
|
+
import { translate as __ } from 'foremanReact/common/I18n';
|
12
|
+
import SelectAllCheckbox from 'foremanReact/components/PF4/TableIndexPage/Table/SelectAllCheckbox';
|
13
|
+
import { STATUS, getControllerSearchProps } from 'foremanReact/constants';
|
14
|
+
import { RowSelectTd } from 'foremanReact/components/HostsIndex/RowSelectTd';
|
15
|
+
import { getPageStats } from 'foremanReact/components/PF4/TableIndexPage/Table/helpers';
|
16
|
+
import { BulkErrataWizardContext, ERRATA_URL } from './BulkErrataWizard';
|
17
|
+
import { ErrataType, ErrataSeverity } from '../../../../../components/Errata';
|
18
|
+
import katelloApi from '../../../../../services/api';
|
19
|
+
|
20
|
+
const BulkErrataTable = () => {
|
21
|
+
const {
|
22
|
+
setShouldValidateStep2,
|
23
|
+
errataBulkSelect,
|
24
|
+
errataResults: results,
|
25
|
+
errataMetadata: {
|
26
|
+
total, per_page: perPage, page, subtotal,
|
27
|
+
},
|
28
|
+
errataResponse: response,
|
29
|
+
} = useContext(BulkErrataWizardContext);
|
30
|
+
const apiOptions = { key: 'BULK_HOST_ERRATA' };
|
31
|
+
const {
|
32
|
+
status: errataStatus,
|
33
|
+
} = response;
|
34
|
+
|
35
|
+
|
36
|
+
const origSearchProps = getControllerSearchProps('errata', 'searchBar-errata');
|
37
|
+
const customSearchProps = {
|
38
|
+
...origSearchProps,
|
39
|
+
autocomplete: {
|
40
|
+
...origSearchProps.autocomplete,
|
41
|
+
url: katelloApi.getApiUrl('/errata/auto_complete_search'),
|
42
|
+
},
|
43
|
+
};
|
44
|
+
|
45
|
+
const {
|
46
|
+
selectAll,
|
47
|
+
selectPage,
|
48
|
+
selectNone,
|
49
|
+
selectOne,
|
50
|
+
isSelected,
|
51
|
+
selectedCount,
|
52
|
+
areAllRowsSelected,
|
53
|
+
areAllRowsOnPageSelected,
|
54
|
+
updateSearchQuery,
|
55
|
+
hasInteracted,
|
56
|
+
} = errataBulkSelect;
|
57
|
+
|
58
|
+
useEffect(() => {
|
59
|
+
if (results?.length && hasInteracted) {
|
60
|
+
setShouldValidateStep2(true);
|
61
|
+
}
|
62
|
+
}, [setShouldValidateStep2, results, hasInteracted]);
|
63
|
+
|
64
|
+
const pageStats = getPageStats({ total: subtotal, page, perPage });
|
65
|
+
const selectionToolbar = (
|
66
|
+
<ToolbarItem key="selectAll">
|
67
|
+
<SelectAllCheckbox
|
68
|
+
{...{
|
69
|
+
selectNone,
|
70
|
+
selectPage,
|
71
|
+
selectedCount,
|
72
|
+
pageRowCount: pageStats.pageRowCount,
|
73
|
+
areAllRowsSelected,
|
74
|
+
areAllRowsOnPageSelected,
|
75
|
+
}}
|
76
|
+
selectAll={selectAll}
|
77
|
+
totalCount={total}
|
78
|
+
areAllRowsOnPageSelected={areAllRowsOnPageSelected()}
|
79
|
+
areAllRowsSelected={areAllRowsSelected()}
|
80
|
+
/>
|
81
|
+
</ToolbarItem>
|
82
|
+
);
|
83
|
+
|
84
|
+
const columns = {
|
85
|
+
id: {
|
86
|
+
title: __('Erratum'),
|
87
|
+
wrapper: ({ id, errata_id: errataId }) => (
|
88
|
+
<a target="_blank" href={`/errata/${id}`} rel="noreferrer">{errataId}</a>
|
89
|
+
),
|
90
|
+
isSorted: true,
|
91
|
+
weight: 10,
|
92
|
+
},
|
93
|
+
title: {
|
94
|
+
title: __('Title'),
|
95
|
+
wrapper: ({ title }) => <TableText wrapModifier="truncate">{title}</TableText>,
|
96
|
+
isSorted: true,
|
97
|
+
weight: 20,
|
98
|
+
},
|
99
|
+
type: {
|
100
|
+
title: __('Type'),
|
101
|
+
wrapper: erratum => <ErrataType {...erratum} />,
|
102
|
+
weight: 30,
|
103
|
+
isSorted: true,
|
104
|
+
},
|
105
|
+
severity: {
|
106
|
+
title: __('Severity'),
|
107
|
+
wrapper: erratum => <ErrataSeverity {...erratum} />,
|
108
|
+
weight: 40,
|
109
|
+
isSorted: true,
|
110
|
+
},
|
111
|
+
affectedHosts: {
|
112
|
+
title: __('Affected hosts'),
|
113
|
+
wrapper: ({ affected_hosts_count: affectedHostsCount }) => affectedHostsCount,
|
114
|
+
weight: 50,
|
115
|
+
},
|
116
|
+
};
|
117
|
+
|
118
|
+
return (
|
119
|
+
<>
|
120
|
+
<TextContent>
|
121
|
+
<Text ouiaId="mew-step-3-header" component={TextVariants.h3}>
|
122
|
+
{__('Apply errata')}
|
123
|
+
</Text>
|
124
|
+
<Text ouiaId="mew-step-3-content" component={TextVariants.p}>
|
125
|
+
{__('Select errata to apply on the selected hosts. Some errata may already be applied on some hosts.')}
|
126
|
+
</Text>
|
127
|
+
</TextContent>
|
128
|
+
{selectedCount === 0 && hasInteracted && (
|
129
|
+
<Alert
|
130
|
+
ouiaId="no-errata-alert"
|
131
|
+
variant="info"
|
132
|
+
isInline
|
133
|
+
title={__('Select at least one erratum.')}
|
134
|
+
style={{ marginBottom: '1rem' }}
|
135
|
+
/>
|
136
|
+
)}
|
137
|
+
{ errataStatus === STATUS.RESOLVED && !results?.length && (
|
138
|
+
<Alert
|
139
|
+
ouiaId="no-errata-found-alert"
|
140
|
+
variant="info"
|
141
|
+
isInline
|
142
|
+
title={__('No errata found.')}
|
143
|
+
style={{ marginBottom: '1rem' }}
|
144
|
+
/>
|
145
|
+
)}
|
146
|
+
<TableIndexPage
|
147
|
+
columns={columns}
|
148
|
+
showCheckboxes
|
149
|
+
apiUrl={ERRATA_URL}
|
150
|
+
apiOptions={apiOptions}
|
151
|
+
headerText={__('Errata')}
|
152
|
+
header={null}
|
153
|
+
controller="errata"
|
154
|
+
customSearchProps={customSearchProps}
|
155
|
+
creatable={false}
|
156
|
+
replacementResponse={response}
|
157
|
+
selectionToolbar={selectionToolbar}
|
158
|
+
updateSearchQuery={updateSearchQuery}
|
159
|
+
rowSelectTd={RowSelectTd}
|
160
|
+
selectOne={selectOne}
|
161
|
+
isSelected={isSelected}
|
162
|
+
idColumn="errata_id"
|
163
|
+
updateParamsByUrl={false}
|
164
|
+
bookmarksPosition="right"
|
165
|
+
/>
|
166
|
+
</>
|
167
|
+
);
|
168
|
+
};
|
169
|
+
|
170
|
+
|
171
|
+
export default BulkErrataTable;
|