Remove Enable Azure synapse link for Cassandra (#1427)

This commit is contained in:
sindhuba 2023-04-10 10:18:57 -07:00 committed by GitHub
parent 1b5a9b83ff
commit 755b732532
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 17 additions and 1 deletions

View File

@ -54,6 +54,22 @@ describe("CommandBarComponentButtonFactory tests", () => {
); );
expect(enableAzureSynapseLinkBtn).toBeUndefined(); expect(enableAzureSynapseLinkBtn).toBeUndefined();
}); });
it("Button should not be visible for Cassandra API", () => {
updateUserContext({
databaseAccount: {
properties: {
capabilities: [{ name: "EnableCassandra" }],
},
} as DatabaseAccount,
});
const buttons = CommandBarComponentButtonFactory.createStaticCommandBarButtons(mockExplorer, selectedNodeState);
const enableAzureSynapseLinkBtn = buttons.find(
(button) => button.commandButtonLabel === enableAzureSynapseLinkBtnLabel
);
expect(enableAzureSynapseLinkBtn).toBeUndefined();
});
}); });
describe("Enable notebook button", () => { describe("Enable notebook button", () => {

View File

@ -51,7 +51,7 @@ export function createStaticCommandBarButtons(
const buttons: CommandButtonComponentProps[] = []; const buttons: CommandButtonComponentProps[] = [];
buttons.push(newCollectionBtn); buttons.push(newCollectionBtn);
if (userContext.apiType !== "Tables") { if (userContext.apiType !== "Tables" && userContext.apiType !== "Cassandra") {
const addSynapseLink = createOpenSynapseLinkDialogButton(container); const addSynapseLink = createOpenSynapseLinkDialogButton(container);
if (addSynapseLink) { if (addSynapseLink) {