-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added logger DEBUG level to dev env. Created initial work type.
- Loading branch information
Showing
21 changed files
with
246 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
# Generated via | ||
# `rails generate hyrax:work Work` | ||
module Hyrax | ||
module Actors | ||
class WorkActor < Hyrax::Actors::BaseActor | ||
end | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
# Generated via | ||
# `rails generate hyrax:work Work` | ||
module Hyrax | ||
# Generated controller for Work | ||
class WorksController < ApplicationController | ||
# Adds Hyrax behaviors to the controller. | ||
include Hyrax::WorksControllerBehavior | ||
include Hyrax::BreadcrumbsForWorks | ||
self.curation_concern_type = ::Work | ||
|
||
# Use this line if you want to use a custom presenter | ||
self.show_presenter = Hyrax::WorkPresenter | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
# Generated via | ||
# `rails generate hyrax:work Work` | ||
module Hyrax | ||
# Generated form for Work | ||
class WorkForm < Hyrax::Forms::WorkForm | ||
self.model_class = ::Work | ||
self.terms += [:resource_type] | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
# Generated via | ||
# `rails generate hyrax:work Work` | ||
class WorkIndexer < Hyrax::WorkIndexer | ||
# This indexes the default metadata. You can remove it if you want to | ||
# provide your own metadata and indexing. | ||
include Hyrax::IndexesBasicMetadata | ||
|
||
# Fetch remote labels for based_near. You can remove this if you don't want | ||
# this behavior | ||
include Hyrax::IndexesLinkedMetadata | ||
|
||
# Uncomment this block if you want to add custom indexing behavior: | ||
# def generate_solr_document | ||
# super.tap do |solr_doc| | ||
# solr_doc['my_custom_field_ssim'] = object.my_custom_property | ||
# end | ||
# end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
# Generated via | ||
# `rails generate hyrax:work Work` | ||
class Work < ActiveFedora::Base | ||
include ::Hyrax::WorkBehavior | ||
|
||
self.indexer = WorkIndexer | ||
# Change this to restrict which works can be added as a child. | ||
# self.valid_child_concerns = [] | ||
validates :title, presence: { message: 'Your work must have a title.' } | ||
|
||
# This must be included at the end, because it finalizes the metadata | ||
# schema (by adding accepts_nested_attributes) | ||
include ::Hyrax::BasicMetadata | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
# Generated via | ||
# `rails generate hyrax:work Work` | ||
module Hyrax | ||
class WorkPresenter < Hyrax::WorkShowPresenter | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
<%# This is a search result view %> | ||
<%= render 'catalog/document', document: work, document_counter: work_counter %> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
de: | ||
hyrax: | ||
icons: | ||
work: 'fa fa-file-text-o' | ||
select_type: | ||
work: | ||
description: "Work Werke" | ||
name: "Work" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
en: | ||
hyrax: | ||
icons: | ||
work: 'fa fa-file-text-o' | ||
select_type: | ||
work: | ||
description: "Work works" | ||
name: "Work" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
es: | ||
hyrax: | ||
icons: | ||
work: 'fa fa-file-text-o' | ||
select_type: | ||
work: | ||
# TODO: translate `human_name` into Spanish | ||
description: "Work trabajos" | ||
name: "Work" | ||
# TODO: translate `human_name` into Spanish |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
fr: | ||
hyrax: | ||
icons: | ||
work: 'fa fa-file-text-o' | ||
select_type: | ||
work: | ||
description: "Work œuvres" | ||
name: "Work" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
it: | ||
hyrax: | ||
icons: | ||
work: 'fa fa-file-text-o' | ||
select_type: | ||
work: | ||
description: "Work opere" | ||
name: "Work" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
pt-BR: | ||
hyrax: | ||
icons: | ||
work: 'fa fa-file-text-o' | ||
select_type: | ||
work: | ||
description: "Work obras" | ||
name: "Work" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
zh: | ||
hyrax: | ||
icons: | ||
work: 'fa fa-file-text-o' | ||
select_type: | ||
work: | ||
# TODO: translate `human_name` into Chinese | ||
description: "Work 作品" | ||
name: "Work" | ||
# TODO: translate `human_name` into Chinese |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
# Generated via | ||
# `rails generate hyrax:work Work` | ||
require 'rails_helper' | ||
|
||
RSpec.describe Hyrax::Actors::WorkActor do | ||
it "has tests" do | ||
skip "Add your tests here" | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
# Generated via | ||
# `rails generate hyrax:work Work` | ||
require 'rails_helper' | ||
|
||
RSpec.describe Hyrax::WorksController do | ||
it "has tests" do | ||
skip "Add your tests here" | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,68 @@ | ||
# Generated via | ||
# `rails generate hyrax:work Work` | ||
require 'rails_helper' | ||
include Warden::Test::Helpers | ||
|
||
# NOTE: If you generated more than one work, you have to set "js: true" | ||
RSpec.feature 'Create a Work', js: false do | ||
context 'a logged in user' do | ||
let(:user_attributes) do | ||
{ email: '[email protected]' } | ||
end | ||
let(:user) do | ||
User.new(user_attributes) { |u| u.save(validate: false) } | ||
end | ||
let(:admin_set_id) { AdminSet.find_or_create_default_admin_set_id } | ||
let(:permission_template) { Hyrax::PermissionTemplate.find_or_create_by!(source_id: admin_set_id) } | ||
let(:workflow) { Sipity::Workflow.create!(active: true, name: 'test-workflow', permission_template: permission_template) } | ||
|
||
before do | ||
# Create a single action that can be taken | ||
Sipity::WorkflowAction.create!(name: 'submit', workflow: workflow) | ||
|
||
# Grant the user access to deposit into the admin set. | ||
Hyrax::PermissionTemplateAccess.create!( | ||
permission_template_id: permission_template.id, | ||
agent_type: 'user', | ||
agent_id: user.user_key, | ||
access: 'deposit' | ||
) | ||
login_as user | ||
end | ||
|
||
scenario do | ||
visit '/dashboard' | ||
click_link "Works" | ||
click_link "Add new work" | ||
|
||
# If you generate more than one work uncomment these lines | ||
# choose "payload_concern", option: "Work" | ||
# click_button "Create work" | ||
|
||
expect(page).to have_content "Add New Work" | ||
click_link "Files" # switch tab | ||
expect(page).to have_content "Add files" | ||
expect(page).to have_content "Add folder" | ||
within('span#addfiles') do | ||
attach_file("files[]", "#{Hyrax::Engine.root}/spec/fixtures/image.jp2", visible: false) | ||
attach_file("files[]", "#{Hyrax::Engine.root}/spec/fixtures/jp2_fits.xml", visible: false) | ||
end | ||
click_link "Descriptions" # switch tab | ||
fill_in('Title', with: 'My Test Work') | ||
fill_in('Creator', with: 'Doe, Jane') | ||
select('In Copyright', from: 'Rights statement') | ||
|
||
# With selenium and the chrome driver, focus remains on the | ||
# select box. Click outside the box so the next line can't find | ||
# its element | ||
find('body').click | ||
choose('work_visibility_open') | ||
expect(page).to have_content('Please note, making something visible to the world (i.e. marking this as Public) may be viewed as publishing which could impact your ability to') | ||
check('agreement') | ||
|
||
click_on('Save') | ||
expect(page).to have_content('My Test Work') | ||
expect(page).to have_content "Your files are being processed by Hyrax in the background." | ||
end | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
# Generated via | ||
# `rails generate hyrax:work Work` | ||
require 'rails_helper' | ||
|
||
RSpec.describe Hyrax::WorkForm do | ||
it "has tests" do | ||
skip "Add your tests here" | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
# Generated via | ||
# `rails generate hyrax:work Work` | ||
require 'rails_helper' | ||
|
||
RSpec.describe Work do | ||
it "has tests" do | ||
skip "Add your tests here" | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
# Generated via | ||
# `rails generate hyrax:work Work` | ||
require 'rails_helper' | ||
|
||
RSpec.describe Hyrax::WorkPresenter do | ||
it "has tests" do | ||
skip "Add your tests here" | ||
end | ||
end |