diff --git a/web/app/components/app-sidebar/dataset-info/index.tsx b/web/app/components/app-sidebar/dataset-info/index.tsx index 2d2eeefbb2..ba82099b6c 100644 --- a/web/app/components/app-sidebar/dataset-info/index.tsx +++ b/web/app/components/app-sidebar/dataset-info/index.tsx @@ -71,7 +71,7 @@ const DatasetInfo: FC = ({
{isExternalProvider && t('externalTag', { ns: 'dataset' })} - {!isExternalProvider && isPipelinePublished && dataset.doc_form && dataset.indexing_technique && ( + {!!(!isExternalProvider && isPipelinePublished && dataset.doc_form && dataset.indexing_technique) && (
{t(`chunkingMode.${DOC_FORM_TEXT[dataset.doc_form]}`, { ns: 'dataset' })} {formatIndexingTechniqueAndMethod(dataset.indexing_technique, dataset.retrieval_model_dict?.search_method)} diff --git a/web/app/components/app-sidebar/dataset-sidebar-dropdown.tsx b/web/app/components/app-sidebar/dataset-sidebar-dropdown.tsx index 4ba9814255..c81125e973 100644 --- a/web/app/components/app-sidebar/dataset-sidebar-dropdown.tsx +++ b/web/app/components/app-sidebar/dataset-sidebar-dropdown.tsx @@ -114,7 +114,7 @@ const DatasetSidebarDropdown = ({
{isExternalProvider && t('externalTag', { ns: 'dataset' })} - {!isExternalProvider && dataset.doc_form && dataset.indexing_technique && ( + {!!(!isExternalProvider && dataset.doc_form && dataset.indexing_technique) && (
{t(`chunkingMode.${DOC_FORM_TEXT[dataset.doc_form]}`, { ns: 'dataset' })} {formatIndexingTechniqueAndMethod(dataset.indexing_technique, dataset.retrieval_model_dict?.search_method)} diff --git a/web/app/components/app/annotation/edit-annotation-modal/index.tsx b/web/app/components/app/annotation/edit-annotation-modal/index.tsx index b7f7cd1600..2595ec38b2 100644 --- a/web/app/components/app/annotation/edit-annotation-modal/index.tsx +++ b/web/app/components/app/annotation/edit-annotation-modal/index.tsx @@ -144,7 +144,7 @@ const EditAnnotationModal: FC = ({
{t('editModal.removeThisCache', { ns: 'appAnnotation' })}
- {createdAt && ( + {!!createdAt && (
{t('editModal.createdAt', { ns: 'appAnnotation' })}   diff --git a/web/app/components/app/configuration/base/feature-panel/index.tsx b/web/app/components/app/configuration/base/feature-panel/index.tsx index 06ae2ab10a..7f337c1572 100644 --- a/web/app/components/app/configuration/base/feature-panel/index.tsx +++ b/web/app/components/app/configuration/base/feature-panel/index.tsx @@ -28,16 +28,16 @@ const FeaturePanel: FC = ({
- {headerIcon &&
{headerIcon}
} + {!!headerIcon &&
{headerIcon}
}
{title}
- {headerRight &&
{headerRight}
} + {!!headerRight &&
{headerRight}
}
{/* Body */} - {children && ( + {!!children && (
{children}
diff --git a/web/app/components/app/configuration/dataset-config/card-item/index.tsx b/web/app/components/app/configuration/dataset-config/card-item/index.tsx index 81c2b470ad..00d3f6d6ad 100644 --- a/web/app/components/app/configuration/dataset-config/card-item/index.tsx +++ b/web/app/components/app/configuration/dataset-config/card-item/index.tsx @@ -91,7 +91,7 @@ const Item: FC = ({
{ - config.indexing_technique && ( + !!config.indexing_technique && ( = ({
)} { - item.indexing_technique && ( + !!item.indexing_technique && ( = ({ />
- {currentDataset && currentDataset.indexing_technique && ( + {!!(currentDataset && currentDataset.indexing_technique) && (
{t('form.indexMethod', { ns: 'datasetSettings' })}
diff --git a/web/app/components/app/configuration/debug/debug-with-single-model/index.spec.tsx b/web/app/components/app/configuration/debug/debug-with-single-model/index.spec.tsx index b9a1c5ba8b..08bdd2bfcb 100644 --- a/web/app/components/app/configuration/debug/debug-with-single-model/index.spec.tsx +++ b/web/app/components/app/configuration/debug/debug-with-single-model/index.spec.tsx @@ -465,8 +465,8 @@ vi.mock('@/app/components/base/chat/chat', () => ({
))}
- {questionIcon &&
{questionIcon}
} - {answerIcon &&
{answerIcon}
} + {!!questionIcon &&
{questionIcon}
} + {!!answerIcon &&
{answerIcon}
}