@apollo-annotation/jbrowse-plugin-apollo 0.1.5 → 0.1.7

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 (76) hide show
  1. package/dist/index.esm.js +206 -115
  2. package/dist/index.esm.js.map +1 -1
  3. package/dist/jbrowse-plugin-apollo.cjs.development.js +206 -115
  4. package/dist/jbrowse-plugin-apollo.cjs.development.js.map +1 -1
  5. package/dist/jbrowse-plugin-apollo.cjs.production.min.js +1 -1
  6. package/dist/jbrowse-plugin-apollo.cjs.production.min.js.map +1 -1
  7. package/dist/jbrowse-plugin-apollo.umd.development.js +257 -117
  8. package/dist/jbrowse-plugin-apollo.umd.development.js.map +1 -1
  9. package/dist/jbrowse-plugin-apollo.umd.production.min.js +1 -1
  10. package/dist/jbrowse-plugin-apollo.umd.production.min.js.map +1 -1
  11. package/package.json +6 -6
  12. package/src/ApolloInternetAccount/addMenuItems.ts +2 -4
  13. package/src/ApolloInternetAccount/components/AuthTypeSelector.tsx +14 -6
  14. package/src/ApolloInternetAccount/model.ts +24 -16
  15. package/src/ApolloJobModel.ts +2 -0
  16. package/src/ApolloSequenceAdapter/ApolloSequenceAdapter.ts +4 -0
  17. package/src/ApolloSixFrameRenderer/ApolloSixFrameRenderer.tsx +1 -0
  18. package/src/ApolloSixFrameRenderer/components/ApolloRendering.tsx +16 -3
  19. package/src/ApolloTextSearchAdapter/ApolloTextSearchAdapter.ts +5 -0
  20. package/src/BackendDrivers/CollaborationServerDriver.ts +10 -4
  21. package/src/BackendDrivers/DesktopFileDriver.ts +1 -0
  22. package/src/BackendDrivers/InMemoryFileDriver.ts +1 -0
  23. package/src/ChangeManager.ts +3 -0
  24. package/src/FeatureDetailsWidget/Attributes.tsx +4 -1
  25. package/src/FeatureDetailsWidget/BasicInformation.tsx +4 -2
  26. package/src/FeatureDetailsWidget/NumberTextField.tsx +4 -1
  27. package/src/FeatureDetailsWidget/RelatedFeature.tsx +16 -3
  28. package/src/FeatureDetailsWidget/Sequence.tsx +1 -0
  29. package/src/FeatureDetailsWidget/StringTextField.tsx +4 -1
  30. package/src/FeatureDetailsWidget/model.ts +2 -0
  31. package/src/LinearApolloDisplay/components/LinearApolloDisplay.tsx +9 -2
  32. package/src/LinearApolloDisplay/glyphs/BoxGlyph.ts +2 -0
  33. package/src/LinearApolloDisplay/glyphs/CanonicalGeneGlyph.ts +9 -4
  34. package/src/LinearApolloDisplay/glyphs/GenericChildGlyph.ts +4 -1
  35. package/src/LinearApolloDisplay/glyphs/Glyph.ts +5 -1
  36. package/src/LinearApolloDisplay/glyphs/ImplicitExonGeneGlyph.ts +8 -2
  37. package/src/LinearApolloDisplay/stateModel/base.ts +7 -2
  38. package/src/LinearApolloDisplay/stateModel/getGlyph.ts +1 -0
  39. package/src/LinearApolloDisplay/stateModel/glyphs.ts +2 -0
  40. package/src/LinearApolloDisplay/stateModel/layouts.ts +3 -0
  41. package/src/LinearApolloDisplay/stateModel/mouseEvents.ts +3 -1
  42. package/src/LinearApolloDisplay/stateModel/rendering.ts +3 -2
  43. package/src/LinearApolloDisplay/types.ts +1 -1
  44. package/src/OntologyManager/OntologyStore/fulltext.ts +1 -0
  45. package/src/OntologyManager/OntologyStore/index.test.ts +3 -1
  46. package/src/OntologyManager/OntologyStore/index.ts +4 -5
  47. package/src/OntologyManager/OntologyStore/indexeddb-storage.ts +3 -2
  48. package/src/SixFrameFeatureDisplay/stateModel.ts +17 -5
  49. package/src/TabularEditor/HybridGrid/Feature.tsx +7 -2
  50. package/src/TabularEditor/HybridGrid/FeatureAttributes.tsx +1 -0
  51. package/src/TabularEditor/HybridGrid/HybridGrid.tsx +2 -2
  52. package/src/TabularEditor/HybridGrid/NumberCell.tsx +3 -1
  53. package/src/TabularEditor/HybridGrid/ToolBar.tsx +9 -2
  54. package/src/components/AddAssembly.tsx +16 -8
  55. package/src/components/AddChildFeature.tsx +9 -4
  56. package/src/components/AddFeature.tsx +11 -5
  57. package/src/components/CopyFeature.tsx +11 -6
  58. package/src/components/DeleteAssembly.tsx +7 -4
  59. package/src/components/DeleteFeature.tsx +4 -1
  60. package/src/components/Dialog.tsx +1 -0
  61. package/src/components/DownloadGFF3.tsx +7 -2
  62. package/src/components/ImportFeatures.tsx +9 -3
  63. package/src/components/ManageChecks.tsx +10 -4
  64. package/src/components/ManageUsers.tsx +13 -4
  65. package/src/components/ModifyFeatureAttribute.tsx +4 -1
  66. package/src/components/OntologyTermAutocomplete.tsx +7 -4
  67. package/src/components/OntologyTermMultiSelect.tsx +2 -2
  68. package/src/components/OpenLocalFile.tsx +6 -3
  69. package/src/components/ViewChangeLog.tsx +13 -4
  70. package/src/components/ViewCheckResults.tsx +8 -2
  71. package/src/extensions/annotationFromPileup.ts +7 -2
  72. package/src/index.ts +4 -0
  73. package/src/makeDisplayComponent.tsx +4 -4
  74. package/src/session/ClientDataStore.ts +5 -0
  75. package/src/session/session.ts +9 -17
  76. package/src/util/loadAssemblyIntoClient.ts +4 -3
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@apollo-annotation/jbrowse-plugin-apollo",
3
- "version": "0.1.5",
3
+ "version": "0.1.7",
4
4
  "description": "Apollo plugin for JBrowse 2",
5
5
  "repository": {
6
6
  "type": "git",
@@ -32,9 +32,9 @@
32
32
  "clean": "rimraf dist",
33
33
  "start": "yarn clean && npm-run-all --parallel start:watch start:server",
34
34
  "start:watch": "JB_NPM=false NODE_ENV=development rollup --config --watch",
35
- "start:server": "serve --no-request-logging --cors --listen 9000 .",
35
+ "start:server": "serve --no-request-logging --cors --listen 9000 --no-port-switching .",
36
36
  "build": "yarn build:shared && yarn clean && rollup --config",
37
- "browse": "serve --no-request-logging --listen 8999 .jbrowse",
37
+ "browse": "serve --no-request-logging --listen 8999 --no-port-switching .jbrowse",
38
38
  "test": "jest",
39
39
  "test:ci": "jest --coverage",
40
40
  "start:collab-cypress": "yarn workspace apollo-collaboration-server run cypress:start",
@@ -51,9 +51,9 @@
51
51
  "name": "Apollo"
52
52
  },
53
53
  "dependencies": {
54
- "@apollo-annotation/apollo-common": "^0.1.5",
55
- "@apollo-annotation/apollo-mst": "^0.1.5",
56
- "@apollo-annotation/apollo-shared": "^0.1.5",
54
+ "@apollo-annotation/apollo-common": "^0.1.7",
55
+ "@apollo-annotation/apollo-mst": "^0.1.7",
56
+ "@apollo-annotation/apollo-shared": "^0.1.7",
57
57
  "@emotion/react": "^11.10.6",
58
58
  "@emotion/styled": "^11.10.6",
59
59
  "@gmod/gff": "1.2.0",
@@ -54,8 +54,7 @@ export function addMenuItems(rootModel: AbstractMenuManager) {
54
54
  handleClose: () => {
55
55
  doneCallback()
56
56
  },
57
- changeManager: (session as ApolloSessionModel).apolloDataStore
58
- .changeManager,
57
+ changeManager: session.apolloDataStore.changeManager,
59
58
  },
60
59
  ],
61
60
  )
@@ -72,8 +71,7 @@ export function addMenuItems(rootModel: AbstractMenuManager) {
72
71
  handleClose: () => {
73
72
  doneCallback()
74
73
  },
75
- changeManager: (session as ApolloSessionModel).apolloDataStore
76
- .changeManager,
74
+ changeManager: session.apolloDataStore.changeManager,
77
75
  },
78
76
  ],
79
77
  )
