@edx/frontend-app-subscription-learner-dashboard 1.38.0 → 1.38.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -7,24 +7,24 @@ import messages from './messages';
7
7
  import PropTypes from 'prop-types';
8
8
  export const ViewCertificateBanner = ({ cardId }) => {
9
9
  const courseData = useCourseData(cardId);
10
- const { isEarned = false, isVerified = false, mode = '', availableDate = '', certPreviewUrl = '', } = useMemo(() => {
10
+ const { isEarned = false, isVerified = false, mode = '', certPreviewUrl = '', issuedDate = '', } = useMemo(() => {
11
11
  var _a, _b, _c, _d, _e;
12
12
  return ({
13
13
  isEarned: ((_a = courseData === null || courseData === void 0 ? void 0 : courseData.certificate) === null || _a === void 0 ? void 0 : _a.isEarned) || false,
14
14
  isVerified: ((_b = courseData === null || courseData === void 0 ? void 0 : courseData.enrollment) === null || _b === void 0 ? void 0 : _b.isVerified) || false,
15
15
  mode: ((_c = courseData === null || courseData === void 0 ? void 0 : courseData.enrollment) === null || _c === void 0 ? void 0 : _c.mode) || '',
16
- availableDate: ((_d = courseData === null || courseData === void 0 ? void 0 : courseData.certificate) === null || _d === void 0 ? void 0 : _d.availableDate) || '',
17
- certPreviewUrl: ((_e = courseData === null || courseData === void 0 ? void 0 : courseData.certificate) === null || _e === void 0 ? void 0 : _e.certPreviewUrl) || '',
16
+ certPreviewUrl: ((_d = courseData === null || courseData === void 0 ? void 0 : courseData.certificate) === null || _d === void 0 ? void 0 : _d.certPreviewUrl) || '',
17
+ issuedDate: ((_e = courseData === null || courseData === void 0 ? void 0 : courseData.certificate) === null || _e === void 0 ? void 0 : _e.issuedDate) || '',
18
18
  });
19
19
  }, [courseData]);
20
20
  const { formatMessage } = useIntl();
21
21
  const formatDate = utilHooks.useFormatDate();
22
22
  const showVerifiedBanner = isEarned && isVerified && mode === 'verified';
23
23
  return (_jsx(Card.Status, { variant: "warning", className: "bg-light-200 verified-banner", "data-testid": "course-card-view-certificate-banner", children: _jsxs(Row, { className: "align-items-sm-center mt-1", children: [_jsx(Col, { xs: 12, sm: true, className: "pe-sm-3", children: _jsxs("p", { className: "mb-0 font-weight-semi-bold", children: [_jsx("span", { children: _jsxs("b", { children: [formatMessage(messages.congratulationsText), " "] }) }), showVerifiedBanner ? (_jsx(_Fragment, { children: formatMessage(messages.verifiedBannerText, {
24
- date: formatDate(availableDate),
24
+ date: formatDate(issuedDate),
25
25
  }) }))
26
26
  : (_jsx(_Fragment, { children: formatMessage(messages.completedAndPassedBannerText, {
27
- date: formatDate(availableDate),
27
+ date: formatDate(issuedDate),
28
28
  }) }))] }) }), _jsxs(Col, { xs: 12, sm: "auto", className: "d-flex justify-content-start justify-content-sm-end mt-2 mt-sm-0", children: [_jsx(Button, { variant: "outline-brand", size: "md", href: certPreviewUrl
29
29
  ? `${getSiteConfig().lmsBaseUrl}${certPreviewUrl}`
30
30
  : undefined, "data-testid": "view-certificate-button", className: "view-certificate-button d-none d-lg-inline-flex", target: "_blank", rel: "noopener noreferrer", role: "link", children: formatMessage(messages.viewCertificate) }), _jsx(Hyperlink, { destination: certPreviewUrl
@@ -1 +1 @@
1
- {"version":3,"file":"ViewCertificateBanner.js","sourceRoot":"","sources":["../../../../../src/containers/CourseCard/components/CourseCardBanners/ViewCertificateBanner.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,EAAE,IAAI,EAAE,GAAG,EAAE,GAAG,EAAE,MAAM,kBAAkB,CAAC;AACrE,OAAO,EAAE,OAAO,EAAE,MAAM,OAAO,CAAC;AAChC,OAAO,EAAE,aAAa,EAAE,OAAO,EAAE,MAAM,wBAAwB,CAAC;AAChE,OAAO,EAAE,SAAS,EAAE,aAAa,EAAE,MAAM,YAAY,CAAC;AACtD,OAAO,QAAQ,MAAM,YAAY,CAAC;AAClC,OAAO,SAAS,MAAM,YAAY,CAAC;AAEnC,MAAM,CAAC,MAAM,qBAAqB,GAAG,CAAC,EAAE,MAAM,EAAE,EAAE,E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AM,CAAC,UAAU;CACpC,CAAC;AAEF,eAAe,qBAAqB,CAAC","sourcesContent":["import { Hyperlink, Button, Card, Row, Col } from '@openedx/paragon';\nimport { useMemo } from 'react';\nimport { getSiteConfig, useIntl } from '@openedx/frontend-base';\nimport { utilHooks, useCourseData } from '@src/hooks';\nimport messages from './messages';\nimport PropTypes from 'prop-types';\n\nexport const ViewCertificateBanner = ({ cardId }) => {\n const courseData = useCourseData(cardId);\n const {\n isEarned = false,\n isVerified = false,\n mode = '',\n availableDate = '',\n certPreviewUrl = '',\n } = useMemo(() => ({\n isEarned: courseData?.certificate?.isEarned || false,\n isVerified: courseData?.enrollment?.isVerified || false,\n mode: courseData?.enrollment?.mode || '',\n availableDate: courseData?.certificate?.availableDate || '',\n certPreviewUrl: courseData?.certificate?.certPreviewUrl || '',\n }), [courseData]);\n\n const { formatMessage } = useIntl();\n const formatDate = utilHooks.useFormatDate();\n\n const showVerifiedBanner = isEarned && isVerified && mode === 'verified';\n\n return (\n <Card.Status variant=\"warning\" className=\"bg-light-200 verified-banner\" data-testid=\"course-card-view-certificate-banner\">\n <Row className=\"align-items-sm-center mt-1\">\n <Col xs={12} sm className=\"pe-sm-3\">\n <p className=\"mb-0 font-weight-semi-bold\">\n <span><b>{formatMessage(messages.congratulationsText)} </b></span>\n {\n showVerifiedBanner ? (\n <>\n {formatMessage(messages.verifiedBannerText, {\n date: formatDate(availableDate),\n })}\n </>\n )\n : (\n <>\n {formatMessage(messages.completedAndPassedBannerText, {\n date: formatDate(availableDate),\n })}\n </>\n )\n }\n </p>\n </Col>\n <Col xs={12} sm=\"auto\" className=\"d-flex justify-content-start justify-content-sm-end mt-2 mt-sm-0\">\n {/* Desktop: outlined button */}\n <Button\n variant=\"outline-brand\"\n size=\"md\"\n href={certPreviewUrl\n ? `${getSiteConfig().lmsBaseUrl}${certPreviewUrl}`\n : undefined}\n data-testid=\"view-certificate-button\"\n className=\"view-certificate-button d-none d-lg-inline-flex\"\n target=\"_blank\"\n rel=\"noopener noreferrer\"\n role=\"link\"\n >\n {formatMessage(messages.viewCertificate)}\n </Button>\n {/* Tablet/Mobile: plain text link */}\n <Hyperlink\n destination={certPreviewUrl\n ? `${getSiteConfig().lmsBaseUrl}${certPreviewUrl}`\n : undefined}\n target=\"_blank\"\n rel=\"noopener noreferrer\"\n className=\"d-lg-none view-certificate-link\"\n data-testid=\"view-certificate-link\"\n isInline\n >\n {formatMessage(messages.viewCertificate)}\n </Hyperlink>\n </Col>\n </Row>\n </Card.Status>\n );\n};\n\nViewCertificateBanner.propTypes = {\n cardId: PropTypes.string.isRequired,\n};\n\nexport default ViewCertificateBanner;\n"]}
1
+ {"version":3,"file":"ViewCertificateBanner.js","sourceRoot":"","sources":["../../../../../src/containers/CourseCard/components/CourseCardBanners/ViewCertificateBanner.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,EAAE,IAAI,EAAE,GAAG,EAAE,GAAG,EAAE,MAAM,kBAAkB,CAAC;AACrE,OAAO,EAAE,OAAO,EAAE,MAAM,OAAO,CAAC;AAChC,OAAO,EAAE,aAAa,EAAE,OAAO,EAAE,MAAM,wBAAwB,CAAC;AAChE,OAAO,EAAE,SAAS,EAAE,aAAa,EAAE,MAAM,YAAY,CAAC;AACtD,OAAO,QAAQ,MAAM,YAAY,CAAC;AAClC,OAAO,SAAS,MAAM,YAAY,CAAC;AAEnC,MAAM,CAAC,MAAM,qBAAqB,GAAG,CAAC,EAAE,MAAM,EAAE,EAAE,EAAE;IAClD,MAAM,UAAU,GAAG,aAAa,CAAC,MAAM,CAAC,CAAC;IACzC,MAAM,EACJ,QAAQ,GAAG,KAAK,EAChB,UAAU,GAAG,KAAK,EAClB,IAAI,GAAG,EAAE,EACT,cAAc,GAAG,EAAE,EACnB,UAAU,GAAG,EAAE,GAChB,GAAG,OAAO,CAAC,GAAG,EAAE;;QAAC,OAAA,CAAC;YACjB,QAAQ,EAAE,CAAA,MAAA,UAAU,aAAV,UAAU,uBAAV,UA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A4B,EAAE;wCACpD,IAAI,EAAE,UAAU,CAAC,UAAU,CAAC;qCAC7B,CAAC,GACD,CACJ,IAEL,GACA,EACN,MAAC,GAAG,IAAC,EAAE,EAAE,EAAE,EAAE,EAAE,EAAC,MAAM,EAAC,SAAS,EAAC,kEAAkE,aAEjG,KAAC,MAAM,IACL,OAAO,EAAC,eAAe,EACvB,IAAI,EAAC,IAAI,EACT,IAAI,EAAE,cAAc;gCAClB,CAAC,CAAC,GAAG,aAAa,EAAE,CAAC,UAAU,GAAG,cAAc,EAAE;gCAClD,CAAC,CAAC,SAAS,iBACD,yBAAyB,EACrC,SAAS,EAAC,iDAAiD,EAC3D,MAAM,EAAC,QAAQ,EACf,GAAG,EAAC,qBAAqB,EACzB,IAAI,EAAC,MAAM,YAEV,aAAa,CAAC,QAAQ,CAAC,eAAe,CAAC,GACjC,EAET,KAAC,SAAS,IACR,WAAW,EAAE,cAAc;gCACzB,CAAC,CAAC,GAAG,aAAa,EAAE,CAAC,UAAU,GAAG,cAAc,EAAE;gCAClD,CAAC,CAAC,SAAS,EACb,MAAM,EAAC,QAAQ,EACf,GAAG,EAAC,qBAAqB,EACzB,SAAS,EAAC,iCAAiC,iBAC/B,uBAAuB,EACnC,QAAQ,kBAEP,aAAa,CAAC,QAAQ,CAAC,eAAe,CAAC,GAC9B,IACR,IACF,GACM,CACf,CAAC;AACJ,CAAC,CAAC;AAEF,qBAAqB,CAAC,SAAS,GAAG;IAChC,MAAM,EAAE,SAAS,CAAC,MAAM,CAAC,UAAU;CACpC,CAAC;AAEF,eAAe,qBAAqB,CAAC","sourcesContent":["import { Hyperlink, Button, Card, Row, Col } from '@openedx/paragon';\nimport { useMemo } from 'react';\nimport { getSiteConfig, useIntl } from '@openedx/frontend-base';\nimport { utilHooks, useCourseData } from '@src/hooks';\nimport messages from './messages';\nimport PropTypes from 'prop-types';\n\nexport const ViewCertificateBanner = ({ cardId }) => {\n const courseData = useCourseData(cardId);\n const {\n isEarned = false,\n isVerified = false,\n mode = '',\n certPreviewUrl = '',\n issuedDate = '',\n } = useMemo(() => ({\n isEarned: courseData?.certificate?.isEarned || false,\n isVerified: courseData?.enrollment?.isVerified || false,\n mode: courseData?.enrollment?.mode || '',\n certPreviewUrl: courseData?.certificate?.certPreviewUrl || '',\n issuedDate: courseData?.certificate?.issuedDate || '',\n }), [courseData]);\n\n const { formatMessage } = useIntl();\n const formatDate = utilHooks.useFormatDate();\n\n const showVerifiedBanner = isEarned && isVerified && mode === 'verified';\n\n return (\n <Card.Status variant=\"warning\" className=\"bg-light-200 verified-banner\" data-testid=\"course-card-view-certificate-banner\">\n <Row className=\"align-items-sm-center mt-1\">\n <Col xs={12} sm className=\"pe-sm-3\">\n <p className=\"mb-0 font-weight-semi-bold\">\n <span><b>{formatMessage(messages.congratulationsText)} </b></span>\n {\n showVerifiedBanner ? (\n <>\n {formatMessage(messages.verifiedBannerText, {\n date: formatDate(issuedDate),\n })}\n </>\n )\n : (\n <>\n {formatMessage(messages.completedAndPassedBannerText, {\n date: formatDate(issuedDate),\n })}\n </>\n )\n }\n </p>\n </Col>\n <Col xs={12} sm=\"auto\" className=\"d-flex justify-content-start justify-content-sm-end mt-2 mt-sm-0\">\n {/* Desktop: outlined button */}\n <Button\n variant=\"outline-brand\"\n size=\"md\"\n href={certPreviewUrl\n ? `${getSiteConfig().lmsBaseUrl}${certPreviewUrl}`\n : undefined}\n data-testid=\"view-certificate-button\"\n className=\"view-certificate-button d-none d-lg-inline-flex\"\n target=\"_blank\"\n rel=\"noopener noreferrer\"\n role=\"link\"\n >\n {formatMessage(messages.viewCertificate)}\n </Button>\n {/* Tablet/Mobile: plain text link */}\n <Hyperlink\n destination={certPreviewUrl\n ? `${getSiteConfig().lmsBaseUrl}${certPreviewUrl}`\n : undefined}\n target=\"_blank\"\n rel=\"noopener noreferrer\"\n className=\"d-lg-none view-certificate-link\"\n data-testid=\"view-certificate-link\"\n isInline\n >\n {formatMessage(messages.viewCertificate)}\n </Hyperlink>\n </Col>\n </Row>\n </Card.Status>\n );\n};\n\nViewCertificateBanner.propTypes = {\n cardId: PropTypes.string.isRequired,\n};\n\nexport default ViewCertificateBanner;\n"]}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@edx/frontend-app-subscription-learner-dashboard",
3
- "version": "1.38.0",
3
+ "version": "1.38.1",
4
4
  "description": "",
5
5
  "repository": {
6
6
  "type": "git",