Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixed issues with uploa progress not being displayed correctly #1062

Merged
merged 2 commits into from
Apr 5, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ const EmbedComponent = ({
return (
<NodeViewWrapper
className={`neeto-editor__video-wrapper neeto-editor__video--${align}`}
data-cy="neeto-editor-video-wrapper"
>
<Resizable
lockAspectRatio
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ export default Node.create({

content: "inline*",

draggable: true,
draggable: false,

isolating: true,

Expand Down Expand Up @@ -181,14 +181,13 @@ export default Node.create({
const url = await upload(image, DIRECT_UPLOAD_ENDPOINT);
url &&
view.state.doc.descendants((node, pos) => {
if (node.attrs.id === id) {
const transaction = view.state.tr.setNodeMarkup(
pos,
null,
{ src: url }
);
view.dispatch(transaction);
}
if (!(node.attrs.id === id)) return;
const transaction = view.state.tr.setNodeMarkup(
pos,
null,
{ src: url }
);
view.dispatch(transaction);
});
} catch {
view.dispatch(view.state.tr.delete(pos, pos + 1));
Expand Down
1 change: 1 addition & 0 deletions src/components/Editor/CustomExtensions/Image/Menu.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ const Menu = ({ align, editor, updateAttributes, deleteNode }) => {
>
{menuOptions.map(({ Icon, optionName, alignPos }) => (
<Button
data-cy={`neeto-editor-image-menu-${optionName}`}
icon={Icon}
key={optionName}
style={alignPos === align ? "secondary" : "text"}
Expand Down
2 changes: 1 addition & 1 deletion src/utils/ActiveStorageUpload.js
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ class ActiveStorageUpload extends BasePlugin {

uploadFile = async file => {
const handleProgress = xhr => {
if (xhr.lengthComputable) {
if (xhr.event.lengthComputable) {
this.uppy.emit("upload-progress", file, {
uploader: this,
bytesUploaded: xhr.loaded,
Expand Down
Loading