mirror of
https://github.com/Azure/cosmos-explorer.git
synced 2025-12-23 02:41:39 +00:00
Fixed typescript strict issue of ResourceTokenUtils, CostEnstimatedText Draggable files
This commit is contained in:
@@ -28,8 +28,9 @@ export const CostEstimateText: FunctionComponent<CostEstimateTextProps> = ({
|
||||
}
|
||||
|
||||
const serverId: string = userContext.portalEnv;
|
||||
const { enableMultipleWriteLocations } = databaseAccount.properties;
|
||||
const numberOfRegions: number = databaseAccount.properties.readLocations?.length || 1;
|
||||
const multimasterEnabled: boolean = databaseAccount.properties.enableMultipleWriteLocations;
|
||||
const multimasterEnabled: boolean = enableMultipleWriteLocations ? enableMultipleWriteLocations : false;
|
||||
const hourlyPrice: number = computeRUUsagePriceHourly({
|
||||
serverId,
|
||||
requestUnits,
|
||||
|
||||
@@ -11,7 +11,6 @@ import {
|
||||
DropTargetConnector,
|
||||
DropTargetMonitor,
|
||||
} from "react-dnd";
|
||||
|
||||
import { connect } from "react-redux";
|
||||
import { Dispatch } from "redux";
|
||||
import styled, { StyledComponent } from "styled-components";
|
||||
@@ -109,7 +108,7 @@ const DragHandleAnchor = styled.div`
|
||||
position: relative;
|
||||
`;
|
||||
|
||||
export function isDragUpper(props: Props, monitor: DropTargetMonitor, el: HTMLElement): boolean {
|
||||
export function isDragUpper(_props: Props, monitor: DropTargetMonitor, el: HTMLElement): boolean {
|
||||
const hoverBoundingRect = el.getBoundingClientRect();
|
||||
const hoverMiddleY = (hoverBoundingRect.bottom - hoverBoundingRect.top) / 2;
|
||||
|
||||
@@ -223,7 +222,7 @@ export class DraggableCellView extends React.Component<Props & DnDSourceProps &
|
||||
const source = DragSource<Props, DnDSourceProps>("CELL", cellSource, collectSource);
|
||||
const target = DropTarget<Props, DnDTargetProps>("CELL", cellTarget, collectTarget);
|
||||
|
||||
export const makeMapDispatchToProps = (initialDispatch: Dispatch) => {
|
||||
export const makeMapDispatchToProps = (_initialDispatch: Dispatch) => {
|
||||
const mapDispatchToProps = (dispatch: Dispatch) => ({
|
||||
moveCell: (payload: actions.MoveCell["payload"]) => dispatch(actions.moveCell(payload)),
|
||||
focusCell: (payload: actions.FocusCell["payload"]) => dispatch(actions.focusCell(payload)),
|
||||
|
||||
@@ -10,7 +10,7 @@ describe("parseResourceTokenConnectionString", () => {
|
||||
accountEndpoint: "fakeEndpoint",
|
||||
collectionId: "fakeCollectionId",
|
||||
databaseId: "fakeDatabaseId",
|
||||
partitionKey: undefined,
|
||||
partitionKey: "",
|
||||
resourceToken: "type=resource&ver=1&sig=2dIP+CdIfT1ScwHWdv5GGw==;fakeToken;",
|
||||
});
|
||||
});
|
||||
|
||||
@@ -7,11 +7,11 @@ export interface ParsedResourceTokenConnectionString {
|
||||
}
|
||||
|
||||
export function parseResourceTokenConnectionString(connectionString: string): ParsedResourceTokenConnectionString {
|
||||
let accountEndpoint: string;
|
||||
let collectionId: string;
|
||||
let databaseId: string;
|
||||
let partitionKey: string;
|
||||
let resourceToken: string;
|
||||
let accountEndpoint = "";
|
||||
let collectionId = "";
|
||||
let databaseId = "";
|
||||
let partitionKey = "";
|
||||
let resourceToken = "";
|
||||
const connectionStringParts = connectionString.split(";");
|
||||
connectionStringParts.forEach((part: string) => {
|
||||
if (part.startsWith("type=resource")) {
|
||||
@@ -39,5 +39,5 @@ export function parseResourceTokenConnectionString(connectionString: string): Pa
|
||||
}
|
||||
|
||||
export function isResourceTokenConnectionString(connectionString: string): boolean {
|
||||
return connectionString && connectionString.includes("type=resource");
|
||||
return connectionString.includes("type=resource");
|
||||
}
|
||||
|
||||
@@ -21,7 +21,7 @@ interface UserContext {
|
||||
// This is coming in a future Cosmos ARM API version as a prperty on databaseAccount
|
||||
apiType: ApiType;
|
||||
readonly isTryCosmosDBSubscription?: boolean;
|
||||
readonly portalEnv?: PortalEnv;
|
||||
readonly portalEnv: PortalEnv;
|
||||
readonly features: Features;
|
||||
readonly addCollectionFlight: string;
|
||||
readonly hasWriteAccess: boolean;
|
||||
|
||||
@@ -8,9 +8,11 @@
|
||||
"noUnusedParameters": true
|
||||
},
|
||||
"files": [
|
||||
"./src/Explorer/Controls/ThroughputInput/CostEstimateText/CostEstimateText.tsx",
|
||||
"./src/AuthType.ts",
|
||||
"./src/Bindings/ReactBindingHandler.ts",
|
||||
"./src/Common/ArrayHashMap.ts",
|
||||
"./src/Common/CollapsedResourceTree.tsx",
|
||||
"./src/Common/Constants.ts",
|
||||
"./src/Common/DeleteFeedback.ts",
|
||||
"./src/Common/DocumentUtility.ts",
|
||||
@@ -25,6 +27,7 @@
|
||||
"./src/Common/ObjectCache.ts",
|
||||
"./src/Common/OfferUtility.test.ts",
|
||||
"./src/Common/OfferUtility.ts",
|
||||
"./src/Common/ResourceTree.tsx",
|
||||
"./src/Common/Splitter.ts",
|
||||
"./src/Common/ThemeUtility.ts",
|
||||
"./src/Common/UrlUtility.ts",
|
||||
@@ -46,6 +49,7 @@
|
||||
"./src/Explorer/LazyMonaco.ts",
|
||||
"./src/Explorer/Notebook/FileSystemUtil.ts",
|
||||
"./src/Explorer/Notebook/NTeractUtil.ts",
|
||||
"./src/Explorer/Notebook/NotebookComponent/ContentProviders/InMemoryContentProviderUtils.ts",
|
||||
"./src/Explorer/Notebook/NotebookComponent/actions.ts",
|
||||
"./src/Explorer/Notebook/NotebookComponent/loadTransform.ts",
|
||||
"./src/Explorer/Notebook/NotebookComponent/reducers.ts",
|
||||
@@ -57,7 +61,10 @@
|
||||
"./src/Explorer/Notebook/NotebookRenderer/PromptContent.tsx",
|
||||
"./src/Explorer/Notebook/NotebookRenderer/decorators/CellCreator.tsx",
|
||||
"./src/Explorer/Notebook/NotebookRenderer/decorators/CellLabeler.tsx",
|
||||
"./src/Explorer/Notebook/NotebookRenderer/decorators/draggable/index.tsx",
|
||||
"./src/Explorer/Notebook/NotebookUtil.ts",
|
||||
"./src/Explorer/Notebook/SchemaAnalyzer/SchemaAnalyzerSplashScreen.tsx",
|
||||
"./src/Explorer/Notebook/SchemaAnalyzer/SchemaAnalyzerUtils.ts",
|
||||
"./src/Explorer/OpenFullScreen.test.tsx",
|
||||
"./src/Explorer/OpenFullScreen.tsx",
|
||||
"./src/Explorer/Panes/PaneComponents.ts",
|
||||
@@ -78,9 +85,13 @@
|
||||
"./src/Index.ts",
|
||||
"./src/NotebookWorkspaceManager/NotebookWorkspaceResourceProviderMockClients.ts",
|
||||
"./src/Platform/Hosted/Authorization.ts",
|
||||
"./src/Platform/Hosted/Components/ConnectExplorer.test.tsx",
|
||||
"./src/Platform/Hosted/Components/ConnectExplorer.tsx",
|
||||
"./src/Platform/Hosted/Components/MeControl.test.tsx",
|
||||
"./src/Platform/Hosted/Components/MeControl.tsx",
|
||||
"./src/Platform/Hosted/Components/SignInButton.tsx",
|
||||
"./src/Platform/Hosted/Helpers/ResourceTokenUtils.test.ts",
|
||||
"./src/Platform/Hosted/Helpers/ResourceTokenUtils.ts",
|
||||
"./src/Platform/Hosted/extractFeatures.test.ts",
|
||||
"./src/Platform/Hosted/extractFeatures.ts",
|
||||
"./src/ReactDevTools.ts",
|
||||
@@ -139,4 +150,4 @@
|
||||
"src/Terminal/**/*",
|
||||
"src/Utils/arm/**/*"
|
||||
]
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user