Skip to content

Commit

Permalink
Merge pull request #2982 from the-deep/fix/automatic-analytical-state…
Browse files Browse the repository at this point in the history
…ment

Fix Automatic analytical statement
  • Loading branch information
AdityaKhatri authored Aug 9, 2024
2 parents c8f5f58 + f207e91 commit 1a7bf10
Show file tree
Hide file tree
Showing 2 changed files with 101 additions and 109 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ import {
Button,
CollapsibleContainer,
Container,
Header,
ListView,
Modal,
QuickActionButton,
Expand Down Expand Up @@ -397,7 +398,7 @@ function StoryAnalysisModal(props: Props) {
? `**Analytical Statement** \n \n ${analyticalStatement} \n \n`
: '';
const entriesText = generatedReportText
? `**Evidences** \n \n ${generatedReportText} \n \n`
? `**Evidence** \n \n ${generatedReportText} \n \n`
: '';

const myAnalysis = myAnalysisHeading
Expand Down Expand Up @@ -592,38 +593,39 @@ function StoryAnalysisModal(props: Props) {
<div className={styles.markdownContainer}>
<MarkdownEditor
className={styles.editor}
labelContainerClassName={styles.labelContainer}
label={(
<>
<div>
Information Gaps
</div>
<div className={styles.labelContainerAction}>
<QuickActionConfirmButton
name={undefined}
title="Auto generate Information Gaps using NLP"
message="You are about to auto generate Information Gaps using NLP. This will replace the current information gaps. Are you sure you want to continue?"
onConfirm={informationGapOnClick}
disabled={project?.isPrivate || pending}
variant="nlp-primary"
>
<Svg
className={styles.brainIcon}
src={brainIcon}
/>
</QuickActionConfirmButton>
{project?.isPrivate && (
<div className={styles.info}>
<IoInformation />
<Tooltip>
Auto generate is not available
for private projects to
maintain document privacy.
</Tooltip>
</div>
)}
</div>
</>
<Header
actions={(
<>
<QuickActionConfirmButton
name={undefined}
title="Auto generate Information Gaps using NLP"
message="You are about to auto generate Information Gaps using NLP. This will replace the current information gaps. Are you sure you want to continue?"
onConfirm={informationGapOnClick}
disabled={project?.isPrivate || pending}
variant="nlp-primary"
>
<Svg
className={styles.brainIcon}
src={brainIcon}
/>
</QuickActionConfirmButton>
{project?.isPrivate && (
<div className={styles.info}>
<IoInformation />
<Tooltip>
Auto generate is not available
for private projects to
maintain document privacy.
</Tooltip>
</div>
)}
</>
)}
headingSize="extraSmall"
spacing="comfortable"
heading="Information Gaps"
/>
)}
name="informationGap"
value={informationGaps}
Expand Down Expand Up @@ -662,36 +664,38 @@ function StoryAnalysisModal(props: Props) {
className={styles.editor}
labelContainerClassName={styles.labelContainer}
label={(
<>
<div>
Analytical Statament
</div>
<div className={styles.labelContainerAction}>
<QuickActionConfirmButton
name={undefined}
title="Auto generate Analytical Statement using NLP"
message="You are about to auto generate Analytical Statement using NLP. This will replace the current Analytical Statement. Are you sure you want to continue?"
onConfirm={onStatementGenerateClick}
disabled={project?.isPrivate || pending}
variant="nlp-primary"
>
<Svg
className={styles.brainIcon}
src={brainIcon}
/>
</QuickActionConfirmButton>
{project?.isPrivate && (
<div className={styles.info}>
<IoInformation />
<Tooltip>
Auto generate is not available
for private projects to
maintain document privacy.
</Tooltip>
</div>
)}
</div>
</>
<Header
actions={(
<>
<QuickActionConfirmButton
name={undefined}
title="Auto generate Analytical Statement using NLP"
message="You are about to auto generate Analytical Statement using NLP. This will replace the current Analytical Statement. Are you sure you want to continue?"
onConfirm={onStatementGenerateClick}
disabled={project?.isPrivate || pending}
variant="nlp-primary"
>
<Svg
className={styles.brainIcon}
src={brainIcon}
/>
</QuickActionConfirmButton>
{project?.isPrivate && (
<div className={styles.info}>
<IoInformation />
<Tooltip>
Auto generate is not available
for private projects to
maintain document privacy.
</Tooltip>
</div>
)}
</>
)}
headingSize="extraSmall"
spacing="comfortable"
heading="Analytical Statament"
/>
)}
name="analyticalStatement"
value={analyticalStatement}
Expand All @@ -704,36 +708,38 @@ function StoryAnalysisModal(props: Props) {
labelContainerClassName={styles.labelContainer}
inputSectionClassName={styles.inputSection}
label={(
<>
<div>
My Analysis
</div>
<div className={styles.labelContainerAction}>
<QuickActionConfirmButton
name={undefined}
title="Auto generate My Analysis using NLP"
message="You are about to auto generate 'My Analysis' using NLP. This will use the current analytical statement, automatic summary, informations gap, entries and replace the current 'My analysis'. Are you sure you want to continue?"
onConfirm={onAnalysisGenerateClick}
disabled={project?.isPrivate || pending}
variant="nlp-primary"
>
<Svg
className={styles.brainIcon}
src={brainIcon}
/>
</QuickActionConfirmButton>
{project?.isPrivate && (
<div className={styles.info}>
<IoInformation />
<Tooltip>
Auto generate is not available
for private projects to
maintain document privacy.
</Tooltip>
</div>
)}
</div>
</>
<Header
actions={(
<>
<QuickActionConfirmButton
name={undefined}
title="Auto generate My Analysis using NLP"
message="You are about to auto generate 'My Analysis' using NLP. This will use the current analytical statement, automatic summary, informations gap, entries and replace the current 'My analysis'. Are you sure you want to continue?"
onConfirm={onAnalysisGenerateClick}
disabled={project?.isPrivate || pending}
variant="nlp-primary"
>
<Svg
className={styles.brainIcon}
src={brainIcon}
/>
</QuickActionConfirmButton>
{project?.isPrivate && (
<div className={styles.info}>
<IoInformation />
<Tooltip>
Auto generate is not available
for private projects to
maintain document privacy.
</Tooltip>
</div>
)}
</>
)}
headingSize="extraSmall"
spacing="comfortable"
heading="My Analysis"
/>
)}
name="reportText"
value={reportText}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -128,24 +128,10 @@
.editor {
display: flex;
flex-grow: 1;
gap: var(--dui-width-separator-thin);

.label-container {
display: flex;
justify-content: space-between;
padding-bottom: var(--dui-spacing-small);
color: var(--dui-color-text);
font-size: var(--dui-font-size-large);
font-weight: var(--dui-font-weight-bold);
}

.label-container-action {
display: flex;

.brain-icon {
width: auto;
height: var(--dui-font-size-extra-large);
}
.brain-icon {
width: auto;
height: var(--dui-font-size-extra-large);
}
}
}
Expand Down

0 comments on commit 1a7bf10

Please sign in to comment.