@jbrowse/plugin-data-management 2.1.4 → 2.1.5

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 (72) hide show
  1. package/dist/AddConnectionWidget/components/AddConnectionWidget.d.ts +4 -7
  2. package/dist/AddConnectionWidget/components/AddConnectionWidget.js +15 -20
  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/index.d.ts +2 -2
  14. package/dist/AddTrackWidget/index.js.map +1 -1
  15. package/dist/HierarchicalTrackSelectorWidget/components/Header.js +2 -3
  16. package/dist/HierarchicalTrackSelectorWidget/components/Header.js.map +1 -1
  17. package/dist/HierarchicalTrackSelectorWidget/components/ManageConnectionsDialog.js +6 -7
  18. package/dist/HierarchicalTrackSelectorWidget/components/ManageConnectionsDialog.js.map +1 -1
  19. package/dist/HierarchicalTrackSelectorWidget/components/ToggleConnectionsDialog.d.ts +2 -2
  20. package/dist/HierarchicalTrackSelectorWidget/components/ToggleConnectionsDialog.js +10 -13
  21. package/dist/HierarchicalTrackSelectorWidget/components/ToggleConnectionsDialog.js.map +1 -1
  22. package/dist/HierarchicalTrackSelectorWidget/model.js +13 -17
  23. package/dist/HierarchicalTrackSelectorWidget/model.js.map +1 -1
  24. package/dist/PluginStoreWidget/index.d.ts +2 -2
  25. package/dist/PluginStoreWidget/index.js.map +1 -1
  26. package/dist/ucsc-trackhub/model.d.ts +16 -4
  27. package/dist/ucsc-trackhub/ucscTrackHub.d.ts +3 -3
  28. package/esm/AddConnectionWidget/components/AddConnectionWidget.d.ts +4 -7
  29. package/esm/AddConnectionWidget/components/AddConnectionWidget.js +16 -21
  30. package/esm/AddConnectionWidget/components/AddConnectionWidget.js.map +1 -1
  31. package/esm/AddConnectionWidget/components/ConfigureConnection.d.ts +9 -1
  32. package/esm/AddConnectionWidget/components/ConfigureConnection.js +3 -3
  33. package/esm/AddConnectionWidget/components/ConfigureConnection.js.map +1 -1
  34. package/esm/AddConnectionWidget/components/ConnectionTypeSelect.d.ts +4 -4
  35. package/esm/AddConnectionWidget/components/ConnectionTypeSelect.js +6 -12
  36. package/esm/AddConnectionWidget/components/ConnectionTypeSelect.js.map +1 -1
  37. package/esm/AddConnectionWidget/index.d.ts +2 -2
  38. package/esm/AddConnectionWidget/index.js.map +1 -1
  39. package/esm/AddConnectionWidget/model.js.map +1 -1
  40. package/esm/AddTrackWidget/index.d.ts +2 -2
  41. package/esm/AddTrackWidget/index.js.map +1 -1
  42. package/esm/HierarchicalTrackSelectorWidget/components/Header.js +2 -3
  43. package/esm/HierarchicalTrackSelectorWidget/components/Header.js.map +1 -1
  44. package/esm/HierarchicalTrackSelectorWidget/components/ManageConnectionsDialog.js +6 -7
  45. package/esm/HierarchicalTrackSelectorWidget/components/ManageConnectionsDialog.js.map +1 -1
  46. package/esm/HierarchicalTrackSelectorWidget/components/ToggleConnectionsDialog.d.ts +2 -2
  47. package/esm/HierarchicalTrackSelectorWidget/components/ToggleConnectionsDialog.js +8 -13
  48. package/esm/HierarchicalTrackSelectorWidget/components/ToggleConnectionsDialog.js.map +1 -1
  49. package/esm/HierarchicalTrackSelectorWidget/model.js +14 -18
  50. package/esm/HierarchicalTrackSelectorWidget/model.js.map +1 -1
  51. package/esm/PluginStoreWidget/index.d.ts +2 -2
  52. package/esm/PluginStoreWidget/index.js.map +1 -1
  53. package/esm/ucsc-trackhub/model.d.ts +16 -4
  54. package/esm/ucsc-trackhub/ucscTrackHub.d.ts +3 -3
  55. package/package.json +3 -3
  56. package/src/AddConnectionWidget/components/{AddConnectionWidget.js → AddConnectionWidget.tsx} +28 -33
  57. package/src/AddConnectionWidget/components/ConfigureConnection.tsx +26 -0
  58. package/src/AddConnectionWidget/components/ConnectionTypeSelect.tsx +43 -52
  59. package/src/AddConnectionWidget/components/__snapshots__/AddConnectionWidget.test.js.snap +8 -8
  60. package/src/AddConnectionWidget/{index.js → index.ts} +0 -0
  61. package/src/AddConnectionWidget/{model.js → model.ts} +0 -0
  62. package/src/AddTrackWidget/components/AddTrackWidget.test.tsx +75 -85
  63. package/src/AddTrackWidget/{index.js → index.ts} +0 -0
  64. package/src/HierarchicalTrackSelectorWidget/components/Header.tsx +2 -2
  65. package/src/HierarchicalTrackSelectorWidget/components/HierarchicalTrackSelector.test.tsx +7 -15
  66. package/src/HierarchicalTrackSelectorWidget/components/ManageConnectionsDialog.tsx +13 -15
  67. package/src/HierarchicalTrackSelectorWidget/components/ToggleConnectionsDialog.tsx +9 -14
  68. package/src/HierarchicalTrackSelectorWidget/components/__snapshots__/HierarchicalTrackSelector.test.tsx.snap +2 -2
  69. package/src/HierarchicalTrackSelectorWidget/model.ts +25 -20
  70. package/src/PluginStoreWidget/components/__snapshots__/PluginStoreWidget.test.js.snap +2 -2
  71. package/src/PluginStoreWidget/{index.js → index.ts} +0 -0
  72. package/src/AddConnectionWidget/components/ConfigureConnection.js +0 -20
