Skip to content

Commit

Permalink
Start trying to fix js types
Browse files Browse the repository at this point in the history
  • Loading branch information
glinton committed Dec 13, 2019
1 parent 998887b commit 00adcf1
Show file tree
Hide file tree
Showing 10 changed files with 26 additions and 23 deletions.
14 changes: 7 additions & 7 deletions http/swagger.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9208,15 +9208,15 @@ components:
type: string
description:
type: string
agent:
config:
type: string
metadata:
type: object
properties:
collectionInterval:
type: integer
plugins:
type: array
items:
$ref: "#/components/schemas/TelegrafRequestPlugin"
buckets:
type: array
items:
type: string
orgID:
type: string
TelegrafRequestPlugin:
Expand Down
2 changes: 1 addition & 1 deletion http/telegraf.go
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ type TelegrafHandler struct {
}

const (
prefixTelegraf = "/api/v2/telegrafs"
prefixTelegraf = "/api/v2/telegrafs"
telegrafsIDPath = "/api/v2/telegrafs/:id"
telegrafsIDMembersPath = "/api/v2/telegrafs/:id/members"
telegrafsIDMembersIDPath = "/api/v2/telegrafs/:id/members/:userID"
Expand Down
2 changes: 1 addition & 1 deletion storage/reads/datatypes/storage_common.pb.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

14 changes: 7 additions & 7 deletions ui/src/dashboards/actions/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ import {DEFAULT_DASHBOARD_NAME} from 'src/dashboards/constants/index'

// Types
import {RemoteDataState} from 'src/types'
import {CreateCell, ILabel} from '@influxdata/influx'
import {CreateCell, Label} from 'src/client/generatedRoutes'
import {
Dashboard,
NewView,
Expand Down Expand Up @@ -141,15 +141,15 @@ interface AddDashboardLabelsAction {
type: ActionTypes.AddDashboardLabels
payload: {
dashboardID: string
labels: ILabel[]
labels: Label[]
}
}

interface RemoveDashboardLabelsAction {
type: ActionTypes.RemoveDashboardLabels
payload: {
dashboardID: string
labels: ILabel[]
labels: Label[]
}
}

Expand Down Expand Up @@ -215,15 +215,15 @@ export const removeCell = (

export const addDashboardLabels = (
dashboardID: string,
labels: ILabel[]
labels: Label[]
): AddDashboardLabelsAction => ({
type: ActionTypes.AddDashboardLabels,
payload: {dashboardID, labels},
})

export const removeDashboardLabels = (
dashboardID: string,
labels: ILabel[]
labels: Label[]
): RemoveDashboardLabelsAction => ({
type: ActionTypes.RemoveDashboardLabels,
payload: {dashboardID, labels},
Expand Down Expand Up @@ -527,7 +527,7 @@ export const copyDashboardCellAsync = (dashboard: Dashboard, cell: Cell) => (

export const addDashboardLabelsAsync = (
dashboardID: string,
labels: ILabel[]
labels: Label[]
) => async (dispatch: Dispatch<Action | PublishNotificationAction>) => {
try {
const newLabels = await client.dashboards.addLabels(
Expand All @@ -544,7 +544,7 @@ export const addDashboardLabelsAsync = (

export const removeDashboardLabelsAsync = (
dashboardID: string,
labels: ILabel[]
labels: Label[]
) => async (dispatch: Dispatch<Action | PublishNotificationAction>) => {
try {
await client.dashboards.removeLabels(dashboardID, labels.map(l => l.id))
Expand Down
3 changes: 2 additions & 1 deletion ui/src/telegrafs/actions/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,8 @@ import {client} from 'src/utils/api'

// Types
import {RemoteDataState, GetState} from 'src/types'
import {ITelegraf as Telegraf, ILabel as Label} from '@influxdata/influx'
import {Telegraf} from 'src/client/generatedRoutes'
import {ILabel as Label} from '@influxdata/influx'
import {Dispatch, ThunkAction} from 'redux-thunk'

// Actions
Expand Down
5 changes: 3 additions & 2 deletions ui/src/telegrafs/components/CollectorCard.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,8 @@ import {DEFAULT_COLLECTOR_NAME} from 'src/dashboards/constants'

// Types
import {AppState, Organization} from 'src/types'
import {ILabel, ITelegraf as Telegraf} from '@influxdata/influx'
import {Telegraf} from 'src/client/generatedRoutes'
import {ILabel} from '@influxdata/influx'

interface OwnProps {
collector: Telegraf
Expand Down Expand Up @@ -75,7 +76,7 @@ class CollectorRow extends PureComponent<Props & WithRouterProps> {
labels={this.labels}
metaData={[
<span key={`bucket-key--${collector.id}`} data-testid="bucket-name">
{/* todo(glinton): verify what sets this. It seems like it is using the 'config' section of 'influxdb_v2' output?? */}
{}
Bucket: {collector.metadata.buckets.join(", ")}
</span>,
<>
Expand Down
2 changes: 1 addition & 1 deletion ui/src/telegrafs/components/CollectorList.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import {ResourceList} from '@influxdata/clockface'
import CollectorRow from 'src/telegrafs/components/CollectorCard'

// Types
import {ITelegraf as Telegraf} from '@influxdata/influx'
import {Telegraf} from 'src/client/generatedRoutes'
import {Sort} from '@influxdata/clockface'
import {SortTypes, getSortedResources} from 'src/shared/utils/sort'
import {AppState} from 'src/types'
Expand Down
3 changes: 2 additions & 1 deletion ui/src/telegrafs/components/Collectors.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,8 @@ import {updateTelegraf, deleteTelegraf} from 'src/telegrafs/actions'
import {ErrorHandling} from 'src/shared/decorators/errors'

// Types
import {ITelegraf as Telegraf} from '@influxdata/influx'
import {Telegraf} from 'src/client/generatedRoutes' // from `import {ITelegraf as Telegraf} from '@influxdata/influx'`

import {OverlayState, AppState, Bucket} from 'src/types'
import {
setDataLoadersType,
Expand Down
2 changes: 1 addition & 1 deletion ui/src/telegrafs/components/TelegrafConfigOverlay.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ import {downloadTextFile} from 'src/shared/utils/download'

// Types
import {AppState} from 'src/types'
import {ITelegraf as Telegraf} from '@influxdata/influx'
import {Telegraf} from 'src/client/generatedRoutes'

interface OwnProps {
onClose: () => void
Expand Down
2 changes: 1 addition & 1 deletion ui/src/telegrafs/reducers/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import {produce} from 'immer'
// Types
import {RemoteDataState} from 'src/types'
import {Action} from 'src/telegrafs/actions'
import {ITelegraf as Telegraf} from '@influxdata/influx'
import {Telegraf} from 'src/client/generatedRoutes'

const initialState = (): TelegrafsState => ({
status: RemoteDataState.NotStarted,
Expand Down

0 comments on commit 00adcf1

Please sign in to comment.