* initial add of toolbar to v2 editor WIP * fix Form test knocked out by rebase * basic image upload functionality added to toolbar * add cypress tests for toolbar * move image tests to previous cypress spec * test markdown insertion from buttons in jest * small tidy up * remove right padding in scrollable layout, hide scrollbar * update tests following new line changes * add more doc comments * tweak padding css * create constant for image placeholder * add image uploader change missed in staging after merge conflict resolution
17 lines
435 B
JavaScript
17 lines
435 B
JavaScript
import { generateMainImage } from '../article-form/actions';
|
|
import { validateFileInputs } from '../packs/validateFileInputs';
|
|
|
|
export const dragAndUpload = (
|
|
files,
|
|
handleImageSuccess,
|
|
handleImageFailure,
|
|
) => {
|
|
if (files.length > 0 && validateFileInputs()) {
|
|
const payload = { image: files };
|
|
generateMainImage({
|
|
payload,
|
|
successCb: handleImageSuccess,
|
|
failureCb: handleImageFailure,
|
|
});
|
|
}
|
|
};
|