@jbrowse/plugin-data-management 2.1.4 → 2.1.6

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 (92) hide show
  1. package/dist/AddConnectionWidget/components/AddConnectionWidget.d.ts +4 -7
  2. package/dist/AddConnectionWidget/components/AddConnectionWidget.js +16 -22
  3. package/dist/AddConnectionWidget/components/AddConnectionWidget.js.map +1 -1
  4. package/dist/AddConnectionWidget/components/ConfigureConnection.d.ts +9 -1
  5. package/dist/AddConnectionWidget/components/ConfigureConnection.js +3 -3
  6. package/dist/AddConnectionWidget/components/ConfigureConnection.js.map +1 -1
  7. package/dist/AddConnectionWidget/components/ConnectionTypeSelect.d.ts +4 -4
  8. package/dist/AddConnectionWidget/components/ConnectionTypeSelect.js +6 -12
  9. package/dist/AddConnectionWidget/components/ConnectionTypeSelect.js.map +1 -1
  10. package/dist/AddConnectionWidget/index.d.ts +2 -2
  11. package/dist/AddConnectionWidget/index.js.map +1 -1
  12. package/dist/AddConnectionWidget/model.js.map +1 -1
  13. package/dist/AddTrackWidget/components/AddTrackWidget.js +1 -2
  14. package/dist/AddTrackWidget/components/AddTrackWidget.js.map +1 -1
  15. package/dist/AddTrackWidget/components/ConfirmTrack.js +6 -7
  16. package/dist/AddTrackWidget/components/ConfirmTrack.js.map +1 -1
  17. package/dist/AddTrackWidget/components/DefaultAddTrackWorkflow.js +3 -4
  18. package/dist/AddTrackWidget/components/DefaultAddTrackWorkflow.js.map +1 -1
  19. package/dist/AddTrackWidget/index.d.ts +2 -2
  20. package/dist/AddTrackWidget/index.js.map +1 -1
  21. package/dist/HierarchicalTrackSelectorWidget/components/Header.js +12 -15
  22. package/dist/HierarchicalTrackSelectorWidget/components/Header.js.map +1 -1
  23. package/dist/HierarchicalTrackSelectorWidget/components/ManageConnectionsDialog.js +6 -7
  24. package/dist/HierarchicalTrackSelectorWidget/components/ManageConnectionsDialog.js.map +1 -1
  25. package/dist/HierarchicalTrackSelectorWidget/components/ToggleConnectionsDialog.d.ts +2 -2
  26. package/dist/HierarchicalTrackSelectorWidget/components/ToggleConnectionsDialog.js +10 -13
  27. package/dist/HierarchicalTrackSelectorWidget/components/ToggleConnectionsDialog.js.map +1 -1
  28. package/dist/HierarchicalTrackSelectorWidget/model.js +20 -30
  29. package/dist/HierarchicalTrackSelectorWidget/model.js.map +1 -1
  30. package/dist/PluginStoreWidget/components/PluginCard.js +1 -1
  31. package/dist/PluginStoreWidget/components/PluginCard.js.map +1 -1
  32. package/dist/PluginStoreWidget/index.d.ts +2 -2
  33. package/dist/PluginStoreWidget/index.js.map +1 -1
  34. package/dist/ucsc-trackhub/model.d.ts +16 -4
  35. package/dist/ucsc-trackhub/ucscTrackHub.d.ts +3 -3
  36. package/esm/AddConnectionWidget/components/AddConnectionWidget.d.ts +4 -7
  37. package/esm/AddConnectionWidget/components/AddConnectionWidget.js +17 -23
  38. package/esm/AddConnectionWidget/components/AddConnectionWidget.js.map +1 -1
  39. package/esm/AddConnectionWidget/components/ConfigureConnection.d.ts +9 -1
  40. package/esm/AddConnectionWidget/components/ConfigureConnection.js +3 -3
  41. package/esm/AddConnectionWidget/components/ConfigureConnection.js.map +1 -1
  42. package/esm/AddConnectionWidget/components/ConnectionTypeSelect.d.ts +4 -4
  43. package/esm/AddConnectionWidget/components/ConnectionTypeSelect.js +6 -12
  44. package/esm/AddConnectionWidget/components/ConnectionTypeSelect.js.map +1 -1
  45. package/esm/AddConnectionWidget/index.d.ts +2 -2
  46. package/esm/AddConnectionWidget/index.js.map +1 -1
  47. package/esm/AddConnectionWidget/model.js.map +1 -1
  48. package/esm/AddTrackWidget/components/AddTrackWidget.js +1 -2
  49. package/esm/AddTrackWidget/components/AddTrackWidget.js.map +1 -1
  50. package/esm/AddTrackWidget/components/ConfirmTrack.js +4 -5
  51. package/esm/AddTrackWidget/components/ConfirmTrack.js.map +1 -1
  52. package/esm/AddTrackWidget/components/DefaultAddTrackWorkflow.js +3 -4
  53. package/esm/AddTrackWidget/components/DefaultAddTrackWorkflow.js.map +1 -1
  54. package/esm/AddTrackWidget/index.d.ts +2 -2
  55. package/esm/AddTrackWidget/index.js.map +1 -1
  56. package/esm/HierarchicalTrackSelectorWidget/components/Header.js +7 -10
  57. package/esm/HierarchicalTrackSelectorWidget/components/Header.js.map +1 -1
  58. package/esm/HierarchicalTrackSelectorWidget/components/ManageConnectionsDialog.js +6 -7
  59. package/esm/HierarchicalTrackSelectorWidget/components/ManageConnectionsDialog.js.map +1 -1
  60. package/esm/HierarchicalTrackSelectorWidget/components/ToggleConnectionsDialog.d.ts +2 -2
  61. package/esm/HierarchicalTrackSelectorWidget/components/ToggleConnectionsDialog.js +8 -13
  62. package/esm/HierarchicalTrackSelectorWidget/components/ToggleConnectionsDialog.js.map +1 -1
  63. package/esm/HierarchicalTrackSelectorWidget/model.js +21 -31
  64. package/esm/HierarchicalTrackSelectorWidget/model.js.map +1 -1
  65. package/esm/PluginStoreWidget/components/PluginCard.js +2 -2
  66. package/esm/PluginStoreWidget/components/PluginCard.js.map +1 -1
  67. package/esm/PluginStoreWidget/index.d.ts +2 -2
  68. package/esm/PluginStoreWidget/index.js.map +1 -1
  69. package/esm/ucsc-trackhub/model.d.ts +16 -4
  70. package/esm/ucsc-trackhub/ucscTrackHub.d.ts +3 -3
  71. package/package.json +3 -3
  72. package/src/AddConnectionWidget/components/{AddConnectionWidget.js → AddConnectionWidget.tsx} +34 -38
  73. package/src/AddConnectionWidget/components/ConfigureConnection.tsx +26 -0
  74. package/src/AddConnectionWidget/components/ConnectionTypeSelect.tsx +43 -52
  75. package/src/AddConnectionWidget/components/__snapshots__/AddConnectionWidget.test.js.snap +8 -8
  76. package/src/AddConnectionWidget/{index.js → index.ts} +0 -0
  77. package/src/AddConnectionWidget/{model.js → model.ts} +0 -0
  78. package/src/AddTrackWidget/components/AddTrackWidget.test.tsx +75 -85
  79. package/src/AddTrackWidget/components/AddTrackWidget.tsx +1 -2
  80. package/src/AddTrackWidget/components/ConfirmTrack.tsx +11 -13
  81. package/src/AddTrackWidget/components/DefaultAddTrackWorkflow.tsx +4 -4
  82. package/src/AddTrackWidget/{index.js → index.ts} +0 -0
  83. package/src/HierarchicalTrackSelectorWidget/components/Header.tsx +11 -12
  84. package/src/HierarchicalTrackSelectorWidget/components/HierarchicalTrackSelector.test.tsx +7 -15
  85. package/src/HierarchicalTrackSelectorWidget/components/ManageConnectionsDialog.tsx +13 -15
  86. package/src/HierarchicalTrackSelectorWidget/components/ToggleConnectionsDialog.tsx +9 -14
  87. package/src/HierarchicalTrackSelectorWidget/components/__snapshots__/HierarchicalTrackSelector.test.tsx.snap +2 -2
  88. package/src/HierarchicalTrackSelectorWidget/model.ts +30 -38
  89. package/src/PluginStoreWidget/components/PluginCard.tsx +3 -4
  90. package/src/PluginStoreWidget/components/__snapshots__/PluginStoreWidget.test.js.snap +2 -2
  91. package/src/PluginStoreWidget/{index.js → index.ts} +0 -0
  92. package/src/AddConnectionWidget/components/ConfigureConnection.js +0 -20
