fix: Multiple UI/UX improvements (#2529)
This includes multiple improvements described in https://github.com/openedx/frontend-app-authoring/issues/2528
This commit is contained in:
@@ -4,7 +4,7 @@ import {
|
||||
import {
|
||||
ActionRow, Button, Icon, ModalDialog, useToggle,
|
||||
} from '@openedx/paragon';
|
||||
import { Info, Warning } from '@openedx/paragon/icons';
|
||||
import { Info } from '@openedx/paragon/icons';
|
||||
import { useIntl, FormattedMessage } from '@edx/frontend-platform/i18n';
|
||||
|
||||
import { ToastContext } from '@src/generic/toast-context';
|
||||
@@ -150,7 +150,7 @@ export const PreviewLibraryXBlockChanges = ({
|
||||
return (
|
||||
<CompareChangesWidget
|
||||
usageKey={blockData.upstreamBlockId}
|
||||
oldUsageKey={isTextWithLocalChanges ? blockData.downstreamBlockId : undefined}
|
||||
oldUsageKey={blockData.downstreamBlockId}
|
||||
oldTitle={isTextWithLocalChanges ? blockData.displayName : undefined}
|
||||
oldVersion={blockData.upstreamBlockVersionSynced || 'published'}
|
||||
newVersion="published"
|
||||
@@ -235,21 +235,14 @@ export const PreviewLibraryXBlockChanges = ({
|
||||
</ModalDialog.Title>
|
||||
</ModalDialog.Header>
|
||||
<ModalDialog.Body>
|
||||
{isTextWithLocalChanges ? (
|
||||
{isTextWithLocalChanges && (
|
||||
<AlertMessage
|
||||
show
|
||||
variant="info"
|
||||
icon={Info}
|
||||
title={intl.formatMessage(messages.localEditsAlert)}
|
||||
/>
|
||||
) : (!blockData.isContainer && (
|
||||
<AlertMessage
|
||||
show
|
||||
variant="warning"
|
||||
icon={Warning}
|
||||
title={intl.formatMessage(messages.olderVersionPreviewAlert)}
|
||||
/>
|
||||
))}
|
||||
)}
|
||||
{getBody()}
|
||||
</ModalDialog.Body>
|
||||
<ModalDialog.Footer>
|
||||
|
||||
@@ -51,11 +51,6 @@ const messages = defineMessages({
|
||||
defaultMessage: 'Ignore',
|
||||
description: 'Preview changes confirmation dialog confirm button text when user clicks on ignore changes.',
|
||||
},
|
||||
olderVersionPreviewAlert: {
|
||||
id: 'course-authoring.review-tab.preview.old-version-alert',
|
||||
defaultMessage: 'The old version preview is the previous library version',
|
||||
description: 'Alert message stating that older version in preview is of library block',
|
||||
},
|
||||
localEditsAlert: {
|
||||
id: 'course-authoring.review-tab.preview.loal-edits-alert',
|
||||
defaultMessage: 'This library content has local edits.',
|
||||
@@ -73,7 +68,7 @@ const messages = defineMessages({
|
||||
},
|
||||
updateToPublishedLibraryContentBody: {
|
||||
id: 'course-authoring.review-tab.preview.update-to-published.modal.body',
|
||||
defaultMessage: 'Updating this block will discard local changes. Any eidts made within this course will be discarted, and cannot be recovered',
|
||||
defaultMessage: 'Updating this block will discard local changes. Any edits made within this course will be discarded, and cannot be recovered',
|
||||
description: 'Body of the modal to update a content to the published library content',
|
||||
},
|
||||
updateToPublishedLibraryContentConfirm: {
|
||||
@@ -93,7 +88,7 @@ const messages = defineMessages({
|
||||
},
|
||||
keepCourseContentBody: {
|
||||
id: 'course-authoring.review-tab.preview.keep-course-content.modal.body',
|
||||
defaultMessage: 'This will keep the locally edited course content. if the component is published again in its library, you can choose to update to published library content',
|
||||
defaultMessage: 'This will keep the locally edited course content. If the component is published again in its library, you can choose to update to published library content',
|
||||
description: 'Body of the modal to keep the content of a course component',
|
||||
},
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user