@apollo-annotation/jbrowse-plugin-apollo 0.3.5 → 0.3.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 (136) hide show
  1. package/dist/index.esm.js +6964 -4598
  2. package/dist/index.esm.js.map +1 -1
  3. package/dist/jbrowse-plugin-apollo.cjs.development.js +6610 -4261
  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 +11563 -7493
  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 +4 -4
  12. package/src/ApolloInternetAccount/addMenuItems.ts +23 -2
  13. package/src/ApolloInternetAccount/components/AuthTypeSelector.tsx +1 -0
  14. package/src/ApolloInternetAccount/components/LoginButtons.tsx +1 -1
  15. package/src/ApolloInternetAccount/components/LoginIcons.tsx +1 -1
  16. package/src/ApolloInternetAccount/configSchema.ts +1 -1
  17. package/src/ApolloInternetAccount/model.ts +11 -10
  18. package/src/ApolloJobModel.ts +1 -1
  19. package/src/ApolloRefNameAliasAdapter/ApolloRefNameAliasAdapter.ts +8 -6
  20. package/src/ApolloRefNameAliasAdapter/index.ts +2 -2
  21. package/src/ApolloSequenceAdapter/ApolloSequenceAdapter.ts +4 -4
  22. package/src/ApolloSequenceAdapter/index.ts +1 -1
  23. package/src/ApolloTextSearchAdapter/ApolloTextSearchAdapter.ts +8 -7
  24. package/src/ApolloTextSearchAdapter/index.ts +1 -1
  25. package/src/BackendDrivers/BackendDriver.ts +7 -7
  26. package/src/BackendDrivers/CollaborationServerDriver.ts +14 -10
  27. package/src/BackendDrivers/DesktopFileDriver.ts +11 -10
  28. package/src/BackendDrivers/InMemoryFileDriver.ts +10 -6
  29. package/src/ChangeManager.ts +15 -11
  30. package/src/FeatureDetailsWidget/ApolloFeatureDetailsWidget.tsx +8 -7
  31. package/src/FeatureDetailsWidget/ApolloTranscriptDetailsWidget.tsx +35 -14
  32. package/src/FeatureDetailsWidget/AttributeKey.tsx +50 -0
  33. package/src/FeatureDetailsWidget/AttributeKeySelector.tsx +104 -0
  34. package/src/FeatureDetailsWidget/Attributes.tsx +215 -367
  35. package/src/FeatureDetailsWidget/BasicInformation.tsx +6 -5
  36. package/src/FeatureDetailsWidget/DefaultAttributeEditor.tsx +104 -0
  37. package/src/FeatureDetailsWidget/DefaultAttributeViewer.tsx +22 -0
  38. package/src/FeatureDetailsWidget/FeatureDetailsNavigation.tsx +4 -4
  39. package/src/FeatureDetailsWidget/NumberTextField.tsx +1 -1
  40. package/src/FeatureDetailsWidget/Sequence.tsx +2 -2
  41. package/src/FeatureDetailsWidget/StringTextField.tsx +1 -1
  42. package/src/FeatureDetailsWidget/TranscriptSequence.tsx +15 -23
  43. package/src/FeatureDetailsWidget/TranscriptWidgetEditLocation.tsx +950 -196
  44. package/src/FeatureDetailsWidget/TranscriptWidgetSummary.tsx +8 -4
  45. package/src/FeatureDetailsWidget/model.ts +8 -3
  46. package/src/LinearApolloDisplay/components/LinearApolloDisplay.tsx +7 -7
  47. package/src/LinearApolloDisplay/glyphs/BoxGlyph.ts +59 -72
  48. package/src/LinearApolloDisplay/glyphs/GeneGlyph.ts +253 -60
  49. package/src/LinearApolloDisplay/glyphs/GenericChildGlyph.ts +52 -6
  50. package/src/LinearApolloDisplay/glyphs/Glyph.ts +16 -8
  51. package/src/LinearApolloDisplay/stateModel/base.ts +81 -10
  52. package/src/LinearApolloDisplay/stateModel/index.ts +4 -3
  53. package/src/LinearApolloDisplay/stateModel/layouts.ts +8 -39
  54. package/src/LinearApolloDisplay/stateModel/mouseEvents.ts +63 -46
  55. package/src/LinearApolloDisplay/stateModel/rendering.ts +60 -31
  56. package/src/LinearApolloSixFrameDisplay/components/LinearApolloSixFrameDisplay.tsx +226 -0
  57. package/src/LinearApolloSixFrameDisplay/components/TrackLines.tsx +32 -0
  58. package/src/LinearApolloSixFrameDisplay/components/index.ts +2 -0
  59. package/src/LinearApolloSixFrameDisplay/configSchema.ts +7 -0
  60. package/src/LinearApolloSixFrameDisplay/glyphs/GeneGlyph.ts +940 -0
  61. package/src/LinearApolloSixFrameDisplay/glyphs/Glyph.ts +63 -0
  62. package/src/LinearApolloSixFrameDisplay/glyphs/index.ts +1 -0
  63. package/src/LinearApolloSixFrameDisplay/index.ts +2 -0
  64. package/src/LinearApolloSixFrameDisplay/stateModel/base.ts +302 -0
  65. package/src/LinearApolloSixFrameDisplay/stateModel/index.ts +27 -0
  66. package/src/LinearApolloSixFrameDisplay/stateModel/layouts.ts +252 -0
  67. package/src/LinearApolloSixFrameDisplay/stateModel/mouseEvents.ts +368 -0
  68. package/src/LinearApolloSixFrameDisplay/stateModel/rendering.ts +201 -0
  69. package/src/LinearApolloSixFrameDisplay/types.ts +1 -0
  70. package/src/OntologyManager/OntologyStore/fulltext.test.ts +1 -1
  71. package/src/OntologyManager/OntologyStore/fulltext.ts +8 -3
  72. package/src/OntologyManager/OntologyStore/index.test.ts +3 -1
  73. package/src/OntologyManager/OntologyStore/index.ts +19 -14
  74. package/src/OntologyManager/OntologyStore/indexeddb-schema.ts +6 -5
  75. package/src/OntologyManager/OntologyStore/indexeddb-storage.ts +11 -5
  76. package/src/OntologyManager/index.ts +12 -7
  77. package/src/OntologyManager/util.ts +3 -2
  78. package/src/TabularEditor/HybridGrid/ChangeHandling.ts +2 -2
  79. package/src/TabularEditor/HybridGrid/Feature.tsx +13 -7
  80. package/src/TabularEditor/HybridGrid/FeatureAttributes.tsx +1 -1
  81. package/src/TabularEditor/HybridGrid/HybridGrid.tsx +3 -2
  82. package/src/TabularEditor/HybridGrid/ToolBar.tsx +1 -1
  83. package/src/TabularEditor/HybridGrid/featureContextMenuItems.ts +114 -22
  84. package/src/TabularEditor/TabularEditorPane.tsx +1 -1
  85. package/src/TabularEditor/model.ts +2 -2
  86. package/src/TabularEditor/types.ts +5 -2
  87. package/src/components/AddAssembly.tsx +182 -179
  88. package/src/components/AddAssemblyAliases.tsx +114 -0
  89. package/src/components/AddChildFeature.tsx +8 -10
  90. package/src/components/AddFeature.tsx +216 -44
  91. package/src/components/AddRefSeqAliases.tsx +14 -12
  92. package/src/components/CopyFeature.tsx +10 -11
  93. package/src/components/CreateApolloAnnotation.tsx +342 -158
  94. package/src/components/DeleteAssembly.tsx +9 -8
  95. package/src/components/DeleteFeature.tsx +362 -14
  96. package/src/components/Dialog.tsx +1 -1
  97. package/src/components/DownloadGFF3.tsx +31 -11
  98. package/src/components/FilterFeatures.tsx +6 -4
  99. package/src/components/FilterTranscripts.tsx +86 -0
  100. package/src/components/ImportFeatures.tsx +7 -6
  101. package/src/components/LogOut.tsx +5 -4
  102. package/src/components/ManageChecks.tsx +9 -8
  103. package/src/components/ManageUsers.tsx +11 -10
  104. package/src/components/MergeExons.tsx +193 -0
  105. package/src/components/MergeTranscripts.tsx +185 -0
  106. package/src/components/OntologyTermAutocomplete.tsx +5 -5
  107. package/src/components/OntologyTermMultiSelect.tsx +6 -6
  108. package/src/components/OpenLocalFile.tsx +4 -3
  109. package/src/components/SplitExon.tsx +134 -0
  110. package/src/components/ViewChangeLog.tsx +7 -6
  111. package/src/components/ViewCheckResults.tsx +8 -7
  112. package/src/components/index.ts +3 -0
  113. package/src/config.ts +5 -0
  114. package/src/extensions/annotationFromJBrowseFeature.test.ts +1 -0
  115. package/src/extensions/annotationFromJBrowseFeature.ts +13 -10
  116. package/src/extensions/annotationFromPileup.ts +104 -94
  117. package/src/index.ts +33 -50
  118. package/src/makeDisplayComponent.tsx +90 -37
  119. package/src/session/ClientDataStore.ts +21 -17
  120. package/src/session/session.ts +46 -39
  121. package/src/types.ts +4 -4
  122. package/src/util/annotationFeatureUtils.ts +66 -1
  123. package/src/util/copyToClipboard.ts +21 -0
  124. package/src/util/glyphUtils.ts +49 -0
  125. package/src/util/index.ts +5 -3
  126. package/src/util/loadAssemblyIntoClient.ts +10 -3
  127. package/src/util/mouseEventsUtils.ts +113 -0
  128. package/src/ApolloSixFrameRenderer/ApolloSixFrameRenderer.tsx +0 -13
  129. package/src/ApolloSixFrameRenderer/components/ApolloRendering.tsx +0 -707
  130. package/src/ApolloSixFrameRenderer/configSchema.ts +0 -7
  131. package/src/ApolloSixFrameRenderer/index.ts +0 -3
  132. package/src/SixFrameFeatureDisplay/components/TrackLines.tsx +0 -19
  133. package/src/SixFrameFeatureDisplay/components/index.ts +0 -1
  134. package/src/SixFrameFeatureDisplay/configSchema.ts +0 -21
  135. package/src/SixFrameFeatureDisplay/index.ts +0 -2
  136. package/src/SixFrameFeatureDisplay/stateModel.ts +0 -443
