From df92c6c694d0038355d707ddceeea1894199fc3e Mon Sep 17 00:00:00 2001 From: Brandon Corbett Date: Mon, 8 Jan 2024 11:58:19 -0500 Subject: [PATCH 01/15] EDSC-3951: Update GraphQL queries to use new `params` parameter objects --- static/src/js/actions/exportSearch.js | 74 +--------------------- static/src/js/actions/focusedCollection.js | 24 ++++--- static/src/js/actions/focusedGranule.js | 4 +- static/src/js/actions/project.js | 31 ++++----- 4 files changed, 27 insertions(+), 106 deletions(-) diff --git a/static/src/js/actions/exportSearch.js b/static/src/js/actions/exportSearch.js index 856f93905a..d47d5469c6 100644 --- a/static/src/js/actions/exportSearch.js +++ b/static/src/js/actions/exportSearch.js @@ -132,78 +132,8 @@ export const exportSearchAsStac = (format) => (dispatch, getState) => { const graphQlRequestObject = new ExportSearchRequest(authToken, earthdataEnvironment) const graphQuery = ` - query SearchCollections( - $boundingBox: [String] - $circle: [String] - $cloudHosted: Boolean - $collectionDataType: [String] - $dataCenter: String - $dataCenterH: [String] - $facetsSize: Int - $granuleDataFormat: String - $granuleDataFormatH: [String] - $hasGranulesOrCwic: Boolean - $horizontalDataResolutionRange: [String] - $instrument: String - $instrumentH: [String] - $keyword: String - $line: [String] - $offset: Int - $options: JSON - $platform: String - $platformH: [String] - $point: [String] - $polygon: [String] - $processingLevelIdH: [String] - $project: String - $projectH: [String] - $provider: String - $scienceKeywordsH: JSON - $serviceType: [String] - $sortKey: [String] - $spatialKeyword: String - $tagKey: [String] - $temporal: String - $twoDCoordinateSystemName: [String] - $limit: Int - $cursor: String - ) { - collections ( - boundingBox: $boundingBox - circle: $circle - cloudHosted: $cloudHosted - collectionDataType: $collectionDataType - dataCenter: $dataCenter - dataCenterH: $dataCenterH - facetsSize: $facetsSize - granuleDataFormat: $granuleDataFormat - granuleDataFormatH: $granuleDataFormatH - hasGranulesOrCwic: $hasGranulesOrCwic - horizontalDataResolutionRange: $horizontalDataResolutionRange - instrument: $instrument - instrumentH: $instrumentH - keyword: $keyword - line: $line - offset: $offset - options: $options - platform: $platform - platformH: $platformH - point: $point - polygon: $polygon - processingLevelIdH: $processingLevelIdH - project: $project - projectH: $projectH - provider: $provider - scienceKeywordsH: $scienceKeywordsH - serviceType: $serviceType - sortKey: $sortKey - spatialKeyword: $spatialKeyword - tagKey: $tagKey - temporal: $temporal - twoDCoordinateSystemName: $twoDCoordinateSystemName - limit: $limit, - cursor: $cursor - ) { + query SearchCollections($params: CollectionsInput) { + collections (params: $params) { cursor items { provider diff --git a/static/src/js/actions/focusedCollection.js b/static/src/js/actions/focusedCollection.js index 8181732ea9..5bdd8b625c 100644 --- a/static/src/js/actions/focusedCollection.js +++ b/static/src/js/actions/focusedCollection.js @@ -82,15 +82,9 @@ export const getFocusedCollection = () => async (dispatch, getState) => { const graphQuery = ` query GetCollection( - $id: String! - $includeHasGranules: Boolean - $includeTags: String - $subscriberId: String + $params: CollectionInput, $subcriptionParams: SubscriptionsInput ) { - collection ( - conceptId: $id - includeHasGranules: $includeHasGranules - includeTags: $includeTags + collection (params: $params ) { abstract archiveAndDistributionInformation @@ -153,7 +147,7 @@ export const getFocusedCollection = () => async (dispatch, getState) => { } } subscriptions ( - subscriberId: $subscriberId + params: $subcriptionParams ) { count items { @@ -189,10 +183,14 @@ export const getFocusedCollection = () => async (dispatch, getState) => { }` const response = graphQlRequestObject.search(graphQuery, { - id: focusedCollectionId, - includeHasGranules: true, - includeTags: defaultCmrSearchTags.join(','), - subscriberId: username + params: { + id: focusedCollectionId, + includeHasGranules: true, + includeTags: defaultCmrSearchTags.join(',') + }, + subcriptionParams: { + subscriberId: username + } }) .then((responseObject) => { const payload = [] diff --git a/static/src/js/actions/focusedGranule.js b/static/src/js/actions/focusedGranule.js index 0521d87bd3..48ff34e295 100644 --- a/static/src/js/actions/focusedGranule.js +++ b/static/src/js/actions/focusedGranule.js @@ -51,10 +51,10 @@ export const getFocusedGranule = () => (dispatch, getState) => { const graphQuery = ` query GetGranule( - $id: String! + $params: GranuleInput ) { granule( - conceptId: $id + params: $params ) { granuleUr granuleSize diff --git a/static/src/js/actions/project.js b/static/src/js/actions/project.js index f92a4538bd..b27a87d49c 100644 --- a/static/src/js/actions/project.js +++ b/static/src/js/actions/project.js @@ -205,25 +205,15 @@ export const getProjectCollections = () => async (dispatch, getState) => { const searchParams = buildCollectionSearchParams(collectionParams) const { - includeGranuleCounts, includeHasGranules } = searchParams const graphQlRequestObject = new GraphQlRequest(authToken, earthdataEnvironment) const graphQuery = ` - query GetProjectCollections ( - $ids: [String] - $includeHasGranules: Boolean - $includeTags: String - $pageSize: Int - $subscriberId: String - ) { + query GetProjectCollections ($params: CollectionsInput, $subcriptionParams: SubscriptionsInput) { collections ( - conceptId: $ids - includeHasGranules: $includeHasGranules - includeTags: $includeTags - limit: $pageSize + params: $params ) { items { abstract @@ -315,7 +305,7 @@ export const getProjectCollections = () => async (dispatch, getState) => { } } subscriptions ( - subscriberId: $subscriberId + params: $subcriptionParams ) { count items { @@ -350,12 +340,15 @@ export const getProjectCollections = () => async (dispatch, getState) => { }` const response = graphQlRequestObject.search(graphQuery, { - ids: filteredIds, - includeTags: defaultCmrSearchTags.join(','), - includeGranuleCounts, - includeHasGranules, - pageSize: filteredIds.length, - subscriberId: username + params: { + conceptId: filteredIds, + includeTags: defaultCmrSearchTags.join(','), + includeHasGranules, + pageSize: filteredIds.length + }, + subcriptionParams: { + subscriberId: username + } }) .then((responseObject) => { const payload = [] From 2ecf577a7b78eca0212c6bb16f3029eb21462d06 Mon Sep 17 00:00:00 2001 From: Brandon Corbett Date: Mon, 8 Jan 2024 12:04:48 -0500 Subject: [PATCH 02/15] Linting --- static/src/js/actions/focusedCollection.js | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/static/src/js/actions/focusedCollection.js b/static/src/js/actions/focusedCollection.js index 5bdd8b625c..d29362c71b 100644 --- a/static/src/js/actions/focusedCollection.js +++ b/static/src/js/actions/focusedCollection.js @@ -84,8 +84,7 @@ export const getFocusedCollection = () => async (dispatch, getState) => { query GetCollection( $params: CollectionInput, $subcriptionParams: SubscriptionsInput ) { - collection (params: $params - ) { + collection (params: $params) { abstract archiveAndDistributionInformation associatedDois From bfe864c326a2f34a4ef26c4b3aa8d52f82b454ac Mon Sep 17 00:00:00 2001 From: Brandon Corbett Date: Tue, 9 Jan 2024 14:55:48 -0500 Subject: [PATCH 03/15] Updated mock --- cypress/support/graphQlGetCollection.js | 2 +- cypress/support/graphQlGetCollections.js | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/cypress/support/graphQlGetCollection.js b/cypress/support/graphQlGetCollection.js index 4dd2d7d26f..23e12bb3fd 100644 --- a/cypress/support/graphQlGetCollection.js +++ b/cypress/support/graphQlGetCollection.js @@ -2,4 +2,4 @@ * Return the GraphQl query for verifying the request is what we expect inside of cy.intercept * @param {String} conceptId conceptId to retrieve */ -export const graphQlGetCollection = (conceptId) => `{"query":"\\n query GetCollection(\\n $id: String!\\n $includeHasGranules: Boolean\\n $includeTags: String\\n $subscriberId: String\\n ) {\\n collection (\\n conceptId: $id\\n includeHasGranules: $includeHasGranules\\n includeTags: $includeTags\\n ) {\\n abstract\\n archiveAndDistributionInformation\\n associatedDois\\n boxes\\n cloudHosted\\n conceptId\\n coordinateSystem\\n dataCenter\\n dataCenters\\n directDistributionInformation\\n doi\\n duplicateCollections {\\n count\\n items {\\n id\\n }\\n }\\n hasGranules\\n lines\\n nativeDataFormats\\n points\\n polygons\\n relatedUrls\\n relatedCollections (\\n limit: 3\\n ) {\\n count\\n items {\\n id\\n title\\n }\\n }\\n scienceKeywords\\n shortName\\n spatialExtent\\n tags\\n temporalExtents\\n tilingIdentificationSystems\\n title\\n versionId\\n services {\\n count\\n items {\\n conceptId\\n longName\\n name\\n type\\n url\\n serviceOptions\\n supportedOutputProjections\\n supportedReformattings\\n }\\n }\\n granules {\\n count\\n items {\\n conceptId\\n onlineAccessFlag\\n }\\n }\\n subscriptions (\\n subscriberId: $subscriberId\\n ) {\\n count\\n items {\\n collectionConceptId\\n conceptId\\n name\\n nativeId\\n query\\n type\\n }\\n }\\n tools {\\n count\\n items {\\n longName\\n name\\n potentialAction\\n }\\n }\\n variables {\\n count\\n items {\\n conceptId\\n definition\\n instanceInformation\\n longName\\n name\\n nativeId\\n scienceKeywords\\n }\\n }\\n }\\n }","variables":{"id":"${conceptId}","includeHasGranules":true,"includeTags":"edsc.*,opensearch.granule.osdd"}}` +export const graphQlGetCollection = (conceptId) => `{"query":"\\n query GetCollection(\\n $params: CollectionInput, $subcriptionParams: SubscriptionsInput\\n ) {\\n collection (params: $params) {\\n abstract\\n archiveAndDistributionInformation\\n associatedDois\\n boxes\\n cloudHosted\\n conceptId\\n coordinateSystem\\n dataCenter\\n dataCenters\\n directDistributionInformation\\n doi\\n duplicateCollections {\\n count\\n items {\\n id\\n }\\n }\\n hasGranules\\n lines\\n nativeDataFormats\\n points\\n polygons\\n relatedUrls\\n relatedCollections (\\n limit: 3\\n ) {\\n count\\n items {\\n id\\n title\\n }\\n }\\n scienceKeywords\\n shortName\\n spatialExtent\\n tags\\n temporalExtents\\n tilingIdentificationSystems\\n title\\n versionId\\n services {\\n count\\n items {\\n conceptId\\n longName\\n name\\n type\\n url\\n serviceOptions\\n supportedOutputProjections\\n supportedReformattings\\n }\\n }\\n granules {\\n count\\n items {\\n conceptId\\n onlineAccessFlag\\n }\\n }\\n subscriptions (\\n params: $subcriptionParams\\n ) {\\n count\\n items {\\n collectionConceptId\\n conceptId\\n name\\n nativeId\\n query\\n type\\n }\\n }\\n tools {\\n count\\n items {\\n longName\\n name\\n potentialAction\\n }\\n }\\n variables {\\n count\\n items {\\n conceptId\\n definition\\n instanceInformation\\n longName\\n name\\n nativeId\\n scienceKeywords\\n }\\n }\\n }\\n }","variables":{"params":{"id":"${conceptId}","includeHasGranules":true,"includeTags":"edsc.*,opensearch.granule.osdd"},"subcriptionParams":{}}}` \ No newline at end of file diff --git a/cypress/support/graphQlGetCollections.js b/cypress/support/graphQlGetCollections.js index 86e5cdb186..188842b4e4 100644 --- a/cypress/support/graphQlGetCollections.js +++ b/cypress/support/graphQlGetCollections.js @@ -2,4 +2,4 @@ * Return the GraphQl query for verifying the request is what we expect inside of cy.intercept * @param {String} conceptId conceptId to retrieve */ -export const graphQlGetCollections = (conceptId) => `{"query":"\\n query GetProjectCollections (\\n $ids: [String]\\n $includeHasGranules: Boolean\\n $includeTags: String\\n $pageSize: Int\\n $subscriberId: String\\n ) {\\n collections (\\n conceptId: $ids\\n includeHasGranules: $includeHasGranules\\n includeTags: $includeTags\\n limit: $pageSize\\n ) {\\n items {\\n abstract\\n archiveAndDistributionInformation\\n associatedDois\\n boxes\\n cloudHosted\\n conceptId\\n coordinateSystem\\n dataCenter\\n dataCenters\\n dataQualitySummaries {\\n count\\n items {\\n id\\n summary\\n }\\n }\\n directDistributionInformation\\n doi\\n duplicateCollections {\\n count\\n items {\\n id\\n }\\n }\\n hasGranules\\n lines\\n points\\n polygons\\n relatedCollections (\\n limit: 3\\n ) {\\n count\\n items {\\n id\\n title\\n }\\n }\\n relatedUrls\\n scienceKeywords\\n shortName\\n spatialExtent\\n tags\\n temporalExtents\\n tilingIdentificationSystems\\n title\\n versionId\\n services {\\n count\\n items {\\n conceptId\\n longName\\n name\\n type\\n url\\n serviceOptions\\n supportedOutputProjections\\n supportedReformattings\\n maxItemsPerOrder\\n orderOptions {\\n count\\n items {\\n conceptId\\n name\\n form\\n }\\n }\\n variables {\\n count\\n items {\\n conceptId\\n definition\\n longName\\n name\\n nativeId\\n scienceKeywords\\n }\\n }\\n }\\n }\\n granules {\\n count\\n items {\\n browseFlag\\n conceptId\\n onlineAccessFlag\\n links\\n }\\n }\\n subscriptions (\\n subscriberId: $subscriberId\\n ) {\\n count\\n items {\\n collectionConceptId\\n conceptId\\n name\\n query\\n }\\n }\\n tools {\\n count\\n items {\\n longName\\n name\\n potentialAction\\n }\\n }\\n variables {\\n count\\n items {\\n conceptId\\n definition\\n instanceInformation\\n longName\\n name\\n nativeId\\n scienceKeywords\\n }\\n }\\n }\\n }\\n }","variables":{"ids":["${conceptId}"],"includeTags":"edsc.*,opensearch.granule.osdd","includeGranuleCounts":true,"includeHasGranules":true,"pageSize":1}}` +export const graphQlGetCollections = (conceptId) => `{"query":"\\n query GetProjectCollections (\\n $ids: [String]\\n $includeHasGranules: Boolean\\n $includeTags: String\\n $pageSize: Int\\n $subscriberId: String\\n ) {\\n collections (\\n conceptId: $ids\\n includeHasGranules: $includeHasGranules\\n includeTags: $includeTags\\n limit: $pageSize\\n ) {\\n items {\\n abstract\\n archiveAndDistributionInformation\\n associatedDois\\n boxes\\n cloudHosted\\n conceptId\\n coordinateSystem\\n dataCenter\\n dataCenters\\n dataQualitySummaries {\\n count\\n items {\\n id\\n summary\\n }\\n }\\n directDistributionInformation\\n doi\\n duplicateCollections {\\n count\\n items {\\n id\\n }\\n }\\n hasGranules\\n lines\\n points\\n polygons\\n relatedCollections (\\n limit: 3\\n ) {\\n count\\n items {\\n id\\n title\\n }\\n }\\n relatedUrls\\n scienceKeywords\\n shortName\\n spatialExtent\\n tags\\n temporalExtents\\n tilingIdentificationSystems\\n title\\n versionId\\n services {\\n count\\n items {\\n conceptId\\n longName\\n name\\n type\\n url\\n serviceOptions\\n supportedOutputProjections\\n supportedReformattings\\n maxItemsPerOrder\\n orderOptions {\\n count\\n items {\\n conceptId\\n name\\n form\\n }\\n }\\n variables {\\n count\\n items {\\n conceptId\\n definition\\n longName\\n name\\n nativeId\\n scienceKeywords\\n }\\n }\\n }\\n }\\n granules {\\n count\\n items {\\n browseFlag\\n conceptId\\n onlineAccessFlag\\n links\\n }\\n }\\n subscriptions (\\n subscriberId: $subscriberId\\n ) {\\n count\\n items {\\n collectionConceptId\\n conceptId\\n name\\n query\\n }\\n }\\n tools {\\n count\\n items {\\n longName\\n name\\n potentialAction\\n }\\n }\\n variables {\\n count\\n items {\\n conceptId\\n definition\\n instanceInformation\\n longName\\n name\\n nativeId\\n scienceKeywords\\n }\\n }\\n }\\n }\\n }","variables":{"ids":["${conceptId}"],"includeTags":"edsc.*,opensearch.granule.osdd","includeHasGranules":true,"pageSize":1}}` From a7e127fca58e6b6d9e6e46c6d817267623ca42f2 Mon Sep 17 00:00:00 2001 From: Brandon Corbett Date: Tue, 9 Jan 2024 15:55:36 -0500 Subject: [PATCH 04/15] linting --- cypress/support/graphQlGetCollection.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cypress/support/graphQlGetCollection.js b/cypress/support/graphQlGetCollection.js index 23e12bb3fd..1996cb65ac 100644 --- a/cypress/support/graphQlGetCollection.js +++ b/cypress/support/graphQlGetCollection.js @@ -2,4 +2,4 @@ * Return the GraphQl query for verifying the request is what we expect inside of cy.intercept * @param {String} conceptId conceptId to retrieve */ -export const graphQlGetCollection = (conceptId) => `{"query":"\\n query GetCollection(\\n $params: CollectionInput, $subcriptionParams: SubscriptionsInput\\n ) {\\n collection (params: $params) {\\n abstract\\n archiveAndDistributionInformation\\n associatedDois\\n boxes\\n cloudHosted\\n conceptId\\n coordinateSystem\\n dataCenter\\n dataCenters\\n directDistributionInformation\\n doi\\n duplicateCollections {\\n count\\n items {\\n id\\n }\\n }\\n hasGranules\\n lines\\n nativeDataFormats\\n points\\n polygons\\n relatedUrls\\n relatedCollections (\\n limit: 3\\n ) {\\n count\\n items {\\n id\\n title\\n }\\n }\\n scienceKeywords\\n shortName\\n spatialExtent\\n tags\\n temporalExtents\\n tilingIdentificationSystems\\n title\\n versionId\\n services {\\n count\\n items {\\n conceptId\\n longName\\n name\\n type\\n url\\n serviceOptions\\n supportedOutputProjections\\n supportedReformattings\\n }\\n }\\n granules {\\n count\\n items {\\n conceptId\\n onlineAccessFlag\\n }\\n }\\n subscriptions (\\n params: $subcriptionParams\\n ) {\\n count\\n items {\\n collectionConceptId\\n conceptId\\n name\\n nativeId\\n query\\n type\\n }\\n }\\n tools {\\n count\\n items {\\n longName\\n name\\n potentialAction\\n }\\n }\\n variables {\\n count\\n items {\\n conceptId\\n definition\\n instanceInformation\\n longName\\n name\\n nativeId\\n scienceKeywords\\n }\\n }\\n }\\n }","variables":{"params":{"id":"${conceptId}","includeHasGranules":true,"includeTags":"edsc.*,opensearch.granule.osdd"},"subcriptionParams":{}}}` \ No newline at end of file +export const graphQlGetCollection = (conceptId) => `{"query":"\\n query GetCollection(\\n $params: CollectionInput, $subcriptionParams: SubscriptionsInput\\n ) {\\n collection (params: $params) {\\n abstract\\n archiveAndDistributionInformation\\n associatedDois\\n boxes\\n cloudHosted\\n conceptId\\n coordinateSystem\\n dataCenter\\n dataCenters\\n directDistributionInformation\\n doi\\n duplicateCollections {\\n count\\n items {\\n id\\n }\\n }\\n hasGranules\\n lines\\n nativeDataFormats\\n points\\n polygons\\n relatedUrls\\n relatedCollections (\\n limit: 3\\n ) {\\n count\\n items {\\n id\\n title\\n }\\n }\\n scienceKeywords\\n shortName\\n spatialExtent\\n tags\\n temporalExtents\\n tilingIdentificationSystems\\n title\\n versionId\\n services {\\n count\\n items {\\n conceptId\\n longName\\n name\\n type\\n url\\n serviceOptions\\n supportedOutputProjections\\n supportedReformattings\\n }\\n }\\n granules {\\n count\\n items {\\n conceptId\\n onlineAccessFlag\\n }\\n }\\n subscriptions (\\n params: $subcriptionParams\\n ) {\\n count\\n items {\\n collectionConceptId\\n conceptId\\n name\\n nativeId\\n query\\n type\\n }\\n }\\n tools {\\n count\\n items {\\n longName\\n name\\n potentialAction\\n }\\n }\\n variables {\\n count\\n items {\\n conceptId\\n definition\\n instanceInformation\\n longName\\n name\\n nativeId\\n scienceKeywords\\n }\\n }\\n }\\n }","variables":{"params":{"id":"${conceptId}","includeHasGranules":true,"includeTags":"edsc.*,opensearch.granule.osdd"},"subcriptionParams":{}}}` From 472c5fbd114ca63650d1df6b7d82479ed477560e Mon Sep 17 00:00:00 2001 From: Brandon Corbett Date: Tue, 16 Jan 2024 15:32:40 -0500 Subject: [PATCH 05/15] Updates for unit tests --- .../granule_details/granule_details.cy.js | 2 +- .../e2e/paths/search/granules/granules.cy.js | 2 +- .../src/retrieveGranuleLinks/fetchCmrLinks.js | 54 +------------------ tests/e2e/map/map.spec.js | 2 +- tests/support/graphQlGetCollection.js | 2 +- 5 files changed, 6 insertions(+), 56 deletions(-) diff --git a/cypress/e2e/paths/search/granules/granule_details/granule_details.cy.js b/cypress/e2e/paths/search/granules/granule_details/granule_details.cy.js index c50bc2c958..0fdb4cc67d 100644 --- a/cypress/e2e/paths/search/granules/granule_details/granule_details.cy.js +++ b/cypress/e2e/paths/search/granules/granule_details/granule_details.cy.js @@ -68,7 +68,7 @@ describe('Path /search/granules/granule-details', () => { }) } - if (JSON.stringify(req.body) === '{"query":"\\n query GetGranule(\\n $id: String!\\n ) {\\n granule(\\n conceptId: $id\\n ) {\\n granuleUr\\n granuleSize\\n title\\n onlineAccessFlag\\n dayNightFlag\\n timeStart\\n timeEnd\\n dataCenter\\n originalFormat\\n conceptId\\n collectionConceptId\\n spatialExtent\\n temporalExtent\\n relatedUrls\\n dataGranule\\n measuredParameters\\n providerDates\\n }\\n }","variables":{"id":"G1287941210-ASF"}}') { + if (JSON.stringify(req.body) === '{"query":"\\n query GetGranule(\\n $params: GranuleInput\\n ) {\\n granule(\\n params: $params\\n ) {\\n granuleUr\\n granuleSize\\n title\\n onlineAccessFlag\\n dayNightFlag\\n timeStart\\n timeEnd\\n dataCenter\\n originalFormat\\n conceptId\\n collectionConceptId\\n spatialExtent\\n temporalExtent\\n relatedUrls\\n dataGranule\\n measuredParameters\\n providerDates\\n }\\n }","variables":{"id":"G1287941210-ASF"}}') { req.alias = 'graphQlGranuleQuery' req.reply({ body: getGranuleGraphQlBody, diff --git a/cypress/e2e/paths/search/granules/granules.cy.js b/cypress/e2e/paths/search/granules/granules.cy.js index 92999d7d66..23e917b22f 100644 --- a/cypress/e2e/paths/search/granules/granules.cy.js +++ b/cypress/e2e/paths/search/granules/granules.cy.js @@ -1132,7 +1132,7 @@ describe('Path /search/granules', () => { }) } - if (JSON.stringify(req.body) === '{"query":"\\n query GetGranule(\\n $id: String!\\n ) {\\n granule(\\n conceptId: $id\\n ) {\\n granuleUr\\n granuleSize\\n title\\n onlineAccessFlag\\n dayNightFlag\\n timeStart\\n timeEnd\\n dataCenter\\n originalFormat\\n conceptId\\n collectionConceptId\\n spatialExtent\\n temporalExtent\\n relatedUrls\\n dataGranule\\n measuredParameters\\n providerDates\\n }\\n }","variables":{"id":"G2058417402-LPDAAC_ECS"}}') { + if (JSON.stringify(req.body) === '{"query":"\\n query GetGranule(\\n $params: GranulesInput\\n ) {\\n granule(\\n params: $params\\n ) {\\n granuleUr\\n granuleSize\\n title\\n onlineAccessFlag\\n dayNightFlag\\n timeStart\\n timeEnd\\n dataCenter\\n originalFormat\\n conceptId\\n collectionConceptId\\n spatialExtent\\n temporalExtent\\n relatedUrls\\n dataGranule\\n measuredParameters\\n providerDates\\n }\\n }","variables":{"id":"G2058417402-LPDAAC_ECS"}}') { req.alias = 'graphQlGranuleQuery' req.reply({ body: focusedGranuleGranuleGraphQlBody, diff --git a/serverless/src/retrieveGranuleLinks/fetchCmrLinks.js b/serverless/src/retrieveGranuleLinks/fetchCmrLinks.js index f8a00a6132..57401a016f 100644 --- a/serverless/src/retrieveGranuleLinks/fetchCmrLinks.js +++ b/serverless/src/retrieveGranuleLinks/fetchCmrLinks.js @@ -8,58 +8,8 @@ import { getS3Urls } from '../../../sharedUtils/getS3Urls' import { getBrowseUrls } from '../../../sharedUtils/getBrowseUrls' const granulesGraphQlQuery = ` - query GetGranuleLinks( - $boundingBox: [String] - $browseOnly: Boolean - $circle: [String] - $cloudCover: JSON - $collectionConceptId: String - $conceptId: [String] - $cursor: String - $dayNightFlag: String - $equatorCrossingDate: JSON - $equatorCrossingLongitude: JSON - $exclude: JSON - $limit: Int - $line: [String] - $linkTypes: [String] - $offset: Int - $onlineOnly: Boolean - $options: JSON - $orbitNumber: JSON - $point: [String] - $polygon: [String] - $readableGranuleName: [String] - $sortKey: [String] - $temporal: String - $twoDCoordinateSystem: JSON - ) { - granules( - boundingBox: $boundingBox - browseOnly: $browseOnly - circle: $circle - cloudCover: $cloudCover - collectionConceptId: $collectionConceptId - conceptId: $conceptId - cursor: $cursor - dayNightFlag: $dayNightFlag - equatorCrossingDate: $equatorCrossingDate - equatorCrossingLongitude: $equatorCrossingLongitude - exclude: $exclude - limit: $limit - line: $line - linkTypes: $linkTypes - offset: $offset - onlineOnly: $onlineOnly - options: $options - orbitNumber: $orbitNumber - point: $point - polygon: $polygon - readableGranuleName: $readableGranuleName - sortKey: $sortKey - temporal: $temporal - twoDCoordinateSystem: $twoDCoordinateSystem - ) { + query GetGranuleLinks( $params: GranulesInput ) { + granules( params: $params) { cursor items { links diff --git a/tests/e2e/map/map.spec.js b/tests/e2e/map/map.spec.js index d3cb1b60ac..de39fce12e 100644 --- a/tests/e2e/map/map.spec.js +++ b/tests/e2e/map/map.spec.js @@ -1443,7 +1443,7 @@ test.describe('Map interactions', () => { await page.route(/api$/, async (route) => { const query = route.request().postData() - expect(query).toEqual('{"query":"\\n query GetGranule(\\n $id: String!\\n ) {\\n granule(\\n conceptId: $id\\n ) {\\n granuleUr\\n granuleSize\\n title\\n onlineAccessFlag\\n dayNightFlag\\n timeStart\\n timeEnd\\n dataCenter\\n originalFormat\\n conceptId\\n collectionConceptId\\n spatialExtent\\n temporalExtent\\n relatedUrls\\n dataGranule\\n measuredParameters\\n providerDates\\n }\\n }","variables":{"id":"G2061166811-ASF"}}') + expect(query).toEqual('{"query":"\\n query GetGranule(\\n $params: GranuleInput\\n ) {\\n granule(\\n params: $params\\n ) {\\n granuleUr\\n granuleSize\\n title\\n onlineAccessFlag\\n dayNightFlag\\n timeStart\\n timeEnd\\n dataCenter\\n originalFormat\\n conceptId\\n collectionConceptId\\n spatialExtent\\n temporalExtent\\n relatedUrls\\n dataGranule\\n measuredParameters\\n providerDates\\n }\\n }","variables":{"id":"G2061166811-ASF"}}') await route.fulfill({ json: granuleGraphQlBody, diff --git a/tests/support/graphQlGetCollection.js b/tests/support/graphQlGetCollection.js index 4dd2d7d26f..98425af642 100644 --- a/tests/support/graphQlGetCollection.js +++ b/tests/support/graphQlGetCollection.js @@ -2,4 +2,4 @@ * Return the GraphQl query for verifying the request is what we expect inside of cy.intercept * @param {String} conceptId conceptId to retrieve */ -export const graphQlGetCollection = (conceptId) => `{"query":"\\n query GetCollection(\\n $id: String!\\n $includeHasGranules: Boolean\\n $includeTags: String\\n $subscriberId: String\\n ) {\\n collection (\\n conceptId: $id\\n includeHasGranules: $includeHasGranules\\n includeTags: $includeTags\\n ) {\\n abstract\\n archiveAndDistributionInformation\\n associatedDois\\n boxes\\n cloudHosted\\n conceptId\\n coordinateSystem\\n dataCenter\\n dataCenters\\n directDistributionInformation\\n doi\\n duplicateCollections {\\n count\\n items {\\n id\\n }\\n }\\n hasGranules\\n lines\\n nativeDataFormats\\n points\\n polygons\\n relatedUrls\\n relatedCollections (\\n limit: 3\\n ) {\\n count\\n items {\\n id\\n title\\n }\\n }\\n scienceKeywords\\n shortName\\n spatialExtent\\n tags\\n temporalExtents\\n tilingIdentificationSystems\\n title\\n versionId\\n services {\\n count\\n items {\\n conceptId\\n longName\\n name\\n type\\n url\\n serviceOptions\\n supportedOutputProjections\\n supportedReformattings\\n }\\n }\\n granules {\\n count\\n items {\\n conceptId\\n onlineAccessFlag\\n }\\n }\\n subscriptions (\\n subscriberId: $subscriberId\\n ) {\\n count\\n items {\\n collectionConceptId\\n conceptId\\n name\\n nativeId\\n query\\n type\\n }\\n }\\n tools {\\n count\\n items {\\n longName\\n name\\n potentialAction\\n }\\n }\\n variables {\\n count\\n items {\\n conceptId\\n definition\\n instanceInformation\\n longName\\n name\\n nativeId\\n scienceKeywords\\n }\\n }\\n }\\n }","variables":{"id":"${conceptId}","includeHasGranules":true,"includeTags":"edsc.*,opensearch.granule.osdd"}}` +export const graphQlGetCollection = (conceptId) => `{"query":"\\n query GetCollection(\\n $params: CollectionInput, $subcriptionParams: SubscriptionsInput\\n ) {\\n collection (params: $params) {\\n abstract\\n archiveAndDistributionInformation\\n associatedDois\\n boxes\\n cloudHosted\\n conceptId\\n coordinateSystem\\n dataCenter\\n dataCenters\\n directDistributionInformation\\n doi\\n duplicateCollections {\\n count\\n items {\\n id\\n }\\n }\\n hasGranules\\n lines\\n nativeDataFormats\\n points\\n polygons\\n relatedUrls\\n relatedCollections (\\n limit: 3\\n ) {\\n count\\n items {\\n id\\n title\\n }\\n }\\n scienceKeywords\\n shortName\\n spatialExtent\\n tags\\n temporalExtents\\n tilingIdentificationSystems\\n title\\n versionId\\n services {\\n count\\n items {\\n conceptId\\n longName\\n name\\n type\\n url\\n serviceOptions\\n supportedOutputProjections\\n supportedReformattings\\n }\\n }\\n granules {\\n count\\n items {\\n conceptId\\n onlineAccessFlag\\n }\\n }\\n subscriptions (\\n params: $subcriptionParams\\n ) {\\n count\\n items {\\n collectionConceptId\\n conceptId\\n name\\n nativeId\\n query\\n type\\n }\\n }\\n tools {\\n count\\n items {\\n longName\\n name\\n potentialAction\\n }\\n }\\n variables {\\n count\\n items {\\n conceptId\\n definition\\n instanceInformation\\n longName\\n name\\n nativeId\\n scienceKeywords\\n }\\n }\\n }\\n },variables:{params:{id:${conceptId},includeHasGranules:true,includeTags:edsc.*,opensearch.granule.osdd},subcriptionParams:{}}}` From 92f5bf8f0b3619152d493cb8d82c8c3ed767a3cd Mon Sep 17 00:00:00 2001 From: Brandon Corbett Date: Tue, 16 Jan 2024 15:56:13 -0500 Subject: [PATCH 06/15] Updated test value. --- tests/support/graphQlProjectGetCollections.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/support/graphQlProjectGetCollections.js b/tests/support/graphQlProjectGetCollections.js index 293f6f2c47..bc416a70fa 100644 --- a/tests/support/graphQlProjectGetCollections.js +++ b/tests/support/graphQlProjectGetCollections.js @@ -2,4 +2,4 @@ * Return the GraphQl query for verifying the request is what we expect inside of cy.intercept * @param {String} conceptId conceptId to retrieve */ -export const graphQlGetProjectCollections = (conceptId) => `{"query":"\\n query GetProjectCollections (\\n $ids: [String]\\n $includeHasGranules: Boolean\\n $includeTags: String\\n $pageSize: Int\\n $subscriberId: String\\n ) {\\n collections (\\n conceptId: $ids\\n includeHasGranules: $includeHasGranules\\n includeTags: $includeTags\\n limit: $pageSize\\n ) {\\n items {\\n abstract\\n archiveAndDistributionInformation\\n associatedDois\\n boxes\\n cloudHosted\\n conceptId\\n coordinateSystem\\n dataCenter\\n dataCenters\\n dataQualitySummaries {\\n count\\n items {\\n id\\n summary\\n }\\n }\\n directDistributionInformation\\n doi\\n duplicateCollections {\\n count\\n items {\\n id\\n }\\n }\\n hasGranules\\n lines\\n points\\n polygons\\n relatedCollections (\\n limit: 3\\n ) {\\n count\\n items {\\n id\\n title\\n }\\n }\\n relatedUrls\\n scienceKeywords\\n shortName\\n spatialExtent\\n tags\\n temporalExtents\\n tilingIdentificationSystems\\n title\\n versionId\\n services {\\n count\\n items {\\n conceptId\\n longName\\n name\\n type\\n url\\n serviceOptions\\n supportedOutputProjections\\n supportedReformattings\\n maxItemsPerOrder\\n orderOptions {\\n count\\n items {\\n conceptId\\n name\\n form\\n }\\n }\\n variables {\\n count\\n items {\\n conceptId\\n definition\\n longName\\n name\\n nativeId\\n scienceKeywords\\n }\\n }\\n }\\n }\\n granules {\\n count\\n items {\\n browseFlag\\n conceptId\\n onlineAccessFlag\\n links\\n }\\n }\\n subscriptions (\\n subscriberId: $subscriberId\\n ) {\\n count\\n items {\\n collectionConceptId\\n conceptId\\n name\\n query\\n }\\n }\\n tools {\\n count\\n items {\\n longName\\n name\\n potentialAction\\n }\\n }\\n variables {\\n count\\n items {\\n conceptId\\n definition\\n instanceInformation\\n longName\\n name\\n nativeId\\n scienceKeywords\\n }\\n }\\n }\\n }\\n }","variables":{"ids":["${conceptId}"],"includeTags":"edsc.*,opensearch.granule.osdd","includeGranuleCounts":true,"includeHasGranules":true,"pageSize":1}}` +export const graphQlGetProjectCollections = (conceptId) => `{"query":"\\n query GetProjectCollections (\\n $ids: [String]\\n $includeHasGranules: Boolean\\n $includeTags: String\\n $pageSize: Int\\n $subscriberId: String\\n ) {\\n collections (\\n conceptId: $ids\\n includeHasGranules: $includeHasGranules\\n includeTags: $includeTags\\n limit: $pageSize\\n ) {\\n items {\\n abstract\\n archiveAndDistributionInformation\\n associatedDois\\n boxes\\n cloudHosted\\n conceptId\\n coordinateSystem\\n dataCenter\\n dataCenters\\n dataQualitySummaries {\\n count\\n items {\\n id\\n summary\\n }\\n }\\n directDistributionInformation\\n doi\\n duplicateCollections {\\n count\\n items {\\n id\\n }\\n }\\n hasGranules\\n lines\\n points\\n polygons\\n relatedCollections (\\n limit: 3\\n ) {\\n count\\n items {\\n id\\n title\\n }\\n }\\n relatedUrls\\n scienceKeywords\\n shortName\\n spatialExtent\\n tags\\n temporalExtents\\n tilingIdentificationSystems\\n title\\n versionId\\n services {\\n count\\n items {\\n conceptId\\n longName\\n name\\n type\\n url\\n serviceOptions\\n supportedOutputProjections\\n supportedReformattings\\n maxItemsPerOrder\\n orderOptions {\\n count\\n items {\\n conceptId\\n name\\n form\\n }\\n }\\n variables {\\n count\\n items {\\n conceptId\\n definition\\n longName\\n name\\n nativeId\\n scienceKeywords\\n }\\n }\\n }\\n }\\n granules {\\n count\\n items {\\n browseFlag\\n conceptId\\n onlineAccessFlag\\n links\\n }\\n }\\n subscriptions (\\n subscriberId: $subscriberId\\n ) {\\n count\\n items {\\n collectionConceptId\\n conceptId\\n name\\n query\\n }\\n }\\n tools {\\n count\\n items {\\n longName\\n name\\n potentialAction\\n }\\n }\\n variables {\\n count\\n items {\\n conceptId\\n definition\\n instanceInformation\\n longName\\n name\\n nativeId\\n scienceKeywords\\n }\\n }\\n }\\n }\\n }",variables:{ids:[${conceptId}],includeTags:edsc.*,opensearch.granule.osdd,includeGranuleCounts:true,includeHasGranules:true,pageSize:1}}` From dd129221ff71cb47d68e1323a0ea3af1c1ffae00 Mon Sep 17 00:00:00 2001 From: Brandon Corbett Date: Tue, 16 Jan 2024 16:21:36 -0500 Subject: [PATCH 07/15] Additional quotes. --- tests/support/graphQlGetCollection.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/support/graphQlGetCollection.js b/tests/support/graphQlGetCollection.js index 98425af642..1996cb65ac 100644 --- a/tests/support/graphQlGetCollection.js +++ b/tests/support/graphQlGetCollection.js @@ -2,4 +2,4 @@ * Return the GraphQl query for verifying the request is what we expect inside of cy.intercept * @param {String} conceptId conceptId to retrieve */ -export const graphQlGetCollection = (conceptId) => `{"query":"\\n query GetCollection(\\n $params: CollectionInput, $subcriptionParams: SubscriptionsInput\\n ) {\\n collection (params: $params) {\\n abstract\\n archiveAndDistributionInformation\\n associatedDois\\n boxes\\n cloudHosted\\n conceptId\\n coordinateSystem\\n dataCenter\\n dataCenters\\n directDistributionInformation\\n doi\\n duplicateCollections {\\n count\\n items {\\n id\\n }\\n }\\n hasGranules\\n lines\\n nativeDataFormats\\n points\\n polygons\\n relatedUrls\\n relatedCollections (\\n limit: 3\\n ) {\\n count\\n items {\\n id\\n title\\n }\\n }\\n scienceKeywords\\n shortName\\n spatialExtent\\n tags\\n temporalExtents\\n tilingIdentificationSystems\\n title\\n versionId\\n services {\\n count\\n items {\\n conceptId\\n longName\\n name\\n type\\n url\\n serviceOptions\\n supportedOutputProjections\\n supportedReformattings\\n }\\n }\\n granules {\\n count\\n items {\\n conceptId\\n onlineAccessFlag\\n }\\n }\\n subscriptions (\\n params: $subcriptionParams\\n ) {\\n count\\n items {\\n collectionConceptId\\n conceptId\\n name\\n nativeId\\n query\\n type\\n }\\n }\\n tools {\\n count\\n items {\\n longName\\n name\\n potentialAction\\n }\\n }\\n variables {\\n count\\n items {\\n conceptId\\n definition\\n instanceInformation\\n longName\\n name\\n nativeId\\n scienceKeywords\\n }\\n }\\n }\\n },variables:{params:{id:${conceptId},includeHasGranules:true,includeTags:edsc.*,opensearch.granule.osdd},subcriptionParams:{}}}` +export const graphQlGetCollection = (conceptId) => `{"query":"\\n query GetCollection(\\n $params: CollectionInput, $subcriptionParams: SubscriptionsInput\\n ) {\\n collection (params: $params) {\\n abstract\\n archiveAndDistributionInformation\\n associatedDois\\n boxes\\n cloudHosted\\n conceptId\\n coordinateSystem\\n dataCenter\\n dataCenters\\n directDistributionInformation\\n doi\\n duplicateCollections {\\n count\\n items {\\n id\\n }\\n }\\n hasGranules\\n lines\\n nativeDataFormats\\n points\\n polygons\\n relatedUrls\\n relatedCollections (\\n limit: 3\\n ) {\\n count\\n items {\\n id\\n title\\n }\\n }\\n scienceKeywords\\n shortName\\n spatialExtent\\n tags\\n temporalExtents\\n tilingIdentificationSystems\\n title\\n versionId\\n services {\\n count\\n items {\\n conceptId\\n longName\\n name\\n type\\n url\\n serviceOptions\\n supportedOutputProjections\\n supportedReformattings\\n }\\n }\\n granules {\\n count\\n items {\\n conceptId\\n onlineAccessFlag\\n }\\n }\\n subscriptions (\\n params: $subcriptionParams\\n ) {\\n count\\n items {\\n collectionConceptId\\n conceptId\\n name\\n nativeId\\n query\\n type\\n }\\n }\\n tools {\\n count\\n items {\\n longName\\n name\\n potentialAction\\n }\\n }\\n variables {\\n count\\n items {\\n conceptId\\n definition\\n instanceInformation\\n longName\\n name\\n nativeId\\n scienceKeywords\\n }\\n }\\n }\\n }","variables":{"params":{"id":"${conceptId}","includeHasGranules":true,"includeTags":"edsc.*,opensearch.granule.osdd"},"subcriptionParams":{}}}` From 480ad840a73a25402ff71155cc45f8588ccba640 Mon Sep 17 00:00:00 2001 From: Brandon Corbett Date: Wed, 17 Jan 2024 12:24:02 -0500 Subject: [PATCH 08/15] Updates Jan 17 --- .../e2e/paths/search/granules/granules.cy.js | 4 +- cypress/support/graphQlGetCollection.js | 2 +- package-lock.json | 74 ++++++++----------- package.json | 2 +- static/src/js/actions/focusedCollection.js | 2 +- static/src/js/actions/focusedGranule.js | 4 +- .../GranuleResults/GranuleResultsItem.js | 1 + tests/support/graphQlGetCollection.js | 2 +- 8 files changed, 41 insertions(+), 50 deletions(-) diff --git a/cypress/e2e/paths/search/granules/granules.cy.js b/cypress/e2e/paths/search/granules/granules.cy.js index 23e917b22f..5ad2c3d277 100644 --- a/cypress/e2e/paths/search/granules/granules.cy.js +++ b/cypress/e2e/paths/search/granules/granules.cy.js @@ -1078,7 +1078,7 @@ describe('Path /search/granules', () => { }) describe('When the path is loaded with a focused granule', () => { - it('loads with the granule focused', () => { + it.only('loads with the granule focused', () => { const conceptId = 'C194001210-LPDAAC_ECS' const cmrHits = 275361 @@ -1132,7 +1132,7 @@ describe('Path /search/granules', () => { }) } - if (JSON.stringify(req.body) === '{"query":"\\n query GetGranule(\\n $params: GranulesInput\\n ) {\\n granule(\\n params: $params\\n ) {\\n granuleUr\\n granuleSize\\n title\\n onlineAccessFlag\\n dayNightFlag\\n timeStart\\n timeEnd\\n dataCenter\\n originalFormat\\n conceptId\\n collectionConceptId\\n spatialExtent\\n temporalExtent\\n relatedUrls\\n dataGranule\\n measuredParameters\\n providerDates\\n }\\n }","variables":{"id":"G2058417402-LPDAAC_ECS"}}') { + if (JSON.stringify(req.body) === '{"query":"\\n query GetGranule(\\n $params: GranulesInput\\n ) {\\n granule(\\n params: $params\\n ) {\\n granuleUr\\n granuleSize\\n title\\n onlineAccessFlag\\n dayNightFlag\\n timeStart\\n timeEnd\\n dataCenter\\n originalFormat\\n conceptId\\n collectionConceptId\\n spatialExtent\\n temporalExtent\\n relatedUrls\\n dataGranule\\n measuredParameters\\n providerDates\\n }\\n }","variables":{"conceptId":"G2058417402-LPDAAC_ECS"}}') { req.alias = 'graphQlGranuleQuery' req.reply({ body: focusedGranuleGranuleGraphQlBody, diff --git a/cypress/support/graphQlGetCollection.js b/cypress/support/graphQlGetCollection.js index 1996cb65ac..fd085d07df 100644 --- a/cypress/support/graphQlGetCollection.js +++ b/cypress/support/graphQlGetCollection.js @@ -2,4 +2,4 @@ * Return the GraphQl query for verifying the request is what we expect inside of cy.intercept * @param {String} conceptId conceptId to retrieve */ -export const graphQlGetCollection = (conceptId) => `{"query":"\\n query GetCollection(\\n $params: CollectionInput, $subcriptionParams: SubscriptionsInput\\n ) {\\n collection (params: $params) {\\n abstract\\n archiveAndDistributionInformation\\n associatedDois\\n boxes\\n cloudHosted\\n conceptId\\n coordinateSystem\\n dataCenter\\n dataCenters\\n directDistributionInformation\\n doi\\n duplicateCollections {\\n count\\n items {\\n id\\n }\\n }\\n hasGranules\\n lines\\n nativeDataFormats\\n points\\n polygons\\n relatedUrls\\n relatedCollections (\\n limit: 3\\n ) {\\n count\\n items {\\n id\\n title\\n }\\n }\\n scienceKeywords\\n shortName\\n spatialExtent\\n tags\\n temporalExtents\\n tilingIdentificationSystems\\n title\\n versionId\\n services {\\n count\\n items {\\n conceptId\\n longName\\n name\\n type\\n url\\n serviceOptions\\n supportedOutputProjections\\n supportedReformattings\\n }\\n }\\n granules {\\n count\\n items {\\n conceptId\\n onlineAccessFlag\\n }\\n }\\n subscriptions (\\n params: $subcriptionParams\\n ) {\\n count\\n items {\\n collectionConceptId\\n conceptId\\n name\\n nativeId\\n query\\n type\\n }\\n }\\n tools {\\n count\\n items {\\n longName\\n name\\n potentialAction\\n }\\n }\\n variables {\\n count\\n items {\\n conceptId\\n definition\\n instanceInformation\\n longName\\n name\\n nativeId\\n scienceKeywords\\n }\\n }\\n }\\n }","variables":{"params":{"id":"${conceptId}","includeHasGranules":true,"includeTags":"edsc.*,opensearch.granule.osdd"},"subcriptionParams":{}}}` +export const graphQlGetCollection = (conceptId) => `{"query":"\\n query GetCollection(\\n $params: CollectionInput, $subcriptionParams: SubscriptionsInput\\n ) {\\n collection (params: $params) {\\n abstract\\n archiveAndDistributionInformation\\n associatedDois\\n boxes\\n cloudHosted\\n conceptId\\n coordinateSystem\\n dataCenter\\n dataCenters\\n directDistributionInformation\\n doi\\n duplicateCollections {\\n count\\n items {\\n id\\n }\\n }\\n hasGranules\\n lines\\n nativeDataFormats\\n points\\n polygons\\n relatedUrls\\n relatedCollections (\\n limit: 3\\n ) {\\n count\\n items {\\n id\\n title\\n }\\n }\\n scienceKeywords\\n shortName\\n spatialExtent\\n tags\\n temporalExtents\\n tilingIdentificationSystems\\n title\\n versionId\\n services {\\n count\\n items {\\n conceptId\\n longName\\n name\\n type\\n url\\n serviceOptions\\n supportedOutputProjections\\n supportedReformattings\\n }\\n }\\n granules {\\n count\\n items {\\n conceptId\\n onlineAccessFlag\\n }\\n }\\n subscriptions (\\n params: $subcriptionParams\\n ) {\\n count\\n items {\\n collectionConceptId\\n conceptId\\n name\\n nativeId\\n query\\n type\\n }\\n }\\n tools {\\n count\\n items {\\n longName\\n name\\n potentialAction\\n }\\n }\\n variables {\\n count\\n items {\\n conceptId\\n definition\\n instanceInformation\\n longName\\n name\\n nativeId\\n scienceKeywords\\n }\\n }\\n }\\n }","variables":{"params":{"conceptId":"${conceptId}","includeHasGranules":true,"includeTags":"edsc.*,opensearch.granule.osdd"},"subcriptionParams":{}}}` diff --git a/package-lock.json b/package-lock.json index 229a74da30..943cff41b9 100644 --- a/package-lock.json +++ b/package-lock.json @@ -177,7 +177,7 @@ "babel-jest": "^28.1.0", "babel-plugin-istanbul": "^6.1.1", "cookies": "^0.7.3", - "cypress": "^12.17.2", + "cypress": "^13.0.0", "cypress-file-upload": "^5.0.8", "enzyme": "^3.11.0", "istanbul-instrumenter-loader": "^3.0.1", @@ -9495,9 +9495,9 @@ } }, "node_modules/@cypress/request": { - "version": "2.88.12", - "resolved": "https://registry.npmjs.org/@cypress/request/-/request-2.88.12.tgz", - "integrity": "sha512-tOn+0mDZxASFM+cuAP9szGUGPI1HwWVSvdzm7V4cCsPdFTx6qMj29CwaQmRAMIEhORIUBFBsYROYJcveK4uOjA==", + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/@cypress/request/-/request-3.0.1.tgz", + "integrity": "sha512-TWivJlJi8ZDx2wGOw1dbLuHJKUYX7bWySw377nlnGOW3hP9/MUKIsEdXT/YngWxVdgNCHRBmFlBipE+5/2ZZlQ==", "dependencies": { "aws-sign2": "~0.7.0", "aws4": "^1.8.0", @@ -9512,7 +9512,7 @@ "json-stringify-safe": "~5.0.1", "mime-types": "~2.1.19", "performance-now": "^2.1.0", - "qs": "~6.10.3", + "qs": "6.10.4", "safe-buffer": "^5.1.2", "tough-cookie": "^4.1.3", "tunnel-agent": "^0.6.0", @@ -18986,14 +18986,13 @@ "integrity": "sha512-DJR/VvkAvSZW9bTouZue2sSxDwdTN92uHjqeKVm+0dAqdfNykRzQ95tay8aXMBAAPpUiq4Qcug2L7neoRh2Egw==" }, "node_modules/cypress": { - "version": "12.17.4", - "resolved": "https://registry.npmjs.org/cypress/-/cypress-12.17.4.tgz", - "integrity": "sha512-gAN8Pmns9MA5eCDFSDJXWKUpaL3IDd89N9TtIupjYnzLSmlpVr+ZR+vb4U/qaMp+lB6tBvAmt7504c3Z4RU5KQ==", + "version": "13.6.3", + "resolved": "https://registry.npmjs.org/cypress/-/cypress-13.6.3.tgz", + "integrity": "sha512-d/pZvgwjAyZsoyJ3FOsJT5lDsqnxQ/clMqnNc++rkHjbkkiF2h9s0JsZSyyH4QXhVFW3zPFg82jD25roFLOdZA==", "hasInstallScript": true, "dependencies": { - "@cypress/request": "2.88.12", + "@cypress/request": "^3.0.0", "@cypress/xvfb": "^1.2.4", - "@types/node": "^16.18.39", "@types/sinonjs__fake-timers": "8.1.1", "@types/sizzle": "^2.3.2", "arch": "^2.2.0", @@ -19039,7 +19038,7 @@ "cypress": "bin/cypress" }, "engines": { - "node": "^14.0.0 || ^16.0.0 || >=18.0.0" + "node": "^16.0.0 || ^18.0.0 || >=20.0.0" } }, "node_modules/cypress-file-upload": { @@ -19055,18 +19054,13 @@ } }, "node_modules/cypress-real-events": { - "version": "1.7.6", - "resolved": "https://registry.npmjs.org/cypress-real-events/-/cypress-real-events-1.7.6.tgz", - "integrity": "sha512-yP6GnRrbm6HK5q4DH6Nnupz37nOfZu/xn1xFYqsE2o4G73giPWQOdu6375QYpwfU1cvHNCgyD2bQ2hPH9D7NMw==", + "version": "1.11.0", + "resolved": "https://registry.npmjs.org/cypress-real-events/-/cypress-real-events-1.11.0.tgz", + "integrity": "sha512-4LXVRsyq+xBh5TmlEyO1ojtBXtN7xw720Pwb9rEE9rkJuXmeH3VyoR1GGayMGr+Itqf11eEjfDewtDmcx6PWPQ==", "peerDependencies": { - "cypress": "^4.x || ^5.x || ^6.x || ^7.x || ^8.x || ^9.x || ^10.x || ^11.x || ^12.x" + "cypress": "^4.x || ^5.x || ^6.x || ^7.x || ^8.x || ^9.x || ^10.x || ^11.x || ^12.x || ^13.x" } }, - "node_modules/cypress/node_modules/@types/node": { - "version": "16.18.58", - "resolved": "https://registry.npmjs.org/@types/node/-/node-16.18.58.tgz", - "integrity": "sha512-YGncyA25/MaVtQkjWW9r0EFBukZ+JulsLcVZBlGUfIb96OBMjkoRWwQo5IEWJ8Fj06Go3GHw+bjYDitv6BaGsA==" - }, "node_modules/cypress/node_modules/ansi-styles": { "version": "4.3.0", "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", @@ -34294,9 +34288,9 @@ } }, "node_modules/sshpk": { - "version": "1.17.0", - "resolved": "https://registry.npmjs.org/sshpk/-/sshpk-1.17.0.tgz", - "integrity": "sha512-/9HIEs1ZXGhSPE8X6Ccm7Nam1z8KcoCqPdI7ecm1N33EzAetWahvQWVqLZtaZQ+IDKX4IyA2o0gBzqIMkAagHQ==", + "version": "1.18.0", + "resolved": "https://registry.npmjs.org/sshpk/-/sshpk-1.18.0.tgz", + "integrity": "sha512-2p2KJZTSqQ/I3+HX42EpYOa2l3f8Erv8MWKsy2I9uf4wA7yFIkXRffYdsx86y6z4vHtV8u7g+pPlr8/4ouAxsQ==", "dependencies": { "asn1": "~0.2.3", "assert-plus": "^1.0.0", @@ -44787,9 +44781,9 @@ } }, "@cypress/request": { - "version": "2.88.12", - "resolved": "https://registry.npmjs.org/@cypress/request/-/request-2.88.12.tgz", - "integrity": "sha512-tOn+0mDZxASFM+cuAP9szGUGPI1HwWVSvdzm7V4cCsPdFTx6qMj29CwaQmRAMIEhORIUBFBsYROYJcveK4uOjA==", + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/@cypress/request/-/request-3.0.1.tgz", + "integrity": "sha512-TWivJlJi8ZDx2wGOw1dbLuHJKUYX7bWySw377nlnGOW3hP9/MUKIsEdXT/YngWxVdgNCHRBmFlBipE+5/2ZZlQ==", "requires": { "aws-sign2": "~0.7.0", "aws4": "^1.8.0", @@ -44804,7 +44798,7 @@ "json-stringify-safe": "~5.0.1", "mime-types": "~2.1.19", "performance-now": "^2.1.0", - "qs": "~6.10.3", + "qs": "6.10.4", "safe-buffer": "^5.1.2", "tough-cookie": "^4.1.3", "tunnel-agent": "^0.6.0", @@ -52501,13 +52495,12 @@ "integrity": "sha512-DJR/VvkAvSZW9bTouZue2sSxDwdTN92uHjqeKVm+0dAqdfNykRzQ95tay8aXMBAAPpUiq4Qcug2L7neoRh2Egw==" }, "cypress": { - "version": "12.17.4", - "resolved": "https://registry.npmjs.org/cypress/-/cypress-12.17.4.tgz", - "integrity": "sha512-gAN8Pmns9MA5eCDFSDJXWKUpaL3IDd89N9TtIupjYnzLSmlpVr+ZR+vb4U/qaMp+lB6tBvAmt7504c3Z4RU5KQ==", + "version": "13.6.3", + "resolved": "https://registry.npmjs.org/cypress/-/cypress-13.6.3.tgz", + "integrity": "sha512-d/pZvgwjAyZsoyJ3FOsJT5lDsqnxQ/clMqnNc++rkHjbkkiF2h9s0JsZSyyH4QXhVFW3zPFg82jD25roFLOdZA==", "requires": { - "@cypress/request": "2.88.12", + "@cypress/request": "^3.0.0", "@cypress/xvfb": "^1.2.4", - "@types/node": "^16.18.39", "@types/sinonjs__fake-timers": "8.1.1", "@types/sizzle": "^2.3.2", "arch": "^2.2.0", @@ -52550,11 +52543,6 @@ "yauzl": "^2.10.0" }, "dependencies": { - "@types/node": { - "version": "16.18.58", - "resolved": "https://registry.npmjs.org/@types/node/-/node-16.18.58.tgz", - "integrity": "sha512-YGncyA25/MaVtQkjWW9r0EFBukZ+JulsLcVZBlGUfIb96OBMjkoRWwQo5IEWJ8Fj06Go3GHw+bjYDitv6BaGsA==" - }, "ansi-styles": { "version": "4.3.0", "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", @@ -52656,9 +52644,9 @@ "requires": {} }, "cypress-real-events": { - "version": "1.7.6", - "resolved": "https://registry.npmjs.org/cypress-real-events/-/cypress-real-events-1.7.6.tgz", - "integrity": "sha512-yP6GnRrbm6HK5q4DH6Nnupz37nOfZu/xn1xFYqsE2o4G73giPWQOdu6375QYpwfU1cvHNCgyD2bQ2hPH9D7NMw==", + "version": "1.11.0", + "resolved": "https://registry.npmjs.org/cypress-real-events/-/cypress-real-events-1.11.0.tgz", + "integrity": "sha512-4LXVRsyq+xBh5TmlEyO1ojtBXtN7xw720Pwb9rEE9rkJuXmeH3VyoR1GGayMGr+Itqf11eEjfDewtDmcx6PWPQ==", "requires": {} }, "d": { @@ -63963,9 +63951,9 @@ } }, "sshpk": { - "version": "1.17.0", - "resolved": "https://registry.npmjs.org/sshpk/-/sshpk-1.17.0.tgz", - "integrity": "sha512-/9HIEs1ZXGhSPE8X6Ccm7Nam1z8KcoCqPdI7ecm1N33EzAetWahvQWVqLZtaZQ+IDKX4IyA2o0gBzqIMkAagHQ==", + "version": "1.18.0", + "resolved": "https://registry.npmjs.org/sshpk/-/sshpk-1.18.0.tgz", + "integrity": "sha512-2p2KJZTSqQ/I3+HX42EpYOa2l3f8Erv8MWKsy2I9uf4wA7yFIkXRffYdsx86y6z4vHtV8u7g+pPlr8/4ouAxsQ==", "requires": { "asn1": "~0.2.3", "assert-plus": "^1.0.0", diff --git a/package.json b/package.json index d4f28c5262..410eb0edb2 100644 --- a/package.json +++ b/package.json @@ -59,7 +59,7 @@ "babel-jest": "^28.1.0", "babel-plugin-istanbul": "^6.1.1", "cookies": "^0.7.3", - "cypress": "^12.17.2", + "cypress": "^13.0.0", "cypress-file-upload": "^5.0.8", "enzyme": "^3.11.0", "istanbul-instrumenter-loader": "^3.0.1", diff --git a/static/src/js/actions/focusedCollection.js b/static/src/js/actions/focusedCollection.js index d29362c71b..006becf16d 100644 --- a/static/src/js/actions/focusedCollection.js +++ b/static/src/js/actions/focusedCollection.js @@ -183,7 +183,7 @@ export const getFocusedCollection = () => async (dispatch, getState) => { const response = graphQlRequestObject.search(graphQuery, { params: { - id: focusedCollectionId, + conceptId: focusedCollectionId, includeHasGranules: true, includeTags: defaultCmrSearchTags.join(',') }, diff --git a/static/src/js/actions/focusedGranule.js b/static/src/js/actions/focusedGranule.js index 48ff34e295..c692bb3940 100644 --- a/static/src/js/actions/focusedGranule.js +++ b/static/src/js/actions/focusedGranule.js @@ -77,7 +77,9 @@ export const getFocusedGranule = () => (dispatch, getState) => { }` const response = graphQlRequestObject.search(graphQuery, { - id: focusedGranuleId + params: { + conceptId: focusedGranuleId + } }) .then((responseObject) => { const payload = [] diff --git a/static/src/js/components/GranuleResults/GranuleResultsItem.js b/static/src/js/components/GranuleResults/GranuleResultsItem.js index d485bdcf32..12447e8354 100644 --- a/static/src/js/components/GranuleResults/GranuleResultsItem.js +++ b/static/src/js/components/GranuleResults/GranuleResultsItem.js @@ -68,6 +68,7 @@ const GranuleResultsItem = forwardRef(({ } const handleClickGranuleDetails = (granuleId) => { + console.log('CORBETT:: ', granuleId) onFocusedGranuleChange(granuleId) } diff --git a/tests/support/graphQlGetCollection.js b/tests/support/graphQlGetCollection.js index 1996cb65ac..fd085d07df 100644 --- a/tests/support/graphQlGetCollection.js +++ b/tests/support/graphQlGetCollection.js @@ -2,4 +2,4 @@ * Return the GraphQl query for verifying the request is what we expect inside of cy.intercept * @param {String} conceptId conceptId to retrieve */ -export const graphQlGetCollection = (conceptId) => `{"query":"\\n query GetCollection(\\n $params: CollectionInput, $subcriptionParams: SubscriptionsInput\\n ) {\\n collection (params: $params) {\\n abstract\\n archiveAndDistributionInformation\\n associatedDois\\n boxes\\n cloudHosted\\n conceptId\\n coordinateSystem\\n dataCenter\\n dataCenters\\n directDistributionInformation\\n doi\\n duplicateCollections {\\n count\\n items {\\n id\\n }\\n }\\n hasGranules\\n lines\\n nativeDataFormats\\n points\\n polygons\\n relatedUrls\\n relatedCollections (\\n limit: 3\\n ) {\\n count\\n items {\\n id\\n title\\n }\\n }\\n scienceKeywords\\n shortName\\n spatialExtent\\n tags\\n temporalExtents\\n tilingIdentificationSystems\\n title\\n versionId\\n services {\\n count\\n items {\\n conceptId\\n longName\\n name\\n type\\n url\\n serviceOptions\\n supportedOutputProjections\\n supportedReformattings\\n }\\n }\\n granules {\\n count\\n items {\\n conceptId\\n onlineAccessFlag\\n }\\n }\\n subscriptions (\\n params: $subcriptionParams\\n ) {\\n count\\n items {\\n collectionConceptId\\n conceptId\\n name\\n nativeId\\n query\\n type\\n }\\n }\\n tools {\\n count\\n items {\\n longName\\n name\\n potentialAction\\n }\\n }\\n variables {\\n count\\n items {\\n conceptId\\n definition\\n instanceInformation\\n longName\\n name\\n nativeId\\n scienceKeywords\\n }\\n }\\n }\\n }","variables":{"params":{"id":"${conceptId}","includeHasGranules":true,"includeTags":"edsc.*,opensearch.granule.osdd"},"subcriptionParams":{}}}` +export const graphQlGetCollection = (conceptId) => `{"query":"\\n query GetCollection(\\n $params: CollectionInput, $subcriptionParams: SubscriptionsInput\\n ) {\\n collection (params: $params) {\\n abstract\\n archiveAndDistributionInformation\\n associatedDois\\n boxes\\n cloudHosted\\n conceptId\\n coordinateSystem\\n dataCenter\\n dataCenters\\n directDistributionInformation\\n doi\\n duplicateCollections {\\n count\\n items {\\n id\\n }\\n }\\n hasGranules\\n lines\\n nativeDataFormats\\n points\\n polygons\\n relatedUrls\\n relatedCollections (\\n limit: 3\\n ) {\\n count\\n items {\\n id\\n title\\n }\\n }\\n scienceKeywords\\n shortName\\n spatialExtent\\n tags\\n temporalExtents\\n tilingIdentificationSystems\\n title\\n versionId\\n services {\\n count\\n items {\\n conceptId\\n longName\\n name\\n type\\n url\\n serviceOptions\\n supportedOutputProjections\\n supportedReformattings\\n }\\n }\\n granules {\\n count\\n items {\\n conceptId\\n onlineAccessFlag\\n }\\n }\\n subscriptions (\\n params: $subcriptionParams\\n ) {\\n count\\n items {\\n collectionConceptId\\n conceptId\\n name\\n nativeId\\n query\\n type\\n }\\n }\\n tools {\\n count\\n items {\\n longName\\n name\\n potentialAction\\n }\\n }\\n variables {\\n count\\n items {\\n conceptId\\n definition\\n instanceInformation\\n longName\\n name\\n nativeId\\n scienceKeywords\\n }\\n }\\n }\\n }","variables":{"params":{"conceptId":"${conceptId}","includeHasGranules":true,"includeTags":"edsc.*,opensearch.granule.osdd"},"subcriptionParams":{}}}` From 96d440e0aa42622bffbd5d129530a4be3e4ad538 Mon Sep 17 00:00:00 2001 From: Brandon Corbett Date: Wed, 17 Jan 2024 12:24:46 -0500 Subject: [PATCH 09/15] remove it.only from cypress test --- cypress/e2e/paths/search/granules/granules.cy.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cypress/e2e/paths/search/granules/granules.cy.js b/cypress/e2e/paths/search/granules/granules.cy.js index 5ad2c3d277..2084e673a7 100644 --- a/cypress/e2e/paths/search/granules/granules.cy.js +++ b/cypress/e2e/paths/search/granules/granules.cy.js @@ -1078,7 +1078,7 @@ describe('Path /search/granules', () => { }) describe('When the path is loaded with a focused granule', () => { - it.only('loads with the granule focused', () => { + it('loads with the granule focused', () => { const conceptId = 'C194001210-LPDAAC_ECS' const cmrHits = 275361 From c2c3c19a7b2919eadc21f2eaba8e9a565f28e283 Mon Sep 17 00:00:00 2001 From: Brandon Corbett Date: Wed, 17 Jan 2024 15:38:49 -0500 Subject: [PATCH 10/15] fixes for cypress. --- .../search/granules/granule_details/granule_details.cy.js | 2 +- cypress/e2e/paths/search/granules/granules.cy.js | 6 +++++- cypress/support/graphQlGetCollections.js | 2 +- tests/e2e/map/map.spec.js | 2 +- 4 files changed, 8 insertions(+), 4 deletions(-) diff --git a/cypress/e2e/paths/search/granules/granule_details/granule_details.cy.js b/cypress/e2e/paths/search/granules/granule_details/granule_details.cy.js index 0fdb4cc67d..6d5877d90c 100644 --- a/cypress/e2e/paths/search/granules/granule_details/granule_details.cy.js +++ b/cypress/e2e/paths/search/granules/granule_details/granule_details.cy.js @@ -68,7 +68,7 @@ describe('Path /search/granules/granule-details', () => { }) } - if (JSON.stringify(req.body) === '{"query":"\\n query GetGranule(\\n $params: GranuleInput\\n ) {\\n granule(\\n params: $params\\n ) {\\n granuleUr\\n granuleSize\\n title\\n onlineAccessFlag\\n dayNightFlag\\n timeStart\\n timeEnd\\n dataCenter\\n originalFormat\\n conceptId\\n collectionConceptId\\n spatialExtent\\n temporalExtent\\n relatedUrls\\n dataGranule\\n measuredParameters\\n providerDates\\n }\\n }","variables":{"id":"G1287941210-ASF"}}') { + if (JSON.stringify(req.body) === `{"query":"\\n query GetGranule(\\n $params: GranuleInput\\n ) {\\n granule(\\n params: $params\\n ) {\\n granuleUr\\n granuleSize\\n title\\n onlineAccessFlag\\n dayNightFlag\\n timeStart\\n timeEnd\\n dataCenter\\n originalFormat\\n conceptId\\n collectionConceptId\\n spatialExtent\\n temporalExtent\\n relatedUrls\\n dataGranule\\n measuredParameters\\n providerDates\\n }\\n }","variables":{"params":{"conceptId":"${granuleId}"}}}`) { req.alias = 'graphQlGranuleQuery' req.reply({ body: getGranuleGraphQlBody, diff --git a/cypress/e2e/paths/search/granules/granules.cy.js b/cypress/e2e/paths/search/granules/granules.cy.js index 2084e673a7..1abbcd21a0 100644 --- a/cypress/e2e/paths/search/granules/granules.cy.js +++ b/cypress/e2e/paths/search/granules/granules.cy.js @@ -1132,12 +1132,14 @@ describe('Path /search/granules', () => { }) } - if (JSON.stringify(req.body) === '{"query":"\\n query GetGranule(\\n $params: GranulesInput\\n ) {\\n granule(\\n params: $params\\n ) {\\n granuleUr\\n granuleSize\\n title\\n onlineAccessFlag\\n dayNightFlag\\n timeStart\\n timeEnd\\n dataCenter\\n originalFormat\\n conceptId\\n collectionConceptId\\n spatialExtent\\n temporalExtent\\n relatedUrls\\n dataGranule\\n measuredParameters\\n providerDates\\n }\\n }","variables":{"conceptId":"G2058417402-LPDAAC_ECS"}}') { + if (JSON.stringify(req.body) === '{"query":"\\n query GetGranule(\\n $params: GranuleInput\\n ) {\\n granule(\\n params: $params\\n ) {\\n granuleUr\\n granuleSize\\n title\\n onlineAccessFlag\\n dayNightFlag\\n timeStart\\n timeEnd\\n dataCenter\\n originalFormat\\n conceptId\\n collectionConceptId\\n spatialExtent\\n temporalExtent\\n relatedUrls\\n dataGranule\\n measuredParameters\\n providerDates\\n }\\n }","variables":{"params":{"conceptId":"G2058417402-LPDAAC_ECS"}}}') { req.alias = 'graphQlGranuleQuery' req.reply({ body: focusedGranuleGranuleGraphQlBody, headers: focusedGranuleGraphQlHeaders }) + } else { + console.log('Granule CORBETT:: ', JSON.stringify(req.body)) } } ) @@ -1237,6 +1239,8 @@ describe('Path /search/granules', () => { body: projectGranuleCollectionsGraphQlBody, headers: projectGranuleGraphQlHeaders }) + } else { + console.log("GET COLLECTIONS", JSON.stringify(req.body)) } } ) diff --git a/cypress/support/graphQlGetCollections.js b/cypress/support/graphQlGetCollections.js index 188842b4e4..c49aff0a0a 100644 --- a/cypress/support/graphQlGetCollections.js +++ b/cypress/support/graphQlGetCollections.js @@ -2,4 +2,4 @@ * Return the GraphQl query for verifying the request is what we expect inside of cy.intercept * @param {String} conceptId conceptId to retrieve */ -export const graphQlGetCollections = (conceptId) => `{"query":"\\n query GetProjectCollections (\\n $ids: [String]\\n $includeHasGranules: Boolean\\n $includeTags: String\\n $pageSize: Int\\n $subscriberId: String\\n ) {\\n collections (\\n conceptId: $ids\\n includeHasGranules: $includeHasGranules\\n includeTags: $includeTags\\n limit: $pageSize\\n ) {\\n items {\\n abstract\\n archiveAndDistributionInformation\\n associatedDois\\n boxes\\n cloudHosted\\n conceptId\\n coordinateSystem\\n dataCenter\\n dataCenters\\n dataQualitySummaries {\\n count\\n items {\\n id\\n summary\\n }\\n }\\n directDistributionInformation\\n doi\\n duplicateCollections {\\n count\\n items {\\n id\\n }\\n }\\n hasGranules\\n lines\\n points\\n polygons\\n relatedCollections (\\n limit: 3\\n ) {\\n count\\n items {\\n id\\n title\\n }\\n }\\n relatedUrls\\n scienceKeywords\\n shortName\\n spatialExtent\\n tags\\n temporalExtents\\n tilingIdentificationSystems\\n title\\n versionId\\n services {\\n count\\n items {\\n conceptId\\n longName\\n name\\n type\\n url\\n serviceOptions\\n supportedOutputProjections\\n supportedReformattings\\n maxItemsPerOrder\\n orderOptions {\\n count\\n items {\\n conceptId\\n name\\n form\\n }\\n }\\n variables {\\n count\\n items {\\n conceptId\\n definition\\n longName\\n name\\n nativeId\\n scienceKeywords\\n }\\n }\\n }\\n }\\n granules {\\n count\\n items {\\n browseFlag\\n conceptId\\n onlineAccessFlag\\n links\\n }\\n }\\n subscriptions (\\n subscriberId: $subscriberId\\n ) {\\n count\\n items {\\n collectionConceptId\\n conceptId\\n name\\n query\\n }\\n }\\n tools {\\n count\\n items {\\n longName\\n name\\n potentialAction\\n }\\n }\\n variables {\\n count\\n items {\\n conceptId\\n definition\\n instanceInformation\\n longName\\n name\\n nativeId\\n scienceKeywords\\n }\\n }\\n }\\n }\\n }","variables":{"ids":["${conceptId}"],"includeTags":"edsc.*,opensearch.granule.osdd","includeHasGranules":true,"pageSize":1}}` +export const graphQlGetCollections = (conceptId) => `{"query":"\\n query GetProjectCollections ($params: CollectionsInput, $subcriptionParams: SubscriptionsInput) {\\n collections (\\n params: $params\\n ) {\\n items {\\n abstract\\n archiveAndDistributionInformation\\n associatedDois\\n boxes\\n cloudHosted\\n conceptId\\n coordinateSystem\\n dataCenter\\n dataCenters\\n dataQualitySummaries {\\n count\\n items {\\n id\\n summary\\n }\\n }\\n directDistributionInformation\\n doi\\n duplicateCollections {\\n count\\n items {\\n id\\n }\\n }\\n hasGranules\\n lines\\n points\\n polygons\\n relatedCollections (\\n limit: 3\\n ) {\\n count\\n items {\\n id\\n title\\n }\\n }\\n relatedUrls\\n scienceKeywords\\n shortName\\n spatialExtent\\n tags\\n temporalExtents\\n tilingIdentificationSystems\\n title\\n versionId\\n services {\\n count\\n items {\\n conceptId\\n longName\\n name\\n type\\n url\\n serviceOptions\\n supportedOutputProjections\\n supportedReformattings\\n maxItemsPerOrder\\n orderOptions {\\n count\\n items {\\n conceptId\\n name\\n form\\n }\\n }\\n variables {\\n count\\n items {\\n conceptId\\n definition\\n longName\\n name\\n nativeId\\n scienceKeywords\\n }\\n }\\n }\\n }\\n granules {\\n count\\n items {\\n browseFlag\\n conceptId\\n onlineAccessFlag\\n links\\n }\\n }\\n subscriptions (\\n params: $subcriptionParams\\n ) {\\n count\\n items {\\n collectionConceptId\\n conceptId\\n name\\n query\\n }\\n }\\n tools {\\n count\\n items {\\n longName\\n name\\n potentialAction\\n }\\n }\\n variables {\\n count\\n items {\\n conceptId\\n definition\\n instanceInformation\\n longName\\n name\\n nativeId\\n scienceKeywords\\n }\\n }\\n }\\n }\\n }","variables":{"params":{"conceptId":["${conceptId}"],"includeTags":"edsc.*,opensearch.granule.osdd","includeHasGranules":true,"pageSize":1},"subcriptionParams":{}}}` diff --git a/tests/e2e/map/map.spec.js b/tests/e2e/map/map.spec.js index de39fce12e..d4743001f7 100644 --- a/tests/e2e/map/map.spec.js +++ b/tests/e2e/map/map.spec.js @@ -1443,7 +1443,7 @@ test.describe('Map interactions', () => { await page.route(/api$/, async (route) => { const query = route.request().postData() - expect(query).toEqual('{"query":"\\n query GetGranule(\\n $params: GranuleInput\\n ) {\\n granule(\\n params: $params\\n ) {\\n granuleUr\\n granuleSize\\n title\\n onlineAccessFlag\\n dayNightFlag\\n timeStart\\n timeEnd\\n dataCenter\\n originalFormat\\n conceptId\\n collectionConceptId\\n spatialExtent\\n temporalExtent\\n relatedUrls\\n dataGranule\\n measuredParameters\\n providerDates\\n }\\n }","variables":{"id":"G2061166811-ASF"}}') + expect(query).toEqual('{"query":"\\n query GetGranule(\\n $params: GranuleInput\\n ) {\\n granule(\\n params: $params\\n ) {\\n granuleUr\\n granuleSize\\n title\\n onlineAccessFlag\\n dayNightFlag\\n timeStart\\n timeEnd\\n dataCenter\\n originalFormat\\n conceptId\\n collectionConceptId\\n spatialExtent\\n temporalExtent\\n relatedUrls\\n dataGranule\\n measuredParameters\\n providerDates\\n }\\n }","variables":{"conceptId":"G2061166811-ASF"}}') await route.fulfill({ json: granuleGraphQlBody, From 5dc4bf1383e45593c68610648c8e2ac2dafef040 Mon Sep 17 00:00:00 2001 From: Brandon Corbett Date: Wed, 17 Jan 2024 15:46:38 -0500 Subject: [PATCH 11/15] lint --- cypress/e2e/paths/search/granules/granules.cy.js | 2 -- 1 file changed, 2 deletions(-) diff --git a/cypress/e2e/paths/search/granules/granules.cy.js b/cypress/e2e/paths/search/granules/granules.cy.js index 1abbcd21a0..67f5627d3f 100644 --- a/cypress/e2e/paths/search/granules/granules.cy.js +++ b/cypress/e2e/paths/search/granules/granules.cy.js @@ -1239,8 +1239,6 @@ describe('Path /search/granules', () => { body: projectGranuleCollectionsGraphQlBody, headers: projectGranuleGraphQlHeaders }) - } else { - console.log("GET COLLECTIONS", JSON.stringify(req.body)) } } ) From 1cced3b7b393a3a79d15ddb0c2b9de0da53f10f4 Mon Sep 17 00:00:00 2001 From: Brandon Corbett Date: Wed, 17 Jan 2024 16:42:41 -0500 Subject: [PATCH 12/15] Update for playwright --- tests/e2e/map/map.spec.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/e2e/map/map.spec.js b/tests/e2e/map/map.spec.js index d4743001f7..4475e158be 100644 --- a/tests/e2e/map/map.spec.js +++ b/tests/e2e/map/map.spec.js @@ -1443,7 +1443,7 @@ test.describe('Map interactions', () => { await page.route(/api$/, async (route) => { const query = route.request().postData() - expect(query).toEqual('{"query":"\\n query GetGranule(\\n $params: GranuleInput\\n ) {\\n granule(\\n params: $params\\n ) {\\n granuleUr\\n granuleSize\\n title\\n onlineAccessFlag\\n dayNightFlag\\n timeStart\\n timeEnd\\n dataCenter\\n originalFormat\\n conceptId\\n collectionConceptId\\n spatialExtent\\n temporalExtent\\n relatedUrls\\n dataGranule\\n measuredParameters\\n providerDates\\n }\\n }","variables":{"conceptId":"G2061166811-ASF"}}') + expect(query).toEqual('{"query":"\\n query GetGranule(\\n $params: GranuleInput\\n ) {\\n granule(\\n params: $params\\n ) {\\n granuleUr\\n granuleSize\\n title\\n onlineAccessFlag\\n dayNightFlag\\n timeStart\\n timeEnd\\n dataCenter\\n originalFormat\\n conceptId\\n collectionConceptId\\n spatialExtent\\n temporalExtent\\n relatedUrls\\n dataGranule\\n measuredParameters\\n providerDates\\n }\\n }","variables":{"params":{"conceptId":"G2061166811-ASF"}}}') await route.fulfill({ json: granuleGraphQlBody, From 509aac0b1947d54d7ad8afe61cf942906c305695 Mon Sep 17 00:00:00 2001 From: Brandon Corbett Date: Thu, 18 Jan 2024 08:57:23 -0500 Subject: [PATCH 13/15] Update playwright projetions query --- tests/support/graphQlProjectGetCollections.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/support/graphQlProjectGetCollections.js b/tests/support/graphQlProjectGetCollections.js index bc416a70fa..2e12576122 100644 --- a/tests/support/graphQlProjectGetCollections.js +++ b/tests/support/graphQlProjectGetCollections.js @@ -2,4 +2,4 @@ * Return the GraphQl query for verifying the request is what we expect inside of cy.intercept * @param {String} conceptId conceptId to retrieve */ -export const graphQlGetProjectCollections = (conceptId) => `{"query":"\\n query GetProjectCollections (\\n $ids: [String]\\n $includeHasGranules: Boolean\\n $includeTags: String\\n $pageSize: Int\\n $subscriberId: String\\n ) {\\n collections (\\n conceptId: $ids\\n includeHasGranules: $includeHasGranules\\n includeTags: $includeTags\\n limit: $pageSize\\n ) {\\n items {\\n abstract\\n archiveAndDistributionInformation\\n associatedDois\\n boxes\\n cloudHosted\\n conceptId\\n coordinateSystem\\n dataCenter\\n dataCenters\\n dataQualitySummaries {\\n count\\n items {\\n id\\n summary\\n }\\n }\\n directDistributionInformation\\n doi\\n duplicateCollections {\\n count\\n items {\\n id\\n }\\n }\\n hasGranules\\n lines\\n points\\n polygons\\n relatedCollections (\\n limit: 3\\n ) {\\n count\\n items {\\n id\\n title\\n }\\n }\\n relatedUrls\\n scienceKeywords\\n shortName\\n spatialExtent\\n tags\\n temporalExtents\\n tilingIdentificationSystems\\n title\\n versionId\\n services {\\n count\\n items {\\n conceptId\\n longName\\n name\\n type\\n url\\n serviceOptions\\n supportedOutputProjections\\n supportedReformattings\\n maxItemsPerOrder\\n orderOptions {\\n count\\n items {\\n conceptId\\n name\\n form\\n }\\n }\\n variables {\\n count\\n items {\\n conceptId\\n definition\\n longName\\n name\\n nativeId\\n scienceKeywords\\n }\\n }\\n }\\n }\\n granules {\\n count\\n items {\\n browseFlag\\n conceptId\\n onlineAccessFlag\\n links\\n }\\n }\\n subscriptions (\\n subscriberId: $subscriberId\\n ) {\\n count\\n items {\\n collectionConceptId\\n conceptId\\n name\\n query\\n }\\n }\\n tools {\\n count\\n items {\\n longName\\n name\\n potentialAction\\n }\\n }\\n variables {\\n count\\n items {\\n conceptId\\n definition\\n instanceInformation\\n longName\\n name\\n nativeId\\n scienceKeywords\\n }\\n }\\n }\\n }\\n }",variables:{ids:[${conceptId}],includeTags:edsc.*,opensearch.granule.osdd,includeGranuleCounts:true,includeHasGranules:true,pageSize:1}}` +export const graphQlGetProjectCollections = (conceptId) => `{"query":"\\n query GetProjectCollections ($params: CollectionsInput, $subcriptionParams: SubscriptionsInput) {\\n collections (\\n params: $params\\n ) {\\n items {\\n abstract\\n archiveAndDistributionInformation\\n associatedDois\\n boxes\\n cloudHosted\\n conceptId\\n coordinateSystem\\n dataCenter\\n dataCenters\\n dataQualitySummaries {\\n count\\n items {\\n id\\n summary\\n }\\n }\\n directDistributionInformation\\n doi\\n duplicateCollections {\\n count\\n items {\\n id\\n }\\n }\\n hasGranules\\n lines\\n points\\n polygons\\n relatedCollections (\\n limit: 3\\n ) {\\n count\\n items {\\n id\\n title\\n }\\n }\\n relatedUrls\\n scienceKeywords\\n shortName\\n spatialExtent\\n tags\\n temporalExtents\\n tilingIdentificationSystems\\n title\\n versionId\\n services {\\n count\\n items {\\n conceptId\\n longName\\n name\\n type\\n url\\n serviceOptions\\n supportedOutputProjections\\n supportedReformattings\\n maxItemsPerOrder\\n orderOptions {\\n count\\n items {\\n conceptId\\n name\\n form\\n }\\n }\\n variables {\\n count\\n items {\\n conceptId\\n definition\\n longName\\n name\\n nativeId\\n scienceKeywords\\n }\\n }\\n }\\n }\\n granules {\\n count\\n items {\\n browseFlag\\n conceptId\\n onlineAccessFlag\\n links\\n }\\n }\\n subscriptions (\\n params: $subcriptionParams\\n ) {\\n count\\n items {\\n collectionConceptId\\n conceptId\\n name\\n query\\n }\\n }\\n tools {\\n count\\n items {\\n longName\\n name\\n potentialAction\\n }\\n }\\n variables {\\n count\\n items {\\n conceptId\\n definition\\n instanceInformation\\n longName\\n name\\n nativeId\\n scienceKeywords\\n }\\n }\\n }\\n }\\n }","variables":{"params":{"conceptId":["${conceptId}"],"includeTags":"edsc.*,opensearch.granule.osdd","includeHasGranules":true,"pageSize":1},"subcriptionParams":{}}}` From f96176aadf5933eb503597dd3801e6bdb1634522 Mon Sep 17 00:00:00 2001 From: Brandon Corbett Date: Thu, 18 Jan 2024 10:36:48 -0500 Subject: [PATCH 14/15] Remove console statements. --- cypress/e2e/paths/search/granules/granules.cy.js | 2 -- static/src/js/components/GranuleResults/GranuleResultsItem.js | 1 - 2 files changed, 3 deletions(-) diff --git a/cypress/e2e/paths/search/granules/granules.cy.js b/cypress/e2e/paths/search/granules/granules.cy.js index 67f5627d3f..48d53f507d 100644 --- a/cypress/e2e/paths/search/granules/granules.cy.js +++ b/cypress/e2e/paths/search/granules/granules.cy.js @@ -1138,8 +1138,6 @@ describe('Path /search/granules', () => { body: focusedGranuleGranuleGraphQlBody, headers: focusedGranuleGraphQlHeaders }) - } else { - console.log('Granule CORBETT:: ', JSON.stringify(req.body)) } } ) diff --git a/static/src/js/components/GranuleResults/GranuleResultsItem.js b/static/src/js/components/GranuleResults/GranuleResultsItem.js index 12447e8354..d485bdcf32 100644 --- a/static/src/js/components/GranuleResults/GranuleResultsItem.js +++ b/static/src/js/components/GranuleResults/GranuleResultsItem.js @@ -68,7 +68,6 @@ const GranuleResultsItem = forwardRef(({ } const handleClickGranuleDetails = (granuleId) => { - console.log('CORBETT:: ', granuleId) onFocusedGranuleChange(granuleId) } From 6c7fabcac17531656d5f2f2e188da6ae3e4815ce Mon Sep 17 00:00:00 2001 From: Ed Olivares <34591886+eudoroolivares2016@users.noreply.github.com> Date: Wed, 24 Jan 2024 10:47:24 -0500 Subject: [PATCH 15/15] EDSC-3951: Fix granules link calls --- .../src/retrieveGranuleLinks/fetchCmrLinks.js | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/serverless/src/retrieveGranuleLinks/fetchCmrLinks.js b/serverless/src/retrieveGranuleLinks/fetchCmrLinks.js index 57401a016f..a55bcebabf 100644 --- a/serverless/src/retrieveGranuleLinks/fetchCmrLinks.js +++ b/serverless/src/retrieveGranuleLinks/fetchCmrLinks.js @@ -1,7 +1,5 @@ import axios from 'axios' -import camelcaseKeys from 'camelcase-keys' -import { prepareGranuleAccessParams } from '../../../sharedUtils/prepareGranuleAccessParams' import { getApplicationConfig, getEarthdataConfig } from '../../../sharedUtils/config' import { getDownloadUrls } from '../../../sharedUtils/getDownloadUrls' import { getS3Urls } from '../../../sharedUtils/getS3Urls' @@ -31,14 +29,16 @@ export const fetchCmrLinks = async ({ const graphQlUrl = `${graphQlHost}/api` - const preparedGranuleParams = camelcaseKeys(prepareGranuleAccessParams(granuleParams)) + const { concept_id: conceptIdsFromParams = [] } = granuleParams const variables = { - ...preparedGranuleParams, - limit: parseInt(granuleLinksPageSize, 10), - linkTypes: linkTypes.split(','), - collectionConceptId: collectionId, - cursor + params: { + limit: parseInt(granuleLinksPageSize, 10), + linkTypes: linkTypes.split(','), + collectionConceptId: collectionId, + conceptId: conceptIdsFromParams, + cursor + } } const response = await axios({