// Libaries import React, { PureComponent } from 'react'; // Utils & Services import { AngularComponent, getAngularLoader } from '@grafana/runtime'; // Types import { DashboardModel } from '../../state/DashboardModel'; import { BackButton } from 'app/core/components/BackButton/BackButton'; import { updateLocation } from 'app/core/actions'; import { CustomScrollbar } from '@grafana/ui'; export interface Props { dashboard: DashboardModel | null; updateLocation: typeof updateLocation; } export class DashboardSettings extends PureComponent { element: HTMLElement; angularCmp: AngularComponent; componentDidMount() { const loader = getAngularLoader(); const template = ''; const scopeProps = { dashboard: this.props.dashboard }; this.angularCmp = loader.load(this.element, scopeProps, template); } componentWillUnmount() { if (this.angularCmp) { this.angularCmp.destroy(); } } onClose = () => { this.props.updateLocation({ query: { editview: null }, partial: true, }); }; render() { const { dashboard } = this.props; const folderTitle = dashboard.meta.folderTitle; const haveFolder = dashboard.meta.folderId > 0; return (
{haveFolder &&
{folderTitle} /
} {dashboard.title} / Settings
(this.element = element)} />
); } }