Fix bugs on data transfer and bring back query explanation and remove query prompt from editor (#1777)
* Fix minor issues * add back preview tag * bring back query explanation and remove prompt in editor
This commit is contained in:
parent
a524138ac9
commit
da2e874ae6
|
@ -122,14 +122,21 @@ const pollDataTransferJobOperation = async (
|
||||||
|
|
||||||
updateDataTransferJob(body);
|
updateDataTransferJob(body);
|
||||||
|
|
||||||
if (status === "Cancelled" || status === "Failed" || status === "Faulted") {
|
if (status === "Cancelled") {
|
||||||
|
removeFromPolling(jobName);
|
||||||
|
clearMessage && clearMessage();
|
||||||
|
const cancelMessage = `Data transfer job ${jobName} cancelled`;
|
||||||
|
NotificationConsoleUtils.logConsoleError(cancelMessage);
|
||||||
|
throw new AbortError(cancelMessage);
|
||||||
|
}
|
||||||
|
if (status === "Failed" || status === "Faulted") {
|
||||||
removeFromPolling(jobName);
|
removeFromPolling(jobName);
|
||||||
const errorMessage = body?.properties?.error
|
const errorMessage = body?.properties?.error
|
||||||
? JSON.stringify(body?.properties?.error)
|
? JSON.stringify(body?.properties?.error)
|
||||||
: "Operation could not be completed";
|
: "Operation could not be completed";
|
||||||
const error = new Error(errorMessage);
|
const error = new Error(errorMessage);
|
||||||
clearMessage && clearMessage();
|
clearMessage && clearMessage();
|
||||||
NotificationConsoleUtils.logConsoleError(`Data transfer job ${jobName} Failed`);
|
NotificationConsoleUtils.logConsoleError(`Data transfer job ${jobName} failed: ${errorMessage}`);
|
||||||
throw new AbortError(error);
|
throw new AbortError(error);
|
||||||
}
|
}
|
||||||
if (status === "Completed") {
|
if (status === "Completed") {
|
||||||
|
|
|
@ -136,15 +136,15 @@ export const PartitionKeyComponent: React.FC<PartitionKeyComponentProps> = ({ da
|
||||||
};
|
};
|
||||||
|
|
||||||
const getPercentageComplete = () => {
|
const getPercentageComplete = () => {
|
||||||
|
const jobStatus = portalDataTransferJob?.properties?.status;
|
||||||
|
const isCompleted = jobStatus === "Completed";
|
||||||
|
if (isCompleted) {
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
const processedCount = portalDataTransferJob?.properties?.processedCount;
|
const processedCount = portalDataTransferJob?.properties?.processedCount;
|
||||||
const totalCount = portalDataTransferJob?.properties?.totalCount;
|
const totalCount = portalDataTransferJob?.properties?.totalCount;
|
||||||
const jobStatus = portalDataTransferJob?.properties?.status;
|
const isJobInProgress = isCurrentJobInProgress(portalDataTransferJob);
|
||||||
const isCancelled = jobStatus === "Cancelled";
|
return isJobInProgress ? (totalCount > 0 ? processedCount / totalCount : null) : 0;
|
||||||
const isCompleted = jobStatus === "Completed";
|
|
||||||
if (totalCount <= 0 && !isCompleted) {
|
|
||||||
return isCancelled ? 0 : null;
|
|
||||||
}
|
|
||||||
return isCompleted ? 1 : processedCount / totalCount;
|
|
||||||
};
|
};
|
||||||
|
|
||||||
return (
|
return (
|
||||||
|
|
|
@ -149,7 +149,7 @@ export const getTabTitle = (tab: SettingsV2TabTypes): string => {
|
||||||
case SettingsV2TabTypes.IndexingPolicyTab:
|
case SettingsV2TabTypes.IndexingPolicyTab:
|
||||||
return "Indexing Policy";
|
return "Indexing Policy";
|
||||||
case SettingsV2TabTypes.PartitionKeyTab:
|
case SettingsV2TabTypes.PartitionKeyTab:
|
||||||
return "Partition Keys";
|
return "Partition Keys (preview)";
|
||||||
case SettingsV2TabTypes.ComputedPropertiesTab:
|
case SettingsV2TabTypes.ComputedPropertiesTab:
|
||||||
return "Computed Properties (preview)";
|
return "Computed Properties (preview)";
|
||||||
default:
|
default:
|
||||||
|
|
|
@ -207,7 +207,7 @@ exports[`SettingsComponent renders 1`] = `
|
||||||
/>
|
/>
|
||||||
</PivotItem>
|
</PivotItem>
|
||||||
<PivotItem
|
<PivotItem
|
||||||
headerText="Partition Keys"
|
headerText="Partition Keys (preview)"
|
||||||
itemKey="PartitionKeyTab"
|
itemKey="PartitionKeyTab"
|
||||||
key="PartitionKeyTab"
|
key="PartitionKeyTab"
|
||||||
style={
|
style={
|
||||||
|
|
|
@ -6,6 +6,7 @@ import {
|
||||||
Icon,
|
Icon,
|
||||||
IconButton,
|
IconButton,
|
||||||
Link,
|
Link,
|
||||||
|
MessageBar,
|
||||||
Stack,
|
Stack,
|
||||||
Text,
|
Text,
|
||||||
TooltipHost,
|
TooltipHost,
|
||||||
|
@ -207,6 +208,7 @@ export const ChangePartitionKeyPane: React.FC<ChangePartitionKeyPaneProps> = ({
|
||||||
</Stack>
|
</Stack>
|
||||||
{createNewContainer ? (
|
{createNewContainer ? (
|
||||||
<Stack>
|
<Stack>
|
||||||
|
<MessageBar>All configurations except for unique keys will be copied from the source container</MessageBar>
|
||||||
<Stack className="panelGroupSpacing">
|
<Stack className="panelGroupSpacing">
|
||||||
<Stack horizontal>
|
<Stack horizontal>
|
||||||
<span className="mandatoryStar">* </span>
|
<span className="mandatoryStar">* </span>
|
||||||
|
|
|
@ -214,8 +214,10 @@ export const QueryCopilotPromptbar: React.FC<QueryCopilotPromptProps> = ({
|
||||||
const generateSQLQueryResponse: GenerateSQLQueryResponse = await response?.json();
|
const generateSQLQueryResponse: GenerateSQLQueryResponse = await response?.json();
|
||||||
if (response.ok) {
|
if (response.ok) {
|
||||||
if (generateSQLQueryResponse?.sql !== "N/A") {
|
if (generateSQLQueryResponse?.sql !== "N/A") {
|
||||||
let currentGeneratedQuery = `-- **Prompt:** ${userPrompt}\r\n`;
|
const queryExplanation = `-- **Explanation of query:** ${
|
||||||
currentGeneratedQuery += generateSQLQueryResponse.sql;
|
generateSQLQueryResponse.explanation ? generateSQLQueryResponse.explanation : "N/A"
|
||||||
|
}\r\n`;
|
||||||
|
const currentGeneratedQuery = queryExplanation + generateSQLQueryResponse.sql;
|
||||||
const lastQuery = generatedQuery && query ? `${query}\r\n` : "";
|
const lastQuery = generatedQuery && query ? `${query}\r\n` : "";
|
||||||
setQuery(`${lastQuery}${currentGeneratedQuery}`);
|
setQuery(`${lastQuery}${currentGeneratedQuery}`);
|
||||||
setGeneratedQuery(generateSQLQueryResponse.sql);
|
setGeneratedQuery(generateSQLQueryResponse.sql);
|
||||||
|
|
Loading…
Reference in New Issue