From 745a96786706e29bac48c909b344722be90977e7 Mon Sep 17 00:00:00 2001 From: kjgarza Date: Fri, 3 Jan 2020 12:32:47 +0100 Subject: [PATCH] published facet --- app/controllers/dois_controller.rb | 2 ++ app/graphql/types/person_type.rb | 7 +++---- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/app/controllers/dois_controller.rb b/app/controllers/dois_controller.rb index 082d645f6..d11b2560a 100644 --- a/app/controllers/dois_controller.rb +++ b/app/controllers/dois_controller.rb @@ -140,6 +140,7 @@ def index else states = total > 0 ? facet_by_key(response.aggregations.states.buckets) : nil resource_types = total > 0 ? facet_by_resource_type(response.aggregations.resource_types.buckets) : nil + years = total > 0 ? facet_by_year(response.aggregations.years.buckets) : nil created = total > 0 ? facet_by_year(response.aggregations.created.buckets) : nil registered = total > 0 ? facet_by_year(response.aggregations.registered.buckets) : nil providers = total > 0 ? facet_by_provider(response.aggregations.providers.buckets) : nil @@ -167,6 +168,7 @@ def index states: states, "resourceTypes" => resource_types, created: created, + published: years, registered: registered, providers: providers, clients: clients, diff --git a/app/graphql/types/person_type.rb b/app/graphql/types/person_type.rb index 5cdc7d728..86fccc0c4 100644 --- a/app/graphql/types/person_type.rb +++ b/app/graphql/types/person_type.rb @@ -8,6 +8,9 @@ class PersonType < BaseObject field :name, String, null: true, description: "The name of the person." field :given_name, String, null: true, hash_key: "given_names", description: "Given name. In the U.S., the first name of a Person." field :family_name, String, null: true, description: "Family name. In the U.S., the last name of an Person." + field :view_count, Integer, null: true, description: "The count of DOI views according to the COUNTER code of Practice" + field :download_count, Integer, null: true, description: "The count of DOI dowloands according to the COUNTER code of Practice" + field :citation_count, Integer, null: true, description: "The count of DOI events that represents citations" field :datasets, PersonDatasetConnectionWithMetaType, null: true, description: "Authored datasets", connection: true do argument :first, Int, required: false, default_value: 25 @@ -21,10 +24,6 @@ class PersonType < BaseObject argument :first, Int, required: false, default_value: 25 end - field :view_count, Integer, null: true, description: "The count of DOI views according to the COUNTER code of Practice" - field :download_count, Integer, null: true, description: "The count of DOI dowloands according to the COUNTER code of Practice" - field :citation_count, Integer, null: true, description: "The count of DOI events that represents citations" - def type "Person" end