Skip to content

Commit

Permalink
Merge branch 'master' into stable
Browse files Browse the repository at this point in the history
  • Loading branch information
jstejada committed Nov 7, 2016
2 parents 2fbd2f3 + 17e5087 commit 1c9f986
Show file tree
Hide file tree
Showing 12 changed files with 33 additions and 16 deletions.
2 changes: 1 addition & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# N1 Changelog

### 0.4.203 (11/7/16)
### 0.4.204 (11/7/16)

- Features:

Expand Down
2 changes: 1 addition & 1 deletion internal_packages/onboarding/lib/onboarding-store.es6
Original file line number Diff line number Diff line change
Expand Up @@ -189,7 +189,7 @@ class OnboardingStore extends NylasStore {
}
} catch (e) {
NylasEnv.reportError(e)
NylasEnv.showErrorDialog("Unable to Connect Accounts", "Sorry, something went wrong on your instance of the sync engine. Please try again.")
NylasEnv.showErrorDialog("Unable to Connect Accounts", `Sorry, something went wrong on your instance of the sync engine. Please try again. Detail: ${e.toString()}`)
}
}

Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "nylas",
"productName": "Nylas N1",
"version": "0.4.203",
"version": "0.4.204",
"description": "An extensible, open-source mail client built on the modern web.",
"license": "GPL-3.0",
"main": "./src/browser/main.js",
Expand Down
10 changes: 10 additions & 0 deletions spec/stores/draft-factory-spec.es6
Original file line number Diff line number Diff line change
Expand Up @@ -582,6 +582,16 @@ describe('DraftFactory', function draftFactory() {
});
});
});
['mailto', 'mail', ''].forEach((url) => {
it(`rejects gracefully on super mangled mailto link: ${url}`, () => {
waitsForPromise(() => {
return DraftFactory.createDraftForMailto(url).then(() => {
expect('resolved').toBe(false);
}).catch(() => {
});
});
});
});
});

