├── tmp ├── pids │ └── .gitkeep └── .gitignore ├── .rspec ├── app ├── assets │ ├── builds │ │ └── .keep │ ├── stylesheets │ │ ├── registration.css │ │ ├── impersonate_groups.css │ │ ├── bulk-actions.css │ │ ├── search_results.css │ │ ├── profile.css │ │ ├── blacklight.scss │ │ ├── layout.css │ │ ├── renderjson.css │ │ ├── workflow_grid.css │ │ ├── document.css │ │ ├── variables.css │ │ ├── text-extraction.css │ │ └── bootstrap-overrides.css │ └── images │ │ └── favicon.ico ├── views │ ├── tags │ │ └── edit.html.erb │ ├── serials │ │ ├── edit.html.erb │ │ └── _edit.html.erb │ ├── catalog_record_ids │ │ └── edit.html.erb │ ├── profile │ │ ├── _search_header.html.erb │ │ ├── _table_row.html.erb │ │ └── _table_row_pivot.html.erb │ ├── report │ │ ├── _search_header.html.erb │ │ ├── _results_pagination.html.erb │ │ └── _workflow_grid.html.erb │ ├── bulk_actions │ │ ├── _default.html.erb │ │ ├── purge_jobs │ │ │ ├── new.turbo_stream.erb │ │ │ ├── new.html.erb │ │ │ └── _new.html.erb │ │ ├── rights_jobs │ │ │ ├── new.turbo_stream.erb │ │ │ ├── new.html.erb │ │ │ └── _new.html.erb │ │ ├── collection_jobs │ │ │ ├── new.turbo_stream.erb │ │ │ └── new.html.erb │ │ ├── export_tag_jobs │ │ │ ├── new.turbo_stream.erb │ │ │ ├── new.html.erb │ │ │ └── _new.html.erb │ │ ├── import_tag_jobs │ │ │ ├── new.turbo_stream.erb │ │ │ └── new.html.erb │ │ ├── reindex_jobs │ │ │ ├── new.turbo_stream.erb │ │ │ ├── new.html.erb │ │ │ └── _new.html.erb │ │ ├── republish_jobs │ │ │ ├── new.turbo_stream.erb │ │ │ ├── new.html.erb │ │ │ └── _new.html.erb │ │ ├── add_workflow_jobs │ │ │ ├── new.turbo_stream.erb │ │ │ ├── new.html.erb │ │ │ └── _new.html.erb │ │ ├── checksum_report_jobs │ │ │ ├── new.turbo_stream.erb │ │ │ ├── new.html.erb │ │ │ └── _new.html.erb │ │ ├── close_version_jobs │ │ │ ├── new.turbo_stream.erb │ │ │ ├── new.html.erb │ │ │ └── _new.html.erb │ │ ├── content_type_jobs │ │ │ ├── new.turbo_stream.erb │ │ │ └── new.html.erb │ │ ├── download_mods_jobs │ │ │ ├── new.turbo_stream.erb │ │ │ ├── new.html.erb │ │ │ └── _new.html.erb │ │ ├── governing_apo_jobs │ │ │ ├── new.turbo_stream.erb │ │ │ ├── new.html.erb │ │ │ └── _new.html.erb │ │ ├── manage_embargo_jobs │ │ │ ├── new.turbo_stream.erb │ │ │ └── new.html.erb │ │ ├── manage_release_jobs │ │ │ ├── new.turbo_stream.erb │ │ │ └── new.html.erb │ │ ├── new.html.erb │ │ ├── open_version_jobs │ │ │ ├── new.turbo_stream.erb │ │ │ ├── new.html.erb │ │ │ └── _new.html.erb │ │ ├── refresh_mods_jobs │ │ │ ├── new.turbo_stream.erb │ │ │ ├── new.html.erb │ │ │ └── _new.html.erb │ │ ├── register_druid_jobs │ │ │ ├── new.turbo_stream.erb │ │ │ └── new.html.erb │ │ ├── source_id_csv_jobs │ │ │ ├── new.turbo_stream.erb │ │ │ └── new.html.erb │ │ ├── text_extraction_jobs │ │ │ ├── new.turbo_stream.erb │ │ │ └── new.html.erb │ │ ├── virtual_object_jobs │ │ │ ├── new.turbo_stream.erb │ │ │ └── new.html.erb │ │ ├── apply_apo_defaults_jobs │ │ │ ├── new.turbo_stream.erb │ │ │ ├── new.html.erb │ │ │ └── _new.html.erb │ │ ├── export_catalog_links_jobs │ │ │ ├── new.turbo_stream.erb │ │ │ ├── new.html.erb │ │ │ └── _new.html.erb │ │ ├── export_cocina_json_jobs │ │ │ ├── new.turbo_stream.erb │ │ │ ├── new.html.erb │ │ │ └── _new.html.erb │ │ ├── export_structural_jobs │ │ │ ├── new.turbo_stream.erb │ │ │ ├── new.html.erb │ │ │ └── _new.html.erb │ │ ├── import_structural_jobs │ │ │ ├── new.turbo_stream.erb │ │ │ ├── new.html.erb │ │ │ └── _new.html.erb │ │ ├── tracking_sheet_report_jobs │ │ │ ├── new.turbo_stream.erb │ │ │ ├── new.html.erb │ │ │ └── _new.html.erb │ │ ├── descriptive_metadata_export_jobs │ │ │ ├── new.turbo_stream.erb │ │ │ ├── new.html.erb │ │ │ └── _new.html.erb │ │ ├── descriptive_metadata_import_jobs │ │ │ ├── new.turbo_stream.erb │ │ │ └── new.html.erb │ │ ├── license_and_rights_statement_jobs │ │ │ ├── new.turbo_stream.erb │ │ │ └── new.html.erb │ │ ├── validate_cocina_descriptive_jobs │ │ │ ├── new.turbo_stream.erb │ │ │ └── new.html.erb │ │ ├── catalog_record_id_and_barcode_csv_jobs │ │ │ ├── new.turbo_stream.erb │ │ │ └── new.html.erb │ │ ├── _errors.html.erb │ │ ├── _descmetadata_download_job.html.erb │ │ ├── _checksum_report_job.html.erb │ │ ├── _register_druids_job.html.erb │ │ ├── _export_cocina_json_job.html.erb │ │ ├── _export_tags_job.html.erb │ │ ├── _tracking_sheet_report_job.html.erb │ │ ├── _export_catalog_links_job.html.erb │ │ ├── _export_structural_job.html.erb │ │ ├── _descriptive_metadata_export_job.html.erb │ │ ├── old.html.erb │ │ └── _druids.html.erb │ ├── descriptives │ │ ├── edit.turbo_stream.erb │ │ └── edit.html.erb │ ├── apo │ │ ├── edit.html.erb │ │ ├── new.html.erb │ │ ├── _count_items.html.erb │ │ └── _count_collections.html.erb │ ├── dor │ │ └── query_by_id.rxml │ ├── items │ │ ├── error.html.erb │ │ ├── file.html.erb │ │ ├── source_id_ui.html.erb │ │ ├── set_governing_apo_ui.html.erb │ │ ├── collection_ui.html.erb │ │ ├── _collection_ui_line_item.html.erb │ │ ├── _edit_dro_rights.html.erb │ │ ├── _set_governing_apo_ui.html.erb │ │ ├── edit_barcode.html.erb │ │ ├── edit_copyright.html.erb │ │ ├── edit_license.html.erb │ │ ├── _edit_collection_rights.html.erb │ │ ├── edit_use_statement.html.erb │ │ └── _source_id_ui.html.erb │ ├── workflows │ │ ├── _history.html.erb │ │ ├── new.html.erb │ │ ├── history.html.erb │ │ ├── _new.html.erb │ │ └── show.html.erb │ ├── collections │ │ ├── _count.html.erb │ │ ├── new.html.erb │ │ └── new_modal.html.erb │ ├── structures │ │ ├── hierarchy.html.erb │ │ └── show.html.erb │ ├── embargos │ │ ├── edit.html.erb │ │ ├── new.html.erb │ │ └── _form.html.erb │ ├── catalog │ │ ├── _bulk_action_button.html.erb │ │ ├── _search_sidebar.html.erb │ │ ├── _lazy_project_tag_facet.html.erb │ │ ├── _lazy_wps_workflow_facet.html.erb │ │ ├── _lazy_nonproject_tag_facet.html.erb │ │ ├── _home_text.html.erb │ │ ├── _constraints.html.erb │ │ ├── _sort_widget.html.erb │ │ └── _show_releases.html.erb │ ├── layouts │ │ ├── one_column.html.erb │ │ └── catalog_result.html.erb │ ├── text_extraction │ │ └── new.html.erb │ ├── versions │ │ ├── close_ui.html.erb │ │ ├── open_ui.html.erb │ │ ├── _open_ui.html.erb │ │ └── _close_ui.html.erb │ ├── content_types │ │ └── edit.html.erb │ ├── shared │ │ ├── _header_navbar.html.erb │ │ └── _modal.html.erb │ ├── workflow_service │ │ ├── lock_assembling.html.erb │ │ ├── lock_inactive.html.erb │ │ ├── unlock_inactive.html.erb │ │ ├── unlock.html.erb │ │ └── lock.html.erb │ ├── manage_releases │ │ └── edit.html.erb │ ├── metadata │ │ └── descriptive.html.erb │ ├── files │ │ └── index.html.erb │ ├── tokens │ │ └── index.html.erb │ └── cocina_objects │ │ └── show.html.erb ├── components │ ├── show │ │ ├── tags_component.html.erb │ │ ├── workflow_error_component.html.erb │ │ ├── item │ │ │ ├── structure │ │ │ │ ├── file_component.html.erb │ │ │ │ ├── file_component.rb │ │ │ │ ├── file_hierarchy_component.rb │ │ │ │ └── directory_component.rb │ │ │ ├── access_rights_component.html.erb │ │ │ ├── overview_component.rb │ │ │ └── thumbnail_component.rb │ │ ├── apo │ │ │ ├── grant_component.html.erb │ │ │ ├── grant_component.rb │ │ │ ├── roles_component.html.erb │ │ │ └── details_component.rb │ │ ├── barcode_component.html.erb │ │ ├── license_component.html.erb │ │ ├── copyright_component.html.erb │ │ ├── collection │ │ │ ├── access_rights_component.html.erb │ │ │ ├── overview_component.rb │ │ │ └── access_rights_component.rb │ │ ├── use_statement_component.html.erb │ │ ├── source_id_component.html.erb │ │ ├── is_member_of_component.html.erb │ │ ├── collection_component.rb │ │ ├── admin_policy_component.rb │ │ ├── governed_by_component.html.erb │ │ ├── content_type_component.html.erb │ │ ├── catalog_record_id_component.html.erb │ │ ├── item_component.rb │ │ ├── agreement_component.rb │ │ ├── agreement │ │ │ ├── overview_component.rb │ │ │ └── details_component.rb │ │ ├── external_links_component.html.erb │ │ ├── source_id_component.rb │ │ ├── content_type_component.rb │ │ ├── barcode_component.rb │ │ ├── copyright_component.rb │ │ ├── ticket_tag_component.rb │ │ └── use_statement_component.rb │ ├── new_bulk_action_button_component.html.erb │ ├── spinner.html.erb │ ├── action_button.html.erb │ ├── spinner.rb │ ├── download_all_button_component.html.erb │ ├── workflow_grid_component.html.erb │ ├── open_close_component.html.erb │ ├── lazy_project_tag_facet_component.rb │ ├── contents │ │ ├── preservation_link_component.html.erb │ │ ├── stacks_link_component.html.erb │ │ ├── constituent_component.html.erb │ │ ├── constituent_component.rb │ │ ├── preservation_link_component.rb │ │ └── structural_component.html.erb │ ├── lazy_wps_workflow_facet_component.rb │ ├── lazy_nonproject_tag_facet_component.rb │ ├── throbber.html.erb │ ├── top_navbar_component.rb │ ├── alert_danger_component.rb │ ├── show_embargo_component.html.erb │ ├── throbber.rb │ ├── open_close_component.rb │ ├── search_navbar_component.html.erb │ ├── constraint_component.rb │ ├── blacklight_modal_component.rb │ ├── report_category_component.rb │ ├── manage_release │ │ ├── item_form_component.rb │ │ ├── collection_form_component.rb │ │ ├── form_component.html.erb │ │ └── form_component.rb │ ├── date_choice_facet_component.rb │ ├── alert_danger_component.html.erb │ ├── techmd_component.rb │ ├── workflow_update_button.html.erb │ ├── constraint_layout_component.rb │ ├── language_selector_component.rb │ ├── blacklight_modal_component.html.erb │ ├── version_milestones_component.html.erb │ ├── report_category_component.html.erb │ ├── edit_modal_component.rb │ ├── document_component.html.erb │ ├── edit_modal_component.html.erb │ ├── workflow_grid_component.rb │ └── document_component.rb ├── mailers │ └── application_mailer.rb ├── javascript │ ├── jquery-shim.js │ └── controllers │ │ ├── structural_controller.js │ │ ├── registration_controller.js │ │ └── multiselect_controller.js ├── models │ ├── application_record.rb │ ├── argo │ │ └── exceptions.rb │ ├── null_user.rb │ ├── view_switcher.rb │ └── druid.rb ├── controllers │ ├── profile_controller.rb │ ├── bulk_actions │ │ ├── purge_jobs_controller.rb │ │ ├── export_tag_jobs_controller.rb │ │ ├── reindex_jobs_controller.rb │ │ ├── republish_jobs_controller.rb │ │ ├── close_version_jobs_controller.rb │ │ ├── checksum_report_jobs_controller.rb │ │ ├── download_mods_jobs_controller.rb │ │ ├── export_cocina_json_jobs_controller.rb │ │ ├── export_structural_jobs_controller.rb │ │ ├── export_catalog_links_jobs_controller.rb │ │ ├── tracking_sheet_report_jobs_controller.rb │ │ ├── descriptive_metadata_export_jobs_controller.rb │ │ ├── add_workflow_jobs_controller.rb │ │ ├── refresh_mods_jobs_controller.rb │ │ ├── open_version_jobs_controller.rb │ │ ├── apply_apo_defaults_jobs_controller.rb │ │ ├── import_tag_jobs_controller.rb │ │ ├── text_extraction_jobs_controller.rb │ │ ├── manage_release_jobs_controller.rb │ │ ├── virtual_object_jobs_controller.rb │ │ ├── collection_jobs_controller.rb │ │ ├── rights_jobs_controller.rb │ │ ├── governing_apo_jobs_controller.rb │ │ ├── import_structural_jobs_controller.rb │ │ ├── source_id_csv_jobs_controller.rb │ │ ├── manage_embargo_jobs_controller.rb │ │ └── content_type_jobs_controller.rb │ ├── login_controller.rb │ ├── technicals_controller.rb │ └── events_controller.rb ├── services │ ├── purge_service.rb │ ├── mods_validator.rb │ ├── search_service.rb │ ├── deep_compact_blank.rb │ └── descriptions_grouper.rb ├── jobs │ ├── application_job.rb │ ├── close_version_job.rb │ ├── remote_indexing_job.rb │ ├── purge_job.rb │ ├── apply_apo_defaults_job.rb │ └── bulk_action_csv_job_item.rb ├── forms │ ├── application_change_set.rb │ ├── application_form.rb │ └── has_view_access_with_cdl.rb ├── presenters │ ├── workflow_xml_presenter.rb │ ├── argo_index_presenter.rb │ ├── home_text_presenter.rb │ └── date_presenter.rb ├── helpers │ ├── profile_helper.rb │ ├── bulk_action_helper.rb │ └── apo_helper.rb └── search_builders │ ├── report_search_builder.rb │ └── argo │ └── custom_search.rb ├── vendor └── plugins │ └── .gitkeep ├── config ├── default_htaccess_directives ├── sidekiq.yml ├── settings │ ├── development.yml │ └── test.yml ├── initializers │ ├── more_mime_types.rb │ ├── nokogiri_backend.rb │ ├── load_abbyy_languages.rb │ ├── lograge.rb │ ├── purl_fetcher_client.rb │ ├── prawn_setup.rb │ ├── session_store.rb │ ├── mime_types.rb │ ├── preservation_client.rb │ ├── sidekiq.rb │ ├── dor_services_client.rb │ ├── config.rb │ ├── cookies_serializer.rb │ ├── application_controller_renderer.rb │ ├── bootstrap5_form_errors.rb │ ├── assets.rb │ ├── filter_parameter_logging.rb │ ├── folio_client.rb │ ├── permissions_policy.rb │ ├── secret_token.rb │ ├── wrap_parameters.rb │ └── backtrace_silencers.rb ├── certs │ └── README.rdoc ├── environment.rb ├── blacklight.yml ├── spring.rb ├── deploy │ ├── qa.rb │ ├── prod.rb │ └── stage.rb ├── boot.rb ├── cable.yml ├── locales │ └── blacklight.en.yml └── setup_load_paths.rb ├── solr_conf └── conf │ └── spellings.txt ├── .overmind.env ├── public ├── icon.png ├── 404-dog.png ├── robots.txt └── icon.svg ├── .dockerignore ├── log ├── .gitignore └── profiler │ └── .gitignore ├── spec ├── fixtures │ ├── files │ │ ├── item_registration.csv │ │ ├── character-test.csv │ │ ├── catalog_record_id_and_barcode.csv │ │ ├── catalog_record_id_and_barcode_utf8.csv │ │ ├── crowdsourcing_bridget_1.xlsx │ │ ├── invalid_bulk_upload_nonutf8.csv │ │ ├── item_registration_incomplete.csv │ │ ├── catalog_record_id_and_barcode.ods │ │ ├── catalog_record_id_and_barcode.xls │ │ ├── catalog_record_id_and_barcode.xlsx │ │ ├── catalog_record_id_and_barcode.bogus │ │ ├── null-descriptive-blank-end-rows.csv │ │ ├── catalog_record_id_and_barcode_extra_columns.csv │ │ ├── catalog_record_id_and_barcode_with_whitespace.csv │ │ ├── catalog_record_id_and_barcode_preamble.csv │ │ ├── structure-upload.csv │ │ ├── descriptive-upload-bad.csv │ │ ├── bulk_upload_structural.csv │ │ └── invalid_bulk_upload_structural.csv │ └── bulk_upload │ │ └── workspace │ │ └── druid:bc682xk5613 │ │ ├── 2016_05_02_22_39_44_008 │ │ ├── crowdsourcing_bridget_1-MODS.xml │ │ ├── log.csv │ │ └── log.txt.moved │ │ ├── 2016_04_21_16_56_40_824 │ │ ├── log.csv │ │ └── log.txt │ │ ├── 2016_04_21_17_22_16_520 │ │ ├── log.csv │ │ └── log.txt │ │ ├── 2016_04_21_17_34_02_445 │ │ ├── log.csv │ │ └── log.txt │ │ └── 2016_04_21_17_08_53_345 │ │ └── log.txt ├── factories │ ├── user.rb │ └── bulk_action.rb ├── support │ ├── fixtures.rb │ ├── factory_bot.rb │ ├── test_view_helpers.rb │ ├── collection_method_sender.rb │ ├── apo_method_sender.rb │ ├── signin_helper.rb │ ├── create_strategy_repository_pattern.rb │ └── feature_sessions.rb ├── views │ ├── workflows │ │ ├── _history.html.erb_spec.rb │ │ ├── show.html.erb_spec.rb │ │ ├── history.html.erb_spec.rb │ │ ├── new.html.erb_spec.rb │ │ └── _new.html.erb_spec.rb │ ├── items │ │ ├── file.html.erb_spec.rb │ │ ├── source_id_ui.html.erb_spec.rb │ │ ├── collection_ui.html.erb_spec.rb │ │ ├── set_governing_apo_ui.html.erb_spec.rb │ │ └── _source_id_ui.html.erb_spec.rb │ ├── content_types │ │ └── edit.html.erb_spec.rb │ ├── versions │ │ ├── close_ui.html.erb_spec.rb │ │ ├── open_ui.html.erb_spec.rb │ │ ├── _open_ui.html.erb_spec.rb │ │ └── _close_ui.html.erb_spec.rb │ ├── embargos │ │ └── edit.html.erb_spec.rb │ └── uploads │ │ └── new.html.erb_spec.rb ├── helpers │ ├── application_helper_spec.rb │ ├── profile_helper_spec.rb │ └── bulk_action_helper_spec.rb ├── routing │ ├── profile_spec.rb │ ├── report_routing_spec.rb │ └── workflows_spec.rb ├── components │ ├── report_category_component_spec.rb │ ├── open_close_component_spec.rb │ ├── contents │ │ └── constituent_component_spec.rb │ └── blacklight_modal_component_spec.rb ├── models │ └── view_switcher_spec.rb ├── requests │ ├── create_new_admin_policy_spec.rb │ ├── display_workflow_grid_spec.rb │ └── bulk_actions │ │ └── manage_embargo_job_spec.rb ├── spec_helper.rb ├── system │ └── full_width_spec.rb ├── presenters │ └── workflow_xml_presenter_spec.rb └── services │ ├── purge_service_spec.rb │ └── description_export_spec.rb ├── bin ├── rake ├── rails ├── rubocop ├── server ├── dev ├── sidekiq └── spring ├── .gitattributes ├── Procfile.dev ├── docker └── Dockerfile-solr ├── db └── migrate │ ├── 20200709002946_drop_table_delayed_jobs.rb │ ├── 20110819234506_create_users.rb │ ├── 20251007125342_change_bulk_action_description.rb │ ├── 20110820000003_create_searches.rb │ ├── 20110820000005_remove_editable_fields_from_bookmarks.rb │ ├── 20150128201043_add_polymorphic_type_to_bookmarks.blacklight.rb │ ├── 20240801155124_remove_not_null_on_active_storage_blobs_checksum.active_storage.rb │ ├── 20121011191241_create_indexing_exceptions.rb │ ├── 20110820000004_create_bookmarks.rb │ ├── 20160114000925_create_bulk_actions.rb │ ├── 20210406023300_add_foreign_key_constraint_to_active_storage_attachments_for_blob_id.active_storage.rb │ ├── 20110820000006_add_user_types_to_bookmarks_searches.rb │ └── 20180510050959_drop_wfs_rails_workflows.rb ├── config.ru ├── Rakefile ├── .eslintrc.js ├── .github └── pull_request_template.md ├── lib └── test_shibboleth_headers.rb └── LICENSE /tmp/pids/.gitkeep: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /.rspec: -------------------------------------------------------------------------------- 1 | --colour 2 | -------------------------------------------------------------------------------- /app/assets/builds/.keep: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /vendor/plugins/.gitkeep: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /config/default_htaccess_directives: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /app/assets/stylesheets/registration.css: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /app/views/tags/edit.html.erb: -------------------------------------------------------------------------------- 1 | <%= render 'edit' %> 2 | -------------------------------------------------------------------------------- /solr_conf/conf/spellings.txt: -------------------------------------------------------------------------------- 1 | pizza 2 | history 3 | -------------------------------------------------------------------------------- /app/views/serials/edit.html.erb: -------------------------------------------------------------------------------- 1 | <%= render 'edit' %> 2 | -------------------------------------------------------------------------------- /app/views/catalog_record_ids/edit.html.erb: -------------------------------------------------------------------------------- 1 | <%= render 'edit' %> 2 | -------------------------------------------------------------------------------- /config/sidekiq.yml: -------------------------------------------------------------------------------- 1 | :concurrency: 6 2 | :queues: 3 | - default 4 | -------------------------------------------------------------------------------- /.overmind.env: -------------------------------------------------------------------------------- 1 | OVERMIND_PROCFILE=Procfile.dev 2 | OVERMIND_PORT=3000 3 | -------------------------------------------------------------------------------- /app/components/show/tags_component.html.erb: -------------------------------------------------------------------------------- 1 | <%= tags %> <%= edit_tags %> 2 | -------------------------------------------------------------------------------- /public/icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sul-dlss/argo/HEAD/public/icon.png -------------------------------------------------------------------------------- /app/views/profile/_search_header.html.erb: -------------------------------------------------------------------------------- 1 | <%= render 'catalog/report_view_toggle' %> 2 | -------------------------------------------------------------------------------- /app/views/report/_search_header.html.erb: -------------------------------------------------------------------------------- 1 | <%= render 'catalog/report_view_toggle' %> 2 | -------------------------------------------------------------------------------- /public/404-dog.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sul-dlss/argo/HEAD/public/404-dog.png -------------------------------------------------------------------------------- /app/views/bulk_actions/_default.html.erb: -------------------------------------------------------------------------------- 1 | <%# No output produced in the default case %> 2 | -------------------------------------------------------------------------------- /app/views/report/_results_pagination.html.erb: -------------------------------------------------------------------------------- 1 | <%# Don't draw pagination for reports %> 2 | -------------------------------------------------------------------------------- /.dockerignore: -------------------------------------------------------------------------------- 1 | /log/* 2 | /tmp/* 3 | /node_modules 4 | /.bundle 5 | /public/assets 6 | /_*/ 7 | -------------------------------------------------------------------------------- /config/settings/development.yml: -------------------------------------------------------------------------------- 1 | # URLs 2 | solrizer_url: 'http://localhost:8983/solr/argo' 3 | -------------------------------------------------------------------------------- /app/views/report/_workflow_grid.html.erb: -------------------------------------------------------------------------------- 1 | <%= render WorkflowGridComponent.new(data: @facet_tree) %> 2 | -------------------------------------------------------------------------------- /log/.gitignore: -------------------------------------------------------------------------------- 1 | # Ignore everything in this directory 2 | * 3 | # Except this file 4 | !.gitignore 5 | -------------------------------------------------------------------------------- /app/assets/images/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sul-dlss/argo/HEAD/app/assets/images/favicon.ico -------------------------------------------------------------------------------- /spec/fixtures/files/item_registration.csv: -------------------------------------------------------------------------------- 1 | source_id,catkey,barcode,label 2 | foo:123,,,My new object 3 | -------------------------------------------------------------------------------- /app/assets/stylesheets/impersonate_groups.css: -------------------------------------------------------------------------------- 1 | .auth-groups { 2 | margin: 0 auto; 3 | width: 500px; 4 | } 5 | -------------------------------------------------------------------------------- /app/views/descriptives/edit.turbo_stream.erb: -------------------------------------------------------------------------------- 1 | <%= turbo_stream.replace("descriptive-form", partial: 'form') %> 2 | -------------------------------------------------------------------------------- /log/profiler/.gitignore: -------------------------------------------------------------------------------- 1 | # Ignore everything in this directory 2 | * 3 | # Except this file 4 | !.gitignore 5 | -------------------------------------------------------------------------------- /spec/fixtures/bulk_upload/workspace/druid:bc682xk5613/2016_05_02_22_39_44_008/crowdsourcing_bridget_1-MODS.xml: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /bin/rake: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env ruby 2 | require_relative "../config/boot" 3 | require "rake" 4 | Rake.application.run 5 | -------------------------------------------------------------------------------- /app/assets/stylesheets/bulk-actions.css: -------------------------------------------------------------------------------- 1 | .new_bulk_action { 2 | .help-block { 3 | font-weight: bold; 4 | } 5 | } 6 | -------------------------------------------------------------------------------- /app/assets/stylesheets/search_results.css: -------------------------------------------------------------------------------- 1 | .report-toggle { 2 | display: inline-block; 3 | position: relative; 4 | } 5 | -------------------------------------------------------------------------------- /app/components/show/workflow_error_component.html.erb: -------------------------------------------------------------------------------- 1 | <%= render AlertDangerComponent.new(text: workflow_errors) %> 2 | -------------------------------------------------------------------------------- /app/views/apo/edit.html.erb: -------------------------------------------------------------------------------- 1 | <% @page_title = 'Edit APO' %> 2 | 3 |

Edit APO

