Release/v0.2.4 (#397)
* Fix/bug en zh (#389) * [fix]The log retains genuine alerts and errors, while filtering out unnecessary noise. * [fix]Scenario English and Chinese, emotion specifications * [fix]Change the "no data" scenario from 0.0 to None * [fix]The emotional health indicators, emotional advice, and emotional distribution analysis are all linked together. * [fix]The emotional health indicators, emotional advice, and emotional distribution analysis are all linked together. * [fix]Separate expected errors from unexpected errors * [changes]Translation of emotion labels, and the list of hosts arranged in the order of creation * [changes]Translation of emotion labels, and the list of hosts arranged in the order of creation * feat(web): improve knowledge base form validation and parser config handling - Refactor form validation logic to support tab-specific field validation in edit mode - Add conditional validation for knowledge graph fields when editing existing knowledge base - Preserve all existing parser_config fields when merging graphrag configuration - Skip third-party authentication check when editing on knowledge graph tab - Update form value retrieval to include disabled fields using getFieldsValue(true) - Improve comments to clarify parser_config field preservation and validation behavior - This change enables users to edit knowledge graph settings without re-validating all basic configuration fields * fix(web): improve infinite scroll handling in knowledge base list - Add auto-load detection when initial data doesn't fill viewport to prevent empty scrollbar - Implement scroll height check to automatically load more data if content is insufficient - Fix hasMore condition to prevent premature loader hiding - Update loader visibility to only show when data exists and is actively loading - Refine end message display to show only when all data is loaded and no more items available - Resolves issue where knowledge base list shows no scrollbar on initial load with limited items * fix(web): FileUpload bugfix * fix(web): change skill search key * Fix/bug en zh (#391) * [fix]The log retains genuine alerts and errors, while filtering out unnecessary noise. * [fix]Scenario English and Chinese, emotion specifications * [fix]Change the "no data" scenario from 0.0 to None * [fix]The emotional health indicators, emotional advice, and emotional distribution analysis are all linked together. * [fix]The emotional health indicators, emotional advice, and emotional distribution analysis are all linked together. * [fix]Separate expected errors from unexpected errors * [changes]Translation of emotion labels, and the list of hosts arranged in the order of creation * [changes]Translation of emotion labels, and the list of hosts arranged in the order of creation * [fix]The mainframe engineering supports Chinese verification. * [fix]The mainframe engineering supports Chinese verification. * fix(web): update en * fix(web): file upload bugfix * fix(web): memory-write node hide message config --------- Co-authored-by: 乐力齐 <162269739+lanceyq@users.noreply.github.com> Co-authored-by: yujiangping <yujiangping@taofen8.com> Co-authored-by: zhaoying <yzhao96@best-inc.com> Co-authored-by: yingzhao <zhaoyingyz@126.com>
This commit is contained in:
@@ -221,9 +221,9 @@ const CreateModal = forwardRef<CreateModalRef, CreateModalRefProps>(({
|
||||
status: record.status,
|
||||
};
|
||||
|
||||
// Process parser_config data, set default values if not present
|
||||
// Process parser_config data, preserve all existing fields and merge graphrag config
|
||||
baseValues.parser_config = {
|
||||
...record.parser_config,
|
||||
...record.parser_config, // Preserve all existing parser_config fields (yuque_user_id, yuque_token, feishu_app_id, etc.)
|
||||
graphrag: {
|
||||
use_graphrag: false,
|
||||
scene_name: '',
|
||||
@@ -362,12 +362,32 @@ const CreateModal = forwardRef<CreateModalRef, CreateModalRefProps>(({
|
||||
// Actual save logic
|
||||
const performSave = async () => {
|
||||
try {
|
||||
await form.validateFields();
|
||||
setLoading(true);
|
||||
const formValues = form.getFieldsValue();
|
||||
// Get fields to validate based on current tab and edit mode
|
||||
let fieldsToValidate: any[] | undefined = undefined;
|
||||
|
||||
// Check Third-party authentication before saving
|
||||
if (formValues.type === 'Third-party' || currentType === 'Third-party') {
|
||||
// If in edit mode and on knowledge graph tab, only validate knowledge graph fields
|
||||
if (datasets?.id && activeTab === 'knowledgeGraph') {
|
||||
fieldsToValidate = [
|
||||
['parser_config', 'graphrag', 'use_graphrag'],
|
||||
['parser_config', 'graphrag', 'scene_name'],
|
||||
['parser_config', 'graphrag', 'entity_types'],
|
||||
['parser_config', 'graphrag', 'method'],
|
||||
['parser_config', 'graphrag', 'resolution'],
|
||||
['parser_config', 'graphrag', 'community'],
|
||||
];
|
||||
}
|
||||
|
||||
// Validate only specified fields or all fields
|
||||
await form.validateFields(fieldsToValidate);
|
||||
setLoading(true);
|
||||
// Get all field values including disabled fields
|
||||
const formValues = form.getFieldsValue(true);
|
||||
|
||||
// Only check Third-party authentication when creating new or explicitly on basic config tab
|
||||
// Skip authentication check when editing and on knowledge graph tab
|
||||
const shouldCheckAuth = !datasets?.id || activeTab === 'basic';
|
||||
|
||||
if (shouldCheckAuth && (formValues.type === 'Third-party' || currentType === 'Third-party')) {
|
||||
const platform = formValues.parser_config?._third_party_platform || thirdPartyPlatform;
|
||||
|
||||
try {
|
||||
|
||||
@@ -334,6 +334,18 @@ const KnowledgeBaseManagement: FC = () => {
|
||||
setHasMore(hasNext);
|
||||
|
||||
buildModelMenus(list, isLoadMore);
|
||||
|
||||
// 首次加载后,检查是否需要自动加载更多(解决无滚动条问题)
|
||||
if (!isLoadMore && hasNext) {
|
||||
setTimeout(() => {
|
||||
const scrollDiv = document.getElementById('scrollableDiv');
|
||||
if (scrollDiv && scrollDiv.scrollHeight <= scrollDiv.clientHeight) {
|
||||
console.log('No scrollbar detected, auto-loading more data');
|
||||
setPage(2);
|
||||
fetchData(2, true);
|
||||
}
|
||||
}, 100);
|
||||
}
|
||||
} catch (error) {
|
||||
console.error('Failed to fetch knowledge base list:', error);
|
||||
if (!isLoadMore) {
|
||||
@@ -532,10 +544,10 @@ const KnowledgeBaseManagement: FC = () => {
|
||||
<InfiniteScroll
|
||||
dataLength={data.length}
|
||||
next={loadMore}
|
||||
hasMore={hasMore && !loading}
|
||||
loader={<div className="rb:text-center rb:py-4">{t('common.loading')}</div>}
|
||||
hasMore={hasMore}
|
||||
loader={loading && data.length > 0 ? <div className="rb:text-center rb:py-4">{t('common.loading')}</div> : null}
|
||||
endMessage={
|
||||
data.length > 0 ? (
|
||||
data.length > 0 && !hasMore ? (
|
||||
<div className="rb:text-center rb:py-4 rb:text-gray-400">
|
||||
{t('common.noMoreData')}
|
||||
</div>
|
||||
|
||||
Reference in New Issue
Block a user