1297 Commits

Author SHA1 Message Date
Juan Cruz Viotti
6f7ea4e772 Convert hero-progress-button into an Angular directive 2016-03-30 15:46:48 -04:00
Juan Cruz Viotti
482b0a52ee Move title normalisation to desktop.css 2016-03-30 14:56:59 -04:00
Juan Cruz Viotti
abdee7fe10 Refactor tick as a scss component 2016-03-30 14:17:03 -04:00
Juan Cruz Viotti
5d52b19c2b Refactor hero-button as a scss component 2016-03-30 14:11:18 -04:00
Juan Cruz Viotti
01ec52f4d7 Refactor caption as a scss component 2016-03-30 14:02:03 -04:00
Juan Cruz Viotti
d47eaa8a2a Refactor badge as a scss component 2016-03-30 13:47:36 -04:00
Juan Cruz Viotti
f530dfcc3c Return to avoid any further code execution after an elevation error
Turns out that even by using `process.exit(1)`, the electron main
process doesn't exit instantly, but continues executing code.

This causes electron to throw on `electron.globalShortcut` because this
functionality is not available given that we didn't create a renderer
view.

Fixes: https://github.com/resin-io/etcher/issues/215
2016-03-25 09:41:30 -04:00
Juan Cruz Viotti
84b5117a93 Merge pull request #214 from resin-io/fix/error-dialog-analytics
Throw error after displaying it with dialog
2016-03-21 10:42:08 -04:00
Juan Cruz Viotti
3166dbe4a6 Throw error after displaying it with dialog
Currently, we "swallow" errors by only showing them with the "dialog"
module, causing them to not be logged to TrackJS.
2016-03-21 09:23:53 -04:00
Juan Cruz Viotti
ad082fc268 Configure TrackJS with userId
Otherwise, all we get in TrackJS are "anonymous" users, without a way to
link them to Mixpanel users.
2016-03-21 09:19:20 -04:00
Juan Cruz Viotti
fda6f8a6a5 Fix Cannot read property 'length' of undefined
This error was reported by TrackJS various times:

```
TypeError: Cannot read property 'length' of undefined
  at EventEmitter.<anonymous> (file:///Users/jviotti/Projects/resin/etcher/lib/browser/app.js:104:15)
  at emitOne (events.js:77:13)
  at EventEmitter.emit (events.js:169:7)
  at /Users/jviotti/Projects/resin/etcher/lib/browser/modules/drive-scanner.js:131:17
  at processQueue (/Users/jviotti/Projects/resin/etcher/node_modules/angular/angular.js:15616:28)
  at /Users/jviotti/Projects/resin/etcher/node_modules/angular/angular.js:15632:27
  at Scope.$eval (/Users/jviotti/Projects/resin/etcher/node_modules/angular/angular.js:16884:28)
  at Scope.$digest (/Users/jviotti/Projects/resin/etcher/node_modules/angular/angular.js:16700:31)
  at /Users/jviotti/Projects/resin/etcher/node_modules/angular/angular.js:16923:26
  at completeOutstandingRequest (/Users/jviotti/Projects/resin/etcher/node_modules/angular/angular.js:5825:10),
```

The error refers to the following line in `app.js`:

```js
if (drives.length === 1 && self.selection.hasImage()) {
```

Which indicates that the array of detected drives returned to the main
controller is `undefined` for some reason.

The problem resides in the `.scan()` method of `DriveScannerService`:

```js
this.scan = function() {
  return $q.when(drives.listRemovable()).catch(dialog.showError);
};
```

When an error is thrown when scanning the drives, the `.catch()` block
is called. This means that the error is not propagated to the outer code
and the promise resolves with `undefined`.

The solution is to move `.catch()` to the place `.scan()` is called,
instead of making use of it in the low-level parts of the process.
2016-03-17 09:36:43 -04:00
Juan Cruz Viotti
a40ad6fd54 Allow window to be dragged from anywhere
Fixes: https://github.com/resin-io/etcher/issues/191
2016-03-13 15:10:16 -04:00
Juan Cruz Viotti
dcdc7a18e2 Fix broken state when going to settings in the success screen 2016-03-10 17:15:57 -04:00
Juan Cruz Viotti
61b88c95e0 Merge pull request #203 from resin-io/refactor/controllers
Split controllers into separate files
2016-03-10 17:15:33 -04:00
Juan Cruz Viotti
cb43ec19dd Move NavigationController to a separate file 2016-03-10 15:44:33 -04:00
Juan Cruz Viotti
caea581589 Move SettingsController to settings module 2016-03-10 14:57:55 -04:00
Juan Cruz Viotti
673e82e530 Reuse SettingsController in success screen 2016-03-10 14:56:07 -04:00
Juan Cruz Viotti
3149f5af6d Move FinishController to a separate file 2016-03-10 14:52:08 -04:00
Juan Cruz Viotti
1ccf003487 Add "Getting Help" guide 2016-03-10 14:38:58 -04:00
Juan Cruz Viotti
e429a87d5a Move "Restart" event log to FinishController 2016-03-10 12:36:34 -04:00
Juan Cruz Viotti
9c5748b54e Reset burn state in FinishController 2016-03-10 12:05:28 -04:00
Juan Cruz Viotti
793001e133 Move burn state to ImageWriterService
Previously, the burn state lived in the controller, however if the user
moved to another page (the settings page for example) and then returned,
the progress state would be lost, leading to a broken progress bar.