@@ -9,49 +9,46 @@ import {
9
9
  AddAssemblyFromFileChange,
10
10
  } from '@apollo-annotation/shared'
11
11
  import { readConfObject } from '@jbrowse/core/configuration'
12
- import { AbstractSessionModel } from '@jbrowse/core/util'
12
+ import { type AbstractSessionModel } from '@jbrowse/core/util'
13
+ import InfoIcon from '@mui/icons-material/Info'
14
+ import LinkIcon from '@mui/icons-material/Link'
15
+ import RadioButtonCheckedIcon from '@mui/icons-material/RadioButtonChecked'
16
+ import RadioButtonUncheckedIcon from '@mui/icons-material/RadioButtonUnchecked'
13
17
  import {
18
+ Accordion,
19
+ AccordionDetails,
20
+ AccordionSummary,
21
+ Box,
14
22
  Button,
23
+ Checkbox,
15
24
  DialogActions,
16
25
  DialogContent,
17
26
  DialogContentText,
18
- Accordion,
19
- AccordionSummary,
20
- AccordionDetails,
21
- Typography,
22
- Box,
23
- FormGroup,
24
27
  FormControlLabel,
25
- Checkbox,
26
- LinearProgress,
27
- TextField,
28
- Tooltip,
28
+ FormGroup,
29
29
  IconButton,
30
+ InputAdornment,
31
+ LinearProgress,
30
32
  Table,
31
- TableCell,
32
33
  TableBody,
33
- InputAdornment,
34
+ TableCell,
34
35
  TableRow,
36
+ TextField,
37
+ Tooltip,
38
+ Typography,
35
39
  } from '@mui/material'
