Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
RDMS
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
researchdata
RDMS
Commits
393e096e
Commit
393e096e
authored
11 months ago
by
Gyan Gupta
Browse files
Options
Downloads
Patches
Plain Diff
Allow draft works to show in catalog search page
parent
36860412
Branches
bug_fix/allow-draft-works-to-show-in-catalog-search
Branches containing commit
Tags
Tags containing commit
1 merge request
!305
Allow draft works to show in catalog search page
Pipeline
#14465
passed
11 months ago
Stage: build
Stage: test
Stage: deploy
Changes
2
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
hyrax/app/search_builders/hyrax/filter_suppressed.rb
+17
-0
17 additions, 0 deletions
hyrax/app/search_builders/hyrax/filter_suppressed.rb
hyrax/config/initializers/catalog_search_builder_override.rb
+11
-0
11 additions, 0 deletions
hyrax/config/initializers/catalog_search_builder_override.rb
with
28 additions
and
0 deletions
hyrax/app/search_builders/hyrax/filter_suppressed.rb
0 → 100644
+
17
−
0
View file @
393e096e
# frozen_string_literal: true
module
Hyrax
# Injects a search builder filter to hide documents marked as suppressed
module
FilterSuppressed
extend
ActiveSupport
::
Concern
included
do
self
.
default_processor_chain
+=
[
:only_active_works
]
end
def
only_active_works
(
solr_parameters
)
return
if
blacklight_params
[
:controller
]
==
'catalog'
solr_parameters
[
:fq
]
||=
[]
solr_parameters
[
:fq
]
<<
'-suppressed_bsi:true'
end
end
end
\ No newline at end of file
This diff is collapsed.
Click to expand it.
hyrax/config/initializers/catalog_search_builder_override.rb
0 → 100644
+
11
−
0
View file @
393e096e
Rails
.
configuration
.
to_prepare
do
Hyrax
::
CatalogSearchBuilder
.
class_eval
do
# overide show works that are in the active state or not for catalog only.
def
show_only_active_records
(
solr_parameters
)
return
if
blacklight_params
[
:controller
]
==
'catalog'
solr_parameters
[
:fq
]
||=
[]
solr_parameters
[
:fq
]
<<
'-suppressed_bsi:true'
end
end
end
\ No newline at end of file
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment