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

@@ -25,7 +25,7 @@ describe("ConflictResolutionComponent", () => {
},
onConflictResolutionDirtyChange: () => {
return;
}
},
};
it("Sproc text field displayed", () => {

View File

@@ -7,7 +7,7 @@ import {
conflictResolutionLwwTooltip,
conflictResolutionCustomToolTip,
subComponentStackProps,
getChoiceGroupStyles
getChoiceGroupStyles,
} from "../SettingsRenderUtils";
import { TextField, ITextFieldProps, Stack, IChoiceGroupOption, ChoiceGroup } from "office-ui-fabric-react";
import { ToolTipLabelComponent } from "./ToolTipLabelComponent";
@@ -35,9 +35,9 @@ export class ConflictResolutionComponent extends React.Component<ConflictResolut
private conflictResolutionChoiceGroupOptions: IChoiceGroupOption[] = [
{
key: DataModels.ConflictResolutionMode.LastWriterWins,
text: "Last Write Wins (default)"
text: "Last Write Wins (default)",
},
{ key: DataModels.ConflictResolutionMode.Custom, text: "Merge Procedure (custom)" }
{ key: DataModels.ConflictResolutionMode.Custom, text: "Merge Procedure (custom)" },
];
componentDidMount(): void {

View File

@@ -8,7 +8,7 @@ describe("IndexingPolicyComponent", () => {
automatic: false,
indexingMode: "",
includedPaths: [],
excludedPaths: []
excludedPaths: [],
};
const baseProps: IndexingPolicyComponentProps = {
shouldDiscardIndexingPolicy: false,
@@ -27,7 +27,7 @@ describe("IndexingPolicyComponent", () => {
return;
},
indexTransformationProgress: undefined,
refreshIndexTransformationProgress: () => new Promise(jest.fn())
refreshIndexTransformationProgress: () => new Promise(jest.fn()),
};
it("renders", () => {

View File

@@ -33,7 +33,7 @@ export class IndexingPolicyComponent extends React.Component<
constructor(props: IndexingPolicyComponentProps) {
super(props);
this.state = {
indexingPolicyContentIsValid: true
indexingPolicyContentIsValid: true,
};
}
@@ -55,7 +55,7 @@ export class IndexingPolicyComponent extends React.Component<
this.createIndexingPolicyEditor();
} else {
this.indexingPolicyEditor.updateOptions({
readOnly: isIndexTransforming(this.props.indexTransformationProgress)
readOnly: isIndexTransforming(this.props.indexTransformationProgress),
});
const indexingPolicyEditorModel = this.indexingPolicyEditor.getModel();
const value: string = JSON.stringify(this.props.indexingPolicyContent, undefined, 4);
@@ -91,7 +91,7 @@ export class IndexingPolicyComponent extends React.Component<
value: value,
language: "json",
readOnly: isIndexTransforming(this.props.indexTransformationProgress),
ariaLabel: "Indexing Policy"
ariaLabel: "Indexing Policy",
});
if (this.indexingPolicyEditor) {
const indexingPolicyEditorModel = this.indexingPolicyEditor.getModel();

View File

@@ -6,7 +6,7 @@ describe("IndexingPolicyRefreshComponent", () => {
it("renders", () => {
const props: IndexingPolicyRefreshComponentProps = {
indexTransformationProgress: 90,
refreshIndexTransformationProgress: () => new Promise(jest.fn())
refreshIndexTransformationProgress: () => new Promise(jest.fn()),
};
const wrapper = shallow(<IndexingPolicyRefreshComponent {...props} />);

View File

@@ -2,7 +2,7 @@ import * as React from "react";
import { MessageBar, MessageBarType } from "office-ui-fabric-react";
import {
mongoIndexTransformationRefreshingMessage,
renderMongoIndexTransformationRefreshMessage
renderMongoIndexTransformationRefreshMessage,
} from "../../SettingsRenderUtils";
import { handleError } from "../../../../../Common/ErrorHandlingUtils";
import { isIndexTransforming } from "../../SettingsUtils";
@@ -23,7 +23,7 @@ export class IndexingPolicyRefreshComponent extends React.Component<
constructor(props: IndexingPolicyRefreshComponentProps) {
super(props);
this.state = {
isRefreshing: false
isRefreshing: false,
};
}

View File

@@ -15,7 +15,7 @@ describe("AddMongoIndexComponent", () => {
},
onDiscard: () => {
return;
}
},
};
const wrapper = shallow(<AddMongoIndexComponent {...props} />);

View File

@@ -7,21 +7,21 @@ import {
TextField,
Dropdown,
IDropdownOption,
ITextField
ITextField,
} from "office-ui-fabric-react";
import {
addMongoIndexSubElementsTokens,
mongoErrorMessageStyles,
mongoWarningStackProps,
shortWidthDropDownStyles,
shortWidthTextFieldStyles
shortWidthTextFieldStyles,
} from "../../SettingsRenderUtils";
import {
getMongoIndexTypeText,
MongoIndexTypes,
MongoNotificationMessage,
MongoNotificationType,
MongoWildcardPlaceHolder
MongoWildcardPlaceHolder,
} from "../../SettingsUtils";
export interface AddMongoIndexComponentProps {
@@ -39,7 +39,7 @@ export class AddMongoIndexComponent extends React.Component<AddMongoIndexCompone
private indexTypes: IDropdownOption[] = [MongoIndexTypes.Single, MongoIndexTypes.Wildcard].map(
(value: MongoIndexTypes) => ({
text: getMongoIndexTypeText(value),
key: value
key: value,
})
);

View File

@@ -28,7 +28,7 @@ describe("MongoIndexingPolicyComponent", () => {
},
onMongoIndexingPolicyDiscardableChange: () => {
return;
}
},
};
it("renders", () => {
@@ -55,24 +55,24 @@ describe("MongoIndexingPolicyComponent", () => {
false,
false,
true,
sampleWarning
sampleWarning,
],
[
{ type: MongoNotificationType.Error, message: sampleError } as MongoNotificationMessage,
false,
false,
true,
undefined
undefined,
],
[
{ type: MongoNotificationType.Error, message: sampleError } as MongoNotificationMessage,
true,
false,
true,
undefined
undefined,
],
[undefined, false, true, true, undefined],
[undefined, true, true, true, undefined]
[undefined, true, true, true, undefined],
];
test.each(cases)(
@@ -87,7 +87,7 @@ describe("MongoIndexingPolicyComponent", () => {
const addMongoIndexProps = {
mongoIndex: { key: { keys: ["sampleKey"] } },
type: MongoIndexTypes.Single,
notification: notification
notification: notification,
};
let indexesToDrop: number[] = [];

View File

@@ -11,7 +11,7 @@ import {
MessageBarType,
Spinner,
SpinnerSize,
Separator
Separator,
} from "office-ui-fabric-react";
import {
addMongoIndexStackProps,
@@ -23,7 +23,7 @@ import {
separatorStyles,
indexingPolicynUnsavedWarningMessage,
infoAndToolTipTextStyle,
onRenderRow
onRenderRow,
} from "../../SettingsRenderUtils";
import { MongoIndex } from "../../../../../Utils/arm/generatedClients/2020-04-01/types";
import {
@@ -33,7 +33,7 @@ import {
MongoNotificationType,
getMongoIndexType,
getMongoIndexTypeText,
isIndexTransforming
isIndexTransforming,
} from "../../SettingsUtils";
import { AddMongoIndexComponent } from "./AddMongoIndexComponent";
import { CollapsibleSectionComponent } from "../../../CollapsiblePanel/CollapsibleSectionComponent";
@@ -71,8 +71,8 @@ export class MongoIndexingPolicyComponent extends React.Component<MongoIndexingP
fieldName: "actionButton",
minWidth: 100,
maxWidth: 200,
isResizable: true
}
isResizable: true,
},
];
private indexesToBeDroppedColumns: IColumn[] = [
@@ -84,8 +84,8 @@ export class MongoIndexingPolicyComponent extends React.Component<MongoIndexingP
fieldName: "actionButton",
minWidth: 100,
maxWidth: 200,
isResizable: true
}
isResizable: true,
},
];
componentDidUpdate(prevProps: MongoIndexingPolicyComponentProps): void {
@@ -114,7 +114,7 @@ export class MongoIndexingPolicyComponent extends React.Component<MongoIndexingP
return false;
}
const addErrorsExist = !!this.props.indexesToAdd.find(addMongoIndexProps => addMongoIndexProps.notification);
const addErrorsExist = !!this.props.indexesToAdd.find((addMongoIndexProps) => addMongoIndexProps.notification);
if (addErrorsExist) {
return false;
@@ -129,7 +129,7 @@ export class MongoIndexingPolicyComponent extends React.Component<MongoIndexingP
public getMongoWarningNotificationMessage = (): JSX.Element => {
const warningMessage = this.props.indexesToAdd.find(
addMongoIndexProps => addMongoIndexProps.notification?.type === MongoNotificationType.Warning
(addMongoIndexProps) => addMongoIndexProps.notification?.type === MongoNotificationType.Warning
)?.notification.message;
if (warningMessage) {
@@ -172,7 +172,7 @@ export class MongoIndexingPolicyComponent extends React.Component<MongoIndexingP
mongoIndexDisplayProps = {
definition: <Text>{definition}</Text>,
type: <Text>{getMongoIndexTypeText(type)}</Text>,
actionButton: definition === MongoIndexIdField ? <></> : this.getActionButton(arrayPosition, isCurrentIndex)
actionButton: definition === MongoIndexIdField ? <></> : this.getActionButton(arrayPosition, isCurrentIndex),
};
}
return mongoIndexDisplayProps;

View File

@@ -40,8 +40,8 @@ describe("ScaleComponent", () => {
return;
},
initialNotification: {
description: `Throughput update for ${targetThroughput} ${throughputUnit}`
} as DataModels.Notification
description: `Throughput update for ${targetThroughput} ${throughputUnit}`,
} as DataModels.Notification,
};
it("renders with correct initial notification", () => {
@@ -59,12 +59,12 @@ describe("ScaleComponent", () => {
autoscaleMaxThroughput: maxThroughput,
minimumThroughput: 400,
id: "offer",
offerReplacePending: true
offerReplacePending: true,
});
const newProps = {
...baseProps,
initialNotification: undefined as DataModels.Notification,
collection: newCollection
collection: newCollection,
};
wrapper = shallow(<ScaleComponent {...newProps} />);
expect(wrapper.exists("#throughputApplyShortDelayMessage")).toEqual(true);
@@ -95,10 +95,10 @@ describe("ScaleComponent", () => {
capabilities: [
{
name: Constants.CapabilityNames.EnableAutoScale.toLowerCase(),
description: undefined
}
]
}
description: undefined,
},
],
},
});
const props = { ...baseProps, container: newContainer };
const scaleComponent = new ScaleComponent(props);

View File

@@ -12,7 +12,7 @@ import {
throughputUnit,
getThroughputApplyLongDelayMessage,
getThroughputApplyShortDelayMessage,
updateThroughputBeyondLimitWarningMessage
updateThroughputBeyondLimitWarningMessage,
} from "../SettingsRenderUtils";
import { hasDatabaseSharedThroughput } from "../SettingsUtils";
import * as AutoPilotUtils from "../../../../Utils/AutoPilotUtils";

View File

@@ -54,7 +54,7 @@ describe("SubSettingsComponent", () => {
},
onSubSettingsDiscardableChange: () => {
return;
}
},
};
it("renders", () => {

View File

@@ -9,7 +9,7 @@ import {
TtlOn,
TtlOff,
TtlOnNoDefault,
getSanitizedInputValue
getSanitizedInputValue,
} from "../SettingsUtils";
import Explorer from "../../../Explorer";
import { Int32 } from "../../../Panes/Tables/Validators/EntityPropertyValidationCommon";
@@ -21,7 +21,7 @@ import {
titleAndInputStackProps,
getChoiceGroupStyles,
ttlWarning,
messageBarStyles
messageBarStyles,
} from "../SettingsRenderUtils";
import { ToolTipLabelComponent } from "./ToolTipLabelComponent";
@@ -119,7 +119,7 @@ export class SubSettingsComponent extends React.Component<SubSettingsComponentPr
private ttlChoiceGroupOptions: IChoiceGroupOption[] = [
{ key: TtlType.Off, text: "Off" },
{ key: TtlType.OnNoDefault, text: "On (no default)" },
{ key: TtlType.On, text: "On" }
{ key: TtlType.On, text: "On" },
];
public getTtlValue = (value: string): TtlType => {
@@ -207,7 +207,7 @@ export class SubSettingsComponent extends React.Component<SubSettingsComponentPr
private analyticalTtlChoiceGroupOptions: IChoiceGroupOption[] = [
{ key: TtlType.Off, text: "Off", disabled: true },
{ key: TtlType.OnNoDefault, text: "On (no default)" },
{ key: TtlType.On, text: "On" }
{ key: TtlType.On, text: "On" },
];
private getAnalyticalStorageTtlComponent = (): JSX.Element => (
@@ -244,7 +244,7 @@ export class SubSettingsComponent extends React.Component<SubSettingsComponentPr
private geoSpatialConfigTypeChoiceGroupOptions: IChoiceGroupOption[] = [
{ key: GeospatialConfigType.Geography, text: "Geography" },
{ key: GeospatialConfigType.Geometry, text: "Geometry" }
{ key: GeospatialConfigType.Geometry, text: "Geometry" },
];
private getGeoSpatialComponent = (): JSX.Element => (
@@ -260,7 +260,7 @@ export class SubSettingsComponent extends React.Component<SubSettingsComponentPr
private changeFeedChoiceGroupOptions: IChoiceGroupOption[] = [
{ key: ChangeFeedPolicyState.Off, text: "Off" },
{ key: ChangeFeedPolicyState.On, text: "On" }
{ key: ChangeFeedPolicyState.On, text: "On" },
];
private getChangeFeedComponent = (): JSX.Element => {

View File

@@ -2,7 +2,7 @@ import { shallow } from "enzyme";
import React from "react";
import {
ThroughputInputAutoPilotV3Component,
ThroughputInputAutoPilotV3Props
ThroughputInputAutoPilotV3Props,
} from "./ThroughputInputAutoPilotV3Component";
import * as DataModels from "../../../../../Contracts/DataModels";
@@ -43,7 +43,7 @@ describe("ThroughputInputAutoPilotV3Component", () => {
onScaleDiscardableChange: () => {
return;
},
getThroughputWarningMessage: () => undefined
getThroughputWarningMessage: () => undefined,
};
it("throughput input visible", () => {

View File

@@ -16,7 +16,7 @@ import {
AutoscaleEstimatedSpendingDisplayProps,
PriceBreakdown,
getRuPriceBreakdown,
transparentDetailsHeaderStyle
transparentDetailsHeaderStyle,
} from "../../SettingsRenderUtils";
import {
Text,
@@ -29,7 +29,7 @@ import {
Link,
MessageBar,
FontIcon,
IColumn
IColumn,
} from "office-ui-fabric-react";
import { ToolTipLabelComponent } from "../ToolTipLabelComponent";
import { getSanitizedInputValue, IsComponentDirtyResult, isDirty } from "../../SettingsUtils";
@@ -95,7 +95,7 @@ export class ThroughputInputAutoPilotV3Component extends React.Component<
private autoPilotInputMaxValue: number;
private options: IChoiceGroupOption[] = [
{ key: "true", text: "Autoscale" },
{ key: "false", text: "Manual" }
{ key: "false", text: "Manual" },
];
componentDidMount(): void {
@@ -157,7 +157,7 @@ export class ThroughputInputAutoPilotV3Component extends React.Component<
this.state = {
spendAckChecked: this.props.spendAckChecked,
exceedFreeTierThroughput:
this.props.isFreeTierAccount && !this.props.isAutoPilotSelected && this.props.throughput > 400
this.props.isFreeTierAccount && !this.props.isAutoPilotSelected && this.props.throughput > 400,
};
this.step = this.props.step ?? ThroughputInputAutoPilotV3Component.defaultStep;
@@ -224,7 +224,7 @@ export class ThroughputInputAutoPilotV3Component extends React.Component<
minWidth: 100,
maxWidth: 200,
isResizable: true,
styles: transparentDetailsHeaderStyle
styles: transparentDetailsHeaderStyle,
},
{
key: "minPerMonth",
@@ -233,7 +233,7 @@ export class ThroughputInputAutoPilotV3Component extends React.Component<
minWidth: 100,
maxWidth: 200,
isResizable: true,
styles: transparentDetailsHeaderStyle
styles: transparentDetailsHeaderStyle,
},
{
key: "maxPerMonth",
@@ -242,8 +242,8 @@ export class ThroughputInputAutoPilotV3Component extends React.Component<
minWidth: 100,
maxWidth: 200,
isResizable: true,
styles: transparentDetailsHeaderStyle
}
styles: transparentDetailsHeaderStyle,
},
];
const estimatedSpendingItems: AutoscaleEstimatedSpendingDisplayProps[] = [
{
@@ -257,8 +257,8 @@ export class ThroughputInputAutoPilotV3Component extends React.Component<
<Text>
{prices.currencySign} {calculateEstimateNumber(prices.monthlyPrice)}
</Text>
)
}
),
},
];
if (newThroughput) {
@@ -288,7 +288,7 @@ export class ThroughputInputAutoPilotV3Component extends React.Component<
{newPrices.currencySign} {calculateEstimateNumber(newPrices.monthlyPrice)}
</b>
</Text>
)
),
});
}
@@ -318,7 +318,7 @@ export class ThroughputInputAutoPilotV3Component extends React.Component<
minWidth: 100,
maxWidth: 200,
isResizable: true,
styles: transparentDetailsHeaderStyle
styles: transparentDetailsHeaderStyle,
},
{
key: "hourly",
@@ -327,7 +327,7 @@ export class ThroughputInputAutoPilotV3Component extends React.Component<
minWidth: 100,
maxWidth: 200,
isResizable: true,
styles: transparentDetailsHeaderStyle
styles: transparentDetailsHeaderStyle,
},
{
key: "daily",
@@ -336,7 +336,7 @@ export class ThroughputInputAutoPilotV3Component extends React.Component<
minWidth: 100,
maxWidth: 200,
isResizable: true,
styles: transparentDetailsHeaderStyle
styles: transparentDetailsHeaderStyle,
},
{
key: "monthly",
@@ -345,8 +345,8 @@ export class ThroughputInputAutoPilotV3Component extends React.Component<
minWidth: 100,
maxWidth: 200,
isResizable: true,
styles: transparentDetailsHeaderStyle
}
styles: transparentDetailsHeaderStyle,
},
];
const estimatedSpendingItems: ManualEstimatedSpendingDisplayProps[] = [
{
@@ -365,8 +365,8 @@ export class ThroughputInputAutoPilotV3Component extends React.Component<
<Text>
{prices.currencySign} {calculateEstimateNumber(prices.monthlyPrice)}
</Text>
)
}
),
},
];
if (newThroughput) {
@@ -403,7 +403,7 @@ export class ThroughputInputAutoPilotV3Component extends React.Component<
{newPrices.currencySign} {calculateEstimateNumber(newPrices.monthlyPrice)}
</b>
</Text>
)
),
});
}
@@ -462,7 +462,7 @@ export class ThroughputInputAutoPilotV3Component extends React.Component<
databaseName: this.props.databaseName,
collectionName: this.props.collectionName,
apiKind: userContext.defaultExperience,
dataExplorerArea: "Scale Tab V2"
dataExplorerArea: "Scale Tab V2",
});
};

View File

@@ -5,7 +5,7 @@ import { ToolTipLabelComponent, ToolTipLabelComponentProps } from "./ToolTipLabe
describe("ToolTipLabelComponent", () => {
const props: ToolTipLabelComponentProps = {
label: "sample tool tip label",
toolTipElement: <span>sample tool tip text</span>
toolTipElement: <span>sample tool tip text</span>,
};
it("renders", () => {