Compare commits

..

3 Commits

Author SHA1 Message Date
sunilyadav840
4ddf46f370 Merge branch 'master' of https://github.com/Azure/cosmos-explorer into tsStrict/fixed-hoverablecell-inputparameter-file 2021-07-26 18:08:24 +05:30
sunilyadav840
1e32838f60 make cellId optional 2021-05-21 14:31:45 +05:30
sunilyadav840
1e0a0b73e0 fixed typescript strict hoverableCell and InputParameter file 2021-05-17 18:08:31 +05:30
8 changed files with 21 additions and 25 deletions

View File

@@ -28,9 +28,8 @@ export const CostEstimateText: FunctionComponent<CostEstimateTextProps> = ({
} }
const serverId: string = userContext.portalEnv; const serverId: string = userContext.portalEnv;
const { enableMultipleWriteLocations } = databaseAccount.properties;
const numberOfRegions: number = databaseAccount.properties.readLocations?.length || 1; const numberOfRegions: number = databaseAccount.properties.readLocations?.length || 1;
const multimasterEnabled: boolean = enableMultipleWriteLocations ? enableMultipleWriteLocations : false; const multimasterEnabled: boolean = databaseAccount.properties.enableMultipleWriteLocations;
const hourlyPrice: number = computeRUUsagePriceHourly({ const hourlyPrice: number = computeRUUsagePriceHourly({
serverId, serverId,
requestUnits, requestUnits,

View File

@@ -54,11 +54,11 @@ export const SET_HOVERED_CELL = "SET_HOVERED_CELL";
export interface SetHoveredCellAction { export interface SetHoveredCellAction {
type: "SET_HOVERED_CELL"; type: "SET_HOVERED_CELL";
payload: { payload: {
cellId: CellId; cellId?: CellId;
}; };
} }
export const setHoveredCell = (payload: { cellId: CellId }): SetHoveredCellAction => { export const setHoveredCell = (payload: { cellId?: CellId }): SetHoveredCellAction => {
return { return {
type: SET_HOVERED_CELL, type: SET_HOVERED_CELL,
payload, payload,

View File

@@ -11,6 +11,7 @@ import {
DropTargetConnector, DropTargetConnector,
DropTargetMonitor, DropTargetMonitor,
} from "react-dnd"; } from "react-dnd";
import { connect } from "react-redux"; import { connect } from "react-redux";
import { Dispatch } from "redux"; import { Dispatch } from "redux";
import styled, { StyledComponent } from "styled-components"; import styled, { StyledComponent } from "styled-components";
@@ -108,7 +109,7 @@ const DragHandleAnchor = styled.div`
position: relative; 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 hoverBoundingRect = el.getBoundingClientRect();
const hoverMiddleY = (hoverBoundingRect.bottom - hoverBoundingRect.top) / 2; const hoverMiddleY = (hoverBoundingRect.bottom - hoverBoundingRect.top) / 2;
@@ -222,7 +223,7 @@ export class DraggableCellView extends React.Component<Props & DnDSourceProps &
const source = DragSource<Props, DnDSourceProps>("CELL", cellSource, collectSource); const source = DragSource<Props, DnDSourceProps>("CELL", cellSource, collectSource);
const target = DropTarget<Props, DnDTargetProps>("CELL", cellTarget, collectTarget); const target = DropTarget<Props, DnDTargetProps>("CELL", cellTarget, collectTarget);
export const makeMapDispatchToProps = (_initialDispatch: Dispatch) => { export const makeMapDispatchToProps = (initialDispatch: Dispatch) => {
const mapDispatchToProps = (dispatch: Dispatch) => ({ const mapDispatchToProps = (dispatch: Dispatch) => ({
moveCell: (payload: actions.MoveCell["payload"]) => dispatch(actions.moveCell(payload)), moveCell: (payload: actions.MoveCell["payload"]) => dispatch(actions.moveCell(payload)),
focusCell: (payload: actions.FocusCell["payload"]) => dispatch(actions.focusCell(payload)), focusCell: (payload: actions.FocusCell["payload"]) => dispatch(actions.focusCell(payload)),

View File

@@ -26,7 +26,7 @@ export interface InputParameterProps {
onDeleteParamKeyPress?: () => void; onDeleteParamKeyPress?: () => void;
onAddNewParamKeyPress?: () => void; onAddNewParamKeyPress?: () => void;
onParamValueChange: (event: React.FormEvent<HTMLElement>, newInput?: string) => void; onParamValueChange: (event: React.FormEvent<HTMLElement>, newInput?: string) => void;
onParamKeyChange: (event: React.FormEvent<HTMLElement>, selectedParam: IDropdownOption) => void; onParamKeyChange: (event: React.FormEvent<HTMLElement>, selectedParam?: IDropdownOption) => void;
paramValue: string; paramValue: string;
selectedKey: string | number; selectedKey: string | number;
} }

View File

@@ -10,7 +10,7 @@ describe("parseResourceTokenConnectionString", () => {
accountEndpoint: "fakeEndpoint", accountEndpoint: "fakeEndpoint",
collectionId: "fakeCollectionId", collectionId: "fakeCollectionId",
databaseId: "fakeDatabaseId", databaseId: "fakeDatabaseId",
partitionKey: "", partitionKey: undefined,
resourceToken: "type=resource&ver=1&sig=2dIP+CdIfT1ScwHWdv5GGw==;fakeToken;", resourceToken: "type=resource&ver=1&sig=2dIP+CdIfT1ScwHWdv5GGw==;fakeToken;",
}); });
}); });

View File

@@ -7,11 +7,11 @@ export interface ParsedResourceTokenConnectionString {
} }
export function parseResourceTokenConnectionString(connectionString: string): ParsedResourceTokenConnectionString { export function parseResourceTokenConnectionString(connectionString: string): ParsedResourceTokenConnectionString {
let accountEndpoint = ""; let accountEndpoint: string;
let collectionId = ""; let collectionId: string;
let databaseId = ""; let databaseId: string;
let partitionKey = ""; let partitionKey: string;
let resourceToken = ""; let resourceToken: string;
const connectionStringParts = connectionString.split(";"); const connectionStringParts = connectionString.split(";");
connectionStringParts.forEach((part: string) => { connectionStringParts.forEach((part: string) => {
if (part.startsWith("type=resource")) { if (part.startsWith("type=resource")) {
@@ -39,5 +39,5 @@ export function parseResourceTokenConnectionString(connectionString: string): Pa
} }
export function isResourceTokenConnectionString(connectionString: string): boolean { export function isResourceTokenConnectionString(connectionString: string): boolean {
return connectionString.includes("type=resource"); return connectionString && connectionString.includes("type=resource");
} }

View File

@@ -40,7 +40,7 @@ interface UserContext {
// This is coming in a future Cosmos ARM API version as a prperty on databaseAccount // This is coming in a future Cosmos ARM API version as a prperty on databaseAccount
apiType: ApiType; apiType: ApiType;
readonly isTryCosmosDBSubscription?: boolean; readonly isTryCosmosDBSubscription?: boolean;
readonly portalEnv: PortalEnv; readonly portalEnv?: PortalEnv;
readonly features: Features; readonly features: Features;
readonly addCollectionFlight: string; readonly addCollectionFlight: string;
readonly hasWriteAccess: boolean; readonly hasWriteAccess: boolean;

View File

@@ -8,6 +8,7 @@
"noUnusedParameters": true "noUnusedParameters": true
}, },
"files": [ "files": [
"./src/Explorer/Panes/ExecuteSprocParamsPane/InputParameter.tsx",
"./src/AuthType.ts", "./src/AuthType.ts",
"./src/Bindings/ReactBindingHandler.ts", "./src/Bindings/ReactBindingHandler.ts",
"./src/Common/ArrayHashMap.ts", "./src/Common/ArrayHashMap.ts",
@@ -40,7 +41,6 @@
"./src/Explorer/Controls/Dialog.tsx", "./src/Explorer/Controls/Dialog.tsx",
"./src/Explorer/Controls/GitHub/GitHubStyleConstants.ts", "./src/Explorer/Controls/GitHub/GitHubStyleConstants.ts",
"./src/Explorer/Controls/SmartUi/InputUtils.ts", "./src/Explorer/Controls/SmartUi/InputUtils.ts",
"./src/Explorer/Controls/ThroughputInput/CostEstimateText/CostEstimateText.tsx",
"./src/Explorer/Graph/GraphExplorerComponent/ArraysByKeyCache.test.ts", "./src/Explorer/Graph/GraphExplorerComponent/ArraysByKeyCache.test.ts",
"./src/Explorer/Graph/GraphExplorerComponent/ArraysByKeyCache.ts", "./src/Explorer/Graph/GraphExplorerComponent/ArraysByKeyCache.ts",
"./src/Explorer/Graph/GraphExplorerComponent/EdgeInfoCache.ts", "./src/Explorer/Graph/GraphExplorerComponent/EdgeInfoCache.ts",
@@ -61,6 +61,7 @@
"./src/Explorer/Notebook/NotebookRenderer/StatusBar.tsx", "./src/Explorer/Notebook/NotebookRenderer/StatusBar.tsx",
"./src/Explorer/Notebook/NotebookRenderer/decorators/CellCreator.tsx", "./src/Explorer/Notebook/NotebookRenderer/decorators/CellCreator.tsx",
"./src/Explorer/Notebook/NotebookRenderer/decorators/CellLabeler.tsx", "./src/Explorer/Notebook/NotebookRenderer/decorators/CellLabeler.tsx",
"./src/Explorer/Notebook/NotebookRenderer/decorators/HoverableCell.tsx",
"./src/Explorer/Notebook/NotebookUtil.ts", "./src/Explorer/Notebook/NotebookUtil.ts",
"./src/Explorer/Notebook/SchemaAnalyzer/SchemaAnalyzerSplashScreen.tsx", "./src/Explorer/Notebook/SchemaAnalyzer/SchemaAnalyzerSplashScreen.tsx",
"./src/Explorer/Notebook/SchemaAnalyzer/SchemaAnalyzerUtils.ts", "./src/Explorer/Notebook/SchemaAnalyzer/SchemaAnalyzerUtils.ts",
@@ -85,15 +86,9 @@
"./src/GitHub/GitHubConnector.ts", "./src/GitHub/GitHubConnector.ts",
"./src/HostedExplorerChildFrame.ts", "./src/HostedExplorerChildFrame.ts",
"./src/Platform/Hosted/Authorization.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.test.tsx",
"./src/Platform/Hosted/Components/MeControl.tsx", "./src/Platform/Hosted/Components/MeControl.tsx",
"./src/Platform/Hosted/Components/SignInButton.tsx", "./src/Platform/Hosted/Components/SignInButton.tsx",
"./src/Platform/Hosted/Components/SwitchAccount.tsx",
"./src/Platform/Hosted/Components/SwitchSubscription.tsx",
"./src/Platform/Hosted/Helpers/ResourceTokenUtils.test.ts",
"./src/Platform/Hosted/Helpers/ResourceTokenUtils.ts",
"./src/Platform/Hosted/HostedUtils.test.ts", "./src/Platform/Hosted/HostedUtils.test.ts",
"./src/Platform/Hosted/HostedUtils.ts", "./src/Platform/Hosted/HostedUtils.ts",
"./src/Platform/Hosted/extractFeatures.test.ts", "./src/Platform/Hosted/extractFeatures.test.ts",
@@ -137,15 +132,17 @@
"./src/hooks/useFullScreenURLs.tsx", "./src/hooks/useFullScreenURLs.tsx",
"./src/hooks/useGraphPhoto.tsx", "./src/hooks/useGraphPhoto.tsx",
"./src/hooks/useNotebookSnapshotStore.ts", "./src/hooks/useNotebookSnapshotStore.ts",
"./src/hooks/usePortalAccessToken.tsx",
"./src/hooks/useNotificationConsole.ts", "./src/hooks/useNotificationConsole.ts",
"./src/hooks/useObservable.ts", "./src/hooks/useObservable.ts",
"./src/hooks/usePortalAccessToken.tsx",
"./src/hooks/useSidePanel.ts", "./src/hooks/useSidePanel.ts",
"./src/i18n.ts", "./src/i18n.ts",
"./src/quickstart.ts", "./src/quickstart.ts",
"./src/setupTests.ts", "./src/setupTests.ts",
"./src/userContext.test.ts", "./src/userContext.test.ts",
"src/Common/EntityValue.tsx" "src/Common/EntityValue.tsx",
"./src/Platform/Hosted/Components/SwitchAccount.tsx",
"./src/Platform/Hosted/Components/SwitchSubscription.tsx"
], ],
"include": [ "include": [
"src/CellOutputViewer/transforms/**/*", "src/CellOutputViewer/transforms/**/*",
@@ -160,7 +157,6 @@
"src/Explorer/Graph/GraphExplorerComponent/__mocks__/**/*", "src/Explorer/Graph/GraphExplorerComponent/__mocks__/**/*",
"src/Explorer/Menus/NavBar/**/*", "src/Explorer/Menus/NavBar/**/*",
"src/Explorer/Notebook/NotebookComponent/__mocks__/**/*", "src/Explorer/Notebook/NotebookComponent/__mocks__/**/*",
"src/Explorer/Notebook/NotebookRenderer/decorators/draggable/**/*",
"src/Explorer/Notebook/NotebookRenderer/decorators/hijack-scroll/**/*", "src/Explorer/Notebook/NotebookRenderer/decorators/hijack-scroll/**/*",
"src/Explorer/Notebook/NotebookRenderer/decorators/kbd-shortcuts/**/*", "src/Explorer/Notebook/NotebookRenderer/decorators/kbd-shortcuts/**/*",
"src/Explorer/Panes/RightPaneForm/**/*", "src/Explorer/Panes/RightPaneForm/**/*",