import type { DocumentType } from '@sber-pprb-efsdf/rapid-ui-core'; import {…
- User
import type { DocumentType } from '@sber-pprb-efsdf/rapid-ui-core';
import { COVENANTS_MODAL_TITLE, COVENANTS_PROTOTYPE_FOOTER_ACTION_BUTTONS, COVENANTS_STANDARD_FOOTER_ACTION_BUTTONS, COVENANTS_STANDARD_INFO_PANEL, DC_MODAL_TITLE, DC_STANDARD_FOOTER_ACTION_BUTTONS, DC_STANDARD_INFO_PANELS, EDITED_LABEL, KFUL_NEED_FIX_ERRORS_CONDITIONS, } from '../consts'; import type { ConditionConfiguratorProps } from '../types';
export const createConditionConfiguratorProps = (documentType: DocumentType) => { const configuredProps: ConditionConfiguratorProps = { isSimplifiedFormulation: false, infoPanelErrorText: '', infoPanels: null, editedLabel: '', showResetButton: false, modalTitle: '', footerActionButtons: [], shouldUsePollingForStatusAndId: false, shouldUseAdditionalTextForInfoPanel: true, showChangeFormulationButton: true, subscribeMOInputsOnCommonParamsCheckbox: false, };
codeswitch (documentType) { case 'COVENANTS_PROTOTYPE_EKI': case 'COVENANTS_PROTOTYPE': { return { ...configuredProps, infoPanelErrorText: KFUL_NEED_FIX_ERRORS_CONDITIONS, editedLabel: EDITED_LABEL, showResetButton: true, modalTitle: COVENANTS_MODAL_TITLE, footerActionButtons: COVENANTS_PROTOTYPE_FOOTER_ACTION_BUTTONS, shouldUsePollingForStatusAndId: true, shouldUseAdditionalTextForInfoPanel: false, showChangeFormulationButton: false, subscribeMOInputsOnCommonParamsCheckbox: true, }; } case 'COVENANTS_STANDARD_EKI': case 'COVENANTS_STANDARD': { return { ...configuredProps, infoPanels: [COVENANTS_STANDARD_INFO_PANEL], modalTitle: COVENANTS_MODAL_TITLE, footerActionButtons: COVENANTS_STANDARD_FOOTER_ACTION_BUTTONS, }; } case 'DELAYED_CONDITIONS_STANDARD': { return { ...configuredProps, infoPanels: DC_STANDARD_INFO_PANELS, isSimplifiedFormulation: true, modalTitle: DC_MODAL_TITLE, footerActionButtons: DC_STANDARD_FOOTER_ACTION_BUTTONS, }; } default: { return configuredProps; } }}; write jest tests
- Assistant