diff --git a/app/models/folder_workflow.rb b/app/models/folder_workflow.rb index 3b9f70f77c..b426e85b42 100644 --- a/app/models/folder_workflow.rb +++ b/app/models/folder_workflow.rb @@ -25,10 +25,9 @@ def translate_state_from(workflow) end # States in which the record can be publicly viewable - # All states must be included here because any state is viewable if its container allows it # @return array of strings def self.public_read_states - [:needs_qa, :complete].map(&:to_s) + [:complete].map(&:to_s) end # States in which read groups for the record are indexable diff --git a/spec/decorators/valkyrie/resource_decorator_spec.rb b/spec/decorators/valkyrie/resource_decorator_spec.rb index ccbcd721f2..6306c6dc42 100644 --- a/spec/decorators/valkyrie/resource_decorator_spec.rb +++ b/spec/decorators/valkyrie/resource_decorator_spec.rb @@ -234,6 +234,14 @@ class MyResource < Resource expect(decorator.visibility.first).to have_selector("div.alert-warning", text: "Users will not be able to view this digital object on discovery sites due to the workflow status.") end end + + context "needs_qa open resource" do + let(:resource) { FactoryBot.build(:needs_qa_ephemera_folder) } + + it "has a warning about the workflow" do + expect(decorator.visibility.first).to have_selector("div.alert-warning", text: "Users will not be able to view this digital object on discovery sites due to the workflow status.") + end + end context "complete netid resource" do let(:resource) { FactoryBot.build(:complete_campus_only_scanned_resource) } diff --git a/spec/factories/ephemera_folder.rb b/spec/factories/ephemera_folder.rb index 7e384d5d4b..a97e3516c1 100644 --- a/spec/factories/ephemera_folder.rb +++ b/spec/factories/ephemera_folder.rb @@ -66,6 +66,10 @@ factory :complete_ephemera_folder do state { "complete" } end + factory :needs_qa_ephemera_folder do + visibility { Hydra::AccessControls::AccessRight::VISIBILITY_TEXT_VALUE_PUBLIC } + state { "needs_qa" } + end factory :non_validating_ephemera_folder do barcode { nil } end diff --git a/spec/factories/scanned_resource.rb b/spec/factories/scanned_resource.rb index a4a535550c..152eeaca45 100644 --- a/spec/factories/scanned_resource.rb +++ b/spec/factories/scanned_resource.rb @@ -89,6 +89,9 @@ factory :pending_scanned_resource do state { "pending" } end + factory :needs_qa_scanned_resource do + state { "needs_qa" } + end factory :draft_cdl_resource do state { "draft" } change_set { "CDL::Resource" }