Ankita Kalra
|
7f0e35f130
Final iteration making the layout compatible,tags showing the functionality of redirection
|
6 years ago |
Ankita Kalra
|
d9f61044b9
Final iteration making the layout compatible,tags showing the functionality of redirection
|
6 years ago |
Ankita Kalra
|
15da3810ff
Final iteration making the layout compatible,tags showing the functionality of redirection
|
6 years ago |
Ankita Kalra
|
b6a4f8adb9
New Updates
|
6 years ago |
Ankita Kalra
|
2132f6c9b0
added front end functionality, updated websockets with user is typing thing, tags and comments being popped up, layout design yet to be worked upon
|
6 years ago |
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 years ago |
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 years ago |
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 years ago |
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 years ago |
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 years ago |
Andrew Knox Shiels
|
20d63c2366
A few singleton elements being passed to the serializer were not having their enclosing brackets trimmed. Fixed this so that they are now being trimmed.
|
6 years ago |
Andrew Knox Shiels
|
3c1715db0d
addressed a bug where my working front-end wasn't working right with JSONified single model instances.
|
6 years ago |
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 years ago |
Andrew Knox Shiels
|
f1e8d3a6f7
Marked canvas_type in models.py as TODO: 'change canvas_type to strings, update URL parameters to reflect this in routing, views.py, and in the html templates...'
|
6 years ago |
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 years ago |
Andrew Knox Shiels
|
958dc856bf
runserver warned me null has no effect on m2m - removed null=True from project.users and project.admins
|
6 years ago |
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 years ago |
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 years ago |
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 years ago |
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 years ago |
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 years ago |
Andrew Knox Shiels
|
b0e96618f0
Added a first draft of what I think an API should be, and modified user permissions to return 401 unauthorized if user isn't in user-set and 403 forbidden if a user isn't in the admin-set
|
6 years ago |
Andrew Knox Shiels
|
84fed90de3
Data for canvasList and ideaList in the tag-popup weren't updating, so I wasn't totally sure if the data was usable on new tag additions. Using prop value instead seems to have fixed it.
|
6 years ago |
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 years ago |
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 years ago |
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 years ago |
Andrew Knox Shiels
|
78c7e87638
Edited comments component so that when the user us promoted, the admin buttons become visible (resolve 1, resolve all, delete) and on demotion, they disappear.
|
6 years ago |
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 years ago |
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 years ago |
Andrew Knox Shiels
|
3dc6a4d911
Modified canvas model, replaced 'is_ethics' boolean with 'canvas_type' integer to allow for privacy canvas and any other canvas type (so long as the category list exists and is of length 9 with a 10th uncategorised slot) which may arise in the future.
|
6 years ago |