Skip to content

Commit

Permalink
MMT-3903: Update MMT to the new UMM-C schema (#1321)
Browse files Browse the repository at this point in the history
* MMT-3903: Update MMT to the new UMM-C schema

* MMT-3903: Test fix

* MMT-3903: destructuring and test fix

* MMT-3903: Running bin/download_schemas.sh

* Revert "MMT-3903: destructuring and test fix"

This reverts commit 481c925.

* Revert "MMT-3903: Running bin/download_schemas.sh"

This reverts commit 5b9421e.

* MMT-3903: Test fix
  • Loading branch information
mandyparson authored Nov 15, 2024
1 parent 9316f6f commit c84acf9
Show file tree
Hide file tree
Showing 5 changed files with 25 additions and 9 deletions.
2 changes: 1 addition & 1 deletion sharedUtils/__tests__/getConfig.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ describe('getConfig', () => {
describe('when ummVersionConfig is called', () => {
test('returns a valid json object for ummVersionConfig', () => {
const expectedUmmVersionConfig = {
ummC: '1.18.1',
ummC: '1.18.2',
ummS: '1.5.3',
ummT: '1.2.0',
ummV: '1.9.0'
Expand Down
2 changes: 1 addition & 1 deletion static.config.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
}
},
"ummVersions": {
"ummC": "1.18.1",
"ummC": "1.18.2",
"ummS": "1.5.3",
"ummT": "1.2.0",
"ummV": "1.9.0"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,13 +46,19 @@ import useAvailableProviders from '@/js/hooks/useAvailableProviders'

import TemplateForm from '../TemplateForm'

import staticConfig from '../../../../../../static.config.json'

vi.mock('@/js/utils/createTemplate')
vi.mock('@/js/utils/errorLogger')
vi.mock('@/js/utils/getTemplate')
vi.mock('@/js/utils/updateTemplate')
vi.mock('@/js/components/ErrorBanner/ErrorBanner')
vi.mock('@/js/components/FormNavigation/FormNavigation')

const getConfig = () => staticConfig

const ummCVersion = getConfig().ummVersions.ummC

vi.mock('@/js/hooks/useAvailableProviders')
useAvailableProviders.mockReturnValue({
providerIds: ['MMT_1', 'MMT_2']
Expand Down Expand Up @@ -503,7 +509,7 @@ describe('TemplateForm', () => {
},
nativeId: 'MMT_mock-uuid',
providerId: 'MMT_2',
ummVersion: '1.18.1'
ummVersion: `${ummCVersion}`
}
},
result: {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,12 +24,18 @@ import errorLogger from '../../../utils/errorLogger'
import getTemplate from '../../../utils/getTemplate'
import { INGEST_DRAFT } from '../../../operations/mutations/ingestDraft'

import staticConfig from '../../../../../../static.config.json'

vi.mock('../../../utils/getTemplate')
vi.mock('../../ErrorBanner/ErrorBanner')
vi.mock('../../PreviewProgress/PreviewProgress')
vi.mock('../../../utils/errorLogger')
vi.mock('../../../utils/deleteTemplate')

const getConfig = () => staticConfig

const ummCVersion = getConfig().ummVersions.ummC

const setup = () => {
const user = userEvent.setup()

Expand Down Expand Up @@ -365,7 +371,7 @@ describe('TemplatePreview', () => {
},
nativeId: 'MMT_mock-uuid',
providerId: 'MMT_2',
ummVersion: '1.18.1'
ummVersion: `${ummCVersion}`
}
},
result: {
Expand Down Expand Up @@ -407,7 +413,7 @@ describe('TemplatePreview', () => {
},
nativeId: 'MMT_mock-uuid',
providerId: 'MMT_2',
ummVersion: '1.18.1'
ummVersion: `${ummCVersion}`
}
},
error: new Error('An error occurred')
Expand Down
12 changes: 8 additions & 4 deletions static/src/js/schemas/umm/ummCSchema.js
Original file line number Diff line number Diff line change
Expand Up @@ -3227,8 +3227,10 @@ const ummCSchema = {
'PLANNED',
'COMPLETE',
'DEPRECATED',
'NOT APPLICABLE',
'NOT PROVIDED'
'INREVIEW',
'NOT PROVIDED',
'PREPRINT',
'SUPERSEDED'
]
},
LocationKeywordType: {
Expand Down Expand Up @@ -3688,6 +3690,8 @@ const ummCSchema = {
'Child Dataset',
'Collaborative/Other Agency',
'Field Campaign',
'IsPreviousVersionOf',
'IsNewVersionOf',
'Parent Dataset',
'Related Dataset'
]
Expand Down Expand Up @@ -3809,7 +3813,7 @@ const ummCSchema = {
description: 'This element represents the URL where the schema lives. The schema can be downloaded.',
type: 'string',
enum: [
'https://cdn.earthdata.nasa.gov/umm/collection/v1.18.1'
'https://cdn.earthdata.nasa.gov/umm/collection/v1.18.2'
]
},
Name: {
Expand All @@ -3823,7 +3827,7 @@ const ummCSchema = {
description: 'This element represents the version of the schema.',
type: 'string',
enum: [
'1.18.1'
'1.18.2'
]
}
},
Expand Down

0 comments on commit c84acf9

Please sign in to comment.