[PR #4794] [MERGED] feat: generic calculations #6447

Closed
opened 2026-03-23 22:23:16 +00:00 by mirror · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/AppFlowy-IO/AppFlowy/pull/4794
Author: @Xazin
Created: 3/2/2024
Status: Merged
Merged: 3/5/2024
Merged by: @Xazin

Base: mainHead: feat/generic-calculations


📝 Commits (6)

  • 8fd0ebf feat: add generic calculations
  • a1be9e0 chore: remove row count at bottom of grid
  • 5f30416 chore: merge branch 'upstream/main' into feat/generic-calculations
  • 0082212 Merge branch 'main' into feat/generic-calculations
  • c4bdc24 chore: merge branch 'upstream/main' into feat/generic-calculations
  • 38e357b fix: code review

📊 Changes

15 files changed (+222 additions, -127 deletions)

View changed files

📝 frontend/appflowy_flutter/integration_test/desktop/database/database_row_test.dart (+3 -6)
📝 frontend/appflowy_flutter/integration_test/shared/database_test_op.dart (+18 -24)
📝 frontend/appflowy_flutter/lib/plugins/database/application/calculations/calculation_type_ext.dart (+14 -0)
📝 frontend/appflowy_flutter/lib/plugins/database/application/field/type_option/number_format_bloc.dart (+2 -2)
frontend/appflowy_flutter/lib/plugins/database/grid/application/calculations/field_type_calc_ext.dart (+34 -0)
📝 frontend/appflowy_flutter/lib/plugins/database/grid/presentation/grid_page.dart (+0 -39)
📝 frontend/appflowy_flutter/lib/plugins/database/grid/presentation/widgets/calculations/calculate_cell.dart (+22 -23)
📝 frontend/appflowy_flutter/test/bloc_test/grid_test/grid_bloc_test.dart (+5 -3)
📝 frontend/resources/translations/en.json (+7 -2)
📝 frontend/rust-lib/flowy-database2/src/entities/calculation/calculation_entities.rs (+25 -5)
📝 frontend/rust-lib/flowy-database2/src/entities/macros.rs (+3 -0)
📝 frontend/rust-lib/flowy-database2/src/services/calculations/controller.rs (+25 -14)
📝 frontend/rust-lib/flowy-database2/src/services/calculations/service.rs (+45 -4)
📝 frontend/rust-lib/flowy-database2/src/services/database_view/view_calculations.rs (+5 -0)
📝 frontend/rust-lib/flowy-database2/src/services/database_view/view_editor.rs (+14 -5)

📄 Description

This PR adds Count, CountEmpty, and CountNonEmpty as calculations, and these are supported on all Field Types where empty values are allowed. (Count is supported on all field types).

I also removed that little "Count: #" at the bottom of the grid, as the same can now be achieved by adding a calculation.

PR Checklist

  • My code adheres to AppFlowy's Conventions
  • I've listed at least one issue that this PR fixes in the description above.
  • I've added a test(s) to validate changes in this PR, or this PR only contains semantic changes.
  • All existing tests are passing.

🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/AppFlowy-IO/AppFlowy/pull/4794 **Author:** [@Xazin](https://github.com/Xazin) **Created:** 3/2/2024 **Status:** ✅ Merged **Merged:** 3/5/2024 **Merged by:** [@Xazin](https://github.com/Xazin) **Base:** `main` ← **Head:** `feat/generic-calculations` --- ### 📝 Commits (6) - [`8fd0ebf`](https://github.com/AppFlowy-IO/AppFlowy/commit/8fd0ebf365b3fadaacb542e434c2afb89328a044) feat: add generic calculations - [`a1be9e0`](https://github.com/AppFlowy-IO/AppFlowy/commit/a1be9e09a0fc1e5090d6c0a2bb2b788b3d3f1099) chore: remove row count at bottom of grid - [`5f30416`](https://github.com/AppFlowy-IO/AppFlowy/commit/5f3041672ce3f1d7521b2b590248b9288deb91c0) chore: merge branch 'upstream/main' into feat/generic-calculations - [`0082212`](https://github.com/AppFlowy-IO/AppFlowy/commit/008221274f4aa727552b1d7d1678497a34cd3dd2) Merge branch 'main' into feat/generic-calculations - [`c4bdc24`](https://github.com/AppFlowy-IO/AppFlowy/commit/c4bdc24a558adf2302a89e293737e1a10b594193) chore: merge branch 'upstream/main' into feat/generic-calculations - [`38e357b`](https://github.com/AppFlowy-IO/AppFlowy/commit/38e357b92c513d2b8eb4d7c2a9af8970a3d72810) fix: code review ### 📊 Changes **15 files changed** (+222 additions, -127 deletions) <details> <summary>View changed files</summary> 📝 `frontend/appflowy_flutter/integration_test/desktop/database/database_row_test.dart` (+3 -6) 📝 `frontend/appflowy_flutter/integration_test/shared/database_test_op.dart` (+18 -24) 📝 `frontend/appflowy_flutter/lib/plugins/database/application/calculations/calculation_type_ext.dart` (+14 -0) 📝 `frontend/appflowy_flutter/lib/plugins/database/application/field/type_option/number_format_bloc.dart` (+2 -2) ➕ `frontend/appflowy_flutter/lib/plugins/database/grid/application/calculations/field_type_calc_ext.dart` (+34 -0) 📝 `frontend/appflowy_flutter/lib/plugins/database/grid/presentation/grid_page.dart` (+0 -39) 📝 `frontend/appflowy_flutter/lib/plugins/database/grid/presentation/widgets/calculations/calculate_cell.dart` (+22 -23) 📝 `frontend/appflowy_flutter/test/bloc_test/grid_test/grid_bloc_test.dart` (+5 -3) 📝 `frontend/resources/translations/en.json` (+7 -2) 📝 `frontend/rust-lib/flowy-database2/src/entities/calculation/calculation_entities.rs` (+25 -5) 📝 `frontend/rust-lib/flowy-database2/src/entities/macros.rs` (+3 -0) 📝 `frontend/rust-lib/flowy-database2/src/services/calculations/controller.rs` (+25 -14) 📝 `frontend/rust-lib/flowy-database2/src/services/calculations/service.rs` (+45 -4) 📝 `frontend/rust-lib/flowy-database2/src/services/database_view/view_calculations.rs` (+5 -0) 📝 `frontend/rust-lib/flowy-database2/src/services/database_view/view_editor.rs` (+14 -5) </details> ### 📄 Description This PR adds Count, CountEmpty, and CountNonEmpty as calculations, and these are supported on all Field Types where empty values are allowed. (Count is supported on all field types). I also removed that little "Count: #" at the bottom of the grid, as the same can now be achieved by adding a calculation. #### PR Checklist - [x] My code adheres to [AppFlowy's Conventions](https://docs.appflowy.io/docs/documentation/software-contributions/conventions) - [ ] I've listed at least one issue that this PR fixes in the description above. - [ ] 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. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
mirror 2026-03-23 22:23:16 +00:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
AppFlowy-IO/AppFlowy#6447
No description provided.