Skip to content

Commit

Permalink
Use radio button
Browse files Browse the repository at this point in the history
  • Loading branch information
cmdcolin committed Apr 21, 2024
1 parent f60aa94 commit 0132362
Show file tree
Hide file tree
Showing 8 changed files with 36 additions and 68 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@ import {
getSession,
assembleLocString,
toLocale,
ParsedLocString,
SimpleFeatureSerialized,
} from '../../util'
import { ErrorMessage } from '../../ui'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,6 @@ const useStyles = makeStyles()({
formControl: {
margin: 0,
marginLeft: 4,
maxWidth: 180,
},
})

Expand Down Expand Up @@ -67,7 +66,7 @@ const SequenceFeatureDetails = observer(function ({
)

return (
<span>
<>
<span>
<FormControl className={classes.formControl}>
<Select
Expand Down Expand Up @@ -216,7 +215,7 @@ const SequenceFeatureDetails = observer(function ({
</Suspense>
) : null}
</div>
</span>
</>
)
})

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,12 @@ import {
Button,
DialogContent,
DialogActions,
TextField,
Checkbox,
FormControlLabel,
FormControl,
FormLabel,
Radio,
RadioGroup,
TextField,
} from '@mui/material'
import { Dialog } from '@jbrowse/core/ui'
import { makeStyles } from 'tss-react/mui'
Expand Down Expand Up @@ -65,15 +68,24 @@ const SequenceFeatureSettingsDialog = observer(function ({
/>
</div>
<div>
<FormControlLabel
control={
<Checkbox
onChange={event => model.setUpperCaseCDS(event.target.checked)}
checked={model.upperCaseCDS}
<FormControl>
<FormLabel>Sequence capitalization</FormLabel>
<RadioGroup
value={model.upperCaseCDS ? 'cds' : 'unchanged'}
onChange={e => model.setUpperCaseCDS(e.target.value === 'cds')}
>
<FormControlLabel
value="cds"
control={<Radio />}
label="Capitalize CDS and lower case everything else"
/>
}
label="Upper case CDS, lower case everything else?"
/>
<FormControlLabel
value="unchanged"
control={<Radio />}
label="Capitalization from reference genome sequence"
/>
</RadioGroup>
</FormControl>
</div>
</DialogContent>

Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1 @@
import SequenceFeaturePanel from './SequenceFeaturePanel'

export { SequenceFeaturePanel as default }
export { default } from './SequenceFeaturePanel'
Original file line number Diff line number Diff line change
Expand Up @@ -283,35 +283,15 @@ exports[`open up a widget 1`] = `
<div
class="css-1lttu3w-container"
>
<button
class="MuiButtonBase-root MuiButton-root MuiButton-contained MuiButton-containedPrimary MuiButton-sizeMedium MuiButton-containedSizeMedium MuiButton-colorPrimary MuiButton-root MuiButton-contained MuiButton-containedPrimary MuiButton-sizeMedium MuiButton-containedSizeMedium MuiButton-colorPrimary css-sghohy-MuiButtonBase-root-MuiButton-root"
tabindex="0"
type="button"
>
Show feature sequence
<span
class="MuiTouchRipple-root css-8je8zh-MuiTouchRipple-root"
/>
</button>
<div
class="MuiFormControl-root css-147opmv-MuiFormControl-root-formControl"
>
<button
class="MuiButtonBase-root MuiIconButton-root MuiIconButton-sizeMedium css-78trlr-MuiButtonBase-root-MuiIconButton-root"
class="MuiButtonBase-root MuiButton-root MuiButton-contained MuiButton-containedPrimary MuiButton-sizeMedium MuiButton-containedSizeMedium MuiButton-colorPrimary MuiButton-root MuiButton-contained MuiButton-containedPrimary MuiButton-sizeMedium MuiButton-containedSizeMedium MuiButton-colorPrimary css-sghohy-MuiButtonBase-root-MuiButton-root"
tabindex="0"
type="button"
>
<svg
aria-hidden="true"
class="MuiSvgIcon-root MuiSvgIcon-fontSizeMedium css-i4bv87-MuiSvgIcon-root"
data-testid="HelpIcon"
focusable="false"
viewBox="0 0 24 24"
>
<path
d="M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2m1 17h-2v-2h2zm2.07-7.75-.9.92C13.45 12.9 13 13.5 13 15h-2v-.5c0-1.1.45-2.1 1.17-2.83l1.24-1.26c.37-.36.59-.86.59-1.41 0-1.1-.9-2-2-2s-2 .9-2 2H8c0-2.21 1.79-4 4-4s4 1.79 4 4c0 .88-.36 1.68-.93 2.25"
/>
</svg>
Show sequence
<span
class="MuiTouchRipple-root css-8je8zh-MuiTouchRipple-root"
/>
Expand Down
2 changes: 1 addition & 1 deletion plugins/gccontent/src/GCContentAdapter/GCContentAdapter.ts
Original file line number Diff line number Diff line change
Expand Up @@ -95,5 +95,5 @@ export default class GCContentAdapter extends BaseFeatureDataAdapter {
* will not be needed for the foreseeable future and can be purged
* from caches, etc
*/
public freeResources(/* { region } */) { }
public freeResources(/* { region } */) {}
}
Original file line number Diff line number Diff line change
Expand Up @@ -191,35 +191,15 @@ exports[`renders with just the required model elements 1`] = `
<div
class="css-1lttu3w-container"
>
<button
class="MuiButtonBase-root MuiButton-root MuiButton-contained MuiButton-containedPrimary MuiButton-sizeMedium MuiButton-containedSizeMedium MuiButton-colorPrimary MuiButton-root MuiButton-contained MuiButton-containedPrimary MuiButton-sizeMedium MuiButton-containedSizeMedium MuiButton-colorPrimary css-sghohy-MuiButtonBase-root-MuiButton-root"
tabindex="0"
type="button"
>
Show feature sequence
<span
class="MuiTouchRipple-root css-8je8zh-MuiTouchRipple-root"
/>
</button>
<div
class="MuiFormControl-root css-147opmv-MuiFormControl-root-formControl"
>
<button
class="MuiButtonBase-root MuiIconButton-root MuiIconButton-sizeMedium css-78trlr-MuiButtonBase-root-MuiIconButton-root"
class="MuiButtonBase-root MuiButton-root MuiButton-contained MuiButton-containedPrimary MuiButton-sizeMedium MuiButton-containedSizeMedium MuiButton-colorPrimary MuiButton-root MuiButton-contained MuiButton-containedPrimary MuiButton-sizeMedium MuiButton-containedSizeMedium MuiButton-colorPrimary css-sghohy-MuiButtonBase-root-MuiButton-root"
tabindex="0"
type="button"
>
<svg
aria-hidden="true"
class="MuiSvgIcon-root MuiSvgIcon-fontSizeMedium css-i4bv87-MuiSvgIcon-root"
data-testid="HelpIcon"
focusable="false"
viewBox="0 0 24 24"
>
<path
d="M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2m1 17h-2v-2h2zm2.07-7.75-.9.92C13.45 12.9 13 13.5 13 15h-2v-.5c0-1.1.45-2.1 1.17-2.83l1.24-1.26c.37-.36.59-.86.59-1.41 0-1.1-.9-2-2-2s-2 .9-2 2H8c0-2.21 1.79-4 4-4s4 1.79 4 4c0 .88-.36 1.68-.93 2.25"
/>
</svg>
Show sequence
<span
class="MuiTouchRipple-root css-8je8zh-MuiTouchRipple-root"
/>
Expand Down
12 changes: 6 additions & 6 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -6909,9 +6909,9 @@ caniuse-api@^3.0.0:
lodash.uniq "^4.5.0"

caniuse-lite@^1.0.0, caniuse-lite@^1.0.30001587:
version "1.0.30001611"
resolved "https://registry.yarnpkg.com/caniuse-lite/-/caniuse-lite-1.0.30001611.tgz#4dbe78935b65851c2d2df1868af39f709a93a96e"
integrity sha512-19NuN1/3PjA3QI8Eki55N8my4LzfkMCRLgCVfrl/slbSAchQfV0+GwjPrK3rq37As4UCLlM/DHajbKkAqbv92Q==
version "1.0.30001612"
resolved "https://registry.yarnpkg.com/caniuse-lite/-/caniuse-lite-1.0.30001612.tgz#d34248b4ec1f117b70b24ad9ee04c90e0b8a14ae"
integrity sha512-lFgnZ07UhaCcsSZgWW0K5j4e69dK1u/ltrL9lTUiFOwNHs12S3UMIEYgBV0Z6C6hRDev7iRnMzzYmKabYdXF9g==

canvas-sequencer@^3.1.0:
version "3.1.0"
Expand Down Expand Up @@ -13544,9 +13544,9 @@ nth-check@^2.0.1:
boolbase "^1.0.0"

nwsapi@^2.2.2, nwsapi@^2.2.7:
version "2.2.8"
resolved "https://registry.yarnpkg.com/nwsapi/-/nwsapi-2.2.8.tgz#a3552e65b74bf8cc89d0480c4132b61dbe54eccf"
integrity sha512-GU/I3lTEFQ9mkEm07Q7HvdRajss8E1wVMGOk3/lHl60QPseG+B3BIQY+JUjYWw7gF8cCeoQCXd4N7DB7avw0Rg==
version "2.2.9"
resolved "https://registry.yarnpkg.com/nwsapi/-/nwsapi-2.2.9.tgz#7f3303218372db2e9f27c27766bcfc59ae7e61c6"
integrity sha512-2f3F0SEEer8bBu0dsNCFF50N0cTThV1nWFYcEYFZttdW0lDAoybv9cQoK7X7/68Z89S7FoRrVjP1LPX4XRf9vg==

nx@18.3.3, "nx@>=17.1.2 < 19":
version "18.3.3"
Expand Down

0 comments on commit 0132362

Please sign in to comment.