Skip to content

fix(ui): disable save button until the upload file is uploaded / ready#10083

Merged
PatrikKozak merged 18 commits intomainfrom
feat/upload-from-url-disabled-save
Jan 2, 2025
Merged

fix(ui): disable save button until the upload file is uploaded / ready#10083
PatrikKozak merged 18 commits intomainfrom
feat/upload-from-url-disabled-save

Conversation

@PatrikKozak
Copy link
Copy Markdown
Contributor

@PatrikKozak PatrikKozak commented Dec 19, 2024

What?

Previously, while uploading a file - if the uploading process took a bit of time, users could still save the document prior to the upload fully completing.

Why?

During the uploading process - the save button should be disabled until the upload is complete to prevent premature saving of an upload document.

How?

Now, we keep track of the state of the upload in a provider and disable the save button until the file is fully uploaded.

@PatrikKozak PatrikKozak changed the title feat(ui): disable save button until the upload file is uploaded / ready fix(ui): disable save button until the upload file is uploaded / ready Dec 23, 2024
Copy link
Copy Markdown
Contributor

@DanRibbens DanRibbens left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is there a reason we wouldn't want to add the upload status to the existing DocumentInfoProvider? I don't see what we gain by adding another provider.

Copy link
Copy Markdown
Contributor

@DanRibbens DanRibbens left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Rather than adding the same logic for disabled state, you should pass the forceDisabled prop down. That way custom components all continue to work without having to make this same exact change also.

Comment thread packages/ui/src/elements/SaveDraftButton/index.tsx Outdated
@PatrikKozak PatrikKozak merged commit bd7f705 into main Jan 2, 2025
@PatrikKozak PatrikKozak deleted the feat/upload-from-url-disabled-save branch January 2, 2025 14:35
@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Jan 3, 2025

🚀 This is included in version v3.14.0

kendelljoseph pushed a commit that referenced this pull request Feb 21, 2025
#10083)

### What?

Previously, while uploading a file - if the uploading process took a bit
of time, users could still save the document prior to the upload fully
completing.

### Why?

During the uploading process - the save button should be disabled until
the upload is complete to prevent premature saving of an upload
document.

### How?

Now, we keep track of the state of the upload in a provider and disable
the save button until the file is fully uploaded.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants