-
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.
Now we are at a working base install. Tag this commit.
- Loading branch information
Showing
28 changed files
with
303 additions
and
3 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 |
---|---|---|
|
@@ -71,4 +71,6 @@ end | |
|
||
gem 'riiif', '~> 2.1' | ||
|
||
gem 'mysql2' | ||
gem 'mysql2' | ||
|
||
gem 'hydra-role-management' |
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 @@ | ||
# Generated via | ||
# `rails generate hyrax:work GenericWork` | ||
module Hyrax | ||
module Actors | ||
class GenericWorkActor < 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 GenericWork` | ||
module Hyrax | ||
# Generated controller for GenericWork | ||
class GenericWorksController < ApplicationController | ||
# Adds Hyrax behaviors to the controller. | ||
include Hyrax::WorksControllerBehavior | ||
include Hyrax::BreadcrumbsForWorks | ||
self.curation_concern_type = ::GenericWork | ||
|
||
# Use this line if you want to use a custom presenter | ||
self.show_presenter = Hyrax::GenericWorkPresenter | ||
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 GenericWork` | ||
module Hyrax | ||
# Generated form for GenericWork | ||
class GenericWorkForm < Hyrax::Forms::WorkForm | ||
self.model_class = ::GenericWork | ||
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 GenericWork` | ||
class GenericWorkIndexer < 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
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 GenericWork` | ||
class GenericWork < ActiveFedora::Base | ||
include ::Hyrax::WorkBehavior | ||
|
||
self.indexer = GenericWorkIndexer | ||
# 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
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 GenericWork` | ||
module Hyrax | ||
class GenericWorkPresenter < 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: generic_work, document_counter: generic_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: | ||
generic_work: 'fa fa-file-text-o' | ||
select_type: | ||
generic_work: | ||
description: "Generic work Werke" | ||
name: "Generic 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: | ||
generic_work: 'fa fa-file-text-o' | ||
select_type: | ||
generic_work: | ||
description: "Generic work works" | ||
name: "Generic 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: | ||
generic_work: 'fa fa-file-text-o' | ||
select_type: | ||
generic_work: | ||
# TODO: translate `human_name` into Spanish | ||
description: "Generic work trabajos" | ||
name: "Generic 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: | ||
generic_work: 'fa fa-file-text-o' | ||
select_type: | ||
generic_work: | ||
description: "Generic work œuvres" | ||
name: "Generic 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: | ||
generic_work: 'fa fa-file-text-o' | ||
select_type: | ||
generic_work: | ||
description: "Generic work opere" | ||
name: "Generic 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: | ||
generic_work: 'fa fa-file-text-o' | ||
select_type: | ||
generic_work: | ||
description: "Generic work obras" | ||
name: "Generic 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: | ||
generic_work: 'fa fa-file-text-o' | ||
select_type: | ||
generic_work: | ||
# TODO: translate `human_name` into Chinese | ||
description: "Generic work 作品" | ||
name: "Generic 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
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,19 @@ | ||
# frozen_string_literal: true | ||
class UserRoles < ActiveRecord::Migration[5.0] | ||
def up | ||
create_table :roles do |t| | ||
t.string :name | ||
end | ||
create_table :roles_users, id: false do |t| | ||
t.references :role | ||
t.references :user | ||
end | ||
add_index :roles_users, [:role_id, :user_id] | ||
add_index :roles_users, [:user_id, :role_id] | ||
end | ||
|
||
def down | ||
drop_table :roles_users | ||
drop_table :roles | ||
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
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 GenericWork` | ||
require 'rails_helper' | ||
|
||
RSpec.describe Hyrax::Actors::GenericWorkActor 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 GenericWork` | ||
require 'rails_helper' | ||
|
||
RSpec.describe Hyrax::GenericWorksController 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 GenericWork` | ||
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 GenericWork', 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: "GenericWork" | ||
# click_button "Create work" | ||
|
||
expect(page).to have_content "Add New Generic 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('generic_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 GenericWork` | ||
require 'rails_helper' | ||
|
||
RSpec.describe Hyrax::GenericWorkForm 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 GenericWork` | ||
require 'rails_helper' | ||
|
||
RSpec.describe GenericWork do | ||
it "has tests" do | ||
skip "Add your tests here" | ||
end | ||
end |
Oops, something went wrong.