fix: optimize feedback and app icon (#1099)

This commit is contained in:
bowen
2023-09-05 09:13:59 +08:00
committed by GitHub
parent 7c66d3c793
commit 4a28599fbd
15 changed files with 45 additions and 37 deletions

View File

@@ -134,7 +134,7 @@ const PromptValuePanel: FC<IPromptValuePanelProps> = ({
<div className="space-y-3 ">
{promptVariables.map(({ key, name, type, options, max_length, required }) => (
<div key={key} className="flex items-center justify-between">
<div className="mr-1 shrink-0 w-[120px] text-sm text-gray-900">{name || key}</div>
<div className="mr-1 shrink-0 w-[120px] text-sm text-gray-900 break-all">{name || key}</div>
{type === 'select'
? (
<Select

View File

@@ -288,7 +288,7 @@ const CompletionConversationDetailComp: FC<{ appId?: string; conversationId?: st
return true
}
catch (err) {
notify({ type: 'error', message: t('common.actionMsg.modificationFailed') })
notify({ type: 'error', message: t('common.actionMsg.modifiedUnsuccessfully') })
return false
}
}
@@ -301,7 +301,7 @@ const CompletionConversationDetailComp: FC<{ appId?: string; conversationId?: st
return true
}
catch (err) {
notify({ type: 'error', message: t('common.actionMsg.modificationFailed') })
notify({ type: 'error', message: t('common.actionMsg.modifiedUnsuccessfully') })
return false
}
}
@@ -332,7 +332,7 @@ const ChatConversationDetailComp: FC<{ appId?: string; conversationId?: string }
return true
}
catch (err) {
notify({ type: 'error', message: t('common.actionMsg.modificationFailed') })
notify({ type: 'error', message: t('common.actionMsg.modifiedUnsuccessfully') })
return false
}
}
@@ -344,7 +344,7 @@ const ChatConversationDetailComp: FC<{ appId?: string; conversationId?: string }
return true
}
catch (err) {
notify({ type: 'error', message: t('common.actionMsg.modificationFailed') })
notify({ type: 'error', message: t('common.actionMsg.modifiedUnsuccessfully') })
return false
}
}

View File

@@ -119,9 +119,11 @@ function AppCard({
}
const onGenCode = async () => {
setGenLoading(true)
await asyncRunSafe(onGenerateCode?.() as any)
setGenLoading(false)
if (onGenerateCode) {
setGenLoading(true)
await asyncRunSafe(onGenerateCode())
setGenLoading(false)
}
}
return (

View File

@@ -46,7 +46,8 @@ const SettingsModal: FC<ISettingsModalProps> = ({
onSave,
}) => {
const [isShowMore, setIsShowMore] = useState(false)
const { title, description, copyright, privacy_policy, default_language, icon, icon_background } = appInfo.site
const { icon, icon_background } = appInfo
const { title, description, copyright, privacy_policy, default_language } = appInfo.site
const [inputInfo, setInputInfo] = useState({ title, desc: description, copyright, privacyPolicy: privacy_policy })
const [language, setLanguage] = useState(default_language)
const [saveLoading, setSaveLoading] = useState(false)

View File

@@ -41,8 +41,8 @@ const ConfirmUI: FC<IConfirmUIProps> = ({
</div>
<div className='flex gap-3 mt-4 ml-12'>
<div onClick={onConfirm} className='w-20 leading-[34px] text-center text-white border rounded-lg cursor-pointer h-9 border-color-primary-700 bg-primary-700'>{confirmText || t('common.operation.confirm')}</div>
<div onClick={onCancel} className='w-20 leading-[34px] text-center text-gray-500 border rounded-lg cursor-pointer h-9 border-color-gray-200'>{cancelText || t('common.operation.cancel')}</div>
<div onClick={onConfirm} className='w-20 leading-9 text-center text-white border rounded-lg cursor-pointer h-9 border-color-primary-700 bg-primary-700'>{confirmText || t('common.operation.confirm')}</div>
<div onClick={onCancel} className='w-20 leading-9 text-center text-gray-500 border rounded-lg cursor-pointer h-9 border-color-gray-200'>{cancelText || t('common.operation.cancel')}</div>
</div>
</div>

View File

@@ -304,7 +304,7 @@ const Completed: FC<ICompletedProps> = ({
setAllSegments([...allSegments])
}
else {
notify({ type: 'error', message: t('common.actionMsg.modificationFailed') })
notify({ type: 'error', message: t('common.actionMsg.modifiedUnsuccessfully') })
}
}
@@ -315,7 +315,7 @@ const Completed: FC<ICompletedProps> = ({
resetList()
}
else {
notify({ type: 'error', message: t('common.actionMsg.modificationFailed') })
notify({ type: 'error', message: t('common.actionMsg.modifiedUnsuccessfully') })
}
}

View File

@@ -206,7 +206,7 @@ const EmbeddingDetail: FC<Props> = ({ detail, stopPosition = 'top', datasetId: d
setIndexingStatusDetail(null)
}
else {
notify({ type: 'error', message: t('common.actionMsg.modificationFailed') })
notify({ type: 'error', message: t('common.actionMsg.modifiedUnsuccessfully') })
}
}

View File

@@ -292,7 +292,7 @@ const Metadata: FC<IMetadataProps> = ({ docDetail, loading, onUpdate }) => {
if (!e)
notify({ type: 'success', message: t('common.actionMsg.modifiedSuccessfully') })
else
notify({ type: 'error', message: t('common.actionMsg.modificationFailed') })
notify({ type: 'error', message: t('common.actionMsg.modifiedUnsuccessfully') })
onUpdate?.()
setEditStatus(false)
setSaveLoading(false)

View File

@@ -150,7 +150,7 @@ export const OperationAction: FC<{
if (!e)
notify({ type: 'success', message: t('common.actionMsg.modifiedSuccessfully') })
else
notify({ type: 'error', message: t('common.actionMsg.modificationFailed') })
notify({ type: 'error', message: t('common.actionMsg.modifiedUnsuccessfully') })
onUpdate(operationName)
}

View File

@@ -70,7 +70,7 @@ const Form = ({
await mutateDatasets()
}
catch (e) {
notify({ type: 'error', message: t('common.actionMsg.modificationFailed') })
notify({ type: 'error', message: t('common.actionMsg.modifiedUnsuccessfully') })
}
finally {
setLoading(false)

View File

@@ -44,7 +44,7 @@ export const ChatBtn: FC<{ onClick: () => void; className?: string }> = ({
return (
<Button
type='primary'
className={cn(className, `flex items-center ${s.customBtn} gap-2`)}
className={cn(className, `!px-0 flex items-center ${s.customBtn} gap-2`)}
onClick={onClick}>
<svg width="20" height="20" viewBox="0 0 20 20" fill="none" xmlns="http://www.w3.org/2000/svg">
<path fillRule="evenodd" clipRule="evenodd" d="M18 10.5C18 14.366 14.418 17.5 10 17.5C8.58005 17.506 7.17955 17.1698 5.917 16.52L2 17.5L3.338 14.377C2.493 13.267 2 11.934 2 10.5C2 6.634 5.582 3.5 10 3.5C14.418 3.5 18 6.634 18 10.5ZM7 9.5H5V11.5H7V9.5ZM15 9.5H13V11.5H15V9.5ZM9 9.5H11V11.5H9V9.5Z" fill="white" />