diff --git a/.gitignore b/.gitignore deleted file mode 100644 index 63493844a8c..00000000000 --- a/.gitignore +++ /dev/null @@ -1,61 +0,0 @@ -.idea* -.project -reports -project.vim -katello.vim -tags -.settings -*.swp -.rbenv* -.ropeproject -.rvmrc* -.DS_Store -Gemfile*.lock -.bundle -.bin -db/*.sqlite3 -db/*.sqlite3-journal -log/*.log -log/*.age -hudson -yard -tmp -*~ -config/katello.yml -*.iml -locale/*.mo -locale/*/*.edit.po -locale/*/*.po.time_stamp -locale/.cache/* -locale/*/*.pox -locale/*/LC_MESSAGES -.yardoc -yardoc -doc/apidoc* -doc/headpin-apidoc* -public/apipie-cache* -public/headpin-apipie-cache* -project.vim -routes.html -routes.txt -perm_coverage.log -vendor/ruby -coverage -public/assets -bundler.d/local*.rb -config/initializers/_local*.rb -config/initializers/local*.rb -lib/tasks/local*.rb -doc/graphs/*.svg -.ruby-version -.ruby-gemset -*.swo -*.swn -*.gem -.zanata-cache -node_modules -.vscode -npm-debug.log -/foreman/ -package-lock.json -webpack/foremanReact/ diff --git a/.rubocop_todo.yml b/.rubocop_todo.yml deleted file mode 100644 index 6df2ad76c31..00000000000 --- a/.rubocop_todo.yml +++ /dev/null @@ -1,735 +0,0 @@ -# This configuration was generated by -# `rubocop --auto-gen-config` -# on 2024-11-05 08:03:08 UTC using RuboCop version 1.23.0. -# The point is for the user to remove these configuration records -# one by one as the offenses are removed from the code base. -# Note that changes in the inspected code, or installation of new -# versions of RuboCop, may require this file to be generated again. - -# Offense count: 2056 -# Cop supports --auto-correct. -# Configuration parameters: EnforcedStyle, IndentationWidth. -# SupportedStyles: with_first_argument, with_fixed_indentation -Layout/ArgumentAlignment: - Enabled: false - -# Offense count: 57 -# Cop supports --auto-correct. -Layout/ClosingParenthesisIndentation: - Enabled: false - -# Offense count: 138 -# Cop supports --auto-correct. -# Configuration parameters: EnforcedStyle, IndentationWidth. -# SupportedStyles: consistent, consistent_relative_to_receiver, special_for_inner_method_call, special_for_inner_method_call_in_parentheses -Layout/FirstArgumentIndentation: - Enabled: false - -# Offense count: 13 -# Cop supports --auto-correct. -# Configuration parameters: EnforcedStyle, IndentationWidth. -# SupportedStyles: special_inside_parentheses, consistent, align_braces -Layout/FirstHashElementIndentation: - Exclude: - - 'app/models/katello/host/content_facet.rb' - - 'test/lib/resources/katello_cdn_test.rb' - - 'test/lib/util/deduplication_migrator_test.rb' - - 'test/models/host/subscription_facet_test.rb' - -# Offense count: 248 -# Cop supports --auto-correct. -# Configuration parameters: AllowHeredoc, AllowURI, URISchemes, IgnoreCopDirectives, IgnoredPatterns. -# URISchemes: http, https -Layout/LineLength: - Max: 200 - -# Offense count: 24 -# Cop supports --auto-correct. -# Configuration parameters: EnforcedStyle. -# SupportedStyles: symmetrical, new_line, same_line -Layout/MultilineArrayBraceLayout: - Exclude: - - 'app/controllers/katello/api/v2/host_collections_controller.rb' - - 'app/controllers/katello/api/v2/repositories_controller.rb' - - 'app/models/katello/content_view_filter.rb' - - 'app/models/katello/content_view_repository.rb' - - 'app/models/katello/root_repository.rb' - - 'app/services/katello/host_status_manager.rb' - - 'spec/helpers/product_test_data.rb' - - 'test/controllers/api/v2/activation_keys_controller_test.rb' - - 'test/controllers/api/v2/content_view_versions_controller_test.rb' - - 'test/controllers/api/v2/content_views_controller_test.rb' - - 'test/models/content_view_environment_content_facet_test.rb' - - 'test/models/erratum_test.rb' - - 'test/models/ping_test.rb' - - 'test/services/katello/pulp3/api/client_api_test.rb' - -# Offense count: 114 -# Cop supports --auto-correct. -# Configuration parameters: EnforcedStyle. -# SupportedStyles: symmetrical, new_line, same_line -Layout/MultilineHashBraceLayout: - Enabled: false - -# Offense count: 359 -# Cop supports --auto-correct. -# Configuration parameters: EnforcedStyle. -# SupportedStyles: symmetrical, new_line, same_line -Layout/MultilineMethodCallBraceLayout: - Enabled: false - -# Offense count: 179 -# Cop supports --auto-correct. -# Configuration parameters: EnforcedStyle, IndentationWidth. -# SupportedStyles: aligned, indented, indented_relative_to_receiver -Layout/MultilineMethodCallIndentation: - Enabled: false - -# Offense count: 124 -# Cop supports --auto-correct. -# Configuration parameters: EnforcedStyle, IndentationWidth. -# SupportedStyles: aligned, indented -Layout/MultilineOperationIndentation: - Enabled: false - -# Offense count: 20 -# Cop supports --auto-correct. -# Configuration parameters: EnforcedStyle, EnforcedStyleForEmptyBrackets. -# SupportedStyles: space, no_space, compact -# SupportedStylesForEmptyBrackets: space, no_space -Layout/SpaceInsideArrayLiteralBrackets: - Exclude: - - 'app/models/katello/concerns/operatingsystem_extensions.rb' - - 'app/models/katello/deb.rb' - - 'app/models/katello/host/content_facet.rb' - - 'db/seeds.d/110-content-view-autopublish.rb' - - 'test/actions/pulp3/orchestration/file_remove_units_test.rb' - - 'test/lib/util/hostgroup_facets_helper_test.rb' - - 'test/mailers/subscription_mailer_test.rb' - - 'test/models/root_repository_test.rb' - - 'test/services/katello/pulp3/module_stream_test.rb' - -# Offense count: 23 -# Configuration parameters: IgnoredMethods. -Lint/AmbiguousBlockAssociation: - Exclude: - - 'app/services/katello/pulp3/pulp_content_unit.rb' - - 'test/controllers/api/v2/content_views_controller_test.rb' - - 'test/controllers/api/v2/package_groups_controller_test.rb' - - 'test/controllers/api/v2/products_bulk_actions_controller_test.rb' - - 'test/controllers/api/v2/root_controller_test.rb' - - 'test/models/authorization/repository_authorization_test.rb' - - 'test/models/concerns/operatingsystem_extensions_test.rb' - - 'test/models/content_view_test.rb' - - 'test/models/repository_test.rb' - - 'test/services/product_content_finder_test.rb' - -# Offense count: 13 -# Configuration parameters: AllowedMethods. -# AllowedMethods: enums -Lint/ConstantDefinitionInBlock: - Exclude: - - 'app/models/katello/concerns/content_facet_host_extensions.rb' - - 'app/models/katello/concerns/organization_extensions.rb' - - 'engines/bastion/config/routes.rb' - - 'lib/katello/tasks/annotate_scenarios.rake' - - 'lib/katello/tasks/clean_backend_objects.rake' - - 'lib/katello/tasks/clean_old_file_repos.rake' - - 'lib/katello/tasks/reset.rake' - - 'lib/katello/tasks/virt_who_report.rake' - - 'spec/models/lazy_accessor_spec.rb' - -# Offense count: 73 -# Configuration parameters: MaximumRangeSize. -Lint/MissingCopEnableDirective: - Enabled: false - -# Offense count: 5 -Lint/MissingSuper: - Exclude: - - 'app/lib/actions/helpers/presenter.rb' - - 'app/lib/katello/resources/discovery/container.rb' - - 'app/lib/katello/resources/discovery/yum.rb' - - 'app/services/katello/pulp3/smart_proxy_mirror_repository.rb' - - 'app/services/katello/ui_notifications/task_notification.rb' - -# Offense count: 2 -# Cop supports --auto-correct. -Lint/NonDeterministicRequireOrder: - Exclude: - - 'lib/katello/permissions.rb' - - 'test/lib/tasks/reimport_test.rb' - -# Offense count: 7 -# Cop supports --auto-correct. -Lint/RedundantStringCoercion: - Exclude: - - 'app/lib/katello/errors.rb' - - 'app/lib/katello/lazy_accessor.rb' - - 'app/models/katello/task_status.rb' - -# Offense count: 1 -# Configuration parameters: IgnoredPatterns. -# IgnoredPatterns: (?-mix:(exactly|at_least|at_most)\(\d+\)\.times) -Lint/UnreachableLoop: - Exclude: - - 'app/lib/actions/katello/host/hypervisors_update.rb' - -# Offense count: 7 -# Cop supports --auto-correct. -# Configuration parameters: AllowComments. -Lint/UselessMethodDefinition: - Exclude: - - 'app/controllers/katello/api/v2/debs_controller.rb' - - 'app/controllers/katello/api/v2/errata_controller.rb' - - 'app/controllers/katello/api/v2/packages_controller.rb' - - 'app/controllers/katello/api/v2/srpms_controller.rb' - - 'app/lib/actions/pulp3/repository/upload_file.rb' - - 'app/models/katello/concerns/smart_proxy_extensions.rb' - - 'app/services/katello/pulp3/api/generic.rb' - -# Offense count: 1137 -# Configuration parameters: IgnoredMethods, CountRepeatedAttributes. -Metrics/AbcSize: - Max: 60 - -# Offense count: 183 -# Configuration parameters: CountComments, CountAsOne, ExcludedMethods, IgnoredMethods. -# IgnoredMethods: refine -Metrics/BlockLength: - Max: 273 - -# Offense count: 8 -# Configuration parameters: CountBlocks. -Metrics/BlockNesting: - Max: 4 - -# Offense count: 146 -# Configuration parameters: CountComments, CountAsOne. -Metrics/ClassLength: - Max: 297 - -# Offense count: 203 -# Configuration parameters: IgnoredMethods. -Metrics/CyclomaticComplexity: - Max: 14 - -# Offense count: 20 -# Configuration parameters: CountComments, CountAsOne. -Metrics/ModuleLength: - Max: 325 - -# Offense count: 10 -# Configuration parameters: CountKeywordArgs, MaxOptionalParameters. -Metrics/ParameterLists: - Max: 7 - -# Offense count: 177 -# Configuration parameters: IgnoredMethods. -Metrics/PerceivedComplexity: - Max: 18 - -# Offense count: 12 -# Configuration parameters: EnforcedStyleForLeadingUnderscores. -# SupportedStylesForLeadingUnderscores: disallowed, required, optional -Naming/MemoizedInstanceVariableName: - Exclude: - - 'app/controllers/katello/api/v2/activation_keys_controller.rb' - - 'app/controllers/katello/api/v2/sync_plans_controller.rb' - - 'app/lib/actions/helpers/notifications.rb' - - 'app/lib/katello/util/path_with_substitutions.rb' - - 'app/models/katello/alternate_content_source.rb' - - 'app/models/katello/errata_status.rb' - - 'app/models/katello/glue/pulp/repos.rb' - - 'app/models/katello/repository.rb' - - 'app/models/katello/smart_proxy_alternate_content_source.rb' - - 'app/services/katello/organization_creator.rb' - - 'app/services/katello/pulp3/task.rb' - - 'app/services/katello/pulp3/task_group.rb' - -# Offense count: 12 -# Configuration parameters: MinNameLength, AllowNamesEndingInNumbers, AllowedNames, ForbiddenNames. -# AllowedNames: at, by, db, id, in, io, ip, of, on, os, pp, to -Naming/MethodParameterName: - Exclude: - - 'app/controllers/katello/api/v2/repository_sets_controller.rb' - - 'app/helpers/katello/hosts_and_hostgroups_helper.rb' - - 'app/helpers/katello/translation_helper.rb' - - 'app/lib/katello/http_resource.rb' - - 'app/lib/katello/util/hostgroup_facets_helper.rb' - - 'app/lib/katello/util/package_filter.rb' - - 'app/lib/katello/util/support.rb' - - 'test/source_code_test.rb' - - 'test/support/candlepin/consumer_support.rb' - -# Offense count: 17 -# Cop supports --auto-correct. -# Configuration parameters: PreferredName. -Naming/RescuedExceptionsVariableName: - Exclude: - - 'app/controllers/katello/api/registry/registry_proxies_controller.rb' - - 'app/controllers/katello/api/v2/api_controller.rb' - - 'app/controllers/katello/api/v2/repositories_controller.rb' - - 'app/controllers/katello/application_controller.rb' - - 'app/controllers/katello/concerns/hosts_controller_extensions.rb' - - 'app/controllers/katello/concerns/organizations_controller_extensions.rb' - - 'app/lib/actions/katello/host/recalculate_errata_status.rb' - - 'app/lib/actions/middleware/record_smart_proxy_sync_history.rb' - - 'app/lib/katello/event_daemon/monitor.rb' - - 'app/lib/katello/http_resource.rb' - - 'app/models/katello/concerns/smart_proxy_extensions.rb' - - 'app/services/katello/pulp3/service_common.rb' - - 'lib/katello/tasks/import_applicability.rake' - - 'lib/katello/tasks/update_subscription_facet_backend_data.rake' - -# Offense count: 5 -# Cop supports --auto-correct. -Performance/Casecmp: - Exclude: - - 'app/helpers/katello/application_helper.rb' - - 'app/models/katello/candlepin/repository_mapper.rb' - - 'app/models/katello/erratum.rb' - - 'test/support/annotations/matched_annotation.rb' - -# Offense count: 11 -# Cop supports --auto-correct. -Performance/InefficientHashSearch: - Exclude: - - 'app/lib/actions/katello/content_view/publish.rb' - - 'app/lib/actions/katello/content_view_version/incremental_update.rb' - - 'app/lib/actions/middleware/execute_if_contents_changed.rb' - - 'app/lib/actions/middleware/propagate_output.rb' - - 'app/models/katello/alternate_content_source.rb' - -# Offense count: 1 -# Cop supports --auto-correct. -Performance/RangeInclude: - Exclude: - - 'lib/katello/apipie/validators.rb' - -# Offense count: 4 -# Cop supports --auto-correct. -Performance/RedundantBlockCall: - Exclude: - - 'app/controllers/katello/application_controller.rb' - - 'app/helpers/katello/layout_helper.rb' - - 'test/source_code_test.rb' - -# Offense count: 1 -# Cop supports --auto-correct. -Performance/RedundantMatch: - Exclude: - - 'app/lib/katello/validators/gpg_key_content_validator.rb' - -# Offense count: 16 -# Cop supports --auto-correct. -# Configuration parameters: MaxKeyValuePairs. -Performance/RedundantMerge: - Exclude: - - 'app/lib/katello/resources/candlepin/owner.rb' - - 'app/services/katello/pulp3/alternate_content_source.rb' - - 'app/services/katello/pulp3/repository.rb' - - 'app/services/katello/pulp3/repository/apt.rb' - - 'app/services/katello/pulp3/repository/generic.rb' - - 'app/services/katello/pulp3/repository/yum.rb' - - 'app/services/katello/pulp3/repository_mirror.rb' - - 'lib/katello/url_constrained_cookie_store.rb' - - 'spec/models/product_spec.rb' - -# Offense count: 1 -# Cop supports --auto-correct. -# Configuration parameters: AutoCorrect, SafeMultiline. -Performance/StartWith: - Exclude: - - 'test/support/actions/fixtures.rb' - -# Offense count: 11 -# Cop supports --auto-correct. -Performance/StringReplacement: - Exclude: - - 'app/controllers/katello/api/v2/generic_content_units_controller.rb' - - 'app/helpers/katello/errata_mailer_helper.rb' - - 'app/lib/actions/katello/repository/errata_mail.rb' - - 'app/models/katello/host/subscription_facet.rb' - - 'app/models/katello/repository.rb' - - 'app/services/cert/rhsm_client.rb' - - 'app/services/katello/ui_notifications/hosts/lifecycle_expire_soon.rb' - - 'test/controllers/api/v2/organizations_controller_test.rb' - - 'test/models/activation_key_test.rb' - -# Offense count: 5 -# Cop supports --auto-correct. -# Configuration parameters: AutoCorrect. -Performance/TimesMap: - Exclude: - - 'test/lib/validators/katello_label_format_validator_test.rb' - - 'test/models/host_collection_test.rb' - - 'test/models/rpm_test.rb' - - 'test/models/srpm_test.rb' - -# Offense count: 34 -# Configuration parameters: EnforcedStyle, AllowToTime. -# SupportedStyles: strict, flexible -Rails/Date: - Exclude: - - 'app/controllers/katello/api/v2/api_controller.rb' - - 'app/models/katello/pool.rb' - - 'app/models/katello/rhel_lifecycle_status.rb' - - 'test/controllers/api/v2/subscriptions_controller_test.rb' - - 'test/controllers/foreman/hosts_controller_test.rb' - - 'test/factories/pool_factory.rb' - - 'test/models/rhel_lifecycle_status_test.rb' - -# Offense count: 14 -# Configuration parameters: EnforcedStyle. -# SupportedStyles: slashes, arguments -Rails/FilePath: - Exclude: - - 'app/controllers/katello/api/registry/registry_proxies_controller.rb' - - 'app/controllers/katello/api/v2/subscriptions_controller.rb' - - 'app/lib/actions/katello/repository/upload_files.rb' - - 'app/lib/actions/middleware/record_fixtures.rb' - - 'lib/katello/tasks/annotate_scenarios.rake' - - 'test/controllers/api/registry/registry_proxies_controller_test.rb' - - 'test/katello_test_helper.rb' - - 'test/lib/access_permissions_test.rb' - - 'test/lib/event_daemon/runner_test.rb' - - 'test/lib/tasks/receptor/extract_orgs_test.rb' - -# Offense count: 7 -# Cop supports --auto-correct. -# Configuration parameters: Include, IgnoredMethods. -# Include: app/models/**/*.rb -# IgnoredMethods: order, limit, select, lock -Rails/FindEach: - Exclude: - - 'app/models/katello/concerns/host_managed_extensions.rb' - - 'app/models/katello/concerns/operatingsystem_extensions.rb' - - 'app/models/katello/content.rb' - - 'app/models/katello/content_view.rb' - - 'app/models/katello/repository.rb' - -# Offense count: 17 -# Configuration parameters: Include. -# Include: app/helpers/**/*.rb -Rails/HelperInstanceVariable: - Exclude: - - 'app/helpers/katello/katello_urls_helper.rb' - - 'app/helpers/katello/subscription_mailer_helper.rb' - - 'app/helpers/katello/taxonomy_helper.rb' - -# Offense count: 22 -# Configuration parameters: Include. -# Include: app/models/**/*.rb -Rails/InverseOf: - Exclude: - - 'app/models/katello/concerns/content_facet_host_extensions.rb' - - 'app/models/katello/concerns/host_managed_extensions.rb' - - 'app/models/katello/concerns/organization_extensions.rb' - - 'app/models/katello/concerns/subscription_facet_host_extensions.rb' - - 'app/models/katello/content_view.rb' - - 'app/models/katello/content_view_deb_filter.rb' - - 'app/models/katello/content_view_docker_filter.rb' - - 'app/models/katello/content_view_erratum_filter.rb' - - 'app/models/katello/content_view_module_stream_filter.rb' - - 'app/models/katello/content_view_package_filter.rb' - - 'app/models/katello/content_view_package_group_filter.rb' - - 'app/models/katello/kt_environment.rb' - - 'app/models/katello/product.rb' - - 'app/models/katello/repository.rb' - -# Offense count: 45 -# Configuration parameters: Include. -# Include: app/controllers/**/*.rb -Rails/LexicallyScopedActionFilter: - Enabled: false - -# Offense count: 10 -Rails/OutputSafety: - Exclude: - - 'app/helpers/katello/application_helper.rb' - - 'app/helpers/katello/errata_mailer_helper.rb' - - 'app/helpers/katello/hosts_and_hostgroups_helper.rb' - - 'app/helpers/katello/layout_helper.rb' - - 'engines/bastion/app/helpers/bastion/layout_helper.rb' - -# Offense count: 15 -# Cop supports --auto-correct. -Rails/Presence: - Exclude: - - 'app/controllers/katello/api/v2/api_controller.rb' - - 'app/controllers/katello/api/v2/errata_controller.rb' - - 'app/helpers/katello/hosts_and_hostgroups_helper.rb' - - 'app/helpers/katello/taxonomy_helper.rb' - - 'app/lib/actions/katello/organization/manifest_refresh.rb' - - 'app/models/katello/content_view_filter.rb' - - 'app/services/katello/managed_content_medium_provider.rb' - - 'app/services/katello/pulp3/repository/ansible_collection.rb' - - 'app/services/katello/pulp3/repository/apt.rb' - - 'app/services/katello/pulp3/task.rb' - - 'db/migrate/20160619223332_fix_viewer_role.rb' - - 'db/seeds.d/102-organizations.rb' - -# Offense count: 123 -# Cop supports --auto-correct. -# Configuration parameters: NotNilAndNotEmpty, NotBlank, UnlessBlank. -Rails/Present: - Enabled: false - -# Offense count: 10 -# Cop supports --auto-correct. -# Configuration parameters: Include. -# Include: **/Rakefile, **/*.rake -Rails/RakeEnvironment: - Exclude: - - 'lib/katello/tasks/jenkins.rake' - - 'lib/katello/tasks/reset.rake' - - 'lib/katello/tasks/rubocop.rake' - - 'lib/katello/tasks/test.rake' - -# Offense count: 757 -# Cop supports --auto-correct. -# Configuration parameters: EnforcedStyle, Include. -# SupportedStyles: assert_not, refute -# Include: **/test/**/* -Rails/RefuteMethods: - Enabled: false - -# Offense count: 89 -# Configuration parameters: ForbiddenMethods, AllowedMethods. -# ForbiddenMethods: decrement!, decrement_counter, increment!, increment_counter, insert, insert!, insert_all, insert_all!, toggle!, touch, touch_all, update_all, update_attribute, update_column, update_columns, update_counters, upsert, upsert_all -Rails/SkipsModelValidations: - Enabled: false - -# Offense count: 78 -# Cop supports --auto-correct. -# Configuration parameters: EnforcedStyle. -# SupportedStyles: strict, flexible -Rails/TimeZone: - Enabled: false - -# Offense count: 1 -# Cop supports --auto-correct. -# Configuration parameters: EnforcedStyle, AutoCorrect. -# SupportedStyles: conservative, aggressive -Rails/UniqBeforePluck: - Exclude: - - 'test/controllers/api/v2/api_controller_test.rb' - -# Offense count: 1 -Security/Open: - Exclude: - - 'lib/katello/tasks/clean_old_file_repos.rake' - -# Offense count: 9 -# Configuration parameters: EnforcedStyle, AllowModifiersOnSymbols. -# SupportedStyles: inline, group -Style/AccessModifierDeclarations: - Exclude: - - 'app/controllers/katello/api/v2/content_view_components_controller.rb' - - 'app/services/katello/product_content_importer.rb' - -# Offense count: 1 -# Cop supports --auto-correct. -# Configuration parameters: EnforcedStyle. -# SupportedStyles: prefer_alias, prefer_alias_method -Style/Alias: - Exclude: - - 'app/models/katello/content_view_environment.rb' - -# Offense count: 294 -# Cop supports --auto-correct. -# Configuration parameters: EnforcedStyle. -# SupportedStyles: nested, compact -Style/ClassAndModuleChildren: - Enabled: false - -# Offense count: 1 -Style/CombinableLoops: - Exclude: - - 'test/services/katello/pulp3/api/client_api_test.rb' - -# Offense count: 67 -# Cop supports --auto-correct. -# Configuration parameters: EnforcedStyle, SingleLineConditionsOnly, IncludeTernaryExpressions. -# SupportedStyles: assign_to_condition, assign_inside_condition -Style/ConditionalAssignment: - Enabled: false - -# Offense count: 2 -# Cop supports --auto-correct. -Style/EmptyCaseCondition: - Exclude: - - 'app/lib/katello/resources/discovery/container.rb' - - 'app/models/katello/content_view_version.rb' - -# Offense count: 5 -# Cop supports --auto-correct. -Style/ExpandPathArguments: - Exclude: - - 'bin/rails' - - 'lib/katello/permissions.rb' - - 'lib/katello/repository_types.rb' - -# Offense count: 396 -# Configuration parameters: EnforcedStyle, MaxUnannotatedPlaceholdersAllowed, IgnoredMethods. -# SupportedStyles: annotated, template, unannotated -Style/FormatStringToken: - Enabled: false - -# Offense count: 12 -# Cop supports --auto-correct. -# Configuration parameters: AllowedReceivers. -Style/HashEachMethods: - Exclude: - - 'app/lib/actions/katello/repository/multi_clone_contents.rb' - - 'app/lib/katello/event_daemon/monitor.rb' - - 'app/lib/katello/http_resource.rb' - - 'app/models/katello/concerns/smart_proxy_extensions.rb' - - 'app/models/katello/content_view_version.rb' - - 'app/models/katello/glue/pulp/repos.rb' - - 'app/services/katello/repository_type_manager.rb' - - 'lib/katello/tasks/upgrades/4.1/reupdate_content_import_export_perms.rake' - - 'test/katello_test_helper.rb' - - 'test/models/file_unit_test.rb' - - 'test/services/katello/pulp3/repository_integration_test.rb' - -# Offense count: 1 -# Cop supports --auto-correct. -Style/HashTransformKeys: - Exclude: - - 'app/models/katello/content_view_version.rb' - -# Offense count: 11 -# Cop supports --auto-correct. -Style/IdenticalConditionalBranches: - Exclude: - - 'app/controllers/katello/api/registry/registry_proxies_controller.rb' - - 'app/lib/actions/katello/repository/finish_upload.rb' - - 'app/models/katello/kt_environment.rb' - - 'app/services/katello/pulp3/repository.rb' - - 'lib/katello/url_constrained_cookie_store.rb' - -# Offense count: 19 -# Cop supports --auto-correct. -# Configuration parameters: AllowIfModifier. -Style/IfInsideElse: - Enabled: false - -# Offense count: 25 -# Cop supports --auto-correct. -# Configuration parameters: InverseMethods, InverseBlocks. -Style/InverseMethods: - Enabled: false - -# Offense count: 1 -Style/MissingRespondToMissing: - Exclude: - - 'app/presenters/katello/content_view_version_compare_presenter.rb' - -# Offense count: 1 -# Cop supports --auto-correct. -# Configuration parameters: AllowMethodComparison. -Style/MultipleComparison: - Exclude: - - 'test/controllers/api/v2/content_views_controller_test.rb' - -# Offense count: 3 -# Cop supports --auto-correct. -# Configuration parameters: EnforcedOctalStyle. -# SupportedOctalStyles: zero_with_o, zero_only -Style/NumericLiteralPrefix: - Exclude: - - 'app/controllers/katello/api/registry/registry_proxies_controller.rb' - - 'app/controllers/katello/api/v2/subscriptions_controller.rb' - -# Offense count: 93 -# Cop supports --auto-correct. -# Configuration parameters: EnforcedStyle, IgnoredMethods. -# SupportedStyles: predicate, comparison -Style/NumericPredicate: - Enabled: false - -# Offense count: 15 -# Cop supports --auto-correct. -Style/ParallelAssignment: - Exclude: - - 'app/controllers/katello/api/rhsm/candlepin_proxies_controller.rb' - - 'app/lib/katello/errors.rb' - - 'app/lib/katello/lazy_accessor.rb' - - 'app/lib/katello/resources/discovery/yum.rb' - - 'app/lib/katello/util/path_with_substitutions.rb' - - 'app/models/katello/rpm.rb' - - 'app/models/katello/sync_plan.rb' - - 'app/services/katello/pulp3/repository.rb' - - 'test/models/erratum_test.rb' - - 'test/models/file_unit_test.rb' - - 'test/services/katello/pulp3/erratum_test.rb' - -# Offense count: 83 -# Cop supports --auto-correct. -# Configuration parameters: PreferredDelimiters. -Style/PercentLiteralDelimiters: - Enabled: false - -# Offense count: 41 -# Cop supports --auto-correct. -Style/RedundantInterpolation: - Enabled: false - -# Offense count: 12 -# Cop supports --auto-correct. -# Configuration parameters: EnforcedStyle, AllowInnerSlashes. -# SupportedStyles: slashes, percent_r, mixed -Style/RegexpLiteral: - Exclude: - - 'app/helpers/katello/katello_urls_helper.rb' - - 'app/lib/katello/util/path_with_substitutions.rb' - - 'app/lib/katello/validators/alternate_content_source_path_validator.rb' - - 'app/lib/katello/validators/container_image_name_validator.rb' - - 'app/lib/katello/validators/gpg_key_content_validator.rb' - - 'app/models/katello/repository.rb' - - 'app/services/katello/pulp3/repository.rb' - - 'config/routes.rb' - - 'test/controllers/api/v2/content_export_incrementals_controller_test.rb' - - 'test/models/activation_key_test.rb' - - 'test/support/actions/fixtures.rb' - -# Offense count: 19 -# Cop supports --auto-correct. -# Configuration parameters: EnforcedStyle. -# SupportedStyles: single_quotes, double_quotes -Style/StringLiteralsInInterpolation: - Exclude: - - 'app/controllers/katello/api/v2/activation_keys_controller.rb' - - 'app/controllers/katello/api/v2/generic_content_units_controller.rb' - - 'app/lib/actions/pulp3/repository/multi_copy_units.rb' - - 'app/lib/katello/resources/cdn/katello_cdn.rb' - - 'app/lib/katello/util/package.rb' - - 'app/lib/katello/util/report_table.rb' - - 'app/models/katello/content_view.rb' - - 'db/migrate/20160701180402_add_sortable_version_to_puppet_modules.rb' - - 'engines/bastion/lib/bastion/engine.rb' - - 'lib/katello/plugin.rb' - - 'test/lib/util/cdn_var_subsitutor_test.rb' - - 'test/models/content_view_test.rb' - -# Offense count: 11 -# Cop supports --auto-correct. -# Configuration parameters: EnforcedStyleForMultiline. -# SupportedStylesForMultiline: comma, consistent_comma, no_comma -Style/TrailingCommaInArrayLiteral: - Exclude: - - 'lib/katello/tasks/test.rake' - -# Offense count: 30 -# Cop supports --auto-correct. -Style/ZeroLengthPredicate: - Enabled: false - -# Offense count: 3186 -# Cop supports --auto-correct. -# Configuration parameters: AllowHeredoc, AllowURI, URISchemes, IgnoreCopDirectives, IgnoredPatterns. -# URISchemes: http, https -Layout/LineLength: - Max: 273 diff --git a/app/controllers/katello/api/v2/content_view_filter_rules_controller.rb b/app/controllers/katello/api/v2/content_view_filter_rules_controller.rb index 0b61607da58..5054a94e332 100644 --- a/app/controllers/katello/api/v2/content_view_filter_rules_controller.rb +++ b/app/controllers/katello/api/v2/content_view_filter_rules_controller.rb @@ -40,6 +40,7 @@ def resource_class param :types, Array, :desc => N_("erratum: types (enhancement, bugfix, security)") param :date_type, String, :desc => N_("erratum: search using the 'Issued On' or 'Updated On' column of the errata. Values are 'issued'/'updated'") param :module_stream_ids, Array, :desc => N_("module stream ids") + param :allow_other_types, :bool, :desc => N_("erratum: allow types not matching a valid errata type") def create rule_clazz = ContentViewFilter.rule_class_for(@filter) @@ -89,6 +90,7 @@ def show param :start_date, String, :desc => N_("erratum: start date (YYYY-MM-DD)") param :end_date, String, :desc => N_("erratum: end date (YYYY-MM-DD)") param :types, Array, :desc => N_("erratum: types (enhancement, bugfix, security)") + param :allow_other_types, :bool, :desc => N_("erratum: allow types not matching a valid errata type") def update update_params = rule_params update_params[:name] = update_params[:name].first if update_params[:name] @@ -136,7 +138,7 @@ def rule_params @rule_params ||= params.fetch(:content_view_filter_rule, {}). permit(:uuid, :version, :min_version, :max_version, :architecture, - :errata_id, :start_date, :end_date, :date_type, + :errata_id, :start_date, :end_date, :date_type, :allow_other_types, :types => [], :module_stream_ids => [], :errata_ids => [], name: []) end diff --git a/app/controllers/katello/api/v2/errata_controller.rb b/app/controllers/katello/api/v2/errata_controller.rb index d8040aea0b8..ecad877b21a 100644 --- a/app/controllers/katello/api/v2/errata_controller.rb +++ b/app/controllers/katello/api/v2/errata_controller.rb @@ -59,9 +59,21 @@ def custom_index_relation(collection) fail HttpErrors::UnprocessableEntity, msg end + collection = custom_index_relation_handle_type_and_time(collection) + collection + end + + def custom_index_relation_handle_type_and_time(collection) collection = collection.where("#{date_type} >= ?", params[:start_date]) if params[:start_date] collection = collection.where("#{date_type} <= ?", params[:end_date]) if params[:end_date] - collection = collection.of_type(params[:types]) if params[:types] + if params[:types] + include_other = params[:types]&.include?('other') + params[:types]&.delete('other') + collection = collection.of_type( + params[:types], + include_other + ) + end collection end diff --git a/app/lib/katello/validators/content_view_erratum_filter_rule_validator.rb b/app/lib/katello/validators/content_view_erratum_filter_rule_validator.rb index 3eee2a8f252..7b512488c6d 100644 --- a/app/lib/katello/validators/content_view_erratum_filter_rule_validator.rb +++ b/app/lib/katello/validators/content_view_erratum_filter_rule_validator.rb @@ -2,9 +2,9 @@ module Katello module Validators class ContentViewErratumFilterRuleValidator < ActiveModel::Validator def validate(record) - if record.errata_id.blank? && record.start_date.blank? && record.end_date.blank? && record.types.blank? + if record.errata_id.blank? && record.start_date.blank? && record.end_date.blank? && record.types.blank? && record.allow_other_types == false invalid_parameters = _("Invalid erratum filter rule specified, Must specify at least one of the following:" \ - " 'errata_id', 'start_date', 'end_date' or 'types'") + " 'errata_id', 'start_date', 'end_date', 'types', or 'allow_other_types'") record.errors.add(:base, invalid_parameters) return end diff --git a/app/models/katello/content_view_erratum_filter.rb b/app/models/katello/content_view_erratum_filter.rb index ee8d9f98103..a6e39a65c19 100644 --- a/app/models/katello/content_view_erratum_filter.rb +++ b/app/models/katello/content_view_erratum_filter.rb @@ -92,9 +92,21 @@ def erratum_arel end def types_clause + # Create an array to store output clauses for quick type filtering later + conditions = [] + + # Add clauses for types in the filter types = erratum_rules.first.types - return if types.blank? - errata_types_in(types) + conditions << errata_types_in(types) unless types.blank? + + # Add clauses for 'other' types + conditions << errata_types_not_in(Erratum::TYPES) if erratum_rules.first.allow_other_types? + + # Reduce the array of clauses to a single clause and return + return if conditions.empty? + conditions.reduce(nil) do |combined_clause, condition| + combined_clause ? combined_clause.or(condition) : condition + end end def filter_by_id? @@ -105,6 +117,10 @@ def errata_types_in(types) erratum_arel[:errata_type].in(types) end + def errata_types_not_in(types) + erratum_arel[:errata_type].not_in(types) + end + def errata_in(ids) erratum_arel[:errata_id].in(ids) end diff --git a/app/models/katello/erratum.rb b/app/models/katello/erratum.rb index b68062ee1cd..9a6b3893d51 100644 --- a/app/models/katello/erratum.rb +++ b/app/models/katello/erratum.rb @@ -48,8 +48,14 @@ class Erratum < Katello::Model :validator => ->(value) { ['true', 'false'].include?(value.downcase) }, :operators => ["="] - def self.of_type(type) - where(:errata_type => type) + def self.of_type(type, include_other = false) + if include_other + where.not( + :errata_type => [Erratum::SECURITY, Erratum::BUGZILLA, Erratum::ENHANCEMENT].flatten + ).or(where(:errata_type => type)) + else + where(:errata_type => type) + end end scope :security, -> { of_type(Erratum::SECURITY) } diff --git a/app/views/katello/api/v2/content_view_filter_rules/show.json.rabl b/app/views/katello/api/v2/content_view_filter_rules/show.json.rabl index 38c1b04a2b1..d7024c206e7 100644 --- a/app/views/katello/api/v2/content_view_filter_rules/show.json.rabl +++ b/app/views/katello/api/v2/content_view_filter_rules/show.json.rabl @@ -13,6 +13,7 @@ attributes :start_date, :if => lambda { |rule| rule.respond_to?(:start_date) && attributes :end_date, :if => lambda { |rule| rule.respond_to?(:end_date) && !rule.end_date.blank? } attributes :architecture, :if => lambda { |rule| rule.respond_to?(:architecture) && !rule.architecture.blank? } attributes :types, :if => lambda { |rule| rule.respond_to?(:types) && !rule.types.blank? } +attributes :allow_other_types, :if => lambda { |rule| rule.respond_to?(:allow_other_types) } attributes :date_type, :if => lambda { |rule| rule.respond_to?(:date_type) } attributes :module_stream_id, :if => lambda { |rule| rule.respond_to?(:module_stream_id) && !rule.module_stream_id.blank? } if @resource&.try(:module_stream) diff --git a/db/migrate/20241120213713_add_allow_other_types_to_content_view_erratum_filter_rules.rb b/db/migrate/20241120213713_add_allow_other_types_to_content_view_erratum_filter_rules.rb new file mode 100644 index 00000000000..adac4544e52 --- /dev/null +++ b/db/migrate/20241120213713_add_allow_other_types_to_content_view_erratum_filter_rules.rb @@ -0,0 +1,6 @@ +class AddAllowOtherTypesToContentViewErratumFilterRules < ActiveRecord::Migration[6.1] + def change + add_column :katello_content_view_erratum_filter_rules, :allow_other_types, :boolean, + :default => false, :null => false + end +end diff --git a/test/models/content_view_erratum_filter_test.rb b/test/models/content_view_erratum_filter_test.rb index 02491f8baa9..a4439339d70 100644 --- a/test/models/content_view_erratum_filter_test.rb +++ b/test/models/content_view_erratum_filter_test.rb @@ -6,6 +6,9 @@ def setup @repo = katello_repositories(:fedora_17_x86_64) end + TYPICAL_TYPES_RESPONSE = + " AND \"katello_errata\".\"errata_type\" IN ('bugfix', 'enhancement', 'security')".freeze + def test_erratum_by_id_returns_arel_for_specified_errata_id erratum = katello_errata(:security) @repo.errata = [erratum] @@ -24,7 +27,7 @@ def test_errata_by_start_date_returns_arel_for_errata_by_updated_date_and_errata filter = id_rule.filter filter.reload - assert_equal "\"katello_errata\".\"updated\" >= '#{start_date}' AND \"katello_errata\".\"errata_type\" IN ('bugfix', 'enhancement', 'security')", + assert_equal "\"katello_errata\".\"updated\" >= '#{start_date}'" + TYPICAL_TYPES_RESPONSE, filter.generate_clauses(@repo).to_sql end @@ -35,7 +38,7 @@ def test_errata_by_start_date_returns_arel_for_errata_by_issued_date_and_errata_ filter = id_rule.filter filter.reload - assert_equal "\"katello_errata\".\"issued\" >= '#{start_date}' AND \"katello_errata\".\"errata_type\" IN ('bugfix', 'enhancement', 'security')", + assert_equal "\"katello_errata\".\"issued\" >= '#{start_date}'" + TYPICAL_TYPES_RESPONSE, filter.generate_clauses(@repo).to_sql end @@ -45,7 +48,7 @@ def test_errata_by_end_date_returns_arel_for_errata_by_updated_date_and_errata_t filter = id_rule.filter filter.reload - assert_equal "\"katello_errata\".\"updated\" <= '#{end_date}' AND \"katello_errata\".\"errata_type\" IN ('bugfix', 'enhancement', 'security')", + assert_equal "\"katello_errata\".\"updated\" <= '#{end_date}'" + TYPICAL_TYPES_RESPONSE, filter.generate_clauses(@repo).to_sql end @@ -56,7 +59,7 @@ def test_errata_by_end_date_returns_arel_for_errata_by_issued_date_and_errata_ty filter = id_rule.filter filter.reload - assert_equal "\"katello_errata\".\"issued\" <= '#{end_date}' AND \"katello_errata\".\"errata_type\" IN ('bugfix', 'enhancement', 'security')", + assert_equal "\"katello_errata\".\"issued\" <= '#{end_date}'" + TYPICAL_TYPES_RESPONSE, filter.generate_clauses(@repo).to_sql end @@ -69,6 +72,16 @@ def test_errata_by_type_returns_arel_by_errata_type filter.generate_clauses(@repo).to_sql end + def test_errata_by_type_returns_arel_by_errata_type_other + id_rule = FactoryBot.create(:katello_content_view_erratum_filter_rule, :allow_other_types => true) + id_rule.update!(types: []) + filter = id_rule.filter + filter.reload + + assert_equal "\"katello_errata\".\"errata_type\" NOT IN ('security', 'bugfix', 'recommended', 'enhancement', 'optional')", + filter.generate_clauses(@repo).to_sql + end + def test_content_unit_pulp_ids_with_empty_errata_list_returns_empty_result rpm1 = @repo.rpms.first rpm2 = @repo.rpms.last @@ -209,13 +222,16 @@ def test_content_unit_pulp_ids_by_issued_end_date_returns_pulp_hrefs end def test_content_unit_pulp_ids_by_errata_type - rpm1 = @repo.rpms.first - rpm2 = @repo.rpms.last + rpm1 = @repo.rpms[0] + rpm2 = @repo.rpms[1] + rpm3 = @repo.rpms[2] erratum1 = Katello::Erratum.new(:pulp_id => "one", :errata_id => "ERRATA1", :errata_type => 'bugfix') erratum1.packages << Katello::ErratumPackage.new(:filename => rpm1.filename, :name => "e1", :nvrea => "e1") erratum2 = Katello::Erratum.new(:pulp_id => "two", :errata_id => "ERRATA2", :errata_type => 'security') erratum2.packages << Katello::ErratumPackage.new(:filename => rpm2.filename, :name => "e2", :nvrea => "e2") + erratum3 = Katello::Erratum.new(:pulp_id => "three", :errata_id => "ERRATA3", :errata_type => 'not_recognized') + erratum3.packages << Katello::ErratumPackage.new(:filename => rpm3.filename, :name => "e3", :nvrea => "e3") @repo.errata = [erratum2] @repo.save! @@ -226,5 +242,28 @@ def test_content_unit_pulp_ids_by_errata_type assert_equal [rpm2.pulp_id], filter.content_unit_pulp_ids(@repo) end + + def test_content_unit_pulp_ids_by_errata_type_other + rpm1 = @repo.rpms[0] + rpm2 = @repo.rpms[1] + rpm3 = @repo.rpms[2] + + erratum1 = Katello::Erratum.new(:pulp_id => "one", :errata_id => "ERRATA1", :errata_type => 'bugfix') + erratum1.packages << Katello::ErratumPackage.new(:filename => rpm1.filename, :name => "e1", :nvrea => "e1") + erratum2 = Katello::Erratum.new(:pulp_id => "two", :errata_id => "ERRATA2", :errata_type => 'security') + erratum2.packages << Katello::ErratumPackage.new(:filename => rpm2.filename, :name => "e2", :nvrea => "e2") + erratum3 = Katello::Erratum.new(:pulp_id => "three", :errata_id => "ERRATA3", :errata_type => 'not_recognized') + erratum3.packages << Katello::ErratumPackage.new(:filename => rpm3.filename, :name => "e3", :nvrea => "e3") + + @repo.errata = [erratum3] + @repo.save! + + id_rule = FactoryBot.create(:katello_content_view_erratum_filter_rule, :allow_other_types => true) + id_rule.update!(types: []) + filter = id_rule.filter + filter.reload + + assert_equal [rpm3.pulp_id], filter.content_unit_pulp_ids(@repo) + end end end diff --git a/webpack/scenes/ContentViews/Details/Filters/CVErrataDateFilterContent.js b/webpack/scenes/ContentViews/Details/Filters/CVErrataDateFilterContent.js index 8eb5c2204d9..eec33cb6263 100644 --- a/webpack/scenes/ContentViews/Details/Filters/CVErrataDateFilterContent.js +++ b/webpack/scenes/ContentViews/Details/Filters/CVErrataDateFilterContent.js @@ -46,7 +46,12 @@ const CVErrataDateFilterContent = ({ selectCVFilterDetails(state, cvId, filterId), shallowEqual); const { repositories = [], rules } = filterDetails; const [{ - id, types, start_date: ruleStartDate, end_date: ruleEndDate, date_type: ruleDateType, + id, + types, + allow_other_types: ruleAllowOtherTypes, + start_date: ruleStartDate, + end_date: ruleEndDate, + date_type: ruleDateType, } = {}] = rules; const { permissions } = details; const [startDate, setStartDate] = useState(convertAPIDateToUIFormat(ruleStartDate)); @@ -54,12 +59,20 @@ const CVErrataDateFilterContent = ({ const [dateType, setDateType] = useState(ruleDateType); const [dateTypeSelectOpen, setDateTypeSelectOpen] = useState(false); const [typeSelectOpen, setTypeSelectOpen] = useState(false); - const [selectedTypes, setSelectedTypes] = useState(types); const dispatch = useDispatch(); const [activeTabKey, setActiveTabKey] = useState(0); const [startEntry, setStartEntry] = useState(false); const [endEntry, setEndEntry] = useState(false); + const getInitialSelectedTypes = () => { + if (ruleAllowOtherTypes) { + return [...types, 'other']; + } + return types; + }; + + const [selectedTypes, setSelectedTypes] = useState(getInitialSelectedTypes()); + const onSave = () => { dispatch(editCVFilterRule( filterId, @@ -68,8 +81,9 @@ const CVErrataDateFilterContent = ({ content_view_filter_id: filterId, start_date: startDate && startDate !== '' ? dateParse(startDate) : null, end_date: endDate && endDate !== '' ? dateParse(endDate) : null, - types: selectedTypes, + types: selectedTypes.filter(e => e !== 'other'), date_type: dateType, + allow_other_types: selectedTypes.includes('other'), }, () => { dispatch({ type: CONTENT_VIEW_NEEDS_PUBLISH }); @@ -81,15 +95,21 @@ const CVErrataDateFilterContent = ({ const resetFilters = () => { setStartDate(convertAPIDateToUIFormat(ruleStartDate)); setEndDate(convertAPIDateToUIFormat(ruleEndDate)); - setSelectedTypes(types); setDateType(ruleDateType); + setSelectedTypes(getInitialSelectedTypes()); }; const onTypeSelect = (selection) => { if (selectedTypes.includes(selection)) { + // If the selection is the only selection remaining, do not allow it to be removed if (selectedTypes.length === 1) return; + + // Filter out the current selection to deselect it setSelectedTypes(selectedTypes.filter(e => e !== selection)); - } else setSelectedTypes([...selectedTypes, selection]); + } else { + // Add the selection to the selected types + setSelectedTypes([...selectedTypes, selection]); + } }; const singleSelection = selection => (selectedTypes.length === 1 @@ -99,7 +119,7 @@ const CVErrataDateFilterContent = ({ ( isEqual(convertAPIDateToUIFormat(ruleStartDate), startDate) && isEqual(convertAPIDateToUIFormat(ruleEndDate), endDate) && - isEqual(sortBy(types), sortBy(selectedTypes)) && + isEqual(sortBy(getInitialSelectedTypes()), sortBy(selectedTypes)) && isEqual(ruleDateType, dateType) ); @@ -171,6 +191,15 @@ const CVErrataDateFilterContent = ({ {__('Bugfix')}

