Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
B
BoxDialer
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Kulya
BoxDialer
Commits
f82e2fe9
Commit
f82e2fe9
authored
Sep 21, 2023
by
Muhammadali
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
update
parent
2021c99d
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
39 additions
and
32 deletions
+39
-32
package.json
package.json
+1
-1
controlRenderBX.jsx
src/lib/controlRenderBX.jsx
+17
-10
index.jsx
src/root/index.jsx
+21
-21
No files found.
package.json
View file @
f82e2fe9
{
"name"
:
"boxdialer"
,
"version"
:
"2.
1.9
"
,
"version"
:
"2.
2.0
"
,
"description"
:
""
,
"main"
:
"src/boxDialer.js"
,
"scripts"
:
{
...
...
src/lib/controlRenderBX.jsx
View file @
f82e2fe9
...
...
@@ -3,7 +3,7 @@ import React, { useEffect, useState } from 'react';
import
Root
from
'
../root
'
;
const
ControlRenderBX
=
()
=>
{
const
[
data
,
setD
ata
]
=
useState
({});
const
[
wsphonedata
,
setWsphoned
ata
]
=
useState
({});
const
[
typeEnvironments
,
setTypeEnvironments
]
=
useState
(
'
none
'
);
var
intervalFetchToBx
;
...
...
@@ -13,10 +13,10 @@ const ControlRenderBX = () => {
},
[]);
const
intervalFunc
=
()
=>
{
if
(
!
Boolean
(
data
?.
number
))
{
set
D
ata
(
window
.
alovoice_wsphone
);
if
(
!
Boolean
(
wsphone
data
?.
number
))
{
set
Wsphoned
ata
(
window
.
alovoice_wsphone
);
}
if
(
Boolean
(
data
?.
number
))
{
if
(
Boolean
(
wsphone
data
?.
number
))
{
clearInterval
(
intervalFetchToBx
);
intervalFetchToBx
=
null
;
}
...
...
@@ -24,12 +24,9 @@ const ControlRenderBX = () => {
const
testFunc
=
(
e
)
=>
{
console
.
log
(
'
dsadasdsd
'
,
e
);
setData
(
e
);
setTimeout
(()
=>
{
setData
({});
},
3000
);
setWsphonedata
(
e
);
};
console
.
log
(
'
check_data
'
,
data
);
console
.
log
(
'
check_data
'
,
wsphone
data
);
// switch (typeEnvironments) {
// case 'bitrix':
// return <Root setData={setData} data={data} />;
...
...
@@ -38,7 +35,17 @@ const ControlRenderBX = () => {
// default:
// return <Root setData={setData} data={data} />;
// }
return
<
div
>
{
data
?.
number
&&
<
Root
setData=
{
testFunc
}
data=
{
data
}
/>
}
</
div
>;
return
(
<
div
>
{
data
?.
number
&&
(
<
Root
setWsphonedata=
{
testFunc
}
onSetDnd=
{
window
.
alovoice_onsetdnd
}
wsphonedata=
{
wsphonedata
}
/>
)
}
</
div
>
);
};
export
default
ControlRenderBX
;
src/root/index.jsx
View file @
f82e2fe9
...
...
@@ -8,7 +8,7 @@ import Modal from '../components/Modal';
import
BxMiniWidjetUi
from
'
../components/BxMiniWidjetUi
'
;
import
SecondNotifSip
from
'
../components/SecondNotifSip
'
;
const
Root
=
({
data
,
onSetDnd
,
setData
})
=>
{
const
Root
=
({
wsphone
data
,
onSetDnd
,
setData
})
=>
{
// const [dataSecond, setDataSecond] = useState([]);
// if (!data) {
// data = {
...
...
@@ -25,10 +25,10 @@ const Root = ({ data, onSetDnd, setData }) => {
// };
// }
if
(
window
?.
alovoice_wsphone
)
{
data
=
window
.
alovoice_wsphone
;
onSetDnd
=
window
.
alovoice_onsetdnd
;
}
//
if (window?.alovoice_wsphone) {
// wsphone
data = window.alovoice_wsphone;
//
onSetDnd = window.alovoice_onsetdnd;
//
}
const
[
phoneModal
,
setPhoneModal
]
=
useState
(
false
);
const
[
dynamicValue
,
setDynamicValue
]
=
useState
(
'
pending
'
);
...
...
@@ -46,12 +46,12 @@ const Root = ({ data, onSetDnd, setData }) => {
},
[
secondLine
]);
useEffect
(()
=>
{
if
(
data
&&
data
?.
number
)
{
if
(
wsphonedata
&&
wsphone
data
?.
number
)
{
boxDialer
.
setSipStateChangeCallback
(
setDynamicValue
,
'
dynamicValue
'
);
boxDialer
.
setSipStateChangeCallback
(
setModalState
,
'
modalState
'
);
boxDialer
.
setSipStateChangeCallback
(
setPhoneModal
,
'
phoneModal
'
);
boxDialer
.
setSipStateChangeCallback
(
setSecondLine
,
'
secondLine
'
);
boxDialer
.
sipRegister
(
data
);
boxDialer
.
sipRegister
(
wsphone
data
);
}
// setData(data);
},
[]);
...
...
@@ -75,11 +75,11 @@ const Root = ({ data, onSetDnd, setData }) => {
return
(
<
BxMiniWidjetUi
widjetState=
{
dynamicValue
}
phoneNumber=
{
data
?.
number
}
reason=
{
data
?.
reason
}
phoneNumber=
{
wsphone
data
?.
number
}
reason=
{
wsphone
data
?.
reason
}
widjetVersion=
{
packageJson
?.
version
}
leftTime=
{
data
.
lefttime
}
position=
{
data
.
position
||
'
bottomLeft
'
}
leftTime=
{
wsphone
data
.
lefttime
}
position=
{
wsphone
data
.
position
||
'
bottomLeft
'
}
onClick=
{
()
=>
{
phoneModal
?
setPhoneModal
(
false
)
:
setPhoneModal
(
true
);
}
}
...
...
@@ -89,11 +89,11 @@ const Root = ({ data, onSetDnd, setData }) => {
return
(
<
DefaultWidjetUi
widjetState=
{
dynamicValue
}
phoneNumber=
{
data
?.
number
}
reason=
{
data
?.
reason
}
phoneNumber=
{
wsphone
data
?.
number
}
reason=
{
wsphone
data
?.
reason
}
widjetVersion=
{
packageJson
?.
version
}
leftTime=
{
data
.
lefttime
}
position=
{
data
.
position
||
'
bottomLeft
'
}
leftTime=
{
wsphone
data
.
lefttime
}
position=
{
wsphone
data
.
position
||
'
bottomLeft
'
}
onClick=
{
()
=>
{
phoneModal
?
setPhoneModal
(
false
)
:
setPhoneModal
(
true
);
}
}
...
...
@@ -102,22 +102,22 @@ const Root = ({ data, onSetDnd, setData }) => {
}
};
if
(
!
data
||
!
data
?.
number
||
!
data
?.
position
)
return
;
if
(
!
wsphonedata
||
!
wsphonedata
?.
number
||
!
wsphone
data
?.
position
)
return
;
console
.
log
(
modalState
,
'
modalState
'
);
return
(
<>
{
selectWidjetType
(
data
.
variant
)
}
{
selectWidjetType
(
wsphone
data
.
variant
)
}
<
ModalPhoneNumpad
modalState=
{
modalState
}
phoneModal=
{
phoneModal
}
reasons=
{
data
?.
reasons
}
reason=
{
data
?.
reason
}
reasons=
{
wsphone
data
?.
reasons
}
reason=
{
wsphone
data
?.
reason
}
onClick=
{
(
e
)
=>
e
.
stopPropagation
()
}
dynamicValue=
{
dynamicValue
}
onSetDnd=
{
reasonSelect
}
variant=
{
data
.
variant
||
'
defaultWidjet
'
}
position=
{
data
.
position
||
'
bottomLeft
'
}
variant=
{
wsphone
data
.
variant
||
'
defaultWidjet
'
}
position=
{
wsphone
data
.
position
||
'
bottomLeft
'
}
/>
<
Modal
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment