katello 3.16.0 → 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/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/hosts_bulk_actions_controller.rb +10 -0
- data/app/controllers/katello/api/v2/repositories_controller.rb +4 -1
- 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/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/capsule_content/sync.rb +2 -1
- 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/repository/content_update.rb +41 -0
- data/app/lib/actions/katello/repository/export.rb +1 -1
- data/app/lib/actions/katello/repository/update.rb +4 -20
- data/app/lib/actions/pulp/orchestration/repository/smart_proxy_sync.rb +1 -0
- data/app/lib/actions/pulp3/capsule_content/refresh_content_guard.rb +17 -0
- data/app/lib/actions/pulp3/{ContentGuard → content_guard}/refresh.rb +0 -0
- data/app/lib/katello/concerns/base_template_scope_extensions.rb +4 -0
- data/app/lib/katello/resources/candlepin/product.rb +11 -0
- data/app/lib/katello/util/cdn_var_substitutor.rb +1 -0
- 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 +2 -5
- 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_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/host/content_facet.rb +18 -0
- 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/ping.rb +1 -3
- 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 -1
- data/app/models/katello/root_repository.rb +23 -11
- data/app/models/katello/subscription_status.rb +1 -1
- data/app/models/katello/trace_status.rb +1 -1
- data/app/models/setting/content.rb +5 -1
- data/app/services/katello/event_daemon.rb +7 -8
- data/app/services/katello/host_status_manager.rb +13 -0
- data/app/services/katello/pulp3/repository_mirror.rb +7 -2
- 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/v2.rb +2 -0
- 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/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/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/details/repositories/details/views/repository-info.html +10 -0
- 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 +14 -2
- 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 +1 -1
- data/lib/katello/plugin.rb +20 -17
- 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/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 +144 -74
- 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
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: bf008f8880960ad2a6cf9b615c0e0801fb38cce104e67001f4d17178cca43ab7
|
4
|
+
data.tar.gz: d2cda17cc4664479ac34f7abd33c08f14ef81f038abb0cfe3d43c9542624c48b
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 27f052edff77986139ef6a82d0cd318c95b90a601a9f42178038896589c1042b1e18d030320173ae2c5a21ac75bfe09b13e7376525574f7dbff9d33b4867b8fa
|
7
|
+
data.tar.gz: 22f05c56710ee8951e1d15d30e5b2d471ab07f17287c51c01b7958e751442197fe89b8d262eb89584e612bba939aad7e8d7ddd407d55937d31a04d00e1df8e10
|
@@ -1,10 +1,3 @@
|
|
1
|
-
/**
|
2
|
-
* = require "katello/jquery.loadmask.css"
|
3
|
-
* = require "katello/jquery-ui-1.8.11.custom.css"
|
4
|
-
* = require "katello/jquery.treeTable.css"
|
5
|
-
* = require "katello/ui.spinner.css"
|
6
|
-
*/
|
7
|
-
|
8
1
|
@import "katello/overrides";
|
9
2
|
@import "katello/katello_base";
|
10
3
|
@import "katello/look";
|
@@ -18,6 +11,9 @@
|
|
18
11
|
@import "katello/generic";
|
19
12
|
@import "katello/notifications";
|
20
13
|
|
14
|
+
@import "katello/jquery.treeTable";
|
15
|
+
@import "katello/jquery-ui-1.8.11.custom.css";
|
16
|
+
|
21
17
|
body {
|
22
18
|
background-color: white;
|
23
19
|
}
|
@@ -1,4 +1,5 @@
|
|
1
1
|
module Katello
|
2
|
+
# rubocop:disable Metrics/ClassLength
|
2
3
|
class Api::V2::ActivationKeysController < Api::V2::ApiController
|
3
4
|
include Katello::Concerns::FilteredAutoCompleteSearch
|
4
5
|
include Katello::Concerns::Api::V2::ContentOverridesController
|
@@ -11,6 +12,7 @@ module Katello
|
|
11
12
|
:content_override, :add_subscriptions, :remove_subscriptions,
|
12
13
|
:subscriptions]
|
13
14
|
before_action :authorize
|
15
|
+
before_action :verify_simple_content_access_disabled, :only => [:add_subscriptions]
|
14
16
|
|
15
17
|
wrap_parameters :include => (ActivationKey.attribute_names + %w(host_collection_ids service_level auto_attach purpose_role purpose_usage purpose_addons content_view_environment))
|
16
18
|
|
@@ -348,5 +350,11 @@ module Katello
|
|
348
350
|
|
349
351
|
key_params
|
350
352
|
end
|
353
|
+
|
354
|
+
def verify_simple_content_access_disabled
|
355
|
+
if @activation_key.organization.simple_content_access?
|
356
|
+
fail HttpErrors::BadRequest, _("The specified organization is in Simple Content Access mode. Attaching subscriptions is disabled")
|
357
|
+
end
|
358
|
+
end
|
351
359
|
end
|
352
360
|
end
|
@@ -39,7 +39,9 @@ module Katello
|
|
39
39
|
respond_for_index :collection => @collection
|
40
40
|
end
|
41
41
|
|
42
|
-
def index_response
|
42
|
+
def index_response(reload_host = false)
|
43
|
+
# Host needs to be reloaded because of lazy accessor
|
44
|
+
@host.reload if reload_host
|
43
45
|
entitlements = @host.subscription_facet.candlepin_consumer.entitlements
|
44
46
|
subscriptions = entitlements.map { |entitlement| ::Katello::HostSubscriptionPresenter.new(entitlement) }
|
45
47
|
full_result_response(subscriptions)
|
@@ -53,7 +55,7 @@ module Katello
|
|
53
55
|
end
|
54
56
|
|
55
57
|
sync_task(::Actions::Katello::Host::AutoAttachSubscriptions, @host)
|
56
|
-
respond_for_index(:collection => index_response, :template => "index")
|
58
|
+
respond_for_index(:collection => index_response(true), :template => "index")
|
57
59
|
end
|
58
60
|
|
59
61
|
api :DELETE, "/hosts/:host_id/subscriptions/", N_("Unregister the host as a subscription consumer")
|
@@ -124,7 +126,7 @@ module Katello
|
|
124
126
|
end
|
125
127
|
|
126
128
|
sync_task(::Actions::Katello::Host::RemoveSubscriptions, @host, pool_id_quantities.values)
|
127
|
-
respond_for_index(:collection => index_response, :template => "index")
|
129
|
+
respond_for_index(:collection => index_response(true), :template => "index")
|
128
130
|
end
|
129
131
|
|
130
132
|
api :PUT, "/hosts/:host_id/subscriptions/add_subscriptions", N_("Add a subscription to a host")
|
@@ -134,12 +136,16 @@ module Katello
|
|
134
136
|
param :quantity, :number, :desc => N_("Quantity of this subscriptions to add"), :required => true
|
135
137
|
end
|
136
138
|
def add_subscriptions
|
139
|
+
if @host.organization.simple_content_access?
|
140
|
+
fail ::Katello::HttpErrors::BadRequest, _("This host's organization is in Simple Content Access mode. Attaching subscriptions is disabled.")
|
141
|
+
end
|
142
|
+
|
137
143
|
pools_with_quantities = params.require(:subscriptions).map do |sub_params|
|
138
144
|
PoolWithQuantities.new(Pool.with_identifier(sub_params['id']), sub_params['quantity'].to_i)
|
139
145
|
end
|
140
146
|
|
141
147
|
sync_task(::Actions::Katello::Host::AttachSubscriptions, @host, pools_with_quantities)
|
142
|
-
respond_for_index(:collection => index_response, :template => "index")
|
148
|
+
respond_for_index(:collection => index_response(true), :template => "index")
|
143
149
|
end
|
144
150
|
|
145
151
|
api :PUT, "/hosts/:host_id/subscriptions/content_override", N_("Set content overrides for the host")
|
@@ -10,9 +10,11 @@ module Katello
|
|
10
10
|
before_action :find_deletable_hosts, :only => [:destroy_hosts]
|
11
11
|
before_action :find_readable_hosts, :only => [:applicable_errata, :installable_errata, :available_incremental_updates]
|
12
12
|
before_action :find_errata, :only => [:available_incremental_updates]
|
13
|
+
before_action :find_organization, :only => [:add_subscriptions]
|
13
14
|
before_action :deprecate_katello_agent, :only => [:install_content, :update_content, :remove_content]
|
14
15
|
|
15
16
|
before_action :validate_content_action, :only => [:install_content, :update_content, :remove_content]
|
17
|
+
before_action :validate_organization, :only => [:add_subscriptions]
|
16
18
|
|
17
19
|
# disable *_count fields on erratum rabl, since they perform N+1 queries
|
18
20
|
before_action :disable_erratum_hosts_count
|
@@ -173,6 +175,10 @@ module Katello
|
|
173
175
|
param :quantity, :number, :desc => N_("Quantity of this subscriptions to add"), :required => true
|
174
176
|
end
|
175
177
|
def add_subscriptions
|
178
|
+
if @organization.simple_content_access?
|
179
|
+
fail HttpErrors::BadRequest, _("The specified organization is in Simple Content Access mode. Attaching subscriptions is disabled")
|
180
|
+
end
|
181
|
+
|
176
182
|
pools_with_quantities = params.require(:subscriptions).map do |sub_params|
|
177
183
|
PoolWithQuantities.new(Pool.find(sub_params['id']), sub_params['quantity'])
|
178
184
|
end
|
@@ -295,6 +301,10 @@ module Katello
|
|
295
301
|
find_bulk_hosts(:destroy_hosts, params)
|
296
302
|
end
|
297
303
|
|
304
|
+
def validate_organization
|
305
|
+
fail HttpErrors::BadRequest, _("Organization ID is required") if @organization.blank?
|
306
|
+
end
|
307
|
+
|
298
308
|
def validate_host_collection_membership_limit
|
299
309
|
max_hosts_exceeded = []
|
300
310
|
host_ids = @hosts.map(&:id)
|
@@ -57,6 +57,7 @@ module Katello
|
|
57
57
|
param :ansible_collection_requirements, String, :desc => N_("Contents of requirement yaml file to sync from URL")
|
58
58
|
param :http_proxy_policy, ::Katello::RootRepository::HTTP_PROXY_POLICIES, :desc => N_("policies for HTTP proxy for content sync")
|
59
59
|
param :http_proxy_id, :number, :desc => N_("ID of a HTTP Proxy")
|
60
|
+
param :auto_enabled, :bool, :desc => N_("if true, the repositories will be automatically enabled on a registered host subscribed to this product. Default: true")
|
60
61
|
end
|
61
62
|
|
62
63
|
def_param_group :repo_create do
|
@@ -327,6 +328,7 @@ module Katello
|
|
327
328
|
api :PUT, "/repositories/:id", N_("Update a repository")
|
328
329
|
param :id, :number, :required => true, :desc => N_("repository ID")
|
329
330
|
param :name, String, :required => false
|
331
|
+
param :description, String, :desc => N_("description of the repository"), :required => false
|
330
332
|
param_group :repo
|
331
333
|
def update
|
332
334
|
repo_params = repository_params
|
@@ -463,7 +465,7 @@ module Katello
|
|
463
465
|
|
464
466
|
def repository_params
|
465
467
|
keys = [:download_policy, :mirror_on_sync, :arch, :verify_ssl_on_sync, :upstream_password, :upstream_username,
|
466
|
-
:ostree_upstream_sync_depth, :ostree_upstream_sync_policy,
|
468
|
+
:ostree_upstream_sync_depth, :ostree_upstream_sync_policy, :auto_enabled,
|
467
469
|
:deb_releases, :deb_components, :deb_architectures, :description, :http_proxy_policy, :http_proxy_id,
|
468
470
|
{:ignorable_content => []}
|
469
471
|
]
|
@@ -514,6 +516,7 @@ module Katello
|
|
514
516
|
root.ansible_collection_requirements = repo_params[:ansible_collection_requirements] if root.ansible_collection?
|
515
517
|
root.http_proxy_policy = repo_params[:http_proxy_policy] if repo_params.key?(:http_proxy_policy)
|
516
518
|
root.http_proxy_id = repo_params[:http_proxy_id] if repo_params.key?(:http_proxy_id)
|
519
|
+
root.auto_enabled = repo_params[:auto_enabled] if repo_params.key?(:auto_enabled)
|
517
520
|
|
518
521
|
if root.ostree?
|
519
522
|
root.ostree_upstream_sync_policy = repo_params[:ostree_upstream_sync_policy]
|
@@ -77,6 +77,22 @@ module Katello
|
|
77
77
|
render json: { status: 'OK' }
|
78
78
|
end
|
79
79
|
|
80
|
+
api :PUT, "/organizations/:organization_id/simple_content_access/enable",
|
81
|
+
N_("Enable simple content access for a manifest")
|
82
|
+
param :organization_id, :number, :desc => N_("Organization ID"), :required => true
|
83
|
+
def enable_simple_content_access
|
84
|
+
task = async_task(::Actions::Katello::Organization::SimpleContentAccess::Enable, params[:organization_id])
|
85
|
+
respond_for_async :resource => task
|
86
|
+
end
|
87
|
+
|
88
|
+
api :PUT, "/organizations/:organization_id/simple_content_access/disable",
|
89
|
+
N_("Disable simple content access for a manifest")
|
90
|
+
param :organization_id, :number, :desc => N_("Organization ID"), :required => true
|
91
|
+
def disable_simple_content_access
|
92
|
+
task = async_task(::Actions::Katello::Organization::SimpleContentAccess::Disable, params[:organization_id])
|
93
|
+
respond_for_async :resource => task
|
94
|
+
end
|
95
|
+
|
80
96
|
private
|
81
97
|
|
82
98
|
def update_params
|
@@ -5,19 +5,19 @@ module Katello
|
|
5
5
|
|
6
6
|
def find_bulk_hosts(permission, bulk_params, restrict_to = nil)
|
7
7
|
#works on a structure of param_group bulk_params and transforms it into a list of systems
|
8
|
-
|
8
|
+
find_organization
|
9
9
|
bulk_params[:included] ||= {}
|
10
10
|
bulk_params[:excluded] ||= {}
|
11
11
|
@hosts = []
|
12
12
|
|
13
13
|
unless bulk_params[:included][:ids].blank?
|
14
14
|
@hosts = ::Host::Managed.authorized(permission).where(:id => bulk_params[:included][:ids])
|
15
|
-
@hosts = @hosts.where(:organization_id => organization.id) if organization
|
15
|
+
@hosts = @hosts.where(:organization_id => @organization.id) if @organization
|
16
16
|
end
|
17
17
|
|
18
18
|
if bulk_params[:included][:search]
|
19
19
|
search_hosts = ::Host::Managed.authorized(permission)
|
20
|
-
search_hosts = search_hosts.where(:organization_id =>
|
20
|
+
search_hosts = search_hosts.where(:organization_id => @organization.id) if @organization
|
21
21
|
search_hosts = search_hosts.search_for(bulk_params[:included][:search])
|
22
22
|
if @hosts.any?
|
23
23
|
@hosts = ::Host.where(id: @hosts).or(::Host.where(id: search_hosts))
|
@@ -38,7 +38,7 @@ module Katello
|
|
38
38
|
end
|
39
39
|
|
40
40
|
def find_organization
|
41
|
-
Organization.find_by_id(params[:organization_id])
|
41
|
+
@organization ||= Organization.find_by_id(params[:organization_id])
|
42
42
|
end
|
43
43
|
end
|
44
44
|
end
|
@@ -28,6 +28,16 @@ module Katello
|
|
28
28
|
def unsubscribed_hypervisor_count
|
29
29
|
host_query.search_for("subscription_status = unsubscribed_hypervisor").size
|
30
30
|
end
|
31
|
+
|
32
|
+
def removed_widgets
|
33
|
+
widgets = super
|
34
|
+
|
35
|
+
if Organization.current&.simple_content_access?
|
36
|
+
widgets.reject! { |widget| ::Widget.singleton_class::SUBSCRIPTION_TEMPLATES.include? widget[:template] }
|
37
|
+
end
|
38
|
+
|
39
|
+
widgets
|
40
|
+
end
|
31
41
|
end
|
32
42
|
end
|
33
43
|
end
|
@@ -15,7 +15,7 @@ module Katello
|
|
15
15
|
end
|
16
16
|
|
17
17
|
def organizations(host)
|
18
|
-
if host.is_a?(Hostgroup)
|
18
|
+
if host.is_a?(::Hostgroup)
|
19
19
|
host.organizations
|
20
20
|
else
|
21
21
|
host.organization ? [host.organization] : []
|
@@ -29,8 +29,7 @@ module Katello
|
|
29
29
|
|
30
30
|
def host_hostgroup_kickstart_repository_id(host)
|
31
31
|
return if host.blank?
|
32
|
-
|
33
|
-
host.content_facet.kickstart_repository_id if host.try(:content_facet).present?
|
32
|
+
host.content_facet&.kickstart_repository_id
|
34
33
|
end
|
35
34
|
|
36
35
|
def kickstart_repository_id(host, options = {})
|
@@ -78,13 +77,13 @@ module Katello
|
|
78
77
|
|
79
78
|
def accessible_lifecycle_environments(org, host)
|
80
79
|
selected = host.lifecycle_environment
|
81
|
-
envs = org.kt_environments.readable
|
80
|
+
envs = org.kt_environments.readable.order(:name)
|
82
81
|
envs |= [selected] if selected.present? && org == selected.organization
|
83
82
|
envs
|
84
83
|
end
|
85
84
|
|
86
85
|
def accessible_content_proxies(obj)
|
87
|
-
list = accessible_resource_records(:smart_proxy).with_content.to_a
|
86
|
+
list = accessible_resource_records(:smart_proxy).with_content.order(:name).to_a
|
88
87
|
current = obj.content_source
|
89
88
|
list |= [current] if current.present?
|
90
89
|
list
|
@@ -159,7 +158,7 @@ module Katello
|
|
159
158
|
|
160
159
|
views = []
|
161
160
|
if lifecycle_environment
|
162
|
-
views = Katello::ContentView.in_environment(lifecycle_environment).readable
|
161
|
+
views = Katello::ContentView.in_environment(lifecycle_environment).readable.order(:name)
|
163
162
|
views |= [content_view] if content_view.present? && content_view.in_environment?(lifecycle_environment)
|
164
163
|
elsif content_view
|
165
164
|
views = [content_view]
|
@@ -205,7 +204,7 @@ module Katello
|
|
205
204
|
|
206
205
|
return [] unless new_host.operatingsystem.is_a?(Redhat)
|
207
206
|
|
208
|
-
if (host.is_a? Hostgroup)
|
207
|
+
if (host.is_a? ::Hostgroup)
|
209
208
|
new_host.content_facet = ::Katello::Host::ContentFacet.new(:lifecycle_environment_id => host.inherited_lifecycle_environment_id,
|
210
209
|
:content_view_id => host.inherited_content_view_id,
|
211
210
|
:content_source_id => host.inherited_content_source_id)
|
@@ -6,11 +6,12 @@ module Actions
|
|
6
6
|
param :product_id
|
7
7
|
param :content_id
|
8
8
|
param :owner
|
9
|
+
param :enabled
|
9
10
|
end
|
10
11
|
|
11
12
|
def run
|
12
13
|
output[:response] = ::Katello::Resources::Candlepin::Product.
|
13
|
-
add_content(input[:owner], input[:product_id], input[:content_id],
|
14
|
+
add_content(input[:owner], input[:product_id], input[:content_id], input[:enabled])
|
14
15
|
end
|
15
16
|
end
|
16
17
|
end
|
@@ -0,0 +1,18 @@
|
|
1
|
+
module Actions
|
2
|
+
module Candlepin
|
3
|
+
module Product
|
4
|
+
class ContentUpdateEnablement < Candlepin::Abstract
|
5
|
+
input_format do
|
6
|
+
param :content_enablements
|
7
|
+
param :owner
|
8
|
+
param :product_id
|
9
|
+
end
|
10
|
+
|
11
|
+
def run
|
12
|
+
output[:response] = ::Katello::Resources::Candlepin::Product.
|
13
|
+
update_enabled(input[:owner], input[:product_id], input[:content_enablements])
|
14
|
+
end
|
15
|
+
end
|
16
|
+
end
|
17
|
+
end
|
18
|
+
end
|
@@ -32,7 +32,7 @@ module Actions
|
|
32
32
|
|
33
33
|
smart_proxy_helper = ::Katello::SmartProxyHelper.new(smart_proxy)
|
34
34
|
repositories = smart_proxy_helper.repos_available_to_capsule(environment, content_view, repository)
|
35
|
-
|
35
|
+
|
36
36
|
smart_proxy.ping_pulp if repositories.any? { |repo| !smart_proxy.pulp3_support?(repo) }
|
37
37
|
|
38
38
|
refresh_options = options.merge(content_view: content_view,
|
@@ -40,6 +40,7 @@ module Actions
|
|
40
40
|
repository: repository)
|
41
41
|
sequence do
|
42
42
|
plan_action(Actions::Pulp::Orchestration::Repository::RefreshRepos, smart_proxy, refresh_options)
|
43
|
+
plan_action(Actions::Pulp3::CapsuleContent::RefreshContentGuard, smart_proxy) if repositories.any? { |repo| smart_proxy.pulp3_support?(repo) }
|
43
44
|
plan_action(Actions::Pulp3::Orchestration::Repository::RefreshRepos, smart_proxy, refresh_options) if smart_proxy.pulp3_enabled?
|
44
45
|
plan_action(SyncCapsule, smart_proxy, refresh_options)
|
45
46
|
end
|
@@ -0,0 +1,17 @@
|
|
1
|
+
module Actions
|
2
|
+
module Katello
|
3
|
+
module Organization
|
4
|
+
module SimpleContentAccess
|
5
|
+
class Disable < Toggle
|
6
|
+
def content_access_mode_value
|
7
|
+
SIMPLE_CONTENT_ACCESS_DISABLED_VALUE
|
8
|
+
end
|
9
|
+
|
10
|
+
def humanized_name
|
11
|
+
N_("Disable Simple Content Access")
|
12
|
+
end
|
13
|
+
end
|
14
|
+
end
|
15
|
+
end
|
16
|
+
end
|
17
|
+
end
|
@@ -0,0 +1,17 @@
|
|
1
|
+
module Actions
|
2
|
+
module Katello
|
3
|
+
module Organization
|
4
|
+
module SimpleContentAccess
|
5
|
+
class Enable < Toggle
|
6
|
+
def content_access_mode_value
|
7
|
+
SIMPLE_CONTENT_ACCESS_ENABLED_VALUE
|
8
|
+
end
|
9
|
+
|
10
|
+
def humanized_name
|
11
|
+
N_("Enable Simple Content Access")
|
12
|
+
end
|
13
|
+
end
|
14
|
+
end
|
15
|
+
end
|
16
|
+
end
|
17
|
+
end
|
@@ -0,0 +1,36 @@
|
|
1
|
+
module Actions
|
2
|
+
module Katello
|
3
|
+
module Organization
|
4
|
+
module SimpleContentAccess
|
5
|
+
class Toggle < Actions::AbstractAsyncTask
|
6
|
+
middleware.use Actions::Middleware::PropagateCandlepinErrors
|
7
|
+
|
8
|
+
SIMPLE_CONTENT_ACCESS_DISABLED_VALUE = "entitlement".freeze
|
9
|
+
SIMPLE_CONTENT_ACCESS_ENABLED_VALUE = "org_environment".freeze
|
10
|
+
|
11
|
+
attr_reader :organization
|
12
|
+
|
13
|
+
def plan(organization_id)
|
14
|
+
@organization = ::Organization.find(organization_id)
|
15
|
+
|
16
|
+
::Katello::Resources::Candlepin::UpstreamConsumer.update(
|
17
|
+
"#{consumer['apiUrl']}#{consumer['uuid']}",
|
18
|
+
consumer['idCert']['cert'],
|
19
|
+
consumer['idCert']['key'],
|
20
|
+
nil,
|
21
|
+
{contentAccessMode: content_access_mode_value}
|
22
|
+
)
|
23
|
+
|
24
|
+
plan_action(::Actions::Katello::Organization::ManifestRefresh, organization)
|
25
|
+
end
|
26
|
+
|
27
|
+
private
|
28
|
+
|
29
|
+
def consumer
|
30
|
+
@consumer ||= ::Katello::Resources::Candlepin::UpstreamCandlepinResource.upstream_consumer
|
31
|
+
end
|
32
|
+
end
|
33
|
+
end
|
34
|
+
end
|
35
|
+
end
|
36
|
+
end
|
@@ -13,6 +13,19 @@ module Actions
|
|
13
13
|
Actions::Pulp3::Orchestration::OrphanCleanup::RemoveOrphans,
|
14
14
|
proxy)
|
15
15
|
end
|
16
|
+
plan_self
|
17
|
+
end
|
18
|
+
end
|
19
|
+
|
20
|
+
def run
|
21
|
+
models = []
|
22
|
+
::Katello::RepositoryTypeManager.repository_types.each_value do |repo_type|
|
23
|
+
indexable_types = repo_type.content_types_to_index
|
24
|
+
models += indexable_types&.map(&:model_class)
|
25
|
+
models.select! { |model| model.many_repository_associations }
|
26
|
+
end
|
27
|
+
models.each do |model|
|
28
|
+
model.joins("left join katello_#{model.repository_association} on #{model.table_name}.id = katello_#{model.repository_association}.#{model.unit_id_field}").where("katello_#{model.repository_association}.#{model.unit_id_field} IS NULL").destroy_all
|
16
29
|
end
|
17
30
|
end
|
18
31
|
end
|