@jbrowse/plugin-data-management 2.2.0 → 2.2.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (67) hide show
  1. package/dist/AddTrackWidget/components/AddTrackWidget.js +2 -0
  2. package/dist/AddTrackWidget/components/AddTrackWidget.js.map +1 -1
  3. package/dist/AddTrackWidget/components/PasteConfigWorkflow.d.ts +7 -0
  4. package/dist/AddTrackWidget/components/PasteConfigWorkflow.js +66 -0
  5. package/dist/AddTrackWidget/components/PasteConfigWorkflow.js.map +1 -0
  6. package/dist/AddTrackWidget/model.d.ts +2 -2
  7. package/dist/AssemblyManager/AssemblyAddForm.js +14 -41
  8. package/dist/AssemblyManager/AssemblyAddForm.js.map +1 -1
  9. package/dist/AssemblyManager/AssemblyEditor.js +2 -1
  10. package/dist/AssemblyManager/AssemblyEditor.js.map +1 -1
  11. package/dist/AssemblyManager/AssemblyManager.js +14 -54
  12. package/dist/AssemblyManager/AssemblyManager.js.map +1 -1
  13. package/dist/AssemblyManager/AssemblyTable.js +24 -47
  14. package/dist/AssemblyManager/AssemblyTable.js.map +1 -1
  15. package/dist/HierarchicalTrackSelectorWidget/components/ManageConnectionsDialog.js +4 -12
  16. package/dist/HierarchicalTrackSelectorWidget/components/ManageConnectionsDialog.js.map +1 -1
  17. package/dist/HierarchicalTrackSelectorWidget/components/ToggleConnectionsDialog.js +2 -12
  18. package/dist/HierarchicalTrackSelectorWidget/components/ToggleConnectionsDialog.js.map +1 -1
  19. package/dist/HierarchicalTrackSelectorWidget/model.d.ts +3 -3
  20. package/dist/HierarchicalTrackSelectorWidget/model.js +1 -1
  21. package/dist/HierarchicalTrackSelectorWidget/model.js.map +1 -1
  22. package/dist/PluginStoreWidget/components/CustomPluginForm.js +1 -11
  23. package/dist/PluginStoreWidget/components/CustomPluginForm.js.map +1 -1
  24. package/dist/PluginStoreWidget/components/PluginStoreWidget.js.map +1 -1
  25. package/dist/PluginStoreWidget/model.d.ts +2 -2
  26. package/esm/AddTrackWidget/components/AddTrackWidget.js +2 -0
  27. package/esm/AddTrackWidget/components/AddTrackWidget.js.map +1 -1
  28. package/esm/AddTrackWidget/components/PasteConfigWorkflow.d.ts +7 -0
  29. package/esm/AddTrackWidget/components/PasteConfigWorkflow.js +41 -0
  30. package/esm/AddTrackWidget/components/PasteConfigWorkflow.js.map +1 -0
  31. package/esm/AddTrackWidget/model.d.ts +2 -2
  32. package/esm/AddTrackWidget/model.js +1 -1
  33. package/esm/AssemblyManager/AssemblyAddForm.js +9 -36
  34. package/esm/AssemblyManager/AssemblyAddForm.js.map +1 -1
  35. package/esm/AssemblyManager/AssemblyEditor.js +2 -1
  36. package/esm/AssemblyManager/AssemblyEditor.js.map +1 -1
  37. package/esm/AssemblyManager/AssemblyManager.js +15 -55
  38. package/esm/AssemblyManager/AssemblyManager.js.map +1 -1
  39. package/esm/AssemblyManager/AssemblyTable.js +25 -48
  40. package/esm/AssemblyManager/AssemblyTable.js.map +1 -1
  41. package/esm/HierarchicalTrackSelectorWidget/components/ManageConnectionsDialog.js +5 -13
  42. package/esm/HierarchicalTrackSelectorWidget/components/ManageConnectionsDialog.js.map +1 -1
  43. package/esm/HierarchicalTrackSelectorWidget/components/ToggleConnectionsDialog.js +3 -13
  44. package/esm/HierarchicalTrackSelectorWidget/components/ToggleConnectionsDialog.js.map +1 -1
  45. package/esm/HierarchicalTrackSelectorWidget/model.d.ts +3 -3
  46. package/esm/HierarchicalTrackSelectorWidget/model.js +2 -2
  47. package/esm/HierarchicalTrackSelectorWidget/model.js.map +1 -1
  48. package/esm/PluginStoreWidget/components/CustomPluginForm.js +2 -12
  49. package/esm/PluginStoreWidget/components/CustomPluginForm.js.map +1 -1
  50. package/esm/PluginStoreWidget/components/PluginStoreWidget.js.map +1 -1
  51. package/esm/PluginStoreWidget/model.d.ts +2 -2
  52. package/package.json +3 -3
  53. package/src/AddTrackWidget/components/AddTrackWidget.tsx +2 -0
  54. package/src/AddTrackWidget/components/PasteConfigWorkflow.tsx +64 -0
  55. package/src/AddTrackWidget/model.ts +1 -1
  56. package/src/AssemblyManager/AssemblyAddForm.tsx +147 -182
  57. package/src/AssemblyManager/AssemblyEditor.tsx +5 -1
  58. package/src/AssemblyManager/AssemblyManager.test.tsx +1 -1
  59. package/src/AssemblyManager/AssemblyManager.tsx +70 -137
  60. package/src/AssemblyManager/AssemblyTable.tsx +65 -97
  61. package/src/HierarchicalTrackSelectorWidget/components/ManageConnectionsDialog.tsx +5 -20
  62. package/src/HierarchicalTrackSelectorWidget/components/ToggleConnectionsDialog.tsx +7 -21
  63. package/src/HierarchicalTrackSelectorWidget/model.ts +7 -2
  64. package/src/PluginStoreWidget/components/CustomPluginForm.tsx +1 -18
  65. package/src/PluginStoreWidget/components/PluginStoreWidget.tsx +1 -0
  66. package/src/PluginStoreWidget/components/__snapshots__/PluginStoreWidget.test.js.snap +22 -0
  67. package/src/__snapshots__/index.test.js.snap +4 -4
