From e20e8457e720c919e9af6ae08ffc13828e86c287 Mon Sep 17 00:00:00 2001 From: vchikalkin Date: Mon, 17 Apr 2023 13:39:06 +0300 Subject: [PATCH] fix radioCalcType --- apps/web/config/default-options.ts | 4 ++++ apps/web/process/configurator/reactions/filters.ts | 9 +++++++-- 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/apps/web/config/default-options.ts b/apps/web/config/default-options.ts index 1f383dc..15f6026 100644 --- a/apps/web/config/default-options.ts +++ b/apps/web/config/default-options.ts @@ -193,6 +193,10 @@ export const radioCalcType = [ label: 'Суммы', value: 100_000_001, }, + { + label: 'PI', + value: 100_000_099, + }, ]; export const selectRequirementTelematic = [ diff --git a/apps/web/process/configurator/reactions/filters.ts b/apps/web/process/configurator/reactions/filters.ts index ad567ee..5b708d9 100644 --- a/apps/web/process/configurator/reactions/filters.ts +++ b/apps/web/process/configurator/reactions/filters.ts @@ -302,8 +302,10 @@ export default function reactions({ store, apolloClient, user }: ProcessContext) reaction( () => $calculation.element('selectProduct').getValue(), async (productId) => { + const IRRCalcTypeOptions = radioCalcType.filter((x) => x.value === 100_000_000); + if (!productId) { - $calculation.element('radioCalcType').resetOptions(); + $calculation.element('radioCalcType').setOptions(IRRCalcTypeOptions); return; } @@ -323,8 +325,11 @@ export default function reactions({ store, apolloClient, user }: ProcessContext) ); $calculation.element('radioCalcType').setOptions(filteredCalcTypeOptions); } else { - $calculation.element('radioCalcType').resetOptions(); + $calculation.element('radioCalcType').setOptions(IRRCalcTypeOptions); } + }, + { + fireImmediately: true, } );