@jbrowse/plugin-data-management 4.0.4 → 4.1.3
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/esm/AddTrackWidget/components/ConfirmTrack.js +5 -2
- package/esm/AddTrackWidget/components/TrackAdapterSelector.js +6 -2
- package/esm/AddTrackWidget/components/TrackSourceSelect.js +1 -1
- package/esm/AddTrackWidget/model.d.ts +1 -0
- package/esm/AddTrackWidget/model.js +8 -0
- package/package.json +8 -7
|
@@ -25,9 +25,9 @@ const useStyles = makeStyles()(theme => ({
|
|
|
25
25
|
const ConfirmTrack = observer(function ConfirmTrack({ model, }) {
|
|
26
26
|
const { classes } = useStyles();
|
|
27
27
|
const session = getSession(model);
|
|
28
|
-
const { trackName, unsupported, trackAdapter, trackType, warningMessage, adapterHint, textIndexTrack, } = model;
|
|
28
|
+
const { trackName, unsupported, trackAdapter, trackType, warningMessage, adapterHint, textIndexTrack, adapterHintNotConfigurable, } = model;
|
|
29
29
|
useEffect(() => {
|
|
30
|
-
if (adapterHint === '' && trackAdapter) {
|
|
30
|
+
if (adapterHint === '' && trackAdapter && trackAdapter.type !== UNKNOWN) {
|
|
31
31
|
model.setAdapterHint(trackAdapter.type);
|
|
32
32
|
}
|
|
33
33
|
}, [adapterHint, trackAdapter, model]);
|
|
@@ -37,6 +37,9 @@ const ConfirmTrack = observer(function ConfirmTrack({ model, }) {
|
|
|
37
37
|
else if (trackAdapter?.type === UNKNOWN) {
|
|
38
38
|
return _jsx(UnknownAdapterPrompt, { model: model });
|
|
39
39
|
}
|
|
40
|
+
else if (adapterHintNotConfigurable) {
|
|
41
|
+
return (_jsxs(Typography, { color: "error", children: ["The \"", adapterHint, "\" adapter cannot be configured for the provided file. This adapter may require a specific file extension or format. Please check the file or select a different adapter."] }));
|
|
42
|
+
}
|
|
40
43
|
else if (!trackAdapter?.type) {
|
|
41
44
|
return _jsx(Typography, { children: "Could not recognize this data type." });
|
|
42
45
|
}
|
|
@@ -4,9 +4,13 @@ import { ListSubheader, MenuItem, TextField } from '@mui/material';
|
|
|
4
4
|
import { observer } from 'mobx-react';
|
|
5
5
|
import { categorizeAdapters } from "./util.js";
|
|
6
6
|
const TrackAdapterSelector = observer(function ({ model, }) {
|
|
7
|
-
const { trackAdapter } = model;
|
|
7
|
+
const { trackAdapter, adapterHintNotConfigurable } = model;
|
|
8
|
+
const { adapterHint } = model;
|
|
8
9
|
const { pluginManager } = getEnv(model);
|
|
9
|
-
|
|
10
|
+
const displayValue = adapterHint || (trackAdapter?.type !== 'UNKNOWN' ? trackAdapter?.type : '');
|
|
11
|
+
return (_jsx(TextField, { value: displayValue, label: "Adapter type", variant: "outlined", select: true, fullWidth: true, error: adapterHintNotConfigurable, helperText: adapterHintNotConfigurable
|
|
12
|
+
? `The "${adapterHint}" adapter cannot be configured for the provided file. This adapter may require a specific file extension or additional setup.`
|
|
13
|
+
: undefined, onChange: event => {
|
|
10
14
|
model.setAdapterHint(event.target.value);
|
|
11
15
|
}, slotProps: {
|
|
12
16
|
select: {
|
|
@@ -15,6 +15,6 @@ const useStyles = makeStyles()(theme => ({
|
|
|
15
15
|
const TrackSourceSelect = observer(function TrackSourceSelect({ model, }) {
|
|
16
16
|
const { classes } = useStyles();
|
|
17
17
|
const rootModel = getRoot(model);
|
|
18
|
-
return (_jsxs(Paper, { className: classes.paper, children: [_jsx(FileSelector, { name: "Main file", description: "", location: model.trackData, setLocation: model.setTrackData,
|
|
18
|
+
return (_jsxs(Paper, { className: classes.paper, children: [_jsx(FileSelector, { name: "Main file", description: "", location: model.trackData, setLocation: model.setTrackData, rootModel: rootModel }), _jsx("div", { className: classes.spacer }), _jsx(FileSelector, { name: "Index file", description: "(Optional) The URL of the index file is automatically inferred from the URL of the main file if it is not supplied.", location: model.indexTrackData, setLocation: model.setIndexTrackData, rootModel: rootModel })] }));
|
|
19
19
|
});
|
|
20
20
|
export default TrackSourceSelect;
|
|
@@ -41,6 +41,7 @@ export default function f(pluginManager: PluginManager): import("@jbrowse/mobx-s
|
|
|
41
41
|
readonly indexHttp: boolean | undefined;
|
|
42
42
|
readonly wrongProtocol: boolean | undefined;
|
|
43
43
|
readonly unsupported: boolean;
|
|
44
|
+
readonly adapterHintNotConfigurable: boolean;
|
|
44
45
|
readonly assembly: any;
|
|
45
46
|
readonly trackAdapterType: string | undefined;
|
|
46
47
|
readonly trackType: string;
|
|
@@ -116,6 +116,14 @@ export default function f(pluginManager) {
|
|
|
116
116
|
get unsupported() {
|
|
117
117
|
return this.trackAdapter?.type === UNSUPPORTED;
|
|
118
118
|
},
|
|
119
|
+
get adapterHintNotConfigurable() {
|
|
120
|
+
const { adapterHint } = self;
|
|
121
|
+
const adapterType = this.trackAdapter?.type;
|
|
122
|
+
return !!(adapterHint &&
|
|
123
|
+
(!adapterType ||
|
|
124
|
+
adapterType === 'UNKNOWN' ||
|
|
125
|
+
adapterType !== adapterHint));
|
|
126
|
+
},
|
|
119
127
|
get assembly() {
|
|
120
128
|
return self.altAssemblyName || self.view?.assemblyNames?.[0];
|
|
121
129
|
},
|
package/package.json
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@jbrowse/plugin-data-management",
|
|
3
|
-
"version": "4.
|
|
3
|
+
"version": "4.1.3",
|
|
4
|
+
"type": "module",
|
|
4
5
|
"description": "JBrowse 2 linear genome view",
|
|
5
6
|
"keywords": [
|
|
6
7
|
"jbrowse",
|
|
@@ -22,15 +23,15 @@
|
|
|
22
23
|
"dependencies": {
|
|
23
24
|
"@gmod/ucsc-hub": "^2.0.3",
|
|
24
25
|
"@jbrowse/mobx-state-tree": "^5.5.0",
|
|
25
|
-
"@mui/icons-material": "^7.3.
|
|
26
|
-
"@mui/material": "^7.3.
|
|
27
|
-
"@mui/x-data-grid": "^8.
|
|
26
|
+
"@mui/icons-material": "^7.3.7",
|
|
27
|
+
"@mui/material": "^7.3.7",
|
|
28
|
+
"@mui/x-data-grid": "^8.26.0",
|
|
28
29
|
"deepmerge": "^4.3.1",
|
|
29
30
|
"mobx": "^6.15.0",
|
|
30
31
|
"mobx-react": "^9.2.1",
|
|
31
|
-
"@jbrowse/
|
|
32
|
-
"@jbrowse/
|
|
33
|
-
"@jbrowse/
|
|
32
|
+
"@jbrowse/core": "^4.1.3",
|
|
33
|
+
"@jbrowse/plugin-config": "^4.1.3",
|
|
34
|
+
"@jbrowse/product-core": "^4.1.3"
|
|
34
35
|
},
|
|
35
36
|
"peerDependencies": {
|
|
36
37
|
"react": ">=18.0.0"
|