Skip to content

Commit

Permalink
chore #316 - Updates for web-alert-manager
Browse files Browse the repository at this point in the history
Update package.json version
Fix lint errors
Rename getRemainingJSON to getJSONValueType

Closes #316
  • Loading branch information
github-actions committed May 5, 2021
1 parent 3769230 commit fd9da4a
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 17 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@dassana-io/web-components",
"version": "0.10.15",
"version": "0.10.16",
"publishConfig": {
"registry": "https://npm.pkg.github.com/dassana-io"
},
Expand Down
10 changes: 2 additions & 8 deletions src/components/Input/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -12,13 +12,7 @@ import {
fieldErrorStyles
} from '../assets/styles/styleguide'
import { generateAddonStyles, generateInputStyles } from './utils'
import React, {
FC,
FocusEvent,
KeyboardEvent,
LegacyRef,
RefObject
} from 'react'
import React, { FC, FocusEvent, KeyboardEvent, RefObject } from 'react'

const { dark, light } = ThemeType

Expand All @@ -43,7 +37,7 @@ export interface InputProps extends BaseFormElementProps<HTMLInputElement> {
addonAfter?: string
addonBefore?: string
defaultValue?: string
inputRef?: LegacyRef<AntDInput>
inputRef?: RefObject<AntDInput>
focused?: boolean
onFocus?: (e: FocusEvent<HTMLInputElement>) => void
onKeyDown?: (e: KeyboardEvent) => void
Expand Down
4 changes: 2 additions & 2 deletions src/components/JSONPathPicker/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { CodeControls } from 'components/Code/CodeControls'
import { getJSONPathValue } from 'components/utils'
import { useStyles } from './styles'
import { copyToClipboard, stringifyCode } from 'components/Code/utils'
import { getRemainingJSONType, JSONDataTypes, recursiveRender } from './utils'
import { getJSONValueType, JSONDataTypes, recursiveRender } from './utils'
import React, { FC, useEffect, useState } from 'react'

export type JSONValue =
Expand Down Expand Up @@ -63,4 +63,4 @@ export const JSONPathPicker: FC<JSONPathPickerProps> = ({
)
}

export { getJSONPathValue, getRemainingJSONType, JSONDataTypes }
export { getJSONPathValue, getJSONValueType, JSONDataTypes }
10 changes: 5 additions & 5 deletions src/components/JSONPathPicker/utils.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -249,11 +249,11 @@ const mappedTypesToRenderFns = {
[string]: renderString
}

export const getRemainingJSONType = (remainingJSON: RemainingJSON) => {
if (isNull(remainingJSON)) return nullType
else if (Array.isArray(remainingJSON)) return array
export const getJSONValueType = (json: RemainingJSON) => {
if (isNull(json)) return nullType
else if (Array.isArray(json)) return array
else {
const type = typeof remainingJSON
const type = typeof json

switch (type) {
case 'number':
Expand All @@ -279,7 +279,7 @@ export const recursiveRender = ({
onChange,
remainingJSON
}: RenderParams): ReactNode =>
mappedTypesToRenderFns[getRemainingJSONType(remainingJSON)]({
mappedTypesToRenderFns[getJSONValueType(remainingJSON)]({
classes,
currPath,
isLastItem,
Expand Down
2 changes: 1 addition & 1 deletion src/components/utils.ts
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
import Color from 'color'
import { JSONPath } from 'jsonpath-plus'
import { JSONValue } from './JSONPathPicker'
import mapValues from 'lodash/mapValues'
import { PopupContainerProps } from './types'
import { TooltipPlacement } from 'antd/es/tooltip'
import { useEffect, useState } from 'react'
import { JSONValue } from './JSONPathPicker'

export const placementOptions: TooltipPlacement[] = [
'bottom',
Expand Down

0 comments on commit fd9da4a

Please sign in to comment.