minor fixes

This commit is contained in:
Torkel Ödegaard 2018-11-23 15:01:36 +01:00
parent daee874ee6
commit 39a1b11cb3
7 changed files with 27 additions and 13 deletions

View File

@ -1,4 +1,5 @@
import React from 'react'; import React from 'react';
import { hot } from 'react-hot-loader';
import ReactGridLayout from 'react-grid-layout'; import ReactGridLayout from 'react-grid-layout';
import { GRID_CELL_HEIGHT, GRID_CELL_VMARGIN, GRID_COLUMN_COUNT } from 'app/core/constants'; import { GRID_CELL_HEIGHT, GRID_CELL_VMARGIN, GRID_COLUMN_COUNT } from 'app/core/constants';
import { DashboardPanel } from './DashboardPanel'; import { DashboardPanel } from './DashboardPanel';
@ -213,3 +214,5 @@ export class DashboardGrid extends React.Component<DashboardGridProps, any> {
); );
} }
} }
export default hot(module)(DashboardGrid);

View File

@ -1,4 +1,4 @@
import { react2AngularDirective } from 'app/core/utils/react2angular'; import { react2AngularDirective } from 'app/core/utils/react2angular';
import { DashboardGrid } from './DashboardGrid'; import DashboardGrid from './DashboardGrid';
react2AngularDirective('dashboardGrid', DashboardGrid, [['dashboard', { watchDepth: 'reference' }]]); react2AngularDirective('dashboardGrid', DashboardGrid, [['dashboard', { watchDepth: 'reference' }]]);

View File

@ -20,6 +20,7 @@ export interface EditorToolBarView {
interface State { interface State {
openView?: EditorToolBarView; openView?: EditorToolBarView;
isOpen: boolean;
fadeIn: boolean; fadeIn: boolean;
} }
@ -30,6 +31,7 @@ export class EditorTabBody extends PureComponent<Props, State> {
this.state = { this.state = {
openView: null, openView: null,
fadeIn: false, fadeIn: false,
isOpen: false,
}; };
} }
@ -39,12 +41,13 @@ export class EditorTabBody extends PureComponent<Props, State> {
onToggleToolBarView = (item: EditorToolBarView) => { onToggleToolBarView = (item: EditorToolBarView) => {
this.setState({ this.setState({
openView: item === this.state.openView ? null : item, openView: item,
isOpen: !this.state.isOpen,
}); });
}; };
onCloseOpenView = () => { onCloseOpenView = () => {
this.setState({ openView: null }); this.setState({ isOpen: false });
}; };
static getDerivedStateFromProps(props, state) { static getDerivedStateFromProps(props, state) {
@ -102,7 +105,7 @@ export class EditorTabBody extends PureComponent<Props, State> {
render() { render() {
const { children, toolbarItems, main, heading } = this.props; const { children, toolbarItems, main, heading } = this.props;
const { openView, fadeIn } = this.state; const { openView, fadeIn, isOpen } = this.state;
return ( return (
<> <>
@ -114,7 +117,7 @@ export class EditorTabBody extends PureComponent<Props, State> {
</div> </div>
<div className="panel-editor__scroll"> <div className="panel-editor__scroll">
<CustomScrollbar autoHide={false}> <CustomScrollbar autoHide={false}>
<FadeIn in={openView !== null} duration={200}> <FadeIn in={isOpen} duration={200}>
<div className="panel-editor__toolbar-view">{openView && this.renderOpenView(openView)}</div> <div className="panel-editor__toolbar-view">{openView && this.renderOpenView(openView)}</div>
</FadeIn> </FadeIn>
<div className="panel-editor__content"> <div className="panel-editor__content">

View File

@ -87,10 +87,10 @@ export class PanelEditor extends PureComponent<PanelEditorProps> {
return ( return (
<div className="panel-editor-container__editor"> <div className="panel-editor-container__editor">
<div className="panel-editor__close">
<i className="fa fa-arrow-left" />
</div>
{ {
// <div className="panel-editor__close">
// <i className="fa fa-arrow-left" />
// </div>
// <div className="panel-editor-resizer"> // <div className="panel-editor-resizer">
// <div className="panel-editor-resizer__handle"> // <div className="panel-editor-resizer__handle">
// <div className="panel-editor-resizer__handle-dots" /> // <div className="panel-editor-resizer__handle-dots" />

View File

@ -3,7 +3,13 @@
.panel-in-fullscreen { .panel-in-fullscreen {
.react-grid-layout { .react-grid-layout {
height: calc(100% - 20px) !important; height: 100% !important;
}
.dashboard-container--has-submenu {
.react-grid-layout {
height: calc(100% - 50px) !important;
}
} }
.react-grid-item { .react-grid-item {

View File

@ -3,10 +3,6 @@
width: 100%; width: 100%;
height: 100%; height: 100%;
box-sizing: border-box; box-sizing: border-box;
&--has-submenu {
height: calc(100% - 50px);
}
} }
.template-variable { .template-variable {

View File

@ -69,6 +69,12 @@ module.exports = merge(common, {
use: [ use: [
'style-loader', // creates style nodes from JS strings 'style-loader', // creates style nodes from JS strings
'css-loader', // translates CSS into CommonJS 'css-loader', // translates CSS into CommonJS
{
loader: 'postcss-loader',
options: {
config: { path: __dirname + '/postcss.config.js' },
},
},
'sass-loader', // compiles Sass to CSS 'sass-loader', // compiles Sass to CSS
], ],
}, },