Update prettier to latest. Remove tslint (#1641)

* Rev up prettier

* Reformat

* Remove deprecated tslint

* Remove call to tslint and update package-lock.json
This commit is contained in:
Laurent Nguyen
2023-10-03 15:13:24 +00:00
committed by GitHub
parent e3c168b7be
commit 90c1439d34
311 changed files with 1899 additions and 2194 deletions

View File

@@ -260,7 +260,7 @@ export class AddCollectionPanel extends React.Component<AddCollectionPanelProps,
<TooltipHost
directionalHint={DirectionalHint.bottomLeftEdge}
content={`A database is analogous to a namespace. It is the unit of management for a set of ${getCollectionName(
true
true,
).toLocaleLowerCase()}.`}
>
<Icon
@@ -268,7 +268,7 @@ export class AddCollectionPanel extends React.Component<AddCollectionPanelProps,
className="panelInfoIcon"
tabIndex={0}
ariaLabel={`A database is analogous to a namespace. It is the unit of management for a set of ${getCollectionName(
true
true,
).toLocaleLowerCase()}.`}
/>
</TooltipHost>
@@ -345,7 +345,7 @@ export class AddCollectionPanel extends React.Component<AddCollectionPanelProps,
<TooltipHost
directionalHint={DirectionalHint.bottomLeftEdge}
content={`Throughput configured at the database level will be shared across all ${getCollectionName(
true
true,
).toLocaleLowerCase()} within the database.`}
>
<Icon
@@ -353,7 +353,7 @@ export class AddCollectionPanel extends React.Component<AddCollectionPanelProps,
className="panelInfoIcon"
tabIndex={0}
ariaLabel={`Throughput configured at the database level will be shared across all ${getCollectionName(
true
true,
).toLocaleLowerCase()} within the database.`}
/>
</TooltipHost>
@@ -675,7 +675,7 @@ export class AddCollectionPanel extends React.Component<AddCollectionPanelProps,
directionalHint={DirectionalHint.bottomLeftEdge}
content={`You can optionally provision dedicated throughput for a ${getCollectionName().toLocaleLowerCase()} within a database that has throughput
provisioned. This dedicated throughput amount will not be shared with other ${getCollectionName(
true
true,
).toLocaleLowerCase()} in the database and
does not count towards the throughput you provisioned for the database. This throughput amount will be
billed in addition to the throughput amount you provisioned at the database level.`}
@@ -686,7 +686,7 @@ export class AddCollectionPanel extends React.Component<AddCollectionPanelProps,
tabIndex={0}
ariaLabel={`You can optionally provision dedicated throughput for a ${getCollectionName().toLocaleLowerCase()} within a database that has throughput
provisioned. This dedicated throughput amount will not be shared with other ${getCollectionName(
true
true,
).toLocaleLowerCase()} in the database and
does not count towards the throughput you provisioned for the database. This throughput amount will be
billed in addition to the throughput amount you provisioned at the database level.`}
@@ -736,44 +736,42 @@ export class AddCollectionPanel extends React.Component<AddCollectionPanelProps,
</TooltipHost>
</Stack>
{this.state.uniqueKeys.map(
(uniqueKey: string, i: number): JSX.Element => {
return (
<Stack style={{ marginBottom: 8 }} key={`uniqueKey${i}`} horizontal>
<input
type="text"
autoComplete="off"
placeholder={
userContext.apiType === "Mongo"
? "Comma separated paths e.g. firstName,address.zipCode"
: "Comma separated paths e.g. /firstName,/address/zipCode"
}
className="panelTextField"
autoFocus
value={uniqueKey}
onChange={(event: React.ChangeEvent<HTMLInputElement>) => {
const uniqueKeys = this.state.uniqueKeys.map((uniqueKey: string, j: number) => {
if (i === j) {
return event.target.value;
}
return uniqueKey;
});
this.setState({ uniqueKeys });
}}
/>
{this.state.uniqueKeys.map((uniqueKey: string, i: number): JSX.Element => {
return (
<Stack style={{ marginBottom: 8 }} key={`uniqueKey${i}`} horizontal>
<input
type="text"
autoComplete="off"
placeholder={
userContext.apiType === "Mongo"
? "Comma separated paths e.g. firstName,address.zipCode"
: "Comma separated paths e.g. /firstName,/address/zipCode"
}
className="panelTextField"
autoFocus
value={uniqueKey}
onChange={(event: React.ChangeEvent<HTMLInputElement>) => {
const uniqueKeys = this.state.uniqueKeys.map((uniqueKey: string, j: number) => {
if (i === j) {
return event.target.value;
}
return uniqueKey;
});
this.setState({ uniqueKeys });
}}
/>
<IconButton
iconProps={{ iconName: "Delete" }}
style={{ height: 27 }}
onClick={() => {
const uniqueKeys = this.state.uniqueKeys.filter((uniqueKey, j) => i !== j);
this.setState({ uniqueKeys });
}}
/>
</Stack>
);
}
)}
<IconButton
iconProps={{ iconName: "Delete" }}
style={{ height: 27 }}
onClick={() => {
const uniqueKeys = this.state.uniqueKeys.filter((uniqueKey, j) => i !== j);
this.setState({ uniqueKeys });
}}
/>
</Stack>
);
})}
<ActionButton
iconProps={{ iconName: "Add" }}
@@ -1100,7 +1098,7 @@ export class AddCollectionPanel extends React.Component<AddCollectionPanelProps,
}
let tooltipText = `The ${this.getPartitionKeyName(
true
true,
)} is used to automatically distribute data across partitions for scalability. Choose a property in your JSON document that has a wide range of values and evenly distributes request volume.`;
if (userContext.apiType === "SQL") {
@@ -1204,7 +1202,7 @@ export class AddCollectionPanel extends React.Component<AddCollectionPanelProps,
}
return properties.capabilities?.some(
(capability) => capability.name === Constants.CapabilityNames.EnableStorageAnalytics
(capability) => capability.name === Constants.CapabilityNames.EnableStorageAnalytics,
);
}

