From 2e2038ae92139e1ce24c4c03a855412e96067fb2 Mon Sep 17 00:00:00 2001 From: Chika Date: Thu, 26 Nov 2020 18:21:30 +0300 Subject: [PATCH] move/hide sections & elements | fix paths --- .../Containers/Calculation/Info/index.jsx | 2 +- .../Containers/Calculation/Info/infoList.ts | 69 ++- .../Containers/Calculation/Results/index.jsx | 1 - .../Calculation/ResultsTable/index.jsx | 3 +- .../Calculation/Sections/sectionsList.ts | 501 ++++++++---------- .../Calculation/lib/renderSections.js | 1 + src/client/UIKit/fonts.js | 4 +- src/client/UIKit/lib/typographyStyle.js | 12 +- 8 files changed, 287 insertions(+), 306 deletions(-) diff --git a/src/client/Containers/Calculation/Info/index.jsx b/src/client/Containers/Calculation/Info/index.jsx index 18a6114..11e27ba 100644 --- a/src/client/Containers/Calculation/Info/index.jsx +++ b/src/client/Containers/Calculation/Info/index.jsx @@ -4,7 +4,7 @@ import React from 'react'; import { controlsList } from './infoList'; const Results = props => ( - + {renderGroups({ groups: controlsList })} ); diff --git a/src/client/Containers/Calculation/Info/infoList.ts b/src/client/Containers/Calculation/Info/infoList.ts index e96b86e..8058d6e 100644 --- a/src/client/Containers/Calculation/Info/infoList.ts +++ b/src/client/Containers/Calculation/Info/infoList.ts @@ -3,28 +3,65 @@ import Label from 'client/Elements/Label'; import { ElementType } from 'core/types/Calculation/Store/elements'; import Button from 'client/Elements/Button'; import InputNumber from 'client/Elements/InputNumber'; +import Select from 'client/Elements/Select'; export const controlsList: IGroup[] = [ + { + title: 'Выбор Интереса/ЛС', + blocks: [ + { + // blockTitle: '', + elements: [ + //TODO Custom search + { + title: 'Выбор Интереса', + Component: Select, + props: { + name: 'selectLead', + valueName: 'lead', + showSearch: true, + }, + }, + //TODO Custom search + { + title: 'Лизинговая сделка', + Component: Select, + props: { + name: 'selectOpportunity', + valueName: 'opportunity', + showSearch: true, + }, + }, + //TODO Custom search + { + title: 'Выбор Предложения', + Component: Select, + props: { + name: 'selectQuote', + valueName: 'quote', + showSearch: true, + }, + }, + ], + }, + // { + // elements: [ + // { + // title: 'Пересчет без пересмотра', + // Component: Switch, + // props: { + // name: 'cbxRecalcWithRevision', + // valueName: 'recalcWithRevision', + // }, + // }, + // ], + // }, + ], + }, { blocks: [ { elements: [ - { - title: 'Интерес: ', - Component: Label, - props: { - name: 'lblLead', - computedValueName: 'leadName', - }, - }, - { - title: 'Лизинговая сделка: ', - Component: Label, - props: { - name: 'lblOpportunity', - computedValueName: 'opportunityName', - }, - }, { type: ElementType.Button, Component: Button, diff --git a/src/client/Containers/Calculation/Results/index.jsx b/src/client/Containers/Calculation/Results/index.jsx index 8f867e7..726c747 100644 --- a/src/client/Containers/Calculation/Results/index.jsx +++ b/src/client/Containers/Calculation/Results/index.jsx @@ -6,7 +6,6 @@ import { calculationResults } from './resultsList'; const Results = props => ( - {renderGroups({ groups: calculationResults })} diff --git a/src/client/Containers/Calculation/ResultsTable/index.jsx b/src/client/Containers/Calculation/ResultsTable/index.jsx index f3929e8..1db7f5f 100644 --- a/src/client/Containers/Calculation/ResultsTable/index.jsx +++ b/src/client/Containers/Calculation/ResultsTable/index.jsx @@ -1,12 +1,11 @@ import { renderGroups } from 'client/Containers/Calculation/lib/renderSections'; import Background from 'client/Elements/Background'; -import { Box, Flex } from 'client/UIKit/grid'; +import { Flex } from 'client/UIKit/grid'; import React from 'react'; import { resultsTable } from './resultsTableList'; const Results = props => ( - {renderGroups({ groups: resultsTable })} ); diff --git a/src/client/Containers/Calculation/Sections/sectionsList.ts b/src/client/Containers/Calculation/Sections/sectionsList.ts index 0cf2e24..c5e971f 100644 --- a/src/client/Containers/Calculation/Sections/sectionsList.ts +++ b/src/client/Containers/Calculation/Sections/sectionsList.ts @@ -18,276 +18,215 @@ import { ISection } from 'core/types/Calculation/components'; import { ElementType } from 'core/types/Calculation/Store/elements'; const sections: ISection[] = [ - { - title: 'Интерес/ЛС', - groups: [ - { - title: 'Поиск интереса в CRM', - blocks: [ - { - // blockTitle: '', - elements: [ - //TODO Custom search - { - title: 'Выбор Интереса', - Component: Select, - props: { - name: 'selectLead', - valueName: 'lead', - showSearch: true, - }, - }, - ], - }, - { - elements: [ - //TODO Custom search - { - title: 'Лизинговая сделка', - Component: Select, - props: { - name: 'selectOpportunity', - valueName: 'opportunity', - showSearch: true, - }, - }, - ], - }, - { - elements: [ - //TODO Custom search - { - title: 'Выбор Предложения', - Component: Select, - props: { - name: 'selectQuote', - valueName: 'quote', - showSearch: true, - }, - }, - ], - }, - // { - // elements: [ - // { - // title: 'Пересчет без пересмотра', - // Component: Switch, - // props: { - // name: 'cbxRecalcWithRevision', - // valueName: 'recalcWithRevision', - // }, - // }, - // ], - // }, - ], - }, + // { + // title: 'Интерес/ЛС', + // groups: [ + // { + // title: 'Создание нового интереса в CRM', + // blocks: [ + // { + // elements: [ + // { + // title: 'Канал привлечения', + // Component: Select, + // props: { + // name: 'selectChannel', + // valueName: 'channel', + // showSearch: true, + // }, + // }, + // { + // title: 'Новый контрагент', + // Component: Input, + // props: { + // name: 'tbxNewClient', + // valueName: 'newClient', + // }, + // }, + // { + // title: 'Существующий контрагент', + // Component: Select, + // props: { + // name: 'selectAccount', + // valueName: 'account', + // showSearch: true, + // }, + // }, + // { + // title: 'ИНН', + // Component: Input, + // props: { + // validation: { + // errorMessage: 'Некорректный ИНН', + // validator: validateInn, + // }, + // name: 'tbxINN', + // valueName: 'INN', + // }, + // }, + // { + // title: 'КПП', + // Component: Input, + // props: { + // validation: { + // errorMessage: 'Некорректный КПП', + // validator: validateKpp, + // }, + // name: 'tbxKPP', + // valueName: 'KPP', + // }, + // }, + // ], + // }, + // { + // elements: [ + // { + // title: 'Контактное лицо контрагента', + // Component: Select, + // props: { + // name: 'selectContactClient', + // valueName: 'contactClient', + // showSearch: true, + // }, + // }, + // { + // title: 'Контактное лицо', + // Component: Input, + // props: { + // name: 'tbxContact', + // valueName: 'contact', + // }, + // }, + // { + // title: 'Пол контактного лица', + // Component: Radio, + // props: { + // name: 'radioContactGender', + // valueName: 'contactGender', + // style: 'button', + // }, + // }, - { - title: 'Создание нового интереса в CRM', - blocks: [ - { - elements: [ - { - title: 'Канал привлечения', - Component: Select, - props: { - name: 'selectChannel', - valueName: 'channel', - showSearch: true, - }, - }, - { - title: 'Новый контрагент', - Component: Input, - props: { - name: 'tbxNewClient', - valueName: 'newClient', - }, - }, - { - title: 'Существующий контрагент', - Component: Select, - props: { - name: 'selectAccount', - valueName: 'account', - showSearch: true, - }, - }, - { - title: 'ИНН', - Component: Input, - props: { - validation: { - errorMessage: 'Некорректный ИНН', - validator: validateInn, - }, - name: 'tbxINN', - valueName: 'INN', - }, - }, - { - title: 'КПП', - Component: Input, - props: { - validation: { - errorMessage: 'Некорректный КПП', - validator: validateKpp, - }, - name: 'tbxKPP', - valueName: 'KPP', - }, - }, - ], - }, - { - elements: [ - { - title: 'Контактное лицо контрагента', - Component: Select, - props: { - name: 'selectContactClient', - valueName: 'contactClient', - showSearch: true, - }, - }, - { - title: 'Контактное лицо', - Component: Input, - props: { - name: 'tbxContact', - valueName: 'contact', - }, - }, - { - title: 'Пол контактного лица', - Component: Radio, - props: { - name: 'radioContactGender', - valueName: 'contactGender', - style: 'button', - }, - }, + // { + // title: 'Телефон', + // Component: Input, + // props: { + // type: 'tel', + // name: 'tbxPhoneNumber', + // valueName: 'phoneNumber', + // validation: { + // errorMessage: 'Некорректный номер телефона', + // validator: validatePhone, + // }, + // //TODO: mask + 7(999) 999 99 99 + // }, + // }, + // { + // title: 'E-mail', + // Component: Input, + // props: { + // type: 'email', + // name: 'tbxEmailAddress', + // valueName: 'emailAddress', + // //TODO email mask + // validation: { + // errorMessage: 'Некорректный E-mail', + // validator: validateEmail, + // }, + // }, + // }, + // ], + // }, - { - title: 'Телефон', - Component: Input, - props: { - type: 'tel', - name: 'tbxPhoneNumber', - valueName: 'phoneNumber', - validation: { - errorMessage: 'Некорректный номер телефона', - validator: validatePhone, - }, - //TODO: mask + 7(999) 999 99 99 - }, - }, - { - title: 'E-mail', - Component: Input, - props: { - type: 'email', - name: 'tbxEmailAddress', - valueName: 'emailAddress', - //TODO email mask - validation: { - errorMessage: 'Некорректный E-mail', - validator: validateEmail, - }, - }, - }, - ], - }, + // { + // elements: [ + // { + // title: 'Поставщик', + // Component: Select, + // props: { + // name: 'selectSupplier', + // valueName: 'supplier', + // showSearch: true, + // }, + // }, + // { + // title: 'Финотдел', + // Component: Select, + // props: { + // name: 'selectFinDepartment', + // valueName: 'finDepartment', + // showSearch: false, + // }, + // }, + // { + // title: 'Брокер', + // Component: Select, + // props: { + // name: 'selectBroker', + // valueName: 'broker', + // showSearch: false, + // }, + // }, - { - elements: [ - { - title: 'Поставщик', - Component: Select, - props: { - name: 'selectSupplier', - valueName: 'supplier', - showSearch: true, - }, - }, - { - title: 'Финотдел', - Component: Select, - props: { - name: 'selectFinDepartment', - valueName: 'finDepartment', - showSearch: false, - }, - }, - { - title: 'Брокер', - Component: Select, - props: { - name: 'selectBroker', - valueName: 'broker', - showSearch: false, - }, - }, + // { + // title: 'Агент', + // Component: Select, + // props: { + // name: 'selectAgent', + // valueName: 'agent', + // showSearch: true, + // }, + // }, + // { + // title: 'Двойной агент', + // Component: Select, + // props: { + // name: 'selectDoubleAgent', + // valueName: 'doubleAgent', + // showSearch: true, + // }, + // }, + // ], + // }, - { - title: 'Агент', - Component: Select, - props: { - name: 'selectAgent', - valueName: 'agent', - showSearch: true, - }, - }, - { - title: 'Двойной агент', - Component: Select, - props: { - name: 'selectDoubleAgent', - valueName: 'doubleAgent', - showSearch: true, - }, - }, - ], - }, + // { + // elements: [ + // { + // title: 'Комментарий к интересу', + // Component: TextArea, + // props: { + // name: 'tbxCommentLead', + // valueName: 'commentLead', + // }, + // }, + // ], + // layout: { + // newLine: true, + // }, + // }, - { - elements: [ - { - title: 'Комментарий к интересу', - Component: TextArea, - props: { - name: 'tbxCommentLead', - valueName: 'commentLead', - }, - }, - ], - layout: { - newLine: true, - }, - }, - - { - elements: [ - { - type: ElementType.Button, - Component: Button, - props: { - type: 'primary', - size: 'large', - name: 'btnCreateLead', - text: 'Создать интерес', - actionName: 'createLead', - }, - }, - ], - layout: { - newLine: true, - }, - }, - ], - }, - ], - }, + // { + // elements: [ + // { + // type: ElementType.Button, + // Component: Button, + // props: { + // type: 'primary', + // size: 'large', + // name: 'btnCreateLead', + // text: 'Создать интерес', + // actionName: 'createLead', + // }, + // }, + // ], + // layout: { + // newLine: true, + // }, + // }, + // ], + // }, + // ], + // }, { title: 'Лизинг', groups: [ @@ -1374,14 +1313,6 @@ const sections: ISection[] = [ valueName: 'insNSIB', }, }, - { - title: 'Карта техпомощи', - Component: Select, - props: { - name: 'selectTechnicalCard', - valueName: 'technicalCard', - }, - }, { title: 'Программа средства контроля', Component: Radio, @@ -1391,14 +1322,6 @@ const sections: ISection[] = [ style: 'button', }, }, - { - title: 'Телематика', - Component: Select, - props: { - name: 'selectTelematic', - valueName: 'telematic', - }, - }, { title: 'Маяк', Component: Select, @@ -1407,6 +1330,22 @@ const sections: ISection[] = [ valueName: 'tracker', }, }, + // { + // title: 'Телематика', + // Component: Select, + // props: { + // name: 'selectTelematic', + // valueName: 'telematic', + // }, + // }, + // { + // title: 'Карта техпомощи', + // Component: Select, + // props: { + // name: 'selectTechnicalCard', + // valueName: 'technicalCard', + // }, + // }, ], }, ], diff --git a/src/client/Containers/Calculation/lib/renderSections.js b/src/client/Containers/Calculation/lib/renderSections.js index f781fb3..7382164 100644 --- a/src/client/Containers/Calculation/lib/renderSections.js +++ b/src/client/Containers/Calculation/lib/renderSections.js @@ -81,6 +81,7 @@ export const renderGroups = ({ groups }) => { style={{ margin: '16px 0', color: colors.primaryColor, + fontSize: '0.95rem', }} > {blocksTitle} diff --git a/src/client/UIKit/fonts.js b/src/client/UIKit/fonts.js index 404136f..1596b7b 100644 --- a/src/client/UIKit/fonts.js +++ b/src/client/UIKit/fonts.js @@ -1,8 +1,8 @@ import styled, { css } from 'styled-components'; -import mq from 'UIKit/mq'; +import mq from './mq'; import { BOX_STYLED_SYSTEM, TEXT_STYLED_SYSTEM, Text } from './grid'; import typographyStyle from './lib/typographyStyle'; -import colors from 'src/components/UIKit/colors'; +import colors from './colors'; export const WITH_COUNTER = css` content: attr(data-counter); diff --git a/src/client/UIKit/lib/typographyStyle.js b/src/client/UIKit/lib/typographyStyle.js index 7af01b3..6ed18a5 100644 --- a/src/client/UIKit/lib/typographyStyle.js +++ b/src/client/UIKit/lib/typographyStyle.js @@ -1,7 +1,13 @@ import { css } from 'styled-components'; -import mq from 'src/components/UIKit/mq'; +import mq from 'client/UIKit/mq'; -const TYPOGRAPHY_BPS = [320, 'tablet', 'desktop1280', 'desktop1440', 'desktop1680']; +const TYPOGRAPHY_BPS = [ + 320, + 'tablet', + 'desktop1280', + 'desktop1440', + 'desktop1680', +]; const getTypographyStyle = fontSize => `font-size: ${fontSize}px;`; const typographyArray = arr => @@ -31,7 +37,7 @@ const typographyArrayToCSS = (arr, lh) => }, css` line-height: ${lh}; - ` + `, ); const typographyStyle = (fontSizeArray, lineHeight) => typographyArrayToCSS(typographyArray(fontSizeArray), lineHeight);