diff --git a/src/Explorer/Menus/CommandBar/CommandBarComponentButtonFactory.test.ts b/src/Explorer/Menus/CommandBar/CommandBarComponentButtonFactory.test.ts index b5cca5db6..c9133b3b9 100644 --- a/src/Explorer/Menus/CommandBar/CommandBarComponentButtonFactory.test.ts +++ b/src/Explorer/Menus/CommandBar/CommandBarComponentButtonFactory.test.ts @@ -25,7 +25,7 @@ describe("CommandBarComponentButtonFactory tests", () => { updateUserContext({ databaseAccount: { properties: { - capabilities: [{ name: "EnableTable" }], + capabilities: [{ name: "EnableMongo" }], }, } as DatabaseAccount, }); @@ -38,6 +38,22 @@ describe("CommandBarComponentButtonFactory tests", () => { ); expect(enableAzureSynapseLinkBtn).toBeDefined(); }); + + it("Button should not be visible for Tables API", () => { + updateUserContext({ + databaseAccount: { + properties: { + capabilities: [{ name: "EnableTable" }], + }, + } as DatabaseAccount, + }); + + const buttons = CommandBarComponentButtonFactory.createStaticCommandBarButtons(mockExplorer, selectedNodeState); + const enableAzureSynapseLinkBtn = buttons.find( + (button) => button.commandButtonLabel === enableAzureSynapseLinkBtnLabel + ); + expect(enableAzureSynapseLinkBtn).toBeUndefined(); + }); }); describe("Enable notebook button", () => { diff --git a/src/Explorer/Menus/CommandBar/CommandBarComponentButtonFactory.tsx b/src/Explorer/Menus/CommandBar/CommandBarComponentButtonFactory.tsx index 938383d5b..137256b32 100644 --- a/src/Explorer/Menus/CommandBar/CommandBarComponentButtonFactory.tsx +++ b/src/Explorer/Menus/CommandBar/CommandBarComponentButtonFactory.tsx @@ -51,11 +51,13 @@ export function createStaticCommandBarButtons( const buttons: CommandButtonComponentProps[] = []; buttons.push(newCollectionBtn); + if (userContext.apiType !== "Tables") { + const addSynapseLink = createOpenSynapseLinkDialogButton(container); - const addSynapseLink = createOpenSynapseLinkDialogButton(container); - if (addSynapseLink) { - buttons.push(createDivider()); - buttons.push(addSynapseLink); + if (addSynapseLink) { + buttons.push(createDivider()); + buttons.push(addSynapseLink); + } } if (userContext.apiType !== "Tables") {