Skip to content

Commit

Permalink
Merge pull request #585 from AFP-Medialab/assistant/credibility-signa…
Browse files Browse the repository at this point in the history
…ls-fix-accordion

Assistant/credibility signals fix accordion
  • Loading branch information
Sallaa authored Sep 13, 2024
2 parents c78cf42 + 6b1177b commit 651b753
Show file tree
Hide file tree
Showing 4 changed files with 552 additions and 591 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { useSelector } from "react-redux";

import Box from "@mui/material/Box";
import Card from "@mui/material/Card";
import { CardHeader, Grid2 } from "@mui/material";
import { CardHeader, Grid2, ListItemButton } from "@mui/material";
import CardContent from "@mui/material/CardContent";
import Collapse from "@mui/material/Collapse";
import Divider from "@mui/material/Divider";
Expand Down Expand Up @@ -146,9 +146,8 @@ const AssistantNEResult = () => {
<List>
{neResult.map((value, index) => (
<Box key={index}>
<ListItem
<ListItemButton
key={index}
button
onClick={() => handleCollapse(index)}
>
<ListItemText
Expand All @@ -165,7 +164,7 @@ const AssistantNEResult = () => {
) : (
<ExpandMore />
)}
</ListItem>
</ListItemButton>
<Collapse in={index === selectedIndex}>
<List component="div" disablePadding>
{value["words"].map((v, k) => (
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ import { getUrlTypeFromCredScope } from "./assistantUtils";
const renderScope = (keyword, scope) => {
return (
<ListItem>
{scope.includes("/") ? (
{scope && scope.includes("/") ? (
<Typography variant={"subtitle2"}>
{` ${keyword("account_scope")} ${scope} `}
</Typography>
Expand Down Expand Up @@ -139,7 +139,8 @@ const ExtractedSourceCredibilityDBKFDialog = ({
? sourceCredibilityResults.map((value, key) => (
<Accordion key={key}>
<AccordionSummary expandIcon={<ExpandMoreIcon />}>
{value.credibilityScope.includes("/") ? (
{value.credibilityScope &&
value.credibilityScope.includes("/") ? (
<Typography color={trafficLightColor}>
{` ${keyword("this")}`}
{getUrlTypeFromCredScope(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,8 @@ const SourceCredibilityResult = (props) => {
align={"left"}
color={"textPrimary"}
>
{value.credibilityScope.includes("/") ? (
{value.credibilityScope &&
value.credibilityScope.includes("/") ? (
<Typography>
{` ${keyword("this")}`}
{getUrlTypeFromCredScope(value.credibilityScope)}
Expand Down
Loading

0 comments on commit 651b753

Please sign in to comment.