Prettier 2.0 (#393)

This commit is contained in:
Steve Faulkner
2021-01-20 09:15:01 -06:00
committed by GitHub
parent c1937ca464
commit 4be53284b5
500 changed files with 41927 additions and 41838 deletions

View File

@@ -46,7 +46,7 @@ export class CommandBarComponentAdapter implements ReactAdapter {
container.isSynapseLinkUpdating,
container.databaseAccount,
this.isNotebookTabActive,
container.isServerlessEnabled
container.isServerlessEnabled,
];
ko.computed(() => ko.toJSON(toWatch)).subscribe(() => this.triggerRender());
@@ -95,7 +95,7 @@ export class CommandBarComponentAdapter implements ReactAdapter {
items={uiFabricStaticButtons.concat(uiFabricTabsButtons)}
farItems={uiFabricControlButtons}
styles={{
root: { backgroundColor: backgroundColor }
root: { backgroundColor: backgroundColor },
}}
overflowButtonProps={{ ariaLabel: "More commands" }}
/>

View File

@@ -32,7 +32,7 @@ describe("CommandBarComponentButtonFactory tests", () => {
const buttons = CommandBarComponentButtonFactory.createStaticCommandBarButtons(mockExplorer);
const enableAzureSynapseLinkBtn = buttons.find(
button => button.commandButtonLabel === enableAzureSynapseLinkBtnLabel
(button) => button.commandButtonLabel === enableAzureSynapseLinkBtnLabel
);
expect(enableAzureSynapseLinkBtn).toBeDefined();
});
@@ -42,7 +42,7 @@ describe("CommandBarComponentButtonFactory tests", () => {
const buttons = CommandBarComponentButtonFactory.createStaticCommandBarButtons(mockExplorer);
const enableAzureSynapseLinkBtn = buttons.find(
button => button.commandButtonLabel === enableAzureSynapseLinkBtnLabel
(button) => button.commandButtonLabel === enableAzureSynapseLinkBtnLabel
);
expect(enableAzureSynapseLinkBtn).toBeUndefined();
});
@@ -73,7 +73,7 @@ describe("CommandBarComponentButtonFactory tests", () => {
mockExplorer.isRunningOnNationalCloud = ko.observable(false);
const buttons = CommandBarComponentButtonFactory.createStaticCommandBarButtons(mockExplorer);
const enableNotebookBtn = buttons.find(button => button.commandButtonLabel === enableNotebookBtnLabel);
const enableNotebookBtn = buttons.find((button) => button.commandButtonLabel === enableNotebookBtnLabel);
expect(enableNotebookBtn).toBeUndefined();
});
@@ -83,7 +83,7 @@ describe("CommandBarComponentButtonFactory tests", () => {
mockExplorer.isRunningOnNationalCloud = ko.observable(true);
const buttons = CommandBarComponentButtonFactory.createStaticCommandBarButtons(mockExplorer);
const enableNotebookBtn = buttons.find(button => button.commandButtonLabel === enableNotebookBtnLabel);
const enableNotebookBtn = buttons.find((button) => button.commandButtonLabel === enableNotebookBtnLabel);
expect(enableNotebookBtn).toBeUndefined();
});
@@ -93,7 +93,7 @@ describe("CommandBarComponentButtonFactory tests", () => {
mockExplorer.isRunningOnNationalCloud = ko.observable(false);
const buttons = CommandBarComponentButtonFactory.createStaticCommandBarButtons(mockExplorer);
const enableNotebookBtn = buttons.find(button => button.commandButtonLabel === enableNotebookBtnLabel);
const enableNotebookBtn = buttons.find((button) => button.commandButtonLabel === enableNotebookBtnLabel);
expect(enableNotebookBtn).toBeDefined();
expect(enableNotebookBtn.disabled).toBe(false);
expect(enableNotebookBtn.tooltipText).toBe("");
@@ -105,7 +105,7 @@ describe("CommandBarComponentButtonFactory tests", () => {
mockExplorer.isRunningOnNationalCloud = ko.observable(false);
const buttons = CommandBarComponentButtonFactory.createStaticCommandBarButtons(mockExplorer);
const enableNotebookBtn = buttons.find(button => button.commandButtonLabel === enableNotebookBtnLabel);
const enableNotebookBtn = buttons.find((button) => button.commandButtonLabel === enableNotebookBtnLabel);
expect(enableNotebookBtn).toBeDefined();
expect(enableNotebookBtn.disabled).toBe(true);
expect(enableNotebookBtn.tooltipText).toBe(
@@ -142,7 +142,7 @@ describe("CommandBarComponentButtonFactory tests", () => {
mockExplorer.isPreferredApiMongoDB = ko.computed<boolean>(() => false);
const buttons = CommandBarComponentButtonFactory.createStaticCommandBarButtons(mockExplorer);
const openMongoShellBtn = buttons.find(button => button.commandButtonLabel === openMongoShellBtnLabel);
const openMongoShellBtn = buttons.find((button) => button.commandButtonLabel === openMongoShellBtnLabel);
expect(openMongoShellBtn).toBeUndefined();
});
@@ -150,13 +150,13 @@ describe("CommandBarComponentButtonFactory tests", () => {
mockExplorer.isRunningOnNationalCloud = ko.observable(true);
const buttons = CommandBarComponentButtonFactory.createStaticCommandBarButtons(mockExplorer);
const openMongoShellBtn = buttons.find(button => button.commandButtonLabel === openMongoShellBtnLabel);
const openMongoShellBtn = buttons.find((button) => button.commandButtonLabel === openMongoShellBtnLabel);
expect(openMongoShellBtn).toBeUndefined();
});
it("Notebooks is not enabled and is unavailable - button should be shown and disabled", () => {
const buttons = CommandBarComponentButtonFactory.createStaticCommandBarButtons(mockExplorer);
const openMongoShellBtn = buttons.find(button => button.commandButtonLabel === openMongoShellBtnLabel);
const openMongoShellBtn = buttons.find((button) => button.commandButtonLabel === openMongoShellBtnLabel);
expect(openMongoShellBtn).toBeDefined();
expect(openMongoShellBtn.disabled).toBe(true);
expect(openMongoShellBtn.tooltipText).toBe(
@@ -168,7 +168,7 @@ describe("CommandBarComponentButtonFactory tests", () => {
mockExplorer.isNotebooksEnabledForAccount = ko.observable(true);
const buttons = CommandBarComponentButtonFactory.createStaticCommandBarButtons(mockExplorer);
const openMongoShellBtn = buttons.find(button => button.commandButtonLabel === openMongoShellBtnLabel);
const openMongoShellBtn = buttons.find((button) => button.commandButtonLabel === openMongoShellBtnLabel);
expect(openMongoShellBtn).toBeDefined();
expect(openMongoShellBtn.disabled).toBe(false);
expect(openMongoShellBtn.tooltipText).toBe("");
@@ -178,7 +178,7 @@ describe("CommandBarComponentButtonFactory tests", () => {
mockExplorer.isNotebookEnabled = ko.observable(true);
const buttons = CommandBarComponentButtonFactory.createStaticCommandBarButtons(mockExplorer);
const openMongoShellBtn = buttons.find(button => button.commandButtonLabel === openMongoShellBtnLabel);
const openMongoShellBtn = buttons.find((button) => button.commandButtonLabel === openMongoShellBtnLabel);
expect(openMongoShellBtn).toBeDefined();
expect(openMongoShellBtn.disabled).toBe(false);
expect(openMongoShellBtn.tooltipText).toBe("");
@@ -189,7 +189,7 @@ describe("CommandBarComponentButtonFactory tests", () => {
mockExplorer.isNotebooksEnabledForAccount = ko.observable(true);
const buttons = CommandBarComponentButtonFactory.createStaticCommandBarButtons(mockExplorer);
const openMongoShellBtn = buttons.find(button => button.commandButtonLabel === openMongoShellBtnLabel);
const openMongoShellBtn = buttons.find((button) => button.commandButtonLabel === openMongoShellBtnLabel);
expect(openMongoShellBtn).toBeDefined();
expect(openMongoShellBtn.disabled).toBe(false);
expect(openMongoShellBtn.tooltipText).toBe("");
@@ -224,7 +224,7 @@ describe("CommandBarComponentButtonFactory tests", () => {
mockExplorer.isPreferredApiCassandra = ko.computed<boolean>(() => false);
const buttons = CommandBarComponentButtonFactory.createStaticCommandBarButtons(mockExplorer);
const openCassandraShellBtn = buttons.find(button => button.commandButtonLabel === openCassandraShellBtnLabel);
const openCassandraShellBtn = buttons.find((button) => button.commandButtonLabel === openCassandraShellBtnLabel);
expect(openCassandraShellBtn).toBeUndefined();
});
@@ -232,13 +232,13 @@ describe("CommandBarComponentButtonFactory tests", () => {
mockExplorer.isRunningOnNationalCloud = ko.observable(true);
const buttons = CommandBarComponentButtonFactory.createStaticCommandBarButtons(mockExplorer);
const openCassandraShellBtn = buttons.find(button => button.commandButtonLabel === openCassandraShellBtnLabel);
const openCassandraShellBtn = buttons.find((button) => button.commandButtonLabel === openCassandraShellBtnLabel);
expect(openCassandraShellBtn).toBeUndefined();
});
it("Notebooks is not enabled and is unavailable - button should be shown and disabled", () => {
const buttons = CommandBarComponentButtonFactory.createStaticCommandBarButtons(mockExplorer);
const openCassandraShellBtn = buttons.find(button => button.commandButtonLabel === openCassandraShellBtnLabel);
const openCassandraShellBtn = buttons.find((button) => button.commandButtonLabel === openCassandraShellBtnLabel);
expect(openCassandraShellBtn).toBeDefined();
expect(openCassandraShellBtn.disabled).toBe(true);
expect(openCassandraShellBtn.tooltipText).toBe(
@@ -250,7 +250,7 @@ describe("CommandBarComponentButtonFactory tests", () => {
mockExplorer.isNotebooksEnabledForAccount = ko.observable(true);
const buttons = CommandBarComponentButtonFactory.createStaticCommandBarButtons(mockExplorer);
const openCassandraShellBtn = buttons.find(button => button.commandButtonLabel === openCassandraShellBtnLabel);
const openCassandraShellBtn = buttons.find((button) => button.commandButtonLabel === openCassandraShellBtnLabel);
expect(openCassandraShellBtn).toBeDefined();
expect(openCassandraShellBtn.disabled).toBe(false);
expect(openCassandraShellBtn.tooltipText).toBe("");
@@ -260,7 +260,7 @@ describe("CommandBarComponentButtonFactory tests", () => {
mockExplorer.isNotebookEnabled = ko.observable(true);
const buttons = CommandBarComponentButtonFactory.createStaticCommandBarButtons(mockExplorer);
const openCassandraShellBtn = buttons.find(button => button.commandButtonLabel === openCassandraShellBtnLabel);
const openCassandraShellBtn = buttons.find((button) => button.commandButtonLabel === openCassandraShellBtnLabel);
expect(openCassandraShellBtn).toBeDefined();
expect(openCassandraShellBtn.disabled).toBe(false);
expect(openCassandraShellBtn.tooltipText).toBe("");
@@ -271,7 +271,7 @@ describe("CommandBarComponentButtonFactory tests", () => {
mockExplorer.isNotebooksEnabledForAccount = ko.observable(true);
const buttons = CommandBarComponentButtonFactory.createStaticCommandBarButtons(mockExplorer);
const openCassandraShellBtn = buttons.find(button => button.commandButtonLabel === openCassandraShellBtnLabel);
const openCassandraShellBtn = buttons.find((button) => button.commandButtonLabel === openCassandraShellBtnLabel);
expect(openCassandraShellBtn).toBeDefined();
expect(openCassandraShellBtn.disabled).toBe(false);
expect(openCassandraShellBtn.tooltipText).toBe("");
@@ -313,7 +313,7 @@ describe("CommandBarComponentButtonFactory tests", () => {
mockExplorer.isNotebookEnabled = ko.observable(true);
const buttons = CommandBarComponentButtonFactory.createStaticCommandBarButtons(mockExplorer);
const connectToGitHubBtn = buttons.find(button => button.commandButtonLabel === connectToGitHubBtnLabel);
const connectToGitHubBtn = buttons.find((button) => button.commandButtonLabel === connectToGitHubBtnLabel);
expect(connectToGitHubBtn).toBeDefined();
});
@@ -323,7 +323,7 @@ describe("CommandBarComponentButtonFactory tests", () => {
const buttons = CommandBarComponentButtonFactory.createStaticCommandBarButtons(mockExplorer);
const manageGitHubSettingsBtn = buttons.find(
button => button.commandButtonLabel === manageGitHubSettingsBtnLabel
(button) => button.commandButtonLabel === manageGitHubSettingsBtnLabel
);
expect(manageGitHubSettingsBtn).toBeDefined();
});
@@ -331,11 +331,11 @@ describe("CommandBarComponentButtonFactory tests", () => {
it("Notebooks is not enabled - connect to github and manage github settings buttons should be hidden", () => {
const buttons = CommandBarComponentButtonFactory.createStaticCommandBarButtons(mockExplorer);
const connectToGitHubBtn = buttons.find(button => button.commandButtonLabel === connectToGitHubBtnLabel);
const connectToGitHubBtn = buttons.find((button) => button.commandButtonLabel === connectToGitHubBtnLabel);
expect(connectToGitHubBtn).toBeUndefined();
const manageGitHubSettingsBtn = buttons.find(
button => button.commandButtonLabel === manageGitHubSettingsBtnLabel
(button) => button.commandButtonLabel === manageGitHubSettingsBtnLabel
);
expect(manageGitHubSettingsBtn).toBeUndefined();
});

View File

@@ -56,7 +56,7 @@ export class CommandBarComponentButtonFactory {
const newNotebookButton = CommandBarComponentButtonFactory.createNewNotebookButton(container);
newNotebookButton.children = [
CommandBarComponentButtonFactory.createNewNotebookButton(container),
CommandBarComponentButtonFactory.createuploadNotebookButton(container)
CommandBarComponentButtonFactory.createuploadNotebookButton(container),
];
buttons.push(newNotebookButton);
@@ -103,7 +103,7 @@ export class CommandBarComponentButtonFactory {
const openQueryBtn = CommandBarComponentButtonFactory.createOpenQueryButton(container);
openQueryBtn.children = [
CommandBarComponentButtonFactory.createOpenQueryButton(container),
CommandBarComponentButtonFactory.createOpenQueryFromDiskButton(container)
CommandBarComponentButtonFactory.createOpenQueryFromDiskButton(container),
];
buttons.push(openQueryBtn);
} else if (isSupportedOpenQueryFromDiskApi && container.selectedNode() && container.findSelectedCollection()) {
@@ -122,7 +122,7 @@ export class CommandBarComponentButtonFactory {
commandButtonLabel: label,
ariaLabel: label,
hasPopup: true,
disabled: container.isDatabaseNodeOrNoneSelected()
disabled: container.isDatabaseNodeOrNoneSelected(),
};
newStoredProcedureBtn.children = CommandBarComponentButtonFactory.createScriptCommandButtons(container);
@@ -148,7 +148,7 @@ export class CommandBarComponentButtonFactory {
commandButtonLabel: label,
ariaLabel: label,
hasPopup: true,
disabled: container.isDatabaseNodeOrNoneSelected() && container.isPreferredApiMongoDB()
disabled: container.isDatabaseNodeOrNoneSelected() && container.isPreferredApiMongoDB(),
};
buttons.push(newMongoShellBtn);
}
@@ -172,7 +172,7 @@ export class CommandBarComponentButtonFactory {
ariaLabel: label,
tooltipText: label,
hasPopup: true,
disabled: false
disabled: false,
};
buttons.push(settingsPaneButton);
}
@@ -188,7 +188,7 @@ export class CommandBarComponentButtonFactory {
tooltipText: label,
hasPopup: false,
disabled: !container.isHostedDataExplorerEnabled(),
className: "OpenFullScreen"
className: "OpenFullScreen",
};
buttons.push(fullScreenButton);
}
@@ -203,7 +203,7 @@ export class CommandBarComponentButtonFactory {
ariaLabel: label,
tooltipText: label,
hasPopup: false,
disabled: false
disabled: false,
};
buttons.push(feedbackButtonOptions);
}
@@ -220,7 +220,7 @@ export class CommandBarComponentButtonFactory {
iconSrc: null,
iconAlt: null,
onCommandClick: null,
ariaLabel: label
ariaLabel: label,
};
}
@@ -237,7 +237,7 @@ export class CommandBarComponentButtonFactory {
commandButtonLabel: label,
ariaLabel: label,
hasPopup: true,
id: "createNewContainerCommandButton"
id: "createNewContainerCommandButton",
};
}
@@ -265,7 +265,7 @@ export class CommandBarComponentButtonFactory {
container.databaseAccount().properties &&
container.databaseAccount().properties.capabilities) ||
[];
if (capabilities.some(capability => capability.name === Constants.CapabilityNames.EnableStorageAnalytics)) {
if (capabilities.some((capability) => capability.name === Constants.CapabilityNames.EnableStorageAnalytics)) {
return null;
}
@@ -277,7 +277,7 @@ export class CommandBarComponentButtonFactory {
commandButtonLabel: label,
hasPopup: false,
disabled: container.isSynapseLinkUpdating(),
ariaLabel: label
ariaLabel: label,
};
}
@@ -292,7 +292,7 @@ export class CommandBarComponentButtonFactory {
},
commandButtonLabel: label,
ariaLabel: label,
hasPopup: true
hasPopup: true,
};
}
@@ -309,7 +309,7 @@ export class CommandBarComponentButtonFactory {
commandButtonLabel: label,
ariaLabel: label,
hasPopup: true,
disabled: container.isDatabaseNodeOrNoneSelected()
disabled: container.isDatabaseNodeOrNoneSelected(),
};
} else if (container.isPreferredApiMongoDB()) {
const label = "New Query";
@@ -323,7 +323,7 @@ export class CommandBarComponentButtonFactory {
commandButtonLabel: label,
ariaLabel: label,
hasPopup: true,
disabled: container.isDatabaseNodeOrNoneSelected()
disabled: container.isDatabaseNodeOrNoneSelected(),
};
}
@@ -348,7 +348,7 @@ export class CommandBarComponentButtonFactory {
commandButtonLabel: label,
ariaLabel: label,
hasPopup: true,
disabled: container.isDatabaseNodeOrNoneSelected()
disabled: container.isDatabaseNodeOrNoneSelected(),
};
buttons.push(newStoredProcedureBtn);
}
@@ -365,7 +365,7 @@ export class CommandBarComponentButtonFactory {
commandButtonLabel: label,
ariaLabel: label,
hasPopup: true,
disabled: container.isDatabaseNodeOrNoneSelected()
disabled: container.isDatabaseNodeOrNoneSelected(),
};
buttons.push(newUserDefinedFunctionBtn);
}
@@ -382,7 +382,7 @@ export class CommandBarComponentButtonFactory {
commandButtonLabel: label,
ariaLabel: label,
hasPopup: true,
disabled: container.isDatabaseNodeOrNoneSelected()
disabled: container.isDatabaseNodeOrNoneSelected(),
};
buttons.push(newTriggerBtn);
}
@@ -399,7 +399,7 @@ export class CommandBarComponentButtonFactory {
commandButtonLabel: label,
hasPopup: false,
disabled: false,
ariaLabel: label
ariaLabel: label,
};
}
@@ -412,7 +412,7 @@ export class CommandBarComponentButtonFactory {
commandButtonLabel: label,
hasPopup: false,
disabled: false,
ariaLabel: label
ariaLabel: label,
};
}
@@ -425,7 +425,7 @@ export class CommandBarComponentButtonFactory {
commandButtonLabel: label,
ariaLabel: label,
hasPopup: true,
disabled: false
disabled: false,
};
}
@@ -438,7 +438,7 @@ export class CommandBarComponentButtonFactory {
commandButtonLabel: label,
ariaLabel: label,
hasPopup: true,
disabled: false
disabled: false,
};
}
@@ -459,7 +459,7 @@ export class CommandBarComponentButtonFactory {
hasPopup: false,
disabled: !container.isNotebooksEnabledForAccount(),
ariaLabel: label,
tooltipText: container.isNotebooksEnabledForAccount() ? "" : tooltip
tooltipText: container.isNotebooksEnabledForAccount() ? "" : tooltip,
};
}
@@ -472,7 +472,7 @@ export class CommandBarComponentButtonFactory {
commandButtonLabel: label,
hasPopup: false,
disabled: false,
ariaLabel: label
ariaLabel: label,
};
}
@@ -498,7 +498,7 @@ export class CommandBarComponentButtonFactory {
hasPopup: false,
disabled: disableButton,
ariaLabel: label,
tooltipText: !disableButton ? "" : tooltip
tooltipText: !disableButton ? "" : tooltip,
};
}
@@ -524,7 +524,7 @@ export class CommandBarComponentButtonFactory {
hasPopup: false,
disabled: disableButton,
ariaLabel: label,
tooltipText: !disableButton ? "" : tooltip
tooltipText: !disableButton ? "" : tooltip,
};
}
@@ -537,7 +537,7 @@ export class CommandBarComponentButtonFactory {
commandButtonLabel: label,
hasPopup: false,
disabled: false,
ariaLabel: label
ariaLabel: label,
};
}
@@ -552,7 +552,7 @@ export class CommandBarComponentButtonFactory {
TelemetryProcessor.trace(Action.NotebooksGitHubConnect, ActionModifiers.Mark, {
databaseAccountName: container.databaseAccount() && container.databaseAccount().name,
defaultExperience: container.defaultExperience && container.defaultExperience(),
dataExplorerArea: Areas.Notebook
dataExplorerArea: Areas.Notebook,
});
}
container.gitHubReposPane.open();
@@ -560,7 +560,7 @@ export class CommandBarComponentButtonFactory {
commandButtonLabel: label,
hasPopup: false,
disabled: false,
ariaLabel: label
ariaLabel: label,
};
}
@@ -578,7 +578,7 @@ export class CommandBarComponentButtonFactory {
if (!openQueryBtn.disabled) {
openQueryBtn.children = [
CommandBarComponentButtonFactory.createOpenQueryButton(container),
CommandBarComponentButtonFactory.createOpenQueryFromDiskButton(container)
CommandBarComponentButtonFactory.createOpenQueryFromDiskButton(container),
];
}

View File

@@ -15,7 +15,7 @@ describe("CommandBarUtil tests", () => {
disabled: true,
tooltipText: "tooltipText",
children: [],
className: "className"
className: "className",
};
};

View File

@@ -22,7 +22,7 @@ export const convertButton = (btns: CommandButtonComponentProps[], backgroundCol
const buttonHeightPx = StyleConstants.CommandBarButtonHeight;
return btns
.filter(btn => btn)
.filter((btn) => btn)
.map(
(btn: CommandButtonComponentProps, index: number): ICommandBarItemProps => {
if (btn.isDivider) {
@@ -35,10 +35,10 @@ export const convertButton = (btns: CommandButtonComponentProps[], backgroundCol
iconProps: {
style: {
width: StyleConstants.CommandBarIconWidth, // 16
alignSelf: btn.iconName ? "baseline" : undefined
alignSelf: btn.iconName ? "baseline" : undefined,
},
imageProps: btn.iconSrc ? { src: btn.iconSrc, alt: btn.iconAlt } : undefined,
iconName: btn.iconName
iconName: btn.iconName,
},
onClick: (ev?: React.MouseEvent<HTMLElement, MouseEvent> | React.KeyboardEvent<HTMLElement>) => {
btn.onCommandClick(ev);
@@ -59,18 +59,18 @@ export const convertButton = (btns: CommandButtonComponentProps[], backgroundCol
paddingLeft: 0,
minWidth: 24,
marginLeft: isSplit ? 0 : 5,
marginRight: isSplit ? 0 : 5
marginRight: isSplit ? 0 : 5,
},
rootDisabled: {
backgroundColor: backgroundColor,
pointerEvents: "auto"
pointerEvents: "auto",
},
splitButtonMenuButton: {
backgroundColor: backgroundColor,
selectors: {
":hover": { backgroundColor: StyleConstants.AccentLight }
":hover": { backgroundColor: StyleConstants.AccentLight },
},
width: 16
width: 16,
},
label: { fontSize: StyleConstants.mediumFontSize },
rootHovered: { backgroundColor: StyleConstants.AccentLight },
@@ -78,23 +78,23 @@ export const convertButton = (btns: CommandButtonComponentProps[], backgroundCol
splitButtonMenuButtonExpanded: {
backgroundColor: StyleConstants.AccentExtra,
selectors: {
":hover": { backgroundColor: StyleConstants.AccentLight }
}
":hover": { backgroundColor: StyleConstants.AccentLight },
},
},
splitButtonDivider: {
display: "none"
display: "none",
},
icon: {
paddingLeft: 0,
paddingRight: 0
paddingRight: 0,
},
splitButtonContainer: {
marginLeft: 5,
marginRight: 5
}
marginRight: 5,
},
},
className: btn.className,
id: btn.id
id: btn.id,
};
if (isSplit) {
@@ -110,10 +110,10 @@ export const convertButton = (btns: CommandButtonComponentProps[], backgroundCol
selectors: {
".ms-ContextualMenu-itemText": { fontSize: StyleConstants.mediumFontSize },
".ms-ContextualMenu-link:hover": { backgroundColor: StyleConstants.AccentLight },
".ms-ContextualMenu-icon": { width: 16, height: 16 }
}
}
}
".ms-ContextualMenu-icon": { width: 16, height: 16 },
},
},
},
};
result.menuIconProps = {
@@ -121,14 +121,14 @@ export const convertButton = (btns: CommandButtonComponentProps[], backgroundCol
style: {
width: 12,
paddingLeft: 1,
paddingTop: 6
paddingTop: 6,
},
imageProps: { src: ChevronDownIcon, alt: btn.iconAlt }
imageProps: { src: ChevronDownIcon, alt: btn.iconAlt },
};
}
if (btn.isDropdown) {
const selectedChild = _.find(btn.children, child => child.dropdownItemKey === btn.dropdownSelectedKey);
const selectedChild = _.find(btn.children, (child) => child.dropdownItemKey === btn.dropdownSelectedKey);
result.name = selectedChild?.commandButtonLabel || btn.dropdownPlaceholder;
const dropdownStyles: Partial<IDropdownStyles> = {
@@ -136,7 +136,7 @@ export const convertButton = (btns: CommandButtonComponentProps[], backgroundCol
dropdown: { width: btn.dropdownWidth },
title: { fontSize: 12, height: 30, lineHeight: 28 },
dropdownItem: { fontSize: 12, lineHeight: 28, minHeight: 30 },
dropdownItemSelected: { fontSize: 12, lineHeight: 28, minHeight: 30 }
dropdownItemSelected: { fontSize: 12, lineHeight: 28, minHeight: 30 },
};
const onDropdownChange = (
@@ -156,7 +156,7 @@ export const convertButton = (btns: CommandButtonComponentProps[], backgroundCol
onChange={onDropdownChange}
options={btn.children.map((child: CommandButtonComponentProps) => ({
key: child.dropdownItemKey,
text: child.commandButtonLabel
text: child.commandButtonLabel,
}))}
styles={dropdownStyles}
/>
@@ -182,7 +182,7 @@ export const createDivider = (key: string): ICommandBarItemProps => {
),
iconOnly: true,
disabled: true,
key: key
key: key,
};
};
@@ -192,6 +192,6 @@ export const createMemoryTracker = (
): ICommandBarItemProps => {
return {
key,
onRender: () => <MemoryTrackerComponent memoryUsageInfo={memoryUsageInfo} />
onRender: () => <MemoryTrackerComponent memoryUsageInfo={memoryUsageInfo} />,
};
};

View File

@@ -5,7 +5,7 @@
import * as React from "react";
import {
CommandButtonComponent,
CommandButtonComponentProps
CommandButtonComponentProps,
} from "../../Controls/CommandButton/CommandButtonComponent";
export interface ControlBarComponentProps {

View File

@@ -4,7 +4,7 @@ import {
NotificationConsoleComponentProps,
ConsoleData,
NotificationConsoleComponent,
ConsoleDataType
ConsoleDataType,
} from "./NotificationConsoleComponent";
describe("NotificationConsoleComponent", () => {
@@ -13,7 +13,7 @@ describe("NotificationConsoleComponent", () => {
consoleData: [],
isConsoleExpanded: true,
onConsoleDataChange: (consoleData: ConsoleData[]) => {},
onConsoleExpandedChange: (isExpanded: boolean) => {}
onConsoleExpandedChange: (isExpanded: boolean) => {},
};
};
@@ -22,7 +22,7 @@ describe("NotificationConsoleComponent", () => {
props.consoleData.push({
type: ConsoleDataType.Info,
date: "date",
message: "message"
message: "message",
});
const wrapper = shallow(<NotificationConsoleComponent {...props} />);
@@ -37,7 +37,7 @@ describe("NotificationConsoleComponent", () => {
props.consoleData.push({
type: ConsoleDataType.InProgress,
date: "date",
message: "message"
message: "message",
});
}
@@ -55,7 +55,7 @@ describe("NotificationConsoleComponent", () => {
props.consoleData.push({
type: ConsoleDataType.Error,
date: "date",
message: "message"
message: "message",
});
}
@@ -73,7 +73,7 @@ describe("NotificationConsoleComponent", () => {
props.consoleData.push({
type: ConsoleDataType.Info,
date: "date",
message: "message"
message: "message",
});
}
@@ -88,7 +88,7 @@ describe("NotificationConsoleComponent", () => {
props.consoleData.push({
date: date,
message: msg,
type: type
type: type,
});
const wrapper = shallow(<NotificationConsoleComponent {...props} />);
expect(wrapper.find(".notificationConsoleData .date").text()).toEqual(date);
@@ -113,17 +113,17 @@ describe("NotificationConsoleComponent", () => {
props.consoleData.push({
type: ConsoleDataType.InProgress,
date: "date",
message: "message1"
message: "message1",
});
props.consoleData.push({
type: ConsoleDataType.Error,
date: "date",
message: "message2"
message: "message2",
});
props.consoleData.push({
type: ConsoleDataType.Info,
date: "date",
message: "message3"
message: "message3",
});
const wrapper = shallow(<NotificationConsoleComponent {...props} />);
@@ -137,7 +137,7 @@ describe("NotificationConsoleComponent", () => {
props.consoleData.push({
date: "date",
message: "message",
type: ConsoleDataType.Info
type: ConsoleDataType.Info,
});
props.isConsoleExpanded = true;
@@ -153,7 +153,7 @@ describe("NotificationConsoleComponent", () => {
props2.consoleData.push({
date: "date",
message: latestData,
type: ConsoleDataType.Info
type: ConsoleDataType.Info,
});
props2.isConsoleExpanded = true;

View File

@@ -22,7 +22,7 @@ import ChevronDownIcon from "../../../../images/QueryBuilder/CollapseChevronDown
export enum ConsoleDataType {
Info = 0,
Error = 1,
InProgress = 2
InProgress = 2,
}
/**
@@ -57,7 +57,7 @@ export class NotificationConsoleComponent extends React.Component<
{ key: "All", text: "All" },
{ key: "In Progress", text: "In progress" },
{ key: "Info", text: "Info" },
{ key: "Error", text: "Error" }
{ key: "Error", text: "Error" },
];
private headerTimeoutId?: number;
private prevHeaderStatus: string | null;
@@ -68,7 +68,7 @@ export class NotificationConsoleComponent extends React.Component<
this.state = {
headerStatus: "",
selectedFilter: NotificationConsoleComponent.FilterOptions[0].key || "",
isExpanded: props.isConsoleExpanded
isExpanded: props.isConsoleExpanded,
};
this.prevHeaderStatus = null;
}