4 | 5 | <%= render 'form' %> 6 | -------------------------------------------------------------------------------- /app/views/bulk_actions/purge_jobs/new.turbo_stream.erb: -------------------------------------------------------------------------------- 1 | <%= turbo_stream.replace("bulk-action-form", partial: 'new') %> 2 | -------------------------------------------------------------------------------- /app/views/bulk_actions/rights_jobs/new.turbo_stream.erb: -------------------------------------------------------------------------------- 1 | <%= turbo_stream.replace("bulk-action-form", partial: 'new') %> 2 | -------------------------------------------------------------------------------- /app/views/dor/query_by_id.rxml: -------------------------------------------------------------------------------- 1 | xml.objects do 2 | data.each do |values| 3 | xml.object(values) 4 | end 5 | end 6 | -------------------------------------------------------------------------------- /app/views/items/error.html.erb: -------------------------------------------------------------------------------- 1 | <%= message %> 2 | -------------------------------------------------------------------------------- /config/initializers/more_mime_types.rb: -------------------------------------------------------------------------------- 1 | # frozen_string_literal: true 2 | 3 | Mime::Type.register 'image/svg+xml', :svg 4 | -------------------------------------------------------------------------------- /public/robots.txt: -------------------------------------------------------------------------------- 1 | # See https://www.robotstxt.org/robotstxt.html for documentation on how to use the robots.txt file 2 | -------------------------------------------------------------------------------- /app/mailers/application_mailer.rb: -------------------------------------------------------------------------------- 1 | # frozen_string_literal: true 2 | 3 | class ApplicationMailer < ActionMailer::Base; end 4 | -------------------------------------------------------------------------------- /app/views/apo/new.html.erb: -------------------------------------------------------------------------------- 1 | <% @page_title = 'Register APO' %> 2 | 3 |

Register APO

