4.8.5 test fix (#1862)
* app list ui * feat: photo view * perf: app dataset filter * perf: app dataset filter * fix: chat recently apps * perf: workflow header phone * default templates * default templates * fix: input guide phone * fix: i18n * team chat history * remove code * perf: mongo connection * log level
This commit is contained in:
@@ -37,7 +37,7 @@ async function handler(req: NextApiRequest) {
|
||||
fileId,
|
||||
isQAImport: true
|
||||
});
|
||||
console.log(rawText);
|
||||
|
||||
// 2. split chunks
|
||||
const chunks = rawText2Chunks({
|
||||
rawText,
|
||||
|
||||
@@ -96,16 +96,6 @@ const AppCard = () => {
|
||||
>
|
||||
{t('core.Chat')}
|
||||
</Button>
|
||||
{appDetail.permission.hasWritePer && feConfigs?.show_team_chat && (
|
||||
<Button
|
||||
size={['sm', 'md']}
|
||||
variant={'whitePrimary'}
|
||||
leftIcon={<DragHandleIcon w={'16px'} />}
|
||||
onClick={() => setTeamTagsSet(appDetail)}
|
||||
>
|
||||
{t('common.Team Tags Set')}
|
||||
</Button>
|
||||
)}
|
||||
{appDetail.permission.hasManagePer && (
|
||||
<Button
|
||||
size={['sm', 'md']}
|
||||
@@ -133,7 +123,16 @@ const AppCard = () => {
|
||||
icon: 'core/app/type/workflow',
|
||||
label: appT('Transition to workflow'),
|
||||
onClick: () => setTransitionCreateNew(true)
|
||||
}
|
||||
},
|
||||
...(appDetail.permission.hasWritePer && feConfigs?.show_team_chat
|
||||
? [
|
||||
{
|
||||
icon: 'core/chat/fileSelect',
|
||||
label: t('common.Team Tags Set'),
|
||||
onClick: () => setTeamTagsSet(appDetail)
|
||||
}
|
||||
]
|
||||
: [])
|
||||
]
|
||||
},
|
||||
{
|
||||
|
||||
@@ -59,12 +59,18 @@ const Edit = ({
|
||||
borderRadius={'lg'}
|
||||
overflowY={['auto', 'unset']}
|
||||
>
|
||||
<Box className={styles.EditAppBox} pr={[0, 1]} overflowY={'auto'} minW={'580px'} flex={'1'}>
|
||||
<Box
|
||||
className={styles.EditAppBox}
|
||||
pr={[0, 1]}
|
||||
overflowY={'auto'}
|
||||
minW={['auto', '580px']}
|
||||
flex={'1'}
|
||||
>
|
||||
<Box {...cardStyles} boxShadow={'2'}>
|
||||
<AppCard />
|
||||
</Box>
|
||||
|
||||
<Box mt={4} {...cardStyles} boxShadow={'3.5'} w={'auto'}>
|
||||
<Box mt={4} {...cardStyles} boxShadow={'3.5'}>
|
||||
<EditForm appForm={appForm} setAppForm={setAppForm} />
|
||||
</Box>
|
||||
</Box>
|
||||
|
||||
@@ -57,6 +57,7 @@ const BoxStyles: BoxProps = {
|
||||
};
|
||||
const LabelStyles: BoxProps = {
|
||||
w: ['60px', '100px'],
|
||||
whiteSpace: 'nowrap',
|
||||
flexShrink: 0,
|
||||
fontSize: 'xs'
|
||||
};
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import React, { useCallback, useMemo } from 'react';
|
||||
import { Box, Flex, Button, IconButton } from '@chakra-ui/react';
|
||||
import { Box, Flex, Button, IconButton, HStack } from '@chakra-ui/react';
|
||||
import { useTranslation } from 'next-i18next';
|
||||
import dynamic from 'next/dynamic';
|
||||
|
||||
@@ -79,9 +79,10 @@ const Header = () => {
|
||||
pl={[2, 4]}
|
||||
pr={[2, 6]}
|
||||
borderBottom={'base'}
|
||||
alignItems={'center'}
|
||||
alignItems={['flex-start', 'center']}
|
||||
userSelect={'none'}
|
||||
h={'67px'}
|
||||
h={['auto', '67px']}
|
||||
flexWrap={'wrap'}
|
||||
{...(currentTab === TabEnum.appEdit
|
||||
? {
|
||||
bg: 'myGray.25'
|
||||
@@ -115,10 +116,9 @@ const Header = () => {
|
||||
<Box flex={1} />
|
||||
|
||||
{currentTab === TabEnum.appEdit && (
|
||||
<>
|
||||
<HStack flexDirection={['column', 'row']} spacing={[2, 3]}>
|
||||
{!historiesDefaultData && (
|
||||
<IconButton
|
||||
mr={[2, 4]}
|
||||
icon={<MyIcon name={'history'} w={'18px'} />}
|
||||
aria-label={''}
|
||||
size={'sm'}
|
||||
@@ -157,7 +157,6 @@ const Header = () => {
|
||||
<Box>
|
||||
<MyTooltip label={t('core.app.Publish app tip')}>
|
||||
<Button
|
||||
ml={[2, 4]}
|
||||
size={'sm'}
|
||||
leftIcon={<MyIcon name={'common/publishFill'} w={['14px', '16px']} />}
|
||||
>
|
||||
@@ -169,7 +168,7 @@ const Header = () => {
|
||||
onConfirm={() => onclickPublish()}
|
||||
/>
|
||||
)}
|
||||
</>
|
||||
</HStack>
|
||||
)}
|
||||
</Flex>
|
||||
{historiesDefaultData && (
|
||||
|
||||
@@ -27,7 +27,10 @@ const SelectAppModal = ({
|
||||
|
||||
const getAppList = useCallback(
|
||||
async ({ parentId }: GetResourceFolderListProps) => {
|
||||
return getMyApps({ parentId }).then((res) =>
|
||||
return getMyApps({
|
||||
parentId,
|
||||
type: [AppTypeEnum.folder, AppTypeEnum.simple, AppTypeEnum.workflow]
|
||||
}).then((res) =>
|
||||
res
|
||||
.filter((item) => !filterAppIds.includes(item._id))
|
||||
.map<GetResourceListItemResponse>((item) => ({
|
||||
|
||||
@@ -50,15 +50,18 @@ const CreateModal = ({ onClose, type }: { type: CreateAppType; onClose: () => vo
|
||||
[AppTypeEnum.simple]: {
|
||||
icon: 'core/app/simpleBot',
|
||||
title: appT('type.Create simple bot'),
|
||||
avatar: '/imgs/app/avatar/simple.svg',
|
||||
templates: simpleBotTemplates
|
||||
},
|
||||
[AppTypeEnum.workflow]: {
|
||||
icon: 'core/app/type/workflowFill',
|
||||
avatar: '/imgs/app/avatar/workflow.svg',
|
||||
title: appT('type.Create workflow bot'),
|
||||
templates: workflowTemplates
|
||||
},
|
||||
[AppTypeEnum.plugin]: {
|
||||
icon: 'core/app/type/pluginFill',
|
||||
avatar: '/imgs/app/avatar/plugin.svg',
|
||||
title: appT('type.Create plugin bot'),
|
||||
templates: pluginTemplates
|
||||
}
|
||||
@@ -67,7 +70,7 @@ const CreateModal = ({ onClose, type }: { type: CreateAppType; onClose: () => vo
|
||||
|
||||
const { register, setValue, watch, handleSubmit } = useForm<FormType>({
|
||||
defaultValues: {
|
||||
avatar: '',
|
||||
avatar: typeData.avatar,
|
||||
name: '',
|
||||
templateId: typeData.templates[0].id
|
||||
}
|
||||
@@ -146,7 +149,7 @@ const CreateModal = ({ onClose, type }: { type: CreateAppType; onClose: () => vo
|
||||
w={['28px', '32px']}
|
||||
h={['28px', '32px']}
|
||||
cursor={'pointer'}
|
||||
borderRadius={'md'}
|
||||
borderRadius={'sm'}
|
||||
onClick={onOpenSelectFile}
|
||||
/>
|
||||
</MyTooltip>
|
||||
|
||||
@@ -180,8 +180,8 @@ const ListItem = () => {
|
||||
})}
|
||||
>
|
||||
<HStack>
|
||||
<Avatar src={app.avatar} borderRadius={'md'} w={'1.5rem'} />
|
||||
<Box flex={'1 0 0'} fontSize={'1.125rem'}>
|
||||
<Avatar src={app.avatar} borderRadius={'sm'} w={'1.5rem'} />
|
||||
<Box flex={'1 0 0'} color={'myGray.900'}>
|
||||
{app.name}
|
||||
</Box>
|
||||
<Box mr={'-1.25rem'}>
|
||||
@@ -189,7 +189,7 @@ const ListItem = () => {
|
||||
</Box>
|
||||
</HStack>
|
||||
<Box
|
||||
flex={['1 0 60px', '1 0 80px']}
|
||||
flex={['1 0 60px', '1 0 72px']}
|
||||
mt={3}
|
||||
pr={8}
|
||||
textAlign={'justify'}
|
||||
@@ -209,21 +209,26 @@ const ListItem = () => {
|
||||
<HStack spacing={3.5}>
|
||||
{owner && (
|
||||
<HStack spacing={1}>
|
||||
<Avatar src={owner.avatar} w={'0.875rem'} />
|
||||
<Avatar src={owner.avatar} w={'0.875rem'} borderRadius={'50%'} />
|
||||
<Box maxW={'150px'} className="textEllipsis">
|
||||
{owner.memberName}
|
||||
</Box>
|
||||
</HStack>
|
||||
)}
|
||||
|
||||
<PermissionIconText defaultPermission={app.defaultPermission} w={'0.875rem'} />
|
||||
<PermissionIconText
|
||||
defaultPermission={app.defaultPermission}
|
||||
color={'myGray.500'}
|
||||
iconColor={'myGray.400'}
|
||||
w={'0.875rem'}
|
||||
/>
|
||||
</HStack>
|
||||
|
||||
<HStack>
|
||||
{isPc && (
|
||||
<HStack spacing={0.5} className="time">
|
||||
<MyIcon name={'history'} w={'0.85rem'} />
|
||||
<Box>{formatTimeToChatTime(app.updateTime)}</Box>
|
||||
<MyIcon name={'history'} w={'0.85rem'} color={'myGray.400'} />
|
||||
<Box color={'myGray.500'}>{formatTimeToChatTime(app.updateTime)}</Box>
|
||||
</HStack>
|
||||
)}
|
||||
{app.permission.hasManagePer && (
|
||||
@@ -292,17 +297,21 @@ const ListItem = () => {
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
children: [
|
||||
{
|
||||
icon: 'core/chat/chatLight',
|
||||
label: appT('Go to chat'),
|
||||
onClick: () => {
|
||||
router.push(`/chat?appId=${app._id}`);
|
||||
...([AppTypeEnum.simple, AppTypeEnum.workflow].includes(app.type)
|
||||
? [
|
||||
{
|
||||
children: [
|
||||
{
|
||||
icon: 'core/chat/chatLight',
|
||||
label: appT('Go to chat'),
|
||||
onClick: () => {
|
||||
router.push(`/chat?appId=${app._id}`);
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
]
|
||||
},
|
||||
]
|
||||
: []),
|
||||
...(app.permission.isOwner
|
||||
? [
|
||||
{
|
||||
|
||||
@@ -165,7 +165,7 @@ const ChatHistorySlider = ({
|
||||
}}
|
||||
list={[
|
||||
{ label: t('core.chat.Recent use'), value: TabEnum.recently },
|
||||
{ label: t('App'), value: TabEnum.app },
|
||||
...(!isTeamChat ? [{ label: t('App'), value: TabEnum.app }] : []),
|
||||
{ label: t('core.chat.History'), value: TabEnum.history }
|
||||
]}
|
||||
value={currentTab}
|
||||
|
||||
@@ -23,7 +23,10 @@ const SliderApps = ({ apps, activeAppId }: { apps: AppListItemType[]; activeAppI
|
||||
const isTeamChat = router.pathname === '/chat/team';
|
||||
|
||||
const getAppList = useCallback(async ({ parentId }: GetResourceFolderListProps) => {
|
||||
return getMyApps({ parentId }).then((res) =>
|
||||
return getMyApps({
|
||||
parentId,
|
||||
type: [AppTypeEnum.folder, AppTypeEnum.simple, AppTypeEnum.workflow]
|
||||
}).then((res) =>
|
||||
res.map<GetResourceListItemResponse>((item) => ({
|
||||
id: item._id,
|
||||
name: item.name,
|
||||
|
||||
@@ -73,6 +73,7 @@ const RegisterForm = ({ setPageType, loginSuccess }: Props) => {
|
||||
avatar: template.avatar,
|
||||
name: t(template.name),
|
||||
modules: template.modules,
|
||||
edges: template.edges,
|
||||
type: template.type
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user