-
Notifications
You must be signed in to change notification settings - Fork 61
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add about dialog with version number for embedded components (#3162)
* Output version * Add version * Use IconButton * Update snaps * Only bundle after postversion so that we get the proper version bundled in the app
- Loading branch information
Showing
14 changed files
with
325 additions
and
76 deletions.
There are no files selected for viewing
10 changes: 10 additions & 0 deletions
10
products/jbrowse-react-circular-genome-view/output-version.js
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,10 @@ | ||
// used to output a version.js file to the src folder | ||
// this avoids bundlers having to know how to import ../../package.json or similar for downstream consumers | ||
const fs = require('fs') | ||
|
||
// eslint-disable-next-line no-console | ||
console.log( | ||
`export const version = '${ | ||
JSON.parse(fs.readFileSync('package.json')).version | ||
}'`, | ||
) |
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
96 changes: 96 additions & 0 deletions
96
products/jbrowse-react-circular-genome-view/src/JBrowseCircularGenomeView/AboutDialog.tsx
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,96 @@ | ||
import React from 'react' | ||
import { version } from '../version' | ||
import { | ||
Dialog, | ||
DialogContent, | ||
DialogTitle, | ||
IconButton, | ||
Link, | ||
Typography, | ||
} from '@mui/material' | ||
import CloseIcon from '@mui/icons-material/Close' | ||
import { makeStyles } from 'tss-react/mui' | ||
|
||
const useStyles = makeStyles()(theme => ({ | ||
closeButton: { | ||
position: 'absolute', | ||
right: theme.spacing(1), | ||
top: theme.spacing(1), | ||
color: theme.palette.grey[500], | ||
}, | ||
content: { | ||
minWidth: 800, | ||
}, | ||
})) | ||
|
||
export default function AboutDialog({ | ||
open, | ||
onClose, | ||
}: { | ||
open: boolean | ||
onClose: () => void | ||
}) { | ||
const { classes } = useStyles() | ||
return ( | ||
<Dialog open={open} onClose={onClose} maxWidth="xl"> | ||
<DialogTitle> | ||
JBrowse v{version} | ||
<IconButton | ||
className={classes.closeButton} | ||
onClick={() => onClose()} | ||
size="large" | ||
> | ||
<CloseIcon /> | ||
</IconButton> | ||
</DialogTitle> | ||
<DialogContent className={classes.content}> | ||
<Typography> | ||
JBrowse is a GMOD project © 2019-2021, The Evolutionary Software | ||
Foundation | ||
</Typography> | ||
<Typography> | ||
Here are some resources and documentation. Please report the version | ||
number above when asking questions. Thanks! | ||
</Typography> | ||
<ul> | ||
<li> | ||
<Link | ||
href="https://github.com/GMOD/jbrowse-components/discussions" | ||
target="_blank" | ||
rel="noopener noreferrer" | ||
> | ||
Question & answer forum | ||
</Link> | ||
</li> | ||
<li> | ||
<Link | ||
href="https://github.com/GMOD/jbrowse-components/issues/new/choose" | ||
target="_blank" | ||
rel="noopener noreferrer" | ||
> | ||
Report a bug | ||
</Link> | ||
</li> | ||
<li> | ||
<Link | ||
href="https://jbrowse.org/jb2/docs/user_guide" | ||
target="_blank" | ||
rel="noopener noreferrer" | ||
> | ||
User guide | ||
</Link> | ||
</li> | ||
<li> | ||
<Link | ||
href="https://jbrowse.org/jb2/docs/" | ||
target="_blank" | ||
rel="noopener noreferrer" | ||
> | ||
Documentation | ||
</Link> | ||
</li> | ||
</ul> | ||
</DialogContent> | ||
</Dialog> | ||
) | ||
} |
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 @@ | ||
export const version = '2.1.2' |
10 changes: 10 additions & 0 deletions
10
products/jbrowse-react-linear-genome-view/output-version.js
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,10 @@ | ||
// used to output a version.js file to the src folder | ||
// this avoids bundlers having to know how to import ../../package.json or similar for downstream consumers | ||
const fs = require('fs') | ||
|
||
// eslint-disable-next-line no-console | ||
console.log( | ||
`export const version = '${ | ||
JSON.parse(fs.readFileSync('package.json')).version | ||
}'`, | ||
) |
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
96 changes: 96 additions & 0 deletions
96
products/jbrowse-react-linear-genome-view/src/JBrowseLinearGenomeView/AboutDialog.tsx
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,96 @@ | ||
import React from 'react' | ||
import { version } from '../version' | ||
import { | ||
Dialog, | ||
DialogContent, | ||
DialogTitle, | ||
IconButton, | ||
Link, | ||
Typography, | ||
} from '@mui/material' | ||
import CloseIcon from '@mui/icons-material/Close' | ||
import { makeStyles } from 'tss-react/mui' | ||
|
||
const useStyles = makeStyles()(theme => ({ | ||
closeButton: { | ||
position: 'absolute', | ||
right: theme.spacing(1), | ||
top: theme.spacing(1), | ||
color: theme.palette.grey[500], | ||
}, | ||
content: { | ||
minWidth: 800, | ||
}, | ||
})) | ||
|
||
export default function AboutDialog({ | ||
open, | ||
onClose, | ||
}: { | ||
open: boolean | ||
onClose: () => void | ||
}) { | ||
const { classes } = useStyles() | ||
return ( | ||
<Dialog open={open} onClose={onClose} maxWidth="xl"> | ||
<DialogTitle> | ||
JBrowse v{version} | ||
<IconButton | ||
className={classes.closeButton} | ||
onClick={() => onClose()} | ||
size="large" | ||
> | ||
<CloseIcon /> | ||
</IconButton> | ||
</DialogTitle> | ||
<DialogContent className={classes.content}> | ||
<Typography> | ||
JBrowse is a GMOD project © 2019-2021, The Evolutionary Software | ||
Foundation | ||
</Typography> | ||
<Typography> | ||
Here are some resources and documentation. Please report the version | ||
number above when asking questions. Thanks! | ||
</Typography> | ||
<ul> | ||
<li> | ||
<Link | ||
href="https://github.com/GMOD/jbrowse-components/discussions" | ||
target="_blank" | ||
rel="noopener noreferrer" | ||
> | ||
Question & answer forum | ||
</Link> | ||
</li> | ||
<li> | ||
<Link | ||
href="https://github.com/GMOD/jbrowse-components/issues/new/choose" | ||
target="_blank" | ||
rel="noopener noreferrer" | ||
> | ||
Report a bug | ||
</Link> | ||
</li> | ||
<li> | ||
<Link | ||
href="https://jbrowse.org/jb2/docs/user_guide" | ||
target="_blank" | ||
rel="noopener noreferrer" | ||
> | ||
User guide | ||
</Link> | ||
</li> | ||
<li> | ||
<Link | ||
href="https://jbrowse.org/jb2/docs/" | ||
target="_blank" | ||
rel="noopener noreferrer" | ||
> | ||
Documentation | ||
</Link> | ||
</li> | ||
</ul> | ||
</DialogContent> | ||
</Dialog> | ||
) | ||
} |
Oops, something went wrong.