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

MMT-3417: As a MMT dev, I want to be able to CRUD UMM-V records in CMR GraphQL #81

Merged
merged 12 commits into from
Nov 17, 2023

Conversation

dmistry1
Copy link
Contributor

@dmistry1 dmistry1 commented Nov 9, 2023

Overview

Added support for Publish Variable Draft and Published Delete Draft.

List impacted areas.

Testing

1.) Has a Published Collection Record handy.
2.) Publish a variable draft

    mutation PublishDraft(
      $draftConceptId: String!
      $nativeId: String!
      $ummVersion: String!
    ) {
      publishDraft(
        draftConceptId: $draftConceptId
        nativeId: $nativeId
        ummVersion: $ummVersion
      ) {
        conceptId
        revisionId
        warnings
        existingErrors
      }
    }

Variables:

    {
      "draftConceptId": "VD1000000001-EXAMPLE",
      "nativeId": "service-1",
      "ummVersion": "1.2.0"
      "collectionConceptId: "C100000-EXAMPLE"
    }

Testing Delete

mutation DeleteService(
   $providerId: String!
   $nativeId: String!
 ) {
   deleteTool(
     providerId: $providerId
     nativeId: $nativeId
   ) {
     conceptId
     revisionId
   }
 }

Variables:

 {
      "providerId": "EXAMPLE",
      "nativeId": "variable-1"
    }

Checklist

  • I have added automated tests that prove my fix is effective or that my feature works
  • New and existing unit tests pass locally with my changes
  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • My changes generate no new warnings

Copy link

codecov bot commented Nov 9, 2023

Codecov Report

All modified and coverable lines are covered by tests ✅

Comparison is base (38851d5) 100.00% compared to head (7c4286a) 100.00%.

Additional details and impacted files
@@            Coverage Diff            @@
##              main       #81   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files           69        69           
  Lines         1516      1538   +22     
  Branches       208       210    +2     
=========================================
+ Hits          1516      1538   +22     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

src/utils/cmrIngest.js Outdated Show resolved Hide resolved
src/utils/cmrIngest.js Outdated Show resolved Hide resolved
src/cmr/concepts/draft.js Show resolved Hide resolved
src/resolvers/variable.js Outdated Show resolved Hide resolved
src/resolvers/__tests__/draft.test.js Outdated Show resolved Hide resolved
src/resolvers/__tests__/draft.test.js Outdated Show resolved Hide resolved
src/resolvers/__tests__/draft.test.js Outdated Show resolved Hide resolved

import { deleteTool as toolSourceDelete, fetchTools as toolSourceFetch } from '../datasources/tool'

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

remove extra line

@@ -25,14 +25,19 @@ import orderOptionSource from '../datasources/orderOption'
import serviceDraftSource from '../datasources/serviceDraft'
import toolDraftSource from '../datasources/toolDraft'
import variableDraftSource from '../datasources/variableDraft'
import variableSource from '../datasources/variable'

import { deleteTool as toolSourceDelete, fetchTools as toolSourceFetch } from '../datasources/tool'
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

try to split this

src/cmr/concepts/draft.js Show resolved Hide resolved
@@ -1759,6 +1813,55 @@ describe('Draft', () => {
}
})
})

test('returns the cmr result when publishing a Publish Draft and collection concept not provided', async () => {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

update test title

src/utils/cmrIngest.js Show resolved Hide resolved
@@ -1759,6 +1813,55 @@ describe('Draft', () => {
}
})
})

test('returns the cmr result when collection concept id not provided', async () => {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

"returns an error when collection concept id not provided"

src/resolvers/__tests__/draft.test.js Outdated Show resolved Hide resolved
@dmistry1 dmistry1 merged commit a2ac8c7 into main Nov 17, 2023
8 checks passed
@dmistry1 dmistry1 deleted the MMT-3417 branch November 17, 2023 15:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants