mirror of
https://github.com/Azure/cosmos-explorer.git
synced 2025-12-24 19:31:36 +00:00
Compare commits
1 Commits
fixed-tsst
...
fixed-ts-s
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
bb134a2441 |
@@ -12,7 +12,7 @@ export interface GremlinSimpleClientParameters {
|
||||
password: string;
|
||||
successCallback: (result: Result) => void;
|
||||
progressCallback: (result: Result) => void;
|
||||
failureCallback: (result: Result | null, error: string) => void;
|
||||
failureCallback: (result: Result, error: string) => void;
|
||||
infoCallback: (msg: string) => void;
|
||||
}
|
||||
|
||||
@@ -62,15 +62,14 @@ export class GremlinSimpleClient {
|
||||
private static readonly requestChargeHeader = "x-ms-request-charge";
|
||||
|
||||
public params: GremlinSimpleClientParameters;
|
||||
private ws: WebSocket | undefined;
|
||||
private protocols: string | string[];
|
||||
private ws: WebSocket;
|
||||
|
||||
public requestsToSend: { [requestId: string]: GremlinRequestMessage };
|
||||
public pendingRequests: { [requestId: string]: GremlinRequestMessage };
|
||||
|
||||
constructor(params: GremlinSimpleClientParameters) {
|
||||
this.params = params;
|
||||
this.ws = undefined;
|
||||
|
||||
this.pendingRequests = {};
|
||||
this.requestsToSend = {};
|
||||
}
|
||||
@@ -118,7 +117,7 @@ export class GremlinSimpleClient {
|
||||
}
|
||||
}
|
||||
|
||||
public decodeMessage(msg: MessageEvent): GremlinResponseMessage | null {
|
||||
public decodeMessage(msg: MessageEvent): GremlinResponseMessage {
|
||||
if (msg.data === null) {
|
||||
return null;
|
||||
}
|
||||
@@ -281,7 +280,7 @@ export class GremlinSimpleClient {
|
||||
|
||||
public static utf8ToB64(utf8Str: string) {
|
||||
return btoa(
|
||||
encodeURIComponent(utf8Str).replace(/%([0-9A-F]{2})/g, function (_match, p1) {
|
||||
encodeURIComponent(utf8Str).replace(/%([0-9A-F]{2})/g, function (match, p1) {
|
||||
return String.fromCharCode(parseInt(p1, 16));
|
||||
})
|
||||
);
|
||||
@@ -306,7 +305,7 @@ export class GremlinSimpleClient {
|
||||
return binaryMessage;
|
||||
}
|
||||
|
||||
private onOpen(_event: any) {
|
||||
private onOpen(event: any) {
|
||||
this.executeRequestsToSend();
|
||||
}
|
||||
|
||||
@@ -349,6 +348,6 @@ export class GremlinSimpleClient {
|
||||
|
||||
private sendGremlinMessage(gremlinRequestMessage: GremlinRequestMessage) {
|
||||
const gremlinFrame = GremlinSimpleClient.buildGremlinMessage(gremlinRequestMessage);
|
||||
this.ws && this.ws.send(gremlinFrame);
|
||||
this.ws.send(gremlinFrame);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -18,7 +18,7 @@ const EditorContainer = styled.div`
|
||||
`;
|
||||
|
||||
interface MappedStateProps {
|
||||
mimetype: string;
|
||||
mimetype: string | null;
|
||||
text: string;
|
||||
contentRef: ContentRef;
|
||||
theme?: "light" | "dark";
|
||||
@@ -37,7 +37,7 @@ interface TextFileState {
|
||||
class EditorPlaceholder extends React.PureComponent<MonacoEditorProps> {
|
||||
render(): JSX.Element {
|
||||
// TODO: Show a little blocky placeholder
|
||||
return undefined;
|
||||
return <div />;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -83,7 +83,7 @@ interface InitialProps {
|
||||
}
|
||||
|
||||
function makeMapStateToTextFileProps(
|
||||
initialState: AppState,
|
||||
_initialState: AppState,
|
||||
initialProps: InitialProps
|
||||
): (state: AppState) => MappedStateProps {
|
||||
const { contentRef } = initialProps;
|
||||
@@ -106,7 +106,7 @@ function makeMapStateToTextFileProps(
|
||||
}
|
||||
|
||||
const makeMapDispatchToTextFileProps = (
|
||||
initialDispatch: Dispatch,
|
||||
_initialDispatch: Dispatch,
|
||||
initialProps: InitialProps
|
||||
): ((dispatch: Dispatch) => MappedDispatchProps) => {
|
||||
const { contentRef } = initialProps;
|
||||
|
||||
@@ -99,7 +99,7 @@ export class PureMarkdownCell extends React.Component<ComponentProps & DispatchP
|
||||
}
|
||||
|
||||
export const makeMapStateToProps = (
|
||||
initialState: AppState,
|
||||
_initialState: AppState,
|
||||
ownProps: ComponentProps
|
||||
): ((state: AppState) => StateProps) => {
|
||||
const { id, contentRef } = ownProps;
|
||||
@@ -134,7 +134,7 @@ export const makeMapStateToProps = (
|
||||
};
|
||||
|
||||
const makeMapDispatchToProps = (
|
||||
initialDispatch: Dispatch,
|
||||
_initialDispatch: Dispatch,
|
||||
ownProps: ComponentProps
|
||||
): ((dispatch: Dispatch) => DispatchProps) => {
|
||||
const { id, contentRef } = ownProps;
|
||||
|
||||
@@ -32,8 +32,9 @@ export async function fetchDatabaseAccounts(subscriptionId: string, accessToken:
|
||||
|
||||
export function useDatabaseAccounts(subscriptionId: string, armToken: string): DatabaseAccount[] | undefined {
|
||||
const { data } = useSWR(
|
||||
() => (armToken && subscriptionId ? ["databaseAccounts", subscriptionId, armToken] : undefined),
|
||||
(_, subscriptionId, armToken) => fetchDatabaseAccounts(subscriptionId, armToken)
|
||||
// eslint-disable-next-line no-null/no-null
|
||||
() => (armToken && subscriptionId ? ["databaseAccounts", subscriptionId, armToken] : null),
|
||||
(_: string, subscriptionId: string, armToken: string) => fetchDatabaseAccounts(subscriptionId, armToken)
|
||||
);
|
||||
return data;
|
||||
}
|
||||
|
||||
@@ -34,8 +34,9 @@ export async function fetchSubscriptions(accessToken: string): Promise<Subscript
|
||||
|
||||
export function useSubscriptions(armToken: string): Subscription[] | undefined {
|
||||
const { data } = useSWR(
|
||||
() => (armToken ? ["subscriptions", armToken] : undefined),
|
||||
(_, armToken) => fetchSubscriptions(armToken)
|
||||
// eslint-disable-next-line no-null/no-null
|
||||
() => (armToken ? ["subscriptions", armToken] : null),
|
||||
(_: string, armToken: string) => fetchSubscriptions(armToken)
|
||||
);
|
||||
return data;
|
||||
}
|
||||
|
||||
@@ -8,7 +8,9 @@
|
||||
"noUnusedParameters": true
|
||||
},
|
||||
"files": [
|
||||
"./src/Explorer/Graph/GraphExplorerComponent/GremlinSimpleClient.ts",
|
||||
"./src/hooks/useDatabaseAccounts.tsx",
|
||||
"./src/hooks/useSubscriptions.tsx",
|
||||
"./src/Explorer/Notebook/NotebookComponent/contents/file/text-file.tsx",
|
||||
"./src/AuthType.ts",
|
||||
"./src/Bindings/ReactBindingHandler.ts",
|
||||
"./src/Common/ArrayHashMap.ts",
|
||||
|
||||
Reference in New Issue
Block a user