Skip to content

Commit

Permalink
Merge pull request #2485 from samvera/merge_master
Browse files Browse the repository at this point in the history
 Merge latest changes from master into collections-sprint branch
  • Loading branch information
elrayle authored Jan 12, 2018
2 parents 16fa58f + fa44b5d commit af46dda
Show file tree
Hide file tree
Showing 14 changed files with 183 additions and 178 deletions.
4 changes: 3 additions & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
language: ruby
sudo: false
# Workaround for https://github.com/travis-ci/travis-ci/issues/8836
# sudo: false
sudo: required
dist: trusty

addons:
Expand Down
18 changes: 12 additions & 6 deletions app/models/concerns/hyrax/with_events.rb
Original file line number Diff line number Diff line change
Expand Up @@ -8,16 +8,22 @@ def event_class
self.class.name
end

def event_store
RedisEventStore
end

def events(size = -1)
event_store.for(stream[:event]).fetch(size)
event_stream.fetch(size)
end

def log_event(event_id)
event_store.for(stream[:event]).push(event_id)
event_stream.push(event_id)
end

private

def event_store
RedisEventStore
end

def event_stream
event_store.for(stream[:event])
end
end
end
35 changes: 35 additions & 0 deletions app/services/hyrax/default_middleware_stack.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3,22 +3,57 @@ class DefaultMiddlewareStack
# rubocop:disable Metrics/MethodLength
def self.build_stack
ActionDispatch::MiddlewareStack.new.tap do |middleware|
# Wrap everything in a database transaction, if the save of the resource
# fails then roll back any database AdminSetChangeSet
middleware.use Hyrax::Actors::TransactionalRequest

# Ensure you are mutating the most recent version
middleware.use Hyrax::Actors::OptimisticLockValidator

# Attach files from a URI (for BrowseEverything)
middleware.use Hyrax::Actors::CreateWithRemoteFilesActor

# Attach files uploaded in the form to the UploadsController
middleware.use Hyrax::Actors::CreateWithFilesActor

# Add/remove the resource to/from a collection
middleware.use Hyrax::Actors::CollectionsMembershipActor

# Add/remove to parent work
middleware.use Hyrax::Actors::AddToWorkActor

# Add/remove children (works or file_sets)
middleware.use Hyrax::Actors::AttachMembersActor

# Set the order of the children (works or file_sets)
middleware.use Hyrax::Actors::ApplyOrderActor

# Decode the private/public/institution on the form into permisisons on
# the model
middleware.use Hyrax::Actors::InterpretVisibilityActor

# Handles transfering ownership of works from one user to another
middleware.use Hyrax::Actors::TransferRequestActor

# Sets the default admin set if they didn't supply one
middleware.use Hyrax::Actors::DefaultAdminSetActor

# Copies default permissions from the PermissionTemplate to the work
middleware.use Hyrax::Actors::ApplyPermissionTemplateActor

# Remove attached FileSets when destroying a work
middleware.use Hyrax::Actors::CleanupFileSetsActor

# Destroys the trophies in the database when the work is destroyed
middleware.use Hyrax::Actors::CleanupTrophiesActor

# Destroys the feature tag in the database when the work is destroyed
middleware.use Hyrax::Actors::FeaturedWorkActor

# Persist the metadata changes on the resource
middleware.use Hyrax::Actors::ModelActor

# Start the workflow for this work
middleware.use Hyrax::Actors::InitializeWorkflowActor
end
end
Expand Down
2 changes: 1 addition & 1 deletion app/views/hyrax/my/_search_header.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@

<% if on_my_works? %>
<div class="batch-info">
<%= render 'hyrax/dashboard/collections/form_for_select_collection', user_collections: @user_collections %>
<%= render 'hyrax/dashboard/collections/form_for_select_collection', user_collections: @user_collections if params[:controller] != 'hyrax/my/collections' %>

<div class="batch-toggle">
<% session[:batch_edit_state] = "on" %>
Expand Down
113 changes: 52 additions & 61 deletions config/locales/hyrax.de.yml

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion config/locales/hyrax.en.yml
Original file line number Diff line number Diff line change
Expand Up @@ -817,6 +817,7 @@ en:
keyword_label: 'Keywords'
keyword_missing: 'no keywords specified'
recently_uploaded:
depositor: 'Depositor'
details: 'Details'
no_public: 'No public work has been contributed.'
tab_label: 'Recently Uploaded'
Expand All @@ -827,7 +828,6 @@ en:
depositor_missing: 'no depositor value'
keyword_label: 'Keywords'
keyword_missing: 'no keywords specified'

