katello 3.13.4 → 3.14.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/controllers/katello/api/registry/registry_proxies_controller.rb +25 -16
- data/app/controllers/katello/api/v2/activation_keys_controller.rb +26 -21
- data/app/controllers/katello/api/v2/ansible_collections_controller.rb +6 -0
- data/app/controllers/katello/api/v2/content_uploads_controller.rb +8 -2
- data/app/controllers/katello/api/v2/content_view_filter_rules_controller.rb +8 -1
- data/app/controllers/katello/api/v2/content_view_filters_controller.rb +1 -1
- data/app/controllers/katello/api/v2/errata_controller.rb +1 -1
- data/app/controllers/katello/api/v2/host_subscriptions_controller.rb +3 -3
- data/app/controllers/katello/api/v2/katello_ping_controller.rb +24 -0
- data/app/controllers/katello/api/v2/module_streams_controller.rb +21 -0
- data/app/controllers/katello/api/v2/package_groups_controller.rb +5 -0
- data/app/controllers/katello/api/v2/packages_controller.rb +16 -0
- data/app/controllers/katello/api/v2/repositories_controller.rb +7 -4
- data/app/controllers/katello/api/v2/srpms_controller.rb +1 -1
- data/app/controllers/katello/api/v2/subscriptions_controller.rb +5 -1
- data/app/controllers/katello/api/v2/sync_plans_controller.rb +7 -5
- data/app/controllers/katello/concerns/api/v2/repository_content_controller.rb +36 -5
- data/app/helpers/katello/hosts_and_hostgroups_helper.rb +12 -0
- data/app/lib/actions/katello/capsule_content/refresh_repos.rb +55 -0
- data/app/lib/actions/katello/capsule_content/sync.rb +13 -64
- data/app/lib/actions/katello/capsule_content/sync_capsule.rb +40 -0
- data/app/lib/actions/katello/content_view/publish.rb +0 -3
- data/app/lib/actions/katello/content_view_puppet_environment/destroy.rb +1 -3
- data/app/lib/actions/katello/orphan_cleanup/remove_orphans.rb +21 -0
- data/app/lib/actions/katello/repository/create.rb +8 -0
- data/app/lib/actions/katello/repository/import_upload.rb +13 -12
- data/app/lib/actions/katello/repository/metadata_generate.rb +2 -2
- data/app/lib/actions/katello/repository/update.rb +9 -0
- data/app/lib/actions/katello/repository/upload_files.rb +4 -11
- data/app/lib/actions/pulp/consumer/sync_capsule.rb +4 -0
- data/app/lib/actions/pulp/orchestration/orphan_cleanup/remove_orphans.rb +16 -0
- data/app/lib/actions/pulp/orchestration/repository/refresh_repos.rb +25 -0
- data/app/lib/actions/pulp/orchestration/repository/smart_proxy_sync.rb +34 -0
- data/app/lib/actions/pulp/orchestration/repository/upload_content.rb +35 -0
- data/app/lib/actions/pulp/orphan_cleanup/remove_orphans.rb +15 -0
- data/app/lib/actions/{katello/capsule_content → pulp/orphan_cleanup}/remove_unneeded_repos.rb +2 -2
- data/app/lib/actions/pulp/repository/import_upload.rb +7 -11
- data/app/lib/actions/pulp3/abstract_async_task.rb +7 -7
- data/app/lib/actions/pulp3/capsule_content/generate_metadata.rb +32 -0
- data/app/lib/actions/pulp3/capsule_content/refresh_distribution.rb +31 -0
- data/app/lib/actions/pulp3/capsule_content/sync.rb +26 -0
- data/app/lib/actions/pulp3/orchestration/orphan_cleanup/remove_orphans.rb +20 -0
- data/app/lib/actions/pulp3/orchestration/repository/copy_all_units.rb +15 -15
- data/app/lib/actions/pulp3/orchestration/repository/create.rb +3 -1
- data/app/lib/actions/pulp3/orchestration/repository/import_upload.rb +36 -0
- data/app/lib/actions/pulp3/orchestration/repository/refresh_repos.rb +24 -0
- data/app/lib/actions/pulp3/orchestration/repository/sync.rb +1 -1
- data/app/lib/actions/pulp3/orchestration/repository/upload_content.rb +25 -0
- data/app/lib/actions/pulp3/orphan_cleanup/delete_orphan_repository_versions.rb +20 -0
- data/app/lib/actions/pulp3/orphan_cleanup/remove_unneeded_repos.rb +16 -0
- data/app/lib/actions/pulp3/repository/create_publication.rb +1 -5
- data/app/lib/actions/pulp3/repository/import_upload.rb +21 -0
- data/app/lib/actions/pulp3/repository/save_artifact.rb +19 -0
- data/app/lib/actions/pulp3/repository/save_version.rb +3 -2
- data/app/lib/actions/pulp3/repository/sync.rb +1 -1
- data/app/lib/actions/pulp3/repository/upload_file.rb +76 -0
- data/app/lib/katello/api/v2/rendering.rb +1 -2
- data/app/lib/katello/concerns/base_template_scope_extensions.rb +34 -2
- data/app/lib/katello/errors.rb +21 -0
- data/app/lib/katello/resources/candlepin/consumer.rb +0 -9
- data/app/lib/katello/resources/candlepin/owner.rb +0 -5
- data/app/lib/katello/resources/candlepin/product.rb +2 -6
- data/app/lib/katello/resources/registry.rb +25 -10
- data/app/lib/katello/util/filter_clause_generator.rb +1 -1
- data/app/lib/katello/util/module_stream_clause_generator.rb +49 -0
- data/app/lib/katello/util/package_clause_generator.rb +1 -1
- data/app/models/katello/ansible_collection.rb +5 -8
- data/app/models/katello/ansible_collection_tag.rb +8 -0
- data/app/models/katello/ansible_tag.rb +8 -0
- data/app/models/katello/concerns/host_managed_extensions.rb +16 -14
- data/app/models/katello/concerns/pulp_database_unit.rb +27 -4
- data/app/models/katello/concerns/search_by_repository_name.rb +4 -1
- data/app/models/katello/concerns/smart_proxy_extensions.rb +44 -20
- data/app/models/katello/content_view_docker_filter.rb +15 -2
- data/app/models/katello/content_view_filter.rb +28 -8
- data/app/models/katello/content_view_module_stream_filter.rb +14 -0
- data/app/models/katello/content_view_module_stream_filter_rule.rb +11 -0
- data/app/models/katello/content_view_package_filter.rb +18 -8
- data/app/models/katello/content_view_version.rb +7 -2
- data/app/models/katello/deb.rb +0 -8
- data/app/models/katello/docker_manifest.rb +0 -8
- data/app/models/katello/docker_manifest_list.rb +0 -8
- data/app/models/katello/docker_meta_tag.rb +38 -20
- data/app/models/katello/docker_tag.rb +22 -33
- data/app/models/katello/erratum.rb +10 -8
- data/app/models/katello/file_unit.rb +1 -13
- data/app/models/katello/glue/candlepin/owner.rb +0 -5
- data/app/models/katello/glue/candlepin/product.rb +1 -5
- data/app/models/katello/glue/pulp/repo.rb +1 -1
- data/app/models/katello/host/content_facet.rb +6 -0
- data/app/models/katello/host_collection.rb +4 -0
- data/app/models/katello/installed_package.rb +4 -0
- data/app/models/katello/module_stream.rb +1 -12
- data/app/models/katello/ostree_branch.rb +0 -7
- data/app/models/katello/package_group.rb +0 -7
- data/app/models/katello/ping.rb +10 -3
- data/app/models/katello/pool.rb +11 -1
- data/app/models/katello/puppet_module.rb +0 -7
- data/app/models/katello/repository.rb +15 -6
- data/app/models/katello/repository_docker_meta_tag.rb +7 -0
- data/app/models/katello/repository_docker_tag.rb +7 -0
- data/app/models/katello/repository_file_unit.rb +7 -0
- data/app/models/katello/rhsm_fact_name.rb +5 -1
- data/app/models/katello/rhsm_fact_parser.rb +17 -1
- data/app/models/katello/root_repository.rb +11 -6
- data/app/models/katello/rpm.rb +0 -8
- data/app/models/katello/srpm.rb +0 -8
- data/app/models/katello/upstream_pool.rb +2 -0
- data/app/models/katello/yum_metadata_file.rb +0 -4
- data/app/models/setting/content.rb +124 -128
- data/app/services/katello/candlepin/consumer.rb +0 -1
- data/app/services/katello/pulp/content.rb +11 -4
- data/app/services/katello/pulp/docker_tag.rb +0 -1
- data/app/services/katello/pulp/pulp_content_unit.rb +4 -0
- data/app/services/katello/pulp/repository.rb +53 -0
- data/app/services/katello/pulp/repository/file.rb +1 -1
- data/app/services/katello/pulp/repository/puppet.rb +8 -1
- data/app/services/katello/pulp/repository/yum.rb +42 -9
- data/app/services/katello/pulp/smart_proxy_repository.rb +13 -96
- data/app/services/katello/pulp3/ansible_collection.rb +7 -3
- data/app/services/katello/pulp3/content.rb +60 -0
- data/app/services/katello/pulp3/docker_blob.rb +1 -1
- data/app/services/katello/pulp3/docker_manifest.rb +1 -1
- data/app/services/katello/pulp3/docker_manifest_list.rb +1 -1
- data/app/services/katello/pulp3/docker_tag.rb +2 -2
- data/app/services/katello/pulp3/file_unit.rb +7 -1
- data/app/services/katello/pulp3/pulp_content_unit.rb +15 -5
- data/app/services/katello/pulp3/repository.rb +301 -24
- data/app/services/katello/pulp3/repository/ansible_collection.rb +5 -1
- data/app/services/katello/pulp3/repository/docker.rb +54 -9
- data/app/services/katello/pulp3/repository/file.rb +8 -0
- data/app/services/katello/pulp3/repository/yum.rb +61 -0
- data/app/services/katello/pulp3/smart_proxy_repository.rb +38 -0
- data/app/services/katello/repository_type_manager.rb +7 -0
- data/app/services/katello/smart_proxy_helper.rb +50 -0
- data/app/views/foreman/smart_proxies/_content_tab.html.erb +1 -1
- data/app/views/katello/api/v2/ansible_collections/base.json.rabl +5 -0
- data/app/views/katello/api/v2/ansible_collections/show.json.rabl +7 -0
- data/app/views/katello/api/v2/capsule_content/sync_status.json.rabl +1 -0
- data/app/views/katello/api/v2/content_view_filter_rules/show.json.rabl +1 -1
- data/app/views/katello/api/v2/content_view_filters/base.json.rabl +5 -0
- data/app/views/katello/api/v2/content_view_filters/show.json.rabl +2 -1
- data/app/views/katello/api/v2/hosts_bulk_actions/erratum.json.rabl +2 -0
- data/app/views/katello/api/v2/{ping → katello_ping}/server_status.json.rabl +0 -0
- data/app/views/katello/api/v2/{ping → katello_ping}/show.json.rabl +0 -0
- data/app/views/katello/api/v2/{ping → katello_ping}/version.json.rabl +0 -0
- data/app/views/katello/api/v2/repositories/show.json.rabl +1 -1
- data/app/views/katello/api/v2/subscription_facet/base.json.rabl +1 -1
- data/app/views/katello/api/v2/subscriptions/index.json.rabl +1 -0
- data/app/views/katello/api/v2/subscriptions/permissions.rabl +11 -0
- data/config/katello.yaml.example +9 -0
- data/config/routes.rb +2 -1
- data/config/routes/api/v2.rb +2 -2
- data/db/migrate/20180920214134_create_repository_root.rb +1 -1
- data/db/migrate/20190730183518_add_docker_tag_join_table.rb +25 -0
- data/db/migrate/20190730203334_add_docker_meta_tag_join_table.rb +25 -0
- data/db/migrate/20190814025338_create_content_view_module_stream_filter_rules.rb +13 -0
- data/db/migrate/20190816162733_rename_ansible_collection_whitelist_to_requirements.rb +5 -0
- data/db/migrate/20190822144300_add_ansible_fields.rb +18 -0
- data/db/migrate/20190912210927_rename_repository_file_unit.rb +12 -0
- data/engines/bastion/README.md +2 -2
- data/engines/bastion/app/assets/javascripts/bastion/components/bst-edit.directive.js +2 -1
- data/engines/bastion/app/assets/javascripts/bastion/components/nutupane.factory.js +20 -6
- data/engines/bastion/app/assets/javascripts/bastion/components/views/bst-modal.html +1 -1
- data/engines/bastion/app/assets/javascripts/bastion/layouts/partials/table.html +2 -1
- data/engines/bastion/app/assets/stylesheets/bastion/overrides.scss +1 -0
- data/engines/bastion/lib/bastion.rb +1 -0
- data/engines/bastion_katello/README.md +1 -2
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/activation-keys/details/activation-key-repository-sets.controller.js +1 -4
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/ansible-collections/ansible-collections.factory.js +28 -0
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/ansible-collections/ansible-collections.module.js +15 -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/capsule-content/capsule-content.controller.js +4 -0
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-hosts/bulk/content-hosts-bulk-errata-modal.controller.js +0 -6
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-hosts/bulk/views/content-hosts-bulk-destroy-modal.html +3 -3
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-hosts/bulk/views/content-hosts-bulk-errata-modal.html +2 -34
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-hosts/bulk/views/content-hosts-bulk-repository-sets-modal.html +1 -1
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-hosts/content-host-register-client.directive.js +6 -0
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-hosts/content-hosts.routes.js +0 -11
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-hosts/content/content-host-packages-installed.controller.js +1 -4
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-hosts/content/content-host-packages.controller.js +3 -1
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-hosts/content/views/content-host-errata.html +1 -3
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-hosts/content/views/content-host-packages-actions.html +2 -5
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-hosts/content/views/content-host-packages-installed.html +1 -4
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-hosts/details/views/content-host-details.html +4 -16
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-hosts/details/views/content-host-info.html +2 -2
- 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-client.html +13 -0
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-hosts/views/register.html +1 -13
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-views/content-views.routes.js +47 -5
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-views/details/components/views/content-view-composite-available-content-views.html +1 -1
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-views/details/components/views/content-view-composite-content-views-list.html +1 -1
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-views/details/content-view-details.controller.js +1 -1
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-views/details/filters/available-module-stream-filter.controller.js +68 -0
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-views/details/filters/filter-helper.service.js +2 -1
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-views/details/filters/filter-rule-matching-package-modal.controller.js +37 -0
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-views/details/filters/filters.controller.js +4 -1
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-views/details/filters/module-stream-list-filter.controller.js +73 -0
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-views/details/filters/new-filter.controller.js +4 -1
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-views/details/filters/package-filter.controller.js +14 -1
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-views/details/filters/views/errata-filter-details.html +3 -0
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-views/details/filters/views/filter-details.html +0 -2
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-views/details/filters/views/filter-repositories.html +5 -0
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-views/details/filters/views/filter-rule-matching-package-modal.html +43 -0
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-views/details/filters/views/filters.html +4 -0
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-views/details/filters/views/module-stream-filter-details.html +41 -0
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-views/details/filters/views/module-stream-filter.html +43 -0
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-views/details/filters/views/package-filter-details.html +4 -0
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-views/details/histories/content-view-history.controller.js +1 -1
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-views/details/histories/views/content-view-history.html +1 -1
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-views/details/views/content-view-deb-repositories.html +3 -3
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-views/details/views/content-view-info.html +1 -2
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-views/new/views/content-view-new.html +1 -1
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-views/versions/views/content-view-version-errata.html +3 -0
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/errata/errata.controller.js +1 -1
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/host-collections/details/views/host-collection-add-hosts.html +1 -1
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/host-collections/details/views/host-collection-info.html +44 -35
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/packages/packages.controller.js +1 -1
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/products/details/repositories/details/repository-details-info.controller.js +12 -0
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/products/details/repositories/details/repository-details-manage-content.controller.js +5 -3
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/products/details/repositories/details/views/repository-info.html +21 -3
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/products/details/repositories/details/views/repository-manage-ansible-collections.html +36 -0
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/products/details/repositories/download-policy.service.js +1 -1
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/products/details/repositories/new/new-repository.controller.js +24 -2
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/products/details/repositories/new/views/new-repository.html +29 -15
- 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 +1 -1
- data/engines/bastion_katello/app/assets/stylesheets/bastion_katello/bastion_katello.scss +8 -0
- data/engines/bastion_katello/lib/bastion_katello/engine.rb +8 -8
- data/lib/katello/engine.rb +0 -4
- data/lib/katello/plugin.rb +19 -1
- data/lib/katello/repository_types/yum.rb +2 -0
- data/lib/katello/tasks/delete_orphaned_content.rake +1 -1
- data/lib/katello/tasks/reimport.rake +1 -1
- data/lib/katello/version.rb +1 -1
- data/package.json +9 -5
- data/webpack/__mocks__/foremanReact/common/helpers.js +4 -1
- data/webpack/__mocks__/foremanReact/components/PermissionDenied/index.js +2 -0
- data/webpack/components/Content/ContentPage.js +55 -0
- data/webpack/{scenes/ModuleStreams/ModuleStreamsTable.js → components/Content/ContentTable.js} +9 -8
- data/webpack/components/Content/Details/ContentDetailInfo.js +33 -0
- data/webpack/{scenes/ModuleStreams/Details/Repositories/ModuleStreamDetailRepositories.js → components/Content/Details/ContentDetailRepositories.js} +4 -4
- data/webpack/{scenes/ModuleStreams/Details/Repositories/TableSchema.js → components/Content/Details/ContentDetailRepositoryTableSchema.js} +1 -1
- data/webpack/components/Content/Details/ContentDetails.js +70 -0
- data/webpack/components/Content/Details/__tests__/ContentDetailInfo.test.js +28 -0
- data/webpack/components/Content/Details/__tests__/ContentDetailRepositories.test.js +22 -0
- data/webpack/components/Content/Details/__tests__/ContentDetails.test.js +64 -0
- data/webpack/components/Content/Details/__tests__/__snapshots__/ContentDetailInfo.test.js.snap +39 -0
- data/webpack/{scenes/ModuleStreams/Details/Repositories/__tests__/__snapshots__/ModuleStreamDetailRepositories.test.js.snap → components/Content/Details/__tests__/__snapshots__/ContentDetailRepositories.test.js.snap} +3 -9
- data/webpack/components/Content/Details/__tests__/__snapshots__/ContentDetails.test.js.snap +137 -0
- data/webpack/components/Content/__tests__/ContentPage.test.js +36 -0
- data/webpack/components/Content/__tests__/ContentTable.test.js +40 -0
- data/webpack/components/Content/__tests__/__snapshots__/ContentPage.test.js.snap +70 -0
- data/webpack/components/Content/__tests__/__snapshots__/ContentTable.test.js.snap +33 -0
- data/webpack/components/Search/index.js +6 -7
- data/webpack/components/SelectOrg/SelectOrgAction.js +20 -22
- data/webpack/containers/Application/config.js +10 -0
- data/webpack/containers/Application/overrides.scss +5 -0
- data/webpack/move_to_foreman/common/helpers.js +1 -1
- data/webpack/move_to_foreman/components/common/table/components/TableSelectionCell.js +5 -2
- data/webpack/move_to_foreman/components/common/table/formatters/EntitlementsInlineEditFormatter.js +9 -2
- data/webpack/move_to_foreman/components/common/table/formatters/collapseableAndSelectionCellFormatter.js +2 -0
- data/webpack/move_to_foreman/components/common/table/formatters/selectionCellFormatter.js +3 -0
- data/webpack/move_to_pf/TypeAhead/TypeAhead.js +1 -0
- data/webpack/redux/OrganizationProducts/OrganizationProductsActions.js +10 -10
- data/webpack/redux/actions/RedHatRepositories/__tests__/enabled.test.js +39 -0
- data/webpack/redux/actions/RedHatRepositories/enabled.js +24 -24
- data/webpack/redux/actions/RedHatRepositories/helpers.js +5 -5
- data/webpack/redux/actions/RedHatRepositories/repositorySetRepositories.js +23 -22
- data/webpack/redux/actions/RedHatRepositories/sets.js +17 -21
- data/webpack/redux/reducers/RedHatRepositories/__tests__/enabled.test.js +1 -0
- data/webpack/redux/reducers/RedHatRepositories/__tests__/sets.test.js +1 -1
- data/webpack/redux/reducers/RedHatRepositories/enabled.fixtures.js +1 -0
- data/webpack/redux/reducers/RedHatRepositories/enabled.js +42 -33
- data/webpack/redux/reducers/RedHatRepositories/sets.fixtures.js +2 -1
- data/webpack/redux/reducers/RedHatRepositories/sets.js +2 -1
- data/webpack/redux/reducers/index.js +4 -0
- data/webpack/scenes/AnsibleCollections/AnsibleCollectionsActions.js +30 -0
- data/webpack/scenes/AnsibleCollections/AnsibleCollectionsConstants.js +3 -0
- data/webpack/scenes/AnsibleCollections/AnsibleCollectionsPage.js +80 -0
- data/webpack/scenes/AnsibleCollections/AnsibleCollectionsReducer.js +39 -0
- data/webpack/scenes/AnsibleCollections/AnsibleCollectionsTableSchema.js +60 -0
- data/webpack/scenes/AnsibleCollections/AnsibleCollectionsTables.scss +0 -0
- data/webpack/scenes/AnsibleCollections/Details/AnsibleCollectionDetails.js +91 -0
- data/webpack/scenes/AnsibleCollections/Details/AnsibleCollectionDetailsActions.js +23 -0
- data/webpack/scenes/AnsibleCollections/Details/AnsibleCollectionDetailsConstants.js +3 -0
- data/webpack/scenes/AnsibleCollections/Details/AnsibleCollectionDetailsReducer.js +30 -0
- data/webpack/scenes/AnsibleCollections/Details/AnsibleCollectionsSchema.js +35 -0
- data/webpack/scenes/AnsibleCollections/Details/__tests__/AnsibleCollectionDetailInfo.test.js +16 -0
- data/webpack/scenes/AnsibleCollections/Details/__tests__/AnsibleCollectionDetails.fixtures.js +25 -0
- data/webpack/scenes/AnsibleCollections/Details/__tests__/AnsibleCollectionDetails.test.js +29 -0
- data/webpack/scenes/AnsibleCollections/Details/__tests__/AnsibleCollectionDetailsActions.test.js +41 -0
- data/webpack/scenes/AnsibleCollections/Details/__tests__/AnsibleCollectionDetailsReducer.test.js +33 -0
- data/webpack/scenes/AnsibleCollections/Details/__tests__/__snapshots__/AnsibleCollectionDetailInfo.test.js.snap +83 -0
- data/webpack/scenes/AnsibleCollections/Details/__tests__/__snapshots__/AnsibleCollectionDetails.test.js.snap +190 -0
- data/webpack/scenes/AnsibleCollections/Details/__tests__/__snapshots__/AnsibleCollectionDetailsActions.test.js.snap +54 -0
- data/webpack/scenes/AnsibleCollections/Details/__tests__/__snapshots__/AnsibleCollectionDetailsReducer.test.js.snap +50 -0
- data/webpack/scenes/AnsibleCollections/Details/index.js +17 -0
- data/webpack/scenes/AnsibleCollections/__tests__/AnsibleCollectionPage.test.js +25 -0
- data/webpack/scenes/AnsibleCollections/__tests__/AnsibleCollections.fixtures.js +52 -0
- data/webpack/scenes/AnsibleCollections/__tests__/AnsibleCollectionsActions.test.js +48 -0
- data/webpack/scenes/AnsibleCollections/__tests__/AnsibleCollectionsReducer.test.js +46 -0
- data/webpack/scenes/AnsibleCollections/__tests__/AnsibleCollectionsTable.test.js +27 -0
- data/webpack/scenes/AnsibleCollections/__tests__/__snapshots__/AnsibleCollectionPage.test.js.snap +73 -0
- data/webpack/scenes/AnsibleCollections/__tests__/__snapshots__/AnsibleCollectionsTable.test.js.snap +81 -0
- data/webpack/scenes/AnsibleCollections/index.js +17 -0
- data/webpack/scenes/ModuleStreams/Details/ModuleDetailsSchema.js +56 -0
- data/webpack/scenes/ModuleStreams/Details/ModuleStreamDetails.js +7 -71
- data/webpack/scenes/ModuleStreams/Details/ModuleStreamDetailsActions.js +9 -11
- data/webpack/scenes/ModuleStreams/Details/__tests__/ModuleStreamDetailInfo.test.js +5 -3
- data/webpack/scenes/ModuleStreams/Details/__tests__/__snapshots__/ModuleStreamDetails.test.js.snap +453 -507
- data/webpack/scenes/ModuleStreams/ModuleStreamsActions.js +10 -11
- data/webpack/scenes/ModuleStreams/ModuleStreamsPage.js +12 -33
- data/webpack/scenes/ModuleStreams/__tests__/ModuleStreamPage.test.js +2 -4
- data/webpack/scenes/ModuleStreams/__tests__/ModuleStreamsActions.test.js +8 -9
- data/webpack/scenes/ModuleStreams/__tests__/ModuleStreamsTable.test.js +5 -3
- data/webpack/scenes/ModuleStreams/__tests__/__snapshots__/ModuleStreamPage.test.js.snap +83 -65
- data/webpack/scenes/ModuleStreams/__tests__/__snapshots__/ModuleStreamsTable.test.js.snap +1 -1
- data/webpack/scenes/Organizations/OrganizationActions.js +27 -32
- data/webpack/scenes/Organizations/__tests__/OrganizationActions.test.js +12 -12
- data/webpack/scenes/Organizations/__tests__/organizations.fixtures.js +1 -1
- data/webpack/scenes/Products/ProductActions.js +10 -10
- data/webpack/scenes/Products/__tests__/ProductActions.test.js +6 -6
- data/webpack/scenes/RedHatRepositories/RedHatRepositoriesPage.js +118 -0
- data/webpack/scenes/RedHatRepositories/__tests__/RedHatRepositoriesPage.test.js +51 -0
- data/webpack/scenes/RedHatRepositories/__tests__/__snapshots__/RedHatRepositoriesPage.test.js.snap +117 -0
- data/webpack/scenes/RedHatRepositories/components/EnabledRepository/EnabledRepository.js +44 -45
- data/webpack/scenes/RedHatRepositories/components/EnabledRepository/__tests__/EnabledRepository.test.js +84 -5
- data/webpack/scenes/RedHatRepositories/components/RepositorySetRepository/RepositorySetRepository.js +46 -47
- data/webpack/scenes/RedHatRepositories/helpers.js +1 -1
- data/webpack/scenes/RedHatRepositories/index.js +2 -101
- data/webpack/scenes/Settings/Tables/TableActions.js +42 -43
- data/webpack/scenes/Settings/Tables/__tests__/TableActions.test.js +18 -18
- data/webpack/scenes/Subscriptions/Details/SubscriptionDetailActions.js +10 -10
- data/webpack/scenes/Subscriptions/Details/SubscriptionDetails.js +7 -6
- data/webpack/scenes/Subscriptions/Details/__tests__/SubscriptionDetailActions.test.js +8 -8
- data/webpack/scenes/Subscriptions/Details/__tests__/__snapshots__/SubscriptionDetails.test.js.snap +2 -2
- data/webpack/scenes/Subscriptions/Manifest/ManageManifestModal.js +142 -113
- data/webpack/scenes/Subscriptions/Manifest/Manifest.scss +8 -0
- data/webpack/scenes/Subscriptions/Manifest/ManifestActions.js +40 -40
- data/webpack/scenes/Subscriptions/Manifest/__tests__/ManifestActions.test.js +24 -24
- data/webpack/scenes/Subscriptions/Manifest/__tests__/__snapshots__/ManageManifestModal.test.js.snap +0 -199
- data/webpack/scenes/Subscriptions/SubscriptionActions.js +52 -46
- data/webpack/scenes/Subscriptions/SubscriptionReducer.js +21 -2
- data/webpack/scenes/Subscriptions/SubscriptionsPage.js +64 -42
- data/webpack/scenes/Subscriptions/SubscriptionsSelectors.js +3 -0
- data/webpack/scenes/Subscriptions/UpstreamSubscriptions/UpstreamSubscriptionsActions.js +21 -21
- data/webpack/scenes/Subscriptions/UpstreamSubscriptions/UpstreamSubscriptionsPage.js +20 -21
- data/webpack/scenes/Subscriptions/UpstreamSubscriptions/UpstreamSubscriptionsTableSchema.js +1 -15
- data/webpack/scenes/Subscriptions/UpstreamSubscriptions/__tests__/UpstreamSubscriptionsActions.test.js +12 -13
- data/webpack/scenes/Subscriptions/UpstreamSubscriptions/__tests__/__snapshots__/UpstreamSubscriptionsPage.test.js.snap +11 -14
- data/webpack/scenes/Subscriptions/__tests__/SubscriptionsActions.test.js +21 -23
- data/webpack/scenes/Subscriptions/__tests__/SubscriptionsPage.test.js +35 -1
- data/webpack/scenes/Subscriptions/__tests__/__snapshots__/SubscriptionsPage.test.js.snap +13 -0
- data/webpack/scenes/Subscriptions/__tests__/__snapshots__/SubscriptionsReducer.test.js.snap +7 -0
- data/webpack/scenes/Subscriptions/__tests__/subscriptions.fixtures.js +18 -0
- data/webpack/scenes/Subscriptions/components/SubscriptionsTable/SubscriptionsTable.js +5 -4
- data/webpack/scenes/Subscriptions/components/SubscriptionsTable/SubscriptionsTableHelpers.js +26 -5
- data/webpack/scenes/Subscriptions/components/SubscriptionsTable/SubscriptionsTableSchema.js +9 -1
- data/webpack/scenes/Subscriptions/components/SubscriptionsTable/__tests__/SubscriptionsTable.fixtures.js +27 -2
- data/webpack/scenes/Subscriptions/components/SubscriptionsTable/__tests__/SubscriptionsTableHelpers.test.js +5 -4
- data/webpack/scenes/Subscriptions/components/SubscriptionsTable/__tests__/__snapshots__/SubscriptionsTable.test.js.snap +1 -0
- data/webpack/scenes/Subscriptions/components/SubscriptionsTable/components/Dialogs/UpdateDialog.js +9 -9
- data/webpack/scenes/Subscriptions/components/SubscriptionsTable/components/Table.js +8 -3
- data/webpack/scenes/Subscriptions/components/SubscriptionsToolbar/SubscriptionsToolbar.js +28 -23
- data/webpack/scenes/Subscriptions/components/SubscriptionsToolbar/__snapshots__/SubscriptionsToolbar.test.js.snap +0 -135
- data/webpack/scenes/Subscriptions/index.js +2 -0
- data/webpack/scenes/Tasks/TaskActions.js +36 -31
- data/webpack/scenes/Tasks/__tests__/TaskActions.test.js +35 -47
- metadata +146 -67
- data/app/controllers/katello/api/v2/ping_controller.rb +0 -24
- data/app/lib/actions/katello/capsule_content/create_repos.rb +0 -30
- data/app/lib/actions/katello/capsule_content/remove_orphans.rb +0 -21
- data/app/lib/actions/pulp/repository/refresh_needed.rb +0 -37
- data/app/lib/katello/resources/candlepin/owner_info.rb +0 -18
- data/app/models/katello/glue/candlepin/owner_info.rb +0 -41
- data/app/models/katello/repository_file.rb +0 -7
- data/app/overrides/add_subscription_status.rb +0 -6
- data/app/views/overrides/hosts/_subscription_link.html.erb +0 -6
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-hosts/content-host-events.controller.js +0 -17
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-hosts/details/views/content-host-events.html +0 -30
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/subscriptions/content-access-mode-banner.directive.js +0 -22
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/subscriptions/details/subscription-details.controller.js +0 -58
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/subscriptions/details/subscription-product-details.controller.js +0 -12
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/subscriptions/details/subscription-products.controller.js +0 -30
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/subscriptions/details/views/subscription-details.html +0 -25
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/subscriptions/details/views/subscription-info.html +0 -120
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/subscriptions/details/views/subscription-products.html +0 -54
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/subscriptions/grouped.filter.js +0 -21
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/subscriptions/manifest/manifest-details.controller.js +0 -34
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/subscriptions/manifest/manifest-history.controller.js +0 -18
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/subscriptions/manifest/manifest-import.controller.js +0 -261
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/subscriptions/manifest/manifest.controller.js +0 -16
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/subscriptions/manifest/views/manifest-delete-modal.html +0 -19
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/subscriptions/manifest/views/manifest-details.html +0 -46
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/subscriptions/manifest/views/manifest-import-history.html +0 -17
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/subscriptions/manifest/views/manifest-import.html +0 -92
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/subscriptions/manifest/views/manifest.html +0 -33
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/subscriptions/subscription-start-date.directive.js +0 -21
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/subscriptions/subscription-type.directive.js +0 -16
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/subscriptions/subscriptionAttachAmountFilter.filter.js +0 -16
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/subscriptions/subscriptions.controller.js +0 -73
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/subscriptions/subscriptions.routes.js +0 -110
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/subscriptions/views/content-access-mode-banner.html +0 -5
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/subscriptions/views/subscription-start-date.html +0 -2
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/subscriptions/views/subscription-type.html +0 -18
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/subscriptions/views/subscriptions-delete-bulk.html +0 -4
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/subscriptions/views/subscriptions.html +0 -63
- data/webpack/scenes/ModuleStreams/Details/ModuleStreamDetailInfo.js +0 -52
- data/webpack/scenes/ModuleStreams/Details/Repositories/__tests__/ModuleStreamDetailRepositories.test.js +0 -16
@@ -1,6 +1,8 @@
|
|
1
1
|
import Immutable from 'seamless-immutable';
|
2
|
+
import { get } from 'lodash';
|
2
3
|
import { GET_SETTING_SUCCESS } from 'foremanReact/components/Settings/SettingsConstants';
|
3
4
|
import { initialApiState } from '../../services/api';
|
5
|
+
|
4
6
|
import { TASK_BULK_SEARCH_SUCCESS, RESET_TASKS, GET_TASK_SUCCESS } from '../Tasks/TaskConstants';
|
5
7
|
|
6
8
|
import {
|
@@ -58,11 +60,24 @@ export default (state = initialState, action) => {
|
|
58
60
|
.set('selectedTableColumns', action.payload.enabledColumns);
|
59
61
|
case SUBSCRIPTIONS_SUCCESS: {
|
60
62
|
const {
|
61
|
-
page,
|
63
|
+
page,
|
64
|
+
per_page, // eslint-disable-line camelcase
|
65
|
+
subtotal,
|
66
|
+
results,
|
67
|
+
can_import_manifest, // eslint-disable-line camelcase
|
68
|
+
can_delete_manifest, // eslint-disable-line camelcase
|
69
|
+
can_manage_subscription_allocations, // eslint-disable-line camelcase
|
70
|
+
can_edit_organizations, // eslint-disable-line camelcase
|
62
71
|
} = action.response;
|
63
72
|
|
64
73
|
return state.merge({
|
65
74
|
results,
|
75
|
+
activePermissions: {
|
76
|
+
can_import_manifest,
|
77
|
+
can_delete_manifest,
|
78
|
+
can_manage_subscription_allocations,
|
79
|
+
can_edit_organizations,
|
80
|
+
},
|
66
81
|
loading: false,
|
67
82
|
searchIsActive: !!action.search,
|
68
83
|
search: action.search,
|
@@ -85,7 +100,11 @@ export default (state = initialState, action) => {
|
|
85
100
|
return state
|
86
101
|
.set('loading', false)
|
87
102
|
.set('results', [])
|
88
|
-
.set('itemCount', 0)
|
103
|
+
.set('itemCount', 0)
|
104
|
+
.set(
|
105
|
+
'missingPermissions',
|
106
|
+
get(action, ['payload', 'messages', 0, 'missing_permissions']),
|
107
|
+
);
|
89
108
|
|
90
109
|
case UPDATE_QUANTITY_FAILURE:
|
91
110
|
case DELETE_SUBSCRIPTIONS_FAILURE:
|
@@ -2,9 +2,11 @@ import React, { Component } from 'react';
|
|
2
2
|
import PropTypes from 'prop-types';
|
3
3
|
import Immutable from 'seamless-immutable';
|
4
4
|
import { translate as __ } from 'foremanReact/common/I18n';
|
5
|
+
import { propsToCamelCase } from 'foremanReact/common/helpers';
|
5
6
|
import { isEmpty, isEqual } from 'lodash';
|
6
7
|
import { Grid, Row, Col } from 'patternfly-react';
|
7
8
|
import ModalProgressBar from 'foremanReact/components/common/ModalProgressBar';
|
9
|
+
import PermissionDenied from 'foremanReact/components/PermissionDenied';
|
8
10
|
import { renderTaskFinishedToast, renderTaskStartedToast } from '../Tasks/helpers';
|
9
11
|
import ManageManifestModal from './Manifest/';
|
10
12
|
import { SubscriptionsTable } from './components/SubscriptionsTable';
|
@@ -12,7 +14,6 @@ import SubscriptionsToolbar from './components/SubscriptionsToolbar';
|
|
12
14
|
import { manifestExists } from './SubscriptionHelpers';
|
13
15
|
import api, { orgId } from '../../services/api';
|
14
16
|
|
15
|
-
|
16
17
|
import { createSubscriptionParams } from './SubscriptionActions.js';
|
17
18
|
import {
|
18
19
|
BLOCKING_FOREMAN_TASK_TYPES,
|
@@ -23,17 +24,10 @@ import {
|
|
23
24
|
import './SubscriptionsPage.scss';
|
24
25
|
|
25
26
|
class SubscriptionsPage extends Component {
|
26
|
-
constructor(props) {
|
27
|
-
super(props);
|
28
|
-
|
29
|
-
this.uploadManifest = this.uploadManifest.bind(this);
|
30
|
-
this.deleteManifest = this.deleteManifest.bind(this);
|
31
|
-
this.refreshManifest = this.refreshManifest.bind(this);
|
32
|
-
}
|
33
|
-
|
34
27
|
componentDidMount() {
|
35
28
|
this.props.resetTasks();
|
36
29
|
this.props.loadSetting('content_disconnected');
|
30
|
+
this.props.loadSubscriptions();
|
37
31
|
}
|
38
32
|
|
39
33
|
componentDidUpdate(prevProps) {
|
@@ -100,7 +94,7 @@ class SubscriptionsPage extends Component {
|
|
100
94
|
return disabledReason;
|
101
95
|
}
|
102
96
|
|
103
|
-
pollTasks() {
|
97
|
+
async pollTasks() {
|
104
98
|
const { pollBulkSearch, organization } = this.props;
|
105
99
|
|
106
100
|
if (organization && organization.owner_details) {
|
@@ -113,51 +107,53 @@ class SubscriptionsPage extends Component {
|
|
113
107
|
|
114
108
|
this.props.loadSetting('content_disconnected');
|
115
109
|
this.props.loadSubscriptions();
|
116
|
-
this.props.loadTables()
|
117
|
-
|
118
|
-
|
119
|
-
});
|
110
|
+
await this.props.loadTables();
|
111
|
+
const { subscriptionTableSettings, loadTableColumns } = this.props;
|
112
|
+
loadTableColumns(subscriptionTableSettings);
|
120
113
|
}
|
121
114
|
|
122
|
-
handleDoneTask(taskToPoll) {
|
115
|
+
async handleDoneTask(taskToPoll) {
|
123
116
|
const POLL_TASK_INTERVAL = 5000;
|
124
117
|
const { pollTaskUntilDone, loadSubscriptions, organization } = this.props;
|
125
118
|
|
126
|
-
pollTaskUntilDone(taskToPoll.id, {}, POLL_TASK_INTERVAL, organization.id)
|
127
|
-
|
128
|
-
|
129
|
-
|
130
|
-
this.setState({ pollingATask: false });
|
131
|
-
});
|
119
|
+
const task = await pollTaskUntilDone(taskToPoll.id, {}, POLL_TASK_INTERVAL, organization.id);
|
120
|
+
renderTaskFinishedToast(task);
|
121
|
+
loadSubscriptions();
|
122
|
+
this.setState({ pollingATask: false });
|
132
123
|
}
|
133
124
|
|
134
|
-
|
135
|
-
|
136
|
-
|
137
|
-
openTaskModal();
|
138
|
-
|
125
|
+
startManifestTask = () => {
|
126
|
+
this.props.openTaskModal();
|
139
127
|
this.setState({
|
140
128
|
pollingATask: true,
|
141
129
|
});
|
142
|
-
callback(file)
|
143
|
-
.then(() => renderTaskStartedToast(this.props.taskDetails))
|
144
|
-
.then(() =>
|
145
|
-
setTimeout(() => this.props.bulkSearch({
|
146
|
-
action: `organization '${this.props.organization.owner_details.displayName}'`,
|
147
|
-
result: 'pending',
|
148
|
-
label: BLOCKING_FOREMAN_TASK_TYPES.join(' or '),
|
149
|
-
})), 100);
|
150
|
-
}
|
151
|
-
uploadManifest = (file) => {
|
152
|
-
this.manifestAction(this.props.uploadManifest, file);
|
153
130
|
};
|
154
131
|
|
155
|
-
|
156
|
-
|
132
|
+
cleanUpManifestTask = async () => {
|
133
|
+
await renderTaskStartedToast(this.props.taskDetails);
|
134
|
+
setTimeout(() => this.props.bulkSearch({
|
135
|
+
action: `organization '${this.props.organization.owner_details.displayName}'`,
|
136
|
+
result: 'pending',
|
137
|
+
label: BLOCKING_FOREMAN_TASK_TYPES.join(' or '),
|
138
|
+
}), 100);
|
139
|
+
};
|
140
|
+
|
141
|
+
uploadManifest = async (file) => {
|
142
|
+
this.startManifestTask();
|
143
|
+
await this.props.uploadManifest(file);
|
144
|
+
this.cleanUpManifestTask();
|
145
|
+
};
|
146
|
+
|
147
|
+
deleteManifest = async () => {
|
148
|
+
this.startManifestTask();
|
149
|
+
await this.props.deleteManifest();
|
150
|
+
this.cleanUpManifestTask();
|
157
151
|
};
|
158
152
|
|
159
|
-
refreshManifest = () => {
|
160
|
-
this.
|
153
|
+
refreshManifest = async () => {
|
154
|
+
this.startManifestTask();
|
155
|
+
await this.props.refreshManifest();
|
156
|
+
this.cleanUpManifestTask();
|
161
157
|
};
|
162
158
|
|
163
159
|
render() {
|
@@ -168,8 +164,20 @@ class SubscriptionsPage extends Component {
|
|
168
164
|
deleteButtonDisabled, disableDeleteButton, enableDeleteButton,
|
169
165
|
searchQuery, updateSearchQuery,
|
170
166
|
taskModalOpened,
|
171
|
-
tasks = [], subscriptions, organization, subscriptionTableSettings,
|
167
|
+
tasks = [], activePermissions, subscriptions, organization, subscriptionTableSettings,
|
172
168
|
} = this.props;
|
169
|
+
// Basic permissions - should we even show this page?
|
170
|
+
if (subscriptions.missingPermissions && subscriptions.missingPermissions.length > 0) {
|
171
|
+
return <PermissionDenied missingPermissions={subscriptions.missingPermissions} />;
|
172
|
+
}
|
173
|
+
// Granular permissions
|
174
|
+
const permissions = propsToCamelCase(activePermissions);
|
175
|
+
const {
|
176
|
+
canDeleteManifest,
|
177
|
+
canManageSubscriptionAllocations,
|
178
|
+
canImportManifest,
|
179
|
+
canEditOrganizations,
|
180
|
+
} = permissions;
|
173
181
|
const { disconnected } = subscriptions;
|
174
182
|
const taskInProgress = tasks.length > 0;
|
175
183
|
const disableManifestActions = taskInProgress || disconnected;
|
@@ -246,6 +254,7 @@ class SubscriptionsPage extends Component {
|
|
246
254
|
<h1>{__('Subscriptions')}</h1>
|
247
255
|
|
248
256
|
<SubscriptionsToolbar
|
257
|
+
canManageSubscriptionAllocations={canManageSubscriptionAllocations}
|
249
258
|
disableManifestActions={disableManifestActions}
|
250
259
|
disableManifestReason={this.getDisabledReason()}
|
251
260
|
disableDeleteButton={deleteButtonDisabled}
|
@@ -263,6 +272,9 @@ class SubscriptionsPage extends Component {
|
|
263
272
|
/>
|
264
273
|
|
265
274
|
<ManageManifestModal
|
275
|
+
canImportManifest={canImportManifest}
|
276
|
+
canDeleteManifest={canDeleteManifest}
|
277
|
+
canEditOrganizations={canEditOrganizations}
|
266
278
|
showModal={manifestModalOpened}
|
267
279
|
taskInProgress={taskInProgress}
|
268
280
|
disableManifestActions={disableManifestActions}
|
@@ -275,6 +287,7 @@ class SubscriptionsPage extends Component {
|
|
275
287
|
|
276
288
|
<div id="subscriptions-table" className="modal-container">
|
277
289
|
<SubscriptionsTable
|
290
|
+
canManageSubscriptionAllocations={canManageSubscriptionAllocations}
|
278
291
|
loadSubscriptions={this.props.loadSubscriptions}
|
279
292
|
tableColumns={columns}
|
280
293
|
updateQuantity={this.props.updateQuantity}
|
@@ -313,7 +326,12 @@ SubscriptionsPage.propTypes = {
|
|
313
326
|
disconnected: PropTypes.bool,
|
314
327
|
tableColumns: PropTypes.array,
|
315
328
|
selectedTableColumns: PropTypes.array,
|
329
|
+
missingPermissions: PropTypes.array,
|
316
330
|
}).isRequired,
|
331
|
+
activePermissions: PropTypes.shape({
|
332
|
+
can_delete_manifest: PropTypes.bool,
|
333
|
+
can_manage_subscription_allocations: PropTypes.bool,
|
334
|
+
}),
|
317
335
|
organization: PropTypes.shape({
|
318
336
|
id: PropTypes.number,
|
319
337
|
owner_details: PropTypes.shape({
|
@@ -358,6 +376,10 @@ SubscriptionsPage.defaultProps = {
|
|
358
376
|
taskModalOpened: false,
|
359
377
|
deleteButtonDisabled: true,
|
360
378
|
subscriptionTableSettings: {},
|
379
|
+
activePermissions: {
|
380
|
+
can_import_manifest: false,
|
381
|
+
can_manage_subscription_allocations: false,
|
382
|
+
},
|
361
383
|
};
|
362
384
|
|
363
385
|
export default SubscriptionsPage;
|
@@ -16,6 +16,9 @@ export const selectTaskModalOpened = state =>
|
|
16
16
|
export const selectDeleteButtonDisabled = state =>
|
17
17
|
selectSubscriptionsState(state).deleteButtonDisabled;
|
18
18
|
|
19
|
+
export const selectActivePermissions = state =>
|
20
|
+
selectSubscriptionsState(state).activePermissions;
|
21
|
+
|
19
22
|
export const selectSubscriptionsTasks = state =>
|
20
23
|
selectSubscriptionsState(state).tasks;
|
21
24
|
|
@@ -12,7 +12,7 @@ import {
|
|
12
12
|
SAVE_UPSTREAM_SUBSCRIPTIONS_FAILURE,
|
13
13
|
} from './UpstreamSubscriptionsContstants';
|
14
14
|
|
15
|
-
export const loadUpstreamSubscriptions = (extendedParams = {}) => (dispatch) => {
|
15
|
+
export const loadUpstreamSubscriptions = (extendedParams = {}) => async (dispatch) => {
|
16
16
|
dispatch({ type: UPSTREAM_SUBSCRIPTIONS_REQUEST });
|
17
17
|
|
18
18
|
const params = {
|
@@ -20,34 +20,34 @@ export const loadUpstreamSubscriptions = (extendedParams = {}) => (dispatch) =>
|
|
20
20
|
...propsToSnakeCase(extendedParams),
|
21
21
|
};
|
22
22
|
|
23
|
-
|
24
|
-
.get(`/organizations/${orgId()}/upstream_subscriptions`, {}, params)
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
23
|
+
try {
|
24
|
+
const { data } = await api.get(`/organizations/${orgId()}/upstream_subscriptions`, {}, params);
|
25
|
+
return dispatch({
|
26
|
+
type: UPSTREAM_SUBSCRIPTIONS_SUCCESS,
|
27
|
+
response: data,
|
28
|
+
search: extendedParams.search,
|
29
|
+
});
|
30
|
+
} catch (error) {
|
31
|
+
return dispatch(apiError(UPSTREAM_SUBSCRIPTIONS_FAILURE, error));
|
32
|
+
}
|
33
33
|
};
|
34
34
|
|
35
|
-
export const saveUpstreamSubscriptions = upstreamSubscriptions => (dispatch) => {
|
35
|
+
export const saveUpstreamSubscriptions = upstreamSubscriptions => async (dispatch) => {
|
36
36
|
dispatch({ type: SAVE_UPSTREAM_SUBSCRIPTIONS_REQUEST });
|
37
37
|
|
38
38
|
const params = {
|
39
39
|
...propsToSnakeCase(upstreamSubscriptions),
|
40
40
|
};
|
41
41
|
|
42
|
-
|
43
|
-
.post(`/organizations/${orgId()}/upstream_subscriptions`, params)
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
42
|
+
try {
|
43
|
+
const { data } = await api.post(`/organizations/${orgId()}/upstream_subscriptions`, params);
|
44
|
+
return dispatch({
|
45
|
+
type: SAVE_UPSTREAM_SUBSCRIPTIONS_SUCCESS,
|
46
|
+
response: data,
|
47
|
+
});
|
48
|
+
} catch (error) {
|
49
|
+
return dispatch(apiError(SAVE_UPSTREAM_SUBSCRIPTIONS_FAILURE, error));
|
50
|
+
}
|
51
51
|
};
|
52
52
|
|
53
53
|
export default loadUpstreamSubscriptions;
|
@@ -78,7 +78,6 @@ class UpstreamSubscriptionsPage extends Component {
|
|
78
78
|
);
|
79
79
|
}
|
80
80
|
|
81
|
-
|
82
81
|
quantityValidationInput = (pool) => {
|
83
82
|
if (!pool || pool.updatedQuantity === undefined) return null;
|
84
83
|
if (this.quantityValidation(pool)[0]) {
|
@@ -91,7 +90,7 @@ class UpstreamSubscriptionsPage extends Component {
|
|
91
90
|
this.state.selectedRows.length &&
|
92
91
|
this.state.selectedRows.every(pool => this.quantityValidation(pool)[0]);
|
93
92
|
|
94
|
-
saveUpstreamSubscriptions = () => {
|
93
|
+
saveUpstreamSubscriptions = async () => {
|
95
94
|
const updatedPools = _.map(
|
96
95
|
this.state.selectedRows,
|
97
96
|
pool => ({ ...pool, quantity: parseInt(pool.updatedQuantity, 10) }),
|
@@ -99,24 +98,23 @@ class UpstreamSubscriptionsPage extends Component {
|
|
99
98
|
|
100
99
|
const updatedSubscriptions = { pools: updatedPools };
|
101
100
|
|
102
|
-
this.props.saveUpstreamSubscriptions(updatedSubscriptions)
|
103
|
-
|
104
|
-
|
105
|
-
|
106
|
-
|
107
|
-
|
108
|
-
|
109
|
-
|
110
|
-
|
111
|
-
|
112
|
-
|
113
|
-
|
114
|
-
|
115
|
-
|
116
|
-
|
117
|
-
|
118
|
-
|
119
|
-
});
|
101
|
+
await this.props.saveUpstreamSubscriptions(updatedSubscriptions);
|
102
|
+
const { task } = this.props.upstreamSubscriptions;
|
103
|
+
|
104
|
+
// TODO: could probably factor this out into a task response component
|
105
|
+
if (task) {
|
106
|
+
const message = (
|
107
|
+
<span>
|
108
|
+
<span>{__('Subscriptions have been saved and are being updated. ')}</span>
|
109
|
+
<a href={urlBuilder('foreman_tasks/tasks', '', task.id)}>
|
110
|
+
{__('Click here to go to the tasks page for the task.')}
|
111
|
+
</a>
|
112
|
+
</span>
|
113
|
+
);
|
114
|
+
|
115
|
+
window.tfm.toastNotifications.notify({ message, type: 'success' });
|
116
|
+
this.props.history.push('/subscriptions');
|
117
|
+
}
|
120
118
|
};
|
121
119
|
|
122
120
|
loadData() {
|
@@ -134,6 +132,7 @@ class UpstreamSubscriptionsPage extends Component {
|
|
134
132
|
<Row>
|
135
133
|
<Col sm={12}>
|
136
134
|
<Button
|
135
|
+
style={{ marginTop: '10px', marginRight: '5px' }}
|
137
136
|
bsStyle="primary"
|
138
137
|
type="submit"
|
139
138
|
disabled={upstreamSubscriptions.loading ||
|
@@ -143,7 +142,7 @@ class UpstreamSubscriptionsPage extends Component {
|
|
143
142
|
{__('Submit')}
|
144
143
|
</Button>
|
145
144
|
|
146
|
-
<LinkContainer to="/subscriptions">
|
145
|
+
<LinkContainer to="/subscriptions" style={{ marginTop: '10px' }}>
|
147
146
|
<Button>
|
148
147
|
{__('Cancel')}
|
149
148
|
</Button>
|
@@ -4,23 +4,9 @@ import { translate as __ } from 'foremanReact/common/I18n';
|
|
4
4
|
import {
|
5
5
|
headerFormatter,
|
6
6
|
cellFormatter,
|
7
|
-
selectionHeaderCellFormatter,
|
8
|
-
selectionCellFormatter,
|
9
7
|
} from '../../../move_to_foreman/components/common/table';
|
10
8
|
|
11
|
-
export const columns =
|
12
|
-
{
|
13
|
-
property: 'select',
|
14
|
-
header: {
|
15
|
-
label: __('Select all rows'),
|
16
|
-
formatters: [label => selectionHeaderCellFormatter(selectionController, label)],
|
17
|
-
},
|
18
|
-
cell: {
|
19
|
-
formatters: [
|
20
|
-
(value, additionalData) => selectionCellFormatter(selectionController, additionalData),
|
21
|
-
],
|
22
|
-
},
|
23
|
-
},
|
9
|
+
export const columns = controller => [
|
24
10
|
{
|
25
11
|
property: 'id',
|
26
12
|
header: {
|
@@ -25,21 +25,20 @@ describe('upstream subscription actions', () => {
|
|
25
25
|
const url = '/katello/api/v2/organizations/1/upstream_subscriptions';
|
26
26
|
|
27
27
|
describe('creates UPSTREAM_SUBSCRIPTIONS_REQUEST', () => {
|
28
|
-
it('and then fails with 422', () => {
|
28
|
+
it('and then fails with 422', async () => {
|
29
29
|
mockErrorRequest({
|
30
30
|
url,
|
31
31
|
status: 422,
|
32
32
|
});
|
33
|
-
|
34
|
-
|
35
|
-
.then(() => expect(store.getActions()).toEqual(getFailureActions));
|
33
|
+
await store.dispatch(loadUpstreamSubscriptions());
|
34
|
+
expect(store.getActions()).toEqual(getFailureActions);
|
36
35
|
});
|
37
36
|
|
38
|
-
it('and ends with success', () => {
|
37
|
+
it('and ends with success', async () => {
|
39
38
|
mockApi.onGet(url).reply(200, requestSuccessResponse);
|
40
39
|
|
41
|
-
|
42
|
-
|
40
|
+
await store.dispatch(loadUpstreamSubscriptions());
|
41
|
+
expect(store.getActions()).toEqual(getSuccessActions);
|
43
42
|
});
|
44
43
|
});
|
45
44
|
|
@@ -48,22 +47,22 @@ describe('upstream subscription actions', () => {
|
|
48
47
|
pools: [{ id: 'abcde', quantity: 100 }],
|
49
48
|
};
|
50
49
|
|
51
|
-
it('and then fails with 422', () => {
|
50
|
+
it('and then fails with 422', async () => {
|
52
51
|
mockErrorRequest({
|
53
52
|
url,
|
54
53
|
status: 422,
|
55
54
|
method: 'POST',
|
56
55
|
});
|
57
56
|
|
58
|
-
|
59
|
-
|
57
|
+
await store.dispatch(saveUpstreamSubscriptions(subscriptionData));
|
58
|
+
expect(store.getActions()).toEqual(saveFailureActions);
|
60
59
|
});
|
61
60
|
|
62
|
-
it('and ends with success', () => {
|
61
|
+
it('and ends with success', async () => {
|
63
62
|
mockApi.onPost(url).reply(200, getTaskSuccessResponse);
|
64
63
|
|
65
|
-
|
66
|
-
|
64
|
+
await store.dispatch(saveUpstreamSubscriptions(subscriptionData));
|
65
|
+
expect(store.getActions()).toEqual(saveSuccessActions);
|
67
66
|
});
|
68
67
|
});
|
69
68
|
});
|