Merge branch 'develop' of github.com:getinsomnia/insomnia into develop

This commit is contained in:
Gregory Schier
2019-04-23 10:55:06 -07:00
6 changed files with 1060 additions and 161 deletions

View File

@@ -22,6 +22,14 @@ class SidebarRequestGroupRow extends PureComponent {
this._requestGroupActionsDropdown = n;
}
_setExpandTagRef(n) {
this._expandTag = n;
}
getExpandTag() {
return this._expandTag;
}
_handleCollapse() {
const { requestGroup, handleSetRequestGroupCollapsed, isCollapsed } = this.props;
handleSetRequestGroupCollapsed(requestGroup._id, !isCollapsed);
@@ -78,6 +86,15 @@ class SidebarRequestGroupRow extends PureComponent {
<div className="sidebar__clickable">
<i className={'sidebar__item__icon fa ' + folderIconClass} />
<Highlight search={filter} text={requestGroup.name} />
<div
ref={this._setExpandTagRef}
className={classnames('sidebar__expand', {
'sidebar__expand-hint': isDraggingOver && isCollapsed,
})}>
<div className="tag tag--no-bg tag--small">
<span className="tag__inner">OPEN</span>
</div>
</div>
</div>
</button>,
),
@@ -181,6 +198,18 @@ function isAbove(monitor, component) {
return hoveredTop > draggedTop;
}
function isOnExpandTag(monitor, component) {
const rect = component.getExpandTag().getBoundingClientRect();
const pointer = monitor.getClientOffset();
return (
rect.left <= pointer.x &&
pointer.x <= rect.right &&
rect.top <= pointer.y &&
pointer.y <= rect.bottom
);
}
const dragTarget = {
drop(props, monitor, component) {
const movingDoc = monitor.getItem().requestGroup || monitor.getItem().request;
@@ -194,7 +223,10 @@ const dragTarget = {
}
},
hover(props, monitor, component) {
if (isAbove(monitor, component)) {
if (isOnExpandTag(monitor, component)) {
component.props.handleSetRequestGroupCollapsed(props.requestGroup._id, false);
component.setDragDirection(0);
} else if (isAbove(monitor, component)) {
component.setDragDirection(1);
} else {
component.setDragDirection(-1);

View File

@@ -26,7 +26,7 @@ class URLTag extends React.PureComponent<Props> {
return (
<div className={classnames('tag', { 'tag--small': small }, className)}>
<Tooltip message={url} position="bottom">
<Tooltip wide message={url} position="bottom">
<strong>{method || 'URL'}</strong> {shortUrl}
</Tooltip>
</div>

View File

@@ -279,7 +279,7 @@
.sidebar__clickable {
display: grid;
grid-template-columns: auto minmax(0, 1fr);
grid-template-columns: auto minmax(0, 1fr) auto;
align-items: center;
height: 100%;
@@ -333,6 +333,20 @@
padding-left: calc(@padding-sm + @padding-md * 6);
}
// ~~~~~~~~~~~~~~~ //
// Sidebar Expand //
// ~~~~~~~~~~~~~~~ //
.sidebar__expand {
display: none;
height: 100%;
&.sidebar__expand-hint {
display: flex;
align-items: center;
}
}
// ~~~~~~~~~~~~~~~ //
// Sidebar Actions //
// ~~~~~~~~~~~~~~~ //

View File

@@ -20,6 +20,7 @@
text-align: center;
z-index: 10;
white-space: normal !important;
word-wrap: break-word;
&.tooltip__bubble--visible {
opacity: 1;

View File

File diff suppressed because it is too large Load Diff

View File

@@ -450,6 +450,7 @@
"resolved": "https://registry.npmjs.org/boom/-/boom-0.4.2.tgz",
"integrity": "sha1-emNune1O/O+xnO9JR6PGffrukRs=",
"dev": true,
"optional": true,
"requires": {
"hoek": "0.9.x"
}
@@ -1823,7 +1824,8 @@
"version": "0.9.1",
"resolved": "https://registry.npmjs.org/hoek/-/hoek-0.9.1.tgz",
"integrity": "sha1-PTIkYrrfB3Fup+uFuviAec3c5QU=",
"dev": true
"dev": true,
"optional": true
},
"home-or-tmp": {
"version": "1.0.0",