@jbrowse/plugin-data-management 1.6.7 → 1.7.0

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 (66) hide show
  1. package/dist/AddConnectionWidget/components/AddConnectionWidget.js +178 -0
  2. package/dist/AddConnectionWidget/components/AddConnectionWidget.test.js +270 -0
  3. package/dist/AddConnectionWidget/components/ConfigureConnection.js +35 -0
  4. package/dist/AddConnectionWidget/components/ConnectionTypeSelect.js +70 -0
  5. package/dist/AddConnectionWidget/index.js +21 -0
  6. package/dist/AddConnectionWidget/model.js +17 -0
  7. package/dist/AddTrackWidget/components/AddTrackWidget.js +215 -0
  8. package/dist/AddTrackWidget/components/AddTrackWidget.test.js +218 -0
  9. package/dist/AddTrackWidget/components/ConfirmTrack.js +277 -0
  10. package/dist/AddTrackWidget/components/TrackSourceSelect.js +60 -0
  11. package/dist/AddTrackWidget/index.js +21 -0
  12. package/dist/AddTrackWidget/index.test.js +291 -0
  13. package/dist/AddTrackWidget/model.js +167 -0
  14. package/dist/AssemblyManager/AssemblyAddForm.js +299 -0
  15. package/dist/AssemblyManager/AssemblyEditor.js +25 -0
  16. package/dist/AssemblyManager/AssemblyManager.js +144 -0
  17. package/dist/AssemblyManager/AssemblyManager.test.js +113 -0
  18. package/dist/AssemblyManager/AssemblyTable.js +92 -0
  19. package/dist/AssemblyManager/index.js +15 -0
  20. package/dist/HierarchicalTrackSelectorWidget/components/CloseConnectionDialog.js +55 -0
  21. package/dist/HierarchicalTrackSelectorWidget/components/DeleteConnectionDialog.js +46 -0
  22. package/dist/HierarchicalTrackSelectorWidget/components/HierarchicalTrackSelector.js +648 -0
  23. package/dist/HierarchicalTrackSelectorWidget/components/HierarchicalTrackSelector.test.js +191 -0
  24. package/dist/HierarchicalTrackSelectorWidget/components/ManageConnectionsDialog.js +80 -0
  25. package/dist/HierarchicalTrackSelectorWidget/components/ToggleConnectionsDialog.js +98 -0
  26. package/dist/HierarchicalTrackSelectorWidget/index.js +21 -0
  27. package/dist/HierarchicalTrackSelectorWidget/model.js +306 -0
  28. package/dist/HierarchicalTrackSelectorWidget/model.test.js +28 -0
  29. package/dist/PluginStoreWidget/components/CustomPluginForm.js +217 -0
  30. package/dist/PluginStoreWidget/components/InstalledPlugin.js +138 -0
  31. package/dist/PluginStoreWidget/components/InstalledPluginsList.js +47 -0
  32. package/dist/PluginStoreWidget/components/PluginCard.js +121 -0
  33. package/dist/PluginStoreWidget/components/PluginStoreWidget.js +240 -0
  34. package/dist/PluginStoreWidget/components/PluginStoreWidget.test.js +201 -0
  35. package/dist/PluginStoreWidget/index.js +29 -0
  36. package/dist/PluginStoreWidget/model.js +28 -0
  37. package/dist/PluginStoreWidget/model.test.js +17 -0
  38. package/dist/SetDefaultSession/SetDefaultSession.js +64 -0
  39. package/dist/SetDefaultSession/SetDefaultSession.test.js +75 -0
  40. package/dist/SetDefaultSession/index.js +15 -0
  41. package/dist/index.js +159 -6
  42. package/dist/index.test.js +56 -0
  43. package/dist/plugin-data-management.cjs.development.js +29 -23
  44. package/dist/plugin-data-management.cjs.development.js.map +1 -1
  45. package/dist/plugin-data-management.cjs.production.min.js +1 -1
  46. package/dist/plugin-data-management.cjs.production.min.js.map +1 -1
  47. package/dist/plugin-data-management.esm.js +29 -23
  48. package/dist/plugin-data-management.esm.js.map +1 -1
  49. package/dist/ucsc-trackhub/configSchema.js +30 -0
  50. package/dist/ucsc-trackhub/index.js +23 -0
  51. package/dist/ucsc-trackhub/model.js +130 -0
  52. package/dist/ucsc-trackhub/ucscAssemblies.js +13 -0
  53. package/dist/ucsc-trackhub/ucscTrackHub.js +503 -0
  54. package/package.json +3 -6
  55. package/src/AddConnectionWidget/components/AddConnectionWidget.test.js +1 -0
  56. package/src/AddTrackWidget/components/AddTrackWidget.test.js +1 -0
  57. package/src/AddTrackWidget/components/AddTrackWidget.tsx +1 -1
  58. package/src/HierarchicalTrackSelectorWidget/components/HierarchicalTrackSelector.js +94 -89
  59. package/src/HierarchicalTrackSelectorWidget/components/HierarchicalTrackSelector.test.js +1 -0
  60. package/src/HierarchicalTrackSelectorWidget/components/__snapshots__/HierarchicalTrackSelector.test.js.snap +2 -2
  61. package/src/PluginStoreWidget/components/CustomPluginForm.tsx +1 -1
  62. package/src/PluginStoreWidget/components/InstalledPlugin.tsx +4 -2
  63. package/src/PluginStoreWidget/components/PluginCard.tsx +4 -2
  64. package/src/PluginStoreWidget/components/PluginStoreWidget.test.js +1 -0
  65. package/src/PluginStoreWidget/model.test.js +1 -0
  66. package/src/SetDefaultSession/SetDefaultSession.tsx +4 -3
