Change the migration type UI to radio buttons and add confirmation dialogs for canceling or confirming jobs

This commit is contained in:
Bikram Choudhury
2025-12-22 17:00:52 +05:30
parent 53288dec6f
commit a91043a0ba
19 changed files with 799 additions and 303 deletions

View File

@@ -41,8 +41,10 @@ describe("CopyJobActions", () => {
const mockExplorer = {} as Explorer;
const mockSetPanelHasConsole = jest.fn();
const mockOpenSidePanel = jest.fn();
const mockSetLightDismiss = jest.fn();
(useSidePanel.getState as jest.Mock).mockReturnValue({
setLightDismiss: mockSetLightDismiss,
setPanelHasConsole: mockSetPanelHasConsole,
openSidePanel: mockOpenSidePanel,
});
@@ -50,6 +52,7 @@ describe("CopyJobActions", () => {
openCreateCopyJobPanel(mockExplorer);
expect(mockSetPanelHasConsole).toHaveBeenCalledWith(false);
expect(mockSetLightDismiss).toHaveBeenCalledWith(false);
expect(mockOpenSidePanel).toHaveBeenCalledWith(expect.any(String), expect.any(Object), "650px");
});
@@ -59,6 +62,7 @@ describe("CopyJobActions", () => {
(useSidePanel.getState as jest.Mock).mockReturnValue({
setPanelHasConsole: jest.fn(),
setLightDismiss: jest.fn(),
openSidePanel: mockOpenSidePanel,
});
@@ -94,9 +98,11 @@ describe("CopyJobActions", () => {
};
const mockSetPanelHasConsole = jest.fn();
const mockSetLightDismiss = jest.fn();
const mockOpenSidePanel = jest.fn();
(useSidePanel.getState as jest.Mock).mockReturnValue({
setLightDismiss: mockSetLightDismiss,
setPanelHasConsole: mockSetPanelHasConsole,
openSidePanel: mockOpenSidePanel,
});
@@ -104,6 +110,7 @@ describe("CopyJobActions", () => {
openCopyJobDetailsPanel(mockJob);
expect(mockSetPanelHasConsole).toHaveBeenCalledWith(false);
expect(mockSetLightDismiss).toHaveBeenCalledWith(true);
expect(mockOpenSidePanel).toHaveBeenCalledWith(expect.stringContaining("test-job"), expect.any(Object), "650px");
});
@@ -133,6 +140,7 @@ describe("CopyJobActions", () => {
(useSidePanel.getState as jest.Mock).mockReturnValue({
setPanelHasConsole: jest.fn(),
setLightDismiss: jest.fn(),
openSidePanel: mockOpenSidePanel,
});

View File

@@ -34,6 +34,7 @@ import { CopyJobContextState, CopyJobError, CopyJobErrorType, CopyJobType } from
export const openCreateCopyJobPanel = (explorer: Explorer) => {
const sidePanelState = useSidePanel.getState();
sidePanelState.setPanelHasConsole(false);
sidePanelState.setLightDismiss(false);
sidePanelState.openSidePanel(
ContainerCopyMessages.createCopyJobPanelTitle,
<CreateCopyJobScreensProvider explorer={explorer} />,
@@ -44,6 +45,7 @@ export const openCreateCopyJobPanel = (explorer: Explorer) => {
export const openCopyJobDetailsPanel = (job: CopyJobType) => {
const sidePanelState = useSidePanel.getState();
sidePanelState.setPanelHasConsole(false);
sidePanelState.setLightDismiss(true);
sidePanelState.openSidePanel(
ContainerCopyMessages.copyJobDetailsPanelTitle(job.Name),
<CopyJobDetails job={job} />,