beat issueshttps://gitlab.idiap.ch/groups/beat/-/issues2017-08-06T16:44:52Zhttps://gitlab.idiap.ch/beat/beat.web/-/issues/426[reports] tables sorting and saving2017-08-06T16:44:52ZFlavio TARSETTI[reports] tables sorting and savingThe tables in reports are currently not sortable.
We would like to enforce a mechanism to sort and save this sorting preferences for each tables of the report.
Others viewers should also be able to sort the table if they wish too.The tables in reports are currently not sortable.
We would like to enforce a mechanism to sort and save this sorting preferences for each tables of the report.
Others viewers should also be able to sort the table if they wish too.Open-source ReleaseFlavio TARSETTIFlavio TARSETTIhttps://gitlab.idiap.ch/beat/beat.web/-/issues/425[algorithms] If algorithms are only usable, users can still see it through th...2017-08-06T16:44:52ZAndré Anjos[algorithms] If algorithms are only usable, users can still see it through the "diff" panelExample:
https://www.beat-eu.org/platform/algorithms/diff/anjithgeorge/KBOC_IITKGP_ANJITH_APRIL7_1/10/anjithgeorge/KBOC_IITKGP_ANJITH_APRIL7_1/14/
This option should be removed.Example:
https://www.beat-eu.org/platform/algorithms/diff/anjithgeorge/KBOC_IITKGP_ANJITH_APRIL7_1/10/anjithgeorge/KBOC_IITKGP_ANJITH_APRIL7_1/14/
This option should be removed.Open-source ReleaseAndré AnjosAndré Anjoshttps://gitlab.idiap.ch/beat/beat.web/-/issues/424[search] Allow spaces separating terms in OR'ed search2017-08-06T16:44:52ZAndré Anjos[search] Allow spaces separating terms in OR'ed searchFeedback from an user:
```text
I have a minor reccomendation (not important). In the explanation of the search rules with OR operator:
"In order to search using a logical-OR, add search terms to the text boxes separated by a singl...Feedback from an user:
```text
I have a minor reccomendation (not important). In the explanation of the search rules with OR operator:
"In order to search using a logical-OR, add search terms to the text boxes separated by a single comma."
It could be useful to allow the "bar space" after the comma. I mean: "eifanfaces,fisherfaces" works well
as in the example but not "eifanfaces, fisherfaces". It will be very common error in my opinion (it was
my error :)). If it is not possible, you could add a warning about the use of space:
"In order to search using a logical-OR, add search terms to the text boxes separated by a single comma
(without bar-space between terms)."
For those who read fast the instructions.
```André AnjosAndré Anjoshttps://gitlab.idiap.ch/beat/beat.web/-/issues/423[report] reload on saved and unified saving action with the rest of the report2017-08-06T16:44:52ZFlavio TARSETTI[report] reload on saved and unified saving action with the rest of the reportTo make sure everything is saved properly, it's better to reload the page after a save.To make sure everything is saved properly, it's better to reload the page after a save.Open-source ReleaseFlavio TARSETTIFlavio TARSETTIhttps://gitlab.idiap.ch/beat/beat.web/-/issues/422[reports] on multiple aliasing change avoid error with database2017-08-06T16:44:52ZFlavio TARSETTI[reports] on multiple aliasing change avoid error with databaseOpen-source ReleaseFlavio TARSETTIFlavio TARSETTIhttps://gitlab.idiap.ch/beat/beat.web/-/issues/421[reports] fix alias issue2017-08-06T16:44:52ZFlavio TARSETTI[reports] fix alias issueOn dynamic aliasing, the experiment was not found and set to plotter as the alias changesOn dynamic aliasing, the experiment was not found and set to plotter as the alias changesOpen-source ReleaseFlavio TARSETTIFlavio TARSETTIhttps://gitlab.idiap.ch/beat/beat.web/-/issues/467Possibly no plotterparameters for bar plots2017-08-06T16:44:51ZJaden DIEFENBAUGHPossibly no plotterparameters for bar plotsSee jdiefenbaugh/beat.web#19 and jdiefenbaugh/beat.web#17 for some background info if needed.See jdiefenbaugh/beat.web#19 and jdiefenbaugh/beat.web#17 for some background info if needed.https://gitlab.idiap.ch/beat/beat.web/-/issues/463db IntegrityError when adding user from Django admin with non-default account...2017-08-06T16:44:51ZJaden DIEFENBAUGHdb IntegrityError when adding user from Django admin with non-default account settings#### What
Going to the Django admin page for the Users model and creating a new user always fails if any combination of the four options under "Account Settings # 1" are unchecked.
#### Configs
- local development (SQLite backend)
- Cle...#### What
Going to the Django admin page for the Users model and creating a new user always fails if any combination of the four options under "Account Settings # 1" are unchecked.
#### Configs
- local development (SQLite backend)
- Clean `./bin/django install` db on master branch
#### Traceback
```
Internal Server Error: /admin/auth/user/add/
Traceback (most recent call last):
File "/home/blackcap/Code/beat.env.web/usr/lib/python2.7/site-packages/django/core/handlers/base.py", line 149, in get_response
response = self.process_exception_by_middleware(e, request)
File "/home/blackcap/Code/beat.env.web/usr/lib/python2.7/site-packages/django/core/handlers/base.py", line 147, in get_response
response = wrapped_callback(request, *callback_args, **callback_kwargs)
File "/home/blackcap/Code/beat.env.web/usr/lib/python2.7/site-packages/django/contrib/admin/options.py", line 541, in wrapper
return self.admin_site.admin_view(view)(*args, **kwargs)
File "/home/blackcap/Code/beat.env.web/usr/lib/python2.7/site-packages/django/utils/decorators.py", line 149, in _wrapped_view
response = view_func(request, *args, **kwargs)
File "/home/blackcap/Code/beat.env.web/usr/lib/python2.7/site-packages/django/views/decorators/cache.py", line 57, in _wrapped_view_func
response = view_func(request, *args, **kwargs)
File "/home/blackcap/Code/beat.env.web/usr/lib/python2.7/site-packages/django/contrib/admin/sites.py", line 244, in inner
return view(request, *args, **kwargs)
File "/home/blackcap/Code/beat.env.web/usr/lib/python2.7/site-packages/django/utils/decorators.py", line 67, in _wrapper
return bound_func(*args, **kwargs)
File "/home/blackcap/Code/beat.env.web/usr/lib/python2.7/site-packages/django/views/decorators/debug.py", line 76, in sensitive_post_parameters_wrapper
return view(request, *args, **kwargs)
File "/home/blackcap/Code/beat.env.web/usr/lib/python2.7/site-packages/django/utils/decorators.py", line 63, in bound_func
return func.__get__(self, type(self))(*args2, **kwargs2)
File "/home/blackcap/Code/beat.env.web/usr/lib/python2.7/site-packages/django/utils/decorators.py", line 67, in _wrapper
return bound_func(*args, **kwargs)
File "/home/blackcap/Code/beat.env.web/usr/lib/python2.7/site-packages/django/utils/decorators.py", line 149, in _wrapped_view
response = view_func(request, *args, **kwargs)
File "/home/blackcap/Code/beat.env.web/usr/lib/python2.7/site-packages/django/utils/decorators.py", line 63, in bound_func
return func.__get__(self, type(self))(*args2, **kwargs2)
File "/home/blackcap/Code/beat.env.web/usr/lib/python2.7/site-packages/django/utils/decorators.py", line 184, in inner
return func(*args, **kwargs)
File "/home/blackcap/Code/beat.env.web/usr/lib/python2.7/site-packages/django/contrib/auth/admin.py", line 128, in add_view
extra_context)
File "/home/blackcap/Code/beat.env.web/usr/lib/python2.7/site-packages/django/contrib/admin/options.py", line 1437, in add_view
return self.changeform_view(request, None, form_url, extra_context)
File "/home/blackcap/Code/beat.env.web/usr/lib/python2.7/site-packages/django/utils/decorators.py", line 67, in _wrapper
return bound_func(*args, **kwargs)
File "/home/blackcap/Code/beat.env.web/usr/lib/python2.7/site-packages/django/utils/decorators.py", line 149, in _wrapped_view
response = view_func(request, *args, **kwargs)
File "/home/blackcap/Code/beat.env.web/usr/lib/python2.7/site-packages/django/utils/decorators.py", line 63, in bound_func
return func.__get__(self, type(self))(*args2, **kwargs2)
File "/home/blackcap/Code/beat.env.web/usr/lib/python2.7/site-packages/django/utils/decorators.py", line 184, in inner
return func(*args, **kwargs)
File "/home/blackcap/Code/beat.env.web/usr/lib/python2.7/site-packages/django/contrib/admin/options.py", line 1379, in changeform_view
self.save_related(request, form, formsets, not add)
File "/home/blackcap/Code/beat.env.web/usr/lib/python2.7/site-packages/django/contrib/admin/options.py", line 1015, in save_related
self.save_formset(request, form, formset, change=change)
File "/home/blackcap/Code/beat.env.web/usr/lib/python2.7/site-packages/django/contrib/admin/options.py", line 1003, in save_formset
formset.save()
File "/home/blackcap/Code/beat.env.web/usr/lib/python2.7/site-packages/django/forms/models.py", line 645, in save
return self.save_existing_objects(commit) + self.save_new_objects(commit)
File "/home/blackcap/Code/beat.env.web/usr/lib/python2.7/site-packages/django/forms/models.py", line 775, in save_new_objects
self.new_objects.append(self.save_new(form, commit=commit))
File "/home/blackcap/Code/beat.env.web/usr/lib/python2.7/site-packages/django/forms/models.py", line 913, in save_new
obj.save()
File "/home/blackcap/Code/beat.env.web/usr/lib/python2.7/site-packages/django/db/models/base.py", line 708, in save
force_update=force_update, update_fields=update_fields)
File "/home/blackcap/Code/beat.env.web/usr/lib/python2.7/site-packages/django/db/models/base.py", line 736, in save_base
updated = self._save_table(raw, cls, force_insert, force_update, using, update_fields)
File "/home/blackcap/Code/beat.env.web/usr/lib/python2.7/site-packages/django/db/models/base.py", line 820, in _save_table
result = self._do_insert(cls._base_manager, using, fields, update_pk, raw)
File "/home/blackcap/Code/beat.env.web/usr/lib/python2.7/site-packages/django/db/models/base.py", line 859, in _do_insert
using=using, raw=raw)
File "/home/blackcap/Code/beat.env.web/usr/lib/python2.7/site-packages/django/db/models/manager.py", line 122, in manager_method
return getattr(self.get_queryset(), name)(*args, **kwargs)
File "/home/blackcap/Code/beat.env.web/usr/lib/python2.7/site-packages/django/db/models/query.py", line 1039, in _insert
return query.get_compiler(using=using).execute_sql(return_id)
File "/home/blackcap/Code/beat.env.web/usr/lib/python2.7/site-packages/django/db/models/sql/compiler.py", line 1060, in execute_sql
cursor.execute(sql, params)
File "/home/blackcap/Code/beat.env.web/usr/lib/python2.7/site-packages/django/db/backends/utils.py", line 79, in execute
return super(CursorDebugWrapper, self).execute(sql, params)
File "/home/blackcap/Code/beat.env.web/usr/lib/python2.7/site-packages/django/db/backends/utils.py", line 64, in execute
return self.cursor.execute(sql, params)
File "/home/blackcap/Code/beat.env.web/usr/lib/python2.7/site-packages/django/db/utils.py", line 95, in __exit__
six.reraise(dj_exc_type, dj_exc_value, traceback)
File "/home/blackcap/Code/beat.env.web/usr/lib/python2.7/site-packages/django/db/backends/utils.py", line 64, in execute
return self.cursor.execute(sql, params)
File "/home/blackcap/Code/beat.env.web/usr/lib/python2.7/site-packages/django/db/backends/sqlite3/base.py", line 323, in execute
return Database.Cursor.execute(self, query, params)
IntegrityError: UNIQUE constraint failed: accounts_accountsettings.owner_id
[21/Apr/2017 15:39:18] "POST /admin/auth/user/add/ HTTP/1.1" 500 255813
```
#### Django error page
[IntegrityError_at_admin_auth_user_add_.htm](/uploads/0842213a9f0d290b38112c0e0cbd1401/IntegrityError_at__admin_auth_user_add_.htm)https://gitlab.idiap.ch/beat/beat.web/-/issues/461[experiments] Little misleading web interface2017-08-06T16:44:51ZTeodors EGLITIS[experiments] Little misleading web interfaceI find the web interface a little misleading when you set up an experiment.
After one chooses a block, 4 buttons appear that enables you to modify parameters, view algorithm, etc. The black button means "Modify algorithm parameters speci...I find the web interface a little misleading when you set up an experiment.
After one chooses a block, 4 buttons appear that enables you to modify parameters, view algorithm, etc. The black button means "Modify algorithm parameters specifically for this block":
![beat_s1](/uploads/4f90b6d3b0a2328d9067aa12fc0b4844/beat_s1.png)
After you "open" the menu, icon changes, intuitively it feels that pressing the button would just close the algorithm parameter selection menu (for 2 months I assumed this), but in reality this means "reset algorithm on this block to their default values":
![beat_s2](/uploads/b7fe95af199721920534e8dd2b3e35cf/beat_s2.png)
IMHO it would be convenient that the user can close the "algorithm parameter selection menu" without parameter reset (imagine that you are working with a large size toolchain with 10-15 blocks, and you want to change the slot count for each of the blocks - if you must keep open all the menus, the already complicated algorithm setup page becomes non-transparent).
Also, an additional fifth button for reset should be introduced for each block.https://gitlab.idiap.ch/beat/beat.web/-/issues/460[algorithms] Can't save an edited algorithm2017-08-06T16:44:51ZPhilip ABBET[algorithms] Can't save an edited algorithmUpdate of staging to version 1.2.0Philip ABBETPhilip ABBEThttps://gitlab.idiap.ch/beat/beat.web/-/issues/459Django IOError & associated meltdown2017-08-06T16:44:51ZJaden DIEFENBAUGHDjango IOError & associated meltdown#### Info
Django will randomly start crashing with this error, and I'll need to restart the server. It can happen when Django is trying to open the database, when I refresh the page, when an AJAX call is made, etc. It sounds like there's...#### Info
Django will randomly start crashing with this error, and I'll need to restart the server. It can happen when Django is trying to open the database, when I refresh the page, when an AJAX call is made, etc. It sounds like there's some file descriptor leak (some code not properly closing file descriptors), but I don't know.
I thought I fixed it with `ulimit -n 2048` (increasing the file descriptor limit to 2048), but recently it's been happening again. There's no reliable way to reproduce it, or reliable timing - I may not have it for a few days, or get it several times an hour. It's happened over the last couple months (started maybe around Christmas break? Don't remember exactly).
I develop on my own laptop on Arch Linux.
#### Raw data
Django Error page: [django_io_error.html](/uploads/347be48a0a7f87d71ccbe374598d6976/django_io_error.html)
Traceback 1:
```sh
Traceback (most recent call last):
File "/home/blackcap/Code/beat.env.web/usr/lib/python2.7/wsgiref/handlers.py", line 85, in run
self.result = application(self.environ, self.start_response)
File "/home/blackcap/Code/beat.env.web/usr/lib/python2.7/site-packages/django/contrib/staticfiles/handlers.py", line 64, in __call__
return super(StaticFilesHandler, self).__call__(environ, start_response)
File "/home/blackcap/Code/beat.env.web/usr/lib/python2.7/site-packages/django/core/handlers/wsgi.py", line 177, in __call__
response = self.get_response(request)
File "/home/blackcap/Code/beat.env.web/usr/lib/python2.7/site-packages/django/contrib/staticfiles/handlers.py", line 54, in get_response
return self.serve(request)
File "/home/blackcap/Code/beat.env.web/usr/lib/python2.7/site-packages/django/contrib/staticfiles/handlers.py", line 47, in serve
return serve(request, self.file_path(request.path), insecure=True)
File "/home/blackcap/Code/beat.env.web/usr/lib/python2.7/site-packages/django/contrib/staticfiles/views.py", line 40, in serve
return static.serve(request, path, document_root=document_root, **kwargs)
File "/home/blackcap/Code/beat.env.web/usr/lib/python2.7/site-packages/django/views/static.py", line 68, in serve
response = FileResponse(open(fullpath, 'rb'), content_type=content_type)
IOError: [Errno 24] Too many open files: u'/home/blackcap/Code/beat.web/beat/web/reports/static/reports/app/data/table_itemcontent.json'
[23/Feb/2017 15:10:37] "GET /static/reports/app/data/table_itemcontent.json?v1.1.5 HTTP/1.1" 500 59
```
Traceback 2 (right after 1):
```sh
Internal Server Error: /api/v1/plotters/
Traceback (most recent call last):
File "/home/blackcap/Code/beat.env.web/usr/lib/python2.7/site-packages/django/core/handlers/base.py", line 123, in get_response
File "/home/blackcap/Code/beat.web/beat/web/navigation/middleware.py", line 62, in process_request
File "/home/blackcap/Code/beat.env.web/usr/lib/python2.7/site-packages/django/utils/functional.py", line 204, in inner
File "/home/blackcap/Code/beat.env.web/usr/lib/python2.7/site-packages/django/utils/functional.py", line 351, in _setup
File "/home/blackcap/Code/beat.env.web/usr/lib/python2.7/site-packages/django/contrib/auth/middleware.py", line 22, in <lambda>
File "/home/blackcap/Code/beat.env.web/usr/lib/python2.7/site-packages/django/contrib/auth/middleware.py", line 10, in get_user
File "/home/blackcap/Code/beat.env.web/usr/lib/python2.7/site-packages/django/contrib/auth/__init__.py", line 167, in get_user
File "/home/blackcap/Code/beat.env.web/usr/lib/python2.7/site-packages/django/contrib/auth/__init__.py", line 59, in _get_user_session_key
File "/home/blackcap/Code/beat.env.web/usr/lib/python2.7/site-packages/django/contrib/sessions/backends/base.py", line 48, in __getitem__
File "/home/blackcap/Code/beat.env.web/usr/lib/python2.7/site-packages/django/contrib/sessions/backends/base.py", line 198, in _get_session
File "/home/blackcap/Code/beat.env.web/usr/lib/python2.7/site-packages/django/contrib/sessions/backends/cached_db.py", line 45, in load
File "/home/blackcap/Code/beat.env.web/usr/lib/python2.7/site-packages/django/db/models/manager.py", line 122, in manager_method
File "/home/blackcap/Code/beat.env.web/usr/lib/python2.7/site-packages/django/db/models/query.py", line 381, in get
File "/home/blackcap/Code/beat.env.web/usr/lib/python2.7/site-packages/django/db/models/query.py", line 240, in __len__
File "/home/blackcap/Code/beat.env.web/usr/lib/python2.7/site-packages/django/db/models/query.py", line 1074, in _fetch_all
File "/home/blackcap/Code/beat.env.web/usr/lib/python2.7/site-packages/django/db/models/query.py", line 52, in __iter__
File "/home/blackcap/Code/beat.env.web/usr/lib/python2.7/site-packages/django/db/models/sql/compiler.py", line 846, in execute_sql
File "/home/blackcap/Code/beat.env.web/usr/lib/python2.7/site-packages/django/db/backends/base/base.py", line 231, in cursor
File "/home/blackcap/Code/beat.env.web/usr/lib/python2.7/site-packages/django/db/backends/base/base.py", line 204, in _cursor
File "/home/blackcap/Code/beat.env.web/usr/lib/python2.7/site-packages/django/db/backends/base/base.py", line 199, in ensure_connection
File "/home/blackcap/Code/beat.env.web/usr/lib/python2.7/site-packages/django/db/utils.py", line 95, in __exit__
File "/home/blackcap/Code/beat.env.web/usr/lib/python2.7/site-packages/django/db/backends/base/base.py", line 199, in ensure_connection
File "/home/blackcap/Code/beat.env.web/usr/lib/python2.7/site-packages/django/db/backends/base/base.py", line 171, in connect
File "/home/blackcap/Code/beat.env.web/usr/lib/python2.7/site-packages/django/db/backends/sqlite3/base.py", line 207, in get_new_connection
OperationalError: unable to open database file
[23/Feb/2017 15:10:38] "GET /api/v1/plotters/ HTTP/1.1" 500 64611
```
Traceback 3:
```sh
Internal Server Error: /reports/user/test/
Traceback (most recent call last):
File "/home/blackcap/Code/beat.env.web/usr/lib/python2.7/site-packages/django/core/handlers/base.py", line 149, in get_response
File "/home/blackcap/Code/beat.env.web/usr/lib/python2.7/site-packages/django/core/handlers/base.py", line 147, in get_response
File "/home/blackcap/Code/beat.web/beat/web/reports/views.py", line 81, in for_author
File "/home/blackcap/Code/beat.env.web/usr/lib/python2.7/site-packages/django/shortcuts.py", line 45, in render_to_response
using=using)
File "/home/blackcap/Code/beat.env.web/usr/lib/python2.7/site-packages/django/template/loader.py", line 114, in render_to_string
File "/home/blackcap/Code/beat.env.web/usr/lib/python2.7/site-packages/django/template/engine.py", line 231, in render_to_string
File "/home/blackcap/Code/beat.env.web/usr/lib/python2.7/site-packages/django/template/engine.py", line 190, in get_template
File "/home/blackcap/Code/beat.env.web/usr/lib/python2.7/site-packages/django/template/engine.py", line 157, in find_template
File "/home/blackcap/Code/beat.env.web/usr/lib/python2.7/site-packages/django/template/loaders/base.py", line 40, in get_template
File "/home/blackcap/Code/beat.env.web/usr/lib/python2.7/site-packages/django/template/loaders/filesystem.py", line 24, in get_contents
IOError: [Errno 24] Too many open files: '/home/blackcap/Code/beat.web/beat/web/templates/reports/report.html'
[23/Feb/2017 15:10:52] "GET /reports/user/test/ HTTP/1.1" 500 64762
```https://gitlab.idiap.ch/beat/beat.web/-/issues/458Refactor server communication & request state handling to be DRY2017-08-06T16:44:51ZJaden DIEFENBAUGHRefactor server communication & request state handling to be DRYThere are at least several hundred different AJAX code blocks in the JS. Sometimes, Angular Factories help abstract the actual AJAX handling (see: report app). Sometimes, every request is handwritten (see: experiments app). Many requests...There are at least several hundred different AJAX code blocks in the JS. Sometimes, Angular Factories help abstract the actual AJAX handling (see: report app). Sometimes, every request is handwritten (see: experiments app). Many requests need to be set up beforehand. One common setting is sending the CSRF token:
```js
$.ajaxSetup({
beforeSend: function(xhr, settings) {
var csrftoken = $.cookie('csrftoken');
xhr.setRequestHeader('X-CSRFToken', csrftoken);
}
});
```
Requests may also handle certain error codes:
```js
$.ajax({
//....
statusCode: {
404: function(data, status, message) {
container.textContent = message + ' (' + data.status + ')';
$(container).addClass('error');
$(container).removeClass('progress');
},
500: function(data, status, message) {
container.textContent = message + ' (' + data.status + ')';
$(container).addClass('error');
$(container).removeClass('progress');
},
}
//....
```
Since many requests most likely have similar settings/error handling, refactoring the actual requesting functionality (into it's own Angular Service) would make requests more consistent and DRY. It would also help separate the actual AJAX from the handling of a successful request.https://gitlab.idiap.ch/beat/beat.web/-/issues/457Refactor heavy manual DOM manipulation into directives/templates/controllers2017-08-06T16:44:51ZJaden DIEFENBAUGHRefactor heavy manual DOM manipulation into directives/templates/controllersMany apps have JS files that generate & manage complex DOM elements (such as popups/dialogs, settings, and button handling) that aren't plugged in to the Angular system. For example, all of the [Experiments app's JS files](https://gitlab...Many apps have JS files that generate & manage complex DOM elements (such as popups/dialogs, settings, and button handling) that aren't plugged in to the Angular system. For example, all of the [Experiments app's JS files](https://gitlab.idiap.ch/beat/beat.web/tree/master/beat/web/experiments/static/experiments/js) manipulate the DOM.
A few issues that suggest we refactor this:
- No separation between the HTML & JS
- No separation between background processing/AJAX & DOM manipulation
- No clear patterns for extending/changing/reusing these DOM manipulations (no modularity)
- Very little comments/documentation
Angular Directives [were designed to manage these heavy DOM manipulations](https://code.angularjs.org/1.4.5/docs/guide/directive).https://gitlab.idiap.ch/beat/beat.web/-/issues/456Refactor globals/"namespaces" in JS to Angular entities2017-08-06T16:44:51ZJaden DIEFENBAUGHRefactor globals/"namespaces" in JS to Angular entitiesFor reasons why global variables are bad, people commonly reference the ["GlobalVariablesAreBad" article](http://wiki.c2.com/?GlobalVariablesAreBad). Additionally, Angular already provides solutions to homebrew namespaces, so they don't ...For reasons why global variables are bad, people commonly reference the ["GlobalVariablesAreBad" article](http://wiki.c2.com/?GlobalVariablesAreBad). Additionally, Angular already provides solutions to homebrew namespaces, so they don't have to be used.
I was going to add example files, but it's so widespread, just look in any of the JS for the experiments/toolchains/etc. apps. A common manifestation of the globals:
```js
// Declaration of our namespaces
if (beat === undefined)
var beat = {}
if (beat.toolchains === undefined)
beat.toolchains = {}
if (beat.toolchains.dialogs === undefined)
beat.toolchains.dialogs = {}
```
And later in the file, fields are assigned to these globals.
A better approach may be to instead use Angular [Services](https://code.angularjs.org/1.4.5/docs/guide/services) which support DI (dependency injection) and are designed to support heavy processing/data functionality.https://gitlab.idiap.ch/beat/beat.web/-/issues/455Documentation/comments of the frontend2017-08-06T16:44:51ZJaden DIEFENBAUGHDocumentation/comments of the frontendThere is basically no documentation (either in-line or in separate documents) of the nearly **20,000LOC** of JS.
This leads to developers having to go as far as reverse-engineering the application whenever they are not familiar with a c...There is basically no documentation (either in-line or in separate documents) of the nearly **20,000LOC** of JS.
This leads to developers having to go as far as reverse-engineering the application whenever they are not familiar with a certain piece of functionality, which increases the overhead of starting work on new code and slows onboarding new developers.https://gitlab.idiap.ch/beat/beat.web/-/issues/454Give user a 1-click way to navigate to report that they just added experiment...2017-08-06T16:44:51ZJaden DIEFENBAUGHGive user a 1-click way to navigate to report that they just added experiments toI've added experiments 2 ways:
- Selecting experiments from the experiments list page, and adding them to a report
- On a successfully-ran experiment page, adding it to a report
Both ways don't give the user the opportunity to quickly n...I've added experiments 2 ways:
- Selecting experiments from the experiments list page, and adding them to a report
- On a successfully-ran experiment page, adding it to a report
Both ways don't give the user the opportunity to quickly navigate to the report they just added an experiment to. Maybe a popup letting them navigate there?https://gitlab.idiap.ch/beat/beat.web/-/issues/453Migrate from deprecated `replace: true` in directives2017-08-06T16:44:51ZJaden DIEFENBAUGHMigrate from deprecated `replace: true` in directivesAs of [Angular 1.3.0](https://code.angularjs.org/1.3.0/docs/api/ng/service/$compile) the `replace` attribute in directive definitions is deprecated. We are using it in at least the directives `tableDynamic` & `myReportInfo` in the report...As of [Angular 1.3.0](https://code.angularjs.org/1.3.0/docs/api/ng/service/$compile) the `replace` attribute in directive definitions is deprecated. We are using it in at least the directives `tableDynamic` & `myReportInfo` in the reports app.https://gitlab.idiap.ch/beat/beat.web/-/issues/452Migrate from deprecated `$http .success` & `$http .error` to `$http .then`2017-08-06T16:44:51ZJaden DIEFENBAUGHMigrate from deprecated `$http .success` & `$http .error` to `$http .then`While it's officially deprecated in [v1.5.0](https://code.angularjs.org/1.5.0/docs/api/ng/service/$http#deprecation-notice), the alternative is already implemented in v1.4.5.
`.success` & `.error` don't allow chaining as normal Promise ...While it's officially deprecated in [v1.5.0](https://code.angularjs.org/1.5.0/docs/api/ng/service/$http#deprecation-notice), the alternative is already implemented in v1.4.5.
`.success` & `.error` don't allow chaining as normal Promise handling (`.then`) do.https://gitlab.idiap.ch/beat/beat.web/-/issues/451More descriptive names for Angular entities2017-08-06T16:44:51ZJaden DIEFENBAUGHMore descriptive names for Angular entitiesA couple targets off the top of my head (more to be added):
- [ ] [`theColumn` directive](https://gitlab.idiap.ch/beat/beat.web/blob/67ca8af8e123d03debc1d6b89cf4b0751ddbb4b5/beat/web/reports/static/reports/app/directives/reportItemView.j...A couple targets off the top of my head (more to be added):
- [ ] [`theColumn` directive](https://gitlab.idiap.ch/beat/beat.web/blob/67ca8af8e123d03debc1d6b89cf4b0751ddbb4b5/beat/web/reports/static/reports/app/directives/reportItemView.js#L1117)
- [ ] [`item` directive](https://gitlab.idiap.ch/beat/beat.web/blob/67ca8af8e123d03debc1d6b89cf4b0751ddbb4b5/beat/web/reports/static/reports/app/directives/reportItemView.js#L1072)https://gitlab.idiap.ch/beat/beat.web/-/issues/450Refactor to not climb `$parent` in Angular2017-08-06T16:44:51ZJaden DIEFENBAUGHRefactor to not climb `$parent` in AngularControllers in Angular should not be depending on an exact parent hierarchy. If the child controller needs information from a parent scope, it should at the very least be passed down to the child explicitly (or better yet, refactored int...Controllers in Angular should not be depending on an exact parent hierarchy. If the child controller needs information from a parent scope, it should at the very least be passed down to the child explicitly (or better yet, refactored into a Service). Climbing `$parent` makes the app's parts too coupled and kills modularity. For example, [the `theColumn` directive in the reports app](https://gitlab.idiap.ch/beat/beat.web/blob/67ca8af8e123d03debc1d6b89cf4b0751ddbb4b5/beat/web/reports/static/reports/app/directives/reportItemView.js#L1127-1132):
```js
var the_parent = $scope.$parent.$parent.$parent.$parent;
var report_experiments = $scope.$parent.$parent.$parent.$parent.report_experiments;
var report_experiments_alias = $scope.$parent.$parent.$parent.$parent.report_experiments_alias;
var floating_point_precision = $scope.$parent.$parent.$parent.$parent.floating_point_precision;
var report = $scope.$parent.$parent.$parent.report;
var experiment_name = $scope.$parent.item;
```
There's more than this (just search for `$parent`)