From 76dcd1a9208d1b72dea1efad00c3872136c13d30 Mon Sep 17 00:00:00 2001
From: Raymond Zhou <56318341+rayzhou-bit@users.noreply.github.com>
Date: Fri, 13 May 2022 12:23:42 -0700
Subject: [PATCH] Feat alert users with feedback instead of disabling
next/save buttons (#68)
* feat: implemented user feedback ErrorAlerts
---
.../components/ErrorAlerts/ErrorAlert.jsx | 29 +++-
.../ErrorAlerts/ErrorAlert.test.jsx | 26 ++-
.../__snapshots__/ErrorAlert.test.jsx.snap | 17 +-
.../FetchErrorAlert.test.jsx.snap | 2 +
.../UploadErrorAlert.test.jsx.snap | 2 +
.../ImageSettingsModal/AltTextControls.jsx | 26 ++-
.../AltTextControls.test.jsx | 7 +-
.../AltTextControls.test.jsx.snap | 58 ++++++-
.../__snapshots__/index.test.jsx.snap | 34 +++-
.../components/ImageSettingsModal/hooks.js | 106 ++++++++++--
.../ImageSettingsModal/hooks.test.js | 163 ++++++++++++++----
.../components/ImageSettingsModal/index.jsx | 23 ++-
.../ImageSettingsModal/index.test.jsx | 5 +-
.../components/ImageSettingsModal/messages.js | 12 ++
.../__snapshots__/index.test.jsx.snap | 11 ++
.../components/SelectImageModal/hooks.js | 39 +++--
.../components/SelectImageModal/hooks.test.js | 45 ++++-
.../components/SelectImageModal/index.jsx | 20 ++-
.../SelectImageModal/index.test.jsx | 11 +-
.../components/SelectImageModal/messages.js | 41 +++--
20 files changed, 541 insertions(+), 136 deletions(-)
diff --git a/src/editors/containers/TextEditor/components/ErrorAlerts/ErrorAlert.jsx b/src/editors/containers/TextEditor/components/ErrorAlerts/ErrorAlert.jsx
index 6a62d1b98..9b9dfc40d 100644
--- a/src/editors/containers/TextEditor/components/ErrorAlerts/ErrorAlert.jsx
+++ b/src/editors/containers/TextEditor/components/ErrorAlerts/ErrorAlert.jsx
@@ -11,7 +11,7 @@ export const hooks = {
state: {
isDismissed: (val) => React.useState(val),
},
- dismissalHooks: ({ isError }) => {
+ dismissalHooks: ({ dismissError, isError }) => {
const [isDismissed, setIsDismissed] = hooks.state.isDismissed(false);
React.useEffect(() => {
setIsDismissed(isDismissed && !isError);
@@ -19,16 +19,21 @@ export const hooks = {
[isError]);
return {
isDismissed,
- dismissAlert: () => setIsDismissed(true),
+ dismissAlert: () => {
+ setIsDismissed(true);
+ dismissError();
+ },
};
},
};
export const ErrorAlert = ({
+ dismissError,
+ hideHeading,
isError,
children,
}) => {
- const { isDismissed, dismissAlert } = hooks.dismissalHooks({ isError });
+ const { isDismissed, dismissAlert } = hooks.dismissalHooks({ dismissError, isError });
if (!isError || isDismissed) {
return null;
}
@@ -39,17 +44,25 @@ export const ErrorAlert = ({
dismissible
onClose={dismissAlert}
>
-
-
-
+ {!hideHeading
+ && (
+
+
+
+ )}
{children}
);
};
+ErrorAlert.defaultProps = {
+ dismissError: null,
+ hideHeading: false,
+};
+
ErrorAlert.propTypes = {
+ dismissError: PropTypes.func,
+ hideHeading: PropTypes.bool,
isError: PropTypes.bool.isRequired,
children: PropTypes.oneOfType([
PropTypes.arrayOf(PropTypes.node),
diff --git a/src/editors/containers/TextEditor/components/ErrorAlerts/ErrorAlert.test.jsx b/src/editors/containers/TextEditor/components/ErrorAlerts/ErrorAlert.test.jsx
index 436bf9e54..abeb6a5d3 100644
--- a/src/editors/containers/TextEditor/components/ErrorAlerts/ErrorAlert.test.jsx
+++ b/src/editors/containers/TextEditor/components/ErrorAlerts/ErrorAlert.test.jsx
@@ -28,15 +28,20 @@ describe('ErrorAlert component', () => {
beforeEach(() => { state.mock(); });
afterEach(() => { state.restore(); });
describe('dismissalHooks', () => {
+ const props = {
+ dismissError: jest.fn(),
+ isError: testValue,
+ };
beforeEach(() => {
- hook = module.hooks.dismissalHooks({ isError: testValue });
+ hook = module.hooks.dismissalHooks(props);
});
it('returns isDismissed value, initialized to false', () => {
expect(state.stateVals.isDismissed).toEqual(hook.isDismissed);
});
- test('dismissAlert sets isDismissed to true', () => {
+ test('dismissAlert sets isDismissed to true and calls dismissError', () => {
hook.dismissAlert();
expect(state.setState.isDismissed).toHaveBeenCalledWith(true);
+ expect(props.dismissError).toHaveBeenCalled();
});
test('On Render, calls setIsDismissed', () => {
expect(React.useEffect.mock.calls.length).toEqual(1);
@@ -51,20 +56,27 @@ describe('ErrorAlert component', () => {
describe('Component', () => {
describe('Snapshots', () => {
let props;
+ const msg =
An Error Message
;
beforeAll(() => {
props = {
- isError: false,
+ dismissError: jest.fn(),
};
- jest.spyOn(module.hooks, 'dismissalHooks').mockImplementation((value) => ({ isError: value }));
+ jest.spyOn(module.hooks, 'dismissalHooks').mockImplementation(() => ({
+ isDismissed: false,
+ dismissAlert: jest.fn().mockName('dismissAlert'),
+ }));
});
afterAll(() => {
jest.clearAllMocks();
});
- test('snapshot: is Null when no error (ErrorAlert)', () => {
- expect(shallow( An Error Message
)).toMatchSnapshot();
+ test('snapshot: is Null when no error (ErrorAlert)', () => {
+ expect(shallow( An Error Message
)).toMatchSnapshot();
});
test('snapshot: Loads children and component when error (ErrorAlert)', () => {
- expect(shallow( An Error Message
)).toMatchSnapshot();
+ expect(shallow({msg})).toMatchSnapshot();
+ });
+ test('snapshot: Does not load heading when hideHeading is true', () => {
+ expect(shallow({msg})).toMatchSnapshot();
});
});
});
diff --git a/src/editors/containers/TextEditor/components/ErrorAlerts/__snapshots__/ErrorAlert.test.jsx.snap b/src/editors/containers/TextEditor/components/ErrorAlerts/__snapshots__/ErrorAlert.test.jsx.snap
index c557aff11..8d8ecd143 100644
--- a/src/editors/containers/TextEditor/components/ErrorAlerts/__snapshots__/ErrorAlert.test.jsx.snap
+++ b/src/editors/containers/TextEditor/components/ErrorAlerts/__snapshots__/ErrorAlert.test.jsx.snap
@@ -1,10 +1,21 @@
// Jest Snapshot v1, https://goo.gl/fbAQLP
-exports[`ErrorAlert component Component Snapshots snapshot: is Null when no error (ErrorAlert) 1`] = `""`;
+exports[`ErrorAlert component Component Snapshots snapshot: Does not load heading when hideHeading is true 1`] = `
+
+
+ An Error Message
+
+
+`;
exports[`ErrorAlert component Component Snapshots snapshot: Loads children and component when error (ErrorAlert) 1`] = `
@@ -14,10 +25,10 @@ exports[`ErrorAlert component Component Snapshots snapshot: Loads children and c
id="authoring.texteditor.selectimagemodal.error.errorTitle"
/>
-
An Error Message
-
`;
+
+exports[`ErrorAlert component Component Snapshots snapshot: is Null when no error (ErrorAlert) 1`] = `""`;
diff --git a/src/editors/containers/TextEditor/components/ErrorAlerts/__snapshots__/FetchErrorAlert.test.jsx.snap b/src/editors/containers/TextEditor/components/ErrorAlerts/__snapshots__/FetchErrorAlert.test.jsx.snap
index c15744f8e..9cc5c939a 100644
--- a/src/editors/containers/TextEditor/components/ErrorAlerts/__snapshots__/FetchErrorAlert.test.jsx.snap
+++ b/src/editors/containers/TextEditor/components/ErrorAlerts/__snapshots__/FetchErrorAlert.test.jsx.snap
@@ -2,6 +2,8 @@
exports[`FetchErrorAlert Snapshots snapshot: is ErrorAlert with Message error (ErrorAlert) 1`] = `
+ {validation.show
+ && (
+
+
+
+ )}
@@ -46,10 +56,16 @@ export const AltTextControls = ({
);
AltTextControls.propTypes = {
+ error: PropTypes.shape({
+ show: PropTypes.bool,
+ }).isRequired,
isDecorative: PropTypes.bool.isRequired,
- value: PropTypes.string.isRequired,
setValue: PropTypes.func.isRequired,
setIsDecorative: PropTypes.func.isRequired,
+ validation: PropTypes.shape({
+ show: PropTypes.bool,
+ }).isRequired,
+ value: PropTypes.string.isRequired,
// inject
intl: intlShape.isRequired,
};
diff --git a/src/editors/containers/TextEditor/components/ImageSettingsModal/AltTextControls.test.jsx b/src/editors/containers/TextEditor/components/ImageSettingsModal/AltTextControls.test.jsx
index c45720330..55e3a1f12 100644
--- a/src/editors/containers/TextEditor/components/ImageSettingsModal/AltTextControls.test.jsx
+++ b/src/editors/containers/TextEditor/components/ImageSettingsModal/AltTextControls.test.jsx
@@ -19,9 +19,14 @@ describe('AltTextControls', () => {
beforeEach(() => {
props.setValue = jest.fn().mockName('props.setValue');
props.setIsDecorative = jest.fn().mockName('props.setIsDecorative');
+ props.validation = { show: true };
});
describe('render', () => {
- test('snapshot: isDecorative=true', () => {
+ test('snapshot: isDecorative=true errorProps.showSubmissionError=true', () => {
+ expect(shallow()).toMatchSnapshot();
+ });
+ test('snapshot: isDecorative=true errorProps.showSubmissionError=false', () => {
+ props.validation.show = false;
expect(shallow()).toMatchSnapshot();
});
});
diff --git a/src/editors/containers/TextEditor/components/ImageSettingsModal/__snapshots__/AltTextControls.test.jsx.snap b/src/editors/containers/TextEditor/components/ImageSettingsModal/__snapshots__/AltTextControls.test.jsx.snap
index 7a07ff7a4..15d516797 100644
--- a/src/editors/containers/TextEditor/components/ImageSettingsModal/__snapshots__/AltTextControls.test.jsx.snap
+++ b/src/editors/containers/TextEditor/components/ImageSettingsModal/__snapshots__/AltTextControls.test.jsx.snap
@@ -1,6 +1,6 @@
// Jest Snapshot v1, https://goo.gl/fbAQLP
-exports[`AltTextControls render snapshot: isDecorative=true 1`] = `
+exports[`AltTextControls render snapshot: isDecorative=true errorProps.showSubmissionError=false 1`] = `
@@ -17,6 +17,7 @@ exports[`AltTextControls render snapshot: isDecorative=true 1`] = `
className="mt-4.5"
disabled={true}
floatingLabel="Alt Text"
+ isInvalid={false}
onChange={
Object {
"hooks.onInputChange": [MockFunction props.setValue],
@@ -44,3 +45,58 @@ exports[`AltTextControls render snapshot: isDecorative=true 1`] = `
`;
+
+exports[`AltTextControls render snapshot: isDecorative=true errorProps.showSubmissionError=true 1`] = `
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+`;
diff --git a/src/editors/containers/TextEditor/components/ImageSettingsModal/__snapshots__/index.test.jsx.snap b/src/editors/containers/TextEditor/components/ImageSettingsModal/__snapshots__/index.test.jsx.snap
index ddf4b198b..754db4ee4 100644
--- a/src/editors/containers/TextEditor/components/ImageSettingsModal/__snapshots__/index.test.jsx.snap
+++ b/src/editors/containers/TextEditor/components/ImageSettingsModal/__snapshots__/index.test.jsx.snap
@@ -5,18 +5,17 @@ exports[`ImageSettingsModal render snapshot 1`] = `
close={[MockFunction props.close]}
confirmAction={
)}
>
+
+
+
({
altText: () => ({
value: 'alternative Taxes',
isDecorative: false,
+ error: {
+ show: 'sHoW',
+ dismiss: jest.fn(),
+ },
}),
onSaveClick: (args) => ({ 'hooks.onSaveClick': args }),
- isSaveDisabled: (args) => ({ 'hooks.isSaveDisabled': args }),
}));
describe('ImageSettingsModal', () => {
diff --git a/src/editors/containers/TextEditor/components/ImageSettingsModal/messages.js b/src/editors/containers/TextEditor/components/ImageSettingsModal/messages.js
index 7d331db62..1be309a18 100644
--- a/src/editors/containers/TextEditor/components/ImageSettingsModal/messages.js
+++ b/src/editors/containers/TextEditor/components/ImageSettingsModal/messages.js
@@ -59,6 +59,18 @@ export const messages = {
defaultMessage: 'This image is decorative (no alt text required).',
description: 'Checkbox label for whether or not an image is decorative.',
},
+
+ // User Feedback Errors
+ altTextError: {
+ id: 'authoring.texteditor.imagesettingsmodal.error.altTextError',
+ defaultMessage: 'Enter alt text or specify that the image is decorative only.',
+ description: 'Message presented to user when user attempts to save unaccepted altText configuration.',
+ },
+ altTextLocalFeedback: {
+ id: 'authoring.texteditor.imagesettingsmodal.error.altTextLocalFeedback',
+ defaultMessage: 'Enter alt text',
+ description: 'Message feedback for user below the alt text field.',
+ },
};
export default messages;
diff --git a/src/editors/containers/TextEditor/components/SelectImageModal/__snapshots__/index.test.jsx.snap b/src/editors/containers/TextEditor/components/SelectImageModal/__snapshots__/index.test.jsx.snap
index 4432c3b7e..3831a406f 100644
--- a/src/editors/containers/TextEditor/components/SelectImageModal/__snapshots__/index.test.jsx.snap
+++ b/src/editors/containers/TextEditor/components/SelectImageModal/__snapshots__/index.test.jsx.snap
@@ -32,6 +32,17 @@ exports[`SelectImageModal component snapshot 1`] = `
>
+
+
+
diff --git a/src/editors/containers/TextEditor/components/SelectImageModal/hooks.js b/src/editors/containers/TextEditor/components/SelectImageModal/hooks.js
index a51dd5143..f3ee8a075 100644
--- a/src/editors/containers/TextEditor/components/SelectImageModal/hooks.js
+++ b/src/editors/containers/TextEditor/components/SelectImageModal/hooks.js
@@ -6,8 +6,9 @@ import * as module from './hooks';
import { sortFunctions, sortKeys } from './utils';
export const state = {
- images: (val) => React.useState(val),
highlighted: (val) => React.useState(val),
+ images: (val) => React.useState(val),
+ showSelectImageError: (val) => React.useState(val),
searchString: (val) => React.useState(val),
sortBy: (val) => React.useState(val),
};
@@ -34,12 +35,13 @@ export const displayList = ({ sortBy, searchString, images }) => module.filtered
}).sort(sortFunctions[sortBy in sortKeys ? sortKeys[sortBy] : sortKeys.dateNewest]);
export const imgListHooks = ({
- setSelection,
searchSortProps,
+ setSelection,
}) => {
const dispatch = useDispatch();
const [images, setImages] = module.state.images({});
const [highlighted, setHighlighted] = module.state.highlighted(null);
+ const [showSelectImageError, setShowSelectImageError] = module.state.showSelectImageError(false);
const list = module.displayList({ ...searchSortProps, images });
React.useEffect(() => {
@@ -47,12 +49,12 @@ export const imgListHooks = ({
}, []);
return {
- images,
- // highlight by id
- selectBtnProps: {
- disabled: !highlighted,
- onClick: () => setSelection(images[highlighted]),
+ error: {
+ show: showSelectImageError,
+ set: () => setShowSelectImageError(true),
+ dismiss: () => setShowSelectImageError(false),
},
+ images,
galleryProps: {
galleryIsEmpty: Object.keys(images).length === 0,
searchIsEmpty: list.length === 0,
@@ -60,6 +62,16 @@ export const imgListHooks = ({
highlighted,
onHighlightChange: e => setHighlighted(e.target.value),
},
+ // highlight by id
+ selectBtnProps: {
+ onClick: () => {
+ if (highlighted) {
+ setSelection(images[highlighted]);
+ } else {
+ setShowSelectImageError(true);
+ }
+ },
+ },
};
};
@@ -85,13 +97,18 @@ export const imgHooks = ({ setSelection }) => {
const searchSortProps = module.searchAndSortHooks();
const imgList = module.imgListHooks({ setSelection, searchSortProps });
const fileInput = module.fileInputHooks({ setSelection });
- const { selectBtnProps, galleryProps } = imgList;
-
- return {
- fileInput,
+ const {
+ error,
galleryProps,
selectBtnProps,
+ } = imgList;
+
+ return {
+ error,
+ fileInput,
+ galleryProps,
searchSortProps,
+ selectBtnProps,
};
};
diff --git a/src/editors/containers/TextEditor/components/SelectImageModal/hooks.test.js b/src/editors/containers/TextEditor/components/SelectImageModal/hooks.test.js
index 6423ab68f..95bb1115a 100644
--- a/src/editors/containers/TextEditor/components/SelectImageModal/hooks.test.js
+++ b/src/editors/containers/TextEditor/components/SelectImageModal/hooks.test.js
@@ -61,8 +61,9 @@ describe('SelectImageModal hooks', () => {
jest.clearAllMocks();
});
describe('state hooks', () => {
- state.testGetter(state.keys.images);
state.testGetter(state.keys.highlighted);
+ state.testGetter(state.keys.images);
+ state.testGetter(state.keys.showSelectImageError);
state.testGetter(state.keys.searchString);
state.testGetter(state.keys.sortBy);
});
@@ -175,12 +176,6 @@ describe('SelectImageModal hooks', () => {
);
});
describe('selectBtnProps', () => {
- it('is disabled if nothing is highlighted', () => {
- expect(hook.selectBtnProps.disabled).toEqual(true);
- state.mockVal(state.keys.highlighted, { some: 'value' });
- load();
- expect(hook.selectBtnProps.disabled).toEqual(false);
- });
test('on click, if sets selection to the image with the same id', () => {
const highlighted = 'id1';
state.mockVal(state.keys.images, { [highlighted]: testValue });
@@ -190,6 +185,14 @@ describe('SelectImageModal hooks', () => {
hook.selectBtnProps.onClick();
expect(props.setSelection).toHaveBeenCalledWith(testValue);
});
+ test('on click, sets showSelectImageError to true if nothing is highlighted', () => {
+ state.mockVal(state.keys.images, { });
+ state.mockVal(state.keys.highlighted, null);
+ load();
+ hook.selectBtnProps.onClick();
+ expect(props.setSelection).not.toHaveBeenCalled();
+ expect(state.setState.showSelectImageError).toHaveBeenCalledWith(true);
+ });
});
describe('galleryProps', () => {
it('returns highlighted value, initialized to null', () => {
@@ -197,7 +200,7 @@ describe('SelectImageModal hooks', () => {
expect(state.stateVals.highlighted).toEqual(null);
});
test('onHighlightChange sets highlighted with event target value', () => {
- expect(hook.galleryProps.onHighlightChange({ target: { value: testValue } }));
+ hook.galleryProps.onHighlightChange({ target: { value: testValue } });
expect(state.setState.highlighted).toHaveBeenCalledWith(testValue);
});
test('displayList returns displayListhook called with searchSortProps and images', () => {
@@ -207,6 +210,32 @@ describe('SelectImageModal hooks', () => {
}));
});
});
+ describe('error', () => {
+ test('show is initialized to false and returns properly', () => {
+ const show = 'sHOWSelectiMaGEeRROr';
+ expect(hook.error.show).toEqual(false);
+ state.mockVal(state.keys.showSelectImageError, show);
+ hook = hooks.imgListHooks(props);
+ expect(hook.error.show).toEqual(show);
+ });
+ test('set sets showSelectImageError to true', () => {
+ hook.error.set();
+ expect(state.setState.showSelectImageError).toHaveBeenCalledWith(true);
+ });
+ test('dismiss sets showSelectImageError to false', () => {
+ hook.error.dismiss();
+ expect(state.setState.showSelectImageError).toHaveBeenCalledWith(false);
+ });
+ // TODO
+ // it('returns selectImageError value, initialized to false', () => {
+ // expect(hook.selectImageErrorProps.isError).toEqual(state.stateVals.isSelectImageError);
+ // expect(state.stateVals.isSelectImageError).toEqual(false);
+ // });
+ // test('dismissError sets selectImageError to false', () => {
+ // hook.selectImageErrorProps.dismissError();
+ // expect(state.setState.isSelectImageError).toHaveBeenCalledWith(false);
+ // });
+ });
});
});
describe('fileInputHooks', () => {
diff --git a/src/editors/containers/TextEditor/components/SelectImageModal/index.jsx b/src/editors/containers/TextEditor/components/SelectImageModal/index.jsx
index 7dd33436a..22307ec42 100644
--- a/src/editors/containers/TextEditor/components/SelectImageModal/index.jsx
+++ b/src/editors/containers/TextEditor/components/SelectImageModal/index.jsx
@@ -13,6 +13,7 @@ import Gallery from './Gallery';
import FileInput from './FileInput';
import FetchErrorAlert from '../ErrorAlerts/FetchErrorAlert';
import UploadErrorAlert from '../ErrorAlerts/UploadErrorAlert';
+import ErrorAlert from '../ErrorAlerts/ErrorAlert';
export const SelectImageModal = ({
isOpen,
@@ -22,10 +23,11 @@ export const SelectImageModal = ({
intl,
}) => {
const {
- searchSortProps,
- galleryProps,
- selectBtnProps,
+ error,
fileInput,
+ galleryProps,
+ searchSortProps,
+ selectBtnProps,
} = hooks.imgHooks({ setSelection });
return (
+
+ {/* Error Alerts */}
+
+ {/* User Feedback Alerts */}
+
+
+
+
diff --git a/src/editors/containers/TextEditor/components/SelectImageModal/index.test.jsx b/src/editors/containers/TextEditor/components/SelectImageModal/index.test.jsx
index d613f7600..1bbfb43e5 100644
--- a/src/editors/containers/TextEditor/components/SelectImageModal/index.test.jsx
+++ b/src/editors/containers/TextEditor/components/SelectImageModal/index.test.jsx
@@ -18,14 +18,19 @@ jest.mock('../ErrorAlerts/UploadErrorAlert', () => 'UploadErrorAlert');
jest.mock('./hooks', () => ({
imgHooks: jest.fn(() => ({
- searchSortProps: { search: 'sortProps' },
- galleryProps: { gallery: 'props' },
- selectBtnProps: { select: 'btnProps' },
+ error: {
+ show: 'ShoWERror',
+ set: jest.fn(),
+ dismiss: jest.fn(),
+ },
fileInput: {
addFile: 'imgHooks.fileInput.addFile',
click: 'imgHooks.fileInput.click',
ref: 'imgHooks.fileInput.ref',
},
+ galleryProps: { gallery: 'props' },
+ searchSortProps: { search: 'sortProps' },
+ selectBtnProps: { select: 'btnProps' },
})),
}));
diff --git a/src/editors/containers/TextEditor/components/SelectImageModal/messages.js b/src/editors/containers/TextEditor/components/SelectImageModal/messages.js
index 9981dfcdf..1f106c39b 100644
--- a/src/editors/containers/TextEditor/components/SelectImageModal/messages.js
+++ b/src/editors/containers/TextEditor/components/SelectImageModal/messages.js
@@ -19,6 +19,8 @@ export const messages = {
defaultMessage: 'Search',
description: 'Placeholder text for search bar',
},
+
+ // Sort Dropdown
sortByDateNewest: {
id: 'authoring.texteditor.selectimagemodal.sort.datenewest.label',
defaultMessage: 'By date added (newest)',
@@ -39,6 +41,8 @@ export const messages = {
defaultMessage: 'By name (descending)',
description: 'Dropdown label for sorting by name (descending)',
},
+
+ // Gallery
addedDate: {
id: 'authoring.texteditor.selectimagemodal.addedDate.label',
defaultMessage: 'Added {date} at {time}',
@@ -49,21 +53,6 @@ export const messages = {
defaultMessage: 'loading...',
description: 'Gallery loading spinner screen-reader text',
},
- uploadImageError: {
- id: 'authoring.texteditor.selectimagemodal.error.uploadImageError',
- defaultMessage: 'Failed to Upload Image. Please Try again.',
- description: 'Message presented to user when image fails to upload',
- },
- fetchImagesError: {
- id: 'authoring.texteditor.selectimagemodal.error.fetchImagesError',
- defaultMessage: 'Failed to obtain course Images. Please Try again.',
- description: 'Message presented to user when images are not found',
- },
- errorTitle: {
- id: 'authoring.texteditor.selectimagemodal.error.errorTitle',
- defaultMessage: 'Error',
- description: 'Title of message presented to user when something goes wrong',
- },
emptyGalleryLabel: {
id: 'authoring.texteditor.selectimagemodal.emptyGalleryLabel',
defaultMessage: 'No images found in your gallery. Please upload an image using the button below.',
@@ -74,6 +63,28 @@ export const messages = {
defaultMessage: 'No search results.',
description: 'Label for when search returns nothing.',
},
+
+ // Errors
+ errorTitle: {
+ id: 'authoring.texteditor.selectimagemodal.error.errorTitle',
+ defaultMessage: 'Error',
+ description: 'Title of message presented to user when something goes wrong',
+ },
+ uploadImageError: {
+ id: 'authoring.texteditor.selectimagemodal.error.uploadImageError',
+ defaultMessage: 'Failed to Upload Image. Please Try again.',
+ description: 'Message presented to user when image fails to upload',
+ },
+ fetchImagesError: {
+ id: 'authoring.texteditor.selectimagemodal.error.fetchImagesError',
+ defaultMessage: 'Failed to obtain course Images. Please Try again.',
+ description: 'Message presented to user when images are not found',
+ },
+ selectImageError: {
+ id: 'authoring.texteditor.selectimagemodal.error.selectImageError',
+ defaultMessage: 'Select an image to continue.',
+ description: 'Message presented to user when clicking Next without selecting an image',
+ },
};
export default messages;