Commit 05b6ed9
Versioning and history (#3659)
* Implement Versioning and History of Editor Code for Assessment Workspaces
* Create tests for versioning and history feature
* Prevent submit answer from displaying success message, as submit status is the same as version history save status.
* Fix updateVersionName API route and getVersionHistory return value
* Fix bug causing double saving, now only submits answer, and allows the submission to save code to backend
* Change restored versions to be named "(name)-restored" instead of "(timestamp)-restored"
* Prevent autosave in team assessments
* Implement UI for Versioning and History feature
* Implement version preview before restoring
* Fix bug causing duplicate versions to be saved
* Prevent save status indicator from showing in team assessments
* Update test to not check for success message upon autosave
* Update snapshots to align with changes
* Reformatted imports
* Fix bug where save status is not correctly checked and updated, always showing saved even on fail
* Refactor restoreVersionSaga and prevent restoring from auto-submitting in team assessments
* Fix bug where renaming updates the timestamp
* Fix bug where restoring was renaming the wrong version
* update snapshots to match changes
* Fix bug where new UI is not updated for mobile view
* Change return type of sagas for better type safety
* Fix bug where restoring will rename an existing version if the code is not updated
* Memoize sorted array of versions to improve performance
* Fix bug where save button appears incorrectly for individual assessments during loading
* Update snapshot to match bug fixes
* Fix formatting
* Fix bug where the restoreVersion action did not take into account the SagaIterator return type of restoreVersionSaga
* Fix bug where one auto-save can prematurely unblock another, causing an incorrectly timed version history refresh
* Fix bug where UI would show a stale name if the rename API fails
* Change all early returns in performAutoSave to return false instead of undefined
* Change onClick prop to match how other control-bar buttons are typed
* Fix bug where backend saga mock never updates save status
* Change saving status watcher to only work in assessment workspaces
* Fix bug where restoring a version always shows saved even while in the process of saving
* Add check to ensure that timestamp is a naive datetime before appending 'Z"
* Add safeguard to prevent blanking the editor when restoring a malformed version
* Edited clickable versions in the panel to be keyboard-focusable and announced correctly by assistive tech
* Add safeguard to prevent slicing the inserted_at when it is null/undefined
* Fix bug where save button for team assessments is enabled even when a student has not joined a team
* Edit autosaves to only fetch version history if the panel is open to improve performance
* Remove redundant code
* Use .reverse() to sort the versions by timestamp instead of .sort() to improve performance
* Update field to match backend change
* Fix bug where wrong version is renamed after restoring
* Add tests for coverage
* Implement diff viewer when previewing version to restore
* Prevent race condition by making concurrent auto saves wait for the first one to complete
* Fix bug where performAutoSave returns true even if save failed
* Fix bug where admin panel configuration switches were not animating
* Fix bug where hasUnsavedCode is not set to false when restoring identical code
* Make code save when history panel is opened
* Update tests
* Implement configuration setting for enabling and disabling autosave per assessment group and per assessment overrides
* Update tests for configuration of autosave
* Update snapshots
* Fix bug causing duplicate versions when restoring
* Fix bug causing hasUnsavedChanges to be false even when save failed from restoring
* Prevent autosaving from fetch and restore when disabled
* Update tests
* Fix bug where autosave was enabled for MCQ
* Change deduplication check for better performance
* Change restoreVersionSaga to return earlier if autosave is disabled
* Make auto save return earlier if it is a team assessment
* Update tests
* Improve performance of restoring version by removing redundant search
* Update tests
* Improve performance of renaming versions when restoring
* Change default to enable autosave for assessments created before this feature was implemented
* Implement lazy loading of versions for previewing
* Implement collapsible grouping of versions in history panel
* Remove redundant work following backend changes
* Edit reset confirmation message
* Update tests
* Prevent race condition from hanging and blocking future autosaves
* Change direct calls to fetchVersionHistorySaga to action dispatches instead
* Prevent possible indefinite hanging of saga
* Add onSelectVersion to the useEffect dependency array
* Fix bug where rapid selection of versions can cause incorrect code to be displayed
* Update lockfile post-merge
* Remove duplicate dependency
* Remove unnecessary type assertion
* Refactor to use SCSS module for scoping
* Fix global
* Update test snapshots
* Remove unnecessary type assertion
---------
Co-authored-by: Richard Dominick <34370238+RichDom2185@users.noreply.github.com>1 parent 06478a0 commit 05b6ed9
39 files changed
Lines changed: 2636 additions & 97 deletions
File tree
- src
- bootstrap
- commons
- application
- actions/__tests__
- reducers/__tests__
- assessmentWorkspace
- __tests__
- __snapshots__
- assessment
- __tests__
- controlBar
- __tests__
- mocks
- profile/__tests__
- sagas
- WorkspaceSaga
- helpers
- __tests__
- workspace
- __tests__
- features/groundControl
- pages/academy
- adminPanel/subcomponents/assessmentConfigPanel
- grading/subcomponents
- groundControl
- subcomponents
- styles
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
51 | 51 | | |
52 | 52 | | |
53 | 53 | | |
| 54 | + | |
54 | 55 | | |
55 | 56 | | |
56 | 57 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
9 | 9 | | |
10 | 10 | | |
11 | 11 | | |
| 12 | + | |
12 | 13 | | |
13 | 14 | | |
14 | 15 | | |
| |||
24 | 25 | | |
25 | 26 | | |
26 | 27 | | |
| 28 | + | |
27 | 29 | | |
28 | 30 | | |
29 | 31 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
392 | 392 | | |
393 | 393 | | |
394 | 394 | | |
395 | | - | |
| 395 | + | |
| 396 | + | |
| 397 | + | |
| 398 | + | |
| 399 | + | |
| 400 | + | |
| 401 | + | |
| 402 | + | |
| 403 | + | |
| 404 | + | |
| 405 | + | |
396 | 406 | | |
397 | 407 | | |
398 | 408 | | |
| |||
Lines changed: 20 additions & 10 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
268 | 268 | | |
269 | 269 | | |
270 | 270 | | |
271 | | - | |
| 271 | + | |
| 272 | + | |
272 | 273 | | |
273 | 274 | | |
274 | 275 | | |
| |||
280 | 281 | | |
281 | 282 | | |
282 | 283 | | |
283 | | - | |
| 284 | + | |
| 285 | + | |
284 | 286 | | |
285 | 287 | | |
286 | 288 | | |
| |||
292 | 294 | | |
293 | 295 | | |
294 | 296 | | |
295 | | - | |
| 297 | + | |
| 298 | + | |
296 | 299 | | |
297 | 300 | | |
298 | 301 | | |
| |||
726 | 729 | | |
727 | 730 | | |
728 | 731 | | |
729 | | - | |
| 732 | + | |
| 733 | + | |
730 | 734 | | |
731 | 735 | | |
732 | 736 | | |
| |||
738 | 742 | | |
739 | 743 | | |
740 | 744 | | |
741 | | - | |
| 745 | + | |
| 746 | + | |
742 | 747 | | |
743 | 748 | | |
744 | 749 | | |
| |||
750 | 755 | | |
751 | 756 | | |
752 | 757 | | |
753 | | - | |
| 758 | + | |
| 759 | + | |
754 | 760 | | |
755 | 761 | | |
756 | 762 | | |
| |||
762 | 768 | | |
763 | 769 | | |
764 | 770 | | |
765 | | - | |
| 771 | + | |
| 772 | + | |
766 | 773 | | |
767 | 774 | | |
768 | 775 | | |
| |||
774 | 781 | | |
775 | 782 | | |
776 | 783 | | |
777 | | - | |
| 784 | + | |
| 785 | + | |
778 | 786 | | |
779 | 787 | | |
780 | 788 | | |
| |||
786 | 794 | | |
787 | 795 | | |
788 | 796 | | |
789 | | - | |
| 797 | + | |
| 798 | + | |
790 | 799 | | |
791 | 800 | | |
792 | 801 | | |
| |||
807 | 816 | | |
808 | 817 | | |
809 | 818 | | |
810 | | - | |
| 819 | + | |
| 820 | + | |
811 | 821 | | |
812 | 822 | | |
813 | 823 | | |
| |||
Lines changed: 6 additions & 3 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
149 | 149 | | |
150 | 150 | | |
151 | 151 | | |
152 | | - | |
| 152 | + | |
| 153 | + | |
153 | 154 | | |
154 | 155 | | |
155 | 156 | | |
| |||
164 | 165 | | |
165 | 166 | | |
166 | 167 | | |
167 | | - | |
| 168 | + | |
| 169 | + | |
168 | 170 | | |
169 | 171 | | |
170 | 172 | | |
| |||
179 | 181 | | |
180 | 182 | | |
181 | 183 | | |
182 | | - | |
| 184 | + | |
| 185 | + | |
183 | 186 | | |
184 | 187 | | |
185 | 188 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
68 | 68 | | |
69 | 69 | | |
70 | 70 | | |
| 71 | + | |
71 | 72 | | |
72 | 73 | | |
73 | 74 | | |
| |||
112 | 113 | | |
113 | 114 | | |
114 | 115 | | |
| 116 | + | |
115 | 117 | | |
116 | 118 | | |
117 | 119 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
20 | 20 | | |
21 | 21 | | |
22 | 22 | | |
23 | | - | |
| 23 | + | |
| 24 | + | |
24 | 25 | | |
25 | 26 | | |
26 | 27 | | |
| |||
0 commit comments