chore: exclude ai columns (#5526)

This commit is contained in:
Nathan.fooo 2024-06-13 11:15:59 +08:00 committed by GitHub
parent 15329b39d0
commit ecca81f3b8
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
5 changed files with 64 additions and 41 deletions

View File

@ -1041,14 +1041,6 @@ packages:
url: "https://pub.dev" url: "https://pub.dev"
source: hosted source: hosted
version: "0.19.0" version: "0.19.0"
intl_utils:
dependency: transitive
description:
name: intl_utils
sha256: c2b1f5c72c25512cbeef5ab015c008fc50fe7e04813ba5541c25272300484bf4
url: "https://pub.dev"
source: hosted
version: "2.8.7"
io: io:
dependency: transitive dependency: transitive
description: description:
@ -2200,22 +2192,6 @@ packages:
url: "https://pub.dev" url: "https://pub.dev"
source: hosted source: hosted
version: "1.3.2" version: "1.3.2"
universal_html:
dependency: transitive
description:
name: universal_html
sha256: "56536254004e24d9d8cfdb7dbbf09b74cf8df96729f38a2f5c238163e3d58971"
url: "https://pub.dev"
source: hosted
version: "2.2.4"
universal_io:
dependency: transitive
description:
name: universal_io
sha256: "1722b2dcc462b4b2f3ee7d188dad008b6eb4c40bbd03a3de451d82c78bba9aad"
url: "https://pub.dev"
source: hosted
version: "2.2.2"
universal_platform: universal_platform:
dependency: transitive dependency: transitive
description: description:

View File

@ -203,6 +203,20 @@ dependencies = [
"thiserror", "thiserror",
] ]
[[package]]
name = "appflowy-cloud-billing-client"
version = "0.1.0"
source = "git+https://github.com/AppFlowy-IO/AppFlowy-Cloud-Billing-Client?rev=9f9c2d1ad180987a31d18c6c067a56a5fa1f6da6#9f9c2d1ad180987a31d18c6c067a56a5fa1f6da6"
dependencies = [
"client-api",
"reqwest",
"serde",
"serde_json",
"shared-entity",
"tokio",
"yrs",
]
[[package]] [[package]]
name = "appflowy_tauri" name = "appflowy_tauri"
version = "0.0.0" version = "0.0.0"
@ -1330,7 +1344,7 @@ dependencies = [
"cssparser-macros", "cssparser-macros",
"dtoa-short", "dtoa-short",
"itoa 1.0.6", "itoa 1.0.6",
"phf 0.8.0", "phf 0.11.2",
"smallvec", "smallvec",
] ]
@ -2211,6 +2225,7 @@ dependencies = [
"flowy-codegen", "flowy-codegen",
"flowy-derive", "flowy-derive",
"flowy-error", "flowy-error",
"flowy-folder",
"flowy-notification", "flowy-notification",
"flowy-search-pub", "flowy-search-pub",
"flowy-sqlite", "flowy-sqlite",
@ -2247,6 +2262,7 @@ name = "flowy-server"
version = "0.1.0" version = "0.1.0"
dependencies = [ dependencies = [
"anyhow", "anyhow",
"appflowy-cloud-billing-client",
"bytes", "bytes",
"chrono", "chrono",
"client-api", "client-api",
@ -4814,7 +4830,7 @@ checksum = "c55e02e35260070b6f716a2423c2ff1c3bb1642ddca6f99e1f26d06268a0e2d2"
dependencies = [ dependencies = [
"bytes", "bytes",
"heck 0.4.1", "heck 0.4.1",
"itertools 0.10.5", "itertools 0.11.0",
"log", "log",
"multimap", "multimap",
"once_cell", "once_cell",
@ -4835,7 +4851,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "efb6c9a1dd1def8e2124d17e83a20af56f1570d6c2d2bd9e266ccb768df3840e" checksum = "efb6c9a1dd1def8e2124d17e83a20af56f1570d6c2d2bd9e266ccb768df3840e"
dependencies = [ dependencies = [
"anyhow", "anyhow",
"itertools 0.10.5", "itertools 0.11.0",
"proc-macro2", "proc-macro2",
"quote", "quote",
"syn 2.0.47", "syn 2.0.47",
@ -6744,9 +6760,9 @@ checksum = "c7c4ceeeca15c8384bbc3e011dbd8fccb7f068a440b752b7d9b32ceb0ca0e2e8"
[[package]] [[package]]
name = "tokio" name = "tokio"
version = "1.36.0" version = "1.38.0"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "61285f6515fa018fb2d1e46eb21223fff441ee8db5d0f1435e8ab4f5cdb80931" checksum = "ba4f4a02a7a80d6f274636f0aa95c7e383b912d41fe721a31f29e29698585a4a"
dependencies = [ dependencies = [
"backtrace", "backtrace",
"bytes", "bytes",
@ -6764,9 +6780,9 @@ dependencies = [
[[package]] [[package]]
name = "tokio-macros" name = "tokio-macros"
version = "2.2.0" version = "2.3.0"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "5b8a1e28f2deaa14e508979454cb3a223b10b938b45af148bc0986de36f1923b" checksum = "5f5ae998a069d4b5aba8ee9dad856af7d520c3699e6159b185c2acd48155d39a"
dependencies = [ dependencies = [
"proc-macro2", "proc-macro2",
"quote", "quote",

View File

@ -247,6 +247,20 @@ dependencies = [
"thiserror", "thiserror",
] ]
[[package]]
name = "appflowy-cloud-billing-client"
version = "0.1.0"
source = "git+https://github.com/AppFlowy-IO/AppFlowy-Cloud-Billing-Client?rev=9f9c2d1ad180987a31d18c6c067a56a5fa1f6da6#9f9c2d1ad180987a31d18c6c067a56a5fa1f6da6"
dependencies = [
"client-api",
"reqwest",
"serde",
"serde_json",
"shared-entity",
"tokio",
"yrs",
]
[[package]] [[package]]
name = "arc-swap" name = "arc-swap"
version = "1.7.1" version = "1.7.1"
@ -981,7 +995,7 @@ dependencies = [
"cssparser-macros", "cssparser-macros",
"dtoa-short", "dtoa-short",
"itoa", "itoa",
"phf 0.8.0", "phf 0.11.2",
"smallvec", "smallvec",
] ]
@ -1532,6 +1546,7 @@ name = "flowy-server"
version = "0.1.0" version = "0.1.0"
dependencies = [ dependencies = [
"anyhow", "anyhow",
"appflowy-cloud-billing-client",
"bytes", "bytes",
"chrono", "chrono",
"client-api", "client-api",
@ -2921,7 +2936,7 @@ version = "0.8.0"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "3dfb61232e34fcb633f43d12c58f83c1df82962dcdfa565a4e866ffc17dafe12" checksum = "3dfb61232e34fcb633f43d12c58f83c1df82962dcdfa565a4e866ffc17dafe12"
dependencies = [ dependencies = [
"phf_macros", "phf_macros 0.8.0",
"phf_shared 0.8.0", "phf_shared 0.8.0",
"proc-macro-hack", "proc-macro-hack",
] ]
@ -2941,6 +2956,7 @@ version = "0.11.2"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "ade2d8b8f33c7333b51bcf0428d37e217e9f32192ae4772156f65063b8ce03dc" checksum = "ade2d8b8f33c7333b51bcf0428d37e217e9f32192ae4772156f65063b8ce03dc"
dependencies = [ dependencies = [
"phf_macros 0.11.2",
"phf_shared 0.11.2", "phf_shared 0.11.2",
] ]
@ -3008,6 +3024,19 @@ dependencies = [
"syn 1.0.109", "syn 1.0.109",
] ]
[[package]]
name = "phf_macros"
version = "0.11.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "3444646e286606587e49f3bcf1679b8cef1dc2c5ecc29ddacaffc305180d464b"
dependencies = [
"phf_generator 0.11.2",
"phf_shared 0.11.2",
"proc-macro2",
"quote",
"syn 2.0.48",
]
[[package]] [[package]]
name = "phf_shared" name = "phf_shared"
version = "0.8.0" version = "0.8.0"
@ -4269,9 +4298,9 @@ checksum = "1f3ccbac311fea05f86f61904b462b55fb3df8837a366dfc601a0161d0532f20"
[[package]] [[package]]
name = "tokio" name = "tokio"
version = "1.36.0" version = "1.38.0"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "61285f6515fa018fb2d1e46eb21223fff441ee8db5d0f1435e8ab4f5cdb80931" checksum = "ba4f4a02a7a80d6f274636f0aa95c7e383b912d41fe721a31f29e29698585a4a"
dependencies = [ dependencies = [
"backtrace", "backtrace",
"bytes", "bytes",
@ -4285,9 +4314,9 @@ dependencies = [
[[package]] [[package]]
name = "tokio-macros" name = "tokio-macros"
version = "2.2.0" version = "2.3.0"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "5b8a1e28f2deaa14e508979454cb3a223b10b938b45af148bc0986de36f1923b" checksum = "5f5ae998a069d4b5aba8ee9dad856af7d520c3699e6159b185c2acd48155d39a"
dependencies = [ dependencies = [
"proc-macro2", "proc-macro2",
"quote", "quote",

View File

@ -495,6 +495,10 @@ impl FieldType {
s.to_string() s.to_string()
} }
pub fn is_ai_field(&self) -> bool {
matches!(self, FieldType::Summary | FieldType::Translate)
}
pub fn is_number(&self) -> bool { pub fn is_number(&self) -> bool {
matches!(self, FieldType::Number) matches!(self, FieldType::Number)
} }

View File

@ -435,8 +435,7 @@ impl DatabaseManager {
// When summarizing a row, skip the content in the "AI summary" cell; it does not need to // When summarizing a row, skip the content in the "AI summary" cell; it does not need to
// be summarized. // be summarized.
if field.id != field_id { if field.id != field_id {
// Don't summarize the summary field. if FieldType::from(field.field_type).is_ai_field() {
if field.field_type == FieldType::Summary as i64 {
continue; continue;
} }
if let Some(cell) = row.cells.get(&field.id) { if let Some(cell) = row.cells.get(&field.id) {
@ -482,8 +481,7 @@ impl DatabaseManager {
// When translate a row, skip the content in the "AI Translate" cell; it does not need to // When translate a row, skip the content in the "AI Translate" cell; it does not need to
// be translated. // be translated.
if field.id != field_id { if field.id != field_id {
// Don't translate the translate field. if FieldType::from(field.field_type).is_ai_field() {
if field.field_type == FieldType::Translate as i64 {
continue; continue;
} }