From 35e96c71b5ebd19cfc8ae9da70ff99df7c742136 Mon Sep 17 00:00:00 2001 From: Caroline Bridge Date: Fri, 9 Sep 2022 15:43:35 -0400 Subject: [PATCH 1/7] Infrastructure changes necessary for MLLV --- packages/core/PluginManager.ts | 3 +- .../core/pluggableElementTypes/ViewType.ts | 7 ++ .../LinearGenomeView/components/Header.tsx | 14 ++-- .../components/LinearGenomeView.tsx | 22 ++---- .../components/MiniControls.tsx | 76 ++++++++++--------- .../src/LinearGenomeView/index.tsx | 24 +++++- 6 files changed, 84 insertions(+), 62 deletions(-) diff --git a/packages/core/PluginManager.ts b/packages/core/PluginManager.ts index ee1505367a..992a9fac6f 100644 --- a/packages/core/PluginManager.ts +++ b/packages/core/PluginManager.ts @@ -519,7 +519,8 @@ export default class PluginManager { displays.forEach(display => { // view may have already added the displayType in its callback if ( - display.viewType === newView.name && + (display.viewType === newView.name || + display.viewType === newView.extendedName) && !newView.displayTypes.includes(display) ) { newView.addDisplayType(display) diff --git a/packages/core/pluggableElementTypes/ViewType.ts b/packages/core/pluggableElementTypes/ViewType.ts index eed827cdaa..f179dd7689 100644 --- a/packages/core/pluggableElementTypes/ViewType.ts +++ b/packages/core/pluggableElementTypes/ViewType.ts @@ -18,14 +18,21 @@ export default class ViewType extends PluggableElementBase { displayTypes: DisplayType[] = [] + // allows for views that are 'extended' from other views to be added as a new view type in the plugin manager + // without this, the plugin manager cannot distinguish whether relevant displays have been added to the view type's list + // and thus will not display tracks that should be accessible within a view that has been extended from another + extendedName?: string + constructor(stuff: { name: string ReactComponent: ViewReactComponent stateModel: IAnyModelType + extendedName?: string }) { super(stuff) this.ReactComponent = stuff.ReactComponent this.stateModel = stuff.stateModel + this.extendedName = stuff.extendedName ? stuff.extendedName : undefined if (!this.ReactComponent) { throw new Error(`no ReactComponent defined for view ${this.name}`) } diff --git a/plugins/linear-genome-view/src/LinearGenomeView/components/Header.tsx b/plugins/linear-genome-view/src/LinearGenomeView/components/Header.tsx index 08028be9e2..512b2305ac 100644 --- a/plugins/linear-genome-view/src/LinearGenomeView/components/Header.tsx +++ b/plugins/linear-genome-view/src/LinearGenomeView/components/Header.tsx @@ -119,13 +119,15 @@ const Controls = ({ model }: { model: LGV }) => { } const LinearGenomeViewHeader = observer(({ model }: { model: LGV }) => { - return model.hideHeaderOverview ? ( - - ) : ( - + return !model.hideHeader ? ( + model.hideHeaderOverview ? ( - - ) + ) : ( + + + + ) + ) : null }) export default LinearGenomeViewHeader diff --git a/plugins/linear-genome-view/src/LinearGenomeView/components/LinearGenomeView.tsx b/plugins/linear-genome-view/src/LinearGenomeView/components/LinearGenomeView.tsx index 44d697dda2..3a0bde7da9 100644 --- a/plugins/linear-genome-view/src/LinearGenomeView/components/LinearGenomeView.tsx +++ b/plugins/linear-genome-view/src/LinearGenomeView/components/LinearGenomeView.tsx @@ -6,11 +6,9 @@ import { observer } from 'mobx-react' // locals import { LinearGenomeViewModel } from '..' -import Header from './Header' import TrackContainer from './TrackContainer' import TracksContainer from './TracksContainer' import ImportForm from './ImportForm' -import MiniControls from './MiniControls' import GetSequenceDialog from './GetSequenceDialog' import SearchResultsDialog from './SearchResultsDialog' @@ -45,7 +43,7 @@ const useStyles = makeStyles()(theme => ({ })) const LinearGenomeView = observer(({ model }: { model: LGV }) => { - const { tracks, error, hideHeader, initialized, hasDisplayedRegions } = model + const { tracks, error, initialized, hasDisplayedRegions } = model const { classes } = useStyles() if (!initialized && !error) { @@ -59,6 +57,9 @@ const LinearGenomeView = observer(({ model }: { model: LGV }) => { return } + const MiniControlsComponent = model.MiniControlsComponent() + const HeaderComponent = model.HeaderComponent() + return (
{model.seqDialogDisplayed ? ( @@ -73,19 +74,8 @@ const LinearGenomeView = observer(({ model }: { model: LGV }) => { handleClose={() => model.setSearchResults(undefined, undefined)} /> ) : null} - {!hideHeader ? ( -
- ) : ( -
- -
- )} + + {!tracks.length ? ( diff --git a/plugins/linear-genome-view/src/LinearGenomeView/components/MiniControls.tsx b/plugins/linear-genome-view/src/LinearGenomeView/components/MiniControls.tsx index 4484a8d131..72c1113130 100644 --- a/plugins/linear-genome-view/src/LinearGenomeView/components/MiniControls.tsx +++ b/plugins/linear-genome-view/src/LinearGenomeView/components/MiniControls.tsx @@ -9,46 +9,48 @@ import { LinearGenomeViewModel } from '..' const MiniControls = observer((props: { model: LinearGenomeViewModel }) => { const { model } = props - const { bpPerPx, maxBpPerPx, minBpPerPx, scaleFactor } = model + const { bpPerPx, maxBpPerPx, minBpPerPx, scaleFactor, hideHeader } = model const [anchorEl, setAnchorEl] = useState() - return ( - - setAnchorEl(event.currentTarget)} - > - - + return hideHeader ? ( +
+ + setAnchorEl(event.currentTarget)} + > + + - model.zoom(bpPerPx * 2)} - disabled={bpPerPx >= maxBpPerPx - 0.0001 || scaleFactor !== 1} - color="secondary" - > - - - model.zoom(model.bpPerPx / 2)} - disabled={bpPerPx <= minBpPerPx + 0.0001 || scaleFactor !== 1} - color="secondary" - > - - - { - callback() - setAnchorEl(undefined) - }} - onClose={() => setAnchorEl(undefined)} - menuItems={model.menuItems()} - /> - - ) + model.zoom(bpPerPx * 2)} + disabled={bpPerPx >= maxBpPerPx - 0.0001 || scaleFactor !== 1} + color="secondary" + > + + + model.zoom(model.bpPerPx / 2)} + disabled={bpPerPx <= minBpPerPx + 0.0001 || scaleFactor !== 1} + color="secondary" + > + + + { + callback() + setAnchorEl(undefined) + }} + onClose={() => setAnchorEl(undefined)} + menuItems={model.menuItems()} + /> + +
+ ) : null }) export default MiniControls diff --git a/plugins/linear-genome-view/src/LinearGenomeView/index.tsx b/plugins/linear-genome-view/src/LinearGenomeView/index.tsx index a997678536..e9f5255327 100644 --- a/plugins/linear-genome-view/src/LinearGenomeView/index.tsx +++ b/plugins/linear-genome-view/src/LinearGenomeView/index.tsx @@ -1,4 +1,4 @@ -import { lazy } from 'react' +import React, { lazy } from 'react' import { getConf, AnyConfigurationModel } from '@jbrowse/core/configuration' import { BaseViewModel } from '@jbrowse/core/pluggableElementTypes/models' import { Region } from '@jbrowse/core/util/types' @@ -53,6 +53,10 @@ import { renderToSvg } from './components/LinearGenomeViewSvg' import RefNameAutocomplete from './components/RefNameAutocomplete' import SearchBox from './components/SearchBox' import ExportSvgDlg from './components/ExportSvgDialog' +import MiniControls from './components/MiniControls' +import Header from './components/Header' +import ZoomControls from './components/ZoomControls' +import LinearGenomeView from './components/LinearGenomeView' const SequenceSearchDialog = lazy( () => import('./components/SequenceSearchDialog'), @@ -192,6 +196,16 @@ export function stateModelFactory(pluginManager: PluginManager) { }, })) .views(self => ({ + // eslint-disable-next-line @typescript-eslint/no-explicit-any + MiniControlsComponent(): React.FC { + return MiniControls + }, + + // eslint-disable-next-line @typescript-eslint/no-explicit-any + HeaderComponent(): React.FC { + return Header + }, + get assemblyErrors() { const { assemblyManager } = getSession(self) const { assemblyNames } = self @@ -1220,7 +1234,13 @@ export function stateModelFactory(pluginManager: PluginManager) { })) } -export { renderToSvg, RefNameAutocomplete, SearchBox } +export { + renderToSvg, + RefNameAutocomplete, + SearchBox, + ZoomControls, + LinearGenomeView, +} export type LinearGenomeViewStateModel = ReturnType export type LinearGenomeViewModel = Instance export { default as ReactComponent } from './components/LinearGenomeView' From 2e2be35f3a1c4c10e931ba520f38f46a1e594204 Mon Sep 17 00:00:00 2001 From: Caroline Bridge Date: Thu, 22 Sep 2022 10:45:58 -0400 Subject: [PATCH 2/7] styles import theme and export components runtime --- .../src/LinearGenomeView/components/SearchBox.tsx | 2 +- plugins/linear-genome-view/src/index.ts | 3 +++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/plugins/linear-genome-view/src/LinearGenomeView/components/SearchBox.tsx b/plugins/linear-genome-view/src/LinearGenomeView/components/SearchBox.tsx index 595534b71a..10a2d05f1e 100644 --- a/plugins/linear-genome-view/src/LinearGenomeView/components/SearchBox.tsx +++ b/plugins/linear-genome-view/src/LinearGenomeView/components/SearchBox.tsx @@ -1,6 +1,6 @@ import React from 'react' import { observer } from 'mobx-react' -import { useTheme, alpha } from '@mui/material' +import { useTheme, alpha } from '@mui/material/styles' import { makeStyles } from 'tss-react/mui' import { getSession } from '@jbrowse/core/util' import BaseResult from '@jbrowse/core/TextSearch/BaseResults' diff --git a/plugins/linear-genome-view/src/index.ts b/plugins/linear-genome-view/src/index.ts index ddfc6697eb..f2bfb6b729 100644 --- a/plugins/linear-genome-view/src/index.ts +++ b/plugins/linear-genome-view/src/index.ts @@ -29,6 +29,7 @@ import { renderToSvg, RefNameAutocomplete, SearchBox, + ZoomControls, } from './LinearGenomeView' import { @@ -45,6 +46,8 @@ export default class LinearGenomeViewPlugin extends Plugin { BaseLinearDisplayComponent, BaseLinearDisplay, baseLinearDisplayConfigSchema, + SearchBox, + ZoomControls, } install(pluginManager: PluginManager) { From 091c68e4af05d1ba60135ce0e8606a91e24a8e6b Mon Sep 17 00:00:00 2001 From: Caroline Bridge Date: Thu, 22 Sep 2022 11:14:40 -0400 Subject: [PATCH 3/7] export for external plugin runtime import --- .../src/LinearGenomeView/components/SearchBox.tsx | 2 ++ plugins/linear-genome-view/src/index.ts | 2 ++ 2 files changed, 4 insertions(+) diff --git a/plugins/linear-genome-view/src/LinearGenomeView/components/SearchBox.tsx b/plugins/linear-genome-view/src/LinearGenomeView/components/SearchBox.tsx index 8ac18f3966..99aa7b1923 100644 --- a/plugins/linear-genome-view/src/LinearGenomeView/components/SearchBox.tsx +++ b/plugins/linear-genome-view/src/LinearGenomeView/components/SearchBox.tsx @@ -51,11 +51,13 @@ function SearchBox({ // 3) else assume it's a locstring and navigate to it async function handleSelectedRegion(option: BaseResult) { try { + // @ts-ignore if (option.hasLocation()) { navToOption(option) } else { const input = option.getLabel() const [ref, rest] = splitLast(input, ':') + // @ts-ignore const allRefs = assembly?.allRefNamesWithLowerCase || [] if ( allRefs.includes(input) || diff --git a/plugins/linear-genome-view/src/index.ts b/plugins/linear-genome-view/src/index.ts index f2bfb6b729..fbabc94d89 100644 --- a/plugins/linear-genome-view/src/index.ts +++ b/plugins/linear-genome-view/src/index.ts @@ -30,6 +30,7 @@ import { RefNameAutocomplete, SearchBox, ZoomControls, + LinearGenomeView, } from './LinearGenomeView' import { @@ -48,6 +49,7 @@ export default class LinearGenomeViewPlugin extends Plugin { baseLinearDisplayConfigSchema, SearchBox, ZoomControls, + LinearGenomeView, } install(pluginManager: PluginManager) { From a1d7212f762f8cdffb1077e0b89ff0b838391cb2 Mon Sep 17 00:00:00 2001 From: Caroline Bridge Date: Thu, 22 Sep 2022 11:33:16 -0400 Subject: [PATCH 4/7] update snaps --- .../ConfigurationEditor.test.tsx.snap | 46 +++++++++---------- .../AddConnectionWidget.test.js.snap | 2 +- .../LinearGenomeView.test.js.snap | 4 +- .../JBrowseLinearGenomeView.test.tsx.snap | 2 +- 4 files changed, 27 insertions(+), 27 deletions(-) diff --git a/plugins/config/src/ConfigurationEditorWidget/components/__snapshots__/ConfigurationEditor.test.tsx.snap b/plugins/config/src/ConfigurationEditorWidget/components/__snapshots__/ConfigurationEditor.test.tsx.snap index 8884b9a9e9..24eff05411 100644 --- a/plugins/config/src/ConfigurationEditorWidget/components/__snapshots__/ConfigurationEditor.test.tsx.snap +++ b/plugins/config/src/ConfigurationEditorWidget/components/__snapshots__/ConfigurationEditor.test.tsx.snap @@ -86,7 +86,7 @@ exports[`ConfigurationEditor widget renders all the different types of built-in class="MuiOutlinedInput-notchedOutline css-1d3z3hw-MuiOutlinedInput-notchedOutline" > stringTest @@ -191,7 +191,7 @@ exports[`ConfigurationEditor widget renders all the different types of built-in class="MuiOutlinedInput-notchedOutline css-1d3z3hw-MuiOutlinedInput-notchedOutline" > Enter URL @@ -269,7 +269,7 @@ exports[`ConfigurationEditor widget renders all the different types of built-in class="MuiOutlinedInput-notchedOutline css-1d3z3hw-MuiOutlinedInput-notchedOutline" > numberTest @@ -717,7 +717,7 @@ exports[`ConfigurationEditor widget renders all the different types of built-in class="MuiOutlinedInput-notchedOutline css-1d3z3hw-MuiOutlinedInput-notchedOutline" > integerTest @@ -775,7 +775,7 @@ exports[`ConfigurationEditor widget renders all the different types of built-in class="MuiOutlinedInput-notchedOutline css-1d3z3hw-MuiOutlinedInput-notchedOutline" > colorTest @@ -948,7 +948,7 @@ exports[`ConfigurationEditor widget renders with defaults of the PileupTrack sch class="MuiOutlinedInput-notchedOutline css-1d3z3hw-MuiOutlinedInput-notchedOutline" > maxFeatureScreenDensity @@ -1003,7 +1003,7 @@ exports[`ConfigurationEditor widget renders with defaults of the PileupTrack sch class="MuiOutlinedInput-notchedOutline css-1d3z3hw-MuiOutlinedInput-notchedOutline" > fetchSizeLimit @@ -1060,7 +1060,7 @@ exports[`ConfigurationEditor widget renders with defaults of the PileupTrack sch class="MuiOutlinedInput-notchedOutline css-1d3z3hw-MuiOutlinedInput-notchedOutline" > Type @@ -1283,7 +1283,7 @@ exports[`ConfigurationEditor widget renders with defaults of the PileupTrack sch class="MuiOutlinedInput-notchedOutline css-1d3z3hw-MuiOutlinedInput-notchedOutline" > color @@ -1392,7 +1392,7 @@ exports[`ConfigurationEditor widget renders with defaults of the PileupTrack sch class="MuiOutlinedInput-notchedOutline css-1d3z3hw-MuiOutlinedInput-notchedOutline" > orientationType @@ -1468,7 +1468,7 @@ exports[`ConfigurationEditor widget renders with defaults of the PileupTrack sch class="MuiOutlinedInput-notchedOutline css-1d3z3hw-MuiOutlinedInput-notchedOutline" > displayMode @@ -1523,7 +1523,7 @@ exports[`ConfigurationEditor widget renders with defaults of the PileupTrack sch class="MuiOutlinedInput-notchedOutline css-1d3z3hw-MuiOutlinedInput-notchedOutline" > minSubfeatureWidth @@ -1578,7 +1578,7 @@ exports[`ConfigurationEditor widget renders with defaults of the PileupTrack sch class="MuiOutlinedInput-notchedOutline css-1d3z3hw-MuiOutlinedInput-notchedOutline" > maxHeight @@ -1633,7 +1633,7 @@ exports[`ConfigurationEditor widget renders with defaults of the PileupTrack sch class="MuiOutlinedInput-notchedOutline css-1d3z3hw-MuiOutlinedInput-notchedOutline" > maxClippingSize @@ -1688,7 +1688,7 @@ exports[`ConfigurationEditor widget renders with defaults of the PileupTrack sch class="MuiOutlinedInput-notchedOutline css-1d3z3hw-MuiOutlinedInput-notchedOutline" > height @@ -1817,7 +1817,7 @@ exports[`ConfigurationEditor widget renders with defaults of the PileupTrack sch class="MuiOutlinedInput-notchedOutline css-1d3z3hw-MuiOutlinedInput-notchedOutline" > largeInsertionIndicatorScale @@ -1992,7 +1992,7 @@ exports[`ConfigurationEditor widget renders with just the required model element class="MuiOutlinedInput-notchedOutline css-1d3z3hw-MuiOutlinedInput-notchedOutline" > foo diff --git a/plugins/data-management/src/AddConnectionWidget/components/__snapshots__/AddConnectionWidget.test.js.snap b/plugins/data-management/src/AddConnectionWidget/components/__snapshots__/AddConnectionWidget.test.js.snap index e1e69c4d1a..5e7ec25feb 100644 --- a/plugins/data-management/src/AddConnectionWidget/components/__snapshots__/AddConnectionWidget.test.js.snap +++ b/plugins/data-management/src/AddConnectionWidget/components/__snapshots__/AddConnectionWidget.test.js.snap @@ -112,7 +112,7 @@ exports[` renders 1`] = ` class="MuiOutlinedInput-notchedOutline css-1d3z3hw-MuiOutlinedInput-notchedOutline" > connectionType diff --git a/plugins/linear-genome-view/src/LinearGenomeView/components/__snapshots__/LinearGenomeView.test.js.snap b/plugins/linear-genome-view/src/LinearGenomeView/components/__snapshots__/LinearGenomeView.test.js.snap index 76e718a200..c30748c2e3 100644 --- a/plugins/linear-genome-view/src/LinearGenomeView/components/__snapshots__/LinearGenomeView.test.js.snap +++ b/plugins/linear-genome-view/src/LinearGenomeView/components/__snapshots__/LinearGenomeView.test.js.snap @@ -224,7 +224,7 @@ exports[` renders one track, one region 1`] = ` class="MuiOutlinedInput-notchedOutline css-1d3z3hw-MuiOutlinedInput-notchedOutline" > renders two tracks, two regions 1`] = ` class="MuiOutlinedInput-notchedOutline css-1d3z3hw-MuiOutlinedInput-notchedOutline" > renders successfully 1`] = ` class="MuiOutlinedInput-notchedOutline mui-1d3z3hw-MuiOutlinedInput-notchedOutline" > Date: Wed, 28 Sep 2022 15:05:43 -0400 Subject: [PATCH 5/7] snaps --- .../ConfigurationEditor.test.tsx.snap | 46 +++++++++---------- .../AddConnectionWidget.test.js.snap | 2 +- .../LinearGenomeView.test.js.snap | 4 +- .../JBrowseLinearGenomeView.test.tsx.snap | 2 +- 4 files changed, 27 insertions(+), 27 deletions(-) diff --git a/plugins/config/src/ConfigurationEditorWidget/components/__snapshots__/ConfigurationEditor.test.tsx.snap b/plugins/config/src/ConfigurationEditorWidget/components/__snapshots__/ConfigurationEditor.test.tsx.snap index 24eff05411..8884b9a9e9 100644 --- a/plugins/config/src/ConfigurationEditorWidget/components/__snapshots__/ConfigurationEditor.test.tsx.snap +++ b/plugins/config/src/ConfigurationEditorWidget/components/__snapshots__/ConfigurationEditor.test.tsx.snap @@ -86,7 +86,7 @@ exports[`ConfigurationEditor widget renders all the different types of built-in class="MuiOutlinedInput-notchedOutline css-1d3z3hw-MuiOutlinedInput-notchedOutline" > stringTest @@ -191,7 +191,7 @@ exports[`ConfigurationEditor widget renders all the different types of built-in class="MuiOutlinedInput-notchedOutline css-1d3z3hw-MuiOutlinedInput-notchedOutline" > Enter URL @@ -269,7 +269,7 @@ exports[`ConfigurationEditor widget renders all the different types of built-in class="MuiOutlinedInput-notchedOutline css-1d3z3hw-MuiOutlinedInput-notchedOutline" > numberTest @@ -717,7 +717,7 @@ exports[`ConfigurationEditor widget renders all the different types of built-in class="MuiOutlinedInput-notchedOutline css-1d3z3hw-MuiOutlinedInput-notchedOutline" > integerTest @@ -775,7 +775,7 @@ exports[`ConfigurationEditor widget renders all the different types of built-in class="MuiOutlinedInput-notchedOutline css-1d3z3hw-MuiOutlinedInput-notchedOutline" > colorTest @@ -948,7 +948,7 @@ exports[`ConfigurationEditor widget renders with defaults of the PileupTrack sch class="MuiOutlinedInput-notchedOutline css-1d3z3hw-MuiOutlinedInput-notchedOutline" > maxFeatureScreenDensity @@ -1003,7 +1003,7 @@ exports[`ConfigurationEditor widget renders with defaults of the PileupTrack sch class="MuiOutlinedInput-notchedOutline css-1d3z3hw-MuiOutlinedInput-notchedOutline" > fetchSizeLimit @@ -1060,7 +1060,7 @@ exports[`ConfigurationEditor widget renders with defaults of the PileupTrack sch class="MuiOutlinedInput-notchedOutline css-1d3z3hw-MuiOutlinedInput-notchedOutline" > Type @@ -1283,7 +1283,7 @@ exports[`ConfigurationEditor widget renders with defaults of the PileupTrack sch class="MuiOutlinedInput-notchedOutline css-1d3z3hw-MuiOutlinedInput-notchedOutline" > color @@ -1392,7 +1392,7 @@ exports[`ConfigurationEditor widget renders with defaults of the PileupTrack sch class="MuiOutlinedInput-notchedOutline css-1d3z3hw-MuiOutlinedInput-notchedOutline" > orientationType @@ -1468,7 +1468,7 @@ exports[`ConfigurationEditor widget renders with defaults of the PileupTrack sch class="MuiOutlinedInput-notchedOutline css-1d3z3hw-MuiOutlinedInput-notchedOutline" > displayMode @@ -1523,7 +1523,7 @@ exports[`ConfigurationEditor widget renders with defaults of the PileupTrack sch class="MuiOutlinedInput-notchedOutline css-1d3z3hw-MuiOutlinedInput-notchedOutline" > minSubfeatureWidth @@ -1578,7 +1578,7 @@ exports[`ConfigurationEditor widget renders with defaults of the PileupTrack sch class="MuiOutlinedInput-notchedOutline css-1d3z3hw-MuiOutlinedInput-notchedOutline" > maxHeight @@ -1633,7 +1633,7 @@ exports[`ConfigurationEditor widget renders with defaults of the PileupTrack sch class="MuiOutlinedInput-notchedOutline css-1d3z3hw-MuiOutlinedInput-notchedOutline" > maxClippingSize @@ -1688,7 +1688,7 @@ exports[`ConfigurationEditor widget renders with defaults of the PileupTrack sch class="MuiOutlinedInput-notchedOutline css-1d3z3hw-MuiOutlinedInput-notchedOutline" > height @@ -1817,7 +1817,7 @@ exports[`ConfigurationEditor widget renders with defaults of the PileupTrack sch class="MuiOutlinedInput-notchedOutline css-1d3z3hw-MuiOutlinedInput-notchedOutline" > largeInsertionIndicatorScale @@ -1992,7 +1992,7 @@ exports[`ConfigurationEditor widget renders with just the required model element class="MuiOutlinedInput-notchedOutline css-1d3z3hw-MuiOutlinedInput-notchedOutline" > foo diff --git a/plugins/data-management/src/AddConnectionWidget/components/__snapshots__/AddConnectionWidget.test.js.snap b/plugins/data-management/src/AddConnectionWidget/components/__snapshots__/AddConnectionWidget.test.js.snap index 5e7ec25feb..e1e69c4d1a 100644 --- a/plugins/data-management/src/AddConnectionWidget/components/__snapshots__/AddConnectionWidget.test.js.snap +++ b/plugins/data-management/src/AddConnectionWidget/components/__snapshots__/AddConnectionWidget.test.js.snap @@ -112,7 +112,7 @@ exports[` renders 1`] = ` class="MuiOutlinedInput-notchedOutline css-1d3z3hw-MuiOutlinedInput-notchedOutline" > connectionType diff --git a/plugins/linear-genome-view/src/LinearGenomeView/components/__snapshots__/LinearGenomeView.test.js.snap b/plugins/linear-genome-view/src/LinearGenomeView/components/__snapshots__/LinearGenomeView.test.js.snap index f11497884c..8492fc6768 100644 --- a/plugins/linear-genome-view/src/LinearGenomeView/components/__snapshots__/LinearGenomeView.test.js.snap +++ b/plugins/linear-genome-view/src/LinearGenomeView/components/__snapshots__/LinearGenomeView.test.js.snap @@ -224,7 +224,7 @@ exports[` renders one track, one region 1`] = ` class="MuiOutlinedInput-notchedOutline css-1d3z3hw-MuiOutlinedInput-notchedOutline" > renders two tracks, two regions 1`] = ` class="MuiOutlinedInput-notchedOutline css-1d3z3hw-MuiOutlinedInput-notchedOutline" > renders successfully 1`] = ` class="MuiOutlinedInput-notchedOutline mui-1d3z3hw-MuiOutlinedInput-notchedOutline" > Date: Thu, 29 Sep 2022 09:25:41 -0400 Subject: [PATCH 6/7] remove ternary and tsignore snaps --- packages/core/pluggableElementTypes/ViewType.ts | 2 +- .../src/LinearGenomeView/components/SearchBox.tsx | 4 +--- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/packages/core/pluggableElementTypes/ViewType.ts b/packages/core/pluggableElementTypes/ViewType.ts index f179dd7689..8f87a6f58d 100644 --- a/packages/core/pluggableElementTypes/ViewType.ts +++ b/packages/core/pluggableElementTypes/ViewType.ts @@ -32,7 +32,7 @@ export default class ViewType extends PluggableElementBase { super(stuff) this.ReactComponent = stuff.ReactComponent this.stateModel = stuff.stateModel - this.extendedName = stuff.extendedName ? stuff.extendedName : undefined + this.extendedName = stuff.extendedName if (!this.ReactComponent) { throw new Error(`no ReactComponent defined for view ${this.name}`) } diff --git a/plugins/linear-genome-view/src/LinearGenomeView/components/SearchBox.tsx b/plugins/linear-genome-view/src/LinearGenomeView/components/SearchBox.tsx index 99aa7b1923..a7c9ca469d 100644 --- a/plugins/linear-genome-view/src/LinearGenomeView/components/SearchBox.tsx +++ b/plugins/linear-genome-view/src/LinearGenomeView/components/SearchBox.tsx @@ -1,6 +1,6 @@ import React from 'react' import { observer } from 'mobx-react' -import { useTheme, alpha } from '@mui/material/styles' +import { useTheme, alpha } from '@mui/material' import { makeStyles } from 'tss-react/mui' import { getSession } from '@jbrowse/core/util' import BaseResult from '@jbrowse/core/TextSearch/BaseResults' @@ -51,13 +51,11 @@ function SearchBox({ // 3) else assume it's a locstring and navigate to it async function handleSelectedRegion(option: BaseResult) { try { - // @ts-ignore if (option.hasLocation()) { navToOption(option) } else { const input = option.getLabel() const [ref, rest] = splitLast(input, ':') - // @ts-ignore const allRefs = assembly?.allRefNamesWithLowerCase || [] if ( allRefs.includes(input) || From 71ac22ae97dda103c74310c62ff87406069f8bbe Mon Sep 17 00:00:00 2001 From: Colin Date: Thu, 29 Sep 2022 08:39:46 -0600 Subject: [PATCH 7/7] Update extendedName description --- packages/core/PluginManager.ts | 1 + packages/core/pluggableElementTypes/ViewType.ts | 9 ++++++--- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/packages/core/PluginManager.ts b/packages/core/PluginManager.ts index 992a9fac6f..5d8153a326 100644 --- a/packages/core/PluginManager.ts +++ b/packages/core/PluginManager.ts @@ -518,6 +518,7 @@ export default class PluginManager { const displays = this.getElementTypesInGroup('display') as DisplayType[] displays.forEach(display => { // view may have already added the displayType in its callback + // see ViewType for description of extendedName if ( (display.viewType === newView.name || display.viewType === newView.extendedName) && diff --git a/packages/core/pluggableElementTypes/ViewType.ts b/packages/core/pluggableElementTypes/ViewType.ts index 8f87a6f58d..f83ca77d6a 100644 --- a/packages/core/pluggableElementTypes/ViewType.ts +++ b/packages/core/pluggableElementTypes/ViewType.ts @@ -18,9 +18,12 @@ export default class ViewType extends PluggableElementBase { displayTypes: DisplayType[] = [] - // allows for views that are 'extended' from other views to be added as a new view type in the plugin manager - // without this, the plugin manager cannot distinguish whether relevant displays have been added to the view type's list - // and thus will not display tracks that should be accessible within a view that has been extended from another + // extendedName can be used for when you extend a given view type, and want + // to register all of that view types displays to yourself e.g. you create a + // linear-genome-view subtype, and want all the tracks that are compatible + // display types for the linear-genome-view to be compatible with your type + // also (without this, display types are only registered to a single view + // type) extendedName?: string constructor(stuff: {