rename type

This commit is contained in:
Peter Holmberg
2018-10-29 16:01:14 +01:00
parent 12336e1548
commit 12a63b605f
6 changed files with 12 additions and 12 deletions

View File

@@ -2,7 +2,7 @@ import React, { PureComponent } from 'react';
import { connect } from 'react-redux';
import { Label } from '../../core/components/Label/Label';
import SimplePicker from '../../core/components/Picker/SimplePicker';
import { Dashboard, OrganizationPreferences } from 'app/types';
import { DashboardSearchHit, OrganizationPreferences } from 'app/types';
import {
setOrganizationHomeDashboard,
setOrganizationTheme,
@@ -12,7 +12,7 @@ import {
export interface Props {
preferences: OrganizationPreferences;
starredDashboards: Dashboard[];
starredDashboards: DashboardSearchHit[];
setOrganizationHomeDashboard: typeof setOrganizationHomeDashboard;
setOrganizationTheme: typeof setOrganizationTheme;
setOrganizationTimezone: typeof setOrganizationTimezone;
@@ -69,7 +69,7 @@ export class OrgPreferences extends PureComponent<Props> {
defaultValue={starredDashboards.find(dashboard => dashboard.id === preferences.homeDashboardId)}
getOptionValue={i => i.id}
getOptionLabel={i => i.title}
onSelected={(dashboard: Dashboard) => setOrganizationHomeDashboard(dashboard.id)}
onSelected={(dashboard: DashboardSearchHit) => setOrganizationHomeDashboard(dashboard.id)}
options={starredDashboards}
placeholder="Chose default dashboard"
width={20}

View File

@@ -1,5 +1,5 @@
import { ThunkAction } from 'redux-thunk';
import { Dashboard, Organization, OrganizationPreferences, StoreState } from 'app/types';
import { DashboardSearchHit, Organization, OrganizationPreferences, StoreState } from 'app/types';
import { getBackendSrv } from '../../../core/services/backend_srv';
type ThunkResult<R> = ThunkAction<R, StoreState, undefined, any>;
@@ -26,7 +26,7 @@ interface LoadPreferencesAction {
interface LoadStarredDashboardsAction {
type: ActionTypes.LoadStarredDashboards;
payload: Dashboard[];
payload: DashboardSearchHit[];
}
interface SetOrganizationNameAction {

View File

@@ -1,10 +1,10 @@
import { Dashboard, Organization, OrganizationPreferences, OrganizationState } from 'app/types';
import { DashboardSearchHit, Organization, OrganizationPreferences, OrganizationState } from 'app/types';
import { Action, ActionTypes } from './actions';
const initialState: OrganizationState = {
organization: {} as Organization,
preferences: {} as OrganizationPreferences,
starredDashboards: [] as Dashboard[],
starredDashboards: [] as DashboardSearchHit[],
};
const organizationReducer = (state = initialState, action: Action): OrganizationState => {