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