Skip to content
This repository has been archived by the owner on Jun 3, 2018. It is now read-only.

Commit

Permalink
Improve workspace layout
Browse files Browse the repository at this point in the history
  • Loading branch information
lukasmartinelli committed Apr 16, 2016
1 parent 25e69ce commit ac61854
Show file tree
Hide file tree
Showing 8 changed files with 36 additions and 45 deletions.
3 changes: 2 additions & 1 deletion resources/scss/editor.scss
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
.CodeMirror {
font: 12px/20px normal Menlo, Droidsansmono, Bitstream Vera Sans Mono, Monaco, Consolas, monospace;
height: auto;
//height: 100%;
height: 300px;
}

.swatch {
Expand Down
1 change: 1 addition & 0 deletions resources/scss/main.scss
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ body {
@import "fonts";
@import "layout";
@import "forms";
@import "scrollbar";
@import "button";
@import "modal";
@import "workspace";
Expand Down
17 changes: 17 additions & 0 deletions resources/scss/scrollbar.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
::-webkit-scrollbar {
width: 8px;
background-color: rgba(0,0,0,0);
-webkit-border-radius: 100px;
}
::-webkit-scrollbar:hover {
background-color: rgba(0, 0, 0, 0.09);
}

::-webkit-scrollbar-thumb:vertical {
background: rgba(0,0,0,0.5);
-webkit-border-radius: 100px;
}
::-webkit-scrollbar-thumb:vertical:active {
background: rgba(0,0,0,0.61);
-webkit-border-radius: 100px;
}
20 changes: 0 additions & 20 deletions resources/scss/table.scss
Original file line number Diff line number Diff line change
Expand Up @@ -18,26 +18,6 @@ $table-bg-header-color: #222;
border-bottom: 1px solid $table-border-color;
}

.FlexTable {
::-webkit-scrollbar {
width: 8px;
background-color: rgba(0,0,0,0);
-webkit-border-radius: 100px;
}
::-webkit-scrollbar:hover {
background-color: rgba(0, 0, 0, 0.09);
}

::-webkit-scrollbar-thumb:vertical {
background: rgba(0,0,0,0.5);
-webkit-border-radius: 100px;
}
::-webkit-scrollbar-thumb:vertical:active {
background: rgba(0,0,0,0.61);
-webkit-border-radius: 100px;
}
}

.FlexTable__truncatedColumnText {
font-size: 12px;
line-height: 28px;
Expand Down
18 changes: 5 additions & 13 deletions resources/scss/workspace.scss
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
.workspace {
position: relative;
height: 100%;
display: flex;
flex-direction: column;
}

.workspace-header {
//background-color: darken($bg-color, 5%);
background-color: #404040;
}

Expand All @@ -14,22 +15,13 @@

.workspace-logs, .workspace-error {
background-color: #222;
padding: 1.5 * $pad;
}

.workspace-bottom {
position: absolute;
bottom: 0;
width: 100%;
padding: 0 8px;
line-height: 28px;
}

.workspace-table {
flex: 1;
width: 100%;
height: 400px;
}

.workspace-logs {
padding: 8px;
}

.workspace-error {
Expand Down
4 changes: 2 additions & 2 deletions src/database.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@ export class Database {
}

//TODO: Use promises instead of callback
//TODO: Deal with connection not set yet
var transformQuery = "select ST_AsGeoJSON(ST_Transform(geometry, 4326)) AS geom, t.* from (" + subquery + ") as t";
this.db.result(transformQuery, true).then((result) => {
dbgeo.parse({
Expand All @@ -26,7 +25,8 @@ export class Database {
"geometryColumn": "geom",
"geometryType": "geojson"
}, (err, geojson) => {
window.events.publish('query.success', `Display ${result.rowCount} rows`);
console.log(result);
window.events.publish('query.success', `${result.rowCount} rows in ${result.duration}ms`);
//TODO: This is solved some pattern somehow
cb(err, {
geojson: geojson,
Expand Down
4 changes: 3 additions & 1 deletion src/editor.js
Original file line number Diff line number Diff line change
Expand Up @@ -56,10 +56,12 @@ export class Editor extends React.Component {

render() {
const codeMirrorOptions = {
tabSize: 2,
lineNumbers: true,
lineWrapping: true,
mode: 'text/x-plsql',
theme: 'dracula',
viewportMargin: Infinity
//viewportMargin: Infinity
};

return <Codemirror value={this.state.code} onChange={this.updateCode} options={codeMirrorOptions} />;
Expand Down
14 changes: 6 additions & 8 deletions src/workspace.js
Original file line number Diff line number Diff line change
Expand Up @@ -54,16 +54,14 @@ export class Workspace extends React.Component {
<Toolbar db={this.db} />
</div>
{workspaceError}
<div className="workspace-editor">
<div className="workspace-editor">
<Editor db={this.db} />
</div>
<div className="workspace-bottom">
<div className="workspace-table">
<GeoJSONTable />
</div>
<div className="workspace-logs">
{this.state.message}
</div>
<div className="workspace-table">
<GeoJSONTable />
</div>
<div className="workspace-logs">
{this.state.message}
</div>
</div>;
}
Expand Down

0 comments on commit ac61854

Please sign in to comment.