Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add error message for auto extraction incompatible leads #2801

Merged
merged 1 commit into from
Dec 20, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 9 additions & 1 deletion app/views/EntryEdit/LeftPane/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -67,8 +67,10 @@ const LEAD_PREVIEW = gql`
lead(id: $leadId) {
id
extractionStatus
confidentiality
leadPreview {
textExtract
textExtractionId
}
}
}
Expand Down Expand Up @@ -375,6 +377,9 @@ function LeftPane(props: Props) {
setShowCanvasDrawModalTrue();
}, [fullScreenMode, setShowCanvasDrawModalTrue, setShowScreenshotFalse]);

const isAutoExtractionCompatible = isDefined(leadPreview?.textExtractionId)
&& leadPreviewData?.project?.lead?.confidentiality !== 'CONFIDENTIAL';

const originalTabContent = (
<Container
elementRef={containerRef}
Expand Down Expand Up @@ -548,13 +553,16 @@ function LeftPane(props: Props) {
<Button
className={styles.autoEntriesButton}
name={undefined}
title={!isAutoExtractionCompatible
? 'Ooops. Looks like this source does not support Auto extraction at the moment. Please try it with a new source.'
: 'Extract entries for this source'}
onClick={showAutoEntriesModal}
variant="nlp-tertiary"
spacing="compact"
disabled={!isAutoExtractionCompatible}
>
NLP Extract and Classify
</Button>

{(leadPreview?.textExtract?.length ?? 0) > 0 ? (
<SimplifiedTextView
className={styles.simplifiedTextView}
Expand Down
Loading