Rename pruneDashboardTimeV1 to retainRangesDashboardTimeV1

pull/10616/head
Jared Scheib 2018-06-11 16:42:06 -07:00
parent 37eb215869
commit a8180f6920
3 changed files with 10 additions and 10 deletions

View File

@ -114,16 +114,16 @@ export const setDashTimeV1 = (
},
})
interface PruneDashTimeV1Action {
type: 'PRUNE_DASHBOARD_TIME_V1'
interface RetainRangesDashTimeV1Action {
type: 'RETAIN_RANGES_DASHBOARD_TIME_V1'
payload: {
dashboardIDs: string[]
}
}
export const pruneDashTimeV1 = (
export const retainRangesDashTimeV1 = (
dashboardIDs: string[]
): PruneDashTimeV1Action => ({
type: 'PRUNE_DASHBOARD_TIME_V1',
): RetainRangesDashTimeV1Action => ({
type: 'RETAIN_RANGES_DASHBOARD_TIME_V1',
payload: {dashboardIDs},
})

View File

@ -13,7 +13,7 @@ import {
deleteDashboardAsync,
getChronografVersion,
importDashboardAsync,
pruneDashTimeV1 as pruneDashTimeV1Action,
retainRangesDashTimeV1 as retainRangesDashTimeV1Action,
} from 'src/dashboards/actions'
import {notify as notifyAction} from 'src/shared/actions/notifications'
@ -36,7 +36,7 @@ interface Props {
handleDeleteDashboard: (dashboard: Dashboard) => void
handleImportDashboard: (dashboard: Dashboard) => void
notify: (message: Notification) => void
pruneDashTimeV1: (dashboardIDs: number[]) => void
retainRangesDashTimeV1: (dashboardIDs: number[]) => void
dashboards: Dashboard[]
}
@ -45,7 +45,7 @@ class DashboardsPage extends PureComponent<Props> {
public async componentDidMount() {
const dashboards = await this.props.handleGetDashboards()
const dashboardIDs = dashboards.map(d => d.id)
this.props.pruneDashTimeV1(dashboardIDs)
this.props.retainRangesDashTimeV1(dashboardIDs)
}
public render() {
@ -143,7 +143,7 @@ const mapDispatchToProps = {
handleGetChronografVersion: getChronografVersion,
handleImportDashboard: importDashboardAsync,
notify: notifyAction,
pruneDashTimeV1: pruneDashTimeV1Action,
retainRangesDashTimeV1: retainRangesDashTimeV1Action,
}
export default withRouter(

View File

@ -11,7 +11,7 @@ const dashTimeV1 = (state = initialState, action) => {
return {...state, ranges}
}
case 'PRUNE_DASHBOARD_TIME_V1': {
case 'RETAIN_RANGES_DASHBOARD_TIME_V1': {
const {dashboardIDs} = action.payload
const ranges = state.ranges.filter(r =>
dashboardIDs.includes(r.dashboardID)