Skip to content

Commit 14ef9c9

Browse files
fix: update copy, icons, and use imported fallback img from @edx/brand for highlights (#938)
1 parent 51b7601 commit 14ef9c9

11 files changed

+59
-44
lines changed

package-lock.json

Lines changed: 15 additions & 15 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,13 +24,13 @@
2424
"license": "AGPL-3.0",
2525
"dependencies": {
2626
"@babel/plugin-transform-runtime": "7.12.1",
27-
"@edx/brand": "npm:@edx/brand-edx.org@^2.0.7",
27+
"@edx/brand": "npm:@edx/brand-openedx@1.2.0",
2828
"@edx/frontend-enterprise-catalog-search": "3.1.5",
2929
"@edx/frontend-enterprise-hotjar": "1.2.0",
3030
"@edx/frontend-enterprise-logistration": "2.1.0",
3131
"@edx/frontend-enterprise-utils": "2.1.0",
3232
"@edx/frontend-platform": "2.4.0",
33-
"@edx/paragon": "20.24.1",
33+
"@edx/paragon": "20.26.3",
3434
"@fortawesome/fontawesome-svg-core": "1.2.35",
3535
"@fortawesome/free-brands-svg-icons": "5.15.3",
3636
"@fortawesome/free-regular-svg-icons": "5.15.3",

src/components/ContentHighlights/ContentHighlightCardItem.jsx

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,9 @@
11
import React from 'react';
2-
import { Card, Hyperlink } from '@edx/paragon';
32
import Truncate from 'react-truncate';
43
import PropTypes from 'prop-types';
4+
import { Card, Hyperlink } from '@edx/paragon';
5+
import cardImageCapFallbackSrc from '@edx/brand/paragon/images/card-imagecap-fallback.png';
6+
57
import { getContentHighlightCardFooter } from './data/utils';
68

79
const ContentHighlightCardItem = ({
@@ -32,6 +34,7 @@ const ContentHighlightCardItem = ({
3234
<Card variant={contentType !== 'course' && 'dark'} isLoading={isLoading}>
3335
<Card.ImageCap
3436
src={cardInfo.cardImgSrc}
37+
fallbackSrc={cardImageCapFallbackSrc}
3538
srcAlt=""
3639
logoSrc={cardInfo.cardLogoSrc}
3740
logoAlt={cardInfo.cardLogoAlt}

src/components/ContentHighlights/ContentHighlights.jsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ const ContentHighlights = () => {
1616
useEffect(() => {
1717
if (locationState?.deletedHighlightSet) {
1818
setToasts((prevState) => [...prevState, {
19-
toastText: `"${enterpriseCuration?.toastText}" deleted.`,
19+
toastText: `"${enterpriseCuration?.toastText}" deleted`,
2020
uuid: uuidv4(),
2121
}]);
2222
const newState = { ...locationState };
@@ -25,7 +25,7 @@ const ContentHighlights = () => {
2525
}
2626
if (locationState?.addHighlightSet) {
2727
setToasts((prevState) => [...prevState, {
28-
toastText: `"${enterpriseCuration?.toastText}" added.`,
28+
toastText: `"${enterpriseCuration?.toastText}" added`,
2929
uuid: uuidv4(),
3030
}]);
3131
const newState = { ...locationState };

src/components/ContentHighlights/DeleteHighlightSet.jsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -88,8 +88,8 @@ const DeleteHighlightSet = ({ enterpriseSlug }) => {
8888
</p>
8989
</Alert>
9090
<p>
91-
Deleting this highlight collection will remove it from your
92-
learners. This action is permanent and cannot be undone.
91+
Deleting this highlight will remove it from your
92+
learners&apos; &quot;Find a Course&quot; This action is permanent and cannot be undone.
9393
</p>
9494
</AlertModal>
9595
</>

src/components/ContentHighlights/HighlightStepper/HighlightStepperConfirmContent.jsx

Lines changed: 23 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -130,19 +130,29 @@ SelectedContent.propTypes = {
130130
enterpriseId: PropTypes.string.isRequired,
131131
};
132132

133-
const HighlightStepperConfirmContent = ({ enterpriseId }) => (
134-
<Container>
135-
<Row>
136-
<Col xs={12} md={8} lg={6}>
137-
<h3 className="mb-3 d-flex align-items-center">
138-
<Icon src={Assignment} className="mr-2 color-brand-tertiary" />
139-
{STEPPER_STEP_TEXT.confirmContent}
140-
</h3>
141-
</Col>
142-
</Row>
143-
<SelectedContent enterpriseId={enterpriseId} />
144-
</Container>
145-
);
133+
const HighlightStepperConfirmContent = ({ enterpriseId }) => {
134+
const highlightTitle = useContextSelector(
135+
ContentHighlightsContext,
136+
v => v[0].stepperModal.highlightTitle,
137+
);
138+
139+
return (
140+
<Container>
141+
<Row>
142+
<Col xs={12} md={8} lg={6}>
143+
<h3 className="mb-3 d-flex align-items-center">
144+
<Icon src={Assignment} className="mr-2 text-brand" />
145+
{STEPPER_STEP_TEXT.confirmContent}
146+
</h3>
147+
<p>
148+
{STEPPER_STEP_TEXT.getConfirmContentSubtitle(highlightTitle)}.
149+
</p>
150+
</Col>
151+
</Row>
152+
<SelectedContent enterpriseId={enterpriseId} />
153+
</Container>
154+
);
155+
};
146156

147157
HighlightStepperConfirmContent.propTypes = {
148158
enterpriseId: PropTypes.string.isRequired,

src/components/ContentHighlights/HighlightStepper/HighlightStepperSelectContentHeader.jsx

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,11 +10,12 @@ const HighlightStepperSelectContentTitle = () => {
1010
return (
1111
<>
1212
<h3 className="mb-3 d-flex align-items-center">
13-
<Icon src={AddCircle} className="mr-2 color-brand-tertiary" />
13+
<Icon src={AddCircle} className="mr-2 text-brand" />
1414
{STEPPER_STEP_TEXT.selectContent}
1515
</h3>
1616
<p>
17-
Select up to <b>{MAX_CONTENT_ITEMS_PER_HIGHLIGHT_SET}</b> items for &quot;{highlightTitle}&quot;.
17+
Select up to <b>{MAX_CONTENT_ITEMS_PER_HIGHLIGHT_SET}</b> items for &quot;{highlightTitle}&quot;. Courses
18+
in learners&apos; portal appear in the order of selection.
1819
</p>
1920
<p>
2021
<strong>

src/components/ContentHighlights/HighlightStepper/HighlightStepperSelectContentSearch.jsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ const HighlightStepperSelectContent = ({ enterpriseId }) => {
3636
ContentHighlightsContext,
3737
v => v[0].searchClient,
3838
);
39-
// TODO: replace testEnterpriseId with enterpriseID before push,
39+
// TODO: replace testEnterpriseId with enterpriseId before push,
4040
// uncomment out import and replace with testEnterpriseId to test
4141
const searchFilters = `enterprise_customer_uuids:${enterpriseId}`;
4242

src/components/ContentHighlights/HighlightStepper/HighlightStepperTitle.jsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import React from 'react';
22
import {
33
Row, Col, Icon, Container,
44
} from '@edx/paragon';
5-
import { AddCircle } from '@edx/paragon/icons';
5+
import { EditCircle } from '@edx/paragon/icons';
66

77
import { STEPPER_STEP_TEXT } from '../data/constants';
88
import HighlightStepperTitleInput from './HighlightStepperTitleInput';
@@ -12,13 +12,13 @@ const HighlightStepperTitle = () => (
1212
<Row>
1313
<Col xs={12} md={8} lg={6}>
1414
<h3 className="mb-3 d-flex align-items-center">
15-
<Icon src={AddCircle} className="mr-2 color-brand-tertiary" />
15+
<Icon src={EditCircle} className="mr-2 text-brand" />
1616
{STEPPER_STEP_TEXT.createTitle}
1717
</h3>
1818
<div className="mb-4.5">
1919
<p>
2020
Create a unique title for your highlight. This title is visible
21-
to your learners and helps them discovery relevant content.
21+
to your learners and helps them navigate to relevant content.
2222
</p>
2323
<p>
2424
<strong>

src/components/ContentHighlights/data/constants.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,8 @@ export const HIGHLIGHT_TITLE_MAX_LENGTH = 60;
2525
export const STEPPER_STEP_TEXT = {
2626
createTitle: 'Create a title for your highlight',
2727
selectContent: 'Add content to your highlight',
28-
confirmContent: 'Confirm your content selections',
28+
confirmContent: 'Confirm your selections',
29+
getConfirmContentSubtitle: (highlightTitle) => `Review content selections for "${highlightTitle}"`,
2930
};
3031
// Header text extracted into constant to maintain passing test on changes
3132
export const HEADER_TEXT = {

0 commit comments

Comments
 (0)