This new version reports the size as a number of bytes instead of a
human readable string, so we have to take care of converting back to a
readable GB format ourselves.
Signed-off-by: Juan Cruz Viotti <jviottidc@gmail.com>
This refactoring will be useful on future changes, where there will be
a single application entry point that will execute the CLI or the GUI
version depending on the environment.
Signed-off-by: Juan Cruz Viotti <jviottidc@gmail.com>
* Upgrade Electron to v0.37.6
The main motiviation for such upgrade is that an error manifesting
itself as `Cannot read property 'object' of undefined` on certain Linux
systems was fixed in v0.37.4.
See https://github.com/electron/electron/issues/5229
Signed-off-by: Juan Cruz Viotti <jviottidc@gmail.com>
* Make use of shell module by requiring `shell`
Otherwise we get a strange issue when trying to stub it:
TypeError: Attempted to wrap undefined property openExternal as function
Signed-off-by: Juan Cruz Viotti <jviottidc@gmail.com>
The current "Close" button makes it confusing to the user to know if
he's accepting his changes, or just discarding them.
The "Close" button in the top right corner was replaced with a standard
cross icon, and there is a new "Continue" block button fixed in the
bottom of the modal.
Fixes: https://github.com/resin-io/etcher/issues/294
Signed-off-by: Juan Cruz Viotti <jviottidc@gmail.com>
* Implement ManifestBind directive
This directive is useful to bind the contents of an element to a
property in the `package.json` manifest.
Signed-off-by: Juan Cruz Viotti <jviottidc@gmail.com>
* Add application version to footer
Fixes: https://github.com/resin-io/etcher/issues/292
Signed-off-by: Juan Cruz Viotti <jviottidc@gmail.com>
* Inherit current scope in osOpenExternal directive
This directive attempts to create a new isolated scope, which leads the
errors when using this directive on top of another directive in the same
element.
Signed-off-by: Juan Cruz Viotti <jviottidc@gmail.com>
* Implement SVGIcon Angular directive
This directive replaces part of `hero-icon`, the old Polymer component.
Signed-off-by: Juan Cruz Viotti <jviottidc@gmail.com>
- Rename `Etcher.Utils.Dropzone` to `Etcher.OS.Dropzone`
- Rename `Etcher.Utils.OpenExternal` to `Etcher.OS.OpenExternal`
- Rename `Etcher.Utils.WindowProgress` to `Etcher.OS.WindowProgress`
- Rename `Etcher.notification` to `Etcher.OS.Notification`
- Rename `Etcher.notifier` to `Etcher.Utils.Notifier`
- Rename `Etcher.path` to `Etcher.Utils.Path`
Signed-off-by: Juan Cruz Viotti <jviottidc@gmail.com>
Previously, `DriveSelector` kept a temporary selection state until the
modal was closed, which caused the selected drives to be passed to
`SelectionStateModel`.
This proves to be problematic when attempting to pass changes to
`SelectionStateModel` to `DriveSelector`. For example, consider the case
where the `DriveSelector` modal is opened with two drives, and one is
ejected. The remaining drive will be auto-selected by Etcher in the
background, but `DriveSelector` will not update itself with such change.
Fixes: https://github.com/resin-io/etcher/issues/304
Signed-off-by: Juan Cruz Viotti <jviottidc@gmail.com>
Suppose you plug a device, select it in Etcher, but then eject it from
your computer. Etcher will keep the selection thinking the drive is
still there.
With this PR, the selected drive, if any, is ensured its still inside
the array of available drives, otherwise the selected is cleared.
Fixes: https://github.com/resin-io/etcher/issues/254
Signed-off-by: Juan Cruz Viotti <jviottidc@gmail.com>
Electron's `shell.openExternal()` fails on GNU/Linux when Electron is
ran with `sudo`. The issue was reported, and this is a workaround until
its fixed on the Electron side.
`node-open` is smart enough to check the `$SUDO_USER` environment
variable and to prepend `sudo -u <user>` if needed.
We keep `shell.openExternal()` for OSes other than Linux since we intend
to fully rely on it when the issue is fixed, and since its closer
integration with the operating system might lead to more accurate
results than a third party NPM module.
See https://github.com/electron/electron/issues/5039
Signed-off-by: Juan Cruz Viotti <jviottidc@gmail.com>
The following error is thrown if the open file dialog is cancelled
without any selection:
Unhandled rejection TypeError: Cannot read property '0' of undefined
at Number.indexedGetter (/home/parallels/Projects/etcher/node_modules/bluebird/js/release/call_get.js:106:15)
at Number.tryCatcher (/home/parallels/Projects/etcher/node_modules/bluebird/js/release/util.js:16:23)
at Promise._settlePromiseFromHandler (/home/parallels/Projects/etcher/node_modules/bluebird/js/release/promise.js:503:31)
at Promise._settlePromise (/home/parallels/Projects/etcher/node_modules/bluebird/js/release/promise.js:560:18)
at Promise._settlePromise0 (/home/parallels/Projects/etcher/node_modules/bluebird/js/release/promise.js:605:10)
at Promise._settlePromises (/home/parallels/Projects/etcher/node_modules/bluebird/js/release/promise.js:684:18)
at Async._drainQueue (/home/parallels/Projects/etcher/node_modules/bluebird/js/release/async.js:126:16)
at Async._drainQueues (/home/parallels/Projects/etcher/node_modules/bluebird/js/release/async.js:136:10)
at Immediate.Async.drainQueues [as _onImmediate] (/home/parallels/Projects/etcher/node_modules/bluebird/js/release/async.js:16:14)
at processImmediate [as _immediateCallback] (timers.js:383:17)
Signed-off-by: Juan Cruz Viotti <jviottidc@gmail.com>
This directives will be used in the header navigation instead of
re-using this logic from the `NavigationController`.
A consequence of this change is that `NavigationController` is no longer
needed, and therefore is removed.
This modal provides a more advanced way to select a drive. It prevents
certain issues the dropdown was having, like the contents overflowing
when there were many connected drives.
Fixes: https://github.com/resin-io/etcher/issues/202
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
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.
This screen informs the user that the burn has completed and that the
drive can be ejected directly.
It also provides a button to burn another image without exitting the
application.
Fixes: https://github.com/resin-io/herostratus/issues/41