updates for graphic changes, manager
This commit is contained in:
parent
09f904a44b
commit
dc6f9ce052
@ -68,7 +68,7 @@ class Manager extends React.Component
|
||||
<div className="info">
|
||||
<a href={ `mailto:${ company.manager_email }` }>{ company.manager_email }</a>
|
||||
{ company.manager_mobilephone !== undefined && company.manager_mobilephone !== null && company.manager_mobilephone !== "" && (
|
||||
<a href={ `tel:+${ company.manager_mobilephone.replace('/[^\d]/m', '') }` }>{ company.manager_mobilephone }</a>
|
||||
<a href={ `tel:+${ company.manager_mobilephone.replace(/[^\d]/mg, '') }` }>{ company.manager_mobilephone }</a>
|
||||
) }
|
||||
{ company.manager_telegram !== undefined && company.manager_telegram !== null && company.manager_telegram !== "" && (
|
||||
<a href={ `https://telegram.me/${ company.manager_telegram.replace("@", "") }` } target="_blank">{ `@${ company.manager_telegram.replace("@", "")}` }</a>
|
||||
|
||||
@ -50,7 +50,7 @@ export default class CalculationsList extends React.Component
|
||||
dots: false,
|
||||
infinite: false,
|
||||
speed: 500,
|
||||
slidesToShow: 2.5,
|
||||
slidesToShow: 2.3,
|
||||
slidesToScroll: 1,
|
||||
centerMode: false,
|
||||
variableWidth: false,
|
||||
|
||||
@ -291,7 +291,7 @@ class SumSelector extends React.Component
|
||||
const { onOption } = this.props;
|
||||
const { min, max } = this.state;
|
||||
|
||||
const value = parseFloat(event.target.value.replace('/[^\d]/m', ''));
|
||||
const value = parseFloat(event.target.value.replace(/[^\d]/mg, ''));
|
||||
if(value >= min && value <= max && !isNaN(value))
|
||||
{
|
||||
this.setState({ value: value }, () =>
|
||||
@ -380,7 +380,7 @@ class InsurancePriceSelector extends React.Component
|
||||
//}
|
||||
//else
|
||||
//{
|
||||
const value = parseFloat(event.target.value.replace('/[^\d]/m', ''));
|
||||
const value = parseFloat(event.target.value.replace(/[^\d]/mg, ''));
|
||||
if(value >= min && value <= max && !isNaN(value))
|
||||
{
|
||||
this.setState({ value: value }, () =>
|
||||
|
||||
@ -191,7 +191,9 @@ class ContractPage extends React.Component
|
||||
</div>
|
||||
</div>
|
||||
) }
|
||||
<button className="button button-blue" onClick={ () => this._handle_onRequest(question.id) }>Создать обращение</button>
|
||||
{ question.request && (
|
||||
<button className="button button-blue" onClick={ () => this._handle_onRequest(question.id) }>Создать обращение</button>
|
||||
) }
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@ -113,6 +113,7 @@ class SupportRequestPage extends React.Component
|
||||
loading: false,
|
||||
contracts: null,
|
||||
themes: null,
|
||||
themes_filtered: null,
|
||||
name: "",
|
||||
phone: "",
|
||||
email: "",
|
||||
@ -169,7 +170,26 @@ class SupportRequestPage extends React.Component
|
||||
opened_theme++;
|
||||
}
|
||||
|
||||
this.setState({ loading: false, opened_theme: found ? opened_theme : 0, opened_question: found ? opened_question : 0 });
|
||||
let themes_filtered = [];
|
||||
for(let t in this.state.themes)
|
||||
{
|
||||
let questions = [];
|
||||
|
||||
for(let q in this.state.themes[t].questions)
|
||||
{
|
||||
if(this.state.themes[t].questions[q].request)
|
||||
{
|
||||
questions.push(this.state.themes[t].questions[q]);
|
||||
}
|
||||
}
|
||||
|
||||
if(questions.length > 0)
|
||||
{
|
||||
themes_filtered.push({ ...this.state.themes[t], ...{ questions } });
|
||||
}
|
||||
}
|
||||
|
||||
this.setState({ loading: false, themes_filtered, opened_theme: found ? opened_theme : 0, opened_question: found ? opened_question : 0 });
|
||||
})
|
||||
.catch(() => {});
|
||||
});
|
||||
@ -301,7 +321,7 @@ class SupportRequestPage extends React.Component
|
||||
|
||||
_renderForm = () =>
|
||||
{
|
||||
const { loading, contracts, themes, name, phone, email, question, file, files, opened_theme, opened_question } = this.state;
|
||||
const { loading, contracts, themes, themes_filtered, name, phone, email, question, file, files, opened_theme, opened_question } = this.state;
|
||||
|
||||
const contracts_list = [];
|
||||
for(let i in contracts)
|
||||
@ -346,9 +366,11 @@ class SupportRequestPage extends React.Component
|
||||
render()
|
||||
{
|
||||
const { number } = this.props;
|
||||
const { loading, success, themes, opened_theme, opened_question } = this.state;
|
||||
const { loading, success, themes, themes_filtered, opened_theme, opened_question } = this.state;
|
||||
|
||||
const procedure = themes !== undefined && themes !== null ? themes[opened_theme].questions[opened_question] : undefined;
|
||||
const procedure = themes_filtered !== undefined && themes_filtered !== null ? themes_filtered[ opened_theme ].questions[ opened_question ] : undefined;
|
||||
|
||||
console.log("themes_filtered", themes_filtered);
|
||||
|
||||
return (
|
||||
<React.Fragment>
|
||||
@ -379,9 +401,9 @@ class SupportRequestPage extends React.Component
|
||||
<div className="new_appeal">
|
||||
<div className="column">
|
||||
<div className="dropdown_blocks_list appeal_list visible">
|
||||
{ themes !== undefined && themes !== null && themes.map((theme, theme_index) =>
|
||||
{ themes_filtered !== undefined && themes_filtered !== null && themes_filtered.map((theme, theme_index) =>
|
||||
(
|
||||
<React.Fragment key={ `theme_${ theme_index }` } >
|
||||
<React.Fragment key={ `theme_${ theme_index }` }>
|
||||
<div className={ `appeal_item dropdown_block ${ theme_index === opened_theme && "open" }` } style={ theme_index === opened_theme ? { backgroundColor: "unset"} : {} } onClick={ () => this._handle_onChangeTheme(theme_index) }>
|
||||
<div className="block_header">
|
||||
<p style={{ fontWeight: "bold" }}>{ theme.name }</p>
|
||||
@ -400,7 +422,7 @@ class SupportRequestPage extends React.Component
|
||||
)) }
|
||||
</div>
|
||||
</div>
|
||||
{ themes !== undefined && themes !== null && (
|
||||
{ themes_filtered !== undefined && themes_filtered !== null && (
|
||||
<div className="column">
|
||||
<div className="column_text_block">
|
||||
<p><b>Процедура</b></p>
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user