Merge branch 'master' into develop

This commit is contained in:
Gregory Schier 2017-05-24 10:28:05 -07:00
commit 412cc537d3
12 changed files with 105 additions and 86 deletions

View File

@ -8,11 +8,13 @@ build: off
shallow_clone: true
platform: x64
environment:
nodejs_version: "7.4.0"
NODEJS_VERSION: "7.4.0"
CSC_LINK: '%WINDOWS_CSC_LINK%'
CSC_KEY_PASSWORD: '%WINDOWS_CSC_KEY_PASSWORD%'
# Things to install after repo clone
install:
- ps: Install-Product node $env:nodejs_version $env:Platform
- ps: Install-Product node $env:NODEJS_VERSION $env:Platform
- npm install -g npm@latest > Nul
- npm config set msvs_version 2013
- npm install > NUL

View File

@ -5,8 +5,9 @@ process easy and effective for everyone involved.
## Using the issue tracker
The [issue tracker](/issues) is the preferred channel for [bug reports](#bug-reports),
[features requests](#feature-requests) and [submitting pull requests](#pull-requests).
[GitHub Issues](https://github.com/getinsomnia/insomnia/issues) is the preferred channel
for [bug reports](#bug-reports), [features requests](#feature-requests)
and [submitting pull requests](#pull-requests).
Please respect the following restrictions:

View File

@ -136,7 +136,7 @@ export const AUTH_NTLM = 'ntlm';
const authTypesMap = {
[AUTH_BASIC]: ['Basic', 'Basic Auth'],
[AUTH_DIGEST]: ['Digest', 'Digest Auth'],
[AUTH_NTLM]: ['NTML', 'Microsoft NTML'],
[AUTH_NTLM]: ['NTLM', 'Microsoft NTLM'],
[AUTH_OAUTH_1]: ['OAuth 1', 'OAuth 1.0'],
[AUTH_OAUTH_2]: ['OAuth 2', 'OAuth 2.0']
};

View File

@ -3,7 +3,7 @@ import electron from 'electron';
import {isDevelopment, isMac} from './common/constants';
import * as errorHandling from './main/error-handling';
import * as updates from './main/updates';
import {createWindow} from './main/window-utils';
import * as windowUtils from './main/window-utils';
// Handle potential auto-update
if (needsRestart) {
@ -13,6 +13,7 @@ if (needsRestart) {
// Initialize some things
errorHandling.init();
updates.init();
windowUtils.init();
function addUrlToOpen (e, url) {
e.preventDefault();
@ -43,7 +44,7 @@ app.on('activate', (e, hasVisibleWindows) => {
// Create a new window when clicking the doc icon if there isn't one open
if (!hasVisibleWindows) {
try {
createWindow();
windowUtils.createWindow();
} catch (e) {
// This might happen if 'ready' hasn't fired yet. So we're just going
// to silence these errors.
@ -55,7 +56,7 @@ app.on('activate', (e, hasVisibleWindows) => {
// When the app is first launched
app.on('ready', () => {
app.removeListener('open-url', addUrlToOpen);
const window = createWindow();
const window = windowUtils.createWindow();
// Handle URLs sent via command line args
ipcMain.once('app-ready', () => {

View File

@ -59,12 +59,11 @@ function _checkForUpdates () {
return;
}
if (!isLinux()) {
if (!isLinux() && !isDevelopment()) {
try {
autoUpdater.setFeedURL(UPDATE_URLS[process.platform]);
autoUpdater.checkForUpdates();
} catch (err) {
// This will fail in development
console.warn('[updater] Failed to check for updates:', err.message);
}
}

View File

@ -9,6 +9,11 @@ const {app, Menu, BrowserWindow, shell, dialog} = electron;
let mainWindow = null;
let localStorage = null;
export function init () {
initLocalStorage();
initContextMenus();
}
export function createWindow () {
const zoomFactor = getZoomFactor();
const {bounds, fullscreen} = getBounds();
@ -270,8 +275,6 @@ export function createWindow () {
Menu.setApplicationMenu(Menu.buildFromTemplate(template));
require('electron-context-menu')({});
return mainWindow;
}
@ -351,4 +354,6 @@ function initLocalStorage () {
localStorage = new LocalStorage(localStoragePath);
}
initLocalStorage();
function initContextMenus () {
require('electron-context-menu')({});
}

View File

@ -1,7 +1,7 @@
{
"private": true,
"name": "insomnia",
"version": "5.0.20",
"version": "5.1.0",
"productName": "Insomnia",
"longName": "Insomnia REST Client",
"description": "Debug APIs like a human, not a robot",

View File

@ -23,9 +23,9 @@ export default class NowExtension extends BaseExtension {
label: 'Timestamp Format',
type: 'enum',
options: [
{name: 'ISO-8601', value: 'iso-8601'},
{name: 'Milliseconds', value: 'millis'},
{name: 'Unix Timestamp', value: 'unix'},
{name: 'ISO-8601 Format', value: 'iso-8601'}
{name: 'Unix', value: 'unix'}
]
}];
}

View File

@ -232,7 +232,8 @@ async function _updateElementText (render, mark, text) {
const firstArg = tagDefinition.args[0];
if (firstArg && firstArg.type === 'enum') {
const argData = tagData.args[0];
const option = firstArg.options.find(d => d.value === argData.value);
const foundOption = firstArg.options.find(d => d.value === argData.value);
const option = foundOption || firstArg.options[0];
el.innerHTML = `<label></label>${tagDefinition.displayName} &rArr; ${option.name}`;
} else {
el.innerHTML = `<label></label>${tagData.name}`;
@ -254,6 +255,9 @@ async function _updateElementText (render, mark, text) {
const fullMessage = err.message.replace(/\[.+,.+]\s*/, '');
let message = fullMessage;
const label = el.querySelector('label');
if (!label) {
console.log(el);
}
label.innerHTML = `<i class="fa fa-exclamation-triangle"></i>${label.innerHTML}`;
el.title = message;
el.setAttribute('data-error', 'on');

View File

@ -211,8 +211,12 @@ class WorkspaceSettingsModal extends PureComponent {
You have not yet added any certificates
</p>
) : workspace.certificates.map(certificate => (
<div key={certificate.host} className="row-spaced">
<div>
<div>
<p className="notice info no-margin-top">
Client certificates are an experimental feature
</p>
<div key={certificate.host} className="row-spaced">
<div>
<span className="pad-right no-wrap">
<strong>PFX:</strong>
{' '}
@ -221,51 +225,52 @@ class WorkspaceSettingsModal extends PureComponent {
: <i className="fa fa-remove"/>
}
</span>
<span className="pad-right no-wrap">
<span className="pad-right no-wrap">
<strong>CRT:</strong>
{' '}
{certificate.cert
? <i className="fa fa-check"/>
: <i className="fa fa-remove"/>
}
{' '}
{certificate.cert
? <i className="fa fa-check"/>
: <i className="fa fa-remove"/>
}
</span>
<span className="pad-right no-wrap">
<span className="pad-right no-wrap">
<strong>Key:</strong>
{' '}
{certificate.key
? <i className="fa fa-check"/>
: <i className="fa fa-remove"/>
}
{' '}
{certificate.key
? <i className="fa fa-check"/>
: <i className="fa fa-remove"/>
}
</span>
<span className="pad-right no-wrap" title={certificate.passphrase || null}>
<span className="pad-right no-wrap" title={certificate.passphrase || null}>
<strong>Passphrase:</strong>
{' '}
{certificate.passphrase
? <i className="fa fa-check"/>
: <i className="fa fa-remove"/>
}
{' '}
{certificate.passphrase
? <i className="fa fa-check"/>
: <i className="fa fa-remove"/>
}
</span>
<span className="pad-right">
<span className="pad-right">
<strong>Host:</strong>
{' '}
<span className="monospace selectable">{certificate.host}</span>
{' '}
<span className="monospace selectable">{certificate.host}</span>
</span>
</div>
<div className="no-wrap">
<button className="btn btn--super-compact width-auto"
title="Enable or disable certificate"
onClick={() => this._handleToggleCertificate(certificate)}>
{certificate.disabled
? <i className="fa fa-square-o"/>
: <i className="fa fa-check-square-o"/>
}
</button>
<PromptButton className="btn btn--super-compact width-auto"
confirmMessage=" "
addIcon
onClick={() => this._handleDeleteCertificate(certificate)}>
<i className="fa fa-trash-o"></i>
</PromptButton>
</div>
<div className="no-wrap">
<button className="btn btn--super-compact width-auto"
title="Enable or disable certificate"
onClick={() => this._handleToggleCertificate(certificate)}>
{certificate.disabled
? <i className="fa fa-square-o"/>
: <i className="fa fa-check-square-o"/>
}
</button>
<PromptButton className="btn btn--super-compact width-auto"
confirmMessage=" "
addIcon
onClick={() => this._handleDeleteCertificate(certificate)}>
<i className="fa fa-trash-o"></i>
</PromptButton>
</div>
</div>
</div>
))}

View File

@ -563,10 +563,11 @@ class App extends PureComponent {
}
_handleToggleMenuBar (hide) {
let win = remote.BrowserWindow.getFocusedWindow();
if (win.isMenuBarAutoHide() === hide) {
win.setAutoHideMenuBar(hide);
win.setMenuBarVisibility(!hide);
for (const win of remote.BrowserWindow.getAllWindows()) {
if (win.isMenuBarAutoHide() !== hide) {
win.setAutoHideMenuBar(hide);
win.setMenuBarVisibility(!hide);
}
}
}

View File

@ -1,46 +1,47 @@
/* Padding */
@padding-md: 1.2rem;
@padding-sm: 0.6rem;
@padding-xs: 0.4rem;
@padding-xxs: 0.2rem;
@padding-lg: 2.5rem;
@padding-xl: 5rem;
/* Fonts */
@font-size: 13px;
@font-size-xs: 0.8rem;
@font-size-sm: 0.9rem;
@font-size-md: 1.0rem;
@font-size-lg: 1.2rem;
@font-size-xl: 1.35rem;
@font-size-xxl: 1.5rem;
@font-size-xxxl: 1.7rem;
@font-size-xs: round(@font-size * 0.8);
@font-size-sm: round(@font-size * 0.9);
@font-size-md: round(@font-size * 1.0);
@font-size-lg: round(@font-size * 1.2);
@font-size-xl: round(@font-size * 1.35);
@font-size-xxl: round(@font-size * 1.5);
@font-size-xxxl: round(@font-size * 1.7);
/* Padding */
@padding-md: round(@font-size * 1.2);
@padding-sm: round(@font-size * 0.6);
@padding-xs: round(@font-size * 0.4);
@padding-xxs: round(@font-size * 0.2);
@padding-lg: round(@font-size * 2.5);
@padding-xl: round(@font-size * 5);
/* Wrapper */
@line-height-md: 3.6rem;
@line-height-sm: @line-height-md * 0.8;
@line-height-xs: @line-height-sm * 0.85;
@line-height-xxs: @line-height-xs * 0.85;
@line-height-md: round(@font-size * 3.6);
@line-height-sm: round(@line-height-md * 0.8);
@line-height-xs: round(@line-height-sm * 0.85);
@line-height-xxs: round(@line-height-xs * 0.85);
/* Nav */
@height-nav: @line-height-md;
/* Scrollbars */
@scrollbar-width: 0.75rem;
@scrollbar-width: round(@font-size * 0.75);
/* Borders */
@radius-sm: 0.2rem;
@radius-md: 0.3rem;
@radius-sm: round(@font-size * 0.2);
@radius-md: round(@font-size * 0.3);
/* Dropdowns */
@dropdown-min-width: 12rem;
@dropdown-min-width: round(@font-size * 12);
/* Modals */
@modal-width: 50rem;
@modal-width-wide: 70rem;
@modal-width: round(@font-size * 50);
@modal-width-wide: round(@font-size * 70);
/* Other */
@drag-width: 0.5em;
@drag-width: round(@font-size * 0.5);
/* Breakpoints */
@breakpoint-lg: 1100px;