View File

@@ -48,7 +48,7 @@ export const AddDatabasePanel: FunctionComponent<AddDatabasePaneProps> = ({
const databaseLevelThroughputTooltipText = `Provisioned throughput at the ${databaseLabel} level will be shared across all ${collectionsLabel} within the ${databaseLabel}.`;
const [databaseCreateNewShared, setDatabaseCreateNewShared] = useState<boolean>(
subscriptionType !== SubscriptionType.EA && !isServerlessAccount()
subscriptionType !== SubscriptionType.EA && !isServerlessAccount(),
);
const [formErrors, setFormErrors] = useState<string>("");
const [isExecuting, setIsExecuting] = useState<boolean>(false);
@@ -114,7 +114,7 @@ export const AddDatabasePanel: FunctionComponent<AddDatabasePaneProps> = ({
},
(error: string) => {
_onCreateDatabaseFailure(error, throughput, startKey);
}
},
);
};
@@ -147,7 +147,7 @@ export const AddDatabasePanel: FunctionComponent<AddDatabasePaneProps> = ({
if (isAutoscaleSelected) {
if (!AutoPilotUtils.isValidAutoPilotThroughput(throughput)) {
setFormErrors(
`Please enter a value greater than ${AutoPilotUtils.autoPilotThroughput1K} for autopilot throughput`
`Please enter a value greater than ${AutoPilotUtils.autoPilotThroughput1K} for autopilot throughput`,
);
return false;
}
@@ -165,7 +165,7 @@ export const AddDatabasePanel: FunctionComponent<AddDatabasePaneProps> = ({
(event: React.FormEvent<HTMLInputElement | HTMLTextAreaElement>, newValue?: string) => {
setDatabaseId(newValue || "");
},
[]
[],
);
const props: RightPaneFormProps = {
@@ -184,7 +184,7 @@ export const AddDatabasePanel: FunctionComponent<AddDatabasePaneProps> = ({
userContext.portalEnv,
true,
useDatabases.getState().isFirstResourceCreated(),
true
true,
)}
messageType="info"
showErrorDetails={false}

View File

@@ -36,7 +36,7 @@ export const CassandraAddCollectionPane: FunctionComponent<CassandraAddCollectio
const [existingKeyspaceId, setExistingKeyspaceId] = useState<string>("");
const [tableId, setTableId] = useState<string>("");
const [userTableQuery, setUserTableQuery] = useState<string>(
"(userid int, name text, email text, PRIMARY KEY (userid))"
"(userid int, name text, email text, PRIMARY KEY (userid))",
);
const [isKeyspaceShared, setIsKeyspaceShared] = useState<boolean>(false);
const [keyspaceCreateNew, setKeyspaceCreateNew] = useState<boolean>(true);
@@ -118,14 +118,14 @@ export const CassandraAddCollectionPane: FunctionComponent<CassandraAddCollectio
userContext?.databaseAccount?.id,
container,
tableQuery,
createKeyspaceQuery
createKeyspaceQuery,
);
} else {
await cassandraApiClient.createTableAndKeyspace(
userContext?.databaseAccount?.properties?.cassandraEndpoint,
userContext?.databaseAccount?.id,
container,
tableQuery
tableQuery,
);
}
container.refreshAllDatabases();

View File

@@ -72,7 +72,7 @@ export const CopyNotebookPane: FunctionComponent<CopyNotebookPanelProps> = ({
if (selectedLocation.type === "GitHub") {
destination = `${destination} - ${GitHubUtils.toRepoFullName(
selectedLocation.owner,
selectedLocation.repo
selectedLocation.repo,
)} - ${selectedLocation.branch}`;
} else if (selectedLocation.type === "MyNotebooks" && useNotebook.getState().isPhoenixNotebooks) {
destination = useNotebook.getState().notebookFolderName;

View File

@@ -88,7 +88,7 @@ export const CopyNotebookPaneComponent: FunctionComponent<CopyNotebookPaneProps>
repo: pinnedRepo.name,
branch: branch.name,
} as Location,
})
}),
);
});
}

