-
Notifications
You must be signed in to change notification settings - Fork 15
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(notebook): SFKP-1081 add error message, fix typo (#4003)
- Loading branch information
Showing
4 changed files
with
52 additions
and
117 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -722,7 +722,7 @@ const en = { | |
title: 'CAVATICA VWB — Data Studio', | ||
part1: 'Analyze Kids First’s variant data in Cavatica’s', | ||
part2: | ||
'for enhanced data manipulation. Once your files are copied into a Cavatica project, you can explore and combine Kids First participant clinical data, variant annotations, and public external variant databases (such as Ensembl, gnomAD, dbSNFP, OMIM) in JupyterLab with PySpark to conduct statistical analyses, integrate multi-omics data, generate predictive models, and create compelling visualizations.', | ||
'for enhanced data manipulation. Once your files are copied into a Cavatica project, you can explore and combine Kids First participant clinical data, variant annotations, and public external variant databases (such as Ensembl, gnomAD, dbNSFP, OMIM) in JupyterLab with PySpark to conduct statistical analyses, integrate multi-omics data, generate predictive models, and create compelling visualizations.', | ||
part3: | ||
'In order to access and copy variant data in a Cavatica project, you must have authorizations to access select NCI and Kids First controlled data. Connect to our data repository partners using your eRA Commons account to obtain controlled access to variant data.', | ||
readMore: 'Read more on', | ||
|
@@ -743,6 +743,22 @@ const en = { | |
wait: 'This process may take a few moments.', | ||
open: 'Open notebooks', | ||
launch: 'Launch in Cavatica', | ||
error: { | ||
title: 'Error', | ||
no_fence_connection: { | ||
title: 'Connection Error', | ||
description: `We couldn't establish a connection to the data repository partners. Please use your eRA Commons account to connect through the Authorized Studies widget.`, | ||
}, | ||
no_acl: { | ||
title: 'Access denied: insufficient permissions', | ||
description: | ||
'You do not have the necessary permissions to access this controlled data. Please try again or <a href="mailto:[email protected]">Contact support</a>.', | ||
}, | ||
no_file_for_acls: { | ||
title: 'No variant data available', | ||
description: 'No variant data was found for your permitted controlled access list.', | ||
}, | ||
}, | ||
}, | ||
fhirDataResource: { | ||
title: 'Kids First FHIR API', | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,70 +1,52 @@ | ||
import intl from 'react-intl-universal'; | ||
import { createAsyncThunk } from '@reduxjs/toolkit'; | ||
|
||
import { NotebookApi } from 'services/api/notebook'; | ||
import { TNotebookApiResponse } from 'services/api/notebook/model'; | ||
import { RootState } from 'store/types'; | ||
import { handleThunkApiReponse } from 'store/utils'; | ||
|
||
import { globalActions } from '../global'; | ||
|
||
const getNotebookClusterManifest = createAsyncThunk< | ||
TNotebookApiResponse, | ||
{ | ||
onSuccess: () => void; | ||
}, | ||
void, | ||
{ rejectValue: string; state: RootState } | ||
>('notebook/manifest', async (args, thunkAPI) => { | ||
const { data, error } = await NotebookApi.getManifest(); | ||
|
||
let errorMessage = ''; | ||
let errorDescription = ''; | ||
if (error) { | ||
return thunkAPI.rejectWithValue(error?.message); | ||
} | ||
|
||
args.onSuccess(); | ||
|
||
return handleThunkApiReponse({ | ||
error, | ||
data: data!, | ||
reject: thunkAPI.rejectWithValue, | ||
}); | ||
}); | ||
|
||
const getNotebookClusterStatus = createAsyncThunk< | ||
TNotebookApiResponse, | ||
void, | ||
{ rejectValue: string; state: RootState } | ||
>('notebook/get', async (_, thunkAPI) => { | ||
const { data, error } = await NotebookApi.getStatus(); | ||
|
||
if (error) { | ||
return thunkAPI.rejectWithValue(error?.message); | ||
const msg = error.response?.data?.error ?? ''; | ||
if (msg === 'no_fence_connection') { | ||
errorMessage = 'screen.dashboard.cards.notebook.error.no_fence_connection.message'; | ||
errorDescription = 'screen.dashboard.cards.notebook.error.no_fence_connection.description'; | ||
} else if (msg === 'no_acl') { | ||
errorMessage = 'screen.dashboard.cards.notebook.error.no_acl.message'; | ||
errorDescription = 'screen.dashboard.cards.notebook.error.no_acl.description'; | ||
} else if (msg === 'no_file_for_acls') { | ||
errorMessage = 'screen.dashboard.cards.notebook.error.no_file_for_acls.message'; | ||
errorDescription = 'screen.dashboard.cards.notebook.error.no_file_for_acls.description'; | ||
} | ||
} | ||
|
||
return handleThunkApiReponse({ | ||
error, | ||
onError: () => { | ||
if (errorMessage && errorDescription) { | ||
thunkAPI.dispatch( | ||
globalActions.displayNotification({ | ||
type: 'error', | ||
message: intl.get('screen.dashboard.cards.notebook.error.title'), | ||
description: intl.get(errorDescription), | ||
}), | ||
); | ||
} | ||
}, | ||
data: data!, | ||
reject: thunkAPI.rejectWithValue, | ||
}); | ||
}); | ||
|
||
const stopNotebookCluster = createAsyncThunk< | ||
void, | ||
{ | ||
onSuccess: () => void; | ||
}, | ||
{ rejectValue: string; state: RootState } | ||
>('notebook/stop', async (args, thunkAPI) => { | ||
const { data, error } = await NotebookApi.stop(); | ||
|
||
if (error) { | ||
return thunkAPI.rejectWithValue(error?.message); | ||
} | ||
|
||
args.onSuccess(); | ||
|
||
return handleThunkApiReponse({ | ||
error, | ||
data, | ||
reject: thunkAPI.rejectWithValue, | ||
}); | ||
}); | ||
|
||
export { getNotebookClusterManifest, getNotebookClusterStatus, stopNotebookCluster }; | ||
export { getNotebookClusterManifest }; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters