Skip to content

Commit

Permalink
Merge pull request #592 from mahajanmahesh935/HomePage
Browse files Browse the repository at this point in the history
TASK :#0000 Open popup for copyright after clicking on credits
  • Loading branch information
ManojNathIC authored Sep 9, 2024
2 parents 7a23539 + be3073f commit 724a763
Show file tree
Hide file tree
Showing 3 changed files with 58 additions and 8 deletions.
8 changes: 4 additions & 4 deletions packages/nulp_elite/src/pages/content/AllContent.js
Original file line number Diff line number Diff line change
Expand Up @@ -131,11 +131,11 @@ const AllContent = () => {
filters: {
board: [domainName],
primaryCategory: [
"course","Manuals/SOPs","Good Practices","Reports"
"course","Manuals/SOPs","Good Practices","Reports","Manual/SOPs"
],
visibility: ["Default", "Parent"],
// visibility: ["Default", "Parent"], Commentent because not showing contents on prod
},
limit: 100,
limit: 2000,
sort_by: { lastPublishedOn: "desc" },
fields: [
"name",
Expand Down Expand Up @@ -172,7 +172,7 @@ const AllContent = () => {

const filteredAndSortedData = response?.data?.result?.content
?.filter((item) =>
["Manuals/SOPs", "Good Practices", "Reports", "Course"].includes(
["Manuals/SOPs","Manual/SOPs", "Good Practices", "Reports", "Course"].includes(
item.primaryCategory
)
)
Expand Down
9 changes: 6 additions & 3 deletions packages/nulp_elite/src/pages/content/CategoryPage.js
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,10 @@ const preselectedDomain = decodeURIComponent(preselectedDomainRaw || "");
filters: {
primaryCategory: [category],
visibility: [],
board: domainName ? [domainName] : [preselectedDomain],
board: domainName
? [domainName]
: (preselectedDomain && preselectedDomain !== "null" ? [preselectedDomain] : undefined)

},
limit: 20,
sort_by: {
Expand Down Expand Up @@ -249,7 +252,7 @@ const preselectedDomain = decodeURIComponent(preselectedDomainRaw || "");
role="main"
className="allContent xs-pb-20 pb-30 domain-list"
>
{(domainName || preselectedDomain) && (
{(domainName || (preselectedDomain && preselectedDomain !== "null")) && (
<Box
className="d-flex jc-bw mr-20 my-20"
style={{ alignItems: "center" }}
Expand Down Expand Up @@ -280,7 +283,7 @@ const preselectedDomain = decodeURIComponent(preselectedDomainRaw || "");
className="d-flex jc-bw mr-20 my-20 px-10"
style={{ alignItems: "center" }}
>
<p className="h3-title">{category}</p>
<p className="h3-title">{category === "Course" ? "Courses" : category}</p>
<Link onClick={handleGoBack} className="viewAll mr-17">
{t("BACK")}
</Link>
Expand Down
49 changes: 48 additions & 1 deletion packages/nulp_elite/src/pages/content/joinCourse.js
Original file line number Diff line number Diff line change
Expand Up @@ -112,6 +112,7 @@ const JoinCourse = () => {
const [isContentConsumed, setIsContentConsumed] = useState();
const [completedContents, setCompletedContents] = useState([]);
const [isCompleted, setIsCompleted] = useState();
const [copyrightOpen,setcopyrightOpen] = useState(false);
const toggleShowMore = () => {
setShowMore((prevShowMore) => !prevShowMore);
};
Expand Down Expand Up @@ -923,6 +924,16 @@ const JoinCourse = () => {
console.error("Error fetching data:", error);
}
};


const handlecopyrightOpen = () => {
setcopyrightOpen(true);
};

const handlecopyrightClose = () => {
setcopyrightOpen(false);
}

const handleOpen = () => {
setOpen(true);
};
Expand Down Expand Up @@ -1405,7 +1416,43 @@ className="xs-hide accordionBoxShadow"
userData.result.content.children[0].lastUpdatedOn
)}
</Typography>
<Typography className="h6-title">{t("CREDITS")}:</Typography>
<Typography
className="h6-title"
onClick={handlecopyrightOpen}
style={{ cursor: "pointer", color: "blue" }}
>
{t("CREDITS")}
</Typography>
<Dialog open={copyrightOpen} onClose={handlecopyrightClose} sx={{ "& .MuiDialog-paper": { width: "455px" } }} >
<DialogTitle>{t("CREDITS")}</DialogTitle>
<DialogContent>
<p style={{ color: "#4d4d4d", fontSize: "13px", fontWeight: "bold" }}>
COPYRIGHT
</p>
{userData?.result?.content?.copyright && userData?.result?.content?.copyrightYear
? `${userData.result.content.copyright}, ${userData.result.content.copyrightYear}`
: userData?.result?.content?.copyright || userData?.result?.content?.copyrightYear
}
<h5>This content is derived from</h5>
<p style={{ color: "#4d4d4d", fontSize: "13px", fontWeight: "bold" }}>
CONTENT
</p>
{userData?.result?.content?.name}
<p style={{ color: "#4d4d4d", fontSize: "13px", fontWeight: "bold" }}>
LICENSE TERMS
</p>
{userData?.result?.content?.licenseDetails?.name}
<p style={{ color: "#4d4d4d", fontSize: "13px", fontWeight: "bold" }}>
PUBLISHED ON NULP BY
</p>
{userData?.result?.content?.copyright}
</DialogContent>
<DialogActions>
<Button onClick={handleClose} color="primary">
{t("CLOSE")}
</Button>
</DialogActions>
</Dialog>
<Typography className="h6-title">
{t("LICENSE_TERMS")}:{" "}
{userData?.result?.content?.licenseDetails?.name}
Expand Down

0 comments on commit 724a763

Please sign in to comment.