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

TASK #0000 show error message every time when user click on content i… #496

Merged
merged 4 commits into from
Aug 16, 2024
Merged
Show file tree
Hide file tree
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
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
58 changes: 29 additions & 29 deletions packages/nulp_elite/src/components/Card.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import { Divider } from "native-base";
import RandomImage from "../assets/cardRandomImgs.json";
import { useTranslation } from "react-i18next";
const processString = (str) => {
return str.replace(/[^a-zA-Z0-9]/g, "").toLowerCase();
return str?.replace(/[^a-zA-Z0-9]/g, "").toLowerCase();
};
export default function BoxCard({ items, index, onClick, continueLearning }) {
const [imgUrl, setImgUrl] = useState();
Expand Down Expand Up @@ -212,34 +212,34 @@ export default function BoxCard({ items, index, onClick, continueLearning }) {
items?.se_gradeLevels) && (
<>
<Box className="textLeft mb-15 d-flex">
{(items?.board || items?.se_boards) && (
<Tooltip
title={
Array.isArray(items?.board) && items.board.length === 1
? items.board.join(", ")
: Array.isArray(items?.se_boards) &&
items.se_boards.length > 1
? items.se_boards.join(", ")
: items?.se_boards?.[0] || ""
}
placement="top"
className="labelOne cardLabelEllips"
>
<Button>
{Array.isArray(items?.board) && items.board.length === 1
? items.board[0]
: Array.isArray(items?.board) && items.board.length > 1
? `${items.board[0]} + ${items.board.length - 1}`
: Array.isArray(items?.se_boards) &&
items.se_boards.length === 1
? items.se_boards[0]
: Array.isArray(items?.se_boards) &&
items.se_boards.length > 1
? `${items.se_boards[0]} + ${items.se_boards.length - 1}`
: ""}
</Button>
</Tooltip>
)}
{items?.board ? (
<Tooltip
title={items.board}
placement="top"
className="labelOne cardLabelEllips"
>
<Button>
{items.board}
</Button>
</Tooltip>
) : (
<Tooltip
title={
Array.isArray(items?.se_boards) && items.se_boards.length > 0
? items.se_boards.join(", ")
: ""
}
placement="top"
className="labelOne cardLabelEllips"
>
<Button>
{Array.isArray(items?.se_boards) && items.se_boards.length > 0
? `${items.se_boards[0]}${items.se_boards.length > 1 ? ` + ${items.se_boards.length - 1}` : ''}`
: ""
}
</Button>
</Tooltip>
)}
{(items.gradeLevel || items.se_gradeLevels) && (
<Tooltip
title={
Expand Down
34 changes: 17 additions & 17 deletions packages/nulp_elite/src/pages/content/joinCourse.js
Original file line number Diff line number Diff line change
Expand Up @@ -501,23 +501,23 @@ const JoinCourse = () => {
});
};

const handleLinkClick = (id) => {
if (isEnroll) {
navigate(`${routeConfig.ROUTES.PLAYER_PAGE.PLAYER}?${id}`, {
state: {
coursename: userData?.result?.content?.name,
batchid: batchDetails?.batchId,
courseid: contentId,
isenroll: isEnroll,
consumedcontents: ConsumedContents,
},
});
} else {
showOpenContenErrorMessage(
"You must join the course to get complete access to content."
);
}
};

const handleLinkClick = (id) => {
if (isEnroll) {
navigate(`${routeConfig.ROUTES.PLAYER_PAGE.PLAYER}?${id}`, {
state: {
coursename: userData?.result?.content?.name,
batchid: batchDetails?.batchId,
courseid: contentId,
isenroll: isEnroll,
consumedcontents: ConsumedContents,
},
});
} else {
showErrorMessage("You must join the course to get complete access to content.");
}
};


const handleSnackbarClose = (event, reason) => {
if (reason === "clickaway") {
Expand Down
2 changes: 1 addition & 1 deletion packages/nulp_elite/src/pages/search/ContentList.js
Original file line number Diff line number Diff line change
Expand Up @@ -180,7 +180,7 @@ const ContentList = (props) => {
"eTextBook",
"TVLesson",
]}),
se_boards: domainfilter.se_board || [domainName],
board: domainfilter.se_board || [domainName],
se_gradeLevels:
subDomainFilter && subDomainFilter.length > 0
? subDomainFilter
Expand Down
Loading