View File

@@ -148,7 +148,7 @@ describe("Delete Collection Confirmation Pane", () => {
"testDatabaseAccountId",
"testDatabaseAccountName",
ApiKind.SQL,
feedbackText
feedbackText,
);
await new Promise((resolve) => setTimeout(resolve, 0));
expect(TelemetryProcessor.trace).toHaveBeenCalledWith(Action.DeleteCollection, ActionModifiers.Mark, {

View File

@@ -41,7 +41,7 @@ export const DeleteCollectionConfirmationPane: FunctionComponent<DeleteCollectio
const errorMessage = "Input " + collectionName + " id does not match the selected " + collectionName;
setFormError(errorMessage);
NotificationConsoleUtils.logConsoleError(
`Error while deleting ${collectionName} ${collection.id()}: ${errorMessage}`
`Error while deleting ${collectionName} ${collection.id()}: ${errorMessage}`,
);
return;
}
@@ -65,7 +65,7 @@ export const DeleteCollectionConfirmationPane: FunctionComponent<DeleteCollectio
useTabs
.getState()
.closeTabsByComparator(
(tab) => tab.node?.id() === collection.id() && (tab.node as Collection).databaseId === collection.databaseId
(tab) => tab.node?.id() === collection.id() && (tab.node as Collection).databaseId === collection.databaseId,
);
refreshDatabases();
@@ -76,7 +76,7 @@ export const DeleteCollectionConfirmationPane: FunctionComponent<DeleteCollectio
userContext.databaseAccount?.id,
userContext.databaseAccount?.name,
DefaultExperienceUtility.getApiKindFromDefaultExperience(userContext.apiType),
deleteCollectionFeedback
deleteCollectionFeedback,
);
TelemetryProcessor.trace(Action.DeleteCollection, ActionModifiers.Mark, {
@@ -98,7 +98,7 @@ export const DeleteCollectionConfirmationPane: FunctionComponent<DeleteCollectio
error: errorMessage,
errorStack: getErrorStack(error),
},
startKey
startKey,
);
}
};

