#464-Saving-card-content #481
No reviewers
Labels
No labels
_CRITICAL_
API
app
backEnd
Blocked, waiting for further changes
bug
cleanup
close
design
duplicate
enhancement
feature request
frontEnd
help wanted
invalid
low priority
needs input
needs review
project documentation
question
research
reviewed
script
security
SQL
style
testing
topLevel
wontfix
No milestone
No project
No assignees
3 participants
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
Andras/BoundlessFlowCampus2K!481
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "#464-Saving-card-content"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Regarding issues #464, #461 and #462
Problems: 1. Save content from a view to layout, 2. Load content from layout to views.
Solution: These solution has mainly been worked on against the textView since that is one of the few cards that needs to be updated often. 2. To load content from layout to views, it is similar to the process of loading from localstorage. All information gets saved to the localstorage in json format, which gets returned through the getFromLocalStorage function in the SaveGrid.js. 1. Similarly to how solution 2 works, when a layout is created it will be a json object that gets saved to the local storage through functions in the SaveGrid.js. The layout is created when a new view is added, and it contains extra information in a data variable depending on which view it is. To update the layout, the onChange function is used. It references to a updateCardValues function that updates all card values before saving it to local storage. To make the TextView work, other than previously mentioned changes to the layout format by adding the data variable, text is no longer stored in the textview file. Data cannot be stored there if it wants to update and therefore it is always going to be stored in the layout variable in the dashboard. Following the changes to the layout format, the temperatureView was also modified to save its sensorId as a data variable.
Important notes:
Possible improvements:
Review on #464
Whats done
Tested on Windowns 11 using Chrome
+TextView works well.
Inspected following files
What needs to be done
Conclusion
Will merge manually!
Pull request closed