diff --git a/src/components/DataBrowserHeaderBar/DataBrowserHeaderBar.react.js b/src/components/DataBrowserHeaderBar/DataBrowserHeaderBar.react.js index 7eb5cd85da..b33bed826f 100644 --- a/src/components/DataBrowserHeaderBar/DataBrowserHeaderBar.react.js +++ b/src/components/DataBrowserHeaderBar/DataBrowserHeaderBar.react.js @@ -15,15 +15,16 @@ import { DragDropContext } from 'react-dnd'; @DragDropContext(HTML5Backend) export default class DataBrowserHeaderBar extends React.Component { render() { - let { headers, onResize, selected, selectAll, onAddColumn, updateOrdering, readonly, handleDragDrop } = this.props; + let { headers, onResize, selected, selectAll, onAddColumn, updateOrdering, readonly, handleDragDrop, minWidth } = this.props; let elements = [ // Note: bulk checkbox is disabled as all rows are selected (not just visible ones due to current lazy loading implementation) // TODO: add bulk checking only visible rows -
+
{readonly ? null : selectAll(e.target.checked)} />}
]; + headers.forEach(({ width, name, type, targetClass, order }, i) => { let wrapStyle = { width }; if (i % 2) { @@ -48,7 +49,7 @@ export default class DataBrowserHeaderBar extends React.Component { targetClass={targetClass} order={order} index={i} - moveDataBrowserHeader={this.props.handleDragDrop}/> + moveDataBrowserHeader={handleDragDrop}/>
); elements.push( @@ -62,7 +63,7 @@ export default class DataBrowserHeaderBar extends React.Component { } elements.push( readonly ? null : ( -
+
{elements}
; + return
{elements}
; } } diff --git a/src/components/DataBrowserHeaderBar/DataBrowserHeaderBar.scss b/src/components/DataBrowserHeaderBar/DataBrowserHeaderBar.scss index be4c3dc317..8f28d26049 100644 --- a/src/components/DataBrowserHeaderBar/DataBrowserHeaderBar.scss +++ b/src/components/DataBrowserHeaderBar/DataBrowserHeaderBar.scss @@ -12,10 +12,11 @@ top: 0; left: 0; height: 30px; - background: #66637a; + background-color: #66637a; white-space: nowrap; display: inline-block; min-width: 100%; + width: 100%; // to resolve rendering issue with retina displays -webkit-transform: translate3d(0,0,0); } @@ -48,6 +49,7 @@ } .check { + display: inline-block; line-height: 30px; height: 30px; vertical-align: top; diff --git a/src/dashboard/Data/Browser/Browser.scss b/src/dashboard/Data/Browser/Browser.scss index 7cf6b2a7de..0fabf8754f 100644 --- a/src/dashboard/Data/Browser/Browser.scss +++ b/src/dashboard/Data/Browser/Browser.scss @@ -22,6 +22,10 @@ &.safari { -webkit-transform: translate3d(0,0,0); } + + &.showAddRow { + bottom: 36px; + } } @media (max-width: 980px) { @@ -89,6 +93,7 @@ top: 30px; bottom: 0; left: 0; + width: 100%; min-width: 100%; overflow-y: auto; overflow-x: hidden; @@ -98,6 +103,15 @@ top: 126px; } +.rowsHolder { + position: absolute; + top: 0; + right:0; + bottom: 0; + left: 0; + width: 100%; +} + .tableRow { @include MonospaceFont; font-size: 12px; @@ -121,13 +135,15 @@ } .addRow { - height: 30px; + position: fixed; + left: 300px; + right: 0; + bottom: 0; + height: 36px; padding: 8px; - - a { - cursor: pointer; - display: inline-block; - } + display: inline-flex; + align-items: center; + border-top: 1px solid #ccc; svg { fill: $blue; @@ -136,6 +152,42 @@ fill: $darkBlue; } } + + a { + display: inline-flex; + justify-content: center; + align-items: center; + margin-right: 14px; + font-size: 12px; + font-weight: 700; + height: 24px; + padding: 0 10px; + border-radius: 2px; + border: 1px solid transparent; + } + + + .rowsHolder { + bottom: 60px; + } +} + +.addNewRow { + position: relative; + margin-bottom: 30px; + border-bottom: 1px solid #169CEE; + + &:before { + content: ''; + position: absolute; + left: 0; + right: 0; + bottom: -1px; + border-bottom: 2px solid #0092ff; + } + + + .rowsHolder { + position: relative; + } } .notification { diff --git a/src/dashboard/Data/Browser/BrowserTable.react.js b/src/dashboard/Data/Browser/BrowserTable.react.js index 98199624f2..95b697633d 100644 --- a/src/dashboard/Data/Browser/BrowserTable.react.js +++ b/src/dashboard/Data/Browser/BrowserTable.react.js @@ -87,7 +87,7 @@ export default class BrowserTable extends React.Component { let attributes = obj.attributes; let index = row - this.state.offset; return ( -
+
; + let classes = [styles.browser, browserUtils.isSafari() ? styles.safari : ''] + let addRow = null; + let rowWidth = 0; + if (this.props.data) { - let rowWidth = 210; + rowWidth = 210; for (let i = 0; i < this.props.order.length; i++) { rowWidth += this.props.order[i].width; } let newRow = null; if (this.props.newObject && this.state.offset <= 0) { newRow = ( -
+
{this.renderRow({ row: -1, obj: this.props.newObject, rowWidth: rowWidth })}
); @@ -238,47 +242,34 @@ export default class BrowserTable extends React.Component { } } - let addRow = null; - if (!this.props.newObject) { - if (this.props.relation) { - addRow = ( -
-
- ); - } else { - addRow = ( -
- - - -
- ); - } + if (!this.props.newObject && this.props.relation) { + classes.push(styles.showAddRow); + + addRow = ( +
+
+ ); } if (this.props.newObject || this.props.data.length > 0) { table = ( -
-
+
{newRow} - {rows} -
{addRow} +
+ {rows} +
{editor}
); @@ -309,7 +300,7 @@ export default class BrowserTable extends React.Component { } return ( -
+
{table} + onAddColumn={this.props.onAddColumn} + minWidth={rowWidth} />
); }