4 | 5 | <%= render 'form' %> 6 | -------------------------------------------------------------------------------- /app/views/bulk_actions/collection_jobs/new.turbo_stream.erb: -------------------------------------------------------------------------------- 1 | <%= turbo_stream.replace("bulk-action-form", partial: 'new') %> 2 | -------------------------------------------------------------------------------- /app/views/bulk_actions/export_tag_jobs/new.turbo_stream.erb: -------------------------------------------------------------------------------- 1 | <%= turbo_stream.replace("bulk-action-form", partial: 'new') %> 2 | -------------------------------------------------------------------------------- /app/views/bulk_actions/import_tag_jobs/new.turbo_stream.erb: -------------------------------------------------------------------------------- 1 | <%= turbo_stream.replace("bulk-action-form", partial: 'new') %> 2 | -------------------------------------------------------------------------------- /app/views/bulk_actions/reindex_jobs/new.turbo_stream.erb: -------------------------------------------------------------------------------- 1 | <%= turbo_stream.replace("bulk-action-form", partial: 'new') %> 2 | -------------------------------------------------------------------------------- /app/views/bulk_actions/republish_jobs/new.turbo_stream.erb: -------------------------------------------------------------------------------- 1 | <%= turbo_stream.replace("bulk-action-form", partial: 'new') %> 2 | -------------------------------------------------------------------------------- /app/views/workflows/_history.html.erb: -------------------------------------------------------------------------------- 1 | <%= CodeRay::Duo[:xml, :div].highlight(PrettyXml.print(@history_xml)).html_safe %> 2 | -------------------------------------------------------------------------------- /config/initializers/nokogiri_backend.rb: -------------------------------------------------------------------------------- 1 | # frozen_string_literal: true 2 | 3 | ActiveSupport::XmlMini.backend = 'Nokogiri' 4 | -------------------------------------------------------------------------------- /spec/fixtures/files/character-test.csv: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sul-dlss/argo/HEAD/spec/fixtures/files/character-test.csv -------------------------------------------------------------------------------- /app/components/new_bulk_action_button_component.html.erb: -------------------------------------------------------------------------------- 1 | <%= link_to 'New Bulk Action', link_path, class: 'btn btn-primary' %> 2 | -------------------------------------------------------------------------------- /app/javascript/jquery-shim.js: -------------------------------------------------------------------------------- 1 | import jquery from 'jquery' 2 | 3 | window.jQuery = jquery // for jquery-ui 4 | window.$ = jquery 5 | -------------------------------------------------------------------------------- /app/views/bulk_actions/add_workflow_jobs/new.turbo_stream.erb: -------------------------------------------------------------------------------- 1 | <%= turbo_stream.replace("bulk-action-form", partial: 'new') %> 2 | -------------------------------------------------------------------------------- /app/views/bulk_actions/checksum_report_jobs/new.turbo_stream.erb: -------------------------------------------------------------------------------- 1 | <%= turbo_stream.replace("bulk-action-form", partial: 'new') %> 2 | -------------------------------------------------------------------------------- /app/views/bulk_actions/close_version_jobs/new.turbo_stream.erb: -------------------------------------------------------------------------------- 1 | <%= turbo_stream.replace("bulk-action-form", partial: 'new') %> 2 | -------------------------------------------------------------------------------- /app/views/bulk_actions/content_type_jobs/new.turbo_stream.erb: -------------------------------------------------------------------------------- 1 | <%= turbo_stream.replace("bulk-action-form", partial: 'new') %> 2 | -------------------------------------------------------------------------------- /app/views/bulk_actions/download_mods_jobs/new.turbo_stream.erb: -------------------------------------------------------------------------------- 1 | <%= turbo_stream.replace("bulk-action-form", partial: 'new') %> 2 | -------------------------------------------------------------------------------- /app/views/bulk_actions/governing_apo_jobs/new.turbo_stream.erb: -------------------------------------------------------------------------------- 1 | <%= turbo_stream.replace("bulk-action-form", partial: 'new') %> 2 | -------------------------------------------------------------------------------- /app/views/bulk_actions/manage_embargo_jobs/new.turbo_stream.erb: -------------------------------------------------------------------------------- 1 | <%= turbo_stream.replace("bulk-action-form", partial: 'new') %> 2 | -------------------------------------------------------------------------------- /app/views/bulk_actions/manage_release_jobs/new.turbo_stream.erb: -------------------------------------------------------------------------------- 1 | <%= turbo_stream.replace("bulk-action-form", partial: 'new') %> 2 | -------------------------------------------------------------------------------- /app/views/bulk_actions/new.html.erb: -------------------------------------------------------------------------------- 1 | <% @page_title = 'New bulk action' %> 2 | 3 | <%= render BulkActionsFormComponent.new %> 4 | -------------------------------------------------------------------------------- /app/views/bulk_actions/open_version_jobs/new.turbo_stream.erb: -------------------------------------------------------------------------------- 1 | <%= turbo_stream.replace("bulk-action-form", partial: 'new') %> 2 | -------------------------------------------------------------------------------- /app/views/bulk_actions/purge_jobs/new.html.erb: -------------------------------------------------------------------------------- 1 | 2 | <%= render 'new' %> 3 | 4 | -------------------------------------------------------------------------------- /app/views/bulk_actions/refresh_mods_jobs/new.turbo_stream.erb: -------------------------------------------------------------------------------- 1 | <%= turbo_stream.replace("bulk-action-form", partial: 'new') %> 2 | -------------------------------------------------------------------------------- /app/views/bulk_actions/register_druid_jobs/new.turbo_stream.erb: -------------------------------------------------------------------------------- 1 | <%= turbo_stream.replace("bulk-action-form", partial: 'new') %> 2 | -------------------------------------------------------------------------------- /app/views/bulk_actions/reindex_jobs/new.html.erb: -------------------------------------------------------------------------------- 1 | 2 | <%= render 'new' %> 3 | 4 | -------------------------------------------------------------------------------- /app/views/bulk_actions/rights_jobs/new.html.erb: -------------------------------------------------------------------------------- 1 | 2 | <%= render 'new' %> 3 | 4 | -------------------------------------------------------------------------------- /app/views/bulk_actions/source_id_csv_jobs/new.turbo_stream.erb: -------------------------------------------------------------------------------- 1 | <%= turbo_stream.replace("bulk-action-form", partial: 'new') %> 2 | -------------------------------------------------------------------------------- /app/views/bulk_actions/text_extraction_jobs/new.turbo_stream.erb: -------------------------------------------------------------------------------- 1 | <%= turbo_stream.replace("bulk-action-form", partial: 'new') %> 2 | -------------------------------------------------------------------------------- /app/views/bulk_actions/virtual_object_jobs/new.turbo_stream.erb: -------------------------------------------------------------------------------- 1 | <%= turbo_stream.replace("bulk-action-form", partial: 'new') %> 2 | -------------------------------------------------------------------------------- /spec/fixtures/files/catalog_record_id_and_barcode.csv: -------------------------------------------------------------------------------- 1 | Druid,Catkey,Barcode 2 | druid:bb396kf5077,13157971, 3 | bb631ry3167,13965062, -------------------------------------------------------------------------------- /app/views/bulk_actions/add_workflow_jobs/new.html.erb: -------------------------------------------------------------------------------- 1 | 2 | <%= render 'new' %> 3 | 4 | -------------------------------------------------------------------------------- /app/views/bulk_actions/apply_apo_defaults_jobs/new.turbo_stream.erb: -------------------------------------------------------------------------------- 1 | <%= turbo_stream.replace("bulk-action-form", partial: 'new') %> 2 | -------------------------------------------------------------------------------- /app/views/bulk_actions/collection_jobs/new.html.erb: -------------------------------------------------------------------------------- 1 | 2 | <%= render 'new' %> 3 | 4 | -------------------------------------------------------------------------------- /app/views/bulk_actions/content_type_jobs/new.html.erb: -------------------------------------------------------------------------------- 1 | 2 | <%= render 'new' %> 3 | 4 | -------------------------------------------------------------------------------- /app/views/bulk_actions/export_catalog_links_jobs/new.turbo_stream.erb: -------------------------------------------------------------------------------- 1 | <%= turbo_stream.replace("bulk-action-form", partial: 'new') %> 2 | -------------------------------------------------------------------------------- /app/views/bulk_actions/export_cocina_json_jobs/new.turbo_stream.erb: -------------------------------------------------------------------------------- 1 | <%= turbo_stream.replace("bulk-action-form", partial: 'new') %> 2 | -------------------------------------------------------------------------------- /app/views/bulk_actions/export_structural_jobs/new.turbo_stream.erb: -------------------------------------------------------------------------------- 1 | <%= turbo_stream.replace("bulk-action-form", partial: 'new') %> 2 | -------------------------------------------------------------------------------- /app/views/bulk_actions/export_tag_jobs/new.html.erb: -------------------------------------------------------------------------------- 1 | 2 | <%= render 'new' %> 3 | 4 | -------------------------------------------------------------------------------- /app/views/bulk_actions/import_structural_jobs/new.turbo_stream.erb: -------------------------------------------------------------------------------- 1 | <%= turbo_stream.replace("bulk-action-form", partial: 'new') %> 2 | -------------------------------------------------------------------------------- /app/views/bulk_actions/import_tag_jobs/new.html.erb: -------------------------------------------------------------------------------- 1 | 2 | <%= render 'new' %> 3 | 4 | -------------------------------------------------------------------------------- /app/views/bulk_actions/open_version_jobs/new.html.erb: -------------------------------------------------------------------------------- 1 | 2 | <%= render 'new' %> 3 | 4 | -------------------------------------------------------------------------------- /app/views/bulk_actions/refresh_mods_jobs/new.html.erb: -------------------------------------------------------------------------------- 1 | 2 | <%= render 'new' %> 3 | 4 | -------------------------------------------------------------------------------- /app/views/bulk_actions/republish_jobs/new.html.erb: -------------------------------------------------------------------------------- 1 | 2 | <%= render 'new' %> 3 | 4 | -------------------------------------------------------------------------------- /app/views/bulk_actions/tracking_sheet_report_jobs/new.turbo_stream.erb: -------------------------------------------------------------------------------- 1 | <%= turbo_stream.replace("bulk-action-form", partial: 'new') %> 2 | -------------------------------------------------------------------------------- /spec/fixtures/files/catalog_record_id_and_barcode_utf8.csv: -------------------------------------------------------------------------------- 1 | Druid,Catkey,Barcode 2 | druid:bb396kf5077,13157971, 3 | bb631ry3167,13965062, -------------------------------------------------------------------------------- /.gitattributes: -------------------------------------------------------------------------------- 1 | Gemfile.lock linguist-generated=true 2 | yarn.lock linguist-generated=true 3 | .rubocop_todo.yml linguist-generated=true 4 | -------------------------------------------------------------------------------- /Procfile.dev: -------------------------------------------------------------------------------- 1 | web: unset PORT && bin/rails server 2 | css: yarn install && yarn watch:css 3 | js: yarn build --watch 4 | workers: bin/sidekiq -------------------------------------------------------------------------------- /app/components/spinner.html.erb: -------------------------------------------------------------------------------- 1 |
2 | Loading... 3 |
4 | -------------------------------------------------------------------------------- /app/views/bulk_actions/checksum_report_jobs/new.html.erb: -------------------------------------------------------------------------------- 1 | 2 | <%= render 'new' %> 3 | 4 | -------------------------------------------------------------------------------- /app/views/bulk_actions/close_version_jobs/new.html.erb: -------------------------------------------------------------------------------- 1 | 2 | <%= render 'new' %> 3 | 4 | -------------------------------------------------------------------------------- /app/views/bulk_actions/download_mods_jobs/new.html.erb: -------------------------------------------------------------------------------- 1 | 2 | <%= render 'new' %> 3 | 4 | -------------------------------------------------------------------------------- /app/views/bulk_actions/export_structural_jobs/new.html.erb: -------------------------------------------------------------------------------- 1 | 2 | <%= render 'new' %> 3 | 4 | -------------------------------------------------------------------------------- /app/views/bulk_actions/governing_apo_jobs/new.html.erb: -------------------------------------------------------------------------------- 1 | 2 | <%= render 'new' %> 3 | 4 | -------------------------------------------------------------------------------- /app/views/bulk_actions/import_structural_jobs/new.html.erb: -------------------------------------------------------------------------------- 1 | 2 | <%= render 'new' %> 3 | 4 | -------------------------------------------------------------------------------- /app/views/bulk_actions/manage_embargo_jobs/new.html.erb: -------------------------------------------------------------------------------- 1 | 2 | <%= render 'new' %> 3 | 4 | -------------------------------------------------------------------------------- /app/views/bulk_actions/manage_release_jobs/new.html.erb: -------------------------------------------------------------------------------- 1 | 2 | <%= render 'new' %> 3 | 4 | -------------------------------------------------------------------------------- /app/views/bulk_actions/register_druid_jobs/new.html.erb: -------------------------------------------------------------------------------- 1 | 2 | <%= render 'new' %> 3 | 4 | -------------------------------------------------------------------------------- /app/views/bulk_actions/source_id_csv_jobs/new.html.erb: -------------------------------------------------------------------------------- 1 | 2 | <%= render 'new' %> 3 | 4 | -------------------------------------------------------------------------------- /app/views/bulk_actions/virtual_object_jobs/new.html.erb: -------------------------------------------------------------------------------- 1 | 2 | <%= render 'new' %> 3 | 4 | -------------------------------------------------------------------------------- /config/certs/README.rdoc: -------------------------------------------------------------------------------- 1 | == Certificates 2 | 3 | Dor-services uses certs for client authentication. When you get them, put them in here. 4 | -------------------------------------------------------------------------------- /app/views/bulk_actions/apply_apo_defaults_jobs/new.html.erb: -------------------------------------------------------------------------------- 1 | 2 | <%= render 'new' %> 3 | 4 | -------------------------------------------------------------------------------- /app/views/bulk_actions/descriptive_metadata_export_jobs/new.turbo_stream.erb: -------------------------------------------------------------------------------- 1 | <%= turbo_stream.replace("bulk-action-form", partial: 'new') %> 2 | -------------------------------------------------------------------------------- /app/views/bulk_actions/descriptive_metadata_import_jobs/new.turbo_stream.erb: -------------------------------------------------------------------------------- 1 | <%= turbo_stream.replace("bulk-action-form", partial: 'new') %> 2 | -------------------------------------------------------------------------------- /app/views/bulk_actions/export_catalog_links_jobs/new.html.erb: -------------------------------------------------------------------------------- 1 | 2 | <%= render 'new' %> 3 | 4 | -------------------------------------------------------------------------------- /app/views/bulk_actions/export_cocina_json_jobs/new.html.erb: -------------------------------------------------------------------------------- 1 | 2 | <%= render 'new' %> 3 | 4 | -------------------------------------------------------------------------------- /app/views/bulk_actions/license_and_rights_statement_jobs/new.turbo_stream.erb: -------------------------------------------------------------------------------- 1 | <%= turbo_stream.replace("bulk-action-form", partial: 'new') %> 2 | -------------------------------------------------------------------------------- /app/views/bulk_actions/tracking_sheet_report_jobs/new.html.erb: -------------------------------------------------------------------------------- 1 | 2 | <%= render 'new' %> 3 | 4 | -------------------------------------------------------------------------------- /app/views/bulk_actions/validate_cocina_descriptive_jobs/new.turbo_stream.erb: -------------------------------------------------------------------------------- 1 | <%= turbo_stream.replace("bulk-action-form", partial: 'new') %> 2 | -------------------------------------------------------------------------------- /docker/Dockerfile-solr: -------------------------------------------------------------------------------- 1 | FROM solr:9.6.1 2 | 3 | COPY solr_conf/conf/* /myconfig/ 4 | 5 | CMD ["solr-create", "-c", "argo", "-d", "/myconfig"] 6 | -------------------------------------------------------------------------------- /spec/fixtures/files/crowdsourcing_bridget_1.xlsx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sul-dlss/argo/HEAD/spec/fixtures/files/crowdsourcing_bridget_1.xlsx -------------------------------------------------------------------------------- /app/views/bulk_actions/catalog_record_id_and_barcode_csv_jobs/new.turbo_stream.erb: -------------------------------------------------------------------------------- 1 | <%= turbo_stream.replace("bulk-action-form", partial: 'new') %> 2 | -------------------------------------------------------------------------------- /app/views/bulk_actions/descriptive_metadata_export_jobs/new.html.erb: -------------------------------------------------------------------------------- 1 | 2 | <%= render 'new' %> 3 | 4 | -------------------------------------------------------------------------------- /app/views/bulk_actions/descriptive_metadata_import_jobs/new.html.erb: -------------------------------------------------------------------------------- 1 | 2 | <%= render 'new' %> 3 | 4 | -------------------------------------------------------------------------------- /app/views/bulk_actions/validate_cocina_descriptive_jobs/new.html.erb: -------------------------------------------------------------------------------- 1 | 2 | <%= render 'new' %> 3 | 4 | -------------------------------------------------------------------------------- /app/views/profile/_table_row.html.erb: -------------------------------------------------------------------------------- 1 | 2 | 3 | <%= item.value %> 4 | 5 | 6 | <%= item.hits %> 7 | 8 | 9 | -------------------------------------------------------------------------------- /public/icon.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | -------------------------------------------------------------------------------- /spec/fixtures/files/invalid_bulk_upload_nonutf8.csv: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sul-dlss/argo/HEAD/spec/fixtures/files/invalid_bulk_upload_nonutf8.csv -------------------------------------------------------------------------------- /spec/fixtures/files/item_registration_incomplete.csv: -------------------------------------------------------------------------------- 1 | source_id,folio_instance_id,barcode,label 2 | foo:123,in12319237,,My new object 3 | bar:345,,, 4 | -------------------------------------------------------------------------------- /app/assets/stylesheets/profile.css: -------------------------------------------------------------------------------- 1 | .table-fixed-layout { 2 | table-layout: fixed; 3 | } 4 | 5 | .indented { 6 | padding-left: 30px !important; 7 | } 8 | -------------------------------------------------------------------------------- /app/components/action_button.html.erb: -------------------------------------------------------------------------------- 1 | <%= link_to label, url, method:, class: "btn button btn-primary #{'disabled' if disabled?}", data: button_data %> 2 | -------------------------------------------------------------------------------- /app/components/show/item/structure/file_component.html.erb: -------------------------------------------------------------------------------- 1 | <%= name %> - <%= number_to_human_size(size) %> 2 | -------------------------------------------------------------------------------- /app/components/spinner.rb: -------------------------------------------------------------------------------- 1 | # frozen_string_literal: true 2 | 3 | # A spinner 4 | class Spinner < ViewComponent::Base 5 | def initialize(*); end 6 | end 7 | -------------------------------------------------------------------------------- /app/views/bulk_actions/_errors.html.erb: -------------------------------------------------------------------------------- 1 | <% if @errors.present? %> 2 | <%= render AlertDangerComponent.new(text: @errors.to_sentence) %> 3 | <% end %> 4 | -------------------------------------------------------------------------------- /app/views/bulk_actions/license_and_rights_statement_jobs/new.html.erb: -------------------------------------------------------------------------------- 1 | 2 | <%= render 'new' %> 3 | 4 | -------------------------------------------------------------------------------- /spec/fixtures/files/catalog_record_id_and_barcode.ods: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sul-dlss/argo/HEAD/spec/fixtures/files/catalog_record_id_and_barcode.ods -------------------------------------------------------------------------------- /spec/fixtures/files/catalog_record_id_and_barcode.xls: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sul-dlss/argo/HEAD/spec/fixtures/files/catalog_record_id_and_barcode.xls -------------------------------------------------------------------------------- /spec/fixtures/files/catalog_record_id_and_barcode.xlsx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sul-dlss/argo/HEAD/spec/fixtures/files/catalog_record_id_and_barcode.xlsx -------------------------------------------------------------------------------- /app/views/apo/_count_items.html.erb: -------------------------------------------------------------------------------- 1 | <%= link_to number_with_delimiter(count), path_for_search, target: '_top' %> 2 | -------------------------------------------------------------------------------- /app/views/bulk_actions/catalog_record_id_and_barcode_csv_jobs/new.html.erb: -------------------------------------------------------------------------------- 1 | 2 | <%= render 'new' %> 3 | 4 | -------------------------------------------------------------------------------- /spec/fixtures/files/catalog_record_id_and_barcode.bogus: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sul-dlss/argo/HEAD/spec/fixtures/files/catalog_record_id_and_barcode.bogus -------------------------------------------------------------------------------- /spec/fixtures/files/null-descriptive-blank-end-rows.csv: -------------------------------------------------------------------------------- 1 | Druid,Catkey,Barcode 2 | druid:bb396kf5077,13157971, 3 | druid:bb631ry3167,13965062, 4 | ,, 5 | ,, 6 | -------------------------------------------------------------------------------- /app/components/download_all_button_component.html.erb: -------------------------------------------------------------------------------- 1 | <%= link_to path, link_options do %> 2 | Download all files 3 | <% end %> 4 | -------------------------------------------------------------------------------- /app/components/show/apo/grant_component.html.erb: -------------------------------------------------------------------------------- 1 | 2 | <%= name %> 3 | 4 | <%= access.capitalize %> 5 | 6 | 7 | -------------------------------------------------------------------------------- /app/components/workflow_grid_component.html.erb: -------------------------------------------------------------------------------- 1 | <% workflows.each do |(name, data)| %> 2 | <%= render WorkflowTableComponent.new(name:, data:) %> 3 | <% end %> 4 | -------------------------------------------------------------------------------- /bin/rails: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env ruby 2 | APP_PATH = File.expand_path("../config/application", __dir__) 3 | require_relative "../config/boot" 4 | require "rails/commands" 5 | -------------------------------------------------------------------------------- /config/initializers/load_abbyy_languages.rb: -------------------------------------------------------------------------------- 1 | # frozen_string_literal: true 2 | 3 | ABBYY_LANGUAGES = YAML.load_file(Rails.root.join('config/abbyy_languages.yml')) 4 | -------------------------------------------------------------------------------- /config/initializers/lograge.rb: -------------------------------------------------------------------------------- 1 | # frozen_string_literal: true 2 | 3 | Rails.application.configure do 4 | config.lograge.enabled = Rails.env.production? 5 | end 6 | -------------------------------------------------------------------------------- /spec/fixtures/files/catalog_record_id_and_barcode_extra_columns.csv: -------------------------------------------------------------------------------- 1 | Druid,,Catkey,Barcode 2 | druid:bb396kf5077,extra,13157971,,extra 3 | bb631ry3167,extra,13965062, -------------------------------------------------------------------------------- /spec/fixtures/files/catalog_record_id_and_barcode_with_whitespace.csv: -------------------------------------------------------------------------------- 1 | Druid,Catkey,Barcode 2 | druid:bb396kf5077 ,13157971, 3 | bb631ry3167,13965062, 4 | -------------------------------------------------------------------------------- /app/components/open_close_component.html.erb: -------------------------------------------------------------------------------- 1 |
2 | 3 |
4 | -------------------------------------------------------------------------------- /app/views/collections/_count.html.erb: -------------------------------------------------------------------------------- 1 | <%= link_to number_with_delimiter(count), path_for_facet, target: '_top' %> 2 | -------------------------------------------------------------------------------- /config/environment.rb: -------------------------------------------------------------------------------- 1 | # Load the Rails application. 2 | require_relative "application" 3 | 4 | # Initialize the Rails application. 5 | Rails.application.initialize! 6 | -------------------------------------------------------------------------------- /app/views/apo/_count_collections.html.erb: -------------------------------------------------------------------------------- 1 | <%= link_to number_with_delimiter(count), path_for_search, target: '_top' %> 2 | -------------------------------------------------------------------------------- /config/blacklight.yml: -------------------------------------------------------------------------------- 1 | development: 2 | adapter: solr 3 | url: <%= Settings.solrizer_url %> 4 | test: &test 5 | adapter: solr 6 | url: <%= Settings.solrizer_url %> 7 | -------------------------------------------------------------------------------- /config/spring.rb: -------------------------------------------------------------------------------- 1 | # frozen_string_literal: true 2 | 3 | Spring.watch( 4 | '.ruby-version', 5 | '.rbenv-vars', 6 | 'tmp/restart.txt', 7 | 'tmp/caching-dev.txt' 8 | ) 9 | -------------------------------------------------------------------------------- /config/initializers/purl_fetcher_client.rb: -------------------------------------------------------------------------------- 1 | # frozen_string_literal: true 2 | 3 | PurlFetcher::Client.configure(url: Settings.purl_fetcher.url, token: Settings.purl_fetcher.token) 4 | -------------------------------------------------------------------------------- /db/migrate/20200709002946_drop_table_delayed_jobs.rb: -------------------------------------------------------------------------------- 1 | class DropTableDelayedJobs < ActiveRecord::Migration[5.2] 2 | def change 3 | drop_table :delayed_jobs 4 | end 5 | end 6 | -------------------------------------------------------------------------------- /app/components/lazy_project_tag_facet_component.rb: -------------------------------------------------------------------------------- 1 | # frozen_string_literal: true 2 | 3 | class LazyProjectTagFacetComponent < ViewComponent::Base 4 | def initialize(**); end 5 | end 6 | -------------------------------------------------------------------------------- /app/components/contents/preservation_link_component.html.erb: -------------------------------------------------------------------------------- 1 |

2 | Preservation: 3 | <%= link_to nil, preserved_item_file_path(item_id: druid, id: filename, version:) %> 4 |

5 | -------------------------------------------------------------------------------- /app/components/lazy_wps_workflow_facet_component.rb: -------------------------------------------------------------------------------- 1 | # frozen_string_literal: true 2 | 3 | class LazyWpsWorkflowFacetComponent < ViewComponent::Base 4 | def initialize(**); end 5 | end 6 | -------------------------------------------------------------------------------- /app/views/structures/hierarchy.html.erb: -------------------------------------------------------------------------------- 1 | 2 | <%= render Show::Item::Structure::DirectoryComponent.new(directory: @root_directory) %> 3 | 4 | -------------------------------------------------------------------------------- /spec/fixtures/files/catalog_record_id_and_barcode_preamble.csv: -------------------------------------------------------------------------------- 1 | Explanatory text that will be ignored. 2 | 3 | Druid,Catkey,Barcode 4 | druid:bb396kf5077,13157971, 5 | bb631ry3167,13965062, -------------------------------------------------------------------------------- /app/components/lazy_nonproject_tag_facet_component.rb: -------------------------------------------------------------------------------- 1 | # frozen_string_literal: true 2 | 3 | class LazyNonprojectTagFacetComponent < ViewComponent::Base 4 | def initialize(**); end 5 | end 6 | -------------------------------------------------------------------------------- /app/components/throbber.html.erb: -------------------------------------------------------------------------------- 1 |
2 | -------------------------------------------------------------------------------- /app/components/top_navbar_component.rb: -------------------------------------------------------------------------------- 1 | # frozen_string_literal: true 2 | 3 | class TopNavbarComponent < Blacklight::TopNavbarComponent 4 | delegate :current_user, :can?, to: :helpers 5 | end 6 | -------------------------------------------------------------------------------- /app/components/alert_danger_component.rb: -------------------------------------------------------------------------------- 1 | # frozen_string_literal: true 2 | 3 | class AlertDangerComponent < ApplicationComponent 4 | def initialize(text:) 5 | @text = text 6 | end 7 | end 8 | -------------------------------------------------------------------------------- /app/models/application_record.rb: -------------------------------------------------------------------------------- 1 | # frozen_string_literal: true 2 | 3 | # app/models/application_record.rb 4 | class ApplicationRecord < ActiveRecord::Base 5 | self.abstract_class = true 6 | end 7 | -------------------------------------------------------------------------------- /app/views/items/file.html.erb: -------------------------------------------------------------------------------- 1 | <%= render BlacklightModalComponent.new do |component| %> 2 | <% component.with_header { 'Files' } %> 3 | <% component.with_body { render 'file' } %> 4 | <% end %> 5 | -------------------------------------------------------------------------------- /app/views/embargos/edit.html.erb: -------------------------------------------------------------------------------- 1 | <%= render EditModalComponent.new do |component| %> 2 | <% component.with_header { 'Update embargo' } %> 3 | <% component.with_body { render 'form' } %> 4 | <% end %> 5 | -------------------------------------------------------------------------------- /app/views/embargos/new.html.erb: -------------------------------------------------------------------------------- 1 | <%= render EditModalComponent.new do |component| %> 2 | <% component.with_header { 'Create embargo' } %> 3 | <% component.with_body { render 'form' } %> 4 | <% end %> 5 | -------------------------------------------------------------------------------- /app/views/serials/_edit.html.erb: -------------------------------------------------------------------------------- 1 | <%= render EditModalComponent.new do |component| %> 2 | <% component.with_header { 'Manage Serials' } %> 3 | <% component.with_body { render 'form' } %> 4 | <% end %> 5 | -------------------------------------------------------------------------------- /app/views/workflows/new.html.erb: -------------------------------------------------------------------------------- 1 | <%= render EditModalComponent.new do |component| %> 2 | <% component.with_header { 'Add workflow' } %> 3 | <% component.with_body { render 'new' } %> 4 | <% end %> 5 | -------------------------------------------------------------------------------- /spec/factories/user.rb: -------------------------------------------------------------------------------- 1 | # frozen_string_literal: true 2 | 3 | FactoryBot.define do 4 | factory :user do 5 | sequence :sunetid do |n| 6 | "person#{n}" 7 | end 8 | end 9 | end 10 | -------------------------------------------------------------------------------- /app/components/show_embargo_component.html.erb: -------------------------------------------------------------------------------- 1 |
2 | Embargoed until <%= l embargo_release_date, format: :long %> <%= edit_embargo %> 3 |
4 | -------------------------------------------------------------------------------- /app/views/catalog/_bulk_action_button.html.erb: -------------------------------------------------------------------------------- 1 |
2 | <%= link_to 'Bulk Actions', bulk_actions_path(search_state.to_h), class: 'btn btn-outline-primary', type: 'button' %> 3 |
4 | -------------------------------------------------------------------------------- /app/views/descriptives/edit.html.erb: -------------------------------------------------------------------------------- 1 | <%= render EditModalComponent.new do |component| %> 2 | <% component.with_header { 'Upload Cocina' } %> 3 | <% component.with_body { render 'form' } %> 4 | <% end %> 5 | -------------------------------------------------------------------------------- /app/views/layouts/one_column.html.erb: -------------------------------------------------------------------------------- 1 | <% content_for(:content) do %> 2 |
3 | <%= yield %> 4 |
5 | <% end %> 6 | 7 | <%= render template: 'layouts/blacklight/base' %> 8 | -------------------------------------------------------------------------------- /app/views/text_extraction/new.html.erb: -------------------------------------------------------------------------------- 1 | <%= render EditModalComponent.new do |component| %> 2 | <% component.with_header { 'Text extraction' } %> 3 | <% component.with_body { render 'form' } %> 4 | <% end %> 5 | -------------------------------------------------------------------------------- /app/views/versions/close_ui.html.erb: -------------------------------------------------------------------------------- 1 | <%= render EditModalComponent.new do |component| %> 2 | <% component.with_header { 'Close version' } %> 3 | <% component.with_body { render 'close_ui' } %> 4 | <% end %> 5 | -------------------------------------------------------------------------------- /app/views/content_types/edit.html.erb: -------------------------------------------------------------------------------- 1 | <%= render EditModalComponent.new do |component| %> 2 | <% component.with_header { 'Set content type' } %> 3 | <% component.with_body { render 'content_type' } %> 4 | <% end %> 5 | -------------------------------------------------------------------------------- /app/views/items/source_id_ui.html.erb: -------------------------------------------------------------------------------- 1 | <%= render EditModalComponent.new do |component| %> 2 | <% component.with_header { 'Change source id' } %> 3 | <% component.with_body { render 'source_id_ui' } %> 4 | <% end %> 5 | -------------------------------------------------------------------------------- /app/views/versions/open_ui.html.erb: -------------------------------------------------------------------------------- 1 | <%= render EditModalComponent.new do |component| %> 2 | <% component.with_header { 'Open for modification' } %> 3 | <% component.with_body { render 'open_ui' } %> 4 | <% end %> 5 | -------------------------------------------------------------------------------- /app/views/workflows/history.html.erb: -------------------------------------------------------------------------------- 1 | <%= render BlacklightModalComponent.new do |component| %> 2 | <% component.with_header { 'Workflow history' } %> 3 | <% component.with_body { render 'history' } %> 4 | <% end %> 5 | -------------------------------------------------------------------------------- /tmp/.gitignore: -------------------------------------------------------------------------------- 1 | # Ignore everything in this directory 2 | /* 3 | 4 | # Except this file 5 | !/.gitignore 6 | 7 | # And the pids directory needed for Argo to start 8 | !/pids 9 | /pids/* 10 | !/pids/.gitkeep 11 | -------------------------------------------------------------------------------- /app/components/throbber.rb: -------------------------------------------------------------------------------- 1 | # frozen_string_literal: true 2 | 3 | # Draws an animation indicating the user should wait while the system is working 4 | class Throbber < ViewComponent::Base 5 | def initialize(*); end 6 | end 7 | -------------------------------------------------------------------------------- /app/controllers/profile_controller.rb: -------------------------------------------------------------------------------- 1 | # frozen_string_literal: true 2 | 3 | ## 4 | # Used for the profile view of search results but just inherits from CatalogController 5 | class ProfileController < CatalogController 6 | end 7 | -------------------------------------------------------------------------------- /config.ru: -------------------------------------------------------------------------------- 1 | # frozen_string_literal: true 2 | 3 | # This file is used by Rack-based servers to start the application. 4 | 5 | require_relative 'config/environment' 6 | 7 | run Rails.application 8 | Rails.application.load_server 9 | -------------------------------------------------------------------------------- /config/deploy/qa.rb: -------------------------------------------------------------------------------- 1 | # frozen_string_literal: true 2 | 3 | server 'argo-qa-a.stanford.edu', user: 'lyberadmin', roles: %w[web db app worker] 4 | server 'argo-qa-b.stanford.edu', user: 'lyberadmin', roles: %w[web db app worker] 5 | -------------------------------------------------------------------------------- /spec/fixtures/bulk_upload/workspace/druid:bc682xk5613/2016_04_21_16_56_40_824/log.csv: -------------------------------------------------------------------------------- 1 | "Job started","2016-04-21 09:57am 2 | " 3 | "Number of records","20 4 | " 5 | "Job finished","2016-04-21 09:57am 6 | " 7 | "Druids loaded","0" 8 | -------------------------------------------------------------------------------- /spec/fixtures/bulk_upload/workspace/druid:bc682xk5613/2016_05_02_22_39_44_008/log.csv: -------------------------------------------------------------------------------- 1 | "Job started","2016-05-02 15:39pm 2 | " 3 | "Number of records","0 4 | " 5 | "Job finished","2016-05-02 15:40pm 6 | " 7 | "Druids loaded","0" 8 | -------------------------------------------------------------------------------- /app/views/catalog/_search_sidebar.html.erb: -------------------------------------------------------------------------------- 1 | <%= render 'facets' %> 2 | 3 | <% unless has_search_parameters? || params[:all] %> 4 | <%= link_to 'Show more facets', root_path(all: true), class: 'btn btn-primary mb-4' %> 5 | <% end %> 6 | -------------------------------------------------------------------------------- /config/boot.rb: -------------------------------------------------------------------------------- 1 | ENV["BUNDLE_GEMFILE"] ||= File.expand_path("../Gemfile", __dir__) 2 | 3 | require "bundler/setup" # Set up gems listed in the Gemfile. 4 | require "bootsnap/setup" # Speed up boot time by caching expensive operations. 5 | -------------------------------------------------------------------------------- /config/deploy/prod.rb: -------------------------------------------------------------------------------- 1 | # frozen_string_literal: true 2 | 3 | server 'argo-prod-01.stanford.edu', user: 'lyberadmin', roles: %w[web db app worker] 4 | server 'argo-prod-02.stanford.edu', user: 'lyberadmin', roles: %w[web db app worker] 5 | -------------------------------------------------------------------------------- /app/views/items/set_governing_apo_ui.html.erb: -------------------------------------------------------------------------------- 1 | <%= render EditModalComponent.new do |component| %> 2 | <% component.with_header { 'Set governing APO' } %> 3 | <% component.with_body { render 'set_governing_apo_ui' } %> 4 | <% end %> 5 | -------------------------------------------------------------------------------- /config/deploy/stage.rb: -------------------------------------------------------------------------------- 1 | # frozen_string_literal: true 2 | 3 | server 'argo-stage-a.stanford.edu', user: 'lyberadmin', roles: %w[web db app worker] 4 | server 'argo-stage-b.stanford.edu', user: 'lyberadmin', roles: %w[web db app worker] 5 | -------------------------------------------------------------------------------- /config/initializers/prawn_setup.rb: -------------------------------------------------------------------------------- 1 | # frozen_string_literal: true 2 | 3 | require 'prawn' 4 | require 'prawn/measurement_extensions' 5 | require 'barby' 6 | require 'barby/barcode/code_128' 7 | require 'barby/outputter/prawn_outputter' 8 | -------------------------------------------------------------------------------- /config/initializers/session_store.rb: -------------------------------------------------------------------------------- 1 | # frozen_string_literal: true 2 | 3 | # Be sure to restart your server when you modify this file. 4 | 5 | Rails.application.config.session_store :cookie_store, key: '_argo_session', same_site: :lax 6 | -------------------------------------------------------------------------------- /spec/factories/bulk_action.rb: -------------------------------------------------------------------------------- 1 | # frozen_string_literal: true 2 | 3 | FactoryBot.define do 4 | factory :bulk_action do 5 | action_type { 'RemoteIndexingJob' } 6 | user 7 | log_name { 'tmp/log.txt' } 8 | end 9 | end 10 | -------------------------------------------------------------------------------- /app/assets/stylesheets/blacklight.scss: -------------------------------------------------------------------------------- 1 | @import "bootstrap/scss/bootstrap"; 2 | @import "blacklight-frontend/app/assets/stylesheets/blacklight/blacklight"; 3 | @import "blacklight-hierarchy/app/assets/stylesheets/blacklight/hierarchy/hierarchy"; 4 | -------------------------------------------------------------------------------- /app/models/argo/exceptions.rb: -------------------------------------------------------------------------------- 1 | # frozen_string_literal: true 2 | 3 | module Argo 4 | module Exceptions 5 | # Raised if there is a problem communicating with dor_indexing_app 6 | class ReindexError < RuntimeError; end 7 | end 8 | end 9 | -------------------------------------------------------------------------------- /app/views/items/collection_ui.html.erb: -------------------------------------------------------------------------------- 1 | <%= render EditModalComponent.new do |component| %> 2 | <% component.with_header { 'Edit collections' } %> 3 | <% component.with_body { render 'collection_ui', response_message: nil } %> 4 | <% end %> 5 | -------------------------------------------------------------------------------- /config/initializers/mime_types.rb: -------------------------------------------------------------------------------- 1 | # frozen_string_literal: true 2 | 3 | # Be sure to restart your server when you modify this file. 4 | 5 | # Add new mime types for use in respond_to blocks: 6 | # Mime::Type.register "text/richtext", :rtf 7 | -------------------------------------------------------------------------------- /app/views/shared/_header_navbar.html.erb: -------------------------------------------------------------------------------- 1 | <%= render Blacklight::HeaderComponent.new(blacklight_config:) do |c| %> 2 | <% c.with_top_bar component: TopNavbarComponent %> 3 | <% c.with_search_bar component: SearchNavbarComponent %> 4 | <% end %> 5 | -------------------------------------------------------------------------------- /config/cable.yml: -------------------------------------------------------------------------------- 1 | development: 2 | adapter: async 3 | 4 | test: 5 | adapter: test 6 | 7 | production: 8 | adapter: redis 9 | url: <%= ENV.fetch("REDIS_URL") { "redis://localhost:6379/1" } %> 10 | channel_prefix: argo_production 11 | -------------------------------------------------------------------------------- /app/components/open_close_component.rb: -------------------------------------------------------------------------------- 1 | # frozen_string_literal: true 2 | 3 | class OpenCloseComponent < ApplicationComponent 4 | # @param [String] id 5 | def initialize(id:) 6 | @id = id 7 | end 8 | 9 | attr_reader :id 10 | end 11 | -------------------------------------------------------------------------------- /config/settings/test.yml: -------------------------------------------------------------------------------- 1 | bulk_metadata: 2 | directory: 'spec/fixtures/bulk_upload/workspace/' 3 | 4 | # URLs 5 | solrizer_url: 'http://localhost:8983/solr/argo' 6 | 7 | features: 8 | ocr_workflow: true 9 | speech_to_text_workflow: true 10 | -------------------------------------------------------------------------------- /app/components/search_navbar_component.html.erb: -------------------------------------------------------------------------------- 1 | <%= tag.div class: 'navbar-search navbar bg-light', role: 'navigation', aria: { label: t('blacklight.search.header') } do %> 2 |
3 | <%= search_bar %> 4 |
5 | <% end %> 6 | -------------------------------------------------------------------------------- /spec/support/fixtures.rb: -------------------------------------------------------------------------------- 1 | # frozen_string_literal: true 2 | 3 | def fixture_dir 4 | @fixture_dir ||= File.join(File.dirname(__FILE__), '../fixtures') 5 | end 6 | 7 | def read_fixture(fname) 8 | File.read(File.join(fixture_dir, fname)) 9 | end 10 | -------------------------------------------------------------------------------- /config/initializers/preservation_client.rb: -------------------------------------------------------------------------------- 1 | # frozen_string_literal: true 2 | 3 | # Configure preservation-client to use preservation catalog URL 4 | Preservation::Client.configure(url: Settings.preservation_catalog.url, token: Settings.preservation_catalog.token) 5 | -------------------------------------------------------------------------------- /app/components/constraint_component.rb: -------------------------------------------------------------------------------- 1 | # frozen_string_literal: true 2 | 3 | class ConstraintComponent < Blacklight::ConstraintComponent 4 | def initialize(facet_item_presenter:, classes: 'filter', layout: ConstraintLayoutComponent) 5 | super 6 | end 7 | end 8 | -------------------------------------------------------------------------------- /app/views/structures/show.html.erb: -------------------------------------------------------------------------------- 1 | 2 | <%= render Contents::StructuralComponent.new(structural: @cocina_item.structural, object_id: @cocina_item.externalIdentifier, viewable: @viewable, user_version: @user_version) %> 3 | 4 | -------------------------------------------------------------------------------- /app/controllers/bulk_actions/purge_jobs_controller.rb: -------------------------------------------------------------------------------- 1 | # frozen_string_literal: true 2 | 3 | module BulkActions 4 | class PurgeJobsController < ApplicationController 5 | include CreatesBulkActions 6 | 7 | self.action_type = 'PurgeJob' 8 | end 9 | end 10 | -------------------------------------------------------------------------------- /app/views/bulk_actions/_descmetadata_download_job.html.erb: -------------------------------------------------------------------------------- 1 | <% if bulk_action.present? && bulk_action.status == 'Completed' %> 2 | <%= link_to('Download Metadata', file_bulk_action_path(bulk_action.id, filename: Settings.bulk_metadata.zip), download: true) %> 3 | <% end %> 4 | -------------------------------------------------------------------------------- /app/views/workflow_service/lock_assembling.html.erb: -------------------------------------------------------------------------------- 1 | 2 | <%= link_to '#', 3 | title: 'Item is in assembly', 4 | class: 'btn disabled' do %> 5 | <%= tag.span class: 'bi-lock-fill' %> 6 | <% end %> 7 | 8 | -------------------------------------------------------------------------------- /app/views/workflow_service/lock_inactive.html.erb: -------------------------------------------------------------------------------- 1 | 2 | <%= link_to '#', 3 | title: 'Item is in accessioning', 4 | class: 'btn disabled' do %> 5 | <%= tag.span class: 'bi-lock-fill' %> 6 | <% end %> 7 | 8 | -------------------------------------------------------------------------------- /app/views/workflow_service/unlock_inactive.html.erb: -------------------------------------------------------------------------------- 1 | 2 | <%= link_to '#', 3 | title: 'Version already open', 4 | class: 'btn disabled' do %> 5 | <%= tag.span class: 'bi-unlock-fill' %> 6 | <% end %> 7 | 8 | -------------------------------------------------------------------------------- /spec/fixtures/files/structure-upload.csv: -------------------------------------------------------------------------------- 1 | resource_label,resource_type,sequence,filename,file_label,publish,shelve,preserve,rights_view,rights_download,rights_location,mimetype,role 2 | Item 1,image,1,chocolate_cake.jpg,chocolate_cake.jpg,yes,yes,yes,world,world,,image/jpeg, 3 | -------------------------------------------------------------------------------- /app/assets/stylesheets/layout.css: -------------------------------------------------------------------------------- 1 | /* These body/main styles allow the SUL and SU footers to render at the bottom of the viewport */ 2 | body { 3 | display: flex; 4 | flex-direction: column; 5 | min-height: 100vh; 6 | } 7 | 8 | main { 9 | flex: 1 0 auto; 10 | } 11 | -------------------------------------------------------------------------------- /config/initializers/sidekiq.rb: -------------------------------------------------------------------------------- 1 | # frozen_string_literal: true 2 | 3 | Sidekiq.configure_server do |config| 4 | config.redis = { url: Settings.redis_url } 5 | end 6 | 7 | Sidekiq.configure_client do |config| 8 | config.redis = { url: Settings.redis_url } 9 | end 10 | -------------------------------------------------------------------------------- /config/initializers/dor_services_client.rb: -------------------------------------------------------------------------------- 1 | # frozen_string_literal: true 2 | 3 | # Configure dor-services-client to use the dor-services URL 4 | Dor::Services::Client.configure(url: Settings.dor_services.url, 5 | token: Settings.dor_services.token) 6 | -------------------------------------------------------------------------------- /app/controllers/bulk_actions/export_tag_jobs_controller.rb: -------------------------------------------------------------------------------- 1 | # frozen_string_literal: true 2 | 3 | module BulkActions 4 | class ExportTagJobsController < ApplicationController 5 | include CreatesBulkActions 6 | 7 | self.action_type = 'ExportTagsJob' 8 | end 9 | end 10 | -------------------------------------------------------------------------------- /app/controllers/bulk_actions/reindex_jobs_controller.rb: -------------------------------------------------------------------------------- 1 | # frozen_string_literal: true 2 | 3 | module BulkActions 4 | class ReindexJobsController < ApplicationController 5 | include CreatesBulkActions 6 | 7 | self.action_type = 'RemoteIndexingJob' 8 | end 9 | end 10 | -------------------------------------------------------------------------------- /app/controllers/bulk_actions/republish_jobs_controller.rb: -------------------------------------------------------------------------------- 1 | # frozen_string_literal: true 2 | 3 | module BulkActions 4 | class RepublishJobsController < ApplicationController 5 | include CreatesBulkActions 6 | 7 | self.action_type = 'RepublishJob' 8 | end 9 | end 10 | -------------------------------------------------------------------------------- /app/views/items/_collection_ui_line_item.html.erb: -------------------------------------------------------------------------------- 1 |
  • 2 | <%= collection_label %> 3 | <%= link_to remove_collection_item_path(id: item_id, collection: collection_id) do %> 4 | 5 | <% end %> 6 |
  • 7 | -------------------------------------------------------------------------------- /app/views/workflows/_new.html.erb: -------------------------------------------------------------------------------- 1 | <%= form_tag item_workflows_path do %> 2 |
    3 | <%= select_tag :wf, options_for_select(start_workflow_options), class: 'form-select' %> 4 |
    5 | 8 | <% end %> 9 | -------------------------------------------------------------------------------- /config/initializers/config.rb: -------------------------------------------------------------------------------- 1 | # frozen_string_literal: true 2 | 3 | Config.setup do |config| 4 | config.const_name = 'Settings' 5 | config.use_env = true 6 | config.env_prefix = 'SETTINGS' 7 | config.env_separator = '__' 8 | config.env_converter = :downcase 9 | end 10 | -------------------------------------------------------------------------------- /app/components/contents/stacks_link_component.html.erb: -------------------------------------------------------------------------------- 1 | <% if no_download? %> 2 |

    3 | Stacks: <%= stacks_link %> (not available for download) 4 |

    5 | <% else %> 6 |

    7 | Stacks: <%= link_to nil, stacks_link %> 8 |

    9 | <% end %> 10 | -------------------------------------------------------------------------------- /spec/views/workflows/_history.html.erb_spec.rb: -------------------------------------------------------------------------------- 1 | # frozen_string_literal: true 2 | 3 | require 'rails_helper' 4 | 5 | RSpec.describe 'workflows/_history' do 6 | it 'renders the partial content' do 7 | render 8 | expect(rendered).to have_css '.CodeRay' 9 | end 10 | end 11 | -------------------------------------------------------------------------------- /app/components/blacklight_modal_component.rb: -------------------------------------------------------------------------------- 1 | # frozen_string_literal: true 2 | 3 | # Designed to use bootstrap styles to fill within the Blacklight modal 4 | class BlacklightModalComponent < ViewComponent::Base 5 | renders_one :header 6 | renders_one :body 7 | renders_one :footer 8 | end 9 | -------------------------------------------------------------------------------- /app/components/show/barcode_component.html.erb: -------------------------------------------------------------------------------- 1 | 2 | <%= barcode %> 3 | <% if edit? %> 4 | <%= link_to edit_barcode_item_path(id:), aria: { label: 'Edit barcode' } do %> 5 | 6 | <% end %> 7 | <% end %> 8 | 9 | -------------------------------------------------------------------------------- /app/components/show/license_component.html.erb: -------------------------------------------------------------------------------- 1 | 2 | <%= license %> 3 | <% if edit? %> 4 | <%= link_to edit_license_item_path(id:), aria: { label: 'Edit license' } do %> 5 | 6 | <% end %> 7 | <% end %> 8 | 9 | -------------------------------------------------------------------------------- /app/controllers/bulk_actions/close_version_jobs_controller.rb: -------------------------------------------------------------------------------- 1 | # frozen_string_literal: true 2 | 3 | module BulkActions 4 | class CloseVersionJobsController < ApplicationController 5 | include CreatesBulkActions 6 | 7 | self.action_type = 'CloseVersionJob' 8 | end 9 | end 10 | -------------------------------------------------------------------------------- /app/views/bulk_actions/_checksum_report_job.html.erb: -------------------------------------------------------------------------------- 1 | <% if bulk_action.has_report?(Settings.checksum_report_job.csv_filename) %> 2 | <%= link_to('Download Checksum Report', file_bulk_action_path(bulk_action.id, filename: Settings.checksum_report_job.csv_filename), download: true) %> 3 | <% end %> 4 | -------------------------------------------------------------------------------- /db/migrate/20110819234506_create_users.rb: -------------------------------------------------------------------------------- 1 | class CreateUsers < ActiveRecord::Migration[4.2] 2 | def self.up 3 | create_table :users do |t| 4 | t.string :sunetid 5 | t.timestamps 6 | end 7 | end 8 | 9 | def self.down 10 | drop_table :users 11 | end 12 | end 13 | -------------------------------------------------------------------------------- /app/controllers/bulk_actions/checksum_report_jobs_controller.rb: -------------------------------------------------------------------------------- 1 | # frozen_string_literal: true 2 | 3 | module BulkActions 4 | class ChecksumReportJobsController < ApplicationController 5 | include CreatesBulkActions 6 | 7 | self.action_type = 'ChecksumReportJob' 8 | end 9 | end 10 | -------------------------------------------------------------------------------- /app/controllers/bulk_actions/download_mods_jobs_controller.rb: -------------------------------------------------------------------------------- 1 | # frozen_string_literal: true 2 | 3 | module BulkActions 4 | class DownloadModsJobsController < ApplicationController 5 | include CreatesBulkActions 6 | 7 | self.action_type = 'DescmetadataDownloadJob' 8 | end 9 | end 10 | -------------------------------------------------------------------------------- /app/views/bulk_actions/_register_druids_job.html.erb: -------------------------------------------------------------------------------- 1 | <% if bulk_action.has_report?(Settings.register_druids_job.csv_filename) %> 2 | <%= link_to 'Download Report', file_bulk_action_path(bulk_action.id, filename: Settings.register_druids_job.csv_filename, format: :csv), download: true %> 3 | <% end %> 4 | -------------------------------------------------------------------------------- /app/views/layouts/catalog_result.html.erb: -------------------------------------------------------------------------------- 1 | <%# overridden from blacklight to put the sidebar on the left side %> 2 | <% content_for(:content) do %> 3 |
    4 | <%= yield %> 5 |
    6 | <% end %> 7 | <%= render template: 'layouts/blacklight/base' %> 8 | -------------------------------------------------------------------------------- /config/locales/blacklight.en.yml: -------------------------------------------------------------------------------- 1 | en: 2 | blacklight: 3 | application_name: 'Argo' 4 | search: 5 | fields: 6 | released_to_earthworks: Released to Earthworks 7 | released_to_purl_sitemap: Released to PURL Sitemap 8 | released_to_searchworks: Released to Searchworks 9 | -------------------------------------------------------------------------------- /app/components/show/copyright_component.html.erb: -------------------------------------------------------------------------------- 1 | 2 | <%= copyright %> 3 | <% if edit? %> 4 | <%= link_to edit_copyright_item_path(id:), aria: { label: 'Edit copyright' } do %> 5 | 6 | <% end %> 7 | <% end %> 8 | 9 | -------------------------------------------------------------------------------- /app/controllers/bulk_actions/export_cocina_json_jobs_controller.rb: -------------------------------------------------------------------------------- 1 | # frozen_string_literal: true 2 | 3 | module BulkActions 4 | class ExportCocinaJsonJobsController < ApplicationController 5 | include CreatesBulkActions 6 | 7 | self.action_type = 'ExportCocinaJsonJob' 8 | end 9 | end 10 | -------------------------------------------------------------------------------- /app/controllers/bulk_actions/export_structural_jobs_controller.rb: -------------------------------------------------------------------------------- 1 | # frozen_string_literal: true 2 | 3 | module BulkActions 4 | class ExportStructuralJobsController < ApplicationController 5 | include CreatesBulkActions 6 | 7 | self.action_type = 'ExportStructuralJob' 8 | end 9 | end 10 | -------------------------------------------------------------------------------- /app/views/bulk_actions/_export_cocina_json_job.html.erb: -------------------------------------------------------------------------------- 1 | <% if bulk_action.has_report?(Settings.export_cocina_json_job.gzip_filename) %> 2 | <%= link_to('Download Cocina JSON', file_bulk_action_path(bulk_action.id, filename: Settings.export_cocina_json_job.gzip_filename), download: true) %> 3 | <% end %> 4 | -------------------------------------------------------------------------------- /app/views/catalog/_lazy_project_tag_facet.html.erb: -------------------------------------------------------------------------------- 1 | 2 | <%= render Blacklight::Hierarchy::FacetFieldListComponent.new( 3 | facet_field: @facet_field_presenter, 4 | layout: Blacklight::FacetFieldComponent 5 | ) %> 6 | 7 | -------------------------------------------------------------------------------- /app/views/catalog/_lazy_wps_workflow_facet.html.erb: -------------------------------------------------------------------------------- 1 | 2 | <%= render Blacklight::Hierarchy::FacetFieldListComponent.new( 3 | facet_field: @facet_field_presenter, 4 | layout: Blacklight::FacetFieldComponent 5 | ) %> 6 | 7 | -------------------------------------------------------------------------------- /app/views/manage_releases/edit.html.erb: -------------------------------------------------------------------------------- 1 | <%= render EditModalComponent.new do |component| %> 2 | <% component.with_header { 'Manage release' } %> 3 | <% component.with_body do 4 | render ManageRelease::FormComponent.new(bulk_action: @bulk_action, document: @document) 5 | end %> 6 | <% end %> 7 | -------------------------------------------------------------------------------- /bin/rubocop: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env ruby 2 | require "rubygems" 3 | require "bundler/setup" 4 | 5 | # explicit rubocop config increases performance slightly while avoiding config confusion. 6 | ARGV.unshift("--config", File.expand_path("../.rubocop.yml", __dir__)) 7 | 8 | load Gem.bin_path("rubocop", "rubocop") 9 | -------------------------------------------------------------------------------- /app/assets/stylesheets/renderjson.css: -------------------------------------------------------------------------------- 1 | .renderjson { 2 | /* Hide top level disclosure */ 3 | > span > .object > .disclosure:first-of-type { 4 | display: none; 5 | } 6 | 7 | .disclosure { 8 | font-family: bootstrap-icons; 9 | margin-right: 5px; 10 | font-size: 14px; 11 | } 12 | } -------------------------------------------------------------------------------- /app/controllers/bulk_actions/export_catalog_links_jobs_controller.rb: -------------------------------------------------------------------------------- 1 | # frozen_string_literal: true 2 | 3 | module BulkActions 4 | class ExportCatalogLinksJobsController < ApplicationController 5 | include CreatesBulkActions 6 | 7 | self.action_type = 'ExportCatalogLinksJob' 8 | end 9 | end 10 | -------------------------------------------------------------------------------- /app/views/bulk_actions/_export_tags_job.html.erb: -------------------------------------------------------------------------------- 1 | <% if bulk_action.has_report?(Settings.export_tags_job.csv_filename) %> 2 | <%= link_to('Download Exported Tags (CSV)', file_bulk_action_path(bulk_action.id, filename: Settings.export_tags_job.csv_filename, mime_type: 'text/csv'), download: true) %> 3 | <% end %> 4 | -------------------------------------------------------------------------------- /app/views/bulk_actions/text_extraction_jobs/new.html.erb: -------------------------------------------------------------------------------- 1 | 2 | <% if Settings.features.ocr_workflow || Settings.speech_to_text_workflow %> 3 | <%= render 'new' %> 4 | <% else %> 5 |

    Text extraction job currently not available.

    6 | <% end %> 7 |
    8 | -------------------------------------------------------------------------------- /app/views/catalog/_lazy_nonproject_tag_facet.html.erb: -------------------------------------------------------------------------------- 1 | 2 | <%= render Blacklight::Hierarchy::FacetFieldListComponent.new( 3 | facet_field: @facet_field_presenter, 4 | layout: Blacklight::FacetFieldComponent 5 | ) %> 6 | 7 | -------------------------------------------------------------------------------- /app/components/show/item/access_rights_component.html.erb: -------------------------------------------------------------------------------- 1 | 2 | <%= access_rights %> 3 | <% if edit? %> 4 | <%= link_to edit_rights_item_path(id:), aria: { label: 'Edit rights' } do %> 5 | 6 | <% end %> 7 | <% end %> 8 | 9 | -------------------------------------------------------------------------------- /app/controllers/bulk_actions/tracking_sheet_report_jobs_controller.rb: -------------------------------------------------------------------------------- 1 | # frozen_string_literal: true 2 | 3 | module BulkActions 4 | class TrackingSheetReportJobsController < ApplicationController 5 | include CreatesBulkActions 6 | 7 | self.action_type = 'TrackingSheetReportJob' 8 | end 9 | end 10 | -------------------------------------------------------------------------------- /app/services/purge_service.rb: -------------------------------------------------------------------------------- 1 | # frozen_string_literal: true 2 | 3 | # Removes an object from SDR. 4 | class PurgeService 5 | # @param [String] druid 6 | # @param [String] user_name 7 | def self.purge(druid:, user_name:) 8 | Dor::Services::Client.object(druid).destroy(user_name:) 9 | end 10 | end 11 | -------------------------------------------------------------------------------- /app/views/bulk_actions/_tracking_sheet_report_job.html.erb: -------------------------------------------------------------------------------- 1 | <% if bulk_action.has_report?(Settings.tracking_sheet_report_job.pdf_filename) %> 2 | <%= link_to('Download Tracking Sheets', file_bulk_action_path(bulk_action.id, filename: Settings.tracking_sheet_report_job.pdf_filename), download: true) %> 3 | <% end %> 4 | -------------------------------------------------------------------------------- /app/components/show/collection/access_rights_component.html.erb: -------------------------------------------------------------------------------- 1 | 2 | <%= access_rights %> 3 | <% if open? %> 4 | <%= link_to edit_rights_item_path(id:), aria: { label: 'Edit rights' } do %> 5 | 6 | <% end %> 7 | <% end %> 8 | 9 | -------------------------------------------------------------------------------- /db/migrate/20251007125342_change_bulk_action_description.rb: -------------------------------------------------------------------------------- 1 | class ChangeBulkActionDescription < ActiveRecord::Migration[8.0] 2 | def up 3 | change_column :bulk_actions, :description, :text 4 | end 5 | 6 | def down 7 | change_column :bulk_actions, :description, :string, limit: 255 8 | end 9 | end 10 | -------------------------------------------------------------------------------- /spec/support/factory_bot.rb: -------------------------------------------------------------------------------- 1 | # frozen_string_literal: true 2 | 3 | RSpec.configure do |config| 4 | config.include FactoryBot::Syntax::Methods 5 | 6 | # Avoid doing this because it registers new items/collections which is slow 7 | # config.before(:suite) do 8 | # FactoryBot.lint 9 | # end 10 | end 11 | -------------------------------------------------------------------------------- /app/components/show/use_statement_component.html.erb: -------------------------------------------------------------------------------- 1 | 2 | <%= use_statement %> 3 | <% if edit? %> 4 | <%= link_to edit_use_statement_item_path(id:), aria: { label: 'Edit use and reproduction' } do %> 5 | 6 | <% end %> 7 | <% end %> 8 | 9 | -------------------------------------------------------------------------------- /config/setup_load_paths.rb: -------------------------------------------------------------------------------- 1 | # frozen_string_literal: true 2 | 3 | # Select the correct item for which you use below. 4 | # If you're not using bundler, remove it completely. 5 | # 6 | # # If we're using a Bundler 1.0 beta 7 | ENV['BUNDLE_GEMFILE'] = File.expand_path('../Gemfile', File.dirname(__FILE__)) 8 | require 'bundler/setup' 9 | -------------------------------------------------------------------------------- /app/components/contents/constituent_component.html.erb: -------------------------------------------------------------------------------- 1 |
  • 2 | 10 |
  • 11 | -------------------------------------------------------------------------------- /app/controllers/bulk_actions/descriptive_metadata_export_jobs_controller.rb: -------------------------------------------------------------------------------- 1 | # frozen_string_literal: true 2 | 3 | module BulkActions 4 | class DescriptiveMetadataExportJobsController < ApplicationController 5 | include CreatesBulkActions 6 | 7 | self.action_type = 'DescriptiveMetadataExportJob' 8 | end 9 | end 10 | -------------------------------------------------------------------------------- /app/javascript/controllers/structural_controller.js: -------------------------------------------------------------------------------- 1 | import { Controller } from '@hotwired/stimulus' 2 | 3 | export default class extends Controller { 4 | static targets = ['form'] 5 | 6 | open () { 7 | this.formTarget.hidden = false 8 | } 9 | 10 | close () { 11 | this.formTarget.hidden = true 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /app/services/mods_validator.rb: -------------------------------------------------------------------------------- 1 | # frozen_string_literal: true 2 | 3 | class ModsValidator 4 | SCHEMA = 'mods-3-7.xsd' 5 | 6 | def self.validate(doc) 7 | Dir.chdir('app/helpers/xml') do 8 | xsd = Nokogiri::XML::Schema(File.open(SCHEMA)) 9 | xsd.validate(doc).map(&:message) 10 | end 11 | end 12 | end 13 | -------------------------------------------------------------------------------- /app/views/bulk_actions/_export_catalog_links_job.html.erb: -------------------------------------------------------------------------------- 1 | <% if bulk_action.has_report?(Settings.export_catalog_links_job.csv_filename) %> 2 | <%= link_to('Download FOLIO Instance HRIDs and Barcodes CSV', file_bulk_action_path(bulk_action.id, filename: Settings.export_catalog_links_job.csv_filename), download: true) %> 3 | <% end %> 4 | -------------------------------------------------------------------------------- /Rakefile: -------------------------------------------------------------------------------- 1 | # frozen_string_literal: true 2 | 3 | # Add your own tasks in files placed in lib/tasks ending in .rake, 4 | # for example lib/tasks/capistrano.rake, and they will automatically be available to Rake. 5 | 6 | require File.expand_path('config/application', __dir__) 7 | require 'rake' 8 | 9 | Rails.application.load_tasks 10 | -------------------------------------------------------------------------------- /config/initializers/cookies_serializer.rb: -------------------------------------------------------------------------------- 1 | # frozen_string_literal: true 2 | 3 | # Be sure to restart your server when you modify this file. 4 | 5 | # Specify a serializer for the signed and encrypted cookie jars. 6 | # Valid options are :json, :marshal, and :hybrid. 7 | Rails.application.config.action_dispatch.cookies_serializer = :hybrid 8 | -------------------------------------------------------------------------------- /app/components/report_category_component.rb: -------------------------------------------------------------------------------- 1 | # frozen_string_literal: true 2 | 3 | class ReportCategoryComponent < ApplicationComponent 4 | def initialize(category:) 5 | @category = category 6 | end 7 | 8 | attr_reader :category 9 | 10 | def fields 11 | Report::REPORT_FIELDS_BY_CATEGORY[category] 12 | end 13 | end 14 | -------------------------------------------------------------------------------- /app/views/bulk_actions/_export_structural_job.html.erb: -------------------------------------------------------------------------------- 1 | <% if bulk_action.has_report?(Settings.export_structural_job.csv_filename) %> 2 | <%= link_to('Download Exported Structural Metadata (CSV)', file_bulk_action_path(bulk_action.id, filename: Settings.export_structural_job.csv_filename, mime_type: 'text/csv'), download: true) %> 3 | <% end %> 4 | -------------------------------------------------------------------------------- /config/initializers/application_controller_renderer.rb: -------------------------------------------------------------------------------- 1 | # frozen_string_literal: true 2 | 3 | # Be sure to restart your server when you modify this file. 4 | 5 | # ActiveSupport::Reloader.to_prepare do 6 | # ApplicationController.renderer.defaults.merge!( 7 | # http_host: 'example.org', 8 | # https: false 9 | # ) 10 | # end 11 | -------------------------------------------------------------------------------- /bin/server: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | # Provide some default values that allow the user to login. 4 | # In a production like environment these are provided by the webserver/Shibboleth/LDAP 5 | REMOTE_USER="${REMOTE_USER:=blalbrit@stanford.edu}" 6 | ROLES="${ROLES:=sdr:administrator-role}" 7 | 8 | REMOTE_USER=$REMOTE_USER ROLES=$ROLES bin/rails s 9 | -------------------------------------------------------------------------------- /app/components/show/source_id_component.html.erb: -------------------------------------------------------------------------------- 1 | <%= source_id %> 2 | 3 | <% if edit? %> 4 | <%= link_to source_id_ui_item_path(id:), 5 | aria: { label: 'Change source id' }, 6 | data: { controller: 'button', action: 'click->button#open' } do %> 7 | 8 | <% end %> 9 | <% end %> 10 | -------------------------------------------------------------------------------- /app/models/null_user.rb: -------------------------------------------------------------------------------- 1 | # frozen_string_literal: true 2 | 3 | class NullUser 4 | def admin? 5 | false 6 | end 7 | 8 | def manager? 9 | false 10 | end 11 | 12 | def viewer? 13 | false 14 | end 15 | 16 | def sdr_api_authorized? 17 | false 18 | end 19 | 20 | def permitted_apos 21 | [] 22 | end 23 | end 24 | -------------------------------------------------------------------------------- /app/views/workflows/show.html.erb: -------------------------------------------------------------------------------- 1 | <%= render BlacklightModalComponent.new do |component| %> 2 | <% component.with_header { 'Workflow view' } %> 3 | <% component.with_body do %> 4 | <% if params[:raw] %> 5 | <%= @presenter.pretty_xml %> 6 | <% else %> 7 | <%= render 'show' %> 8 | <% end %> 9 | <% end %> 10 | <% end %> 11 | -------------------------------------------------------------------------------- /spec/support/test_view_helpers.rb: -------------------------------------------------------------------------------- 1 | # frozen_string_literal: true 2 | 3 | module TestViewHelpers 4 | extend ActiveSupport::Concern 5 | 6 | included do 7 | before do 8 | view.send(:extend, ApoHelper) 9 | view.send(:extend, ArgoHelper) 10 | view.send(:extend, Blacklight::HierarchyHelper) 11 | end 12 | end 13 | end 14 | -------------------------------------------------------------------------------- /app/components/manage_release/item_form_component.rb: -------------------------------------------------------------------------------- 1 | # frozen_string_literal: true 2 | 3 | module ManageRelease 4 | class ItemFormComponent < ApplicationComponent 5 | def initialize(form:, current_user:) 6 | @form = form 7 | @current_user = current_user 8 | end 9 | 10 | attr_reader :form, :current_user 11 | end 12 | end 13 | -------------------------------------------------------------------------------- /app/components/show/is_member_of_component.html.erb: -------------------------------------------------------------------------------- 1 | <%= collection %> 2 | 3 | <% if edit? %> 4 | <%= link_to collection_ui_item_path(id:), 5 | aria: { label: 'Edit collections' }, 6 | data: { controller: 'button', action: 'click->button#open' } do %> 7 | 8 | <% end %> 9 | <% end %> 10 | -------------------------------------------------------------------------------- /app/views/bulk_actions/_descriptive_metadata_export_job.html.erb: -------------------------------------------------------------------------------- 1 | <% if bulk_action.has_report?(Settings.descriptive_metadata_export_job.csv_filename) %> 2 | <%= link_to('Download Descriptions (CSV)', file_bulk_action_path(bulk_action.id, filename: Settings.descriptive_metadata_export_job.csv_filename, mime_type: 'text/csv'), download: true) %> 3 | <% end %> 4 | -------------------------------------------------------------------------------- /app/components/show/collection_component.rb: -------------------------------------------------------------------------------- 1 | # frozen_string_literal: true 2 | 3 | module Show 4 | class CollectionComponent < ApplicationComponent 5 | def initialize(presenter:) 6 | @presenter = presenter 7 | end 8 | 9 | attr_reader :presenter 10 | 11 | delegate :document, :cocina, :view_token, to: :presenter 12 | end 13 | end 14 | -------------------------------------------------------------------------------- /app/jobs/application_job.rb: -------------------------------------------------------------------------------- 1 | # frozen_string_literal: true 2 | 3 | class ApplicationJob < ActiveJob::Base 4 | # Automatically retry jobs that encountered a deadlock 5 | # retry_on ActiveRecord::Deadlocked 6 | 7 | # Most jobs are safe to ignore if the underlying records are no longer available 8 | # discard_on ActiveJob::DeserializationError 9 | end 10 | -------------------------------------------------------------------------------- /bin/dev: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env sh 2 | 3 | # Provide some default values that allow the user to login. 4 | # In a production like environment these are provided by the webserver/Shibboleth/LDAP 5 | REMOTE_USER="${REMOTE_USER:=blalbrit@stanford.edu}" 6 | ROLES="${ROLES:=sdr:administrator-role}" 7 | 8 | REMOTE_USER=$REMOTE_USER ROLES=$ROLES bin/overmind start -f Procfile.dev 9 | -------------------------------------------------------------------------------- /app/components/date_choice_facet_component.rb: -------------------------------------------------------------------------------- 1 | # frozen_string_literal: true 2 | 3 | class DateChoiceFacetComponent < Blacklight::FacetFieldListComponent 4 | def search_params 5 | @facet_field.search_state.params_for_search.except(:page, :utf8) 6 | end 7 | 8 | def solr_field_name 9 | @facet_field.facet_field.raw_facet_field 10 | end 11 | end 12 | -------------------------------------------------------------------------------- /app/components/manage_release/collection_form_component.rb: -------------------------------------------------------------------------------- 1 | # frozen_string_literal: true 2 | 3 | module ManageRelease 4 | class CollectionFormComponent < ApplicationComponent 5 | def initialize(form:, current_user:) 6 | @form = form 7 | @current_user = current_user 8 | end 9 | 10 | attr_reader :form, :current_user 11 | end 12 | end 13 | -------------------------------------------------------------------------------- /app/components/show/admin_policy_component.rb: -------------------------------------------------------------------------------- 1 | # frozen_string_literal: true 2 | 3 | module Show 4 | class AdminPolicyComponent < ApplicationComponent 5 | def initialize(presenter:) 6 | @presenter = presenter 7 | end 8 | 9 | attr_reader :presenter 10 | 11 | delegate :document, :cocina, :view_token, to: :presenter 12 | end 13 | end 14 | -------------------------------------------------------------------------------- /app/components/show/governed_by_component.html.erb: -------------------------------------------------------------------------------- 1 | <%= admin_policy %> 2 | 3 | <% if edit? %> 4 | <%= link_to set_governing_apo_ui_item_path(id:), 5 | aria: { label: 'Set governing APO' }, 6 | data: { controller: 'button', action: 'click->button#open' } do %> 7 | 8 | <% end %> 9 | <% end %> 10 | -------------------------------------------------------------------------------- /spec/fixtures/bulk_upload/workspace/druid:bc682xk5613/2016_04_21_17_22_16_520/log.csv: -------------------------------------------------------------------------------- 1 | "Job started","2016-04-21 10:22am 2 | " 3 | "Note","convertonly 4 | " 5 | "Error - there was an error within the MODSulator server","Net::ReadTimeout 6 | " 7 | "Exception","Got no response from server 8 | " 9 | "Job finished","2016-04-21 10:23am 10 | " 11 | "Druids loaded","0" 12 | -------------------------------------------------------------------------------- /app/components/show/apo/grant_component.rb: -------------------------------------------------------------------------------- 1 | # frozen_string_literal: true 2 | 3 | module Show 4 | module Apo 5 | class GrantComponent < ApplicationComponent 6 | def initialize(grant:) 7 | @name = grant.fetch(:name) 8 | @access = grant.fetch(:access) 9 | end 10 | 11 | attr_reader :name, :access 12 | end 13 | end 14 | end 15 | -------------------------------------------------------------------------------- /app/components/show/content_type_component.html.erb: -------------------------------------------------------------------------------- 1 | <%= content_type %> 2 | 3 | <% if edit? %> 4 | <%= link_to edit_item_content_type_path(item_id: id), 5 | aria: { label: 'Set content type' }, 6 | data: { controller: 'button', action: 'click->button#open' } do %> 7 | 8 | <% end %> 9 | <% end %> 10 | -------------------------------------------------------------------------------- /config/initializers/bootstrap5_form_errors.rb: -------------------------------------------------------------------------------- 1 | # frozen_string_literal: true 2 | 3 | # Give any .form_control the .is-invalid Bootstrap 5 class 4 | # html_tag is a ActiveSupport::SafeBuffer 5 | ActionView::Base.field_error_proc = proc do |html_tag, _instance| 6 | html_tag.sub('form-control', 'form-control is-invalid').html_safe # rubocop:disable Rails/OutputSafety 7 | end 8 | -------------------------------------------------------------------------------- /spec/helpers/application_helper_spec.rb: -------------------------------------------------------------------------------- 1 | # frozen_string_literal: true 2 | 3 | require 'rails_helper' 4 | 5 | RSpec.describe ApplicationHelper do 6 | describe '#views_to_switch' do 7 | it 'returns the view switchers' do 8 | helper.views_to_switch.each do |view| 9 | expect(view).to be_an ViewSwitcher 10 | end 11 | end 12 | end 13 | end 14 | -------------------------------------------------------------------------------- /app/components/show/catalog_record_id_component.html.erb: -------------------------------------------------------------------------------- 1 | <%= catalog_record_id %> 2 | 3 | <% if edit? %> 4 | <%= link_to edit_item_catalog_record_id_path(item_id: id), 5 | aria: { label: manage_label }, 6 | data: { controller: 'button', action: 'click->button#open' } do %> 7 | 8 | <% end %> 9 | <% end %> 10 | -------------------------------------------------------------------------------- /app/views/profile/_table_row_pivot.html.erb: -------------------------------------------------------------------------------- 1 | 2 | <%= facet_field['value'] %><%= facet_field['count'] %> 3 | 4 | <% if facet_field['pivot'].present? %> 5 | <% facet_field['pivot'].each do |pivot| %> 6 | 7 | <%= pivot['value'] %><%= pivot['count'] %> 8 | 9 | <% end %> 10 | <% end %> 11 | -------------------------------------------------------------------------------- /spec/routing/profile_spec.rb: -------------------------------------------------------------------------------- 1 | # frozen_string_literal: true 2 | 3 | require 'rails_helper' 4 | 5 | RSpec.describe ReportController do 6 | describe 'routing' do 7 | it 'routes to to #facet' do 8 | expect(get: "/profile/facet/#{SolrDocument::FIELD_TOPIC}") 9 | .to route_to('profile#facet', id: SolrDocument::FIELD_TOPIC) 10 | end 11 | end 12 | end 13 | -------------------------------------------------------------------------------- /app/controllers/bulk_actions/add_workflow_jobs_controller.rb: -------------------------------------------------------------------------------- 1 | # frozen_string_literal: true 2 | 3 | module BulkActions 4 | class AddWorkflowJobsController < ApplicationController 5 | include CreatesBulkActions 6 | 7 | self.action_type = 'AddWorkflowJob' 8 | 9 | def job_params 10 | super.merge(workflow: params[:workflow]) 11 | end 12 | end 13 | end 14 | -------------------------------------------------------------------------------- /app/forms/application_change_set.rb: -------------------------------------------------------------------------------- 1 | # frozen_string_literal: true 2 | 3 | # A superclass for the change sets that handles forms backed by Cocina objects 4 | class ApplicationChangeSet < Reform::Form 5 | # needed for generating the update route 6 | def to_param 7 | model.externalIdentifier 8 | end 9 | 10 | def persisted? 11 | model.present? 12 | end 13 | end 14 | -------------------------------------------------------------------------------- /db/migrate/20110820000003_create_searches.rb: -------------------------------------------------------------------------------- 1 | class CreateSearches < ActiveRecord::Migration[4.2] 2 | def self.up 3 | create_table :searches do |t| 4 | t.text :query_params 5 | t.integer :user_id 6 | 7 | t.timestamps 8 | end 9 | add_index :searches, :user_id 10 | end 11 | 12 | def self.down 13 | drop_table :searches 14 | end 15 | end 16 | -------------------------------------------------------------------------------- /spec/routing/report_routing_spec.rb: -------------------------------------------------------------------------------- 1 | # frozen_string_literal: true 2 | 3 | require 'rails_helper' 4 | 5 | RSpec.describe ReportController do 6 | describe 'routing' do 7 | it 'routes to to #facet' do 8 | expect(get: "/report/facet/#{SolrDocument::FIELD_TOPIC}") 9 | .to route_to('report#facet', id: SolrDocument::FIELD_TOPIC) 10 | end 11 | end 12 | end 13 | -------------------------------------------------------------------------------- /app/controllers/login_controller.rb: -------------------------------------------------------------------------------- 1 | # frozen_string_literal: true 2 | 3 | ### 4 | # Simple controller to handle login and redirect 5 | ### 6 | class LoginController < ApplicationController 7 | def login 8 | if params[:referrer].present? 9 | redirect_to params[:referrer] 10 | else 11 | redirect_back fallback_location: root_url 12 | end 13 | end 14 | end 15 | -------------------------------------------------------------------------------- /app/views/bulk_actions/tracking_sheet_report_jobs/_new.html.erb: -------------------------------------------------------------------------------- 1 | <%= form_with url: tracking_sheet_report_job_path, class: 'new_bulk_action', data: { turbo_frame: '_top' } do |f| %> 2 | 3 | Download PDF tracking sheets of objects. 4 | 5 | 6 | <%= render 'bulk_actions/druids', f: %> 7 | <%= render 'bulk_actions/common_fields', f: %> 8 | <% end %> 9 | -------------------------------------------------------------------------------- /db/migrate/20110820000005_remove_editable_fields_from_bookmarks.rb: -------------------------------------------------------------------------------- 1 | class RemoveEditableFieldsFromBookmarks < ActiveRecord::Migration[4.2] 2 | def self.up 3 | remove_column :bookmarks, :notes 4 | remove_column :bookmarks, :url 5 | end 6 | 7 | def self.down 8 | add_column :bookmarks, :notes, :text 9 | add_column :bookmarks, :url, :string 10 | end 11 | end 12 | -------------------------------------------------------------------------------- /db/migrate/20150128201043_add_polymorphic_type_to_bookmarks.blacklight.rb: -------------------------------------------------------------------------------- 1 | # This migration comes from blacklight (originally 20140320000000) 2 | # -*- encoding : utf-8 -*- 3 | 4 | class AddPolymorphicTypeToBookmarks < ActiveRecord::Migration[4.2] 5 | def change 6 | add_column(:bookmarks, :document_type, :string) 7 | 8 | add_index :bookmarks, :user_id 9 | end 10 | end 11 | -------------------------------------------------------------------------------- /spec/fixtures/bulk_upload/workspace/druid:bc682xk5613/2016_04_21_17_34_02_445/log.csv: -------------------------------------------------------------------------------- 1 | "Job started","2016-04-21 10:34am 2 | " 3 | "Note","convertonly 4 | " 5 | "Error - there was an error within the MODSulator server","the server responded with status 500 6 | " 7 | "Exception","Got no response from server 8 | " 9 | "Job finished","2016-04-21 10:34am 10 | " 11 | "Druids loaded","0" 12 | -------------------------------------------------------------------------------- /spec/fixtures/files/descriptive-upload-bad.csv: -------------------------------------------------------------------------------- 1 | druid,source_id,title1.structuredValue1.type,title1.structuredValue1.value,title1.structuredValue2.type,title1.structuredValue2.value,purl,relatedResource1.type 2 | druid:bc123df4567,desc:no-title-type,,title1.structuredValue1.value without a corresponding type,subtitle,subtitle,https://sul-purl-stage.stanford.edu/bc123df4567,has other format 3 | -------------------------------------------------------------------------------- /app/components/alert_danger_component.html.erb: -------------------------------------------------------------------------------- 1 | 10 | -------------------------------------------------------------------------------- /app/controllers/bulk_actions/refresh_mods_jobs_controller.rb: -------------------------------------------------------------------------------- 1 | # frozen_string_literal: true 2 | 3 | module BulkActions 4 | class RefreshModsJobsController < ApplicationController 5 | include CreatesBulkActions 6 | 7 | self.action_type = 'RefreshModsJob' 8 | 9 | def job_params 10 | super.merge(close_version: params[:close_version]) 11 | end 12 | end 13 | end 14 | -------------------------------------------------------------------------------- /app/javascript/controllers/registration_controller.js: -------------------------------------------------------------------------------- 1 | import { Controller } from '@hotwired/stimulus' 2 | 3 | export default class extends Controller { 4 | // If the field is marked as invalid, then show the invalid (bootstrap) style. 5 | displayValidation (event) { 6 | const field = event.target 7 | field.classList.toggle('is-invalid', !field.validity.valid) 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /app/forms/application_form.rb: -------------------------------------------------------------------------------- 1 | # frozen_string_literal: true 2 | 3 | class ApplicationForm 4 | include ActiveModel::Model 5 | include ActiveModel::Attributes 6 | 7 | def self.model_name 8 | # Remove the "Form" suffix from the class name. 9 | # This allows Rails magic such as route paths. 10 | ActiveModel::Name.new(self, nil, to_s.delete_suffix('Form')) 11 | end 12 | end 13 | -------------------------------------------------------------------------------- /app/components/show/apo/roles_component.html.erb: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | <%= render Show::Apo::GrantComponent.with_collection(permissions) %> 12 | 13 |
    Group nameRole
    14 | -------------------------------------------------------------------------------- /app/components/show/item_component.rb: -------------------------------------------------------------------------------- 1 | # frozen_string_literal: true 2 | 3 | module Show 4 | class ItemComponent < ApplicationComponent 5 | def initialize(presenter:) 6 | @presenter = presenter 7 | end 8 | 9 | attr_reader :presenter 10 | 11 | delegate :document, :cocina, :view_token, to: :presenter 12 | delegate :state_service, to: :@presenter 13 | end 14 | end 15 | -------------------------------------------------------------------------------- /app/controllers/bulk_actions/open_version_jobs_controller.rb: -------------------------------------------------------------------------------- 1 | # frozen_string_literal: true 2 | 3 | module BulkActions 4 | class OpenVersionJobsController < ApplicationController 5 | include CreatesBulkActions 6 | 7 | self.action_type = 'OpenVersionJob' 8 | 9 | def job_params 10 | super.merge(version_description: params[:version_description]) 11 | end 12 | end 13 | end 14 | -------------------------------------------------------------------------------- /app/javascript/controllers/multiselect_controller.js: -------------------------------------------------------------------------------- 1 | import { Controller } from '@hotwired/stimulus' 2 | import Choices from 'choices.js' 3 | 4 | export default class extends Controller { 5 | connect () { 6 | if (!this.select) { 7 | this.select = new Choices(this.element, { removeItemButton: true, removeItemLabelText: (value) => `Remove item: ${value}` }) 8 | } 9 | } 10 | } 11 | -------------------------------------------------------------------------------- /app/views/bulk_actions/old.html.erb: -------------------------------------------------------------------------------- 1 |
    2 | 3 | Download checksums of files in objects (as csv). 4 | 5 |
    6 | 7 |
    8 | 9 | Download descriptive metadata for objects. 10 | 11 |
    12 | -------------------------------------------------------------------------------- /app/views/catalog/_home_text.html.erb: -------------------------------------------------------------------------------- 1 |

    Welcome to Argo!

    2 | <% if @presenter.view_something? %> 3 |

    4 | To begin, enter one or more search terms, or select a facet under the 'Limit your search' panel. 5 |

    6 | <% else %> 7 |

    8 | You do not appear to have permission to view any items in Argo. Please contact an administrator. 9 |

    10 | <% end %> 11 | -------------------------------------------------------------------------------- /app/controllers/bulk_actions/apply_apo_defaults_jobs_controller.rb: -------------------------------------------------------------------------------- 1 | # frozen_string_literal: true 2 | 3 | module BulkActions 4 | class ApplyApoDefaultsJobsController < ApplicationController 5 | include CreatesBulkActions 6 | 7 | self.action_type = 'ApplyApoDefaultsJob' 8 | 9 | def job_params 10 | super.merge(close_version: params[:close_version]) 11 | end 12 | end 13 | end 14 | -------------------------------------------------------------------------------- /app/jobs/close_version_job.rb: -------------------------------------------------------------------------------- 1 | # frozen_string_literal: true 2 | 3 | ## 4 | # Job to close objects 5 | class CloseVersionJob < BulkActionJob 6 | class CloseVersionJobItem < BulkActionJobItem 7 | def perform 8 | return unless check_update_ability? 9 | 10 | close_version_if_needed!(force: true) 11 | success!(message: 'Object successfully closed') 12 | end 13 | end 14 | end 15 | -------------------------------------------------------------------------------- /app/views/bulk_actions/purge_jobs/_new.html.erb: -------------------------------------------------------------------------------- 1 | <%= form_with url: purge_job_path, class: 'new_bulk_action', data: { turbo_frame: '_top' } do |f| %> 2 | <%= render 'bulk_actions/errors' %> 3 | 4 | 5 | Deletes unpublished DOR objects 6 | 7 | 8 | <%= render 'bulk_actions/druids', f: %> 9 | <%= render 'bulk_actions/common_fields', f: %> 10 | <% end %> 11 | -------------------------------------------------------------------------------- /db/migrate/20240801155124_remove_not_null_on_active_storage_blobs_checksum.active_storage.rb: -------------------------------------------------------------------------------- 1 | # This migration comes from active_storage (originally 20211119233751) 2 | class RemoveNotNullOnActiveStorageBlobsChecksum < ActiveRecord::Migration[6.0] 3 | def change 4 | return unless table_exists?(:active_storage_blobs) 5 | 6 | change_column_null(:active_storage_blobs, :checksum, true) 7 | end 8 | end 9 | -------------------------------------------------------------------------------- /spec/fixtures/files/bulk_upload_structural.csv: -------------------------------------------------------------------------------- 1 | druid,resource_label,resource_type,sequence,filename,file_label,publish,shelve,preserve,rights_view,rights_download,rights_location,mimetype,role 2 | zp968gy7494,LOL1,image,1,jt667tw2770_00_0001.tif,jt667tw2770_00_0001.tif,no,no,yes,dark,none,,image/tiff, 3 | zp968gy7494,LOL2,image,1,jt667tw2770_05_0001.jp2,jt667tw2770_05_0001.jp2,no,no,yes,dark,none,,image/jp2, 4 | -------------------------------------------------------------------------------- /spec/routing/workflows_spec.rb: -------------------------------------------------------------------------------- 1 | # frozen_string_literal: true 2 | 3 | require 'rails_helper' 4 | 5 | RSpec.describe WorkflowsController do 6 | describe 'routing' do 7 | it 'routes to to #facet' do 8 | expect(put: '/items/druid:hx908xy6904/workflows/accessionWF') 9 | .to route_to('workflows#update', item_id: 'druid:hx908xy6904', id: 'accessionWF') 10 | end 11 | end 12 | end 13 | -------------------------------------------------------------------------------- /app/components/show/agreement_component.rb: -------------------------------------------------------------------------------- 1 | # frozen_string_literal: true 2 | 3 | module Show 4 | class AgreementComponent < ApplicationComponent 5 | def initialize(presenter:) 6 | @presenter = presenter 7 | end 8 | 9 | attr_reader :presenter 10 | 11 | delegate :document, :cocina, :view_token, to: :presenter 12 | delegate :state_service, to: :@presenter 13 | end 14 | end 15 | -------------------------------------------------------------------------------- /app/components/techmd_component.rb: -------------------------------------------------------------------------------- 1 | # frozen_string_literal: true 2 | 3 | class TechmdComponent < ViewComponent::Base 4 | # @params [String] view_token 5 | def initialize(view_token:, presenter:) 6 | @view_token = view_token 7 | @presenter = presenter 8 | end 9 | 10 | attr_reader :view_token 11 | 12 | def render? 13 | !@presenter.version_or_user_version_view? 14 | end 15 | end 16 | -------------------------------------------------------------------------------- /app/jobs/remote_indexing_job.rb: -------------------------------------------------------------------------------- 1 | # frozen_string_literal: true 2 | 3 | ## 4 | # job to reindex a DOR object to Solr using the dor_indexing_app endpoint 5 | class RemoteIndexingJob < BulkActionJob 6 | class RemoteIndexingJobItem < BulkActionJobItem 7 | def perform 8 | Dor::Services::Client.object(druid).reindex 9 | success!(message: 'Reindex successful') 10 | end 11 | end 12 | end 13 | -------------------------------------------------------------------------------- /app/presenters/workflow_xml_presenter.rb: -------------------------------------------------------------------------------- 1 | # frozen_string_literal: true 2 | 3 | # Shows the raw xml of the workflow status, with pretty formatting 4 | class WorkflowXmlPresenter 5 | def initialize(xml:) 6 | @xml = xml 7 | end 8 | 9 | def pretty_xml 10 | CodeRay::Duo[:xml, :div].highlight(PrettyXml.print(xml)).html_safe 11 | end 12 | 13 | private 14 | 15 | attr_reader :xml 16 | end 17 | -------------------------------------------------------------------------------- /app/views/bulk_actions/reindex_jobs/_new.html.erb: -------------------------------------------------------------------------------- 1 | <%= form_with url: reindex_job_path, class: 'new_bulk_action', data: { turbo_frame: '_top' } do |f| %> 2 | <%= render 'bulk_actions/errors' %> 3 | 4 | 5 | Reindexes the DOR object to Solr 6 | 7 | 8 | <%= render 'bulk_actions/druids', f: %> 9 | <%= render 'bulk_actions/common_fields', f: %> 10 | <% end %> 11 | -------------------------------------------------------------------------------- /app/views/collections/new.html.erb: -------------------------------------------------------------------------------- 1 | <% @page_title = 'Register Collection' %> 2 | 3 |

    Register Collection

    4 | 5 | <%= form_tag collections_path do %> 6 |
    7 | 10 | <%= select_tag :apo_druid, options_for_select(@apo_list), class: 'form-select' %> 11 |
    12 | 13 | <%= render 'form' %> 14 | <% end %> 15 | -------------------------------------------------------------------------------- /app/views/metadata/descriptive.html.erb: -------------------------------------------------------------------------------- 1 | <%= render BlacklightModalComponent.new do |component| %> 2 | <% component.with_header { 'View descriptive metadata' } %> 3 | <% component.with_body do 4 | render ModsDisplay::RecordComponent.new(record: @mods_display, 5 | fields: [:title] + ModsDisplay::RecordComponent::DEFAULT_FIELDS - [:subTitle]) 6 | end %> 7 | <% end %> 8 | -------------------------------------------------------------------------------- /app/components/show/item/structure/file_component.rb: -------------------------------------------------------------------------------- 1 | # frozen_string_literal: true 2 | 3 | module Show 4 | module Item 5 | module Structure 6 | class FileComponent < ViewComponent::Base 7 | def initialize(file:) 8 | @file = file 9 | end 10 | 11 | delegate :name, :size, :index, to: :file 12 | 13 | attr_reader :file 14 | end 15 | end 16 | end 17 | end 18 | -------------------------------------------------------------------------------- /app/controllers/bulk_actions/import_tag_jobs_controller.rb: -------------------------------------------------------------------------------- 1 | # frozen_string_literal: true 2 | 3 | module BulkActions 4 | class ImportTagJobsController < ApplicationController 5 | include CreatesBulkActions 6 | 7 | self.action_type = 'ImportTagsJob' 8 | 9 | def job_params 10 | { groups: current_user.groups, csv_file: CsvUploadNormalizer.read(params[:csv_file].path) } 11 | end 12 | end 13 | end 14 | -------------------------------------------------------------------------------- /app/controllers/bulk_actions/text_extraction_jobs_controller.rb: -------------------------------------------------------------------------------- 1 | # frozen_string_literal: true 2 | 3 | module BulkActions 4 | class TextExtractionJobsController < ApplicationController 5 | include CreatesBulkActions 6 | 7 | self.action_type = 'TextExtractionJob' 8 | 9 | def job_params 10 | super.merge(text_extraction_languages: params[:text_extraction_languages]) 11 | end 12 | end 13 | end 14 | -------------------------------------------------------------------------------- /app/helpers/profile_helper.rb: -------------------------------------------------------------------------------- 1 | # frozen_string_literal: true 2 | 3 | module ProfileHelper 4 | include Blacklight::CatalogHelperBehavior 5 | 6 | ## 7 | # Kind of a hacky override, but better than overriding additional partials 8 | # Don't show pagination for ProfileController requests 9 | def show_pagination?(*) 10 | return false if params['controller'] == 'profile' 11 | 12 | super 13 | end 14 | end 15 | -------------------------------------------------------------------------------- /app/views/catalog/_constraints.html.erb: -------------------------------------------------------------------------------- 1 | <%= render Blacklight::ConstraintsComponent.new(search_state:, 2 | facet_constraint_component: ConstraintComponent, 3 | query_constraint_component: ConstraintLayoutComponent, 4 | tag: :ul, classes: 'clearfix constraints-container list-unstyled') %> 5 | -------------------------------------------------------------------------------- /db/migrate/20121011191241_create_indexing_exceptions.rb: -------------------------------------------------------------------------------- 1 | class CreateIndexingExceptions < ActiveRecord::Migration[4.2] 2 | def change 3 | create_table :indexing_exceptions do |t| 4 | t.string :pid 5 | t.text :solr_document 6 | t.string :dor_services_version 7 | t.text :exception 8 | 9 | t.timestamps 10 | end 11 | 12 | add_index :indexing_exceptions, :pid 13 | end 14 | end 15 | -------------------------------------------------------------------------------- /app/components/workflow_update_button.html.erb: -------------------------------------------------------------------------------- 1 | <%# workflow update requires id, workflow, process, and status parameters %> 2 | <%= form_tag item_workflow_path(druid, workflow_name), method: 'put' do %> 3 | <%= hidden_field_tag('process', name) %> 4 | <%= hidden_field_tag('status', next_status) %> 5 | <%= button_tag(label, id: "workflow-status-set-#{name}-#{next_status}", type: 'submit', class: 'btn btn-primary') %> 6 | <% end %> 7 | -------------------------------------------------------------------------------- /app/views/bulk_actions/download_mods_jobs/_new.html.erb: -------------------------------------------------------------------------------- 1 | <%= form_with url: download_mods_job_path, class: 'new_bulk_action', data: { turbo_frame: '_top' } do |f| %> 2 | <%= render 'bulk_actions/errors' %> 3 | 4 | 5 | Download descriptive metadata for objects. 6 | 7 | 8 | <%= render 'bulk_actions/druids', f: %> 9 | <%= render 'bulk_actions/common_fields', f: %> 10 | <% end %> 11 | -------------------------------------------------------------------------------- /db/migrate/20110820000004_create_bookmarks.rb: -------------------------------------------------------------------------------- 1 | class CreateBookmarks < ActiveRecord::Migration[4.2] 2 | def self.up 3 | create_table :bookmarks do |t| 4 | t.integer :user_id, null: false 5 | t.text :url 6 | t.string :document_id 7 | t.string :title 8 | t.text :notes 9 | t.timestamps 10 | end 11 | end 12 | 13 | def self.down 14 | drop_table :bookmarks 15 | end 16 | end 17 | -------------------------------------------------------------------------------- /app/controllers/bulk_actions/manage_release_jobs_controller.rb: -------------------------------------------------------------------------------- 1 | # frozen_string_literal: true 2 | 3 | module BulkActions 4 | class ManageReleaseJobsController < ApplicationController 5 | include CreatesBulkActions 6 | 7 | self.action_type = 'ReleaseObjectJob' 8 | 9 | def job_params 10 | super.merge(to: params[:to], who: params[:who], what: params[:what], tag: params[:tag]) 11 | end 12 | end 13 | end 14 | -------------------------------------------------------------------------------- /app/views/bulk_actions/export_cocina_json_jobs/_new.html.erb: -------------------------------------------------------------------------------- 1 | <%= form_with url: export_cocina_json_job_path, class: 'new_bulk_action', data: { turbo_frame: '_top' } do |f| %> 2 | <%= render 'bulk_actions/errors' %> 3 | 4 | 5 | Download full Cocina JSON for objects. 6 | 7 | 8 | <%= render 'bulk_actions/druids', f: %> 9 | <%= render 'bulk_actions/common_fields', f: %> 10 | <% end %> 11 | -------------------------------------------------------------------------------- /bin/sidekiq: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env ruby 2 | # frozen_string_literal: true 3 | 4 | # 5 | # This file was generated by Bundler. 6 | # 7 | # The application 'sidekiq' is installed as part of a gem, and 8 | # this file is here to facilitate running it. 9 | # 10 | 11 | ENV["BUNDLE_GEMFILE"] ||= File.expand_path("../Gemfile", __dir__) 12 | 13 | require "rubygems" 14 | require "bundler/setup" 15 | 16 | load Gem.bin_path("sidekiq", "sidekiq") 17 | -------------------------------------------------------------------------------- /spec/components/report_category_component_spec.rb: -------------------------------------------------------------------------------- 1 | # frozen_string_literal: true 2 | 3 | require 'rails_helper' 4 | 5 | RSpec.describe ReportCategoryComponent, type: :component do 6 | it 'renders the category fields' do 7 | render_inline(described_class.new(category: Report::CITATION_CATEGORY)) 8 | expect(page).to have_content('Citation') 9 | expect(page).to have_field('Author', checked: false) 10 | end 11 | end 12 | -------------------------------------------------------------------------------- /spec/views/items/file.html.erb_spec.rb: -------------------------------------------------------------------------------- 1 | # frozen_string_literal: true 2 | 3 | require 'rails_helper' 4 | 5 | RSpec.describe 'items/file' do 6 | it 'renders the template' do 7 | stub_template 'items/_file.html.erb' => 'stubbed_file' 8 | render 9 | expect(rendered).to have_css '.modal-header h3.modal-title', text: 'Files' 10 | expect(rendered).to have_css '.modal-body', text: 'stubbed_file' 11 | end 12 | end 13 | -------------------------------------------------------------------------------- /app/components/constraint_layout_component.rb: -------------------------------------------------------------------------------- 1 | # frozen_string_literal: true 2 | 3 | class ConstraintLayoutComponent < Blacklight::ConstraintLayoutComponent 4 | attr_reader :value, :label, :remove_path, :classes 5 | 6 | def remove_aria_label 7 | return I18n.t('blacklight.search.filters.remove.value', value:) if label.blank? 8 | 9 | I18n.t('blacklight.search.filters.remove.label_value', label:, value:) 10 | end 11 | end 12 | -------------------------------------------------------------------------------- /app/components/language_selector_component.rb: -------------------------------------------------------------------------------- 1 | # frozen_string_literal: true 2 | 3 | # Show the language selection controls for OCR text extraction workflows 4 | class LanguageSelectorComponent < ApplicationComponent 5 | def initialize(form:) 6 | @form = form 7 | end 8 | 9 | def available_ocr_languages 10 | ABBYY_LANGUAGES.map { |lang| [lang, lang.gsub(/[ ()]/, '')] } 11 | end 12 | 13 | attr_reader :form 14 | end 15 | -------------------------------------------------------------------------------- /app/views/bulk_actions/checksum_report_jobs/_new.html.erb: -------------------------------------------------------------------------------- 1 | <%= form_with url: checksum_report_job_path, class: 'new_bulk_action', data: { turbo_frame: '_top' } do |f| %> 2 | <%= render 'bulk_actions/errors' %> 3 | 4 | 5 | Download checksums of files in objects (as csv). 6 | 7 | 8 | <%= render 'bulk_actions/druids', f: %> 9 | <%= render 'bulk_actions/common_fields', f: %> 10 | <% end %> 11 | -------------------------------------------------------------------------------- /app/views/bulk_actions/refresh_mods_jobs/_new.html.erb: -------------------------------------------------------------------------------- 1 | <%= form_with url: refresh_mods_job_path, class: 'new_bulk_action', data: { turbo_frame: '_top' } do |f| %> 2 | <%= render 'bulk_actions/errors' %> 3 | 4 | 5 | Refresh metadata from the catalog 6 | 7 | 8 | <%= render 'bulk_actions/druids', f: %> 9 | <%= render 'bulk_actions/common_fields', f:, close_option: true %> 10 | <% end %> 11 | -------------------------------------------------------------------------------- /app/assets/stylesheets/workflow_grid.css: -------------------------------------------------------------------------------- 1 | .workflow-grid-table { 2 | table { 3 | counter-reset: rowNumber; 4 | } 5 | 6 | tr { 7 | counter-increment: rowNumber; 8 | 9 | td:first-child::before { 10 | content: counter(rowNumber); 11 | margin-right: 0.5em; 12 | min-width: 1em; 13 | } 14 | } 15 | } 16 | 17 | /* reset button */ 18 | .errors { 19 | form { 20 | display: inline-block; 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /app/components/contents/constituent_component.rb: -------------------------------------------------------------------------------- 1 | # frozen_string_literal: true 2 | 3 | module Contents 4 | # Displays constituents for a virtual object 5 | # e.g. https://argo.stanford.edu/view/druid:tm280sk2404 6 | class ConstituentComponent < ViewComponent::Base 7 | with_collection_parameter :druid 8 | 9 | def initialize(druid:) 10 | @druid = druid 11 | end 12 | 13 | attr_reader :druid 14 | end 15 | end 16 | -------------------------------------------------------------------------------- /app/controllers/bulk_actions/virtual_object_jobs_controller.rb: -------------------------------------------------------------------------------- 1 | # frozen_string_literal: true 2 | 3 | module BulkActions 4 | class VirtualObjectJobsController < ApplicationController 5 | include CreatesBulkActions 6 | 7 | self.action_type = 'CreateVirtualObjectsJob' 8 | 9 | def job_params 10 | { groups: current_user.groups, csv_file: CsvUploadNormalizer.read(params[:csv_file].path) } 11 | end 12 | end 13 | end 14 | -------------------------------------------------------------------------------- /app/models/view_switcher.rb: -------------------------------------------------------------------------------- 1 | # frozen_string_literal: true 2 | 3 | ## 4 | # Holds structure needed to switch views between controllers 5 | class ViewSwitcher 6 | attr_reader :name, :path 7 | 8 | ## 9 | # @param [Symbol] name name of "view" used for switching between controllers 10 | # @param [Symbol] path named route path helper method 11 | def initialize(name, path) 12 | @name = name 13 | @path = path 14 | end 15 | end 16 | -------------------------------------------------------------------------------- /app/views/workflow_service/unlock.html.erb: -------------------------------------------------------------------------------- 1 | 2 | <%= link_to close_ui_item_version_index_path(item_id: id), 3 | title: 'Close Version', 4 | class: 'btn', 5 | data: { 6 | controller: 'open-close', 7 | action: 'click->open-close#open' 8 | } do %> 9 | <%= tag.span class: 'bi-unlock-fill' %> 10 | <% end %> 11 | 12 | -------------------------------------------------------------------------------- /config/initializers/assets.rb: -------------------------------------------------------------------------------- 1 | # Be sure to restart your server when you modify this file. 2 | 3 | # Version of your assets, change this if you want to expire all your assets. 4 | # Rails.application.config.assets.version = "1.0" 5 | 6 | # Add additional assets to the asset load path. 7 | # Rails.application.config.assets.paths << Emoji.images_path 8 | Rails.application.config.assets.paths << Rails.root.join('node_modules/tabulator-tables/dist/css') 9 | -------------------------------------------------------------------------------- /app/components/show/item/structure/file_hierarchy_component.rb: -------------------------------------------------------------------------------- 1 | # frozen_string_literal: true 2 | 3 | module Show 4 | module Item 5 | module Structure 6 | class FileHierarchyComponent < ViewComponent::Base 7 | # @params [String] view_token 8 | def initialize(view_token:) 9 | @view_token = view_token 10 | end 11 | 12 | attr_reader :view_token 13 | end 14 | end 15 | end 16 | end 17 | -------------------------------------------------------------------------------- /app/controllers/bulk_actions/collection_jobs_controller.rb: -------------------------------------------------------------------------------- 1 | # frozen_string_literal: true 2 | 3 | module BulkActions 4 | class CollectionJobsController < ApplicationController 5 | include CreatesBulkActions 6 | 7 | self.action_type = 'SetCollectionJob' 8 | 9 | def job_params 10 | super.merge(new_collection_id: params[:new_collection_id].compact_blank, close_version: params[:close_version]) 11 | end 12 | end 13 | end 14 | -------------------------------------------------------------------------------- /spec/helpers/profile_helper_spec.rb: -------------------------------------------------------------------------------- 1 | # frozen_string_literal: true 2 | 3 | require 'rails_helper' 4 | 5 | RSpec.describe ProfileHelper do 6 | describe '#show_pagination?' do 7 | context 'when using ProfileController' do 8 | it 'returns false' do 9 | allow(helper).to receive_messages(params: { 'controller' => 'profile' }) 10 | expect(helper.show_pagination?).to be false 11 | end 12 | end 13 | end 14 | end 15 | -------------------------------------------------------------------------------- /app/assets/stylesheets/document.css: -------------------------------------------------------------------------------- 1 | dl.deflist { 2 | clear: left !important; 3 | 4 | dt { 5 | text-align: left; 6 | width: 7.5em; 7 | } 8 | 9 | dd { 10 | width: 80%; 11 | } 12 | } 13 | 14 | .errortext { 15 | color: red; 16 | --bs-table-color: red; /* override bootstrap table text color */ 17 | } 18 | 19 | .notetext { 20 | color: green; 21 | --bs-table-color: green; /* override bootstrap table text color */ 22 | } 23 | -------------------------------------------------------------------------------- /app/views/bulk_actions/export_tag_jobs/_new.html.erb: -------------------------------------------------------------------------------- 1 | <%= form_with url: export_tag_job_path, class: 'new_bulk_action', data: { turbo_frame: '_top' } do |f| %> 2 | <%= render 'bulk_actions/errors' %> 3 | 4 | 5 | Download tags as CSV (comma-separated values) for druids specified below 6 | 7 | 8 | <%= render 'bulk_actions/druids', f: %> 9 | <%= render 'bulk_actions/common_fields', f: %> 10 | <% end %> 11 | -------------------------------------------------------------------------------- /app/views/shared/_modal.html.erb: -------------------------------------------------------------------------------- 1 | 2 | 8 | -------------------------------------------------------------------------------- /app/views/bulk_actions/descriptive_metadata_export_jobs/_new.html.erb: -------------------------------------------------------------------------------- 1 | <%= form_with url: descriptive_metadata_export_job_path, class: 'new_bulk_action', data: { turbo_frame: '_top' } do |f| %> 2 | <%= render 'bulk_actions/errors' %> 3 | 4 | 5 | Download descriptive metadata for objects. 6 | 7 | 8 | <%= render 'bulk_actions/druids', f: %> 9 | <%= render 'bulk_actions/common_fields', f: %> 10 | <% end %> 11 | -------------------------------------------------------------------------------- /app/views/files/index.html.erb: -------------------------------------------------------------------------------- 1 | <%= render BlacklightModalComponent.new do |component| %> 2 | <% component.with_header { 'File Availability' } %> 3 | <% component.with_body do %> 4 | <%= render Contents::StacksLinkComponent.new(druid: params[:item_id], user_version: @user_version, cocina_file: @file) %> 5 | <%= render Contents::PreservationLinkComponent.new(druid: params[:item_id], cocina_file: @file, version: @version) %> 6 | <% end %> 7 | <% end %> 8 | -------------------------------------------------------------------------------- /app/views/items/_edit_dro_rights.html.erb: -------------------------------------------------------------------------------- 1 | <%= turbo_frame_tag 'access-rights' do %> 2 | <%= form_with model: @change_set, data: { controller: 'access-rights' } do |f| %> 3 | <%= render Edit::Item::AccessRightsComponent.new(form_builder: f) %> 4 | 5 |
    6 | <%= link_to 'Cancel', show_rights_item_path(params[:id]) %> 7 | <%= f.submit 'Save', class: 'btn btn-primary' %> 8 |
    9 | <% end %> 10 | <% end %> 11 | -------------------------------------------------------------------------------- /app/views/workflow_service/lock.html.erb: -------------------------------------------------------------------------------- 1 | 2 | <%= link_to open_ui_item_version_index_path(item_id: id), 3 | title: 'Unlock to make changes to this object', 4 | class: 'btn', 5 | data: { 6 | controller: 'open-close', 7 | action: 'click->open-close#open' 8 | } do %> 9 | <%= tag.span class: 'bi-lock-fill' %> 10 | <% end %> 11 | 12 | -------------------------------------------------------------------------------- /spec/support/collection_method_sender.rb: -------------------------------------------------------------------------------- 1 | # frozen_string_literal: true 2 | 3 | class CollectionMethodSender 4 | def initialize(cocina_request) 5 | @cocina_model = cocina_request 6 | end 7 | 8 | attr_reader :cocina_model 9 | 10 | def title=(title) 11 | @cocina_model = @cocina_model.new(description: { title: [{ value: title }] }) 12 | end 13 | 14 | def label=(label) 15 | @cocina_model = @cocina_model.new(label:) 16 | end 17 | end 18 | -------------------------------------------------------------------------------- /app/components/blacklight_modal_component.html.erb: -------------------------------------------------------------------------------- 1 | 5 | 6 | 9 | 10 | 14 | -------------------------------------------------------------------------------- /app/helpers/bulk_action_helper.rb: -------------------------------------------------------------------------------- 1 | # frozen_string_literal: true 2 | 3 | # Helper methods for BulkAction views. 4 | module BulkActionHelper 5 | # Renders the partial for a BulkAction based on its action type (descriptive metadata download etc.) 6 | def render_bulk_action_type(bulk_action) 7 | render partial: bulk_action.action_type.underscore, locals: { bulk_action: } 8 | rescue ActionView::MissingTemplate 9 | render partial: 'default' 10 | end 11 | end 12 | -------------------------------------------------------------------------------- /app/views/bulk_actions/apply_apo_defaults_jobs/_new.html.erb: -------------------------------------------------------------------------------- 1 | <%= form_with url: apply_apo_defaults_job_path, class: 'new_bulk_action', data: { turbo_frame: '_top' } do |f| %> 2 | <%= render 'bulk_actions/errors' %> 3 | 4 | 5 | Overwrite object metadata with the defaults from the APO. 6 | 7 | 8 | <%= render 'bulk_actions/druids', f: %> 9 | <%= render 'bulk_actions/common_fields', f:, close_option: true %> 10 | <% end %> 11 | -------------------------------------------------------------------------------- /app/components/version_milestones_component.html.erb: -------------------------------------------------------------------------------- 1 | 2 | - 3 | <%= version_link_or_label %><% if user_version %> (<%= user_version_link_or_label %>)<% end %> 4 | 5 | 6 | 7 | <% steps.each do |k, m| %> 8 | 9 | 10 | <%= m[:display] || k.titleize %> 11 | <%= m[:time].nil? ? 'pending' : m[:time].in_time_zone.to_s %> 12 | 13 | <% end %> 14 | -------------------------------------------------------------------------------- /app/views/bulk_actions/export_structural_jobs/_new.html.erb: -------------------------------------------------------------------------------- 1 | <%= form_with url: export_structural_job_path, class: 'new_bulk_action', data: { turbo_frame: '_top' } do |f| %> 2 | <%= render 'bulk_actions/errors' %> 3 | 4 | 5 | Export structural metadata as CSV (comma-separated values) for druids specified below 6 | 7 | 8 | <%= render 'bulk_actions/druids', f: %> 9 | <%= render 'bulk_actions/common_fields', f: %> 10 | <% end %> 11 | -------------------------------------------------------------------------------- /app/views/items/_set_governing_apo_ui.html.erb: -------------------------------------------------------------------------------- 1 | <%= form_tag set_governing_apo_item_path(@cocina.externalIdentifier) do %> 2 |
    3 | <%= label_tag :new_apo_id, 'New governing APO' %> 4 | <%= select_tag :new_apo_id, 5 | options_for_select(@apo_list, @cocina.administrative.hasAdminPolicy), 6 | class: 'form-select' %> 7 |
    8 | 11 | <% end %> 12 | -------------------------------------------------------------------------------- /spec/views/workflows/show.html.erb_spec.rb: -------------------------------------------------------------------------------- 1 | # frozen_string_literal: true 2 | 3 | require 'rails_helper' 4 | 5 | RSpec.describe 'workflows/show' do 6 | it 'renders the template' do 7 | stub_template 'workflows/_show.html.erb' => 'stubbed_workflow_view' 8 | render 9 | expect(rendered) 10 | .to have_css '.modal-header h3.modal-title', text: 'Workflow view' 11 | expect(rendered).to have_css '.modal-body', text: 'stubbed_workflow_view' 12 | end 13 | end 14 | -------------------------------------------------------------------------------- /app/components/report_category_component.html.erb: -------------------------------------------------------------------------------- 1 |
    <%= category %>
    2 | <% fields.each do |field| %> 3 |
    4 | 7 |
    8 | <% end %> 9 | -------------------------------------------------------------------------------- /app/components/show/item/structure/directory_component.rb: -------------------------------------------------------------------------------- 1 | # frozen_string_literal: true 2 | 3 | module Show 4 | module Item 5 | module Structure 6 | class DirectoryComponent < ViewComponent::Base 7 | def initialize(directory:) 8 | @directory = directory 9 | end 10 | 11 | delegate :name, :children_directories, :children_files, :index, to: :directory 12 | 13 | attr_reader :directory 14 | end 15 | end 16 | end 17 | end 18 | -------------------------------------------------------------------------------- /app/views/bulk_actions/export_catalog_links_jobs/_new.html.erb: -------------------------------------------------------------------------------- 1 | <%= form_with url: export_catalog_links_job_path, class: 'new_bulk_action', data: { turbo_frame: '_top' } do |f| %> 2 | <%= render 'bulk_actions/errors' %> 3 | 4 | 5 | Download FOLIO Instance HRIDs and barcodes as CSV (comma-separated values) for druids specified below. 6 | 7 | <%= render 'bulk_actions/druids', f: %> 8 | <%= render 'bulk_actions/common_fields', f: %> 9 | <% end %> 10 | -------------------------------------------------------------------------------- /spec/views/content_types/edit.html.erb_spec.rb: -------------------------------------------------------------------------------- 1 | # frozen_string_literal: true 2 | 3 | require 'rails_helper' 4 | 5 | RSpec.describe 'content_types/edit' do 6 | it 'renders the template' do 7 | stub_template 'content_types/_content_type.html.erb' => 'stubbed_content_type' 8 | render 9 | expect(rendered).to have_css '.modal-header h3.modal-title', text: 'Set content type' 10 | expect(rendered).to have_css '.modal-body', text: 'stubbed_content_type' 11 | end 12 | end 13 | -------------------------------------------------------------------------------- /spec/views/items/source_id_ui.html.erb_spec.rb: -------------------------------------------------------------------------------- 1 | # frozen_string_literal: true 2 | 3 | require 'rails_helper' 4 | 5 | RSpec.describe 'items/source_id_ui' do 6 | it 'renders the template' do 7 | stub_template 'items/_source_id_ui.html.erb' => 'stubbed_source_id_ui' 8 | render 9 | expect(rendered) 10 | .to have_css '.modal-header h3.modal-title', text: 'Change source id' 11 | expect(rendered).to have_css '.modal-body', text: 'source_id_ui' 12 | end 13 | end 14 | -------------------------------------------------------------------------------- /spec/views/workflows/history.html.erb_spec.rb: -------------------------------------------------------------------------------- 1 | # frozen_string_literal: true 2 | 3 | require 'rails_helper' 4 | 5 | RSpec.describe 'workflows/history' do 6 | it 'renders the HS template' do 7 | stub_template 'workflows/_history.html.erb' => 'stubbed_wf_history_view' 8 | render 9 | expect(rendered).to have_css '.modal-header h3.modal-title', text: 'Workflow history' 10 | expect(rendered).to have_css '.modal-body', text: 'stubbed_wf_history_view' 11 | end 12 | end 13 | -------------------------------------------------------------------------------- /app/views/bulk_actions/republish_jobs/_new.html.erb: -------------------------------------------------------------------------------- 1 | <%= form_with url: republish_job_path, class: 'new_bulk_action', data: { turbo_frame: '_top' } do |f| %> 2 | <%= render 'bulk_actions/errors' %> 3 | 4 | 5 | Republish DOR objects. You still need to use the normal versioning process to make sure your changes are preserved. 6 | 7 | 8 | <%= render 'bulk_actions/druids', f: %> 9 | <%= render 'bulk_actions/common_fields', f: %> 10 | <% end %> 11 | -------------------------------------------------------------------------------- /spec/views/versions/close_ui.html.erb_spec.rb: -------------------------------------------------------------------------------- 1 | # frozen_string_literal: true 2 | 3 | require 'rails_helper' 4 | 5 | RSpec.describe 'versions/close_ui' do 6 | it 'renders the JS template' do 7 | stub_template 'versions/_close_ui.html.erb' => 'stubbed_closed_version' 8 | render 9 | expect(rendered) 10 | .to have_css '.modal-header h3.modal-title', text: 'Close version' 11 | expect(rendered).to have_css '.modal-body', text: 'stubbed_closed_version' 12 | end 13 | end 14 | -------------------------------------------------------------------------------- /app/components/show/item/overview_component.rb: -------------------------------------------------------------------------------- 1 | # frozen_string_literal: true 2 | 3 | module Show 4 | module Item 5 | class OverviewComponent < ApplicationComponent 6 | # @param [ArgoShowPresenter] presenter 7 | def initialize(presenter:) 8 | @presenter = presenter 9 | @solr_document = presenter.document 10 | end 11 | 12 | delegate :id, :status, to: :@solr_document 13 | delegate :state_service, to: :@presenter 14 | end 15 | end 16 | end 17 | -------------------------------------------------------------------------------- /app/services/search_service.rb: -------------------------------------------------------------------------------- 1 | # frozen_string_literal: true 2 | 3 | # Searches against Solr 4 | class SearchService 5 | class << self 6 | def query(query, args = {}) 7 | params = args.merge(q: query) 8 | params[:start] ||= 0 9 | solr.get 'select', params: 10 | end 11 | 12 | delegate :blacklight_config, to: CatalogController 13 | 14 | def solr 15 | blacklight_config.repository_class.new(blacklight_config).connection 16 | end 17 | end 18 | end 19 | -------------------------------------------------------------------------------- /app/views/items/edit_barcode.html.erb: -------------------------------------------------------------------------------- 1 | <%= turbo_frame_tag 'barcode' do %> 2 | <%= form_with model: @change_set do |f| %> 3 |
    4 | <%= f.label :barcode, class: 'visually-hidden' %> 5 | <%= f.text_field :barcode, class: 'form-control' %> 6 |
    7 |
    8 | <%= link_to 'Cancel', show_barcode_item_path(params[:id]) %> 9 | <%= f.submit 'Save', class: 'btn btn-primary' %> 10 |
    11 | <% end %> 12 | <% end %> 13 | -------------------------------------------------------------------------------- /spec/support/apo_method_sender.rb: -------------------------------------------------------------------------------- 1 | # frozen_string_literal: true 2 | 3 | class ApoMethodSender 4 | def initialize(cocina_request) 5 | @cocina_model = cocina_request 6 | end 7 | 8 | attr_reader :cocina_model 9 | 10 | def title=(title) 11 | @cocina_model = @cocina_model.new(description: { title: [{ value: title }] }) 12 | end 13 | 14 | def roles=(roles) 15 | @cocina_model = @cocina_model.new(administrative: @cocina_model.administrative.new(roles:)) 16 | end 17 | end 18 | -------------------------------------------------------------------------------- /spec/views/items/collection_ui.html.erb_spec.rb: -------------------------------------------------------------------------------- 1 | # frozen_string_literal: true 2 | 3 | require 'rails_helper' 4 | 5 | RSpec.describe 'items/collection_ui' do 6 | it 'renders the template' do 7 | stub_template 'items/_collection_ui.html.erb' => 'stubbed_collection_ui' 8 | render 9 | expect(rendered) 10 | .to have_css '.modal-header h3.modal-title', text: 'Edit collections' 11 | expect(rendered).to have_css '.modal-body', text: 'stubbed_collection_ui' 12 | end 13 | end 14 | -------------------------------------------------------------------------------- /.eslintrc.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | env: { 3 | browser: true, 4 | es2021: true 5 | }, 6 | extends: 'standard', 7 | overrides: [ 8 | { 9 | env: { 10 | node: true 11 | }, 12 | files: [ 13 | '.eslintrc.{js,cjs}' 14 | ], 15 | parserOptions: { 16 | sourceType: 'script' 17 | } 18 | } 19 | ], 20 | parserOptions: { 21 | ecmaVersion: 'latest', 22 | sourceType: 'module' 23 | }, 24 | rules: { 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /spec/fixtures/bulk_upload/workspace/druid:bc682xk5613/2016_04_21_16_56_40_824/log.txt: -------------------------------------------------------------------------------- 1 | argo.bulk_metadata.bulk_log_job_start 2016-04-21 09:57am 2 | argo.bulk_metadata.bulk_log_user tommyi 3 | argo.bulk_metadata.bulk_log_input_file crowdsourcing_bridget_1.xlsx 4 | argo.bulk_metadata.bulk_log_xml_timestamp 2016-04-21 09:57am 5 | argo.bulk_metadata.bulk_log_xml_filename crowdsourcing_bridget_1-MODS.xml 6 | argo.bulk_metadata.bulk_log_record_count 20 7 | argo.bulk_metadata.bulk_log_job_complete 2016-04-21 09:57am 8 | -------------------------------------------------------------------------------- /spec/views/versions/open_ui.html.erb_spec.rb: -------------------------------------------------------------------------------- 1 | # frozen_string_literal: true 2 | 3 | require 'rails_helper' 4 | 5 | RSpec.describe 'versions/open_ui' do 6 | it 'renders the JS template' do 7 | stub_template 'versions/_open_ui.html.erb' => 'stubbed_open_version_ui' 8 | render 9 | expect(rendered) 10 | .to have_css '.modal-header h3.modal-title', text: 'Open for modification' 11 | expect(rendered).to have_css '.modal-body', text: 'stubbed_open_version_ui' 12 | end 13 | end 14 | -------------------------------------------------------------------------------- /app/components/show/agreement/overview_component.rb: -------------------------------------------------------------------------------- 1 | # frozen_string_literal: true 2 | 3 | module Show 4 | module Agreement 5 | class OverviewComponent < ApplicationComponent 6 | # @param [ArgoShowPresenter] presenter 7 | def initialize(presenter:) 8 | @presenter = presenter 9 | @solr_document = presenter.document 10 | end 11 | 12 | delegate :id, :status, to: :@solr_document 13 | delegate :state_service, to: :@presenter 14 | end 15 | end 16 | end 17 | -------------------------------------------------------------------------------- /app/views/items/edit_copyright.html.erb: -------------------------------------------------------------------------------- 1 | <%= turbo_frame_tag 'copyright' do %> 2 | <%= form_with model: @change_set do |f| %> 3 |
    4 | <%= f.label :copyright, class: 'visually-hidden' %> 5 | <%= f.text_field :copyright, class: 'form-control' %> 6 |
    7 |
    8 | <%= link_to 'Cancel', show_copyright_item_path(params[:id]) %> 9 | <%= f.submit 'Save', class: 'btn btn-primary' %> 10 |
    11 | <% end %> 12 | <% end %> 13 | -------------------------------------------------------------------------------- /spec/fixtures/bulk_upload/workspace/druid:bc682xk5613/2016_05_02_22_39_44_008/log.txt.moved: -------------------------------------------------------------------------------- 1 | argo.bulk_metadata.bulk_log_job_start 2016-05-02 15:39pm 2 | argo.bulk_metadata.bulk_log_user tommyi 3 | argo.bulk_metadata.bulk_log_input_file crowdsourcing_bridget_1.xlsx 4 | argo.bulk_metadata.bulk_log_xml_timestamp 2016-05-02 15:40pm 5 | argo.bulk_metadata.bulk_log_xml_filename crowdsourcing_bridget_1-MODS.xml 6 | argo.bulk_metadata.bulk_log_record_count 0 7 | argo.bulk_metadata.bulk_log_job_complete 2016-05-02 15:40pm 8 | -------------------------------------------------------------------------------- /spec/models/view_switcher_spec.rb: -------------------------------------------------------------------------------- 1 | # frozen_string_literal: true 2 | 3 | require 'rails_helper' 4 | 5 | RSpec.describe ViewSwitcher do 6 | let(:view_switcher) { described_class.new(:cool_view, :cool_view_path) } 7 | 8 | describe '#name' do 9 | it 'returns name' do 10 | expect(view_switcher.name).to eq :cool_view 11 | end 12 | end 13 | 14 | describe '#path' do 15 | it 'returns view' do 16 | expect(view_switcher.path).to eq :cool_view_path 17 | end 18 | end 19 | end 20 | -------------------------------------------------------------------------------- /app/components/edit_modal_component.rb: -------------------------------------------------------------------------------- 1 | # frozen_string_literal: true 2 | 3 | # This models the component that appears when you click one of the blue buttons to modify an object. 4 | # It does not depend on the BlacklightModalComponent, which has a bunch of jquery javascript for 5 | # doing the ajax. That javascript prevents us from showing errors after a form is submitted. 6 | class EditModalComponent < ApplicationComponent 7 | renders_one :header 8 | renders_one :body 9 | renders_one :footer 10 | end 11 | -------------------------------------------------------------------------------- /app/components/show/collection/overview_component.rb: -------------------------------------------------------------------------------- 1 | # frozen_string_literal: true 2 | 3 | module Show 4 | module Collection 5 | class OverviewComponent < ApplicationComponent 6 | # @param [ArgoShowPresenter] presenter 7 | def initialize(presenter:) 8 | @presenter = presenter 9 | @solr_document = presenter.document 10 | end 11 | 12 | delegate :id, :status, to: :@solr_document 13 | delegate :state_service, to: :@presenter 14 | end 15 | end 16 | end 17 | -------------------------------------------------------------------------------- /app/views/items/edit_license.html.erb: -------------------------------------------------------------------------------- 1 | <%= turbo_frame_tag 'license' do %> 2 | <%= form_with model: @change_set do |f| %> 3 |
    4 | <%= f.label :license, class: 'visually-hidden' %> 5 | <%= f.select :license, license_options, {}, class: 'form-select' %> 6 |
    7 |
    8 | <%= link_to 'Cancel', show_license_item_path(params[:id]) %> 9 | <%= f.submit 'Save', class: 'btn btn-primary' %> 10 |
    11 | <% end %> 12 | <% end %> 13 | -------------------------------------------------------------------------------- /app/views/versions/_open_ui.html.erb: -------------------------------------------------------------------------------- 1 | <%= form_with url: open_item_version_index_path(item_id: @cocina_object.externalIdentifier), 2 | method: :post, 3 | local: true do %> 4 |
    5 |
    6 | 7 |
    8 | 11 | <% end %> 12 | -------------------------------------------------------------------------------- /app/components/show/external_links_component.html.erb: -------------------------------------------------------------------------------- 1 |
    2 |

    View in new window

    3 | 12 |
    13 | -------------------------------------------------------------------------------- /app/controllers/technicals_controller.rb: -------------------------------------------------------------------------------- 1 | # frozen_string_literal: true 2 | 3 | class TechnicalsController < ApplicationController 4 | def show 5 | @techmd = TechmdService.techmd_for(druid: decrypted_token.fetch(:druid)) 6 | end 7 | 8 | private 9 | 10 | # decode the token that grants view access 11 | # @raise [ActiveSupport::MessageVerifier::InvalidSignature] if the token is invalid 12 | def decrypted_token 13 | Argo.verifier.verify(params[:item_id], purpose: :view_token) 14 | end 15 | end 16 | -------------------------------------------------------------------------------- /app/models/druid.rb: -------------------------------------------------------------------------------- 1 | # frozen_string_literal: true 2 | 3 | class Druid 4 | def initialize(identifier_or_cocina) 5 | identifier = identifier_or_cocina.respond_to?(:externalIdentifier) ? identifier_or_cocina.externalIdentifier : identifier_or_cocina 6 | @identifier = identifier.start_with?('druid:') ? identifier : "druid:#{identifier}" 7 | end 8 | 9 | def with_namespace 10 | @identifier 11 | end 12 | 13 | def without_namespace 14 | @identifier.delete_prefix('druid:') 15 | end 16 | end 17 | -------------------------------------------------------------------------------- /.github/pull_request_template.md: -------------------------------------------------------------------------------- 1 | # Why was this change made? 2 | 3 | 4 | 5 | 6 | # How was this change tested? 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /app/controllers/bulk_actions/rights_jobs_controller.rb: -------------------------------------------------------------------------------- 1 | # frozen_string_literal: true 2 | 3 | module BulkActions 4 | class RightsJobsController < ApplicationController 5 | include CreatesBulkActions 6 | 7 | self.action_type = 'SetRightsJob' 8 | 9 | def job_params 10 | super.merge(params.slice(:view_access, :download_access, :controlled_digital_lending, 11 | :access_location).to_unsafe_h).merge(close_version: params[:close_version]) 12 | end 13 | end 14 | end 15 | -------------------------------------------------------------------------------- /app/presenters/argo_index_presenter.rb: -------------------------------------------------------------------------------- 1 | # frozen_string_literal: true 2 | 3 | class ArgoIndexPresenter < Blacklight::IndexPresenter 4 | ## 5 | # Override default Blacklight presenter method, to provide citation when 6 | # rendering the document's title on the index page. 7 | # @see https://github.com/projectblacklight/blacklight/blob/15eb3fcb5444cbf835fc21f26aac2139110eeef8/app/presenters/blacklight/document_presenter.rb#L38 8 | def heading 9 | CitationPresenter.new(@document).render 10 | end 11 | end 12 | -------------------------------------------------------------------------------- /app/views/tokens/index.html.erb: -------------------------------------------------------------------------------- 1 |
    2 |
    3 | 4 |
    5 | 9 |
    10 | -------------------------------------------------------------------------------- /app/views/versions/_close_ui.html.erb: -------------------------------------------------------------------------------- 1 | <%= form_with url: close_item_version_index_path(@cocina_object.externalIdentifier), 2 | method: :post, 3 | local: true do %> 4 |
    5 |
    6 | 7 |
    8 | 11 | <% end %> 12 | -------------------------------------------------------------------------------- /lib/test_shibboleth_headers.rb: -------------------------------------------------------------------------------- 1 | # frozen_string_literal: true 2 | 3 | # This is a Rack middleware that we use in testing. It injects headers 4 | # that simulate mod_shib so we can test. 5 | class TestShibbolethHeaders 6 | def initialize(app) 7 | @app = app 8 | end 9 | 10 | def call(env) 11 | request = Rack::Request.new(env) 12 | env['REMOTE_USER'] = request.cookies['test_remote_user'] 13 | env['eduPersonEntitlement'] = request.cookies['test_groups'] 14 | @app.call(env) 15 | end 16 | end 17 | -------------------------------------------------------------------------------- /app/helpers/apo_helper.rb: -------------------------------------------------------------------------------- 1 | # frozen_string_literal: true 2 | 3 | module ApoHelper 4 | def agreement_options 5 | q = "#{SolrDocument::FIELD_OBJECT_TYPE}:agreement" 6 | result = SearchService.query(q, rows: 99_999, fl: 'id,tag_ssim,display_title_ss')['response']['docs'] 7 | result.sort! do |a, b| 8 | a['display_title_ss'].to_s <=> b['display_title_ss'].to_s 9 | end 10 | result.collect do |doc| 11 | [Array(doc['display_title_ss']).first.to_s, doc['id'].to_s] 12 | end 13 | end 14 | end 15 | -------------------------------------------------------------------------------- /app/views/items/_edit_collection_rights.html.erb: -------------------------------------------------------------------------------- 1 | <%= turbo_frame_tag 'access-rights' do %> 2 | <%= form_with model: @change_set do |f| %> 3 |
    4 | <%= f.label :view_access %> 5 | <%= f.select :view_access, [%w[World world], %w[Dark dark]], {}, class: 'form-select' %> 6 |
    7 |
    8 | <%= link_to 'Cancel', show_rights_item_path(params[:id]) %> 9 | <%= f.submit 'Save', class: 'btn btn-primary' %> 10 |
    11 | <% end %> 12 | <% end %> 13 | -------------------------------------------------------------------------------- /app/views/items/edit_use_statement.html.erb: -------------------------------------------------------------------------------- 1 | <%= turbo_frame_tag 'use_statement' do %> 2 | <%= form_with model: @change_set do |f| %> 3 |
    4 | <%= f.label :use_statement, class: 'visually-hidden' %> 5 | <%= f.text_field :use_statement, class: 'form-control' %> 6 |
    7 |
    8 | <%= link_to 'Cancel', show_use_statement_item_path(params[:id]) %> 9 | <%= f.submit 'Save', class: 'btn btn-primary' %> 10 |
    11 | <% end %> 12 | <% end %> 13 | -------------------------------------------------------------------------------- /spec/support/signin_helper.rb: -------------------------------------------------------------------------------- 1 | # frozen_string_literal: true 2 | 3 | module SigninHelper 4 | def mock_user(attributes = {}) 5 | double(:webauth_user, { 6 | login: 'sunetid', 7 | logged_in?: true, 8 | privgroup: [], 9 | groups: [], 10 | admin?: false, 11 | webauth_admin?: attributes[:admin?], 12 | manager?: false, 13 | viewer?: false, 14 | roles: [], 15 | permitted_apos: [], 16 | permitted_collections: [] 17 | }.merge(attributes)) 18 | end 19 | end 20 | -------------------------------------------------------------------------------- /app/components/document_component.html.erb: -------------------------------------------------------------------------------- 1 | <%= content_tag :div, 2 | id: @id, 3 | data: { 4 | 'document-id': @document.id.to_s.parameterize, 5 | 'document-counter': @counter 6 | }, 7 | itemscope: true, 8 | itemtype: @document.itemtype, 9 | class: 'document document-component' do %> 10 | <%= with_title(component: DocumentTitleComponent) %> 11 | 12 | <%= render child_component %> 13 | <% end %> 14 | -------------------------------------------------------------------------------- /config/initializers/filter_parameter_logging.rb: -------------------------------------------------------------------------------- 1 | # Be sure to restart your server when you modify this file. 2 | 3 | # Configure parameters to be partially matched (e.g. passw matches password) and filtered from the log file. 4 | # Use this to limit dissemination of sensitive information. 5 | # See the ActiveSupport::ParameterFilter documentation for supported notations and behaviors. 6 | Rails.application.config.filter_parameters += [ 7 | :passw, :email, :secret, :token, :_key, :crypt, :salt, :certificate, :otp, :ssn, :cvv, :cvc 8 | ] 9 | -------------------------------------------------------------------------------- /app/controllers/bulk_actions/governing_apo_jobs_controller.rb: -------------------------------------------------------------------------------- 1 | # frozen_string_literal: true 2 | 3 | module BulkActions 4 | class GoverningApoJobsController < ApplicationController 5 | include CreatesBulkActions 6 | 7 | self.action_type = 'SetGoverningApoJob' 8 | 9 | def new 10 | @apo_list = AdminPolicyOptions.for(current_user) 11 | super 12 | end 13 | 14 | def job_params 15 | super.merge(new_apo_id: params[:new_apo_id], close_version: params[:close_version]) 16 | end 17 | end 18 | end 19 | -------------------------------------------------------------------------------- /spec/requests/create_new_admin_policy_spec.rb: -------------------------------------------------------------------------------- 1 | # frozen_string_literal: true 2 | 3 | require 'rails_helper' 4 | 5 | RSpec.describe 'Create a new Admin Policy' do 6 | let(:user) { create(:user) } 7 | 8 | before do 9 | sign_in user, groups: ['sdr:administrator-role'] 10 | end 11 | 12 | context 'when the parameters are invalid' do 13 | it 'redraws the form' do 14 | post '/apo', params: { apo: { title: '' } } 15 | expect(response).to have_http_status(:unprocessable_content) 16 | end 17 | end 18 | end 19 | -------------------------------------------------------------------------------- /spec/views/items/set_governing_apo_ui.html.erb_spec.rb: -------------------------------------------------------------------------------- 1 | # frozen_string_literal: true 2 | 3 | require 'rails_helper' 4 | 5 | RSpec.describe 'items/set_governing_apo_ui' do 6 | it 'renders the JS template' do 7 | stub_template 'items/_set_governing_apo_ui.html.erb' => 'stubbed_set_governing_apo_ui' 8 | render 9 | expect(rendered) 10 | .to have_css '.modal-header h3.modal-title', text: 'Set governing APO' 11 | expect(rendered).to have_css '.modal-body', text: 'stubbed_set_governing_apo_ui' 12 | end 13 | end 14 | -------------------------------------------------------------------------------- /spec/views/workflows/new.html.erb_spec.rb: -------------------------------------------------------------------------------- 1 | # frozen_string_literal: true 2 | 3 | require 'rails_helper' 4 | 5 | RSpec.describe 'workflows/new' do 6 | it 'renders the JS template' do 7 | stub_template 'workflows/_new.html.erb' => 'stubbed_add_workflow' 8 | controller.request.path_parameters[:id] = 'test' 9 | render 10 | expect(rendered) 11 | .to have_css '.modal-header h3.modal-title', text: 'Add workflow' 12 | expect(rendered).to have_css '.modal-body', text: 'stubbed_add_workflow' 13 | end 14 | end 15 | -------------------------------------------------------------------------------- /app/components/show/agreement/details_component.rb: -------------------------------------------------------------------------------- 1 | # frozen_string_literal: true 2 | 3 | module Show 4 | module Agreement 5 | class DetailsComponent < ApplicationComponent 6 | # @param [ArgoShowPresenter] presenter 7 | def initialize(presenter:) 8 | @presenter = presenter 9 | @solr_document = presenter.document 10 | end 11 | 12 | delegate :object_type, :created_date, :preservation_size, to: :@solr_document 13 | delegate :state_service, to: :@presenter 14 | end 15 | end 16 | end 17 | -------------------------------------------------------------------------------- /spec/components/open_close_component_spec.rb: -------------------------------------------------------------------------------- 1 | # frozen_string_literal: true 2 | 3 | require 'rails_helper' 4 | 5 | RSpec.describe OpenCloseComponent, type: :component do 6 | let(:component) do 7 | described_class.new(id: item_id) 8 | end 9 | 10 | let(:rendered) { render_inline(component) } 11 | let(:item_id) { 'druid:kv840xx0000' } 12 | 13 | it 'renders an eager loading turbo frame' do 14 | expect(rendered.css('turbo-frame').attribute('src').value).to eq '/workflow_service/druid:kv840xx0000/lock' 15 | end 16 | end 17 | -------------------------------------------------------------------------------- /spec/requests/display_workflow_grid_spec.rb: -------------------------------------------------------------------------------- 1 | # frozen_string_literal: true 2 | 3 | require 'rails_helper' 4 | 5 | RSpec.describe 'The workflow grid' do 6 | let(:user) { create(:user) } 7 | 8 | context 'as an admin' do 9 | before do 10 | sign_in user, groups: ['sdr:administrator-role'] 11 | end 12 | 13 | it 'displays properly' do 14 | get '/report/workflow_grid' 15 | expect(response).to have_http_status(:ok) 16 | expect(response.body).to include 'workflow-grid' 17 | end 18 | end 19 | end 20 | -------------------------------------------------------------------------------- /spec/views/embargos/edit.html.erb_spec.rb: -------------------------------------------------------------------------------- 1 | # frozen_string_literal: true 2 | 3 | require 'rails_helper' 4 | 5 | RSpec.describe 'embargos/edit' do 6 | it 'renders the template' do 7 | stub_template 'embargos/_form.html.erb' => 'stubbed_embargo_form' 8 | render 9 | expect(rendered).to have_css '.modal-header h3.modal-title', text: 'Update embargo' 10 | expect(rendered).to have_css '.modal-body', text: 'stubbed_embargo_form' 11 | expect(rendered).to have_css '.modal-footer button', text: 'Cancel' 12 | end 13 | end 14 | -------------------------------------------------------------------------------- /app/views/cocina_objects/show.html.erb: -------------------------------------------------------------------------------- 1 | 2 | <%= tag.div data: { 3 | controller: 'json-renderer', 4 | json_renderer_cocina_value: CocinaHashPresenter.new(cocina_object: @cocina_object, without_metadata: true).render.to_json 5 | } do %> 6 | Expand all | 7 | Collapse all 8 | 9 |
    10 | <% end %> 11 |
    12 | -------------------------------------------------------------------------------- /app/views/collections/new_modal.html.erb: -------------------------------------------------------------------------------- 1 | <%= render EditModalComponent.new do |component| %> 2 | <% component.with_header { 'Create Collection' } %> 3 | <% component.with_body do %> 4 |

    APO — <%= @cocina_admin_policy.label %>

    5 | <%= form_tag collections_path(@cocina_admin_policy.externalIdentifier) do %> 6 | <%= hidden_field_tag :apo_druid, @cocina_admin_policy.externalIdentifier %> 7 | <%= hidden_field_tag :modal, true %> 8 | <%= render 'form' %> 9 | <% end %> 10 | <% end %> 11 | <% end %> 12 | -------------------------------------------------------------------------------- /spec/views/items/_source_id_ui.html.erb_spec.rb: -------------------------------------------------------------------------------- 1 | # frozen_string_literal: true 2 | 3 | require 'rails_helper' 4 | 5 | RSpec.describe 'items/_source_id_ui' do 6 | before do 7 | @cocina = build(:dro, source_id: 'sul:99999') 8 | end 9 | 10 | it 'renders the partial content' do 11 | render 12 | expect(rendered) 13 | .to have_css 'form input.form-control[value="sul:99999"]' 14 | expect(rendered).to have_css 'p.form-text' 15 | expect(rendered).to have_css 'button.btn.btn-primary', text: 'Update' 16 | end 17 | end 18 | -------------------------------------------------------------------------------- /app/assets/stylesheets/variables.css: -------------------------------------------------------------------------------- 1 | :root { 2 | /* Stanford colors that are not defined in the component library */ 3 | --stanford-illuminating-light: #ffe781; 4 | --stanford-sky-light: #67afd2; 5 | --stanford-bay-light: #8ab8a7; 6 | --stanford-60-black: #767674; 7 | --stanford-stone-dark-rgb: 84, 73, 72; 8 | --stanford-poppy-light: #f9a44a; 9 | --stanford-palo-verde-light: #59b3a9; 10 | 11 | /* non-standard colors (not part of Stanford's palette) */ 12 | --argo-floral-white: #f9f6ef; 13 | --argo-tahuna-sands: #d2c295; 14 | } 15 | -------------------------------------------------------------------------------- /app/components/edit_modal_component.html.erb: -------------------------------------------------------------------------------- 1 | 2 | 6 | 7 | 10 | 11 | 15 | 16 | -------------------------------------------------------------------------------- /app/views/bulk_actions/rights_jobs/_new.html.erb: -------------------------------------------------------------------------------- 1 | <%= form_with url: rights_job_path, class: 'new_bulk_action', data: { turbo_frame: '_top' } do |f| %> 2 | <%= render 'bulk_actions/errors' %> 3 | 4 | 5 | Edit rights 6 | 7 | 8 |
    9 | <%= render Edit::Item::AccessRightsComponent.new(form_builder: f) %> 10 |
    11 | 12 | <%= render 'bulk_actions/druids', f: %> 13 | <%= render 'bulk_actions/common_fields', f:, close_option: true %> 14 | <% end %> 15 | -------------------------------------------------------------------------------- /db/migrate/20160114000925_create_bulk_actions.rb: -------------------------------------------------------------------------------- 1 | class CreateBulkActions < ActiveRecord::Migration[4.2] 2 | def change 3 | create_table :bulk_actions do |t| 4 | t.string :action_type 5 | t.string :status 6 | t.string :log_name 7 | t.string :description 8 | t.integer :druid_count_total, default: 0 9 | t.integer :druid_count_success, default: 0 10 | t.integer :druid_count_fail, default: 0 11 | 12 | t.timestamps null: false 13 | t.belongs_to :user, index: true 14 | end 15 | end 16 | end 17 | -------------------------------------------------------------------------------- /app/jobs/purge_job.rb: -------------------------------------------------------------------------------- 1 | # frozen_string_literal: true 2 | 3 | ## 4 | # job to purge unpublished objects 5 | class PurgeJob < BulkActionJob 6 | class PurgeJobItem < BulkActionJobItem 7 | def perform 8 | return unless check_update_ability? 9 | 10 | if WorkflowService.submitted?(druid:) 11 | return failure!(message: 'Cannot purge item because it has already been submitted') 12 | end 13 | 14 | PurgeService.purge(druid:, user_name: user) 15 | 16 | success!(message: 'Purge sucessful') 17 | end 18 | end 19 | end 20 | -------------------------------------------------------------------------------- /bin/spring: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env ruby 2 | if !defined?(Spring) && [nil, "development", "test"].include?(ENV["RAILS_ENV"]) 3 | gem "bundler" 4 | require "bundler" 5 | 6 | # Load Spring without loading other gems in the Gemfile, for speed. 7 | Bundler.locked_gems&.specs&.find { |spec| spec.name == "spring" }&.tap do |spring| 8 | Gem.use_paths Gem.dir, Bundler.bundle_path.to_s, *Gem.path 9 | gem "spring", spring.version 10 | require "spring/binstub" 11 | rescue Gem::LoadError 12 | # Ignore when Spring is not installed. 13 | end 14 | end 15 | -------------------------------------------------------------------------------- /db/migrate/20210406023300_add_foreign_key_constraint_to_active_storage_attachments_for_blob_id.active_storage.rb: -------------------------------------------------------------------------------- 1 | # This migration comes from active_storage (originally 20180723000244) 2 | class AddForeignKeyConstraintToActiveStorageAttachmentsForBlobId < ActiveRecord::Migration[6.0] 3 | def up 4 | return if foreign_key_exists?(:active_storage_attachments, column: :blob_id) 5 | 6 | return unless table_exists?(:active_storage_blobs) 7 | 8 | add_foreign_key :active_storage_attachments, :active_storage_blobs, column: :blob_id 9 | end 10 | end 11 | -------------------------------------------------------------------------------- /app/components/contents/preservation_link_component.rb: -------------------------------------------------------------------------------- 1 | # frozen_string_literal: true 2 | 3 | module Contents 4 | class PreservationLinkComponent < ApplicationComponent 5 | def initialize(druid:, cocina_file:, version:) 6 | @druid = druid 7 | @cocina_file = cocina_file 8 | @version = version 9 | end 10 | 11 | attr_reader :cocina_file, :version, :druid 12 | 13 | delegate :filename, to: :cocina_file 14 | 15 | def render? 16 | version.present? && cocina_file.administrative.sdrPreserve 17 | end 18 | end 19 | end 20 | -------------------------------------------------------------------------------- /spec/spec_helper.rb: -------------------------------------------------------------------------------- 1 | # frozen_string_literal: true 2 | 3 | require 'simplecov' 4 | SimpleCov.start :rails do 5 | add_filter '/spec/' 6 | add_filter '/vendor/' 7 | 8 | if ENV['CI'] 9 | require 'simplecov_json_formatter' 10 | 11 | formatter SimpleCov::Formatter::JSONFormatter 12 | end 13 | end 14 | 15 | RSpec.configure do |config| 16 | config.order = :random 17 | config.disable_monkey_patching! 18 | 19 | config.default_formatter = 'doc' if config.files_to_run.one? 20 | config.example_status_persistence_file_path = 'examples.txt' 21 | end 22 | -------------------------------------------------------------------------------- /app/components/workflow_grid_component.rb: -------------------------------------------------------------------------------- 1 | # frozen_string_literal: true 2 | 3 | class WorkflowGridComponent < ApplicationComponent 4 | # @param [Hash] data 5 | def initialize(data:) 6 | @data = data 7 | end 8 | 9 | def render? 10 | @data.present? 11 | end 12 | 13 | # @return [Array] returns a list of tuples with the name and the data 14 | def workflows 15 | @data.keys.sort 16 | .reject { |wf_name| Settings.inactive_workflows.include?(wf_name) } 17 | .map { |wf_name| [wf_name, @data[wf_name]] } 18 | end 19 | end 20 | -------------------------------------------------------------------------------- /app/presenters/home_text_presenter.rb: -------------------------------------------------------------------------------- 1 | # frozen_string_literal: true 2 | 3 | # Logic for presenting the home page text 4 | class HomeTextPresenter 5 | def initialize(current_user) 6 | @current_user = current_user 7 | end 8 | 9 | # @return [Boolean] true if this user has permissions to see anything in Argo 10 | def view_something? 11 | admin? || manager? || viewer? || permitted_apos.any? 12 | end 13 | 14 | private 15 | 16 | attr_reader :current_user 17 | 18 | delegate :admin?, :manager?, :viewer?, :permitted_apos, to: :current_user 19 | end 20 | -------------------------------------------------------------------------------- /config/initializers/folio_client.rb: -------------------------------------------------------------------------------- 1 | # frozen_string_literal: true 2 | 3 | # Configure folio_client singleton 4 | FolioClient.configure( 5 | url: Settings.catalog.folio.okapi.url, 6 | login_params: { 7 | username: Settings.catalog.folio.okapi.username, 8 | password: Settings.catalog.folio.okapi.password, 9 | legacy_auth: Settings.catalog.folio.okapi.legacy_auth 10 | }, 11 | okapi_headers: { 12 | 'X-Okapi-Tenant': Settings.catalog.folio.tenant_id, 13 | 'User-Agent': "folio_client #{FolioClient::VERSION}; argo #{Rails.env}" 14 | } 15 | ) 16 | -------------------------------------------------------------------------------- /config/initializers/permissions_policy.rb: -------------------------------------------------------------------------------- 1 | # Be sure to restart your server when you modify this file. 2 | 3 | # Define an application-wide HTTP permissions policy. For further 4 | # information see: https://developers.google.com/web/updates/2018/06/feature-policy 5 | 6 | # Rails.application.config.permissions_policy do |policy| 7 | # policy.camera :none 8 | # policy.gyroscope :none 9 | # policy.microphone :none 10 | # policy.usb :none 11 | # policy.fullscreen :self 12 | # policy.payment :self, "https://secure.example.com" 13 | # end 14 | -------------------------------------------------------------------------------- /spec/system/full_width_spec.rb: -------------------------------------------------------------------------------- 1 | # frozen_string_literal: true 2 | 3 | require 'rails_helper' 4 | 5 | RSpec.describe 'Full width' do 6 | before do 7 | sign_in create(:user) 8 | end 9 | 10 | it 'has bootstrap full width classes' do 11 | visit root_path 12 | expect(page).to have_css '#main-container.container-fluid' 13 | 14 | # but not in the top bar 15 | expect(page).to have_css 'nav.navbar .container' 16 | expect(page).to have_css '.masthead .container' 17 | expect(page).to have_css '.navbar-search .container' 18 | end 19 | end 20 | -------------------------------------------------------------------------------- /app/components/contents/structural_component.html.erb: -------------------------------------------------------------------------------- 1 |
    2 |
    <%= pluralize number_of_content_items, label %>
    3 | <%= helpers.paginate paginatable_array, theme: :blacklight, outer_window: 2 %> 4 |
    5 | 9 | -------------------------------------------------------------------------------- /app/components/show/collection/access_rights_component.rb: -------------------------------------------------------------------------------- 1 | # frozen_string_literal: true 2 | 3 | module Show 4 | module Collection 5 | class AccessRightsComponent < ApplicationComponent 6 | def initialize(change_set:, version_service:) 7 | @change_set = change_set 8 | @version_service = version_service 9 | end 10 | 11 | def access_rights 12 | view_access.capitalize 13 | end 14 | 15 | delegate :open?, to: :@version_service 16 | delegate :id, :view_access, to: :@change_set 17 | end 18 | end 19 | end 20 | -------------------------------------------------------------------------------- /spec/views/workflows/_new.html.erb_spec.rb: -------------------------------------------------------------------------------- 1 | # frozen_string_literal: true 2 | 3 | require 'rails_helper' 4 | 5 | RSpec.describe 'workflows/_new' do 6 | before do 7 | allow(view).to receive(:workflow_options).and_return([%w[assemblyWF assemblyWF], %w[registrationWF registrationWF]]) 8 | end 9 | 10 | it 'renders the partial content' do 11 | controller.request.path_parameters[:item_id] = 'test' 12 | render 13 | expect(rendered).to have_css 'form select' 14 | expect(rendered).to have_css 'form button.btn.btn-primary', text: 'Add' 15 | end 16 | end 17 | -------------------------------------------------------------------------------- /spec/presenters/workflow_xml_presenter_spec.rb: -------------------------------------------------------------------------------- 1 | # frozen_string_literal: true 2 | 3 | require 'rails_helper' 4 | 5 | RSpec.describe WorkflowXmlPresenter do 6 | subject(:presenter) do 7 | described_class.new(xml:) 8 | end 9 | 10 | describe '#pretty_xml' do 11 | subject { presenter.pretty_xml } 12 | 13 | let(:xml) do 14 | ' 15 | 16 | ' 17 | end 18 | 19 | it { is_expected.to be_html_safe } 20 | end 21 | end 22 | -------------------------------------------------------------------------------- /app/views/bulk_actions/close_version_jobs/_new.html.erb: -------------------------------------------------------------------------------- 1 | <%= form_with url: close_version_job_path, class: 'new_bulk_action', data: { turbo_frame: '_top' } do |f| %> 2 | <%= render 'bulk_actions/errors' %> 3 | 4 | 5 | Close a version of the items so the changes can be accessioned. The items will retain the version type (Major, Minor, or Admin) and version description as entered when the item was opened for versioning. 6 | 7 | 8 | <%= render 'bulk_actions/druids', f: %> 9 | <%= render 'bulk_actions/common_fields', f: %> 10 | <% end %> 11 | -------------------------------------------------------------------------------- /app/views/bulk_actions/add_workflow_jobs/_new.html.erb: -------------------------------------------------------------------------------- 1 | <%= form_with url: add_workflow_job_path, class: 'new_bulk_action', data: { turbo_frame: '_top' } do |f| %> 2 | <%= render 'bulk_actions/errors' %> 3 | 4 | 5 | Starts a workflow for individual objects. 6 | 7 | 8 |
    9 | <%= f.label :workflow %> 10 | <%= f.select :workflow, start_workflow_options, {}, class: 'form-select' %> 11 |
    12 | 13 | <%= render 'bulk_actions/druids', f: %> 14 | <%= render 'bulk_actions/common_fields', f: %> 15 | <% end %> 16 | -------------------------------------------------------------------------------- /config/initializers/secret_token.rb: -------------------------------------------------------------------------------- 1 | # frozen_string_literal: true 2 | 3 | # Be sure to restart your server when you modify this file. 4 | 5 | # Your secret key for verifying the integrity of signed cookies. 6 | # If you change this key, all old signed cookies will become invalid! 7 | # Make sure the secret is at least 30 characters and all random, 8 | # no regular words or you'll be exposed to dictionary attacks. 9 | Rails.application.config.secret_key_base = 'b82ec30e6fe76f9f9b6bdac84163f03de92ae714274324e5cd5f6e66253a70a68fe6921dbc3dab503b67ac9a1236c1882fb583dc6d06df515990252955b928ee' 10 | -------------------------------------------------------------------------------- /db/migrate/20110820000006_add_user_types_to_bookmarks_searches.rb: -------------------------------------------------------------------------------- 1 | class AddUserTypesToBookmarksSearches < ActiveRecord::Migration[4.2] 2 | def self.up 3 | add_column :searches, :user_type, :string 4 | add_column :bookmarks, :user_type, :string 5 | Search.reset_column_information 6 | Bookmark.reset_column_information 7 | Search.update_all("user_type = 'User'") 8 | Bookmark.update_all("user_type = 'User'") 9 | end 10 | 11 | def self.down 12 | remove_column :searches, :user_type, :string 13 | remove_column :bookmarks, :user_type, :string 14 | end 15 | end 16 | -------------------------------------------------------------------------------- /app/jobs/apply_apo_defaults_job.rb: -------------------------------------------------------------------------------- 1 | # frozen_string_literal: true 2 | 3 | ## 4 | # job to apply APO defaults to a set of items 5 | class ApplyApoDefaultsJob < BulkActionJob 6 | class ApplyApoDefaultsJobItem < BulkActionJobItem 7 | def perform 8 | return unless check_update_ability? 9 | 10 | open_new_version_if_needed!(description: 'Applied admin policy defaults') 11 | 12 | Dor::Services::Client.object(druid).apply_admin_policy_defaults 13 | 14 | close_version_if_needed! 15 | success!(message: 'Successfully applied defaults') 16 | end 17 | end 18 | end 19 | -------------------------------------------------------------------------------- /db/migrate/20180510050959_drop_wfs_rails_workflows.rb: -------------------------------------------------------------------------------- 1 | class DropWfsRailsWorkflows < ActiveRecord::Migration[5.1] 2 | def change 3 | # This migration was created by a gem that was only loaded in development and 4 | # test modes. So, dropping the table in production/staging would fail. 5 | # Additionally, the drop_table would fail for anyone who has newly created 6 | # their database and had never had the wfs_rails gem installed 7 | return unless ActiveRecord::Base.connection.table_exists? 'wfs_rails_workflows' 8 | 9 | drop_table :wfs_rails_workflows 10 | end 11 | end 12 | -------------------------------------------------------------------------------- /app/components/manage_release/form_component.html.erb: -------------------------------------------------------------------------------- 1 | <%= form_with(url: item_manage_release_path(@document.id), method: :patch) do |f| %> 2 |
    3 | 4 |
    5 |

    <%= @document.title_display %>

    6 |
    7 | <%= @document.released_to.to_sentence %> 8 |
    9 | <%= child_form(f) %> 10 |
    11 | 12 |
    13 | <% end %> 14 | -------------------------------------------------------------------------------- /app/search_builders/report_search_builder.rb: -------------------------------------------------------------------------------- 1 | # frozen_string_literal: true 2 | 3 | class ReportSearchBuilder < Blacklight::SearchBuilder 4 | include Blacklight::Solr::SearchBuilderBehavior 5 | include Argo::AccessControlsEnforcement 6 | include Argo::CustomSearch 7 | include Argo::DateFieldQueries 8 | 9 | self.default_processor_chain -= [:add_facetting_to_solr] # remove faceting from reports 10 | 11 | self.default_processor_chain += [ 12 | :add_access_controls_to_solr_params, # enforce restrictions 13 | :add_date_field_queries # ensure date field queries work 14 | ] 15 | end 16 | -------------------------------------------------------------------------------- /spec/views/versions/_open_ui.html.erb_spec.rb: -------------------------------------------------------------------------------- 1 | # frozen_string_literal: true 2 | 3 | require 'rails_helper' 4 | 5 | RSpec.describe 'versions/_open_ui' do 6 | before do 7 | @cocina_object = instance_double(Cocina::Models::DRO, externalIdentifier: 'druid:abc123') 8 | end 9 | 10 | it 'renders the partial content' do 11 | render 12 | expect(rendered) 13 | .to have_css 'label', text: 'Version description' 14 | expect(rendered).to have_css 'textarea#description.form-control' 15 | expect(rendered).to have_css 'button.btn.btn-primary', text: 'Open Version' 16 | end 17 | end 18 | -------------------------------------------------------------------------------- /app/assets/stylesheets/text-extraction.css: -------------------------------------------------------------------------------- 1 | .dropdown-content { 2 | background-color: #f1f1f1; 3 | overflow-y: auto; 4 | max-height: 180px; 5 | label { 6 | padding: 5px 10px; 7 | cursor: pointer; 8 | } 9 | 10 | label:hover { 11 | background-color: #ddd; 12 | } 13 | } 14 | 15 | .text-cardinal { 16 | color: var(--stanford-cardinal); 17 | } 18 | 19 | .text-extraction-search-bar { 20 | input, 21 | input:focus { 22 | border: none; 23 | outline: none; 24 | } 25 | 26 | button { 27 | flex: 0 0 auto; 28 | } 29 | 30 | input { 31 | flex: 1; 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /app/components/show/item/thumbnail_component.rb: -------------------------------------------------------------------------------- 1 | # frozen_string_literal: true 2 | 3 | module Show 4 | module Item 5 | class ThumbnailComponent < ApplicationComponent 6 | def initialize(document:) 7 | @document = document 8 | end 9 | 10 | attr_reader :document 11 | 12 | def show_thumbnail? 13 | document.content_type != 'file' && document.thumbnail_url 14 | end 15 | 16 | def placeholder_text 17 | truncate(CitationPresenter.new(document, italicize: false).render, length: 246, omission: '…') 18 | end 19 | end 20 | end 21 | end 22 | -------------------------------------------------------------------------------- /app/views/bulk_actions/import_structural_jobs/_new.html.erb: -------------------------------------------------------------------------------- 1 | <%= form_with url: import_structural_job_path, class: 'new_bulk_action', data: { turbo_frame: '_top' } do |f| %> 2 | <%= render 'bulk_actions/errors' %> 3 | 4 | 5 | Upload structural metadata as CSV (comma-separated values) 6 | 7 |
    8 | <%= f.label :csv_file, 'Upload a CSV file' %> 9 | <%= f.file_field :csv_file, class: 'form-control', accept: '.csv' %> 10 |
    11 | 12 | <%= render 'bulk_actions/common_fields', f:, close_option: true %> 13 | <% end %> 14 | -------------------------------------------------------------------------------- /app/views/catalog/_sort_widget.html.erb: -------------------------------------------------------------------------------- 1 | <%# Override from blacklight to change the button class to btn-outline-primary %> 2 | <% if show_sort_and_per_page? %> 3 | <%= render Blacklight::System::DropdownComponent.new( 4 | param: 'sort', 5 | choices: active_sort_fields.map { |key, config| [sort_field_label(config.key), key] }, 6 | id: 'sort-dropdown', 7 | search_state:, 8 | selected: current_sort_field&.key 9 | ) do |w| %> 10 | <%= w.with_button classes: 'btn btn-outline-primary dropdown-toggle', label: w.button_label %> 11 | <% end %> 12 | <% end %> 13 | -------------------------------------------------------------------------------- /app/views/items/_source_id_ui.html.erb: -------------------------------------------------------------------------------- 1 | <% if flash.now[:alert] %> 2 | 5 | <% end %> 6 | 7 | <%= form_tag source_id_item_path(@cocina.externalIdentifier) do %> 8 |
    9 | 10 |

    11 | entries should be of the form source:value 12 |

    13 |
    14 | 15 | <% end %> 16 | -------------------------------------------------------------------------------- /app/components/show/source_id_component.rb: -------------------------------------------------------------------------------- 1 | # frozen_string_literal: true 2 | 3 | module Show 4 | class SourceIdComponent < ApplicationComponent 5 | def initialize(document:, presenter:) 6 | @document = document 7 | @presenter = presenter 8 | end 9 | 10 | def edit? 11 | item? && !version_or_user_version_view? && open_and_not_assembling? 12 | end 13 | 14 | delegate :version_service, :version_or_user_version_view?, to: :@presenter 15 | delegate :open_and_not_assembling?, to: :version_service 16 | delegate :id, :source_id, :item?, to: :@document 17 | end 18 | end 19 | -------------------------------------------------------------------------------- /app/components/show/content_type_component.rb: -------------------------------------------------------------------------------- 1 | # frozen_string_literal: true 2 | 3 | module Show 4 | class ContentTypeComponent < ApplicationComponent 5 | def initialize(document:, presenter:) 6 | @document = document 7 | @presenter = presenter 8 | end 9 | 10 | def edit? 11 | !version_or_user_version_view? && open_and_not_assembling? 12 | end 13 | 14 | delegate :version_service, :version_or_user_version_view?, :change_set, to: :@presenter 15 | delegate :open_and_not_assembling?, to: :version_service 16 | delegate :id, :content_type, to: :@document 17 | end 18 | end 19 | -------------------------------------------------------------------------------- /app/views/bulk_actions/governing_apo_jobs/_new.html.erb: -------------------------------------------------------------------------------- 1 | <%= form_with url: governing_apo_job_path, class: 'new_bulk_action', data: { turbo_frame: '_top' } do |f| %> 2 | <%= render 'bulk_actions/errors' %> 3 | 4 | 5 | Moves the object to a new governing APO. 6 | 7 | 8 |
    9 | <%= f.label :new_apo_id, 'New governing APO' %> 10 | <%= f.select(:new_apo_id, @apo_list, {}, class: 'form-select') %> 11 |
    12 | 13 | <%= render 'bulk_actions/druids', f: %> 14 | <%= render 'bulk_actions/common_fields', f:, close_option: true %> 15 | <% end %> 16 | -------------------------------------------------------------------------------- /config/initializers/wrap_parameters.rb: -------------------------------------------------------------------------------- 1 | # frozen_string_literal: true 2 | 3 | # Be sure to restart your server when you modify this file. 4 | 5 | # This file contains settings for ActionController::ParamsWrapper which 6 | # is enabled by default. 7 | 8 | # Enable parameter wrapping for JSON. You can disable this by setting :format to an empty array. 9 | ActiveSupport.on_load(:action_controller) do 10 | wrap_parameters format: [:json] 11 | end 12 | 13 | # To enable root element in JSON for ActiveRecord objects. 14 | # ActiveSupport.on_load(:active_record) do 15 | # self.include_root_in_json = true 16 | # end 17 | -------------------------------------------------------------------------------- /spec/fixtures/bulk_upload/workspace/druid:bc682xk5613/2016_04_21_17_22_16_520/log.txt: -------------------------------------------------------------------------------- 1 | argo.bulk_metadata.bulk_log_job_start 2016-04-21 10:22am 2 | argo.bulk_metadata.bulk_log_user tommyi 3 | argo.bulk_metadata.bulk_log_input_file SriLanka_BulkUpload.xlsx 4 | argo.bulk_metadata.bulk_log_note convertonly 5 | argo.bulk_metadata.bulk_log_internal_error Net::ReadTimeout 6 | argo.bulk_metadata.bulk_log_empty_response ERROR: No response from https://modsulator-app-stage.stanford.edu/v1/modsulator 7 | argo.bulk_metadata.bulk_log_error_exception Got no response from server 8 | argo.bulk_metadata.bulk_log_job_complete 2016-04-21 10:23am 9 | -------------------------------------------------------------------------------- /app/views/bulk_actions/open_version_jobs/_new.html.erb: -------------------------------------------------------------------------------- 1 | <%= form_with url: open_version_job_path, class: 'new_bulk_action', data: { turbo_frame: '_top' } do |f| %> 2 | <%= render 'bulk_actions/errors' %> 3 | 4 | 5 | Open items not yet open for versioning. 6 | 7 | 8 |
    9 | <%= f.label :version_description, 'Describe this version' %> 10 | <%= f.text_area :version_description, class: 'form-control', required: true %> 11 |
    12 | 13 | <%= render 'bulk_actions/druids', f: %> 14 | <%= render 'bulk_actions/common_fields', f: %> 15 | <% end %> 16 | -------------------------------------------------------------------------------- /spec/components/contents/constituent_component_spec.rb: -------------------------------------------------------------------------------- 1 | # frozen_string_literal: true 2 | 3 | require 'rails_helper' 4 | 5 | RSpec.describe Contents::ConstituentComponent, type: :component do 6 | let(:component) { described_class.new(druid: id) } 7 | let(:rendered) { render_inline(component) } 8 | let(:id) { 'druid:bf746ns6287' } 9 | 10 | it 'renders the component' do 11 | expect(rendered.css('li').to_html) 12 | .to include 'druid:bf746ns6287' 13 | 14 | expect(rendered.css('li a').to_html) 15 | .to eq 'druid:bf746ns6287' 16 | end 17 | end 18 | -------------------------------------------------------------------------------- /spec/fixtures/bulk_upload/workspace/druid:bc682xk5613/2016_04_21_17_08_53_345/log.txt: -------------------------------------------------------------------------------- 1 | argo.bulk_metadata.bulk_log_job_start 2016-04-21 10:09am 2 | argo.bulk_metadata.bulk_log_user tommyi 3 | argo.bulk_metadata.bulk_log_input_file SriLanka_BulkUpload.xlsx 4 | argo.bulk_metadata.bulk_log_note convertonly 5 | argo.bulk_metadata.bulk_log_internal_error Net::ReadTimeout 6 | argo.bulk_metadata.bulk_log_empty_response ERROR: No response from https://modsulator-app-stage.stanford.edu/v1/modsulator 7 | argo.bulk_metadata.bulk_log_error_exception Got no response from server 8 | argo.bulk_metadata.bulk_log_job_complete 2016-04-21 10:10am 9 | -------------------------------------------------------------------------------- /app/components/document_component.rb: -------------------------------------------------------------------------------- 1 | # frozen_string_literal: true 2 | 3 | class DocumentComponent < Blacklight::DocumentComponent 4 | def initialize(document: nil, **kwargs) 5 | super 6 | end 7 | 8 | def child_component 9 | component_class.new(presenter: @presenter) 10 | end 11 | 12 | def component_class 13 | case @document.object_type 14 | when 'collection' 15 | Show::CollectionComponent 16 | when 'agreement' 17 | Show::AgreementComponent 18 | when 'adminPolicy' 19 | Show::AdminPolicyComponent 20 | else 21 | Show::ItemComponent 22 | end 23 | end 24 | end 25 | -------------------------------------------------------------------------------- /app/components/show/apo/details_component.rb: -------------------------------------------------------------------------------- 1 | # frozen_string_literal: true 2 | 3 | module Show 4 | module Apo 5 | class DetailsComponent < ApplicationComponent 6 | # @param [ArgoShowPresenter] presenter 7 | def initialize(presenter:) 8 | @presenter = presenter 9 | @solr_document = presenter.document 10 | end 11 | 12 | delegate :created_date, :id, to: :@solr_document 13 | 14 | def admin_policy 15 | @presenter.cocina 16 | end 17 | 18 | def agreement_id 19 | admin_policy.administrative.hasAgreement 20 | end 21 | end 22 | end 23 | end 24 | -------------------------------------------------------------------------------- /app/jobs/bulk_action_csv_job_item.rb: -------------------------------------------------------------------------------- 1 | # frozen_string_literal: true 2 | 3 | # Super class for performing an action on a single row in a BulkActionCsvJob. 4 | # Subclasses must implement the perform method. 5 | class BulkActionCsvJobItem < BulkActionJobItem 6 | def initialize(row:, **args) 7 | @row = row 8 | Honeybadger.context(row:) 9 | super(**args) 10 | end 11 | 12 | attr_reader :row 13 | 14 | def success!(message:) 15 | job.success!(druid: druid, message: message, index:) 16 | end 17 | 18 | def failure!(message:) 19 | job.failure!(druid: druid, message: message, index:) 20 | end 21 | end 22 | -------------------------------------------------------------------------------- /app/presenters/date_presenter.rb: -------------------------------------------------------------------------------- 1 | # frozen_string_literal: true 2 | 3 | class DatePresenter 4 | def self.render(datetime) 5 | return '' if datetime.nil? || datetime == '' 6 | 7 | # this needs to use the timezone set in config.time_zone 8 | begin 9 | zone = ActiveSupport::TimeZone.new('Pacific Time (US & Canada)') 10 | d = datetime.is_a?(Time) ? datetime : DateTime.parse(datetime).in_time_zone(zone) 11 | I18n.l(d) 12 | rescue StandardError 13 | d = datetime.is_a?(Time) ? datetime : Time.zone.parse(datetime.to_s) 14 | d.strftime('%Y-%m-%d %I:%M%p') 15 | end 16 | end 17 | end 18 | -------------------------------------------------------------------------------- /spec/fixtures/files/invalid_bulk_upload_structural.csv: -------------------------------------------------------------------------------- 1 | xdruid,resource_label,resource_type,sequence,filename,file_label,publish,shelve,preserve,rights_view,rights_download,rights_location,mimetype,role 2 | zp968gy7494,LOL1,image,1,jt667tw2770_00_0001.tif,jt667tw2770_00_0001.tif,no,no,yes,dark,none,,image/tiff, 3 | zp968gy7494,LOL2,image,1,jt667tw2770_05_0001.jp2,jt667tw2770_05_0001.jp2,no,no,yes,dark,none,,image/jp2, 4 | bc234fg7890,LOL3,image,1,jt667tw2770_00_0001.tif,jt667tw2770_00_0001.tif,no,no,yes,dark,none,,image/tiff, 5 | bc234fg7890,LOL4,image,1,jt667tw2770_05_0001.jp2,jt667tw2770_05_0001.jp2,no,no,yes,dark,none,,image/jp2, 6 | -------------------------------------------------------------------------------- /app/components/manage_release/form_component.rb: -------------------------------------------------------------------------------- 1 | # frozen_string_literal: true 2 | 3 | module ManageRelease 4 | class FormComponent < ApplicationComponent 5 | delegate :current_user, to: :controller 6 | 7 | def initialize(bulk_action:, document:) 8 | @bulk_action = bulk_action 9 | @document = document 10 | end 11 | 12 | def child_form(form) 13 | case @document.object_type 14 | when 'collection' 15 | render CollectionFormComponent.new(form:, current_user:) 16 | else 17 | render ItemFormComponent.new(form:, current_user:) 18 | end 19 | end 20 | end 21 | end 22 | -------------------------------------------------------------------------------- /app/forms/has_view_access_with_cdl.rb: -------------------------------------------------------------------------------- 1 | # frozen_string_literal: true 2 | 3 | require 'reform/form/coercion' 4 | 5 | module HasViewAccessWithCdl 6 | extend ActiveSupport::Concern 7 | 8 | included do 9 | include HasViewAccess 10 | 11 | feature Reform::Form::Coercion # Casts properties to a specific type 12 | property :controlled_digital_lending, virtual: true, type: Dry::Types['params.nil'] | Dry::Types['params.bool'] 13 | end 14 | 15 | def setup_view_access_with_cdl_properties(access_model) 16 | setup_view_access_properties(access_model) 17 | self.controlled_digital_lending = false 18 | end 19 | end 20 | -------------------------------------------------------------------------------- /spec/components/blacklight_modal_component_spec.rb: -------------------------------------------------------------------------------- 1 | # frozen_string_literal: true 2 | 3 | require 'rails_helper' 4 | 5 | RSpec.describe BlacklightModalComponent, type: :component do 6 | it 'renders the bootstrap modal' do 7 | render_inline(described_class.new) do |component| 8 | component.with_header { 'header' } 9 | component.with_body { 'body' } 10 | component.with_footer { 'footer' } 11 | end 12 | expect(page).to have_css('.btn-close') 13 | expect(page).to have_content('header') 14 | expect(page).to have_content('body') 15 | expect(page).to have_content('footer') 16 | end 17 | end 18 | -------------------------------------------------------------------------------- /app/controllers/events_controller.rb: -------------------------------------------------------------------------------- 1 | # frozen_string_literal: true 2 | 3 | class EventsController < ApplicationController 4 | def show 5 | object_client = Dor::Services::Client.object(decrypted_token.fetch(:druid)) 6 | @events = object_client.events.list 7 | @event_presenters = @events.map { |event| EventHashPresenter.new(event:) } 8 | end 9 | 10 | private 11 | 12 | # decode the token that grants view access 13 | # @raise [ActiveSupport::MessageVerifier::InvalidSignature] if the token is invalid 14 | def decrypted_token 15 | Argo.verifier.verify(params[:item_id], purpose: :view_token) 16 | end 17 | end 18 | -------------------------------------------------------------------------------- /app/views/embargos/_form.html.erb: -------------------------------------------------------------------------------- 1 |
    2 | <%= form_with model: @change_set, url: item_embargo_path(@change_set), class: 'col-md-4' do |f| %> 3 |
    4 | <%= f.label :release_date %> 5 | <%= f.text_field :release_date, type: 'date', class: 'form-control' %> 6 |
    7 | 8 |
    9 |

    Once embargo ends, these rights are applied:

    10 | <%= render Edit::Item::AccessRightsComponent.new(form_builder: f) %> 11 |
    12 | 13 | <%= f.submit 'Save', class: 'btn btn-primary' %> 14 | <% end %> 15 |
    16 | -------------------------------------------------------------------------------- /spec/services/purge_service_spec.rb: -------------------------------------------------------------------------------- 1 | # frozen_string_literal: true 2 | 3 | require 'rails_helper' 4 | 5 | RSpec.describe PurgeService do 6 | describe '.purge' do 7 | subject(:purge) { described_class.purge(druid: 'druid:ab123cd4567', user_name: 'dijkstra') } 8 | 9 | let(:object_client) { instance_double(Dor::Services::Client::Object, destroy: true) } 10 | 11 | before do 12 | allow(Dor::Services::Client).to receive(:object).and_return(object_client) 13 | end 14 | 15 | it 'removes the object' do 16 | purge 17 | expect(object_client).to have_received(:destroy) 18 | end 19 | end 20 | end 21 | -------------------------------------------------------------------------------- /spec/views/versions/_close_ui.html.erb_spec.rb: -------------------------------------------------------------------------------- 1 | # frozen_string_literal: true 2 | 3 | require 'rails_helper' 4 | 5 | RSpec.describe 'versions/_close_ui' do 6 | before do 7 | @cocina_object = instance_double(Cocina::Models::DRO, externalIdentifier: 'druid:abc123') 8 | end 9 | 10 | it 'renders the partial content' do 11 | render 12 | expect(rendered).to have_css 'form' 13 | expect(rendered) 14 | .to have_css 'label', text: 'Version description' 15 | expect(rendered).to have_css 'textarea.form-control' 16 | expect(rendered).to have_css 'button.btn.btn-primary', text: 'Close Version' 17 | end 18 | end 19 | -------------------------------------------------------------------------------- /app/assets/stylesheets/bootstrap-overrides.css: -------------------------------------------------------------------------------- 1 | /* Set color of selected facet */ 2 | .card-header { 3 | background-color: var(--argo-floral-white); 4 | } 5 | 6 | /* Override text color of selected facets 7 | https://github.com/projectblacklight/blacklight/blob/abf6f24bb8e53354dc91db8520f029bee68c4a4c/app/assets/stylesheets/blacklight/_facets.scss#L146 */ 8 | .facet-values li .selected { 9 | --bs-success-rgb: var(--bs-body-color); 10 | } 11 | 12 | /* Set border color of facets */ 13 | .facet-limit { 14 | border-color: var(--argo-tahuna-sands); 15 | } 16 | 17 | :root { 18 | --bs-table-border-color: var(--stanford-30-black); 19 | } 20 | -------------------------------------------------------------------------------- /app/components/show/barcode_component.rb: -------------------------------------------------------------------------------- 1 | # frozen_string_literal: true 2 | 3 | module Show 4 | class BarcodeComponent < ApplicationComponent 5 | def initialize(presenter:) 6 | @presenter = presenter 7 | end 8 | 9 | def barcode 10 | change_set.barcode || 'Not recorded' 11 | end 12 | 13 | def edit? 14 | !version_or_user_version_view? && open_and_not_assembling? 15 | end 16 | 17 | delegate :version_service, :version_or_user_version_view?, :change_set, to: :@presenter 18 | delegate :open_and_not_assembling?, to: :version_service 19 | delegate :id, to: :change_set 20 | end 21 | end 22 | -------------------------------------------------------------------------------- /config/initializers/backtrace_silencers.rb: -------------------------------------------------------------------------------- 1 | # frozen_string_literal: true 2 | 3 | # Be sure to restart your server when you modify this file. 4 | 5 | # You can add backtrace silencers for libraries that you're using but don't wish to see in your backtraces. 6 | # Rails.backtrace_cleaner.add_silencer { |line| /my_noisy_library/.match?(line) } 7 | 8 | # You can also remove all the silencers if you're trying to debug a problem that might stem from framework code 9 | # by setting BACKTRACE=1 before calling your invocation, like "BACKTRACE=1 ./bin/rails runner 'MyClass.perform'" 10 | Rails.backtrace_cleaner.remove_silencers! if ENV['BACKTRACE'] 11 | -------------------------------------------------------------------------------- /spec/fixtures/bulk_upload/workspace/druid:bc682xk5613/2016_04_21_17_34_02_445/log.txt: -------------------------------------------------------------------------------- 1 | argo.bulk_metadata.bulk_log_job_start 2016-04-21 10:34am 2 | argo.bulk_metadata.bulk_log_user tommyi 3 | argo.bulk_metadata.bulk_log_input_file crowdsourcing_bridget_1.xlsx 4 | argo.bulk_metadata.bulk_log_note convertonly 5 | argo.bulk_metadata.bulk_log_internal_error the server responded with status 500 6 | argo.bulk_metadata.bulk_log_empty_response ERROR: No response from https://modsulator-app-stage.stanford.edu/v1/modsulator 7 | argo.bulk_metadata.bulk_log_error_exception Got no response from server 8 | argo.bulk_metadata.bulk_log_job_complete 2016-04-21 10:34am 9 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | © 2011 The Board of Trustees of the Leland Stanford Junior University. 2 | 3 | Licensed under the Apache License, Version 2.0 (the "License"); 4 | you may not use this file except in compliance with the License. 5 | You may obtain a copy of the License at 6 | 7 | http://www.apache.org/licenses/LICENSE-2.0 8 | 9 | Unless required by applicable law or agreed to in writing, software 10 | distributed under the License is distributed on an "AS IS" BASIS, 11 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | See the License for the specific language governing permissions and 13 | limitations under the License. 14 | -------------------------------------------------------------------------------- /app/components/show/copyright_component.rb: -------------------------------------------------------------------------------- 1 | # frozen_string_literal: true 2 | 3 | module Show 4 | class CopyrightComponent < ApplicationComponent 5 | def initialize(presenter:) 6 | @presenter = presenter 7 | end 8 | 9 | def copyright 10 | change_set.copyright || 'Not entered' 11 | end 12 | 13 | def edit? 14 | !version_or_user_version_view? && open_and_not_assembling? 15 | end 16 | 17 | delegate :version_service, :version_or_user_version_view?, :change_set, to: :@presenter 18 | delegate :open_and_not_assembling?, to: :version_service 19 | delegate :id, to: :change_set 20 | end 21 | end 22 | -------------------------------------------------------------------------------- /app/components/show/ticket_tag_component.rb: -------------------------------------------------------------------------------- 1 | # frozen_string_literal: true 2 | 3 | module Show 4 | class TicketTagComponent < ApplicationComponent 5 | def initialize(document:) 6 | @document = document 7 | end 8 | 9 | def call 10 | field_config = fields.fetch(SolrDocument::FIELD_TICKET_TAG) 11 | Blacklight::FieldPresenter.new(self, @document, field_config).render 12 | end 13 | 14 | private 15 | 16 | delegate :blacklight_config, :search_state, :search_action_path, to: :helpers 17 | 18 | def fields 19 | @fields ||= blacklight_config.show_fields_for([:show]) 20 | end 21 | end 22 | end 23 | -------------------------------------------------------------------------------- /app/services/deep_compact_blank.rb: -------------------------------------------------------------------------------- 1 | # frozen_string_literal: true 2 | 3 | # Recursively compact enumerables of blank values 4 | class DeepCompactBlank 5 | def self.run(enumerable:) 6 | new(enumerable:).run 7 | end 8 | 9 | def initialize(enumerable:) 10 | @enumerable = enumerable 11 | end 12 | 13 | def run 14 | return enumerable unless enumerable.respond_to?(:compact_blank) 15 | 16 | enumerable 17 | .compact_blank 18 | .public_send(enumerable.is_a?(Hash) ? :transform_values : :map) { |value| self.class.run(enumerable: value) } 19 | end 20 | 21 | private 22 | 23 | attr_reader :enumerable 24 | end 25 | -------------------------------------------------------------------------------- /spec/services/description_export_spec.rb: -------------------------------------------------------------------------------- 1 | # frozen_string_literal: true 2 | 3 | require 'rails_helper' 4 | 5 | RSpec.describe DescriptionExport do 6 | subject(:run) { described_class.export(source_id:, description:) } 7 | 8 | let(:source_id) { 'sul:123' } 9 | let(:description) do 10 | Cocina::Models::Description.new( 11 | { title: [{ value: 'Stored title' }], purl: 'https://purl.stanford.edu/zt570qh4444' } 12 | ) 13 | end 14 | 15 | it 'rectangularizes the item' do 16 | expect(run).to eq('source_id' => 'sul:123', 'title1.value' => 'Stored title', 'purl' => 'https://purl.stanford.edu/zt570qh4444') 17 | end 18 | end 19 | -------------------------------------------------------------------------------- /spec/support/create_strategy_repository_pattern.rb: -------------------------------------------------------------------------------- 1 | # frozen_string_literal: true 2 | 3 | class CreateStategyForRepositoryPattern 4 | def association(runner) 5 | runner.run 6 | end 7 | 8 | def result(evaluation) 9 | result = nil 10 | evaluation.object.tap do |instance| 11 | evaluation.notify(:after_build, instance) 12 | evaluation.notify(:before_create, instance) 13 | result = evaluation.create(instance) 14 | evaluation.notify(:after_create, instance) 15 | end 16 | 17 | result 18 | end 19 | end 20 | 21 | FactoryBot.register_strategy(:create_for_repository, CreateStategyForRepositoryPattern) 22 | -------------------------------------------------------------------------------- /spec/support/feature_sessions.rb: -------------------------------------------------------------------------------- 1 | # frozen_string_literal: true 2 | 3 | module Features 4 | module SessionHelpers 5 | def sign_in(user = nil, groups: [], example: RSpec.current_example) 6 | if example.metadata[:type] == :system 7 | visit auth_test_login_path(remote_user: user.login, groups: groups.join(';')) 8 | else 9 | get auth_test_login_path(remote_user: user.login, groups: groups.join(';')) 10 | end 11 | end 12 | end 13 | end 14 | 15 | RSpec.configure do |config| 16 | config.include Features::SessionHelpers, type: :system 17 | config.include Features::SessionHelpers, type: :request 18 | end 19 | -------------------------------------------------------------------------------- /spec/helpers/bulk_action_helper_spec.rb: -------------------------------------------------------------------------------- 1 | # frozen_string_literal: true 2 | 3 | require 'rails_helper' 4 | 5 | RSpec.describe BulkActionHelper do 6 | describe '#render_bulk_action_type' do 7 | context 'with partial defined' do 8 | it 'renders the bulk actions partial' do 9 | bulk_action = create(:bulk_action, action_type: 'DescmetadataDownloadJob') 10 | expect(helper).to receive(:render) 11 | .with( 12 | partial: 'descmetadata_download_job', 13 | locals: { bulk_action: } 14 | ) 15 | helper.render_bulk_action_type(bulk_action) 16 | end 17 | end 18 | end 19 | end 20 | -------------------------------------------------------------------------------- /app/search_builders/argo/custom_search.rb: -------------------------------------------------------------------------------- 1 | # frozen_string_literal: true 2 | 3 | module Argo 4 | module CustomSearch 5 | ## 6 | # Returns an unlimited (> 10,000,000) return of DRUIDs only from Solr if 7 | # `:druids_only` = true is provided in user_params 8 | # This is used by the "Populate with previous search" feature of bulk actions 9 | def druids_only(solr_parameters) 10 | return unless blacklight_params[:druids_only] 11 | 12 | solr_parameters[:fl] ||= [] 13 | solr_parameters[:fl] << 'id' 14 | solr_parameters[:rows] = 99_999_999 15 | solr_parameters[:facet] = false 16 | end 17 | end 18 | end 19 | -------------------------------------------------------------------------------- /app/services/descriptions_grouper.rb: -------------------------------------------------------------------------------- 1 | # frozen_string_literal: true 2 | 3 | # Groups descriptions based on like data (e.g., form type values, note label 4 | # values) for easier comprehension by users 5 | class DescriptionsGrouper 6 | def self.group(descriptions:) 7 | new(descriptions:).group 8 | end 9 | 10 | def initialize(descriptions:) 11 | @descriptions = descriptions 12 | end 13 | 14 | def group 15 | descriptions.then { |descs| FormsGrouper.group(descriptions: descs) } 16 | .then { |descs| NotesGrouper.group(descriptions: descs) } 17 | end 18 | 19 | private 20 | 21 | attr_reader :descriptions 22 | end 23 | -------------------------------------------------------------------------------- /app/views/bulk_actions/_druids.html.erb: -------------------------------------------------------------------------------- 1 |
    2 | <% if search_state.has_constraints? %> 3 | <%= render Blacklight::HiddenSearchStateComponent.new(params: Blacklight::Parameters.sanitize(search_state.to_h)) %> 4 | 7 | <% end %> 8 |
    9 | 10 | 11 |
    12 |
    13 | -------------------------------------------------------------------------------- /app/components/show/use_statement_component.rb: -------------------------------------------------------------------------------- 1 | # frozen_string_literal: true 2 | 3 | module Show 4 | class UseStatementComponent < ApplicationComponent 5 | def initialize(presenter:) 6 | @presenter = presenter 7 | end 8 | 9 | def use_statement 10 | change_set.use_statement || 'Not entered' 11 | end 12 | 13 | def edit? 14 | !version_or_user_version_view? && open_and_not_assembling? 15 | end 16 | 17 | delegate :version_service, :version_or_user_version_view?, :change_set, to: :@presenter 18 | delegate :open_and_not_assembling?, to: :version_service 19 | delegate :id, to: :change_set 20 | end 21 | end 22 | -------------------------------------------------------------------------------- /app/controllers/bulk_actions/import_structural_jobs_controller.rb: -------------------------------------------------------------------------------- 1 | # frozen_string_literal: true 2 | 3 | module BulkActions 4 | class ImportStructuralJobsController < ApplicationController 5 | include CreatesBulkActions 6 | 7 | self.action_type = 'ImportStructuralJob' 8 | 9 | def job_params 10 | { 11 | groups: current_user.groups, 12 | csv_file: CsvUploadNormalizer.read(params[:csv_file].path), 13 | close_version: params[:close_version] 14 | } 15 | end 16 | 17 | def validate_job_params(job_params) 18 | validate_csv_headers(job_params.fetch(:csv_file), ['druid']) 19 | end 20 | end 21 | end 22 | -------------------------------------------------------------------------------- /app/controllers/bulk_actions/source_id_csv_jobs_controller.rb: -------------------------------------------------------------------------------- 1 | # frozen_string_literal: true 2 | 3 | module BulkActions 4 | class SourceIdCsvJobsController < ApplicationController 5 | include CreatesBulkActions 6 | 7 | self.action_type = 'SetSourceIdsCsvJob' 8 | 9 | def job_params 10 | { 11 | groups: current_user.groups, 12 | csv_file: CsvUploadNormalizer.read(params[:csv_file].path), 13 | close_version: params[:close_version] 14 | } 15 | end 16 | 17 | def validate_job_params(job_params) 18 | validate_csv_headers(job_params.fetch(:csv_file), %w[druid source_id]) 19 | end 20 | end 21 | end 22 | -------------------------------------------------------------------------------- /app/controllers/bulk_actions/manage_embargo_jobs_controller.rb: -------------------------------------------------------------------------------- 1 | # frozen_string_literal: true 2 | 3 | module BulkActions 4 | class ManageEmbargoJobsController < ApplicationController 5 | include CreatesBulkActions 6 | 7 | self.action_type = 'ManageEmbargoesJob' 8 | 9 | def job_params 10 | { 11 | groups: current_user.groups, 12 | csv_file: CsvUploadNormalizer.read(params[:csv_file].path), 13 | close_version: params[:close_version] 14 | } 15 | end 16 | 17 | def validate_job_params(job_params) 18 | validate_csv_headers(job_params.fetch(:csv_file), %w[druid release_date]) 19 | end 20 | end 21 | end 22 | -------------------------------------------------------------------------------- /app/views/catalog/_show_releases.html.erb: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | <% release_tags.each do |release_tag| %> 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | <% end %> 21 | 22 |
    ReleaseWhatToWhoWhen
    <%= release_tag.release %><%= release_tag.what %><%= release_tag.to %><%= release_tag.who %><%= release_tag.date %>
    23 | -------------------------------------------------------------------------------- /spec/requests/bulk_actions/manage_embargo_job_spec.rb: -------------------------------------------------------------------------------- 1 | # frozen_string_literal: true 2 | 3 | require 'rails_helper' 4 | 5 | RSpec.describe 'BulkActions::ManageEmbargoJobs' do 6 | let(:rendered) do 7 | Capybara::Node::Simple.new(response.body) 8 | end 9 | 10 | describe 'GET #new' do 11 | before do 12 | sign_in build(:user), groups: ['sdr:administrator-role'] 13 | end 14 | 15 | it 'draws the form' do 16 | get '/bulk_actions/manage_embargo_job/new' 17 | 18 | expect(rendered).to have_css 'textarea[name="description"]' 19 | expect(rendered).to have_css 'input[type="file"][name="csv_file"]' 20 | end 21 | end 22 | end 23 | -------------------------------------------------------------------------------- /spec/views/uploads/new.html.erb_spec.rb: -------------------------------------------------------------------------------- 1 | # frozen_string_literal: true 2 | 3 | require 'rails_helper' 4 | 5 | RSpec.describe 'uploads/new' do 6 | before do 7 | params[:apo_id] = 'druid:hv992yv2222' 8 | render 9 | end 10 | 11 | it 'has the correct title' do 12 | expect(rendered).to have_css('strong', text: 'Submit MODS descriptive metadata for bulk processing') 13 | end 14 | 15 | it 'has Browse, Submit and Cancel buttons' do 16 | expect(rendered).to have_css('input#spreadsheet_file') 17 | expect(rendered).to have_css('button#spreadsheet_submit') 18 | expect(rendered).to have_css('button#spreadsheet_cancel') 19 | end 20 | end 21 | -------------------------------------------------------------------------------- /app/controllers/bulk_actions/content_type_jobs_controller.rb: -------------------------------------------------------------------------------- 1 | # frozen_string_literal: true 2 | 3 | module BulkActions 4 | class ContentTypeJobsController < ApplicationController 5 | include CreatesBulkActions 6 | 7 | self.action_type = 'SetContentTypeJob' 8 | 9 | def job_params 10 | super.merge(current_resource_type: params[:current_resource_type], 11 | new_content_type: params[:new_content_type], 12 | new_resource_type: params[:new_resource_type], 13 | viewing_direction: params[:viewing_direction], 14 | close_version: params[:close_version]) 15 | end 16 | end 17 | end 18 | --------------------------------------------------------------------------------