icons:
collection: 'fa fa-cubes'
default: 'fa fa-cube'
Expand Down
28 changes: 12 additions & 16 deletions config/locales/hyrax.es.yml
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,6 @@ es:
no_date: Se requiere una fecha para la opción de lanzamiento seleccionada.
no_embargo: Se requiere un período de embargo para la opción seleccionada.
nothing: Seleccione opciones de lanzamiento antes de guardar.
varies: La opción de lanzamiento 'Varía' requiere una fecha o período de embargo.
permission_update_notices:
new_admin_set: Se ha creado el conjunto administrativo '%{name}'. Utilice las pestañas adicionales para definir otros aspectos del conjunto administrativo.
participants: Se han actualizado los derechos de participante del conjunto administrativo
Expand Down Expand Up @@ -201,7 +200,6 @@ es:
end_label: Finalizando [el momento actual es el valor predeterminado]
heading: 'Ver Archivos Depositados:'
start_label: Comenzando
registered: Registrado
repository_objects:
series:
published: Publicado
Expand Down Expand Up @@ -385,15 +383,6 @@ es:
title: Añadir a la colección
update: Actualizar Colección
collections:
edit:
header: 'Editar Colección: %{title}'
form:
tabs:
description: Descripción
sharing: Compartir
visibility: Visibilidad
new:
header: Nueva Colección
search_form:
button_label: Ir
label: Buscar Colección %{title}
Expand Down Expand Up @@ -603,13 +592,24 @@ es:
tab_label: Investigador destacado
title: Investigador destacado
featured_works:
document:
depositor_label: Depositor
depositor_missing: sin valor para el depositante
keyword_label: Palabras clave
keyword_missing: no palabras clave especificadas
title_label: Título
drag: Arrastrar
no_works: No hay trabajos destacados
tab_label: Trabajos destacados
title: Trabajos destacados
recently_uploaded:
depositor: Depositante
details: Detalles
document:
depositor_label: Depositor
depositor_missing: sin valor para el depositante
keyword_label: Palabras clave
keyword_missing: no palabras clave especificadas
title_label: Título
no_public: No hay trabajos públicos.
tab_label: Subidos recientemente
title: Subidos recientemente
Expand Down Expand Up @@ -796,10 +796,6 @@ es:
text: Público
warning_html: '<p> <strong>Tenga en cuenta</strong>, hacer algo visible para el mundo (es decir, marcar esto como %{label}) puede ser visto como una publicación, lo que podría afectar su capacidad de: </p> <ul> <li>Patentar su trabajo</li> <li>Publicar su trabajo en una revista</li> </ul> <p> Eche un vistazo a <a href="http://www.sherpa.ac.uk/romeo/">SHERPA/RoMEO</a> para más información sobre las políticas de copyright del editor. </p>'
open_title_attr: Cambiar la visibilidad de este recurso
private:
note_html: Sólo los usuarios y/o grupos a los que se les ha dado acceso específico en la sección "Compartir con".
text: Privado
private_title_attr: Cambiar la visibilidad de este recurso
restricted:
note_html: Sólo los usuarios y / o grupos a los que se les ha dado acceso específico en la sección "Compartir con".
text: Privado
Expand Down
33 changes: 12 additions & 21 deletions config/locales/hyrax.fr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,6 @@ fr:
no_date: Une date est requise pour l'option de publication sélectionnée.
no_embargo: Une période d'embargo est requise pour l'option sélectionnée.
nothing: Sélectionnez les options de libération avant d'appuyer sur Enregistrer.
varies: L'option de libération «Variable» nécessite une date ou une période d'embargo.
permission_update_notices:
new_admin_set: L'ensemble administratif '%{name}' a été créé. Utilisez les onglets supplémentaires pour définir d'autres aspects de l'ensemble administratif.
participants: Les droits des participants au service administratif ont été mis à jour
Expand Down Expand Up @@ -201,7 +200,6 @@ fr:
end_label: Fin [par défaut pour maintenant]
heading: 'Afficher les fichiers déposés:'
start_label: Début
registered: Inscrit
repository_objects:
series:
published: Publié
Expand Down Expand Up @@ -242,11 +240,6 @@ fr:
tabs:
published: Publié
under_review: À l'étude
admin_sets:
index:
header: Toutes les collections
show:
header: Collection
api:
accepted:
default: Votre demande a été acceptée pour traitement, mais le traitement n'est pas complet. Consultez le travail pour plus d'informations.
Expand Down Expand Up @@ -391,15 +384,6 @@ fr:
title: Ajouter à la collection
update: Mise à jour de la collection
collections:
edit:
header: 'Modifier la Collection: %{title}'
form:
tabs:
description: La description
sharing: Partage
visibility: Visibilité
new:
header: Nouvelle Collection
search_form:
button_label: Aller
label: Rechercher Collection %{title}
Expand Down Expand Up @@ -607,13 +591,24 @@ fr:
tab_label: Chercheur en vedette
title: Chercheur en vedette
featured_works:
document:
depositor_label: Déposant
depositor_missing: pas de valeur de déposant
keyword_label: Mots clés
keyword_missing: aucun mot-clé spécifié
title_label: Titre
drag: Traîne
no_works: Aucun travail n'a été présenté
tab_label: Travaux en vedette
title: Travaux en vedette
recently_uploaded:
depositor: Déposant
details: Détails
document:
depositor_label: Déposant
depositor_missing: pas de valeur de déposant
keyword_label: Mots clés
keyword_missing: aucun mot-clé spécifié
title_label: Titre
no_public: Aucun travail public n'a été apporté.
tab_label: Chargé récemment
title: Chargé récemment
Expand Down Expand Up @@ -800,10 +795,6 @@ fr:
text: Public
warning_html: '<p> <strong>Notez</strong> que faire apparaître une chose visible dans le monde (c.-à-d. Marquer cela comme %{label}) peut être considérée comme une publication qui pourrait avoir une incidence sur votre capacité à: </p><ul><li> Prenez connaissance de votre travail </li><li> Publiez votre travail dans un journal </li></ul><p> Consultez <a href="http://www.sherpa.ac.uk/romeo/">SHERPA / RoMEO</a> pour plus d''informations sur les politiques de copyright des éditeurs. </p>'
open_title_attr: Changez la visibilité de cette ressource
private:
note_html: Seuls les utilisateurs et / ou les groupes ayant reçu un accès spécifique dans la section "Partager avec".
text: Privé
private_title_attr: Changez la visibilité de cette ressource
restricted:
note_html: Seuls les utilisateurs et / ou les groupes ayant reçu un accès spécifique dans la section "Partager avec".
text: Privé
Expand Down
33 changes: 12 additions & 21 deletions config/locales/hyrax.it.yml
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,6 @@ it:
no_date: È necessaria una data per l'opzione di rilascio selezionata.
no_embargo: È necessario un periodo di embargo per l'opzione selezionata.
nothing: Selezionare le opzioni di rilascio prima di salvare.
varies: L'opzione di rilascio "Varia" richiede una data o un periodo di embargo.
permission_update_notices:
new_admin_set: È stato creato il set amministrativo '%{name}'. Utilizza le schede aggiuntive per definire altri aspetti dell'insieme amministrativo.
participants: I diritti partecipanti del set di amministratori sono stati aggiornati
Expand Down Expand Up @@ -201,7 +200,6 @@ it:
end_label: Fine [impostazione predefinita]
heading: 'Visualizza i file depositati:'
start_label: Inizio
registered: Registrato
repository_objects:
series:
published: Pubblicato
Expand Down Expand Up @@ -242,11 +240,6 @@ it:
tabs:
published: Pubblicato
under_review: In corso di revisione
admin_sets:
index:
header: Tutte le collezioni
show:
header: Collezione
api:
accepted:
default: La tua richiesta è stata accettata per l'elaborazione, ma l'elaborazione non è completa. Vedere il lavoro per ulteriori informazioni.
Expand Down Expand Up @@ -390,15 +383,6 @@ it:
title: Aggiungere alla collezione
update: Aggiorna Collezione
collections:
edit:
header: 'Modifica Collezione: %{title}'
form:
tabs:
description: Descrizione
sharing: compartecipazione
visibility: Visibilità
new:
header: Nuova Collezione
search_form:
button_label: Partire
label: Cerca la raccolta %{title}
Expand Down Expand Up @@ -606,13 +590,24 @@ it:
tab_label: Ricercatore in primo piano
title: Ricercatore in primo piano
featured_works:
document:
depositor_label: Depositante
depositor_missing: nessun valore del depositante
keyword_label: parole
keyword_missing: nessuna parola chiave specificata
title_label: Titolo
drag: Trascinare
no_works: Nessun lavoro è stato descritto
tab_label: Opere in primo piano
title: Opere in primo piano
recently_uploaded:
depositor: Depositante
details: Dettagli
document:
depositor_label: Depositante
depositor_missing: nessun valore del depositante
keyword_label: parole
keyword_missing: nessuna parola chiave specificata
title_label: Titolo
no_public: Nessun lavoro pubblico è stato contribuito.
tab_label: Recentemente caricati
title: Recentemente caricati
Expand Down Expand Up @@ -799,10 +794,6 @@ it:
text: Pubblico
warning_html: '<p> <strong>Si prega di notare</strong> che facendo qualcosa di visibile al mondo (vale a dire marcatura come %{label}) può essere considerata come pubblicazione che potrebbe influenzare la tua capacità di: </p><ul><li> Brevetti il ​​tuo lavoro </li><li> Pubblica il tuo lavoro in un diario </li></ul><p> <a href="http://www.sherpa.ac.uk/romeo/">Controlla SHERPA / RoMEO</a> per ulteriori informazioni sulle norme del copyright dei publisher. </p>'
open_title_attr: Modificare la visibilità di questa risorsa
private:
note_html: Solo utenti e / o gruppi che hanno ricevuto l'accesso specifico nella sezione "Condividi con".
text: Privato
private_title_attr: Modificare la visibilità di questa risorsa
restricted:
note_html: Solo utenti e / o gruppi che hanno ricevuto l'accesso specifico nella sezione "Condividi con".
text: Privato
Expand Down
Loading

0 comments on commit af46dda

Please sign in to comment.