mirror of
https://github.com/AppFlowy-IO/AppFlowy.git
synced 2024-08-30 18:12:39 +00:00
feat: row document (#2792)
* chore: create orphan view handler * feat: save icon url and cover url in view * feat: implement emoji picker UI * chore: config ui * chore: config ui again * chore: replace RowPB with RowMetaPB to exposing more row information * fix: compile error * feat: show emoji in row * chore: update * test: insert emoji test * test: add update emoji test * test: add remove emoji test * test: add create field tests * test: add create row and delete row integration tests * test: add create row from row menu * test: document in row detail page * test: delete, duplicate row in row detail page * test: check the row count displayed in grid page * test: rename existing field in grid page * test: update field type of exisiting field in grid page * test: delete field test * test: add duplicate field test * test: add hide field test * test: add edit text cell test * test: add insert text to text cell test * test: add edit number cell test * test: add edit multiple number cells * test: add edit checkbox cell test * feat: integrate editor into database row * test: add edit create time and last edit time cell test * test: add edit date cell by selecting a date test * chore: remove unused code * chore: update checklist bg color * test: add update database layout test --------- Co-authored-by: Lucas.Xu <lucas.xu@appflowy.io>
This commit is contained in:
@ -1,8 +1,8 @@
|
||||
use bytes::Bytes;
|
||||
use std::convert::TryFrom;
|
||||
use std::env::temp_dir;
|
||||
use std::sync::Arc;
|
||||
|
||||
use bytes::Bytes;
|
||||
use nanoid::nanoid;
|
||||
use parking_lot::RwLock;
|
||||
|
||||
@ -96,6 +96,16 @@ impl FlowyCoreTest {
|
||||
.await;
|
||||
}
|
||||
|
||||
pub async fn update_view(&self, changeset: UpdateViewPayloadPB) -> Option<FlowyError> {
|
||||
// delete the view. the view will be moved to trash
|
||||
EventBuilder::new(self.clone())
|
||||
.event(flowy_folder2::event_map::FolderEvent::UpdateView)
|
||||
.payload(changeset)
|
||||
.async_send()
|
||||
.await
|
||||
.error()
|
||||
}
|
||||
|
||||
pub async fn create_view(&self, parent_id: &str, name: String) -> ViewPB {
|
||||
let payload = CreateViewPayloadPB {
|
||||
parent_view_id: parent_id.to_string(),
|
||||
@ -264,12 +274,23 @@ impl FlowyCoreTest {
|
||||
.error()
|
||||
}
|
||||
|
||||
pub async fn get_primary_field(&self, database_view_id: &str) -> FieldPB {
|
||||
EventBuilder::new(self.clone())
|
||||
.event(flowy_database2::event_map::DatabaseEvent::GetPrimaryField)
|
||||
.payload(DatabaseViewIdPB {
|
||||
value: database_view_id.to_string(),
|
||||
})
|
||||
.async_send()
|
||||
.await
|
||||
.parse::<FieldPB>()
|
||||
}
|
||||
|
||||
pub async fn create_row(
|
||||
&self,
|
||||
view_id: &str,
|
||||
start_row_id: Option<String>,
|
||||
data: Option<RowDataPB>,
|
||||
) -> RowPB {
|
||||
) -> RowMetaPB {
|
||||
EventBuilder::new(self.clone())
|
||||
.event(flowy_database2::event_map::DatabaseEvent::CreateRow)
|
||||
.payload(CreateRowPayloadPB {
|
||||
@ -280,7 +301,7 @@ impl FlowyCoreTest {
|
||||
})
|
||||
.async_send()
|
||||
.await
|
||||
.parse::<RowPB>()
|
||||
.parse::<RowMetaPB>()
|
||||
}
|
||||
|
||||
pub async fn delete_row(&self, view_id: &str, row_id: &str) -> Option<FlowyError> {
|
||||
@ -309,6 +330,28 @@ impl FlowyCoreTest {
|
||||
.parse::<OptionalRowPB>()
|
||||
}
|
||||
|
||||
pub async fn get_row_meta(&self, view_id: &str, row_id: &str) -> RowMetaPB {
|
||||
EventBuilder::new(self.clone())
|
||||
.event(flowy_database2::event_map::DatabaseEvent::GetRowMeta)
|
||||
.payload(RowIdPB {
|
||||
view_id: view_id.to_string(),
|
||||
row_id: row_id.to_string(),
|
||||
group_id: None,
|
||||
})
|
||||
.async_send()
|
||||
.await
|
||||
.parse::<RowMetaPB>()
|
||||
}
|
||||
|
||||
pub async fn update_row_meta(&self, changeset: UpdateRowMetaChangesetPB) -> Option<FlowyError> {
|
||||
EventBuilder::new(self.clone())
|
||||
.event(flowy_database2::event_map::DatabaseEvent::UpdateRowMeta)
|
||||
.payload(changeset)
|
||||
.async_send()
|
||||
.await
|
||||
.error()
|
||||
}
|
||||
|
||||
pub async fn duplicate_row(&self, view_id: &str, row_id: &str) -> Option<FlowyError> {
|
||||
EventBuilder::new(self.clone())
|
||||
.event(flowy_database2::event_map::DatabaseEvent::DuplicateRow)
|
||||
|
Reference in New Issue
Block a user