katello 4.7.4 → 4.8.0.rc2
Sign up to get free protection for your applications and to get access to all the features.
Potentially problematic release.
This version of katello might be problematic. Click here for more details.
- checksums.yaml +4 -4
- data/app/controllers/katello/api/registry/registry_proxies_controller.rb +8 -22
- data/app/controllers/katello/api/rhsm/candlepin_proxies_controller.rb +15 -12
- data/app/controllers/katello/api/v2/alternate_content_sources_controller.rb +7 -5
- data/app/controllers/katello/api/v2/capsule_content_controller.rb +0 -4
- data/app/controllers/katello/api/v2/content_export_incrementals_controller.rb +22 -81
- data/app/controllers/katello/api/v2/content_exports_controller.rb +11 -80
- data/app/controllers/katello/api/v2/content_imports_controller.rb +1 -0
- data/app/controllers/katello/api/v2/exports_controller.rb +130 -0
- data/app/controllers/katello/api/v2/host_subscriptions_controller.rb +7 -8
- data/app/controllers/katello/api/v2/hosts_bulk_actions_controller.rb +8 -4
- data/app/controllers/katello/api/v2/organizations_controller.rb +3 -0
- data/app/controllers/katello/api/v2/package_groups_controller.rb +0 -52
- data/app/controllers/katello/api/v2/repositories_controller.rb +3 -18
- data/app/controllers/katello/concerns/api/v2/bulk_hosts_extensions.rb +4 -6
- data/app/controllers/katello/concerns/api/v2/registration_controller_extensions.rb +1 -2
- data/app/controllers/katello/concerns/authorization/api/v2/content_views_controller.rb +4 -1
- data/app/controllers/katello/concerns/content_facet_hosts_controller_extensions.rb +24 -0
- data/app/controllers/katello/concerns/hosts_controller_extensions.rb +3 -3
- data/app/helpers/katello/hosts_and_hostgroups_helper.rb +59 -23
- data/app/helpers/katello/katello_urls_helper.rb +0 -15
- data/app/helpers/katello/sync_management_helper.rb +0 -4
- data/app/lib/actions/candlepin/owner/destroy_imports.rb +1 -1
- data/app/lib/actions/katello/alternate_content_source/create.rb +3 -1
- data/app/lib/actions/katello/alternate_content_source/update.rb +3 -1
- data/app/lib/actions/katello/capsule_content/sync.rb +0 -4
- data/app/lib/actions/katello/capsule_content/sync_capsule.rb +1 -2
- data/app/lib/actions/katello/content_view/publish.rb +6 -2
- data/app/lib/actions/katello/content_view/remove.rb +8 -2
- data/app/lib/actions/katello/content_view_version/destroy.rb +1 -1
- data/app/lib/actions/katello/environment/destroy.rb +8 -2
- data/app/lib/actions/katello/host/reassign.rb +4 -2
- data/app/lib/actions/katello/orphan_cleanup/remove_orphans.rb +0 -1
- data/app/lib/actions/katello/product/destroy.rb +2 -1
- data/app/lib/actions/katello/repository/filtered_index_content.rb +2 -10
- data/app/lib/actions/katello/repository/import_upload.rb +0 -1
- data/app/lib/actions/katello/repository/sync.rb +0 -1
- data/app/lib/actions/katello/repository/update.rb +5 -3
- data/app/lib/actions/katello/repository/upload_files.rb +0 -1
- data/app/lib/actions/pulp3/abstract.rb +0 -6
- data/app/lib/actions/pulp3/content_view/delete_repository_references.rb +1 -2
- data/app/lib/actions/pulp3/content_view_version/create_syncable_export_history.rb +4 -0
- data/app/lib/actions/pulp3/orchestration/content_view_version/copy_version_units_to_library.rb +1 -1
- data/app/lib/actions/pulp3/orchestration/content_view_version/export.rb +12 -11
- data/app/lib/actions/pulp3/orchestration/content_view_version/export_repository.rb +7 -2
- data/app/lib/actions/pulp3/orchestration/content_view_version/syncable_export.rb +7 -4
- data/app/lib/actions/pulp3/repository/reclaim_space.rb +1 -1
- data/app/lib/actions/pulp3/repository/refresh_distribution.rb +1 -2
- data/app/lib/actions/pulp3/repository/save_distribution_references.rb +2 -2
- data/app/lib/katello/api/v2/error_handling.rb +12 -2
- data/app/lib/katello/concerns/base_template_scope_extensions.rb +7 -3
- data/app/lib/katello/concerns/renderer_extensions.rb +1 -1
- data/app/lib/katello/event_daemon/runner.rb +12 -9
- data/app/lib/katello/resources/candlepin/consumer.rb +6 -6
- data/app/lib/katello/resources/candlepin/owner.rb +1 -1
- data/app/lib/katello/resources/candlepin/upstream_consumer.rb +3 -4
- data/app/lib/katello/resources/candlepin.rb +4 -4
- data/app/lib/katello/util/errata.rb +12 -10
- data/app/lib/katello/util/search.rb +0 -1
- data/app/lib/katello/validators/content_view_environment_org_validator.rb +5 -2
- data/app/lib/katello/validators/content_view_environment_validator.rb +1 -2
- data/app/lib/katello/validators/generated_content_view_validator.rb +16 -0
- data/app/mailers/katello/errata_mailer.rb +4 -2
- data/app/models/katello/alternate_content_source.rb +59 -5
- data/app/models/katello/concerns/content_facet_host_extensions.rb +25 -14
- data/app/models/katello/concerns/host_managed_extensions.rb +31 -8
- data/app/models/katello/concerns/redhat_extensions.rb +16 -6
- data/app/models/katello/concerns/smart_proxy_extensions.rb +0 -12
- data/app/models/katello/concerns/subscription_facet_host_extensions.rb +1 -0
- data/app/models/katello/content_view.rb +22 -5
- data/app/models/katello/content_view_environment.rb +11 -2
- data/app/models/katello/content_view_environment_content_facet.rb +9 -0
- data/app/models/katello/content_view_version.rb +10 -5
- data/app/models/katello/erratum.rb +6 -1
- data/app/models/katello/glue/candlepin/pool.rb +6 -0
- data/app/models/katello/glue/candlepin/product.rb +7 -1
- data/app/models/katello/glue/candlepin/subscription.rb +5 -0
- data/app/models/katello/glue/provider.rb +26 -26
- data/app/models/katello/host/content_facet.rb +108 -18
- data/app/models/katello/host/info_provider.rb +25 -21
- data/app/models/katello/host/subscription_facet.rb +18 -14
- data/app/models/katello/kt_environment.rb +12 -7
- data/app/models/katello/package_group.rb +0 -12
- data/app/models/katello/pool.rb +4 -1
- data/app/models/katello/product.rb +11 -1
- data/app/models/katello/repository.rb +11 -11
- data/app/models/katello/root_repository.rb +5 -4
- data/app/models/katello/task_status.rb +0 -18
- data/app/services/katello/candlepin/consumer.rb +2 -2
- data/app/services/katello/host/package_profile_uploader.rb +1 -1
- data/app/services/katello/product_content_finder.rb +11 -8
- data/app/services/katello/pulp3/content_view_version/export.rb +8 -65
- data/app/services/katello/pulp3/content_view_version/export_validation_error.rb +7 -0
- data/app/services/katello/pulp3/content_view_version/export_validator.rb +121 -0
- data/app/services/katello/pulp3/content_view_version/importable_products.rb +1 -1
- data/app/services/katello/pulp3/content_view_version/syncable_format_export.rb +7 -1
- data/app/services/katello/pulp3/erratum.rb +1 -0
- data/app/services/katello/pulp3/module_stream.rb +26 -11
- data/app/services/katello/pulp3/repository/yum.rb +2 -1
- data/app/services/katello/pulp3/smart_proxy_mirror_repository.rb +2 -1
- data/app/services/katello/registration_manager.rb +46 -26
- data/app/services/katello/repository_type.rb +3 -9
- data/app/services/katello/simple_package.rb +22 -0
- data/app/views/foreman/smart_proxies/_content_sync.html.erb +2 -1
- data/app/views/foreman/smart_proxies/_reclaim_space.html.erb +1 -0
- data/app/views/katello/api/v2/content_facet/base.json.rabl +23 -2
- data/app/views/katello/api/v2/content_facet/show.json.rabl +11 -8
- data/app/views/katello/api/v2/content_views/base.json.rabl +1 -1
- data/app/views/katello/api/v2/hosts/base.json.rabl +22 -2
- data/app/views/overrides/activation_keys/_host_environment_select.html.erb +2 -2
- data/config/initializers/monkeys.rb +0 -2
- data/config/routes/api/registry.rb +8 -7
- data/config/routes/api/v2.rb +0 -2
- data/config/routes.rb +3 -0
- data/db/migrate/20200429153103_installed_package_bad_nvrea.rb +1 -1
- data/db/migrate/20220228173251_remove_drpm_from_ignorable_content.rb +7 -3
- data/db/migrate/20220419193414_content_settings_to_dsl_category.rb +1 -1
- data/db/migrate/20220929204746_add_content_view_environment_content_facet.rb +52 -0
- data/db/migrate/20221123212341_remove_pulp_docker_registry_port_setting.rb +5 -0
- data/db/migrate/20230119003859_ensure_repo_username_password_nil_not_blank.rb +1 -1
- data/db/migrate/20230203141353_set_new_acs_verify_ssl_default.rb +5 -0
- data/db/seeds.d/111-upgrade_tasks.rb +3 -1
- data/engines/bastion/app/assets/stylesheets/bastion/bastion.scss +4 -0
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/activation-keys/details/activation-key-details.controller.js +2 -4
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-hosts/bulk/content-hosts-bulk-errata-modal.controller.js +0 -1
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-hosts/details/content-host-details.controller.js +2 -4
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-hosts/views/content-hosts.html +2 -1
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/errata/apply-errata.controller.js +11 -3
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/host-collections/details/views/host-collection-hosts-list.html +1 -1
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/i18n/bastion_katello.pot +8 -4
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/i18n/locale/de.po +5485 -0
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/i18n/locale/es.po +5397 -0
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/i18n/locale/fr.po +5658 -0
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/i18n/locale/ja.po +5284 -0
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/i18n/locale/ka.po +5231 -0
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/i18n/locale/ko.po +5275 -0
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/i18n/locale/pt_BR.po +5389 -0
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/i18n/locale/zh_CN.po +5212 -0
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/i18n/locale/zh_TW.po +5145 -0
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/i18n/translations.js +9 -0
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/subscriptions/views/content-access-mode-banner.html +2 -2
- data/lib/katello/engine.rb +2 -1
- data/lib/katello/permission_creator.rb +2 -4
- data/lib/katello/permissions/registry_permissions.rb +5 -5
- data/lib/katello/plugin.rb +22 -14
- data/lib/katello/repository_types/README.md +136 -19
- data/lib/katello/repository_types/deb.rb +0 -1
- data/lib/katello/repository_types/docker.rb +0 -1
- data/lib/katello/repository_types/file.rb +0 -1
- data/lib/katello/repository_types/yum.rb +0 -4
- data/lib/katello/tasks/clean_candlepin_orphaned_products.rake +38 -0
- data/lib/katello/tasks/clean_orphaned_facets.rb +20 -0
- data/lib/katello/tasks/reimport.rake +1 -2
- data/lib/katello/tasks/repository.rake +1 -22
- data/lib/katello/tasks/reset.rake +1 -0
- data/lib/katello/tasks/upgrades/4.8/fix_incorrect_providers.rake +29 -0
- data/lib/katello/tasks/upgrades/4.8/regenerate_imported_repository_metadata.rake +33 -0
- data/lib/katello/version.rb +1 -1
- data/lib/katello.rb +0 -5
- data/locale/bn/katello.po +69 -27
- data/locale/cs/katello.po +69 -27
- data/locale/de/katello.po +78 -36
- data/locale/en/katello.po +69 -27
- data/locale/es/katello.po +70 -28
- data/locale/fr/katello.po +73 -31
- data/locale/gu/katello.po +69 -27
- data/locale/hi/katello.po +69 -27
- data/locale/it/katello.po +69 -27
- data/locale/ja/katello.po +73 -31
- data/locale/ka/katello.po +73 -31
- data/locale/katello.pot +335 -262
- data/locale/kn/katello.po +69 -27
- data/locale/ko/katello.po +69 -27
- data/locale/mr/katello.po +69 -27
- data/locale/or/katello.po +69 -27
- data/locale/pa/katello.po +69 -27
- data/locale/pt/katello.po +69 -27
- data/locale/pt_BR/katello.po +70 -28
- data/locale/ru/katello.po +70 -28
- data/locale/ta/katello.po +69 -27
- data/locale/te/katello.po +69 -27
- data/locale/zh_CN/katello.po +73 -31
- data/locale/zh_TW/katello.po +70 -28
- data/webpack/components/Content/ContentPage.js +51 -35
- data/webpack/components/Content/__tests__/ContentPage.test.js +2 -4
- data/webpack/components/Content/__tests__/__snapshots__/ContentPage.test.js.snap +22 -3
- data/webpack/components/Table/EmptyStateMessage.js +14 -11
- data/webpack/components/Table/MainTable.js +36 -15
- data/webpack/components/Table/TableWrapper.js +25 -25
- data/webpack/components/Table/__test__/emptyStateMessage.test.js +51 -0
- data/webpack/components/extensions/HostDetails/Cards/ContentViewDetailsCard/ChangeHostCVModal.js +10 -72
- data/webpack/components/extensions/HostDetails/Cards/ErrataOverviewCard.js +5 -4
- data/webpack/components/extensions/HostDetails/Cards/HostCollectionsCard/HostCollectionsModal.js +1 -1
- data/webpack/components/extensions/HostDetails/Cards/HostCollectionsCard/__tests__/hostCollectionsModal.test.js +1 -17
- data/webpack/components/extensions/HostDetails/Tabs/ErrataTab/ErrataTab.js +18 -9
- data/webpack/components/extensions/HostDetails/Tabs/ModuleStreamsTab/ModuleStreamsTab.js +1 -2
- data/webpack/components/extensions/HostDetails/Tabs/PackagesTab/PackageInstallModal.js +1 -2
- data/webpack/components/extensions/HostDetails/Tabs/PackagesTab/PackagesTab.js +1 -2
- data/webpack/components/extensions/HostDetails/Tabs/RepositorySetsTab/RepositorySetsTab.js +47 -27
- data/webpack/components/extensions/HostDetails/Tabs/TracesTab/TracesTab.js +1 -2
- data/webpack/components/extensions/HostDetails/Tabs/__tests__/errataTab.test.js +2 -21
- data/webpack/components/extensions/HostDetails/Tabs/__tests__/moduleStreamsTab.test.js +1 -28
- data/webpack/components/extensions/HostDetails/Tabs/__tests__/packageInstallModal.test.js +1 -10
- data/webpack/components/extensions/HostDetails/Tabs/__tests__/packagesTab.test.js +1 -18
- data/webpack/components/extensions/HostDetails/Tabs/__tests__/repositorySetsTab.test.js +1 -17
- data/webpack/components/extensions/HostDetails/Tabs/__tests__/tracesTab.test.js +1 -15
- data/webpack/global_test_setup.js +1 -1
- data/webpack/redux/actions/RedHatRepositories/helpers.js +5 -3
- data/webpack/scenes/AlternateContentSources/Create/ACSCreateWizard.js +12 -10
- data/webpack/scenes/AlternateContentSources/Create/Steps/ACSCredentials.js +6 -0
- data/webpack/scenes/AlternateContentSources/Create/Steps/ACSSmartProxies.js +1 -0
- data/webpack/scenes/AlternateContentSources/Create/Steps/AcsUrlPaths.js +3 -10
- data/webpack/scenes/AlternateContentSources/Create/Steps/NameACS.js +1 -0
- data/webpack/scenes/AlternateContentSources/Create/__tests__/acsCreate.test.js +3 -3
- data/webpack/scenes/AlternateContentSources/Details/ACSExpandableDetails.js +6 -5
- data/webpack/scenes/AlternateContentSources/Details/EditModals/ACSEditCredentials.js +1 -0
- data/webpack/scenes/AlternateContentSources/Details/EditModals/ACSEditDetails.js +3 -1
- data/webpack/scenes/AlternateContentSources/Details/EditModals/ACSEditProducts.js +1 -0
- data/webpack/scenes/AlternateContentSources/Details/EditModals/ACSEditSmartProxies.js +2 -0
- data/webpack/scenes/AlternateContentSources/Details/EditModals/ACSEditURLPaths.js +13 -4
- data/webpack/scenes/AlternateContentSources/MainTable/ACSTable.js +7 -4
- data/webpack/scenes/AlternateContentSources/MainTable/__tests__/acsTable.test.js +4 -8
- data/webpack/scenes/AlternateContentSources/helpers.js +1 -1
- data/webpack/scenes/Content/Details/ContentRepositories.js +5 -4
- data/webpack/scenes/Content/Details/__tests__/contentDetail.test.js +1 -12
- data/webpack/scenes/Content/Table/ContentTable.js +2 -1
- data/webpack/scenes/Content/__tests__/contentTable.test.js +1 -14
- data/webpack/scenes/ContentViews/Delete/__tests__/contentViewDelete.test.js +1 -25
- data/webpack/scenes/ContentViews/Details/ComponentContentViews/ContentViewComponents.js +2 -1
- data/webpack/scenes/ContentViews/Details/ComponentContentViews/__tests__/contentViewComponents.test.js +44 -31
- data/webpack/scenes/ContentViews/Details/ContentViewDetails.js +3 -0
- data/webpack/scenes/ContentViews/Details/Filters/AffectedRepositories/AffectedRepositoryTable.js +6 -1
- data/webpack/scenes/ContentViews/Details/Filters/CVContainerImageFilterContent.js +2 -1
- data/webpack/scenes/ContentViews/Details/Filters/CVDebFilterContent.js +2 -1
- data/webpack/scenes/ContentViews/Details/Filters/CVErrataIDFilterContent.js +3 -1
- data/webpack/scenes/ContentViews/Details/Filters/CVModuleStreamFilterContent.js +3 -1
- data/webpack/scenes/ContentViews/Details/Filters/CVPackageGroupFilterContent.js +3 -1
- data/webpack/scenes/ContentViews/Details/Filters/CVRpmFilterContent.js +2 -1
- data/webpack/scenes/ContentViews/Details/Filters/ContentViewFilterDetailsHeader.js +2 -0
- data/webpack/scenes/ContentViews/Details/Filters/ContentViewFilters.js +2 -1
- data/webpack/scenes/ContentViews/Details/Filters/MatchContentModal/CVDebMatchContentModal.js +1 -1
- data/webpack/scenes/ContentViews/Details/Filters/MatchContentModal/CVRpmMatchContentModal.js +1 -1
- data/webpack/scenes/ContentViews/Details/Filters/MatchContentModal/__tests__/CVRpmMatchContentModal.test.js +35 -33
- data/webpack/scenes/ContentViews/Details/Filters/__tests__/CVContainerImageFilterContent.test.js +48 -45
- data/webpack/scenes/ContentViews/Details/Filters/__tests__/CVRpmFilterContent.test.js +58 -24
- data/webpack/scenes/ContentViews/Details/Filters/__tests__/ContentViewPackageGroupFilter.test.js +64 -0
- data/webpack/scenes/ContentViews/Details/Filters/__tests__/contentViewFilterDetails.test.js +36 -20
- data/webpack/scenes/ContentViews/Details/Filters/__tests__/contentViewFilters.test.js +40 -23
- data/webpack/scenes/ContentViews/Details/Filters/__tests__/cvErrataIDFilter.test.js +0 -13
- data/webpack/scenes/ContentViews/Details/Filters/__tests__/cvModuleStreamFilter.test.js +0 -13
- data/webpack/scenes/ContentViews/Details/Histories/ContentViewHistories.js +2 -1
- data/webpack/scenes/ContentViews/Details/Histories/__tests__/contentViewHistory.test.js +1 -10
- data/webpack/scenes/ContentViews/Details/Repositories/ContentViewRepositories.js +2 -1
- data/webpack/scenes/ContentViews/Details/Repositories/__tests__/contentViewAddRemove.test.js +1 -10
- data/webpack/scenes/ContentViews/Details/Versions/Compare/CVVersionCompareConfig.js +21 -9
- data/webpack/scenes/ContentViews/Details/Versions/Compare/CVVersionCompareTable.js +4 -0
- data/webpack/scenes/ContentViews/Details/Versions/Compare/__tests__/CVVersionCompare.test.js +1 -32
- data/webpack/scenes/ContentViews/Details/Versions/ContentViewVersions.js +3 -1
- data/webpack/scenes/ContentViews/Details/Versions/Delete/__tests__/cvVersionRemove.test.js +1 -15
- data/webpack/scenes/ContentViews/Details/Versions/Delete/affectedActivationKeys.js +1 -1
- data/webpack/scenes/ContentViews/Details/Versions/Delete/affectedHosts.js +1 -2
- data/webpack/scenes/ContentViews/Details/Versions/VersionDetails/ContentViewVersionDetailConfig.js +31 -9
- data/webpack/scenes/ContentViews/Details/Versions/VersionDetails/ContentViewVersionDetailsTable.js +4 -0
- data/webpack/scenes/ContentViews/Details/Versions/VersionDetails/__tests__/ContentViewVersionDetails.test.js +30 -14
- data/webpack/scenes/ContentViews/Table/ContentViewsTable.js +1 -1
- data/webpack/scenes/ContentViews/__tests__/contentViewPage.test.js +55 -120
- data/webpack/scenes/ContentViews/components/ContentViewSelect/ContentViewSelectOption.js +87 -0
- data/webpack/scenes/ContentViews/components/EnvironmentPaths/EnvironmentPaths.js +1 -1
- data/webpack/scenes/ContentViews/components/WizardHeader.js +1 -1
- data/webpack/scenes/ContentViews/expansions/RelatedContentViewComponentsModal.js +1 -1
- data/webpack/scenes/ContentViews/expansions/__tests__/contentViewComponentsModal.test.js +8 -1
- data/webpack/scenes/Hosts/ChangeContentSource/components/ContentSourceForm.js +153 -28
- data/webpack/scenes/Hosts/ChangeContentSource/index.js +14 -15
- data/webpack/scenes/Hosts/ChangeContentSource/selectors.js +4 -0
- data/webpack/scenes/Hosts/ChangeContentSource/styles.scss +4 -0
- data/webpack/scenes/ModuleStreams/ModuleStreamsPage.js +3 -9
- data/webpack/scenes/ModuleStreams/__tests__/__snapshots__/ModuleStreamPage.test.js.snap +7 -1
- data/webpack/scenes/RedHatRepositories/components/Search.js +22 -16
- data/webpack/scenes/RedHatRepositories/index.scss +20 -1
- data/webpack/scenes/SmartProxy/SmartProxyContentTable.js +12 -1
- data/webpack/scenes/Subscriptions/Manifest/CdnConfigurationTab/CdnTypeForm.js +1 -1
- data/webpack/scenes/Subscriptions/Manifest/CdnConfigurationTab/CustomCdnTypeForm.js +1 -1
- data/webpack/scenes/Subscriptions/SubscriptionsPage.js +21 -19
- data/webpack/scenes/Subscriptions/__tests__/__snapshots__/SubscriptionsPage.test.js.snap +34 -1
- data/webpack/scenes/Subscriptions/components/SubscriptionsToolbar/SubscriptionsToolbar.js +20 -7
- data/webpack/scenes/Subscriptions/components/SubscriptionsToolbar/SubscriptionsToolbar.test.js +0 -1
- data/webpack/scenes/Subscriptions/components/SubscriptionsToolbar/__snapshots__/SubscriptionsToolbar.test.js.snap +65 -15
- metadata +52 -115
- data/app/lib/actions/katello/pulp_selector.rb +0 -24
- data/app/lib/actions/katello/repository/correct_checksum.rb +0 -24
- data/app/lib/actions/katello/repository/destroy_package_group.rb +0 -26
- data/app/lib/actions/katello/repository/upload_package_group.rb +0 -24
- data/app/lib/actions/pulp/abstract.rb +0 -37
- data/app/lib/actions/pulp/abstract_async_task.rb +0 -154
- data/app/lib/actions/pulp/abstract_async_task_group.rb +0 -94
- data/app/lib/actions/pulp/consumer/sync_capsule.rb +0 -45
- data/app/lib/actions/pulp/consumer/unassociate_units.rb +0 -20
- data/app/lib/actions/pulp/expect_one_task.rb +0 -11
- data/app/lib/actions/pulp/orchestration/orphan_cleanup/remove_orphans.rb +0 -16
- data/app/lib/actions/pulp/orchestration/repository/copy_all_units.rb +0 -19
- data/app/lib/actions/pulp/orchestration/repository/delete.rb +0 -15
- data/app/lib/actions/pulp/orchestration/repository/refresh.rb +0 -14
- data/app/lib/actions/pulp/orchestration/repository/refresh_if_needed.rb +0 -13
- data/app/lib/actions/pulp/orchestration/repository/refresh_repos.rb +0 -19
- data/app/lib/actions/pulp/orchestration/repository/remove_units.rb +0 -14
- data/app/lib/actions/pulp/orchestration/repository/smart_proxy_sync.rb +0 -34
- data/app/lib/actions/pulp/orchestration/repository/sync.rb +0 -18
- data/app/lib/actions/pulp/orchestration/repository/upload_content.rb +0 -37
- data/app/lib/actions/pulp/orphan_cleanup/remove_orphans.rb +0 -15
- data/app/lib/actions/pulp/orphan_cleanup/remove_unneeded_repos.rb +0 -16
- data/app/lib/actions/pulp/repository/abstract_copy_content.rb +0 -45
- data/app/lib/actions/pulp/repository/abstract_remove_content.rb +0 -32
- data/app/lib/actions/pulp/repository/clear.rb +0 -18
- data/app/lib/actions/pulp/repository/copy_all_units.rb +0 -30
- data/app/lib/actions/pulp/repository/copy_units.rb +0 -25
- data/app/lib/actions/pulp/repository/create.rb +0 -28
- data/app/lib/actions/pulp/repository/create_in_plan.rb +0 -15
- data/app/lib/actions/pulp/repository/create_upload_request.rb +0 -20
- data/app/lib/actions/pulp/repository/delete_upload_request.rb +0 -19
- data/app/lib/actions/pulp/repository/destroy.rb +0 -28
- data/app/lib/actions/pulp/repository/distributor_publish.rb +0 -25
- data/app/lib/actions/pulp/repository/download.rb +0 -16
- data/app/lib/actions/pulp/repository/import_upload.rb +0 -19
- data/app/lib/actions/pulp/repository/presenters/abstract_sync_presenter.rb +0 -47
- data/app/lib/actions/pulp/repository/presenters/deb_presenter.rb +0 -95
- data/app/lib/actions/pulp/repository/presenters/docker_presenter.rb +0 -103
- data/app/lib/actions/pulp/repository/presenters/file_unit_presenter.rb +0 -42
- data/app/lib/actions/pulp/repository/presenters/yum_presenter.rb +0 -131
- data/app/lib/actions/pulp/repository/refresh.rb +0 -21
- data/app/lib/actions/pulp/repository/regenerate_applicability.rb +0 -21
- data/app/lib/actions/pulp/repository/remove_distribution.rb +0 -11
- data/app/lib/actions/pulp/repository/remove_units.rb +0 -44
- data/app/lib/actions/pulp/repository/sync.rb +0 -99
- data/app/lib/actions/pulp/repository/upload_file.rb +0 -28
- data/app/lib/actions/pulp/repository_group/create.rb +0 -31
- data/app/lib/actions/pulp/repository_group/delete.rb +0 -17
- data/app/lib/actions/pulp/repository_group/export.rb +0 -51
- data/app/lib/katello/util/package_clause_generator.rb +0 -77
- data/app/models/katello/glue/pulp/pulp_errors.rb +0 -9
- data/app/models/katello/glue/pulp/repo.rb +0 -353
- data/app/models/katello/pulp_sync_status.rb +0 -165
- data/app/models/katello/pulp_task_status.rb +0 -63
- data/app/services/katello/pulp/content.rb +0 -24
- data/app/services/katello/pulp/importer_comparison.rb +0 -28
- data/app/services/katello/pulp/repository/deb.rb +0 -61
- data/app/services/katello/pulp/repository/docker.rb +0 -82
- data/app/services/katello/pulp/repository/file.rb +0 -52
- data/app/services/katello/pulp/repository/yum.rb +0 -205
- data/app/services/katello/pulp/repository.rb +0 -327
- data/app/services/katello/pulp/server.rb +0 -35
- data/app/services/katello/pulp/simple_package.rb +0 -24
- data/app/services/katello/pulp/smart_proxy_repository.rb +0 -52
- data/lib/monkeys/fix_deb_optimized_sync.rb +0 -35
- data/lib/monkeys/fix_pulp_container_path.rb +0 -35
- data/locale/zanata.xml +0 -30
- data/webpack/scenes/ContentViews/Details/Filters/MatchContentModal/__tests__/CVRpmMatchContentSearch.fixtures.json +0 -33
data/webpack/scenes/ContentViews/Details/Filters/__tests__/CVContainerImageFilterContent.test.js
CHANGED
@@ -32,6 +32,10 @@ const addedRule = {
|
|
32
32
|
};
|
33
33
|
|
34
34
|
const autocompleteUrl = '/content_view_filters/195/rules/auto_complete_search';
|
35
|
+
const autocompleteQuery = {
|
36
|
+
organization_id: 1,
|
37
|
+
search: '',
|
38
|
+
};
|
35
39
|
const renderOptions = {
|
36
40
|
apiNamespace: cvFilterDetailsKey(13, 195),
|
37
41
|
routerParams: {
|
@@ -42,20 +46,8 @@ const renderOptions = {
|
|
42
46
|
|
43
47
|
const withCVRoute = component => <Route path="/content_views/:id([0-9]+)#/filters/:filterId([0-9]+)">{component}</Route>;
|
44
48
|
|
45
|
-
let searchDelayScope;
|
46
|
-
let autoSearchScope;
|
47
|
-
beforeEach(() => {
|
48
|
-
searchDelayScope = mockSetting(nockInstance, 'autosearch_delay', 0);
|
49
|
-
autoSearchScope = mockSetting(nockInstance, 'autosearch_while_typing');
|
50
|
-
});
|
51
|
-
|
52
|
-
afterEach(() => {
|
53
|
-
assertNockRequest(searchDelayScope);
|
54
|
-
assertNockRequest(autoSearchScope);
|
55
|
-
});
|
56
|
-
|
57
49
|
test('Can view container image filter rules', async (done) => {
|
58
|
-
const autocompleteScope = mockAutocomplete(nockInstance, autocompleteUrl);
|
50
|
+
const autocompleteScope = mockAutocomplete(nockInstance, autocompleteUrl, autocompleteQuery);
|
59
51
|
const cvFiltersScope = nockInstance
|
60
52
|
.get(cvFilterRulesPath)
|
61
53
|
.query(true)
|
@@ -89,7 +81,7 @@ test('Can view container image filter rules', async (done) => {
|
|
89
81
|
|
90
82
|
// Remove
|
91
83
|
test('Can remove filter rules', async (done) => {
|
92
|
-
const autocompleteScope = mockAutocomplete(nockInstance, autocompleteUrl);
|
84
|
+
const autocompleteScope = mockAutocomplete(nockInstance, autocompleteUrl, autocompleteQuery);
|
93
85
|
|
94
86
|
const cvFiltersScope = nockInstance
|
95
87
|
.get(cvFilterRulesPath)
|
@@ -140,10 +132,16 @@ test('Can remove filter rules', async (done) => {
|
|
140
132
|
|
141
133
|
// Add
|
142
134
|
test('Can add filter rules', async (done) => {
|
143
|
-
const autocompleteScope = mockAutocomplete(
|
135
|
+
const autocompleteScope = mockAutocomplete(
|
136
|
+
nockInstance,
|
137
|
+
autocompleteUrl,
|
138
|
+
autocompleteQuery,
|
139
|
+
[],
|
140
|
+
2,
|
141
|
+
);
|
144
142
|
const autocompleteNameScope = mockAutocomplete(nockInstance, autocompleteNameUrl, true, [], 2);
|
145
|
-
const
|
146
|
-
const
|
143
|
+
const searchDelayScope = mockSetting(nockInstance, 'autosearch_delay', 0);
|
144
|
+
const autoSearchScope = mockSetting(nockInstance, 'autosearch_while_typing');
|
147
145
|
|
148
146
|
const cvFiltersScope = nockInstance
|
149
147
|
.get(cvFilterRulesPath)
|
@@ -160,7 +158,7 @@ test('Can add filter rules', async (done) => {
|
|
160
158
|
.query(true)
|
161
159
|
.reply(200, { ...cvFilterFixtures, results: [...cvFilterFixtures.results, addedRule] });
|
162
160
|
|
163
|
-
const { queryByText, getByLabelText
|
161
|
+
const { queryByText, getByLabelText } =
|
164
162
|
renderWithRedux(
|
165
163
|
withCVRoute(<CVContainerImageFilterContent filterId={195} details={details} />),
|
166
164
|
renderOptions,
|
@@ -174,29 +172,23 @@ test('Can add filter rules', async (done) => {
|
|
174
172
|
fireEvent.click(getByLabelText('add_filter_rule'));
|
175
173
|
});
|
176
174
|
|
177
|
-
|
178
|
-
await patientlyWaitFor(() => {
|
179
|
-
expect(getAllByLabelText('text input for search')[0]).toBeInTheDocument();
|
180
|
-
});
|
181
|
-
|
182
|
-
fireEvent.change(getAllByLabelText('text input for search')[0], { target: { value: `name = ${addedRule.name}` } });
|
183
|
-
|
184
175
|
await patientlyWaitFor(() => {
|
185
176
|
expect(getByLabelText('add_edit_filter_rule')).toBeInTheDocument();
|
186
177
|
expect(getByLabelText('add_edit_filter_rule')).toHaveAttribute('aria-disabled', 'true');
|
187
178
|
});
|
188
179
|
|
189
|
-
fireEvent.
|
180
|
+
fireEvent.change(getByLabelText('text input for search'), { target: { value: 'new-rule' } });
|
181
|
+
fireEvent.submit(getByLabelText('add_edit_filter_rule'));
|
190
182
|
|
191
183
|
await patientlyWaitFor(() => {
|
192
|
-
expect(queryByText(
|
184
|
+
expect(queryByText('Add rule')).not.toBeInTheDocument();
|
193
185
|
});
|
194
186
|
|
195
187
|
assertNockRequest(autocompleteScope);
|
188
|
+
assertNockRequest(searchDelayScope);
|
189
|
+
assertNockRequest(autoSearchScope);
|
196
190
|
assertNockRequest(cvFiltersScope);
|
197
191
|
assertNockRequest(cvFilterAddScope);
|
198
|
-
assertNockRequest(inputSearchDelayScope);
|
199
|
-
assertNockRequest(inputAutoSearchScope);
|
200
192
|
assertNockRequest(autocompleteNameScope);
|
201
193
|
assertNockRequest(cvFiltersCallbackScope, done);
|
202
194
|
act(done);
|
@@ -205,10 +197,16 @@ test('Can add filter rules', async (done) => {
|
|
205
197
|
|
206
198
|
// Edit
|
207
199
|
test('Can edit filter rules', async (done) => {
|
208
|
-
const autocompleteScope = mockAutocomplete(
|
200
|
+
const autocompleteScope = mockAutocomplete(
|
201
|
+
nockInstance,
|
202
|
+
autocompleteUrl,
|
203
|
+
autocompleteQuery,
|
204
|
+
[],
|
205
|
+
2,
|
206
|
+
);
|
209
207
|
const autocompleteNameScope = mockAutocomplete(nockInstance, autocompleteNameUrl, true, [], 2);
|
210
|
-
const
|
211
|
-
const
|
208
|
+
const searchDelayScope = mockSetting(nockInstance, 'autosearch_delay', 0);
|
209
|
+
const autoSearchScope = mockSetting(nockInstance, 'autosearch_while_typing');
|
212
210
|
|
213
211
|
const cvFiltersScope = nockInstance
|
214
212
|
.get(cvFilterRulesPath)
|
@@ -255,37 +253,42 @@ test('Can edit filter rules', async (done) => {
|
|
255
253
|
fireEvent.click(queryByText('Edit'));
|
256
254
|
});
|
257
255
|
|
258
|
-
fireEvent.change(getAllByLabelText('text input for search')[0], { target: { value: `name = ${addedRule.name}` } });
|
259
|
-
|
260
256
|
await patientlyWaitFor(() => {
|
261
257
|
expect(getByLabelText('add_edit_filter_rule')).toBeInTheDocument();
|
262
258
|
expect(getByLabelText('add_edit_filter_rule')).toHaveAttribute('aria-disabled', 'false');
|
263
259
|
});
|
264
260
|
|
265
|
-
fireEvent.
|
261
|
+
fireEvent.change(getByLabelText('text input for search'), { target: { value: 'changed-name' } });
|
262
|
+
fireEvent.submit(getByLabelText('add_edit_filter_rule'));
|
266
263
|
|
267
264
|
await patientlyWaitFor(() => {
|
268
|
-
expect(queryByText(
|
269
|
-
expect(queryByText(addedRule.name)).toBeInTheDocument();
|
265
|
+
expect(queryByText('Edit rule')).not.toBeInTheDocument();
|
270
266
|
});
|
271
267
|
|
272
268
|
assertNockRequest(autocompleteScope);
|
269
|
+
assertNockRequest(searchDelayScope);
|
270
|
+
assertNockRequest(autoSearchScope);
|
273
271
|
assertNockRequest(cvFiltersScope);
|
274
272
|
assertNockRequest(cvFilterAddScope);
|
275
|
-
assertNockRequest(inputSearchDelayScope);
|
276
|
-
assertNockRequest(inputAutoSearchScope);
|
277
273
|
assertNockRequest(autocompleteNameScope);
|
278
274
|
assertNockRequest(cvFiltersCallbackScope, done);
|
279
275
|
act(done);
|
280
276
|
});
|
281
277
|
|
282
278
|
test('Shows call-to-action when there are no filter rules', async (done) => {
|
283
|
-
const autocompleteScope = mockAutocomplete(
|
279
|
+
const autocompleteScope = mockAutocomplete(
|
280
|
+
nockInstance,
|
281
|
+
autocompleteUrl,
|
282
|
+
autocompleteQuery,
|
283
|
+
[],
|
284
|
+
2,
|
285
|
+
);
|
284
286
|
const autocompleteNameScope = mockAutocomplete(nockInstance, autocompleteNameUrl, true, [], 2);
|
285
|
-
const
|
286
|
-
const
|
287
|
+
const searchDelayScope = mockSetting(nockInstance, 'autosearch_delay', 0);
|
288
|
+
const autoSearchScope = mockSetting(nockInstance, 'autosearch_while_typing');
|
287
289
|
const cvFiltersScope = nockInstance
|
288
290
|
.get(cvFilterRulesPath)
|
291
|
+
.times(2)
|
289
292
|
.query(true)
|
290
293
|
.reply(200, emptyCVContainerImageData);
|
291
294
|
|
@@ -303,15 +306,15 @@ test('Shows call-to-action when there are no filter rules', async (done) => {
|
|
303
306
|
});
|
304
307
|
|
305
308
|
assertNockRequest(autocompleteScope);
|
306
|
-
assertNockRequest(inputSearchDelayScope);
|
307
|
-
assertNockRequest(inputAutoSearchScope);
|
308
309
|
assertNockRequest(autocompleteNameScope);
|
310
|
+
assertNockRequest(searchDelayScope);
|
311
|
+
assertNockRequest(autoSearchScope);
|
309
312
|
assertNockRequest(cvFiltersScope, done);
|
310
313
|
act(done);
|
311
314
|
});
|
312
315
|
|
313
316
|
test('Hides bulk_remove dropdownItem when there are no filter rules', async (done) => {
|
314
|
-
const autocompleteScope = mockAutocomplete(nockInstance, autocompleteUrl);
|
317
|
+
const autocompleteScope = mockAutocomplete(nockInstance, autocompleteUrl, autocompleteQuery);
|
315
318
|
const cvFiltersScope = nockInstance
|
316
319
|
.get(cvFilterRulesPath)
|
317
320
|
.query(true)
|
@@ -33,13 +33,15 @@ const renderOptions = {
|
|
33
33
|
initialIndex: 1,
|
34
34
|
},
|
35
35
|
};
|
36
|
+
const autocompleteQuery = {
|
37
|
+
organization_id: 1,
|
38
|
+
search: '',
|
39
|
+
};
|
36
40
|
|
37
41
|
const withCVRoute = component => <Route path="/content_views/:id([0-9]+)#/filters/:filterId([0-9]+)">{component}</Route>;
|
38
42
|
|
39
43
|
test('Can show filter details and package groups on page load', async (done) => {
|
40
44
|
const { name: cvFilterName } = cvFilterDetails;
|
41
|
-
const searchDelayScope = mockSetting(nockInstance, 'autosearch_delay', 0);
|
42
|
-
const autoSearchScope = mockSetting(nockInstance, 'autosearch_while_typing');
|
43
45
|
const cvFilterScope = nockInstance
|
44
46
|
.get(cvFilterDetailsPath)
|
45
47
|
.query(true)
|
@@ -52,7 +54,7 @@ test('Can show filter details and package groups on page load', async (done) =>
|
|
52
54
|
.get(cvPackageFilterRulesPath)
|
53
55
|
.query(true)
|
54
56
|
.reply(200, cvPackageFilterRules);
|
55
|
-
const autocompleteScope = mockAutocomplete(nockInstance, autocompleteUrl);
|
57
|
+
const autocompleteScope = mockAutocomplete(nockInstance, autocompleteUrl, autocompleteQuery);
|
56
58
|
|
57
59
|
const { getByText, queryByText } =
|
58
60
|
renderWithRedux(withCVRoute(<ContentViewFilterDetails
|
@@ -67,8 +69,6 @@ test('Can show filter details and package groups on page load', async (done) =>
|
|
67
69
|
});
|
68
70
|
|
69
71
|
assertNockRequest(autocompleteScope);
|
70
|
-
assertNockRequest(searchDelayScope);
|
71
|
-
assertNockRequest(autoSearchScope);
|
72
72
|
assertNockRequest(cvFilterScope);
|
73
73
|
assertNockRequest(cvFiltersScope);
|
74
74
|
assertNockRequest(cvPackageFilterRulesScope);
|
@@ -81,10 +81,24 @@ test('Can search for package rules in package filter details', async (done) => {
|
|
81
81
|
const { name: cvFilterName } = cvFilterDetails;
|
82
82
|
const { name: firstPackageRuleName } = firstPackageRule;
|
83
83
|
const { name: lastPackageRuleName } = lastPackageRule;
|
84
|
-
const searchQueryMatcher =
|
85
|
-
|
86
|
-
|
87
|
-
|
84
|
+
const searchQueryMatcher = {
|
85
|
+
organization_id: 1,
|
86
|
+
search: `name = ${lastPackageRuleName}`,
|
87
|
+
};
|
88
|
+
const searchResults = [
|
89
|
+
{
|
90
|
+
completed: `name = ${lastPackageRuleName}`,
|
91
|
+
part: 'and',
|
92
|
+
label: `name = ${lastPackageRuleName} and`,
|
93
|
+
category: 'Operators',
|
94
|
+
},
|
95
|
+
{
|
96
|
+
completed: `name = ${lastPackageRuleName}`,
|
97
|
+
part: 'or',
|
98
|
+
label: `name = ${lastPackageRuleName} or`,
|
99
|
+
category: 'Operators',
|
100
|
+
},
|
101
|
+
];
|
88
102
|
|
89
103
|
const cvFilterScope = nockInstance
|
90
104
|
.get(cvFilterDetailsPath)
|
@@ -103,8 +117,13 @@ test('Can search for package rules in package filter details', async (done) => {
|
|
103
117
|
.query(searchQueryMatcher)
|
104
118
|
.reply(200, { results: [lastPackageRule] });
|
105
119
|
|
106
|
-
const autocompleteScope = mockAutocomplete(nockInstance, autocompleteUrl);
|
107
|
-
const withSearchScope = mockAutocomplete(
|
120
|
+
const autocompleteScope = mockAutocomplete(nockInstance, autocompleteUrl, autocompleteQuery);
|
121
|
+
const withSearchScope = mockAutocomplete(
|
122
|
+
nockInstance,
|
123
|
+
autocompleteUrl,
|
124
|
+
searchQueryMatcher,
|
125
|
+
searchResults,
|
126
|
+
);
|
108
127
|
const { getByText, queryByText, getByLabelText } =
|
109
128
|
renderWithRedux(withCVRoute(<ContentViewFilterDetails
|
110
129
|
cvId={1}
|
@@ -117,15 +136,14 @@ test('Can search for package rules in package filter details', async (done) => {
|
|
117
136
|
});
|
118
137
|
|
119
138
|
// Search and only searched result shows
|
120
|
-
|
139
|
+
getByLabelText('Search input').focus();
|
140
|
+
fireEvent.change(getByLabelText('Search input'), { target: { value: `name = ${lastPackageRuleName}` } });
|
121
141
|
await patientlyWaitFor(() => {
|
122
|
-
expect(getByText(lastPackageRuleName)).toBeInTheDocument();
|
123
|
-
expect(queryByText(firstPackageRuleName)).not.toBeInTheDocument();
|
142
|
+
expect(getByText(`name = ${lastPackageRuleName} and`)).toBeInTheDocument();
|
143
|
+
expect(queryByText(`name = ${firstPackageRuleName} and`)).not.toBeInTheDocument();
|
124
144
|
});
|
125
145
|
|
126
146
|
assertNockRequest(autocompleteScope);
|
127
|
-
assertNockRequest(searchDelayScope);
|
128
|
-
assertNockRequest(autoSearchScope);
|
129
147
|
assertNockRequest(cvFilterScope);
|
130
148
|
assertNockRequest(cvFiltersScope);
|
131
149
|
assertNockRequest(cvPackageFilterRulesScope);
|
@@ -136,9 +154,15 @@ test('Can search for package rules in package filter details', async (done) => {
|
|
136
154
|
|
137
155
|
test('Can add package rules to filter in a self-closing modal', async (done) => {
|
138
156
|
const { name: cvFilterName } = cvFilterDetails;
|
139
|
-
const autocompleteScope = mockAutocomplete(nockInstance, autocompleteUrl);
|
140
|
-
const autocompleteNameScope = mockAutocomplete(
|
141
|
-
|
157
|
+
const autocompleteScope = mockAutocomplete(nockInstance, autocompleteUrl, true, undefined, 2);
|
158
|
+
const autocompleteNameScope = mockAutocomplete(
|
159
|
+
nockInstance, autocompleteNameUrl, true,
|
160
|
+
undefined, 2,
|
161
|
+
);
|
162
|
+
const autocompleteArchScope = mockAutocomplete(
|
163
|
+
nockInstance, autocompleteArchUrl, true,
|
164
|
+
undefined, 2,
|
165
|
+
);
|
142
166
|
const searchDelayScope = mockSetting(nockInstance, 'autosearch_delay', 0, 3);
|
143
167
|
const autoSearchScope = mockSetting(nockInstance, 'autosearch_while_typing', undefined, 3);
|
144
168
|
|
@@ -190,12 +214,12 @@ test('Can add package rules to filter in a self-closing modal', async (done) =>
|
|
190
214
|
});
|
191
215
|
getByLabelText('add_rpm_rule').click();
|
192
216
|
await patientlyWaitFor(() => {
|
217
|
+
expect(getAllByLabelText('text input for search')[0]).toBeInTheDocument();
|
193
218
|
expect(getAllByLabelText('text input for search')[1]).toBeInTheDocument();
|
194
|
-
expect(getAllByLabelText('text input for search')[2]).toBeInTheDocument();
|
195
219
|
expect(getByLabelText('add_package_filter_rule')).toBeInTheDocument();
|
196
220
|
});
|
197
|
-
fireEvent.change(getAllByLabelText('text input for search')[
|
198
|
-
fireEvent.change(getAllByLabelText('text input for search')[
|
221
|
+
fireEvent.change(getAllByLabelText('text input for search')[0], { target: { value: 'elephant' } });
|
222
|
+
fireEvent.change(getAllByLabelText('text input for search')[1], { target: { value: 'noarch' } });
|
199
223
|
fireEvent.submit(getByLabelText('add_package_filter_rule'));
|
200
224
|
|
201
225
|
await patientlyWaitFor(() => {
|
@@ -259,6 +283,10 @@ test('Remove rpm filter rule in a self-closing modal', async (done) => {
|
|
259
283
|
});
|
260
284
|
|
261
285
|
getByText('Remove').click();
|
286
|
+
await patientlyWaitFor(() => {
|
287
|
+
expect(getByText(cvFilterName)).toBeInTheDocument();
|
288
|
+
expect(getAllByLabelText('Actions')[1]).toBeInTheDocument();
|
289
|
+
});
|
262
290
|
|
263
291
|
assertNockRequest(autocompleteScope);
|
264
292
|
assertNockRequest(searchDelayScope);
|
@@ -274,8 +302,14 @@ test('Remove rpm filter rule in a self-closing modal', async (done) => {
|
|
274
302
|
test('Edit rpm filter rule in a self-closing modal', async (done) => {
|
275
303
|
const { name: cvFilterName } = cvFilterDetails;
|
276
304
|
const autocompleteScope = mockAutocomplete(nockInstance, autocompleteUrl, true, undefined, 2);
|
277
|
-
const autocompleteNameScope = mockAutocomplete(
|
278
|
-
|
305
|
+
const autocompleteNameScope = mockAutocomplete(
|
306
|
+
nockInstance, autocompleteNameUrl, true,
|
307
|
+
undefined, 2,
|
308
|
+
);
|
309
|
+
const autocompleteArchScope = mockAutocomplete(
|
310
|
+
nockInstance, autocompleteArchUrl, true,
|
311
|
+
undefined, 2,
|
312
|
+
);
|
279
313
|
const searchDelayScope = mockSetting(nockInstance, 'autosearch_delay', 0, 3);
|
280
314
|
const autoSearchScope = mockSetting(nockInstance, 'autosearch_while_typing', undefined, 3);
|
281
315
|
const cvFiltersScope = nockInstance
|
data/webpack/scenes/ContentViews/Details/Filters/__tests__/ContentViewPackageGroupFilter.test.js
CHANGED
@@ -7,6 +7,7 @@ import { ADDED, cvFilterDetailsKey, NOT_ADDED } from '../../../ContentViewsConst
|
|
7
7
|
import {
|
8
8
|
nockInstance,
|
9
9
|
assertNockRequest,
|
10
|
+
mockAutocomplete,
|
10
11
|
} from '../../../../../test-utils/nockWrapper';
|
11
12
|
import api from '../../../../../services/api';
|
12
13
|
|
@@ -27,6 +28,13 @@ const cvBulkRemoveFilterRulesPath = api.getApiUrl('/content_view_filters/1/remov
|
|
27
28
|
const cvBulkAddFilterRulesPath = api.getApiUrl('/content_view_filters/1/add_filter_rules');
|
28
29
|
const cvGetAllReposPath = api.getApiUrl('/content_views/1/repositories');
|
29
30
|
|
31
|
+
const autocompleteUrl = '/package_groups/auto_complete_search';
|
32
|
+
const autocompleteQuery = {
|
33
|
+
filterid: 1,
|
34
|
+
organization_id: 1,
|
35
|
+
search: '',
|
36
|
+
};
|
37
|
+
|
30
38
|
const packageGroupsPath = api.getApiUrl('/package_groups');
|
31
39
|
const renderOptions = {
|
32
40
|
apiNamespace: cvFilterDetailsKey(1, 1),
|
@@ -41,6 +49,7 @@ const withCVRoute = component => <Route path="/content_views/:id([0-9]+)#/filter
|
|
41
49
|
jest.mock('../../../../../components/Search', () => () => 'mocked!');
|
42
50
|
|
43
51
|
test('Can enable and disable add filter button', async (done) => {
|
52
|
+
const autocompleteScope = mockAutocomplete(nockInstance, autocompleteUrl, autocompleteQuery);
|
44
53
|
const { name: cvFilterName } = cvFilterDetails;
|
45
54
|
const cvFilterScope = nockInstance
|
46
55
|
.get(cvFilterDetailsPath)
|
@@ -74,12 +83,14 @@ test('Can enable and disable add filter button', async (done) => {
|
|
74
83
|
expect(getByLabelText('add_filter_rule')).toHaveAttribute('aria-disabled', 'false');
|
75
84
|
});
|
76
85
|
|
86
|
+
assertNockRequest(autocompleteScope);
|
77
87
|
assertNockRequest(cvFilterScope);
|
78
88
|
assertNockRequest(cvFiltersScope);
|
79
89
|
assertNockRequest(packageGroupsScope, done);
|
80
90
|
});
|
81
91
|
|
82
92
|
test('Can remove a filter rule', async (done) => {
|
93
|
+
const autocompleteScope = mockAutocomplete(nockInstance, autocompleteUrl, autocompleteQuery);
|
83
94
|
const { rules } = cvFilterDetails;
|
84
95
|
const { name } = rules[0];
|
85
96
|
|
@@ -126,6 +137,7 @@ test('Can remove a filter rule', async (done) => {
|
|
126
137
|
fireEvent.click(getByText('Remove'));
|
127
138
|
|
128
139
|
|
140
|
+
assertNockRequest(autocompleteScope);
|
129
141
|
assertNockRequest(cvFilterScope);
|
130
142
|
assertNockRequest(cvFiltersScope);
|
131
143
|
assertNockRequest(cvFiltersRuleScope);
|
@@ -135,6 +147,7 @@ test('Can remove a filter rule', async (done) => {
|
|
135
147
|
});
|
136
148
|
|
137
149
|
test('Can add a filter rule', async (done) => {
|
150
|
+
const autocompleteScope = mockAutocomplete(nockInstance, autocompleteUrl, autocompleteQuery);
|
138
151
|
const { rules } = cvFilterDetails;
|
139
152
|
const { name } = rules[0];
|
140
153
|
|
@@ -183,6 +196,7 @@ test('Can add a filter rule', async (done) => {
|
|
183
196
|
fireEvent.click(getByText('Add'));
|
184
197
|
|
185
198
|
|
199
|
+
assertNockRequest(autocompleteScope);
|
186
200
|
assertNockRequest(cvFilterScope);
|
187
201
|
assertNockRequest(cvFiltersScope);
|
188
202
|
assertNockRequest(cvFiltersRuleScope);
|
@@ -192,6 +206,7 @@ test('Can add a filter rule', async (done) => {
|
|
192
206
|
});
|
193
207
|
|
194
208
|
test('Can bulk remove filter rules', async (done) => {
|
209
|
+
const autocompleteScope = mockAutocomplete(nockInstance, autocompleteUrl, autocompleteQuery);
|
195
210
|
const { rules } = cvFilterDetails;
|
196
211
|
const { name } = rules[0];
|
197
212
|
|
@@ -243,6 +258,7 @@ test('Can bulk remove filter rules', async (done) => {
|
|
243
258
|
expect(getByLabelText('bulk_remove')).toBeInTheDocument();
|
244
259
|
fireEvent.click(getByLabelText('bulk_remove'));
|
245
260
|
|
261
|
+
assertNockRequest(autocompleteScope);
|
246
262
|
assertNockRequest(cvFilterScope);
|
247
263
|
assertNockRequest(cvFiltersScope);
|
248
264
|
assertNockRequest(cvFiltersRuleBulkDeleteScope);
|
@@ -252,6 +268,7 @@ test('Can bulk remove filter rules', async (done) => {
|
|
252
268
|
});
|
253
269
|
|
254
270
|
test('Can bulk add filter rules', async (done) => {
|
271
|
+
const autocompleteScope = mockAutocomplete(nockInstance, autocompleteUrl, autocompleteQuery);
|
255
272
|
const { rules } = cvFilterDetails;
|
256
273
|
const { name } = rules[0];
|
257
274
|
|
@@ -300,6 +317,7 @@ test('Can bulk add filter rules', async (done) => {
|
|
300
317
|
expect(getByLabelText('add_filter_rule')).toBeInTheDocument();
|
301
318
|
fireEvent.click(getByLabelText('add_filter_rule'));
|
302
319
|
|
320
|
+
assertNockRequest(autocompleteScope);
|
303
321
|
assertNockRequest(cvFilterScope);
|
304
322
|
assertNockRequest(cvFiltersScope);
|
305
323
|
assertNockRequest(cvFiltersRuleBulkAddScope);
|
@@ -308,6 +326,26 @@ test('Can bulk add filter rules', async (done) => {
|
|
308
326
|
});
|
309
327
|
|
310
328
|
test('Can show affected repository tab on dropdown selection and add repos', async (done) => {
|
329
|
+
const autocompleteScope = mockAutocomplete(
|
330
|
+
nockInstance,
|
331
|
+
autocompleteUrl,
|
332
|
+
autocompleteQuery,
|
333
|
+
[],
|
334
|
+
2,
|
335
|
+
);
|
336
|
+
const autocompleteUrlRepo = '/repositories/auto_complete_search';
|
337
|
+
const autocompleteQueryRepo = {
|
338
|
+
organization_id: 1,
|
339
|
+
search: '',
|
340
|
+
};
|
341
|
+
const autocompleteScopeRepo = mockAutocomplete(
|
342
|
+
nockInstance,
|
343
|
+
autocompleteUrlRepo,
|
344
|
+
autocompleteQueryRepo,
|
345
|
+
[],
|
346
|
+
2,
|
347
|
+
);
|
348
|
+
|
311
349
|
const { rules } = cvFilterDetails;
|
312
350
|
const { name } = rules[0];
|
313
351
|
const { results } = cvAllRepos;
|
@@ -380,10 +418,31 @@ test('Can show affected repository tab on dropdown selection and add repos', asy
|
|
380
418
|
assertNockRequest(bulkAddReposScope);
|
381
419
|
assertNockRequest(cvFilterScope);
|
382
420
|
assertNockRequest(cvAllReposScope);
|
421
|
+
assertNockRequest(autocompleteScope);
|
422
|
+
assertNockRequest(autocompleteScopeRepo);
|
383
423
|
assertNockRequest(packageGroupsScope, done);
|
384
424
|
});
|
385
425
|
|
386
426
|
test('Can show affected repository tab and remove affected repos', async (done) => {
|
427
|
+
const autocompleteScope = mockAutocomplete(
|
428
|
+
nockInstance,
|
429
|
+
autocompleteUrl,
|
430
|
+
autocompleteQuery,
|
431
|
+
[],
|
432
|
+
2,
|
433
|
+
);
|
434
|
+
const autocompleteUrlRepo = '/repositories/auto_complete_search';
|
435
|
+
const autocompleteQueryRepo = {
|
436
|
+
organization_id: 1,
|
437
|
+
search: '',
|
438
|
+
};
|
439
|
+
const autocompleteScopeRepo = mockAutocomplete(
|
440
|
+
nockInstance,
|
441
|
+
autocompleteUrlRepo,
|
442
|
+
autocompleteQueryRepo,
|
443
|
+
[],
|
444
|
+
2,
|
445
|
+
);
|
387
446
|
const { rules } = cvFilterDetailsAffectedRepos;
|
388
447
|
const { name } = rules[0];
|
389
448
|
const { results } = cvAllRepos;
|
@@ -444,6 +503,9 @@ test('Can show affected repository tab and remove affected repos', async (done)
|
|
444
503
|
fireEvent.click(getAllByLabelText('bulk_actions')[1]);
|
445
504
|
expect(getByLabelText('bulk_remove')).toHaveAttribute('aria-disabled', 'false');
|
446
505
|
fireEvent.click(getByLabelText('bulk_remove'));
|
506
|
+
|
507
|
+
assertNockRequest(autocompleteScope);
|
508
|
+
assertNockRequest(autocompleteScopeRepo);
|
447
509
|
assertNockRequest(cvFilterScope);
|
448
510
|
assertNockRequest(cvFiltersScope);
|
449
511
|
assertNockRequest(cvAllReposScope);
|
@@ -454,6 +516,7 @@ test('Can show affected repository tab and remove affected repos', async (done)
|
|
454
516
|
});
|
455
517
|
|
456
518
|
test('Can filter by added/not added rules', async (done) => {
|
519
|
+
const autocompleteScope = mockAutocomplete(nockInstance, autocompleteUrl, autocompleteQuery);
|
457
520
|
const { rules } = cvFilterDetails;
|
458
521
|
const { name } = rules[0];
|
459
522
|
|
@@ -505,6 +568,7 @@ test('Can filter by added/not added rules', async (done) => {
|
|
505
568
|
getByLabelText(NOT_ADDED).click();
|
506
569
|
});
|
507
570
|
|
571
|
+
assertNockRequest(autocompleteScope);
|
508
572
|
assertNockRequest(cvFilterScope);
|
509
573
|
assertNockRequest(cvFiltersScope);
|
510
574
|
assertNockRequest(packageGroupsScope, done);
|
@@ -8,7 +8,6 @@ import {
|
|
8
8
|
nockInstance,
|
9
9
|
assertNockRequest,
|
10
10
|
mockAutocomplete,
|
11
|
-
mockSetting,
|
12
11
|
} from '../../../../../test-utils/nockWrapper';
|
13
12
|
import api from '../../../../../services/api';
|
14
13
|
import allPackageGroups from './allFilterPackageGroups.fixtures.json';
|
@@ -27,21 +26,14 @@ const renderOptions = {
|
|
27
26
|
initialIndex: 1,
|
28
27
|
},
|
29
28
|
};
|
29
|
+
const autocompleteQuery = {
|
30
|
+
filterid: 1,
|
31
|
+
organization_id: 1,
|
32
|
+
search: '',
|
33
|
+
};
|
30
34
|
|
31
35
|
const withCVRoute = component => <Route path="/content_views/:id([0-9]+)#/filters/:filterId([0-9]+)">{component}</Route>;
|
32
36
|
|
33
|
-
let searchDelayScope;
|
34
|
-
let autoSearchScope;
|
35
|
-
beforeEach(() => {
|
36
|
-
searchDelayScope = mockSetting(nockInstance, 'autosearch_delay', 0);
|
37
|
-
autoSearchScope = mockSetting(nockInstance, 'autosearch_while_typing');
|
38
|
-
});
|
39
|
-
|
40
|
-
afterEach(() => {
|
41
|
-
assertNockRequest(searchDelayScope);
|
42
|
-
assertNockRequest(autoSearchScope);
|
43
|
-
});
|
44
|
-
|
45
37
|
test('Can show filter details and package groups on page load', async (done) => {
|
46
38
|
const { name: cvFilterName } = cvFilterDetails;
|
47
39
|
const cvFilterScope = nockInstance
|
@@ -56,7 +48,7 @@ test('Can show filter details and package groups on page load', async (done) =>
|
|
56
48
|
.get(packageGroupsPath)
|
57
49
|
.query(true)
|
58
50
|
.reply(200, allPackageGroups);
|
59
|
-
const autocompleteScope = mockAutocomplete(nockInstance, autocompleteUrl);
|
51
|
+
const autocompleteScope = mockAutocomplete(nockInstance, autocompleteUrl, autocompleteQuery);
|
60
52
|
const { getByText, queryByText } =
|
61
53
|
renderWithRedux(withCVRoute(<ContentViewFilterDetails
|
62
54
|
cvId={1}
|
@@ -83,7 +75,25 @@ test('Can search for package groups in package group filter', async (done) => {
|
|
83
75
|
const { name: cvFilterName } = cvFilterDetails;
|
84
76
|
const { name: firstPackageGroupName } = firstPackageGroup;
|
85
77
|
const { name: lastPackageGroupName } = lastPackageGroup;
|
86
|
-
const searchQueryMatcher =
|
78
|
+
const searchQueryMatcher = {
|
79
|
+
filterid: 1,
|
80
|
+
organization_id: 1,
|
81
|
+
search: `name = ${lastPackageGroupName}`,
|
82
|
+
};
|
83
|
+
const searchResults = [
|
84
|
+
{
|
85
|
+
completed: `name = ${lastPackageGroupName}`,
|
86
|
+
part: 'and',
|
87
|
+
label: `name = ${lastPackageGroupName} and`,
|
88
|
+
category: 'Operators',
|
89
|
+
},
|
90
|
+
{
|
91
|
+
completed: `name = ${lastPackageGroupName}`,
|
92
|
+
part: 'or',
|
93
|
+
label: `name = ${lastPackageGroupName} or`,
|
94
|
+
category: 'Operators',
|
95
|
+
},
|
96
|
+
];
|
87
97
|
|
88
98
|
const cvFilterScope = nockInstance
|
89
99
|
.get(cvFilterDetailsPath)
|
@@ -103,8 +113,13 @@ test('Can search for package groups in package group filter', async (done) => {
|
|
103
113
|
.reply(200, { results: [lastPackageGroup] });
|
104
114
|
|
105
115
|
const autocompleteScope =
|
106
|
-
mockAutocomplete(nockInstance, autocompleteUrl);
|
107
|
-
const withSearchScope = mockAutocomplete(
|
116
|
+
mockAutocomplete(nockInstance, autocompleteUrl, autocompleteQuery);
|
117
|
+
const withSearchScope = mockAutocomplete(
|
118
|
+
nockInstance,
|
119
|
+
autocompleteUrl,
|
120
|
+
searchQueryMatcher,
|
121
|
+
searchResults,
|
122
|
+
);
|
108
123
|
const { getByText, queryByText, getByLabelText } =
|
109
124
|
renderWithRedux(withCVRoute(<ContentViewFilterDetails
|
110
125
|
cvId={1}
|
@@ -118,10 +133,11 @@ test('Can search for package groups in package group filter', async (done) => {
|
|
118
133
|
});
|
119
134
|
|
120
135
|
// Search and only searched result shows
|
121
|
-
|
136
|
+
getByLabelText('Search input').focus();
|
137
|
+
fireEvent.change(getByLabelText('Search input'), { target: { value: `name = ${lastPackageGroupName}` } });
|
122
138
|
await patientlyWaitFor(() => {
|
123
|
-
expect(getByText(lastPackageGroupName)).toBeInTheDocument();
|
124
|
-
expect(queryByText(firstPackageGroupName)).not.toBeInTheDocument();
|
139
|
+
expect(getByText(`name = ${lastPackageGroupName} and`)).toBeInTheDocument();
|
140
|
+
expect(queryByText(`name = ${firstPackageGroupName} and`)).not.toBeInTheDocument();
|
125
141
|
});
|
126
142
|
|
127
143
|
assertNockRequest(autocompleteScope);
|