@@ -1,16 +1,11 @@
1
1
  import React, { Suspense, lazy, useState } from 'react'
2
- import { makeStyles } from 'tss-react/mui'
3
2
  import { Badge, IconButton, InputAdornment, TextField } from '@mui/material'
4
- // icons
5
- import ClearIcon from '@mui/icons-material/Clear'
6
- import MenuIcon from '@mui/icons-material/Menu'
7
- import ShoppingCartIcon from '@mui/icons-material/ShoppingCart'
8
- import { Cable } from '@jbrowse/core/ui/Icons'
9
-
10
- // other
3
+ import { makeStyles } from 'tss-react/mui'
4
+ import { observer } from 'mobx-react'
11
5
  import JBrowseMenu, { MenuItem } from '@jbrowse/core/ui/Menu'
12
6
  import {
13
7
  getSession,
8
+ getEnv,
14
9
  isSessionModelWithWidgets,
15
10
  isSessionModelWithConnections,
16
11
  isSessionWithAddTracks,
@@ -19,8 +14,12 @@ import {
19
14
  AnyConfigurationModel,
20
15
  readConfObject,
21
16
  } from '@jbrowse/core/configuration'
22
- import { observer } from 'mobx-react'
23
- import { getEnv } from 'mobx-state-tree'
17
+
18
+ // icons
19
+ import ClearIcon from '@mui/icons-material/Clear'
20
+ import MenuIcon from '@mui/icons-material/Menu'
21
+ import ShoppingCartIcon from '@mui/icons-material/ShoppingCart'
22
+ import { Cable } from '@jbrowse/core/ui/Icons'
24
23
 
25
24
  // locals
26
25
  import { HierarchicalTrackSelectorModel } from '../model'
@@ -74,7 +73,6 @@ function HierarchicalTrackSelectorHeader({
74
73
  const [connectionManagerOpen, setConnectionManagerOpen] = useState(false)
75
74
  const [connectionToggleOpen, setConnectionToggleOpen] = useState(false)
76
75
  const { assemblyNames } = model
77
- const assemblyName = assemblyNames[assemblyIdx]
78
76
 
79
77
  function breakConnection(
80
78
  connectionConf: AnyConfigurationModel,
@@ -159,6 +157,8 @@ function HierarchicalTrackSelectorHeader({
159
157
 
160
158
  const items = getEnv(model).pluginManager.evaluateExtensionPoint(
161
159
  'TrackSelector-multiTrackMenuItems',
160
+ [],
161
+ { session },
162
162
  ) as MenuItem[]
163
163
  return (
164
164
  <div
@@ -276,7 +276,6 @@ function HierarchicalTrackSelectorHeader({
276
276
  handleClose={() => setConnectionToggleOpen(false)}
277
277
  session={session}
278
278
  breakConnection={breakConnection}
279
- assemblyName={assemblyName}
280
279
  />
281
280
  ) : null}
282
281
  </Suspense>
@@ -1,5 +1,3 @@
1
- /* eslint-disable @typescript-eslint/no-non-null-assertion */
2
-
3
1
  import React from 'react'
4
2
  import { createJBrowseTheme } from '@jbrowse/core/ui'
5
3
  import { createTestSession } from '@jbrowse/web/src/rootModel'
@@ -20,7 +18,7 @@ describe('HierarchicalTrackSelector widget', () => {
20
18
 
21
19
  it('renders nothing with no assembly', () => {
22
20
  const session = createTestSession()
23
- const firstView = session!.addView('LinearGenomeView')
21
+ const firstView = session.addView('LinearGenomeView')
24
22
  const model = firstView.activateTrackSelector()
25
23
 
26
24
  const { container } = render(
@@ -34,7 +32,6 @@ describe('HierarchicalTrackSelector widget', () => {
34
32
 
35
33
  it('renders with a couple of uncategorized tracks', async () => {
36
34
  const session = createTestSession()
37
- // @ts-ignore
38
35
  session.addAssemblyConf({
39
36
  name: 'volMyt1',
40
37
  sequence: {
@@ -54,21 +51,19 @@ describe('HierarchicalTrackSelector widget', () => {
54
51
  },
55
52
  },
56
53
  })
57
- // @ts-ignore
58
54
  session.addTrackConf({
59
55
  trackId: 'fooC',
60
56
  assemblyNames: ['volMyt1'],
61
57
  type: 'FeatureTrack',
62
58
  adapter: { type: 'FromConfigAdapter', features: [] },
63
59
  })
64
- // @ts-ignore
65
60
  session.addTrackConf({
66
61
  trackId: 'barC',
67
62
  assemblyNames: ['volMyt1'],
68
63
  type: 'FeatureTrack',
69
64
  adapter: { type: 'FromConfigAdapter', features: [] },
70
65
  })
71
- const firstView = session!.addView('LinearGenomeView', {
66
+ const firstView = session.addView('LinearGenomeView', {
72
67
  displayedRegions: [
73
68
  {
74
69
  assemblyName: 'volMyt1',
@@ -78,8 +73,8 @@ describe('HierarchicalTrackSelector widget', () => {
78
73
  },
79
74
  ],
80
75
  })
81
- firstView.showTrack(session!.sessionTracks[0].trackId)
82
- firstView.showTrack(session!.sessionTracks[1].trackId)
76
+ firstView.showTrack(session.sessionTracks[0].trackId)
77
+ firstView.showTrack(session.sessionTracks[1].trackId)
83
78
  const model = firstView.activateTrackSelector()
84
79
 
85
80
  const { container, findByTestId } = render(
@@ -94,7 +89,6 @@ describe('HierarchicalTrackSelector widget', () => {
94
89
 
95
90
  it('renders with a couple of categorized tracks', async () => {
96
91
  const session = createTestSession()
97
- // @ts-ignore
98
92
  session.addAssemblyConf({
99
93
  name: 'volMyt1',
100
94
  sequence: {
@@ -115,21 +109,19 @@ describe('HierarchicalTrackSelector widget', () => {
115
109
  },
116
110
  })
117
111
 
118
- // @ts-ignore
119
112
  session.addTrackConf({
120
113
  trackId: 'fooC',
121
114
  assemblyNames: ['volMyt1'],
122
115
  type: 'FeatureTrack',
123
116
  adapter: { type: 'FromConfigAdapter', features: [] },
124
117
  })
125
- // @ts-ignore
126
118
  session.addTrackConf({
127
119
  trackId: 'barC',
128
120
  assemblyNames: ['volMyt1'],
129
121
  type: 'FeatureTrack',
130
122
  adapter: { type: 'FromConfigAdapter', features: [] },
131
123
  })
132
- const firstView = session!.addView('LinearGenomeView', {
124
+ const firstView = session.addView('LinearGenomeView', {
133
125
  displayedRegions: [
134
126
  {
135
127
  assemblyName: 'volMyt1',
@@ -139,8 +131,8 @@ describe('HierarchicalTrackSelector widget', () => {
139
131
  },
140
132
  ],
141
133
  })
142
- firstView.showTrack(session!.sessionTracks[0].trackId)
143
- firstView.showTrack(session!.sessionTracks[1].trackId)
134
+ firstView.showTrack(session.sessionTracks[0].trackId)
135
+ firstView.showTrack(session.sessionTracks[1].trackId)
144
136
  firstView.tracks[0].configuration.category.set(['Foo Category'])
145
137
  firstView.tracks[1].configuration.category.set([
146
138
  'Foo Category',
@@ -62,22 +62,20 @@ function ManageConnectionsDlg({
62
62
  {connections.map(conf => {
63
63
  const name = readConfObject(conf, 'name')
64
64
  return (
65
- <div key={`conn-${name}`}>
66
- <Typography>
67
- {adminMode || sessionConnections?.includes(conf) ? (
68
- <IconButton onClick={() => breakConnection(conf, true)}>
69
- <CloseIcon color="error" />
65
+ <Typography key={`conn-${name}`}>
66
+ {adminMode || sessionConnections?.includes(conf) ? (
67
+ <IconButton onClick={() => breakConnection(conf, true)}>
68
+ <CloseIcon color="error" />
69
+ </IconButton>
70
+ ) : (
71
+ <Tooltip title="Unable to delete connection in config file as non-admin user">
72
+ <IconButton>
73
+ <CloseIcon color="disabled" />
70
74
  </IconButton>
71
- ) : (
72
- <Tooltip title="Unable to delete connection in config file as non-admin user">
73
- <IconButton>
74
- <CloseIcon color="disabled" />
75
- </IconButton>
76
- </Tooltip>
77
- )}
78
- {name}
79
- </Typography>
80
- </div>
75
+ </Tooltip>
76
+ )}
77
+ {name}
78
+ </Typography>
81
79
  )
82
80
  })}
83
81
  {!connections.length ? (
@@ -19,6 +19,10 @@ import {
19
19
  } from '@jbrowse/core/configuration'
20
20
  import { AbstractSessionModel } from '@jbrowse/core/util'
21
21
 
22
+ export function ellipses(slug: string) {
23
+ return slug.length > 20 ? `${slug.slice(0, 20)}...` : slug
24
+ }
25
+
22
26
  const useStyles = makeStyles()(theme => ({
23
27
  closeButton: {
24
28
  position: 'absolute',
@@ -36,24 +40,14 @@ const useStyles = makeStyles()(theme => ({
36
40
  function ToggleConnectionDialog({
37
41
  session,
38
42
  handleClose,
39
- assemblyName,
40
43
  breakConnection,
41
44
  }: {
42
45
  handleClose: () => void
43
46
  session: AbstractSessionModel
44
- assemblyName: string
45
47
  breakConnection: (arg: AnyConfigurationModel) => void
46
48
  }) {
47
49
  const { classes } = useStyles()
48
50
  const { connections, connectionInstances: instances = [] } = session
49
- const assemblySpecificConnections = connections.filter(c => {
50
- const configAssemblyNames = readConfObject(c, 'assemblyNames')
51
- if (configAssemblyNames.length === 0) {
52
- return true
53
- }
54
- return configAssemblyNames.includes(assemblyName)
55
- })
56
-
57
51
  return (
58
52
  <Dialog open onClose={handleClose} maxWidth="lg">
59
53
  <DialogTitle>
@@ -68,8 +62,9 @@ function ToggleConnectionDialog({
68
62
  <DialogContent>
69
63
  <Typography>Use the checkbox to turn on/off connections</Typography>
70
64
  <div className={classes.connectionContainer}>
71
- {assemblySpecificConnections.map(conf => {
65
+ {connections.map(conf => {
72
66
  const name = readConfObject(conf, 'name')
67
+ const assemblyNames = readConfObject(conf, 'assemblyNames')
73
68
  const found = instances.find(conn => name === conn.name)
74
69
  return (
75
70
  <FormControlLabel
@@ -87,12 +82,12 @@ function ToggleConnectionDialog({
87
82
  color="primary"
88
83
  />
89
84
  }
90
- label={name}
85
+ label={`${name} (${ellipses(assemblyNames.join(','))})`}
91
86
  />
92
87
  )
93
88
  })}
94
- {!assemblySpecificConnections.length ? (
95
- <Typography>No connections found for {assemblyName}</Typography>
89
+ {!connections.length ? (
90
+ <Typography>No connections found</Typography>
96
91
  ) : null}
97
92
  </div>
98
93
  </DialogContent>
@@ -73,7 +73,7 @@ exports[`HierarchicalTrackSelector widget renders with a couple of categorized t
73
73
  class="MuiFormControl-root MuiFormControl-marginDense MuiFormControl-fullWidth MuiTextField-root tss-45fwc5-searchBox css-1z10yd4-MuiFormControl-root-MuiTextField-root"
74
74
  >
75
75
  <label
76
- class="MuiFormLabel-root MuiInputLabel-root MuiInputLabel-formControl MuiInputLabel-animated MuiInputLabel-sizeSmall MuiInputLabel-standard MuiFormLabel-colorPrimary css-1s1jvl0-MuiFormLabel-root-MuiInputLabel-root"
76
+ class="MuiFormLabel-root MuiInputLabel-root MuiInputLabel-formControl MuiInputLabel-animated MuiInputLabel-sizeSmall MuiInputLabel-standard MuiFormLabel-colorPrimary MuiInputLabel-root MuiInputLabel-formControl MuiInputLabel-animated MuiInputLabel-sizeSmall MuiInputLabel-standard css-1s1jvl0-MuiFormLabel-root-MuiInputLabel-root"
77
77
  data-shrink="false"
78
78
  for="mui-5"
79
79
  id="mui-5-label"
@@ -170,7 +170,7 @@ exports[`HierarchicalTrackSelector widget renders with a couple of uncategorized
170
170
  class="MuiFormControl-root MuiFormControl-marginDense MuiFormControl-fullWidth MuiTextField-root tss-45fwc5-searchBox css-1z10yd4-MuiFormControl-root-MuiTextField-root"
171
171
  >
172
172
  <label
173
- class="MuiFormLabel-root MuiInputLabel-root MuiInputLabel-formControl MuiInputLabel-animated MuiInputLabel-sizeSmall MuiInputLabel-standard MuiFormLabel-colorPrimary css-1s1jvl0-MuiFormLabel-root-MuiInputLabel-root"
173
+ class="MuiFormLabel-root MuiInputLabel-root MuiInputLabel-formControl MuiInputLabel-animated MuiInputLabel-sizeSmall MuiInputLabel-standard MuiFormLabel-colorPrimary MuiInputLabel-root MuiInputLabel-formControl MuiInputLabel-animated MuiInputLabel-sizeSmall MuiInputLabel-standard css-1s1jvl0-MuiFormLabel-root-MuiInputLabel-root"
174
174
  data-shrink="false"
175
175
  for="mui-1"
176
176
  id="mui-1-label"
@@ -1,10 +1,11 @@
1
- import { types, getParent, getEnv, Instance } from 'mobx-state-tree'
1
+ import { types, getSnapshot, Instance } from 'mobx-state-tree'
2
2
  import {
3
3
  getConf,
4
4
  readConfObject,
5
5
  AnyConfigurationModel,
6
6
  } from '@jbrowse/core/configuration'
7
- import { getSession } from '@jbrowse/core/util'
7
+ import { AbstractSessionModel, getSession, getEnv } from '@jbrowse/core/util'
8
+ import { getTrackName } from '@jbrowse/core/util/tracks'
8
9
  import { ElementId } from '@jbrowse/core/util/types/mst'
9
10
  import PluginManager from '@jbrowse/core/PluginManager'
10
11
 
@@ -12,28 +13,19 @@ function hasAnyOverlap<T>(a1: T[] = [], a2: T[] = []) {
12
13
  return !!a1.find(value => a2.includes(value))
13
14
  }
14
15
 
15
- function passesFilter(filter: string, config: AnyConfigurationModel) {
16
+ function passesFilter(
17
+ filter: string,
18
+ config: AnyConfigurationModel,
19
+ session: AbstractSessionModel,
20
+ ) {
16
21
  const categories = readConfObject(config, 'category') as string[] | undefined
17
22
  const filterLower = filter.toLowerCase()
18
23
  return (
19
- getTrackName(config).toLowerCase().includes(filterLower) ||
24
+ getTrackName(config, session).toLowerCase().includes(filterLower) ||
20
25
  !!categories?.filter(c => c.toLowerCase().includes(filterLower)).length
21
26
  )
22
27
  }
23
28
 
24
- function getTrackName(config: AnyConfigurationModel): string {
25
- if (!config.trackId) {
26
- throw new Error('not a track')
27
- }
28
- return (
29
- readConfObject(config, 'name') ||
30
- `Reference sequence (${
31
- readConfObject(getParent(config), 'displayName') ||
32
- readConfObject(getParent(config), 'name')
33
- })`
34
- )
35
- }
36
-
37
29
  export type TreeNode = {
38
30
  name: string
39
31
  id: string
@@ -55,12 +47,9 @@ function filterTracks(
55
47
  if (!assembly) {
56
48
  return []
57
49
  }
50
+ const { allAliases } = assembly
58
51
  return tracks
59
- .filter(c => {
60
- const trackConfAssemblies = readConfObject(c, 'assemblyNames')
61
- const { allAliases } = assembly
62
- return hasAnyOverlap(allAliases, trackConfAssemblies)
63
- })
52
+ .filter(c => hasAnyOverlap(allAliases, readConfObject(c, 'assemblyNames')))
64
53
  .filter(c => {
65
54
  const { displayTypes } = pluginManager.getViewType(self.view.type)
66
55
  const compatDisplays = displayTypes.map((d: { name: string }) => d.name)
@@ -76,9 +65,10 @@ export function generateHierarchy(
76
65
  ) {
77
66
  const hierarchy = { children: [] as TreeNode[] } as TreeNode
78
67
  const { filterText, view } = model
68
+ const session = getSession(model)
79
69
 
80
70
  trackConfigurations
81
- .filter(conf => passesFilter(filterText, conf))
71
+ .filter(conf => passesFilter(filterText, conf, session))
82
72
  .forEach(conf => {
83
73
  // copy the categories since this array can be mutated downstream
84
74
  const categories = [...(readConfObject(conf, 'category') || [])]
@@ -118,7 +108,7 @@ export function generateHierarchy(
118
108
  0,
119
109
  {
120
110
  id: conf.trackId,
121
- name: getTrackName(conf),
111
+ name: getTrackName(conf, session),
122
112
  conf,
123
113
  checked: !!tracks.find(f => f.configuration === conf),
124
114
  children: [],
@@ -226,24 +216,26 @@ export default function stateTreeFactory(pluginManager: PluginManager) {
226
216
  )
227
217
 
228
218
  const session = getSession(self)
229
- const { connections, connectionInstances } = session
219
+ const { connectionInstances } = session
220
+
221
+ const { assemblyManager } = getSession(self)
222
+ const assembly = assemblyManager.get(assemblyName)
230
223
  const conns =
231
- connectionInstances
232
- ?.filter(c => {
233
- const names = getConf(c, 'assemblyNames')
234
- return names.length === 0 ? true : names.includes(assemblyName)
235
- })
236
- .map((conn, index) => {
237
- const c = connections[index]
238
- return {
239
- id: c.connectionId,
240
- name: readConfObject(c, 'name'),
241
- children: this.connectionHierarchy(assemblyName, conn),
224
+ (assembly &&
225
+ connectionInstances
226
+ ?.filter(c =>
227
+ hasAnyOverlap(assembly.allAliases, getConf(c, 'assemblyNames')),
228
+ )
229
+ .map(c => ({
230
+ // @ts-ignore
231
+ id: getSnapshot(c).configuration,
232
+ name: getConf(c, 'name'),
233
+ children: this.connectionHierarchy(assemblyName, c),
242
234
  state: {
243
235
  expanded: true,
244
236
  },
245
- }
246
- }) || []
237
+ }))) ||
238
+ []
247
239
 
248
240
  return {
249
241
  name: 'Root',
@@ -1,8 +1,7 @@
1
1
  import React, { useState } from 'react'
2
- import PluginManager from '@jbrowse/core/PluginManager'
3
2
  import { observer } from 'mobx-react'
4
- import { getEnv, getParent } from 'mobx-state-tree'
5
- import { getSession } from '@jbrowse/core/util'
3
+ import { getParent } from 'mobx-state-tree'
4
+ import { getSession, getEnv } from '@jbrowse/core/util'
6
5
  import {
7
6
  JBrowsePlugin,
8
7
  isSessionWithSessionPlugins,
@@ -52,7 +51,7 @@ function PluginCard({
52
51
  }) {
53
52
  const { classes } = useStyles()
54
53
  const session = getSession(model)
55
- const { pluginManager } = getEnv(model) as { pluginManager: PluginManager }
54
+ const { pluginManager } = getEnv(model)
56
55
  const isInstalled = Boolean(
57
56
  pluginManager.runtimePluginDefinitions.find(def => def.url === plugin.url),
58
57
  )
@@ -8,7 +8,7 @@ exports[`<PluginStoreWidget /> renders with the available plugins 1`] = `
8
8
  class="MuiFormControl-root MuiFormControl-marginDense MuiFormControl-fullWidth MuiTextField-root css-1z10yd4-MuiFormControl-root-MuiTextField-root"
9
9
  >
10
10
  <label
11
- class="MuiFormLabel-root MuiInputLabel-root MuiInputLabel-formControl MuiInputLabel-animated MuiInputLabel-sizeSmall MuiInputLabel-standard MuiFormLabel-colorPrimary css-1s1jvl0-MuiFormLabel-root-MuiInputLabel-root"
11
+ class="MuiFormLabel-root MuiInputLabel-root MuiInputLabel-formControl MuiInputLabel-animated MuiInputLabel-sizeSmall MuiInputLabel-standard MuiFormLabel-colorPrimary MuiInputLabel-root MuiInputLabel-formControl MuiInputLabel-animated MuiInputLabel-sizeSmall MuiInputLabel-standard css-1s1jvl0-MuiFormLabel-root-MuiInputLabel-root"
12
12
  data-shrink="false"
13
13
  for="mui-1"
14
14
  id="mui-1-label"
@@ -834,7 +834,7 @@ exports[`<PluginStoreWidget /> renders with the available plugins 1`] = `
834
834
  class="MuiCardActions-root MuiCardActions-spacing css-1t6e9jv-MuiCardActions-root"
835
835
  >
836
836
  <button
837
- class="MuiButtonBase-root MuiButton-root MuiButton-contained MuiButton-containedPrimary MuiButton-sizeSmall MuiButton-containedSizeSmall css-1cpxz0y-MuiButtonBase-root-MuiButton-root"
837
+ class="MuiButtonBase-root MuiButton-root MuiButton-contained MuiButton-containedPrimary MuiButton-sizeSmall MuiButton-containedSizeSmall MuiButton-root MuiButton-contained MuiButton-containedPrimary MuiButton-sizeSmall MuiButton-containedSizeSmall css-1cpxz0y-MuiButtonBase-root-MuiButton-root"
838
838
  tabindex="0"
839
839
  type="button"
840
840
  >
File without changes
@@ -1,20 +0,0 @@
1
- import React, { Suspense } from 'react'
2
- import { ConfigurationEditor } from '@jbrowse/plugin-config'
3
- import { observer } from 'mobx-react'
4
-
5
- const ConfigureConnection = observer(props => {
6
- const { connectionType, model, setModelReady } = props
7
- const ConfigEditorComponent =
8
- connectionType.configEditorComponent || ConfigurationEditor
9
-
10
- return (
11
- <Suspense fallback={<div>Loading...</div>}>
12
- <ConfigEditorComponent
13
- model={{ target: model }}
14
- setModelReady={setModelReady}
15
- />
16
- </Suspense>
17
- )
18
- })
19
-
20
- export default ConfigureConnection