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

Revert "Task #228396 : [FE] Add the Ribbon on certificate card of course and …" #685

Merged
merged 1 commit into from
Oct 10, 2024
Merged
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
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
Loading