{"action":"created","comment":{"url":"https://api.github.com/repos/europeana/europeana-portal-collections/pulls/comments/143416382","pull_request_review_id":67923804,"id":143416382,"diff_hunk":"@@ -0,0 +1,204 @@\n+# frozen_string_literal: true\n+\n+module Document\n+  ##\n+  # Presenter for a record metadata \"section\", which may gather data from multiple\n+  # source fields\n+  module FieldGroup\n+    class SectionPresenter < ApplicationPresenter\n+      attr_reader :document, :controller, :group, :definition\n+\n+      delegate :search_field, :entity, :fields, :exclude_vals, :max, :title,\n+               :ga_data, :map_values, :format_date, to: :definition\n+\n+      # @param document [Europeana::Blacklight::Document]\n+      # @param controller [ActionController::Base]\n+      # @param group [Document::FieldGroupPresenter]\n+      # @param definition [OpenStruct]\n+      def initialize(document, controller, group, definition)","path":"app/presenters/document/field_group/section_presenter.rb","position":18,"original_position":18,"commit_id":"32aa2e46c4e9d8a4b76a387c385c31a14de3c9df","original_commit_id":"128e01915c90e7fbb12198e5948e3fcbc91895da","user":{"login":"lbiedinger","id":1177719,"avatar_url":"https://avatars3.githubusercontent.com/u/1177719?v=4","gravatar_id":"","url":"https://api.github.com/users/lbiedinger","html_url":"https://github.com/lbiedinger","followers_url":"https://api.github.com/users/lbiedinger/followers","following_url":"https://api.github.com/users/lbiedinger/following{/other_user}","gists_url":"https://api.github.com/users/lbiedinger/gists{/gist_id}","starred_url":"https://api.github.com/users/lbiedinger/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lbiedinger/subscriptions","organizations_url":"https://api.github.com/users/lbiedinger/orgs","repos_url":"https://api.github.com/users/lbiedinger/repos","events_url":"https://api.github.com/users/lbiedinger/events{/privacy}","received_events_url":"https://api.github.com/users/lbiedinger/received_events","type":"User","site_admin":false},"body":"the FieldGroupPresenter loads in section presenters for each section at initialization:\r\n```\r\n    ...\r\n    @sections = @definition[:sections].map do |section_definition|\r\n      Document::FieldGroup::SectionPresenter.new(document, controller, self, OpenStruct.new(section_definition).freeze)\r\n    end\r\nend\r\n```\r\n\r\nthe sections don't load in the value_presenters until .display is called\r\nso for consistency in the initializer here we could do something like: \r\n```\r\n@value_presenters = value_presenters\r\n```\r\nhowever the logic for determining the value presenters is a bit more complicated for the section presenters than the simple mapping we can do in the FieldgroupPresenter initializer. Therfore I was asking whether it's worth trying to move this into the initializer.\r\n \r\n","created_at":"2017-10-09T09:14:40Z","updated_at":"2017-10-09T09:14:40Z","html_url":"https://github.com/europeana/europeana-portal-collections/pull/997#discussion_r143416382","pull_request_url":"https://api.github.com/repos/europeana/europeana-portal-collections/pulls/997","author_association":"CONTRIBUTOR","_links":{"self":{"href":"https://api.github.com/repos/europeana/europeana-portal-collections/pulls/comments/143416382"},"html":{"href":"https://github.com/europeana/europeana-portal-collections/pull/997#discussion_r143416382"},"pull_request":{"href":"https://api.github.com/repos/europeana/europeana-portal-collections/pulls/997"}},"in_reply_to_id":143218469},"pull_request":{"url":"https://api.github.com/repos/europeana/europeana-portal-collections/pulls/997","id":143351138,"html_url":"https://github.com/europeana/europeana-portal-collections/pull/997","diff_url":"https://github.com/europeana/europeana-portal-collections/pull/997.diff","patch_url":"https://github.com/europeana/europeana-portal-collections/pull/997.patch","issue_url":"https://api.github.com/repos/europeana/europeana-portal-collections/issues/997","number":997,"state":"open","locked":false,"title":"Refactor field group presentation","user":{"login":"rwd","id":218337,"avatar_url":"https://avatars3.githubusercontent.com/u/218337?v=4","gravatar_id":"","url":"https://api.github.com/users/rwd","html_url":"https://github.com/rwd","followers_url":"https://api.github.com/users/rwd/followers","following_url":"https://api.github.com/users/rwd/following{/other_user}","gists_url":"https://api.github.com/users/rwd/gists{/gist_id}","starred_url":"https://api.github.com/users/rwd/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rwd/subscriptions","organizations_url":"https://api.github.com/users/rwd/orgs","repos_url":"https://api.github.com/users/rwd/repos","events_url":"https://api.github.com/users/rwd/events{/privacy}","received_events_url":"https://api.github.com/users/rwd/received_events","type":"User","site_admin":false},"body":"This branch introduces a substantial refactor of the `Document::FieldGroupPresenter` used as the presentation logic for grouped metadata fields on the core item display pages.\r\n\r\nKey changes:\r\n* introduction of nested `Document::FieldGroup::SectionPresenter` and `Document::FieldGroup::Section::ValuePresenter` classes with much of the code from `Document::FieldGroupPresenter` moved into them for better OO modelling and improved readability\r\n* replaces `DocumentPresenter` with `BlacklightDocumentPresenter` *concern* to be included in presenters needing access to the `Europeana::Blacklight::DocumentPresenter` methods\r\n* introduces a base presenter class `ApplicationPresenter`\r\n* europeana-blacklight gem updated to [disable-lang-map-value-dereferencing branch](https://github.com/europeana/europeana-blacklight/tree/disable-lang-map-value-dereferencing) where it no longer dereferences entity URIs in `Europeana::Blacklight::Document::LangMaps#localize_lang_map` so that consumers can obtain the URI and work with it as needed\r\n* config/record_field_groups.yml:\r\n  * remove `entity_proxy_field` and use `fields`\r\n  * move other `entity_` settings under `entity`\r\n  * enable entities lookup on format and type sections (for https://europeanadev.assembla.com/spaces/europeana-npc/tickets/2374)\r\n* rationalised placement of entities-related methods in view/presenter concerns","created_at":"2017-09-27T10:10:42Z","updated_at":"2017-10-09T09:14:40Z","closed_at":null,"merged_at":null,"merge_commit_sha":"dc8a183d50d192b03730678d8b7ca0cc09faa96b","assignee":null,"assignees":[],"requested_reviewers":[],"milestone":null,"commits_url":"https://api.github.com/repos/europeana/europeana-portal-collections/pulls/997/commits","review_comments_url":"https://api.github.com/repos/europeana/europeana-portal-collections/pulls/997/comments","review_comment_url":"https://api.github.com/repos/europeana/europeana-portal-collections/pulls/comments{/number}","comments_url":"https://api.github.com/repos/europeana/europeana-portal-collections/issues/997/comments","statuses_url":"https://api.github.com/repos/europeana/europeana-portal-collections/statuses/32aa2e46c4e9d8a4b76a387c385c31a14de3c9df","head":{"label":"europeana:feat/2374-concept-entity-item-page-links","ref":"feat/2374-concept-entity-item-page-links","sha":"32aa2e46c4e9d8a4b76a387c385c31a14de3c9df","user":{"login":"europeana","id":4570681,"avatar_url":"https://avatars3.githubusercontent.com/u/4570681?v=4","gravatar_id":"","url":"https://api.github.com/users/europeana","html_url":"https://github.com/europeana","followers_url":"https://api.github.com/users/europeana/followers","following_url":"https://api.github.com/users/europeana/following{/other_user}","gists_url":"https://api.github.com/users/europeana/gists{/gist_id}","starred_url":"https://api.github.com/users/europeana/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/europeana/subscriptions","organizations_url":"https://api.github.com/users/europeana/orgs","repos_url":"https://api.github.com/users/europeana/repos","events_url":"https://api.github.com/users/europeana/events{/privacy}","received_events_url":"https://api.github.com/users/europeana/received_events","type":"Organization","site_admin":false},"repo":{"id":27171162,"name":"europeana-portal-collections","full_name":"europeana/europeana-portal-collections","owner":{"login":"europeana","id":4570681,"avatar_url":"https://avatars3.githubusercontent.com/u/4570681?v=4","gravatar_id":"","url":"https://api.github.com/users/europeana","html_url":"https://github.com/europeana","followers_url":"https://api.github.com/users/europeana/followers","following_url":"https://api.github.com/users/europeana/following{/other_user}","gists_url":"https://api.github.com/users/europeana/gists{/gist_id}","starred_url":"https://api.github.com/users/europeana/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/europeana/subscriptions","organizations_url":"https://api.github.com/users/europeana/orgs","repos_url":"https://api.github.com/users/europeana/repos","events_url":"https://api.github.com/users/europeana/events{/privacy}","received_events_url":"https://api.github.com/users/europeana/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/europeana/europeana-portal-collections","description":"Europeana Collections portal as a Rails + Blacklight application.","fork":false,"url":"https://api.github.com/repos/europeana/europeana-portal-collections","forks_url":"https://api.github.com/repos/europeana/europeana-portal-collections/forks","keys_url":"https://api.github.com/repos/europeana/europeana-portal-collections/keys{/key_id}","collaborators_url":"https://api.github.com/repos/europeana/europeana-portal-collections/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/europeana/europeana-portal-collections/teams","hooks_url":"https://api.github.com/repos/europeana/europeana-portal-collections/hooks","issue_events_url":"https://api.github.com/repos/europeana/europeana-portal-collections/issues/events{/number}","events_url":"https://api.github.com/repos/europeana/europeana-portal-collections/events","assignees_url":"https://api.github.com/repos/europeana/europeana-portal-collections/assignees{/user}","branches_url":"https://api.github.com/repos/europeana/europeana-portal-collections/branches{/branch}","tags_url":"https://api.github.com/repos/europeana/europeana-portal-collections/tags","blobs_url":"https://api.github.com/repos/europeana/europeana-portal-collections/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/europeana/europeana-portal-collections/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/europeana/europeana-portal-collections/git/refs{/sha}","trees_url":"https://api.github.com/repos/europeana/europeana-portal-collections/git/trees{/sha}","statuses_url":"https://api.github.com/repos/europeana/europeana-portal-collections/statuses/{sha}","languages_url":"https://api.github.com/repos/europeana/europeana-portal-collections/languages","stargazers_url":"https://api.github.com/repos/europeana/europeana-portal-collections/stargazers","contributors_url":"https://api.github.com/repos/europeana/europeana-portal-collections/contributors","subscribers_url":"https://api.github.com/repos/europeana/europeana-portal-collections/subscribers","subscription_url":"https://api.github.com/repos/europeana/europeana-portal-collections/subscription","commits_url":"https://api.github.com/repos/europeana/europeana-portal-collections/commits{/sha}","git_commits_url":"https://api.github.com/repos/europeana/europeana-portal-collections/git/commits{/sha}","comments_url":"https://api.github.com/repos/europeana/europeana-portal-collections/comments{/number}","issue_comment_url":"https://api.github.com/repos/europeana/europeana-portal-collections/issues/comments{/number}","contents_url":"https://api.github.com/repos/europeana/europeana-portal-collections/contents/{+path}","compare_url":"https://api.github.com/repos/europeana/europeana-portal-collections/compare/{base}...{head}","merges_url":"https://api.github.com/repos/europeana/europeana-portal-collections/merges","archive_url":"https://api.github.com/repos/europeana/europeana-portal-collections/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/europeana/europeana-portal-collections/downloads","issues_url":"https://api.github.com/repos/europeana/europeana-portal-collections/issues{/number}","pulls_url":"https://api.github.com/repos/europeana/europeana-portal-collections/pulls{/number}","milestones_url":"https://api.github.com/repos/europeana/europeana-portal-collections/milestones{/number}","notifications_url":"https://api.github.com/repos/europeana/europeana-portal-collections/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/europeana/europeana-portal-collections/labels{/name}","releases_url":"https://api.github.com/repos/europeana/europeana-portal-collections/releases{/id}","deployments_url":"https://api.github.com/repos/europeana/europeana-portal-collections/deployments","created_at":"2014-11-26T10:14:22Z","updated_at":"2017-06-01T08:44:31Z","pushed_at":"2017-10-09T08:54:27Z","git_url":"git://github.com/europeana/europeana-portal-collections.git","ssh_url":"git@github.com:europeana/europeana-portal-collections.git","clone_url":"https://github.com/europeana/europeana-portal-collections.git","svn_url":"https://github.com/europeana/europeana-portal-collections","homepage":"http://www.europeana.eu/portal","size":4838,"stargazers_count":14,"watchers_count":14,"language":"Ruby","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":5,"mirror_url":null,"open_issues_count":4,"forks":5,"open_issues":4,"watchers":14,"default_branch":"develop"}},"base":{"label":"europeana:develop","ref":"develop","sha":"c55b47bad36ca44508c3d61b9f1d8d43b767e0af","user":{"login":"europeana","id":4570681,"avatar_url":"https://avatars3.githubusercontent.com/u/4570681?v=4","gravatar_id":"","url":"https://api.github.com/users/europeana","html_url":"https://github.com/europeana","followers_url":"https://api.github.com/users/europeana/followers","following_url":"https://api.github.com/users/europeana/following{/other_user}","gists_url":"https://api.github.com/users/europeana/gists{/gist_id}","starred_url":"https://api.github.com/users/europeana/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/europeana/subscriptions","organizations_url":"https://api.github.com/users/europeana/orgs","repos_url":"https://api.github.com/users/europeana/repos","events_url":"https://api.github.com/users/europeana/events{/privacy}","received_events_url":"https://api.github.com/users/europeana/received_events","type":"Organization","site_admin":false},"repo":{"id":27171162,"name":"europeana-portal-collections","full_name":"europeana/europeana-portal-collections","owner":{"login":"europeana","id":4570681,"avatar_url":"https://avatars3.githubusercontent.com/u/4570681?v=4","gravatar_id":"","url":"https://api.github.com/users/europeana","html_url":"https://github.com/europeana","followers_url":"https://api.github.com/users/europeana/followers","following_url":"https://api.github.com/users/europeana/following{/other_user}","gists_url":"https://api.github.com/users/europeana/gists{/gist_id}","starred_url":"https://api.github.com/users/europeana/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/europeana/subscriptions","organizations_url":"https://api.github.com/users/europeana/orgs","repos_url":"https://api.github.com/users/europeana/repos","events_url":"https://api.github.com/users/europeana/events{/privacy}","received_events_url":"https://api.github.com/users/europeana/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/europeana/europeana-portal-collections","description":"Europeana Collections portal as a Rails + Blacklight application.","fork":false,"url":"https://api.github.com/repos/europeana/europeana-portal-collections","forks_url":"https://api.github.com/repos/europeana/europeana-portal-collections/forks","keys_url":"https://api.github.com/repos/europeana/europeana-portal-collections/keys{/key_id}","collaborators_url":"https://api.github.com/repos/europeana/europeana-portal-collections/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/europeana/europeana-portal-collections/teams","hooks_url":"https://api.github.com/repos/europeana/europeana-portal-collections/hooks","issue_events_url":"https://api.github.com/repos/europeana/europeana-portal-collections/issues/events{/number}","events_url":"https://api.github.com/repos/europeana/europeana-portal-collections/events","assignees_url":"https://api.github.com/repos/europeana/europeana-portal-collections/assignees{/user}","branches_url":"https://api.github.com/repos/europeana/europeana-portal-collections/branches{/branch}","tags_url":"https://api.github.com/repos/europeana/europeana-portal-collections/tags","blobs_url":"https://api.github.com/repos/europeana/europeana-portal-collections/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/europeana/europeana-portal-collections/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/europeana/europeana-portal-collections/git/refs{/sha}","trees_url":"https://api.github.com/repos/europeana/europeana-portal-collections/git/trees{/sha}","statuses_url":"https://api.github.com/repos/europeana/europeana-portal-collections/statuses/{sha}","languages_url":"https://api.github.com/repos/europeana/europeana-portal-collections/languages","stargazers_url":"https://api.github.com/repos/europeana/europeana-portal-collections/stargazers","contributors_url":"https://api.github.com/repos/europeana/europeana-portal-collections/contributors","subscribers_url":"https://api.github.com/repos/europeana/europeana-portal-collections/subscribers","subscription_url":"https://api.github.com/repos/europeana/europeana-portal-collections/subscription","commits_url":"https://api.github.com/repos/europeana/europeana-portal-collections/commits{/sha}","git_commits_url":"https://api.github.com/repos/europeana/europeana-portal-collections/git/commits{/sha}","comments_url":"https://api.github.com/repos/europeana/europeana-portal-collections/comments{/number}","issue_comment_url":"https://api.github.com/repos/europeana/europeana-portal-collections/issues/comments{/number}","contents_url":"https://api.github.com/repos/europeana/europeana-portal-collections/contents/{+path}","compare_url":"https://api.github.com/repos/europeana/europeana-portal-collections/compare/{base}...{head}","merges_url":"https://api.github.com/repos/europeana/europeana-portal-collections/merges","archive_url":"https://api.github.com/repos/europeana/europeana-portal-collections/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/europeana/europeana-portal-collections/downloads","issues_url":"https://api.github.com/repos/europeana/europeana-portal-collections/issues{/number}","pulls_url":"https://api.github.com/repos/europeana/europeana-portal-collections/pulls{/number}","milestones_url":"https://api.github.com/repos/europeana/europeana-portal-collections/milestones{/number}","notifications_url":"https://api.github.com/repos/europeana/europeana-portal-collections/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/europeana/europeana-portal-collections/labels{/name}","releases_url":"https://api.github.com/repos/europeana/europeana-portal-collections/releases{/id}","deployments_url":"https://api.github.com/repos/europeana/europeana-portal-collections/deployments","created_at":"2014-11-26T10:14:22Z","updated_at":"2017-06-01T08:44:31Z","pushed_at":"2017-10-09T08:54:27Z","git_url":"git://github.com/europeana/europeana-portal-collections.git","ssh_url":"git@github.com:europeana/europeana-portal-collections.git","clone_url":"https://github.com/europeana/europeana-portal-collections.git","svn_url":"https://github.com/europeana/europeana-portal-collections","homepage":"http://www.europeana.eu/portal","size":4838,"stargazers_count":14,"watchers_count":14,"language":"Ruby","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":5,"mirror_url":null,"open_issues_count":4,"forks":5,"open_issues":4,"watchers":14,"default_branch":"develop"}},"_links":{"self":{"href":"https://api.github.com/repos/europeana/europeana-portal-collections/pulls/997"},"html":{"href":"https://github.com/europeana/europeana-portal-collections/pull/997"},"issue":{"href":"https://api.github.com/repos/europeana/europeana-portal-collections/issues/997"},"comments":{"href":"https://api.github.com/repos/europeana/europeana-portal-collections/issues/997/comments"},"review_comments":{"href":"https://api.github.com/repos/europeana/europeana-portal-collections/pulls/997/comments"},"review_comment":{"href":"https://api.github.com/repos/europeana/europeana-portal-collections/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/europeana/europeana-portal-collections/pulls/997/commits"},"statuses":{"href":"https://api.github.com/repos/europeana/europeana-portal-collections/statuses/32aa2e46c4e9d8a4b76a387c385c31a14de3c9df"}},"author_association":"CONTRIBUTOR"}}
{"actor":{"display_login":"lbiedinger"}}