describe("should correctly instantiate drafts for a wide range of mailto URLs", () => {
Expand Down
6 changes: 2 additions & 4 deletions spec/utils/date-utils-spec.es6
Original file line number Diff line number Diff line change
Expand Up @@ -150,24 +150,22 @@ describe('DateUtils', function dateUtils() {
describe('fullTimeString: 12-hour time', () => {
beforeEach(() => {
spyOn(NylasEnv.config, 'get').andReturn(false)
self.tz = moment.tz(moment.tz.guess()).zoneAbbr()
});

it('displays a date and time', () => {
const datestring = DateUtils.fullTimeString('1982-10-24 22:45')
expect(datestring).toBe(`Sunday, October 24th 1982, 10:45:00 PM ${self.tz}`)
expect(datestring.startsWith(`Sunday, October 24th 1982, 10:45:00 PM`)).toBe(true)
});
});

describe('fullTimeString: 24-hour time', () => {
beforeEach(() => {
spyOn(NylasEnv.config, 'get').andReturn(true)
self.tz = moment.tz(moment.tz.guess()).zoneAbbr()
});

it('displays a date and time', () => {
const datestring = DateUtils.fullTimeString('1982-10-24 22:45')
expect(datestring).toBe(`Sunday, October 24th 1982, 22:45:00 ${self.tz}`)
expect(datestring.startsWith(`Sunday, October 24th 1982, 22:45:00`)).toBe(true)
});
});
});
2 changes: 1 addition & 1 deletion src/browser/package-migration-manager.es6
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ const PACKAGE_MIGRATIONS = [
}],
},
{
"version": "0.4.200",
"version": "0.4.204",
"package-migrations": [{
"new-name": "nylas-private-salesforce",
"old-name": "nylas-private-salesforce",
Expand Down
6 changes: 3 additions & 3 deletions src/components/newsletter-signup.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ export default class NewsletterSignup extends React.Component {
this.setState(state);
}

_onGetStatus(props = this.props) {
_onGetStatus = (props = this.props) => {
this._setState({status: 'Pending'});
EdgehillAPI.makeRequest({
method: 'GET',
Expand All @@ -53,7 +53,7 @@ export default class NewsletterSignup extends React.Component {
});
}

_onSubscribe() {
_onSubscribe = () => {
this._setState({status: 'Pending'});
EdgehillAPI.makeRequest({
method: 'POST',
Expand All @@ -67,7 +67,7 @@ export default class NewsletterSignup extends React.Component {
});
}

_onUnsubscribe() {
_onUnsubscribe = () => {
this._setState({status: 'Pending'});
EdgehillAPI.makeRequest({
method: 'DELETE',
Expand Down
6 changes: 5 additions & 1 deletion src/flux/stores/draft-factory.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,11 @@ class DraftFactory
try
urlString = decodeURI(urlString)

[whole, to, queryString] = /mailto:\/*([^\?\&]*)((.|\n|\r)*)/.exec(urlString)
match = /mailto:\/*([^\?\&]*)((.|\n|\r)*)/.exec(urlString)
if not match
return Promise.reject(new Error("#{urlString} is not a valid mailto URL."))

[whole, to, queryString] = match

if to.length > 0 and to.indexOf('@') is -1
to = decodeURIComponent(to)
Expand Down
4 changes: 4 additions & 0 deletions src/flux/stores/draft-store.es6
Original file line number Diff line number Diff line change
Expand Up @@ -315,12 +315,16 @@ class DraftStore extends NylasStore {
}

_onHandleMailtoLink = (event, urlString) => {
// return is just used for specs
return DraftFactory.createDraftForMailto(urlString).then((draft) => {
return this._finalizeAndPersistNewMessage(draft, {popout: true});
}).catch((err) => {
NylasEnv.showErrorDialog(err.toString())
});
}

_onHandleMailFiles = (event, paths) => {
// return is just used for specs
return DraftFactory.createDraft().then((draft) => {
return this._finalizeAndPersistNewMessage(draft);
})
Expand Down
6 changes: 3 additions & 3 deletions src/flux/stores/file-download-store.es6
Original file line number Diff line number Diff line change
Expand Up @@ -277,10 +277,9 @@ class FileDownloadStore extends NylasStore {
}

const filePath = this.pathForFile(file)
const escapedPath = filePath.replace(/ /g, '\\ ')
const previewPath = `${filePath}.png`
return fs.accessAsync(filePath, fs.F_OK)
.then(() => {
const previewPath = `${filePath}.png`
fs.accessAsync(previewPath, fs.F_OK)
.then(() => {
// If the preview file already exists, set our state and bail
Expand All @@ -289,7 +288,8 @@ class FileDownloadStore extends NylasStore {
})
.catch(() => {
// If the preview file doesn't exist yet, generate it
const fileDir = path.dirname(filePath)
const fileDir = `"${path.dirname(filePath)}"`
const escapedPath = `"${filePath}"`
return new Promise((resolve) => {
const previewSize = THUMBNAIL_WIDTH * (11 / 8.5)
exec(`qlmanage -t -f ${window.devicePixelRatio} -s ${previewSize} -o ${fileDir} ${escapedPath}`, (error, stdout, stderr) => {
Expand Down
1 change: 1 addition & 0 deletions src/flux/stores/nylas-sync-status-store.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ Rx = require 'rx-lite'
AccountStore = require './account-store'
DatabaseStore = require('./database-store').default
NylasStore = require 'nylas-store'
NylasObservables = require 'nylas-observables'

ModelsForSync = [
'threads',
Expand Down
2 changes: 1 addition & 1 deletion src/regexp-utils.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -176,7 +176,7 @@ RegExpUtils =

illegalPathCharactersRegexp: ->
#https://msdn.microsoft.com/en-us/library/windows/desktop/aa365247(v=vs.85).aspx
/[\\\/:|?*><"]/g
/[\\\/:|?*><"#]/g

# https://regex101.com/r/nC0qL2/2
signatureRegex: ->
Expand Down

0 comments on commit 1c9f986

Please sign in to comment.