Merge branch 'hotfix/CFE-8_scroll_actions_call_widget'
This commit is contained in:
@@ -2,15 +2,16 @@ import CallActionsCategories from "./CallActionCategories";
|
||||
import CallActionsSubcategories from "./CallActionSubcategories";
|
||||
import ActionHeader from "./ActionHeader";
|
||||
import CallActionDescription from "./CallActionDescription";
|
||||
import { CALL_ACTION } from "@/core/data/apiRoutes";
|
||||
import {CALL_ACTION} from "@/core/data/apiRoutes";
|
||||
import useRequest from "@/lib/app/hooks/useRequest";
|
||||
import useAnswers from "@/lib/callWidget/hooks/useAnswers";
|
||||
import { useState } from "react";
|
||||
import {useState} from "react";
|
||||
import {Stack} from "@mui/material";
|
||||
|
||||
function CallActions({ tab }) {
|
||||
function CallActions({tab}) {
|
||||
const [description, setDescription] = useState('')
|
||||
const requestServer = useRequest({ auth: true });
|
||||
const { closeAnswerTab } = useAnswers();
|
||||
const requestServer = useRequest({auth: true});
|
||||
const {closeAnswerTab} = useAnswers();
|
||||
|
||||
const handleSubcategoryButton = (category_id, subcategory_id) => {
|
||||
requestServer(`${CALL_ACTION}/${tab.id}`, "post", {
|
||||
@@ -20,23 +21,29 @@ function CallActions({ tab }) {
|
||||
description
|
||||
},
|
||||
success: {
|
||||
notification: { show: false },
|
||||
notification: {show: false},
|
||||
},
|
||||
})
|
||||
.then(() => {
|
||||
closeAnswerTab(tab.id);
|
||||
})
|
||||
.catch(() => {});
|
||||
.catch(() => {
|
||||
});
|
||||
};
|
||||
|
||||
|
||||
|
||||
return (
|
||||
<>
|
||||
<ActionHeader tab={tab} />
|
||||
<CallActionDescription setDescription={setDescription} />
|
||||
<CallActionsCategories tab={tab} />
|
||||
<CallActionsSubcategories handleSubcategoryButton={handleSubcategoryButton} tab={tab} />
|
||||
</>
|
||||
<Stack sx={{
|
||||
height: "100%",
|
||||
overflow: "hidden"
|
||||
}}>
|
||||
<ActionHeader tab={tab}/>
|
||||
<Stack sx={{height: "100%", overflow: "scroll"}}>
|
||||
<CallActionDescription setDescription={setDescription}/>
|
||||
<CallActionsCategories tab={tab}/>
|
||||
<CallActionsSubcategories handleSubcategoryButton={handleSubcategoryButton} tab={tab}/>
|
||||
</Stack>
|
||||
</Stack>
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
@@ -25,7 +25,7 @@ const CallHistory = ({tab}) => {
|
||||
overflow: "hidden"
|
||||
}}>
|
||||
<HistoryHeader tab={tab}/>
|
||||
<Stack sx={{overflow: "scroll"}}>
|
||||
<Stack sx={{height: "100%", overflow: "scroll"}}>
|
||||
{errorHistoryList ? (
|
||||
<ErrorOrEmpty isErrorOrEmpty="error"/>
|
||||
) : isLoadingHistoryList ? (
|
||||
|
||||
@@ -7,7 +7,7 @@ const CallTabPanel = ({tab}) => {
|
||||
<Grid container columns={{xs: 3}} sx={{display: !tab.active && 'none', height: '100%', overflow: "hidden"}}
|
||||
role="tabpanel"
|
||||
id={`answer-tabpanel-${tab.id}`} aria-labelledby={`answer-tab-${tab.id}`}>
|
||||
<Grid item xs={2}>
|
||||
<Grid item xs={2} sx={{height: "100%", overflow: "scroll"}}>
|
||||
<CallActions tab={tab}/>
|
||||
</Grid>
|
||||
<Grid item>
|
||||
|
||||
Reference in New Issue
Block a user