-
{Object.keys(advancedSettingsData).map((settingName) => {
const settingData = advancedSettingsData[settingName];
@@ -205,17 +223,33 @@ const AdvancedSettings = ({ intl, courseId }) => {
return null;
}
return (
-
+ +
{intl.formatMessage(messages.pageTitle)}
++ {intl && intl.formatMessage + ? intl.formatMessage(messages.calendarTitle) + : messages.calendarTitle.defaultMessage} +
+{dataHeading}
+{dataHeading}
+{title}
+{contentTitle}
+ {description} +{instruction}
+ )} +- {intl.formatMessage(messages.rerunTitle)} {displayName} -
- {originalCourseData} --
+ {intl.formatMessage(messages.rerunTitle)} {displayName} +
+ {originalCourseData} ++
Recent Updates
+ {courseUpdates.map((courseUpdate, index) => ( ++ {intl.formatMessage(messages.errorMessage)} +
++
*/} +
*/} +
Placeholder
+Drag widgets here
+{widget.title}
+ { + if (e.key === 'Enter' || e.key === ' ') { + e.preventDefault(); + } + }} + > +{widget.type === 'chart' ? `Chart type: ${widget.content.chartType}` : 'Text widget'}
+{intl && intl.formatMessage + ? intl.formatMessage(message.calendarTitle) + : message.calendarTitle.defaultMessage}
+Overview
+
+ Titan AI suggestion
+
+
+ No suggestions yet.
+ )} +Todo List
+No tasks added.
+ )} +{title}
+{content.description}
++ {event.time} +
{blockTitle}
-{intl.formatMessage(messages.description1, { studioShortName: getConfig().STUDIO_SHORT_NAME })}
+{intl.formatMessage(messages.description2)}
+{intl.formatMessage(messages.title1)}
+{intl.formatMessage(messages.description1, { studioShortName: getConfig().STUDIO_SHORT_NAME })}
++
{intl.formatMessage(messages.exportedContent)}
+{intl.formatMessage(messages.exportedContentHeading)}
+-
+
- {intl.formatMessage(messages.content1)} +
- {intl.formatMessage(messages.content2)} +
- {intl.formatMessage(messages.content3)} +
- {intl.formatMessage(messages.content4)} +
- {intl.formatMessage(messages.content5)} +
{intl.formatMessage(messages.notExportedContent)}
+-
+
- {intl.formatMessage(messages.content6)} +
- {intl.formatMessage(messages.content7)} +
+
{intl.formatMessage(messages.openDownloadFile)}
+{intl.formatMessage(messages.openDownloadFileDescription)}
++
{intl.formatMessage(messages.title1)}
-{intl.formatMessage(messages.description1, { studioShortName: getConfig().STUDIO_SHORT_NAME })}
--
{intl.formatMessage(messages.exportedContent)}
-{intl.formatMessage(messages.exportedContentHeading)}
--
-
- {intl.formatMessage(messages.content1)} -
- {intl.formatMessage(messages.content2)} -
- {intl.formatMessage(messages.content3)} -
- {intl.formatMessage(messages.content4)} -
- {intl.formatMessage(messages.content5)} -
{intl.formatMessage(messages.notExportedContent)}
--
-
- {intl.formatMessage(messages.content6)} -
- {intl.formatMessage(messages.content7)} -
-
{intl.formatMessage(messages.openDownloadFile)}
-{intl.formatMessage(messages.openDownloadFileDescription)}
--
{intl.formatMessage(messages.title1)}
+{intl.formatMessage(messages.description1, { studioShortName: getConfig().STUDIO_SHORT_NAME })}
++
{intl.formatMessage(messages.exportedContent)}
+{intl.formatMessage(messages.exportedContentHeading)}
+-
+
- {intl.formatMessage(messages.content1)} +
- {intl.formatMessage(messages.content2)} +
- {intl.formatMessage(messages.content3)} +
- {intl.formatMessage(messages.content4)} +
- {intl.formatMessage(messages.content5)} +
{intl.formatMessage(messages.notExportedContent)}
+-
+
- {intl.formatMessage(messages.content6)} +
- {intl.formatMessage(messages.content7)} +
+
{intl.formatMessage(messages.openDownloadFile)}
+{intl.formatMessage(messages.openDownloadFileDescription)}
++
Thank you! Your feedback helps us make your experience even better.
+Something went wrong. Please try again.
+404
+
+
+
+
+
+
+ {intl.formatMessage(messages.pasteButtonWhatsInClipboardText)} +
+{title}
diff --git a/src/generic/data/thunks.js b/src/generic/data/thunks.js index f5cc8a9557..e0826028bf 100644 --- a/src/generic/data/thunks.js +++ b/src/generic/data/thunks.js @@ -1,10 +1,3 @@ -import { logError } from '@edx/frontend-platform/logging'; - -import { CLIPBOARD_STATUS, NOTIFICATION_MESSAGES } from '../../constants'; -import { - hideProcessingNotification, - showProcessingNotification, -} from '../processing-notification/data/slice'; import { RequestStatus } from '../../data/constants'; import { fetchOrganizations, @@ -13,14 +6,11 @@ import { updateRedirectUrlObj, updateCourseRerunData, updateSavingStatus, - updateClipboardData, } from './slice'; import { createOrRerunCourse, getOrganizations, getCourseRerun, - updateClipboard, - getClipboard, } from './api'; export function fetchOrganizationsQuery() { @@ -62,34 +52,4 @@ export function updateCreateOrRerunCourseQuery(courseData) { return false; } }; -} - -export function copyToClipboard(usageKey) { - const POLL_INTERVAL_MS = 1000; // Timeout duration for polling in milliseconds - - return async (dispatch) => { - dispatch(showProcessingNotification(NOTIFICATION_MESSAGES.copying)); - dispatch(updateSavingStatus({ status: RequestStatus.PENDING })); - - try { - let clipboardData = await updateClipboard(usageKey); - - while (clipboardData.content?.status === CLIPBOARD_STATUS.loading) { - // eslint-disable-next-line no-await-in-loop,no-promise-executor-return - await new Promise((resolve) => setTimeout(resolve, POLL_INTERVAL_MS)); - clipboardData = await getClipboard(); // eslint-disable-line no-await-in-loop - } - - if (clipboardData.content?.status === CLIPBOARD_STATUS.ready) { - dispatch(updateClipboardData(clipboardData)); - dispatch(updateSavingStatus({ status: RequestStatus.SUCCESSFUL })); - } else { - throw new Error(`Unexpected clipboard status "${clipboardData.content?.status}" in successful API response.`); - } - } catch (error) { - logError('Error copying to clipboard:', error); - } finally { - dispatch(hideProcessingNotification()); - } - }; -} +} \ No newline at end of file diff --git a/src/generic/datepicker-control/DatepickerControl.jsx b/src/generic/datepicker-control/DatepickerControl.jsx index 91306f2f11..cd9fd4e729 100644 --- a/src/generic/datepicker-control/DatepickerControl.jsx +++ b/src/generic/datepicker-control/DatepickerControl.jsx @@ -39,7 +39,8 @@ const DatepickerControl = ({ {label} {showUTC && ( - ({intl.formatMessage(messages.datepickerUTC)}) + {/* This will show the user's timezone with offset */} + ({intl.formatMessage(messages.datepickerCustom)}) )} @@ -99,4 +100,4 @@ DatepickerControl.propTypes = { onChange: PropTypes.func.isRequired, }; -export default DatepickerControl; +export default DatepickerControl; \ No newline at end of file diff --git a/src/generic/datepicker-control/messages.js b/src/generic/datepicker-control/messages.js index b6139f7b57..0e10c72dcc 100644 --- a/src/generic/datepicker-control/messages.js +++ b/src/generic/datepicker-control/messages.js @@ -1,5 +1,13 @@ +import moment from 'moment-timezone'; import { defineMessages } from '@edx/frontend-platform/i18n'; +const getUserTimezoneDetails = () => { + const userTimezone = Intl.DateTimeFormat().resolvedOptions().timeZone; + const timezoneOffset = moment.tz(userTimezone).format('Z'); + + return `${userTimezone} GMT${timezoneOffset}`; +}; + const messages = defineMessages({ calendarAltText: { id: 'course-authoring.schedule.schedule-section.alt-text', @@ -9,6 +17,10 @@ const messages = defineMessages({ id: 'course-authoring.schedule.schedule-section.datepicker.utc', defaultMessage: 'UTC', }, + datepickerCustom: { + id: 'this.datepickerCustom', + defaultMessage: getUserTimezoneDetails(), + }, }); -export default messages; +export default messages; \ No newline at end of file diff --git a/src/generic/drag-helper/SortableItem.jsx b/src/generic/drag-helper/SortableItem.jsx index ffea67a849..98aafd3e2d 100644 --- a/src/generic/drag-helper/SortableItem.jsx +++ b/src/generic/drag-helper/SortableItem.jsx @@ -8,6 +8,7 @@ import { } from '@openedx/paragon'; import { DragIndicator } from '@openedx/paragon/icons'; +import { PluginSlot } from '@openedx/frontend-plugin-framework'; import messages from './messages'; const SortableItem = ({ @@ -50,7 +51,7 @@ const SortableItem = ({ marginBottom: '1.5rem', borderRadius: '0.35rem', boxShadow: '0 0 .125rem rgba(0, 0, 0, .15), 0 0 .25rem rgba(0, 0, 0, .15)', - ...componentStyle, + // ...componentStyle, }; return ( @@ -73,7 +74,11 @@ const SortableItem = ({ {...listeners} > -{intl.formatMessage(messages.description1)}
{intl.formatMessage(messages.description2)}
{intl.formatMessage(messages.description3)}
-{intl.formatMessage(messages.title1)}
++ {intl.formatMessage(messages.description1, { studioShortName: getConfig().STUDIO_SHORT_NAME })} +
++
{intl.formatMessage(messages.importedContent)}
+{intl.formatMessage(messages.importedContentHeading)}
+-
+
- {intl.formatMessage(messages.content1)} +
- {intl.formatMessage(messages.content2)} +
- {intl.formatMessage(messages.content3)} +
- {intl.formatMessage(messages.content4)} +
- {intl.formatMessage(messages.content5)} +
{intl.formatMessage(messages.notImportedContent)}
+-
+
- {intl.formatMessage(messages.content6)} +
- {intl.formatMessage(messages.content7)} +
+
{intl.formatMessage(messages.warningTitle)}
+{intl.formatMessage(messages.warningDescription)}
++
+
This is a text component which uses HTML.
', + metadata: { displayName: 'Introduction to Testing' }, + }; + jest.spyOn(editorCmsApi, 'fetchBlockById').mockImplementationOnce(async () => ( + { status: 200, data: snakeCaseObject(fieldsHtml) } + )); + axiosMock.onPatch(collectionComponentUrl).reply(200); + + render(collectionId); + + const textButton = screen.getByRole('button', { name: /text/i }); + fireEvent.click(textButton); + + // Component should be linked to Collection on closing editor. + const closeButton = await screen.findByRole('button', { name: 'Exit the editor' }); + fireEvent.click(closeButton); + await waitFor(() => expect(axiosMock.history.post[0].url).toEqual(url)); + await waitFor(() => expect(axiosMock.history.patch.length).toEqual(1)); + await waitFor(() => expect(axiosMock.history.patch[0].url).toEqual(collectionComponentUrl)); }); it('should render paste button if clipboard contains pastable xblock', async () => { - initializeMocks(); // Simulate having an HTML block in the clipboard: const getClipboardSpy = mockClipboardHtml.applyMock(); render(); @@ -59,7 +164,6 @@ describe('+
Content ({componentCount})
-
-
{library.description}
-{library.description}
++
+ {intl.formatMessage(messages.coursesTabCourseNotFoundAlertMessage)} +
+ +{title}
+{metadata}
+*/} + {/*
{metadata}
*/} +