@@ -29,7 +29,7 @@ import ArrowDropDownIcon from '@material-ui/icons/ArrowDropDown'
29
29
  import ArrowRightIcon from '@material-ui/icons/ArrowRight'
30
30
  import MenuIcon from '@material-ui/icons/Menu'
31
31
  import MoreIcon from '@material-ui/icons/MoreHoriz'
32
- import PowerOutlinedIcon from '@material-ui/icons/PowerOutlined'
32
+ import { Cable } from '@jbrowse/core/ui/Icons'
33
33
 
34
34
  // other
35
35
  import AutoSizer from 'react-virtualized-auto-sizer'
@@ -46,7 +46,7 @@ const ToggleConnectionsDialog = lazy(() => import('./ToggleConnectionsDialog'))
46
46
 
47
47
  const useStyles = makeStyles(theme => ({
48
48
  searchBox: {
49
- marginBottom: theme.spacing(2),
49
+ margin: theme.spacing(2),
50
50
  },
51
51
  menuIcon: {
52
52
  marginRight: theme.spacing(1),
@@ -316,48 +316,56 @@ const HierarchicalTrackSelectorContainer = observer(
316
316
  toolbarHeight={toolbarHeight}
317
317
  overrideDimensions={overrideDimensions}
318
318
  />
319
- <Fab
320
- color="secondary"
321
- className={classes.fab}
322
- onClick={event => {
323
- setAnchorEl(event.currentTarget)
324
- }}
325
- >
326
- <AddIcon />
327
- </Fab>
328
- <Menu
329
- anchorEl={anchorEl}
330
- open={Boolean(anchorEl)}
331
- onClose={() => setAnchorEl(null)}
332
- >
333
- <MenuItem
334
- onClick={() => {
335
- handleFabClose()
336
- const widget = session.addWidget(
337
- 'AddConnectionWidget',
338
- 'addConnectionWidget',
339
- )
340
- session.showWidget(widget)
341
- }}
342
- >
343
- Add connection
344
- </MenuItem>
345
- <MenuItem
346
- onClick={() => {
347
- handleFabClose()
348
- const widget = session.addWidget(
349
- 'AddTrackWidget',
350
- 'addTrackWidget',
351
- {
352
- view: model.view.id,
353
- },
354
- )
355
- session.showWidget(widget)
356
- }}
357
- >
358
- Add track
359
- </MenuItem>
360
- </Menu>
319
+ {session.addConnectionConf || session.addTrackConf ? (
320
+ <>
321
+ <Fab
322
+ color="secondary"
323
+ className={classes.fab}
324
+ onClick={event => {
325
+ setAnchorEl(event.currentTarget)
326
+ }}
327
+ >
328
+ <AddIcon />
329
+ </Fab>
330
+ <Menu
331
+ anchorEl={anchorEl}
332
+ open={Boolean(anchorEl)}
333
+ onClose={() => setAnchorEl(null)}
334
+ >
335
+ {session.addConnectionConf ? (
336
+ <MenuItem
337
+ onClick={() => {
338
+ handleFabClose()
339
+ const widget = session.addWidget(
340
+ 'AddConnectionWidget',
341
+ 'addConnectionWidget',
342
+ )
343
+ session.showWidget(widget)
344
+ }}
345
+ >
346
+ Add connection
347
+ </MenuItem>
348
+ ) : null}
349
+ {session.addTrackConf ? (
350
+ <MenuItem
351
+ onClick={() => {
352
+ handleFabClose()
353
+ const widget = session.addWidget(
354
+ 'AddTrackWidget',
355
+ 'addTrackWidget',
356
+ {
357
+ view: model.view.id,
358
+ },
359
+ )
360
+ session.showWidget(widget)
361
+ }}
362
+ >
363
+ Add track
364
+ </MenuItem>
365
+ ) : null}
366
+ </Menu>
367
+ </>
368
+ ) : null}
361
369
  </Wrapper>
362
370
  )
363
371
  },
@@ -402,11 +410,24 @@ const HierarchicalTrackSelectorHeader = observer(
402
410
  label: 'Turn on/off connections...',
403
411
  onClick: () => setConnectionToggleOpen(true),
404
412
  },
405
- {
413
+ ]
414
+
415
+ if (session.addConnectionConf) {
416
+ connectionMenuItems.unshift({
417
+ label: 'Add connection',
418
+ onClick: () => {
419
+ session.showWidget(
420
+ session.addWidget('AddConnectionWidget', 'addConnectionWidget'),
421
+ )
422
+ },
423
+ })
424
+
425
+ connectionMenuItems.push({
406
426
  label: 'Delete connections...',
407
427
  onClick: () => setConnectionManagerOpen(true),
408
- },
409
- ]
428
+ })
429
+ }
430
+
410
431
  const assemblyMenuItems =
411
432
  assemblyNames.length > 1
412
433
  ? [
@@ -443,22 +464,28 @@ const HierarchicalTrackSelectorHeader = observer(
443
464
  data-testid="hierarchical_track_selector"
444
465
  >
445
466
  <div style={{ display: 'flex' }}>
446
- <IconButton
447
- className={classes.menuIcon}
448
- onClick={event => {
449
- setMenuAnchorEl(event.currentTarget)
450
- }}
451
- >
452
- <MenuIcon />
453
- </IconButton>
454
- <IconButton
455
- className={classes.menuIcon}
456
- onClick={event => {
457
- setConnectionAnchorEl(event.currentTarget)
458
- }}
459
- >
460
- <PowerOutlinedIcon />
461
- </IconButton>
467
+ {session.addTrackConf && (
468
+ <IconButton
469
+ className={classes.menuIcon}
470
+ onClick={event => {
471
+ setMenuAnchorEl(event.currentTarget)
472
+ }}
473
+ >
474
+ <MenuIcon />
475
+ </IconButton>
476
+ )}
477
+
478
+ {session.makeConnection && (
479
+ <IconButton
480
+ className={classes.menuIcon}
481
+ onClick={event => {
482
+ setConnectionAnchorEl(event.currentTarget)
483
+ }}
484
+ >
485
+ <Cable />
486
+ </IconButton>
487
+ )}
488
+
462
489
  <TextField
463
490
  className={classes.searchBox}
464
491
  label="Filter tracks"
@@ -476,7 +503,6 @@ const HierarchicalTrackSelectorHeader = observer(
476
503
  }}
477
504
  />
478
505
  </div>
479
-
480
506
  <JBrowseMenu
481
507
  anchorEl={connectionAnchorEl}
482
508
  open={Boolean(connectionAnchorEl)}
@@ -484,25 +510,9 @@ const HierarchicalTrackSelectorHeader = observer(
484
510
  callback()
485
511
  setConnectionAnchorEl(undefined)
486
512
  }}
487
- onClose={() => {
488
- setConnectionAnchorEl(undefined)
489
- }}
490
- menuItems={[
491
- {
492
- label: 'Add connection',
493
- onClick: () => {
494
- session.showWidget(
495
- session.addWidget(
496
- 'AddConnectionWidget',
497
- 'addConnectionWidget',
498
- ),
499
- )
500
- },
501
- },
502
- ...connectionMenuItems,
503
- ]}
513
+ onClose={() => setConnectionAnchorEl(undefined)}
514
+ menuItems={connectionMenuItems}
504
515
  />
505
-
506
516
  <JBrowseMenu
507
517
  anchorEl={menuAnchorEl}
508
518
  open={Boolean(menuAnchorEl)}
@@ -510,12 +520,9 @@ const HierarchicalTrackSelectorHeader = observer(
510
520
  callback()
511
521
  setMenuAnchorEl(undefined)
512
522
  }}
