The object returned from UIWindowProgress() now has a `show_error()`
method, taking a title and message. Calling it will replace the content
of the window with those messages.
I've made use of this for file uploads. The only other place we
currently have errors we could show is for zipping and downloading
files, but we do not always have a progress dialog in that case, so I'll
leave that for now.
I think ideally, we would always create a progress dialog, and it would
then support being invisible initially, but appearing after a delay.
Then we'd always have an object to call `show_error()` on, and it could
then immediately show the dialog. But I'll get to that another day. :^)
Previously we showed "Moving /foo" which was confusing.
Also, make use of i18n replacements instead of gluing strings together,
because other languages might put the words in a different order. For
now, I've modified all the translations so that the "Moving foo" text
will appear as it did before, but these will require someone who
actually knows the different languages to check and correct them.
I noticed during this that emptying the trash from inside the Trash
window uses a different code path without a progress dialog, so I've
added a TODO to merge that in. I tried just using it directly but the
behaviour is a bit different. (The Trash one makes all the items fade
out.)
Run the ESLint static analysis tool on any code that is submitted, to
find possible bugs such as undefined functions and variables. We may
want to adjust the ESLint settings over time, but this seems like a
good start.
This is merged into the previous check-translations.yml action, because
that's also a form of linting. Possibly that could be reimplemented as
an ESLint plugin.
These two seem like bugs but are unclear to me how to fix, so I've added
FIXMEs.
/puter/packages/backend/src/routers/kvstore/clearItems.js
41:32 error 'DB_MODE_WRITE' is not defined no-undef
/puter/packages/backend/src/routers/whoami.js
104:35 error 'db' is not defined no-undef
/puter/src/UI/Settings/UITabSecurity.js
13:13 error 'user' is not defined no-undef
31:13 error 'user' is not defined no-undef
32:70 error 'user' is not defined no-undef
36:30 error 'user' is not defined no-undef
40:82 error 'user' is not defined no-undef
41:83 error 'user' is not defined no-undef
87:41 error 'api_origin' is not defined no-undef
/puter/src/UI/UIWindow2FASetup.js
39:33 error 'api_origin' is not defined no-undef
51:37 error 'api_origin' is not defined no-undef
69:37 error 'api_origin' is not defined no-undef
/puter/src/UI/UIWindowLogin.js
202:73 error 'api_origin' is not defined no-undef
271:73 error 'api_origin' is not defined no-undef