99 Commits

Author SHA1 Message Date
Edwin Joassart
a661d102bc patch: setup wdio and port (most) tests 2024-04-25 14:24:36 +02:00
Edwin Joassart
0f2b4dbc10 Update dependencies
- upgrade pretty_bytes to 6.1.1
- upgrade electron-remote to 2.1.0
- upgrade semver to 7.5.4 + @types/semver to 7.5.6
- upgrade chai to 4.3.11 + @types/chai to 4.3.10
- upgrade mocha to 10.2.0 + @types/mocha to 10.0.6
- upgrade sinon to 17.0.1 + @types/sinon to 17.0.2
- remove useless @types
- upgrade @svgr/webpack to 8.1.0
- upgrade @sentry/electron to 4.15.1
- upgrade tslib to 2.6.2
- upgrade immutable to 4.3.4
- upgrade redux to 4.2.1
- upgrade ts-node to 10.9.2 & ts-loader to 9.5.1
- remove mini-css-extract-plugin
- upgrade husky to 8.0.3
- upgrade uuid to 9.0.1
- upgrade lint-staged to 15.2.1
- upgrade @types/node to 18.11.9
- upgrade @fortawesome/fontawesome-free to 6.5.1
- upgrade i18next to 23.7.8 & react-i18next to 11.18.6
- bump react, react-dom + related @types to 17.0.2 and rendition to 35.1.0
- fix getuid for ts
- fix @types/react being in wrong deps
- upgrade @types/tmp to 0.2.6
- upgrade typescript to 5.3.3
- upgrade @types/mime-types to 2.1.4
- remove d3 from deps
- upgrade electron-updater to 6.1.7
- upgrade rendition to 35.1.2
- upgrade node-ipc to 9.2.3
- upgrade @types/node-ipc to 9.2.3
- upgrade electron to 27.1.3
- upgrade @electron-forge/* to 7.2.0
- upgrade @reforged/marker-appimage to 3.3.2
- upgrade style-loader to 3.3.3
- upgrade balena-lint to 7.2.4
- run CI with node 18.19
- add xxhash-addon to sidecar assets

Change-type: patch
2023-12-22 15:20:28 +02:00
Lorenzo Alberto Maria Ambrosi
00e8f11913 patch: Fix linting errors
Signed-off-by: Lorenzo Alberto Maria Ambrosi <lorenzothunder.ambrosi@gmail.com>
2021-10-13 17:21:48 +02:00
Lorenzo Alberto Maria Ambrosi
deb3db0fff Add more typings & refactor code accordingly
Change-type: patch
Signed-off-by: Lorenzo Alberto Maria Ambrosi <lorenzothunder.ambrosi@gmail.com>
2020-11-03 15:02:51 +01:00
Lorenzo Alberto Maria Ambrosi
e484ae9837 Cleanup after child-process is terminated
Change-type: patch
Signed-off-by: Lorenzo Alberto Maria Ambrosi <lorenzothunder.ambrosi@gmail.com>
2020-10-22 14:08:44 +02:00
Lorenzo Alberto Maria Ambrosi
b76366a514 Add more typings & refactor code accordingly
Change-type: patch
Signed-off-by: Lorenzo Alberto Maria Ambrosi <lorenzothunder.ambrosi@gmail.com>
2020-09-04 11:24:10 +02:00
Lorenzo Alberto Maria Ambrosi
dda022df37 Add clone-drive workflow
Change-type: patch
Changelog-entry: Add clone-drive workflow
Signed-off-by: Lorenzo Alberto Maria Ambrosi <lorenzothunder.ambrosi@gmail.com>
2020-08-31 15:13:41 +02:00
Alexis Svinartchouk
a24be20e95 Fix writing config file
Changelog-entry: Fix writing config file
Change-type: patch
2020-08-20 17:27:24 +02:00
Alexis Svinartchouk
4752fa6dd2 Stop checking file extensions
Changelog-entry: Stop checking file extensions
Change-type: patch
2020-05-27 17:27:09 +02:00
Alexis Svinartchouk
ffe281f25d Simplify settings
Change-type: patch
2020-04-30 11:35:29 +02:00
Alexis Svinartchouk
9bf58c89d4 Update resin-lint -> @balena/lint
Change-type: patch
2020-04-30 11:35:25 +02:00
Alexis Svinartchouk
ee62b9a4c7 Decompress images before flashing, remove trim setting, trim ext partitions
Changelog-entry: Decompress images before flashing, remove trim setting, trim ext partitions
Change-type: patch
2020-04-30 11:35:23 +02:00
Lorenzo Alberto Maria Ambrosi
b3f25c176b Add average speed in flash results
Changelog-entry: Add average speed in flash results
Change-type: patch
2020-04-14 17:25:25 +02:00
Alexis Svinartchouk
6fcd9e1595 Remove settings.getDefaults function
Change-type: patch
2020-01-30 16:59:28 +01:00
Alexis Svinartchouk
9caa42d257 Remove unused settings.assign function
Change-type: patch
2020-01-30 16:59:28 +01:00
Alexis Svinartchouk
121b69b0c3 Convert available-drives.spec.ts to typescript
Change-type: patch
2020-01-27 12:35:25 +01:00
Alexis Svinartchouk
cb7cc2f276 Convert selection-state.spec.ts to typescript
Change-type: patch
2020-01-27 12:35:25 +01:00
Alexis Svinartchouk
d812d4e12e Convert flash-state.spec.js to typescript
Change-type: patch
2020-01-27 12:35:22 +01:00
Alexis Svinartchouk
2b3c84f21a Convert settings.spec.js to typescript
Change-type: patch
2020-01-27 12:35:20 +01:00
Alexis Svinartchouk
1c46ee2988 Convert flash-state.js to typescript
Change-type: patch
2020-01-21 17:54:15 +01:00
Alexis Svinartchouk
d0d4ee843d Convert selection-state.js to typescript
Change-type: patch
2020-01-21 17:54:14 +01:00
Alexis Svinartchouk
fd127da342 Convert available-drives.js to typescript
Change-type: patch
2020-01-21 17:54:12 +01:00
Alexis Svinartchouk
c0eb9bd1e9 Convert settings.js to typescript
Change-type: patch
2020-01-21 17:54:10 +01:00
Alexis Svinartchouk
c85896845f Convert drive-constraints.js to typescript
Change-type: patch
2020-01-21 17:54:08 +01:00
Alexis Svinartchouk
109d84302c Remove no longer used storage.js and its tests
Change-type: patch
2020-01-21 17:53:54 +01:00
Alexis Svinartchouk
e50974a86a Convert local-settings.js to typescript
Change-type: patch
2020-01-21 17:53:53 +01:00
Alexis Svinartchouk
ef491e1e96 Remove no longer used lib/gui/app/models/files.js and its tests
Change-type: patch
2020-01-21 17:53:51 +01:00
Alexis Svinartchouk
fe230e7d30 Rename resin -> balena
Change-type: patch
2019-12-12 18:25:54 +01:00
Alexis Svinartchouk
ec015da795 Avoid "Invalid state percentage: null" errors
Change-type: patch
2019-03-29 17:24:34 +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
Alexis Svinartchouk
63967d1558 fix(tests): Remove throw if no percentage or eta test
Since 25916200f2864a9b137325f919c0f8ef5d62fa60 we can handle a progress
state with no percentage or eta.
2019-01-24 13:21:26 +01:00
Lorenzo Alberto Maria Ambrosi
20996b153d fix(GUI): Reject drives with null size
Change-type: patch
Changelog-entry: Reject drives with null size (fixes pretty-bytes error)
Signed-off-by: Lorenzo Alberto Maria Ambrosi <lorenzoa@balena.io>
2018-11-22 19:57:45 +01:00
Alexis Svinartchouk
92d969b075 fix(test): Move tests to correct scope
Move available-drives, flash-state and selection-state tests to gui
tests. These files only test gui code and make `make test-cli` fail.

Change-type: patch
Signed-off-by: Alexis Svinartchouk <alexis@resin.io>
2018-08-07 09:22:29 +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
e0ebdc9045
fix(test): Fix lint errors & tests 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
f6ce603e45
feat(GUI): add convenience localstorage class (#2276)
* feat(GUI): add convenience localstorage class

We add a class `Storage` and accompanying helper methods that makes
localStorage usage easier.

Change-Type: patch
Changelog-Entry: Add a convenience Storage class on top of localStorage.
2018-05-15 11:59:36 +01:00
Benedict Aas
4dc64ee15b
feat(GUI): add app to gui folder structure (#2002)
* 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.
2018-01-29 18:34:21 +00:00
Juan Cruz Viotti
d8e31665a0 chore: follow standardjs guidelines (#1664)
- Extend the `standard` ESLint configuration
- Remove ESLint rules that are defined in the `standard` configuration
- Get rid of semi-colons

See: https://github.com/resin-io/etcher/pull/1657
Signed-off-by: Juan Cruz Viotti <jv@jviotti.com>
2017-08-03 09:01:54 -04:00
Juan Cruz Viotti
5c19b70e83 refactor: adhere mostly to StandardJS guidelines (#1657)
This commit changes the whole codebase to adhere to all StandardJS
guidelines rules except semicolons, since the removal of semicolons
affect pretty much all lines, and the final diff is very hard to follow
(and to assess other more involved changes).

In a nutshell:

- When using `function`, we now require a space before the opening
  parenthesis
- If a line with operators is broken into multiple lines, the operator
  should now go after the line break
- Unnecessary padding lines are now forbidden

There were also some minor things that the `standard` CLI caught that I
updated here.

See: https://standardjs.com
Signed-off-by: Juan Cruz Viotti <jv@jviotti.com>
2017-08-03 06:59:02 -04:00
Juan Cruz Viotti
fc3eeff1c9 refactor(GUI): make settings model setter asynchronous (#1597)
This is part of the process of implementing support for a configuration
file. We previously decoupled the Redux store from localStorage by
moving the logic that actually persists the data to localStorage to a
local-settings.js file, however the localStorage API is synchronous, so
it follows that at the moment, all functions that interact with are also
synchronous.

Moving to storing the settings to a file means turning all these
functions to promises, which we do in this commit, in order to not mix
the addition of the configuration file feature with the huge amount of
refactoring it requires.

See: https://github.com/resin-io/etcher/issues/1356
Change-Type: patch
Signed-off-by: Juan Cruz Viotti <jv@jviotti.com>
2017-08-01 10:27:15 -04:00
Juan Cruz Viotti
4122e0bf1d refactor: move most models to lib/shared/ (#1596)
Now that the Redux store is no longer front-end dependent, we can move
most of the models to lib/shared. Currently, lib/shared is a mess, and
contains all sorts of functionality, however moving things out of the
GUI is the first step. Once we have everything decoupled, we can
organise all the code we have there.

Signed-off-by: Juan Cruz Viotti <jv@jviotti.com>
2017-07-18 12:34:10 -03:00
Juan Cruz Viotti
fdceaadec5 refactor(GUI): move redux store to lib/shared (#1576)
After https://github.com/resin-io/etcher/pull/1569, the redux store can
run outside of a browser context. This commit moves it to `lib/shared`,
where we will likely move all the other models as well. As an extra, I
renamed `Store` to `store`, since there was no reason for that variable
to be capitalized.

Change-Type: patch
Signed-off-by: Juan Cruz Viotti <jv@jviotti.com>
2017-07-07 18:47:39 -04:00
Juan Cruz Viotti
4dc56f4678 refactor(GUI): decouple localStorage from the redux store (#1569)
We're currently persisting the user settings in localSettings by using a
redux plugin called redux-localstorage. As a way to decouple the redux
store from a technology that is browser specific, this commit makes the
following changes:

- Create local-settings.js, which is concerned with managing settings in
  a persisting location

- Decouple the redux store from the persisting storage method

- Extend the settings model to persist settings, cache reads, etc

Change-Type: patch
Signed-off-by: Juan Cruz Viotti <jv@jviotti.com>
2017-07-06 17:49:13 -04:00
Juan Cruz Viotti
103a048e4d refactor(GUI): replace SET_SETTING with an atomic SET_SETTINGS action (#1515)
This commit is the first on a series of commit to incrementally
implement support for configuration files (so we avoid a huge PR like we
have at the moment).

Once of the first things we can do is replace the `SET_SETTING` redux
action with an atomic `SET_SETTINGS` action that sets all the settings
for the application at once.

The purpose of this change is that later the `SET_SETTINGS` action can
be modified to stringify all the settings and store them in a
configuration file, without having to deal with merges, conflicts, etc
(since the client application if forced to resolve those problems before
calling the `SET_SETTINGS` action.)

The behaviour of the code remains almost the same, with the exception
that the user can now set settings that we don't know about, so the user
can switch between Etcher versions without getting weird errors if one
of the configuration keys he has doesn't exist in the other version.

See: https://github.com/resin-io/etcher/pull/1382
Change-Type: patch
Signed-off-by: Juan Cruz Viotti <jv@jviotti.com>
2017-06-15 12:57:15 -04:00
Benedict Aas
ef739fb222 refactor(GUI): remove angular dependency from selection-state (#1509)
We remove the dependency on Angular from SelectionStateModel and rename
it to selectionState.
2017-06-12 08:40:52 -04:00
Benedict Aas
14b04413b5 refactor(GUI): remove angular from DrivesModel (#1265)
We remove usage of Angular from DrivesModel.

Depends: https://github.com/resin-io/etcher/pull/1261
Depends: https://github.com/resin-io/etcher/pull/1264

* remove angular injection from tests

* move file

* add empty array test
2017-06-05 10:30:58 -04:00
Benedict Aas
efa7f986a4 fix(GUI): bound flash progress percentage within 0-100 (#1258)
We limit the Store state flashing percentage to be within 0-100,
throwing errors otherwise. Comes with tests.

Changelog-Type: Bound flash progress percentage within 0-100 range.
Signed-off-by: Juan Cruz Viotti <jviotti@openmailbox.org>
2017-05-09 19:24:44 -04:00
Juan Cruz Viotti
c9e410fcb1 refactor: address file-extensions review comments (#1347)
See: https://github.com/resin-io/etcher/pull/1343#pullrequestreview-34288142
Signed-off-by: Juan Cruz Viotti <jviotti@openmailbox.org>
2017-04-26 23:53:03 -04:00