Skip to content

Commit

Permalink
chore: use standard dialog componet
Browse files Browse the repository at this point in the history
  • Loading branch information
richardshiue committed Sep 4, 2024
1 parent bd7185a commit 199bcf5
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 18 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -86,9 +86,9 @@ class _FieldEditorState extends State<FieldEditor> {
builder: (context, isNull) {
return isNull
? const SizedBox.shrink()
: _currentPage == FieldEditorPage.details
? _fieldDetails()
: _fieldGeneral();
: _currentPage == FieldEditorPage.general
? _fieldGeneral()
: _fieldDetails();
},
),
);
Expand Down Expand Up @@ -336,32 +336,33 @@ enum FieldAction {
);
break;
case FieldAction.clearData:
NavigatorAlertDialog(
constraints: const BoxConstraints(
maxWidth: 250,
maxHeight: 260,
),
title: LocaleKeys.grid_field_clearFieldPromptMessage.tr(),
confirm: () {
PopoverContainer.of(context).closeAll();
showCancelAndConfirmDialog(
context: context,
title: LocaleKeys.grid_field_label.tr(),
description: LocaleKeys.grid_field_clearFieldPromptMessage.tr(),
confirmLabel: LocaleKeys.button_confirm.tr(),
onConfirm: () {
FieldBackendService.clearField(
viewId: viewId,
fieldId: fieldInfo.id,
);
},
).show(context);
PopoverContainer.of(context).close();
);
break;
case FieldAction.delete:
NavigatorAlertDialog(
title: LocaleKeys.grid_field_deleteFieldPromptMessage.tr(),
confirm: () {
PopoverContainer.of(context).closeAll();
showConfirmDeletionDialog(
context: context,
name: LocaleKeys.grid_field_label.tr(),
description: LocaleKeys.grid_field_deleteFieldPromptMessage.tr(),
onConfirm: () {
FieldBackendService.deleteField(
viewId: viewId,
fieldId: fieldInfo.id,
);
},
).show(context);
PopoverContainer.of(context).closeAll();
);
break;
case FieldAction.wrap:
context
Expand Down
3 changes: 2 additions & 1 deletion frontend/resources/translations/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -1294,6 +1294,7 @@
"isNotEmpty": "Is not empty"
},
"field": {
"label": "Property",
"hide": "Hide",
"show": "Show",
"insertLeft": "Insert Left",
Expand Down Expand Up @@ -1346,7 +1347,7 @@
"editProperty": "Edit property",
"newProperty": "New property",
"openRowDocument": "Open as a page",
"deleteFieldPromptMessage": "Are you sure? This property will be deleted",
"deleteFieldPromptMessage": "Are you sure? This property and all its data will be deleted",
"clearFieldPromptMessage": "Are you sure? All cells in this column will be emptied",
"newColumn": "New Column",
"format": "Format",
Expand Down

0 comments on commit 199bcf5

Please sign in to comment.