-
Notifications
You must be signed in to change notification settings - Fork 3.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
chore(ui): refactored dashboards client API to oats generated types and API #16438
Conversation
@@ -81,8 +117,8 @@ export enum ActionTypes { | |||
DeleteDashboardFailed = 'DELETE_DASHBOARD_FAILED', | |||
EditDashboard = 'EDIT_DASHBOARD', | |||
RemoveCell = 'REMOVE_CELL', | |||
AddDashboardLabels = 'ADD_DASHBOARD_LABELS', |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
unpluralized these to accurately reflect their functionality
@@ -262,6 +298,46 @@ export const createDashboard = () => async ( | |||
} | |||
} | |||
|
|||
export const cloneUtilFunc = async (dash: Dashboard, id: string) => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this utility function is based on the client-api:
My first attempt at this refactor tried to flatten these into a synchronous progression, but the functionality was buggy.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
thanks!
ui/src/dashboards/actions/index.ts
Outdated
|
||
// Constants | ||
import * as copy from 'src/shared/copy/notifications' | ||
import {DEFAULT_DASHBOARD_NAME} from 'src/dashboards/constants/index' | ||
|
||
// Types | ||
import {RemoteDataState} from 'src/types' | ||
import {CreateCell} from '@influxdata/influx' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can this come from new client as well?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I’ll give a shot on Monday morning and if there aren’t any conflict/cascading issues then it’ll be in the PR :)
@@ -38,6 +39,7 @@ export type NewCell = Omit<Cell, 'id' | 'links' | 'dashboardID'> | |||
|
|||
export interface Dashboard extends Omit<GenDashboard, 'cells'> { | |||
cells: Cell[] | |||
labels: Label[] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
❤️
684a3c8
to
61cef2c
Compare
Closes #16393
Problem
Current API and types are dependent upon deprecated client API
Solution
Refactored the variables to utilize the new oats generated client API