@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.
- package/dist/AddConnectionWidget/components/AddConnectionWidget.d.ts +4 -7
- package/dist/AddConnectionWidget/components/AddConnectionWidget.js +15 -20
- package/dist/AddConnectionWidget/components/AddConnectionWidget.js.map +1 -1
- package/dist/AddConnectionWidget/components/ConfigureConnection.d.ts +9 -1
- package/dist/AddConnectionWidget/components/ConfigureConnection.js +3 -3
- package/dist/AddConnectionWidget/components/ConfigureConnection.js.map +1 -1
- package/dist/AddConnectionWidget/components/ConnectionTypeSelect.d.ts +4 -4
- package/dist/AddConnectionWidget/components/ConnectionTypeSelect.js +6 -12
- package/dist/AddConnectionWidget/components/ConnectionTypeSelect.js.map +1 -1
- package/dist/AddConnectionWidget/index.d.ts +2 -2
- package/dist/AddConnectionWidget/index.js.map +1 -1
- package/dist/AddConnectionWidget/model.js.map +1 -1
- package/dist/AddTrackWidget/index.d.ts +2 -2
- package/dist/AddTrackWidget/index.js.map +1 -1
- package/dist/HierarchicalTrackSelectorWidget/components/Header.js +2 -3
- package/dist/HierarchicalTrackSelectorWidget/components/Header.js.map +1 -1
- package/dist/HierarchicalTrackSelectorWidget/components/ManageConnectionsDialog.js +6 -7
- package/dist/HierarchicalTrackSelectorWidget/components/ManageConnectionsDialog.js.map +1 -1
- package/dist/HierarchicalTrackSelectorWidget/components/ToggleConnectionsDialog.d.ts +2 -2
- package/dist/HierarchicalTrackSelectorWidget/components/ToggleConnectionsDialog.js +10 -13
- package/dist/HierarchicalTrackSelectorWidget/components/ToggleConnectionsDialog.js.map +1 -1
- package/dist/HierarchicalTrackSelectorWidget/model.js +13 -17
- package/dist/HierarchicalTrackSelectorWidget/model.js.map +1 -1
- package/dist/PluginStoreWidget/index.d.ts +2 -2
- package/dist/PluginStoreWidget/index.js.map +1 -1
- package/dist/ucsc-trackhub/model.d.ts +16 -4
- package/dist/ucsc-trackhub/ucscTrackHub.d.ts +3 -3
- package/esm/AddConnectionWidget/components/AddConnectionWidget.d.ts +4 -7
- package/esm/AddConnectionWidget/components/AddConnectionWidget.js +16 -21
- package/esm/AddConnectionWidget/components/AddConnectionWidget.js.map +1 -1
- package/esm/AddConnectionWidget/components/ConfigureConnection.d.ts +9 -1
- package/esm/AddConnectionWidget/components/ConfigureConnection.js +3 -3
- package/esm/AddConnectionWidget/components/ConfigureConnection.js.map +1 -1
- package/esm/AddConnectionWidget/components/ConnectionTypeSelect.d.ts +4 -4
- package/esm/AddConnectionWidget/components/ConnectionTypeSelect.js +6 -12
- package/esm/AddConnectionWidget/components/ConnectionTypeSelect.js.map +1 -1
- package/esm/AddConnectionWidget/index.d.ts +2 -2
- package/esm/AddConnectionWidget/index.js.map +1 -1
- package/esm/AddConnectionWidget/model.js.map +1 -1
- package/esm/AddTrackWidget/index.d.ts +2 -2
- package/esm/AddTrackWidget/index.js.map +1 -1
- package/esm/HierarchicalTrackSelectorWidget/components/Header.js +2 -3
- package/esm/HierarchicalTrackSelectorWidget/components/Header.js.map +1 -1
- package/esm/HierarchicalTrackSelectorWidget/components/ManageConnectionsDialog.js +6 -7
- package/esm/HierarchicalTrackSelectorWidget/components/ManageConnectionsDialog.js.map +1 -1
- package/esm/HierarchicalTrackSelectorWidget/components/ToggleConnectionsDialog.d.ts +2 -2
- package/esm/HierarchicalTrackSelectorWidget/components/ToggleConnectionsDialog.js +8 -13
- package/esm/HierarchicalTrackSelectorWidget/components/ToggleConnectionsDialog.js.map +1 -1
- package/esm/HierarchicalTrackSelectorWidget/model.js +14 -18
- package/esm/HierarchicalTrackSelectorWidget/model.js.map +1 -1
- package/esm/PluginStoreWidget/index.d.ts +2 -2
- package/esm/PluginStoreWidget/index.js.map +1 -1
- package/esm/ucsc-trackhub/model.d.ts +16 -4
- package/esm/ucsc-trackhub/ucscTrackHub.d.ts +3 -3
- package/package.json +3 -3
- package/src/AddConnectionWidget/components/{AddConnectionWidget.js → AddConnectionWidget.tsx} +28 -33
- package/src/AddConnectionWidget/components/ConfigureConnection.tsx +26 -0
- package/src/AddConnectionWidget/components/ConnectionTypeSelect.tsx +43 -52
- package/src/AddConnectionWidget/components/__snapshots__/AddConnectionWidget.test.js.snap +8 -8
- package/src/AddConnectionWidget/{index.js → index.ts} +0 -0
- package/src/AddConnectionWidget/{model.js → model.ts} +0 -0
- package/src/AddTrackWidget/components/AddTrackWidget.test.tsx +75 -85
- package/src/AddTrackWidget/{index.js → index.ts} +0 -0
- package/src/HierarchicalTrackSelectorWidget/components/Header.tsx +2 -2
- package/src/HierarchicalTrackSelectorWidget/components/HierarchicalTrackSelector.test.tsx +7 -15
- package/src/HierarchicalTrackSelectorWidget/components/ManageConnectionsDialog.tsx +13 -15
- package/src/HierarchicalTrackSelectorWidget/components/ToggleConnectionsDialog.tsx +9 -14
- package/src/HierarchicalTrackSelectorWidget/components/__snapshots__/HierarchicalTrackSelector.test.tsx.snap +2 -2
- package/src/HierarchicalTrackSelectorWidget/model.ts +25 -20
- package/src/PluginStoreWidget/components/__snapshots__/PluginStoreWidget.test.js.snap +2 -2
- package/src/PluginStoreWidget/{index.js → index.ts} +0 -0
- 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
|
-
<
|
|
66
|
-
|
|
67
|
-
{
|
|
68
|
-
<
|
|
69
|
-
|
|
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
|
-
|
|
73
|
-
|
|
74
|
-
|
|
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
|
-
{
|
|
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
|
-
{!
|
|
95
|
-
<Typography>No connections found
|
|
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 {
|
|
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 {
|
|
232
|
+
const { connectionInstances } = session
|
|
233
|
+
|
|
234
|
+
const { assemblyManager } = getSession(self)
|
|
235
|
+
const assembly = assemblyManager.get(assemblyName)
|
|
230
236
|
const conns =
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
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
|