impact-chatbot 2.3.0 → 2.3.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.esm.js CHANGED
@@ -17,7 +17,7 @@ import rehypeSanitize from 'rehype-sanitize';
17
17
  import remarkBreaks from 'remark-breaks';
18
18
  import remarkGfm from 'remark-gfm';
19
19
  import { setSelectedFilters, setFilterConfiguration } from 'core/actions/filterAction';
20
- import { setChatbotContext, setCurrentAgentChatId, setThinkingContext } from 'core/actions/smartBotActions';
20
+ import { setChatbotContext, setCurrentAgentChatId, setThinkingContext, setHierarchyKeyValue } from 'core/actions/smartBotActions';
21
21
  import { useNavigate, useLocation } from 'react-router-dom-v5-compat';
22
22
  import RefreshIcon from '@mui/icons-material/Refresh';
23
23
  import styled from 'styled-components';
@@ -9288,7 +9288,7 @@ const SmartBot = (props) => {
9288
9288
  useState(false);
9289
9289
  useState(false);
9290
9290
  const [conversation, setConversation] = useState({});
9291
- const chatbotContext = useSelector((state) => state.smartBotReducer.chatbotContext);
9291
+ const { chatbotContext, currentAgentChatId } = useSelector((state) => state.smartBotReducer);
9292
9292
  const activeTab = useRef({
9293
9293
  activeTab: "dashboard",
9294
9294
  });
@@ -9403,13 +9403,22 @@ const SmartBot = (props) => {
9403
9403
  }
9404
9404
  const [response, responseStore] = await Promise.all([
9405
9405
  fetchChatbotFilterConfig("product"),
9406
- fetchChatbotFilterConfig("store")
9406
+ fetchChatbotFilterConfig("store"),
9407
9407
  ]);
9408
9408
  const combinedOptions = [
9409
9409
  ...(response?.data?.data || []),
9410
9410
  ...(responseStore?.data?.data || []),
9411
- ...(chatbotFilterCustomConfig?.data || []) // Add custom filter config for testing
9411
+ ...(chatbotFilterCustomConfig?.data || []), // Add custom filter config for testing
9412
9412
  ];
9413
+ // Create hierarchy key-value pairs object
9414
+ const hierarchyKeyValuePairs = {};
9415
+ combinedOptions.forEach((option) => {
9416
+ if (option.column_name && option.label) {
9417
+ hierarchyKeyValuePairs[option.column_name] = option.label;
9418
+ }
9419
+ });
9420
+ // Dispatch hierarchy key-value pairs to store
9421
+ dispatch(setHierarchyKeyValue(hierarchyKeyValuePairs));
9413
9422
  setFilterOptions(combinedOptions);
9414
9423
  }
9415
9424
  catch (error) {
@@ -9690,6 +9699,7 @@ const SmartBot = (props) => {
9690
9699
  setSessionId: setSessionId,
9691
9700
  setInitValue: setInitValue,
9692
9701
  uniqueChatId: uniqueChatId,
9702
+ currentAgentChatId: currentAgentChatId
9693
9703
  });
9694
9704
  setUserInput("");
9695
9705
  }
@@ -9856,6 +9866,7 @@ const SmartBot = (props) => {
9856
9866
  setUserInput("");
9857
9867
  setUniqueChatId("");
9858
9868
  chatDataRef.current[currentMode] = [];
9869
+ dispatch(setCurrentAgentChatId(""));
9859
9870
  functionsState?.abortStreaming();
9860
9871
  return {
9861
9872
  tabName: currentMode,