@@ -49,9 +49,9 @@ export const AuthTypeSelector = ({
49
49
  const data = (await response.json()) as string[]
50
50
  setLoginTypes(data)
51
51
  }
52
- getAuthTypes().catch((error) =>
53
- isAbortException(error) ? '' : setErrorMessage(String(error)),
54
- )
52
+ getAuthTypes().catch((error) => {
53
+ isAbortException(error) ? '' : setErrorMessage(String(error))
54
+ })
55
55
  return () => {
56
56
  controller.abort()
57
57
  }
@@ -84,19 +84,27 @@ export const AuthTypeSelector = ({
84
84
  {allowGoogle ? (
85
85
  <GoogleButton
86
86
  disabled={!allowGoogle}
87
- onClick={() => handleClick('google')}
87
+ onClick={() => {
88
+ handleClick('google')
89
+ }}
88
90
  />
89
91
  ) : null}
90
92
  {allowMicrosoft ? (
91
93
  <MicrosoftButton
92
94
  disabled={!allowMicrosoft}
93
- onClick={() => handleClick('microsoft')}
95
+ onClick={() => {
96
+ handleClick('microsoft')
97
+ }}
94
98
  />
95
99
  ) : null}
96
100
  {allowGuest ? (
97
101
  <>
98
102
  <Divider className={classes.divider} />
99
- <GuestButton onClick={() => handleClick('guest')} />
103
+ <GuestButton
104
+ onClick={() => {
105
+ handleClick('guest')
106
+ }}
107
+ />
100
108
  </>
101
109
  ) : null}
102
110
  </DialogContent>
@@ -1,3 +1,11 @@
1
+ /* eslint-disable @typescript-eslint/no-unused-vars */
2
+ /* eslint-disable @typescript-eslint/no-unsafe-return */
3
+ /* eslint-disable @typescript-eslint/no-unsafe-member-access */
4
+ /* eslint-disable @typescript-eslint/no-unsafe-assignment */
5
+ /* eslint-disable @typescript-eslint/no-unsafe-call */
6
+ /* eslint-disable @typescript-eslint/no-unsafe-argument */
7
+ /* eslint-disable @typescript-eslint/unbound-method */
8
+ /* eslint-disable @typescript-eslint/no-misused-promises */
1
9
  import { Change } from '@apollo-annotation/apollo-common'
2
10
  import {
3
11
  ChangeMessage,
@@ -88,8 +96,6 @@ const stateModelFactory = (configSchema: ApolloInternetAccountConfigModel) => {
88
96
  reject: (error: Error) => void,
89
97
  ) {
90
98
  listener = (event) => {
91
- // this should probably get better handling, but ignored for now
92
- // eslint-disable-next-line @typescript-eslint/no-floating-promises
93
99
  this.finishOAuthWindow(event, resolve, reject)
94
100
  }
95
101
  window.addEventListener('message', listener)
@@ -97,7 +103,7 @@ const stateModelFactory = (configSchema: ApolloInternetAccountConfigModel) => {
97
103
  deleteMessageChannel() {
98
104
  window.removeEventListener('message', listener)
99
105
  },
100
- async finishOAuthWindow(
106
+ finishOAuthWindow(
101
107
  event: MessageEvent,
102
108
  resolve: (token: string) => void,
103
109
  reject: (error: Error) => void,
@@ -105,7 +111,8 @@ const stateModelFactory = (configSchema: ApolloInternetAccountConfigModel) => {
105
111
  if (
106
112
  event.data.name !== `JBrowseAuthWindow-${self.internetAccountId}`
107
113
  ) {
108
- return this.deleteMessageChannel()
114
+ this.deleteMessageChannel()
115
+ return
109
116
  }
110
117
  const redirectUriWithInfo = event.data.redirectUri
111
118
  const fixedQueryString = redirectUriWithInfo.replace('#', '?')
@@ -115,11 +122,12 @@ const stateModelFactory = (configSchema: ApolloInternetAccountConfigModel) => {
115
122
  const token = urlParams.get('access_token')
116
123
  this.deleteMessageChannel()
117
124
  if (!token) {
118
- return reject(new Error('Error with token endpoint'))
125
+ reject(new Error('Error with token endpoint'))
126
+ return
119
127
  }
120
128
  self.storeToken(token)
121
129
  self.setRole()
122
- return resolve(token)
130
+ resolve(token)
123
131
  },
124
132
  async openAuthWindow(
125
133
  type: string,
@@ -149,7 +157,6 @@ const stateModelFactory = (configSchema: ApolloInternetAccountConfigModel) => {
149
157
  const eventFromDesktop = new MessageEvent('message', {
150
158
  data: { name: eventName, redirectUri: redirectUriFromElectron },
151
159
  })
152
- // eslint-disable-next-line @typescript-eslint/no-floating-promises
153
160
  this.finishOAuthWindow(eventFromDesktop, resolve, reject)
154
161
  } else {
155
162
  this.addMessageChannel(resolve, reject)
@@ -204,7 +211,8 @@ const stateModelFactory = (configSchema: ApolloInternetAccountConfigModel) => {
204
211
  response,
205
212
  'Error when logging in',
206
213
  )
207
- return reject(new Error(errorMessage))
214
+ reject(new Error(errorMessage))
215
+ return
208
216
  }
209
217
  const { token } = await response.json()
210
218
  resolve(token)
@@ -246,8 +254,7 @@ const stateModelFactory = (configSchema: ApolloInternetAccountConfigModel) => {
246
254
  ),
247
255
  getMissingChanges: flow(function* getMissingChanges() {
248
256
  const { session } = getRoot<ApolloRootModel>(self)
249
- const { changeManager } = (session as ApolloSessionModel)
250
- .apolloDataStore
257
+ const { changeManager } = session.apolloDataStore
251
258
  if (!self.lastChangeSequenceNumber) {
252
259
  throw new Error(
253
260
  'No LastChangeSequence stored in session. Please, refresh you browser to get last updates from server',
@@ -277,7 +284,7 @@ const stateModelFactory = (configSchema: ApolloInternetAccountConfigModel) => {
277
284
  const serializedChanges = yield response.json()
278
285
  for (const serializedChange of serializedChanges) {
279
286
  const change = Change.fromJSON(serializedChange)
280
- void changeManager?.submit(change, { submitToBackend: false })
287
+ void changeManager.submit(change, { submitToBackend: false })
281
288
  }
282
289
  }),
283
290
  }))
@@ -293,9 +300,8 @@ const stateModelFactory = (configSchema: ApolloInternetAccountConfigModel) => {
293
300
  throw new Error('No Token found')
294
301
  }
295
302
  const { socket } = self
296
- const { addCheckResult, changeManager, deleteCheckResult } = (
297
- session as ApolloSessionModel
298
- ).apolloDataStore
303
+ const { addCheckResult, changeManager, deleteCheckResult } =
304
+ session.apolloDataStore
299
305
  socket.on('connect', async () => {
300
306
  await self.getMissingChanges()
301
307
  })
@@ -320,7 +326,7 @@ const stateModelFactory = (configSchema: ApolloInternetAccountConfigModel) => {
320
326
  return // we did this change, no need to apply it again
321
327
  }
322
328
  const change = Change.fromJSON(message.changeInfo)
323
- void changeManager?.submit(change, { submitToBackend: false })
329
+ void changeManager.submit(change, { submitToBackend: false })
324
330
  })
325
331
  socket.on('USER_LOCATION', (message: UserLocationMessage) => {
326
332
  const { channel, locations, userName, userSessionId } = message
@@ -380,7 +386,9 @@ const stateModelFactory = (configSchema: ApolloInternetAccountConfigModel) => {
380
386
  let timeoutId: ReturnType<typeof setTimeout>
381
387
  return (userLocation: UserLocation[]) => {
382
388
  clearTimeout(timeoutId)
383
- timeoutId = setTimeout(() => fn(userLocation), debounceTimeout)
389
+ timeoutId = setTimeout(() => {
390
+ fn(userLocation)
391
+ }, debounceTimeout)
384
392
  }
385
393
  }
386
394
  return { postUserLocation: debouncePostUserLocation(postUserLocation) }
@@ -1,3 +1,5 @@
1
+ /* eslint-disable @typescript-eslint/no-unsafe-assignment */
2
+ /* eslint-disable @typescript-eslint/no-confusing-void-expression */
1
3
  import {
2
4
  SessionWithWidgets,
3
5
  getSession,
@@ -1,3 +1,7 @@
1
+ /* eslint-disable @typescript-eslint/no-unsafe-assignment */
2
+ /* eslint-disable @typescript-eslint/no-unsafe-argument */
3
+ /* eslint-disable @typescript-eslint/no-unsafe-member-access */
4
+ /* eslint-disable @typescript-eslint/no-unsafe-call */
1
5
  import { readConfObject } from '@jbrowse/core/configuration'
2
6
  import {
3
7
  BaseOptions,
@@ -1,3 +1,4 @@
1
+ /* eslint-disable @typescript-eslint/require-await */
1
2
  import { RenderProps, RendererType } from '@jbrowse/core/pluggableElementTypes'
2
3
  import RpcManager from '@jbrowse/core/rpc/RpcManager'
3
4
 
@@ -1,3 +1,10 @@
1
+ /* eslint-disable react-hooks/exhaustive-deps */
2
+ /* eslint-disable @typescript-eslint/unbound-method */
3
+ /* eslint-disable @typescript-eslint/no-unsafe-assignment */
4
+ /* eslint-disable @typescript-eslint/no-unsafe-call */
5
+ /* eslint-disable @typescript-eslint/no-unsafe-argument */
6
+ /* eslint-disable @typescript-eslint/no-unnecessary-condition */
7
+ /* eslint-disable @typescript-eslint/no-misused-promises */
1
8
  import { AnnotationFeatureI } from '@apollo-annotation/apollo-mst'
2
9
  import {
3
10
  LocationEndChange,
@@ -93,8 +100,14 @@ function ApolloRendering(props: ApolloRenderingProps) {
93
100
  const { collaborators: collabs } = session
94
101
 
95
102
  // bridging mobx observability and React useEffect observability
96
- // eslint-disable-next-line react-hooks/exhaustive-deps
97
- useEffect(() => autorun(() => setCollaborators(toJS(collabs))), [])
103
+
104
+ useEffect(
105
+ () =>
106
+ autorun(() => {
107
+ setCollaborators(toJS(collabs))
108
+ }),
109
+ [],
110
+ )
98
111
 
99
112
  const [region] = regions
100
113
  const totalWidth = (region.end - region.start) / bpPerPx
@@ -536,7 +549,7 @@ function ApolloRendering(props: ApolloRenderingProps) {
536
549
  assembly,
537
550
  })
538
551
  }
539
- await changeManager?.submit(change)
552
+ await changeManager.submit(change)
540
553
  }
541
554
  // eslint-disable-next-line unicorn/no-useless-undefined
542
555
  setDragging(undefined)
@@ -1,3 +1,8 @@
1
+ /* eslint-disable @typescript-eslint/no-unsafe-return */
2
+ /* eslint-disable @typescript-eslint/no-unsafe-member-access */
3
+ /* eslint-disable @typescript-eslint/no-unsafe-assignment */
4
+ /* eslint-disable @typescript-eslint/no-unsafe-call */
5
+ /* eslint-disable @typescript-eslint/no-unsafe-argument */
1
6
  import { readConfObject } from '@jbrowse/core/configuration'
2
7
  import {
3
8
  BaseAdapter,
@@ -1,3 +1,9 @@
1
+ /* eslint-disable @typescript-eslint/no-base-to-string */
2
+ /* eslint-disable @typescript-eslint/no-unsafe-assignment */
3
+ /* eslint-disable @typescript-eslint/no-unsafe-return */
4
+ /* eslint-disable @typescript-eslint/no-unsafe-member-access */
5
+ /* eslint-disable @typescript-eslint/no-unsafe-call */
6
+ /* eslint-disable @typescript-eslint/no-unnecessary-condition */
1
7
  import {
2
8
  AssemblySpecificChange,
3
9
  Change,
@@ -108,7 +114,7 @@ export class CollaborationServerDriver extends BackendDriver {
108
114
  )
109
115
  throw new Error(errorMessage)
110
116
  }
111
- await this.checkSocket(assemblyName, refName, internetAccount)
117
+ this.checkSocket(assemblyName, refName, internetAccount)
112
118
  return response.json() as Promise<
113
119
  [AnnotationFeatureSnapshot[], CheckResultSnapshot[]]
114
120
  >
@@ -120,7 +126,7 @@ export class CollaborationServerDriver extends BackendDriver {
120
126
  * @param refSeq - refSeqName
121
127
  * @param internetAccount - internet account
122
128
  */
123
- async checkSocket(
129
+ checkSocket(
124
130
  assembly: string,
125
131
  refSeq: string,
126
132
  internetAccount: ApolloInternetAccount,
@@ -173,7 +179,7 @@ export class CollaborationServerDriver extends BackendDriver {
173
179
  if (!apolloAssembly) {
174
180
  apolloAssembly = this.clientStore.addAssembly(assemblyName)
175
181
  }
176
- let apolloRefSeq = apolloAssembly?.refSeqs.get(refSeq)
182
+ let apolloRefSeq = apolloAssembly.refSeqs.get(refSeq)
177
183
  if (!apolloRefSeq) {
178
184
  apolloRefSeq = apolloAssembly.addRefSeq(refSeq, refName)
179
185
  }
@@ -204,7 +210,7 @@ export class CollaborationServerDriver extends BackendDriver {
204
210
  )
205
211
  this.inFlight.set(inFlightKey, seqPromise)
206
212
  const seq = await seqPromise
207
- await this.checkSocket(assemblyName, refName, internetAccount)
213
+ this.checkSocket(assemblyName, refName, internetAccount)
208
214
  this.inFlight.delete(inFlightKey)
209
215
  return { seq, refSeq }
210
216
  }
@@ -1,3 +1,4 @@
1
+ /* eslint-disable @typescript-eslint/require-await */
1
2
  import {
2
3
  AssemblySpecificChange,
3
4
  Change,
@@ -1,3 +1,4 @@
1
+ /* eslint-disable @typescript-eslint/require-await */
1
2
  import {
2
3
  AssemblySpecificChange,
3
4
  Change,
@@ -1,3 +1,6 @@
1
+ /* eslint-disable @typescript-eslint/no-unsafe-assignment */
2
+ /* eslint-disable @typescript-eslint/no-unsafe-call */
3
+ /* eslint-disable @typescript-eslint/no-unsafe-member-access */
1
4
  import {
2
5
  Change,
3
6
  ClientDataStore,
@@ -1,3 +1,6 @@
1
+ /* eslint-disable @typescript-eslint/unbound-method */
2
+ /* eslint-disable @typescript-eslint/no-unnecessary-condition */
3
+ /* eslint-disable @typescript-eslint/no-misused-promises */
1
4
  import { AnnotationFeatureI } from '@apollo-annotation/apollo-mst'
2
5
  import { FeatureAttributeChange } from '@apollo-annotation/apollo-shared'
3
6
  import { AbstractSessionModel } from '@jbrowse/core/util'
@@ -190,7 +193,7 @@ export const Attributes = observer(function Attributes({
190
193
  featureId: feature._id,
191
194
  attributes: attrs,
192
195
  })
193
- await changeManager.submit?.(change)
196
+ await changeManager.submit(change)
194
197
  notify('Feature attributes modified successfully', 'success')
195
198
  }
196
199
  function handleAddNewAttributeChange() {
@@ -1,3 +1,4 @@
1
+ /* eslint-disable @typescript-eslint/no-misused-promises */
1
2
  import { AnnotationFeatureI } from '@apollo-annotation/apollo-mst'
2
3
  import {
3
4
  LocationEndChange,
@@ -39,8 +40,9 @@ export const BasicInformation = observer(function BasicInformation({
39
40
 
40
41
  const { _id, assemblyId, end, start, strand, type } = feature
41
42
 
42
- const notifyError = (e: Error) =>
43
- (session as unknown as AbstractSessionModel).notify(e.message, 'error')
43
+ const notifyError = (e: Error) => {
44
+ ;(session as unknown as AbstractSessionModel).notify(e.message, 'error')
45
+ }
44
46
 
45
47
  const { changeManager } = session.apolloDataStore
46
48
  function handleTypeChange(newType: string) {
@@ -1,3 +1,4 @@
1
+ /* eslint-disable @typescript-eslint/no-unsafe-argument */
1
2
  import { TextField, TextFieldProps } from '@mui/material'
2
3
  import { observer } from 'mobx-react'
3
4
  import React, { useEffect, useState } from 'react'
@@ -67,7 +68,9 @@ export const NumberTextField = observer(function NumberTextField({
67
68
  }
68
69
  }
69
70
  }}
70
- inputRef={(node) => setInputNode(node)}
71
+ inputRef={(node) => {
72
+ setInputNode(node)
73
+ }}
71
74
  error={error}
72
75
  helperText={error ? 'Not a valid number' : undefined}
73
76
  />
@@ -1,3 +1,6 @@
1
+ /* eslint-disable @typescript-eslint/no-unsafe-assignment */
2
+ /* eslint-disable @typescript-eslint/no-unsafe-member-access */
3
+ /* eslint-disable @typescript-eslint/no-unsafe-argument */
1
4
  import {
2
5
  AnnotationFeature,
3
6
  AnnotationFeatureI,
@@ -46,7 +49,7 @@ export const RelatedFeatures = observer(function RelatedFeatures({
46
49
  assembly,
47
50
  refName,
48
51
  })
49
- ;(session as unknown as SessionWithWidgets).showWidget?.(
52
+ ;(session as unknown as SessionWithWidgets).showWidget(
50
53
  apolloFeatureWidget,
51
54
  )
52
55
  }
@@ -63,7 +66,12 @@ export const RelatedFeatures = observer(function RelatedFeatures({
63
66
  <Typography variant="h5">Parent</Typography>
64
67
  <Paper elevation={6} className={classes.paper}>
65
68
  {`Start: ${parent.start}, End: ${parent.end}, Type: ${parent.type}`}
66
- <Button variant="contained" onClick={() => onButtonClick(parent)}>
69
+ <Button
70
+ variant="contained"
71
+ onClick={() => {
72
+ onButtonClick(parent)
73
+ }}
74
+ >
67
75
  Go to parent
68
76
  </Button>
69
77
  </Paper>
@@ -75,7 +83,12 @@ export const RelatedFeatures = observer(function RelatedFeatures({
75
83
  {[...children.values()].map((child) => (
76
84
  <Paper elevation={6} className={classes.paper} key={child._id}>
77
85
  {`Start: ${child.start}, End: ${child.end}, Type: ${child.type}`}
78
- <Button variant="contained" onClick={() => onButtonClick(child)}>
86
+ <Button
87
+ variant="contained"
88
+ onClick={() => {
89
+ onButtonClick(child)
90
+ }}
91
+ >
79
92
  Go to child
80
93
  </Button>
81
94
  </Paper>
@@ -1,3 +1,4 @@
1
+ /* eslint-disable @typescript-eslint/no-unnecessary-condition */
1
2
  import { AnnotationFeatureI } from '@apollo-annotation/apollo-mst'
2
3
  import { splitStringIntoChunks } from '@apollo-annotation/apollo-shared'
3
4
  import { Button, Typography } from '@mui/material'
@@ -1,3 +1,4 @@
1
+ /* eslint-disable @typescript-eslint/no-unsafe-argument */
1
2
  import { TextField, TextFieldProps } from '@mui/material'
2
3
  import { observer } from 'mobx-react'
3
4
  import React, { useEffect, useState } from 'react'
@@ -54,7 +55,9 @@ export const StringTextField = observer(function StringTextField({
54
55
  onChangeCommitted(value)
55
56
  }
56
57
  }}
57
- inputRef={(node) => setInputNode(node)}
58
+ inputRef={(node) => {
59
+ setInputNode(node)
60
+ }}
58
61
  />
59
62
  )
60
63
  })
@@ -1,3 +1,5 @@
1
+ /* eslint-disable @typescript-eslint/no-unsafe-call */
2
+ /* eslint-disable @typescript-eslint/no-unnecessary-condition */
1
3
  import {
2
4
  AnnotationFeature,
3
5
  AnnotationFeatureI,
@@ -1,3 +1,8 @@
1
+ /* eslint-disable @typescript-eslint/unbound-method */
2
+ /* eslint-disable @typescript-eslint/no-misused-promises */
3
+ /* eslint-disable @typescript-eslint/no-unnecessary-condition */
4
+ /* eslint-disable @typescript-eslint/no-unsafe-assignment */
5
+ /* eslint-disable @typescript-eslint/no-unsafe-argument */
1
6
  import { Menu, MenuItem } from '@jbrowse/core/ui'
2
7
  import {
3
8
  AbstractSessionModel,
@@ -66,7 +71,9 @@ export const LinearApolloDisplay = observer(function LinearApolloDisplay(
66
71
  const { classes } = useStyles()
67
72
  const lgv = getContainingView(model) as unknown as LinearGenomeViewModel
68
73
 
69
- useEffect(() => setTheme(theme), [theme, setTheme])
74
+ useEffect(() => {
75
+ setTheme(theme)
76
+ }, [theme, setTheme])
70
77
  const [contextCoord, setContextCoord] = useState<Coord>()
71
78
  const [contextMenuItems, setContextMenuItems] = useState<MenuItem[]>([])
72
79
  const message = regionCannotBeRendered()
@@ -178,7 +185,7 @@ export const LinearApolloDisplay = observer(function LinearApolloDisplay(
178
185
  .filter(
179
186
  (checkResult) =>
180
187
  assembly?.isValidRefName(checkResult.refSeq) &&
181
- assembly?.getCanonicalRefName(checkResult.refSeq) ===
188
+ assembly.getCanonicalRefName(checkResult.refSeq) ===
182
189
  region.refName &&
183
190
  doesIntersect2(
184
191
  region.start,
@@ -1,3 +1,5 @@
1
+ /* eslint-disable @typescript-eslint/no-unnecessary-condition */
2
+ /* eslint-disable @typescript-eslint/unbound-method */
1
3
  import { AnnotationFeatureI } from '@apollo-annotation/apollo-mst'
2
4
  import {
3
5
  LocationEndChange,
@@ -1,3 +1,8 @@
1
+ /* eslint-disable @typescript-eslint/no-unsafe-member-access */
2
+ /* eslint-disable @typescript-eslint/no-unsafe-assignment */
3
+ /* eslint-disable @typescript-eslint/no-unsafe-argument */
4
+ /* eslint-disable @typescript-eslint/unbound-method */
5
+ /* eslint-disable @typescript-eslint/no-unnecessary-condition */
1
6
  import { AnnotationFeatureI } from '@apollo-annotation/apollo-mst'
2
7
  import {
3
8
  DiscontinuousLocationEndChange,
@@ -301,7 +306,7 @@ export class CanonicalGeneGlyph extends Glyph {
301
306
  let featureRow: number | undefined
302
307
  let i = 0
303
308
  for (const [, f] of children ?? new Map()) {
304
- if (f._id === apolloSelectedFeature?._id) {
309
+ if (f._id === apolloSelectedFeature._id) {
305
310
  featureEntry = f
306
311
  featureRow = i
307
312
  }
@@ -412,7 +417,7 @@ export class CanonicalGeneGlyph extends Glyph {
412
417
  let featureRow: number | undefined
413
418
  let i = 0
414
419
  for (const [, f] of topLevelFeature.children ?? new Map()) {
415
- if (f._id === feature?._id) {
420
+ if (f._id === feature._id) {
416
421
  featureEntry = f
417
422
  featureRow = i
418
423
  }
@@ -874,10 +879,10 @@ export class CanonicalGeneGlyph extends Glyph {
874
879
 
875
880
  if (feature.type !== 'CDS') {
876
881
  const adjacentExons = this.adjacentExonsOfExon(feature, topLevelFeature)
877
- if (adjacentExons?.nextExon && bp >= adjacentExons?.nextExon.start - 1) {
882
+ if (adjacentExons?.nextExon && bp >= adjacentExons.nextExon.start - 1) {
878
883
  return
879
884
  }
880
- if (adjacentExons?.prevExon && bp <= adjacentExons?.prevExon.end + 1) {
885
+ if (adjacentExons?.prevExon && bp <= adjacentExons.prevExon.end + 1) {
881
886
  return
882
887
  }
883
888
  const dls: CDSDiscontinuousLocation[] = this.cdsDlsForExon(
@@ -1,3 +1,6 @@
1
+ /* eslint-disable @typescript-eslint/no-unnecessary-condition */
2
+ /* eslint-disable @typescript-eslint/no-unsafe-argument */
3
+ /* eslint-disable @typescript-eslint/unbound-method */
1
4
  import { AnnotationFeatureI } from '@apollo-annotation/apollo-mst'
2
5
 
3
6
  import { LinearApolloDisplay } from '../stateModel'
@@ -133,7 +136,7 @@ export class GenericChildGlyph extends BoxGlyph {
133
136
 
134
137
  getFeatureFromLayout(feature: AnnotationFeatureI, bp: number, row: number) {
135
138
  const layoutRow = this.featuresForRow(feature)[row]
136
- return layoutRow?.find((f) => bp >= f.start && bp <= f.end)
139
+ return layoutRow.find((f) => bp >= f.start && bp <= f.end)
137
140
  }
138
141
 
139
142
  getRowForFeature(
@@ -1,3 +1,7 @@
1
+ /* eslint-disable @typescript-eslint/unbound-method */
2
+ /* eslint-disable @typescript-eslint/no-unsafe-member-access */
3
+ /* eslint-disable @typescript-eslint/no-unsafe-assignment */
4
+ /* eslint-disable @typescript-eslint/no-unsafe-return */
1
5
  import { AnnotationFeatureI } from '@apollo-annotation/apollo-mst'
2
6
  import { MenuItem } from '@jbrowse/core/ui'
3
7
  import { AbstractSessionModel, SessionWithWidgets } from '@jbrowse/core/util'
@@ -389,7 +393,7 @@ export abstract class Glyph {
389
393
  refName: region.refName,
390
394
  },
391
395
  )
392
- ;(session as unknown as SessionWithWidgets).showWidget?.(
396
+ ;(session as unknown as SessionWithWidgets).showWidget(
393
397
  apolloFeatureWidget,
394
398
  )
395
399
  },
@@ -1,3 +1,9 @@
1
+ /* eslint-disable @typescript-eslint/no-unsafe-member-access */
2
+ /* eslint-disable @typescript-eslint/no-unsafe-argument */
3
+ /* eslint-disable @typescript-eslint/no-unsafe-assignment */
4
+ /* eslint-disable @typescript-eslint/no-unsafe-call */
5
+ /* eslint-disable @typescript-eslint/unbound-method */
6
+ /* eslint-disable @typescript-eslint/no-unnecessary-condition */
1
7
  import { AnnotationFeatureI } from '@apollo-annotation/apollo-mst'
2
8
  import {
3
9
  LocationEndChange,
@@ -187,7 +193,7 @@ export class ImplicitExonGeneGlyph extends Glyph {
187
193
  let featureRow: number | undefined
188
194
  let i = 0
189
195
  for (const [, f] of children ?? new Map()) {
190
- if (f._id === apolloSelectedFeature?._id) {
196
+ if (f._id === apolloSelectedFeature._id) {
191
197
  featureEntry = f
192
198
  featureRow = i
193
199
  }
@@ -541,7 +547,7 @@ export class ImplicitExonGeneGlyph extends Glyph {
541
547
  row: number,
542
548
  ): AnnotationFeatureI | undefined {
543
549
  const layoutRow = this.featuresForRow(feature)[row]
544
- return layoutRow?.find((f) => bp >= f.start && bp <= f.end)
550
+ return layoutRow.find((f) => bp >= f.start && bp <= f.end)
545
551
  }
546
552
 
547
553
  getRowForFeature(
@@ -1,3 +1,8 @@
1
+ /* eslint-disable @typescript-eslint/unbound-method */
2
+ /* eslint-disable @typescript-eslint/no-unsafe-return */
3
+ /* eslint-disable @typescript-eslint/no-unsafe-assignment */
4
+ /* eslint-disable @typescript-eslint/no-unsafe-member-access */
5
+ /* eslint-disable @typescript-eslint/no-unnecessary-condition */
1
6
  import { AnnotationFeatureI } from '@apollo-annotation/apollo-mst'
2
7
  import { ConfigurationReference, getConf } from '@jbrowse/core/configuration'
3
8
  import { AnyConfigurationSchemaType } from '@jbrowse/core/configuration/configurationSchema'
@@ -101,7 +106,7 @@ export function baseModelFactory(
101
106
  },
102
107
  get changeManager() {
103
108
  return (self.session as unknown as ApolloSessionModel).apolloDataStore
104
- ?.changeManager
109
+ .changeManager
105
110
  },
106
111
  getAssemblyId(assemblyName: string) {
107
112
  const { assemblyManager } =
@@ -119,7 +124,7 @@ export function baseModelFactory(
119
124
  }))
120
125
  .actions((self) => ({
121
126
  setSelectedFeature(feature?: AnnotationFeatureI) {
122
- return (
127
+ ;(
123
128
  self.session as unknown as ApolloSessionModel
124
129
  ).apolloSetSelectedFeature(feature)
125
130
  },
@@ -1,3 +1,4 @@
1
+ /* eslint-disable @typescript-eslint/no-unsafe-member-access */
1
2
  import { AnnotationFeatureI } from '@apollo-annotation/apollo-mst'
2
3
 
3
4
  import {