Skip to content

Commit

Permalink
[Chore]: Typescript 4.4 fixes (#1957)
Browse files Browse the repository at this point in the history
  • Loading branch information
igorDykhta committed Sep 11, 2022
1 parent 49321f8 commit ea73859
Show file tree
Hide file tree
Showing 9 changed files with 227 additions and 208 deletions.
2 changes: 1 addition & 1 deletion src/actions/src/provider-actions.ts
Expand Up @@ -104,7 +104,7 @@ export const resetProviderStatus: () => {
} = createAction(ActionTypes.RESET_PROVIDER_STATUS);

/** SET_CLOUD_PROVIDER */
export type SetCloudProviderPayload = string;
export type SetCloudProviderPayload = string | null;
export const setCloudProvider: (
p: SetCloudProviderPayload
) => {
Expand Down
6 changes: 5 additions & 1 deletion src/components/src/common/item-selector/typeahead.tsx
Expand Up @@ -298,7 +298,11 @@ class Typeahead extends Component<TypeaheadProps, TypeaheadState> {
}

getSelection() {
let index = Number(this.state.selectionIndex);
let index: number | null = this.state.selectionIndex;
if (index === null) {
return null;
}
index = Number(index);

if (this._hasCustomValue()) {
if (index === 0) {
Expand Down
8 changes: 7 additions & 1 deletion src/components/src/map/map-popover.tsx
Expand Up @@ -139,7 +139,13 @@ function createVirtualReference(container, x, y, size = 0) {
right: left + size,
bottom: top + size,
width: size,
height: size
height: size,
// These properties are present to meet the DOMRect interface
y: top,
x: left,
toJSON() {
return this;
}
};
}

Expand Down
12 changes: 6 additions & 6 deletions src/components/src/modals/cloud-tile.tsx
Expand Up @@ -18,7 +18,7 @@
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
// THE SOFTWARE.

import React, {ReactNode} from 'react';
import React from 'react';
import styled from 'styled-components';
import {Logout, Login} from '../common/icons';
import {CenterVerticalFlexbox, Button, CheckMark} from '../common/styled-components';
Expand Down Expand Up @@ -97,7 +97,7 @@ const LogoutButton = ({onClick}: OnClickProps) => (

interface ActionButtonProps {
isConnected?: boolean;
actionName?: ReactNode | null;
actionName?: string | null;
isReady?: boolean;
}

Expand All @@ -111,15 +111,15 @@ const ActionButton = ({isConnected, actionName = null, isReady}: ActionButtonPro
interface CloudTileProps {
onSelect?: React.MouseEventHandler<HTMLDivElement>;
// default to login
onConnect?: React.MouseEventHandler<HTMLDivElement> | null;
onConnect?: (() => void) | null;
// default to logout
onLogout?: React.MouseEventHandler<HTMLDivElement> | null;
onLogout?: (() => void) | null;
// action name
actionName?: ReactNode | null;
actionName?: string | null;
// cloud provider class
cloudProvider: Provider;
// function to take after login or logout
onSetCloudProvider;
onSetCloudProvider: (providerName: string | null) => void;
// whether provider is selected as currentProvider
isSelected?: boolean;
// whether user has logged in
Expand Down

0 comments on commit ea73859

Please sign in to comment.