Merge pull request #13281 from influxdata/reborg-data-explorer
feat(ui): Make data explorer org centricpull/13208/head
commit
76f002f11e
|
@ -24,7 +24,7 @@ import {createDashboard} from 'src/dashboards/apis'
|
|||
import {notify} from 'src/shared/actions/notifications'
|
||||
|
||||
// Types
|
||||
import {AppState, Dashboard, View, Organization} from 'src/types'
|
||||
import {AppState, Dashboard, View} from 'src/types'
|
||||
import {
|
||||
Columns,
|
||||
InputType,
|
||||
|
@ -43,7 +43,7 @@ interface State {
|
|||
interface StateProps {
|
||||
dashboards: Dashboard[]
|
||||
view: View
|
||||
orgs: Organization[]
|
||||
orgID: string
|
||||
}
|
||||
|
||||
interface DispatchProps {
|
||||
|
@ -186,10 +186,10 @@ class SaveAsCellForm extends PureComponent<Props, State> {
|
|||
dashboardName: string,
|
||||
view: View
|
||||
): Promise<void> => {
|
||||
const {onCreateCellWithView, orgs} = this.props
|
||||
const {onCreateCellWithView, orgID} = this.props
|
||||
try {
|
||||
const newDashboard = {
|
||||
orgID: orgs[0].id,
|
||||
orgID,
|
||||
name: dashboardName || DEFAULT_DASHBOARD_NAME,
|
||||
cells: [],
|
||||
}
|
||||
|
@ -233,13 +233,13 @@ class SaveAsCellForm extends PureComponent<Props, State> {
|
|||
const mstp = (state: AppState): StateProps => {
|
||||
const {
|
||||
dashboards: {list: dashboards},
|
||||
orgs: {items},
|
||||
orgs: {org},
|
||||
timeMachines: {
|
||||
timeMachines: {de},
|
||||
},
|
||||
} = state
|
||||
const {view} = de
|
||||
return {dashboards, view, orgs: items}
|
||||
return {dashboards, view, orgID: _.get(org, 'id', '')}
|
||||
}
|
||||
|
||||
const mdtp: DispatchProps = {
|
||||
|
|
|
@ -26,7 +26,7 @@ import {
|
|||
} from 'src/utils/taskOptionsToFluxScript'
|
||||
|
||||
// Types
|
||||
import {AppState, Organization, TimeRange} from 'src/types'
|
||||
import {AppState, TimeRange} from 'src/types'
|
||||
import {
|
||||
TaskSchedule,
|
||||
TaskOptions,
|
||||
|
@ -46,7 +46,6 @@ interface DispatchProps {
|
|||
}
|
||||
|
||||
interface StateProps {
|
||||
orgs: Organization[]
|
||||
taskOptions: TaskOptions
|
||||
draftQueries: DashboardDraftQuery[]
|
||||
activeQueryIndex: number
|
||||
|
@ -155,7 +154,6 @@ class SaveAsTaskForm extends PureComponent<Props & WithRouterProps> {
|
|||
|
||||
const mstp = (state: AppState): StateProps => {
|
||||
const {
|
||||
orgs: {items},
|
||||
tasks: {newScript, taskOptions},
|
||||
} = state
|
||||
|
||||
|
@ -164,7 +162,6 @@ const mstp = (state: AppState): StateProps => {
|
|||
)
|
||||
|
||||
return {
|
||||
orgs: items,
|
||||
newScript,
|
||||
taskOptions,
|
||||
timeRange,
|
||||
|
|
Loading…
Reference in New Issue