Skip to content

Commit 6646c8e

Browse files
authored
style: Fixing nits about sync units [FC-0097] (#2319)
* Stay visible the sync icon in the course outline * Update the message in the sync unit/subsection/section modal * Add a tooltip to the edit and sync button.
1 parent 9a9806c commit 6646c8e

File tree

7 files changed

+23
-21
lines changed

7 files changed

+23
-21
lines changed

src/course-libraries/ReviewTabContent.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -172,7 +172,7 @@ const ItemReviewList = ({
172172
downstreamBlockId: info.usageKey,
173173
upstreamBlockId: outOfSyncItemsByKey[info.usageKey].upstreamKey,
174174
upstreamBlockVersionSynced: outOfSyncItemsByKey[info.usageKey].versionSynced,
175-
isContainer: info.blockType === 'vertical' || info.blockType === 'sequencial' || info.blockType === 'chapter',
175+
isContainer: info.blockType === 'vertical' || info.blockType === 'sequential' || info.blockType === 'chapter',
176176
});
177177
}, [outOfSyncItemsByKey]);
178178

src/course-outline/card-header/CardHeader.tsx

Lines changed: 13 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ import {
1010
Hyperlink,
1111
Icon,
1212
IconButton,
13+
IconButtonWithTooltip,
1314
useToggle,
1415
} from '@openedx/paragon';
1516
import {
@@ -175,19 +176,11 @@ const CardHeader = ({
175176
) : (
176177
<>
177178
{titleComponent}
178-
{readyToSync && (
179-
<IconButton
180-
className="item-card-button-icon"
181-
data-testid={`${namePrefix}-sync-button`}
182-
alt={intl.formatMessage(messages.readyToSyncButtonAlt)}
183-
iconAs={SyncIcon}
184-
onClick={onClickSync}
185-
/>
186-
)}
187-
<IconButton
179+
<IconButtonWithTooltip
188180
className="item-card-button-icon"
189181
data-testid={`${namePrefix}-edit-button`}
190-
alt={intl.formatMessage(messages.altButtonEdit)}
182+
alt={intl.formatMessage(messages.altButtonRename)}
183+
tooltipContent={<div>{intl.formatMessage(messages.altButtonRename)}</div>}
191184
iconAs={EditIcon}
192185
onClick={onClickEdit}
193186
// @ts-ignore
@@ -203,6 +196,15 @@ const CardHeader = ({
203196
<TagCount count={contentTagCount} onClick={openManageTagsDrawer} />
204197
)}
205198
{extraActionsComponent}
199+
{readyToSync && (
200+
<IconButtonWithTooltip
201+
data-testid={`${namePrefix}-sync-button`}
202+
alt={intl.formatMessage(messages.readyToSyncButtonAlt)}
203+
iconAs={SyncIcon}
204+
tooltipContent={<div>{intl.formatMessage(messages.readyToSyncButtonAlt)}</div>}
205+
onClick={onClickSync}
206+
/>
207+
)}
206208
<Dropdown data-testid={`${namePrefix}-card-header__menu`} onClick={onClickMenuButton}>
207209
<Dropdown.Toggle
208210
className="item-card-header__menu"

src/course-outline/card-header/messages.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,9 +33,9 @@ const messages = defineMessages({
3333
id: 'course-authoring.course-outline.card.status-badge.draft-unpublished-changes',
3434
defaultMessage: 'Draft (Unpublished changes)',
3535
},
36-
altButtonEdit: {
36+
altButtonRename: {
3737
id: 'course-authoring.course-outline.card.button.edit.alt',
38-
defaultMessage: 'Edit',
38+
defaultMessage: 'Rename',
3939
},
4040
menuPublish: {
4141
id: 'course-authoring.course-outline.card.menu.publish',

src/course-outline/section-card/SectionCard.test.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -230,7 +230,7 @@ describe('<SectionCard />', () => {
230230

231231
// Should open compare preview modal
232232
expect(screen.getByRole('heading', { name: /preview changes: section name/i })).toBeInTheDocument();
233-
expect(screen.getByText('Preview not available')).toBeInTheDocument();
233+
expect(screen.getByText('Preview not available for container changes at this time')).toBeInTheDocument();
234234

235235
// Click on accept changes
236236
const acceptChangesButton = screen.getByText(/accept changes/i);
@@ -250,7 +250,7 @@ describe('<SectionCard />', () => {
250250

251251
// Should open compare preview modal
252252
expect(screen.getByRole('heading', { name: /preview changes: section name/i })).toBeInTheDocument();
253-
expect(screen.getByText('Preview not available')).toBeInTheDocument();
253+
expect(screen.getByText('Preview not available for container changes at this time')).toBeInTheDocument();
254254

255255
// Click on ignore changes
256256
const ignoreChangesButton = screen.getByRole('button', { name: /ignore changes/i });

src/course-outline/subsection-card/SubsectionCard.test.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -338,7 +338,7 @@ describe('<SubsectionCard />', () => {
338338

339339
// Should open compare preview modal
340340
expect(screen.getByRole('heading', { name: /preview changes: subsection name/i })).toBeInTheDocument();
341-
expect(screen.getByText('Preview not available')).toBeInTheDocument();
341+
expect(screen.getByText('Preview not available for container changes at this time')).toBeInTheDocument();
342342

343343
// Click on accept changes
344344
const acceptChangesButton = screen.getByText(/accept changes/i);
@@ -358,7 +358,7 @@ describe('<SubsectionCard />', () => {
358358

359359
// Should open compare preview modal
360360
expect(screen.getByRole('heading', { name: /preview changes: subsection name/i })).toBeInTheDocument();
361-
expect(screen.getByText('Preview not available')).toBeInTheDocument();
361+
expect(screen.getByText('Preview not available for container changes at this time')).toBeInTheDocument();
362362

363363
// Click on ignore changes
364364
const ignoreChangesButton = screen.getByRole('button', { name: /ignore changes/i });

src/course-outline/unit-card/UnitCard.test.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -198,7 +198,7 @@ describe('<UnitCard />', () => {
198198

199199
// Should open compare preview modal
200200
expect(screen.getByRole('heading', { name: /preview changes: unit name/i })).toBeInTheDocument();
201-
expect(screen.getByText('Preview not available')).toBeInTheDocument();
201+
expect(screen.getByText('Preview not available for container changes at this time')).toBeInTheDocument();
202202

203203
// Click on accept changes
204204
const acceptChangesButton = screen.getByText(/accept changes/i);
@@ -218,7 +218,7 @@ describe('<UnitCard />', () => {
218218

219219
// Should open compare preview modal
220220
expect(screen.getByRole('heading', { name: /preview changes: unit name/i })).toBeInTheDocument();
221-
expect(screen.getByText('Preview not available')).toBeInTheDocument();
221+
expect(screen.getByText('Preview not available for container changes at this time')).toBeInTheDocument();
222222

223223
// Click on ignore changes
224224
const ignoreChangesButton = screen.getByRole('button', { name: /ignore changes/i });

src/library-authoring/component-comparison/messages.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ const messages = defineMessages({
1919
},
2020
previewNotAvailable: {
2121
id: 'course-authoring.library-authoring.component-comparison.preview-not-available',
22-
defaultMessage: 'Preview not available',
22+
defaultMessage: 'Preview not available for container changes at this time',
2323
description: 'Message shown when preview is not available.',
2424
},
2525
});

0 commit comments

Comments
 (0)