Skip to content

Commit b093483

Browse files
authored
fix: fix CSV format parser by bumping giraffe (#4948)
1 parent cb2f8d5 commit b093483

File tree

3 files changed

+21
-41
lines changed

3 files changed

+21
-41
lines changed

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -166,7 +166,7 @@
166166
"@docsearch/react": "^3.0.0-alpha.37",
167167
"@influxdata/clockface": "^4.6.0",
168168
"@influxdata/flux-lsp-browser": "0.8.20",
169-
"@influxdata/giraffe": "^2.29.0",
169+
"@influxdata/giraffe": "^2.30.0",
170170
"@influxdata/influxdb-templates": "0.9.0",
171171
"@influxdata/react-custom-scrollbars": "4.3.8",
172172
"abortcontroller-polyfill": "^1.3.0",

src/notifications/endpoints/components/EndpointCard.tsx

Lines changed: 16 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
// Libraries
22
import React, {FC} from 'react'
3-
import {withRouter, RouteComponentProps} from 'react-router-dom'
4-
import {connect, ConnectedProps} from 'react-redux'
3+
import {useHistory} from 'react-router-dom'
4+
import {useDispatch, useSelector} from 'react-redux'
55

66
// Actions
77
import {
@@ -37,30 +37,20 @@ import {NotificationEndpoint, Label, AlertHistoryType} from 'src/types'
3737
// Utilities
3838
import {relativeTimestampFormatter} from 'src/shared/utils/relativeTimestampFormatter'
3939
import ErrorBoundary from 'src/shared/components/ErrorBoundary'
40+
import {getOrg} from 'src/organizations/selectors'
4041

41-
interface OwnProps {
42+
interface Props {
4243
endpoint: NotificationEndpoint
4344
}
4445

45-
type ReduxProps = ConnectedProps<typeof connector>
46-
type Props = OwnProps & RouteComponentProps<{orgID: string}> & ReduxProps
47-
48-
const EndpointCard: FC<Props> = ({
49-
history,
50-
match: {
51-
params: {orgID},
52-
},
53-
endpoint,
54-
onUpdateEndpointProperties,
55-
onCloneEndpoint,
56-
onDeleteEndpoint,
57-
onAddEndpointLabel,
58-
onRemoveEndpointLabel,
59-
}) => {
46+
const EndpointCard: FC<Props> = ({endpoint}) => {
47+
const history = useHistory()
48+
const orgID = useSelector(getOrg).id
49+
const dispatch = useDispatch()
6050
const {id, name, description, activeStatus} = endpoint
6151

6252
const handleUpdateName = (name: string) => {
63-
onUpdateEndpointProperties(id, {name})
53+
dispatch(updateEndpointProperties(id, {name}))
6454
}
6555

6656
const handleClick = () => {
@@ -69,7 +59,7 @@ const EndpointCard: FC<Props> = ({
6959

7060
const handleToggle = () => {
7161
const toStatus = activeStatus === 'active' ? 'inactive' : 'active'
72-
onUpdateEndpointProperties(id, {status: toStatus})
62+
dispatch(updateEndpointProperties(id, {status: toStatus}))
7363
}
7464

7565
const handleView = () => {
@@ -83,10 +73,10 @@ const EndpointCard: FC<Props> = ({
8373
history.push(`/orgs/${orgID}/alert-history?${queryParams}`)
8474
}
8575
const handleDelete = () => {
86-
onDeleteEndpoint(id)
76+
dispatch(deleteEndpoint(id))
8777
}
8878
const handleClone = () => {
89-
onCloneEndpoint(endpoint)
79+
dispatch(cloneEndpoint(endpoint))
9080
}
9181
const contextMenu = (
9282
<EndpointCardMenu
@@ -97,14 +87,14 @@ const EndpointCard: FC<Props> = ({
9787
)
9888

9989
const handleAddEndpointLabel = (label: Label) => {
100-
onAddEndpointLabel(id, label)
90+
dispatch(addEndpointLabel(id, label))
10191
}
10292
const handleRemoveEndpointLabel = (label: Label) => {
103-
onRemoveEndpointLabel(id, label.id)
93+
dispatch(deleteEndpointLabel(id, label.id))
10494
}
10595

10696
const handleUpdateDescription = (description: string) => {
107-
onUpdateEndpointProperties(id, {description})
97+
dispatch(updateEndpointProperties(id, {description}))
10898
}
10999

110100
return (
@@ -161,14 +151,4 @@ const EndpointCard: FC<Props> = ({
161151
)
162152
}
163153

164-
const mdtp = {
165-
onDeleteEndpoint: deleteEndpoint,
166-
onAddEndpointLabel: addEndpointLabel,
167-
onRemoveEndpointLabel: deleteEndpointLabel,
168-
onUpdateEndpointProperties: updateEndpointProperties,
169-
onCloneEndpoint: cloneEndpoint,
170-
}
171-
172-
const connector = connect(null, mdtp)
173-
174-
export default connector(withRouter(EndpointCard))
154+
export default EndpointCard

yarn.lock

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1461,10 +1461,10 @@
14611461
resolved "https://registry.yarnpkg.com/@influxdata/flux-lsp-browser/-/flux-lsp-browser-0.8.20.tgz#6bd6e9e7fe419ff5178d5b92ac85e74053b55e0b"
14621462
integrity sha512-X6uVgn4CiW1H4jCkGvaYGGGZ3wz3LvsnldPosfP3lqsYFYHbhoKP0PUu4V5EdJYNu/K/Ov5Krx9srx6r35qRVA==
14631463

1464-
"@influxdata/giraffe@^2.29.0":
1465-
version "2.29.1"
1466-
resolved "https://registry.yarnpkg.com/@influxdata/giraffe/-/giraffe-2.29.1.tgz#7b85d9cefdb9c149f64051e9d35759858fc179d3"
1467-
integrity sha512-FUg2MM98Ax3SnS6I6X4gEU9wAIeoSK5oAT1TGt/gE5WEHmxZKbBN2b8zik/bTkJNfoCDNn9jwN7E5mO3OjjBRA==
1464+
"@influxdata/giraffe@^2.30.0":
1465+
version "2.30.0"
1466+
resolved "https://registry.yarnpkg.com/@influxdata/giraffe/-/giraffe-2.30.0.tgz#c399ffaa32a696e2a8c94f377b3cc76123268b5b"
1467+
integrity sha512-3YZI3PGf//6JbKRYMVyNOlClWdlEmuxqib+D8p84A3W1XIGcgm1j2thx1HeSnAmELMYXv92ugKiDGLaVwYuCwA==
14681468
dependencies:
14691469
merge-images "^2.0.0"
14701470

0 commit comments

Comments
 (0)