Implement auto-recover functionality [B: 1403]#483
Merged
Conversation
This may change
Update for bug in `setDate` (in `set-field-values`)
abeverley
reviewed
Dec 22, 2024
Contributor
abeverley
left a comment
There was a problem hiding this comment.
Great work Dave, this is looking really good. I've made a few minor comments so far. I'd also like to test it in practice, but I'm getting Uncaught (in promise) TypeError: crypto.subtle is undefined - any ideas?
src/frontend/components/form-group/autosave/lib/autosaveBase.ts
Outdated
Show resolved
Hide resolved
Also moved ID for current record out of Curval condition
- Added checks to ensure encryption is available for Autorecover - Improved encrypted storage testing - Added NullStorage to disable storage without having to search through all code - Added tests for NullStorage, AppStorage, and GADSStorage classes - Updated test definitions to allow for crypto testing As noted above the modal and field components will not have recovery enabled should encryption be unavailable within storage; this is in order to meet standards for ISO:27001 (DARE is mandatory) - the `setValue` function in the `curval` component should never be called when this is the case, but in case it is, the Null Receiver pattern is used (hence the `NullStorage`, which is a full no-op storage solution for our use case).
droberts-ctrlo
commented
Jan 3, 2025
| * @param {JQuery<HTMLElement> | HTMLElement} el The element to attach the document component to | ||
| */ | ||
| export default function documentComponent(el: JQuery<HTMLElement> | HTMLElement) { | ||
| Promise.all([(new DocumentComponent(el)).init()]); |
Contributor
Author
There was a problem hiding this comment.
We actually need a component to be returned here now
Contributor
Author
There was a problem hiding this comment.
All that's changed here is the change to check for jQuery being defined so all the tests pass as expected
Contributor
Author
There was a problem hiding this comment.
Abstract factory to create the relevant storage provider
Contributor
Author
There was a problem hiding this comment.
These tests are skipped on Node 18
Need to rethink error handling (i.e. `crypto` unavailable etc)
droberts-ctrlo
commented
Jan 8, 2025
droberts-ctrlo
commented
Jan 8, 2025
Said behaviour was only placed in for previous requirement that has since been removed
droberts-ctrlo
commented
Jan 9, 2025
It was found that due to the curval recovery working on events, it was sometimes triggering a write when one isn't required.
Test condition was returning true in unit tests meaning tests failed.
abeverley
reviewed
Jan 20, 2025
Contributor
abeverley
left a comment
There was a problem hiding this comment.
Thanks Dave, almost there!!
src/frontend/components/form-group/autosave/lib/autosaveBase.ts
Outdated
Show resolved
Hide resolved
Also added JSDoc across all new functionality.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.