Commit ab743b93 by Archer Committed by GitHub

fix: ticktime (#6134)

* stop design doc

* remove invalid doc

* del s3 tip

* fix: ticktime

* fix: ticktime

* fix: ticktime
parent 6fb93ef8
...@@ -34,6 +34,7 @@ export const isFileNotFoundError = (error: any): boolean => { ...@@ -34,6 +34,7 @@ export const isFileNotFoundError = (error: any): boolean => {
error.message === 'Not Found' || error.message === 'Not Found' ||
error.message === error.message ===
'The request signature we calculated does not match the signature you provided. Check your key and signing method.' || 'The request signature we calculated does not match the signature you provided. Check your key and signing method.' ||
error.message.includes('Resource name contains bad components') ||
error.message.includes('Object name contains unsupported characters.') error.message.includes('Object name contains unsupported characters.')
); );
} }
......
...@@ -28,13 +28,21 @@ const HelperBot = () => { ...@@ -28,13 +28,21 @@ const HelperBot = () => {
const [showChat, setShowChat] = useToggle(false); const [showChat, setShowChat] = useToggle(false);
const [isLoading, setIsLoading] = useState(true); const [isLoading, setIsLoading] = useState(true);
const { feConfigs, setNotSufficientModalType } = useSystemStore(); const { feConfigs, setNotSufficientModalType, subPlans } = useSystemStore();
const { teamPlanStatus } = useUserStore(); const { teamPlanStatus } = useUserStore();
const hasTicketAccess = useMemo(() => { const hasTicketAccess = useMemo(() => {
const ticketResponseTime = teamPlanStatus?.standard?.ticketResponseTime; const plan = teamPlanStatus?.standard?.currentSubLevel
return ticketResponseTime !== undefined && ticketResponseTime > 0; ? subPlans?.standard?.[teamPlanStatus?.standard?.currentSubLevel]
}, [teamPlanStatus?.standard?.ticketResponseTime]); : undefined;
const ticketResponseTime =
teamPlanStatus?.standard?.ticketResponseTime ?? plan?.ticketResponseTime;
return !!ticketResponseTime;
}, [
subPlans?.standard,
teamPlanStatus?.standard?.currentSubLevel,
teamPlanStatus?.standard?.ticketResponseTime
]);
const botIframeUrl = feConfigs?.botIframeUrl; const botIframeUrl = feConfigs?.botIframeUrl;
......
import { Button } from '@chakra-ui/react'; import { Button } from '@chakra-ui/react';
import { getWorkorderURL } from '@/web/common/workorder/api';
import { useRequest2 } from '@fastgpt/web/hooks/useRequest'; import { useRequest2 } from '@fastgpt/web/hooks/useRequest';
import { useTranslation } from 'next-i18next'; import { useTranslation } from 'next-i18next';
......
...@@ -45,6 +45,7 @@ import { useMount } from 'ahooks'; ...@@ -45,6 +45,7 @@ import { useMount } from 'ahooks';
import MyDivider from '@fastgpt/web/components/common/MyDivider'; import MyDivider from '@fastgpt/web/components/common/MyDivider';
import { useUploadAvatar } from '@fastgpt/web/common/file/hooks/useUploadAvatar'; import { useUploadAvatar } from '@fastgpt/web/common/file/hooks/useUploadAvatar';
import { getUploadAvatarPresignedUrl } from '@/web/common/file/api'; import { getUploadAvatarPresignedUrl } from '@/web/common/file/api';
import { TeamErrEnum } from '@fastgpt/global/common/error/code/team';
const RedeemCouponModal = dynamic(() => import('@/pageComponents/account/info/RedeemCouponModal'), { const RedeemCouponModal = dynamic(() => import('@/pageComponents/account/info/RedeemCouponModal'), {
ssr: false ssr: false
...@@ -717,19 +718,34 @@ const ButtonStyles = { ...@@ -717,19 +718,34 @@ const ButtonStyles = {
fontSize: 'sm' fontSize: 'sm'
}; };
const Other = ({ onOpenContact }: { onOpenContact: () => void }) => { const Other = ({ onOpenContact }: { onOpenContact: () => void }) => {
const { feConfigs } = useSystemStore(); const { feConfigs, setNotSufficientModalType, subPlans } = useSystemStore();
const { teamPlanStatus } = useUserStore(); const { teamPlanStatus } = useUserStore();
const { t } = useTranslation(); const { t } = useTranslation();
const { isPc } = useSystem(); const { isPc } = useSystem();
const { runAsync: onFeedback } = useRequest2(getWorkorderURL, { const { runAsync: onFeedback } = useRequest2(
manual: true, async () => {
onSuccess(data) { const plan = teamPlanStatus?.standard?.currentSubLevel
? subPlans?.standard?.[teamPlanStatus?.standard?.currentSubLevel]
: undefined;
const ticketResponseTime =
teamPlanStatus?.standard?.ticketResponseTime ?? plan?.ticketResponseTime;
const hasTicketAccess = !!ticketResponseTime;
if (!hasTicketAccess) {
setNotSufficientModalType(TeamErrEnum.ticketNotAvailable);
return;
}
const data = await getWorkorderURL();
if (data) { if (data) {
window.open(data.redirectUrl); window.open(data.redirectUrl);
} }
},
{
manual: true
} }
}); );
return ( return (
<Box> <Box>
...@@ -767,16 +783,14 @@ const Other = ({ onOpenContact }: { onOpenContact: () => void }) => { ...@@ -767,16 +783,14 @@ const Other = ({ onOpenContact }: { onOpenContact: () => void }) => {
</Box> </Box>
</Flex> </Flex>
)} )}
{feConfigs?.show_workorder && {feConfigs?.show_workorder && (
teamPlanStatus && <Flex onClick={onFeedback} {...ButtonStyles}>
teamPlanStatus.standard?.currentSubLevel !== StandardSubLevelEnum.free && ( <MyIcon name={'feedback'} w={'18px'} color={'myGray.600'} />
<Flex onClick={onFeedback} {...ButtonStyles}> <Box ml={2} flex={1}>
<MyIcon name={'feedback'} w={'18px'} color={'myGray.600'} /> {t('common:question_feedback')}
<Box ml={2} flex={1}> </Box>
{t('common:question_feedback')} </Flex>
</Box> )}
</Flex>
)}
</Grid> </Grid>
</Box> </Box>
); );
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment