* 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>
This new version contains a fix for the `stream.push() after EOF` error
hit when writing unaligned images.
Fixes: https://github.com/resin-io/etcher/issues/307
Signed-off-by: Juan Cruz Viotti <jviottidc@gmail.com>
Not doing so leads the writer state to have a `progress` of `100%`,
while `isFlashing()` is `false`, which is an inconsistent state.
Fixes: https://github.com/resin-io/etcher/issues/327
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>
Currently, if you have only one connected drive, Etcher will auto-select
it. One the single drive is auto-selected, if you attempt to change your
drive selection by clicking on the "Change" link button, the
re-selection is undone, and redone in a matter of milliseconds, making
it very difficult to get the drive selector modal to open.
A simple solution to this problem is making "Change" links trigger the
reselection action (e.g: opening modals, dialogs, etc) instead of simply
undoing the selection.
Fixes: https://github.com/resin-io/etcher/issues/296
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>
If you have the drive selector modal opened, but you eject all the
available drives, the modal will be closed automatically.
Fixes: https://github.com/resin-io/etcher/issues/295
Signed-off-by: Juan Cruz Viotti <jviottidc@gmail.com>
Its helpful to have an auditive/visual cue when a burn operation
completed.
Instead of adding a setting entry to enable/disable notifications, you
can use the standard way to control notifications from your operating
system. For example, in OS X, you might go to "System Preferences" ->
"Notifications" and disable notifications for "Etcher".
Fixes: https://github.com/resin-io/etcher/issues/280
Signed-off-by: Juan Cruz Viotti <jviottidc@gmail.com>
If the function lacks a message or a title, the following error is
thrown:
Error: Could not call remote function ``.
Check that the function signature is correct.
Underlying error: Error processing argument at index 0,
conversion failure from undefined
Signed-off-by: Juan Cruz Viotti <jviottidc@gmail.com>
This version contains the following changes:
- Detect Macbook SDCard readers in OS X.
- Detect removable drives better in Windows.
- Keep one decimal in Windows drive size.
Fixes: https://github.com/resin-io/etcher/issues/255
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>
UI Bootstrap adds the `.modal-open` class to the `<body>`
element and sets its right padding to the width of the
window, causing the window content to overflow and get
pushed to the bottom.
The `!important` flag is needed since UI Bootstrap inlines
the styles programatically to the element.
Fixes: https://github.com/resin-io/etcher/issues/257
Signed-off-by: Juan Cruz Viotti <jviottidc@gmail.com>
The `name` property equals the drive letter in Windows, and the mount
point in UNIX based operating systems.
Fixes: https://github.com/resin-io/etcher/issues/258
Signed-off-by: Juan Cruz Viotti <jviottidc@gmail.com>
This PR fixes a frequent issue users were having where opening
`Etcher.app` would result in:
"Etcher.app" is damaged and can't be opened. You should move it to
the trash.
Checking the code-signature of the application returned the following
error message:
$ spctl -a -v Etcher.app
Etcher.app: invalid signature (code or signature have been modified)
The solution is based on the following paragraphs from Apple's "OS X
Code Signing in Depth" technical note:
https://developer.apple.com/library/mac/technotes/tn2206/_index.html
> Code signing uses extended attributes to store signatures in non-Mach-O
> executables such as script files. If the extended attributes are lost
> then the program's identity will be broken. Thus, when you ship your
> script, you must use a mechanism that preserves extended attributes.
>
> One way to guarantee preservation of extended attributes is by packing
> up your signed code in a read-write disk image (DMG) file before signing
> and then, after signing, converting to read-only. You probably don't
> need to use a disk image until the final package stage so another less
> heavy-handed method would be to use ZIP or XIP files.
In summary, what we now do is:
- Create a temporal read-write DMG image.
- Perform the code-signing *inside* the DMG image.
- Convert the temporal DMG image into a compressed read-only image.
Sadly, this custom workflow doesn't fit in `electron-packager` nor
`electron-builder`, so we had to re-implement the features those
packages provide us in a nice encapsulated way ourselves.
Signed-off-by: Juan Cruz Viotti <jviottidc@gmail.com>
* Extend ProgressButton to support a striped progress bar
This feature will be used to implement the burn validation step.
* Implement alert-ribbon CSS component
This component will be used to inform an error situation to the user
during the burn/check processes.
* Add "Enable write validation on success" setting
* Implement write validation support
Signed-off-by: Juan Cruz Viotti <jviottidc@gmail.com>
Fixes: https://github.com/resin-io/etcher/issues/45
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>
Its hard to attempt to debug or reproduce an issue if we don't know the
version the user is running.
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>
From the documentation:
> `useContentSize` Boolean - The `width` and `height` would be used as web
> page’s size, which means the actual window’s size will include window
> frame’s size and be slightly larger. Default is `false`.
The original issue is that when you specify a width/height, the actual
size that you get is slighly smaller, since the OS title bar is included
in the size you provide.
By using the `useContentSize` option, we ensure the `WebView` gets the
intended size, no matter the title bar.
This PR invalidates: https://github.com/resin-io/etcher/pull/244
Signed-off-by: Juan Cruz Viotti <jviottidc@gmail.com>
On Electron, the user can click and press over a button,
then move the mouse away from the button and release,
and the button will erroneusly keep the `:focus` state style.
The current workaround consists of:
- Iterate through all the Bootstrap button styles.
- Set the default 'background', `color` and `border-color` to match the
style of the normal state.
Signed-off-by: Juan Cruz Viotti <jviottidc@gmail.com>