36
-
37
- import { makeStyles } from 'tss-react/mui'
38
-
39
40
  import ObjectID from 'bson-objectid'
40
41
  import { getRoot } from 'mobx-state-tree'
41
42
  import React, { useEffect, useState } from 'react'
43
+ import { makeStyles } from 'tss-react/mui'
42
44
 
43
- import { ApolloInternetAccountModel } from '../ApolloInternetAccount/model'
44
- import { ChangeManager } from '../ChangeManager'
45
- import { ApolloSessionModel } from '../session'
46
- import { ApolloRootModel } from '../types'
45
+ import { type ApolloInternetAccountModel } from '../ApolloInternetAccount/model'
46
+ import { type ChangeManager } from '../ChangeManager'
47
+ import { type ApolloSessionModel } from '../session'
48
+ import { type ApolloRootModel } from '../types'
47
49
  import { createFetchErrorMessage } from '../util'
48
- import { Dialog } from './Dialog'
49
50
 
50
- import RadioButtonUncheckedIcon from '@mui/icons-material/RadioButtonUnchecked'
51
- import RadioButtonCheckedIcon from '@mui/icons-material/RadioButtonChecked'
52
-
53
- import InfoIcon from '@mui/icons-material/Info'
54
- import LinkIcon from '@mui/icons-material/Link'
51
+ import { Dialog } from './Dialog'
55
52
 
