-
Notifications
You must be signed in to change notification settings - Fork 3
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix: clear sync-status when value changes #182
Conversation
🚀 Deployed on https://pr-182--dhis2-data-entry.netlify.app |
Looks good, but I wonder if we need to address cases where the cell gets updated back to its previously synced value? e.g. I have a cell with synced value 25, I click on it and change it to 250 (the synced status indicator disappears), I delete the 0 and change it back to 25. Now nothing gets posted back, and I've lost the synced status indicator: I think it's more central to locate this logic in InnerWrapper, but also wonder if it would be helpful to put it in the individual input components, so that it's handled along with the logic for updating/syncing values? |
Yeah, I was just thinking that we should handle this. Will put the PR in draft-mode until I've had a change to fix that. |
87e58ab
to
7425972
Compare
8afbe38
to
9813abf
Compare
f15bbfb
to
c0a8483
Compare
@Mohammer5 that was referring to #88 , not this one. EDIT by @Mohammer5: Oh sorry.. Corrected my mistake |
c0cfba7
to
881e465
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In general I think the approach of storing this type of data in the data
property of the RFF Field is perfect. I do wonder about one implementation detail and left a comment in the code about that.
881e465
to
1779a81
Compare
# [100.1.0](v100.0.0...v100.1.0) (2022-10-21) ### Bug Fixes * adjust client time to server timezone when computing date ranges ([#165](#165)) ([af3fa39](af3fa39)) * adjust synced cell style ([#199](#199)) ([32a9d78](32a9d78)) * allow for unit paths starting at the real root instead of user root ([#197](#197)) ([0191551](0191551)) * clear sync-status when value changes ([#182](#182)) ([d4d6d29](d4d6d29)) * ensure offline units are fetched correctly for users deep in the hierarchy ([#226](#226)) ([d9d4632](d9d4632)) * fix disabled cell styling [TECH-1466] ([#234](#234)) ([0334733](0334733)) * global filter field size ([#221](#221)) ([7b003d8](7b003d8)) * handle inconsistent formats from api for orgUnits [DHIS2-13888] ([#210](#210)) ([ab266ca](ab266ca)) * handle invalid parameters in URL [TECH-1382] [TECH-1384] ([#208](#208)) ([3c14bd8](3c14bd8)) * handle temporal mutation errors ([#206](#206)) ([0bb923d](0bb923d)) * highlighted fields performance ([#155](#155)) ([554025c](554025c)) * import locales so app has access to them ([#207](#207)) ([662ddc6](662ddc6)) * make bottom bar buttons small [DHIS2-13956] ([c507860](c507860)) * make useDataValueParams and useApiAttributeParams stable ([978a7b9](978a7b9)) * manage unsaved comments when moving cells ([b04cbfd](b04cbfd)) * manage unsaved limits when moving cells ([dd14d41](dd14d41)) * or between shortcuts [DHIS2-13955] ([d71a93b](d71a93b)) * print styles [TECH-1312] ([#217](#217)) ([5533e00](5533e00)) * remove defaultOnSuccess for queries ([75e257e](75e257e)) * rerun validation on main bar button click ([d62e4a0](d62e4a0)) * stop tooltip flickering [DHIS2-13954] ([0c44cb5](0c44cb5)) * update variable name [TECH-1465] ([#231](#231)) ([1fd682f](1fd682f)) * **audit history:** update processing, clean up [TECH-1281] ([#131](#131)) ([7464efb](7464efb)) * **basic information:** display client date in tooltip ([da867a7](da867a7)) * **data-value-set:** disable when mutating ([85e7cbc](85e7cbc)) * **dates:** use server time when appropriate ([b8cbdbc](b8cbdbc)) * **deps:** pin dependencies ([35fdd45](35fdd45)) * **deps:** update dependency @dhis2/app-runtime to v3.5.0 ([#224](#224)) ([f532607](f532607)) * **deps:** update dependency @dhis2/ui to v8.5.3 ([#225](#225)) ([7b27ee1](7b27ee1)) * **filter-field:** hide clear-button when no filter ([#222](#222)) ([64b08dc](64b08dc)) * remove custom styles for data details button ([e47d519](e47d519)) * update Add limits styling [DHIS2-13958] ([2f528ba](2f528ba)) * **translations:** sync translations from transifex (development) ([76859da](76859da)) * **translations:** sync translations from transifex (development) ([db5b088](db5b088)) * **translations:** sync translations from transifex (development) ([9724342](9724342)) * **use date limit:** prevent recomputing on every re-render ([68dbbcb](68dbbcb)) * **validation button:** disable validation run when offline [TECH-1377] ([#178](#178)) ([7838601](7838601)) * use a stable date string instead of an instable date instance ([#201](#201)) ([dea42b1](dea42b1)) ### Features * **headerbar:** integrate offline-status message ([#233](#233)) ([58f042e](58f042e)) * sync error handling ([#218](#218)) ([cf3e542](cf3e542)) * **client server date:** add DRY utils ([7153fe3](7153fe3)) * **get current date:** set milliseconds to 0 ([9fa0441](9fa0441)) * respect F_DATAVALUE_ADD user authority ([e91a847](e91a847)) * **custom forms:** notify user about pre-fetching failure ([9e8374f](9e8374f))
🎉 This PR is included in version 100.1.0 🎉 The release is available on: Your semantic-release bot 📦🚀 |
I've moved the
syncStatus
to use react-final-formmutator
, and instead of manually settingsynced: true
, we're calculating thesyncStatus
based on thelastSyncedValue
.It can be argued whether it's necessary to have
lastSyncedValue
in themeta.data
usingmutators
- since we could've just used the previoussetSyncStatus
. But this sets up the wiring required for settingsyncErrors
as well, and we might as well gather these in themeta.data
. Also means that we can cleanup the deep passing of thesyncStatus
andsetSyncStatus
.