chore: remove field width and visibility (#5119)

This commit is contained in:
Richard Shiue 2024-04-16 18:20:15 +08:00 committed by GitHub
parent edc745e88a
commit 241bfa9ddd
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
16 changed files with 50 additions and 130 deletions

View File

@ -859,7 +859,7 @@ dependencies = [
[[package]]
name = "collab"
version = "0.1.0"
source = "git+https://github.com/AppFlowy-IO/AppFlowy-Collab?rev=3f7bc378af0ee5ca4e25e4746acaa66fab6df79f#3f7bc378af0ee5ca4e25e4746acaa66fab6df79f"
source = "git+https://github.com/AppFlowy-IO/AppFlowy-Collab?rev=f1ef8ef3c179a7340d91ad6e5e176cc980accb9c#f1ef8ef3c179a7340d91ad6e5e176cc980accb9c"
dependencies = [
"anyhow",
"async-trait",
@ -883,7 +883,7 @@ dependencies = [
[[package]]
name = "collab-database"
version = "0.1.0"
source = "git+https://github.com/AppFlowy-IO/AppFlowy-Collab?rev=3f7bc378af0ee5ca4e25e4746acaa66fab6df79f#3f7bc378af0ee5ca4e25e4746acaa66fab6df79f"
source = "git+https://github.com/AppFlowy-IO/AppFlowy-Collab?rev=f1ef8ef3c179a7340d91ad6e5e176cc980accb9c#f1ef8ef3c179a7340d91ad6e5e176cc980accb9c"
dependencies = [
"anyhow",
"async-trait",
@ -913,7 +913,7 @@ dependencies = [
[[package]]
name = "collab-document"
version = "0.1.0"
source = "git+https://github.com/AppFlowy-IO/AppFlowy-Collab?rev=3f7bc378af0ee5ca4e25e4746acaa66fab6df79f#3f7bc378af0ee5ca4e25e4746acaa66fab6df79f"
source = "git+https://github.com/AppFlowy-IO/AppFlowy-Collab?rev=f1ef8ef3c179a7340d91ad6e5e176cc980accb9c#f1ef8ef3c179a7340d91ad6e5e176cc980accb9c"
dependencies = [
"anyhow",
"collab",
@ -932,7 +932,7 @@ dependencies = [
[[package]]
name = "collab-entity"
version = "0.1.0"
source = "git+https://github.com/AppFlowy-IO/AppFlowy-Collab?rev=3f7bc378af0ee5ca4e25e4746acaa66fab6df79f#3f7bc378af0ee5ca4e25e4746acaa66fab6df79f"
source = "git+https://github.com/AppFlowy-IO/AppFlowy-Collab?rev=f1ef8ef3c179a7340d91ad6e5e176cc980accb9c#f1ef8ef3c179a7340d91ad6e5e176cc980accb9c"
dependencies = [
"anyhow",
"bytes",
@ -947,7 +947,7 @@ dependencies = [
[[package]]
name = "collab-folder"
version = "0.1.0"
source = "git+https://github.com/AppFlowy-IO/AppFlowy-Collab?rev=3f7bc378af0ee5ca4e25e4746acaa66fab6df79f#3f7bc378af0ee5ca4e25e4746acaa66fab6df79f"
source = "git+https://github.com/AppFlowy-IO/AppFlowy-Collab?rev=f1ef8ef3c179a7340d91ad6e5e176cc980accb9c#f1ef8ef3c179a7340d91ad6e5e176cc980accb9c"
dependencies = [
"anyhow",
"chrono",
@ -985,7 +985,7 @@ dependencies = [
[[package]]
name = "collab-plugins"
version = "0.1.0"
source = "git+https://github.com/AppFlowy-IO/AppFlowy-Collab?rev=3f7bc378af0ee5ca4e25e4746acaa66fab6df79f#3f7bc378af0ee5ca4e25e4746acaa66fab6df79f"
source = "git+https://github.com/AppFlowy-IO/AppFlowy-Collab?rev=f1ef8ef3c179a7340d91ad6e5e176cc980accb9c#f1ef8ef3c179a7340d91ad6e5e176cc980accb9c"
dependencies = [
"anyhow",
"async-stream",
@ -1063,7 +1063,7 @@ dependencies = [
[[package]]
name = "collab-user"
version = "0.1.0"
source = "git+https://github.com/AppFlowy-IO/AppFlowy-Collab?rev=3f7bc378af0ee5ca4e25e4746acaa66fab6df79f#3f7bc378af0ee5ca4e25e4746acaa66fab6df79f"
source = "git+https://github.com/AppFlowy-IO/AppFlowy-Collab?rev=f1ef8ef3c179a7340d91ad6e5e176cc980accb9c#f1ef8ef3c179a7340d91ad6e5e176cc980accb9c"
dependencies = [
"anyhow",
"collab",

View File

@ -98,10 +98,10 @@ client-api = { git = "https://github.com/AppFlowy-IO/AppFlowy-Cloud", rev = "390
# To switch to the local path, run:
# scripts/tool/update_collab_source.sh
# ⚠️⚠️⚠️️
collab = { git = "https://github.com/AppFlowy-IO/AppFlowy-Collab", rev = "3f7bc378af0ee5ca4e25e4746acaa66fab6df79f" }
collab-folder = { git = "https://github.com/AppFlowy-IO/AppFlowy-Collab", rev = "3f7bc378af0ee5ca4e25e4746acaa66fab6df79f" }
collab-document = { git = "https://github.com/AppFlowy-IO/AppFlowy-Collab", rev = "3f7bc378af0ee5ca4e25e4746acaa66fab6df79f" }
collab-database = { git = "https://github.com/AppFlowy-IO/AppFlowy-Collab", rev = "3f7bc378af0ee5ca4e25e4746acaa66fab6df79f" }
collab-plugins = { git = "https://github.com/AppFlowy-IO/AppFlowy-Collab", rev = "3f7bc378af0ee5ca4e25e4746acaa66fab6df79f" }
collab-user = { git = "https://github.com/AppFlowy-IO/AppFlowy-Collab", rev = "3f7bc378af0ee5ca4e25e4746acaa66fab6df79f" }
collab-entity = { git = "https://github.com/AppFlowy-IO/AppFlowy-Collab", rev = "3f7bc378af0ee5ca4e25e4746acaa66fab6df79f" }
collab = { git = "https://github.com/AppFlowy-IO/AppFlowy-Collab", rev = "f1ef8ef3c179a7340d91ad6e5e176cc980accb9c" }
collab-folder = { git = "https://github.com/AppFlowy-IO/AppFlowy-Collab", rev = "f1ef8ef3c179a7340d91ad6e5e176cc980accb9c" }
collab-document = { git = "https://github.com/AppFlowy-IO/AppFlowy-Collab", rev = "f1ef8ef3c179a7340d91ad6e5e176cc980accb9c" }
collab-database = { git = "https://github.com/AppFlowy-IO/AppFlowy-Collab", rev = "f1ef8ef3c179a7340d91ad6e5e176cc980accb9c" }
collab-plugins = { git = "https://github.com/AppFlowy-IO/AppFlowy-Collab", rev = "f1ef8ef3c179a7340d91ad6e5e176cc980accb9c" }
collab-user = { git = "https://github.com/AppFlowy-IO/AppFlowy-Collab", rev = "f1ef8ef3c179a7340d91ad6e5e176cc980accb9c" }
collab-entity = { git = "https://github.com/AppFlowy-IO/AppFlowy-Collab", rev = "f1ef8ef3c179a7340d91ad6e5e176cc980accb9c" }

View File

@ -65,10 +65,10 @@ client-api = { git = "https://github.com/AppFlowy-IO/AppFlowy-Cloud", rev = "390
# To switch to the local path, run:
# scripts/tool/update_collab_source.sh
# ⚠️⚠️⚠️️
collab = { git = "https://github.com/AppFlowy-IO/AppFlowy-Collab", rev = "3f7bc378af0ee5ca4e25e4746acaa66fab6df79f" }
collab-folder = { git = "https://github.com/AppFlowy-IO/AppFlowy-Collab", rev = "3f7bc378af0ee5ca4e25e4746acaa66fab6df79f" }
collab-document = { git = "https://github.com/AppFlowy-IO/AppFlowy-Collab", rev = "3f7bc378af0ee5ca4e25e4746acaa66fab6df79f" }
collab-database = { git = "https://github.com/AppFlowy-IO/AppFlowy-Collab", rev = "3f7bc378af0ee5ca4e25e4746acaa66fab6df79f" }
collab-plugins = { git = "https://github.com/AppFlowy-IO/AppFlowy-Collab", rev = "3f7bc378af0ee5ca4e25e4746acaa66fab6df79f" }
collab-user = { git = "https://github.com/AppFlowy-IO/AppFlowy-Collab", rev = "3f7bc378af0ee5ca4e25e4746acaa66fab6df79f" }
collab-entity = { git = "https://github.com/AppFlowy-IO/AppFlowy-Collab", rev = "3f7bc378af0ee5ca4e25e4746acaa66fab6df79f" }
collab = { git = "https://github.com/AppFlowy-IO/AppFlowy-Collab", rev = "f1ef8ef3c179a7340d91ad6e5e176cc980accb9c" }
collab-folder = { git = "https://github.com/AppFlowy-IO/AppFlowy-Collab", rev = "f1ef8ef3c179a7340d91ad6e5e176cc980accb9c" }
collab-document = { git = "https://github.com/AppFlowy-IO/AppFlowy-Collab", rev = "f1ef8ef3c179a7340d91ad6e5e176cc980accb9c" }
collab-database = { git = "https://github.com/AppFlowy-IO/AppFlowy-Collab", rev = "f1ef8ef3c179a7340d91ad6e5e176cc980accb9c" }
collab-plugins = { git = "https://github.com/AppFlowy-IO/AppFlowy-Collab", rev = "f1ef8ef3c179a7340d91ad6e5e176cc980accb9c" }
collab-user = { git = "https://github.com/AppFlowy-IO/AppFlowy-Collab", rev = "f1ef8ef3c179a7340d91ad6e5e176cc980accb9c" }
collab-entity = { git = "https://github.com/AppFlowy-IO/AppFlowy-Collab", rev = "f1ef8ef3c179a7340d91ad6e5e176cc980accb9c" }

View File

@ -842,7 +842,7 @@ dependencies = [
[[package]]
name = "collab"
version = "0.1.0"
source = "git+https://github.com/AppFlowy-IO/AppFlowy-Collab?rev=3f7bc378af0ee5ca4e25e4746acaa66fab6df79f#3f7bc378af0ee5ca4e25e4746acaa66fab6df79f"
source = "git+https://github.com/AppFlowy-IO/AppFlowy-Collab?rev=f1ef8ef3c179a7340d91ad6e5e176cc980accb9c#f1ef8ef3c179a7340d91ad6e5e176cc980accb9c"
dependencies = [
"anyhow",
"async-trait",
@ -866,7 +866,7 @@ dependencies = [
[[package]]
name = "collab-database"
version = "0.1.0"
source = "git+https://github.com/AppFlowy-IO/AppFlowy-Collab?rev=3f7bc378af0ee5ca4e25e4746acaa66fab6df79f#3f7bc378af0ee5ca4e25e4746acaa66fab6df79f"
source = "git+https://github.com/AppFlowy-IO/AppFlowy-Collab?rev=f1ef8ef3c179a7340d91ad6e5e176cc980accb9c#f1ef8ef3c179a7340d91ad6e5e176cc980accb9c"
dependencies = [
"anyhow",
"async-trait",
@ -896,7 +896,7 @@ dependencies = [
[[package]]
name = "collab-document"
version = "0.1.0"
source = "git+https://github.com/AppFlowy-IO/AppFlowy-Collab?rev=3f7bc378af0ee5ca4e25e4746acaa66fab6df79f#3f7bc378af0ee5ca4e25e4746acaa66fab6df79f"
source = "git+https://github.com/AppFlowy-IO/AppFlowy-Collab?rev=f1ef8ef3c179a7340d91ad6e5e176cc980accb9c#f1ef8ef3c179a7340d91ad6e5e176cc980accb9c"
dependencies = [
"anyhow",
"collab",
@ -915,7 +915,7 @@ dependencies = [
[[package]]
name = "collab-entity"
version = "0.1.0"
source = "git+https://github.com/AppFlowy-IO/AppFlowy-Collab?rev=3f7bc378af0ee5ca4e25e4746acaa66fab6df79f#3f7bc378af0ee5ca4e25e4746acaa66fab6df79f"
source = "git+https://github.com/AppFlowy-IO/AppFlowy-Collab?rev=f1ef8ef3c179a7340d91ad6e5e176cc980accb9c#f1ef8ef3c179a7340d91ad6e5e176cc980accb9c"
dependencies = [
"anyhow",
"bytes",
@ -930,7 +930,7 @@ dependencies = [
[[package]]
name = "collab-folder"
version = "0.1.0"
source = "git+https://github.com/AppFlowy-IO/AppFlowy-Collab?rev=3f7bc378af0ee5ca4e25e4746acaa66fab6df79f#3f7bc378af0ee5ca4e25e4746acaa66fab6df79f"
source = "git+https://github.com/AppFlowy-IO/AppFlowy-Collab?rev=f1ef8ef3c179a7340d91ad6e5e176cc980accb9c#f1ef8ef3c179a7340d91ad6e5e176cc980accb9c"
dependencies = [
"anyhow",
"chrono",
@ -968,7 +968,7 @@ dependencies = [
[[package]]
name = "collab-plugins"
version = "0.1.0"
source = "git+https://github.com/AppFlowy-IO/AppFlowy-Collab?rev=3f7bc378af0ee5ca4e25e4746acaa66fab6df79f#3f7bc378af0ee5ca4e25e4746acaa66fab6df79f"
source = "git+https://github.com/AppFlowy-IO/AppFlowy-Collab?rev=f1ef8ef3c179a7340d91ad6e5e176cc980accb9c#f1ef8ef3c179a7340d91ad6e5e176cc980accb9c"
dependencies = [
"anyhow",
"async-stream",
@ -1046,7 +1046,7 @@ dependencies = [
[[package]]
name = "collab-user"
version = "0.1.0"
source = "git+https://github.com/AppFlowy-IO/AppFlowy-Collab?rev=3f7bc378af0ee5ca4e25e4746acaa66fab6df79f#3f7bc378af0ee5ca4e25e4746acaa66fab6df79f"
source = "git+https://github.com/AppFlowy-IO/AppFlowy-Collab?rev=f1ef8ef3c179a7340d91ad6e5e176cc980accb9c#f1ef8ef3c179a7340d91ad6e5e176cc980accb9c"
dependencies = [
"anyhow",
"collab",

View File

@ -97,10 +97,10 @@ client-api = { git = "https://github.com/AppFlowy-IO/AppFlowy-Cloud", rev = "390
# To switch to the local path, run:
# scripts/tool/update_collab_source.sh
# ⚠️⚠️⚠️️
collab = { git = "https://github.com/AppFlowy-IO/AppFlowy-Collab", rev = "3f7bc378af0ee5ca4e25e4746acaa66fab6df79f" }
collab-folder = { git = "https://github.com/AppFlowy-IO/AppFlowy-Collab", rev = "3f7bc378af0ee5ca4e25e4746acaa66fab6df79f" }
collab-document = { git = "https://github.com/AppFlowy-IO/AppFlowy-Collab", rev = "3f7bc378af0ee5ca4e25e4746acaa66fab6df79f" }
collab-database = { git = "https://github.com/AppFlowy-IO/AppFlowy-Collab", rev = "3f7bc378af0ee5ca4e25e4746acaa66fab6df79f" }
collab-plugins = { git = "https://github.com/AppFlowy-IO/AppFlowy-Collab", rev = "3f7bc378af0ee5ca4e25e4746acaa66fab6df79f" }
collab-user = { git = "https://github.com/AppFlowy-IO/AppFlowy-Collab", rev = "3f7bc378af0ee5ca4e25e4746acaa66fab6df79f" }
collab-entity = { git = "https://github.com/AppFlowy-IO/AppFlowy-Collab", rev = "3f7bc378af0ee5ca4e25e4746acaa66fab6df79f" }
collab = { git = "https://github.com/AppFlowy-IO/AppFlowy-Collab", rev = "f1ef8ef3c179a7340d91ad6e5e176cc980accb9c" }
collab-folder = { git = "https://github.com/AppFlowy-IO/AppFlowy-Collab", rev = "f1ef8ef3c179a7340d91ad6e5e176cc980accb9c" }
collab-document = { git = "https://github.com/AppFlowy-IO/AppFlowy-Collab", rev = "f1ef8ef3c179a7340d91ad6e5e176cc980accb9c" }
collab-database = { git = "https://github.com/AppFlowy-IO/AppFlowy-Collab", rev = "f1ef8ef3c179a7340d91ad6e5e176cc980accb9c" }
collab-plugins = { git = "https://github.com/AppFlowy-IO/AppFlowy-Collab", rev = "f1ef8ef3c179a7340d91ad6e5e176cc980accb9c" }
collab-user = { git = "https://github.com/AppFlowy-IO/AppFlowy-Collab", rev = "f1ef8ef3c179a7340d91ad6e5e176cc980accb9c" }
collab-entity = { git = "https://github.com/AppFlowy-IO/AppFlowy-Collab", rev = "f1ef8ef3c179a7340d91ad6e5e176cc980accb9c" }

View File

@ -784,7 +784,7 @@ dependencies = [
[[package]]
name = "collab"
version = "0.1.0"
source = "git+https://github.com/AppFlowy-IO/AppFlowy-Collab?rev=3f7bc378af0ee5ca4e25e4746acaa66fab6df79f#3f7bc378af0ee5ca4e25e4746acaa66fab6df79f"
source = "git+https://github.com/AppFlowy-IO/AppFlowy-Collab?rev=f1ef8ef3c179a7340d91ad6e5e176cc980accb9c#f1ef8ef3c179a7340d91ad6e5e176cc980accb9c"
dependencies = [
"anyhow",
"async-trait",
@ -808,7 +808,7 @@ dependencies = [
[[package]]
name = "collab-database"
version = "0.1.0"
source = "git+https://github.com/AppFlowy-IO/AppFlowy-Collab?rev=3f7bc378af0ee5ca4e25e4746acaa66fab6df79f#3f7bc378af0ee5ca4e25e4746acaa66fab6df79f"
source = "git+https://github.com/AppFlowy-IO/AppFlowy-Collab?rev=f1ef8ef3c179a7340d91ad6e5e176cc980accb9c#f1ef8ef3c179a7340d91ad6e5e176cc980accb9c"
dependencies = [
"anyhow",
"async-trait",
@ -838,7 +838,7 @@ dependencies = [
[[package]]
name = "collab-document"
version = "0.1.0"
source = "git+https://github.com/AppFlowy-IO/AppFlowy-Collab?rev=3f7bc378af0ee5ca4e25e4746acaa66fab6df79f#3f7bc378af0ee5ca4e25e4746acaa66fab6df79f"
source = "git+https://github.com/AppFlowy-IO/AppFlowy-Collab?rev=f1ef8ef3c179a7340d91ad6e5e176cc980accb9c#f1ef8ef3c179a7340d91ad6e5e176cc980accb9c"
dependencies = [
"anyhow",
"collab",
@ -857,7 +857,7 @@ dependencies = [
[[package]]
name = "collab-entity"
version = "0.1.0"
source = "git+https://github.com/AppFlowy-IO/AppFlowy-Collab?rev=3f7bc378af0ee5ca4e25e4746acaa66fab6df79f#3f7bc378af0ee5ca4e25e4746acaa66fab6df79f"
source = "git+https://github.com/AppFlowy-IO/AppFlowy-Collab?rev=f1ef8ef3c179a7340d91ad6e5e176cc980accb9c#f1ef8ef3c179a7340d91ad6e5e176cc980accb9c"
dependencies = [
"anyhow",
"bytes",
@ -872,7 +872,7 @@ dependencies = [
[[package]]
name = "collab-folder"
version = "0.1.0"
source = "git+https://github.com/AppFlowy-IO/AppFlowy-Collab?rev=3f7bc378af0ee5ca4e25e4746acaa66fab6df79f#3f7bc378af0ee5ca4e25e4746acaa66fab6df79f"
source = "git+https://github.com/AppFlowy-IO/AppFlowy-Collab?rev=f1ef8ef3c179a7340d91ad6e5e176cc980accb9c#f1ef8ef3c179a7340d91ad6e5e176cc980accb9c"
dependencies = [
"anyhow",
"chrono",
@ -910,7 +910,7 @@ dependencies = [
[[package]]
name = "collab-plugins"
version = "0.1.0"
source = "git+https://github.com/AppFlowy-IO/AppFlowy-Collab?rev=3f7bc378af0ee5ca4e25e4746acaa66fab6df79f#3f7bc378af0ee5ca4e25e4746acaa66fab6df79f"
source = "git+https://github.com/AppFlowy-IO/AppFlowy-Collab?rev=f1ef8ef3c179a7340d91ad6e5e176cc980accb9c#f1ef8ef3c179a7340d91ad6e5e176cc980accb9c"
dependencies = [
"anyhow",
"async-stream",
@ -988,7 +988,7 @@ dependencies = [
[[package]]
name = "collab-user"
version = "0.1.0"
source = "git+https://github.com/AppFlowy-IO/AppFlowy-Collab?rev=3f7bc378af0ee5ca4e25e4746acaa66fab6df79f#3f7bc378af0ee5ca4e25e4746acaa66fab6df79f"
source = "git+https://github.com/AppFlowy-IO/AppFlowy-Collab?rev=f1ef8ef3c179a7340d91ad6e5e176cc980accb9c#f1ef8ef3c179a7340d91ad6e5e176cc980accb9c"
dependencies = [
"anyhow",
"collab",

View File

@ -125,10 +125,10 @@ client-api = { git = " https://github.com/AppFlowy-IO/AppFlowy-Cloud", rev = "39
# To switch to the local path, run:
# scripts/tool/update_collab_source.sh
# ⚠️⚠️⚠️️
collab = { git = "https://github.com/AppFlowy-IO/AppFlowy-Collab", rev = "3f7bc378af0ee5ca4e25e4746acaa66fab6df79f" }
collab-folder = { git = "https://github.com/AppFlowy-IO/AppFlowy-Collab", rev = "3f7bc378af0ee5ca4e25e4746acaa66fab6df79f" }
collab-document = { git = "https://github.com/AppFlowy-IO/AppFlowy-Collab", rev = "3f7bc378af0ee5ca4e25e4746acaa66fab6df79f" }
collab-database = { git = "https://github.com/AppFlowy-IO/AppFlowy-Collab", rev = "3f7bc378af0ee5ca4e25e4746acaa66fab6df79f" }
collab-plugins = { git = "https://github.com/AppFlowy-IO/AppFlowy-Collab", rev = "3f7bc378af0ee5ca4e25e4746acaa66fab6df79f" }
collab-user = { git = "https://github.com/AppFlowy-IO/AppFlowy-Collab", rev = "3f7bc378af0ee5ca4e25e4746acaa66fab6df79f" }
collab-entity = { git = "https://github.com/AppFlowy-IO/AppFlowy-Collab", rev = "3f7bc378af0ee5ca4e25e4746acaa66fab6df79f" }
collab = { git = "https://github.com/AppFlowy-IO/AppFlowy-Collab", rev = "f1ef8ef3c179a7340d91ad6e5e176cc980accb9c" }
collab-folder = { git = "https://github.com/AppFlowy-IO/AppFlowy-Collab", rev = "f1ef8ef3c179a7340d91ad6e5e176cc980accb9c" }
collab-document = { git = "https://github.com/AppFlowy-IO/AppFlowy-Collab", rev = "f1ef8ef3c179a7340d91ad6e5e176cc980accb9c" }
collab-database = { git = "https://github.com/AppFlowy-IO/AppFlowy-Collab", rev = "f1ef8ef3c179a7340d91ad6e5e176cc980accb9c" }
collab-plugins = { git = "https://github.com/AppFlowy-IO/AppFlowy-Collab", rev = "f1ef8ef3c179a7340d91ad6e5e176cc980accb9c" }
collab-user = { git = "https://github.com/AppFlowy-IO/AppFlowy-Collab", rev = "f1ef8ef3c179a7340d91ad6e5e176cc980accb9c" }
collab-entity = { git = "https://github.com/AppFlowy-IO/AppFlowy-Collab", rev = "f1ef8ef3c179a7340d91ad6e5e176cc980accb9c" }

View File

@ -29,12 +29,6 @@ pub struct FieldPB {
#[pb(index = 3)]
pub field_type: FieldType,
#[pb(index = 4)]
pub visibility: bool,
#[pb(index = 5)]
pub width: i32,
#[pb(index = 6)]
pub is_primary: bool,
@ -52,8 +46,6 @@ impl FieldPB {
id: field.id,
name: field.name,
field_type,
visibility: field.visibility,
width: field.width as i32,
is_primary: field.is_primary,
type_option_data: type_option_to_pb(type_option, &field_type).to_vec(),
}
@ -388,12 +380,6 @@ pub struct FieldChangesetPB {
#[pb(index = 5, one_of)]
pub frozen: Option<bool>,
#[pb(index = 6, one_of)]
pub visibility: Option<bool>,
#[pb(index = 7, one_of)]
pub width: Option<i32>,
}
impl TryInto<FieldChangesetParams> for FieldChangesetPB {
@ -402,11 +388,6 @@ impl TryInto<FieldChangesetParams> for FieldChangesetPB {
fn try_into(self) -> Result<FieldChangesetParams, Self::Error> {
let view_id = NotEmptyStr::parse(self.view_id).map_err(|_| ErrorCode::DatabaseIdIsEmpty)?;
let field_id = NotEmptyStr::parse(self.field_id).map_err(|_| ErrorCode::FieldIdIsEmpty)?;
// if let Some(type_option_data) = self.type_option_data.as_ref() {
// if type_option_data.is_empty() {
// return Err(ErrorCode::TypeOptionDataIsEmpty);
// }
// }
Ok(FieldChangesetParams {
field_id: field_id.0,
@ -414,9 +395,6 @@ impl TryInto<FieldChangesetParams> for FieldChangesetPB {
name: self.name,
desc: self.desc,
frozen: self.frozen,
visibility: self.visibility,
width: self.width,
// type_option_data: self.type_option_data,
})
}
}
@ -432,11 +410,6 @@ pub struct FieldChangesetParams {
pub desc: Option<String>,
pub frozen: Option<bool>,
pub visibility: Option<bool>,
pub width: Option<i32>,
// pub type_option_data: Option<Vec<u8>>,
}
/// Certain field types have user-defined options such as color, date format, number format,
/// or a list of values for a multi-select list. These options are defined within a specialization

View File

@ -308,10 +308,7 @@ impl DatabaseEditor {
.lock()
.fields
.update_field(&params.field_id, |update| {
update
.set_name_if_not_none(params.name)
.set_width_at_if_not_none(params.width.map(|value| value as i64))
.set_visibility_if_not_none(params.visibility);
update.set_name_if_not_none(params.name);
});
notify_did_update_database_field(&self.database, &params.field_id)?;
Ok(())

View File

@ -10,7 +10,6 @@ pub struct FieldBuilder {
impl FieldBuilder {
pub fn new<T: Into<TypeOptionData>>(field_type: FieldType, type_option_data: T) -> Self {
let mut field = Field::new(gen_field_id(), "".to_string(), field_type.into(), false);
field.width = 150;
field
.type_options
.insert(field_type.to_string(), type_option_data.into());
@ -32,16 +31,6 @@ impl FieldBuilder {
self
}
pub fn visibility(mut self, visibility: bool) -> Self {
self.field.visibility = visibility;
self
}
pub fn width(mut self, width: i64) -> Self {
self.field.width = width;
self
}
pub fn build(self) -> Field {
self.field
}

View File

@ -252,7 +252,6 @@ pub fn default_type_option_data_from_type(field_type: FieldType) -> TypeOptionDa
FieldType::DateTime => DateTypeOption::default().into(),
FieldType::LastEditedTime | FieldType::CreatedTime => TimestampTypeOption {
field_type,
include_time: true,
..Default::default()
}
.into(),

View File

@ -13,18 +13,15 @@ use crate::services::setting::{BoardLayoutSetting, CalendarLayoutSetting};
pub fn make_default_grid(view_id: &str, name: &str) -> CreateDatabaseParams {
let text_field = FieldBuilder::from_field_type(FieldType::RichText)
.name("Name")
.visibility(true)
.primary(true)
.build();
let single_select = FieldBuilder::from_field_type(FieldType::SingleSelect)
.name("Type")
.visibility(true)
.build();
let checkbox_field = FieldBuilder::from_field_type(FieldType::Checkbox)
.name("Done")
.visibility(true)
.build();
let fields = vec![text_field, single_select, checkbox_field];
@ -54,7 +51,6 @@ pub fn make_default_board(view_id: &str, name: &str) -> CreateDatabaseParams {
// text
let text_field = FieldBuilder::from_field_type(FieldType::RichText)
.name("Description")
.visibility(true)
.primary(true)
.build();
let text_field_id = text_field.id.clone();
@ -69,7 +65,6 @@ pub fn make_default_board(view_id: &str, name: &str) -> CreateDatabaseParams {
.extend(vec![to_do_option.clone(), doing_option, done_option]);
let single_select = FieldBuilder::new(FieldType::SingleSelect, single_select_type_option)
.name("Status")
.visibility(true)
.build();
let single_select_field_id = single_select.id.clone();
@ -113,21 +108,18 @@ pub fn make_default_calendar(view_id: &str, name: &str) -> CreateDatabaseParams
// text
let text_field = FieldBuilder::from_field_type(FieldType::RichText)
.name("Title")
.visibility(true)
.primary(true)
.build();
// date
let date_field = FieldBuilder::from_field_type(FieldType::DateTime)
.name("Date")
.visibility(true)
.build();
let date_field_id = date_field.id.clone();
// multi select
let multi_select_field = FieldBuilder::from_field_type(FieldType::MultiSelect)
.name("Tags")
.visibility(true)
.build();
let fields = vec![text_field, date_field, multi_select_field];

View File

@ -12,7 +12,6 @@ pub fn create_text_field(grid_id: &str) -> (CreateFieldParams, Field) {
let type_option = RichTextTypeOption::default();
let text_field = FieldBuilder::new(field_type, type_option.clone())
.name("Name")
.visibility(true)
.primary(true)
.build();
@ -34,7 +33,6 @@ pub fn create_single_select_field(grid_id: &str) -> (CreateFieldParams, Field) {
type_option.options.push(SelectOption::new("Progress"));
let single_select_field = FieldBuilder::new(field_type, type_option.clone())
.name("Name")
.visibility(true)
.build();
let type_option_data = type_option_to_pb(type_option.into(), &field_type).to_vec();
@ -57,7 +55,6 @@ pub fn create_date_field(grid_id: &str) -> (CreateFieldParams, Field) {
let field = FieldBuilder::new(FieldType::DateTime, date_type_option.clone())
.name("Date")
.visibility(true)
.build();
let type_option_data = type_option_to_pb(date_type_option.into(), &FieldType::DateTime).to_vec();
@ -83,11 +80,9 @@ pub fn create_timestamp_field(grid_id: &str, field_type: FieldType) -> (CreateFi
let field: Field = match field_type {
FieldType::LastEditedTime => FieldBuilder::new(field_type, timestamp_type_option.clone())
.name("Updated At")
.visibility(true)
.build(),
FieldType::CreatedTime => FieldBuilder::new(field_type, timestamp_type_option.clone())
.name("Created At")
.visibility(true)
.build(),
_ => panic!("Unsupported group field type"),
};

View File

@ -24,7 +24,6 @@ pub fn make_test_board() -> DatabaseData {
FieldType::RichText => {
let text_field = FieldBuilder::from_field_type(field_type)
.name("Name")
.visibility(true)
.primary(true)
.build();
fields.push(text_field);
@ -33,7 +32,6 @@ pub fn make_test_board() -> DatabaseData {
// Number
let number_field = FieldBuilder::from_field_type(field_type)
.name("Price")
.visibility(true)
.build();
fields.push(number_field);
},
@ -47,7 +45,6 @@ pub fn make_test_board() -> DatabaseData {
let name = "Time";
let date_field = FieldBuilder::new(field_type, date_type_option)
.name(name)
.visibility(true)
.build();
fields.push(date_field);
},
@ -66,7 +63,6 @@ pub fn make_test_board() -> DatabaseData {
};
let date_field = FieldBuilder::new(field_type, date_type_option)
.name(name)
.visibility(true)
.build();
fields.push(date_field);
},
@ -81,7 +77,6 @@ pub fn make_test_board() -> DatabaseData {
.extend(vec![option1, option2, option3]);
let single_select_field = FieldBuilder::new(field_type, single_select_type_option)
.name("Status")
.visibility(true)
.build();
fields.push(single_select_field);
},
@ -94,7 +89,6 @@ pub fn make_test_board() -> DatabaseData {
type_option.options.extend(vec![option1, option2, option3]);
let multi_select_field = FieldBuilder::new(field_type, type_option)
.name("Platform")
.visibility(true)
.build();
fields.push(multi_select_field);
},
@ -102,7 +96,6 @@ pub fn make_test_board() -> DatabaseData {
// Checkbox
let checkbox_field = FieldBuilder::from_field_type(field_type)
.name("is urgent")
.visibility(true)
.build();
fields.push(checkbox_field);
},
@ -110,7 +103,6 @@ pub fn make_test_board() -> DatabaseData {
// URL
let url = FieldBuilder::from_field_type(field_type)
.name("link")
.visibility(true)
.build();
fields.push(url);
},
@ -122,7 +114,6 @@ pub fn make_test_board() -> DatabaseData {
// type_option.options.extend(vec![option1, option2, option3]);
let checklist_field = FieldBuilder::new(field_type, type_option)
.name("TODO")
.visibility(true)
.build();
fields.push(checklist_field);
},
@ -132,7 +123,6 @@ pub fn make_test_board() -> DatabaseData {
};
let relation_field = FieldBuilder::new(field_type, type_option)
.name("Related")
.visibility(true)
.build();
fields.push(relation_field);
},

View File

@ -17,7 +17,6 @@ pub fn make_test_calendar() -> DatabaseData {
// text
let text_field = FieldBuilder::from_field_type(FieldType::RichText)
.name("Name")
.visibility(true)
.primary(true)
.build();
fields.push(text_field);
@ -25,7 +24,6 @@ pub fn make_test_calendar() -> DatabaseData {
// date
let date_field = FieldBuilder::from_field_type(FieldType::DateTime)
.name("Date")
.visibility(true)
.build();
let date_field_id = date_field.id.clone();
fields.push(date_field);
@ -34,7 +32,6 @@ pub fn make_test_calendar() -> DatabaseData {
let type_option = MultiSelectTypeOption::default();
let multi_select_field = FieldBuilder::new(FieldType::MultiSelect, type_option)
.name("Tags")
.visibility(true)
.build();
fields.push(multi_select_field);

View File

@ -23,7 +23,6 @@ pub fn make_test_grid() -> DatabaseData {
FieldType::RichText => {
let text_field = FieldBuilder::from_field_type(field_type)
.name("Name")
.visibility(true)
.primary(true)
.build();
fields.push(text_field);
@ -35,7 +34,6 @@ pub fn make_test_grid() -> DatabaseData {
let number_field = FieldBuilder::new(field_type, type_option)
.name("Price")
.visibility(true)
.build();
fields.push(number_field);
},
@ -49,7 +47,6 @@ pub fn make_test_grid() -> DatabaseData {
let name = "Time";
let date_field = FieldBuilder::new(field_type, date_type_option)
.name(name)
.visibility(true)
.build();
fields.push(date_field);
},
@ -68,7 +65,6 @@ pub fn make_test_grid() -> DatabaseData {
};
let timestamp_field = FieldBuilder::new(field_type, timestamp_type_option)
.name(name)
.visibility(true)
.build();
fields.push(timestamp_field);
},
@ -83,7 +79,6 @@ pub fn make_test_grid() -> DatabaseData {
.extend(vec![option1, option2, option3]);
let single_select_field = FieldBuilder::new(field_type, single_select_type_option)
.name("Status")
.visibility(true)
.build();
fields.push(single_select_field);
},
@ -96,7 +91,6 @@ pub fn make_test_grid() -> DatabaseData {
type_option.options.extend(vec![option1, option2, option3]);
let multi_select_field = FieldBuilder::new(field_type, type_option)
.name("Platform")
.visibility(true)
.build();
fields.push(multi_select_field);
},
@ -104,7 +98,6 @@ pub fn make_test_grid() -> DatabaseData {
// Checkbox
let checkbox_field = FieldBuilder::from_field_type(field_type)
.name("is urgent")
.visibility(true)
.build();
fields.push(checkbox_field);
},
@ -112,7 +105,6 @@ pub fn make_test_grid() -> DatabaseData {
// URL
let url = FieldBuilder::from_field_type(field_type)
.name("link")
.visibility(true)
.build();
fields.push(url);
},
@ -120,7 +112,6 @@ pub fn make_test_grid() -> DatabaseData {
let type_option = ChecklistTypeOption;
let checklist_field = FieldBuilder::new(field_type, type_option)
.name("TODO")
.visibility(true)
.build();
fields.push(checklist_field);
},
@ -130,7 +121,6 @@ pub fn make_test_grid() -> DatabaseData {
};
let relation_field = FieldBuilder::new(field_type, type_option)
.name("Related")
.visibility(true)
.build();
fields.push(relation_field);
},
@ -297,7 +287,6 @@ pub fn make_no_date_test_grid() -> DatabaseData {
FieldType::RichText => {
let text_field = FieldBuilder::from_field_type(field_type)
.name("Name")
.visibility(true)
.primary(true)
.build();
fields.push(text_field);
@ -309,7 +298,6 @@ pub fn make_no_date_test_grid() -> DatabaseData {
let number_field = FieldBuilder::new(field_type, type_option)
.name("Price")
.visibility(true)
.build();
fields.push(number_field);
},