From 9f5135431cfd22125edc0ac8102fd55b90e55659 Mon Sep 17 00:00:00 2001 From: Sarah Proctor Date: Fri, 19 Sep 2025 12:05:46 -0700 Subject: [PATCH 1/3] =?UTF-8?q?=E2=9A=99=EF=B8=8F=20Temporarily=20disable?= =?UTF-8?q?=20batch=5Fupload=20feature?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This commit prevents admin users from enabling batch_upload in settings. This addresses the issue that batch uploads and Valkyrized works are incompatible. The current Batch Add uses a fake Active Fedora form with fixed terms that ignore the selected work type, causing Valkyrie validations to fail (especially on 6.2). It was determined that fixing this issue is low-priority compared to general Bulkrax improvements. To ensure users are not enabling broken features, batch_upload is disabled until further decisions are made. Ref: - https://github.com/notch8/palni_palci_knapsack/issues/479 --- .../stylesheets/hyrax/_admin_features.scss | 18 ++++++++++++++ app/assets/stylesheets/hyrax/_hyrax.scss | 24 +++++++++---------- .../strategies/disable_feature_strategy.rb | 11 +++++++++ config/features.rb | 11 ++++++++- 4 files changed, 51 insertions(+), 13 deletions(-) create mode 100644 app/assets/stylesheets/hyrax/_admin_features.scss create mode 100644 app/strategies/hyrax/strategies/disable_feature_strategy.rb diff --git a/app/assets/stylesheets/hyrax/_admin_features.scss b/app/assets/stylesheets/hyrax/_admin_features.scss new file mode 100644 index 0000000000..92697a9488 --- /dev/null +++ b/app/assets/stylesheets/hyrax/_admin_features.scss @@ -0,0 +1,18 @@ +// Modify the batch_upload feature flipper to be disabled +tr[data-feature="batch-upload"] { + background-color: #f8f9fa; + + td.name { + color: #6c757d !important; + opacity: 0.65 !important; + } + + td.status .badge { + background-color: #dc3545 !important; + } + + td.toggle .btn-group { + pointer-events: none; + opacity: 0.5; + } +} diff --git a/app/assets/stylesheets/hyrax/_hyrax.scss b/app/assets/stylesheets/hyrax/_hyrax.scss index 18076b42f9..a4df07e582 100644 --- a/app/assets/stylesheets/hyrax/_hyrax.scss +++ b/app/assets/stylesheets/hyrax/_hyrax.scss @@ -1,16 +1,16 @@ @import "hyrax/variables", "hyrax/file_sets", "hyrax/settings", "hyrax/html", - "hyrax/header", "hyrax/styles", "hyrax/file-listing", - "hyrax/browse_everything_overrides", "hyrax/nestable", "hyrax/collections", - "hyrax/collection_types", "hyrax/batch-edit", "hyrax/home-page", - "hyrax/featured", "hyrax/usage-stats", "hyrax/catalog", "hyrax/buttons", - "hyrax/tinymce", "hyrax/proxy-rights", "hyrax/file-show", "hyrax/work-show", - "hyrax/modal", "hyrax/forms", "hyrax/form", "hyrax/file_manager", - "hyrax/form-progress", "hyrax/positioning", "hyrax/fixedsticky", - "hyrax/file_upload", "hyrax/representative-media", "hyrax/footer", - "hyrax/select_work_type", "hyrax/users", "hyrax/dashboard", "hyrax/sidebar", - "hyrax/controlled_vocabulary", "hyrax/accessibility", "hyrax/recent", - "hyrax/viewer", "hyrax/breadcrumbs", "hyrax/facets", "hyrax/card", - "hyrax/badge"; +"hyrax/header", "hyrax/styles", "hyrax/file-listing", +"hyrax/browse_everything_overrides", "hyrax/nestable", "hyrax/collections", +"hyrax/collection_types", "hyrax/batch-edit", "hyrax/home-page", +"hyrax/featured", "hyrax/usage-stats", "hyrax/catalog", "hyrax/buttons", +"hyrax/tinymce", "hyrax/proxy-rights", "hyrax/file-show", "hyrax/work-show", +"hyrax/modal", "hyrax/forms", "hyrax/form", "hyrax/file_manager", +"hyrax/form-progress", "hyrax/positioning", "hyrax/fixedsticky", +"hyrax/file_upload", "hyrax/representative-media", "hyrax/footer", +"hyrax/select_work_type", "hyrax/users", "hyrax/dashboard", "hyrax/sidebar", +"hyrax/controlled_vocabulary", "hyrax/accessibility", "hyrax/recent", +"hyrax/viewer", "hyrax/breadcrumbs", "hyrax/facets", "hyrax/card", +"hyrax/badge", "hyrax/admin_features"; @import "hydra-editor/multi_value_fields"; @import "typeahead"; @import "sharing_buttons"; diff --git a/app/strategies/hyrax/strategies/disable_feature_strategy.rb b/app/strategies/hyrax/strategies/disable_feature_strategy.rb new file mode 100644 index 0000000000..05896153b4 --- /dev/null +++ b/app/strategies/hyrax/strategies/disable_feature_strategy.rb @@ -0,0 +1,11 @@ +# frozen_string_literal: true +module Hyrax::Strategies + class DisableFeatureStrategy < Flipflop::Strategies::AbstractStrategy + def enabled?(feature) + # Set batch upload to disabled + return false if feature == :batch_upload + # Return nil to pass through to next strategy for other features + nil + end + end +end diff --git a/config/features.rb b/config/features.rb index f1d6a26dad..15a2780922 100644 --- a/config/features.rb +++ b/config/features.rb @@ -2,6 +2,8 @@ Flipflop.configure do # Strategies will be used in the order listed here. strategy :cookie + # Configuration to prevent features from being enabled + strategy Hyrax::Strategies::DisableFeatureStrategy strategy :active_record, class: Hyrax::Feature strategy Hyrax::Strategies::YamlStrategy, config: Hyrax.config.feature_config_path strategy :default @@ -32,6 +34,11 @@ feature :active_deposit_agreement_acceptance, default: Hyrax.config.active_deposit_agreement_acceptance?, description: "Require an active acceptance of the deposit agreement by checking a checkbox" + # rubocop:disable Layout/LineLength + feature :batch_upload, + default: false, + description: "NOTICE: This feature has been temporarily disabled. To add or upload works in bulk, please use the Bulkrax importer.".html_safe + # rubocop:enable Layout/LineLength # Note, if this is deactivated, a default admin set will be created and all # works will be assigned to it when they are created. @@ -39,9 +46,11 @@ default: true, description: "Ability to assign uploaded items to an admin set" + # rubocop:disable Layout/LineLength feature :batch_upload, default: false, - description: "Enable uploading batches of works" + description: "NOTICE: This feature has been temporarily disabled. To add or upload works in bulk, please use the Bulkrax importer.".html_safe + # rubocop:enable Layout/LineLength feature :proxy_deposit, default: true, From 5c6c4daad63204afea19936448d3545e92c76cc4 Mon Sep 17 00:00:00 2001 From: Sarah Proctor Date: Fri, 19 Sep 2025 14:06:43 -0700 Subject: [PATCH 2/3] =?UTF-8?q?=F0=9F=92=84=20Make=20Rubocop=20happy?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The longer explanation about the disabled feature and accompanying URL causes a long line error in Rubocop. Ignoring the offense. Ref: - https://github.com/notch8/palni_palci_knapsack/issues/479 --- config/features.rb | 5 ----- 1 file changed, 5 deletions(-) diff --git a/config/features.rb b/config/features.rb index 15a2780922..bbc1f02fa6 100644 --- a/config/features.rb +++ b/config/features.rb @@ -34,11 +34,6 @@ feature :active_deposit_agreement_acceptance, default: Hyrax.config.active_deposit_agreement_acceptance?, description: "Require an active acceptance of the deposit agreement by checking a checkbox" - # rubocop:disable Layout/LineLength - feature :batch_upload, - default: false, - description: "NOTICE: This feature has been temporarily disabled. To add or upload works in bulk, please use the Bulkrax importer.".html_safe - # rubocop:enable Layout/LineLength # Note, if this is deactivated, a default admin set will be created and all # works will be assigned to it when they are created. From 9f83c59b1283a8040d33472234041f1c2c427ba0 Mon Sep 17 00:00:00 2001 From: Sarah Proctor Date: Fri, 19 Sep 2025 15:39:58 -0700 Subject: [PATCH 3/3] =?UTF-8?q?=E2=9C=85=20Skipping=20tests=20to=20disable?= =?UTF-8?q?d=20batch=5Fupload=20feature?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Batch uploads have been disabled since batch uploads and Valkyrized works are incompatible. The current Batch Add uses a fake Active Fedora form with fixed terms that ignore the selected work type, causing Valkyrie validations to fail (especially on 6.2). It was determined that fixing this issue is low-priority compared to general Bulkrax improvements. This commit skips the batch_upload tests until further decisions are made. Ref: - https://github.com/samvera/hyrax/issues/7185 - https://github.com/notch8/palni_palci_knapsack/issues/479 --- spec/features/batch_edit_spec.rb | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/spec/features/batch_edit_spec.rb b/spec/features/batch_edit_spec.rb index 545fe5328d..c29ff618ab 100644 --- a/spec/features/batch_edit_spec.rb +++ b/spec/features/batch_edit_spec.rb @@ -48,6 +48,8 @@ describe 'editing' do it 'changes the value of each field for all selected works' do + skip 'due to temporarily disabling the batch_upload feature' + # Ref: https://github.com/samvera/hyrax/issues/7185 click_on 'batch-edit' fill_in_batch_edit_fields_and_verify! reloaded_work1 = wings_disabled ? Hyrax.query_service.find_by(id: work1.id) : work1.reload @@ -97,6 +99,8 @@ end it 'updates visibility' do + skip 'due to temporarily disabling the batch_upload feature' + # Ref: https://github.com/samvera/hyrax/issues/7185 click_on 'batch-edit' find('#edit_permissions_link').click batch_edit_expand('permissions_visibility')