We make the nil-checking of store state fields generic through a
`verifyNoNilFields` function that throws an error if any fields are
nil.
Change-Type: patch
Changelog-Entry: Consolidate store state nil-checking with helper
function.
We separate the SVG component path and content into attributes
`paths` and `contents` which take lists of strings that are
tried until one succeeds. `contents` takes precedence over `paths`,
i.e. it is tried first.
Change-Type: patch
Changelog-Entry: Separate SVG component's path and content attributes.
We warn the user when they select a large drive to confirm they want to
flash in case the device is important.
Fixes: https://github.com/resin-io/etcher/issues/1916
Change-Type: patch
Changelog-Entry: Warn the user on selection of large drives.
We make all tags with `.label` have bold text and remove the need for
`<b>` tags.
Change-Type: patch
Changelog-Entry: Make all `.label` tags' text bold and remove need for `<b>` tags.
We make the drive-selector button orange when there is a warning attached
to the image-drive pair.
Change-Type: patch
Changelog-Entry: Make the drive-selector button orange on warnings.
This removes O_DIRECT and O_EXCL flags from the writer,
as O_DIRECT can lead to EINVAL under quite a few circumstances,
and O_EXCL has proven to be useless.
Change-Type: patch
This replaces shelling out to `diskpart` on Windows to clear
the partition table with `win-drive-clean`, which does so via DeviceIoControl.
Change-Type: minor
Changelog-Entry: Use native code to clean drives on Windows
This commit introduces a Webpack configuration file that bundles the GUI
code along with its dependencies (except the Etcher SDK and its own
dependencies), and uses Babel to add support for JSX (required by the
Rendition library).
The GUI code that goes into the bundle was moved to `lib/gui/app` so we
can easily ignore the whole subdirectory when creating production
distributable packages.
We now have a new make target called `webpack` that can be used to
create the GUI bundle. Such target will be called everytime a package is
generated.
Change-Type: patch
Signed-off-by: Juan Cruz Viotti <jv@jviotti.com>
We remove a piece of code checking whether `_.keys` returns any non-string
values in its array, but per the Lodash documentation `_.keys` always returns an
array of strings.
Change-Type: patch
Changelog-Entry: Remove stale `invalidKey` check in store.
This increases the UV_THREADPOOL_SIZE to CPUs * 4 to
facilitate full write speeds when writing to multiple destinations,
in preparation for integrating multi-writes.
Change-Type: patch
Changelog-Entry: Increase UV_THREADPOOL_SIZE to allocate 4 threads per CPU
We replace the `templateUrl` fields with `template` fields and thus
switch from template paths to template contents in preparation for the
Webpack PR.
Changelog-Entry: Replace template paths with template contents.
Change-Type: patch
We add a descriptive name to modals for analytics and debugging.
Change-Type: patch
Changelog-Entry: Add descriptive name to modals for analytics and
debugging.
This removes the remnants of the unused "robot protocol",
which was previously used by the CLI, but has been superseded by IPC.
Change-Type: minor
Changelog-Entry: Remove unused robot protocol
We upgrade eslint for better support of the object-curly-newline
options, and change the quantity of elements required before the linter
enforces newlines on objects, in addition we apply `consistent` to avoid
errors when there are newlines in objects with less than 2 elements.
```
const { field } = object
const {
field
} = object
const {
field1,
field2
} = object
````
Change-Type: patch
Changelog-Entry: Upgrade eslint to use object-curly-newline options.
We add an icon next to the drive size that is displayed when there is a
drive-image compatibility status message available. We display the first
one in the list and importance is then enforced by the order they are
added to the list in `drive-constraints`.
Change-Type: patch
Changelog-Entry: Add icon next to drive size when compatibility warnings exist.
We replace `ng-show/hide` with `ng-if` on the main page in order to
remove unnecessary calls and become more efficient.
Changelog-Entry: Replace ng-show/hide with ng-if on main page.
Change-Type: patch
We move the `tabindex` attributes to the button element directly from
elements contained within the button element – this is to satisfy the
HTML linter.
Changelog-Entry: Move tabindex attributes to button elements from
contained elements.
Change-Type: patch
We replace the lodash templates with arrow-functions and change the
single-argument object into multiple arguments.
Fixes#1810Closes#2006
Change-Type: patch
Changelog-Entry: Replace Lodash templates with arrow-functions.
* feat(GUI): add app to gui folder structure
We add a `lib/gui/app/` folder to help transition to Webpack usage.
Change-Type: patch
Changelog-Entry: Add `lib/gui/app` folder to ease into Webpack usage.
We specify the encoding to be UTF-8 with a meta tag such that Electron
won't get confused and try any other encodings.
Change-Type: patch
Changelog-Entry: Specify UTF-8 encoding with meta tag.
This replaces use of `electron.app.getName()` with the package.json's `.displayName`
property to ensure the correct application name is displayed when packaged.
Change-Type: patch
This fixes selection of images contained in directories with a file extension
(i.e. "openSUSE-Leap-42.3-DVD-x86_64.iso") in the open file dialog.
Change-Type: patch
Changelog-Entry: Fix selection of images in folders with file extension on Mac OS
Due to some Windows systems missing certain C runtime libraries
(Visual C/C++ 2012 / 2015 Redistributables), we ignore errors when loading
this module until we can ensure distribution of those along with it.
Change-Type: patch
Changelog-Entry: Fix "The specified module could not be found" on Windows
Fixes#1956
This was causing the stdout maxBuffer size to be exceeded
when flashing larger images (or having flashes that took a while).
Fixes#1955
Change-Type: patch
Changlog Entry: Fix "stdout maxBuffer exceeded" error on Linux
The Makefile current has logic to disable updates when building deb or
rpm packages. To make the Concourse pipeline transition easier, the
logic that disables updates on deb and rpm has been moved to the main
application code.
Change-Type: patch
Signed-off-by: Juan Cruz Viotti <jv@jviotti.com>
Etcher currently elevates a child writer proxy that itself spawns the
Etcher CLI in robot mode, parses the output, and proxies those messages
to the GUI application over IPC.
After these set of changes, Etcher elevates a single child writer
process that directly communicates back with the GUI using IPC. The main
purpose behind these changes is to simplify the overall architecture and
fix various issues caused by the current complex child process tree.
Here's a summary of the changes:
- Stop wrapping the Etcher CLI to perform writing
- Remove the robot option from the Etcher CLI (along with related
documentation)
- Elevate a new `child-write.js` standalone executable
- Move the relevant bits of `lib/child-writer` to the `image-writer` GUI
module
- Remove the `lib/child-writer` directory
- Add a new "Child died unexpectedly" Mixpanel event
- Floor state percentage in the flash state model
The above changes made is possible to tackle all the remaining issues
where the writer process would remain alive even if the parent died.
Change-Type: patch
Changelog-Entry: Ensure the writer process dies when the GUI application is killed.
See: https://github.com/resin-io/etcher/pull/1873
See: https://github.com/resin-io/etcher/pull/1843
Signed-off-by: Juan Cruz Viotti <jv@jviotti.com>
* fix(gui): Re-enable application menu
This re-enables the application menu to allow for OS native shortcuts
to work again (i.e. hide/minimize window), which also allows us to
get rid of the global-shortcuts hack to prevent window reloads.
Change-Type: patch
Changelog-Entry: Fix disabled native OS window shortcuts
* refactor(gui): Update kbd shortcut comment to be less specific
This is a strange one. On Windows, putting a space before the
double-ampersand command concatenator makes the environment variable
value contain a trailing space. So for something like `set foo=bar &&
...` the variable `foo` will be `'bar '` instead of `'bar'`.
Change-Type: patch
Changelog-Entry: Fix trailing space in environment variables during Windows elevation.
Signed-off-by: Juan Cruz Viotti <jv@jviotti.com>
* feat(GUI): remove angular from image-writer
We remove Angular from the `image-writer` module by using Redux store
updates, subscribing to them while flashing.
Changelog-Entry: Remove Angular dependency from image-writer.
Change-Type: minor