View File

@@ -96,7 +96,7 @@ describe("Delete Database Confirmation Pane", () => {
"testDatabaseAccountId",
"testDatabaseAccountName",
ApiKind.SQL,
feedbackText
feedbackText,
);
await new Promise((resolve) => setTimeout(resolve, 0));
expect(TelemetryProcessor.trace).toHaveBeenCalledWith(Action.DeleteDatabase, ActionModifiers.Mark, {

View File

@@ -37,11 +37,11 @@ export const DeleteDatabaseConfirmationPanel: FunctionComponent<DeleteDatabaseCo
const submit = async (): Promise<void> => {
if (selectedDatabase?.id() && databaseInput !== selectedDatabase.id()) {
setFormError(
`Input database name "${databaseInput}" does not match the selected database "${selectedDatabase.id()}"`
`Input database name "${databaseInput}" does not match the selected database "${selectedDatabase.id()}"`,
);
logConsoleError(`Error while deleting collection ${selectedDatabase && selectedDatabase.id()}`);
logConsoleError(
`Input database name "${databaseInput}" does not match the selected database "${selectedDatabase.id()}"`
`Input database name "${databaseInput}" does not match the selected database "${selectedDatabase.id()}"`,
);
return;
}
@@ -67,8 +67,8 @@ export const DeleteDatabaseConfirmationPanel: FunctionComponent<DeleteDatabaseCo
.getState()
.closeTabsByComparator(
(tab) =>
tab.node?.id() === collection.id() && (tab.node as Collection).databaseId === collection.databaseId
)
tab.node?.id() === collection.id() && (tab.node as Collection).databaseId === collection.databaseId,
),
);
TelemetryProcessor.traceSuccess(
Action.DeleteDatabase,
@@ -77,7 +77,7 @@ export const DeleteDatabaseConfirmationPanel: FunctionComponent<DeleteDatabaseCo
dataExplorerArea: Areas.ContextualPane,
paneTitle: "Delete Database",
},
startKey
startKey,
);
if (isLastNonEmptyDatabase()) {
@@ -85,7 +85,7 @@ export const DeleteDatabaseConfirmationPanel: FunctionComponent<DeleteDatabaseCo
userContext?.databaseAccount.id,
userContext?.databaseAccount.name,
DefaultExperienceUtility.getApiKindFromDefaultExperience(userContext.apiType),
databaseFeedbackInput
databaseFeedbackInput,
);
TelemetryProcessor.trace(Action.DeleteDatabase, ActionModifiers.Mark, {
@@ -105,7 +105,7 @@ export const DeleteDatabaseConfirmationPanel: FunctionComponent<DeleteDatabaseCo
error: errorMessage,
errorStack: getErrorStack(error),
},
startKey
startKey,
);
}
};

View File

@@ -119,7 +119,7 @@ export const ExecuteSprocParamsPane: FunctionComponent<ExecuteSprocParamsPanePro
}
paramValue={paramKeyValue.text}
selectedKey={paramKeyValue.key}
/>
/>,
);
}

View File

