Skip to content
Snippets Groups Projects
Commit d5aff4dc authored by Arnaud Levy's avatar Arnaud Levy
Browse files

fix tests

parent 26d84390
No related branches found
No related tags found
No related merge requests found
class Communication::Website::Page::ResearchHalPublication < Communication::Website::Page
class Communication::Website::Page::ResearchPublication < Communication::Website::Page
def is_necessary_for_website?
website.connected_hal_publications.any?
website.connected_publications.any?
end
def editable_width?
......@@ -15,7 +15,7 @@ class Communication::Website::Page::ResearchHalPublication < Communication::Webs
def dependencies
super +
[website.config_default_languages] +
website.connected_hal_publications
website.connected_publications
end
protected
......
......@@ -19,7 +19,7 @@ module Communication::Website::Page::WithType
# Research
Communication::Website::Page::ResearchVolume,
Communication::Website::Page::ResearchPaper,
Communication::Website::Page::ResearchHalPublication,
Communication::Website::Page::ResearchPublication,
# Administration
Communication::Website::Page::AdministrationLocation,
# People facets
......
......@@ -8,7 +8,7 @@ class Communication::Website::Permalink::Publication < Communication::Website::P
end
def self.pattern_in_website(website, language)
"/#{website.special_page(Communication::Website::Page::ResearchHalPublication, language: language).slug_with_ancestors}/:year-:slug/"
"/#{website.special_page(Communication::Website::Page::ResearchPublication, language: language).slug_with_ancestors}/:year-:slug/"
end
protected
......
......@@ -88,9 +88,9 @@ module Communication::Website::WithConnectedObjects
University::Organization.where(id: ids)
end
def connected_hal_publications
ids = connections.where(indirect_object_type: 'Research::Hal::Publication').pluck(:indirect_object_id)
Research::Hal::Publication.where(id: ids)
def connected_publications
ids = connections.where(indirect_object_type: 'Research::Publication').pluck(:indirect_object_id)
Research::Publication.where(id: ids)
end
# ensure the object "website" respond to both is_direct_object? and is_indirect_object? as website doesn't include neither as_direct_object nor as_indirect_object
......
......@@ -3,7 +3,7 @@ title: >-
<%= @about.title %>
date: "<%= @about.publication_date&.iso8601 %>"
<%= render 'admin/application/static/breadcrumbs',
pages: @website.special_page(Communication::Website::Page::ResearchHalPublication).ancestors_and_self,
pages: @website.special_page(Communication::Website::Page::ResearchPublication).ancestors_and_self,
current_title: @about.to_s %>
<%= render 'admin/application/static/permalink' %>
hal:
......
default_publication:
docid: MyString
hal_docid: MyString
data:
title: MyString
url: MyString
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment