154 Commits

Author SHA1 Message Date
Giovanni Garufi
3d3b4f4a46 Add electron autoupdater
Change-type: patch
Changelog-entry: Add support for auto-updating feature
Signed-off-by: Giovanni Garufi <giovanni@balena.io>
2019-04-19 17:13:37 +02:00
Alexis Svinartchouk
65d86460cb fix(shared): Fix getDriveImageCompatibilityStatuses() and tests
Change-type: patch
Signed-off-by: Alexis Svinartchouk <alexis@resin.io>
2019-01-24 13:21:27 +01:00
Alexis Svinartchouk
871db09447 fix(tests): Fix gui tests
Change-type: patch
Signed-off-by: Alexis Svinartchouk <alexis@resin.io>
2019-01-24 13:21:26 +01:00
Jonas Hermsmeier
4f7cc7dd6b fix(lib): Fix MIME type exclusion condition
As `mime.extension()` returns `false`, instead of `null` or `undefined`,
this condition simply needs to check for truthyness.

Change-type: patch
2019-01-24 13:21:26 +01:00
Jonas Hermsmeier
47f2336673 fix(lib): Fix use of non-existent dependency
Change-Type: patch
2019-01-24 13:21:26 +01:00
Alexis Svinartchouk
caf5f10326 lint 2019-01-24 13:21:26 +01:00
Alexis Svinartchouk
8630af7646 Remove usage of old sdk in supported-formats 2019-01-24 13:21:21 +01:00
Alexis Svinartchouk
d07d535993 Show raspberry pi usbboot update progress in devices list 2019-01-24 13:21:21 +01:00
Alexis Svinartchouk
a8a75f22b2 Allow flashing from sources for which we don't know the compressed size
* don't show any percentage or eta, show the bytes written instead
2019-01-24 13:21:21 +01:00
Alexis Svinartchouk
6143023502 Integrate etcher-sdk 2019-01-24 13:21:21 +01:00
Alexis Svinartchouk
f2ca997195 Change "Drive Contains Image" label.
Use "Drive Mountpoint Contains Image" instead as the image may not be on
this drive but on a drive mounted in one of the mountpoins of this
drive.
We still don't want to allow flashing this drive in that situation.

Changelog-entry: Changed “Drive Contains Image” to “Drive Mountpoint Contains Image”
Change-type: patch
2019-01-07 15:35:21 +01:00
Lorenzo Alberto Maria Ambrosi
22acc5ae96 Customize Mixpanel configs
Change-type: minor
Signed-off-by: Lorenzo Alberto Maria Ambrosi <lorenzoa@balena.io>
2018-12-18 11:32:07 +01:00
Alexis Svinartchouk
26779ef1fb fix(sdk): Load usbboot adapter on start
Change-type: patch
Changelog-entry: Load usbboot adapter on start on GNU/Linux if running as root.
Signed-off-by: Alexis Svinartchouk <alexis@resin.io>
2018-08-07 04:01:13 +02:00
Benedict Aas
5863319c0b
fix(GUI): file-picker performance and design improvements
- Replace onClick arrow functions in all components that use them for
  efficiency reasons: 300-500% speed-up
- Sort by folders and ignore case for better UX
- Remove use of `rendition.Button` in files, leading to a 10-20%
  performance increase when browsing files
- Proper sidebar width and spacing
- Recents and favorites are now filtered by existence async for a tiny
  performance improvement
- Make Breadcrumbs and Icon pure components to stop frequent re-rendering
- Initial support for array constraints
- Use first constraint as initial path instead of homedir if a
  constraint is set
- Use correct design height on modal, `calc(100vh - 20px)`
- Reset scroll position when browsing a new folder
- Fuse Bluebird `.map()` and `.reduce()` in
  `files.getAllFilesMetadataAsync`.
- Use `localeCompare`'s own case-insensitive option instead of calling
  `.toLowerCase()` twice on `n-2` files compared.
- Use 16px font sizes in sidebar and files to match design.
- Disable `$locationProvider.html5Mode.rewriteLinks`, which seemed to
  take 50ms of the directory changing time.
- Leave file extension as-is in `files.getFileMetadataSync` and the
  async counterpart for a very minor performance improvement.

Change-Type: patch
2018-05-30 12:39:59 +02:00
Jonas Hermsmeier
687e0b563b
refactor(gui): Move shared models to app/models 2018-05-25 20:35:59 +02:00
Jonas Hermsmeier
6232cc7d49
test(settings): Update test specs accordingly
Change-Type: patch
2018-05-25 20:35:59 +02:00
Jonas Hermsmeier
447efc7096
refactor: Move shared/store.js -> gui/app/models/store.js 2018-05-23 21:20:50 +02:00
Benedict Aas
c00b7b62d6 fix: add missing files module
We add a convenience module for file and path operations.
Tests included.

Change-Type: patch
2018-05-17 15:34:34 +01:00
Jonas Hermsmeier
03c7998c11
feat(gui): Add desktop notification setting
This adds a setting to disable desktop notifications, to be controlled
via configuration file

Change-Type: feat
2018-05-15 18:58:10 +02:00
Benedict Aas
21cb7a4847
feat(GUI): env var toggle autoselecting all valid drives (#2306)
We introduce an environment variable
`ETCHER_DISABLE_EXPLICIT_DRIVE_SELECTION` that both enables
autoselection of drives and disables explicit drive selection by hiding
the buttons allowing this. All valid drives are autoselected, i.e. any
drive-image pair that does not result in an error, however warnings are
accepted.

Closes: https://github.com/resin-io/etcher/issues/2262
Change-Type: patch
Changelog-Entry: Introduce env var to toggle autoselection of all
drives.
2018-05-10 18:53:53 +01:00
Benedict Aas
ee831da52d
minifix: replace succeeded with successful in messages (#2273)
Change-Type: patch
2018-04-25 15:08:46 +01:00
Jonas Hermsmeier
8f969374c7
Merge pull request #2272 from resin-io/fix-store-warning-deselect
fix(store): keep single warning-drives selected
2018-04-25 14:39:58 +02:00
Benedict Aas
5a788b04b5 fix(store): keep single warning-drives selected
We ensure that drive-image pairs with warnings don't get deselected when
there is only one drive available. This happenened because there was no
check for any previous selected devices. Comes with a test case.

Fixes: https://github.com/resin-io/etcher/issues/2267
Change-Type: patch
Changelog-Entry: Keep single warning-drive-image pairs selected.
2018-04-25 00:49:42 +01:00
Benedict Aas
b88a45aa79
refactor(GUI): make the finish notification message concise (#2268)
We make the finish notification message print the device name as usual
when there's one target, and instead list quantity of successful and
failed devices when there are multiple. Previously it would list all
device names, and wouldn't specify how many were successful or failures.

Change-Type: patch
2018-04-24 22:04:36 +01:00
Benedict Aas
c4d7076fe8 refactor: use word successful instead of succeeded
We replace 'succeeded' with 'successful' throughout the codebase.

Change-Type: patch
2018-04-23 18:31:44 +01:00
Benedict Aas
32bc615e78
feat(GUI): display succeeded and failed devices on finish screen (#2206)
We display the quantity of succeeded and failed devices using status
dots on the finish screen.

Change-Type: patch
Changelog-Entry: Display succeeded and failed device quantities on the
finish screen.
2018-04-17 15:52:02 +01:00
Jonas Hermsmeier
3381ad042b
Merge pull request #2199 from resin-io/fix-ipc-user-error
fix(child-writer): Fix handling of user errors over IPC
2018-04-16 22:34:57 +02:00
Benedict Aas
aeeb1d4294
feat(GUI): remove unnecessary status dots (#2202)
We remove usage of the status dots except when failed devices occur, in
which case we still display the red failed dot and quantity. We also use
singular and plural depending on the quantity of failed devices.

Change-Type: patch
2018-04-16 20:11:19 +01:00
Jonas Hermsmeier
cc848ef9f2
fix(child-writer): Fix handling of user errors over IPC
This fixes transmission of user errors over IPC, as the `report`
property was previously missing. Further it also adds more properties
to `errors.toJSON`, like `syscall`, `errno`, etc. and re-uses the method
for failure signalling.

Change-Type: patch
2018-04-13 18:36:29 +02:00
Jonas Hermsmeier
64604dbcc6
Merge pull request #2156 from resin-io/fix-store-quantity-guards
fix: ensure flash quantity fields are finite
2018-04-05 18:54:05 +02:00
Jonas Hermsmeier
dd961ad30b
test(lint): Update codespell 1.11.0 -> 1.12.0
This updates codespell, and fixes new spelling error detections

```
lib/shared/models/selection-state.js:377: Unselect  ==> Deselect
lib/gui/app/components/modal/styles/_modal.scss:72: programatically  ==> programmatically
tests/shared/errors.spec.js:88: prioritise  ==> prioritize
tests/shared/errors.spec.js:94: prioritise  ==> prioritize
tests/shared/errors.spec.js💯 prioritise  ==> prioritize
tests/gui/components/svg-icon.spec.js💯 prioritise  ==> prioritize
docs/MAINTAINERS.md:19: artefacts  ==> artifacts
docs/MAINTAINERS.md:21: artefacts  ==> artifacts
docs/MAINTAINERS.md:25: artefacts  ==> artifacts
docs/MAINTAINERS.md:36: artefacts  ==> artifacts
docs/MAINTAINERS.md:96: artefacts  ==> artifacts
docs/MAINTAINERS.md:147: artefacts  ==> artifacts
CHANGELOG.md:492: interferring  ==> interfering
```

Change-Type: patch
2018-04-04 21:00:34 +02:00
Benedict Aas
dc484d79ed fix: ensure flash quantity fields are finite
We replace the `_.identity` predicate with `_.isFinite` to ensure
the flash quantity fields are numbers.

Change-Type: patch
Changelog-Entry: Ensure flash quantity fields are finite.
2018-04-03 21:25:49 +01:00
Benedict Aas
65a4a959bb
feat: expose all flash state fields to the store (#2153)
We expose all the flash state fields to the store, and mirror
`speed`'s format with `totalSpeed` with MB as the size unit.
We also format the progress state messages to use information
available with multiwrites.

Change-Type: patch
Changelog-Entry: Expose all flash state fields to the store.
2018-04-03 20:32:38 +01:00
Benedict Aas
4140d49db3
refactor: multi-writes preparatory changes (#2124)
We add some preparatory changes including new utility functions, as well
as changes throughout the codebase that reflect the change from single
drives to a list of drives, given multi-writes is coming.

Change-Type: patch
Changelog-Entry: Various preparatory changes to account for
multi-writes.
2018-03-23 14:36:39 +00:00
Jonas Hermsmeier
ad7c8760eb
Merge pull request #1807 from resin-io/patch-1136
feat(gui): Display image size when drive too small

Close #1136
Close #2004
2018-03-21 23:37:22 +01:00
Jonas Hermsmeier
98dcb13201
Merge pull request #2112 from resin-io/store-fix-autoselect-stale
fix: stop autoselecting empty value in store
2018-03-21 22:52:20 +01:00
Jonas Hermsmeier
4108979b65
feat(gui): Display image size when drive too small
This adds a display of the determined image size to the
drive label when the drive has been determined to be too small.

Change-Type: patch
Changelog-Entry: Display image size for comparison if drive is too small
2018-03-21 20:35:47 +01:00
Jonas Hermsmeier
c5b311359a
Merge pull request #2111 from resin-io/store-efficient-plainify
minifix: remove stale json object plainifying in store
2018-03-21 20:32:45 +01:00
Benedict Aas
835f2cf769
feat(GUI): add colorised multi-writes progress status dots (#2115)
We add colorised progress status dots with quantities of `flashing`,
`validating`, `succeeded`, and `failed` devices.

Change-Type: patch
Changelog-Entry: Add colorised multi-writes progress status dots.
2018-03-14 17:05:01 +00:00
Benedict Aas
69e85a7ac6 fix: stop autoselecting empty value in store
We fix store autoselection, which selects an empty value when one
drive is selected and then ejected, leaving one drive that is
supposed to be autoselectable. Now it instead properly autoselects the
last drive.

Change-Type: patch
Changelog-Entry: Stop store autoselection from selecting empty values on
drive ejection.
2018-03-09 13:52:38 +00:00
Benedict Aas
82b65399af minifix: remove stale json object plainifying in store
Change-Type: patch
Changelog-Entry: Remove stale JSON object plainifying in store
2018-03-09 13:20:38 +00:00
Benedict Aas
a83e397643
refactor: move memoize function to shared utils (#2090)
We move the memoize function to `lib/shared/utils.js` and expose it to
modules across the project.

Change-Type: patch
Changelog-Entry: Move memoize function to shared utils.
2018-03-09 12:12:34 +00:00
Benedict Aas
4e112dc98c
minifix: add missing parameter to verifyNoNilFields example (#2081)
We add the missing `name` parameter to the `verifyNoNilFields` JSDoc
example.

Change-Type: patch
Changelog-Entry: Add missing name param to verifyNoNilFields JSDoc example.
2018-02-26 11:34:46 +00:00
Benedict Aas
207c2ef5b6
feat: add drive multi-selection in store (#1736)
We lay the foundation for multi-selecting drives by implementing it into
the `store` and relevant modules interacting with the `store`.

Change-Type: patch
Changelog-Entry: Add drive multi-selection to the store.
2018-02-23 17:45:49 +00:00
Benedict Aas
2c0cdcf947
refactor(GUI): remove selection-state clear options to simplify (#2043)
We refactor and simplify the selection-state `.clear()` by removing the
options argument.

Change-Type: patch
Changelog-Entry: Remove `selectionState.clear()` options argument to
simplify.
2018-02-21 15:56:42 +00:00
Benedict Aas
765de94ca3
refactor: consolidate store-state nil-checking (#2062)
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.
2018-02-20 13:13:29 +00:00
Benedict Aas
91719435d9
feat(GUI): warn the user on large drive selection (#2045)
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.
2018-02-19 19:12:48 +00:00
Jonas Hermsmeier
7c9f15d8a9
feat(sdk): Consolidate low-level components into SDK
Changes:

- Split out scanner into own file
- Move `lib/shared/sdk` -> `lib/sdk`
- Move `lib/image-stream` -> `lib/sdk/image-stream`
- Move `lib/writer` -> `lib/sdk/writer`
- Rename `sdk/standard` -> `sdk/blockdevice`
- Move adapters into `sdk/adapters` subdirectory

Change-Type: minor
Changelog-Entry: Consolidate low-level components into Etcher SDK
2018-02-16 17:15:28 +01:00
Benedict Aas
e0f789bc14
refactor: remove stale invalid key check in store (#2050)
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.
2018-02-15 17:23:11 +00:00
Benedict Aas
c3600ee8fc
refactor: rename selection state and store functions (#2037)
We rename functions in `selection-state` and the `store`.

Change-Type: patch
Changelog-Entry: Rename selection-state and store functions.
2018-02-13 11:15:22 +00:00