Skip to content

Commit 79bde08

Browse files
authored
MMT-3991: As a user, I can click on a published or draft Visualization (#1359)
* MMT-3990: Adding Published and Draft Visualizations * MMT-3990: Removing Search Bar for now * MMT-3991: Saving progress * MMT-3991: Working but needs refactor and tests * MMT-3991: Editing tests * MMT-3991: Refactoring * MMT-3991: Few minor fixes * MMT-3991: Editing combined schema * MMT-3991: Adding feature toggle * MMT-3991: Addressing PR feedback * MMT-3991: Code Coverage
1 parent 99e9aa6 commit 79bde08

22 files changed

+2689
-21
lines changed

bin/deploy-bamboo.sh

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,8 @@ config="`jq '.application.cmrHost = $newValue' --arg newValue $bamboo_CMR_HOST <
1919
config="`jq '.application.edscHost = $newValue' --arg newValue $bamboo_EDSC_HOST <<< $config`"
2020
config="`jq '.application.gkrHost = $newValue' --arg newValue $bamboo_GKR_HOST <<< $config`"
2121
config="`jq '.application.kmsHost = $newValue' --arg newValue $bamboo_KMS_HOST <<< $config`"
22+
# Remove in MMT-4028
23+
config="`jq '.application.showVisualizations = ($newValue | tostring)' --arg newValue $bamboo_SHOW_VISUALIZATIONS <<< $config`"
2224
config="`jq '.application.cookieDomain = $newValue' --arg newValue $bamboo_COOKIE_DOMAIN <<< $config`"
2325
config="`jq '.application.displayProdWarning = $newValue' --arg newValue $bamboo_DISPLAY_PROD_WARNING <<< $config`"
2426
config="`jq '.application.tokenValidTime = $newValue' --arg newValue $bamboo_JWT_VALID_TIME <<< $config`"

static.config.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
"mmtHost": "http://localhost:5173",
99
"edscHost": "https://search.sit.earthdata.nasa.gov",
1010
"kmsHost": "https://cmr.sit.earthdata.nasa.gov/kms",
11+
"showVisualizations": "true",
1112
"version": "development",
1213
"defaultResponseHeaders": {
1314
"Access-Control-Allow-Origin": "*",

static/src/js/components/CollectionAssociationForm/CollectionAssociationForm.jsx

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,6 @@ import collectionAssociationUiSchema from '@/js/schemas/uiSchemas/CollectionAsso
4848
import collectionAssociationSearch from '@/js/utils/collectionAssociationSearch'
4949
import errorLogger from '@/js/utils/errorLogger'
5050
import getConceptTypeByConceptId from '@/js/utils/getConceptTypeByConceptId'
51-
5251
import removeEmpty from '@/js/utils/removeEmpty'
5352

5453
import useNotificationsContext from '@/js/hooks/useNotificationsContext'

static/src/js/components/Layout/Layout.jsx

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -19,13 +19,13 @@ import {
1919
import useAuthContext from '@/js/hooks/useAuthContext'
2020
import usePermissions from '@/js/hooks/usePermissions'
2121

22+
import { getApplicationConfig, getUmmVersionsConfig } from 'sharedUtils/getConfig'
23+
2224
import Button from '../Button/Button'
2325
import ErrorBoundary from '../ErrorBoundary/ErrorBoundary'
2426
import PrimaryNavigation from '../PrimaryNavigation/PrimaryNavigation'
2527
import AboutModal from '../AboutModal/AboutModal'
2628

27-
import { getApplicationConfig, getUmmVersionsConfig } from '../../../../../sharedUtils/getConfig'
28-
2929
import './Layout.scss'
3030

3131
/*
@@ -48,7 +48,8 @@ const Layout = ({ className, displayNav }) => {
4848
ummVis
4949
} = getUmmVersionsConfig()
5050

51-
const { env, displayProdWarning } = getApplicationConfig()
51+
// Remove showVisualizations in MMT-4028
52+
const { env, displayProdWarning, showVisualizations } = getApplicationConfig()
5253

5354
const { user } = useAuthContext()
5455

@@ -190,7 +191,8 @@ const Layout = ({ className, displayNav }) => {
190191
}
191192
]
192193
},
193-
{
194+
// Remove in MMT-4028
195+
...((showVisualizations === 'true') ? [{
194196
title: 'Visualizations',
195197
version: `v${ummVis}`,
196198
children: [
@@ -203,7 +205,7 @@ const Layout = ({ className, displayNav }) => {
203205
title: 'Drafts'
204206
}
205207
]
206-
},
208+
}] : []),
207209
{
208210
title: 'Order Options',
209211
children: [

static/src/js/constants/conceptIdTypes.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,8 @@ const conceptIdTypes = {
66
O: 'OrderOption',
77
S: 'Service',
88
T: 'Tool',
9-
V: 'Variable'
9+
V: 'Variable',
10+
VIS: 'Visualization'
1011
}
1112

1213
export default conceptIdTypes

static/src/js/constants/conceptTypeDraftQueries.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,14 @@ import { SERVICE_DRAFT } from '../operations/queries/getServiceDraft'
22
import { TOOL_DRAFT } from '../operations/queries/getToolDraft'
33
import { COLLECTION_DRAFT } from '../operations/queries/getCollectionDraft'
44
import { VARIABLE_DRAFT } from '../operations/queries/getVariableDraft'
5+
import { VISUALIZATION_DRAFT } from '../operations/queries/getVisualizationDraft'
56

67
const conceptTypeDraftQueries = {
78
Collection: COLLECTION_DRAFT,
89
Service: SERVICE_DRAFT,
910
Tool: TOOL_DRAFT,
10-
Variable: VARIABLE_DRAFT
11+
Variable: VARIABLE_DRAFT,
12+
Visualization: VISUALIZATION_DRAFT
1113
}
1214

1315
export default conceptTypeDraftQueries

static/src/js/constants/conceptTypeQueries.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ import { GET_TOOL } from '@/js/operations/queries/getTool'
88
import { GET_TOOLS } from '@/js/operations/queries/getTools'
99
import { GET_VARIABLE } from '@/js/operations/queries/getVariable'
1010
import { GET_VARIABLES } from '@/js/operations/queries/getVariables'
11+
import { GET_VISUALIZATION } from '@/js/operations/queries/getVisualization'
1112
import { GET_VISUALIZATIONS } from '@/js/operations/queries/getVisualizations'
1213

1314
const conceptTypeQueries = {
@@ -21,6 +22,7 @@ const conceptTypeQueries = {
2122
Tools: GET_TOOLS,
2223
Variable: GET_VARIABLE,
2324
Variables: GET_VARIABLES,
25+
Visualization: GET_VISUALIZATION,
2426
Visualizations: GET_VISUALIZATIONS
2527
}
2628

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,15 @@
1-
import { DELETE_COLLECTION } from '../operations/mutations/deleteCollection'
2-
import { DELETE_SERVICE } from '../operations/mutations/deleteService'
3-
import { DELETE_TOOL } from '../operations/mutations/deleteTool'
4-
import { DELETE_VARIABLE } from '../operations/mutations/deleteVariable'
1+
import { DELETE_COLLECTION } from '@/js/operations/mutations/deleteCollection'
2+
import { DELETE_SERVICE } from '@/js/operations/mutations/deleteService'
3+
import { DELETE_TOOL } from '@/js/operations/mutations/deleteTool'
4+
import { DELETE_VARIABLE } from '@/js/operations/mutations/deleteVariable'
5+
import { DELETE_VISUALIZATION } from '@/js/operations/mutations/deleteVisualization'
56

67
const deleteMutationTypes = {
78
Collection: DELETE_COLLECTION,
89
Service: DELETE_SERVICE,
910
Tool: DELETE_TOOL,
10-
Variable: DELETE_VARIABLE
11+
Variable: DELETE_VARIABLE,
12+
Visualization: DELETE_VISUALIZATION
1113
}
1214

1315
export default deleteMutationTypes

static/src/js/constants/draftConceptIdTypes.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,8 @@ const draftConceptIdTypes = {
55
CD: 'Collection',
66
SD: 'Service',
77
TD: 'Tool',
8-
VD: 'Variable'
8+
VD: 'Variable',
9+
VISD: 'Visualization'
910
}
1011

1112
export default draftConceptIdTypes
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
import { gql } from '@apollo/client'
2+
3+
export const DELETE_VISUALIZATION = gql`
4+
mutation DeleteVisualization (
5+
$providerId: String!
6+
$nativeId: String!
7+
) {
8+
deleteVisualization (
9+
providerId: $providerId
10+
nativeId: $nativeId
11+
) {
12+
conceptId
13+
revisionId
14+
}
15+
}
16+
`
17+
18+
// Example Visualizations:
19+
// {
20+
// "conceptId": "V1S200000096-MMT_2",",
21+
// "providerId": "MMT_2"
22+
// }

0 commit comments

Comments
 (0)