Skip to content

Commit

Permalink
feat: support null text values in analyze results (#744)
Browse files Browse the repository at this point in the history
* feat: support null text values in analyze results

* refactor: use italic style for null values
  • Loading branch information
stew-ro authored Nov 11, 2020
1 parent 6994ac9 commit 0ddb7f1
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 7 deletions.
5 changes: 5 additions & 0 deletions src/react/components/pages/predict/predictResult.scss
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,11 @@
margin-bottom: 2px;
padding-left: 3px;
font-size: 0.95em;

&-null {
font-style: italic;
list-style-type: none;
}
}
}

Expand Down
24 changes: 17 additions & 7 deletions src/react/components/pages/predict/predictResult.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -98,13 +98,23 @@ export default class PredictResult extends React.Component<IPredictResultProps,
{this.getPredictionTagContent(item)}
</div>
</li>
<li className={postProcessedValue ? "predictiontag-item-label mt-0" : "predictiontag-item-label mt-0 mb-1"}>
{postProcessedValue ? "text: " + item.text : item.text}
</li>
{postProcessedValue &&
<li className="predictiontag-item-label mb-1">
{postProcessedValue}
</li>
{item.text === null ?
<>
<li className={postProcessedValue ? "predictiontag-item-label-null mt-0" : "predictiontag-item-label-null mt-0 mb-1"}>
{postProcessedValue ? "text: NULL": "NULL"}
</li>
</>
:
<>
<li className={postProcessedValue ? "predictiontag-item-label mt-0" : "predictiontag-item-label mt-0 mb-1"}>
{postProcessedValue ? "text: " + item.text : item.text}
</li>
{postProcessedValue &&
<li className="predictiontag-item-label mb-1">
{postProcessedValue}
</li>
}
</>
}
</div>
);
Expand Down

0 comments on commit 0ddb7f1

Please sign in to comment.