bibot 1.0.34 → 1.0.35

Sign up to get free protection for your applications and to get access to all the features.
@@ -3573,6 +3573,22 @@ var askBiBot = function askBiBot(data) {
3573
3573
  return Promise.reject(e);
3574
3574
  }
3575
3575
  };
3576
+ var recordPredefinedQ = function recordPredefinedQ(data) {
3577
+ try {
3578
+ return Promise.resolve(_catch(function () {
3579
+ var path = 'https://training.dev.bibot.thespuka.com/v0/training/predefined-questions-statistics';
3580
+ return Promise.resolve(pluginAxiosInstance.post(path, data)).then(function (response) {
3581
+ console.log(response, 'here is the res');
3582
+ return response.data;
3583
+ });
3584
+ }, function (error) {
3585
+ console.log(error.message);
3586
+ return error.message;
3587
+ }));
3588
+ } catch (e) {
3589
+ return Promise.reject(e);
3590
+ }
3591
+ };
3576
3592
  var askTimedOutBiBot = function askTimedOutBiBot(data) {
3577
3593
  try {
3578
3594
  return Promise.resolve(_catch(function () {
@@ -3637,10 +3653,15 @@ var useBiBotChatBot = function useBiBotChatBot(_ref) {
3637
3653
  return Promise.reject(e);
3638
3654
  }
3639
3655
  };
3640
- var askPredefinedQuestion = function askPredefinedQuestion(question) {
3656
+ var askPredefinedQuestion = function askPredefinedQuestion(question, client_id) {
3641
3657
  try {
3642
3658
  setIsLoading(true);
3643
3659
  var input = question.question.trim();
3660
+ recordPredefinedQ({
3661
+ client_id: clientId,
3662
+ question: question.question
3663
+ });
3664
+ console.log(question.question, client_id);
3644
3665
  setUserInput('');
3645
3666
  if (input === question.question) {
3646
3667
  setMessages(function (messages) {
@@ -3692,7 +3713,7 @@ var useBiBotChatBot = function useBiBotChatBot(_ref) {
3692
3713
  setChatBubbleConfig = _useState7[1];
3693
3714
  var handlePredefinedQuestionSelect = function handlePredefinedQuestionSelect(question) {
3694
3715
  sendInputInquiry();
3695
- askPredefinedQuestion(question);
3716
+ askPredefinedQuestion(question, clientId);
3696
3717
  setUserInput('');
3697
3718
  setShowPredefinedQuestions(false);
3698
3719
  };
@@ -3762,7 +3783,7 @@ var useBiBotChatBot = function useBiBotChatBot(_ref) {
3762
3783
  };
3763
3784
  };
3764
3785
 
3765
- var styles = {"chat-bubble":"_31at8","chat-toggle":"_1tkAI","chat-window":"_2vdWr","chat-header":"_1ngBE","message-list":"_27MrF","message":"_3XbXj","user":"_3l8QX","bot":"_1MqZg","loader":"_3mrL1","l5":"_25GkQ","input-area":"_6V_kl","loading-bubbles":"_1XTQS","bubble":"_32ZvK","bounce":"_V8DEW"};
3786
+ var styles = {};
3766
3787
 
3767
3788
  function SendMessageIcon(_ref) {
3768
3789
  var color = _ref.color;
@@ -4098,7 +4119,8 @@ var PredefinedQuestions = function PredefinedQuestions(_ref) {
4098
4119
  fontSize: 16,
4099
4120
  margin: 5,
4100
4121
  textAlign: 'start',
4101
- height: 30,
4122
+ maxHeight: '40px',
4123
+ overflow: 'hidden',
4102
4124
  padding: 10,
4103
4125
  display: 'flex',
4104
4126
  alignItems: 'center',