Skip to content

Commit

Permalink
Pare down globalOmits
Browse files Browse the repository at this point in the history
  • Loading branch information
cmdcolin committed Apr 2, 2021
1 parent 261eede commit cc2e7b6
Showing 1 changed file with 18 additions and 9 deletions.
27 changes: 18 additions & 9 deletions packages/core/BaseFeatureWidget/BaseFeatureDetail.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -23,24 +23,29 @@ import SequenceFeatureDetails from './SequenceFeatureDetails'
import { BaseCardProps, BaseProps } from './types'
import { SimpleFeatureSerialized } from '../util/simpleFeature'

// these are always omitted as too detailed
const globalOmit = [
'name',
'start',
'end',
'strand',
'refName',
'type',
'length',
'position',
'subfeatures',
'description',
'uniqueId',
'exonFrames',
'parentId',
'thickStart',
'thickEnd',
]

// coreDetails are omitted in some circumstances
const coreDetails = [
'name',
'start',
'end',
'strand',
'refName',
'description',
'type',
]

export const useStyles = makeStyles(theme => ({
expansionPanelDetails: {
display: 'block',
Expand Down Expand Up @@ -438,7 +443,7 @@ export const FeatureDetails = (props: {
omit?: string[]
formatter?: (val: unknown, key: string) => JSX.Element
}) => {
const { model, feature, depth = 0 } = props
const { omit = [], model, feature, depth = 0 } = props
const { name, id, type, subfeatures } = feature
const displayName = (name || id) as string | undefined
const ellipsedDisplayName =
Expand All @@ -460,7 +465,11 @@ export const FeatureDetails = (props: {
<CoreDetails {...props} />
<Divider />
<div>Attributes</div>
<Attributes attributes={feature} {...props} />
<Attributes
attributes={feature}
{...props}
omit={[...omit, ...coreDetails]}
/>
{sequenceTypes.includes(feature.type) ? (
<ErrorBoundary
FallbackComponent={({ error }) => (
Expand Down

0 comments on commit cc2e7b6

Please sign in to comment.