Skip to content

Commit

Permalink
Fix loading (#9)
Browse files Browse the repository at this point in the history
  • Loading branch information
cmdcolin authored Jan 3, 2025
1 parent cdebf0a commit bd5f6cf
Show file tree
Hide file tree
Showing 10 changed files with 4,530 additions and 6,130 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/integration.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,10 @@ jobs:
if: "!contains(github.event.head_commit.message, 'skip ci')"
steps:
- uses: actions/checkout@v2
- name: Use Node.js 16.x
- name: Use Node.js 22.x
uses: actions/setup-node@v1
with:
node-version: 16.x
node-version: 22.x
- name: Install deps (with cache)
uses: bahmutov/npm-install@v1
- name: Get latest JBrowse
Expand Down
4 changes: 2 additions & 2 deletions cypress/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"compilerOptions": {
"target": "es5",
"lib": ["es5", "dom"],
"types": ["cypress"],
"types": ["cypress"]
},
"include": ["**/*.ts"],
"include": ["**/*.ts"]
}
2 changes: 0 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,6 @@
"cypress:open": "cross-var cypress open --config baseUrl=http://localhost:$npm_package_config_browse_port",
"lint": "eslint --ext .js,.ts,.jsx,.tsx src/",
"prepublishOnly": "npm-run-all test",
"prepare": "npm-run-all build",
"postversion": "git push --follow-tags"
},
"jbrowse-plugin": {
Expand Down Expand Up @@ -73,7 +72,6 @@
"@babel/preset-react": "^7.10.4",
"@emotion/react": "^11.10.4",
"@emotion/styled": "^11.10.4",
"@jbrowse/cli": "^1.5.1",
"@jbrowse/core": "^2.1.2",
"@jbrowse/development-tools": "^2.1.1",
"@jbrowse/plugin-linear-genome-view": "^2.1.2",
Expand Down
4 changes: 2 additions & 2 deletions scripts/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"rootDir": ".",
"lib": ["ES2019"],
"module": "commonjs",
"target": "ES2019",
"target": "ES2019"
},
"include": ["."],
"include": ["."]
}
2 changes: 1 addition & 1 deletion src/LinearGenomeMultilevelView/model.ts
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ export interface BpOffset {

export default function stateModelFactory(pluginManager: PluginManager) {
return (
pluginManager.getViewType('LinearGenomeView')
pluginManager.getViewType('LinearGenomeView')!
.stateModel as LinearGenomeViewStateModel
)
.named('LinearGenomeMultilevelView')
Expand Down
6 changes: 3 additions & 3 deletions src/MultilevelLinearView/components/ImportForm.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ import { getSession, isSessionWithAddTracks } from '@jbrowse/core/util'
import { ErrorMessage, AssemblySelector } from '@jbrowse/core/ui'
import BaseResult from '@jbrowse/core/TextSearch/BaseResults'
import { SearchType } from '@jbrowse/core/data_adapters/BaseAdapter'
import { RefNameAutocomplete } from '@jbrowse/plugin-linear-genome-view/'
import { RefNameAutocomplete } from '@jbrowse/plugin-linear-genome-view'

import { MultilevelLinearViewModel } from '../model'

Expand Down Expand Up @@ -60,7 +60,7 @@ const ImportForm = observer(
label: regions[0]?.refName,
})

const selectedRegion = option?.getLocation()
const selectedRegion = option?.getLocation() || option?.getLabel()

useEffect(() => {
const num = parseInt(numViews, 10)
Expand Down Expand Up @@ -102,7 +102,7 @@ const ImportForm = observer(
model.setSearchResults(results, input.toLowerCase())
return
} else if (results?.length === 1) {
location = results[0].getLocation()
location = results[0].getLocation()!
trackId = results[0].getTrackId()
}
model.navToLocString(location, selected[0])
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@ const MultilevelLinearView = observer(
{model.views.map((view) => {
const { ReactComponent } = pluginManager.getViewType(
view.type,
)
)!

if (!model.initialized || !view.initialized) {
return null
Expand Down
4 changes: 2 additions & 2 deletions src/MultilevelLinearView/model.ts
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ export default function stateModelFactory(pluginManager: PluginManager) {
pluginManager.pluggableMstType('track', 'stateModel'),
),
views: types.array(
pluginManager.getViewType('LinearGenomeMultilevelView')
pluginManager.getViewType('LinearGenomeMultilevelView')!
.stateModel as LinearGenomeViewStateModel,
),
}),
Expand Down Expand Up @@ -414,7 +414,7 @@ export default function stateModelFactory(pluginManager: PluginManager) {
if (target.isAnchor === false && target.isOverview === false) {
self.views.remove(target)
session.notify(`A view has been closed`, 'info', {
name: 'undo',
name: 'undo' as any,
onClick: () => {
pluginManager.rootModel.history.undo()
},
Expand Down
4 changes: 2 additions & 2 deletions tsconfig.test.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"extends": "./tsconfig.json",
"compilerOptions": {
"rootDir": "./",
"rootDir": "./"
},
"include": ["./jest.config.ts", "./jest.setup.ts"],
"include": ["./jest.config.ts", "./jest.setup.ts"]
}
Loading

0 comments on commit bd5f6cf

Please sign in to comment.