Skip to content

Commit

Permalink
Merge pull request #685 from NIUANULP/revert-674-category
Browse files Browse the repository at this point in the history
Revert "Task #228396 : [FE] Add the Ribbon on certificate card of course and …"
  • Loading branch information
paritshivani authored Oct 10, 2024
2 parents 13d24b6 + 9056bec commit c05033f
Showing 1 changed file with 14 additions and 29 deletions.
43 changes: 14 additions & 29 deletions packages/nulp_elite/src/pages/profile/certificate.js
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,6 @@ const Certificate = () => {
const url = `${urlConfig.URLS.LEARNER_PREFIX}${urlConfig.URLS.CERTIFICATE.CERTIF_SEARCH}`;
const response = await axios.post(url, request);
const data = response.data;

setOtherCertData(data);
} catch (error) {
console.error("Error fetching user data:", error);
Expand Down Expand Up @@ -280,7 +279,7 @@ const Certificate = () => {
fontWeight: "600",
}}
>
{certificate?._source?.data?.badge?.name}
{certificate._source.data.badge.name}
</Typography>
<Typography
variant="subtitle1"
Expand All @@ -289,7 +288,7 @@ const Certificate = () => {
style={{ fontSize: "12px" }}
>
{t("CERTIFICATE_GIVEN_BY")}:{" "}
{certificate?._source?.data?.badge?.issuer?.name}
{certificate._source.data.badge.issuer.name}
</Typography>
<Typography
variant="subtitle1"
Expand All @@ -298,7 +297,7 @@ const Certificate = () => {
style={{ fontSize: "12px" }}
>
{t("CERTIFICATE_ISSUE_DATE")}:{" "}
{formatDate(certificate?._source?.data?.issuedOn)}
{formatDate(certificate._source.data.issuedOn)}
</Typography>
<Box
style={{
Expand All @@ -311,7 +310,7 @@ const Certificate = () => {
>
<SimCardDownloadOutlinedIcon />
<Link
href={certificate?._source?.pdfUrl}
href={certificate._source.pdfUrl}
underline="none"
style={{
fontSize: "12px",
Expand All @@ -320,8 +319,8 @@ const Certificate = () => {
}}
onClick={() => {
getCertificateReport(
certificate?._id,
certificate?._source?.data?.badge?.name
certificate._id,
certificate._source.data.badge.name
);
}}
>
Expand All @@ -332,7 +331,7 @@ const Certificate = () => {
</Grid>
))}
{otherCertData.map((certificate) => (
<Grid item xs={12} md={4} key={certificate?.osid}>
<Grid item xs={12} md={4} key={certificate.osid}>
<Card
sx={{
marginTop: "10px",
Expand All @@ -341,21 +340,8 @@ const Certificate = () => {
border: "solid 1px #EFEFEF",
boxShadow: "none",
color: "#484848",
position: 'relative',
}}
>
{certificate?.training?.type && (
<Typography
gutterBottom
variant="h7"
component="div"
className="ribbonCard"
marginTop={"-23px"}
>
<Box className="cardCourses">{certificate?.training?.type}</Box>
</Typography>
)}

<Typography
className="twoLineEllipsis"
variant="subtitle1"
Expand All @@ -366,18 +352,17 @@ const Certificate = () => {
paddingBottom: "0",
height: "42px",
fontWeight: "600",
marginTop : "27px"
}}
>
{certificate?.training?.name}
{certificate.training.name}
</Typography>
<Typography
variant="subtitle1"
color="text.secondary"
component="div"
style={{ fontSize: "12px" }}
>
{t("CERTIFICATE_GIVEN_BY")}: {certificate?.issuer?.name}
{t("CERTIFICATE_GIVEN_BY")}: {certificate.issuer.name}
</Typography>
<Typography
variant="subtitle1"
Expand All @@ -386,7 +371,7 @@ const Certificate = () => {
style={{ fontSize: "12px" }}
>
{t("CERTIFICATE_ISSUE_DATE")}:{" "}
{formatDate(certificate?.osCreatedAt)}
{formatDate(certificate.osCreatedAt)}
</Typography>
<Box
style={{
Expand All @@ -398,15 +383,15 @@ const Certificate = () => {
className="text-green"
onClick={() => {
getCertificate(
certificate?.templateUrl,
certificate?.osid,
certificate?.training?.name
certificate.templateUrl,
certificate.osid,
certificate.training.name
);
}}
>
<SimCardDownloadOutlinedIcon />
<Link
href={certificate?.pdfUrl}
href={certificate.pdfUrl}
underline="none"
style={{
fontSize: "12px",
Expand Down

0 comments on commit c05033f

Please sign in to comment.