Give a longer description of what this PR addresses and why it's needed
This PR handles the following:
Added general notification system. Currently used only by FirebaseEngine. Can be accessed by importing "showNotification" and "RevisitNotification" type from the "notifications.ts" file in "utils/".
When trying to create a snapshot or archive, if there is no data in the current study, an error will be shown as a notification.
If desired, we can now use the "FirebaseActionResponse" interface in the Firebase storage engine class to assert that the response from any Firebase action will have a status of "SUCCESS" or "FAILED", with a required "error" when "FAILED". "SUCCESS" has an optional set of "notifications" that can then be rendered in our component if desired. This is useful for trying to create snapshots and may be useful for other Firebase actions (designed to be similar to an API response).
Snapshots can now be renamed. Edit icon has been added to left of "restore". Opens a modal for renaming
All snapshots maintain the original snapshot order (so it is always in date created order).
Notifications are stacked. For example, when we restore a snapshot, two actions are performed: first, a new snapshot of the live data is created then the restored data will be copied into the live data. However, if no live data exists, then a warning notification will be shown displaying this. But, the snapshot to be restored will still be copied into the live data (so not a full error, just a partial one). Similarly with archiving: if an error occurs when deleting live data, the notification will be shown displaying this error, but it will not prevent a snapshot from being created.
Changed snapshots list to be a table view. Date Created column has been added.
Provide pictures/videos of the behavior before and after these changes (optional)
NOTE: The messaging for failing to create a snapshot has been changed in the actual code from the image you see below.
Are there any additional TODOs before this PR is ready to go?
TODOs:
[x] Want to add some documentation which points out that upon deletion of live data (or archiving), the config will be re-fetched. So the user will always see one config in the Firebase UI
[x] Need to fix loading with too many snapshots.
[X] Should also include some sort of "data successfully restored" or something when you restore snapshots. Maybe just a non modal alert?
[X] Double check what happens when you restore and there is no live data
Does this PR close any open issues?
Closes #446 , #445
Give a longer description of what this PR addresses and why it's needed
This PR handles the following:
Provide pictures/videos of the behavior before and after these changes (optional)
NOTE: The messaging for failing to create a snapshot has been changed in the actual code from the image you see below.
Are there any additional TODOs before this PR is ready to go?
TODOs: