mirror of
https://github.com/AppFlowy-IO/AppFlowy.git
synced 2024-08-30 18:12:39 +00:00
refactor: reanme flowy-grid-data-model to grid-rev-model
This commit is contained in:
parent
d39b31f357
commit
130c5f8e6e
107
frontend/rust-lib/Cargo.lock
generated
107
frontend/rust-lib/Cargo.lock
generated
@ -876,8 +876,8 @@ dependencies = [
|
||||
"rand 0.8.5",
|
||||
"serde",
|
||||
"serde_json",
|
||||
"strum 0.21.0",
|
||||
"strum_macros 0.21.1",
|
||||
"strum",
|
||||
"strum_macros",
|
||||
"tokio",
|
||||
"tracing",
|
||||
"tracing-subscriber",
|
||||
@ -937,13 +937,13 @@ dependencies = [
|
||||
"lib-infra",
|
||||
"lib-ot",
|
||||
"log",
|
||||
"parking_lot 0.11.2",
|
||||
"parking_lot 0.12.1",
|
||||
"pin-project",
|
||||
"protobuf",
|
||||
"serde",
|
||||
"serde_json",
|
||||
"strum 0.21.0",
|
||||
"strum_macros 0.21.1",
|
||||
"strum",
|
||||
"strum_macros",
|
||||
"tokio",
|
||||
"tracing",
|
||||
"unicode-segmentation",
|
||||
@ -965,11 +965,11 @@ dependencies = [
|
||||
"flowy-derive",
|
||||
"flowy-error",
|
||||
"flowy-grid",
|
||||
"flowy-grid-data-model",
|
||||
"flowy-revision",
|
||||
"flowy-sync",
|
||||
"flowy-test",
|
||||
"futures",
|
||||
"grid-rev-model",
|
||||
"indexmap",
|
||||
"lazy_static",
|
||||
"lib-dispatch",
|
||||
@ -984,28 +984,13 @@ dependencies = [
|
||||
"serde",
|
||||
"serde_json",
|
||||
"serde_repr",
|
||||
"strum 0.21.0",
|
||||
"strum_macros 0.21.1",
|
||||
"strum",
|
||||
"strum_macros",
|
||||
"tokio",
|
||||
"tracing",
|
||||
"url",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "flowy-grid-data-model"
|
||||
version = "0.1.0"
|
||||
dependencies = [
|
||||
"bytes",
|
||||
"flowy-error-code",
|
||||
"indexmap",
|
||||
"lib-infra",
|
||||
"nanoid",
|
||||
"serde",
|
||||
"serde_json",
|
||||
"serde_repr",
|
||||
"tracing",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "flowy-net"
|
||||
version = "0.1.0"
|
||||
@ -1037,8 +1022,8 @@ dependencies = [
|
||||
"serde",
|
||||
"serde-aux",
|
||||
"serde_json",
|
||||
"strum 0.21.0",
|
||||
"strum_macros 0.21.1",
|
||||
"strum",
|
||||
"strum_macros",
|
||||
"tokio",
|
||||
"tracing",
|
||||
]
|
||||
@ -1057,11 +1042,11 @@ dependencies = [
|
||||
"lib-infra",
|
||||
"lib-ws",
|
||||
"nanoid",
|
||||
"parking_lot 0.11.2",
|
||||
"parking_lot 0.12.1",
|
||||
"serde",
|
||||
"serde_json",
|
||||
"strum 0.21.0",
|
||||
"strum_macros 0.21.1",
|
||||
"strum",
|
||||
"strum_macros",
|
||||
"tokio",
|
||||
"tracing",
|
||||
]
|
||||
@ -1078,13 +1063,13 @@ dependencies = [
|
||||
"flowy-document",
|
||||
"flowy-folder",
|
||||
"flowy-grid",
|
||||
"flowy-grid-data-model",
|
||||
"flowy-net",
|
||||
"flowy-revision",
|
||||
"flowy-sync",
|
||||
"flowy-user",
|
||||
"futures-core",
|
||||
"futures-util",
|
||||
"grid-rev-model",
|
||||
"lib-dispatch",
|
||||
"lib-infra",
|
||||
"lib-log",
|
||||
@ -1107,19 +1092,19 @@ dependencies = [
|
||||
"dashmap",
|
||||
"dissimilar",
|
||||
"flowy-derive",
|
||||
"flowy-grid-data-model",
|
||||
"folder-rev-model",
|
||||
"futures",
|
||||
"grid-rev-model",
|
||||
"lib-infra",
|
||||
"lib-ot",
|
||||
"log",
|
||||
"md5",
|
||||
"parking_lot 0.11.2",
|
||||
"parking_lot 0.12.1",
|
||||
"protobuf",
|
||||
"serde",
|
||||
"serde_json",
|
||||
"strum 0.21.0",
|
||||
"strum_macros 0.21.1",
|
||||
"strum",
|
||||
"strum_macros",
|
||||
"tokio",
|
||||
"tracing",
|
||||
"url",
|
||||
@ -1188,8 +1173,8 @@ dependencies = [
|
||||
"serde",
|
||||
"serde_json",
|
||||
"serial_test",
|
||||
"strum 0.21.0",
|
||||
"strum_macros 0.21.1",
|
||||
"strum",
|
||||
"strum_macros",
|
||||
"tokio",
|
||||
"tracing",
|
||||
"unicode-segmentation",
|
||||
@ -1212,8 +1197,8 @@ dependencies = [
|
||||
"serde",
|
||||
"serde_json",
|
||||
"serde_repr",
|
||||
"strum 0.24.1",
|
||||
"strum_macros 0.24.3",
|
||||
"strum",
|
||||
"strum_macros",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
@ -1411,6 +1396,19 @@ dependencies = [
|
||||
"walkdir",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "grid-rev-model"
|
||||
version = "0.1.0"
|
||||
dependencies = [
|
||||
"bytes",
|
||||
"flowy-error-code",
|
||||
"indexmap",
|
||||
"nanoid",
|
||||
"serde",
|
||||
"serde_json",
|
||||
"serde_repr",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "h2"
|
||||
version = "0.3.10"
|
||||
@ -1451,12 +1449,6 @@ dependencies = [
|
||||
"unicode-segmentation",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "heck"
|
||||
version = "0.4.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "2540771e65fc8cb83cd6e8a237f70c319bd5c29f78ed1084ba5d50eeac86f7f9"
|
||||
|
||||
[[package]]
|
||||
name = "hermit-abi"
|
||||
version = "0.1.19"
|
||||
@ -1781,8 +1773,8 @@ dependencies = [
|
||||
"serde",
|
||||
"serde_json",
|
||||
"serde_repr",
|
||||
"strum 0.21.0",
|
||||
"strum_macros 0.21.1",
|
||||
"strum",
|
||||
"strum_macros",
|
||||
"thiserror",
|
||||
"tokio",
|
||||
"tracing",
|
||||
@ -1821,8 +1813,8 @@ dependencies = [
|
||||
"paste",
|
||||
"pin-project",
|
||||
"protobuf",
|
||||
"strum 0.21.0",
|
||||
"strum_macros 0.21.1",
|
||||
"strum",
|
||||
"strum_macros",
|
||||
"tokio",
|
||||
"tokio-tungstenite",
|
||||
"tracing",
|
||||
@ -3110,37 +3102,18 @@ version = "0.21.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "aaf86bbcfd1fa9670b7a129f64fc0c9fcbbfe4f1bc4210e9e98fe71ffc12cde2"
|
||||
|
||||
[[package]]
|
||||
name = "strum"
|
||||
version = "0.24.1"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "063e6045c0e62079840579a7e47a355ae92f60eb74daaf156fb1e84ba164e63f"
|
||||
|
||||
[[package]]
|
||||
name = "strum_macros"
|
||||
version = "0.21.1"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "d06aaeeee809dbc59eb4556183dd927df67db1540de5be8d3ec0b6636358a5ec"
|
||||
dependencies = [
|
||||
"heck 0.3.3",
|
||||
"heck",
|
||||
"proc-macro2",
|
||||
"quote",
|
||||
"syn",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "strum_macros"
|
||||
version = "0.24.3"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "1e385be0d24f186b4ce2f9982191e7101bb737312ad61c1f2f984f34bcf85d59"
|
||||
dependencies = [
|
||||
"heck 0.4.0",
|
||||
"proc-macro2",
|
||||
"quote",
|
||||
"rustversion",
|
||||
"syn",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "syn"
|
||||
version = "1.0.85"
|
||||
|
@ -19,7 +19,7 @@ dart-notify = { path = "../dart-notify" }
|
||||
lib-dispatch = { path = "../lib-dispatch" }
|
||||
flowy-revision = { path = "../flowy-revision" }
|
||||
|
||||
parking_lot = "0.11"
|
||||
parking_lot = "0.12.1"
|
||||
protobuf = {version = "2.18.0"}
|
||||
log = "0.4.14"
|
||||
diesel = {version = "1.4.8", features = ["sqlite"]}
|
||||
|
@ -13,7 +13,7 @@ flowy-error = { path = "../flowy-error", features = ["db"]}
|
||||
flowy-derive = { path = "../../../shared-lib/flowy-derive" }
|
||||
lib-ot = { path = "../../../shared-lib/lib-ot" }
|
||||
lib-infra = { path = "../../../shared-lib/lib-infra" }
|
||||
flowy-grid-data-model = { path = "../../../shared-lib/flowy-grid-data-model" }
|
||||
grid-rev-model = { path = "../../../shared-lib/grid-rev-model" }
|
||||
flowy-sync = { path = "../../../shared-lib/flowy-sync" }
|
||||
flowy-database = { path = "../flowy-database" }
|
||||
|
||||
|
@ -1,7 +1,7 @@
|
||||
use crate::entities::parser::NotEmptyStr;
|
||||
use flowy_derive::ProtoBuf;
|
||||
use flowy_error::ErrorCode;
|
||||
use flowy_grid_data_model::parser::NotEmptyStr;
|
||||
use flowy_grid_data_model::revision::RowRevision;
|
||||
use grid_rev_model::RowRevision;
|
||||
use std::sync::Arc;
|
||||
|
||||
/// [BlockPB] contains list of row ids. The rows here does not contain any data, just the id
|
||||
|
@ -1,8 +1,8 @@
|
||||
use crate::entities::parser::NotEmptyStr;
|
||||
use crate::entities::FieldType;
|
||||
use flowy_derive::ProtoBuf;
|
||||
use flowy_error::ErrorCode;
|
||||
use flowy_grid_data_model::parser::NotEmptyStr;
|
||||
use flowy_grid_data_model::revision::{CellRevision, RowChangeset};
|
||||
use grid_rev_model::{CellRevision, RowChangeset};
|
||||
use std::collections::HashMap;
|
||||
|
||||
#[derive(ProtoBuf, Default)]
|
||||
|
@ -1,10 +1,10 @@
|
||||
use flowy_derive::{ProtoBuf, ProtoBuf_Enum};
|
||||
use flowy_error::ErrorCode;
|
||||
use flowy_grid_data_model::parser::NotEmptyStr;
|
||||
use flowy_grid_data_model::revision::{FieldRevision, FieldTypeRevision};
|
||||
use grid_rev_model::{FieldRevision, FieldTypeRevision};
|
||||
use serde_repr::*;
|
||||
use std::sync::Arc;
|
||||
|
||||
use crate::entities::parser::NotEmptyStr;
|
||||
use strum_macros::{Display, EnumCount as EnumCountMacro, EnumIter, EnumString};
|
||||
|
||||
/// [FieldPB] defines a Field's attributes. Such as the name, field_type, and width. etc.
|
||||
|
@ -1,6 +1,6 @@
|
||||
use flowy_derive::{ProtoBuf, ProtoBuf_Enum};
|
||||
use flowy_error::ErrorCode;
|
||||
use flowy_grid_data_model::revision::FilterConfigurationRevision;
|
||||
use grid_rev_model::FilterConfigurationRevision;
|
||||
use std::sync::Arc;
|
||||
|
||||
#[derive(Eq, PartialEq, ProtoBuf, Debug, Default, Clone)]
|
||||
|
@ -1,8 +1,8 @@
|
||||
use crate::entities::parser::NotEmptyStr;
|
||||
use crate::entities::FieldType;
|
||||
use flowy_derive::{ProtoBuf, ProtoBuf_Enum};
|
||||
use flowy_error::ErrorCode;
|
||||
use flowy_grid_data_model::parser::NotEmptyStr;
|
||||
use flowy_grid_data_model::revision::FilterConfigurationRevision;
|
||||
use grid_rev_model::FilterConfigurationRevision;
|
||||
use serde::{Deserialize, Serialize};
|
||||
use std::str::FromStr;
|
||||
use std::sync::Arc;
|
||||
|
@ -1,6 +1,6 @@
|
||||
use flowy_derive::{ProtoBuf, ProtoBuf_Enum};
|
||||
use flowy_error::ErrorCode;
|
||||
use flowy_grid_data_model::revision::FilterConfigurationRevision;
|
||||
use grid_rev_model::FilterConfigurationRevision;
|
||||
|
||||
use std::sync::Arc;
|
||||
|
||||
|
@ -1,7 +1,7 @@
|
||||
use crate::services::field::SelectOptionIds;
|
||||
use flowy_derive::{ProtoBuf, ProtoBuf_Enum};
|
||||
use flowy_error::ErrorCode;
|
||||
use flowy_grid_data_model::revision::FilterConfigurationRevision;
|
||||
use grid_rev_model::FilterConfigurationRevision;
|
||||
use std::sync::Arc;
|
||||
|
||||
#[derive(Eq, PartialEq, ProtoBuf, Debug, Default, Clone)]
|
||||
|
@ -1,6 +1,6 @@
|
||||
use flowy_derive::{ProtoBuf, ProtoBuf_Enum};
|
||||
use flowy_error::ErrorCode;
|
||||
use flowy_grid_data_model::revision::FilterConfigurationRevision;
|
||||
use grid_rev_model::FilterConfigurationRevision;
|
||||
use std::sync::Arc;
|
||||
|
||||
#[derive(Eq, PartialEq, ProtoBuf, Debug, Default, Clone)]
|
||||
|
@ -1,11 +1,11 @@
|
||||
use crate::entities::parser::NotEmptyStr;
|
||||
use crate::entities::{
|
||||
CheckboxCondition, DateFilterCondition, FieldType, NumberFilterCondition, SelectOptionCondition,
|
||||
TextFilterCondition,
|
||||
};
|
||||
use flowy_derive::ProtoBuf;
|
||||
use flowy_error::ErrorCode;
|
||||
use flowy_grid_data_model::parser::NotEmptyStr;
|
||||
use flowy_grid_data_model::revision::{FieldRevision, FieldTypeRevision, FilterConfigurationRevision};
|
||||
use grid_rev_model::{FieldRevision, FieldTypeRevision, FilterConfigurationRevision};
|
||||
use std::convert::TryInto;
|
||||
use std::sync::Arc;
|
||||
|
||||
|
@ -1,7 +1,7 @@
|
||||
use crate::entities::parser::NotEmptyStr;
|
||||
use crate::entities::{BlockPB, FieldIdPB};
|
||||
use flowy_derive::ProtoBuf;
|
||||
use flowy_error::ErrorCode;
|
||||
use flowy_grid_data_model::parser::NotEmptyStr;
|
||||
|
||||
/// [GridPB] describes how many fields and blocks the grid has
|
||||
#[derive(Debug, Clone, Default, ProtoBuf)]
|
||||
|
@ -1,5 +1,5 @@
|
||||
use flowy_derive::{ProtoBuf, ProtoBuf_Enum};
|
||||
use flowy_grid_data_model::revision::{GroupRevision, SelectOptionGroupConfigurationRevision};
|
||||
use grid_rev_model::{GroupRevision, SelectOptionGroupConfigurationRevision};
|
||||
|
||||
#[derive(Eq, PartialEq, ProtoBuf, Debug, Default, Clone)]
|
||||
pub struct UrlGroupConfigurationPB {
|
||||
|
@ -1,9 +1,9 @@
|
||||
use crate::entities::parser::NotEmptyStr;
|
||||
use crate::entities::{CreateRowParams, FieldType, GridLayout, RowPB};
|
||||
use crate::services::group::Group;
|
||||
use flowy_derive::ProtoBuf;
|
||||
use flowy_error::ErrorCode;
|
||||
use flowy_grid_data_model::parser::NotEmptyStr;
|
||||
use flowy_grid_data_model::revision::{FieldTypeRevision, GroupConfigurationRevision};
|
||||
use grid_rev_model::{FieldTypeRevision, GroupConfigurationRevision};
|
||||
use std::convert::TryInto;
|
||||
use std::sync::Arc;
|
||||
|
||||
|
@ -1,7 +1,7 @@
|
||||
use crate::entities::parser::NotEmptyStr;
|
||||
use crate::entities::{GroupPB, InsertedRowPB, RowPB};
|
||||
use flowy_derive::ProtoBuf;
|
||||
use flowy_error::ErrorCode;
|
||||
use flowy_grid_data_model::parser::NotEmptyStr;
|
||||
use std::fmt::Formatter;
|
||||
|
||||
#[derive(Debug, Default, ProtoBuf)]
|
||||
|
@ -4,6 +4,7 @@ mod field_entities;
|
||||
mod filter_entities;
|
||||
mod grid_entities;
|
||||
mod group_entities;
|
||||
pub mod parser;
|
||||
mod row_entities;
|
||||
mod setting_entities;
|
||||
|
||||
|
@ -1,7 +1,7 @@
|
||||
use crate::entities::parser::NotEmptyStr;
|
||||
use crate::entities::GridLayout;
|
||||
use flowy_derive::ProtoBuf;
|
||||
use flowy_error::ErrorCode;
|
||||
use flowy_grid_data_model::parser::NotEmptyStr;
|
||||
|
||||
#[derive(Debug, Default, Clone, ProtoBuf)]
|
||||
pub struct RowIdPB {
|
||||
|
@ -1,3 +1,4 @@
|
||||
use crate::entities::parser::NotEmptyStr;
|
||||
use crate::entities::{
|
||||
DeleteFilterParams, DeleteFilterPayloadPB, DeleteGroupParams, DeleteGroupPayloadPB, InsertFilterParams,
|
||||
InsertFilterPayloadPB, InsertGroupParams, InsertGroupPayloadPB, RepeatedGridFilterConfigurationPB,
|
||||
@ -5,8 +6,7 @@ use crate::entities::{
|
||||
};
|
||||
use flowy_derive::{ProtoBuf, ProtoBuf_Enum};
|
||||
use flowy_error::ErrorCode;
|
||||
use flowy_grid_data_model::parser::NotEmptyStr;
|
||||
use flowy_grid_data_model::revision::LayoutRevision;
|
||||
use grid_rev_model::LayoutRevision;
|
||||
use std::convert::TryInto;
|
||||
use strum::IntoEnumIterator;
|
||||
use strum_macros::EnumIter;
|
||||
|
@ -9,7 +9,7 @@ use crate::services::field::{
|
||||
};
|
||||
use crate::services::row::make_row_from_row_rev;
|
||||
use flowy_error::{ErrorCode, FlowyError, FlowyResult};
|
||||
use flowy_grid_data_model::revision::FieldRevision;
|
||||
use grid_rev_model::FieldRevision;
|
||||
use lib_dispatch::prelude::{data_result, AppData, Data, DataResult};
|
||||
use std::sync::Arc;
|
||||
|
||||
|
@ -12,13 +12,13 @@ use bytes::Bytes;
|
||||
|
||||
use flowy_database::ConnectionPool;
|
||||
use flowy_error::{FlowyError, FlowyResult};
|
||||
use flowy_grid_data_model::revision::{BuildGridContext, GridRevision, GridViewRevision};
|
||||
use flowy_revision::{
|
||||
RevisionManager, RevisionPersistence, RevisionPersistenceConfiguration, RevisionWebSocket,
|
||||
SQLiteRevisionSnapshotPersistence,
|
||||
};
|
||||
use flowy_sync::client_grid::{make_grid_block_operations, make_grid_operations, make_grid_view_operations};
|
||||
use flowy_sync::entities::revision::Revision;
|
||||
use grid_rev_model::{BuildGridContext, GridRevision, GridViewRevision};
|
||||
use lib_infra::ref_map::{RefCountHashMap, RefCountValue};
|
||||
|
||||
use crate::services::block_manager::make_grid_block_rev_manager;
|
||||
|
@ -1,13 +1,13 @@
|
||||
use crate::entities::RowPB;
|
||||
use bytes::Bytes;
|
||||
use flowy_error::{FlowyError, FlowyResult};
|
||||
use flowy_grid_data_model::revision::{CellRevision, GridBlockRevision, RowChangeset, RowRevision};
|
||||
use flowy_revision::{
|
||||
RevisionCloudService, RevisionManager, RevisionMergeable, RevisionObjectDeserializer, RevisionObjectSerializer,
|
||||
};
|
||||
use flowy_sync::client_grid::{GridBlockRevisionChangeset, GridBlockRevisionPad};
|
||||
use flowy_sync::entities::revision::Revision;
|
||||
use flowy_sync::util::make_operations_from_revisions;
|
||||
use grid_rev_model::{CellRevision, GridBlockRevision, RowChangeset, RowRevision};
|
||||
use lib_infra::future::FutureResult;
|
||||
|
||||
use flowy_database::ConnectionPool;
|
||||
|
@ -8,12 +8,10 @@ use crate::services::row::{block_from_row_orders, make_row_from_row_rev, GridBlo
|
||||
use dashmap::DashMap;
|
||||
use flowy_database::ConnectionPool;
|
||||
use flowy_error::FlowyResult;
|
||||
use flowy_grid_data_model::revision::{
|
||||
GridBlockMetaRevision, GridBlockMetaRevisionChangeset, RowChangeset, RowRevision,
|
||||
};
|
||||
use flowy_revision::{
|
||||
RevisionManager, RevisionPersistence, RevisionPersistenceConfiguration, SQLiteRevisionSnapshotPersistence,
|
||||
};
|
||||
use grid_rev_model::{GridBlockMetaRevision, GridBlockMetaRevisionChangeset, RowChangeset, RowRevision};
|
||||
use std::borrow::Cow;
|
||||
use std::collections::HashMap;
|
||||
use std::sync::Arc;
|
||||
|
@ -1,7 +1,7 @@
|
||||
use crate::services::block_manager::GridBlockManager;
|
||||
use crate::services::grid_view_manager::GridViewRowDelegate;
|
||||
|
||||
use flowy_grid_data_model::revision::RowRevision;
|
||||
use grid_rev_model::RowRevision;
|
||||
use lib_infra::future::{wrap_future, AFFuture};
|
||||
use std::sync::Arc;
|
||||
|
||||
|
@ -2,7 +2,7 @@ use crate::entities::FieldType;
|
||||
use crate::services::cell::{CellData, FromCellString};
|
||||
use bytes::Bytes;
|
||||
use flowy_error::{internal_error, FlowyError, FlowyResult};
|
||||
use flowy_grid_data_model::revision::CellRevision;
|
||||
use grid_rev_model::CellRevision;
|
||||
use serde::{Deserialize, Serialize};
|
||||
use std::str::FromStr;
|
||||
|
||||
|
@ -4,7 +4,7 @@ use crate::services::field::*;
|
||||
use std::fmt::Debug;
|
||||
|
||||
use flowy_error::{ErrorCode, FlowyError, FlowyResult};
|
||||
use flowy_grid_data_model::revision::{CellRevision, FieldRevision, FieldTypeRevision};
|
||||
use grid_rev_model::{CellRevision, FieldRevision, FieldTypeRevision};
|
||||
|
||||
/// This trait is used when doing filter/search on the grid.
|
||||
pub trait CellFilterOperation<T> {
|
||||
|
@ -2,7 +2,7 @@ use crate::entities::{FieldPB, FieldType};
|
||||
|
||||
use crate::services::field::{default_type_option_builder_from_type, TypeOptionBuilder};
|
||||
|
||||
use flowy_grid_data_model::revision::FieldRevision;
|
||||
use grid_rev_model::FieldRevision;
|
||||
use indexmap::IndexMap;
|
||||
|
||||
pub struct FieldBuilder {
|
||||
|
@ -1,7 +1,7 @@
|
||||
use crate::services::field::{MultiSelectTypeOptionPB, SingleSelectTypeOptionPB};
|
||||
use crate::services::grid_editor::GridRevisionEditor;
|
||||
use flowy_error::FlowyResult;
|
||||
use flowy_grid_data_model::revision::{TypeOptionDataDeserializer, TypeOptionDataSerializer};
|
||||
use grid_rev_model::{TypeOptionDataDeserializer, TypeOptionDataSerializer};
|
||||
use std::sync::Arc;
|
||||
|
||||
pub async fn edit_field_type_option<T>(
|
||||
|
@ -1,7 +1,7 @@
|
||||
use crate::entities::FieldType;
|
||||
use crate::services::field::type_options::*;
|
||||
use bytes::Bytes;
|
||||
use flowy_grid_data_model::revision::TypeOptionDataSerializer;
|
||||
use grid_rev_model::TypeOptionDataSerializer;
|
||||
|
||||
pub trait TypeOptionBuilder {
|
||||
/// Returns the type of the type-option data
|
||||
|
@ -4,7 +4,7 @@ mod tests {
|
||||
use crate::services::cell::CellDataOperation;
|
||||
use crate::services::field::type_options::checkbox_type_option::*;
|
||||
use crate::services::field::FieldBuilder;
|
||||
use flowy_grid_data_model::revision::FieldRevision;
|
||||
use grid_rev_model::FieldRevision;
|
||||
|
||||
#[test]
|
||||
fn checkout_box_description_test() {
|
||||
|
@ -5,9 +5,7 @@ use crate::services::field::{BoxTypeOptionBuilder, CheckboxCellData, TypeOptionB
|
||||
use bytes::Bytes;
|
||||
use flowy_derive::ProtoBuf;
|
||||
use flowy_error::{FlowyError, FlowyResult};
|
||||
use flowy_grid_data_model::revision::{
|
||||
CellRevision, FieldRevision, TypeOptionDataDeserializer, TypeOptionDataSerializer,
|
||||
};
|
||||
use grid_rev_model::{CellRevision, FieldRevision, TypeOptionDataDeserializer, TypeOptionDataSerializer};
|
||||
use serde::{Deserialize, Serialize};
|
||||
use std::str::FromStr;
|
||||
|
||||
|
@ -4,7 +4,7 @@ mod tests {
|
||||
use crate::services::cell::CellDataOperation;
|
||||
use crate::services::field::*;
|
||||
// use crate::services::field::{DateCellChangeset, DateCellData, DateFormat, DateTypeOptionPB, TimeFormat};
|
||||
use flowy_grid_data_model::revision::FieldRevision;
|
||||
use grid_rev_model::FieldRevision;
|
||||
use strum::IntoEnumIterator;
|
||||
|
||||
#[test]
|
||||
|
@ -9,9 +9,7 @@ use chrono::format::strftime::StrftimeItems;
|
||||
use chrono::{NaiveDateTime, Timelike};
|
||||
use flowy_derive::ProtoBuf;
|
||||
use flowy_error::{ErrorCode, FlowyError, FlowyResult};
|
||||
use flowy_grid_data_model::revision::{
|
||||
CellRevision, FieldRevision, TypeOptionDataDeserializer, TypeOptionDataSerializer,
|
||||
};
|
||||
use grid_rev_model::{CellRevision, FieldRevision, TypeOptionDataDeserializer, TypeOptionDataSerializer};
|
||||
use serde::{Deserialize, Serialize};
|
||||
|
||||
// Date
|
||||
|
@ -4,7 +4,7 @@ mod tests {
|
||||
use crate::services::cell::CellDataOperation;
|
||||
use crate::services::field::FieldBuilder;
|
||||
use crate::services::field::{strip_currency_symbol, NumberFormat, NumberTypeOptionPB};
|
||||
use flowy_grid_data_model::revision::FieldRevision;
|
||||
use grid_rev_model::FieldRevision;
|
||||
use strum::IntoEnumIterator;
|
||||
|
||||
/// Testing when the input is not a number.
|
||||
|
@ -6,9 +6,7 @@ use crate::services::field::{BoxTypeOptionBuilder, NumberCellData, TypeOptionBui
|
||||
use bytes::Bytes;
|
||||
use flowy_derive::ProtoBuf;
|
||||
use flowy_error::{FlowyError, FlowyResult};
|
||||
use flowy_grid_data_model::revision::{
|
||||
CellRevision, FieldRevision, TypeOptionDataDeserializer, TypeOptionDataSerializer,
|
||||
};
|
||||
use grid_rev_model::{CellRevision, FieldRevision, TypeOptionDataDeserializer, TypeOptionDataSerializer};
|
||||
|
||||
use rust_decimal::Decimal;
|
||||
|
||||
|
@ -10,9 +10,7 @@ use crate::services::field::{
|
||||
use bytes::Bytes;
|
||||
use flowy_derive::ProtoBuf;
|
||||
use flowy_error::{FlowyError, FlowyResult};
|
||||
use flowy_grid_data_model::revision::{
|
||||
CellRevision, FieldRevision, TypeOptionDataDeserializer, TypeOptionDataSerializer,
|
||||
};
|
||||
use grid_rev_model::{CellRevision, FieldRevision, TypeOptionDataDeserializer, TypeOptionDataSerializer};
|
||||
use serde::{Deserialize, Serialize};
|
||||
|
||||
// Multiple select
|
||||
|
@ -1,3 +1,4 @@
|
||||
use crate::entities::parser::NotEmptyStr;
|
||||
use crate::entities::{CellChangesetPB, FieldType, GridCellIdPB, GridCellIdParams};
|
||||
use crate::services::cell::{
|
||||
CellBytes, CellBytesParser, CellData, CellDataIsEmpty, CellDisplayable, FromCellChangeset, FromCellString,
|
||||
@ -7,8 +8,7 @@ use crate::services::field::{MultiSelectTypeOptionPB, SingleSelectTypeOptionPB};
|
||||
use bytes::Bytes;
|
||||
use flowy_derive::{ProtoBuf, ProtoBuf_Enum};
|
||||
use flowy_error::{internal_error, ErrorCode, FlowyResult};
|
||||
use flowy_grid_data_model::parser::NotEmptyStr;
|
||||
use flowy_grid_data_model::revision::{FieldRevision, TypeOptionDataSerializer};
|
||||
use grid_rev_model::{FieldRevision, TypeOptionDataSerializer};
|
||||
use nanoid::nanoid;
|
||||
use serde::{Deserialize, Serialize};
|
||||
|
||||
|
@ -9,9 +9,7 @@ use crate::services::field::{
|
||||
use bytes::Bytes;
|
||||
use flowy_derive::ProtoBuf;
|
||||
use flowy_error::{FlowyError, FlowyResult};
|
||||
use flowy_grid_data_model::revision::{
|
||||
CellRevision, FieldRevision, TypeOptionDataDeserializer, TypeOptionDataSerializer,
|
||||
};
|
||||
use grid_rev_model::{CellRevision, FieldRevision, TypeOptionDataDeserializer, TypeOptionDataSerializer};
|
||||
use serde::{Deserialize, Serialize};
|
||||
|
||||
// Single select
|
||||
|
@ -4,7 +4,7 @@ use crate::services::field::{
|
||||
SelectOptionColorPB, SelectOptionIds, SelectOptionPB, SelectTypeOptionSharedAction, CHECK, UNCHECK,
|
||||
};
|
||||
use flowy_error::FlowyResult;
|
||||
use flowy_grid_data_model::revision::FieldRevision;
|
||||
use grid_rev_model::FieldRevision;
|
||||
|
||||
/// Handles how to transform the cell data when switching between different field types
|
||||
pub struct SelectOptionTypeOptionTransformer();
|
||||
|
@ -8,9 +8,7 @@ use crate::services::field::{BoxTypeOptionBuilder, TypeOptionBuilder};
|
||||
use bytes::Bytes;
|
||||
use flowy_derive::ProtoBuf;
|
||||
use flowy_error::{FlowyError, FlowyResult};
|
||||
use flowy_grid_data_model::revision::{
|
||||
CellRevision, FieldRevision, TypeOptionDataDeserializer, TypeOptionDataSerializer,
|
||||
};
|
||||
use grid_rev_model::{CellRevision, FieldRevision, TypeOptionDataDeserializer, TypeOptionDataSerializer};
|
||||
use serde::{Deserialize, Serialize};
|
||||
|
||||
#[derive(Default)]
|
||||
|
@ -4,7 +4,7 @@ mod tests {
|
||||
use crate::services::cell::{CellData, CellDataOperation};
|
||||
use crate::services::field::{FieldBuilder, URLCellDataParser};
|
||||
use crate::services::field::{URLCellDataPB, URLTypeOptionPB};
|
||||
use flowy_grid_data_model::revision::FieldRevision;
|
||||
use grid_rev_model::FieldRevision;
|
||||
|
||||
/// The expected_str will equal to the input string, but the expected_url will be empty if there's no
|
||||
/// http url in the input string.
|
||||
|
@ -6,9 +6,7 @@ use bytes::Bytes;
|
||||
use fancy_regex::Regex;
|
||||
use flowy_derive::ProtoBuf;
|
||||
use flowy_error::{FlowyError, FlowyResult};
|
||||
use flowy_grid_data_model::revision::{
|
||||
CellRevision, FieldRevision, TypeOptionDataDeserializer, TypeOptionDataSerializer,
|
||||
};
|
||||
use grid_rev_model::{CellRevision, FieldRevision, TypeOptionDataDeserializer, TypeOptionDataSerializer};
|
||||
use lazy_static::lazy_static;
|
||||
use serde::{Deserialize, Serialize};
|
||||
|
||||
|
@ -1,5 +1,5 @@
|
||||
use crate::services::cell::AnyCellData;
|
||||
use flowy_grid_data_model::revision::CellRevision;
|
||||
use grid_rev_model::CellRevision;
|
||||
use std::str::FromStr;
|
||||
|
||||
pub fn get_cell_data(cell_rev: &CellRevision) -> String {
|
||||
|
@ -3,8 +3,8 @@ use crate::entities::{
|
||||
SelectOptionFilterConfigurationPB, TextFilterConfigurationPB,
|
||||
};
|
||||
use dashmap::DashMap;
|
||||
use flowy_grid_data_model::revision::{FieldRevision, FilterConfigurationRevision, RowRevision};
|
||||
use flowy_sync::client_grid::GridRevisionPad;
|
||||
use grid_rev_model::{FieldRevision, FilterConfigurationRevision, RowRevision};
|
||||
use std::collections::HashMap;
|
||||
use std::sync::Arc;
|
||||
use tokio::sync::RwLock;
|
||||
|
@ -18,8 +18,8 @@ use crate::services::grid_editor_task::GridServiceTaskScheduler;
|
||||
use crate::services::row::GridBlockSnapshot;
|
||||
use crate::services::tasks::{FilterTaskContext, Task, TaskContent};
|
||||
use flowy_error::FlowyResult;
|
||||
use flowy_grid_data_model::revision::{CellRevision, FieldId, FieldRevision, RowRevision};
|
||||
use flowy_sync::client_grid::GridRevisionPad;
|
||||
use grid_rev_model::{CellRevision, FieldId, FieldRevision, RowRevision};
|
||||
use rayon::prelude::*;
|
||||
use std::collections::HashMap;
|
||||
use std::sync::Arc;
|
||||
|
@ -15,7 +15,6 @@ use crate::services::persistence::block_index::BlockIndexCache;
|
||||
use crate::services::row::{make_grid_blocks, make_rows_from_row_revs, GridBlockSnapshot, RowRevisionBuilder};
|
||||
use bytes::Bytes;
|
||||
use flowy_error::{ErrorCode, FlowyError, FlowyResult};
|
||||
use flowy_grid_data_model::revision::*;
|
||||
use flowy_revision::{
|
||||
RevisionCloudService, RevisionManager, RevisionMergeable, RevisionObjectDeserializer, RevisionObjectSerializer,
|
||||
};
|
||||
@ -23,6 +22,7 @@ use flowy_sync::client_grid::{GridRevisionChangeset, GridRevisionPad, JsonDeseri
|
||||
use flowy_sync::entities::revision::Revision;
|
||||
use flowy_sync::errors::{CollaborateError, CollaborateResult};
|
||||
use flowy_sync::util::make_operations_from_revisions;
|
||||
use grid_rev_model::*;
|
||||
use lib_infra::future::{wrap_future, FutureResult};
|
||||
|
||||
use flowy_database::ConnectionPool;
|
||||
|
@ -1,6 +1,6 @@
|
||||
use crate::services::grid_view_manager::GridViewFieldDelegate;
|
||||
use flowy_grid_data_model::revision::FieldRevision;
|
||||
use flowy_sync::client_grid::GridRevisionPad;
|
||||
use grid_rev_model::FieldRevision;
|
||||
use lib_infra::future::{wrap_future, AFFuture};
|
||||
use std::sync::Arc;
|
||||
use tokio::sync::RwLock;
|
||||
|
@ -14,16 +14,16 @@ use crate::services::group::{
|
||||
use bytes::Bytes;
|
||||
use flowy_database::ConnectionPool;
|
||||
use flowy_error::{FlowyError, FlowyResult};
|
||||
use flowy_grid_data_model::revision::{
|
||||
gen_grid_filter_id, FieldRevision, FieldTypeRevision, FilterConfigurationRevision, GroupConfigurationRevision,
|
||||
RowChangeset, RowRevision,
|
||||
};
|
||||
use flowy_revision::{
|
||||
RevisionCloudService, RevisionManager, RevisionMergeable, RevisionObjectDeserializer, RevisionObjectSerializer,
|
||||
};
|
||||
use flowy_sync::client_grid::{GridViewRevisionChangeset, GridViewRevisionPad};
|
||||
use flowy_sync::entities::revision::Revision;
|
||||
use flowy_sync::util::make_operations_from_revisions;
|
||||
use grid_rev_model::{
|
||||
gen_grid_filter_id, FieldRevision, FieldTypeRevision, FilterConfigurationRevision, GroupConfigurationRevision,
|
||||
RowChangeset, RowRevision,
|
||||
};
|
||||
use lib_infra::future::{wrap_future, AFFuture, FutureResult};
|
||||
use lib_ot::core::EmptyAttributes;
|
||||
use std::future::Future;
|
||||
|
@ -10,10 +10,10 @@ use crate::services::persistence::rev_sqlite::SQLiteGridViewRevisionPersistence;
|
||||
use dashmap::DashMap;
|
||||
use flowy_database::ConnectionPool;
|
||||
use flowy_error::FlowyResult;
|
||||
use flowy_grid_data_model::revision::{FieldRevision, RowChangeset, RowRevision};
|
||||
use flowy_revision::{
|
||||
RevisionManager, RevisionPersistence, RevisionPersistenceConfiguration, SQLiteRevisionSnapshotPersistence,
|
||||
};
|
||||
use grid_rev_model::{FieldRevision, RowChangeset, RowRevision};
|
||||
use lib_infra::future::AFFuture;
|
||||
use std::sync::Arc;
|
||||
|
||||
|
@ -3,7 +3,7 @@ use crate::services::cell::CellDataIsEmpty;
|
||||
use crate::services::group::controller::MoveGroupRowContext;
|
||||
use crate::services::group::Group;
|
||||
use flowy_error::FlowyResult;
|
||||
use flowy_grid_data_model::revision::{CellRevision, FieldRevision, RowRevision};
|
||||
use grid_rev_model::{CellRevision, FieldRevision, RowRevision};
|
||||
use std::sync::Arc;
|
||||
|
||||
/// Using polymorphism to provides the customs action for different group controller.
|
||||
|
@ -1,7 +1,7 @@
|
||||
use crate::entities::{GroupPB, GroupViewChangesetPB};
|
||||
use crate::services::group::{default_group_configuration, GeneratedGroupContext, Group};
|
||||
use flowy_error::{FlowyError, FlowyResult};
|
||||
use flowy_grid_data_model::revision::{
|
||||
use grid_rev_model::{
|
||||
FieldRevision, FieldTypeRevision, GroupConfigurationContentSerde, GroupConfigurationRevision, GroupRevision,
|
||||
};
|
||||
use indexmap::IndexMap;
|
||||
|
@ -4,7 +4,7 @@ use crate::services::group::action::{GroupControllerCustomActions, GroupControll
|
||||
use crate::services::group::configuration::GroupContext;
|
||||
use crate::services::group::entities::Group;
|
||||
use flowy_error::FlowyResult;
|
||||
use flowy_grid_data_model::revision::{
|
||||
use grid_rev_model::{
|
||||
FieldRevision, GroupConfigurationContentSerde, GroupRevision, RowChangeset, RowRevision, TypeOptionDataDeserializer,
|
||||
};
|
||||
use std::marker::PhantomData;
|
||||
|
@ -8,9 +8,7 @@ use crate::services::group::controller::{
|
||||
|
||||
use crate::services::cell::insert_checkbox_cell;
|
||||
use crate::services::group::{move_group_row, GeneratedGroupConfig, GeneratedGroupContext};
|
||||
use flowy_grid_data_model::revision::{
|
||||
CellRevision, CheckboxGroupConfigurationRevision, FieldRevision, GroupRevision, RowRevision,
|
||||
};
|
||||
use grid_rev_model::{CellRevision, CheckboxGroupConfigurationRevision, FieldRevision, GroupRevision, RowRevision};
|
||||
|
||||
pub type CheckboxGroupController = GenericGroupController<
|
||||
CheckboxGroupConfigurationRevision,
|
||||
|
@ -2,7 +2,7 @@ use crate::entities::{GroupChangesetPB, GroupViewChangesetPB, RowPB};
|
||||
use crate::services::group::action::GroupControllerSharedActions;
|
||||
use crate::services::group::{Group, GroupController, MoveGroupRowContext};
|
||||
use flowy_error::FlowyResult;
|
||||
use flowy_grid_data_model::revision::{FieldRevision, RowRevision};
|
||||
use grid_rev_model::{FieldRevision, RowRevision};
|
||||
use std::sync::Arc;
|
||||
|
||||
/// A [DefaultGroupController] is used to handle the group actions for the [FieldType] that doesn't
|
||||
|
@ -9,7 +9,7 @@ use crate::services::group::controller::{
|
||||
use crate::services::group::controller_impls::select_option_controller::util::*;
|
||||
|
||||
use crate::services::group::{make_no_status_group, GeneratedGroupContext};
|
||||
use flowy_grid_data_model::revision::{FieldRevision, RowRevision, SelectOptionGroupConfigurationRevision};
|
||||
use grid_rev_model::{FieldRevision, RowRevision, SelectOptionGroupConfigurationRevision};
|
||||
|
||||
// MultiSelect
|
||||
pub type MultiSelectGroupController = GenericGroupController<
|
||||
|
@ -10,7 +10,7 @@ use crate::services::group::controller_impls::select_option_controller::util::*;
|
||||
use crate::services::group::entities::Group;
|
||||
|
||||
use crate::services::group::{make_no_status_group, GeneratedGroupContext};
|
||||
use flowy_grid_data_model::revision::{FieldRevision, RowRevision, SelectOptionGroupConfigurationRevision};
|
||||
use grid_rev_model::{FieldRevision, RowRevision, SelectOptionGroupConfigurationRevision};
|
||||
|
||||
// SingleSelect
|
||||
pub type SingleSelectGroupController = GenericGroupController<
|
||||
|
@ -4,9 +4,7 @@ use crate::services::field::{SelectOptionCellDataPB, SelectOptionPB, CHECK};
|
||||
use crate::services::group::configuration::GroupContext;
|
||||
use crate::services::group::controller::MoveGroupRowContext;
|
||||
use crate::services::group::{GeneratedGroupConfig, Group};
|
||||
use flowy_grid_data_model::revision::{
|
||||
CellRevision, FieldRevision, GroupRevision, RowRevision, SelectOptionGroupConfigurationRevision,
|
||||
};
|
||||
use grid_rev_model::{CellRevision, FieldRevision, GroupRevision, RowRevision, SelectOptionGroupConfigurationRevision};
|
||||
|
||||
pub type SelectOptionGroupContext = GroupContext<SelectOptionGroupConfigurationRevision>;
|
||||
|
||||
|
@ -6,7 +6,7 @@ use crate::services::group::{
|
||||
MultiSelectGroupController, SelectOptionGroupContext, SingleSelectGroupController,
|
||||
};
|
||||
use flowy_error::FlowyResult;
|
||||
use flowy_grid_data_model::revision::{
|
||||
use grid_rev_model::{
|
||||
CheckboxGroupConfigurationRevision, DateGroupConfigurationRevision, FieldRevision, GroupConfigurationRevision,
|
||||
GroupRevision, LayoutRevision, NumberGroupConfigurationRevision, RowRevision,
|
||||
SelectOptionGroupConfigurationRevision, TextGroupConfigurationRevision, UrlGroupConfigurationRevision,
|
||||
|
@ -3,11 +3,11 @@ use crate::services::persistence::GridDatabase;
|
||||
use bytes::Bytes;
|
||||
use flowy_database::kv::KV;
|
||||
use flowy_error::FlowyResult;
|
||||
use flowy_grid_data_model::revision::GridRevision;
|
||||
use flowy_revision::reset::{RevisionResettable, RevisionStructReset};
|
||||
use flowy_sync::client_grid::{make_grid_rev_json_str, GridOperationsBuilder, GridRevisionPad};
|
||||
use flowy_sync::entities::revision::Revision;
|
||||
use flowy_sync::util::md5;
|
||||
use grid_rev_model::GridRevision;
|
||||
|
||||
use crate::services::persistence::rev_sqlite::SQLiteGridRevisionPersistence;
|
||||
use std::sync::Arc;
|
||||
|
@ -3,7 +3,7 @@ use crate::services::cell::{
|
||||
insert_url_cell,
|
||||
};
|
||||
|
||||
use flowy_grid_data_model::revision::{gen_row_id, CellRevision, FieldRevision, RowRevision, DEFAULT_ROW_HEIGHT};
|
||||
use grid_rev_model::{gen_row_id, CellRevision, FieldRevision, RowRevision, DEFAULT_ROW_HEIGHT};
|
||||
use indexmap::IndexMap;
|
||||
use std::collections::HashMap;
|
||||
use std::sync::Arc;
|
||||
|
@ -1,6 +1,6 @@
|
||||
use crate::entities::{BlockPB, RepeatedBlockPB, RowPB};
|
||||
use flowy_error::FlowyResult;
|
||||
use flowy_grid_data_model::revision::RowRevision;
|
||||
use grid_rev_model::RowRevision;
|
||||
use std::collections::HashMap;
|
||||
use std::sync::Arc;
|
||||
|
||||
|
@ -1,8 +1,8 @@
|
||||
use crate::entities::FieldType;
|
||||
use crate::services::field::*;
|
||||
use crate::services::row::RowRevisionBuilder;
|
||||
use flowy_grid_data_model::revision::BuildGridContext;
|
||||
use flowy_sync::client_grid::GridBuilder;
|
||||
use grid_rev_model::BuildGridContext;
|
||||
|
||||
pub fn make_default_grid() -> BuildGridContext {
|
||||
let mut grid_builder = GridBuilder::new();
|
||||
|
@ -1,7 +1,7 @@
|
||||
use crate::grid::block_test::script::GridRowTest;
|
||||
use crate::grid::block_test::script::RowScript::*;
|
||||
|
||||
use flowy_grid_data_model::revision::{GridBlockMetaRevision, GridBlockMetaRevisionChangeset};
|
||||
use grid_rev_model::{GridBlockMetaRevision, GridBlockMetaRevisionChangeset};
|
||||
|
||||
#[tokio::test]
|
||||
async fn grid_create_block() {
|
||||
|
@ -3,7 +3,7 @@ use crate::grid::block_test::script::{CreateRowScriptBuilder, GridRowTest};
|
||||
use crate::grid::grid_editor::{COMPLETED, FACEBOOK, GOOGLE, PAUSED, TWITTER};
|
||||
use flowy_grid::entities::FieldType;
|
||||
use flowy_grid::services::field::{SELECTION_IDS_SEPARATOR, UNCHECK};
|
||||
use flowy_grid_data_model::revision::RowChangeset;
|
||||
use grid_rev_model::RowChangeset;
|
||||
|
||||
#[tokio::test]
|
||||
async fn grid_create_row_count_test() {
|
||||
|
@ -4,9 +4,7 @@ use crate::grid::grid_editor::GridEditorTest;
|
||||
|
||||
use flowy_grid::entities::{CreateRowParams, FieldType, GridCellIdParams, GridLayout, RowPB};
|
||||
use flowy_grid::services::field::*;
|
||||
use flowy_grid_data_model::revision::{
|
||||
GridBlockMetaRevision, GridBlockMetaRevisionChangeset, RowChangeset, RowRevision,
|
||||
};
|
||||
use grid_rev_model::{GridBlockMetaRevision, GridBlockMetaRevisionChangeset, RowChangeset, RowRevision};
|
||||
use std::collections::HashMap;
|
||||
use std::sync::Arc;
|
||||
use strum::IntoEnumIterator;
|
||||
|
@ -5,7 +5,7 @@ use flowy_grid::services::field::{
|
||||
DateCellChangesetPB, MultiSelectTypeOptionPB, SelectOptionPB, SingleSelectTypeOptionPB,
|
||||
};
|
||||
use flowy_grid::services::row::RowRevisionBuilder;
|
||||
use flowy_grid_data_model::revision::{FieldRevision, RowRevision};
|
||||
use grid_rev_model::{FieldRevision, RowRevision};
|
||||
|
||||
use strum::EnumCount;
|
||||
|
||||
|
@ -1,6 +1,6 @@
|
||||
use crate::grid::grid_editor::GridEditorTest;
|
||||
use flowy_grid::entities::{CreateFieldParams, FieldChangesetParams};
|
||||
use flowy_grid_data_model::revision::FieldRevision;
|
||||
use grid_rev_model::FieldRevision;
|
||||
|
||||
pub enum FieldScript {
|
||||
CreateField {
|
||||
|
@ -4,7 +4,7 @@ use crate::grid::field_test::util::*;
|
||||
use flowy_grid::entities::FieldChangesetParams;
|
||||
use flowy_grid::services::field::selection_type_option::SelectOptionPB;
|
||||
use flowy_grid::services::field::SingleSelectTypeOptionPB;
|
||||
use flowy_grid_data_model::revision::TypeOptionDataSerializer;
|
||||
use grid_rev_model::TypeOptionDataSerializer;
|
||||
|
||||
#[tokio::test]
|
||||
async fn grid_create_field() {
|
||||
|
@ -1,7 +1,7 @@
|
||||
use flowy_grid::entities::*;
|
||||
use flowy_grid::services::field::selection_type_option::SelectOptionPB;
|
||||
use flowy_grid::services::field::*;
|
||||
use flowy_grid_data_model::revision::*;
|
||||
use grid_rev_model::*;
|
||||
|
||||
pub fn create_text_field(grid_id: &str) -> (CreateFieldParams, FieldRevision) {
|
||||
let mut field_rev = FieldBuilder::new(RichTextTypeOptionBuilder::default())
|
||||
|
@ -5,7 +5,7 @@
|
||||
|
||||
use flowy_grid::entities::{InsertFilterParams, InsertFilterPayloadPB, DeleteFilterParams, GridLayout, GridSettingChangesetParams, GridSettingPB};
|
||||
use flowy_grid::services::setting::GridSettingChangesetBuilder;
|
||||
use flowy_grid_data_model::revision::{FieldRevision, FieldTypeRevision};
|
||||
use grid_rev_model::{FieldRevision, FieldTypeRevision};
|
||||
use crate::grid::grid_editor::GridEditorTest;
|
||||
|
||||
pub enum FilterScript {
|
||||
|
@ -1,7 +1,7 @@
|
||||
use crate::grid::filter_test::script::FilterScript::*;
|
||||
use crate::grid::filter_test::script::*;
|
||||
use flowy_grid::entities::{FieldType, InsertFilterPayloadPB, TextFilterCondition};
|
||||
use flowy_grid_data_model::revision::FieldRevision;
|
||||
use grid_rev_model::FieldRevision;
|
||||
|
||||
#[tokio::test]
|
||||
async fn grid_filter_create_test() {
|
||||
|
@ -9,11 +9,11 @@ use flowy_grid::services::field::*;
|
||||
use flowy_grid::services::grid_editor::{GridRevisionEditor, GridRevisionSerde};
|
||||
use flowy_grid::services::row::{CreateRowRevisionPayload, RowRevisionBuilder};
|
||||
use flowy_grid::services::setting::GridSettingChangesetBuilder;
|
||||
use flowy_grid_data_model::revision::*;
|
||||
use flowy_revision::REVISION_WRITE_INTERVAL_IN_MILLIS;
|
||||
use flowy_sync::client_grid::GridBuilder;
|
||||
use flowy_test::helper::ViewTest;
|
||||
use flowy_test::FlowySDKTest;
|
||||
use grid_rev_model::*;
|
||||
use std::collections::HashMap;
|
||||
use std::sync::Arc;
|
||||
use std::time::Duration;
|
||||
|
@ -6,7 +6,7 @@ use flowy_grid::services::field::{
|
||||
SingleSelectTypeOption, SELECTION_IDS_SEPARATOR,
|
||||
};
|
||||
use flowy_grid::services::row::{decode_cell_data_from_type_option_cell_data, CreateRowMetaBuilder};
|
||||
use flowy_grid_data_model::entities::{
|
||||
use grid_rev_model::entities::{
|
||||
CellChangeset, FieldChangesetParams, FieldType, GridBlockInfoChangeset, GridBlockMetaSnapshot, RowMetaChangeset,
|
||||
TypeOptionDataFormat,
|
||||
};
|
||||
|
@ -6,7 +6,7 @@ use flowy_grid::services::cell::{delete_select_option_cell, insert_select_option
|
||||
use flowy_grid::services::field::{
|
||||
edit_single_select_type_option, SelectOptionPB, SelectTypeOptionSharedAction, SingleSelectTypeOptionPB,
|
||||
};
|
||||
use flowy_grid_data_model::revision::{FieldRevision, RowChangeset};
|
||||
use grid_rev_model::{FieldRevision, RowChangeset};
|
||||
use std::sync::Arc;
|
||||
|
||||
pub enum GroupScript {
|
||||
|
@ -2,15 +2,15 @@ use bytes::Bytes;
|
||||
use flowy_grid::services::field::*;
|
||||
use flowy_grid::services::grid_meta_editor::{GridMetaEditor, GridPadBuilder};
|
||||
use flowy_grid::services::row::CreateRowMetaPayload;
|
||||
use flowy_grid_data_model::entities::{
|
||||
BuildGridContext, CellChangeset, Field, FieldChangesetParams, FieldMeta, FieldOrder, FieldType,
|
||||
GridBlockInfoChangeset, GridBlockMetaSnapshot, InsertFieldParams, RowMeta, RowMetaChangeset, RowOrder,
|
||||
TypeOptionDataFormat,
|
||||
};
|
||||
use flowy_revision::REVISION_WRITE_INTERVAL_IN_MILLIS;
|
||||
use flowy_sync::client_grid::GridBuilder;
|
||||
use flowy_test::helper::ViewTest;
|
||||
use flowy_test::FlowySDKTest;
|
||||
use grid_rev_model::entities::{
|
||||
BuildGridContext, CellChangeset, Field, FieldChangesetParams, FieldMeta, FieldOrder, FieldType,
|
||||
GridBlockInfoChangeset, GridBlockMetaSnapshot, InsertFieldParams, RowMeta, RowMetaChangeset, RowOrder,
|
||||
TypeOptionDataFormat,
|
||||
};
|
||||
use std::collections::HashMap;
|
||||
use std::sync::Arc;
|
||||
use std::time::Duration;
|
||||
|
@ -21,7 +21,7 @@ lib-ws = { path = "../../../shared-lib/lib-ws" }
|
||||
bytes = { version = "1.0" }
|
||||
anyhow = "1.0"
|
||||
tokio = {version = "1", features = ["sync"]}
|
||||
parking_lot = "0.11"
|
||||
parking_lot = "0.12.1"
|
||||
strum = "0.21"
|
||||
strum_macros = "0.21"
|
||||
tracing = { version = "0.1", features = ["log"] }
|
||||
|
@ -26,7 +26,7 @@ nanoid = "0.4.0"
|
||||
flowy-revision = {path = "../flowy-revision", features = ["flowy_unit_test"]}
|
||||
serde = { version = "1.0", features = ["derive"] }
|
||||
serde_json = { version = "1.0" }
|
||||
parking_lot = "0.11"
|
||||
parking_lot = "0.12.1"
|
||||
|
||||
[features]
|
||||
flowy_unit_test = []
|
@ -12,7 +12,7 @@ flowy-user = { path = "../flowy-user" }
|
||||
flowy-net = { path = "../flowy-net" }
|
||||
flowy-folder = { path = "../flowy-folder", default-features = false }
|
||||
flowy-grid = { path = "../flowy-grid", default-features = false }
|
||||
flowy-grid-data-model = { path = "../../../shared-lib/flowy-grid-data-model" }
|
||||
grid-rev-model = { path = "../../../shared-lib/grid-rev-model" }
|
||||
flowy-database = { path = "../flowy-database" }
|
||||
flowy-document = { path = "../flowy-document", default-features = false }
|
||||
flowy-revision = { path = "../flowy-revision" }
|
||||
@ -23,7 +23,7 @@ futures-core = { version = "0.3", default-features = false }
|
||||
color-eyre = { version = "0.5", default-features = false }
|
||||
bytes = "1.0"
|
||||
tokio = { version = "1", features = ["rt"] }
|
||||
parking_lot = "0.11"
|
||||
parking_lot = "0.12.1"
|
||||
|
||||
flowy-sync = { path = "../../../shared-lib/flowy-sync" }
|
||||
lib-ws = { path = "../../../shared-lib/lib-ws" }
|
||||
|
@ -12,7 +12,6 @@ use flowy_folder::{
|
||||
use flowy_grid::entities::GridLayout;
|
||||
use flowy_grid::manager::{make_grid_view_data, GridManager};
|
||||
use flowy_grid::util::{make_default_board, make_default_grid};
|
||||
use flowy_grid_data_model::revision::BuildGridContext;
|
||||
use flowy_net::ClientServerConfiguration;
|
||||
use flowy_net::{
|
||||
http_server::folder::FolderHttpCloudService, local_server::LocalServer, ws::connection::FlowyWebSocketConnect,
|
||||
@ -22,6 +21,7 @@ use flowy_sync::entities::revision::Revision;
|
||||
use flowy_sync::entities::ws_data::ClientRevisionWSData;
|
||||
use flowy_user::services::UserSession;
|
||||
use futures_core::future::BoxFuture;
|
||||
use grid_rev_model::BuildGridContext;
|
||||
use lib_infra::future::{BoxResultFuture, FutureResult};
|
||||
use lib_ws::{WSChannel, WSMessageReceiver, WebSocketRawMessage};
|
||||
use std::collections::HashMap;
|
||||
|
@ -24,7 +24,7 @@ lazy_static = "1.4.0"
|
||||
diesel = {version = "1.4.8", features = ["sqlite"]}
|
||||
diesel_derives = {version = "1.4.1", features = ["sqlite"]}
|
||||
once_cell = "1.7.2"
|
||||
parking_lot = "0.11"
|
||||
parking_lot = "0.12.1"
|
||||
strum = "0.21"
|
||||
strum_macros = "0.21"
|
||||
tokio = { version = "1", features = ["rt"] }
|
||||
|
33
shared-lib/Cargo.lock
generated
33
shared-lib/Cargo.lock
generated
@ -403,21 +403,6 @@ dependencies = [
|
||||
"protobuf",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "flowy-grid-data-model"
|
||||
version = "0.1.0"
|
||||
dependencies = [
|
||||
"bytes",
|
||||
"flowy-error-code",
|
||||
"indexmap",
|
||||
"lib-infra",
|
||||
"nanoid",
|
||||
"serde",
|
||||
"serde_json",
|
||||
"serde_repr",
|
||||
"tracing",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "flowy-sync"
|
||||
version = "0.1.0"
|
||||
@ -428,14 +413,14 @@ dependencies = [
|
||||
"dashmap",
|
||||
"dissimilar",
|
||||
"flowy-derive",
|
||||
"flowy-grid-data-model",
|
||||
"folder-rev-model",
|
||||
"futures",
|
||||
"grid-rev-model",
|
||||
"lib-infra",
|
||||
"lib-ot",
|
||||
"log",
|
||||
"md5",
|
||||
"parking_lot 0.11.2",
|
||||
"parking_lot 0.12.1",
|
||||
"protobuf",
|
||||
"serde",
|
||||
"serde_json",
|
||||
@ -641,6 +626,20 @@ dependencies = [
|
||||
"walkdir",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "grid-rev-model"
|
||||
version = "0.1.0"
|
||||
dependencies = [
|
||||
"bytes",
|
||||
"flowy-error-code",
|
||||
"indexmap",
|
||||
"nanoid",
|
||||
"serde",
|
||||
"serde_json",
|
||||
"serde_repr",
|
||||
"tracing",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "hashbrown"
|
||||
version = "0.12.3"
|
||||
|
@ -8,7 +8,7 @@ members = [
|
||||
"flowy-derive",
|
||||
"flowy-ast",
|
||||
"flowy-error-code",
|
||||
"flowy-grid-data-model",
|
||||
"grid-rev-model",
|
||||
]
|
||||
|
||||
[profile.dev]
|
||||
|
@ -1,2 +0,0 @@
|
||||
pub mod parser;
|
||||
pub mod revision;
|
@ -1,2 +0,0 @@
|
||||
mod str_parser;
|
||||
pub use str_parser::*;
|
@ -1,10 +0,0 @@
|
||||
use flowy_grid_data_model::revision::*;
|
||||
|
||||
#[test]
|
||||
fn grid_default_serde_test() {
|
||||
let grid_id = "1".to_owned();
|
||||
let grid = GridRevision::new(&grid_id);
|
||||
|
||||
let json = serde_json::to_string(&grid).unwrap();
|
||||
assert_eq!(json, r#"{"grid_id":"1","fields":[],"blocks":[]}"#)
|
||||
}
|
@ -10,7 +10,7 @@ lib-ot = { path = "../lib-ot" }
|
||||
lib-infra = { path = "../lib-infra" }
|
||||
flowy-derive = { path = "../flowy-derive" }
|
||||
folder-rev-model = { path = "../folder-rev-model" }
|
||||
flowy-grid-data-model = { path = "../flowy-grid-data-model" }
|
||||
grid-rev-model = { path = "../grid-rev-model" }
|
||||
protobuf = {version = "2.18.0"}
|
||||
bytes = "1.0"
|
||||
log = "0.4.14"
|
||||
@ -24,7 +24,7 @@ url = "2.2"
|
||||
strum = "0.21"
|
||||
strum_macros = "0.21"
|
||||
chrono = "0.4.19"
|
||||
parking_lot = "0.11"
|
||||
parking_lot = "0.12.1"
|
||||
dashmap = "5"
|
||||
futures = "0.3.15"
|
||||
async-stream = "0.3.2"
|
||||
|
@ -1,9 +1,7 @@
|
||||
use crate::entities::revision::{RepeatedRevision, Revision};
|
||||
use crate::errors::{CollaborateError, CollaborateResult};
|
||||
use crate::util::{cal_diff, make_operations_from_revisions, md5};
|
||||
use flowy_grid_data_model::revision::{
|
||||
gen_block_id, gen_row_id, CellRevision, GridBlockRevision, RowChangeset, RowRevision,
|
||||
};
|
||||
use grid_rev_model::{gen_block_id, gen_row_id, CellRevision, GridBlockRevision, RowChangeset, RowRevision};
|
||||
use lib_ot::core::{DeltaBuilder, DeltaOperations, EmptyAttributes, OperationTransform};
|
||||
use std::borrow::Cow;
|
||||
use std::collections::HashMap;
|
||||
@ -281,7 +279,7 @@ impl std::default::Default for GridBlockRevisionPad {
|
||||
#[cfg(test)]
|
||||
mod tests {
|
||||
use crate::client_grid::{GridBlockOperations, GridBlockRevisionPad};
|
||||
use flowy_grid_data_model::revision::{RowChangeset, RowRevision};
|
||||
use grid_rev_model::{RowChangeset, RowRevision};
|
||||
|
||||
use std::borrow::Cow;
|
||||
|
||||
|
@ -1,7 +1,5 @@
|
||||
use crate::errors::{CollaborateError, CollaborateResult};
|
||||
use flowy_grid_data_model::revision::{
|
||||
BuildGridContext, FieldRevision, GridBlockMetaRevision, GridBlockRevision, RowRevision,
|
||||
};
|
||||
use grid_rev_model::{BuildGridContext, FieldRevision, GridBlockMetaRevision, GridBlockRevision, RowRevision};
|
||||
use std::sync::Arc;
|
||||
|
||||
pub struct GridBuilder {
|
||||
|
@ -2,7 +2,7 @@ use crate::entities::revision::{RepeatedRevision, Revision};
|
||||
use crate::errors::{internal_error, CollaborateError, CollaborateResult};
|
||||
use crate::util::{cal_diff, make_operations_from_revisions, md5};
|
||||
|
||||
use flowy_grid_data_model::revision::{
|
||||
use grid_rev_model::{
|
||||
gen_block_id, gen_grid_id, FieldRevision, FieldTypeRevision, GridBlockMetaRevision, GridBlockMetaRevisionChangeset,
|
||||
GridRevision,
|
||||
};
|
||||
|
@ -1,7 +1,7 @@
|
||||
use crate::entities::revision::Revision;
|
||||
use crate::errors::{internal_error, CollaborateError, CollaborateResult};
|
||||
use crate::util::{cal_diff, make_operations_from_revisions, md5};
|
||||
use flowy_grid_data_model::revision::{
|
||||
use grid_rev_model::{
|
||||
FieldRevision, FieldTypeRevision, FilterConfigurationRevision, FilterConfigurationsByFieldId, GridViewRevision,
|
||||
GroupConfigurationRevision, GroupConfigurationsByFieldId, LayoutRevision,
|
||||
};
|
||||
|
@ -7,8 +7,8 @@ edition = "2018"
|
||||
|
||||
[dependencies]
|
||||
bytes = "1.0"
|
||||
strum = "0.24.1"
|
||||
strum_macros = "0.24.3"
|
||||
strum = "0.21"
|
||||
strum_macros = "0.21"
|
||||
nanoid = "0.4.0"
|
||||
chrono = { version = "0.4" }
|
||||
serde = { version = "1.0", features = ["derive", "rc"] }
|
||||
|
@ -1,5 +1,5 @@
|
||||
[package]
|
||||
name = "flowy-grid-data-model"
|
||||
name = "grid-rev-model"
|
||||
version = "0.1.0"
|
||||
edition = "2021"
|
||||
|
||||
@ -13,13 +13,3 @@ serde_repr = "0.1"
|
||||
nanoid = "0.4.0"
|
||||
flowy-error-code = { path = "../flowy-error-code"}
|
||||
indexmap = {version = "1.9.1", features = ["serde"]}
|
||||
tracing = { version = "0.1", features = ["log"] }
|
||||
|
||||
[build-dependencies]
|
||||
lib-infra = { path = "../lib-infra", features = ["protobuf_file_gen"] }
|
||||
|
||||
[features]
|
||||
default = []
|
||||
backend = []
|
||||
frontend = []
|
||||
dart = ["lib-infra/dart"]
|
@ -1,4 +1,4 @@
|
||||
use crate::revision::GridBlockRevision;
|
||||
use crate::GridBlockRevision;
|
||||
use bytes::Bytes;
|
||||
use indexmap::IndexMap;
|
||||
use nanoid::nanoid;
|
@ -1,4 +1,4 @@
|
||||
use crate::revision::{FieldRevision, FieldTypeRevision, FilterConfigurationRevision, GroupConfigurationRevision};
|
||||
use crate::{FieldRevision, FieldTypeRevision, FilterConfigurationRevision, GroupConfigurationRevision};
|
||||
use indexmap::IndexMap;
|
||||
use nanoid::nanoid;
|
||||
use serde::{Deserialize, Serialize};
|
||||
@ -49,7 +49,7 @@ where
|
||||
.get_mut(field_id)
|
||||
.and_then(|object_rev_map| object_rev_map.get_mut(field_type));
|
||||
if value.is_none() {
|
||||
tracing::warn!("[Configuration] Can't find the {:?} with", std::any::type_name::<T>());
|
||||
eprintln!("[Configuration] Can't find the {:?} with", std::any::type_name::<T>());
|
||||
}
|
||||
value
|
||||
}
|
@ -1,4 +1,4 @@
|
||||
use crate::revision::{FilterConfiguration, GroupConfiguration};
|
||||
use crate::{FilterConfiguration, GroupConfiguration};
|
||||
use nanoid::nanoid;
|
||||
use serde::{Deserialize, Serialize};
|
||||
use serde_repr::*;
|
||||
@ -71,7 +71,7 @@ pub struct RowOrderRevision {
|
||||
|
||||
#[cfg(test)]
|
||||
mod tests {
|
||||
use crate::revision::GridViewRevision;
|
||||
use crate::GridViewRevision;
|
||||
|
||||
#[test]
|
||||
fn grid_view_revision_serde_test() {
|
@ -1,4 +1,4 @@
|
||||
use crate::revision::{gen_grid_group_id, FieldTypeRevision};
|
||||
use crate::{gen_grid_group_id, FieldTypeRevision};
|
||||
use serde::{Deserialize, Serialize};
|
||||
use serde_json::Error;
|
||||
use serde_repr::*;
|
||||
@ -166,7 +166,7 @@ impl std::default::Default for DateCondition {
|
||||
|
||||
#[cfg(test)]
|
||||
mod tests {
|
||||
use crate::revision::{GroupConfigurationRevision, SelectOptionGroupConfigurationRevision};
|
||||
use crate::{GroupConfigurationRevision, SelectOptionGroupConfigurationRevision};
|
||||
|
||||
#[test]
|
||||
fn group_configuration_serde_test() {
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue
Block a user