Commit History

Auteur SHA1 Bericht Datum
  Andrew Knox Shiels c79440e2ed No longer require AJAX request results to be propagated by front-end code. Now the views receive AJAX POST, do modification, and send to the sockets. 6 jaren geleden
  Andrew Knox Shiels 54713faf90 Changed database-modifying requests to now use AJAX POST requests instead of using WebSockets. The results from these are then propagated by WebSockets. Not broadcasting error messages solved itself by returning error-coded HTTP responses to erronous AJAX requests. Tested only as far as seeing normal non-erronous requests being serviced, the results propagated, and remaining on refresh. Added new TODO for consumers.py as there now exist redundant consumers. Changed API documentation to reflect AJAX POST usage. 6 jaren geleden
  Andrew Knox Shiels 8edc10289d Added 404 codes for the '<Object> does not exist' exceptions, added (UNTESTED) functionality to send errors only to the connection making the erroneous request instead of broadcasting it (worked for a tag that doesn't actually exist, testing for all models to follow). Updated API documentation to reflect this change, and added documentation for delete_canvas and delete_project views, which I forgot. Finally, modified delete_project to only allow the owner to delete the project - admins of a project may still delete individual canvases. 6 jaren geleden
  Andrew Knox Shiels b4691e0887 Added TODO to models.py and views.py (identical TODOs along with NOTEs in views.py detailing code relevant to aforementioned TODO) stating the current functionality for trial users, while not technically broken, is sub-par and was written as a 'quick fix'. It should probably be updated in future. 6 jaren geleden
  Andrew Knox Shiels 014f91105f Updated requirements, excluding selenium, pytest, twisted as they're not actually used in running the canvas locally. Marked at top of consumers.py and views.py the current known bugs to be fixed in future. 6 jaren geleden
  Andrew Knox Shiels bca26df672 For known singleton elements being JSONified, had the square brackets removed from the start and end of it, going from [element] to element. Additionally, added some extra try-catch statements for presence of models before editing them, and added the ability for failure callbacks to be executed. There is an error field in what's returned from Consumers.py; if this field contains anything when it arrives at front-end, the error callbacks can be called. The data returned in this case is the error code and the reply text eg. if unauthorised, will return error: 401 and text Unauthorized. 6 jaren geleden
  Andrew Knox Shiels d5cfff2439 Changed category to ideaCategory (or idea_category when sending TO backend) to make it clearer what it represents. Assumptions about front-end knowledge of back-end cannot be made. 6 jaren geleden
  Andrew Knox Shiels 4a731b7f69 Fixed more bad names - u -> user, a -> admin, except where they're iterators in a loop, and ui -> userListIndex, ai -> adminListIndex (or user_list_index, admin_list_index within python) 6 jaren geleden
  Andrew Knox Shiels 6edd5366f7 Allowing the user, admin and owner fields to be blank and null for the blank trial canvas. Made all operations be available on public canvasses. 6 jaren geleden
  Andrew Knox Shiels 5929a2dfa4 Forgot to update the trial user functionality after adding projects, done so. Enabled null on project owner for the allowance of the AnonymousUser to have a blank project created (if it doesn't exist) for blank trial canvases. 6 jaren geleden
  Andrew Knox Shiels 7949f8741d Moved removeTag out of front-end (was called for each tag before calling deleteIdea) and included in the delete_idea function in views.py. The same done for moving addTag and removeTag calls out of the editIdeaSuccessCallback and into the edit_idea function in views.py . Those two views.py functions now return the removed tag and its data, and the added and removed tag data for delete_idea and edit_idea respectively. 6 jaren geleden
  Andrew Knox Shiels 7d078ed956 Changed 'i' and 'c' variables in consumers.py and canvasDetail.js to more descriptive 'ideaListIndex' and 'commentListIndex' respectively, except for where they exist only as iterators of a loop. In tag component 'c' is 'canvas' as it interacts with canvases, not comments. 6 jaren geleden
  Andrew Knox Shiels 1cda9e3d66 Tidied up the consumers a lot so that every response is of a constant format, highlighted in the API. API also updated. 6 jaren geleden
  Andrew Knox Shiels e32770252b moving idea.save() to the try-catch block in remove_tag() fixed the bug, removed await database_sync_to_async as it wasn't updating other user with everything (delete idea was only deleting for the other user and not removing the tags, or the other way around 6 jaren geleden
  Andrew Knox Shiels 451e23472f Tidied the views up a bit. Changed the consumers calls to view functions to be await database_sync_to_async (issues with delete_idea consumer and remove_tag consumer accessing the database out of order, remove_tag couldn't remove a tag from an idea that had been deleted). 6 jaren geleden
  Andrew Knox Shiels 5237139b23 Added M2M relation between tags and ideas. Altered view functions to make use of these. remove_tag now removes the current idea from the current tag's idea_set. Delete still removes the tag in its entirety. Add still checks for a tag's existence before creating one. Add and remove tag functions return every tag, every tag's canvas_set and every tag's idea_set to make the updating of these sets on the front-end relatively straightforward. Delete only returns the tag so that the callback can just find its location in its array and remove it. 6 jaren geleden
  Andrew Knox Shiels 6bf2541800 Added comment resolve functionality for a single comment as well as for all comments on an idea. Also, comment resolve, delete and resolveAll buttons are hidden for non-admin users. 6 jaren geleden
  Andrew Knox Shiels e4db0c8c18 Added functionality to the deleteUserSuccessCallback where if the current user is the victim user, they are kicked out of the project and back to their own project-list page without the need for a page reload. 6 jaren geleden
  Andrew Knox Shiels 3ef158e4b6 Moved the collaborator component up to the ProjectDetail page instead of the CanvasDetail page, as user/admin permissions and public toggle option is now a project-level feature instead of an individual canvas feature. 6 jaren geleden
  Andrew Knox Shiels 2a349e7176 Made more fixes and added more stuff to tags. They now automatically add themselves to a canvas when an idea has its text updated in such a way as to contain the label of a tag previously not in the canvas but in the project. On creation of a tag it is added to all canvasses where it occurs. On deletion of the tag it is deleted from everywhere. 6 jaren geleden
  Andrew Knox Shiels fe77d36e8d New canvas create was broken, fixed that. Tags automatically add themselves to a second open canvas containing the label as a substring, while they do not do the same if they do not contain the label. When a tag is removed from one canvas, it is reflected in the other by removing the link in the tag popup. Only tested with two canvasses. 6 jaren geleden
  Andrew Knox Shiels dd85c2f8a2 Added (very untested) project functionality. Users, admins, owner are all moved from Canvas to Project. All canvasses in a project are visible to every user in the project. The same user / admin permissions required as before, but check user in project.users instead of canvas.users. Went ahead with tags existing for all canvasses in a given project (also quite untested). When a tag is created it (should) add itself to any other canvas in the project containing the label as a substring of an idea. Deletion deletes the tag object outright, it doesn't check occurrences in other canvasses. 6 jaren geleden
  Andrew Knox Shiels 6bf5fed11e 'Resolve all comments' no longer deletes comments, instead it marks them as resolved. Added some basic CSS to distinguish resolved from unresolved. 6 jaren geleden
  Andrew Knox Shiels 7ab33db9bc Added some basic CSS to tidy the canvas up a bit, mostly for myself, as I was tired of looking at black-and-white left-aligned text fields. Additionally added a boolean to canvas model is_ethics, true for ethics canvas and false for business canvas. If business canvas, the blocks are labelled as a business canvas's would be, with the extra uncategorised block at the bottom. Newly created canvasses have (Business) or (Ethics) at the end of the default title to show their type. For now, on the anonymous user trial of a canvas, tags and collaborators are outright disabled. 6 jaren geleden
  Andrew Knox Shiels 0ea5d97a3a Added anonymous user functionality. Idea addition, modification and deletion only. Collabs, tags and comments disabled. 6 jaren geleden
  Andrew Knox Shiels 87586e8cf6 Added (online) functionality to the collaborators component where it shows a user as (online) when they log in and removes that message on logout, exception for the current user where it still shows (you) in that space. Removed redundant url mappings and html templates, as the view functions for them were converted into ordinary functions called by their respective websocket consumers. 6 jaren geleden
  Andrew Knox Shiels ae409633cb Added <user> is typing functionality for Ideas. Tested basically with only two logged-in users. 6 jaren geleden
  Andrew Knox Shiels 353fd6d4b5 Added channel / websocket functionality to the project. Each database-modifying function is called by an asynchronous consumer. Tested only basic operation with two different logged-in users viewing the same canvas to see that it updated both when one user changed something. 6 jaren geleden