23 Commits

Author SHA1 Message Date
Alexis Svinartchouk
9bf58c89d4 Update resin-lint -> @balena/lint
Change-type: patch
2020-04-30 11:35:25 +02:00
Alexis Svinartchouk
b8fdbc3e94 Convert middle-ellipsis.spec.js to typescript
Change-type: patch
2020-01-27 12:35:18 +01:00
Alexis Svinartchouk
255fae3a90 Convert middle-ellipsis.js to typescript
Change-type: patch
2020-01-21 17:53:35 +01:00
Alexis Svinartchouk
05c2f5bebd Remove no longer used closestUnit angular filter
Changelog-entry: Remove no longer used closestUnit angular filter
Change-type: patch
2020-01-21 17:53:09 +01:00
Alexis Svinartchouk
67eb593164 Remove manifest-bind
Change-type: patch
2019-12-12 18:25:54 +01:00
Alexis Svinartchouk
fe230e7d30 Rename resin -> balena
Change-type: patch
2019-12-12 18:25:54 +01:00
Alexis Svinartchouk
1be1a2b8f7 Require angular-mocks only when needed
Changelog-entry: Require angular-mocks only when needed
Change-type: patch
2019-12-03 13:23:45 +01:00
Benedict Aas
57c4a285d8 refactor: inline middle-ellipsis package as util
We remove our dependency on the `middle-ellipses` package and include
and expose the function in `lib/shared/utils`, alongside the regular
Angular filter it exposes. This allows use of the middle ellipsis
method in React.

Change-Type: patch
Changelog-Entry: Inline middle-ellipsis package as util.
2018-03-29 15:25:55 +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
Benedict Aas
70ad86534d feat(GUI): make size units closest relative (#1539)
We make the size units used the closest relative unit through a new
filter `closestUnit` replacing the old `gigabyte` filter.

Changelog-Entry: Round byte sizes to the more appropriate unit.

* remove filters folder

* new shrinkwrap, add to package.json

* test
2017-08-01 17:34:13 -04:00
Juan Cruz Viotti
997133c979 refactor(GUI): get rid of basename Angular filter (#1252)
Signed-off-by: Juan Cruz Viotti <jviotti@openmailbox.org>
2017-04-01 14:52:06 -04:00
Juan Cruz Viotti
6c8bc117ab chore: revise ESLint built-in configuration (#1149)
There are a lot of new rules since the last time I revised the ESLint
rules documentation.

I've updated the main `.eslintrc.yml` to include some newer additions,
plus I added another ESLint configuration file inside `tests`, so we can
add some stricted rules to the production code while relaxing them for
the test suite (due to the fact that Mocha is not very ES6 friendly and
Angular tests require a bit of dark magic to setup).

This is a summary of the most important changes:

- Disallow "magic numbers"

These should now be extracted to constants, which forces us to think of
a good name for them, and thus make the code more self-documenting (I
had to Google up the meaning of some existing magic numbers, so I guess
this will be great for readability purposes).

- Require consistent `return` statements

Some functions relied on JavaScript relaxed casting mechanism to work,
which now have explicit return values. This flag also helped me detect
some promises that were not being returned, and therefore risked not
being caught by the exception handlers in case of errors.

- Disallow redefining function arguments

Immutability makes functions easier to reason about.

- Enforce JavaScript string templates instead of string concatenation

We were heavily mixing boths across the codebase.

There are some extra rules that I tweaked, however most of codebase
changes in this commit are related to the rules mentioned above.

Signed-off-by: Juan Cruz Viotti <jviotti@openmailbox.org>
2017-03-07 23:46:44 -04:00
Juan Cruz Viotti
aea4403a16 refactor: move all byte-size conversion logic to lib/shared/units.js (#1021)
This commit extracts the byte-related conversions from the `byte-size`
AngularJS module and the `FlashStateModel` to a re-usable generic
CommonJS module at `lib/shared/units.js`, than can also be used by the
CLI.

Signed-off-by: Juan Cruz Viotti <jviotti@openmailbox.org>
2017-01-13 16:11:28 -04:00
Juan Cruz Viotti
5ac486d941 style: refer to Resin.io as resin.io, according to the style manual (#823)
> For all, lower-case capitalization unless beginning a sentence (Ex. I
> like resin.io. Resin.io is great.)

See: https://github.com/resin-io/docs#style-manual
See: https://github.com/resin-io/etcher/issues/797
Signed-off-by: Juan Cruz Viotti <jviotti@openmailbox.org>
2016-11-03 10:57:29 -04:00
Juan Cruz Viotti
b0d13eee3b fix: broken tests due to orphaned notifier tests (#525)
The `NotifierService` was removed in 934d287, but for some reason, the
CI servers didn't report an error because we forgot to delete the
corresponding test file.

Signed-off-by: Juan Cruz Viotti <jviottidc@gmail.com>
2016-06-23 19:07:48 -04:00
Juan Cruz Viotti
b923008f7c refactor: make use of angular-if-state (#506)
We'll use this external module rather than our local `if-state`
implementation.

Signed-off-by: Juan Cruz Viotti <jviottidc@gmail.com>
2016-06-22 10:41:02 -04:00
Juan Cruz Viotti
c1074de198 Upgrade electron to v1.1.1 (#427)
Signed-off-by: Juan Cruz Viotti <jviottidc@gmail.com>
2016-05-24 10:37:31 -04:00
Juan Cruz Viotti
a4e2639c00 Implement update notifier modal (#406)
Auto-update functionality is not ready for usage. As a workaround to
prevent users staying with older versions, we now check for updates at
startup, and if the user is not running the latest version, we present a
modal informing the user of the availiblity of a new version, and
provide a call to action to open the Etcher website in his web browser.

Extra features:

- The user can skip the update, and tell the program to delay the
notification for 7 days.

Misc changes:

- Center modal with flexbox, to allow more flexibility on the modal height.
interacting with the S3 server.
- Implement `ManifestBindService`, which now serves as a backend for the
`manifest-bind` directive to allow the directive's functionality to be
re-used by other services.
- Namespace checkbox styles that are specific to the settings page.

Fixes: https://github.com/resin-io/etcher/issues/396
Signed-off-by: Juan Cruz Viotti <jviottidc@gmail.com>
2016-05-12 13:11:30 -04:00
Juan Cruz Viotti
f55100d09b Fix lint warnings (#359)
- `os` in unused in `byte-size.spec.js`

Signed-off-by: Juan Cruz Viotti <jviottidc@gmail.com>
2016-04-25 14:50:23 -04:00
Juan Cruz Viotti
d5b3e0a83f Upgrade drivelist to v3.0.0 (#354)
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>
2016-04-25 12:46:59 -04:00
Juan Cruz Viotti
afeba11424 Move GUI code into lib/gui (#358)
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>
2016-04-25 12:08:19 -04:00