@@ -9,112 +9,80 @@ import {
9
9
  TableHead,
10
10
  TableRow,
11
11
  Paper,
12
- Typography,
13
12
  } from '@mui/material'
14
- import { makeStyles } from 'tss-react/mui'
15
-
16
- import CreateIcon from '@mui/icons-material/Create'
17
- import DeleteIcon from '@mui/icons-material/Delete'
18
13
  import {
19
14
  readConfObject,
20
15
  AnyConfigurationModel,
21
16
  } from '@jbrowse/core/configuration'
22
17
 
23
- const useStyles = makeStyles()(() => ({
24
- table: {
25
- minWidth: 500,
26
- minHeight: 150,
27
- },
28
- buttonCell: {
29
- padding: 3,
30
- },
31
- button: {
32
- display: 'inline-block',
33
- padding: 3,
34
- minHeight: 0,
35
- minWidth: 0,
36
- },
37
- }))
38
-
39
- const AssemblyTable = observer(
40
- ({
41
- rootModel,
42
- setIsAssemblyBeingEdited,
43
- setAssemblyBeingEdited,
44
- }: {
45
- rootModel: {
46
- jbrowse: {
47
- removeAssemblyConf: (arg: string) => void
48
- assemblies: AnyConfigurationModel[]
49
- }
50
- }
51
- setIsAssemblyBeingEdited(arg: boolean): void
52
- setAssemblyBeingEdited(arg: AnyConfigurationModel): void
53
- }) => {
54
- const { classes } = useStyles()
18
+ import CreateIcon from '@mui/icons-material/Create'
19
+ import DeleteIcon from '@mui/icons-material/Delete'
55
20
 
56
- function removeAssembly(name: string) {
57
- rootModel.jbrowse.removeAssemblyConf(name)
21
+ const AssemblyTable = observer(function ({
22
+ rootModel,
23
+ setIsAssemblyBeingEdited,
24
+ setAssemblyBeingEdited,
25
+ }: {
26
+ rootModel: {
27
+ jbrowse: {
28
+ removeAssemblyConf: (arg: string) => void
29
+ assemblies: AnyConfigurationModel[]
58
30
  }
31
+ }
32
+ setIsAssemblyBeingEdited(arg: boolean): void
33
+ setAssemblyBeingEdited(arg: AnyConfigurationModel): void
34
+ }) {
35
+ function removeAssembly(name: string) {
36
+ rootModel.jbrowse.removeAssemblyConf(name)
37
+ }
59
38
 
60
- const rows = rootModel.jbrowse.assemblies.map(assembly => {
61
- const name = readConfObject(assembly, 'name')
62
- const displayName = readConfObject(assembly, 'displayName')
63
- const aliases = readConfObject(assembly, 'aliases')
64
- return (
65
- <TableRow key={name}>
66
- <TableCell>{name}</TableCell>
67
- <TableCell>{displayName}</TableCell>
68
- <TableCell>{aliases ? aliases.toString() : ''}</TableCell>
69
- <TableCell className={classes.buttonCell}>
70
- <IconButton
71
- data-testid={`${name}-edit`}
72
- className={classes.button}
73
- onClick={() => {
74
- setIsAssemblyBeingEdited(true)
75
- setAssemblyBeingEdited(assembly)
76
- }}
77
- >
78
- <CreateIcon color="primary" />
79
- </IconButton>
80
- <IconButton
81
- data-testid={`${name}-delete`}
82
- className={classes.button}
83
- onClick={() => {
84
- removeAssembly(name)
85
- }}
86
- >
87
- <DeleteIcon color="error" />
88
- </IconButton>
89
- </TableCell>
90
- </TableRow>
91
- )
92
- })
39
+ const { assemblies } = rootModel.jbrowse
93
40
 
94
- return (
95
- <TableContainer component={Paper}>
96
- <Table className={classes.table}>
97
- <TableHead>
98
- <TableRow>
99
- <TableCell>
100
- <Typography variant="h5">Name</Typography>
101
- </TableCell>
102
- <TableCell>
103
- <Typography variant="h5">Display name</Typography>
104
- </TableCell>
105
- <TableCell>
106
- <Typography variant="h5">Aliases</Typography>
107
- </TableCell>
108
- <TableCell>
109
- <Typography variant="h5">Actions</Typography>
110
- </TableCell>
111
- </TableRow>
112
- </TableHead>
113
- <TableBody>{rows}</TableBody>
114
- </Table>
115
- </TableContainer>
116
- )
117
- },
118
- )
41
+ return (
42
+ <TableContainer component={Paper}>
43
+ <Table>
44
+ <TableHead>
45
+ <TableRow>
46
+ <TableCell>Name</TableCell>
47
+ <TableCell>Display name</TableCell>
48
+ <TableCell>Aliases</TableCell>
49
+ <TableCell>Actions</TableCell>
50
+ </TableRow>
51
+ </TableHead>
52
+ <TableBody>
53
+ {assemblies.map(assembly => {
54
+ const name = readConfObject(assembly, 'name')
55
+ const displayName = readConfObject(assembly, 'displayName')
56
+ const aliases = readConfObject(assembly, 'aliases')
57
+ return (
58
+ <TableRow key={name}>
59
+ <TableCell>{name}</TableCell>
60
+ <TableCell>{displayName}</TableCell>
61
+ <TableCell>{aliases ? aliases.toString() : ''}</TableCell>
62
+ <TableCell>
63
+ <IconButton
64
+ data-testid={`${name}-edit`}
65
+ onClick={() => {
66
+ setIsAssemblyBeingEdited(true)
67
+ setAssemblyBeingEdited(assembly)
68
+ }}
69
+ >
70
+ <CreateIcon color="primary" />
71
+ </IconButton>
72
+ <IconButton
73
+ data-testid={`${name}-delete`}
74
+ onClick={() => removeAssembly(name)}
75
+ >
76
+ <DeleteIcon color="error" />
77
+ </IconButton>
78
+ </TableCell>
79
+ </TableRow>
80
+ )
81
+ })}
82
+ </TableBody>
83
+ </Table>
84
+ </TableContainer>
85
+ )
86
+ })
119
87
 
120
88
  export default AssemblyTable
@@ -1,16 +1,14 @@
1
1
  import React from 'react'
2
2
  import {
3
3
  Button,
4
- Dialog,
5
- DialogTitle,
6
4
  DialogContent,
7
5
  DialogActions,
8
6
  IconButton,
9
7
  Tooltip,
10
8
  Typography,
11
9
  } from '@mui/material'
10
+ import { Dialog } from '@jbrowse/core/ui'
12
11
  import { makeStyles } from 'tss-react/mui'
13
- import CloseIcon from '@mui/icons-material/Close'
14
12
  import { observer } from 'mobx-react'
15
13
  import {
16
14
  AnyConfigurationModel,
@@ -18,14 +16,10 @@ import {
18
16
  } from '@jbrowse/core/configuration'
19
17
  import { AbstractSessionModel } from '@jbrowse/core/util'
20
18
 
21
- const useStyles = makeStyles()(theme => ({
22
- closeButton: {
23
- position: 'absolute',
24
- right: theme.spacing(1),
25
- top: theme.spacing(1),
26
- color: theme.palette.grey[500],
27
- },
19
+ // icons
20
+ import CloseIcon from '@mui/icons-material/Close'
28
21
 
22
+ const useStyles = makeStyles()(theme => ({
29
23
  connectionContainer: {
30
24
  margin: theme.spacing(4),
31
25
  width: 500,
@@ -44,16 +38,7 @@ function ManageConnectionsDlg({
44
38
  const { classes } = useStyles()
45
39
  const { adminMode, connections, sessionConnections } = session
46
40
  return (
47
- <Dialog open onClose={handleClose} maxWidth="lg">
48
- <DialogTitle>
49
- Delete connections
50
- <IconButton
51
- className={classes.closeButton}
52
- onClick={() => handleClose()}
53
- >
54
- <CloseIcon />
55
- </IconButton>
56
- </DialogTitle>
41
+ <Dialog open onClose={handleClose} maxWidth="lg" title="Delete connections">
57
42
  <DialogContent>
58
43
  <Typography>
59
44
  Click the X icon to delete the connection from your config completely
@@ -2,16 +2,13 @@ import React from 'react'
2
2
  import {
3
3
  Button,
4
4
  Checkbox,
5
- Dialog,
6
- DialogTitle,
7
5
  DialogContent,
8
6
  DialogActions,
9
7
  FormControlLabel,
10
- IconButton,
11
8
  Typography,
12
9
  } from '@mui/material'
10
+ import { Dialog } from '@jbrowse/core/ui'
13
11
  import { makeStyles } from 'tss-react/mui'
14
- import CloseIcon from '@mui/icons-material/Close'
15
12
  import { observer } from 'mobx-react'
16
13
  import {
17
14
  AnyConfigurationModel,
@@ -24,13 +21,6 @@ export function ellipses(slug: string) {
24
21
  }
25
22
 
26
23
  const useStyles = makeStyles()(theme => ({
27
- closeButton: {
28
- position: 'absolute',
29
- right: theme.spacing(1),
30
- top: theme.spacing(1),
31
- color: theme.palette.grey[500],
32
- },
33
-
34
24
  connectionContainer: {
35
25
  width: 500,
36
26
  margin: theme.spacing(4),
@@ -49,16 +39,12 @@ function ToggleConnectionDialog({
49
39
  const { classes } = useStyles()
50
40
  const { connections, connectionInstances: instances = [] } = session
51
41
  return (
52
- <Dialog open onClose={handleClose} maxWidth="lg">
53
- <DialogTitle>
54
- Turn on/off connections
55
- <IconButton
56
- className={classes.closeButton}
57
- onClick={() => handleClose()}
58
- >
59
- <CloseIcon />
60
- </IconButton>
61
- </DialogTitle>
42
+ <Dialog
43
+ open
44
+ onClose={handleClose}
45
+ maxWidth="lg"
46
+ title="Turn on/off connections"
47
+ >
62
48
  <DialogContent>
63
49
  <Typography>Use the checkbox to turn on/off connections</Typography>
64
50
  <div className={classes.connectionContainer}>
@@ -4,7 +4,12 @@ import {
4
4
  readConfObject,
5
5
  AnyConfigurationModel,
6
6
  } from '@jbrowse/core/configuration'
7
- import { AbstractSessionModel, getSession, getEnv } from '@jbrowse/core/util'
7
+ import {
8
+ AbstractSessionModel,
9
+ dedupe,
10
+ getSession,
11
+ getEnv,
12
+ } from '@jbrowse/core/util'
8
13
  import { getTrackName } from '@jbrowse/core/util/tracks'
9
14
  import { ElementId } from '@jbrowse/core/util/types/mst'
10
15
  import PluginManager from '@jbrowse/core/PluginManager'
@@ -135,7 +140,7 @@ export default function stateTreeFactory(pluginManager: PluginManager) {
135
140
  }))
136
141
  .actions(self => ({
137
142
  addToSelection(elt: AnyConfigurationModel[]) {
138
- self.selection = [...self.selection, ...elt]
143
+ self.selection = dedupe([...self.selection, ...elt], e => e.trackId)
139
144
  },
140
145
  removeFromSelection(elt: AnyConfigurationModel[]) {
141
146
  self.selection = self.selection.filter(f => !elt.includes(f))
@@ -7,7 +7,6 @@ import {
7
7
  Collapse,
8
8
  Dialog,
9
9
  DialogActions,
10
- DialogTitle,
11
10
  DialogContent,
12
11
  DialogContentText,
13
12
  TextField,
@@ -16,18 +15,12 @@ import { makeStyles } from 'tss-react/mui'
16
15
 
17
16
  // icons
18
17
  import IconButton from '@mui/material/IconButton'
19
- import CloseIcon from '@mui/icons-material/Close'
20
18
  import ExpandMoreIcon from '@mui/icons-material/ExpandMore'
21
19
 
22
20
  // locals
23
21
  import { PluginStoreModel } from '../model'
24
22
 
25
23
  const useStyles = makeStyles()(theme => ({
26
- closeButton: {
27
- position: 'absolute',
28
- right: theme.spacing(1),
29
- top: theme.spacing(1),
30
- },
31
24
  dialogContent: {
32
25
  display: 'flex',
33
26
  flexDirection: 'column',
@@ -114,17 +107,7 @@ function CustomPluginForm({
114
107
  }
115
108
 
116
109
  return (
117
- <Dialog open={open} onClose={handleClose}>
118
- <DialogTitle>
119
- Add custom plugin
120
- <IconButton
121
- size="medium"
122
- className={classes.closeButton}
123
- onClick={() => onClose()}
124
- >
125
- <CloseIcon />
126
- </IconButton>
127
- </DialogTitle>
110
+ <Dialog open={open} onClose={handleClose} title="Add custom plugin">
128
111
  <form onSubmit={handleSubmit}>
129
112
  <DialogContent className={classes.dialogContent}>
130
113
  <DialogContentText>
@@ -61,6 +61,7 @@ function PluginStoreWidget({ model }: { model: PluginStoreModel }) {
61
61
  const controller = new AbortController()
62
62
  const { signal } = controller
63
63
 
64
+ // eslint-disable-next-line @typescript-eslint/no-floating-promises
64
65
  ;(async () => {
65
66
  try {
66
67
  const response = await fetch(
@@ -567,6 +567,28 @@ exports[`<PluginStoreWidget /> renders with the available plugins 1`] = `
567
567
  WigglePlugin
568
568
  </p>
569
569
  </li>
570
+ <li
571
+ class="MuiListItem-root MuiListItem-dense MuiListItem-gutters MuiListItem-padding css-ypie1g-MuiListItem-root"
572
+ >
573
+ <svg
574
+ aria-hidden="true"
575
+ aria-label="This plugin was installed by an administrator, you cannot remove it."
576
+ class="MuiSvgIcon-root MuiSvgIcon-fontSizeMedium css-1a34d00-MuiSvgIcon-root-lockedPluginTooltip"
577
+ data-mui-internal-clone-element="true"
578
+ data-testid="LockIcon"
579
+ focusable="false"
580
+ viewBox="0 0 24 24"
581
+ >
582
+ <path
583
+ d="M18 8h-1V6c0-2.76-2.24-5-5-5S7 3.24 7 6v2H6c-1.1 0-2 .9-2 2v10c0 1.1.9 2 2 2h12c1.1 0 2-.9 2-2V10c0-1.1-.9-2-2-2zm-6 9c-1.1 0-2-.9-2-2s.9-2 2-2 2 .9 2 2-.9 2-2 2zm3.1-9H8.9V6c0-1.71 1.39-3.1 3.1-3.1 1.71 0 3.1 1.39 3.1 3.1v2z"
584
+ />
585
+ </svg>
586
+ <p
587
+ class="MuiTypography-root MuiTypography-body1 css-k0xfey-MuiTypography-root"
588
+ >
589
+ GCContentPlugin
590
+ </p>
591
+ </li>
570
592
  <li
571
593
  class="MuiListItem-root MuiListItem-dense MuiListItem-gutters MuiListItem-padding css-ypie1g-MuiListItem-root"
572
594
  >
@@ -1,9 +1,9 @@
1
1
  // Jest Snapshot v1, https://goo.gl/fbAQLP
2
2
 
3
- exports[`Data management adds config editor widget 1`] = `Object {}`;
3
+ exports[`Data management adds config editor widget 1`] = `{}`;
4
4
 
5
- exports[`Data management adds connection add widget 1`] = `Object {}`;
5
+ exports[`Data management adds connection add widget 1`] = `{}`;
6
6
 
7
- exports[`Data management adds hierarchical track selector 1`] = `Object {}`;
7
+ exports[`Data management adds hierarchical track selector 1`] = `{}`;
8
8
 
9
- exports[`Data management adds track add widget 1`] = `Object {}`;
9
+ exports[`Data management adds track add widget 1`] = `{}`;