@@ -182,8 +182,8 @@ export class GitHubReposPanel extends React.Component<IGitHubReposPanelProps, IG
const unpinnedGitHubRepos = this.allGitHubRepos.filter(
(gitHubRepo) =>
this.pinnedReposProps.repos.findIndex(
(pinnedRepo) => pinnedRepo.key === GitHubUtils.toRepoFullName(gitHubRepo.owner, gitHubRepo.name)
) === -1
(pinnedRepo) => pinnedRepo.key === GitHubUtils.toRepoFullName(gitHubRepo.owner, gitHubRepo.name),
) === -1,
);
return unpinnedGitHubRepos.map((gitHubRepo) => ({
key: GitHubUtils.toRepoFullName(gitHubRepo.owner, gitHubRepo.name),
@@ -202,7 +202,7 @@ export class GitHubReposPanel extends React.Component<IGitHubReposPanelProps, IG
repo.owner,
repo.name,
GitHubReposPanel.PageSize,
branchesProps.lastPageInfo?.endCursor
branchesProps.lastPageInfo?.endCursor,
);
if (response.status !== HttpStatusCodes.OK) {
@@ -215,7 +215,7 @@ export class GitHubReposPanel extends React.Component<IGitHubReposPanelProps, IG
branchesProps.defaultBranchName = branchesProps.branches[0].name;
const defaultbranchName = branchesProps.branches.find(
(branch) =>
branch.name === GitHubReposPanel.MasterBranchName || branch.name === GitHubReposPanel.MainBranchName
branch.name === GitHubReposPanel.MasterBranchName || branch.name === GitHubReposPanel.MainBranchName,
)?.name;
if (defaultbranchName) {
branchesProps.defaultBranchName = defaultbranchName;
@@ -255,7 +255,7 @@ export class GitHubReposPanel extends React.Component<IGitHubReposPanelProps, IG
try {
const response = await this.gitHubClient.getReposAsync(
GitHubReposPanel.PageSize,
this.allGitHubReposLastPageInfo?.endCursor
this.allGitHubReposLastPageInfo?.endCursor,
);
if (response.status !== HttpStatusCodes.OK) {
@@ -366,7 +366,7 @@ export class GitHubReposPanel extends React.Component<IGitHubReposPanelProps, IG
try {
const response = await this.junoClient.getPinnedRepos(
this.props.explorer.notebookManager?.gitHubOAuthService.getTokenObservable()()?.scope
this.props.explorer.notebookManager?.gitHubOAuthService.getTokenObservable()()?.scope,
);
if (response.status !== HttpStatusCodes.OK && response.status !== HttpStatusCodes.NoContent) {
@@ -380,7 +380,7 @@ export class GitHubReposPanel extends React.Component<IGitHubReposPanelProps, IG
key: GitHubUtils.toRepoFullName(pinnedRepo.owner, pinnedRepo.name),
branches: pinnedRepo.branches,
repo: JunoUtils.toGitHubRepo(pinnedRepo),
} as RepoListItem)
}) as RepoListItem,
);
this.pinnedReposProps.repos = pinnedRepos;

View File

@@ -59,7 +59,7 @@ export const PublishNotebookPane: FunctionComponent<PublishNotebookPaneAProps> =
handleError(
error,
"PublishNotebookPaneAdapter/isCodeOfConductAccepted",
"Failed to check if code of conduct was accepted"
"Failed to check if code of conduct was accepted",
);
}
};
@@ -106,7 +106,7 @@ export const PublishNotebookPane: FunctionComponent<PublishNotebookPaneAProps> =
notebookDescription,
notebookTags?.split(","),
imageSrc,
content
content,
);
const data = response.data;
@@ -116,7 +116,7 @@ export const PublishNotebookPane: FunctionComponent<PublishNotebookPaneAProps> =
if (data.pendingScanJobIds?.length > 0) {
isPublishPending = true;
NotificationConsoleUtils.logConsoleInfo(
`Content of ${name} is currently being scanned for illegal content. It will not be available in the public gallery until the review is complete (may take a few days).`
`Content of ${name} is currently being scanned for illegal content. It will not be available in the public gallery until the review is complete (may take a few days).`,
);
} else {
NotificationConsoleUtils.logConsoleInfo(`Published ${notebookName} to gallery`);
@@ -129,7 +129,7 @@ export const PublishNotebookPane: FunctionComponent<PublishNotebookPaneAProps> =
notebookId: data.id,
isPublishPending,
},
startKey
startKey,
);
}
} catch (error) {
@@ -139,7 +139,7 @@ export const PublishNotebookPane: FunctionComponent<PublishNotebookPaneAProps> =
error: getErrorMessage(error),
errorStack: getErrorStack(error),
},
startKey
startKey,
);
const errorMessage = getErrorMessage(error);

