| 
									
										
										
										
											2024-10-15 09:32:06 +08:00
										 |  |  | use crate::database::database_editor::DatabaseEditorTest;
 | 
					
						
							| 
									
										
										
										
											2023-04-28 14:08:53 +08:00
										 |  |  | use collab_database::rows::RowId;
 | 
					
						
							| 
									
										
										
										
											2024-02-22 07:12:52 +08:00
										 |  |  | use lib_infra::box_any::BoxAny;
 | 
					
						
							| 
									
										
										
										
											2023-04-28 14:08:53 +08:00
										 |  |  | 
 | 
					
						
							|  |  |  | pub struct DatabaseCellTest {
 | 
					
						
							|  |  |  |   inner: DatabaseEditorTest,
 | 
					
						
							|  |  |  | }
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | impl DatabaseCellTest {
 | 
					
						
							|  |  |  |   pub async fn new() -> Self {
 | 
					
						
							|  |  |  |     let inner = DatabaseEditorTest::new_grid().await;
 | 
					
						
							|  |  |  |     Self { inner }
 | 
					
						
							|  |  |  |   }
 | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2024-10-15 09:32:06 +08:00
										 |  |  |   pub async fn update_cell(
 | 
					
						
							|  |  |  |     &self,
 | 
					
						
							|  |  |  |     view_id: &str,
 | 
					
						
							|  |  |  |     field_id: &str,
 | 
					
						
							|  |  |  |     row_id: &RowId,
 | 
					
						
							|  |  |  |     changeset: BoxAny,
 | 
					
						
							|  |  |  |   ) {
 | 
					
						
							|  |  |  |     self
 | 
					
						
							|  |  |  |       .editor
 | 
					
						
							|  |  |  |       .update_cell_with_changeset(view_id, row_id, field_id, changeset)
 | 
					
						
							|  |  |  |       .await
 | 
					
						
							|  |  |  |       .unwrap();
 | 
					
						
							| 
									
										
										
										
											2023-04-28 14:08:53 +08:00
										 |  |  |   }
 | 
					
						
							|  |  |  | }
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | impl std::ops::Deref for DatabaseCellTest {
 | 
					
						
							|  |  |  |   type Target = DatabaseEditorTest;
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |   fn deref(&self) -> &Self::Target {
 | 
					
						
							|  |  |  |     &self.inner
 | 
					
						
							|  |  |  |   }
 | 
					
						
							|  |  |  | }
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | impl std::ops::DerefMut for DatabaseCellTest {
 | 
					
						
							|  |  |  |   fn deref_mut(&mut self) -> &mut Self::Target {
 | 
					
						
							|  |  |  |     &mut self.inner
 | 
					
						
							|  |  |  |   }
 | 
					
						
							|  |  |  | }
 |