mirror of
https://github.com/AppFlowy-IO/AppFlowy.git
synced 2024-08-30 18:12:39 +00:00
chore: refresh UI after deleting all sorts (#2573)
* chore: disable snapshot for now * chore: notify the fronted to refresh after deleting all the sorts
This commit is contained in:
parent
6c31cf9555
commit
eaa1dcdeb9
@ -80,7 +80,7 @@ class SortBackendService {
|
|||||||
required String sortId,
|
required String sortId,
|
||||||
required FieldType fieldType,
|
required FieldType fieldType,
|
||||||
}) {
|
}) {
|
||||||
final deleteFilterPayload = DeleteSortPayloadPB.create()
|
final deleteSortPayload = DeleteSortPayloadPB.create()
|
||||||
..fieldId = fieldId
|
..fieldId = fieldId
|
||||||
..sortId = sortId
|
..sortId = sortId
|
||||||
..viewId = viewId
|
..viewId = viewId
|
||||||
@ -88,7 +88,7 @@ class SortBackendService {
|
|||||||
|
|
||||||
final payload = DatabaseSettingChangesetPB.create()
|
final payload = DatabaseSettingChangesetPB.create()
|
||||||
..viewId = viewId
|
..viewId = viewId
|
||||||
..deleteSort = deleteFilterPayload;
|
..deleteSort = deleteSortPayload;
|
||||||
|
|
||||||
return DatabaseEventUpdateDatabaseSetting(payload).send().then((result) {
|
return DatabaseEventUpdateDatabaseSetting(payload).send().then((result) {
|
||||||
return result.fold(
|
return result.fold(
|
||||||
|
45
frontend/appflowy_tauri/src-tauri/Cargo.lock
generated
45
frontend/appflowy_tauri/src-tauri/Cargo.lock
generated
@ -99,7 +99,7 @@ checksum = "9c7d0618f0e0b7e8ff11427422b64564d5fb0be1940354bfe2e0529b18a9d9b8"
|
|||||||
[[package]]
|
[[package]]
|
||||||
name = "appflowy-integrate"
|
name = "appflowy-integrate"
|
||||||
version = "0.1.0"
|
version = "0.1.0"
|
||||||
source = "git+https://github.com/AppFlowy-IO/AppFlowy-Collab?rev=d074c9#d074c94471f222e2701fe451f13c51aab39d2bf8"
|
source = "git+https://github.com/AppFlowy-IO/AppFlowy-Collab?rev=7a2e97#7a2e97d9bfe746f5db18753ab0b59347ec5bf23f"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"collab",
|
"collab",
|
||||||
"collab-database",
|
"collab-database",
|
||||||
@ -575,9 +575,9 @@ dependencies = [
|
|||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "bindgen"
|
name = "bindgen"
|
||||||
version = "0.64.0"
|
version = "0.65.1"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "c4243e6031260db77ede97ad86c27e501d646a27ab57b59a574f725d98ab1fb4"
|
checksum = "cfdf7b466f9a4903edc73f95d6d2bcd5baf8ae620638762244d3f60143643cc5"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"bitflags",
|
"bitflags",
|
||||||
"cexpr",
|
"cexpr",
|
||||||
@ -585,12 +585,13 @@ dependencies = [
|
|||||||
"lazy_static",
|
"lazy_static",
|
||||||
"lazycell",
|
"lazycell",
|
||||||
"peeking_take_while",
|
"peeking_take_while",
|
||||||
|
"prettyplease",
|
||||||
"proc-macro2",
|
"proc-macro2",
|
||||||
"quote",
|
"quote",
|
||||||
"regex",
|
"regex",
|
||||||
"rustc-hash",
|
"rustc-hash",
|
||||||
"shlex",
|
"shlex",
|
||||||
"syn 1.0.109",
|
"syn 2.0.16",
|
||||||
]
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
@ -1020,7 +1021,7 @@ dependencies = [
|
|||||||
[[package]]
|
[[package]]
|
||||||
name = "collab"
|
name = "collab"
|
||||||
version = "0.1.0"
|
version = "0.1.0"
|
||||||
source = "git+https://github.com/AppFlowy-IO/AppFlowy-Collab?rev=d074c9#d074c94471f222e2701fe451f13c51aab39d2bf8"
|
source = "git+https://github.com/AppFlowy-IO/AppFlowy-Collab?rev=7a2e97#7a2e97d9bfe746f5db18753ab0b59347ec5bf23f"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"anyhow",
|
"anyhow",
|
||||||
"bytes",
|
"bytes",
|
||||||
@ -1037,7 +1038,7 @@ dependencies = [
|
|||||||
[[package]]
|
[[package]]
|
||||||
name = "collab-client-ws"
|
name = "collab-client-ws"
|
||||||
version = "0.1.0"
|
version = "0.1.0"
|
||||||
source = "git+https://github.com/AppFlowy-IO/AppFlowy-Collab?rev=d074c9#d074c94471f222e2701fe451f13c51aab39d2bf8"
|
source = "git+https://github.com/AppFlowy-IO/AppFlowy-Collab?rev=7a2e97#7a2e97d9bfe746f5db18753ab0b59347ec5bf23f"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"bytes",
|
"bytes",
|
||||||
"collab-sync",
|
"collab-sync",
|
||||||
@ -1055,7 +1056,7 @@ dependencies = [
|
|||||||
[[package]]
|
[[package]]
|
||||||
name = "collab-database"
|
name = "collab-database"
|
||||||
version = "0.1.0"
|
version = "0.1.0"
|
||||||
source = "git+https://github.com/AppFlowy-IO/AppFlowy-Collab?rev=d074c9#d074c94471f222e2701fe451f13c51aab39d2bf8"
|
source = "git+https://github.com/AppFlowy-IO/AppFlowy-Collab?rev=7a2e97#7a2e97d9bfe746f5db18753ab0b59347ec5bf23f"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"anyhow",
|
"anyhow",
|
||||||
"async-trait",
|
"async-trait",
|
||||||
@ -1079,7 +1080,7 @@ dependencies = [
|
|||||||
[[package]]
|
[[package]]
|
||||||
name = "collab-derive"
|
name = "collab-derive"
|
||||||
version = "0.1.0"
|
version = "0.1.0"
|
||||||
source = "git+https://github.com/AppFlowy-IO/AppFlowy-Collab?rev=d074c9#d074c94471f222e2701fe451f13c51aab39d2bf8"
|
source = "git+https://github.com/AppFlowy-IO/AppFlowy-Collab?rev=7a2e97#7a2e97d9bfe746f5db18753ab0b59347ec5bf23f"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"proc-macro2",
|
"proc-macro2",
|
||||||
"quote",
|
"quote",
|
||||||
@ -1091,7 +1092,7 @@ dependencies = [
|
|||||||
[[package]]
|
[[package]]
|
||||||
name = "collab-document"
|
name = "collab-document"
|
||||||
version = "0.1.0"
|
version = "0.1.0"
|
||||||
source = "git+https://github.com/AppFlowy-IO/AppFlowy-Collab?rev=d074c9#d074c94471f222e2701fe451f13c51aab39d2bf8"
|
source = "git+https://github.com/AppFlowy-IO/AppFlowy-Collab?rev=7a2e97#7a2e97d9bfe746f5db18753ab0b59347ec5bf23f"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"anyhow",
|
"anyhow",
|
||||||
"collab",
|
"collab",
|
||||||
@ -1108,7 +1109,7 @@ dependencies = [
|
|||||||
[[package]]
|
[[package]]
|
||||||
name = "collab-folder"
|
name = "collab-folder"
|
||||||
version = "0.1.0"
|
version = "0.1.0"
|
||||||
source = "git+https://github.com/AppFlowy-IO/AppFlowy-Collab?rev=d074c9#d074c94471f222e2701fe451f13c51aab39d2bf8"
|
source = "git+https://github.com/AppFlowy-IO/AppFlowy-Collab?rev=7a2e97#7a2e97d9bfe746f5db18753ab0b59347ec5bf23f"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"anyhow",
|
"anyhow",
|
||||||
"collab",
|
"collab",
|
||||||
@ -1126,7 +1127,7 @@ dependencies = [
|
|||||||
[[package]]
|
[[package]]
|
||||||
name = "collab-persistence"
|
name = "collab-persistence"
|
||||||
version = "0.1.0"
|
version = "0.1.0"
|
||||||
source = "git+https://github.com/AppFlowy-IO/AppFlowy-Collab?rev=d074c9#d074c94471f222e2701fe451f13c51aab39d2bf8"
|
source = "git+https://github.com/AppFlowy-IO/AppFlowy-Collab?rev=7a2e97#7a2e97d9bfe746f5db18753ab0b59347ec5bf23f"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"bincode",
|
"bincode",
|
||||||
"chrono",
|
"chrono",
|
||||||
@ -1146,7 +1147,7 @@ dependencies = [
|
|||||||
[[package]]
|
[[package]]
|
||||||
name = "collab-plugins"
|
name = "collab-plugins"
|
||||||
version = "0.1.0"
|
version = "0.1.0"
|
||||||
source = "git+https://github.com/AppFlowy-IO/AppFlowy-Collab?rev=d074c9#d074c94471f222e2701fe451f13c51aab39d2bf8"
|
source = "git+https://github.com/AppFlowy-IO/AppFlowy-Collab?rev=7a2e97#7a2e97d9bfe746f5db18753ab0b59347ec5bf23f"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"anyhow",
|
"anyhow",
|
||||||
"async-trait",
|
"async-trait",
|
||||||
@ -1172,7 +1173,7 @@ dependencies = [
|
|||||||
[[package]]
|
[[package]]
|
||||||
name = "collab-sync"
|
name = "collab-sync"
|
||||||
version = "0.1.0"
|
version = "0.1.0"
|
||||||
source = "git+https://github.com/AppFlowy-IO/AppFlowy-Collab?rev=d074c9#d074c94471f222e2701fe451f13c51aab39d2bf8"
|
source = "git+https://github.com/AppFlowy-IO/AppFlowy-Collab?rev=7a2e97#7a2e97d9bfe746f5db18753ab0b59347ec5bf23f"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"bytes",
|
"bytes",
|
||||||
"collab",
|
"collab",
|
||||||
@ -3107,9 +3108,9 @@ checksum = "f7012b1bbb0719e1097c47611d3898568c546d597c2e74d66f6087edd5233ff4"
|
|||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "librocksdb-sys"
|
name = "librocksdb-sys"
|
||||||
version = "0.10.0+7.9.2"
|
version = "0.11.0+8.1.1"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "0fe4d5874f5ff2bc616e55e8c6086d478fcda13faf9495768a4aa1c22042d30b"
|
checksum = "d3386f101bcb4bd252d8e9d2fb41ec3b0862a15a62b478c355b2982efa469e3e"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"bindgen",
|
"bindgen",
|
||||||
"bzip2-sys",
|
"bzip2-sys",
|
||||||
@ -4005,6 +4006,16 @@ version = "0.1.1"
|
|||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "925383efa346730478fb4838dbe9137d2a47675ad789c546d150a6e1dd4ab31c"
|
checksum = "925383efa346730478fb4838dbe9137d2a47675ad789c546d150a6e1dd4ab31c"
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "prettyplease"
|
||||||
|
version = "0.2.5"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "617feabb81566b593beb4886fb8c1f38064169dae4dccad0e3220160c3b37203"
|
||||||
|
dependencies = [
|
||||||
|
"proc-macro2",
|
||||||
|
"syn 2.0.16",
|
||||||
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "proc-macro-crate"
|
name = "proc-macro-crate"
|
||||||
version = "0.1.5"
|
version = "0.1.5"
|
||||||
@ -4475,9 +4486,9 @@ dependencies = [
|
|||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "rocksdb"
|
name = "rocksdb"
|
||||||
version = "0.20.1"
|
version = "0.21.0"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "015439787fce1e75d55f279078d33ff14b4af5d93d995e8838ee4631301c8a99"
|
checksum = "bb6f170a4041d50a0ce04b0d2e14916d6ca863ea2e422689a5b694395d299ffe"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"libc",
|
"libc",
|
||||||
"librocksdb-sys",
|
"librocksdb-sys",
|
||||||
|
@ -51,9 +51,7 @@ impl DatabaseManager2 {
|
|||||||
*self.user_database.lock() = Some(InnerUserDatabase::new(
|
*self.user_database.lock() = Some(InnerUserDatabase::new(
|
||||||
user_id,
|
user_id,
|
||||||
db,
|
db,
|
||||||
RocksDBConfig::default()
|
RocksDBConfig::default(),
|
||||||
.enable_snapshot(true)
|
|
||||||
.snapshot_per_update(10),
|
|
||||||
UserDatabaseCollabBuilderImpl(self.collab_builder.clone()),
|
UserDatabaseCollabBuilderImpl(self.collab_builder.clone()),
|
||||||
));
|
));
|
||||||
// do nothing
|
// do nothing
|
||||||
|
@ -465,8 +465,9 @@ impl DatabaseViewEditor {
|
|||||||
|
|
||||||
pub async fn v_delete_all_sorts(&self) -> FlowyResult<()> {
|
pub async fn v_delete_all_sorts(&self) -> FlowyResult<()> {
|
||||||
let all_sorts = self.v_get_all_sorts().await;
|
let all_sorts = self.v_get_all_sorts().await;
|
||||||
self.delegate.remove_all_sorts(&self.view_id);
|
self.sort_controller.write().await.delete_all_sorts().await;
|
||||||
|
|
||||||
|
self.delegate.remove_all_sorts(&self.view_id);
|
||||||
let mut notification = SortChangesetNotificationPB::new(self.view_id.clone());
|
let mut notification = SortChangesetNotificationPB::new(self.view_id.clone());
|
||||||
notification.delete_sorts = all_sorts.into_iter().map(SortPB::from).collect();
|
notification.delete_sorts = all_sorts.into_iter().map(SortPB::from).collect();
|
||||||
notify_did_update_sort(notification).await;
|
notify_did_update_sort(notification).await;
|
||||||
|
@ -90,7 +90,7 @@ impl SortController {
|
|||||||
let event_type = SortEvent::from_str(predicate).unwrap();
|
let event_type = SortEvent::from_str(predicate).unwrap();
|
||||||
let mut rows = self.delegate.get_rows(&self.view_id).await;
|
let mut rows = self.delegate.get_rows(&self.view_id).await;
|
||||||
match event_type {
|
match event_type {
|
||||||
SortEvent::SortDidChanged => {
|
SortEvent::SortDidChanged | SortEvent::DeleteAllSorts => {
|
||||||
self.sort_rows(&mut rows).await;
|
self.sort_rows(&mut rows).await;
|
||||||
let row_orders = rows
|
let row_orders = rows
|
||||||
.iter()
|
.iter()
|
||||||
@ -165,7 +165,7 @@ impl SortController {
|
|||||||
pub async fn delete_all_sorts(&mut self) {
|
pub async fn delete_all_sorts(&mut self) {
|
||||||
self.sorts.clear();
|
self.sorts.clear();
|
||||||
self
|
self
|
||||||
.gen_task(SortEvent::SortDidChanged, QualityOfService::Background)
|
.gen_task(SortEvent::DeleteAllSorts, QualityOfService::Background)
|
||||||
.await;
|
.await;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -292,6 +292,7 @@ fn cmp_cell(
|
|||||||
enum SortEvent {
|
enum SortEvent {
|
||||||
SortDidChanged,
|
SortDidChanged,
|
||||||
RowDidChanged(RowId),
|
RowDidChanged(RowId),
|
||||||
|
DeleteAllSorts,
|
||||||
}
|
}
|
||||||
|
|
||||||
impl ToString for SortEvent {
|
impl ToString for SortEvent {
|
||||||
|
Loading…
Reference in New Issue
Block a user