Merge branch 'master' of https://github.com/merelendor/evoleasing-account
Conflicts: css/main/style.css
This commit is contained in:
commit
7fb1b5d2a5
@ -41,30 +41,30 @@ export const sendInvite = ({ name, email, companies }) =>
|
||||
{
|
||||
console.log("ACTION", "sendInvite()", "response.data", response.data);
|
||||
|
||||
resolve();
|
||||
resolve(response.data);
|
||||
})
|
||||
.catch((error) =>
|
||||
{
|
||||
console.error("ACTION", "sendInvite()", "error");
|
||||
console.error(error);
|
||||
console.log("error.response.data", error.response.data);
|
||||
|
||||
reject();
|
||||
reject(error.response.data);
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
export const removeUser = ({ email }) =>
|
||||
export const removeUser = ({ account, emails }) =>
|
||||
{
|
||||
console.log("ACTION", "removeUser()", { name, email, companies });
|
||||
console.log("ACTION", "removeUser()", { account, emails });
|
||||
|
||||
return new Promise((resolve, reject) =>
|
||||
{
|
||||
axios.post(`${ process.env.NEXT_PUBLIC_SELF_API_HOST }/api/admin/remove`, { name, email, companies })
|
||||
axios.post(`${ process.env.NEXT_PUBLIC_SELF_API_HOST }/api/admin/remove`, { account, emails })
|
||||
.then(async (response) =>
|
||||
{
|
||||
console.log("ACTION", "removeUser()", "response.data", response.data);
|
||||
|
||||
resolve();
|
||||
resolve(response.data);
|
||||
})
|
||||
.catch((error) =>
|
||||
{
|
||||
|
||||
@ -217,30 +217,6 @@ export const sendOffstageToken = ({ token, dispatch }) =>
|
||||
});
|
||||
}
|
||||
|
||||
export const getUsers = ({ dispatch }) =>
|
||||
{
|
||||
console.log("ACTION", "getUsers()");
|
||||
|
||||
return new Promise((resolve, reject) =>
|
||||
{
|
||||
axios.post(`${ process.env.NEXT_PUBLIC_SELF_API_HOST }/api/admin/`, {})
|
||||
.then(async (response) =>
|
||||
{
|
||||
console.log("getContractRules", "response.data", response.data);
|
||||
dispatch({ type: actionTypes.ADMIN, data: { users: response.data.users } });
|
||||
|
||||
resolve();
|
||||
})
|
||||
.catch((error) =>
|
||||
{
|
||||
console.error("ACTION", "getUsers()", "error");
|
||||
console.error(error);
|
||||
|
||||
reject();
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
export const sendSwitchAccount = ({ dispatch, acc_number }) =>
|
||||
{
|
||||
console.log("ACTION", "sendSwitchAccount()", `${ process.env.NEXT_PUBLIC_SELF_API_HOST }/api/auth/switch/`);
|
||||
|
||||
@ -9,4 +9,5 @@ export * from './formsActions';
|
||||
export * from './settingsActions';
|
||||
export * from './announcementsActions';
|
||||
export * from './eventsActions';
|
||||
export * from './supportActions';
|
||||
export * from './supportActions';
|
||||
export * from './adminActions';
|
||||
@ -3456,16 +3456,32 @@ main #order .container {
|
||||
font-weight: 700;
|
||||
margin-right: 50px;
|
||||
}
|
||||
@media all and (max-width: 1279px) {
|
||||
.calendar_payment .day {
|
||||
font-size: 13px;
|
||||
line-height: 20px;
|
||||
}
|
||||
}
|
||||
.calendar_payment .day span {
|
||||
display: block;
|
||||
font-size: 50px;
|
||||
line-height: 1;
|
||||
color: #000;
|
||||
}
|
||||
@media all and (max-width: 1279px) {
|
||||
.calendar_payment .day span {
|
||||
font-size: 22px;
|
||||
}
|
||||
}
|
||||
.calendar_payment .payment_table {
|
||||
display: table;
|
||||
margin-top: 12px;
|
||||
}
|
||||
@media all and (max-width: 1279px) {
|
||||
.calendar_payment .payment_table {
|
||||
margin-top: 0;
|
||||
}
|
||||
}
|
||||
.calendar_payment .payment_table .table_row {
|
||||
display: table-row;
|
||||
}
|
||||
@ -3476,10 +3492,20 @@ main #order .container {
|
||||
.calendar_payment .payment_table .table_row .table_cell a {
|
||||
font-weight: 700;
|
||||
}
|
||||
@media all and (max-width: 1279px) {
|
||||
.calendar_payment .payment_table .table_row .table_cell {
|
||||
font-size: 13px;
|
||||
}
|
||||
}
|
||||
.calendar_payment .payment_table .table_row.table_header .table_cell {
|
||||
color: #87878E;
|
||||
padding: 12px 10px;
|
||||
}
|
||||
@media all and (max-width: 1279px) {
|
||||
.calendar_payment .payment_table .table_row.table_header .table_cell {
|
||||
padding: 0 10px 12px 10px;
|
||||
}
|
||||
}
|
||||
@media all and (max-width: 768px) {
|
||||
.calendar_payment {
|
||||
display: block;
|
||||
@ -4019,13 +4045,14 @@ main .dropdown_blocks_list .dropdown_block .block_body .fines_detail ul li {
|
||||
.help_tooltip .help_content {
|
||||
display: none;
|
||||
position: absolute;
|
||||
bottom: -50%;
|
||||
top: -25px;
|
||||
margin: auto;
|
||||
left: 55px;
|
||||
width: 412px;
|
||||
background: #FFFFFF;
|
||||
padding: 17px;
|
||||
box-shadow: 0px 4px 32px rgba(0, 0, 0, 0.16);
|
||||
z-index: 2;
|
||||
}
|
||||
.help_tooltip .help_content.opened {
|
||||
display: block;
|
||||
@ -4042,8 +4069,7 @@ main .dropdown_blocks_list .dropdown_block .block_body .fines_detail ul li {
|
||||
border-right: 24px solid #fff;
|
||||
border-bottom: 12px solid transparent;
|
||||
position: absolute;
|
||||
top: 0;
|
||||
bottom: 0;
|
||||
top: 24px;
|
||||
margin: auto;
|
||||
left: -24px;
|
||||
}
|
||||
|
||||
File diff suppressed because one or more lines are too long
@ -3858,12 +3858,21 @@ main {
|
||||
font-weight: 700;
|
||||
margin-right: 50px;
|
||||
|
||||
@media all and (max-width: 1279px) {
|
||||
font-size: 13px;
|
||||
line-height: 20px;
|
||||
}
|
||||
|
||||
span {
|
||||
display: block;
|
||||
|
||||
font-size: 50px;
|
||||
line-height: 1;
|
||||
color: #000;
|
||||
|
||||
@media all and (max-width: 1279px) {
|
||||
font-size: 22px;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -3871,6 +3880,10 @@ main {
|
||||
display: table;
|
||||
margin-top: 12px;
|
||||
|
||||
@media all and (max-width: 1279px) {
|
||||
margin-top: 0;
|
||||
}
|
||||
|
||||
.table_row {
|
||||
display: table-row;
|
||||
|
||||
@ -3881,6 +3894,10 @@ main {
|
||||
a {
|
||||
font-weight: 700;
|
||||
}
|
||||
|
||||
@media all and (max-width: 1279px) {
|
||||
font-size: 13px;
|
||||
}
|
||||
}
|
||||
|
||||
&.table_header {
|
||||
@ -3888,6 +3905,10 @@ main {
|
||||
.table_cell {
|
||||
color: #87878E;
|
||||
padding: 12px 10px;
|
||||
|
||||
@media all and (max-width: 1279px) {
|
||||
padding: 0 10px 12px 10px;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -4526,14 +4547,15 @@ main .dropdown_blocks_list .dropdown_block .block_body {
|
||||
.help_content {
|
||||
display: none;
|
||||
position: absolute;
|
||||
bottom: -50%;
|
||||
top: -25px;
|
||||
margin: auto;
|
||||
left: 55px;
|
||||
width: 412px;
|
||||
background: #FFFFFF;
|
||||
padding: 17px;
|
||||
box-shadow: 0px 4px 32px rgba(0, 0, 0, 0.16);
|
||||
|
||||
z-index: 2;
|
||||
|
||||
&.opened {
|
||||
display: block;
|
||||
}
|
||||
@ -4551,8 +4573,7 @@ main .dropdown_blocks_list .dropdown_block .block_body {
|
||||
border-right: 24px solid #fff;
|
||||
border-bottom: 12px solid transparent;
|
||||
position: absolute;
|
||||
top: 0;
|
||||
bottom: 0;
|
||||
top: 24px;
|
||||
margin: auto;
|
||||
left: -24px;
|
||||
}
|
||||
|
||||
File diff suppressed because one or more lines are too long
@ -1 +1 @@
|
||||
{"version":3,"sources":["var.less"],"names":[],"mappings":"AAAA,MACE,cAAA,CACA,wBAAA,CACA,cAAA,CACA,+BAAA,CACA,iBAAA,CACA,kCAAA,CACA,aAAA,CACA,kBAAA,CACA,eAAA,CACA,0BAgBF,KACE,cAAA,CACA,gBAAA,CACA,aAAA,CACA,YAAa,uBAAb,CACA,eAAA,CACA,iBAAA,CACA,WAEA,gBAAmC,uBAAwB,kBAA3D,KACE,cAAA,CACA,kBAGF,gBAAkC,iBAAlC,KACE,cAAA,CACA,kBAIJ,UACE,gBAGF,WACE,gBAAA,CACA,UAAA,CACA,gBAAA,CACA,WAAA,CACA,iBAAA,CACA,oBAAA,CACE,mBAEF,UAAC,OACC,QAAS,EAAT,CACA,aAAA,CACA,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ACE,MAAO,WAGT,gBAAkC,iBAChC,oBACE,cAIJ,OACC,YAAA,CACA,0BAAA,CACC,mBAHF,MAKC,GACC,eAAA,CACE,cAAA,CACA,gBAAA,CACA,UAAA,CACF,mBAEA,gBAAmC,kBAAnC,MAPD,GAQE,cAAA,CACA,qBAID,gBAAmC,kBAAnC,OACE,mBADF,MAGE,GACE,cAAA,CACA,kBAKN,sBACC,gBAAA,CACA,0BAEA,gBAAkC,iBAAlC,sBACC,yBAAA,CACA,kBAGD,QAA2B,uBAAwB,kBAAnD,sBACC,yBAAA,CACA,kBAIF,aACC,eAGD,cACC,gBAAA,CACA,qBAAA,CACA,wBAAA,CACA"}
|
||||
{"version":3,"sources":["var.less"],"names":[],"mappings":"AAAA,MACE,cAAA,CACA,wBAAA,CACA,cAAA,CACA,+BAAA,CACA,iBAAA,CACA,kCAAA,CACA,aAAA,CACA,kBAAA,CACA,eAAA,CACA,0BAgBF,KACE,cAAA,CACA,gBAAA,CACA,aAAA,CACA,YAAa,uBAAb,CACA,eAAA,CACA,iBAAA,CACA,WAEA,gBAAmC,uBAAwB,kBAA3D,KACE,cAAA,CACA,kBAGF,gBAAkC,iBAAlC,KACE,cAAA,CACA,kBAIJ,UACE,gBAEA,gBAAiC,iBAAjC,UACE,gBAKF,gBAAkC,iBAAlC,QACE,iBAIJ,WACE,gBAAA,CACA,UAAA,CACA,gBAAA,CACA,WAAA,CACA,iBAAA,CACA,oBAAA,CACE,mBAEF,UAAC,OACC,QAAS,EAAT,CACA,aAAA,CACA,iBAAA,CACA,KAAA,CACA,MAAA,CACA,UAAA,CACA,QAAA,CACA,WAYF,gBAAmC,uBAAwB,kBAA3D,WACE,kBAGF,gBAAmC,kBAAnC,WACE,kBAGF,gBAAkC,iBAAlC,WACE,gBAAA,CACA,qBAGF,gBAAmC,kBAAnC,WACE,MAAO,kBAAP,CACA,yBAGF,gBAAkC,iBAAlC,WACE,uBAAA,CACA,MAAO,mBAIX,iBACE,YAAA,CACA,6BAAA,CACA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C,yBAAA,CACA,kBAGD,QAA2B,uBAAwB,kBAAnD,sBACC,yBAAA,CACA,kBAIF,aACC,eAGD,cACC,gBAAA,CACA,qBAAA,CACA,wBAAA,CACA"}
|
||||
12
css/var.less
12
css/var.less
@ -46,6 +46,16 @@ body {
|
||||
|
||||
.overflow {
|
||||
overflow: hidden;
|
||||
|
||||
@media all and(max-width: 960px) {
|
||||
overflow: unset;
|
||||
}
|
||||
}
|
||||
|
||||
#__next {
|
||||
@media all and (max-width: 960px) {
|
||||
overflow: hidden;
|
||||
}
|
||||
}
|
||||
|
||||
.container {
|
||||
@ -54,7 +64,7 @@ body {
|
||||
max-width: 1310px;
|
||||
margin: auto;
|
||||
position: relative;
|
||||
padding-bottom: 110px;
|
||||
padding-bottom: 140px;
|
||||
margin-bottom: 40px;
|
||||
|
||||
&:after {
|
||||
|
||||
@ -41,7 +41,7 @@ export default async function handler(req, res)
|
||||
console.error(error);
|
||||
|
||||
res.status(403).json();
|
||||
});
|
||||
});
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
@ -4,9 +4,16 @@ import { Cookies } from 'react-cookie';
|
||||
import cookie from 'cookie';
|
||||
import moment from 'moment';
|
||||
import jwt from 'jsonwebtoken';
|
||||
import { inspect } from 'util';
|
||||
|
||||
import { cors } from '../../../lib/cors';
|
||||
|
||||
const validateEmail = (email) => {
|
||||
return email.match(
|
||||
/^(([^<>()[\]\\.,;:\s@\"]+(\.[^<>()[\]\\.,;:\s@\"]+)*)|(\".+\"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/
|
||||
);
|
||||
};
|
||||
|
||||
export default async function handler(req, res)
|
||||
{
|
||||
await cors(req, res);
|
||||
@ -28,32 +35,53 @@ export default async function handler(req, res)
|
||||
const admin_companies = client_jwt_decoded.companies;
|
||||
const allowed_companies = [];
|
||||
|
||||
if(admin_companies !== undefined && admin_companies !== null)
|
||||
if(validateEmail(email))
|
||||
{
|
||||
if(companies !== undefined && companies !== null)
|
||||
if(admin_companies !== undefined && admin_companies !== null)
|
||||
{
|
||||
for(let c in companies)
|
||||
if(companies !== undefined && companies !== null)
|
||||
{
|
||||
for(let ac in admin_companies)
|
||||
for(let c in companies)
|
||||
{
|
||||
if(admin_companies[ac].acc_number === companies[c])
|
||||
for(let ac in admin_companies)
|
||||
{
|
||||
allowed_companies.push(companies[c]);
|
||||
if(admin_companies[ac].acc_number === companies[c])
|
||||
{
|
||||
allowed_companies.push(companies[c]);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if(allowed_companies.length > 0)
|
||||
{
|
||||
const payload = { name, email, companies, };
|
||||
console.log("payload");
|
||||
console.log(payload);
|
||||
if(allowed_companies.length > 0)
|
||||
{
|
||||
const payload = { name, email, companies, };
|
||||
console.log("payload");
|
||||
console.log(payload);
|
||||
|
||||
const crm_jwt = jwt.sign(payload, process.env.JWT_SECRET_CRM, { noTimestamp: true });
|
||||
const crm_jwt_token = jwt.sign(payload, process.env.JWT_SECRET_CRM, { noTimestamp: true });
|
||||
|
||||
res.status(200).send({
|
||||
status: "success",
|
||||
});
|
||||
await axios.post(`${ process.env.NEXT_PUBLIC_API_HOST }/api/admin/invite/`, {
|
||||
token: crm_jwt_token,
|
||||
})
|
||||
.then((api_response) =>
|
||||
{
|
||||
console.log("API", "auth/invite", "RESPONSE");
|
||||
console.log(inspect(api_response.data, true, null, true));
|
||||
|
||||
res.status(200).send(api_response.data);
|
||||
})
|
||||
.catch((error) =>
|
||||
{
|
||||
console.error("API", "auth/invite", "error");
|
||||
console.error(error);
|
||||
|
||||
res.status(403).json();
|
||||
});
|
||||
}
|
||||
else
|
||||
{
|
||||
res.status(403).json();
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
@ -67,7 +95,7 @@ export default async function handler(req, res)
|
||||
}
|
||||
else
|
||||
{
|
||||
res.status(403).json();
|
||||
res.status(400).json({ errors: [ "email" ]});
|
||||
}
|
||||
}
|
||||
else
|
||||
|
||||
@ -4,13 +4,14 @@ import { Cookies } from 'react-cookie';
|
||||
import cookie from 'cookie';
|
||||
import moment from 'moment';
|
||||
import jwt from 'jsonwebtoken';
|
||||
import { inspect } from 'util';
|
||||
|
||||
import { cors } from '../../../lib/cors';
|
||||
|
||||
export default async function handler(req, res)
|
||||
{
|
||||
await cors(req, res);
|
||||
let { email } = req.body;
|
||||
let { emails } = req.body;
|
||||
|
||||
console.log("API", "admin/remove");
|
||||
if(req.headers.cookie !== undefined)
|
||||
@ -19,8 +20,32 @@ export default async function handler(req, res)
|
||||
|
||||
if(cookies.jwt !== undefined && cookies.jwt !== null)
|
||||
{
|
||||
res.status(200).send({
|
||||
status: "success",
|
||||
let client_jwt_decoded = jwt.verify(cookies.jwt, process.env.JWT_SECRET_CLIENT);
|
||||
console.log("API", "admin/remove", "client_jwt_decoded", client_jwt_decoded);
|
||||
|
||||
const payload = {
|
||||
acc_number: client_jwt_decoded.acc_number,
|
||||
emails,
|
||||
};
|
||||
|
||||
const crm_jwt_token = jwt.sign(payload, process.env.JWT_SECRET_CRM, { noTimestamp: true });
|
||||
|
||||
await axios.post(`${ process.env.NEXT_PUBLIC_API_HOST }/api/admin/remove/`, {
|
||||
token: crm_jwt_token,
|
||||
})
|
||||
.then((api_response) =>
|
||||
{
|
||||
console.log("API", "auth/remove", "RESPONSE");
|
||||
console.log(inspect(api_response.data, true, null, true));
|
||||
|
||||
res.status(200).send(api_response.data);
|
||||
})
|
||||
.catch((error) =>
|
||||
{
|
||||
console.error("API", "auth/remove", "error");
|
||||
console.error(error);
|
||||
|
||||
res.status(403).json();
|
||||
});
|
||||
}
|
||||
else
|
||||
|
||||
@ -43,10 +43,11 @@ export default async function handler(req, res)
|
||||
{
|
||||
const new_client_jwt = jwt.sign({
|
||||
acc_number: acc_number,
|
||||
is_admin: company.is_admin,
|
||||
login: client_jwt_decoded.login,
|
||||
companies: client_jwt_decoded.companies,
|
||||
}, process.env.JWT_SECRET_CLIENT, { noTimestamp: true });
|
||||
|
||||
|
||||
res.status(200).send({
|
||||
status: "success",
|
||||
token: new_client_jwt,
|
||||
|
||||
@ -39,17 +39,24 @@ export default class InnerMenu extends React.Component
|
||||
<Link href={`/events`} shallow>
|
||||
<a className={ type === undefined ? "active" : "" }>Все события</a>
|
||||
</Link>
|
||||
</li>
|
||||
</li>
|
||||
{/*}
|
||||
<li>
|
||||
<Link href={`/events#restrictions`} shallow>
|
||||
<a className={ type === "restrictions" ? "active" : "" }>Ограничения</a>
|
||||
</Link>
|
||||
</li>
|
||||
{*/}
|
||||
<li>
|
||||
<Link href={`/events#payments`} shallow>
|
||||
<a className={ type === "payments" ? "active" : "" }>Платежи</a>
|
||||
</Link>
|
||||
</li>
|
||||
<li>
|
||||
<Link href={`/events#finance`} shallow>
|
||||
<a className={ type === "finance" ? "active" : "" }>Банки и договоры</a>
|
||||
</Link>
|
||||
</li>
|
||||
<li>
|
||||
<Link href={`/events#additional`} shallow>
|
||||
<a className={ type === "additional" ? "active" : "" }>Дополнительные услуги</a>
|
||||
@ -60,11 +67,6 @@ export default class InnerMenu extends React.Component
|
||||
<a className={ type === "fines" ? "active" : "" }>Штрафы</a>
|
||||
</Link>
|
||||
</li>
|
||||
<li>
|
||||
<Link href={`/events#finance`} shallow>
|
||||
<a className={ type === "finance" ? "active" : "" }>Банки</a>
|
||||
</Link>
|
||||
</li>
|
||||
<li>
|
||||
<Link href={`/events#pts`} shallow>
|
||||
<a className={ type === "pts" ? "active" : "" }>ПТС</a>
|
||||
|
||||
@ -65,7 +65,7 @@ class CalendarCellModal extends Component
|
||||
</Link>
|
||||
</div>
|
||||
<div className="table_cell">
|
||||
{ types[payment.type] }
|
||||
<b>{ types[payment.type] }</b>
|
||||
</div>
|
||||
<div className="table_cell">
|
||||
<b style={{ whiteSpace: "nowrap" }}>{ numeral(payment.total_amount).format(' ., ') } ₽</b>
|
||||
|
||||
@ -73,10 +73,10 @@ export default class CalculationsList extends React.Component
|
||||
<p className="item_desc">
|
||||
{ calculation.date_offset_type_comment !== null && (<>{ `${ calculation.date_offset_type_comment.label }: ${ calculation.date_offset_type_comment.value }` }<br/></>) }
|
||||
{ calculation.number_paydate_comment !== null && (<>{ `${ calculation.number_paydate_comment.label }: ${ calculation.number_paydate_comment.value }` }<br/></>) }
|
||||
{ calculation.insurance_price_result_comment !== null && (<>{ `${ calculation.insurance_price_result_comment.label }: ${ numeral(calculation.insurance_price_result_comment.value).format(' ., ') } ` } ₽<br/></>) }
|
||||
{ calculation.insurance_price_result_comment !== null && (<>{ calculation.insurance_price_result_comment.label }: <span style={{ whiteSpace: "nowrap"}}>{ numeral(calculation.insurance_price_result_comment.value).format(' ., ') } ₽</span><br/></>) }
|
||||
{ calculation.fix_last_payment_available_comment !== null && (<>{ `${ calculation.fix_last_payment_available_comment.label }: ${ calculation.fix_last_payment_available_comment.value ? "да" : "нет" }` }<br/></>) }
|
||||
{ calculation.period_new_comment !== null && (<>{ `${ calculation.period_new_comment.label }: ${ calculation.period_new_comment.value }` }<br/></>) }
|
||||
{ calculation.sum_comment !== null && (<>{ `${ calculation.sum_comment.label }: ${ numeral(calculation.sum_comment.value).format(' ., ') }` } ₽<br/></>) }
|
||||
{ calculation.sum_comment !== null && (<>{ calculation.sum_comment.label }: <span style={{ whiteSpace: "nowrap"}}>{ numeral(calculation.sum_comment.value).format(' ., ') } ₽</span><br/></>) }
|
||||
</p>
|
||||
<a className="item_link interactive" onClick={ () => this._handle_onCalculation(calculation.addcontract_number) }>Подробнее</a>
|
||||
</div>
|
||||
|
||||
@ -46,8 +46,8 @@ export default class InnerMenu extends React.Component
|
||||
|
||||
_getActiveLink = (route) =>
|
||||
{
|
||||
if (route.indexOf("/payments/") > -1) return "График платежей";
|
||||
if (route.indexOf("/change/") > -1) return "Изменить график";
|
||||
if (route.indexOf("/payments") > -1) return "График платежей";
|
||||
if (route.indexOf("/change") > -1) return "Изменить график";
|
||||
if (route.indexOf("/services") > -1) return "Дополнительные услуги";
|
||||
if (route.indexOf("/agreement") > -1) return "Документы по договору";
|
||||
if (route.indexOf("/documents") > -1) return "Закрывающие документы";
|
||||
|
||||
@ -17,7 +17,7 @@ import Footer from '../components/Footer';
|
||||
import Pagination from '../components/Pagination';
|
||||
import Company from "../components/Company";
|
||||
|
||||
import { getUsers, sendPhoneChangeNumber, sendPhoneChangeNumberSmsCode, setUserPhone } from '../../actions';
|
||||
import { getUsers, removeUser, sendInvite, sendPhoneChangeNumber, sendPhoneChangeNumberSmsCode, setUserPhone } from '../../actions';
|
||||
import AccountLayout from "../components/Layout/Account";
|
||||
|
||||
class Form extends React.Component
|
||||
@ -34,6 +34,17 @@ class Form extends React.Component
|
||||
};
|
||||
}
|
||||
|
||||
componentDidMount()
|
||||
{
|
||||
const { errors } = this.props;
|
||||
|
||||
if(errors.length > 0)
|
||||
{
|
||||
const update = { ...this.state, ...this.props.form };
|
||||
this.setState(update);
|
||||
}
|
||||
}
|
||||
|
||||
_handle_onChange = (field, value) =>
|
||||
{
|
||||
this.setState({ [ field ]: value }, () =>
|
||||
@ -109,16 +120,16 @@ class Form extends React.Component
|
||||
|
||||
render()
|
||||
{
|
||||
const { companies } = this.props;
|
||||
const { companies, errors } = this.props;
|
||||
const { name, email, selection, selected_companies_all, selected_companies_list, } = this.state;
|
||||
|
||||
return (
|
||||
<div className="table_row editable">
|
||||
<div className="table_cell" data-title="ФИО пользователя">
|
||||
<input type="text" placeholder="Введите ФИО" value={ name } onChange={ (event) => { this._handle_onChange("name", event.target.value) } }/>
|
||||
<input type="text" placeholder="Введите ФИО" value={ name } style={ errors.indexOf("name") > -1 ? { color: "#ED0A34" } : {} } onChange={ (event) => { this._handle_onChange("name", event.target.value) } }/>
|
||||
</div>
|
||||
<div className="table_cell" data-title="Почта">
|
||||
<input type="email" placeholder="Введите почту" value={ email } onChange={ (event) => { this._handle_onChange("email", event.target.value) } }/>
|
||||
<input type="email" placeholder="Введите почту" value={ email } style={ errors.indexOf("email") > -1 ? { color: "#ED0A34" } : {} } onChange={ (event) => { this._handle_onChange("email", event.target.value) } }/>
|
||||
</div>
|
||||
<div className="table_cell" data-title="Роль">Пользователь</div>
|
||||
<div className="table_cell" data-title="Доступные организации">
|
||||
@ -178,15 +189,19 @@ class AdminPage extends React.Component
|
||||
users: null,
|
||||
companies: null,
|
||||
add: false,
|
||||
edit: false,
|
||||
edit: false,
|
||||
save: false,
|
||||
form: {},
|
||||
form: {},
|
||||
observer: false,
|
||||
to_delete: [],
|
||||
errors: [],
|
||||
};
|
||||
}
|
||||
|
||||
static getDerivedStateFromProps(nextProps, prevState)
|
||||
{
|
||||
return {
|
||||
observer: nextProps.observer,
|
||||
user: nextProps.user,
|
||||
users: nextProps.users,
|
||||
companies: nextProps.companies,
|
||||
@ -197,15 +212,22 @@ class AdminPage extends React.Component
|
||||
{
|
||||
this.setState({ loading: true }, () =>
|
||||
{
|
||||
getUsers({ dispatch: this.props.dispatch })
|
||||
.then(() =>
|
||||
if(!this.state.observer && !this.state.user.is_admin)
|
||||
{
|
||||
this.setState({ loading: false, })
|
||||
})
|
||||
.catch(() =>
|
||||
this.props.router.push("/");
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
});
|
||||
getUsers({ dispatch: this.props.dispatch })
|
||||
.then(() =>
|
||||
{
|
||||
this.setState({ loading: false, })
|
||||
})
|
||||
.catch(() =>
|
||||
{
|
||||
this.setState({ loading: false });
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
@ -221,22 +243,85 @@ class AdminPage extends React.Component
|
||||
|
||||
_handle_onSave = () =>
|
||||
{
|
||||
const { form } = this.state;
|
||||
console.log("form");
|
||||
console.log(form);
|
||||
const { form, add, edit, to_delete } = this.state;
|
||||
|
||||
this.setState({ add: false, edit: false });
|
||||
if(add)
|
||||
{
|
||||
const { name, email, selected_companies_list } = form;
|
||||
|
||||
const companies = [];
|
||||
for(let i in selected_companies_list)
|
||||
{
|
||||
companies.push(selected_companies_list[i].acc_number);
|
||||
}
|
||||
|
||||
this.setState({ add: false, edit: false, loading: true }, () =>
|
||||
{
|
||||
sendInvite({ name, email, companies })
|
||||
.then((result) =>
|
||||
{
|
||||
if(result.status === "success")
|
||||
{
|
||||
getUsers({ dispatch: this.props.dispatch })
|
||||
.then(() =>
|
||||
{
|
||||
this.setState({ loading: false, })
|
||||
})
|
||||
.catch(() =>
|
||||
{
|
||||
this.setState({ loading: false });
|
||||
});
|
||||
}
|
||||
else
|
||||
{
|
||||
this.setState({ loading: false });
|
||||
}
|
||||
})
|
||||
.catch((error) =>
|
||||
{
|
||||
this.setState({ loading: false, add: true, errors: error.errors });
|
||||
});
|
||||
});
|
||||
}
|
||||
else
|
||||
{
|
||||
this.setState({ add: false, edit: false, loading: true }, () =>
|
||||
{
|
||||
removeUser({ emails: to_delete })
|
||||
.then((result) =>
|
||||
{
|
||||
if(result.status === "success")
|
||||
{
|
||||
getUsers({ dispatch: this.props.dispatch })
|
||||
.then(() =>
|
||||
{
|
||||
this.setState({ loading: false, to_delete: [] })
|
||||
})
|
||||
.catch(() =>
|
||||
{
|
||||
this.setState({ loading: false, to_delete: [] });
|
||||
});
|
||||
}
|
||||
else
|
||||
{
|
||||
this.setState({ loading: false });
|
||||
}
|
||||
})
|
||||
.catch(() =>
|
||||
{
|
||||
this.setState({ loading: false });
|
||||
});
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
_handle_onCancel = () =>
|
||||
{
|
||||
this.setState({ add: false, edit: false });
|
||||
this.setState({ add: false, edit: false, to_delete: [], });
|
||||
}
|
||||
|
||||
_onFormEdit = (form) =>
|
||||
{
|
||||
console.log("_onFormEdit", form);
|
||||
|
||||
let save = true;
|
||||
if(form.name === "")
|
||||
{
|
||||
@ -254,22 +339,29 @@ class AdminPage extends React.Component
|
||||
}
|
||||
}
|
||||
|
||||
this.setState({ form, save });
|
||||
this.setState({ form, save, errors: [] });
|
||||
}
|
||||
|
||||
_handle_onMarkToDelete = (email) =>
|
||||
{
|
||||
const to_delete = [ ...this.state.to_delete ];
|
||||
|
||||
if(to_delete.indexOf(email) > -1)
|
||||
{
|
||||
|
||||
to_delete.splice(to_delete.indexOf(email), 1);
|
||||
}
|
||||
else
|
||||
{
|
||||
to_delete.push(email);
|
||||
}
|
||||
|
||||
this.setState({ to_delete });
|
||||
}
|
||||
|
||||
render()
|
||||
{
|
||||
const { user, users, companies, add, edit, save } = this.state;
|
||||
console.log("users");
|
||||
console.log(users);
|
||||
|
||||
console.log(".".repeat(100));
|
||||
console.log("user");
|
||||
console.log(user);
|
||||
|
||||
console.log(".".repeat(100));
|
||||
console.log("companies");
|
||||
console.log(companies);
|
||||
const { loading, user, observer, users, companies, errors, form, add, edit, save, to_delete } = this.state;
|
||||
|
||||
return (
|
||||
<React.Fragment>
|
||||
@ -289,108 +381,116 @@ class AdminPage extends React.Component
|
||||
<Company { ...this.props }/>
|
||||
</div>
|
||||
<div className="aside_container about">
|
||||
<InnerMenu { ...this.props }/>
|
||||
<InnerMenu { ...this.props } user={ user } observer={ observer }/>
|
||||
<article>
|
||||
<div className="settings_user_control">
|
||||
<p>Настройки доступа к личному кабинету</p>
|
||||
<div>
|
||||
{ add || edit ? (
|
||||
<>
|
||||
<button className="button button-blue" onClick={ this._handle_onCancel }>Отменить</button>
|
||||
<button className="button button-blue" onClick={ this._handle_onSave } disabled={ save ? false : true }>Сохранить</button>
|
||||
</>
|
||||
) : (
|
||||
<>
|
||||
<button className="button button-blue" onClick={ this._handle_onAdd }>Добавить пользователя</button>
|
||||
<button className="button button-blue" onClick={ this._handle_onEdit }>Редактировать</button>
|
||||
</>
|
||||
) }
|
||||
{ loading ? (
|
||||
<div className="table_row table_header" style={{ minHeight: 300, display: "flex", justifyContent: "center", alignItems: "center" }}>
|
||||
<SpinnerCircular size={90} thickness={51} speed={100} color="rgba(28, 1, 169, 1)" secondaryColor="rgba(236, 239, 244, 1)" />
|
||||
</div>
|
||||
</div>
|
||||
<div className="settings_table editable">
|
||||
<div className="table_header table_row">
|
||||
<div className="table_cell">ФИО пользователя</div>
|
||||
<div className="table_cell">Почта</div>
|
||||
<div className="table_cell">Роль</div>
|
||||
<div className="table_cell">Доступные организации</div>
|
||||
<div className="table_cell" style={ !edit ? { border: "none", } : {} }>Статус</div>
|
||||
{ edit && (
|
||||
<div className="table_cell" style={{ border: "none", }}></div>
|
||||
) }
|
||||
</div>
|
||||
{ users !== undefined && users !== null && users.map((entry, index) =>
|
||||
{
|
||||
if(entry.email === user.email)
|
||||
{
|
||||
return (
|
||||
<div className="table_row" key={ index }>
|
||||
<div className="table_cell" data-title="ФИО пользователя">{ entry.name } (Вы)</div>
|
||||
<div className="table_cell" data-title="Почта">{ entry.email }</div>
|
||||
) : (
|
||||
<>
|
||||
<div className="settings_user_control">
|
||||
<p>Настройки доступа к личному кабинету</p>
|
||||
<div>
|
||||
{ add || edit ? (
|
||||
<>
|
||||
<button className="button button-blue" onClick={ this._handle_onCancel }>Отменить</button>
|
||||
<button className="button button-blue" onClick={ this._handle_onSave } disabled={ add ? save ? false : true : to_delete.length > 0 ? false : true }>Сохранить</button>
|
||||
</>
|
||||
) : (
|
||||
<>
|
||||
<button className="button button-blue" onClick={ this._handle_onAdd }>Добавить пользователя</button>
|
||||
<button className="button button-blue" onClick={ this._handle_onEdit }>Редактировать</button>
|
||||
</>
|
||||
) }
|
||||
</div>
|
||||
</div>
|
||||
<div className="settings_table editable">
|
||||
<div className="table_header table_row">
|
||||
<div className="table_cell">ФИО пользователя</div>
|
||||
<div className="table_cell">Почта</div>
|
||||
<div className="table_cell">Роль</div>
|
||||
<div className="table_cell">Доступные организации</div>
|
||||
<div className="table_cell" style={ !edit ? { border: "none", } : {} }>Статус</div>
|
||||
{ edit && (
|
||||
<div className="table_cell" style={{ border: "none", }}></div>
|
||||
) }
|
||||
</div>
|
||||
{ users !== undefined && users !== null && users.map((entry, index) =>
|
||||
{
|
||||
if(entry.email === user.email)
|
||||
{
|
||||
return (
|
||||
<div className="table_row" key={ index }>
|
||||
<div className="table_cell" data-title="ФИО пользователя">{ entry.name } (Вы)</div>
|
||||
<div className="table_cell" data-title="Почта">{ entry.email } [{user.email}]</div>
|
||||
<div className="table_cell" data-title="Роль">{ entry.is_admin ? "Администратор" : "Пользователь" }</div>
|
||||
<div className="table_cell" data-title="Доступные организации">Все организации</div>
|
||||
<div className="table_cell" data-title="Статус">{ entry.is_admin ? "Активен" : entry.last !== null ? "Активен" : "Приглашен" }</div>
|
||||
{ edit && (
|
||||
<div className="table_cell delete" style={{ position: 'relative' }}></div>
|
||||
) }
|
||||
</div>
|
||||
)
|
||||
}
|
||||
return null;
|
||||
}) }
|
||||
{ users !== undefined && users !== null && users.map((entry, index) =>
|
||||
{
|
||||
if(entry.email !== user.email)
|
||||
{
|
||||
return (
|
||||
<div className="table_row" key={ index } style={ to_delete.indexOf(entry.email) > -1 ? { backgroundColor: "#eee" } : {} }>
|
||||
<div className="table_cell" data-title="ФИО пользователя" style={ to_delete.indexOf(entry.email) > -1 ? { textDecoration: "line-through" } : {} }>{ entry.name }</div>
|
||||
<div className="table_cell" data-title="Почта" style={ to_delete.indexOf(entry.email) > -1 ? { textDecoration: "line-through" } : {} }>{ entry.email }</div>
|
||||
<div className="table_cell" data-title="Роль" style={ to_delete.indexOf(entry.email) > -1 ? { textDecoration: "line-through" } : {} }>{ entry.is_admin ? "Администратор" : "Пользователь" }</div>
|
||||
<div className="table_cell" data-title="Доступные организации">{ entry.companies.map((company, c_index) => (
|
||||
<p key={ c_index } style={ to_delete.indexOf(entry.email) > -1 ? { textDecoration: "line-through" } : {} }>{ company.title }</p>
|
||||
)) }</div>
|
||||
<div className="table_cell" data-title="Статус" style={ to_delete.indexOf(entry.email) > -1 ? { textDecoration: "line-through" } : {} }>{ entry.is_admin ? "Активен" : entry.last !== null ? "Активен" : "Приглашен" }</div>
|
||||
{ edit && (
|
||||
<div className="table_cell delete" style={{ position: 'relative' }}>
|
||||
<button className="delete_user" title="Удалить пользователя" onClick={ () => { this._handle_onMarkToDelete(entry.email) }}></button>
|
||||
</div>
|
||||
) }
|
||||
</div>
|
||||
)
|
||||
}
|
||||
return null;
|
||||
}) }
|
||||
{/*}
|
||||
{ user !== undefined && user !== null && user.email !== undefined && user.email !== null && (
|
||||
<div className="table_row">
|
||||
<div className="table_cell" data-title="ФИО пользователя">{ `${ user.lastname } ${ user.name } ${ user.secondname }` }</div>
|
||||
<div className="table_cell" data-title="Почта">{ user.email }</div>
|
||||
<div className="table_cell" data-title="Роль">Администратор</div>
|
||||
<div className="table_cell" data-title="Доступные организации">Все организации</div>
|
||||
<div className="table_cell" data-title="Статус">Активен</div>
|
||||
{ edit && (
|
||||
<div className="table_cell delete" style={{ position: 'relative' }}></div>
|
||||
) }
|
||||
<div className="table_cell delete" style={{ position: 'relative' }}>
|
||||
</div>
|
||||
</div>
|
||||
)
|
||||
}
|
||||
return null;
|
||||
}) }
|
||||
{ users !== undefined && users !== null && users.map((entry, index) =>
|
||||
{
|
||||
if(entry.email !== user.email)
|
||||
{
|
||||
return (
|
||||
<div className="table_row" key={ index }>
|
||||
<div className="table_cell" data-title="ФИО пользователя">{ entry.name }</div>
|
||||
<div className="table_cell" data-title="Почта">{ entry.email }</div>
|
||||
<div className="table_cell" data-title="Роль">Администратор</div>
|
||||
<div className="table_cell" data-title="Доступные организации">{ entry.companies.map((company, c_index) => (
|
||||
<p key={ c_index }>{ company.title }</p>
|
||||
)) }</div>
|
||||
<div className="table_cell" data-title="Статус">Активен</div>
|
||||
{ edit && (
|
||||
<div className="table_cell delete" style={{ position: 'relative' }}>
|
||||
<button className="delete_user" title="Удалить пользователя"></button>
|
||||
</div>
|
||||
) }
|
||||
) }
|
||||
{*/}
|
||||
{/*}
|
||||
<div className="table_row">
|
||||
<div className="table_cell" data-title="ФИО пользователя">Иванов Иван Иванович</div>
|
||||
<div className="table_cell" data-title="Почта">iivanov@mail.com</div>
|
||||
<div className="table_cell" data-title="Роль">Администратор</div>
|
||||
<div className="table_cell" data-title="Доступные организации">Все организации</div>
|
||||
<div className="table_cell" data-title="Статус">Активен</div>
|
||||
<div className="table_cell delete" style={{ position: 'relative' }}>
|
||||
<button className="delete_user" title="Удалить пользователя"></button>
|
||||
</div>
|
||||
)
|
||||
}
|
||||
return null;
|
||||
}) }
|
||||
{/*}
|
||||
{ user !== undefined && user !== null && user.email !== undefined && user.email !== null && (
|
||||
<div className="table_row">
|
||||
<div className="table_cell" data-title="ФИО пользователя">{ `${ user.lastname } ${ user.name } ${ user.secondname }` }</div>
|
||||
<div className="table_cell" data-title="Почта">{ user.email }</div>
|
||||
<div className="table_cell" data-title="Роль">Администратор</div>
|
||||
<div className="table_cell" data-title="Доступные организации">Все организации</div>
|
||||
<div className="table_cell" data-title="Статус">Активен</div>
|
||||
<div className="table_cell delete" style={{ position: 'relative' }}>
|
||||
</div>
|
||||
{*/}
|
||||
{ add && (
|
||||
<Form companies={ companies } errors={ errors } form={ form } onForm={ this._onFormEdit }/>
|
||||
) }
|
||||
{/*}
|
||||
{*/}
|
||||
</div>
|
||||
) }
|
||||
{*/}
|
||||
{/*}
|
||||
<div className="table_row">
|
||||
<div className="table_cell" data-title="ФИО пользователя">Иванов Иван Иванович</div>
|
||||
<div className="table_cell" data-title="Почта">iivanov@mail.com</div>
|
||||
<div className="table_cell" data-title="Роль">Администратор</div>
|
||||
<div className="table_cell" data-title="Доступные организации">Все организации</div>
|
||||
<div className="table_cell" data-title="Статус">Активен</div>
|
||||
<div className="table_cell delete" style={{ position: 'relative' }}>
|
||||
<button className="delete_user" title="Удалить пользователя"></button>
|
||||
</div>
|
||||
</div>
|
||||
{*/}
|
||||
{ add && (
|
||||
<Form companies={ companies } onForm={ this._onFormEdit }/>
|
||||
) }
|
||||
{/*}
|
||||
{*/}
|
||||
</div>
|
||||
</>
|
||||
) }
|
||||
</article>
|
||||
</div>
|
||||
</AccountLayout>
|
||||
@ -403,6 +503,7 @@ class AdminPage extends React.Component
|
||||
function mapStateToProps(state, ownProps)
|
||||
{
|
||||
return {
|
||||
observer: state.auth.observer,
|
||||
user: state.user,
|
||||
users: state.admin.users,
|
||||
companies: state.companies.list,
|
||||
|
||||
@ -2,9 +2,9 @@ import React from "react";
|
||||
import Link from "next/link";
|
||||
|
||||
const menu = [
|
||||
{id: 1, name: "Номер телефона", link: "/settings/phone"},
|
||||
{id: 2, name: "Пароль", link: "/settings/password"},
|
||||
{id: 3, name: "Настройки доступа", link: "/settings/admin"},
|
||||
{id: 1, type: "phone", name: "Номер телефона", link: "/settings/phone"},
|
||||
{id: 2, type: "password", name: "Пароль", link: "/settings/password"},
|
||||
{id: 3, type: "admin", name: "Настройки доступа", link: "/settings/admin"},
|
||||
]
|
||||
|
||||
export default class InnerMenu extends React.Component
|
||||
@ -47,19 +47,26 @@ export default class InnerMenu extends React.Component
|
||||
|
||||
render()
|
||||
{
|
||||
const { user, observer } = this.props;
|
||||
|
||||
return (
|
||||
<aside>
|
||||
<ul className="aside_nav" ref={ this.menuRef }>
|
||||
{ menu.map(item => (
|
||||
<li key = {item.id} ref={this[item.id]} onClick={() => this.scrollToCategory(item.id)}>
|
||||
<Link
|
||||
href={item.link}
|
||||
shallow
|
||||
>
|
||||
<a className={ this.props.router && this.props.router.route === item.link ? "active" : "" }>{item.name}</a>
|
||||
</Link>
|
||||
</li>
|
||||
)) }
|
||||
{ menu.map(item =>
|
||||
{
|
||||
if(item.type === "admin" && !observer && !user.is_admin) { return null; }
|
||||
|
||||
return (
|
||||
<li key = {item.id} ref={this[item.id]} onClick={() => this.scrollToCategory(item.id)}>
|
||||
<Link
|
||||
href={item.link}
|
||||
shallow
|
||||
>
|
||||
<a className={ this.props.router && this.props.router.route === item.link ? "active" : "" }>{item.name}</a>
|
||||
</Link>
|
||||
</li>
|
||||
)
|
||||
}) }
|
||||
</ul>
|
||||
</aside>
|
||||
)
|
||||
|
||||
@ -34,12 +34,14 @@ class IndexPage extends React.Component
|
||||
new_password_submit_disabled: true,
|
||||
new_password_error: false,
|
||||
user: {},
|
||||
observer: false,
|
||||
};
|
||||
}
|
||||
|
||||
static getDerivedStateFromProps(nextProps, prevState)
|
||||
{
|
||||
return {
|
||||
observer: nextProps.observer,
|
||||
user: nextProps.user,
|
||||
};
|
||||
}
|
||||
@ -127,7 +129,7 @@ class IndexPage extends React.Component
|
||||
render()
|
||||
{
|
||||
console.log("this.state.user", this.state.user);
|
||||
const { password, password_error, new_password, new_password_repeat, new_password_submit_disabled, new_password_check_loading, new_password_error, password_form_step } = this.state;
|
||||
const { user, observer, password, password_error, new_password, new_password_repeat, new_password_submit_disabled, new_password_check_loading, new_password_error, password_form_step } = this.state;
|
||||
|
||||
return (
|
||||
<React.Fragment>
|
||||
@ -147,7 +149,7 @@ class IndexPage extends React.Component
|
||||
<Company { ...this.props }/>
|
||||
</div>
|
||||
<div className="aside_container about">
|
||||
<InnerMenu { ...this.props }/>
|
||||
<InnerMenu { ...this.props } user={ user } observer={ observer }/>
|
||||
<article>
|
||||
{ password_form_step === 1 && (
|
||||
<div className={`login recovery`}>
|
||||
@ -193,6 +195,7 @@ class IndexPage extends React.Component
|
||||
function mapStateToProps(state, ownProps)
|
||||
{
|
||||
return {
|
||||
observer: state.auth.observer,
|
||||
user: state.user,
|
||||
}
|
||||
}
|
||||
|
||||
@ -40,12 +40,14 @@ class IndexPage extends React.Component
|
||||
phone_check_loading: false,
|
||||
code_check_loading: false,
|
||||
user: {},
|
||||
observer: false,
|
||||
};
|
||||
}
|
||||
|
||||
static getDerivedStateFromProps(nextProps, prevState)
|
||||
{
|
||||
return {
|
||||
observer: nextProps.observer,
|
||||
user: nextProps.user,
|
||||
};
|
||||
}
|
||||
@ -174,7 +176,7 @@ class IndexPage extends React.Component
|
||||
<Company { ...this.props }/>
|
||||
</div>
|
||||
<div className="aside_container about">
|
||||
<InnerMenu { ...this.props }/>
|
||||
<InnerMenu { ...this.props } user={ user }/>
|
||||
<article>
|
||||
{ phone_form_step !== 2 && phone_form_step !== 3 && (
|
||||
<>
|
||||
@ -243,6 +245,7 @@ class IndexPage extends React.Component
|
||||
function mapStateToProps(state, ownProps)
|
||||
{
|
||||
return {
|
||||
observer: state.auth.observer,
|
||||
user: state.user,
|
||||
}
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user