mirror of
https://github.com/Azure/cosmos-explorer.git
synced 2026-01-26 05:04:15 +00:00
copy job content change
This commit is contained in:
@@ -29,16 +29,12 @@ export default {
|
|||||||
offline: {
|
offline: {
|
||||||
title: "Offline mode",
|
title: "Offline mode",
|
||||||
description:
|
description:
|
||||||
"Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.",
|
"Offline container copy jobs let you copy data from a source container to a destination Cosmos DB container for supported APIs. To ensure data integrity between the source and destination, we recommend stopping updates on the source container before creating the copy job. Learn more about [offline copy jobs](https://learn.microsoft.com/azure/cosmos-db/how-to-container-copy?tabs=offline-copy&pivots=api-nosql).",
|
||||||
learnMoreText: "Learn more",
|
|
||||||
learnMoreHref: "https://learn.microsoft.com/en-us/azure/cosmos-db/container-copy?tabs=offline-copy",
|
|
||||||
},
|
},
|
||||||
online: {
|
online: {
|
||||||
title: "Online mode",
|
title: "Online mode",
|
||||||
description:
|
description:
|
||||||
"Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.",
|
"Online container copy jobs let you copy data from a source container to a destination Cosmos DB NoSQL API container using the [All Versions and Delete](https://learn.microsoft.com/azure/cosmos-db/change-feed-modes?tabs=all-versions-and-deletes#all-versions-and-deletes-change-feed-mode-preview) change feed. This allows updates to continue on the source while data is copied. A brief downtime is required at the end to safely switch over client applications to the destination container. Learn more about [online copy jobs](https://learn.microsoft.com/azure/cosmos-db/container-copy?tabs=online-copy&pivots=api-nosql#getting-started).",
|
||||||
learnMoreText: "Learn more",
|
|
||||||
learnMoreHref: "https://learn.microsoft.com/en-us/azure/cosmos-db/container-copy?tabs=offline-copy",
|
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
|
||||||
@@ -189,8 +185,8 @@ export default {
|
|||||||
Cancelled: "Cancelled",
|
Cancelled: "Cancelled",
|
||||||
},
|
},
|
||||||
dialog: {
|
dialog: {
|
||||||
heading: "Confirm Action",
|
heading: "",
|
||||||
confirmButtonText: "OK",
|
confirmButtonText: "Confirm",
|
||||||
cancelButtonText: "Cancel",
|
cancelButtonText: "Cancel",
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -103,12 +103,14 @@ describe("MigrationType", () => {
|
|||||||
expect(screen.getByTestId("migration-type-description-online")).toBeInTheDocument();
|
expect(screen.getByTestId("migration-type-description-online")).toBeInTheDocument();
|
||||||
|
|
||||||
const learnMoreLink = screen.getByRole("link", {
|
const learnMoreLink = screen.getByRole("link", {
|
||||||
name: ContainerCopyMessages.migrationTypeOptions.online.learnMoreText,
|
name: "online copy jobs",
|
||||||
});
|
});
|
||||||
expect(learnMoreLink).toBeInTheDocument();
|
expect(learnMoreLink).toBeInTheDocument();
|
||||||
expect(learnMoreLink).toHaveAttribute("href", ContainerCopyMessages.migrationTypeOptions.online.learnMoreHref);
|
expect(learnMoreLink).toHaveAttribute(
|
||||||
|
"href",
|
||||||
|
"https://learn.microsoft.com/azure/cosmos-db/container-copy?tabs=online-copy&pivots=api-nosql#getting-started",
|
||||||
|
);
|
||||||
expect(learnMoreLink).toHaveAttribute("target", "_blank");
|
expect(learnMoreLink).toHaveAttribute("target", "_blank");
|
||||||
expect(learnMoreLink).toHaveAttribute("rel", "noopener noreferrer");
|
|
||||||
});
|
});
|
||||||
|
|
||||||
it("should render offline description and learn more link when offline is selected", () => {
|
it("should render offline description and learn more link when offline is selected", () => {
|
||||||
@@ -126,10 +128,13 @@ describe("MigrationType", () => {
|
|||||||
expect(screen.getByTestId("migration-type-description-offline")).toBeInTheDocument();
|
expect(screen.getByTestId("migration-type-description-offline")).toBeInTheDocument();
|
||||||
|
|
||||||
const learnMoreLink = screen.getByRole("link", {
|
const learnMoreLink = screen.getByRole("link", {
|
||||||
name: ContainerCopyMessages.migrationTypeOptions.offline.learnMoreText,
|
name: "offline copy jobs",
|
||||||
});
|
});
|
||||||
expect(learnMoreLink).toBeInTheDocument();
|
expect(learnMoreLink).toBeInTheDocument();
|
||||||
expect(learnMoreLink).toHaveAttribute("href", ContainerCopyMessages.migrationTypeOptions.offline.learnMoreHref);
|
expect(learnMoreLink).toHaveAttribute(
|
||||||
|
"href",
|
||||||
|
"https://learn.microsoft.com/azure/cosmos-db/how-to-container-copy?tabs=offline-copy&pivots=api-nosql",
|
||||||
|
);
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|||||||
@@ -1,6 +1,7 @@
|
|||||||
/* eslint-disable react/prop-types */
|
/* eslint-disable react/prop-types */
|
||||||
/* eslint-disable react/display-name */
|
/* eslint-disable react/display-name */
|
||||||
import { ChoiceGroup, IChoiceGroupOption, Link, Stack, Text } from "@fluentui/react";
|
import { ChoiceGroup, IChoiceGroupOption, Stack, Text } from "@fluentui/react";
|
||||||
|
import MarkdownRender from "@nteract/markdown";
|
||||||
import { useCopyJobContext } from "Explorer/ContainerCopy/Context/CopyJobContext";
|
import { useCopyJobContext } from "Explorer/ContainerCopy/Context/CopyJobContext";
|
||||||
import React from "react";
|
import React from "react";
|
||||||
import ContainerCopyMessages from "../../../../ContainerCopyMessages";
|
import ContainerCopyMessages from "../../../../ContainerCopyMessages";
|
||||||
@@ -53,10 +54,7 @@ export const MigrationType: React.FC<MigrationTypeProps> = React.memo(() => {
|
|||||||
className="migrationTypeDescription"
|
className="migrationTypeDescription"
|
||||||
data-testid={`migration-type-description-${selectedKeyLowercase}`}
|
data-testid={`migration-type-description-${selectedKeyLowercase}`}
|
||||||
>
|
>
|
||||||
{selectedKeyContent.description}{" "}
|
<MarkdownRender source={selectedKeyContent.description} linkTarget="_blank" />
|
||||||
<Link href={selectedKeyContent.learnMoreHref} target="_blank" rel="noopener noreferrer">
|
|
||||||
{selectedKeyContent.learnMoreText}
|
|
||||||
</Link>
|
|
||||||
</Text>
|
</Text>
|
||||||
</Stack.Item>
|
</Stack.Item>
|
||||||
)}
|
)}
|
||||||
|
|||||||
@@ -35,7 +35,7 @@ jest.mock("../../ContainerCopyMessages", () => ({
|
|||||||
},
|
},
|
||||||
dialog: {
|
dialog: {
|
||||||
heading: "Confirm Action",
|
heading: "Confirm Action",
|
||||||
confirmButtonText: "OK",
|
confirmButtonText: "Confirm",
|
||||||
cancelButtonText: "Cancel",
|
cancelButtonText: "Cancel",
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
@@ -303,7 +303,7 @@ describe("CopyJobActionMenu", () => {
|
|||||||
expect(mockShowOkCancelModalDialog).toHaveBeenCalledWith(
|
expect(mockShowOkCancelModalDialog).toHaveBeenCalledWith(
|
||||||
"Confirm Action",
|
"Confirm Action",
|
||||||
null,
|
null,
|
||||||
"OK",
|
"Confirm",
|
||||||
expect.any(Function),
|
expect.any(Function),
|
||||||
"Cancel",
|
"Cancel",
|
||||||
null,
|
null,
|
||||||
@@ -360,7 +360,7 @@ describe("CopyJobActionMenu", () => {
|
|||||||
expect(mockShowOkCancelModalDialog).toHaveBeenCalledWith(
|
expect(mockShowOkCancelModalDialog).toHaveBeenCalledWith(
|
||||||
"Confirm Action",
|
"Confirm Action",
|
||||||
null,
|
null,
|
||||||
"OK",
|
"Confirm",
|
||||||
expect.any(Function),
|
expect.any(Function),
|
||||||
"Cancel",
|
"Cancel",
|
||||||
null,
|
null,
|
||||||
@@ -404,7 +404,7 @@ describe("CopyJobActionMenu", () => {
|
|||||||
expect(mockShowOkCancelModalDialog).toHaveBeenCalledWith(
|
expect(mockShowOkCancelModalDialog).toHaveBeenCalledWith(
|
||||||
"Confirm Action",
|
"Confirm Action",
|
||||||
null,
|
null,
|
||||||
"OK",
|
"Confirm",
|
||||||
expect.any(Function),
|
expect.any(Function),
|
||||||
"Cancel",
|
"Cancel",
|
||||||
null,
|
null,
|
||||||
@@ -435,7 +435,7 @@ describe("CopyJobActionMenu", () => {
|
|||||||
expect(mockShowOkCancelModalDialog).toHaveBeenCalledWith(
|
expect(mockShowOkCancelModalDialog).toHaveBeenCalledWith(
|
||||||
"Confirm Action",
|
"Confirm Action",
|
||||||
null,
|
null,
|
||||||
"OK",
|
"Confirm",
|
||||||
expect.any(Function),
|
expect.any(Function),
|
||||||
"Cancel",
|
"Cancel",
|
||||||
null,
|
null,
|
||||||
@@ -825,7 +825,7 @@ describe("CopyJobActionMenu", () => {
|
|||||||
expect(mockShowOkCancelModalDialog).toHaveBeenCalledWith(
|
expect(mockShowOkCancelModalDialog).toHaveBeenCalledWith(
|
||||||
"Confirm Action", // title
|
"Confirm Action", // title
|
||||||
null, // subText
|
null, // subText
|
||||||
"OK", // okLabel
|
"Confirm", // confirmLabel
|
||||||
expect.any(Function), // onOk
|
expect.any(Function), // onOk
|
||||||
"Cancel", // cancelLabel
|
"Cancel", // cancelLabel
|
||||||
null, // onCancel
|
null, // onCancel
|
||||||
|
|||||||
@@ -14,26 +14,19 @@ const dialogBody = {
|
|||||||
[CopyJobActions.cancel]: (jobName: string) => (
|
[CopyJobActions.cancel]: (jobName: string) => (
|
||||||
<Stack tokens={{ childrenGap: 10 }}>
|
<Stack tokens={{ childrenGap: 10 }}>
|
||||||
<Stack.Item>
|
<Stack.Item>
|
||||||
You are about to cancel <b>{jobName}</b>:
|
You are about to cancel <b>{jobName}</b> copy job.
|
||||||
</Stack.Item>
|
|
||||||
<Stack.Item>
|
|
||||||
Cancelling this job will stop it immediately. Any running or pending steps will not be completed.
|
|
||||||
</Stack.Item>
|
|
||||||
<Stack.Item>
|
|
||||||
<b>This action cannot be undone. Do you want to continue?</b>
|
|
||||||
</Stack.Item>
|
</Stack.Item>
|
||||||
|
<Stack.Item>Cancelling will stop the job immediately.</Stack.Item>
|
||||||
</Stack>
|
</Stack>
|
||||||
),
|
),
|
||||||
[CopyJobActions.complete]: (jobName: string) => (
|
[CopyJobActions.complete]: (jobName: string) => (
|
||||||
<Stack tokens={{ childrenGap: 10 }}>
|
<Stack tokens={{ childrenGap: 10 }}>
|
||||||
<Stack.Item>
|
<Stack.Item>
|
||||||
You are about to complete <b>{jobName}</b>:
|
You are about to complete <b>{jobName}</b> copy job.
|
||||||
</Stack.Item>
|
</Stack.Item>
|
||||||
<Stack.Item>
|
<Stack.Item>
|
||||||
Completing this job will stop the continuous data synchronization between the source and destination containers.
|
Once completed, continuous data copy will stop after any pending documents are processed. To maintain data
|
||||||
</Stack.Item>
|
integrity, we recommend stopping updates to the source container before completing the job.
|
||||||
<Stack.Item>
|
|
||||||
<b>This action cannot be undone. Do you want to continue?</b>
|
|
||||||
</Stack.Item>
|
</Stack.Item>
|
||||||
</Stack>
|
</Stack>
|
||||||
),
|
),
|
||||||
|
|||||||
@@ -128,6 +128,7 @@ const App = (): JSX.Element => {
|
|||||||
<>
|
<>
|
||||||
<ContainerCopyPanel explorer={explorer} />
|
<ContainerCopyPanel explorer={explorer} />
|
||||||
<SidePanel />
|
<SidePanel />
|
||||||
|
<Dialog />
|
||||||
</>
|
</>
|
||||||
) : (
|
) : (
|
||||||
<DivExplorer explorer={explorer} />
|
<DivExplorer explorer={explorer} />
|
||||||
|
|||||||
Reference in New Issue
Block a user