56
53
  interface AddAssemblyProps {
57
54
  session: ApolloSessionModel
@@ -518,164 +515,170 @@ export function AddAssembly({
518
515
  fileType === FileType.GFF3 ? (
519
516
  <Table size="small" sx={{ mt: 2 }}>
520
517
  <TableBody>
521
- <TableRow />
522
- <TableCell style={{ borderBottomWidth: 0 }}>
523
- <Box display="flex" alignItems="center">
524
- <span>FASTA</span>
525
- <Tooltip title='Unless "Store sequence in database" enabled, FASTA input must be compressed with bgzip and indexed with samtools faidx (or equivalent). Compression is optional for sequences stored in the database.'>
526
- <IconButton size="small">
527
- <InfoIcon sx={{ fontSize: 18 }} />
528
- </IconButton>
529
- </Tooltip>
530
- </Box>
531
- </TableCell>
532
- <TableCell style={{ borderBottomWidth: 0 }}>
533
- <input
534
- data-testid="fasta-input-file"
535
- type="file"
536
- onChange={(
537
- e: React.ChangeEvent<HTMLInputElement>,
538
- ) => {
539
- setFastaFile(e.target.files?.item(0) ?? null)
540
- }}
541
- disabled={submitted && !errorMessage}
542
- />
543
- </TableCell>
544
-
545
- <TableRow />
546
- <TableCell style={{ borderBottomWidth: 0 }}>
547
- FASTA index (.fai)
548
- </TableCell>
549
- <TableCell style={{ borderBottomWidth: 0 }}>
550
- <input
551
- data-testid="fai-input-file"
552
- type="file"
553
- onChange={(
554
- e: React.ChangeEvent<HTMLInputElement>,
555
- ) => {
556
- setFastaIndexFile(e.target.files?.item(0) ?? null)
557
- }}
558
- disabled={
559
- (submitted && !errorMessage) || sequenceIsEditable
560
- }
561
- />
562
- </TableCell>
563
-
564
- <TableRow />
565
- <TableCell style={{ borderBottomWidth: 0 }}>
566
- FASTA binary index (.gzi)
567
- </TableCell>
568
- <TableCell style={{ borderBottomWidth: 0 }}>
569
- <input
570
- data-testid="gzi-input-file"
571
- type="file"
572
- onChange={(
573
- e: React.ChangeEvent<HTMLInputElement>,
574
- ) => {
575
- setFastaGziIndexFile(
576
- e.target.files?.item(0) ?? null,
577
- )
578
- }}
579
- disabled={
580
- (submitted && !errorMessage) || sequenceIsEditable
581
- }
582
- />
583
- </TableCell>
518
+ <TableRow>
519
+ <TableCell style={{ borderBottomWidth: 0 }}>
520
+ <Box display="flex" alignItems="center">
521
+ <span>FASTA</span>
522
+ <Tooltip title='Unless "Store sequence in database" enabled, FASTA input must be compressed with bgzip and indexed with samtools faidx (or equivalent). Compression is optional for sequences stored in the database.'>
523
+ <IconButton size="small">
524
+ <InfoIcon sx={{ fontSize: 18 }} />
525
+ </IconButton>
526
+ </Tooltip>
527
+ </Box>
528
+ </TableCell>
529
+ <TableCell style={{ borderBottomWidth: 0 }}>
530
+ <input
531
+ data-testid="fasta-input-file"
532
+ type="file"
533
+ onChange={(
534
+ e: React.ChangeEvent<HTMLInputElement>,
535
+ ) => {
536
+ setFastaFile(e.target.files?.item(0) ?? null)
537
+ }}
538
+ disabled={submitted && !errorMessage}
539
+ />
540
+ </TableCell>
541
+ </TableRow>
542
+
543
+ <TableRow>
544
+ <TableCell style={{ borderBottomWidth: 0 }}>
545
+ FASTA index (.fai)
546
+ </TableCell>
547
+ <TableCell style={{ borderBottomWidth: 0 }}>
548
+ <input
549
+ data-testid="fai-input-file"
550
+ type="file"
551
+ onChange={(
552
+ e: React.ChangeEvent<HTMLInputElement>,
553
+ ) => {
554
+ setFastaIndexFile(e.target.files?.item(0) ?? null)
555
+ }}
556
+ disabled={
557
+ (submitted && !errorMessage) || sequenceIsEditable
558
+ }
559
+ />
560
+ </TableCell>
561
+ </TableRow>
562
+
563
+ <TableRow>
564
+ <TableCell style={{ borderBottomWidth: 0 }}>
565
+ FASTA binary index (.gzi)
566
+ </TableCell>
567
+ <TableCell style={{ borderBottomWidth: 0 }}>
568
+ <input
569
+ data-testid="gzi-input-file"
570
+ type="file"
571
+ onChange={(
572
+ e: React.ChangeEvent<HTMLInputElement>,
573
+ ) => {
574
+ setFastaGziIndexFile(
575
+ e.target.files?.item(0) ?? null,
576
+ )
577
+ }}
578
+ disabled={
579
+ (submitted && !errorMessage) || sequenceIsEditable
580
+ }
581
+ />
582
+ </TableCell>
583
+ </TableRow>
584
584
  </TableBody>
585
585
  </Table>
586
586
  ) : (
587
587
  <Table size="small" sx={{ mt: 2 }}>
588
588
  <TableBody>
589
- <TableRow />
590
- <TableCell style={{ borderBottomWidth: 0 }}>
591
- <Box display="flex" alignItems="center">
592
- <span>FASTA</span>
593
- <Tooltip title="Remote FASTA input must be compressed with bgzip and indexed with samtools faidx (or equivalent)">
594
- <IconButton size="small">
595
- <InfoIcon sx={{ fontSize: 18 }} />
596
- </IconButton>
597
- </Tooltip>
598
- </Box>
599
- </TableCell>
600
- <TableCell style={{ borderBottomWidth: 0 }}>
601
- <TextField
602
- data-testid="fasta-input-url"
603
- variant="outlined"
604
- value={fastaUrl}
605
- error={!validFastaUrl}
606
- onChange={(
607
- e: React.ChangeEvent<HTMLInputElement>,
608
- ) => {
609
- setFastaUrl(e.target.value)
610
- }}
611
- disabled={submitted && !errorMessage}
612
- slotProps={{
613
- input: {
614
- startAdornment: (
615
- <InputAdornment position="start">
616
- <LinkIcon />
617
- </InputAdornment>
618
- ),
619
- },
620
- }}
621
- />
622
- </TableCell>
623
-
624
- <TableRow />
625
- <TableCell style={{ borderBottomWidth: 0 }}>
626
- FASTA index (.fai)
627
- </TableCell>
628
- <TableCell style={{ borderBottomWidth: 0 }}>
629
- <TextField
630
- data-testid="fai-input-url"
631
- variant="outlined"
632
- value={fastaIndexUrl}
633
- error={!validFastaIndexUrl}
634
- onChange={(
635
- e: React.ChangeEvent<HTMLInputElement>,
636
- ) => {
637
- setFastaIndexUrl(e.target.value)
638
- }}
639
- disabled={submitted && !errorMessage}
640
- slotProps={{
641
- input: {
642
- startAdornment: (
643
- <InputAdornment position="start">
644
- <LinkIcon />
645
- </InputAdornment>
646
- ),
647
- },
648
- }}
649
- />
650
- </TableCell>
651
-
652
- <TableRow />
653
- <TableCell style={{ borderBottomWidth: 0 }}>
654
- FASTA binary index (.gzi)
655
- </TableCell>
656
- <TableCell style={{ borderBottomWidth: 0 }}>
657
- <TextField
658
- data-testid="gzi-input-url"
659
- variant="outlined"
660
- value={fastaGziIndexUrl}
661
- error={!validFastaGziIndexUrl}
662
- onChange={(
663
- e: React.ChangeEvent<HTMLInputElement>,
664
- ) => {
665
- setFastaGziIndexUrl(e.target.value)
666
- }}
667
- disabled={submitted && !errorMessage}
668
- slotProps={{
669
- input: {
670
- startAdornment: (
671
- <InputAdornment position="start">
672
- <LinkIcon />
673
- </InputAdornment>
674
- ),
675
- },
676
- }}
677
- />
678
- </TableCell>
589
+ <TableRow>
590
+ <TableCell style={{ borderBottomWidth: 0 }}>
591
+ <Box display="flex" alignItems="center">
592
+ <span>FASTA</span>
593
+ <Tooltip title="Remote FASTA input must be compressed with bgzip and indexed with samtools faidx (or equivalent)">
594
+ <IconButton size="small">
595
+ <InfoIcon sx={{ fontSize: 18 }} />
596
+ </IconButton>
597
+ </Tooltip>
598
+ </Box>
599
+ </TableCell>
600
+ <TableCell style={{ borderBottomWidth: 0 }}>
601
+ <TextField
602
+ data-testid="fasta-input-url"
603
+ variant="outlined"
604
+ value={fastaUrl}
605
+ error={!validFastaUrl}
606
+ onChange={(
607
+ e: React.ChangeEvent<HTMLInputElement>,
608
+ ) => {
609
+ setFastaUrl(e.target.value)
610
+ }}
611
+ disabled={submitted && !errorMessage}
612
+ slotProps={{
613
+ input: {
614
+ startAdornment: (
615
+ <InputAdornment position="start">
616
+ <LinkIcon />
617
+ </InputAdornment>
618
+ ),
619
+ },
620
+ }}
621
+ />
622
+ </TableCell>
623
+ </TableRow>
624
+
625
+ <TableRow>
626
+ <TableCell style={{ borderBottomWidth: 0 }}>
627
+ FASTA index (.fai)
628
+ </TableCell>
629
+ <TableCell style={{ borderBottomWidth: 0 }}>
630
+ <TextField
631
+ data-testid="fai-input-url"
632
+ variant="outlined"
633
+ value={fastaIndexUrl}
634
+ error={!validFastaIndexUrl}
635
+ onChange={(
636
+ e: React.ChangeEvent<HTMLInputElement>,
637
+ ) => {
638
+ setFastaIndexUrl(e.target.value)
639
+ }}
640
+ disabled={submitted && !errorMessage}
641
+ slotProps={{
642
+ input: {
643
+ startAdornment: (
644
+ <InputAdornment position="start">
645
+ <LinkIcon />
646
+ </InputAdornment>
647
+ ),
648
+ },
649
+ }}
650
+ />
651
+ </TableCell>
652
+ </TableRow>
653
+
654
+ <TableRow>
655
+ <TableCell style={{ borderBottomWidth: 0 }}>
656
+ FASTA binary index (.gzi)
657
+ </TableCell>
658
+ <TableCell style={{ borderBottomWidth: 0 }}>
659
+ <TextField
660
+ data-testid="gzi-input-url"
661
+ variant="outlined"
662
+ value={fastaGziIndexUrl}
663
+ error={!validFastaGziIndexUrl}
664
+ onChange={(
665
+ e: React.ChangeEvent<HTMLInputElement>,
666
+ ) => {
667
+ setFastaGziIndexUrl(e.target.value)
668
+ }}
669
+ disabled={submitted && !errorMessage}
670
+ slotProps={{
671
+ input: {
672
+ startAdornment: (
673
+ <InputAdornment position="start">
674
+ <LinkIcon />
675
+ </InputAdornment>
676
+ ),
677
+ },
678
+ }}
679
+ />
680
+ </TableCell>
681
+ </TableRow>
679
682
  </TableBody>
680
683
  </Table>
681
684
  )}
@@ -0,0 +1,114 @@
1
+ import { AddAssemblyAliasesChange } from '@apollo-annotation/shared'
2
+ import { Box, DialogContent, DialogContentText } from '@mui/material'
3
+ import { DataGrid, type GridColDef, type GridRowModel } from '@mui/x-data-grid'
4
+ import React from 'react'
5
+
6
+ import {
7
+ type ApolloInternetAccount,
8
+ type CollaborationServerDriver,
9
+ } from '../BackendDrivers'
10
+ import { type ChangeManager } from '../ChangeManager'
11
+ import { type ApolloSessionModel } from '../session'
12
+
13
+ import { Dialog } from './Dialog'
14
+
15
+ interface AddAssemblyAliasProps {
16
+ session: ApolloSessionModel
17
+ handleClose: () => void
18
+ changeManager: ChangeManager
19
+ }
20
+
21
+ const columns: GridColDef[] = [
22
+ {
23
+ field: 'name',
24
+ headerName: 'Assembly Name',
25
+ width: 150,
26
+ editable: false,
27
+ },
28
+ {
29
+ field: 'aliases',
30
+ headerName: 'Aliases',
31
+ width: 300,
32
+ editable: true,
33
+ },
34
+ ]
35
+
36
+ interface AssemblyAlias {
37
+ id: string
38
+ name: string
39
+ aliases: string
40
+ }
41
+
42
+ export function AddAssemblyAliases({
43
+ changeManager,
44
+ handleClose,
45
+ session,
46
+ }: AddAssemblyAliasProps) {
47
+ const { apolloDataStore } = session
48
+ const { collaborationServerDriver } = apolloDataStore as {
49
+ collaborationServerDriver: CollaborationServerDriver
50
+ getInternetAccount(
51
+ assemblyName?: string,
52
+ internetAccountId?: string,
53
+ ): ApolloInternetAccount
54
+ }
55
+ const assemblies = collaborationServerDriver.getAssemblies()
56
+
57
+ const rows: AssemblyAlias[] = assemblies.map((assembly) => {
58
+ return {
59
+ id: assembly.name,
60
+ name: assembly.displayName ?? assembly.name,
61
+ aliases: assembly.aliases.join(', '),
62
+ } as AssemblyAlias
63
+ })
64
+
65
+ const [errorMessage, setErrorMessage] = React.useState('')
66
+
67
+ const processRowUpdate = (newRow: GridRowModel, _oldRow: GridRowModel) => {
68
+ const change = new AddAssemblyAliasesChange({
69
+ typeName: 'AddAssemblyAliasesChange',
70
+ assembly: newRow.id as string,
71
+ aliases: (newRow.aliases as string).split(','),
72
+ })
73
+ void changeManager.submit(change).catch(() => {
74
+ setErrorMessage('Error submitting change')
75
+ })
76
+ handleClose()
77
+ return newRow
78
+ }
79
+
80
+ return (
81
+ <Dialog
82
+ open
83
+ title="Add assembly aliases"
84
+ handleClose={handleClose}
85
+ maxWidth={'sm'}
86
+ data-testid="add-assembly-alias"
87
+ fullWidth
88
+ >
89
+ <DialogContent style={{ display: 'flex', flexDirection: 'column' }}>
90
+ <Box sx={{ height: 400, width: '100%' }}>
91
+ <DataGrid
92
+ rows={rows}
93
+ columns={columns}
94
+ initialState={{
95
+ pagination: {
96
+ paginationModel: {
97
+ pageSize: 5,
98
+ },
99
+ },
100
+ }}
101
+ pageSizeOptions={[5]}
102
+ processRowUpdate={processRowUpdate}
103
+ disableRowSelectionOnClick
104
+ />
105
+ </Box>
106
+ </DialogContent>
107
+ {errorMessage ? (
108
+ <DialogContent>
109
+ <DialogContentText color="error">{errorMessage}</DialogContentText>
110
+ </DialogContent>
111
+ ) : null}
112
+ </Dialog>
113
+ )
114
+ }
@@ -1,8 +1,7 @@
1
1
  /* eslint-disable @typescript-eslint/unbound-method */
2
- /* eslint-disable @typescript-eslint/no-misused-promises */
3
- import { AnnotationFeature } from '@apollo-annotation/mst'
2
+
3
+ import { type AnnotationFeature } from '@apollo-annotation/mst'
4
4
  import { AddFeatureChange } from '@apollo-annotation/shared'
5
- import { AbstractSessionModel } from '@jbrowse/core/util'
6
5
  import {
7
6
  Button,
8
7
  DialogActions,
@@ -13,11 +12,12 @@ import {
13
12
  import ObjectID from 'bson-objectid'
14
13
  import React, { useState } from 'react'
15
14
 
16
- import { ChangeManager } from '../ChangeManager'
15
+ import { type ChangeManager } from '../ChangeManager'
17
16
  import { isOntologyClass } from '../OntologyManager'
18
- import OntologyStore from '../OntologyManager/OntologyStore'
17
+ import type OntologyStore from '../OntologyManager/OntologyStore'
19
18
  import { fetchValidDescendantTerms } from '../OntologyManager/util'
20
- import { ApolloSessionModel } from '../session'
19
+ import { type ApolloSessionModel } from '../session'
20
+
21
21
  import { Dialog } from './Dialog'
22
22
  import { OntologyTermAutocomplete } from './OntologyTermAutocomplete'
23
23
 
@@ -36,7 +36,6 @@ export function AddChildFeature({
36
36
  sourceAssemblyId,
37
37
  sourceFeature,
38
38
  }: AddChildFeatureProps) {
39
- const { notify } = session as unknown as AbstractSessionModel
40
39
  const [end, setEnd] = useState(String(sourceFeature.max))
41
40
  const [start, setStart] = useState(String(sourceFeature.min + 1))
42
41
  const [type, setType] = useState('')
@@ -62,7 +61,7 @@ export function AddChildFeature({
62
61
  return terms
63
62
  }
64
63
 
65
- async function onSubmit(event: React.FormEvent<HTMLFormElement>) {
64
+ function onSubmit(event: React.FormEvent<HTMLFormElement>) {
66
65
  event.preventDefault()
67
66
  setErrorMessage('')
68
67
  const change = new AddFeatureChange({
@@ -78,8 +77,7 @@ export function AddChildFeature({
78
77
  },
79
78
  parentFeatureId: sourceFeature._id,
80
79
  })
81
- await changeManager.submit(change)
82
- notify('Feature added successfully', 'success')
80
+ void changeManager.submit(change)
83
81
  handleClose()
84
82
  event.preventDefault()
85
83
  }