rename type
This commit is contained in:
@@ -2,7 +2,7 @@ import React, { PureComponent } from 'react';
|
|||||||
import { connect } from 'react-redux';
|
import { connect } from 'react-redux';
|
||||||
import { Label } from '../../core/components/Label/Label';
|
import { Label } from '../../core/components/Label/Label';
|
||||||
import SimplePicker from '../../core/components/Picker/SimplePicker';
|
import SimplePicker from '../../core/components/Picker/SimplePicker';
|
||||||
import { Dashboard, OrganizationPreferences } from 'app/types';
|
import { DashboardSearchHit, OrganizationPreferences } from 'app/types';
|
||||||
import {
|
import {
|
||||||
setOrganizationHomeDashboard,
|
setOrganizationHomeDashboard,
|
||||||
setOrganizationTheme,
|
setOrganizationTheme,
|
||||||
@@ -12,7 +12,7 @@ import {
|
|||||||
|
|
||||||
export interface Props {
|
export interface Props {
|
||||||
preferences: OrganizationPreferences;
|
preferences: OrganizationPreferences;
|
||||||
starredDashboards: Dashboard[];
|
starredDashboards: DashboardSearchHit[];
|
||||||
setOrganizationHomeDashboard: typeof setOrganizationHomeDashboard;
|
setOrganizationHomeDashboard: typeof setOrganizationHomeDashboard;
|
||||||
setOrganizationTheme: typeof setOrganizationTheme;
|
setOrganizationTheme: typeof setOrganizationTheme;
|
||||||
setOrganizationTimezone: typeof setOrganizationTimezone;
|
setOrganizationTimezone: typeof setOrganizationTimezone;
|
||||||
@@ -69,7 +69,7 @@ export class OrgPreferences extends PureComponent<Props> {
|
|||||||
defaultValue={starredDashboards.find(dashboard => dashboard.id === preferences.homeDashboardId)}
|
defaultValue={starredDashboards.find(dashboard => dashboard.id === preferences.homeDashboardId)}
|
||||||
getOptionValue={i => i.id}
|
getOptionValue={i => i.id}
|
||||||
getOptionLabel={i => i.title}
|
getOptionLabel={i => i.title}
|
||||||
onSelected={(dashboard: Dashboard) => setOrganizationHomeDashboard(dashboard.id)}
|
onSelected={(dashboard: DashboardSearchHit) => setOrganizationHomeDashboard(dashboard.id)}
|
||||||
options={starredDashboards}
|
options={starredDashboards}
|
||||||
placeholder="Chose default dashboard"
|
placeholder="Chose default dashboard"
|
||||||
width={20}
|
width={20}
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
import { ThunkAction } from 'redux-thunk';
|
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';
|
import { getBackendSrv } from '../../../core/services/backend_srv';
|
||||||
|
|
||||||
type ThunkResult<R> = ThunkAction<R, StoreState, undefined, any>;
|
type ThunkResult<R> = ThunkAction<R, StoreState, undefined, any>;
|
||||||
@@ -26,7 +26,7 @@ interface LoadPreferencesAction {
|
|||||||
|
|
||||||
interface LoadStarredDashboardsAction {
|
interface LoadStarredDashboardsAction {
|
||||||
type: ActionTypes.LoadStarredDashboards;
|
type: ActionTypes.LoadStarredDashboards;
|
||||||
payload: Dashboard[];
|
payload: DashboardSearchHit[];
|
||||||
}
|
}
|
||||||
|
|
||||||
interface SetOrganizationNameAction {
|
interface SetOrganizationNameAction {
|
||||||
|
|||||||
@@ -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';
|
import { Action, ActionTypes } from './actions';
|
||||||
|
|
||||||
const initialState: OrganizationState = {
|
const initialState: OrganizationState = {
|
||||||
organization: {} as Organization,
|
organization: {} as Organization,
|
||||||
preferences: {} as OrganizationPreferences,
|
preferences: {} as OrganizationPreferences,
|
||||||
starredDashboards: [] as Dashboard[],
|
starredDashboards: [] as DashboardSearchHit[],
|
||||||
};
|
};
|
||||||
|
|
||||||
const organizationReducer = (state = initialState, action: Action): OrganizationState => {
|
const organizationReducer = (state = initialState, action: Action): OrganizationState => {
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
import { DashboardAcl } from './acl';
|
import { DashboardAcl } from './acl';
|
||||||
|
|
||||||
export interface Dashboard {
|
export interface DashboardSearchHit {
|
||||||
id: number;
|
id: number;
|
||||||
tags: string[];
|
tags: string[];
|
||||||
title: string;
|
title: string;
|
||||||
@@ -3,7 +3,7 @@ import { AlertRuleDTO, AlertRule, AlertRulesState } from './alerting';
|
|||||||
import { LocationState, LocationUpdate, UrlQueryMap, UrlQueryValue } from './location';
|
import { LocationState, LocationUpdate, UrlQueryMap, UrlQueryValue } from './location';
|
||||||
import { NavModel, NavModelItem, NavIndex } from './navModel';
|
import { NavModel, NavModelItem, NavIndex } from './navModel';
|
||||||
import { FolderDTO, FolderState, FolderInfo } from './folders';
|
import { FolderDTO, FolderState, FolderInfo } from './folders';
|
||||||
import { Dashboard, DashboardState } from './dashboard';
|
import { DashboardSearchHit, DashboardState } from './dashboardSearchHit';
|
||||||
import { DashboardAcl, OrgRole, PermissionLevel } from './acl';
|
import { DashboardAcl, OrgRole, PermissionLevel } from './acl';
|
||||||
import { ApiKey, ApiKeysState, NewApiKey } from './apiKeys';
|
import { ApiKey, ApiKeysState, NewApiKey } from './apiKeys';
|
||||||
import { Invitee, OrgUser, User, UsersState } from './user';
|
import { Invitee, OrgUser, User, UsersState } from './user';
|
||||||
@@ -84,7 +84,7 @@ export {
|
|||||||
AppNotificationsState,
|
AppNotificationsState,
|
||||||
AppNotificationSeverity,
|
AppNotificationSeverity,
|
||||||
AppNotificationTimeout,
|
AppNotificationTimeout,
|
||||||
Dashboard,
|
DashboardSearchHit,
|
||||||
};
|
};
|
||||||
|
|
||||||
export interface StoreState {
|
export interface StoreState {
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
import { Dashboard } from './dashboard';
|
import { DashboardSearchHit } from './dashboardSearchHit';
|
||||||
|
|
||||||
export interface Organization {
|
export interface Organization {
|
||||||
name: string;
|
name: string;
|
||||||
@@ -14,5 +14,5 @@ export interface OrganizationPreferences {
|
|||||||
export interface OrganizationState {
|
export interface OrganizationState {
|
||||||
organization: Organization;
|
organization: Organization;
|
||||||
preferences: OrganizationPreferences;
|
preferences: OrganizationPreferences;
|
||||||
starredDashboards: Dashboard[];
|
starredDashboards: DashboardSearchHit[];
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user