+ +

+ {__('Other')} +

+
@@ -178,7 +207,7 @@ const CVErrataDateFilterContent = ({ diff --git a/webpack/scenes/ContentViews/Details/Filters/CVErrataIDFilterContent.js b/webpack/scenes/ContentViews/Details/Filters/CVErrataIDFilterContent.js index 479b0fefa06..aaba31870ef 100644 --- a/webpack/scenes/ContentViews/Details/Filters/CVErrataIDFilterContent.js +++ b/webpack/scenes/ContentViews/Details/Filters/CVErrataIDFilterContent.js @@ -60,7 +60,7 @@ const CVErrataIDFilterContent = ({ const hasNotAddedSelected = rows.some(({ selected, added }) => selected && !added); const [statusSelected, setStatusSelected] = useState(ALL_STATUSES); const [typeSelectOpen, setTypeSelectOpen] = useState(false); - const [selectedTypes, setSelectedTypes] = useState(ERRATA_TYPES); + const [selectedTypes, setSelectedTypes] = useState([...ERRATA_TYPES, 'other']); const [startDate, setStartDate] = useState(''); const [endDate, setEndDate] = useState(''); const activeFilters = [statusSelected, selectedTypes, startDate, endDate]; @@ -198,9 +198,15 @@ const CVErrataIDFilterContent = ({ const onTypeSelect = (selection) => { if (selectedTypes.includes(selection)) { + // If the selection is the only selection remaining, do not allow it to be removed if (selectedTypes.length === 1) return; + + // Filter out the current selection to deselect it setSelectedTypes(selectedTypes.filter(e => e !== selection)); - } else setSelectedTypes([...selectedTypes, selection]); + } else { + // Add the current selection to the selected types + setSelectedTypes([...selectedTypes, selection]); + } setTypeSelectOpen(false); }; @@ -326,6 +332,11 @@ const CVErrataIDFilterContent = ({ {__('Bugfix')}

+ +

+ {__('Other')} +

+
{hasPermission(permissions, 'edit_content_views') &&