Skip to content

Commit

Permalink
fix(FOROME-00): dtree compound_het
Browse files Browse the repository at this point in the history
  • Loading branch information
Lapk1n committed Feb 16, 2022
1 parent d1766e2 commit fcee684
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import { ApproxStateModalMods } from '../../query-builder/ui/approx-state-modal-
import { DisabledVariantsAmount } from '../../query-builder/ui/disabled-variants-amount'
import { HeaderModal } from '../../query-builder/ui/header-modal'
import { ModalBase } from '../../query-builder/ui/modal-base'
import { getApprox } from '../../query-builder/ui/modal-select-compound-het'
import { EditModalButtons } from './edit-modal-buttons'

export interface IParams {
Expand Down Expand Up @@ -92,7 +93,7 @@ export const ModalEditCompoundHet = observer((): ReactElement => {
useEffect(() => {
const indexForApi = dtreeStore.getStepIndexForApi(currentStepIndex)

const params = `{"approx":"${approxCondition}","state":${
const params = `{"approx":${getApprox(approxCondition)},"state":${
stateCondition === '-current-' || !stateCondition
? null
: `"${stateCondition}"`
Expand Down Expand Up @@ -129,7 +130,7 @@ export const ModalEditCompoundHet = observer((): ReactElement => {
if (type === 'approx') {
setApproxCondition(value)

const params = `{"approx":"${value}","state":${
const params = `{"approx":${getApprox(value)},"state":${
stateCondition !== '-current-' ? `"${stateCondition}"` : null
}}`

Expand All @@ -141,7 +142,7 @@ export const ModalEditCompoundHet = observer((): ReactElement => {
if (type === 'state') {
setStateCondition(value)

const params = `{"approx":"${approxCondition}","state":${
const params = `{"approx":${getApprox(approxCondition)},"state":${
value !== '-current-' ? `"${value}"` : null
}}`

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,10 @@ import { HeaderModal } from './header-modal'
import { ModalBase } from './modal-base'
import { SelectModalButtons } from './select-modal-buttons'

export const getApprox = (approxValue: string) => {
return approxValue === 'transcript' ? null : `${approxValue}`
}

export const ModalSelectCompoundHet = observer((): ReactElement => {
const ref = useRef(null)

Expand Down Expand Up @@ -52,7 +56,7 @@ export const ModalSelectCompoundHet = observer((): ReactElement => {
useEffect(() => {
const indexForApi = dtreeStore.getStepIndexForApi(currentStepIndex)

const params = `{"approx":"${approxCondition}","state":${
const params = `{"approx":${getApprox(approxCondition)},"state":${
stateCondition === '-current-' || !stateCondition
? null
: `"${stateCondition}"`
Expand All @@ -77,7 +81,7 @@ export const ModalSelectCompoundHet = observer((): ReactElement => {
if (type === 'approx') {
setApproxCondition(value)

const params = `{"approx":"${value}","state":${
const params = `{"approx":${getApprox(value)},"state":${
stateCondition !== '-current-' ? `"${stateCondition}"` : null
}}`

Expand All @@ -89,7 +93,7 @@ export const ModalSelectCompoundHet = observer((): ReactElement => {
if (type === 'state') {
setStateCondition(value)

const params = `{"approx":"${approxCondition}","state":${
const params = `{"approx":${getApprox(approxCondition)},"state":${
value !== '-current-' ? `"${value}"` : null
}}`

Expand Down

0 comments on commit fcee684

Please sign in to comment.