513
- onClose={() => {
514
- setMenuAnchorEl(undefined)
515
- }}
523
+ onClose={() => setMenuAnchorEl(undefined)}
516
524
  menuItems={menuItems}
517
525
  />
518
-
519
526
  <Suspense fallback={<div />}>
520
527
  {modalInfo ? (
521
528
  <CloseConnectionDialog
@@ -525,9 +532,7 @@ const HierarchicalTrackSelectorHeader = observer(
525
532
  />
526
533
  ) : deleteDialogDetails ? (
527
534
  <DeleteConnectionDialog
528
- handleClose={() => {
529
- setDeleteDialogDetails(undefined)
530
- }}
535
+ handleClose={() => setDeleteDialogDetails(undefined)}
531
536
  deleteDialogDetails={deleteDialogDetails}
532
537
  session={session}
533
538
  />
@@ -3,6 +3,7 @@ import { createTheme, ThemeProvider } from '@material-ui/core/styles'
3
3
  import { cleanup, render } from '@testing-library/react'
4
4
  import React from 'react'
5
5
  import HierarchicalTrackSelector from './HierarchicalTrackSelector'
6
+ jest.mock('@jbrowse/web/src/makeWorkerInstance', () => () => {})
6
7
 
7
8
  window.requestIdleCallback = cb => cb()
8
9
  window.cancelIdleCallback = () => {}
@@ -71,7 +71,7 @@ exports[`HierarchicalTrackSelector widget renders with a couple of categorized t
71
71
  viewBox="0 0 24 24"
72
72
  >
73
73
  <path
74
- d="M16 9v4.66l-3.5 3.51V19h-1v-1.83L8 13.65V9h8m0-6h-2v4h-4V3H8v4h-.01C6.9 6.99 6 7.89 6 8.98v5.52L9.5 18v3h5v-3l3.5-3.51V9c0-1.1-.9-2-2-2V3z"
74
+ d="M20 5V4c0-.55-.45-1-1-1h-2c-.55 0-1 .45-1 1v1h-1v4c0 .55.45 1 1 1h1v7c0 1.1-.9 2-2 2s-2-.9-2-2V7c0-2.21-1.79-4-4-4S5 4.79 5 7v7H4c-.55 0-1 .45-1 1v4h1v1c0 .55.45 1 1 1h2c.55 0 1-.45 1-1v-1h1v-4c0-.55-.45-1-1-1H7V7c0-1.1.9-2 2-2s2 .9 2 2v10c0 2.21 1.79 4 4 4s4-1.79 4-4v-7h1c.55 0 1-.45 1-1V5h-1z"
75
75
  />
76
76
  </svg>
77
77
  </span>
@@ -175,7 +175,7 @@ exports[`HierarchicalTrackSelector widget renders with a couple of uncategorized
175
175
  viewBox="0 0 24 24"
176
176
  >
177
177
  <path
178
- d="M16 9v4.66l-3.5 3.51V19h-1v-1.83L8 13.65V9h8m0-6h-2v4h-4V3H8v4h-.01C6.9 6.99 6 7.89 6 8.98v5.52L9.5 18v3h5v-3l3.5-3.51V9c0-1.1-.9-2-2-2V3z"
178
+ d="M20 5V4c0-.55-.45-1-1-1h-2c-.55 0-1 .45-1 1v1h-1v4c0 .55.45 1 1 1h1v7c0 1.1-.9 2-2 2s-2-.9-2-2V7c0-2.21-1.79-4-4-4S5 4.79 5 7v7H4c-.55 0-1 .45-1 1v4h1v1c0 .55.45 1 1 1h2c.55 0 1-.45 1-1v-1h1v-4c0-.55-.45-1-1-1H7V7c0-1.1.9-2 2-2s2 .9 2 2v10c0 2.21 1.79 4 4 4s4-1.79 4-4v-7h1c.55 0 1-.45 1-1V5h-1z"
179
179
  />
180
180
  </svg>
181
181
  </span>
@@ -132,7 +132,7 @@ function CustomPluginForm({
132
132
  <DialogContent className={classes.dialogContent}>
133
133
  <DialogContentText>
134
134
  Enter the name of the plugin and its URL. The name should match what
135
- is defined in the plugin's build.
135
+ is defined in the plugin&apos;s build.
136
136
  </DialogContentText>
137
137
  <TextField
138
138
  id="umd-name-input"
@@ -19,8 +19,10 @@ import LockIcon from '@material-ui/icons/Lock'
19
19
 
20
20
  import PluginManager from '@jbrowse/core/PluginManager'
21
21
  import { getSession } from '@jbrowse/core/util'
22
- import { BasePlugin } from '@jbrowse/core/util/types'
23
- import { isSessionWithSessionPlugins } from '@jbrowse/core/util/types'
22
+ import {
23
+ BasePlugin,
24
+ isSessionWithSessionPlugins,
25
+ } from '@jbrowse/core/util/types'
24
26
  import { PluginStoreModel } from '../model'
25
27
 
26
28
  const useStyles = makeStyles(() => ({
@@ -3,8 +3,10 @@ import PluginManager from '@jbrowse/core/PluginManager'
3
3
  import { observer } from 'mobx-react'
4
4
  import { getEnv, getParent } from 'mobx-state-tree'
5
5
  import { getSession } from '@jbrowse/core/util'
6
- import { JBrowsePlugin } from '@jbrowse/core/util/types'
7
- import { isSessionWithSessionPlugins } from '@jbrowse/core/util/types'
6
+ import {
7
+ JBrowsePlugin,
8
+ isSessionWithSessionPlugins,
9
+ } from '@jbrowse/core/util/types'
8
10
  import {
9
11
  Card,
10
12
  CardActions,
@@ -4,6 +4,7 @@ import { render, cleanup, fireEvent, waitFor } from '@testing-library/react'
4
4
  import { createTestSession } from '@jbrowse/web/src/rootModel'
5
5
 
6
6
  import PluginStoreWidget from './PluginStoreWidget'
7
+ jest.mock('@jbrowse/web/src/makeWorkerInstance', () => () => {})
7
8
 
8
9
  const plugins = {
9
10
  plugins: [
@@ -1,4 +1,5 @@
1
1
  import { createTestSession } from '@jbrowse/web/src/rootModel'
2
+ jest.mock('@jbrowse/web/src/makeWorkerInstance', () => () => {})
2
3
 
3
4
  describe('PluginStoreModel', () => {
4
5
  it('filters plugins correctly', () => {
@@ -32,9 +32,10 @@ const SetDefaultSession = observer(
32
32
  <DialogTitle>Set default session</DialogTitle>
33
33
  <DialogContent>
34
34
  <Typography>
35
- Select "Set current session as default" to make your current session
36
- saved to the config file. You can also hit "Clear default session",
37
- which would remove the default session from the config.
35
+ Select &quot;Set current session as default&quot; to make your
36
+ current session saved to the config file. You can also hit
37
+ &quot;Clear default session&quot;, which would remove the default
38
+ session from the config.
38
39
  </Typography>
39
40
  </DialogContent>
40
41
  <DialogActions>