Strings were already passed to this function, even though it was declared
as taking an ObjectID. Instead of updating all callers, I just made it
convert strings to ObjectID.
* Drag and drop files to comment editor to add a file attachment
* Using Vue to render comments
Since comments now has attachments we need to update the schemas
./manage.py maintenance replace_pillar_node_type_schemas
This is about fixing file documents that do not have a `project` key at
all. Those were deleted by the `delete_projectless_files` management
command and restored manually. These commands can fix those file
documents properly, by checking which project they're referenced in, and
setting their `project` property.
Finding the references (`manage.py maintenance find_projects_for_files`)
is a heavy operation as it inspects all nodes and all projects. This can
be done offline on a cloned database, and the result stored in a JSON
file. This JSON file can then be processed on the production server
(`manage.py maintenance fix_projects_for_files /path/to/file.json --go`)
to perform the fix.
This should work around a bug in Celery where long Celery tasks would
time out and be re-queued, causing an infinite loop.
See https://github.com/celery/celery/issues/3430 for more info.
Changed how and what we store in elastic to unify it with how we store
things in mongodb so we can have more generic javascript code
to render the data.
Elastic changes:
Added:
Node.project.url
Altered to store id instead of url
Node.picture
Made Post searchable
./manage.py elastic reset_index
./manage.py elastic reindex
Thanks to Pablo and Sybren
project.
Javascript tutti.js and timeline.js is needed, and then the following to
init the timeline:
$('.timeline')
.timeline({
url: '/api/timeline'
});
# Javascript Notes:
## ES6 transpile:
* Files in src/scripts/js/es6/common will be transpiled from
modern es6 js to old es5 js, and then added to tutti.js
* Files in src/scripts/js/es6/individual will be transpiled from
modern es6 js to old es5 js to individual module files
## JS Testing
* Added the Jest test framework to write javascript tests.
* `npm test` will run all the javascript tests
Thanks to Sybren for reviewing
Unable to play video in in project header in firefox.
Reason:
Firefox is missing ResizeObserver, so as a workaround videoJs inserts an
iframe bellow the video and listens to resize events on that. This iframe
lands in front of the video when we use the class ".embed-responsive",
and therefore we can not start the wideo.
Solution:
I could not see any difference in how the page was rendered
with/without this class so I removed it.
Reason:
* To decouple code
* Have the loading bar active until whole page stopped working
* Have local loading info
Usage:
$.('.myClass')
.on('pillar:workStart', function(){
... do stuff locally while loading ...
})
.on('pillar:workStop', function(){
... stop do stuff locally while loading ...
})
$.('.myClass .mySubClass').trigger('pillar:workStart')
... do stuff ...
$.('.myClass .mySubClass').trigger('pillar:workStop')