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,116 @@
|
|
1
|
+
import React from 'react';
|
2
|
+
import { useDispatch, useSelector } from 'react-redux';
|
3
|
+
import {
|
4
|
+
Flex,
|
5
|
+
FlexItem,
|
6
|
+
TextContent,
|
7
|
+
TextList,
|
8
|
+
TextListVariants,
|
9
|
+
TextListItem,
|
10
|
+
TextListItemVariants,
|
11
|
+
} from '@patternfly/react-core';
|
12
|
+
import PropTypes from 'prop-types';
|
13
|
+
import { translate as __ } from 'foremanReact/common/I18n';
|
14
|
+
|
15
|
+
import { updateContentView } from './ContentViewDetailActions';
|
16
|
+
import { selectIsCVUpdating } from './ContentViewDetailSelectors';
|
17
|
+
import Loading from '../../../components/Loading';
|
18
|
+
import ContentViewIcon from '../components/ContentViewIcon';
|
19
|
+
import ActionableDetail from '../../../components/ActionableDetail';
|
20
|
+
import './contentViewInfo.scss';
|
21
|
+
|
22
|
+
const ContentViewInfo = ({ cvId, details }) => {
|
23
|
+
const dispatch = useDispatch();
|
24
|
+
const updating = useSelector(state => selectIsCVUpdating(state));
|
25
|
+
const {
|
26
|
+
name,
|
27
|
+
label,
|
28
|
+
description,
|
29
|
+
composite,
|
30
|
+
solve_dependencies: solveDependencies,
|
31
|
+
auto_publish: autoPublish,
|
32
|
+
} = details;
|
33
|
+
|
34
|
+
const autoPublishTooltip = __('Applicable only for composite views. Auto publish composite ' +
|
35
|
+
'view when a new version of a component content view is created. Also note auto publish will ' +
|
36
|
+
'only happen when the component is marked "latest".');
|
37
|
+
|
38
|
+
const solveDependenciesTooltip = __('This option will solve RPM and Module Stream dependencies ' +
|
39
|
+
'on every publish of this Content View. Dependency solving significantly increases publish ' +
|
40
|
+
'time (publishes can take over three times as long) and filters will be ignored when adding ' +
|
41
|
+
'packages to solve dependencies. Also, certain scenarios involving errata may still cause ' +
|
42
|
+
'dependency errors.');
|
43
|
+
|
44
|
+
|
45
|
+
if (updating) return <Loading size="sm" showText={false} />;
|
46
|
+
const onEdit = (val, attribute) => dispatch(updateContentView(cvId, { [attribute]: val }));
|
47
|
+
return (
|
48
|
+
<TextContent>
|
49
|
+
<TextList component={TextListVariants.dl}>
|
50
|
+
<ActionableDetail
|
51
|
+
label={__('Name')}
|
52
|
+
attribute="name"
|
53
|
+
onEdit={onEdit}
|
54
|
+
value={name}
|
55
|
+
/>
|
56
|
+
<TextListItem component={TextListItemVariants.dt}>
|
57
|
+
{__('Label')}
|
58
|
+
</TextListItem>
|
59
|
+
<TextListItem
|
60
|
+
aria-label="label text value"
|
61
|
+
component={TextListItemVariants.dd}
|
62
|
+
className="foreman-spaced-list"
|
63
|
+
>
|
64
|
+
{label}
|
65
|
+
</TextListItem>
|
66
|
+
<TextListItem component={TextListItemVariants.dt}>
|
67
|
+
{__('Type')}
|
68
|
+
</TextListItem>
|
69
|
+
<TextListItem component={TextListItemVariants.dd} className="foreman-spaced-list">
|
70
|
+
<Flex>
|
71
|
+
<FlexItem spacer={{ default: 'spacerXs' }}><ContentViewIcon composite={composite} /></FlexItem>
|
72
|
+
<FlexItem>{ composite ? 'Composite' : 'Component' }</FlexItem>
|
73
|
+
</Flex>
|
74
|
+
</TextListItem>
|
75
|
+
<ActionableDetail
|
76
|
+
textArea
|
77
|
+
label={__('Description')}
|
78
|
+
attribute="description"
|
79
|
+
onEdit={onEdit}
|
80
|
+
value={description}
|
81
|
+
/>
|
82
|
+
{composite ?
|
83
|
+
(<ActionableDetail
|
84
|
+
label={__('Autopublish')}
|
85
|
+
attribute="auto_publish"
|
86
|
+
value={autoPublish}
|
87
|
+
onEdit={onEdit}
|
88
|
+
tooltip={autoPublishTooltip}
|
89
|
+
boolean
|
90
|
+
/>) :
|
91
|
+
(<ActionableDetail
|
92
|
+
label={__('Solve dependencies')}
|
93
|
+
attribute="solve_dependencies"
|
94
|
+
value={solveDependencies}
|
95
|
+
onEdit={onEdit}
|
96
|
+
tooltip={solveDependenciesTooltip}
|
97
|
+
boolean
|
98
|
+
/>)}
|
99
|
+
</TextList>
|
100
|
+
</TextContent>
|
101
|
+
);
|
102
|
+
};
|
103
|
+
|
104
|
+
ContentViewInfo.propTypes = {
|
105
|
+
cvId: PropTypes.number.isRequired,
|
106
|
+
details: PropTypes.shape({
|
107
|
+
name: PropTypes.string,
|
108
|
+
label: PropTypes.string,
|
109
|
+
description: PropTypes.string,
|
110
|
+
composite: PropTypes.bool,
|
111
|
+
solve_dependencies: PropTypes.bool,
|
112
|
+
auto_publish: PropTypes.bool,
|
113
|
+
}).isRequired,
|
114
|
+
};
|
115
|
+
|
116
|
+
export default ContentViewInfo;
|
@@ -2,8 +2,8 @@ import React, { useEffect } from 'react';
|
|
2
2
|
import { useDispatch, useSelector, shallowEqual } from 'react-redux';
|
3
3
|
import PropTypes from 'prop-types';
|
4
4
|
import { STATUS } from 'foremanReact/constants';
|
5
|
-
import EmptyStateMessage from '
|
6
|
-
import Loading from '
|
5
|
+
import EmptyStateMessage from '../../../components/Table/EmptyStateMessage';
|
6
|
+
import Loading from '../../../components/Loading';
|
7
7
|
import getContentViewDetails from './ContentViewDetailActions';
|
8
8
|
import { selectCVDetails,
|
9
9
|
selectCVDetailStatus,
|
@@ -21,7 +21,7 @@ const DetailsContainer = ({ children, cvId, isOpen }) => {
|
|
21
21
|
}
|
22
22
|
});
|
23
23
|
|
24
|
-
if (status === STATUS.PENDING) return (<Loading
|
24
|
+
if (status === STATUS.PENDING) return (<Loading />);
|
25
25
|
if (status === STATUS.ERROR) return (<EmptyStateMessage error={error} />);
|
26
26
|
return (<React.Fragment>{children}</React.Fragment>);
|
27
27
|
};
|
@@ -29,7 +29,11 @@ const DetailsContainer = ({ children, cvId, isOpen }) => {
|
|
29
29
|
DetailsContainer.propTypes = {
|
30
30
|
children: PropTypes.element.isRequired,
|
31
31
|
cvId: PropTypes.number.isRequired,
|
32
|
-
isOpen: PropTypes.bool
|
32
|
+
isOpen: PropTypes.bool,
|
33
|
+
};
|
34
|
+
|
35
|
+
DetailsContainer.defaultProps = {
|
36
|
+
isOpen: true,
|
33
37
|
};
|
34
38
|
|
35
39
|
export default DetailsContainer;
|
@@ -0,0 +1,101 @@
|
|
1
|
+
import React from 'react';
|
2
|
+
import { renderWithRedux, patientlyWaitFor, fireEvent } from 'react-testing-lib-wrapper';
|
3
|
+
|
4
|
+
import { nockInstance, assertNockRequest } from '../../../../test-utils/nockWrapper';
|
5
|
+
import api from '../../../../services/api';
|
6
|
+
import ContentViewDetails from '../ContentViewDetails';
|
7
|
+
import CONTENT_VIEWS_KEY from '../../ContentViewsConstants';
|
8
|
+
|
9
|
+
const cvDetailData = require('./contentViewDetails.fixtures.json');
|
10
|
+
|
11
|
+
const renderOptions = { apiNamespace: `${CONTENT_VIEWS_KEY}_1` };
|
12
|
+
const cvDetailsPath = api.getApiUrl('/content_views/1');
|
13
|
+
|
14
|
+
test('Can call API and show details on page load', async (done) => {
|
15
|
+
const { label, name, description } = cvDetailData;
|
16
|
+
const scope = nockInstance
|
17
|
+
.get(cvDetailsPath)
|
18
|
+
.query(true)
|
19
|
+
.reply(200, cvDetailData);
|
20
|
+
|
21
|
+
const { getByLabelText } = renderWithRedux(
|
22
|
+
<ContentViewDetails match={{ params: { id: 1 } }} />,
|
23
|
+
renderOptions,
|
24
|
+
);
|
25
|
+
|
26
|
+
await patientlyWaitFor(() => {
|
27
|
+
expect(getByLabelText('name text value')).toHaveTextContent(name);
|
28
|
+
expect(getByLabelText('label text value')).toHaveTextContent(label);
|
29
|
+
expect(getByLabelText('description text value')).toHaveTextContent(description);
|
30
|
+
});
|
31
|
+
|
32
|
+
assertNockRequest(scope, done);
|
33
|
+
});
|
34
|
+
|
35
|
+
test('Can edit text details such as name', async (done) => {
|
36
|
+
const newName = 'agoodname';
|
37
|
+
const updatedCVDetails = { ...cvDetailData, name: newName };
|
38
|
+
const getscope = nockInstance
|
39
|
+
.get(cvDetailsPath)
|
40
|
+
.query(true)
|
41
|
+
.reply(200, cvDetailData);
|
42
|
+
const updatescope = nockInstance
|
43
|
+
.put(cvDetailsPath, { name: newName })
|
44
|
+
.reply(200, updatedCVDetails);
|
45
|
+
const afterUpdateScope = nockInstance
|
46
|
+
.get(cvDetailsPath)
|
47
|
+
.query(true)
|
48
|
+
.reply(200, updatedCVDetails);
|
49
|
+
|
50
|
+
const { getByLabelText } = renderWithRedux(
|
51
|
+
<ContentViewDetails match={{ params: { id: 1 } }} />,
|
52
|
+
renderOptions,
|
53
|
+
);
|
54
|
+
|
55
|
+
const editLabel = 'edit name';
|
56
|
+
// Wait for page to load and confirm edit button is present, then click to edit
|
57
|
+
await patientlyWaitFor(() => { expect(getByLabelText(editLabel)).toBeInTheDocument(); });
|
58
|
+
getByLabelText(editLabel).click();
|
59
|
+
|
60
|
+
const inputLabel = /name text input/;
|
61
|
+
await patientlyWaitFor(() => { expect(getByLabelText(inputLabel)).toBeInTheDocument(); });
|
62
|
+
fireEvent.change(getByLabelText(inputLabel), { target: { value: newName } });
|
63
|
+
getByLabelText('submit name').click();
|
64
|
+
|
65
|
+
// Make sure new name is showing after update
|
66
|
+
await patientlyWaitFor(() => { expect(getByLabelText('name text value')).toHaveTextContent(newName); });
|
67
|
+
|
68
|
+
assertNockRequest(getscope);
|
69
|
+
assertNockRequest(updatescope);
|
70
|
+
assertNockRequest(afterUpdateScope, done);
|
71
|
+
});
|
72
|
+
|
73
|
+
test('Can edit boolean details such as solve dependencies', async (done) => {
|
74
|
+
const updatedCVDetails = { ...cvDetailData, solve_dependencies: true };
|
75
|
+
const getscope = nockInstance
|
76
|
+
.get(cvDetailsPath)
|
77
|
+
.query(true)
|
78
|
+
.reply(200, cvDetailData);
|
79
|
+
const updatescope = nockInstance
|
80
|
+
.put(cvDetailsPath, { solve_dependencies: true })
|
81
|
+
.reply(200, updatedCVDetails);
|
82
|
+
const afterUpdateScope = nockInstance
|
83
|
+
.get(cvDetailsPath)
|
84
|
+
.query(true)
|
85
|
+
.reply(200, updatedCVDetails);
|
86
|
+
|
87
|
+
const { getByLabelText } = renderWithRedux(
|
88
|
+
<ContentViewDetails match={{ params: { id: 1 } }} />,
|
89
|
+
renderOptions,
|
90
|
+
);
|
91
|
+
|
92
|
+
const checkboxLabel = /solve_dependencies switch/;
|
93
|
+
await patientlyWaitFor(() => expect(getByLabelText(checkboxLabel)).toBeInTheDocument());
|
94
|
+
expect(getByLabelText(checkboxLabel).checked).toBeFalsy();
|
95
|
+
fireEvent.click(getByLabelText(checkboxLabel));
|
96
|
+
await patientlyWaitFor(() => expect(getByLabelText(checkboxLabel).checked).toBeTruthy());
|
97
|
+
|
98
|
+
assertNockRequest(getscope);
|
99
|
+
assertNockRequest(updatescope);
|
100
|
+
assertNockRequest(afterUpdateScope, done);
|
101
|
+
});
|
@@ -0,0 +1,106 @@
|
|
1
|
+
{
|
2
|
+
"content_host_count": 0,
|
3
|
+
"composite": false,
|
4
|
+
"component_ids": [],
|
5
|
+
"default": false,
|
6
|
+
"force_puppet_environment": false,
|
7
|
+
"version_count": 5,
|
8
|
+
"latest_version": "5.0",
|
9
|
+
"auto_publish": false,
|
10
|
+
"solve_dependencies": false,
|
11
|
+
"repository_ids": [
|
12
|
+
58,
|
13
|
+
62,
|
14
|
+
64
|
15
|
+
],
|
16
|
+
"id": 1,
|
17
|
+
"name": "Andura",
|
18
|
+
"label": "AnduraLabel",
|
19
|
+
"description": "a cool CV",
|
20
|
+
"organization_id": 8,
|
21
|
+
"organization": {
|
22
|
+
"name": "Enterprise",
|
23
|
+
"label": "Enterprise",
|
24
|
+
"id": 8
|
25
|
+
},
|
26
|
+
"created_at": "2020-05-15 11:50:50 -0400",
|
27
|
+
"updated_at": "2020-07-01 09:51:48 -0400",
|
28
|
+
"environments": [
|
29
|
+
{
|
30
|
+
"id": 19,
|
31
|
+
"name": "Library",
|
32
|
+
"label": "Library",
|
33
|
+
"permissions": {
|
34
|
+
"readable": true
|
35
|
+
}
|
36
|
+
}
|
37
|
+
],
|
38
|
+
"repositories": [
|
39
|
+
{
|
40
|
+
"id": 58,
|
41
|
+
"name": "Wishing Well Cluster",
|
42
|
+
"label": "Wishing_Well_Cluster",
|
43
|
+
"content_type": "yum"
|
44
|
+
},
|
45
|
+
{
|
46
|
+
"id": 62,
|
47
|
+
"name": "Palomar 12",
|
48
|
+
"label": "Palomar_12",
|
49
|
+
"content_type": "yum"
|
50
|
+
},
|
51
|
+
{
|
52
|
+
"id": 64,
|
53
|
+
"name": "Hodge 301",
|
54
|
+
"label": "Hodge_301",
|
55
|
+
"content_type": "yum"
|
56
|
+
}
|
57
|
+
],
|
58
|
+
"puppet_modules": [],
|
59
|
+
"versions": [
|
60
|
+
{
|
61
|
+
"id": 956,
|
62
|
+
"version": "1.0",
|
63
|
+
"published": "2020-05-15 16:40:03 -0400",
|
64
|
+
"environment_ids": []
|
65
|
+
},
|
66
|
+
{
|
67
|
+
"id": 957,
|
68
|
+
"version": "2.0",
|
69
|
+
"published": "2020-05-15 16:40:27 -0400",
|
70
|
+
"environment_ids": []
|
71
|
+
},
|
72
|
+
{
|
73
|
+
"id": 958,
|
74
|
+
"version": "3.0",
|
75
|
+
"published": "2020-05-15 16:40:52 -0400",
|
76
|
+
"environment_ids": []
|
77
|
+
},
|
78
|
+
{
|
79
|
+
"id": 959,
|
80
|
+
"version": "4.0",
|
81
|
+
"published": "2020-05-15 16:41:14 -0400",
|
82
|
+
"environment_ids": []
|
83
|
+
},
|
84
|
+
{
|
85
|
+
"id": 960,
|
86
|
+
"version": "5.0",
|
87
|
+
"published": "2020-05-15 16:41:36 -0400",
|
88
|
+
"environment_ids": [
|
89
|
+
19
|
90
|
+
]
|
91
|
+
}
|
92
|
+
],
|
93
|
+
"components": [],
|
94
|
+
"content_view_components": [],
|
95
|
+
"activation_keys": [],
|
96
|
+
"next_version": "6.0",
|
97
|
+
"last_published": "2020-05-15 16:41:36 -0400",
|
98
|
+
"permissions": {
|
99
|
+
"view_content_views": true,
|
100
|
+
"edit_content_views": true,
|
101
|
+
"destroy_content_views": true,
|
102
|
+
"publish_content_views": true,
|
103
|
+
"promote_or_remove_content_views": true
|
104
|
+
},
|
105
|
+
"duplicate_repositories_to_publish": []
|
106
|
+
}
|
@@ -3,37 +3,31 @@ import PropTypes from 'prop-types';
|
|
3
3
|
import { translate as __ } from 'foremanReact/common/I18n';
|
4
4
|
import { STATUS } from 'foremanReact/constants';
|
5
5
|
|
6
|
-
import TableWrapper from '
|
6
|
+
import TableWrapper from '../../../components/Table/TableWrapper';
|
7
7
|
import tableDataGenerator from './tableDataGenerator';
|
8
8
|
import actionResolver from './actionResolver';
|
9
|
+
import getContentViews from '../ContentViewsActions';
|
9
10
|
|
10
|
-
const ContentViewTable = ({
|
11
|
-
items, status, error,
|
12
|
-
}) => {
|
11
|
+
const ContentViewTable = ({ response, status, error }) => {
|
13
12
|
const [table, setTable] = useState({ rows: [], columns: [] });
|
14
13
|
const [rowMapping, setRowMapping] = useState({});
|
15
|
-
const
|
14
|
+
const { results, ...metadata } = response;
|
15
|
+
const loadingResponse = status === STATUS.PENDING;
|
16
16
|
|
17
17
|
useEffect(
|
18
18
|
() => {
|
19
|
-
if (!
|
20
|
-
const {
|
21
|
-
|
19
|
+
if (!loadingResponse && results) {
|
20
|
+
const { updatedRowMap, ...tableData } = tableDataGenerator(
|
21
|
+
results,
|
22
22
|
rowMapping,
|
23
23
|
);
|
24
24
|
setTable(tableData);
|
25
|
-
setRowMapping(
|
25
|
+
setRowMapping(updatedRowMap);
|
26
26
|
}
|
27
27
|
},
|
28
|
-
[
|
28
|
+
[results, JSON.stringify(rowMapping)], // use JSON to check obj values eq not reference eq
|
29
29
|
);
|
30
30
|
|
31
|
-
const cvIdFromRow = (rowIdx) => {
|
32
|
-
const entry = Object.entries(rowMapping).find(item => item[1].rowIndex === rowIdx);
|
33
|
-
if (entry) return parseInt(entry[0], 10);
|
34
|
-
return null;
|
35
|
-
};
|
36
|
-
|
37
31
|
const onSelect = (event, isSelected, rowId) => {
|
38
32
|
let rows;
|
39
33
|
if (rowId === -1) {
|
@@ -48,47 +42,68 @@ const ContentViewTable = ({
|
|
48
42
|
|
49
43
|
const onExpand = (_event, rowIndex, colIndex, isOpen) => {
|
50
44
|
const { rows } = table;
|
51
|
-
const contentViewId = cvIdFromRow(rowIndex);
|
52
45
|
// adjust for the selection checkbox cell being counted in the index
|
53
46
|
const adjustedColIndex = colIndex - 1;
|
54
47
|
|
55
48
|
if (!isOpen) {
|
56
49
|
setRowMapping((prev) => {
|
57
|
-
const updatedMap = { ...prev[
|
58
|
-
return { ...prev, [
|
50
|
+
const updatedMap = { ...prev[rowIndex], expandedColumn: adjustedColIndex };
|
51
|
+
return { ...prev, [rowIndex]: updatedMap };
|
59
52
|
});
|
60
53
|
} else {
|
61
|
-
//
|
62
|
-
|
63
|
-
const { [contentViewId]: _throwaway, ...newMap } = rowMapping;
|
64
|
-
setRowMapping(newMap);
|
54
|
+
// Keep id in object to not throw off tableStatus id checks
|
55
|
+
setRowMapping(prev => ({ ...prev, [rowIndex]: { id: prev[rowIndex].id } }));
|
65
56
|
}
|
66
57
|
|
67
58
|
setTable(prevTable => ({ ...prevTable, rows }));
|
68
59
|
};
|
69
60
|
|
70
|
-
|
71
|
-
const
|
61
|
+
// Prevents flash of "No Content" before rows are loaded
|
62
|
+
const tableStatus = () => {
|
63
|
+
if (typeof results === 'undefined') return status; // will handle errored state
|
64
|
+
const rowMappingIds = Object.values(rowMapping).map(row => row.id);
|
65
|
+
const resultsIds = Array.from(results.map(result => result.id));
|
66
|
+
// All results are accounted for in row mapping, the page is ready to load
|
67
|
+
if (resultsIds.length === rowMappingIds.length &&
|
68
|
+
resultsIds.every(id => rowMappingIds.includes(id))) {
|
69
|
+
return status;
|
70
|
+
}
|
71
|
+
return STATUS.PENDING; // Fallback to pending
|
72
|
+
};
|
73
|
+
|
74
|
+
const emptyContentTitle = __("You currently don't have any Content Views.");
|
75
|
+
const emptyContentBody = __('A content view can be added by using the "New content view" button below.');
|
76
|
+
const emptySearchTitle = __('No matching content views found');
|
77
|
+
const emptySearchBody = __('Try changing your search settings.');
|
72
78
|
|
73
79
|
const { rows, columns } = table;
|
74
80
|
return (
|
75
81
|
<TableWrapper
|
76
|
-
|
77
|
-
|
78
|
-
|
79
|
-
|
80
|
-
|
81
|
-
|
82
|
+
{...{
|
83
|
+
rows,
|
84
|
+
error,
|
85
|
+
metadata,
|
86
|
+
emptyContentTitle,
|
87
|
+
emptyContentBody,
|
88
|
+
emptySearchTitle,
|
89
|
+
emptySearchBody,
|
90
|
+
onSelect,
|
91
|
+
onExpand,
|
92
|
+
actionResolver,
|
93
|
+
}}
|
94
|
+
status={tableStatus()}
|
95
|
+
fetchItems={getContentViews}
|
82
96
|
canSelectAll={false}
|
83
|
-
|
84
|
-
|
85
|
-
error={error}
|
97
|
+
cells={columns}
|
98
|
+
autocompleteEndpoint="/content_views/auto_complete_search"
|
86
99
|
/>
|
87
100
|
);
|
88
101
|
};
|
89
102
|
|
90
103
|
ContentViewTable.propTypes = {
|
91
|
-
|
104
|
+
response: PropTypes.shape({
|
105
|
+
results: PropTypes.arrayOf(PropTypes.shape({})),
|
106
|
+
}),
|
92
107
|
status: PropTypes.string.isRequired,
|
93
108
|
error: PropTypes.oneOfType([
|
94
109
|
PropTypes.shape({}),
|
@@ -98,7 +113,7 @@ ContentViewTable.propTypes = {
|
|
98
113
|
|
99
114
|
ContentViewTable.defaultProps = {
|
100
115
|
error: null,
|
101
|
-
|
116
|
+
response: { results: [] },
|
102
117
|
};
|
103
118
|
|
104
119
|
export default ContentViewTable;
|