diff --git a/apps/web/process/configurator/reactions/filters.ts b/apps/web/process/configurator/reactions/filters.ts index cf96c23..ff4d640 100644 --- a/apps/web/process/configurator/reactions/filters.ts +++ b/apps/web/process/configurator/reactions/filters.ts @@ -1,5 +1,6 @@ /* eslint-disable @typescript-eslint/naming-convention */ import { gql } from '@apollo/client'; +import { selectSeasonType } from 'config/default-options'; import dayjs from 'dayjs'; import utc from 'dayjs/plugin/utc'; import type * as CRMTypes from 'graphql/crm.types'; @@ -370,10 +371,9 @@ export default function commonReactions({ store, apolloClient }: ReactionsContex const allowedSeasonTypes = diff(seasonTypes, seasonTypesExeption); - const filteredSeasonTypesOptions = $calculation - .element('selectSeasonType') - .getOptions() - .filter((seasonTypeOption) => allowedSeasonTypes.includes(seasonTypeOption.value)); + const filteredSeasonTypesOptions = selectSeasonType.filter((seasonTypeOption) => + allowedSeasonTypes.includes(seasonTypeOption.value) + ); $calculation.element('selectSeasonType').setOptions(filteredSeasonTypesOptions); } diff --git a/apps/web/process/payments/reactions.ts b/apps/web/process/payments/reactions.ts index d2d053f..16cce2c 100644 --- a/apps/web/process/payments/reactions.ts +++ b/apps/web/process/payments/reactions.ts @@ -1,6 +1,6 @@ /* eslint-disable function-paren-newline */ /* eslint-disable implicit-arrow-linebreak */ -import { selectHighSeasonStart, selectSeasonType } from 'config/default-options'; +import { selectHighSeasonStart } from 'config/default-options'; import { comparer, reaction, toJS } from 'mobx'; import type { ReactionsContext } from 'process/types'; import { shift } from 'radash'; @@ -204,36 +204,36 @@ export default function paymentsReactions({ store }: ReactionsContext) { } ); - /** - * Дегрессия - */ + // /** + // * Дегрессия + // */ - reaction( - () => { - const graphType = $calculation.element('radioGraphType').getValue(); + // reaction( + // () => { + // const graphType = $calculation.element('radioGraphType').getValue(); - return graphType; - }, - (graphType) => { - if (!graphType) { - $calculation.element('selectSeasonType').resetOptions(); + // return graphType; + // }, + // (graphType) => { + // if (!graphType) { + // $calculation.element('selectSeasonType').resetOptions(); - return; - } + // return; + // } - if (graphType === 100_000_001 || graphType === 100_000_003) { - const allowedSeasonTypes = seasonsConstants.SEASON_TYPES[graphType]; + // if (graphType === 100_000_001 || graphType === 100_000_003) { + // const allowedSeasonTypes = seasonsConstants.SEASON_TYPES[graphType]; - const selectSeasonTypeOptions = selectSeasonType.filter((option) => - allowedSeasonTypes.includes(option.value) - ); + // const selectSeasonTypeOptions = selectSeasonType.filter((option) => + // allowedSeasonTypes.includes(option.value) + // ); - $calculation.element('selectSeasonType').setOptions(selectSeasonTypeOptions); - } else { - $calculation.element('selectSeasonType').resetOptions(); - } - } - ); + // $calculation.element('selectSeasonType').setOptions(selectSeasonTypeOptions); + // } else { + // $calculation.element('selectSeasonType').resetOptions(); + // } + // } + // ); const degressionSteps: { [key: number]: Array } = { 100_000_003: [100, 50, 25],