@@ -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,4 +1,10 @@
1
- import { types, getParent, getEnv, Instance } from 'mobx-state-tree'
1
+ import {
2
+ types,
3
+ getParent,
4
+ getEnv,
5
+ getSnapshot,
6
+ Instance,
7
+ } from 'mobx-state-tree'
2
8
  import {
3
9
  getConf,
4
10
  readConfObject,
@@ -55,12 +61,9 @@ function filterTracks(
55
61
  if (!assembly) {
56
62
  return []
57
63
  }
64
+ const { allAliases } = assembly
58
65
  return tracks
59
- .filter(c => {
60
- const trackConfAssemblies = readConfObject(c, 'assemblyNames')
61
- const { allAliases } = assembly
62
- return hasAnyOverlap(allAliases, trackConfAssemblies)
63
- })
66
+ .filter(c => hasAnyOverlap(allAliases, readConfObject(c, 'assemblyNames')))
64
67
  .filter(c => {
65
68
  const { displayTypes } = pluginManager.getViewType(self.view.type)
66
69
  const compatDisplays = displayTypes.map((d: { name: string }) => d.name)
@@ -226,24 +229,26 @@ export default function stateTreeFactory(pluginManager: PluginManager) {
226
229
  )
227
230
 
228
231
  const session = getSession(self)
229
- const { connections, connectionInstances } = session
232
+ const { connectionInstances } = session
233
+
234
+ const { assemblyManager } = getSession(self)
235
+ const assembly = assemblyManager.get(assemblyName)
230
236
  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),
237
+ (assembly &&
238
+ connectionInstances
239
+ ?.filter(c =>
240
+ hasAnyOverlap(assembly.allAliases, getConf(c, 'assemblyNames')),
241
+ )
242
+ .map(c => ({
243
+ // @ts-ignore
244
+ id: getSnapshot(c).configuration,
245
+ name: getConf(c, 'name'),
246
+ children: this.connectionHierarchy(assemblyName, c),
242
247
  state: {
243
248
  expanded: true,
244
249
  },
245
- }
246
- }) || []
250
+ }))) ||
251
+ []
247
252
 
248
253
  return {
249
254
  name: 'Root',
@@ -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