mirror of
https://github.com/AppFlowy-IO/AppFlowy.git
synced 2024-08-30 18:12:39 +00:00
test: add databaase event test (#2728)
* test: add tests and fix modify primary field bug * test: add more test * fix: tauri buiuld * chore: disable share link button
This commit is contained in:
@ -16,8 +16,10 @@ class TextCellDataPersistence implements CellDataPersistence<String> {
|
||||
|
||||
@override
|
||||
Future<Option<FlowyError>> save(String data) async {
|
||||
final fut =
|
||||
_cellBackendSvc.updateCell(cellContext: cellContext, data: data);
|
||||
final fut = _cellBackendSvc.updateCell(
|
||||
cellContext: cellContext,
|
||||
data: data,
|
||||
);
|
||||
return fut.then((result) {
|
||||
return result.fold(
|
||||
(l) => none(),
|
||||
|
@ -29,7 +29,6 @@ class FieldBackendService {
|
||||
|
||||
Future<Either<Unit, FlowyError>> updateField({
|
||||
String? name,
|
||||
FieldType? fieldType,
|
||||
bool? frozen,
|
||||
bool? visibility,
|
||||
double? width,
|
||||
@ -42,10 +41,6 @@ class FieldBackendService {
|
||||
payload.name = name;
|
||||
}
|
||||
|
||||
if (fieldType != null) {
|
||||
payload.fieldType = fieldType;
|
||||
}
|
||||
|
||||
if (frozen != null) {
|
||||
payload.frozen = frozen;
|
||||
}
|
||||
|
@ -124,13 +124,29 @@ class _FieldOperationList extends StatelessWidget {
|
||||
}
|
||||
|
||||
Widget _actionCell(FieldAction action) {
|
||||
bool enable = true;
|
||||
|
||||
// If the field is primary, delete and duplicate are disabled.
|
||||
if (fieldInfo.field.isPrimary) {
|
||||
switch (action) {
|
||||
case FieldAction.hide:
|
||||
break;
|
||||
case FieldAction.duplicate:
|
||||
enable = false;
|
||||
break;
|
||||
case FieldAction.delete:
|
||||
enable = false;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
return Flexible(
|
||||
child: SizedBox(
|
||||
height: GridSize.popoverItemHeight,
|
||||
child: FieldActionCell(
|
||||
fieldInfo: fieldInfo,
|
||||
action: action,
|
||||
enable: action != FieldAction.delete || !fieldInfo.field.isPrimary,
|
||||
enable: enable,
|
||||
),
|
||||
),
|
||||
);
|
||||
|
@ -72,5 +72,6 @@ class CheckboxCardCellState with _$CheckboxCardCellState {
|
||||
}
|
||||
|
||||
bool _isSelected(String? cellData) {
|
||||
// The backend use "Yes" and "No" to represent the checkbox cell data.
|
||||
return cellData == "Yes";
|
||||
}
|
||||
|
Reference in New Issue
Block a user