Fixes: https://github.com/resin-io/etcher/issues/190
2016-03-10 12:01:22 -04:00
Juan Cruz Viotti
6367dd8a57 Implement NotifierService
This service provides an easy-to-use and safe (regarding to memory
leaks) way to emit data from services to controllers.

This component will be used in `ImageWriterService` to emit the progress
state instead of accepting an `onProgress` callback.
2016-03-10 12:01:22 -04:00
Juan Cruz Viotti
96e9fd23b7 Show size when there is a selected drive
It lets you be sure that the auto-selected drive is the one you intended
to write to.

Fixes: https://github.com/resin-io/etcher/issues/192
2016-03-10 09:04:27 -04:00
Juan Cruz Viotti
3af8c6dd49 Make use of package.json display name to reference the app
Our `package.json` contains a custom `displayName` property which equals
"Etcher" at the time of this writing.

This PR makes use of this property directly instead of hardcoding
"Etcher" in some places.
2016-03-09 09:25:25 -04:00
Juan Cruz Viotti
fdcc5d6b71 Stop scanner interval before starting a new one
This ensures there are no orphaned intervals running.
2016-03-08 16:19:48 -04:00
Juan Cruz Viotti
a5322950da Add support for zip images in select image dialog
The "Select Image" dialog now permits the user selecting zip files. Once
the zip file is selected, `resin-zip-image` scans the archive to ensure
its validity. If its not valid, an error alert is shown and nothing is
selected.
2016-03-07 12:14:05 -04:00
Juan Cruz Viotti
3e352d4224 Avoid analytics and logging if dialog resolves no file
This will be the case when the dialog accepts zip files. If the selected
zip image is invalid, the module will display an error and resolve
`undefined`.
2016-03-07 10:19:36 -04:00
Juan Cruz Viotti
e5ddb2f2cb Make writer.getImageStream() extract images from zip archives 2016-03-07 09:20:58 -04:00
Juan Cruz Viotti
67312af3d8 Add *.zip to supported files label 2016-03-07 08:45:21 -04:00
Juan Cruz Viotti
334eebe9c9 Implement "Need Help?" button
This button guides the user to publish a new issue in the GitHub
repository.

Fixes: https://github.com/resin-io/etcher/issues/177
2016-03-02 12:32:01 -04:00
Juan Cruz Viotti
bd009a75b0 Expose shell.openExternal in NavigationController
`.open()` was previously exposed in the `AppController`, however after
the router refactoring, this controller is no longer instantiated on the
footer, and therefore the links that live there stopped working.
2016-03-02 12:28:42 -04:00
Juan Cruz Viotti
9f4b793c8d Add a setting to disable auto-unmount on success 2016-03-02 12:06:33 -04:00
Juan Cruz Viotti
64c27235bf Make use of UI Router 2016-03-01 19:50:25 -04:00
Juan Cruz Viotti
f208d2e34d Make use of settings to prevent tracking in analytics module
`SettingsService` is injected manually using `$injector` to a void a
circular dependency over `$rootScope` by `$localStorage`.
2016-03-01 12:55:15 -04:00
Juan Cruz Viotti
61a1527c7e Implement settings screen 2016-03-01 12:22:03 -04:00
Juan Cruz Viotti
ff2a375179 Fix slighly checkbox vertical alignment issue 2016-03-01 11:33:21 -04:00
Juan Cruz Viotti
a871d19ef7 Only apply necessary margins in spacing module 2016-03-01 11:23:41 -04:00
Juan Cruz Viotti
75f22c0209 Implement AnalyticsService.logEvent() 2016-03-01 09:38:43 -04:00
Juan Cruz Viotti
1d75ec02aa Include TrackJS Angular module in Analytics module 2016-02-29 15:54:21 -04:00
Juan Cruz Viotti
1c6675ab4f Integrate Mixpanel 2016-02-29 15:52:00 -04:00
Juan Cruz Viotti
9aac1cd4be Show progress bar in dock/taskbar 2016-02-29 14:00:55 -04:00
Juan Cruz Viotti
8a88f27015 Configure TrackJS application property 2016-02-16 09:37:53 -04:00
Juan Cruz Viotti
c0e8618813 Upgrade sudo-prompt to v2.2.0
This version contains a fix to allow the module to run on `asar`
packages.
2016-02-09 08:55:16 -04:00
Juan Cruz Viotti
efb2c4c911 Merge pull request #150 from resin-io/refactor/unify-elevation-error-handling
Unify handling of elevation errors in etcher.js
2016-02-08 14:39:43 -04:00
Juan Cruz Viotti
611be46177 Unify handling of elevation errors in etcher.js 2016-02-08 14:31:45 -04:00
Juan Cruz Viotti
feb04f8773 Downgrade sudo-prompt to v1.1.8
Later versions make use of shell commands over the internal contents of
the module causing errors when the application is packaged as an
`asar`.

This issue is being fixed here: https://github.com/jorangreef/sudo-prompt/issues/10
2016-02-08 14:28:49 -04:00
Juan Cruz Viotti
7949853086 Refer to Etcher instead of Resin Etcher 2016-02-08 13:04:54 -04:00
Juan Cruz Viotti
e91db955b5 Show error dialogs on elevation errors
Printing to `stderr` makes no sense since the process is detached from
the shell when packaged.
2016-02-08 09:53:49 -04:00
Juan Cruz Viotti
ac2fb8b0a9 Merge pull request #143 from resin-io/feat/74/burn-another-design
Improve "Burn another" screen design
2016-02-05 12:57:49 -04:00