mirror of
https://github.com/Azure/cosmos-explorer.git
synced 2025-02-16 17:25:58 +00:00
Remove other options other than New Query for query copilot collection in the resource tree AB#2501532
This commit is contained in:
parent
ceed162491
commit
deb33daae3
@ -1,3 +1,4 @@
|
|||||||
|
import { QueryCopilotSampleContainerId, QueryCopilotSampleDatabaseId } from "Common/Constants";
|
||||||
import React from "react";
|
import React from "react";
|
||||||
import AddCollectionIcon from "../../images/AddCollection.svg";
|
import AddCollectionIcon from "../../images/AddCollection.svg";
|
||||||
import AddSqlQueryIcon from "../../images/AddSqlQuery_16x16.svg";
|
import AddSqlQueryIcon from "../../images/AddSqlQuery_16x16.svg";
|
||||||
@ -61,6 +62,13 @@ export const createDatabaseContextMenu = (container: Explorer, databaseId: strin
|
|||||||
return items;
|
return items;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
const isQueryCopilotMoreMenu = (selectedCollection: ViewModels.Collection): boolean => {
|
||||||
|
return (
|
||||||
|
selectedCollection.databaseId === QueryCopilotSampleDatabaseId &&
|
||||||
|
selectedCollection.id() === QueryCopilotSampleContainerId
|
||||||
|
);
|
||||||
|
};
|
||||||
|
|
||||||
export const createCollectionContextMenuButton = (
|
export const createCollectionContextMenuButton = (
|
||||||
container: Explorer,
|
container: Explorer,
|
||||||
selectedCollection: ViewModels.Collection
|
selectedCollection: ViewModels.Collection
|
||||||
@ -95,6 +103,7 @@ export const createCollectionContextMenuButton = (
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (!isQueryCopilotMoreMenu(selectedCollection)) {
|
||||||
if (userContext.apiType === "SQL" || userContext.apiType === "Gremlin") {
|
if (userContext.apiType === "SQL" || userContext.apiType === "Gremlin") {
|
||||||
items.push({
|
items.push({
|
||||||
iconSrc: AddStoredProcedureIcon,
|
iconSrc: AddStoredProcedureIcon,
|
||||||
@ -136,7 +145,7 @@ export const createCollectionContextMenuButton = (
|
|||||||
label: `Delete ${getCollectionName()}`,
|
label: `Delete ${getCollectionName()}`,
|
||||||
styleClass: "deleteCollectionMenuItem",
|
styleClass: "deleteCollectionMenuItem",
|
||||||
});
|
});
|
||||||
|
}
|
||||||
return items;
|
return items;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user