katello 3.16.2 → 3.17.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/stylesheets/katello/katello.scss +3 -7
- data/app/controllers/katello/api/rhsm/candlepin_proxies_controller.rb +1 -1
- data/app/controllers/katello/api/v2/activation_keys_controller.rb +8 -0
- data/app/controllers/katello/api/v2/host_subscriptions_controller.rb +10 -4
- data/app/controllers/katello/api/v2/host_tracer_controller.rb +33 -8
- data/app/controllers/katello/api/v2/hosts_bulk_actions_controller.rb +11 -11
- data/app/controllers/katello/api/v2/products_bulk_actions_controller.rb +0 -15
- data/app/controllers/katello/api/v2/repositories_controller.rb +5 -11
- data/app/controllers/katello/api/v2/upstream_subscriptions_controller.rb +16 -0
- data/app/controllers/katello/concerns/api/v2/bulk_hosts_extensions.rb +4 -4
- data/app/controllers/katello/concerns/api/v2/hostgroups_controller_extensions.rb +1 -1
- data/app/controllers/katello/concerns/hosts_controller_extensions.rb +5 -11
- data/app/helpers/katello/concerns/dashboard_helper_extensions.rb +10 -0
- data/app/helpers/katello/hosts_and_hostgroups_helper.rb +6 -7
- data/app/lib/actions/candlepin/product/content_add.rb +2 -1
- data/app/lib/actions/candlepin/product/content_update_enablement.rb +18 -0
- data/app/lib/actions/katello/applicability/hosts/bulk_generate.rb +2 -6
- data/app/lib/actions/katello/capsule_content/refresh_repos.rb +1 -1
- data/app/lib/actions/katello/capsule_content/sync.rb +1 -1
- data/app/lib/actions/katello/capsule_content/sync_capsule.rb +3 -17
- data/app/lib/actions/katello/content_view_version/incremental_update.rb +2 -3
- data/app/lib/actions/katello/organization/simple_content_access/disable.rb +17 -0
- data/app/lib/actions/katello/organization/simple_content_access/enable.rb +17 -0
- data/app/lib/actions/katello/organization/simple_content_access/toggle.rb +36 -0
- data/app/lib/actions/katello/orphan_cleanup/remove_orphans.rb +13 -0
- data/app/lib/actions/katello/product/content_create.rb +3 -3
- data/app/lib/actions/katello/product/destroy.rb +4 -25
- data/app/lib/actions/katello/repository/content_update.rb +41 -0
- data/app/lib/actions/katello/repository/destroy.rb +1 -5
- data/app/lib/actions/katello/repository/export.rb +1 -1
- data/app/lib/actions/katello/repository/multi_clone_contents.rb +15 -13
- data/app/lib/actions/katello/repository/sync.rb +25 -35
- data/app/lib/actions/katello/repository/update.rb +19 -30
- data/app/lib/actions/katello/repository/update_cv_repo_cert_guard.rb +17 -0
- data/app/lib/actions/pulp/orchestration/repository/smart_proxy_sync.rb +1 -0
- data/app/lib/actions/pulp/orchestration/repository/sync.rb +1 -2
- data/app/lib/actions/pulp/repository/sync.rb +1 -2
- data/app/lib/actions/pulp3/abstract_async_task.rb +0 -1
- data/app/lib/actions/pulp3/capsule_content/sync.rb +1 -3
- data/app/lib/actions/pulp3/content_view/delete_repository_references.rb +1 -1
- data/app/lib/actions/pulp3/orchestration/repository/copy_all_units.rb +2 -1
- data/app/lib/actions/pulp3/orchestration/repository/sync.rb +1 -3
- data/app/lib/actions/pulp3/repository/copy_content.rb +1 -0
- data/app/lib/actions/pulp3/repository/delete.rb +1 -1
- data/app/lib/actions/pulp3/repository/multi_copy_content.rb +1 -1
- data/app/lib/actions/pulp3/repository/save_version.rb +16 -20
- data/app/lib/actions/pulp3/repository/sync.rb +1 -1
- data/app/lib/actions/pulp3/repository/update_cv_repository_cert_guard.rb +2 -6
- data/app/lib/actions/pulp3/repository/upload_file.rb +1 -1
- data/app/lib/katello/resources/candlepin/product.rb +11 -0
- data/app/lib/katello/resources/cdn.rb +2 -3
- data/app/lib/katello/util/cdn_var_substitutor.rb +7 -9
- data/app/lib/katello/validators/hostgroup_kickstart_repository_validator.rb +11 -11
- data/app/models/katello/activation_key.rb +1 -1
- data/app/models/katello/concerns/content_facet_host_extensions.rb +7 -0
- data/app/models/katello/concerns/host_managed_extensions.rb +39 -0
- data/app/models/katello/concerns/hostgroup_extensions.rb +46 -24
- data/app/models/katello/concerns/smart_proxy_extensions.rb +5 -19
- data/app/models/katello/concerns/widget_extensions.rb +23 -0
- data/app/models/katello/content_view.rb +9 -1
- data/app/models/katello/content_view_package_filter.rb +1 -1
- data/app/models/katello/content_view_version.rb +7 -0
- data/app/models/katello/erratum.rb +13 -0
- data/app/models/katello/erratum_cve.rb +8 -0
- data/app/models/katello/glue/pulp/repo.rb +1 -1
- data/app/models/katello/host/content_facet.rb +18 -1
- data/app/models/katello/host_collection.rb +6 -0
- data/app/models/katello/hostgroup/content_facet.rb +18 -0
- data/app/models/katello/installed_package.rb +8 -0
- data/app/models/katello/kt_environment.rb +9 -1
- data/app/models/katello/model.rb +16 -0
- data/app/models/katello/pool.rb +17 -0
- data/app/models/katello/product.rb +6 -0
- data/app/models/katello/purpose_addons_status.rb +1 -0
- data/app/models/katello/purpose_role_status.rb +1 -0
- data/app/models/katello/purpose_sla_status.rb +1 -0
- data/app/models/katello/purpose_usage_status.rb +1 -0
- data/app/models/katello/repository.rb +3 -6
- data/app/models/katello/root_repository.rb +24 -16
- data/app/models/katello/subscription_status.rb +1 -1
- data/app/models/katello/trace_status.rb +1 -1
- data/app/models/setting/content.rb +6 -2
- data/app/services/cert/certs.rb +2 -10
- data/app/services/katello/event_daemon.rb +7 -8
- data/app/services/katello/host_status_manager.rb +13 -0
- data/app/services/katello/pulp3/migration.rb +1 -1
- data/app/services/katello/pulp3/repository/yum.rb +6 -72
- data/app/services/katello/pulp3/repository.rb +11 -10
- data/app/services/katello/pulp3/smart_proxy_mirror_repository.rb +1 -1
- data/app/services/katello/pulp3/task.rb +3 -3
- data/app/services/katello/pulp3/task_group.rb +0 -6
- data/app/services/katello/smart_proxy_helper.rb +16 -13
- data/app/views/foreman/smart_proxies/_content_sync.html.erb +1 -1
- data/app/views/katello/api/v2/repositories/base.json.rabl +1 -1
- data/config/routes/api/rhsm.rb +0 -1
- data/config/routes/api/v2.rb +8 -2
- data/config/routes/overrides.rb +0 -4
- data/db/migrate/20141222151001_add_host_content_view_environment.rb +1 -1
- data/db/migrate/20180904122343_create_hostgroup_content_facet.katello.rb +16 -0
- data/db/migrate/20200514092553_move_katello_fields_from_hostgroups.katello.rb +53 -0
- data/db/migrate/20200610112009_remove_audits_of_root_repo_with_content_id.rb +9 -0
- data/db/migrate/20200701150946_add_auto_enabled_to_root_repository.rb +5 -0
- data/db/seeds.d/75-job_templates.rb +2 -2
- data/engines/bastion/app/assets/javascripts/bastion/components/nutupane.factory.js +3 -1
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/activation-keys/details/activation-key-associations.controller.js +5 -2
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/activation-keys/details/activation-key-details.controller.js +4 -2
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/activation-keys/details/views/activation-key-add-subscriptions.html +1 -1
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/activation-keys/details/views/activation-key-associations-content-hosts.html +2 -2
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/activation-keys/details/views/activation-key-details.html +1 -1
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-hosts/bulk/content-hosts-bulk-errata-modal.controller.js +4 -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/content-hosts-bulk-subscriptions-modal.controller.js +1 -0
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-hosts/bulk/content-hosts-bulk-traces-modal.controller.js +4 -3
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-hosts/bulk/views/content-hosts-bulk-environment-modal.html +7 -1
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-hosts/bulk/views/content-hosts-bulk-errata-modal.html +1 -0
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-hosts/bulk/views/content-hosts-bulk-packages-modal.html +1 -0
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-hosts/content-hosts.controller.js +4 -2
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-hosts/content-hosts.routes.js +1 -1
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-hosts/details/content-host-details-info.controller.js +7 -1
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-hosts/details/content-host-details.controller.js +4 -2
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-hosts/details/views/content-host-add-subscriptions.html +1 -1
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-hosts/details/views/content-host-details.html +1 -0
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-hosts/details/views/content-host-info.html +14 -6
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-hosts/details/views/content-host-subscriptions-list.html +1 -1
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-hosts/views/content-hosts.html +6 -6
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/host-collections/details/host-collection-details.controller.js +5 -2
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/host-collections/details/views/host-collection-info.html +1 -1
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/hosts/host-bulk-action.factory.js +1 -2
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/hosts/host-traces-resolve.factory.js +18 -0
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/i18n/bastion_katello.pot +45 -4
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/i18n/locale/de.po +1 -1
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/i18n/locale/es.po +1 -1
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/i18n/locale/fr.po +1 -1
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/i18n/locale/it.po +1 -1
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/i18n/locale/ja.po +1 -1
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/i18n/locale/ko.po +1 -1
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/i18n/locale/pt_BR.po +1 -1
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/i18n/locale/ru.po +1 -1
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/i18n/locale/zh_CN.po +1 -1
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/i18n/locale/zh_TW.po +1 -1
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/products/bulk/product-bulk-action.factory.js +0 -1
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/products/details/repositories/details/repository-details.controller.js +0 -6
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/products/details/repositories/details/views/repository-details.html +1 -7
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/products/details/repositories/details/views/repository-info.html +11 -1
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/products/details/repositories/new/new-repository.controller.js +1 -1
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/products/details/repositories/new/views/new-repository.html +16 -4
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/products/details/repositories/repository.factory.js +0 -1
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/products/products.controller.js +0 -15
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/products/views/products.html +0 -6
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/subscriptions/views/content-access-mode-banner.html +1 -1
- data/lib/katello/engine.rb +6 -5
- data/lib/katello/permission_creator.rb +3 -3
- data/lib/katello/permissions/host_permissions.rb +0 -1
- data/lib/katello/plugin.rb +20 -16
- data/lib/katello/tasks/pulp3_post_migration_check.rake +1 -2
- data/lib/katello/tasks/reimport.rake +1 -1
- data/lib/katello/tasks/reports.rake +0 -12
- data/lib/katello/tasks/test.rake +15 -0
- data/lib/katello/version.rb +1 -1
- data/locale/action_names.rb +48 -48
- data/locale/bn/katello.po +137 -14
- data/locale/cs/katello.po +137 -14
- data/locale/de/katello.po +138 -15
- data/locale/en/katello.po +137 -14
- data/locale/es/katello.po +138 -15
- data/locale/fr/katello.po +138 -15
- data/locale/gu/katello.po +137 -14
- data/locale/hi/katello.po +137 -14
- data/locale/it/katello.po +138 -15
- data/locale/ja/katello.po +138 -15
- data/locale/katello.pot +969 -769
- data/locale/kn/katello.po +137 -14
- data/locale/ko/katello.po +138 -15
- data/locale/mr/katello.po +137 -14
- data/locale/or/katello.po +137 -14
- data/locale/pa/katello.po +137 -14
- data/locale/pt/katello.po +137 -14
- data/locale/pt_BR/katello.po +138 -15
- data/locale/ru/katello.po +138 -15
- data/locale/ta/katello.po +137 -14
- data/locale/te/katello.po +137 -14
- data/locale/zh_CN/katello.po +138 -15
- data/locale/zh_TW/katello.po +138 -15
- data/package.json +8 -25
- data/webpack/__mocks__/foremanReact/Root/Context/ForemanContext.js +3 -0
- data/webpack/components/ActionableDetail.js +63 -0
- data/webpack/components/Content/ContentTable.js +2 -2
- data/webpack/components/Content/Details/ContentDetailRepositoryTableSchema.js +1 -1
- data/webpack/components/Content/Details/ContentDetails.js +1 -1
- data/webpack/components/Content/__tests__/ContentTable.test.js +2 -2
- data/webpack/components/Content/__tests__/__snapshots__/ContentPage.test.js.snap +1 -1
- data/webpack/components/EditableSwitch.js +30 -0
- data/webpack/components/EditableTextInput/EditableTextInput.js +120 -0
- data/webpack/components/EditableTextInput/__tests__/editableTextInput.test.js +52 -0
- data/webpack/components/EditableTextInput/editableTextInput.scss +14 -0
- data/webpack/components/EditableTextInput/index.js +3 -0
- data/webpack/{scenes/ContentViews/components → components}/Loading.js +8 -5
- data/webpack/{move_to_pf → components}/LoadingState/LoadingState.js +0 -0
- data/webpack/{move_to_pf → components}/LoadingState/LoadingState.scss +0 -0
- data/webpack/{move_to_pf → components}/LoadingState/LoadingState.test.js +0 -0
- data/webpack/{move_to_pf → components}/LoadingState/__snapshots__/LoadingState.test.js.snap +0 -0
- data/webpack/{move_to_pf → components}/LoadingState/index.js +0 -0
- data/webpack/components/MultiSelect/index.js +1 -1
- data/webpack/{move_to_pf → components}/OptionTooltip/OptionTooltip.scss +0 -0
- data/webpack/{move_to_pf → components}/OptionTooltip/__tests__/OptionTooltip.test.js +0 -0
- data/webpack/{move_to_pf → components}/OptionTooltip/__tests__/__snapshots__/OptionTooltip.test.js.snap +0 -0
- data/webpack/{move_to_pf → components}/OptionTooltip/index.js +0 -0
- data/webpack/components/Search/Search.js +124 -0
- data/webpack/components/Search/Search.test.js +2 -1
- data/webpack/components/Search/__snapshots__/Search.test.js.snap +2 -0
- data/webpack/components/Search/__tests__/search.test.js +124 -0
- data/webpack/components/Search/index.js +11 -87
- data/webpack/{move_to_pf → components}/Select/Select.js +0 -0
- data/webpack/components/SelectOrg/SetOrganization.js +2 -2
- data/webpack/components/TabWrapper/TabWrapper.js +26 -0
- data/webpack/components/TabWrapper/index.js +3 -0
- data/webpack/components/TabbedView/TabbedView.js +38 -0
- data/webpack/components/TabbedView/TabbedView.scss +3 -0
- data/webpack/components/TabbedView/index.js +3 -0
- data/webpack/components/Table/EmptyStateMessage.js +61 -0
- data/webpack/{scenes/ContentViews/Table/TableWrapper.js → components/Table/MainTable.js} +23 -12
- data/webpack/components/Table/TableWrapper.js +94 -0
- data/webpack/{move_to_pf → components}/TooltipButton/TooltipButton.js +0 -0
- data/webpack/{move_to_pf → components}/TooltipButton/TooltipButton.scss +0 -0
- data/webpack/{move_to_pf → components}/TooltipButton/TooltipButton.test.js +0 -0
- data/webpack/{move_to_pf → components}/TooltipButton/__snapshots__/TooltipButton.test.js.snap +0 -0
- data/webpack/{move_to_pf → components}/TooltipButton/index.js +0 -0
- data/webpack/components/TypeAhead/TypeAhead.js +109 -0
- data/webpack/{move_to_pf → components}/TypeAhead/TypeAhead.scss +0 -0
- data/webpack/components/TypeAhead/helpers/commonPropTypes.js +35 -0
- data/webpack/components/TypeAhead/helpers/helpers.js +32 -0
- data/webpack/components/TypeAhead/index.js +3 -0
- data/webpack/{move_to_pf/TypeAhead → components/TypeAhead/pf3Search}/TypeAheadInput.js +3 -6
- data/webpack/{move_to_pf/TypeAhead → components/TypeAhead/pf3Search}/TypeAheadItems.js +3 -7
- data/webpack/components/TypeAhead/pf3Search/TypeAheadSearch.js +52 -0
- data/webpack/components/TypeAhead/pf4Search/TypeAheadInput.js +44 -0
- data/webpack/components/TypeAhead/pf4Search/TypeAheadInput.scss +11 -0
- data/webpack/components/TypeAhead/pf4Search/TypeAheadItems.js +57 -0
- data/webpack/components/TypeAhead/pf4Search/TypeAheadSearch.js +66 -0
- data/webpack/components/TypeAhead/pf4Search/TypeAheadSearch.scss +5 -0
- data/webpack/components/extensions/about/__tests__/SystemStatuses.test.js +1 -1
- data/webpack/{move_to_foreman/components/common/table → components/pf3Table}/components/CollapseSubscriptionGroupButton.js +0 -0
- data/webpack/{move_to_foreman/components/common/table → components/pf3Table}/components/CollapseSubscriptionGroupButton.test.js +0 -0
- data/webpack/{move_to_foreman/components/common/table → components/pf3Table}/components/Table.js +0 -0
- data/webpack/{move_to_foreman/components/common/table → components/pf3Table}/components/Table.test.js +0 -0
- data/webpack/{move_to_foreman/components/common/table → components/pf3Table}/components/TableBody.js +0 -0
- data/webpack/{move_to_foreman/components/common/table → components/pf3Table}/components/TableBody.test.js +0 -0
- data/webpack/{move_to_foreman/components/common/table → components/pf3Table}/components/TableBodyMessage.js +0 -0
- data/webpack/{move_to_foreman/components/common/table → components/pf3Table}/components/TableBodyMessage.test.js +0 -0
- data/webpack/{move_to_foreman/components/common/table → components/pf3Table}/components/TableFixtures.js +0 -0
- data/webpack/{move_to_foreman/components/common/table → components/pf3Table}/components/TableSelectionCell.js +0 -0
- data/webpack/{move_to_foreman/components/common/table → components/pf3Table}/components/TableSelectionCell.test.js +0 -0
- data/webpack/{move_to_foreman/components/common/table → components/pf3Table}/components/TableSelectionHeaderCell.js +0 -0
- data/webpack/{move_to_foreman/components/common/table → components/pf3Table}/components/TableSelectionHeaderCell.test.js +0 -0
- data/webpack/{move_to_foreman/components/common/table → components/pf3Table}/components/__snapshots__/CollapseSubscriptionGroupButton.test.js.snap +0 -0
- data/webpack/{move_to_foreman/components/common/table → components/pf3Table}/components/__snapshots__/Table.test.js.snap +0 -0
- data/webpack/{move_to_foreman/components/common/table → components/pf3Table}/components/__snapshots__/TableBody.test.js.snap +0 -0
- data/webpack/{move_to_foreman/components/common/table → components/pf3Table}/components/__snapshots__/TableBodyMessage.test.js.snap +0 -0
- data/webpack/{move_to_foreman/components/common/table → components/pf3Table}/components/__snapshots__/TableSelectionCell.test.js.snap +0 -0
- data/webpack/{move_to_foreman/components/common/table → components/pf3Table}/components/__snapshots__/TableSelectionHeaderCell.test.js.snap +0 -0
- data/webpack/{move_to_foreman/components/common/table → components/pf3Table}/components/index.js +0 -0
- data/webpack/{move_to_foreman/components/common/table → components/pf3Table}/formatters/EntitlementsInlineEditFormatter.js +1 -1
- data/webpack/{move_to_foreman/components/common/table → components/pf3Table}/formatters/__tests__/EntitlementsInlineEditFormatter.test.js +0 -0
- data/webpack/{move_to_foreman/components/common/table → components/pf3Table}/formatters/__tests__/__snapshots__/EntitlementsInlineEditFormatter.test.js.snap +0 -0
- data/webpack/{move_to_foreman/components/common/table → components/pf3Table}/formatters/cellFormatter.js +0 -0
- data/webpack/{move_to_foreman/components/common/table → components/pf3Table}/formatters/collapseableAndSelectionCellFormatter.js +0 -0
- data/webpack/{move_to_foreman/components/common/table → components/pf3Table}/formatters/ellipsisCellFormatter.js +0 -0
- data/webpack/{move_to_foreman/components/common/table → components/pf3Table}/formatters/headerFormatter.js +0 -0
- data/webpack/{move_to_foreman/components/common/table → components/pf3Table}/formatters/index.js +0 -0
- data/webpack/{move_to_foreman/components/common/table → components/pf3Table}/formatters/selectionCellFormatter.js +0 -0
- data/webpack/{move_to_foreman/components/common/table → components/pf3Table}/formatters/selectionHeaderCellFormatter.js +0 -0
- data/webpack/{move_to_foreman/components/common/table → components/pf3Table}/index.js +0 -0
- data/webpack/{move_to_pf → components}/react-bootstrap-select/index.js +0 -0
- data/webpack/containers/Application/config.js +5 -0
- data/webpack/containers/Application/overrides.scss +5 -0
- data/webpack/global_test_setup.js +3 -1
- data/webpack/redux/OrganizationProducts/OrganizationProductsActions.js +1 -1
- data/webpack/redux/OrganizationProducts/__tests__/OrganizationProductsActions.test.js +2 -2
- data/webpack/redux/actions/RedHatRepositories/enabled.js +1 -1
- data/webpack/redux/actions/RedHatRepositories/helpers.js +1 -1
- data/webpack/redux/actions/RedHatRepositories/repositorySetRepositories.js +1 -1
- data/webpack/redux/reducers/index.js +2 -0
- data/webpack/scenes/AnsibleCollections/AnsibleCollectionsActions.js +1 -1
- data/webpack/scenes/AnsibleCollections/AnsibleCollectionsTableSchema.js +1 -1
- data/webpack/scenes/AnsibleCollections/Details/AnsibleCollectionDetailsActions.js +1 -1
- data/webpack/scenes/AnsibleCollections/Details/__tests__/AnsibleCollectionDetailsActions.test.js +2 -2
- data/webpack/scenes/AnsibleCollections/__tests__/AnsibleCollectionsTable.test.js +1 -1
- data/webpack/scenes/ContentViews/ContentViewSelectors.js +1 -2
- data/webpack/scenes/ContentViews/ContentViewsActions.js +4 -4
- data/webpack/scenes/ContentViews/ContentViewsConstants.js +4 -1
- data/webpack/scenes/ContentViews/ContentViewsPage.js +12 -6
- data/webpack/scenes/ContentViews/Details/ContentViewDetailActions.js +44 -0
- data/webpack/scenes/ContentViews/Details/ContentViewDetailReducer.js +23 -0
- data/webpack/scenes/ContentViews/{details → Details}/ContentViewDetailSelectors.js +3 -0
- data/webpack/scenes/ContentViews/Details/ContentViewDetails.js +70 -0
- data/webpack/scenes/ContentViews/Details/ContentViewInfo.js +116 -0
- data/webpack/scenes/ContentViews/{details → Details}/DetailsContainer.js +8 -4
- data/webpack/scenes/ContentViews/Details/__tests__/contentViewDetail.test.js +101 -0
- data/webpack/scenes/ContentViews/Details/__tests__/contentViewDetails.fixtures.json +106 -0
- data/webpack/scenes/ContentViews/Details/contentViewInfo.scss +8 -0
- data/webpack/scenes/ContentViews/Details/index.js +7 -0
- data/webpack/scenes/ContentViews/Table/ContentViewsTable.js +51 -36
- data/webpack/scenes/ContentViews/Table/tableDataGenerator.js +47 -44
- data/webpack/scenes/ContentViews/__tests__/basicContentViews.fixtures.js +31 -0
- data/webpack/scenes/ContentViews/__tests__/contentViewList.fixtures.json +2 -1
- data/webpack/scenes/ContentViews/__tests__/contentViewPage.test.js +173 -23
- data/webpack/scenes/ContentViews/components/ContentViewIcon.js +26 -0
- data/webpack/scenes/ContentViews/components/{contentViewName.scss → contentViewIcon.scss} +0 -0
- data/webpack/scenes/ModuleStreams/Details/ModuleStreamDetailsActions.js +1 -1
- data/webpack/scenes/ModuleStreams/Details/Profiles/TableSchema.js +1 -1
- data/webpack/scenes/ModuleStreams/Details/__tests__/ModuleStreamDetailsActions.test.js +2 -2
- data/webpack/scenes/ModuleStreams/ModuleStreamsActions.js +1 -1
- data/webpack/scenes/ModuleStreams/ModuleStreamsTableSchema.js +1 -1
- data/webpack/scenes/ModuleStreams/__tests__/ModuleStreamsTable.test.js +1 -1
- data/webpack/scenes/Organizations/OrganizationSelectors.js +14 -0
- data/webpack/scenes/Products/ProductActions.js +1 -1
- data/webpack/scenes/RedHatRepositories/RedHatRepositoriesPage.js +1 -1
- data/webpack/scenes/Settings/SettingsConstants.js +3 -0
- data/webpack/scenes/Settings/SettingsReducer.js +33 -0
- data/webpack/scenes/Settings/SettingsSelectors.js +4 -0
- data/webpack/scenes/Settings/index.js +2 -1
- data/webpack/scenes/Subscriptions/Details/SubscriptionDetailActions.js +1 -1
- data/webpack/scenes/Subscriptions/Details/SubscriptionDetails.js +1 -1
- data/webpack/scenes/Subscriptions/Manifest/ManageManifestModal.js +59 -73
- data/webpack/scenes/Subscriptions/Manifest/ManageManifestModal.scss +15 -0
- data/webpack/scenes/Subscriptions/Manifest/ManifestActions.js +43 -1
- data/webpack/scenes/Subscriptions/Manifest/ManifestConstants.js +8 -0
- data/webpack/scenes/Subscriptions/Manifest/ManifestHistoryTableSchema.js +1 -1
- data/webpack/scenes/Subscriptions/Manifest/SimpleContentAccess.js +78 -0
- data/webpack/scenes/Subscriptions/Manifest/__tests__/ManageManifestModal.test.js +2 -0
- data/webpack/scenes/Subscriptions/Manifest/__tests__/ManifestActions.test.js +56 -1
- data/webpack/scenes/Subscriptions/Manifest/__tests__/SimpleContentAccess.test.js +114 -0
- data/webpack/scenes/Subscriptions/Manifest/__tests__/__snapshots__/ManageManifestModal.test.js.snap +6 -6
- data/webpack/scenes/Subscriptions/Manifest/__tests__/manifest.fixtures.js +36 -0
- data/webpack/scenes/Subscriptions/Manifest/index.js +3 -1
- data/webpack/scenes/Subscriptions/SubscriptionActions.js +1 -1
- data/webpack/scenes/Subscriptions/SubscriptionConstants.js +4 -0
- data/webpack/scenes/Subscriptions/SubscriptionHelpers.js +0 -3
- data/webpack/scenes/Subscriptions/SubscriptionReducer.js +38 -11
- data/webpack/scenes/Subscriptions/SubscriptionsPage.js +30 -18
- data/webpack/scenes/Subscriptions/SubscriptionsSelectors.js +0 -3
- data/webpack/scenes/Subscriptions/UpstreamSubscriptions/UpstreamSubscriptionsActions.js +1 -1
- data/webpack/scenes/Subscriptions/UpstreamSubscriptions/UpstreamSubscriptionsPage.js +2 -2
- data/webpack/scenes/Subscriptions/UpstreamSubscriptions/UpstreamSubscriptionsTableSchema.js +1 -1
- data/webpack/scenes/Subscriptions/__tests__/SubscriptionHelpers.test.js +0 -11
- data/webpack/scenes/Subscriptions/__tests__/__snapshots__/SubscriptionsActions.test.js.snap +2 -2
- data/webpack/scenes/Subscriptions/__tests__/__snapshots__/SubscriptionsPage.test.js.snap +4 -4
- data/webpack/scenes/Subscriptions/__tests__/__snapshots__/SubscriptionsReducer.test.js.snap +26 -1
- data/webpack/scenes/Subscriptions/components/SubscriptionsTable/SubscriptionTypeFormatter.js +2 -2
- data/webpack/scenes/Subscriptions/components/SubscriptionsTable/SubscriptionsTable.js +27 -21
- data/webpack/scenes/Subscriptions/components/SubscriptionsTable/SubscriptionsTableHelpers.js +6 -2
- data/webpack/scenes/Subscriptions/components/SubscriptionsTable/SubscriptionsTableSchema.js +2 -2
- data/webpack/scenes/Subscriptions/components/SubscriptionsTable/__tests__/__snapshots__/SubscriptionTypeFormatter.test.js.snap +3 -3
- data/webpack/scenes/Subscriptions/components/SubscriptionsTable/components/Table.js +1 -1
- data/webpack/scenes/Subscriptions/components/SubscriptionsToolbar/SubscriptionsToolbar.js +28 -3
- data/webpack/scenes/Subscriptions/components/SubscriptionsToolbar/__snapshots__/SubscriptionsToolbar.test.js.snap +5 -10
- data/webpack/scenes/Subscriptions/index.js +6 -2
- data/webpack/test-utils/nockWrapper.js +39 -5
- data/webpack/test-utils/react-testing-lib-wrapper.js +35 -9
- data/webpack/{move_to_foreman/common → utils}/helpers.js +12 -8
- data/webpack/utils/useEventListener.js +37 -0
- metadata +143 -83
- data/app/lib/actions/katello/repository/verify_checksum.rb +0 -28
- data/app/lib/actions/pulp3/orchestration/repository/trigger_update_repo_cert_guard.rb +0 -22
- data/app/lib/actions/pulp3/repository/presenters/repair_presenter.rb +0 -85
- data/app/lib/actions/pulp3/repository/repair.rb +0 -29
- data/app/services/katello/host_trace_manager.rb +0 -38
- data/vendor/assets/stylesheets/katello/jquery.loadmask.css.scss +0 -40
- data/vendor/assets/stylesheets/katello/ui.spinner.css.scss +0 -3
- data/webpack/__mocks__/foremanReact/components/ForemanModal/ForemanModalActions.js +0 -2
- data/webpack/__mocks__/foremanReact/components/ForemanModal/ForemanModalSelectors.js +0 -2
- data/webpack/__mocks__/foremanReact/components/ForemanModal/index.js +0 -4
- data/webpack/__mocks__/foremanReact/components/Settings/SettingsActions.js +0 -4
- data/webpack/__mocks__/foremanReact/components/Settings/SettingsConstants.js +0 -2
- data/webpack/move_to_pf/TypeAhead/TypeAhead.js +0 -138
- data/webpack/move_to_pf/TypeAhead/helpers.js +0 -5
- data/webpack/scenes/ContentViews/components/ContentViewName.js +0 -33
- data/webpack/scenes/ContentViews/components/EmptyStateMessage.js +0 -43
- data/webpack/scenes/ContentViews/details/ContentViewDetailActions.js +0 -12
- data/webpack/scenes/ContentViews/expansions/RepositoriesExpansion.js +0 -12
@@ -0,0 +1,57 @@
|
|
1
|
+
import React from 'react';
|
2
|
+
import {
|
3
|
+
Dropdown,
|
4
|
+
DropdownItem,
|
5
|
+
DropdownSeparator,
|
6
|
+
} from '@patternfly/react-core';
|
7
|
+
import PropTypes from 'prop-types';
|
8
|
+
|
9
|
+
import { commonItemPropTypes } from '../helpers/commonPropTypes';
|
10
|
+
|
11
|
+
const TypeAheadItems = ({
|
12
|
+
isOpen, items, activeItems, getItemProps, highlightedIndex,
|
13
|
+
}) => {
|
14
|
+
const buildDropdownItems = () => items.map(({ text, type, disabled = false }, index) => {
|
15
|
+
const key = `${text}${index}`;
|
16
|
+
if (type === 'divider') return (<DropdownSeparator key={key} />);
|
17
|
+
const isHovered = activeItems[highlightedIndex] === text;
|
18
|
+
const itemProps = getItemProps({
|
19
|
+
index: activeItems.indexOf(text),
|
20
|
+
item: text,
|
21
|
+
key,
|
22
|
+
isHovered,
|
23
|
+
disabled,
|
24
|
+
});
|
25
|
+
const { onClick, ...dropdownProps } = itemProps;
|
26
|
+
return (
|
27
|
+
<DropdownItem
|
28
|
+
{...dropdownProps}
|
29
|
+
component={
|
30
|
+
<button onClick={onClick}>{text}</button>
|
31
|
+
}
|
32
|
+
/>
|
33
|
+
);
|
34
|
+
});
|
35
|
+
|
36
|
+
// toggle prop is required but since it is not manually toggled, React.Fragment is used to
|
37
|
+
// satisfy the requirement
|
38
|
+
return (
|
39
|
+
<Dropdown
|
40
|
+
toggle={<React.Fragment />}
|
41
|
+
isOpen={isOpen}
|
42
|
+
dropdownItems={buildDropdownItems()}
|
43
|
+
className="typeahead-dropdown"
|
44
|
+
/>
|
45
|
+
);
|
46
|
+
};
|
47
|
+
|
48
|
+
TypeAheadItems.propTypes = {
|
49
|
+
...commonItemPropTypes,
|
50
|
+
isOpen: PropTypes.bool,
|
51
|
+
};
|
52
|
+
|
53
|
+
TypeAheadItems.defaultProps = {
|
54
|
+
isOpen: false,
|
55
|
+
};
|
56
|
+
|
57
|
+
export default TypeAheadItems;
|
@@ -0,0 +1,66 @@
|
|
1
|
+
import React from 'react';
|
2
|
+
import { InputGroup, Button } from '@patternfly/react-core';
|
3
|
+
import { TimesIcon, SearchIcon } from '@patternfly/react-icons';
|
4
|
+
import PropTypes from 'prop-types';
|
5
|
+
|
6
|
+
import keyPressHandler from '../helpers/helpers';
|
7
|
+
import TypeAheadInput from './TypeAheadInput';
|
8
|
+
import TypeAheadItems from './TypeAheadItems';
|
9
|
+
import commonSearchPropTypes from '../helpers/commonPropTypes';
|
10
|
+
import './TypeAheadSearch.scss';
|
11
|
+
|
12
|
+
const TypeAheadSearch = ({
|
13
|
+
userInputValue, clearSearch, getInputProps, getItemProps, isOpen, inputValue, highlightedIndex,
|
14
|
+
selectedItem, selectItem, openMenu, onSearch, items, activeItems, shouldShowItems,
|
15
|
+
autoSearchEnabled,
|
16
|
+
}) => (
|
17
|
+
<React.Fragment>
|
18
|
+
<InputGroup>
|
19
|
+
<TypeAheadInput
|
20
|
+
onKeyPress={
|
21
|
+
(e) => {
|
22
|
+
keyPressHandler(
|
23
|
+
e,
|
24
|
+
isOpen,
|
25
|
+
activeItems,
|
26
|
+
highlightedIndex,
|
27
|
+
selectItem,
|
28
|
+
userInputValue,
|
29
|
+
onSearch,
|
30
|
+
);
|
31
|
+
}
|
32
|
+
}
|
33
|
+
onInputFocus={openMenu}
|
34
|
+
passedProps={getInputProps()}
|
35
|
+
autoSearchEnabled={autoSearchEnabled}
|
36
|
+
/>
|
37
|
+
<React.Fragment>
|
38
|
+
{userInputValue &&
|
39
|
+
<Button
|
40
|
+
variant={autoSearchEnabled ? 'plain' : 'control'}
|
41
|
+
className="foreman-pf4-search-clear"
|
42
|
+
onClick={clearSearch}
|
43
|
+
>
|
44
|
+
<TimesIcon />
|
45
|
+
</Button>}
|
46
|
+
</React.Fragment>
|
47
|
+
{!autoSearchEnabled &&
|
48
|
+
<Button aria-label="search button" variant="control" onClick={() => onSearch(inputValue)}>
|
49
|
+
<SearchIcon />
|
50
|
+
</Button>}
|
51
|
+
</InputGroup>
|
52
|
+
<TypeAheadItems
|
53
|
+
isOpen={shouldShowItems}
|
54
|
+
{...{
|
55
|
+
items, highlightedIndex, selectedItem, getItemProps, activeItems,
|
56
|
+
}}
|
57
|
+
/>
|
58
|
+
</React.Fragment>
|
59
|
+
);
|
60
|
+
|
61
|
+
TypeAheadSearch.propTypes = {
|
62
|
+
autoSearchEnabled: PropTypes.bool.isRequired,
|
63
|
+
...commonSearchPropTypes,
|
64
|
+
};
|
65
|
+
|
66
|
+
export default TypeAheadSearch;
|
@@ -3,7 +3,7 @@ import { testComponentSnapshotsWithFixtures } from 'react-redux-test-utils';
|
|
3
3
|
import SystemStatuses from '../SystemStatuses';
|
4
4
|
import { withServices, pending } from './SystemStatuses.fixtures';
|
5
5
|
|
6
|
-
jest.unmock('../../../../
|
6
|
+
jest.unmock('../../../../components/LoadingState');
|
7
7
|
|
8
8
|
const fixtures = {
|
9
9
|
'renders a table': withServices,
|
File without changes
|
File without changes
|
data/webpack/{move_to_foreman/components/common/table → components/pf3Table}/components/Table.js
RENAMED
File without changes
|
File without changes
|
data/webpack/{move_to_foreman/components/common/table → components/pf3Table}/components/TableBody.js
RENAMED
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
data/webpack/{move_to_foreman/components/common/table → components/pf3Table}/components/index.js
RENAMED
File without changes
|
@@ -2,7 +2,7 @@ import React from 'react';
|
|
2
2
|
import { sprintf, translate as __ } from 'foremanReact/common/I18n';
|
3
3
|
import { KEYCODES } from 'foremanReact/common/keyCodes';
|
4
4
|
import { Table, FormControl, FormGroup, HelpBlock, Spinner } from 'patternfly-react';
|
5
|
-
import { validateQuantity } from '
|
5
|
+
import { validateQuantity } from '../../../scenes/Subscriptions/SubscriptionValidations';
|
6
6
|
|
7
7
|
const renderValue = (value, additionalData, onActivate) => {
|
8
8
|
const { available, upstream_pool_id: upstreamPoolId, collapsible } = additionalData.rowData;
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
data/webpack/{move_to_foreman/components/common/table → components/pf3Table}/formatters/index.js
RENAMED
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
@@ -10,6 +10,7 @@ import ModuleStreamDetails from '../../scenes/ModuleStreams/Details';
|
|
10
10
|
import AnsibleCollections from '../../scenes/AnsibleCollections';
|
11
11
|
import AnsibleCollectionDetails from '../../scenes/AnsibleCollections/Details';
|
12
12
|
import ContentViews from '../../scenes/ContentViews';
|
13
|
+
import ContentViewDetails from '../../scenes/ContentViews/Details';
|
13
14
|
import withHeader from './withHeaders';
|
14
15
|
|
15
16
|
// eslint-disable-next-line import/prefer-default-export
|
@@ -55,4 +56,8 @@ export const links = [
|
|
55
56
|
path: 'labs/content_views',
|
56
57
|
component: withHeader(ContentViews, { title: __('Content Views') }),
|
57
58
|
},
|
59
|
+
{
|
60
|
+
path: 'labs/content_views/:id([0-9]+)',
|
61
|
+
component: withHeader(ContentViewDetails, { title: __('Content View Details') }),
|
62
|
+
},
|
58
63
|
];
|
@@ -34,6 +34,11 @@ td, th {
|
|
34
34
|
}
|
35
35
|
}
|
36
36
|
|
37
|
+
// Patternfly 4's Grid doesn't add margin at the top and bottom
|
38
|
+
.grid-with-margin {
|
39
|
+
margin: 20px 4px;
|
40
|
+
}
|
41
|
+
|
37
42
|
// needed to ensure correct spacing between buttons and the button
|
38
43
|
// container
|
39
44
|
.toolbar-pf .form-group {
|
@@ -1,7 +1,9 @@
|
|
1
1
|
// runs before each test to make sure console.error output will
|
2
2
|
// fail a test (i.e. default PropType missing). Check the error
|
3
3
|
// output and traceback for actual error.
|
4
|
-
global.console.error = (error) => {
|
4
|
+
global.console.error = (error, stack) => {
|
5
|
+
/* eslint-disable-next-line no-console */
|
6
|
+
if (stack) console.log(stack); // Prints out original stack trace
|
5
7
|
throw new Error(error);
|
6
8
|
};
|
7
9
|
|
@@ -5,7 +5,7 @@ import {
|
|
5
5
|
ORGANIZATION_PRODUCTS_SUCCESS,
|
6
6
|
ORGANIZATION_PRODUCTS_FAILURE,
|
7
7
|
} from './OrganizationProductsConstants';
|
8
|
-
import { apiError } from '../../
|
8
|
+
import { apiError } from '../../utils/helpers';
|
9
9
|
|
10
10
|
export const loadOrganizationProducts = (params = {}, orgId = getOrgId()) => async (dispatch) => {
|
11
11
|
dispatch({ type: ORGANIZATION_PRODUCTS_REQUEST });
|
@@ -1,6 +1,6 @@
|
|
1
1
|
import { testActionSnapshotWithFixtures } from 'react-redux-test-utils';
|
2
2
|
import api, { orgId } from '../../../services/api';
|
3
|
-
import { apiError } from '../../../
|
3
|
+
import { apiError } from '../../../utils/helpers';
|
4
4
|
|
5
5
|
import { loadOrganizationProducts } from '../OrganizationProductsActions';
|
6
6
|
|
@@ -9,7 +9,7 @@ const params = {
|
|
9
9
|
};
|
10
10
|
|
11
11
|
jest.mock('../../../services/api');
|
12
|
-
jest.mock('../../../
|
12
|
+
jest.mock('../../../utils/helpers');
|
13
13
|
|
14
14
|
const fixtures = {
|
15
15
|
'should load organization products and success': () => async (dispatch) => {
|
@@ -7,7 +7,7 @@ import {
|
|
7
7
|
productsIdsToSearchQuery,
|
8
8
|
joinSearchQueries,
|
9
9
|
} from './helpers';
|
10
|
-
import { apiError, apiSuccess } from '../../../
|
10
|
+
import { apiError, apiSuccess } from '../../../utils/helpers.js';
|
11
11
|
|
12
12
|
import {
|
13
13
|
ENABLED_REPOSITORIES_REQUEST,
|
@@ -35,7 +35,7 @@ const recommendedRepositoriesSatTools = [
|
|
35
35
|
const recommendedRepositoriesMisc = [
|
36
36
|
'rhel-server-rhscl-7-rpms',
|
37
37
|
'rhel-7-server-satellite-capsule-6.8-rpms',
|
38
|
-
'rhel-7-server-ansible-2.
|
38
|
+
'rhel-7-server-ansible-2.8-rpms',
|
39
39
|
];
|
40
40
|
|
41
41
|
const recommendedRepositorySetLables = recommendedRepositoriesRHEL
|
@@ -1,6 +1,6 @@
|
|
1
1
|
import PropTypes from 'prop-types';
|
2
2
|
import api from '../../../services/api';
|
3
|
-
import { apiError, apiSuccess } from '../../../
|
3
|
+
import { apiError, apiSuccess } from '../../../utils/helpers.js';
|
4
4
|
import { getArchFromPath } from './helpers.js';
|
5
5
|
|
6
6
|
import {
|
@@ -13,6 +13,7 @@ import { moduleStreamDetails } from '../../scenes/ModuleStreams/Details';
|
|
13
13
|
import { reducers as systemStatuses } from '../../components/extensions/about';
|
14
14
|
import { ansibleCollections } from '../../scenes/AnsibleCollections';
|
15
15
|
import { ansibleCollectionDetails } from '../../scenes/AnsibleCollections/Details';
|
16
|
+
import { contentViewDetails } from '../../scenes/ContentViews/Details';
|
16
17
|
|
17
18
|
export default combineReducers({
|
18
19
|
organization,
|
@@ -27,6 +28,7 @@ export default combineReducers({
|
|
27
28
|
moduleStreamDetails,
|
28
29
|
ansibleCollections,
|
29
30
|
ansibleCollectionDetails,
|
31
|
+
contentViewDetails,
|
30
32
|
...organizationProductsReducers,
|
31
33
|
...systemStatuses,
|
32
34
|
});
|
@@ -6,7 +6,7 @@ import {
|
|
6
6
|
ANSIBLE_COLLECTIONS_SUCCESS,
|
7
7
|
ANSIBLE_COLLECTIONS_ERROR,
|
8
8
|
} from './AnsibleCollectionsConstants';
|
9
|
-
import { apiError } from '../../
|
9
|
+
import { apiError } from '../../utils/helpers';
|
10
10
|
|
11
11
|
export const getAnsibleCollections = (extendedParams = {}) => async (dispatch) => {
|
12
12
|
dispatch({ type: ANSIBLE_COLLECTIONS_REQUEST });
|
@@ -4,7 +4,7 @@ import {
|
|
4
4
|
ANSIBLE_COLLECTION_DETAILS_REQUEST,
|
5
5
|
ANSIBLE_COLLECTION_DETAILS_SUCCESS,
|
6
6
|
} from './AnsibleCollectionDetailsConstants';
|
7
|
-
import { apiError } from '../../../
|
7
|
+
import { apiError } from '../../../utils/helpers';
|
8
8
|
|
9
9
|
export const getAnsibleCollectionDetails = ansibleCollectionId => async (dispatch) => {
|
10
10
|
dispatch({ type: ANSIBLE_COLLECTION_DETAILS_REQUEST });
|
data/webpack/scenes/AnsibleCollections/Details/__tests__/AnsibleCollectionDetailsActions.test.js
CHANGED
@@ -1,11 +1,11 @@
|
|
1
1
|
import { testActionSnapshotWithFixtures } from 'react-redux-test-utils';
|
2
2
|
import api from '../../../../services/api';
|
3
|
-
import { apiError } from '../../../../
|
3
|
+
import { apiError } from '../../../../utils/helpers';
|
4
4
|
import { getAnsibleCollectionDetails } from '../AnsibleCollectionDetailsActions';
|
5
5
|
import { details } from './AnsibleCollectionDetails.fixtures';
|
6
6
|
|
7
7
|
jest.mock('../../../../services/api');
|
8
|
-
jest.mock('../../../../
|
8
|
+
jest.mock('../../../../utils/helpers');
|
9
9
|
|
10
10
|
const fixtures = {
|
11
11
|
'should load ansible collection details on success': () => async (dispatch) => {
|
@@ -3,7 +3,7 @@ import { shallow } from 'enzyme';
|
|
3
3
|
import toJson from 'enzyme-to-json';
|
4
4
|
import ContentTable from '../../../components/Content/ContentTable';
|
5
5
|
import TableSchema from '../../AnsibleCollections/AnsibleCollectionsTableSchema';
|
6
|
-
import { Table } from '../../../
|
6
|
+
import { Table } from '../../../components/pf3Table';
|
7
7
|
|
8
8
|
jest.mock('foremanReact/components/Pagination/PaginationWrapper', () => (<div>Pagination Mock</div>));
|
9
9
|
|
@@ -5,8 +5,7 @@ import {
|
|
5
5
|
} from 'foremanReact/redux/API/APISelectors';
|
6
6
|
import CONTENT_VIEWS_KEY from './ContentViewsConstants';
|
7
7
|
|
8
|
-
export const selectContentViews = state =>
|
9
|
-
selectAPIResponse(state, CONTENT_VIEWS_KEY).results || [];
|
8
|
+
export const selectContentViews = state => selectAPIResponse(state, CONTENT_VIEWS_KEY) || {};
|
10
9
|
|
11
10
|
export const selectContentViewStatus = state => selectAPIStatus(state, CONTENT_VIEWS_KEY);
|
12
11
|
|
@@ -2,17 +2,17 @@ import { API_OPERATIONS, get } from 'foremanReact/redux/API';
|
|
2
2
|
import api, { orgId } from '../../services/api';
|
3
3
|
import CONTENT_VIEWS_KEY from './ContentViewsConstants';
|
4
4
|
|
5
|
-
|
6
|
-
const createContentViewsParams = () => ({
|
5
|
+
export const createContentViewsParams = extraParams => ({
|
7
6
|
organization_id: orgId(),
|
8
7
|
nondefault: true,
|
8
|
+
...extraParams,
|
9
9
|
});
|
10
10
|
|
11
|
-
const getContentViews =
|
11
|
+
const getContentViews = extraParams => get({
|
12
12
|
type: API_OPERATIONS.GET,
|
13
13
|
key: CONTENT_VIEWS_KEY,
|
14
14
|
url: api.getApiUrl('/content_views'),
|
15
|
-
params: createContentViewsParams(),
|
15
|
+
params: createContentViewsParams(extraParams),
|
16
16
|
});
|
17
17
|
|
18
18
|
export default getContentViews;
|
@@ -1,3 +1,6 @@
|
|
1
|
-
const CONTENT_VIEWS_KEY = '
|
1
|
+
const CONTENT_VIEWS_KEY = 'CONTENT_VIEWS';
|
2
|
+
export const UPDATE_CONTENT_VIEW = 'UPDATE_CONTENT_VIEW';
|
3
|
+
export const UPDATE_CONTENT_VIEW_SUCCESS = 'UPDATE_CONTENT_VIEW_SUCCESS';
|
4
|
+
export const UPDATE_CONTENT_VIEW_FAILURE = 'UPDATE_CONTENT_VIEW_FAILURE';
|
2
5
|
|
3
6
|
export default CONTENT_VIEWS_KEY;
|
@@ -1,15 +1,15 @@
|
|
1
1
|
import React, { useEffect } from 'react';
|
2
2
|
import { translate as __ } from 'foremanReact/common/I18n';
|
3
3
|
import { useSelector, useDispatch } from 'react-redux';
|
4
|
+
import { Grid, GridItem, TextContent, Text, TextVariants } from '@patternfly/react-core';
|
4
5
|
import getContentViews from './ContentViewsActions';
|
5
6
|
import { selectContentViews,
|
6
7
|
selectContentViewStatus,
|
7
8
|
selectContentViewError } from './ContentViewSelectors';
|
8
|
-
|
9
9
|
import ContentViewsTable from './Table/ContentViewsTable';
|
10
10
|
|
11
11
|
const ContentViewsPage = () => {
|
12
|
-
const
|
12
|
+
const response = useSelector(selectContentViews);
|
13
13
|
const status = useSelector(selectContentViewStatus);
|
14
14
|
const error = useSelector(selectContentViewError);
|
15
15
|
|
@@ -20,10 +20,16 @@ const ContentViewsPage = () => {
|
|
20
20
|
}, []);
|
21
21
|
|
22
22
|
return (
|
23
|
-
<
|
24
|
-
<
|
25
|
-
|
26
|
-
|
23
|
+
<Grid className="grid-with-margin">
|
24
|
+
<GridItem span={12}>
|
25
|
+
<TextContent>
|
26
|
+
<Text component={TextVariants.h1}>{__('Content Views')}</Text>
|
27
|
+
</TextContent>
|
28
|
+
</GridItem>
|
29
|
+
<GridItem span={12}>
|
30
|
+
<ContentViewsTable {...{ response, status, error }} />
|
31
|
+
</GridItem>
|
32
|
+
</Grid>
|
27
33
|
);
|
28
34
|
};
|
29
35
|
|
@@ -0,0 +1,44 @@
|
|
1
|
+
import { API_OPERATIONS, get, put } from 'foremanReact/redux/API';
|
2
|
+
import { addToast } from 'foremanReact/redux/actions/toasts';
|
3
|
+
import { translate as __ } from 'foremanReact/common/I18n';
|
4
|
+
|
5
|
+
import CONTENT_VIEWS_KEY, {
|
6
|
+
UPDATE_CONTENT_VIEW,
|
7
|
+
UPDATE_CONTENT_VIEW_FAILURE,
|
8
|
+
UPDATE_CONTENT_VIEW_SUCCESS,
|
9
|
+
} from '../ContentViewsConstants';
|
10
|
+
import api from '../../../services/api';
|
11
|
+
|
12
|
+
import { apiError } from '../../../utils/helpers';
|
13
|
+
|
14
|
+
const getContentViewDetails = cvId => get({
|
15
|
+
type: API_OPERATIONS.GET,
|
16
|
+
key: `${CONTENT_VIEWS_KEY}_${cvId}`,
|
17
|
+
url: api.getApiUrl(`/content_views/${cvId}`),
|
18
|
+
});
|
19
|
+
|
20
|
+
const cvUpdateSuccess = (response, dispatch) => {
|
21
|
+
const { data: { id } } = response;
|
22
|
+
// Update CV info in redux with the updated CV info from API
|
23
|
+
dispatch(getContentViewDetails(id));
|
24
|
+
return dispatch(addToast({
|
25
|
+
type: 'success',
|
26
|
+
message: __(' Content view updated.'),
|
27
|
+
}));
|
28
|
+
};
|
29
|
+
|
30
|
+
export const updateContentView = (cvId, params) => async dispatch => dispatch(put({
|
31
|
+
type: API_OPERATIONS.PUT,
|
32
|
+
key: `${CONTENT_VIEWS_KEY}_${cvId}`,
|
33
|
+
url: api.getApiUrl(`/content_views/${cvId}`),
|
34
|
+
params,
|
35
|
+
handleSuccess: response => cvUpdateSuccess(response, dispatch),
|
36
|
+
handleError: error => dispatch(apiError(null, error)),
|
37
|
+
actionTypes: {
|
38
|
+
REQUEST: UPDATE_CONTENT_VIEW,
|
39
|
+
SUCCESS: UPDATE_CONTENT_VIEW_SUCCESS,
|
40
|
+
FAILURE: UPDATE_CONTENT_VIEW_FAILURE,
|
41
|
+
},
|
42
|
+
}));
|
43
|
+
|
44
|
+
export default getContentViewDetails;
|
@@ -0,0 +1,23 @@
|
|
1
|
+
import Immutable from 'seamless-immutable';
|
2
|
+
import {
|
3
|
+
UPDATE_CONTENT_VIEW,
|
4
|
+
UPDATE_CONTENT_VIEW_FAILURE,
|
5
|
+
UPDATE_CONTENT_VIEW_SUCCESS,
|
6
|
+
} from '../ContentViewsConstants';
|
7
|
+
|
8
|
+
const initialState = Immutable({
|
9
|
+
updating: false,
|
10
|
+
});
|
11
|
+
|
12
|
+
export default (state = initialState, action) => {
|
13
|
+
switch (action.type) {
|
14
|
+
case UPDATE_CONTENT_VIEW:
|
15
|
+
return state.set('updating', true);
|
16
|
+
case UPDATE_CONTENT_VIEW_SUCCESS:
|
17
|
+
return state.merge({ updating: false });
|
18
|
+
case UPDATE_CONTENT_VIEW_FAILURE:
|
19
|
+
return state.set('updating', false);
|
20
|
+
default:
|
21
|
+
return state;
|
22
|
+
}
|
23
|
+
};
|
@@ -0,0 +1,70 @@
|
|
1
|
+
import React from 'react';
|
2
|
+
import { useSelector, shallowEqual } from 'react-redux';
|
3
|
+
import { Grid, GridItem, TextContent, Text, TextVariants } from '@patternfly/react-core';
|
4
|
+
import { translate as __ } from 'foremanReact/common/I18n';
|
5
|
+
import PropTypes from 'prop-types';
|
6
|
+
|
7
|
+
import DetailsContainer from './DetailsContainer';
|
8
|
+
import ContentViewInfo from './ContentViewInfo';
|
9
|
+
import { selectCVDetails } from './ContentViewDetailSelectors';
|
10
|
+
import TabbedView from '../../../components/TabbedView';
|
11
|
+
|
12
|
+
const ContentViewDetails = ({ match }) => {
|
13
|
+
const cvId = parseInt(match.params.id, 10);
|
14
|
+
const details = useSelector(state => selectCVDetails(state, cvId), shallowEqual);
|
15
|
+
|
16
|
+
const { name } = details;
|
17
|
+
const tabs = [
|
18
|
+
{
|
19
|
+
title: __('Details'),
|
20
|
+
content: <ContentViewInfo {...{ cvId, details }} />,
|
21
|
+
},
|
22
|
+
{
|
23
|
+
title: __('Versions'),
|
24
|
+
content: <React.Fragment>Versions</React.Fragment>,
|
25
|
+
},
|
26
|
+
{
|
27
|
+
title: __('Repositories'),
|
28
|
+
content: <React.Fragment>Repositories</React.Fragment>,
|
29
|
+
},
|
30
|
+
{
|
31
|
+
title: __('Filters'),
|
32
|
+
content: <React.Fragment>Filters</React.Fragment>,
|
33
|
+
},
|
34
|
+
{
|
35
|
+
title: __('History'),
|
36
|
+
content: <React.Fragment>History</React.Fragment>,
|
37
|
+
},
|
38
|
+
{
|
39
|
+
title: __('Tasks'),
|
40
|
+
content: <React.Fragment>Tasks</React.Fragment>,
|
41
|
+
},
|
42
|
+
];
|
43
|
+
|
44
|
+
return (
|
45
|
+
<Grid className="grid-with-margin">
|
46
|
+
<DetailsContainer cvId={cvId}>
|
47
|
+
<React.Fragment>
|
48
|
+
<GridItem span={12}>
|
49
|
+
<TextContent>
|
50
|
+
<Text component={TextVariants.h1}>{`${name} content view`}</Text>
|
51
|
+
</TextContent>
|
52
|
+
</GridItem>
|
53
|
+
<GridItem span={12}>
|
54
|
+
<TabbedView tabs={tabs} />
|
55
|
+
</GridItem>
|
56
|
+
</React.Fragment>
|
57
|
+
</DetailsContainer>
|
58
|
+
</Grid>
|
59
|
+
);
|
60
|
+
};
|
61
|
+
|
62
|
+
ContentViewDetails.propTypes = {
|
63
|
+
match: PropTypes.shape({
|
64
|
+
params: PropTypes.shape({
|
65
|
+
id: PropTypes.oneOfType([PropTypes.string, PropTypes.number]),
|
66
|
+
}),
|
67
|
+
}).isRequired,
|
68
|
+
};
|
69
|
+
|
70
|
+
export default ContentViewDetails;
|