-
Notifications
You must be signed in to change notification settings - Fork 303
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add error alert type for non-catastrophic errors
- Loading branch information
Showing
17 changed files
with
276 additions
and
157 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
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
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
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
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 |
---|---|---|
@@ -0,0 +1,27 @@ | ||
import * as React from 'react'; | ||
import { AppStore } from 'AppStore'; | ||
import { observer } from 'mobx-react'; | ||
import styles from './errorScreen.module.scss'; | ||
import classNames from 'classnames'; | ||
import _ from 'lodash'; | ||
|
||
export const ErrorAlert: React.FunctionComponent<{ | ||
appStore: AppStore; | ||
}> = observer(function({ appStore }) { | ||
const errorGroups = _.groupBy( | ||
appStore.alertErrors, | ||
e => e.errorObj.message | ||
); | ||
|
||
return appStore.alertErrors.length ? ( | ||
<div className={styles.errorAlert}> | ||
{_.map(errorGroups, (errors, message) => { | ||
return <p>{message}</p>; | ||
})} | ||
<i | ||
className={classNames(styles.dismissButton, 'fa', 'fa-close')} | ||
onClick={() => appStore.alertErrors.clear()} | ||
/> | ||
</div> | ||
) : null; | ||
}); |
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
8 changes: 8 additions & 0 deletions
8
src/shared/components/errorScreen/errorScreen.module.scss.d.ts
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 |
---|---|---|
@@ -0,0 +1,8 @@ | ||
declare const styles: { | ||
readonly "dismissButton": string; | ||
readonly "errorAlert": string; | ||
readonly "errorLogo": string; | ||
readonly "errorScreen": string; | ||
}; | ||
export = styles; | ||
|
This file was deleted.
Oops, something went wrong.
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 |
---|---|---|
@@ -0,0 +1,5 @@ | ||
export const ErrorMessages = { | ||
ONCOKB_LOAD_ERROR: | ||
'Error loading OncoKB annotation data. UI may not accurately reflect Oncogenic status.', | ||
INVALID_GENES: 'INVALID GENE SYMBOLS', | ||
}; |
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 |
---|---|---|
@@ -0,0 +1,5 @@ | ||
import EventBus from 'js-event-bus'; | ||
|
||
const eventBus = new EventBus(); | ||
|
||
export default eventBus; |
Oops, something went wrong.