feat: clear date value
Feature Preview
https://github.com/AppFlowy-IO/AppFlowy/assets/59970707/36571a12-4d59-4e30-8b14-1a18ec211f42
Close #1574
PR Checklist
- [x] My code adheres to the AppFlowy Style Guide
- [x] I've listed at least one issue that this PR fixes in the description above.
- [x] I've added a test(s) to validate changes in this PR, or this PR only contains semantic changes.
- [x] All existing tests are passing.
@dejvizelo looks good to me, but the analyzer warnings must be fixed to get CI to pass.
Are you planning on implementing the TODO comment in this PR or are you going to follow up on it?
@a-wallen I'm planning to implement the TODO comment in this PR but I had some questions I asked in #1574. Maybe you can answer some of those questions? Will fix the analyzer warnings soon too.
@a-wallen I'm planning to implement the TODO comment in this PR but I had some questions I asked in #1574. Maybe you can answer some of those questions? Will fix the analyzer warnings soon too.
I'm not the best person to answer. cc @richardshiue or @appflowy
Hey there @dejvizelo, thanks for taking a jab at this. You can follow the following steps to do the backend:
- Create an event in
rust-lib/flowy-database2/src/event_map.rsnamedClearDateCelland specify the handlerclear_date_cell_handler - Implement the
clear_date_cell_handlerinrust-lib/flowy-database2/src/event_handlers.rs - This should call a new
clear_date_cellfunction inrust-lib/flowy-database2/src/services/database/database_editor.rs. You can refer toupdate_cell_with_changeset. - This should then call a new function
clear_date_cellthat is a method ofDateTypeOption, in it theOption<i64>timestamp will be turned intoNone. You can refer to theApplyChangesettrait implementation forDateTypeOption
On the frontend, you're right, I don't think we need to use the selectDay or setTime functions anymore. In date_cal_bloc, you'd have to dispatch that this new ClearDateCell event and handle it (preferably in a helper function). Good luck and let me know if you need more help!
EDIT: moving the conversation here to discuss implementation details.
Sorry for polluting the history. Had some trouble with Git after develop was merged into main.
@richardshiue Your instructions were very helpful and I've made good progress but I'm struggling with a few things. Can I reach you on Discord for some follow-up questions?
@richardshiue Your instructions were very helpful and I've made good progress but I'm struggling with a few things. Can I reach you on Discord for some follow-up questions?
Of course! My Discord username is richardshiue. You can also find it on under the AppFlowy Contributors section in the Server Members list.
Codecov Report
Merging #2700 (5b1c9cf) into main (d32c208) will increase coverage by
0.03%. The diff coverage is96.55%.
@@ Coverage Diff @@
## main #2700 +/- ##
==========================================
+ Coverage 68.85% 68.88% +0.03%
==========================================
Files 430 430
Lines 20471 20498 +27
==========================================
+ Hits 14095 14121 +26
- Misses 6376 6377 +1
| Flag | Coverage Δ | |
|---|---|---|
| appflowy_flutter_integrateion_test | 65.86% <96.55%> (+0.04%) |
:arrow_up: |
| appflowy_flutter_unit_test | 13.12% <3.44%> (-0.02%) |
:arrow_down: |
Flags with carried forward coverage won't be shown. Click here to find out more.
| Impacted Files | Coverage Δ | |
|---|---|---|
| ...iew/widgets/row/cells/date_cell/date_cal_bloc.dart | 82.40% <91.66%> (+2.75%) |
:arrow_up: |
| ...e_view/application/cell/cell_data_persistence.dart | 93.10% <100.00%> (+0.51%) |
:arrow_up: |
| ...se_view/widgets/row/cells/date_cell/date_cell.dart | 94.00% <100.00%> (ø) |
|
| ...ew/widgets/row/cells/date_cell/date_cell_bloc.dart | 100.00% <100.00%> (ø) |
|
| ..._view/widgets/row/cells/date_cell/date_editor.dart | 96.20% <100.00%> (+0.22%) |
:arrow_up: |
This PR should be either merged or closed by the end of July
@annieappflowy Is there anything I can do about the failing Rust-CI check? Otherwise the PR is ready for review
@dejvizelo thanks for contributing!