mirror of
https://github.com/Azure/cosmos-explorer.git
synced 2025-04-13 21:32:26 +01:00
fixed ts strict issue of useSubscription useDatabaseAccount markdown-cells text-file
This commit is contained in:
parent
8eeda41021
commit
bb134a2441
@ -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,6 +8,9 @@
|
||||
"noUnusedParameters": true
|
||||
},
|
||||
"files": [
|
||||
"./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",
|
||||
@ -165,4 +168,4 @@
|
||||
"src/Terminal/**/*",
|
||||
"src/Utils/arm/**/*"
|
||||
]
|
||||
}
|
||||
}
|
Loading…
x
Reference in New Issue
Block a user