katello 3.6.0.1.rc2 → 3.7.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/app/assets/javascripts/katello/hosts/activation_key_edit.js +2 -2
- data/app/controllers/katello/api/rhsm/candlepin_proxies_controller.rb +6 -4
- data/app/controllers/katello/api/v2/activation_keys_controller.rb +1 -3
- data/app/controllers/katello/api/v2/api_controller.rb +13 -3
- data/app/controllers/katello/api/v2/content_credentials_controller.rb +116 -0
- data/app/controllers/katello/api/v2/content_view_filter_rules_controller.rb +1 -1
- data/app/controllers/katello/api/v2/content_view_versions_controller.rb +6 -0
- data/app/controllers/katello/api/v2/content_views_controller.rb +2 -1
- data/app/controllers/katello/api/v2/environments_controller.rb +20 -3
- data/app/controllers/katello/api/v2/gpg_keys_controller.rb +5 -0
- data/app/controllers/katello/api/v2/host_subscriptions_controller.rb +14 -7
- data/app/controllers/katello/api/v2/products_controller.rb +31 -1
- data/app/controllers/katello/api/v2/repositories_controller.rb +103 -34
- data/app/controllers/katello/api/v2/repository_sets_controller.rb +22 -15
- data/app/controllers/katello/api/v2/subscriptions_controller.rb +31 -7
- data/app/controllers/katello/api/v2/upstream_subscriptions_controller.rb +93 -0
- data/app/controllers/katello/concerns/api/v2/repository_content_controller.rb +2 -2
- data/app/helpers/katello/katello_urls_helper.rb +21 -4
- data/app/jobs/create_pulp_disk_space_notifications.rb +4 -0
- data/app/jobs/send_expire_soon_notifications.rb +13 -0
- data/app/lib/actions/candlepin/import_pool_handler.rb +5 -4
- data/app/lib/actions/candlepin/owner/import_products.rb +4 -2
- data/app/lib/actions/helpers/notifications.rb +35 -0
- data/app/lib/actions/katello/capsule_content/sync.rb +12 -1
- data/app/lib/actions/katello/content_view/{capsule_generate_and_sync.rb → capsule_sync.rb} +1 -1
- data/app/lib/actions/katello/content_view/promote_to_environment.rb +1 -1
- data/app/lib/actions/katello/content_view/publish.rb +40 -11
- data/app/lib/actions/katello/content_view/remove.rb +2 -2
- data/app/lib/actions/katello/environment/publish_repositories.rb +41 -0
- data/app/lib/actions/katello/event_queue/poller_thread.rb +10 -8
- data/app/lib/actions/katello/host/attach_subscriptions.rb +1 -1
- data/app/lib/actions/katello/host/remove_subscriptions.rb +1 -1
- data/app/lib/actions/katello/organization/manifest_delete.rb +22 -0
- data/app/lib/actions/katello/organization/manifest_import.rb +22 -0
- data/app/lib/actions/katello/organization/manifest_refresh.rb +22 -0
- data/app/lib/actions/katello/product/create.rb +3 -6
- data/app/lib/actions/katello/product/reindex_subscriptions.rb +3 -4
- data/app/lib/actions/katello/repository/{capsule_generate_and_sync.rb → capsule_sync.rb} +1 -1
- data/app/lib/actions/katello/repository/clone_yum_metadata.rb +2 -1
- data/app/lib/actions/katello/repository/create.rb +2 -1
- data/app/lib/actions/katello/repository/filtered_index_content.rb +2 -0
- data/app/lib/actions/katello/repository/import_upload.rb +38 -6
- data/app/lib/actions/katello/repository/remove_content.rb +1 -1
- data/app/lib/actions/katello/repository/sync.rb +8 -1
- data/app/lib/actions/katello/repository/sync_hook.rb +11 -0
- data/app/lib/actions/katello/repository/update.rb +4 -1
- data/app/lib/actions/katello/sync_plan/add_products.rb +1 -1
- data/app/lib/actions/katello/upstream_subscriptions/bind_entitlement.rb +31 -0
- data/app/lib/actions/katello/upstream_subscriptions/bind_entitlements.rb +28 -0
- data/app/lib/actions/katello/upstream_subscriptions/remove_entitlement.rb +22 -0
- data/app/lib/actions/katello/upstream_subscriptions/remove_entitlements.rb +35 -0
- data/app/lib/actions/katello/upstream_subscriptions/update_entitlement.rb +23 -0
- data/app/lib/actions/katello/upstream_subscriptions/update_entitlements.rb +37 -0
- data/app/lib/actions/middleware/execute_if_contents_changed.rb +1 -1
- data/app/lib/actions/pulp/repository/create.rb +3 -0
- data/app/lib/actions/pulp/repository/ensure_sync_notification.rb +11 -0
- data/app/lib/actions/pulp/repository/import_upload.rb +2 -2
- data/app/lib/katello/resources/candlepin.rb +68 -801
- data/app/lib/katello/resources/candlepin/activation_key.rb +101 -0
- data/app/lib/katello/resources/candlepin/c_p_user.rb +17 -0
- data/app/lib/katello/resources/candlepin/candlepin_ping.rb +19 -0
- data/app/lib/katello/resources/candlepin/consumer.rb +204 -0
- data/app/lib/katello/resources/candlepin/content.rb +36 -0
- data/app/lib/katello/resources/candlepin/entitlement.rb +22 -0
- data/app/lib/katello/resources/candlepin/environment.rb +44 -0
- data/app/lib/katello/resources/candlepin/job.rb +25 -0
- data/app/lib/katello/resources/candlepin/owner.rb +130 -0
- data/app/lib/katello/resources/candlepin/owner_info.rb +18 -0
- data/app/lib/katello/resources/candlepin/pool.rb +39 -0
- data/app/lib/katello/resources/candlepin/product.rb +116 -0
- data/app/lib/katello/resources/candlepin/proxy.rb +41 -0
- data/app/lib/katello/resources/candlepin/subscription.rb +31 -0
- data/app/lib/katello/resources/candlepin/upstream_consumer.rb +41 -0
- data/app/lib/katello/resources/candlepin/upstream_entitlement.rb +19 -0
- data/app/lib/katello/resources/candlepin/upstream_owner.rb +15 -0
- data/app/lib/katello/resources/candlepin/upstream_pool.rb +17 -0
- data/app/lib/katello/util/data.rb +2 -4
- data/app/lib/katello/util/http_proxy.rb +29 -0
- data/app/lib/katello/util/model.rb +1 -1
- data/app/lib/katello/validators/container_image_name_validator.rb +18 -0
- data/app/lib/katello/validators/content_view_environment_org_validator.rb +14 -0
- data/app/lib/katello/validators/environment_docker_repositories_validator.rb +71 -0
- data/app/lib/katello/validators/gpg_key_content_type_validator.rb +22 -0
- data/app/models/katello/activation_key.rb +4 -2
- data/app/models/katello/authorization/content_view_history.rb +0 -1
- data/app/models/katello/authorization/pool.rb +0 -2
- data/app/models/katello/authorization/repository.rb +0 -2
- data/app/models/katello/capsule_lifecycle_environment.rb +2 -0
- data/app/models/katello/compliance_reason.rb +5 -0
- data/app/models/katello/concerns/content_facet_host_extensions.rb +5 -1
- data/app/models/katello/concerns/organization_extensions.rb +22 -0
- data/app/models/katello/concerns/smart_proxy_extensions.rb +3 -2
- data/app/models/katello/concerns/subscription_facet_host_extensions.rb +2 -0
- data/app/models/katello/content.rb +5 -0
- data/app/models/katello/content_facet_applicable_rpm.rb +1 -0
- data/app/models/katello/content_view.rb +50 -82
- data/app/models/katello/content_view_component.rb +1 -0
- data/app/models/katello/content_view_docker_filter_rule.rb +0 -1
- data/app/models/katello/content_view_environment.rb +5 -3
- data/app/models/katello/content_view_filter.rb +2 -1
- data/app/models/katello/content_view_history.rb +3 -0
- data/app/models/katello/content_view_puppet_environment.rb +12 -0
- data/app/models/katello/content_view_puppet_module.rb +1 -0
- data/app/models/katello/content_view_version.rb +18 -1
- data/app/models/katello/docker_manifest.rb +2 -1
- data/app/models/katello/docker_manifest_list.rb +2 -1
- data/app/models/katello/docker_meta_tag.rb +22 -1
- data/app/models/katello/erratum.rb +17 -5
- data/app/models/katello/event.rb +2 -0
- data/app/models/katello/glue/candlepin/activation_key.rb +2 -2
- data/app/models/katello/glue/candlepin/candlepin_object.rb +7 -6
- data/app/models/katello/glue/candlepin/owner.rb +4 -3
- data/app/models/katello/glue/candlepin/pool.rb +51 -20
- data/app/models/katello/glue/candlepin/product.rb +3 -2
- data/app/models/katello/glue/candlepin/subscription.rb +16 -35
- data/app/models/katello/glue/pulp/repo.rb +26 -6
- data/app/models/katello/glue/pulp/repos.rb +6 -3
- data/app/models/katello/gpg_key.rb +29 -4
- data/app/models/katello/host/content_facet.rb +5 -3
- data/app/models/katello/host/subscription_facet.rb +55 -23
- data/app/models/katello/host_collection.rb +1 -0
- data/app/models/katello/host_collection_hosts.rb +1 -1
- data/app/models/katello/installed_package.rb +4 -0
- data/app/models/katello/installed_product.rb +33 -0
- data/app/models/katello/key_host_collection.rb +2 -2
- data/app/models/katello/kt_environment.rb +8 -0
- data/app/models/katello/ostree_branch.rb +1 -1
- data/app/models/katello/ping.rb +1 -0
- data/app/models/katello/pool.rb +13 -7
- data/app/models/katello/pool_product.rb +6 -0
- data/app/models/katello/product.rb +16 -6
- data/app/models/katello/product_content.rb +4 -0
- data/app/models/katello/pulp_task_status.rb +0 -46
- data/app/models/katello/repository.rb +96 -19
- data/app/models/katello/repository_docker_manifest.rb +1 -1
- data/app/models/katello/repository_docker_manifest_list.rb +1 -1
- data/app/models/katello/repository_ostree_branch.rb +1 -1
- data/app/models/katello/rhsm_fact_importer.rb +2 -17
- data/app/models/katello/subscription.rb +5 -5
- data/app/models/katello/subscription_facet_installed_product.rb +6 -0
- data/app/models/katello/subscription_facet_pool.rb +2 -0
- data/app/models/katello/sync_plan.rb +1 -0
- data/app/models/katello/upstream_pool.rb +112 -0
- data/app/models/setting/content.rb +11 -7
- data/app/services/katello/candlepin/consumer.rb +9 -2
- data/app/services/katello/candlepin/message_handler.rb +18 -35
- data/app/services/katello/candlepin/pool_service.rb +17 -0
- data/app/services/katello/event_queue.rb +11 -6
- data/app/services/katello/pulp/server.rb +3 -1
- data/app/services/katello/registration_manager.rb +9 -2
- data/app/services/katello/repository_type_manager.rb +2 -1
- data/app/services/katello/ui_notifications/abstract_notification.rb +29 -0
- data/app/services/katello/ui_notifications/content_view/auto_publish_failure.rb +22 -0
- data/app/services/katello/ui_notifications/pulp/proxy_disk_space.rb +3 -4
- data/app/services/katello/ui_notifications/subscriptions/expire_soon.rb +65 -0
- data/app/services/katello/ui_notifications/subscriptions/manifest_delete_error.rb +13 -0
- data/app/services/katello/ui_notifications/subscriptions/manifest_delete_success.rb +13 -0
- data/app/services/katello/ui_notifications/subscriptions/manifest_import_error.rb +13 -0
- data/app/services/katello/ui_notifications/subscriptions/manifest_import_success.rb +13 -0
- data/app/services/katello/ui_notifications/subscriptions/manifest_refresh_error.rb +13 -0
- data/app/services/katello/ui_notifications/subscriptions/manifest_refresh_success.rb +13 -0
- data/app/services/katello/ui_notifications/task_notification.rb +26 -0
- data/app/views/foreman/job_templates/install_errata.erb +7 -2
- data/app/views/foreman/job_templates/install_errata_-_katello_ansible_default.erb +18 -0
- data/app/views/foreman/job_templates/install_group_-_katello_ansible_default.erb +16 -0
- data/app/views/foreman/job_templates/install_package_-_katello_ansible_default.erb +16 -0
- data/app/views/foreman/job_templates/remove_group_-_katello_ansible_default.erb +16 -0
- data/app/views/foreman/job_templates/remove_package_-_katello_ansible_default.erb +16 -0
- data/app/views/foreman/job_templates/restart_services_-_katello_ansible_default.erb +20 -0
- data/app/views/foreman/job_templates/update_group_-_katello_ansible_default.erb +16 -0
- data/app/views/foreman/job_templates/update_package_-_katello_ansible_default.erb +16 -0
- data/app/views/foreman/smart_proxies/_content_tab.html.erb +1 -1
- data/app/views/katello/api/v2/content_credentials/index.json.rabl +3 -0
- data/app/views/katello/api/v2/content_credentials/show.json.rabl +101 -0
- data/app/views/katello/api/v2/content_view_histories/show.json.rabl +13 -1
- data/app/views/katello/api/v2/content_views/base.json.rabl +1 -0
- data/app/views/katello/api/v2/environments/show.json.rabl +1 -0
- data/app/views/katello/api/v2/errata/{available_errata.rabl → available_errata.json.rabl} +0 -0
- data/app/views/katello/api/v2/errata/show.json.rabl +4 -0
- data/app/views/katello/api/v2/products/_product_content.json.rabl +6 -6
- data/app/views/katello/api/v2/products/base.json.rabl +3 -0
- data/app/views/katello/api/v2/products/show.json.rabl +12 -0
- data/app/views/katello/api/v2/repositories/base.json.rabl +2 -1
- data/app/views/katello/api/v2/repositories/show.json.rabl +19 -5
- data/app/views/katello/api/v2/subscription_facet/show.json.rabl +10 -14
- data/app/views/katello/api/v2/subscriptions/base.json.rabl +2 -1
- data/app/views/katello/api/v2/upstream_subscriptions/base.json.rabl +18 -0
- data/app/views/katello/api/v2/upstream_subscriptions/index.json.rabl +7 -0
- data/app/views/katello/sync_management/_products.html.erb +1 -1
- data/config/katello.yaml.example +10 -0
- data/config/routes.rb +3 -14
- data/config/routes/api/rhsm.rb +1 -0
- data/config/routes/api/v2.rb +16 -0
- data/db/migrate/20161014133811_move_content_view_version_description_to_histories.rb +2 -1
- data/db/migrate/20161214151548_move_content_source_id_to_content_facets.rb +2 -2
- data/db/migrate/20171110082124_add_ssl_certs_to_products_and_repos.rb +42 -0
- data/db/migrate/20171214050230_add_auto_publish_to_content_views.rb +5 -0
- data/db/migrate/20180117202932_sub_facet_add_installed_products.rb +20 -0
- data/db/migrate/20180119152210_add_compliance_reasons.rb +11 -0
- data/db/migrate/20180207232901_add_triggered_by_to_content_view_history.rb +7 -0
- data/db/migrate/20180218191449_add_manifest_refreshed_at_to_organization.rb +9 -0
- data/db/migrate/20180227094827_use_uuid_for_task_id.rb +26 -0
- data/db/migrate/20180323175122_add_registry_name_pattern_to_environment.rb +11 -0
- data/db/migrate/20180326145716_subscription_cp_id_change.rb +10 -0
- data/db/migrate/20180326150339_move_stacking_id.rb +25 -0
- data/db/migrate/20180326190408_move_subscription_products.rb +75 -0
- data/db/migrate/20180402160223_clean_up_force_post_sync_action_setting.rb +5 -0
- data/db/migrate/20180410140909_add_organization_id_to_pool.rb +15 -0
- data/db/migrate/20180413153126_content_facet_applicable_rpms_index.rb +5 -0
- data/db/migrate/20180417031215_add_ignorable_content_to_repository.rb +5 -0
- data/db/migrate/20180521200848_drop_repo_rpms_timestamp_not_null.rb +18 -0
- data/db/seeds.d/109-katello-notification-blueprints.rb +42 -0
- data/db/seeds.d/110-content-view-autopublish.rb +15 -0
- data/db/seeds.d/75-job_templates.rb +3 -1
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/activation-keys/details/activation-key-add-subscriptions.controller.js +1 -1
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/activation-keys/details/activation-key-details-info.controller.js +34 -3
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/activation-keys/details/activation-key-subscriptions.controller.js +1 -0
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/activation-keys/details/views/activation-key-info.html +3 -1
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/bastion-katello-bootstrap.js +1 -1
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/bastion_katello.js +2 -2
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/common/views/subscription-add-or-remove.html +2 -2
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-credentials/content-credential.factory.js +83 -0
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/{gpg-keys/gpg-keys.controller.js → content-credentials/content-credentials.controller.js} +8 -8
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/{gpg-keys/gpg-keys.module.js → content-credentials/content-credentials.module.js} +3 -3
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-credentials/content-credentials.routes.js +76 -0
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-credentials/content-type.filter.js +25 -0
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/{gpg-keys/details/gpg-key-details-info.controller.js → content-credentials/details/content-credential-details-info.controller.js} +10 -10
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-credentials/details/content-credential-details.controller.js +48 -0
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-credentials/details/content-credential-products.controller.js +36 -0
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-credentials/details/content-credential-repositories.controller.js +36 -0
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-credentials/details/views/content-credential-details.html +36 -0
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/{gpg-keys/details/views/gpg-key-info.html → content-credentials/details/views/content-credential-info.html} +21 -12
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/{gpg-keys/details/views/gpg-key-products.html → content-credentials/details/views/content-credential-products.html} +6 -2
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/{gpg-keys/details/views/gpg-key-repositories.html → content-credentials/details/views/content-credential-repositories.html} +6 -4
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-credentials/new/new-content-credential.controller.js +39 -0
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-credentials/new/views/new-content-credential.html +53 -0
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-credentials/views/content-credentials.html +55 -0
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-hosts/bulk/content-hosts-bulk-errata-modal.controller.js +31 -19
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-hosts/bulk/content-hosts-bulk-host-collections-modal.controller.js +0 -1
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-hosts/bulk/content-hosts-bulk-packages-modal.controller.js +4 -1
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-hosts/bulk/views/content-hosts-bulk-environment-modal.html +2 -2
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-hosts/bulk/views/content-hosts-bulk-errata-modal.html +108 -1
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-hosts/bulk/views/content-hosts-bulk-host-collections-modal.html +2 -2
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-hosts/bulk/views/content-hosts-bulk-packages-modal.html +2 -2
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-hosts/bulk/views/content-hosts-bulk-subscriptions-modal.html +1 -1
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-hosts/content/content-host-errata.controller.js +3 -3
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-hosts/content/views/content-host-errata.html +9 -9
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-hosts/content/views/content-host-packages-applicable.html +1 -1
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-hosts/content/views/content-host-packages-installed.html +1 -1
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-hosts/details/content-host-add-subscriptions.controller.js +1 -2
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-hosts/details/content-host-subscriptions.controller.js +1 -1
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-hosts/details/views/content-host-details.html +1 -1
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-hosts/details/views/content-host-info.html +4 -4
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-hosts/details/views/content-host-repository-sets.html +1 -1
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-hosts/views/content-hosts.html +1 -1
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-hosts/views/register.html +14 -4
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-views/details/components/content-view-composite-available-content-views.controller.js +7 -4
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-views/details/content-view-available-deb-repositories.controller.js +4 -2
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-views/details/content-view-available-docker-repositories.controller.js +5 -3
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-views/details/content-view-available-file-repositories.controller.js +4 -2
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-views/details/content-view-available-ostree-repositories.controller.js +5 -3
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-views/details/content-view-available-repositories.controller.js +4 -2
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-views/details/content-view-deb-repositories-list.controller.js +4 -2
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-views/details/content-view-details.controller.js +4 -2
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-views/details/content-view-docker-repositories-list.controller.js +4 -2
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-views/details/content-view-file-repositories-list.controller.js +4 -2
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-views/details/content-view-ostree-repositories-list.controller.js +4 -2
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-views/details/content-view-repositories-list.controller.js +4 -2
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-views/details/content-view-versions.controller.js +5 -3
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-views/details/filters/date-type-errata-filter.controller.js +8 -9
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-views/details/filters/filter-helper.service.js +1 -1
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-views/details/filters/new-filter.controller.js +1 -1
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-views/details/filters/views/date-type-errata.html +6 -2
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-views/details/filters/views/docker-filter.html +1 -1
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-views/details/filters/views/new-filter.html +1 -1
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-views/details/histories/content-view-history.controller.js +2 -2
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-views/details/puppet-modules/content-view-puppet-modules.controller.js +5 -1
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-views/details/views/content-view-details.html +8 -7
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-views/details/views/content-view-docker-repositories.html +3 -3
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-views/details/views/content-view-info.html +14 -0
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-views/details/views/content-view-versions.html +12 -4
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-views/new/views/content-view-new.html +16 -0
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-views/versions/content-view-version-content.controller.js +2 -1
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-views/versions/views/content-view-version-errata.html +2 -2
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-views/versions/views/content-view-version.html +2 -2
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/docker-tags/details/views/docker-tag-details.html +1 -1
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/docker-tags/details/views/docker-tag-environments.html +1 -1
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/docker-tags/details/views/docker-tag-info.html +1 -1
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/docker-tags/docker-tags.routes.js +2 -2
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/docker-tags/views/docker-tags.html +4 -4
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/environments/content.service.js +1 -1
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/environments/details/environment.controller.js +3 -2
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/environments/details/views/environment-details.html +8 -0
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/environments/details/views/environment-docker.html +9 -5
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/environments/details/views/environment-errata.html +2 -2
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/environments/details/views/environment.html +2 -1
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/environments/views/environments.html +18 -6
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/errata/details/erratum-content-hosts.controller.js +22 -8
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/errata/details/erratum-repositories.controller.js +18 -2
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/errata/details/views/erratum-content-hosts.html +3 -3
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/errata/details/views/erratum-repositories.html +1 -1
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/errata/incremental-update.service.js +3 -2
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/errata/views/apply-errata-confirm.html +17 -6
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/errata/views/errata.html +2 -2
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/i18n/README +4 -0
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/i18n/bastion_katello.pot +3465 -1541
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/i18n/translations.js +10 -10
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/katello-features.run.js +5 -5
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/organizations/fenced-pages.service.js +1 -1
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/ostree-branches/details/ostree-branch-repositories.controller.js +18 -2
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/ostree-branches/details/views/ostree-branch-repositories.html +1 -1
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/packages/details/package-repositories.controller.js +18 -2
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/packages/details/views/package-info.html +2 -2
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/packages/details/views/package-repositories.html +1 -1
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/packages/details/views/package.html +2 -2
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/packages/packages.routes.js +1 -1
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/packages/views/packages.html +1 -1
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/products/details/product-details-info.controller.js +32 -5
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/products/details/repositories/details/repository-details-info.controller.js +34 -13
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/products/details/repositories/details/repository-details-info.filter.js +16 -0
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/products/details/repositories/details/repository-details-manage-content.controller.js +15 -2
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/products/details/repositories/details/views/repository-info.html +42 -4
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/products/details/repositories/details/views/repository-manage-debs.html +2 -2
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/products/details/repositories/details/views/repository-manage-docker-manifest-lists.html +2 -2
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/products/details/repositories/details/views/repository-manage-docker-manifests.html +7 -7
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/products/details/repositories/details/views/repository-manage-docker-tags.html +47 -0
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/products/details/repositories/details/views/repository-manage-files.html +1 -1
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/products/details/repositories/details/views/repository-manage-packages.html +1 -1
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/products/details/repositories/new/new-repository.controller.js +10 -8
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/products/details/repositories/new/views/new-repository.html +43 -5
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/products/details/repositories/repositories.routes.js +11 -2
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/products/details/repositories/repository-types.service.js +39 -0
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/products/details/repositories/views/product-repositories.html +6 -6
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/products/details/repositories/yum-content-units.service.js +24 -0
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/products/details/views/product-info.html +24 -0
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/products/discovery/discovery-create.controller.js +7 -7
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/products/discovery/discovery.controller.js +1 -1
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/products/discovery/views/discovery-create.html +3 -3
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/products/new/product-form.controller.js +7 -7
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/products/new/views/product-new-form.html +29 -2
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/products/products.controller.js +9 -3
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/products/products.module.js +1 -1
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/products/views/products.html +2 -1
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/subscriptions/details/subscription-details.controller.js +1 -1
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/subscriptions/manifest/manifest-import.controller.js +12 -3
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/subscriptions/manifest/views/manifest-delete-modal.html +1 -1
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/subscriptions/manifest/views/manifest-import.html +2 -2
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/tasks/task.factory.js +4 -7
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/tasks/tasks-nutupane.factory.js +6 -1
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/tasks/tasks-table.directive.js +6 -3
- data/engines/bastion_katello/lib/bastion_katello/engine.rb +1 -1
- data/lib/katello/apipie/validators.rb +0 -56
- data/lib/katello/engine.rb +6 -43
- data/lib/katello/permission_creator.rb +31 -4
- data/lib/katello/plugin.rb +124 -73
- data/lib/katello/scheduled_jobs.rb +10 -4
- data/lib/katello/tasks/job_templates.rake +16 -0
- data/lib/katello/tasks/reset.rake +0 -3
- data/lib/katello/tasks/upgrades/3.6/import_backend_consumer_attributes.rake +32 -0
- data/lib/katello/tasks/upgrades/3.7/make_all_ks_repos_bootable.rake +11 -0
- data/lib/katello/version.rb +1 -1
- data/locale/action_names.rb +52 -48
- data/locale/katello.pot +3136 -1999
- data/package.json +83 -0
- data/webpack/__mocks__/foremanReact/common/helpers.js +5 -0
- data/webpack/__mocks__/foremanReact/components/common/table.js +6 -0
- data/webpack/__mocks__/react-bootstrap-tooltip-button.js +6 -0
- data/webpack/components/MultiSelect/index.js +35 -0
- data/webpack/components/PaginationRow/PaginationRow.test.js +25 -0
- data/webpack/components/PaginationRow/__snapshots__/PaginationRow.test.js.snap +35 -0
- data/webpack/components/PaginationRow/index.js +90 -0
- data/webpack/components/Search/Search.test.js +20 -0
- data/webpack/components/Search/__snapshots__/Search.test.js.snap +18 -0
- data/webpack/components/Search/helpers.js +6 -0
- data/webpack/components/Search/index.js +86 -0
- data/webpack/containers/Application/Routes.js +11 -0
- data/webpack/containers/Application/config.js +21 -0
- data/webpack/containers/Application/index.js +39 -0
- data/webpack/containers/Application/overrides.scss +38 -0
- data/webpack/index.js +18 -0
- data/webpack/mockRequest.js +32 -0
- data/webpack/move_to_foreman/Settings/SettingsActions.js +28 -0
- data/webpack/move_to_foreman/Settings/SettingsConstants.js +3 -0
- data/webpack/move_to_foreman/Settings/__tests__/SettingsActions.test.js +41 -0
- data/webpack/move_to_foreman/Settings/__tests__/settings.fixtures.js +34 -0
- data/webpack/move_to_foreman/__mocks__/foreman_toast_notifications.js +3 -0
- data/webpack/move_to_foreman/common/helpers.js +36 -0
- data/webpack/move_to_foreman/components/common/ConfirmDialog/ConfirmDialog.js +50 -0
- data/webpack/move_to_foreman/components/common/ConfirmDialog/__tests__/ConfirmDialog.test.js +40 -0
- data/webpack/move_to_foreman/components/common/ConfirmDialog/__tests__/__snapshots__/ConfirmDialog.test.js.snap +125 -0
- data/webpack/move_to_foreman/components/common/ConfirmDialog/index.js +3 -0
- data/webpack/move_to_foreman/components/common/Dialog/Dialog.js +65 -0
- data/webpack/move_to_foreman/components/common/Dialog/__tests__/Dialog.test.js +61 -0
- data/webpack/move_to_foreman/components/common/Dialog/__tests__/__snapshots__/Dialog.test.js.snap +349 -0
- data/webpack/move_to_foreman/components/common/Dialog/index.js +3 -0
- data/webpack/move_to_foreman/components/common/ModalProgressBar/ModalProgressBar.js +43 -0
- data/webpack/move_to_foreman/components/common/ModalProgressBar/ModalProgressBar.scss +15 -0
- data/webpack/move_to_foreman/components/common/ModalProgressBar/__tests__/ModalProgressBar.test.js +22 -0
- data/webpack/move_to_foreman/components/common/ModalProgressBar/__tests__/__snapshots__/ModalProgressBar.test.js.snap +60 -0
- data/webpack/move_to_foreman/components/common/ModalProgressBar/index.js +4 -0
- data/webpack/move_to_foreman/components/common/emptyState/index.js +49 -0
- data/webpack/move_to_foreman/components/common/table/index.js +88 -0
- data/webpack/move_to_foreman/foreman_toast_notifications.js +22 -0
- data/webpack/move_to_pf/TypeAhead/TypeAhead.js +125 -0
- data/webpack/move_to_pf/TypeAhead/TypeAhead.scss +7 -0
- data/webpack/move_to_pf/TypeAhead/TypeAheadInput.js +47 -0
- data/webpack/move_to_pf/TypeAhead/TypeAheadItems.js +60 -0
- data/webpack/move_to_pf/TypeAhead/helpers.js +5 -0
- data/webpack/move_to_pf/react-bootstrap-select/index.js +65 -0
- data/webpack/redux/actions/RedHatRepositories/enabled.js +53 -0
- data/webpack/redux/actions/RedHatRepositories/helpers.js +38 -0
- data/webpack/redux/actions/RedHatRepositories/repositorySetRepositories.js +50 -0
- data/webpack/redux/actions/RedHatRepositories/sets.js +42 -0
- data/webpack/redux/consts.js +18 -0
- data/webpack/redux/index.js +9 -0
- data/webpack/redux/reducers/RedHatRepositories/enabled.fixtures.js +149 -0
- data/webpack/redux/reducers/RedHatRepositories/enabled.js +80 -0
- data/webpack/redux/reducers/RedHatRepositories/enabled.test.js +36 -0
- data/webpack/redux/reducers/RedHatRepositories/filters.fixtures.js +5 -0
- data/webpack/redux/reducers/RedHatRepositories/index.js +10 -0
- data/webpack/redux/reducers/RedHatRepositories/repositorySetRepositories.fixtures.js +135 -0
- data/webpack/redux/reducers/RedHatRepositories/repositorySetRepositories.js +97 -0
- data/webpack/redux/reducers/RedHatRepositories/repositorySetRepositories.test.js +66 -0
- data/webpack/redux/reducers/RedHatRepositories/sets.fixtures.js +123 -0
- data/webpack/redux/reducers/RedHatRepositories/sets.js +41 -0
- data/webpack/redux/reducers/RedHatRepositories/sets.test.js +36 -0
- data/webpack/redux/reducers/index.js +14 -0
- data/webpack/scenes/Organizations/OrganizationActions.js +60 -0
- data/webpack/scenes/Organizations/OrganizationConstants.js +7 -0
- data/webpack/scenes/Organizations/OrganizationReducer.js +32 -0
- data/webpack/scenes/Organizations/__tests__/OrganizationActions.test.js +59 -0
- data/webpack/scenes/Organizations/__tests__/OrganizationReducer.test.js +56 -0
- data/webpack/scenes/Organizations/__tests__/organizations.fixtures.js +99 -0
- data/webpack/scenes/RedHatRepositories/components/EnabledRepository.js +114 -0
- data/webpack/scenes/RedHatRepositories/components/EnabledRepository.stories.js +13 -0
- data/webpack/scenes/RedHatRepositories/components/RepositorySet.js +35 -0
- data/webpack/scenes/RedHatRepositories/components/RepositorySetRepositories.js +64 -0
- data/webpack/scenes/RedHatRepositories/components/RepositorySetRepository.js +127 -0
- data/webpack/scenes/RedHatRepositories/components/RepositoryTypeIcon.js +33 -0
- data/webpack/scenes/RedHatRepositories/components/Search.js +91 -0
- data/webpack/scenes/RedHatRepositories/components/SearchBar.js +145 -0
- data/webpack/scenes/RedHatRepositories/components/__tests__/RepositoryTypeIcon.test.js +28 -0
- data/webpack/scenes/RedHatRepositories/components/__tests__/__snapshots__/RepositoryTypeIcon.test.js.snap +143 -0
- data/webpack/scenes/RedHatRepositories/helpers.js +72 -0
- data/webpack/scenes/RedHatRepositories/index.js +91 -0
- data/webpack/scenes/RedHatRepositories/index.scss +63 -0
- data/webpack/scenes/Subscriptions/EntitlementsInlineEditFormatter.js +87 -0
- data/webpack/scenes/Subscriptions/Manifest/DeleteManifestModalText.js +22 -0
- data/webpack/scenes/Subscriptions/Manifest/ManageManifestModal.js +243 -0
- data/webpack/scenes/Subscriptions/Manifest/Manifest.scss +3 -0
- data/webpack/scenes/Subscriptions/Manifest/ManifestActions.js +114 -0
- data/webpack/scenes/Subscriptions/Manifest/ManifestConstants.js +15 -0
- data/webpack/scenes/Subscriptions/Manifest/ManifestHistoryReducer.js +34 -0
- data/webpack/scenes/Subscriptions/Manifest/ManifestHistoryTableSchema.js +46 -0
- data/webpack/scenes/Subscriptions/Manifest/__tests__/ManageManifestModal.test.js +26 -0
- data/webpack/scenes/Subscriptions/Manifest/__tests__/ManifestActions.test.js +113 -0
- data/webpack/scenes/Subscriptions/Manifest/__tests__/ManifestHistoryReducer.test.js +36 -0
- data/webpack/scenes/Subscriptions/Manifest/__tests__/__snapshots__/ManageManifestModal.test.js.snap +363 -0
- data/webpack/scenes/Subscriptions/Manifest/__tests__/manifest.fixtures.js +216 -0
- data/webpack/scenes/Subscriptions/Manifest/index.js +28 -0
- data/webpack/scenes/Subscriptions/SubscriptionActions.js +119 -0
- data/webpack/scenes/Subscriptions/SubscriptionConstants.js +27 -0
- data/webpack/scenes/Subscriptions/SubscriptionHelpers.js +3 -0
- data/webpack/scenes/Subscriptions/SubscriptionReducer.js +123 -0
- data/webpack/scenes/Subscriptions/SubscriptionValidations.js +25 -0
- data/webpack/scenes/Subscriptions/Subscriptions.scss +14 -0
- data/webpack/scenes/Subscriptions/SubscriptionsPage.js +275 -0
- data/webpack/scenes/Subscriptions/SubscriptionsTable.js +336 -0
- data/webpack/scenes/Subscriptions/SubscriptionsTableSchema.js +117 -0
- data/webpack/scenes/Subscriptions/UpstreamSubscriptions/UpstreamSubscriptionsActions.js +61 -0
- data/webpack/scenes/Subscriptions/UpstreamSubscriptions/UpstreamSubscriptionsContstants.js +7 -0
- data/webpack/scenes/Subscriptions/UpstreamSubscriptions/UpstreamSubscriptionsPage.js +246 -0
- data/webpack/scenes/Subscriptions/UpstreamSubscriptions/UpstreamSubscriptionsReducer.js +59 -0
- data/webpack/scenes/Subscriptions/UpstreamSubscriptions/UpstreamSubscriptionsTableSchema.js +120 -0
- data/webpack/scenes/Subscriptions/UpstreamSubscriptions/__tests__/UpstreamSubscriptionsActions.test.js +64 -0
- data/webpack/scenes/Subscriptions/UpstreamSubscriptions/__tests__/UpstreamSubscriptionsPage.test.js +22 -0
- data/webpack/scenes/Subscriptions/UpstreamSubscriptions/__tests__/UpstreamSubscriptionsReducer.test.js +57 -0
- data/webpack/scenes/Subscriptions/UpstreamSubscriptions/__tests__/__snapshots__/UpstreamSubscriptionsPage.test.js.snap +226 -0
- data/webpack/scenes/Subscriptions/UpstreamSubscriptions/__tests__/upstreamSubscriptions.fixtures.js +162 -0
- data/webpack/scenes/Subscriptions/UpstreamSubscriptions/index.js +20 -0
- data/webpack/scenes/Subscriptions/__tests__/SubscriptionValidations.test.js +66 -0
- data/webpack/scenes/Subscriptions/__tests__/SubscriptionsActions.test.js +126 -0
- data/webpack/scenes/Subscriptions/__tests__/SubscriptionsPage.test.js +26 -0
- data/webpack/scenes/Subscriptions/__tests__/SubscriptionsReducer.test.js +67 -0
- data/webpack/scenes/Subscriptions/__tests__/SubscriptionsTable.test.js +47 -0
- data/webpack/scenes/Subscriptions/__tests__/__snapshots__/SubscriptionsPage.test.js.snap +198 -0
- data/webpack/scenes/Subscriptions/__tests__/__snapshots__/SubscriptionsTable.test.js.snap +419 -0
- data/webpack/scenes/Subscriptions/__tests__/subscriptions.fixtures.js +364 -0
- data/webpack/scenes/Subscriptions/index.js +27 -0
- data/webpack/scenes/Tasks/TaskActions.js +75 -0
- data/webpack/scenes/Tasks/TaskConstants.js +7 -0
- data/webpack/scenes/Tasks/__tests__/TaskActions.test.js +81 -0
- data/webpack/scenes/Tasks/__tests__/task.fixtures.js +123 -0
- data/webpack/services/api/fixtures.js +353 -0
- data/webpack/services/api/index.js +105 -0
- data/webpack/services/api/setupMocks.js +17 -0
- data/webpack/services/index.js +59 -0
- data/webpack/stories/index.js +12 -0
- data/webpack/test_setup.js +9 -0
- metadata +265 -61
- data/app/assets/javascripts/katello/providers/provider_redhat.js +0 -185
- data/app/assets/javascripts/katello/providers/redhat/index.js +0 -3
- data/app/controllers/katello/products_controller.rb +0 -106
- data/app/controllers/katello/providers_controller.rb +0 -64
- data/app/helpers/katello/providers_helper.rb +0 -93
- data/app/models/katello/subscription_product.rb +0 -6
- data/app/views/foreman/unattended/finish-katello.erb +0 -60
- data/app/views/foreman/unattended/kickstart-katello-atomic.erb +0 -51
- data/app/views/foreman/unattended/kickstart-katello.erb +0 -139
- data/app/views/foreman/unattended/snippets/_subscription_manager_registration.erb +0 -18
- data/app/views/foreman/unattended/userdata-katello.erb +0 -92
- data/app/views/katello/providers/redhat/_enable_errors.html.erb +0 -12
- data/app/views/katello/providers/redhat/_errors.html.erb +0 -19
- data/app/views/katello/providers/redhat/_repo_sets.html.erb +0 -56
- data/app/views/katello/providers/redhat/_repos.html.erb +0 -60
- data/app/views/katello/providers/redhat/_tab.html.erb +0 -9
- data/app/views/katello/providers/redhat/show.html.erb +0 -35
- data/db/seeds.d/103-provisioning_templates.rb +0 -42
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-hosts/bulk/views/errata-content-hosts.html +0 -28
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-hosts/bulk/views/errata-details.html +0 -59
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/gpg-keys/details/gpg-key-details.controller.js +0 -48
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/gpg-keys/details/gpg-key-products.controller.js +0 -36
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/gpg-keys/details/gpg-key-repositories.controller.js +0 -36
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/gpg-keys/details/views/gpg-key-details.html +0 -36
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/gpg-keys/gpg-key.factory.js +0 -43
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/gpg-keys/gpg-keys.routes.js +0 -76
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/gpg-keys/new/new-gpg-key.controller.js +0 -39
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/gpg-keys/new/views/new-gpg-key.html +0 -44
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/gpg-keys/views/gpg-keys.html +0 -46
@@ -0,0 +1,25 @@
|
|
1
|
+
import { filterRHSubscriptions } from './SubscriptionHelpers.js';
|
2
|
+
|
3
|
+
export const validateQuantity = (quantity, availableQuantity) => {
|
4
|
+
let state;
|
5
|
+
let message;
|
6
|
+
|
7
|
+
const numberValue = Number(quantity);
|
8
|
+
if (Number.isNaN(numberValue)) {
|
9
|
+
state = 'error';
|
10
|
+
message = __('Not a number');
|
11
|
+
} else if (numberValue < 0) {
|
12
|
+
state = 'error';
|
13
|
+
message = __('Has to be > 0');
|
14
|
+
} else if (availableQuantity && availableQuantity >= 0 && numberValue > availableQuantity) {
|
15
|
+
state = 'error';
|
16
|
+
message = __('Exceeds available quantity');
|
17
|
+
}
|
18
|
+
return {
|
19
|
+
state,
|
20
|
+
message,
|
21
|
+
};
|
22
|
+
};
|
23
|
+
|
24
|
+
export const recordsValid = rows =>
|
25
|
+
filterRHSubscriptions(rows).every(row => validateQuantity(row.quantity, row.availableQuantity).state !== 'error');
|
@@ -0,0 +1,275 @@
|
|
1
|
+
import React, { Component } from 'react';
|
2
|
+
import ReactDOMServer from 'react-dom/server';
|
3
|
+
import PropTypes from 'prop-types';
|
4
|
+
import { LinkContainer } from 'react-router-bootstrap';
|
5
|
+
import { Grid, Row, Col, Form, FormGroup } from 'react-bootstrap';
|
6
|
+
import { Button } from 'patternfly-react';
|
7
|
+
import TooltipButton from 'react-bootstrap-tooltip-button';
|
8
|
+
import { notify } from '../../move_to_foreman/foreman_toast_notifications';
|
9
|
+
import helpers from '../../move_to_foreman/common/helpers';
|
10
|
+
import ModalProgressBar from '../../move_to_foreman/components/common/ModalProgressBar';
|
11
|
+
import ManageManifestModal from './Manifest/';
|
12
|
+
import SubscriptionsTable from './SubscriptionsTable';
|
13
|
+
import Search from '../../components/Search/index';
|
14
|
+
import api, { orgId } from '../../services/api';
|
15
|
+
import { createSubscriptionParams } from './SubscriptionActions.js';
|
16
|
+
import {
|
17
|
+
BLOCKING_FOREMAN_TASK_TYPES,
|
18
|
+
MANIFEST_TASKS_BULK_SEARCH_ID,
|
19
|
+
BULK_TASK_SEARCH_INTERVAL,
|
20
|
+
} from './SubscriptionConstants';
|
21
|
+
|
22
|
+
|
23
|
+
class SubscriptionsPage extends Component {
|
24
|
+
constructor(props) {
|
25
|
+
super(props);
|
26
|
+
this.state = {
|
27
|
+
manifestModalOpen: false,
|
28
|
+
subscriptionDeleteModalOpen: false,
|
29
|
+
disableDeleteButton: true,
|
30
|
+
polledTask: null,
|
31
|
+
showTaskModal: false,
|
32
|
+
searchQuery: '',
|
33
|
+
};
|
34
|
+
}
|
35
|
+
|
36
|
+
componentDidMount() {
|
37
|
+
this.loadData();
|
38
|
+
}
|
39
|
+
|
40
|
+
getDisabledReason(deleteButton) {
|
41
|
+
const { tasks, subscriptions } = this.props;
|
42
|
+
const { disconnected } = subscriptions;
|
43
|
+
let disabledReason = null;
|
44
|
+
|
45
|
+
if (disconnected) {
|
46
|
+
disabledReason = __('This is disabled because disconnected mode is enabled.');
|
47
|
+
} else if (tasks.length > 0) {
|
48
|
+
disabledReason = __('This is disabled because a manifest related task is in progress.');
|
49
|
+
} else if (deleteButton && !disabledReason) {
|
50
|
+
disabledReason = __('This is disabled because no subscriptions are selected');
|
51
|
+
}
|
52
|
+
|
53
|
+
return disabledReason;
|
54
|
+
}
|
55
|
+
|
56
|
+
showTaskModal(show) {
|
57
|
+
if (this.state.showTaskModal !== show) {
|
58
|
+
this.setState({ showTaskModal: show });
|
59
|
+
|
60
|
+
if (show && this.state.manifestModalOpen) {
|
61
|
+
this.setState({ manifestModalOpen: false });
|
62
|
+
}
|
63
|
+
}
|
64
|
+
}
|
65
|
+
|
66
|
+
loadData() {
|
67
|
+
this.props.pollBulkSearch({
|
68
|
+
search_id: MANIFEST_TASKS_BULK_SEARCH_ID,
|
69
|
+
type: 'all',
|
70
|
+
active_only: true,
|
71
|
+
action_types: BLOCKING_FOREMAN_TASK_TYPES,
|
72
|
+
}, BULK_TASK_SEARCH_INTERVAL);
|
73
|
+
|
74
|
+
this.props.loadSetting('content_disconnected');
|
75
|
+
this.props.loadSubscriptions();
|
76
|
+
}
|
77
|
+
|
78
|
+
handleDoneTask(taskToPoll) {
|
79
|
+
const POLL_TASK_INTERVAL = 5000;
|
80
|
+
|
81
|
+
if (!this.state.polledTask) {
|
82
|
+
this.setState({ polledTask: taskToPoll });
|
83
|
+
this.props.pollTaskUntilDone(taskToPoll.id, {}, POLL_TASK_INTERVAL).then((task) => {
|
84
|
+
function getErrors() {
|
85
|
+
return (
|
86
|
+
<ul>
|
87
|
+
{
|
88
|
+
task.humanized.errors.map(error => <li key={error}> {error} </li>)
|
89
|
+
}
|
90
|
+
</ul>
|
91
|
+
);
|
92
|
+
}
|
93
|
+
|
94
|
+
const message = (
|
95
|
+
<span>
|
96
|
+
<span>{__(`Task ${task.humanized.action} completed with a result of ${task.result}`)} </span>
|
97
|
+
{task.errors ? getErrors() : ''}
|
98
|
+
<a href={helpers.urlBuilder('foreman_tasks/tasks', '', task.id)}>
|
99
|
+
{__('Click here to go to the tasks page for the task.')}
|
100
|
+
</a>
|
101
|
+
</span>
|
102
|
+
);
|
103
|
+
|
104
|
+
notify({ message: ReactDOMServer.renderToStaticMarkup(message), type: task.result });
|
105
|
+
|
106
|
+
this.props.loadSubscriptions();
|
107
|
+
});
|
108
|
+
}
|
109
|
+
}
|
110
|
+
|
111
|
+
render() {
|
112
|
+
const { tasks, subscriptions } = this.props;
|
113
|
+
const { disconnected } = subscriptions;
|
114
|
+
const taskInProgress = tasks.length > 0;
|
115
|
+
const disableManifestActions = taskInProgress || disconnected;
|
116
|
+
|
117
|
+
let task = null;
|
118
|
+
|
119
|
+
if (taskInProgress) {
|
120
|
+
[task] = tasks;
|
121
|
+
this.handleDoneTask(task);
|
122
|
+
}
|
123
|
+
|
124
|
+
if (task) {
|
125
|
+
this.showTaskModal(true);
|
126
|
+
} else {
|
127
|
+
this.showTaskModal(false);
|
128
|
+
}
|
129
|
+
|
130
|
+
const onSearch = (search) => {
|
131
|
+
this.props.loadSubscriptions({ search });
|
132
|
+
};
|
133
|
+
|
134
|
+
const getAutoCompleteParams = search => ({
|
135
|
+
endpoint: '/subscriptions/auto_complete_search',
|
136
|
+
params: {
|
137
|
+
organization_id: orgId,
|
138
|
+
search,
|
139
|
+
},
|
140
|
+
});
|
141
|
+
|
142
|
+
const updateSearchQuery = (searchQuery) => {
|
143
|
+
this.setState({ searchQuery });
|
144
|
+
};
|
145
|
+
|
146
|
+
const showManageManifestModal = () => {
|
147
|
+
this.setState({ manifestModalOpen: true });
|
148
|
+
};
|
149
|
+
|
150
|
+
const onManageManifestModalClose = () => {
|
151
|
+
this.setState({ manifestModalOpen: false });
|
152
|
+
};
|
153
|
+
|
154
|
+
const showSubscriptionDeleteModal = () => {
|
155
|
+
this.setState({ subscriptionDeleteModalOpen: true });
|
156
|
+
};
|
157
|
+
|
158
|
+
const onSubscriptionDeleteModalClose = () => {
|
159
|
+
this.setState({ subscriptionDeleteModalOpen: false });
|
160
|
+
};
|
161
|
+
|
162
|
+
const onDeleteSubscriptions = (selectedRows) => {
|
163
|
+
this.props.deleteSubscriptions(selectedRows);
|
164
|
+
onSubscriptionDeleteModalClose();
|
165
|
+
};
|
166
|
+
|
167
|
+
const toggleDeleteButton = (rowsSelected) => {
|
168
|
+
this.setState({ disableDeleteButton: !rowsSelected });
|
169
|
+
};
|
170
|
+
|
171
|
+
const csvParams = createSubscriptionParams({ search: this.state.searchQuery });
|
172
|
+
|
173
|
+
return (
|
174
|
+
<Grid bsClass="container-fluid">
|
175
|
+
<Row>
|
176
|
+
<Col sm={12}>
|
177
|
+
<h1>{__('Red Hat Subscriptions')}</h1>
|
178
|
+
|
179
|
+
<Row className="toolbar-pf table-view-pf-toolbar-external">
|
180
|
+
<Col sm={12}>
|
181
|
+
<Form className="toolbar-pf-actions">
|
182
|
+
<FormGroup className="toolbar-pf-filter">
|
183
|
+
<Search
|
184
|
+
onSearch={onSearch}
|
185
|
+
getAutoCompleteParams={getAutoCompleteParams}
|
186
|
+
updateSearchQuery={updateSearchQuery}
|
187
|
+
/>
|
188
|
+
</FormGroup>
|
189
|
+
|
190
|
+
<div className="toolbar-pf-action-right">
|
191
|
+
<FormGroup>
|
192
|
+
<LinkContainer to="subscriptions/add" disabled={disableManifestActions}>
|
193
|
+
<TooltipButton
|
194
|
+
tooltipId="add-subscriptions-button-tooltip"
|
195
|
+
tooltipText={this.getDisabledReason()}
|
196
|
+
tooltipPlacement="top"
|
197
|
+
title={__('Add Subscriptions')}
|
198
|
+
disabled={disableManifestActions}
|
199
|
+
bsStyle="primary"
|
200
|
+
/>
|
201
|
+
</LinkContainer>
|
202
|
+
|
203
|
+
<Button onClick={showManageManifestModal}>
|
204
|
+
{__('Manage Manifest')}
|
205
|
+
</Button>
|
206
|
+
|
207
|
+
<Button
|
208
|
+
onClick={() => { api.open('/subscriptions.csv', csvParams); }}
|
209
|
+
>
|
210
|
+
{__('Export CSV')}
|
211
|
+
</Button>
|
212
|
+
|
213
|
+
<TooltipButton
|
214
|
+
bsStyle="danger"
|
215
|
+
onClick={showSubscriptionDeleteModal}
|
216
|
+
tooltipId="delete-subscriptions-button-tooltip"
|
217
|
+
tooltipText={this.getDisabledReason(true)}
|
218
|
+
tooltipPlacement="top"
|
219
|
+
title={__('Delete')}
|
220
|
+
disabled={disableManifestActions || this.state.disableDeleteButton}
|
221
|
+
/>
|
222
|
+
|
223
|
+
</FormGroup>
|
224
|
+
</div>
|
225
|
+
</Form>
|
226
|
+
</Col>
|
227
|
+
</Row>
|
228
|
+
|
229
|
+
<ManageManifestModal
|
230
|
+
showModal={this.state.manifestModalOpen}
|
231
|
+
taskInProgress={taskInProgress}
|
232
|
+
disableManifestActions={disableManifestActions}
|
233
|
+
disabledReason={this.getDisabledReason()}
|
234
|
+
onClose={onManageManifestModalClose}
|
235
|
+
/>
|
236
|
+
|
237
|
+
<div id="subscriptions-table" className="modal-container">
|
238
|
+
<SubscriptionsTable
|
239
|
+
loadSubscriptions={this.props.loadSubscriptions}
|
240
|
+
updateQuantity={this.props.updateQuantity}
|
241
|
+
subscriptions={this.props.subscriptions}
|
242
|
+
subscriptionDeleteModalOpen={this.state.subscriptionDeleteModalOpen}
|
243
|
+
onSubscriptionDeleteModalClose={onSubscriptionDeleteModalClose}
|
244
|
+
onDeleteSubscriptions={onDeleteSubscriptions}
|
245
|
+
toggleDeleteButton={toggleDeleteButton}
|
246
|
+
/>
|
247
|
+
<ModalProgressBar
|
248
|
+
show={this.state.showTaskModal}
|
249
|
+
container={document.getElementById('subscriptions-table')}
|
250
|
+
task={task}
|
251
|
+
/>
|
252
|
+
</div>
|
253
|
+
</Col>
|
254
|
+
</Row>
|
255
|
+
</Grid>
|
256
|
+
);
|
257
|
+
}
|
258
|
+
}
|
259
|
+
|
260
|
+
SubscriptionsPage.propTypes = {
|
261
|
+
loadSubscriptions: PropTypes.func.isRequired,
|
262
|
+
updateQuantity: PropTypes.func.isRequired,
|
263
|
+
subscriptions: PropTypes.shape().isRequired,
|
264
|
+
pollBulkSearch: PropTypes.func.isRequired,
|
265
|
+
pollTaskUntilDone: PropTypes.func.isRequired,
|
266
|
+
loadSetting: PropTypes.func.isRequired,
|
267
|
+
tasks: PropTypes.arrayOf(PropTypes.shape({})),
|
268
|
+
deleteSubscriptions: PropTypes.func.isRequired,
|
269
|
+
};
|
270
|
+
|
271
|
+
SubscriptionsPage.defaultProps = {
|
272
|
+
tasks: [],
|
273
|
+
};
|
274
|
+
|
275
|
+
export default SubscriptionsPage;
|
@@ -0,0 +1,336 @@
|
|
1
|
+
import React, { Component } from 'react';
|
2
|
+
import PropTypes from 'prop-types';
|
3
|
+
import { sprintf } from 'jed';
|
4
|
+
import { cloneDeep, findIndex } from 'lodash';
|
5
|
+
import { Spinner, Table, Alert } from 'patternfly-react';
|
6
|
+
import { Table as ForemanTable, TableBody as ForemanTableBody } from '../../move_to_foreman/components/common/table';
|
7
|
+
import ConfirmDialog from '../../move_to_foreman/components/common/ConfirmDialog';
|
8
|
+
import Dialog from '../../move_to_foreman/components/common/Dialog';
|
9
|
+
import { columns } from './SubscriptionsTableSchema';
|
10
|
+
import { recordsValid } from './SubscriptionValidations';
|
11
|
+
|
12
|
+
const emptyStateData = {
|
13
|
+
header: __('There are no Subscriptions to display'),
|
14
|
+
description: __('Add Subscriptions to this Allocation to manage your Entitlements.'),
|
15
|
+
documentation: {
|
16
|
+
title: __('Learn more about adding Subscriptions to Allocations'),
|
17
|
+
url: 'http://redhat.com',
|
18
|
+
},
|
19
|
+
action: {
|
20
|
+
title: __('Add Subscriptions'),
|
21
|
+
url: 'subscriptions/add',
|
22
|
+
},
|
23
|
+
};
|
24
|
+
|
25
|
+
const ErrorAlerts = ({ errors }) => {
|
26
|
+
const alerts = errors.filter(Boolean).map(e => (
|
27
|
+
<Alert type={Alert.ALERT_TYPE_ERROR} key={e}>
|
28
|
+
<span>{e}</span>
|
29
|
+
</Alert>
|
30
|
+
));
|
31
|
+
|
32
|
+
return (
|
33
|
+
<div>
|
34
|
+
{alerts}
|
35
|
+
</div>
|
36
|
+
);
|
37
|
+
};
|
38
|
+
ErrorAlerts.propTypes = {
|
39
|
+
errors: PropTypes.arrayOf(PropTypes.string).isRequired,
|
40
|
+
};
|
41
|
+
|
42
|
+
const buildTableRows = (subscriptions, updatedQuantity) =>
|
43
|
+
subscriptions.results.map((subs) => {
|
44
|
+
if (updatedQuantity[subs.id]) {
|
45
|
+
return {
|
46
|
+
...subs,
|
47
|
+
entitlementsChanged: true,
|
48
|
+
quantity: updatedQuantity[subs.id],
|
49
|
+
availableQuantity: subscriptions.availableQuantities[subs.id],
|
50
|
+
};
|
51
|
+
}
|
52
|
+
return {
|
53
|
+
...subs,
|
54
|
+
availableQuantity: subscriptions.availableQuantities[subs.id],
|
55
|
+
};
|
56
|
+
});
|
57
|
+
|
58
|
+
const buildPools = updatedQuantity =>
|
59
|
+
Object.entries(updatedQuantity)
|
60
|
+
.map(([id, quantity]) => ({
|
61
|
+
id,
|
62
|
+
quantity,
|
63
|
+
}));
|
64
|
+
|
65
|
+
class SubscriptionsTable extends Component {
|
66
|
+
static getDerivedStateFromProps(nextProps, prevState) {
|
67
|
+
if (nextProps.subscriptions !== undefined) {
|
68
|
+
return {
|
69
|
+
rows: buildTableRows(
|
70
|
+
nextProps.subscriptions,
|
71
|
+
prevState.updatedQuantity,
|
72
|
+
),
|
73
|
+
};
|
74
|
+
}
|
75
|
+
return null;
|
76
|
+
}
|
77
|
+
|
78
|
+
constructor(props) {
|
79
|
+
super(props);
|
80
|
+
this.state = {
|
81
|
+
updatedQuantity: {},
|
82
|
+
editing: false,
|
83
|
+
rows: props.subscriptions.results,
|
84
|
+
showUpdateConfirmDialog: false,
|
85
|
+
showCancelConfirmDialog: false,
|
86
|
+
showErrorDialog: false,
|
87
|
+
selectedRows: [],
|
88
|
+
};
|
89
|
+
}
|
90
|
+
|
91
|
+
enableEditing(editingState) {
|
92
|
+
this.setState({
|
93
|
+
updatedQuantity: {},
|
94
|
+
editing: editingState,
|
95
|
+
});
|
96
|
+
}
|
97
|
+
|
98
|
+
updateRows(updatedQuantity) {
|
99
|
+
const rows = buildTableRows(
|
100
|
+
this.props.subscriptions,
|
101
|
+
updatedQuantity,
|
102
|
+
);
|
103
|
+
this.setState({ rows, updatedQuantity });
|
104
|
+
}
|
105
|
+
|
106
|
+
showUpdateConfirm(show) {
|
107
|
+
this.setState({
|
108
|
+
showUpdateConfirmDialog: show,
|
109
|
+
});
|
110
|
+
}
|
111
|
+
|
112
|
+
showCancelConfirm(show) {
|
113
|
+
this.setState({
|
114
|
+
showCancelConfirmDialog: show,
|
115
|
+
});
|
116
|
+
}
|
117
|
+
|
118
|
+
showErrorDialog(show) {
|
119
|
+
this.setState({
|
120
|
+
showErrorDialog: show,
|
121
|
+
});
|
122
|
+
}
|
123
|
+
|
124
|
+
confirmEdit() {
|
125
|
+
this.showUpdateConfirm(false);
|
126
|
+
if (Object.keys(this.state.updatedQuantity).length > 0) {
|
127
|
+
this.props.updateQuantity(buildPools(this.state.updatedQuantity));
|
128
|
+
}
|
129
|
+
this.enableEditing(false);
|
130
|
+
}
|
131
|
+
|
132
|
+
cancelEdit() {
|
133
|
+
this.showCancelConfirm(false);
|
134
|
+
this.enableEditing(false);
|
135
|
+
this.updateRows({});
|
136
|
+
}
|
137
|
+
|
138
|
+
hasQuantityChanged(rowData, editedValue) {
|
139
|
+
if (editedValue !== undefined) {
|
140
|
+
const originalRows = this.props.subscriptions.results;
|
141
|
+
const index = findIndex(originalRows, row => (row.id === rowData.id));
|
142
|
+
const currentValue = originalRows[index].quantity;
|
143
|
+
|
144
|
+
return (`${editedValue}` !== `${currentValue}`);
|
145
|
+
}
|
146
|
+
return false;
|
147
|
+
}
|
148
|
+
|
149
|
+
render() {
|
150
|
+
const { subscriptions } = this.props;
|
151
|
+
|
152
|
+
const inlineEditController = {
|
153
|
+
isEditing: ({ rowData }) => (this.state.editing && rowData.available >= 0),
|
154
|
+
hasChanged: ({ rowData }) => {
|
155
|
+
const editedValue = this.state.updatedQuantity[rowData.id];
|
156
|
+
return this.hasQuantityChanged(rowData, editedValue);
|
157
|
+
},
|
158
|
+
onActivate: () => {
|
159
|
+
this.enableEditing(true);
|
160
|
+
},
|
161
|
+
onConfirm: () => {
|
162
|
+
if (recordsValid(this.state.rows)) {
|
163
|
+
this.showUpdateConfirm(true);
|
164
|
+
} else {
|
165
|
+
this.showErrorDialog(true);
|
166
|
+
}
|
167
|
+
},
|
168
|
+
onCancel: () => {
|
169
|
+
this.showCancelConfirm(true);
|
170
|
+
},
|
171
|
+
onChange: (value, { rowData }) => {
|
172
|
+
const updatedQuantity = cloneDeep(this.state.updatedQuantity);
|
173
|
+
|
174
|
+
if (this.hasQuantityChanged(rowData, value)) {
|
175
|
+
updatedQuantity[rowData.id] = value;
|
176
|
+
} else {
|
177
|
+
delete updatedQuantity[rowData.id];
|
178
|
+
}
|
179
|
+
|
180
|
+
this.updateRows(updatedQuantity);
|
181
|
+
},
|
182
|
+
};
|
183
|
+
|
184
|
+
const checkAllRowsSelected = () => this.state.rows.length === this.state.selectedRows.length;
|
185
|
+
|
186
|
+
const updateDeleteButton = () => {
|
187
|
+
this.props.toggleDeleteButton(this.state.selectedRows.length > 0);
|
188
|
+
};
|
189
|
+
|
190
|
+
const selectionController = {
|
191
|
+
allRowsSelected: () => checkAllRowsSelected(),
|
192
|
+
selectAllRows: () => {
|
193
|
+
if (checkAllRowsSelected()) {
|
194
|
+
this.setState(
|
195
|
+
{ selectedRows: [] },
|
196
|
+
updateDeleteButton,
|
197
|
+
);
|
198
|
+
} else {
|
199
|
+
this.setState(
|
200
|
+
{ selectedRows: this.state.rows.map(row => row.id) },
|
201
|
+
updateDeleteButton,
|
202
|
+
);
|
203
|
+
}
|
204
|
+
},
|
205
|
+
selectRow: ({ rowData }) => {
|
206
|
+
let { selectedRows } = this.state;
|
207
|
+
if (selectedRows.includes(rowData.id)) {
|
208
|
+
selectedRows = selectedRows.filter(e => e !== rowData.id);
|
209
|
+
} else {
|
210
|
+
selectedRows.push(rowData.id);
|
211
|
+
}
|
212
|
+
|
213
|
+
this.setState(
|
214
|
+
{ selectedRows },
|
215
|
+
updateDeleteButton,
|
216
|
+
);
|
217
|
+
},
|
218
|
+
isSelected: ({ rowData }) => this.state.selectedRows.includes(rowData.id),
|
219
|
+
};
|
220
|
+
|
221
|
+
const onPaginationChange = (pagination) => {
|
222
|
+
this.props.loadSubscriptions({
|
223
|
+
...pagination,
|
224
|
+
});
|
225
|
+
};
|
226
|
+
|
227
|
+
let bodyMessage;
|
228
|
+
if (subscriptions.results.length === 0 && subscriptions.searchIsActive) {
|
229
|
+
bodyMessage = __('No subscriptions match your search criteria.');
|
230
|
+
}
|
231
|
+
|
232
|
+
const columnsDefinition = columns(inlineEditController, selectionController);
|
233
|
+
|
234
|
+
return (
|
235
|
+
<Spinner loading={subscriptions.loading} className="small-spacer">
|
236
|
+
<ErrorAlerts
|
237
|
+
errors={[
|
238
|
+
subscriptions.error,
|
239
|
+
subscriptions.quantitiesError,
|
240
|
+
]}
|
241
|
+
/>
|
242
|
+
<ForemanTable
|
243
|
+
columns={columnsDefinition}
|
244
|
+
emptyState={emptyStateData}
|
245
|
+
bodyMessage={bodyMessage}
|
246
|
+
rows={this.state.rows}
|
247
|
+
components={{
|
248
|
+
header: {
|
249
|
+
row: Table.TableInlineEditHeaderRow,
|
250
|
+
},
|
251
|
+
}}
|
252
|
+
itemCount={subscriptions.itemCount}
|
253
|
+
pagination={subscriptions.pagination}
|
254
|
+
onPaginationChange={onPaginationChange}
|
255
|
+
inlineEdit
|
256
|
+
>
|
257
|
+
<Table.Header
|
258
|
+
onRow={() => ({
|
259
|
+
role: 'row',
|
260
|
+
isEditing: () => this.state.editing,
|
261
|
+
onCancel: () => inlineEditController.onCancel(),
|
262
|
+
onConfirm: () => inlineEditController.onConfirm(),
|
263
|
+
})}
|
264
|
+
/>
|
265
|
+
<ForemanTableBody
|
266
|
+
columns={columnsDefinition}
|
267
|
+
rows={this.state.rows}
|
268
|
+
rowKey="id"
|
269
|
+
message={bodyMessage}
|
270
|
+
/>
|
271
|
+
</ForemanTable>
|
272
|
+
<ConfirmDialog
|
273
|
+
show={this.state.showUpdateConfirmDialog}
|
274
|
+
title={__('Editing Entitlements')}
|
275
|
+
dangerouslySetInnerHTML={{
|
276
|
+
__html: sprintf(
|
277
|
+
__("You're making changes to %(entitlementCount)s entitlement(s)"),
|
278
|
+
{
|
279
|
+
entitlementCount: `<b>${Object.keys(this.state.updatedQuantity).length}</b>`,
|
280
|
+
},
|
281
|
+
),
|
282
|
+
}}
|
283
|
+
onConfirm={() => this.confirmEdit()}
|
284
|
+
onCancel={() => this.showUpdateConfirm(false)}
|
285
|
+
/>
|
286
|
+
<ConfirmDialog
|
287
|
+
show={this.state.showCancelConfirmDialog}
|
288
|
+
title={__('Editing Entitlements')}
|
289
|
+
message={__('You have unsaved changes. Do you want to exit without saving your changes?')}
|
290
|
+
confirmLabel={__('Exit')}
|
291
|
+
onConfirm={() => this.cancelEdit()}
|
292
|
+
onCancel={() => this.showCancelConfirm(false)}
|
293
|
+
/>
|
294
|
+
<Dialog
|
295
|
+
show={this.state.showErrorDialog}
|
296
|
+
title={__('Editing Entitlements')}
|
297
|
+
message={__('Some of your inputs contain errors. Please update them and save your changes again.')}
|
298
|
+
onCancel={() => this.showErrorDialog(false)}
|
299
|
+
/>
|
300
|
+
<ConfirmDialog
|
301
|
+
show={this.props.subscriptionDeleteModalOpen}
|
302
|
+
title={__('Confirm Deletion')}
|
303
|
+
dangerouslySetInnerHTML={{
|
304
|
+
__html: sprintf(
|
305
|
+
__(`Are you sure you want to delete %(entitlementCount)s
|
306
|
+
subscription(s)? This action will remove the subscription(s) and
|
307
|
+
refresh your manifest. All systems using these subscription(s) will
|
308
|
+
lose them and also may lose access to updates and Errata.`),
|
309
|
+
{
|
310
|
+
entitlementCount: `<b>${this.state.selectedRows.length}</b>`,
|
311
|
+
},
|
312
|
+
),
|
313
|
+
}}
|
314
|
+
|
315
|
+
confirmLabel={__('Delete')}
|
316
|
+
onConfirm={() => this.props.onDeleteSubscriptions(this.state.selectedRows)}
|
317
|
+
onCancel={this.props.onSubscriptionDeleteModalClose}
|
318
|
+
/>
|
319
|
+
</Spinner>
|
320
|
+
);
|
321
|
+
}
|
322
|
+
}
|
323
|
+
|
324
|
+
SubscriptionsTable.propTypes = {
|
325
|
+
loadSubscriptions: PropTypes.func.isRequired,
|
326
|
+
updateQuantity: PropTypes.func.isRequired,
|
327
|
+
subscriptions: PropTypes.shape({
|
328
|
+
results: PropTypes.array,
|
329
|
+
}).isRequired,
|
330
|
+
subscriptionDeleteModalOpen: PropTypes.bool.isRequired,
|
331
|
+
onDeleteSubscriptions: PropTypes.func.isRequired,
|
332
|
+
onSubscriptionDeleteModalClose: PropTypes.func.isRequired,
|
333
|
+
toggleDeleteButton: PropTypes.func.isRequired,
|
334
|
+
};
|
335
|
+
|
336
|
+
export default SubscriptionsTable;
|