Skip to content

feat(content-uploader): Implement cancel all confirmation modal#4579

Open
dealwith wants to merge 1 commit into
implement-cancelled-state-uploads-managerfrom
implement-cancel-all-confirmation-modal
Open

feat(content-uploader): Implement cancel all confirmation modal#4579
dealwith wants to merge 1 commit into
implement-cancelled-state-uploads-managerfrom
implement-cancel-all-confirmation-modal

Conversation

The Cancel All button on the modernized uploads manager now opens a
confirmation dialog instead of canceling immediately. Confirming runs
handleCancelAllUploads; dismissing leaves uploads untouched. Modal uses
@box/blueprint-web AlertModal with localized copy and danger-styled
primary action.
@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented May 20, 2026

Important

Review skipped

Auto reviews are disabled on base/target branches other than the default branch.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 922e7f8d-e09a-4a44-bd8a-c0ee4cf3e001

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch implement-cancel-all-confirmation-modal

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@dealwith dealwith changed the base branch from master to implement-cancelled-state-uploads-manager May 21, 2026 09:39
@dealwith dealwith marked this pull request as ready for review May 27, 2026 14:26
@dealwith dealwith requested review from a team as code owners May 27, 2026 14:26
@dealwith dealwith changed the title Implement cancel all confirmation modal feat(content-uploader): Implement cancel all confirmation modal May 27, 2026
import Footer from './Footer';
import UploadsManager from './UploadsManager';
import { mapToModernizedUploadItems } from './utils/mapToModernizedUploadItem';
import CancelAllUploadsModal from './CancelAllUploadsModal';
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

[nit] imports should follow alphabetical order

* passed to the modernized uploads manager so the action requires explicit
* confirmation before destroying in-progress uploads.
*/
handleCancelAllRequest = () => {
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

[nit] This function name is quite misleading because it's not actually handling any (normally network) request. Can we change this to ex. handleCancelAllClick or something implies this is simply opening the modal?

renderModal();
expect(await screen.findByRole('alertdialog')).toBeInTheDocument();
expect(screen.getByText('Cancel all uploads?')).toBeInTheDocument();
expect(screen.getByText(/Files that are still uploading will be canceled/)).toBeInTheDocument();
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

[nit] Is there a reason why this can not be expected with the literal string and has to be regex?

defaultMessage: 'Cancel All',
description: 'Confirm button for the cancel all uploads modal',
},
cancelAllUploadsKeepButton: {
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

The name feels slightly unclear what it's trying to do. How about keepUploadingButton?

@@ -0,0 +1,31 @@
import { defineMessages } from 'react-intl';

Copy link
Copy Markdown
Contributor

@reneshen0328 reneshen0328 May 28, 2026

Choose a reason for hiding this comment

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

[question] What's the intended scope of this file?

  • If it's dedicated to CancelAllUploadsModal, the prefix on every key is redundant — heading, body, confirmButton, dismissButton, closeLabel would read cleaner.
  • If it'll hold messages for other modals in content-uploader/, dropping just Modal (already implied) gets you cancelAllUploadsHeading, cancelAllUploadsBody, etc.
  • If it'll hold non-modal messages too, the current cancelAllUploadsModal prefix makes sense as-is.

@@ -1195,6 +1198,24 @@ class ContentUploader extends Component<ContentUploaderProps, State> {
* Cancel every pending or in-progress upload at once. Items keep their row
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

should this be further down with handleCancelAllUploads? or, should your inserted code be above this comment block?

instance.handleCancelAllConfirm();

expect(wrapper.state('isCancelAllModalOpen')).toBe(false);
expect(inProgress.status).toBe('canceled');
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

similar comment, same as #4577 and #4578, consider using STATUS_CANCELED instead of the raw string 'canceled'.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants