Skip to content

Commit

Permalink
TS Panel_error and dashboard_constant (#22141)
Browse files Browse the repository at this point in the history
* Panel migration to ts

Added the getKibanaVersion to index.d.ts file
Panel error now in ts

* test

* Panel migration to ts

Added the getKibanaVersion to index.d.ts file
Panel error now in ts

* deleted dashboard_constants.js

* removed comment in dashboard_constants
  • Loading branch information
rshen91 authored Aug 22, 2018
1 parent ceafa48 commit b3a1ac1
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 12 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,6 @@ export const DASHBOARD_GRID_HEIGHT = 20;
export const DEFAULT_PANEL_WIDTH = DASHBOARD_GRID_COLUMN_COUNT / 2;
export const DEFAULT_PANEL_HEIGHT = 15;

export function createDashboardEditUrl(id) {
export function createDashboardEditUrl(id: string) {
return `/dashboard/${id}`;
}
Original file line number Diff line number Diff line change
Expand Up @@ -18,21 +18,16 @@
*/

import React from 'react';
import PropTypes from 'prop-types';

export function PanelError({ error }) {
export interface PanelErrorProps {
error: string | React.ReactNode;
}

export function PanelError({ error }: PanelErrorProps) {
return (
<div className="dshPanel__error panel-content">
<span aria-hidden="true" className="kuiIcon fa-exclamation-triangle"/>
<span aria-hidden="true" className="kuiIcon fa-exclamation-triangle" />
<span>{error}</span>
</div>
);
}

PanelError.propTypes = {
error: PropTypes.oneOfType([
PropTypes.string,
PropTypes.node
]),
};

1 change: 1 addition & 0 deletions src/ui/public/chrome/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ declare class Chrome {
public dangerouslyGetActiveInjector(): Promise<IInjector>;
public getBasePath(): string;
public getXsrfToken(): string;
public getKibanaVersion(): string;
}

declare const chrome: Chrome;
Expand Down

0 comments on commit b3a1ac1

Please sign in to comment.