More Terminal-UI and code post review fixes.

This commit is contained in:
Simon Howe
2015-12-10 19:43:46 +01:00
parent e0ff3e3ddd
commit 921a7b723f
6 changed files with 15 additions and 23 deletions
-1
View File
@@ -35,7 +35,6 @@ function getStateFromStores() {
topologiesLoaded: AppStore.isTopologiesLoaded(),
version: AppStore.getVersion(),
websocketClosed: AppStore.isWebsocketClosed()
};
}
@@ -4,10 +4,6 @@ import AppStore from '../stores/app-store';
import Terminal from './terminal';
import { receiveControlPipeFromParams } from '../actions/app-actions';
export function shouldLaunchTerminal() {
return window.location.hash.indexOf('#!/terminal/') === 0;
}
function getStateFromStores() {
return {
controlPipe: AppStore.getControlPipe()
+3 -3
View File
@@ -198,7 +198,7 @@ export default class Terminal extends React.Component {
ev.preventDefault();
const paramString = JSON.stringify(this.props);
clickCloseTerminal(this.getPipeId());
openNewWindow(`/terminal.html#!/state/${paramString}`);
openNewWindow(`terminal.html#!/state/${paramString}`);
}
handleResize() {
@@ -247,8 +247,8 @@ export default class Terminal extends React.Component {
<div>
<h3>Connection Closed</h3>
<p>
The connection to this container has been closed. <span
className="link" onClick={this.handleCloseClick}>Close terminal.</span>
The connection to this container has been closed.
<div className="link" onClick={this.handleCloseClick}>Close terminal</div>
</p>
</div>
);
-1
View File
@@ -1,4 +1,3 @@
require('font-awesome-webpack');
require('../styles/main.less');
import React from 'react';
+6 -9
View File
@@ -3,16 +3,13 @@ import page from 'page';
import { route } from '../actions/app-actions';
import AppStore from '../stores/app-store';
//
// TODO: move this logic somewhere else.
//
function shouldReplaceState(prevState, nextState) {
return (
// Opening a new terminal while an existing one is open.
(prevState.controlPipe && nextState.controlPipe) ||
// Closing a terminal.
(prevState.controlPipe && !nextState.controlPipe)
);
// Opening a new terminal while an existing one is open.
const terminalToTerminal = (prevState.controlPipe && nextState.controlPipe);
// Closing a terminal.
const closingTheTerminal = (prevState.controlPipe && !nextState.controlPipe);
return terminalToTerminal || closingTheTerminal;
}
export function updateRoute() {
+6 -5
View File
@@ -61,11 +61,6 @@
transition-delay: .5s;
}
.link {
text-decoration: underline;
cursor: pointer;
}
.hide {
opacity: 0;
}
@@ -652,6 +647,12 @@ h2 {
margin: 4px 0;
color: @white;
}
.link {
text-transform: uppercase;
font-weight: bold;
cursor: pointer;
float: right;
}
}
&-cursor {