View File

@@ -62,7 +62,7 @@ export const PublishNotebookPaneComponent: FunctionComponent<PublishNotebookPane
const descriptionPara2 = `Would you like to publish and share "${FileSystemUtil.stripExtension(
notebookName,
"ipynb"
"ipynb",
)}" to the gallery?`;
const options: ImageTypes[] = [ImageTypes.CustomImage, ImageTypes.Url];

View File

@@ -74,7 +74,7 @@ export const SaveQueryPane: FunctionComponent<SaveQueryPaneProps> = ({
dataExplorerArea: Areas.ContextualPane,
paneTitle: title,
},
startKey
startKey,
);
closeSidePanel();
} catch (error) {
@@ -90,7 +90,7 @@ export const SaveQueryPane: FunctionComponent<SaveQueryPaneProps> = ({
error: errorMessage,
errorStack: getErrorStack(error),
},
startKey
startKey,
);
}
};
@@ -111,7 +111,7 @@ export const SaveQueryPane: FunctionComponent<SaveQueryPaneProps> = ({
dataExplorerArea: Areas.ContextualPane,
paneTitle: title,
},
startKey
startKey,
);
} catch (error) {
const errorMessage = getErrorMessage(error);
@@ -123,7 +123,7 @@ export const SaveQueryPane: FunctionComponent<SaveQueryPaneProps> = ({
error: errorMessage,
errorStack: getErrorStack(error),
},
startKey
startKey,
);
setFormError("Failed to setup a container for saved queries");
logConsoleError(`Failed to setup a container for saved queries: ${errorMessage}`);

View File

@@ -16,35 +16,35 @@ export const SettingsPane: FunctionComponent = () => {
const [pageOption, setPageOption] = useState<string>(
LocalStorageUtility.getEntryNumber(StorageKey.ActualItemPerPage) === Constants.Queries.unlimitedItemsPerPage
? Constants.Queries.UnlimitedPageOption
: Constants.Queries.CustomPageOption
: Constants.Queries.CustomPageOption,
);
const [customItemPerPage, setCustomItemPerPage] = useState<number>(
LocalStorageUtility.getEntryNumber(StorageKey.CustomItemPerPage) || 0
LocalStorageUtility.getEntryNumber(StorageKey.CustomItemPerPage) || 0,
);
const [containerPaginationEnabled, setContainerPaginationEnabled] = useState<boolean>(
LocalStorageUtility.hasItem(StorageKey.ContainerPaginationEnabled)
? LocalStorageUtility.getEntryString(StorageKey.ContainerPaginationEnabled) === "true"
: false
: false,
);
const [crossPartitionQueryEnabled, setCrossPartitionQueryEnabled] = useState<boolean>(
LocalStorageUtility.hasItem(StorageKey.IsCrossPartitionQueryEnabled)
? LocalStorageUtility.getEntryString(StorageKey.IsCrossPartitionQueryEnabled) === "true"
: false
: false,
);
const [graphAutoVizDisabled, setGraphAutoVizDisabled] = useState<string>(
LocalStorageUtility.hasItem(StorageKey.IsGraphAutoVizDisabled)
? LocalStorageUtility.getEntryString(StorageKey.IsGraphAutoVizDisabled)
: "false"
: "false",
);
const [maxDegreeOfParallelism, setMaxDegreeOfParallelism] = useState<number>(
LocalStorageUtility.hasItem(StorageKey.MaxDegreeOfParellism)
? LocalStorageUtility.getEntryNumber(StorageKey.MaxDegreeOfParellism)
: Constants.Queries.DefaultMaxDegreeOfParallelism
: Constants.Queries.DefaultMaxDegreeOfParallelism,
);
const [priorityLevel, setPriorityLevel] = useState<string>(
LocalStorageUtility.hasItem(StorageKey.PriorityLevel)
? LocalStorageUtility.getEntryString(StorageKey.PriorityLevel)
: Constants.PriorityLevel.Default
: Constants.PriorityLevel.Default,
);
const explorerVersion = configContext.gitSha;
const shouldShowQueryPageOptions = userContext.apiType === "SQL";
@@ -58,7 +58,7 @@ export const SettingsPane: FunctionComponent = () => {
LocalStorageUtility.setEntryNumber(
StorageKey.ActualItemPerPage,
isCustomPageOptionSelected() ? customItemPerPage : Constants.Queries.unlimitedItemsPerPage
isCustomPageOptionSelected() ? customItemPerPage : Constants.Queries.unlimitedItemsPerPage,
);
LocalStorageUtility.setEntryNumber(StorageKey.CustomItemPerPage, customItemPerPage);
LocalStorageUtility.setEntryString(StorageKey.ContainerPaginationEnabled, containerPaginationEnabled.toString());
@@ -69,19 +69,19 @@ export const SettingsPane: FunctionComponent = () => {
if (shouldShowGraphAutoVizOption) {
LocalStorageUtility.setEntryBoolean(
StorageKey.IsGraphAutoVizDisabled,
StringUtility.toBoolean(graphAutoVizDisabled)
StringUtility.toBoolean(graphAutoVizDisabled),
);
}
setIsExecuting(false);
logConsoleInfo(
`Updated items per page setting to ${LocalStorageUtility.getEntryNumber(StorageKey.ActualItemPerPage)}`
`Updated items per page setting to ${LocalStorageUtility.getEntryNumber(StorageKey.ActualItemPerPage)}`,
);
logConsoleInfo(`${crossPartitionQueryEnabled ? "Enabled" : "Disabled"} cross-partition query feed option`);
logConsoleInfo(
`Updated the max degree of parallelism query feed option to ${LocalStorageUtility.getEntryNumber(
StorageKey.MaxDegreeOfParellism
)}`
StorageKey.MaxDegreeOfParellism,
)}`,
);
logConsoleInfo(`Updated priority level setting to ${LocalStorageUtility.getEntryString(StorageKey.PriorityLevel)}`);
@@ -89,12 +89,12 @@ export const SettingsPane: FunctionComponent = () => {
logConsoleInfo(
`Graph result will be displayed as ${
LocalStorageUtility.getEntryBoolean(StorageKey.IsGraphAutoVizDisabled) ? "JSON" : "Graph"
}`
}`,
);
}
logConsoleInfo(
`Updated query setting to ${LocalStorageUtility.getEntryString(StorageKey.SetPartitionKeyUndefined)}`
`Updated query setting to ${LocalStorageUtility.getEntryString(StorageKey.SetPartitionKeyUndefined)}`,
);
closeSidePanel();
e.preventDefault();
@@ -131,7 +131,7 @@ export const SettingsPane: FunctionComponent = () => {
const handleOnPriorityLevelOptionChange = (
ev: React.FormEvent<HTMLInputElement>,
option: IChoiceGroupOption
option: IChoiceGroupOption,
): void => {
setPriorityLevel(option.key);
};

View File

@@ -57,7 +57,7 @@ export const StringInputPane: FunctionComponent<StringInputPanelProps> = ({
.getState()
.getTabs(
ViewModels.CollectionTabKind.NotebookV2,
(tab: NotebookV2Tab) => tab.notebookPath && FileSystemUtil.isPathEqual(tab.notebookPath(), originalPath)
(tab: NotebookV2Tab) => tab.notebookPath && FileSystemUtil.isPathEqual(tab.notebookPath(), originalPath),
);
notebookTabs.forEach((tab) => {
tab.tabTitle(newNotebookFile.name);

View File

@@ -63,10 +63,8 @@ export const AddTableEntityPanel: FunctionComponent<AddTableEntityPanelProps> =
const [selectedRow, setSelectedRow] = useState<number>(0);
const [entityAttributeValue, setEntityAttributeValue] = useState<string>("");
const [entityAttributeProperty, setEntityAttributeProperty] = useState<string>("");
const [
isEntityValuePanelOpen,
{ setTrue: setIsEntityValuePanelTrue, setFalse: setIsEntityValuePanelFalse },
] = useBoolean(false);
const [isEntityValuePanelOpen, { setTrue: setIsEntityValuePanelTrue, setFalse: setIsEntityValuePanelFalse }] =
useBoolean(false);
const [formError, setFormError] = useState<string>("");
const [isExecuting, setIsExecuting] = useState<boolean>(false);
@@ -197,7 +195,7 @@ export const AddTableEntityPanel: FunctionComponent<AddTableEntityPanelProps> =
const entityTypeChange = (
_event: React.FormEvent<HTMLDivElement>,
selectedType: IDropdownOption,
indexOfEntity: number
indexOfEntity: number,
): void => {
const entityValuePlaceholder: string = getEntityValuePlaceholder(selectedType.key);
const cloneEntities: EntityRowType[] = [...entities];

View File

@@ -66,10 +66,8 @@ export const EditTableEntityPanel: FunctionComponent<EditTableEntityPanelProps>
const [formError, setFormError] = useState<string>("");
const [isExecuting, setIsExecuting] = useState<boolean>(false);
const [
isEntityValuePanelOpen,
{ setTrue: setIsEntityValuePanelTrue, setFalse: setIsEntityValuePanelFalse },
] = useBoolean(false);
const [isEntityValuePanelOpen, { setTrue: setIsEntityValuePanelTrue, setFalse: setIsEntityValuePanelFalse }] =
useBoolean(false);
useEffect(() => {
// eslint-disable-next-line @typescript-eslint/no-explicit-any
@@ -213,7 +211,7 @@ export const EditTableEntityPanel: FunctionComponent<EditTableEntityPanelProps>
const newEntity: Entities.ITableEntity = await newTableDataClient.updateDocument(
queryTablesTab.collection,
originalDocumentData,
entity
entity,
);
await tableEntityListViewModel.updateCachedEntity(newEntity);
if (!tryInsertNewHeaders(tableEntityListViewModel, newEntity)) {
@@ -298,7 +296,7 @@ export const EditTableEntityPanel: FunctionComponent<EditTableEntityPanelProps>
const entityTypeChange = (
_event: React.FormEvent<HTMLDivElement>,
selectedType: IDropdownOption,
indexOfEntity: number
indexOfEntity: number,
): void => {
const entityValuePlaceholder = getEntityValuePlaceholder(selectedType.key);
const cloneEntities = [...entities];

View File

@@ -305,7 +305,7 @@ export const getFormattedTime = (displayValue: string): string => {
export const getCassandraDefaultEntities = (
headers: string[],
entityTypes: { [key: string]: string }
entityTypes: { [key: string]: string },
): EntityRowType[] => {
const defaultEntities: EntityRowType[] = [];
headers.forEach((header: string) => {

View File

@@ -43,7 +43,7 @@ export const UploadFilePane: FunctionComponent<UploadFilePanelProps> = ({ upload
(error: string) => {
setFormErrors(errorMessage);
logConsoleError(`${errorMessage} ${file.name}: ${error}`);
}
},
)
.finally(() => {
setIsExecuting(false);

View File

@@ -41,7 +41,7 @@ export const UploadItemsPane: FunctionComponent = () => {
(error: Error) => {
const errorMessage = getErrorMessage(error);
setFormError(errorMessage);
}
},
)
.finally(() => {
setIsExecuting(false);