Skip to content

Commit

Permalink
Fix empty feature sequence on top-level gene feature, split jbrowseMo…
Browse files Browse the repository at this point in the history
…del into jbrowseModel+jbrowseConfig (#3662)
  • Loading branch information
cmdcolin authored Apr 25, 2023
1 parent 8cc9202 commit b492af9
Show file tree
Hide file tree
Showing 61 changed files with 2,037 additions and 810 deletions.
18 changes: 10 additions & 8 deletions packages/core/BaseFeatureWidget/BaseFeatureDetail.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ import {
import { ErrorMessage, SanitizedHTML } from '../ui'
import SequenceFeatureDetails from './SequenceFeatureDetails'
import { BaseCardProps, BaseProps } from './types'
import { SimpleFeatureSerializedNoId } from '../util/simpleFeature'
import { SimpleFeatureSerialized } from '../util/simpleFeature'
import { ellipses } from './util'

const MAX_FIELD_NAME_WIDTH = 170
Expand Down Expand Up @@ -270,7 +270,7 @@ function Position(props: BaseProps) {

function CoreDetails(props: BaseProps) {
const { feature } = props
const obj = feature as SimpleFeatureSerializedNoId & {
const obj = feature as SimpleFeatureSerialized & {
start: number
end: number
assemblyName?: string
Expand Down Expand Up @@ -587,13 +587,13 @@ interface PanelDescriptor {

export function FeatureDetails(props: {
model: IAnyStateTreeNode
feature: SimpleFeatureSerializedNoId
feature: SimpleFeatureSerialized
depth?: number
omit?: string[]
formatter?: (val: unknown, key: string) => React.ReactNode
}) {
const { omit = [], model, feature, depth = 0 } = props
const { mate, name = '', id = '', type = '', subfeatures } = feature
const { mate, name = '', id = '', type = '', subfeatures, uniqueId } = feature
const pm = getEnv(model).pluginManager
const session = getSession(model)

Expand All @@ -610,8 +610,10 @@ export function FeatureDetails(props: {
<>
<Divider />
<Typography>Mate details</Typography>
{/* @ts-expect-error */}
<CoreDetails {...props} feature={mate} />
<CoreDetails
{...props}
feature={{ ...mate, uniqueId: uniqueId + '-mate' }}
/>
</>
) : null}
<Divider />
Expand Down Expand Up @@ -642,10 +644,10 @@ export function FeatureDetails(props: {

{subfeatures?.length ? (
<BaseCard title="Subfeatures" defaultExpanded={depth < 1}>
{subfeatures.map(sub => (
{subfeatures.map((sub, idx) => (
<FeatureDetails
key={JSON.stringify(sub)}
feature={sub}
feature={{ ...sub, uniqueId: `${uniqueId}_${idx}` }}
model={model}
depth={depth + 1}
/>
Expand Down
142 changes: 0 additions & 142 deletions packages/core/BaseFeatureWidget/SequenceBox.tsx

This file was deleted.

Loading

0 comments on commit b492af9

Please sign in to comment.