Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

GQL-85: Cannot view collection metadata C1000000321-SEDAC in MMT "All Collections" #141

Closed
wants to merge 2 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/cmr/concepts/collection.js
Original file line number Diff line number Diff line change
Expand Up @@ -332,7 +332,7 @@ export default class Collection extends Concept {
* @param {Object} item The item returned from the CMR umm endpoint
*/
normalizeUmmItem(item) {
const { umm } = item
const { umm = {} } = item

const { ArchiveAndDistributionInformation: archiveAndDistributionInformation = {} } = umm

Expand Down
6 changes: 6 additions & 0 deletions src/resolvers/collection.js
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,13 @@ export default {
)
}
},
CollectionRevisionListItem: {
__resolveType: (source) => {
const { deleted } = source

return deleted ? 'TombstonedCollectionMetadata' : 'Collection'
}
},
Collection: {
revisions: async (source, args, context, info) => {
const { dataSources } = context
Expand Down
36 changes: 35 additions & 1 deletion src/types/collection.graphql
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,9 @@ type Collection {
"The Data Maturity element is used to inform users on where the collection is in a collection's life cycle."
dataMaturity: String

"True if revision has been deleted"
deleted: Boolean

"This element allows end users to get direct access to data products that are stored in the Amazon Web Service (AWS) S3 buckets. The sub elements include S3 credentials end point and a documentation URL as well as bucket prefix names and an AWS region."
directDistributionInformation: JSON

Expand Down Expand Up @@ -524,12 +527,43 @@ type GraphDbPlatformInstrument implements Relationship {
instrument: String
}

type TombstonedCollectionMetadata {
"The concept id of the draft."
conceptId: String!

"The concept type of the draft."
conceptType: String

"True if revision has been deleted"
deleted: Boolean

"The data format of the collection"
format: String

"The native id of the draft."
nativeId: String

"Provider ID of the draft."
providerId: String

"The revision id of the draft."
revisionId: String

"Date which the draft was last updated."
revisionDate: String

"Id of the user who modified/published record"
userId: String
}

union CollectionRevisionListItem = Collection | TombstonedCollectionMetadata

type CollectionRevisionList {
"The number of hits for a given search."
count: Int

"The list of collection search results."
items: [Collection]
items: [CollectionRevisionListItem]
}

type CollectionList {
Expand Down
3 changes: 3 additions & 0 deletions src/types/service.graphql
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,9 @@ type Service {
"This is the contact persons of the service."
contactPersons: JSON

"True if revision has been deleted"
deleted: Boolean

"A brief description of the service."
description: String

Expand Down
3 changes: 3 additions & 0 deletions src/types/tool.graphql
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,9 @@ type Tool {
"This is the contact persons of the downloadable tool or web user interface."
contactPersons: JSON

"True if revision has been deleted"
deleted: Boolean

"A brief description of the web user interface or downloadable tool. Note: This field allows lightweight markup language with plain text formatting syntax. Line breaks within the text are preserved."
description: String

Expand Down
3 changes: 3 additions & 0 deletions src/types/variable.graphql
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,9 @@ type Variable {
"The definition of the variable."
definition: String

"True if revision has been deleted"
deleted: Boolean

"A variable consists of one or more dimensions. An example of a dimension name is 'XDim'. An example of a dimension size is '1200'. Variables are rarely one dimensional."
dimensions: JSON

Expand Down
1 change: 1 addition & 0 deletions src/utils/umm/collectionKeyMap.json
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@
"dataDates": "umm.DataDates",
"dataLanguage": "umm.DataLanguage",
"dataMaturity": "umm.DataMaturity",
"deleted": "meta.deleted",
"directDistributionInformation": "umm.DirectDistributionInformation",
"directoryNames": "umm.DirectoryNames",
"doi": "umm.DOI",
Expand Down
1 change: 1 addition & 0 deletions src/utils/umm/serviceKeyMap.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
"conceptId": "meta.concept-id",
"contactGroups": "umm.ContactGroups",
"contactPersons": "umm.ContactPersons",
"deleted": "meta.deleted",
"description": "umm.Description",
"lastUpdatedDate": "umm.LastUpdatedDate",
"longName": "umm.LongName",
Expand Down
1 change: 1 addition & 0 deletions src/utils/umm/toolKeyMap.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
"conceptId": "meta.concept-id",
"contactGroups": "umm.ContactGroups",
"contactPersons": "umm.ContactPersons",
"deleted": "meta.deleted",
"description": "umm.Description",
"doi": "umm.DOI",
"lastUpdatedDate": "umm.LastUpdatedDate",
Expand Down
1 change: 1 addition & 0 deletions src/utils/umm/variableKeyMap.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
"conceptId": "meta.concept-id",
"dataType": "umm.DataType",
"definition": "umm.Definition",
"deleted": "meta.deleted",
"dimensions": "umm.Dimensions",
"fillValues": "umm.FillValues",
"indexRanges": "umm.IndexRanges",
Expand Down
Loading