katello 3.8.1 → 3.9.0.rc1
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/README.md +7 -7
- data/app/controllers/katello/api/registry/registry_proxies_controller.rb +16 -9
- data/app/controllers/katello/api/rhsm/candlepin_proxies_controller.rb +1 -1
- data/app/controllers/katello/api/v2/api_controller.rb +20 -22
- data/app/controllers/katello/api/v2/capsule_content_controller.rb +1 -1
- data/app/controllers/katello/api/v2/content_view_filter_rules_controller.rb +5 -1
- data/app/controllers/katello/api/v2/content_view_histories_controller.rb +1 -1
- data/app/controllers/katello/api/v2/content_view_versions_controller.rb +12 -12
- data/app/controllers/katello/api/v2/content_views_controller.rb +15 -1
- data/app/controllers/katello/api/v2/host_errata_controller.rb +1 -1
- data/app/controllers/katello/api/v2/host_subscriptions_controller.rb +12 -4
- data/app/controllers/katello/api/v2/hosts_bulk_actions_controller.rb +12 -0
- data/app/controllers/katello/api/v2/module_streams_controller.rb +49 -0
- data/app/controllers/katello/api/v2/organizations_controller.rb +3 -1
- data/app/controllers/katello/api/v2/package_groups_controller.rb +1 -1
- data/app/controllers/katello/api/v2/products_bulk_actions_controller.rb +5 -4
- data/app/controllers/katello/api/v2/products_controller.rb +1 -1
- data/app/controllers/katello/api/v2/puppet_modules_controller.rb +5 -0
- data/app/controllers/katello/api/v2/repositories_controller.rb +80 -84
- data/app/controllers/katello/api/v2/repository_sets_controller.rb +18 -7
- data/app/controllers/katello/api/v2/subscriptions_controller.rb +2 -6
- data/app/controllers/katello/api/v2/sync_plans_controller.rb +13 -24
- data/app/controllers/katello/concerns/api/v2/repository_content_controller.rb +12 -5
- data/app/controllers/katello/concerns/hosts_controller_extensions.rb +2 -5
- data/app/controllers/katello/react_controller.rb +2 -0
- data/app/controllers/katello/remote_execution_controller.rb +16 -5
- data/app/helpers/katello/hosts_and_hostgroups_helper.rb +0 -2
- data/app/lib/actions/candlepin/import_pool_handler.rb +40 -15
- data/app/lib/actions/katello/capsule_content/create_repos.rb +1 -0
- data/app/lib/actions/katello/content_view/publish.rb +21 -2
- data/app/lib/actions/katello/content_view_version/incremental_update.rb +1 -1
- data/app/lib/actions/katello/environment/destroy.rb +2 -3
- data/app/lib/actions/katello/environment/publish_repositories.rb +1 -1
- data/app/lib/actions/katello/event_queue/monitor.rb +9 -15
- data/app/lib/actions/katello/event_queue/poller_thread.rb +24 -1
- data/app/lib/actions/katello/event_queue/suspended_action.rb +2 -2
- data/app/lib/actions/katello/host/hypervisors_update.rb +82 -22
- data/app/lib/actions/katello/organization/manifest_refresh.rb +1 -1
- data/app/lib/actions/katello/product/content_create.rb +30 -38
- data/app/lib/actions/katello/product/content_destroy.rb +11 -12
- data/app/lib/actions/katello/product/create.rb +0 -1
- data/app/lib/actions/katello/product/update.rb +0 -2
- data/app/lib/actions/katello/repository/clear.rb +2 -0
- data/app/lib/actions/katello/repository/clone_to_environment.rb +0 -2
- data/app/lib/actions/katello/repository/clone_to_version.rb +15 -3
- data/app/lib/actions/katello/repository/clone_yum_content.rb +21 -2
- data/app/lib/actions/katello/repository/clone_yum_metadata.rb +1 -1
- data/app/lib/actions/katello/repository/correct_checksum.rb +5 -5
- data/app/lib/actions/katello/repository/create.rb +7 -7
- data/app/lib/actions/katello/repository/create_root.rb +22 -0
- data/app/lib/actions/katello/repository/destroy.rb +11 -6
- data/app/lib/actions/katello/repository/discover.rb +5 -3
- data/app/lib/actions/katello/repository/export.rb +1 -1
- data/app/lib/actions/katello/repository/fetch_pxe_files.rb +13 -27
- data/app/lib/actions/katello/repository/index_module_streams.rb +16 -0
- data/app/lib/actions/katello/repository/metadata_generate.rb +1 -1
- data/app/lib/actions/katello/repository/sync.rb +0 -2
- data/app/lib/actions/katello/repository/update.rb +15 -28
- data/app/lib/actions/katello/repository_set/disable_repository.rb +5 -13
- data/app/lib/actions/katello/repository_set/enable_repository.rb +3 -16
- data/app/lib/actions/katello/repository_set/scan_cdn.rb +4 -32
- data/app/lib/actions/katello/sync_plan/run.rb +37 -0
- data/app/lib/actions/pulp/abstract.rb +7 -2
- data/app/lib/actions/pulp/abstract_async_task.rb +1 -0
- data/app/lib/actions/pulp/consumer/generate_applicability.rb +1 -0
- data/app/lib/actions/pulp/repository/copy_module_default.rb +11 -0
- data/app/lib/actions/pulp/repository/copy_module_stream.rb +11 -0
- data/app/lib/actions/pulp/repository/create.rb +2 -0
- data/app/lib/actions/pulp/repository/distributor_publish.rb +3 -2
- data/app/lib/actions/pulp/repository/remove_module_default.rb +11 -0
- data/app/lib/actions/pulp/repository/remove_module_stream.rb +11 -0
- data/app/lib/actions/pulp/repository/sync.rb +6 -19
- data/app/lib/actions/pulp/repository/update_importer.rb +9 -7
- data/app/lib/katello/concerns/base_template_scope_extensions.rb +42 -0
- data/app/lib/katello/concerns/renderer_extensions.rb +6 -4
- data/app/lib/katello/http_resource.rb +5 -1
- data/app/lib/katello/repo_discovery.rb +6 -2
- data/app/lib/katello/resources/candlepin/consumer.rb +18 -1
- data/app/lib/katello/resources/candlepin/owner.rb +9 -0
- data/app/lib/katello/resources/candlepin/pool.rb +2 -2
- data/app/lib/katello/validators/root_repository_unique_attribute_validator.rb +13 -0
- data/app/models/katello/authorization/product.rb +3 -4
- data/app/models/katello/authorization/repository.rb +4 -4
- data/app/models/katello/candlepin/repository_mapper.rb +12 -26
- data/app/models/katello/concerns/audit_search.rb +13 -0
- data/app/models/katello/concerns/content_facet_host_extensions.rb +1 -1
- data/app/models/katello/concerns/content_view_filter_rule_common.rb +1 -0
- data/app/models/katello/concerns/host_managed_extensions.rb +68 -2
- data/app/models/katello/concerns/hostgroup_extensions.rb +13 -0
- data/app/models/katello/concerns/location_extensions.rb +3 -3
- data/app/models/katello/concerns/organization_extensions.rb +7 -3
- data/app/models/katello/concerns/pulp_database_unit.rb +1 -0
- data/app/models/katello/concerns/recurring_logic_extensions.rb +11 -0
- data/app/models/katello/concerns/redhat_extensions.rb +0 -25
- data/app/models/katello/concerns/search_by_repository_name.rb +21 -0
- data/app/models/katello/concerns/setting_extensions.rb +1 -1
- data/app/models/katello/concerns/subscription_facet_host_extensions.rb +43 -0
- data/app/models/katello/content.rb +7 -3
- data/app/models/katello/content_view.rb +4 -4
- data/app/models/katello/content_view_component.rb +1 -1
- data/app/models/katello/content_view_history.rb +1 -0
- data/app/models/katello/content_view_version.rb +14 -2
- data/app/models/katello/docker_manifest_list.rb +1 -1
- data/app/models/katello/docker_meta_tag.rb +11 -2
- data/app/models/katello/docker_tag.rb +1 -1
- data/app/models/katello/erratum.rb +6 -0
- data/app/models/katello/file_unit.rb +0 -1
- data/app/models/katello/glue/candlepin/owner.rb +1 -0
- data/app/models/katello/glue/candlepin/pool.rb +1 -2
- data/app/models/katello/glue/candlepin/product.rb +0 -4
- data/app/models/katello/glue/candlepin/repository.rb +0 -21
- data/app/models/katello/glue/provider.rb +4 -2
- data/app/models/katello/glue/pulp/repo.rb +10 -173
- data/app/models/katello/glue/pulp/repos.rb +2 -112
- data/app/models/katello/gpg_key.rb +6 -14
- data/app/models/katello/host/content_facet.rb +1 -1
- data/app/models/katello/host/subscription_facet.rb +32 -8
- data/app/models/katello/kt_environment.rb +9 -29
- data/app/models/katello/module_profile.rb +6 -0
- data/app/models/katello/module_profile_rpm.rb +5 -0
- data/app/models/katello/module_stream.rb +112 -0
- data/app/models/katello/module_stream_artifact.rb +5 -0
- data/app/models/katello/ostree_branch.rb +0 -1
- data/app/models/katello/package_group.rb +1 -1
- data/app/models/katello/pool.rb +4 -0
- data/app/models/katello/product.rb +18 -21
- data/app/models/katello/product_content.rb +2 -2
- data/app/models/katello/puppet_module.rb +1 -0
- data/app/models/katello/purpose_addons_status.rb +50 -0
- data/app/models/katello/purpose_role_status.rb +50 -0
- data/app/models/katello/purpose_sla_status.rb +48 -0
- data/app/models/katello/purpose_status.rb +56 -0
- data/app/models/katello/purpose_usage_status.rb +50 -0
- data/app/models/katello/repository.rb +116 -280
- data/app/models/katello/repository_module_stream.rb +7 -0
- data/app/models/katello/root_repository.rb +262 -0
- data/app/models/katello/subscription_status.rb +1 -1
- data/app/models/katello/sync_plan.rb +93 -40
- data/app/presenters/katello/content_view_version_compare_presenter.rb +7 -2
- data/app/services/katello/candlepin/consumer.rb +25 -0
- data/app/services/katello/candlepin/message_handler.rb +18 -2
- data/app/services/katello/managed_content_medium_provider.rb +27 -0
- data/app/services/katello/product_content_finder.rb +3 -3
- data/app/services/katello/pulp/module_stream.rb +9 -0
- data/app/services/katello/pulp/repository.rb +22 -0
- data/app/services/katello/pulp/srpm.rb +1 -1
- data/app/services/katello/pxe_files_downloader.rb +41 -0
- data/app/services/katello/registration_manager.rb +5 -0
- data/app/views/katello/api/v2/content_facet/show.json.rabl +0 -4
- data/app/views/katello/api/v2/content_view_versions/base.json.rabl +12 -2
- data/app/views/katello/api/v2/debs/compare.json.rabl +10 -0
- data/app/views/katello/api/v2/docker_manifest_lists/compare.json.rabl +10 -0
- data/app/views/katello/api/v2/environments/show.json.rabl +1 -0
- data/app/views/katello/api/v2/hosts/host_collections.json.rabl +3 -0
- data/app/views/katello/api/v2/module_streams/base.json.rabl +4 -0
- data/app/views/katello/api/v2/module_streams/index.json.rabl +7 -0
- data/app/views/katello/api/v2/module_streams/name_stream.json.rabl +3 -0
- data/app/views/katello/api/v2/module_streams/name_streams.json.rabl +7 -0
- data/app/views/katello/api/v2/module_streams/show.json.rabl +21 -0
- data/app/views/katello/api/v2/organizations/show.json.rabl +4 -1
- data/app/views/katello/api/v2/products/base.json.rabl +1 -1
- data/app/views/katello/api/v2/repositories/base.json.rabl +23 -10
- data/app/views/katello/api/v2/repositories/show.json.rabl +47 -38
- data/app/views/katello/api/v2/smart_proxies/download_policy.json.rabl +1 -0
- data/app/views/katello/api/v2/subscription_facet/base.json.rabl +1 -1
- data/app/views/katello/api/v2/sync_plans/show.json.rabl +2 -1
- data/app/views/katello/layouts/react.html.erb +1 -0
- data/config/katello.yaml.example +1 -2
- data/config/routes.rb +5 -0
- data/config/routes/api/v2.rb +12 -1
- data/config/routes/overrides.rb +1 -0
- data/db/migrate/20150114225023_add_upstream_name_to_repository.rb +7 -2
- data/db/migrate/20170208215148_add_docker_repo_name.rb +10 -1
- data/db/migrate/20180326190408_move_subscription_products.rb +2 -0
- data/db/migrate/20180622105300_add_docker_tags_whitelist_to_repository.rb +9 -0
- data/db/migrate/20180725083800_change_repository_password_length.rb +5 -0
- data/db/migrate/20180806205420_add_index_to_content_view_version.rb +5 -0
- data/db/migrate/20180807145652_create_katello_module_streams.rb +88 -0
- data/db/migrate/20180807164405_remove_repository_cp_label.rb +5 -0
- data/db/migrate/20180808013432_add_system_purpose_attrs.rb +39 -0
- data/db/migrate/20180814202747_add_recurring_logic_to_sync_plan.rb +12 -0
- data/db/migrate/20180816142044_add_description_to_katello_module_streams.rb +6 -0
- data/db/migrate/20180821144248_add_cron_logic_to_sync_plans.rb +5 -0
- data/db/migrate/20180828161400_remove_join_table_for_role_and_usage.rb +20 -0
- data/db/migrate/20180917173645_add_source_repo_checksum_type_to_katello_repositories.rb +1 -1
- data/db/migrate/20180920123913_drop_repo_module_streams_timestamp_not_null.rb +7 -0
- data/db/migrate/20180920171008_change_repository_password_to_text.rb +17 -0
- data/db/migrate/20180920214134_create_repository_root.rb +142 -0
- data/db/seeds.d/111-container-image-bookmarks.rb +19 -0
- data/db/seeds.d/111-upgrade_tasks.rb +9 -0
- data/db/seeds.d/150-module_job_templates.rb +12 -0
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/bastion-katello-bootstrap.js +1 -0
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/bastion_katello.js +3 -0
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/common/module-stream-actions.service.js +26 -0
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/common/views/subscription-add-or-remove.html +1 -1
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-hosts/bulk/content-hosts-bulk-module-streams-modal.controller.js +60 -0
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-hosts/bulk/content-hosts-bulk-repository-sets-modal.controller.js +2 -1
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-hosts/bulk/views/content-host-bulk-module-streams-modal.html +70 -0
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-hosts/bulk/views/content-hosts-bulk-packages-modal.html +16 -14
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-hosts/bulk/views/content-hosts-bulk-repository-sets-modal.html +1 -7
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-hosts/content-host-modal-helper.service.js +11 -0
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-hosts/content-hosts-helper.service.js +8 -4
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-hosts/content-hosts.controller.js +5 -0
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-hosts/content-hosts.routes.js +14 -0
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-hosts/content/content-host-module-streams.controller.js +48 -0
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-hosts/content/views/content-host-module-streams.html +68 -0
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-hosts/details/content-host-details-info.controller.js +15 -0
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-hosts/details/content-host-details.controller.js +59 -2
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-hosts/details/views/content-host-details.html +6 -0
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-hosts/details/views/content-host-info.html +81 -27
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-hosts/details/views/content-host-provisioning-info.html +1 -1
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-hosts/details/views/content-host-subscriptions.html +2 -2
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-hosts/views/content-hosts.html +4 -0
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-views/content-views.routes.js +10 -0
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-views/details/content-view-repositories.service.js +0 -1
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-views/details/views/content-view-repositories.html +5 -0
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-views/details/views/content-view-versions.html +3 -0
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-views/new/content-view-new.controller.js +7 -0
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-views/new/views/content-view-new.html +1 -2
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-views/versions/content-view-version-content.controller.js +38 -13
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-views/versions/content-view-versions.module.js +1 -0
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-views/versions/views/content-view-version-module-streams.html +8 -0
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-views/versions/views/content-view-version-ostree-branches.html +1 -1
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-views/versions/views/content-view-version-package-groups.html +1 -1
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-views/versions/views/content-view-version-packages.html +1 -1
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-views/versions/views/content-view-version-yum.html +5 -0
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-views/versions/views/content-view-version.html +7 -0
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/docker-tags/docker-tags.controller.js +1 -0
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/environments/content.service.js +5 -0
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/environments/details/views/environment-module-streams.html +38 -0
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/environments/details/views/environment.html +1 -1
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/environments/environments.routes.js +11 -0
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/environments/views/environments.html +3 -0
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/errata/details/erratum-repositories.controller.js +6 -22
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/errata/details/views/erratum-repositories.html +7 -1
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/host-collections/details/host-collection-details.controller.js +4 -0
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/host-collections/details/views/host-collection-info.html +6 -0
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/hosts/host-bulk-action.factory.js +2 -1
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/module-streams/module-stream.factory.js +27 -0
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/module-streams/module-streams.module.js +15 -0
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/module-streams/views/partials/module-streams-table.html +25 -0
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/packages/details/package-repositories.controller.js +6 -22
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/packages/details/views/package-repositories.html +7 -1
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/packages/repositories-filters.service.js +89 -0
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/products/details/product-repositories.controller.js +4 -5
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/products/details/repositories/details/repository-details-info.controller.js +15 -2
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/products/details/repositories/details/repository-details-info.filter.js +2 -2
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/products/details/repositories/details/repository-details-manage-content.controller.js +15 -11
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/products/details/repositories/details/repository-details.controller.js +5 -0
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/products/details/repositories/details/views/repository-info.html +36 -20
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/products/details/repositories/details/views/repository-manage-module-streams.html +17 -0
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/products/details/repositories/new/views/new-repository.html +6 -6
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/products/details/repositories/repositories.routes.js +9 -0
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/products/details/repositories/views/product-repositories.html +5 -0
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/products/discovery/discovery.controller.js +2 -1
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/products/discovery/views/discovery.html +10 -0
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/products/new/new-sync-plan-modal.controller.js +6 -2
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/repository-sets/repository-set.factory.js +1 -1
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/sync-plans/details/sync-plan-details-info.controller.js +20 -3
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/sync-plans/details/sync-plan-details.controller.js +2 -1
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/sync-plans/details/views/sync-plan-info.html +23 -4
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/sync-plans/new/new-sync-plan.controller.js +10 -6
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/sync-plans/new/views/new-sync-plan-form.html +11 -3
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/sync-plans/sync-plan-helper.service.js +3 -3
- data/engines/bastion_katello/app/assets/stylesheets/bastion_katello/bastion_katello.scss +5 -1
- data/engines/bastion_katello/lib/bastion_katello/engine.rb +2 -2
- data/lib/katello/engine.rb +7 -12
- data/lib/katello/permission_creator.rb +5 -1
- data/lib/katello/permissions/host_permissions.rb +1 -0
- data/lib/katello/plugin.rb +38 -14
- data/lib/katello/tasks/clean_backend_objects.rake +7 -3
- data/lib/katello/tasks/reimport.rake +1 -0
- data/lib/katello/tasks/repository.rake +11 -8
- data/lib/katello/tasks/upgrades/3.9/migrate_sync_plans.rake +29 -0
- data/lib/katello/version.rb +1 -1
- data/package.json +11 -7
- data/webpack/__mocks__/foremanReact/common/I18n.js +5 -0
- data/webpack/components/MultiSelect/index.js +15 -3
- data/webpack/components/PaginationRow/index.js +1 -1
- data/webpack/components/Search/__snapshots__/Search.test.js.snap +1 -0
- data/webpack/components/Search/index.js +5 -1
- data/webpack/components/SelectOrg/SetOrganization.js +2 -1
- data/webpack/components/WithOrganization/__snapshots__/withOrganization.test.js.snap +41 -0
- data/webpack/components/WithOrganization/withOrganization.js +42 -10
- data/webpack/components/WithOrganization/withOrganization.test.js +26 -0
- data/webpack/containers/Application/Headers.js +11 -0
- data/webpack/containers/Application/Routes.js +1 -1
- data/webpack/containers/Application/config.js +23 -7
- data/webpack/containers/Application/withHeaders.js +15 -0
- data/webpack/move_to_foreman/common/helpers.js +72 -8
- data/webpack/move_to_foreman/components/common/ConfirmDialog/ConfirmDialog.js +1 -0
- data/webpack/move_to_foreman/components/common/Dialog/Dialog.js +1 -0
- data/webpack/move_to_foreman/components/common/EmptyState/index.js +1 -0
- data/webpack/move_to_foreman/components/common/ModalProgressBar/ModalProgressBar.js +1 -1
- data/webpack/move_to_foreman/components/common/table/formatters/selectionCellFormatter.js +1 -0
- data/webpack/move_to_pf/OptionTooltip/OptionTooltip.scss +20 -0
- data/webpack/move_to_pf/OptionTooltip/__tests__/OptionTooltip.test.js +32 -0
- data/webpack/move_to_pf/OptionTooltip/__tests__/__snapshots__/OptionTooltip.test.js.snap +84 -0
- data/webpack/move_to_pf/OptionTooltip/index.js +83 -0
- data/webpack/move_to_pf/TypeAhead/TypeAhead.js +15 -2
- data/webpack/move_to_pf/react-bootstrap-select/index.js +10 -4
- data/webpack/move_to_pf/test-utils/testHelpers.js +14 -2
- data/webpack/redux/actions/RedHatRepositories/enabled.js +29 -3
- data/webpack/redux/actions/RedHatRepositories/helpers.js +1 -1
- data/webpack/redux/actions/RedHatRepositories/repositorySetRepositories.js +27 -0
- data/webpack/redux/consts.js +8 -0
- data/webpack/redux/reducers/RedHatRepositories/__tests__/enabled.test.js +62 -0
- data/webpack/redux/reducers/RedHatRepositories/{repositorySetRepositories.test.js → __tests__/repositorySetRepositories.test.js} +31 -3
- data/webpack/redux/reducers/RedHatRepositories/{sets.test.js → __tests__/sets.test.js} +3 -3
- data/webpack/redux/reducers/RedHatRepositories/enabled.fixtures.js +16 -0
- data/webpack/redux/reducers/RedHatRepositories/enabled.js +34 -18
- data/webpack/redux/reducers/RedHatRepositories/repositorySetRepositories.fixtures.js +10 -0
- data/webpack/redux/reducers/RedHatRepositories/repositorySetRepositories.js +39 -48
- data/webpack/redux/reducers/index.js +6 -0
- data/webpack/scenes/ModuleStreams/Details/ModuleStreamDetailArtifacts.js +19 -0
- data/webpack/scenes/ModuleStreams/Details/ModuleStreamDetailInfo.js +51 -0
- data/webpack/scenes/ModuleStreams/Details/ModuleStreamDetails.js +147 -0
- data/webpack/scenes/ModuleStreams/Details/ModuleStreamDetailsActions.js +25 -0
- data/webpack/scenes/ModuleStreams/Details/ModuleStreamDetailsConstants.js +3 -0
- data/webpack/scenes/ModuleStreams/Details/ModuleStreamDetailsReducer.js +33 -0
- data/webpack/scenes/ModuleStreams/Details/Profiles/ModuleStreamDetailProfiles.js +19 -0
- data/webpack/scenes/ModuleStreams/Details/Profiles/ProfileRpmsCellFormatter.js +53 -0
- data/webpack/scenes/ModuleStreams/Details/Profiles/ProfileRpmsCellFormatter.scss +4 -0
- data/webpack/scenes/ModuleStreams/Details/Profiles/TableSchema.js +35 -0
- data/webpack/scenes/ModuleStreams/Details/Profiles/__tests__/ModuleStreamDetailProfiles.test.js +14 -0
- data/webpack/scenes/ModuleStreams/Details/Profiles/__tests__/ProfileRpmsCellFormatter.test.js +24 -0
- data/webpack/scenes/ModuleStreams/Details/Profiles/__tests__/__snapshots__/ModuleStreamDetailProfiles.test.js.snap +126 -0
- data/webpack/scenes/ModuleStreams/Details/Profiles/__tests__/__snapshots__/ProfileRpmsCellFormatter.test.js.snap +14 -0
- data/webpack/scenes/ModuleStreams/Details/Repositories/ModuleStreamDetailRepositories.js +19 -0
- data/webpack/scenes/ModuleStreams/Details/Repositories/TableSchema.js +39 -0
- data/webpack/scenes/ModuleStreams/Details/Repositories/__tests__/ModuleStreamDetailRepositories.test.js +14 -0
- data/webpack/scenes/ModuleStreams/Details/Repositories/__tests__/__snapshots__/ModuleStreamDetailRepositories.test.js.snap +70 -0
- data/webpack/scenes/ModuleStreams/Details/__tests__/ModuleStreamDetailArtifacts.test.js +14 -0
- data/webpack/scenes/ModuleStreams/Details/__tests__/ModuleStreamDetailInfo.test.js +14 -0
- data/webpack/scenes/ModuleStreams/Details/__tests__/ModuleStreamDetails.test.js +27 -0
- data/webpack/scenes/ModuleStreams/Details/__tests__/ModuleStreamDetailsActions.test.js +42 -0
- data/webpack/scenes/ModuleStreams/Details/__tests__/ModuleStreamDetailsReducer.test.js +33 -0
- data/webpack/scenes/ModuleStreams/Details/__tests__/__snapshots__/ModuleStreamDetailArtifacts.test.js.snap +18 -0
- data/webpack/scenes/ModuleStreams/Details/__tests__/__snapshots__/ModuleStreamDetailInfo.test.js.snap +111 -0
- data/webpack/scenes/ModuleStreams/Details/__tests__/__snapshots__/ModuleStreamDetails.test.js.snap +552 -0
- data/webpack/scenes/ModuleStreams/Details/__tests__/__snapshots__/ModuleStreamDetailsActions.test.js.snap +144 -0
- data/webpack/scenes/ModuleStreams/Details/__tests__/__snapshots__/ModuleStreamDetailsReducer.test.js.snap +50 -0
- data/webpack/scenes/ModuleStreams/Details/__tests__/moduleStreamDetails.fixtures.js +115 -0
- data/webpack/scenes/ModuleStreams/Details/index.js +17 -0
- data/webpack/scenes/ModuleStreams/ModuleStreamsActions.js +29 -0
- data/webpack/scenes/ModuleStreams/ModuleStreamsConstants.js +3 -0
- data/webpack/scenes/ModuleStreams/ModuleStreamsPage.js +98 -0
- data/webpack/scenes/ModuleStreams/ModuleStreamsReducer.js +43 -0
- data/webpack/scenes/ModuleStreams/ModuleStreamsTable.js +38 -0
- data/webpack/scenes/ModuleStreams/ModuleStreamsTableSchema.js +69 -0
- data/webpack/scenes/ModuleStreams/__tests__/ModuleStreamPage.test.js +27 -0
- data/webpack/scenes/ModuleStreams/__tests__/ModuleStreamsActions.test.js +49 -0
- data/webpack/scenes/ModuleStreams/__tests__/ModuleStreamsReducer.test.js +46 -0
- data/webpack/scenes/ModuleStreams/__tests__/ModuleStreamsTable.test.js +25 -0
- data/webpack/scenes/ModuleStreams/__tests__/__snapshots__/ModuleStreamPage.test.js.snap +69 -0
- data/webpack/scenes/ModuleStreams/__tests__/__snapshots__/ModuleStreamsTable.test.js.snap +95 -0
- data/webpack/scenes/ModuleStreams/__tests__/moduleStreams.fixtures.js +72 -0
- data/webpack/scenes/ModuleStreams/index.js +17 -0
- data/webpack/scenes/RedHatRepositories/components/EnabledRepository/EnabledRepository.js +120 -0
- data/webpack/scenes/RedHatRepositories/components/{EnabledRepository.stories.js → EnabledRepository/EnabledRepository.stories.js} +0 -0
- data/webpack/scenes/RedHatRepositories/components/{EnabledRepositoryContent.js → EnabledRepository/EnabledRepositoryContent.js} +0 -0
- data/webpack/scenes/RedHatRepositories/components/{__tests__ → EnabledRepository/__tests__}/EnabledRepository.test.js +6 -2
- data/webpack/scenes/RedHatRepositories/components/{__tests__ → EnabledRepository/__tests__}/EnabledRepositoryContent.test.js +0 -0
- data/webpack/scenes/RedHatRepositories/components/EnabledRepository/__tests__/__snapshots__/EnabledRepository.test.js.snap +31 -0
- data/webpack/scenes/RedHatRepositories/components/{__tests__ → EnabledRepository/__tests__}/__snapshots__/EnabledRepositoryContent.test.js.snap +0 -0
- data/webpack/scenes/RedHatRepositories/components/EnabledRepository/index.js +17 -0
- data/webpack/scenes/RedHatRepositories/components/RepositorySet.js +1 -1
- data/webpack/scenes/RedHatRepositories/components/RepositorySetRepositories.js +43 -5
- data/webpack/scenes/RedHatRepositories/components/RepositorySetRepositoriesHelpers.js +3 -0
- data/webpack/scenes/RedHatRepositories/components/RepositorySetRepository/RepositorySetRepository.js +168 -0
- data/webpack/scenes/RedHatRepositories/components/RepositorySetRepository/__test__/RepositorySetRepository.test.js +38 -0
- data/webpack/scenes/RedHatRepositories/components/RepositorySetRepository/__test__/__snapshots__/RepositorySetRepository.test.js.snap +70 -0
- data/webpack/scenes/RedHatRepositories/components/RepositorySetRepository/index.js +18 -0
- data/webpack/scenes/RedHatRepositories/components/SearchBar.js +4 -3
- data/webpack/scenes/RedHatRepositories/components/__tests__/RepositorySetRepositories.test.js +44 -0
- data/webpack/scenes/RedHatRepositories/components/__tests__/__snapshots__/RepositorySetRepositories.test.js.snap +48 -0
- data/webpack/scenes/RedHatRepositories/helpers.js +19 -15
- data/webpack/scenes/RedHatRepositories/index.js +1 -3
- data/webpack/scenes/RedHatRepositories/index.scss +16 -0
- data/webpack/scenes/Settings/Tables/TableActions.js +73 -0
- data/webpack/scenes/Settings/Tables/TableConstants.js +11 -0
- data/webpack/scenes/Settings/Tables/TableHelpers.js +8 -0
- data/webpack/scenes/Settings/Tables/TableReducer.js +46 -0
- data/webpack/scenes/Settings/Tables/__tests__/Table.fixtures.js +125 -0
- data/webpack/scenes/Settings/Tables/__tests__/TableActions.test.js +84 -0
- data/webpack/scenes/Settings/Tables/__tests__/TableReducer.test.js +41 -0
- data/webpack/scenes/Settings/Tables/__tests__/__snapshots__/TableReducer.test.js.snap +76 -0
- data/webpack/scenes/Settings/index.js +4 -0
- data/webpack/scenes/Subscriptions/Details/SubscriptionAttributes.js +2 -0
- data/webpack/scenes/Subscriptions/Details/SubscriptionDetailActions.js +1 -1
- data/webpack/scenes/Subscriptions/Details/SubscriptionDetailAssociations.js +1 -0
- data/webpack/scenes/Subscriptions/Details/SubscriptionDetailInfo.js +1 -0
- data/webpack/scenes/Subscriptions/Details/SubscriptionDetailProduct.js +20 -13
- data/webpack/scenes/Subscriptions/Details/{SubscriptionDetailEnabledProducts.js → SubscriptionDetailProductContent.js} +5 -5
- data/webpack/scenes/Subscriptions/Details/SubscriptionDetailReducer.js +3 -3
- data/webpack/scenes/Subscriptions/Details/SubscriptionDetails.js +7 -6
- data/webpack/scenes/Subscriptions/Details/__tests__/{SubscriptionDetailEnabledProducts.test.js → SubscriptionDetailProductContent.test.js} +4 -4
- data/webpack/scenes/Subscriptions/Details/__tests__/SubscriptionDetails.test.js +2 -2
- data/webpack/scenes/Subscriptions/Details/__tests__/__snapshots__/SubscriptionDetailProduct.test.js.snap +28 -16
- data/webpack/scenes/Subscriptions/Details/__tests__/__snapshots__/{SubscriptionDetailEnabledProducts.test.js.snap → SubscriptionDetailProductContent.test.js.snap} +1 -1
- data/webpack/scenes/Subscriptions/Details/__tests__/__snapshots__/SubscriptionDetails.test.js.snap +16 -16
- data/webpack/scenes/Subscriptions/Details/__tests__/subscriptionDetails.fixtures.js +1 -1
- data/webpack/scenes/Subscriptions/Manifest/DeleteManifestModalText.js +2 -0
- data/webpack/scenes/Subscriptions/Manifest/ManageManifestModal.js +38 -61
- data/webpack/scenes/Subscriptions/Manifest/ManifestHistoryReducer.js +4 -0
- data/webpack/scenes/Subscriptions/Manifest/ManifestHistoryTableSchema.js +1 -0
- data/webpack/scenes/Subscriptions/Manifest/__tests__/ManageManifestModal.test.js +3 -3
- data/webpack/scenes/Subscriptions/Manifest/__tests__/__snapshots__/ManageManifestModal.test.js.snap +12 -3
- data/webpack/scenes/Subscriptions/SubscriptionActions.js +26 -0
- data/webpack/scenes/Subscriptions/SubscriptionConstants.js +56 -0
- data/webpack/scenes/Subscriptions/SubscriptionReducer.js +26 -11
- data/webpack/scenes/Subscriptions/SubscriptionValidations.js +1 -0
- data/webpack/scenes/Subscriptions/SubscriptionsPage.js +144 -39
- data/webpack/scenes/Subscriptions/SubscriptionsPage.scss +7 -0
- data/webpack/scenes/Subscriptions/UpstreamSubscriptions/UpstreamSubscriptionsPage.js +10 -16
- data/webpack/scenes/Subscriptions/UpstreamSubscriptions/UpstreamSubscriptionsTableSchema.js +1 -0
- data/webpack/scenes/Subscriptions/UpstreamSubscriptions/__tests__/UpstreamSubscriptionsPage.test.js +1 -1
- data/webpack/scenes/Subscriptions/__tests__/SubscriptionsActions.test.js +11 -1
- data/webpack/scenes/Subscriptions/__tests__/SubscriptionsPage.test.js +15 -2
- data/webpack/scenes/Subscriptions/__tests__/SubscriptionsReducer.test.js +12 -0
- data/webpack/scenes/Subscriptions/__tests__/__snapshots__/SubscriptionsPage.test.js.snap +19 -0
- data/webpack/scenes/Subscriptions/__tests__/subscriptions.fixtures.js +87 -0
- data/webpack/scenes/Subscriptions/components/SubscriptionsTable/EntitlementsInlineEditFormatter.js +1 -1
- data/webpack/scenes/Subscriptions/components/SubscriptionsTable/SubscriptionTypeFormatter.js +31 -0
- data/webpack/scenes/Subscriptions/components/SubscriptionsTable/SubscriptionsTable.js +16 -11
- data/webpack/scenes/Subscriptions/components/SubscriptionsTable/SubscriptionsTableSchema.js +18 -3
- data/webpack/scenes/Subscriptions/components/SubscriptionsTable/__tests__/SubscriptionTypeFormatter.test.js +33 -0
- data/webpack/scenes/Subscriptions/components/SubscriptionsTable/__tests__/SubscriptionsTable.test.js +29 -0
- data/webpack/scenes/Subscriptions/components/SubscriptionsTable/__tests__/__snapshots__/SubscriptionTypeFormatter.test.js.snap +34 -0
- data/webpack/scenes/Subscriptions/components/SubscriptionsTable/__tests__/__snapshots__/SubscriptionsTable.test.js.snap +24 -43
- data/webpack/scenes/Subscriptions/index.js +24 -7
- data/webpack/scenes/Tasks/TaskActions.js +43 -19
- data/webpack/scenes/Tasks/TaskConstants.js +1 -0
- data/webpack/scenes/Tasks/__tests__/TaskActions.test.js +15 -12
- data/webpack/scenes/Tasks/helpers.js +17 -27
- data/webpack/services/api/index.js +3 -0
- metadata +160 -52
- data/app/lib/actions/katello/repository/scheduled_sync.rb +0 -15
- data/app/lib/actions/katello/sync_plan/add_products.rb +0 -27
- data/app/lib/actions/katello/sync_plan/destroy.rb +0 -26
- data/app/lib/actions/katello/sync_plan/remove_products.rb +0 -23
- data/app/lib/actions/katello/sync_plan/update.rb +0 -20
- data/app/lib/actions/pulp/repos/update.rb +0 -24
- data/app/lib/actions/pulp/repository/ensure_sync_notification.rb +0 -11
- data/app/lib/actions/pulp/repository/remove_schedule.rb +0 -16
- data/app/lib/actions/pulp/repository/update_schedule.rb +0 -47
- data/app/lib/katello/validators/repository_unique_attribute_validator.rb +0 -13
- data/app/models/katello/candlepin/docker_repository_mapper.rb +0 -77
- data/app/models/katello/input_template_renderer.rb +0 -7
- data/lib/katello/tasks/upgrades/2.4/import_distributions.rake +0 -11
- data/lib/katello/tasks/upgrades/2.4/import_package_groups.rake +0 -11
- data/lib/katello/tasks/upgrades/2.4/import_puppet_modules.rake +0 -12
- data/lib/katello/tasks/upgrades/2.4/import_rpms.rake +0 -12
- data/lib/katello/tasks/upgrades/3.0/add_export_distributor.rake +0 -14
- data/lib/katello/tasks/upgrades/3.0/delete_docker_v1_content.rake +0 -27
- data/lib/katello/tasks/upgrades/3.0/update_puppet_repository_distributors.rake +0 -20
- data/lib/katello/tasks/upgrades/3.0/update_subscription_facet_backend_data.rake +0 -9
- data/lib/katello/tasks/upgrades/3.3/hypervisors.rake +0 -7
- data/lib/katello/tasks/upgrades/3.4/reindex_docker_tags.rake +0 -12
- data/lib/katello/tasks/upgrades/3.4/remove_unused_products.rake +0 -28
- data/lib/katello/tasks/upgrades/3.6/import_backend_consumer_attributes.rake +0 -32
- data/lib/katello/tasks/upgrades/3.6/import_product_content.rake +0 -12
- data/lib/katello/tasks/upgrades/3.6/republish_file_repos.rake +0 -16
- data/lib/katello/tasks/upgrades/3.7/import_pools.rake +0 -12
- data/lib/katello/tasks/upgrades/3.7/make_all_ks_repos_bootable.rake +0 -11
- data/webpack/helpers/caret.js +0 -6
- data/webpack/redux/reducers/RedHatRepositories/enabled.test.js +0 -36
- data/webpack/redux/reducers/RedHatRepositories/filters.fixtures.js +0 -5
- data/webpack/scenes/RedHatRepositories/components/EnabledRepository.js +0 -105
- data/webpack/scenes/RedHatRepositories/components/RepositorySetRepository.js +0 -129
- data/webpack/scenes/RedHatRepositories/components/__tests__/__snapshots__/EnabledRepository.test.js.snap +0 -25
@@ -4,6 +4,7 @@ import { Icon } from 'patternfly-react';
|
|
4
4
|
import { Link } from 'react-router-dom';
|
5
5
|
import helpers from '../../../../move_to_foreman/common/helpers';
|
6
6
|
import { entitlementsInlineEditFormatter } from './EntitlementsInlineEditFormatter';
|
7
|
+
import { subscriptionTypeFormatter } from './SubscriptionTypeFormatter';
|
7
8
|
import {
|
8
9
|
headerFormatter,
|
9
10
|
cellFormatter,
|
@@ -24,12 +25,16 @@ export const createSubscriptionsTableSchema = (
|
|
24
25
|
},
|
25
26
|
cell: {
|
26
27
|
formatters: [
|
27
|
-
(value, additionalData) =>
|
28
|
-
|
28
|
+
(value, additionalData) => {
|
29
|
+
// eslint-disable-next-line no-param-reassign
|
30
|
+
additionalData.disabled = additionalData.rowData.available === -1;
|
31
|
+
|
32
|
+
return collapseableAndSelectionCellFormatter(
|
29
33
|
groupingController,
|
30
34
|
selectionController,
|
31
35
|
additionalData,
|
32
|
-
)
|
36
|
+
);
|
37
|
+
},
|
33
38
|
],
|
34
39
|
},
|
35
40
|
},
|
@@ -49,6 +54,16 @@ export const createSubscriptionsTableSchema = (
|
|
49
54
|
],
|
50
55
|
},
|
51
56
|
},
|
57
|
+
{
|
58
|
+
property: 'type',
|
59
|
+
header: {
|
60
|
+
label: __('Type'),
|
61
|
+
formatters: [headerFormatter],
|
62
|
+
},
|
63
|
+
cell: {
|
64
|
+
formatters: [subscriptionTypeFormatter],
|
65
|
+
},
|
66
|
+
},
|
52
67
|
{
|
53
68
|
property: 'product_id',
|
54
69
|
header: {
|
@@ -0,0 +1,33 @@
|
|
1
|
+
import { shallow } from 'enzyme';
|
2
|
+
import toJson from 'enzyme-to-json';
|
3
|
+
import { subscriptionTypeFormatter } from '../SubscriptionTypeFormatter';
|
4
|
+
|
5
|
+
describe('subscriptionTypeFormatter', () => {
|
6
|
+
const data = rowData => ({
|
7
|
+
rowData,
|
8
|
+
});
|
9
|
+
|
10
|
+
it('renders physical subscriptions', async () => {
|
11
|
+
const formatter = subscriptionTypeFormatter(null, data({ virt_only: false }));
|
12
|
+
|
13
|
+
expect(toJson(shallow(formatter))).toMatchSnapshot();
|
14
|
+
});
|
15
|
+
|
16
|
+
it('renders temporary subscriptions', async () => {
|
17
|
+
const formatter = subscriptionTypeFormatter(null, data({ unmapped_guest: true }));
|
18
|
+
|
19
|
+
expect(toJson(shallow(formatter))).toMatchSnapshot();
|
20
|
+
});
|
21
|
+
|
22
|
+
it('renders virtual subscriptions', async () => {
|
23
|
+
const formatter = subscriptionTypeFormatter(null, data({}));
|
24
|
+
|
25
|
+
expect(toJson(shallow(formatter))).toMatchSnapshot();
|
26
|
+
});
|
27
|
+
|
28
|
+
it('renders link to a host', async () => {
|
29
|
+
const formatter = subscriptionTypeFormatter(null, data({ hypervisor: { name: 'host.example.com', id: 83 } }));
|
30
|
+
|
31
|
+
expect(toJson(shallow(formatter))).toMatchSnapshot();
|
32
|
+
});
|
33
|
+
});
|
data/webpack/scenes/Subscriptions/components/SubscriptionsTable/__tests__/SubscriptionsTable.test.js
CHANGED
@@ -8,15 +8,24 @@ import { loadSubscriptions, updateQuantity } from '../../../SubscriptionActions'
|
|
8
8
|
|
9
9
|
jest.mock('../../../../../move_to_foreman/foreman_toast_notifications');
|
10
10
|
jest.useFakeTimers();
|
11
|
+
const tableColumns = [
|
12
|
+
'id',
|
13
|
+
'product_id',
|
14
|
+
'contract_number',
|
15
|
+
'start_date',
|
16
|
+
'end_date',
|
17
|
+
];
|
11
18
|
describe('subscriptions table', () => {
|
12
19
|
it('should render a table', async () => {
|
13
20
|
// Wrapping SubscriptionTable in MemoryRouter here since it contains
|
14
21
|
// a Link componenent, which can't be used outside a Router
|
15
22
|
/* eslint-disable react/jsx-indent */
|
23
|
+
|
16
24
|
const page = render(<MemoryRouter>
|
17
25
|
<SubscriptionsTable
|
18
26
|
subscriptions={successState}
|
19
27
|
loadSubscriptions={loadSubscriptions}
|
28
|
+
tableColumns={tableColumns}
|
20
29
|
updateQuantity={updateQuantity}
|
21
30
|
subscriptionDeleteModalOpen={false}
|
22
31
|
onSubscriptionDeleteModalClose={() => { }}
|
@@ -28,6 +37,24 @@ describe('subscriptions table', () => {
|
|
28
37
|
expect(toJson(page)).toMatchSnapshot();
|
29
38
|
});
|
30
39
|
|
40
|
+
it('should disable checkboxes for custom subscriptions', async () => {
|
41
|
+
/* eslint-disable react/jsx-indent */
|
42
|
+
const page = render(<MemoryRouter>
|
43
|
+
<SubscriptionsTable
|
44
|
+
subscriptions={successState}
|
45
|
+
loadSubscriptions={loadSubscriptions}
|
46
|
+
tableColumns={tableColumns}
|
47
|
+
updateQuantity={updateQuantity}
|
48
|
+
subscriptionDeleteModalOpen={false}
|
49
|
+
onSubscriptionDeleteModalClose={() => { }}
|
50
|
+
onDeleteSubscriptions={() => {}}
|
51
|
+
toggleDeleteButton={() => {}}
|
52
|
+
emptyState={{}}
|
53
|
+
/>
|
54
|
+
</MemoryRouter>);
|
55
|
+
expect(page.find('#select1').is('[disabled]')).toBe(true);
|
56
|
+
});
|
57
|
+
|
31
58
|
it('should render an empty state', async () => {
|
32
59
|
const emptyStateData = {
|
33
60
|
header: __('Yay empty state'),
|
@@ -45,6 +72,7 @@ describe('subscriptions table', () => {
|
|
45
72
|
onSubscriptionDeleteModalClose={() => {}}
|
46
73
|
onDeleteSubscriptions={() => {}}
|
47
74
|
toggleDeleteButton={() => {}}
|
75
|
+
tableColumns={[]}
|
48
76
|
/>
|
49
77
|
</MemoryRouter>);
|
50
78
|
expect(toJson(page)).toMatchSnapshot();
|
@@ -55,6 +83,7 @@ describe('subscriptions table', () => {
|
|
55
83
|
const page = mount(<SubscriptionsTable
|
56
84
|
subscriptions={loadingState}
|
57
85
|
loadSubscriptions={loadSubscriptions}
|
86
|
+
tableColumns={tableColumns}
|
58
87
|
updateQuantity={updateQuantity}
|
59
88
|
subscriptionDeleteModalOpen={false}
|
60
89
|
onSubscriptionDeleteModalClose={() => { }}
|
@@ -0,0 +1,34 @@
|
|
1
|
+
// Jest Snapshot v1, https://goo.gl/fbAQLP
|
2
|
+
|
3
|
+
exports[`subscriptionTypeFormatter renders link to a host 1`] = `
|
4
|
+
<td>
|
5
|
+
<span>
|
6
|
+
Guests of
|
7
|
+
|
8
|
+
<Link
|
9
|
+
replace={false}
|
10
|
+
to="/content_hosts/83/"
|
11
|
+
>
|
12
|
+
host.example.com
|
13
|
+
</Link>
|
14
|
+
</span>
|
15
|
+
</td>
|
16
|
+
`;
|
17
|
+
|
18
|
+
exports[`subscriptionTypeFormatter renders physical subscriptions 1`] = `
|
19
|
+
<td>
|
20
|
+
Physical
|
21
|
+
</td>
|
22
|
+
`;
|
23
|
+
|
24
|
+
exports[`subscriptionTypeFormatter renders temporary subscriptions 1`] = `
|
25
|
+
<td>
|
26
|
+
Temporary
|
27
|
+
</td>
|
28
|
+
`;
|
29
|
+
|
30
|
+
exports[`subscriptionTypeFormatter renders virtual subscriptions 1`] = `
|
31
|
+
<td>
|
32
|
+
Virtual
|
33
|
+
</td>
|
34
|
+
`;
|
@@ -18,9 +18,20 @@ exports[`subscriptions table should render a loading state 1`] = `
|
|
18
18
|
},
|
19
19
|
"quantitiesLoading": false,
|
20
20
|
"results": Array [],
|
21
|
+
"selectedTableColumns": Array [],
|
22
|
+
"tableColumns": Array [],
|
21
23
|
"tasks": Array [],
|
22
24
|
}
|
23
25
|
}
|
26
|
+
tableColumns={
|
27
|
+
Array [
|
28
|
+
"id",
|
29
|
+
"product_id",
|
30
|
+
"contract_number",
|
31
|
+
"start_date",
|
32
|
+
"end_date",
|
33
|
+
]
|
34
|
+
}
|
24
35
|
task={
|
25
36
|
Object {
|
26
37
|
"humanized": Object {},
|
@@ -105,21 +116,6 @@ exports[`subscriptions table should render a table 1`] = `
|
|
105
116
|
>
|
106
117
|
End Date
|
107
118
|
</th>
|
108
|
-
<th
|
109
|
-
class=""
|
110
|
-
>
|
111
|
-
Requires Virt-Who
|
112
|
-
</th>
|
113
|
-
<th
|
114
|
-
class=""
|
115
|
-
>
|
116
|
-
Consumed
|
117
|
-
</th>
|
118
|
-
<th
|
119
|
-
class=""
|
120
|
-
>
|
121
|
-
Entitlements
|
122
|
-
</th>
|
123
119
|
</tr>
|
124
120
|
</thead>
|
125
121
|
<tbody>
|
@@ -165,20 +161,6 @@ exports[`subscriptions table should render a table 1`] = `
|
|
165
161
|
>
|
166
162
|
2047-09-14 15:18:44 -0500
|
167
163
|
</td>
|
168
|
-
<td>
|
169
|
-
<span
|
170
|
-
aria-hidden="true"
|
171
|
-
class="fa fa-minus"
|
172
|
-
/>
|
173
|
-
</td>
|
174
|
-
<td
|
175
|
-
class=""
|
176
|
-
>
|
177
|
-
1
|
178
|
-
</td>
|
179
|
-
<td>
|
180
|
-
Unlimited
|
181
|
-
</td>
|
182
164
|
</tr>
|
183
165
|
<tr
|
184
166
|
class=""
|
@@ -193,6 +175,7 @@ exports[`subscriptions table should render a table 1`] = `
|
|
193
175
|
Select row
|
194
176
|
</label>
|
195
177
|
<input
|
178
|
+
disabled=""
|
196
179
|
id="select1"
|
197
180
|
type="checkbox"
|
198
181
|
/>
|
@@ -222,20 +205,6 @@ exports[`subscriptions table should render a table 1`] = `
|
|
222
205
|
>
|
223
206
|
2047-09-18 16:54:36 -0500
|
224
207
|
</td>
|
225
|
-
<td>
|
226
|
-
<span
|
227
|
-
aria-hidden="true"
|
228
|
-
class="fa fa-minus"
|
229
|
-
/>
|
230
|
-
</td>
|
231
|
-
<td
|
232
|
-
class=""
|
233
|
-
>
|
234
|
-
0
|
235
|
-
</td>
|
236
|
-
<td>
|
237
|
-
Unlimited
|
238
|
-
</td>
|
239
208
|
</tr>
|
240
209
|
</tbody>
|
241
210
|
</table>
|
@@ -302,6 +271,18 @@ exports[`subscriptions table should render a table 1`] = `
|
|
302
271
|
15
|
303
272
|
</a>
|
304
273
|
</li>
|
274
|
+
<li
|
275
|
+
class=""
|
276
|
+
role="presentation"
|
277
|
+
>
|
278
|
+
<a
|
279
|
+
href="#"
|
280
|
+
role="menuitem"
|
281
|
+
tabindex="-1"
|
282
|
+
>
|
283
|
+
20
|
284
|
+
</a>
|
285
|
+
</li>
|
305
286
|
<li
|
306
287
|
class=""
|
307
288
|
role="presentation"
|
@@ -2,22 +2,39 @@ import { bindActionCreators } from 'redux';
|
|
2
2
|
import { connect } from 'react-redux';
|
3
3
|
|
4
4
|
import * as subscriptionActions from './SubscriptionActions';
|
5
|
+
|
5
6
|
import * as taskActions from '../Tasks/TaskActions';
|
6
7
|
import * as settingActions from '../../move_to_foreman/Settings/SettingsActions';
|
8
|
+
import * as tableActions from '../Settings/Tables/TableActions';
|
9
|
+
import * as manifestActions from './Manifest/ManifestActions';
|
7
10
|
|
8
11
|
import reducer from './SubscriptionReducer';
|
9
|
-
|
12
|
+
import { SUBSCRIPTION_TABLE_NAME } from './SubscriptionConstants';
|
10
13
|
import SubscriptionsPage from './SubscriptionsPage';
|
11
14
|
|
12
15
|
// map state to props
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
16
|
+
|
17
|
+
const mapStateToProps = (state) => {
|
18
|
+
const subscriptionTableSettings = state.katello.settings.tables[SUBSCRIPTION_TABLE_NAME] || {};
|
19
|
+
|
20
|
+
return {
|
21
|
+
organization: state.katello.organization,
|
22
|
+
subscriptions: state.katello.subscriptions,
|
23
|
+
tasks: state.katello.subscriptions.tasks,
|
24
|
+
subscriptionTableSettings,
|
25
|
+
taskDetails: state.katello.manifestHistory.taskDetails,
|
26
|
+
};
|
27
|
+
};
|
18
28
|
|
19
29
|
// map action dispatchers to props
|
20
|
-
const actions = {
|
30
|
+
const actions = {
|
31
|
+
...subscriptionActions,
|
32
|
+
...taskActions,
|
33
|
+
...settingActions,
|
34
|
+
...tableActions,
|
35
|
+
...manifestActions,
|
36
|
+
};
|
37
|
+
|
21
38
|
const mapDispatchToProps = dispatch => bindActionCreators(actions, dispatch);
|
22
39
|
|
23
40
|
// export reducers
|
@@ -8,9 +8,22 @@ import {
|
|
8
8
|
TASK_BULK_SEARCH_REQUEST,
|
9
9
|
TASK_BULK_SEARCH_SUCCESS,
|
10
10
|
TASK_BULK_SEARCH_FAILURE,
|
11
|
+
RESET_TASKS,
|
11
12
|
} from './TaskConstants';
|
12
13
|
|
13
14
|
export const bulkSearch = (extendedParams = {}) => (dispatch) => {
|
15
|
+
const params = {
|
16
|
+
search: Object.entries(propsToSnakeCase(extendedParams))
|
17
|
+
.map((item) => {
|
18
|
+
if (item[0] === 'action') {
|
19
|
+
return `${item[0]}~${item[1]}`;
|
20
|
+
}
|
21
|
+
return `${item[0]}=${item[1]}`;
|
22
|
+
})
|
23
|
+
.join(' and '),
|
24
|
+
};
|
25
|
+
|
26
|
+
|
14
27
|
const onBulkSearchSuccess = ({ data }) => dispatch({
|
15
28
|
type: TASK_BULK_SEARCH_SUCCESS,
|
16
29
|
response: data,
|
@@ -22,17 +35,18 @@ export const bulkSearch = (extendedParams = {}) => (dispatch) => {
|
|
22
35
|
});
|
23
36
|
|
24
37
|
dispatch({ type: TASK_BULK_SEARCH_REQUEST });
|
25
|
-
|
26
|
-
const params = {
|
27
|
-
searches: [{ ...propsToSnakeCase(extendedParams) }],
|
28
|
-
};
|
29
|
-
|
30
38
|
return api
|
31
|
-
.
|
39
|
+
.get('/tasks', {}, params)
|
32
40
|
.then(onBulkSearchSuccess)
|
33
41
|
.catch(onBulkSearchFailure);
|
34
42
|
};
|
35
43
|
|
44
|
+
export const resetTasks = () => (dispatch) => {
|
45
|
+
dispatch({
|
46
|
+
type: RESET_TASKS,
|
47
|
+
});
|
48
|
+
};
|
49
|
+
|
36
50
|
export const loadTask = (taskId, extendedParams = {}) => (dispatch) => {
|
37
51
|
dispatch({ type: GET_TASK_REQUEST });
|
38
52
|
|
@@ -55,22 +69,33 @@ export const loadTask = (taskId, extendedParams = {}) => (dispatch) => {
|
|
55
69
|
const isUnauthorized = action =>
|
56
70
|
(action.result && action.result.response && action.result.response.status === 401);
|
57
71
|
|
58
|
-
export const pollBulkSearch = (extendedParams = {}, interval
|
59
|
-
|
60
|
-
|
61
|
-
|
72
|
+
export const pollBulkSearch = (extendedParams = {}, interval, orgId) =>
|
73
|
+
(dispatch, getState) => {
|
74
|
+
const triggerPolling = (action) => {
|
75
|
+
const { id } = getState().katello.organization;
|
76
|
+
if (!isUnauthorized(action)) {
|
77
|
+
if (id === orgId) {
|
78
|
+
setTimeout(() => dispatch(pollBulkSearch(extendedParams, interval, orgId)), interval);
|
79
|
+
}
|
80
|
+
}
|
81
|
+
};
|
82
|
+
const { id, loading } = getState().katello.organization;
|
83
|
+
|
84
|
+
if (id === orgId && !loading) {
|
85
|
+
return dispatch(bulkSearch(extendedParams)).then(triggerPolling);
|
62
86
|
}
|
63
|
-
};
|
64
87
|
|
65
|
-
|
66
|
-
};
|
88
|
+
return dispatch({ type: 'POLLING_IS_SKIPPED' });
|
89
|
+
};
|
67
90
|
|
68
|
-
export const pollTaskUntilDone = (taskId, extendedParams = {}, interval) =>
|
69
|
-
new Promise((resolve, reject) => {
|
91
|
+
export const pollTaskUntilDone = (taskId, extendedParams = {}, interval, orgId) =>
|
92
|
+
(dispatch, getState) => new Promise((resolve, reject) => {
|
70
93
|
const pollUntilDone = (action) => {
|
71
|
-
|
94
|
+
const { id, loading } = getState().katello.organization;
|
95
|
+
|
96
|
+
if (isUnauthorized(action) || id !== orgId || loading) {
|
72
97
|
reject(action.result);
|
73
|
-
} else if (action.response.pending
|
98
|
+
} else if (action.response.pending) {
|
74
99
|
setTimeout(() => dispatch(loadTask(taskId, extendedParams)).then(pollUntilDone), interval);
|
75
100
|
} else {
|
76
101
|
resolve(action.response);
|
@@ -78,5 +103,4 @@ export const pollTaskUntilDone = (taskId, extendedParams = {}, interval) => disp
|
|
78
103
|
};
|
79
104
|
|
80
105
|
return dispatch(loadTask(taskId, extendedParams)).then(pollUntilDone);
|
81
|
-
})
|
82
|
-
);
|
106
|
+
});
|
@@ -5,3 +5,4 @@ export const GET_TASK_FAILURE = 'GET_TASK_FAILURE';
|
|
5
5
|
export const TASK_BULK_SEARCH_REQUEST = 'TASK_BULK_SEARCH_REQUEST';
|
6
6
|
export const TASK_BULK_SEARCH_SUCCESS = 'TASK_BULK_SEARCH_SUCCESS';
|
7
7
|
export const TASK_BULK_SEARCH_FAILURE = 'TASK_BULK_SEARCH_FAILURE';
|
8
|
+
export const RESET_TASKS = 'RESET_TASKS';
|
@@ -17,7 +17,10 @@ import {
|
|
17
17
|
import { bulkSearch, loadTask, pollTaskUntilDone, pollBulkSearch } from '../TaskActions';
|
18
18
|
|
19
19
|
const mockStore = configureMockStore([thunk]);
|
20
|
-
const store = mockStore({
|
20
|
+
const store = mockStore({
|
21
|
+
tasks: Immutable({}),
|
22
|
+
katello: { organization: { id: 1, loading: false } },
|
23
|
+
});
|
21
24
|
const mockApi = new MockAdapter(axios);
|
22
25
|
|
23
26
|
beforeEach(() => {
|
@@ -44,17 +47,17 @@ afterEach(() => {
|
|
44
47
|
|
45
48
|
describe('task actions', () => {
|
46
49
|
describe('creates TASK_BULK_SEARCH_REQUEST', () => {
|
47
|
-
const url = '/foreman_tasks/api/tasks
|
50
|
+
const url = '/foreman_tasks/api/tasks';
|
48
51
|
|
49
52
|
it('and then fails with 422', () => {
|
50
|
-
mockApi.
|
53
|
+
mockApi.onGet(url).reply(422);
|
51
54
|
|
52
55
|
return store.dispatch(bulkSearch())
|
53
56
|
.then(() => expect(store.getActions()).toEqual(buildBulkSearchFailureActions()));
|
54
57
|
});
|
55
58
|
|
56
59
|
it('and ends with success', () => {
|
57
|
-
mockApi.
|
60
|
+
mockApi.onGet(url).reply(200, bulkSearchSuccessResponse);
|
58
61
|
|
59
62
|
return store.dispatch(bulkSearch())
|
60
63
|
.then(() => expect(store.getActions()).toEqual(bulkSearchSuccessActions));
|
@@ -88,7 +91,7 @@ describe('task actions', () => {
|
|
88
91
|
mockApi.onGet(url).replyOnce(200, getTaskSuccessResponse);
|
89
92
|
|
90
93
|
return store
|
91
|
-
.dispatch(pollTaskUntilDone(taskId, {}, 1))
|
94
|
+
.dispatch(pollTaskUntilDone(taskId, {}, 1, 1))
|
92
95
|
.then(() => {
|
93
96
|
expect(store.getActions()).toEqual(getTaskSuccessActions);
|
94
97
|
expect(setTimeoutSpy).toHaveBeenCalledTimes(0);
|
@@ -109,7 +112,7 @@ describe('task actions', () => {
|
|
109
112
|
.concat(getTaskSuccessActions);
|
110
113
|
|
111
114
|
return store
|
112
|
-
.dispatch(pollTaskUntilDone(taskId, {}, 1))
|
115
|
+
.dispatch(pollTaskUntilDone(taskId, {}, 1, 1))
|
113
116
|
.then(() => {
|
114
117
|
expect(store.getActions()).toEqual(expectedActions);
|
115
118
|
expect(setTimeoutSpy).toHaveBeenCalledTimes(2);
|
@@ -125,7 +128,7 @@ describe('task actions', () => {
|
|
125
128
|
.concat(buildTaskFailureActions(401));
|
126
129
|
|
127
130
|
return store
|
128
|
-
.dispatch(pollTaskUntilDone(taskId, {}, 1))
|
131
|
+
.dispatch(pollTaskUntilDone(taskId, {}, 1, 1))
|
129
132
|
.catch(() => {
|
130
133
|
expect(store.getActions()).toEqual(expectedActions);
|
131
134
|
expect(setTimeoutSpy).toHaveBeenCalledTimes(1);
|
@@ -134,15 +137,15 @@ describe('task actions', () => {
|
|
134
137
|
});
|
135
138
|
|
136
139
|
describe('pollBulkSearch', () => {
|
137
|
-
const url = '/foreman_tasks/api/tasks
|
140
|
+
const url = '/foreman_tasks/api/tasks';
|
138
141
|
|
139
142
|
it('polls', () => {
|
140
143
|
mockApi
|
141
|
-
.
|
144
|
+
.onGet(url)
|
142
145
|
.replyOnce(200, bulkSearchSuccessResponse);
|
143
146
|
|
144
147
|
return store
|
145
|
-
.dispatch(pollBulkSearch({}, 1))
|
148
|
+
.dispatch(pollBulkSearch({}, 1, 1))
|
146
149
|
.then(() => {
|
147
150
|
expect(store.getActions()).toEqual(bulkSearchSuccessActions);
|
148
151
|
expect(setTimeoutSpy).toHaveBeenCalledTimes(1);
|
@@ -151,10 +154,10 @@ describe('task actions', () => {
|
|
151
154
|
|
152
155
|
it('stops polling on unauthorized response', () => {
|
153
156
|
mockApi
|
154
|
-
.
|
157
|
+
.onGet(url).replyOnce(401);
|
155
158
|
|
156
159
|
return store
|
157
|
-
.dispatch(pollBulkSearch({}, 1))
|
160
|
+
.dispatch(pollBulkSearch({}, 1, 1))
|
158
161
|
.then(() => {
|
159
162
|
expect(store.getActions()).toEqual(buildBulkSearchFailureActions(401));
|
160
163
|
expect(setTimeoutSpy).toHaveBeenCalledTimes(0);
|