Remove Enable Azure Synapse link button for Tables API (#1425)

This commit is contained in:
sindhuba 2023-04-07 08:47:23 -07:00 committed by GitHub
parent fb8871cfbf
commit 1b5a9b83ff
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 23 additions and 5 deletions

View File

@ -25,7 +25,7 @@ describe("CommandBarComponentButtonFactory tests", () => {
updateUserContext({ updateUserContext({
databaseAccount: { databaseAccount: {
properties: { properties: {
capabilities: [{ name: "EnableTable" }], capabilities: [{ name: "EnableMongo" }],
}, },
} as DatabaseAccount, } as DatabaseAccount,
}); });
@ -38,6 +38,22 @@ describe("CommandBarComponentButtonFactory tests", () => {
); );
expect(enableAzureSynapseLinkBtn).toBeDefined(); 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", () => { describe("Enable notebook button", () => {

View File

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