Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Hotfix] Temporarily hide Add condition in filter rule for release new version #2147

Merged
merged 1 commit into from
Sep 14, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -184,11 +184,11 @@ class RulesFilterCreatorController extends BaseMailboxController {
);
listRuleCondition.add(currentRule);
RulesFilterInputFieldArguments newRuleConditionValueArguments = RulesFilterInputFieldArguments(
focusNode: FocusNode(),
errorText: '',
controller: TextEditingController(),
);
listRuleConditionValueArguments.add(newRuleConditionValueArguments);
focusNode: FocusNode(),
errorText: '',
controller: TextEditingController(),
);
listRuleConditionValueArguments.add(newRuleConditionValueArguments);
emailRuleFilterActionSelected.value = EmailRuleFilterAction.moveMessage;
_setValueInputField(
listRuleConditionValueArguments[0].controller,
Expand Down Expand Up @@ -311,34 +311,40 @@ class RulesFilterCreatorController extends BaseMailboxController {
}
}

void createNewRuleFilter(BuildContext context) async {
void createNewRuleFilter(BuildContext context) {
KeyboardUtils.hideKeyboard(context);

final errorName = _getErrorStringByInputValue(context, _newRuleName);
log('RulesFilterCreatorController::createNewRuleFilter:errorName: $errorName');
if (errorName?.isNotEmpty == true) {
errorRuleName.value = errorName;
inputRuleNameFocusNode.requestFocus();
return;
}

if (listRuleCondition.isNotEmpty) {
String? errorConditionString;
for (var ruleCondition in listRuleCondition) {
String? errorString = _getErrorStringByInputValue(context, ruleCondition.value);
if (errorString != null) {
errorConditionString = _getErrorStringByInputValue(context, ruleCondition.value);
log('RulesFilterCreatorController::createNewRuleFilter:errorConditionString: $errorConditionString');
if (errorConditionString != null) {
int ruleConditionIndex = listRuleCondition.indexOf(ruleCondition);
RulesFilterInputFieldArguments newRuleConditionValueArguments = RulesFilterInputFieldArguments(
focusNode: listRuleConditionValueArguments[ruleConditionIndex].focusNode,
errorText: errorString,
errorText: errorConditionString,
controller: listRuleConditionValueArguments[ruleConditionIndex].controller,
);
listRuleConditionValueArguments[ruleConditionIndex] = newRuleConditionValueArguments;
listRuleConditionValueArguments[listRuleCondition.indexOf(ruleCondition)].focusNode.requestFocus();
}
}
return;
if (errorConditionString?.isNotEmpty == true) {
return;
}
}

final errorAction = _getErrorStringByInputValue(context, mailboxSelected.value?.getDisplayName(context));
log('RulesFilterCreatorController::createNewRuleFilter:errorAction: $errorAction');
if (errorAction?.isNotEmpty == true) {
errorRuleActionValue.value = errorAction;
if (currentOverlayContext != null && currentContext != null) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -147,31 +147,31 @@ class RuleFilterCreatorView extends GetWidget<RulesFilterCreatorController> {
color: Colors.black)),
const SizedBox(height: 24),
_buildListRuleFilterConditionList(context, RuleFilterConditionScreenType.desktop),
Container(
padding: const EdgeInsets.only(top: 8),
child: InkWell(
onTap: controller.tapAddCondition,
child: Row(
crossAxisAlignment: CrossAxisAlignment.center,
children: [
SvgPicture.asset(
_imagePaths.icAddNewFolder,
fit: BoxFit.fill,
),
const SizedBox(width: 15,),
Text(
AppLocalizations.of(context).addCondition,
maxLines: 1,
style: const TextStyle(
fontWeight: FontWeight.w500,
fontSize: 17,
color: AppColor.primaryColor
)
)
],
),
),
),
// Container(
// padding: const EdgeInsets.only(top: 8),
// child: InkWell(
// onTap: controller.tapAddCondition,
// child: Row(
// crossAxisAlignment: CrossAxisAlignment.center,
// children: [
// SvgPicture.asset(
// _imagePaths.icAddNewFolder,
// fit: BoxFit.fill,
// ),
// const SizedBox(width: 15,),
// Text(
// AppLocalizations.of(context).addCondition,
// maxLines: 1,
// style: const TextStyle(
// fontWeight: FontWeight.w500,
// fontSize: 17,
// color: AppColor.primaryColor
// )
// )
// ],
// ),
// ),
// ),
const SizedBox(height: 24),
Text(AppLocalizations.of(context).actionTitleRulesFilter,
overflow: CommonTextStyle.defaultTextOverFlow,
Expand Down Expand Up @@ -298,31 +298,31 @@ class RuleFilterCreatorView extends GetWidget<RulesFilterCreatorController> {
color: Colors.black)),
const SizedBox(height: 24),
_buildListRuleFilterConditionList(context, RuleFilterConditionScreenType.tablet),
Container(
padding: const EdgeInsets.only(top: 8),
child: InkWell(
onTap: controller.tapAddCondition,
child: Row(
crossAxisAlignment: CrossAxisAlignment.center,
children: [
SvgPicture.asset(
_imagePaths.icAddNewFolder,
fit: BoxFit.fill,
),
const SizedBox(width: 15,),
Text(
AppLocalizations.of(context).addCondition,
maxLines: 1,
style: const TextStyle(
fontWeight: FontWeight.w500,
fontSize: 17,
color: AppColor.primaryColor
)
)
],
),
),
),
// Container(
// padding: const EdgeInsets.only(top: 8),
// child: InkWell(
// onTap: controller.tapAddCondition,
// child: Row(
// crossAxisAlignment: CrossAxisAlignment.center,
// children: [
// SvgPicture.asset(
// _imagePaths.icAddNewFolder,
// fit: BoxFit.fill,
// ),
// const SizedBox(width: 15,),
// Text(
// AppLocalizations.of(context).addCondition,
// maxLines: 1,
// style: const TextStyle(
// fontWeight: FontWeight.w500,
// fontSize: 17,
// color: AppColor.primaryColor
// )
// )
// ],
// ),
// ),
// ),
const SizedBox(height: 24),
Text(AppLocalizations.of(context).actionTitleRulesFilter,
overflow: CommonTextStyle.defaultTextOverFlow,
Expand Down Expand Up @@ -455,32 +455,32 @@ class RuleFilterCreatorView extends GetWidget<RulesFilterCreatorController> {
color: Colors.black)),
const SizedBox(height: 24),
_buildListRuleFilterConditionList(context, RuleFilterConditionScreenType.mobile),
Container(
padding: const EdgeInsets.only(top: 12),
child: InkWell(
onTap: controller.tapAddCondition,
child: Row(
crossAxisAlignment: CrossAxisAlignment.center,
mainAxisAlignment: MainAxisAlignment.center,
children: [
SvgPicture.asset(
_imagePaths.icAddNewFolder,
fit: BoxFit.fill,
),
const SizedBox(width: 15,),
Text(
AppLocalizations.of(context).addCondition,
maxLines: 1,
style: const TextStyle(
fontWeight: FontWeight.w500,
fontSize: 17,
color: AppColor.primaryColor
)
)
],
),
),
),
// Container(
// padding: const EdgeInsets.only(top: 12),
// child: InkWell(
// onTap: controller.tapAddCondition,
// child: Row(
// crossAxisAlignment: CrossAxisAlignment.center,
// mainAxisAlignment: MainAxisAlignment.center,
// children: [
// SvgPicture.asset(
// _imagePaths.icAddNewFolder,
// fit: BoxFit.fill,
// ),
// const SizedBox(width: 15,),
// Text(
// AppLocalizations.of(context).addCondition,
// maxLines: 1,
// style: const TextStyle(
// fontWeight: FontWeight.w500,
// fontSize: 17,
// color: AppColor.primaryColor
// )
// )
// ],
// ),
// ),
// ),
const Padding(
padding: EdgeInsets.symmetric(vertical: 12),
child: Divider(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ import 'package:rule_filter/rule_filter/rule_condition.dart' as rule_condition;
import 'package:tmail_ui_user/features/base/widget/drop_down_button_widget.dart';
import 'package:tmail_ui_user/features/rules_filter_creator/presentation/model/rule_filter_condition_type.dart';
import 'package:tmail_ui_user/features/rules_filter_creator/presentation/widgets/rule_filter_button_field.dart';
import 'package:tmail_ui_user/features/rules_filter_creator/presentation/widgets/rule_filter_condition_remove_button_builder.dart';
import 'package:tmail_ui_user/features/rules_filter_creator/presentation/widgets/rules_filter_input_field_builder.dart';
import 'package:tmail_ui_user/main/localizations/app_localizations.dart';

Expand Down Expand Up @@ -106,14 +105,14 @@ class RuleFilterConditionRow extends StatelessWidget {
editingController: conditionValueEditingController,
)
),
Container(
padding: const EdgeInsets.only(left: 12),
alignment: Alignment.center,
child: RuleFilterConditionRemoveButton(
tapRemoveRuleFilterConditionCallback: tapRemoveRuleFilterConditionCallback,
imagePath: imagePaths,
)
),
// Container(
// padding: const EdgeInsets.only(left: 12),
// alignment: Alignment.center,
// child: RuleFilterConditionRemoveButton(
// tapRemoveRuleFilterConditionCallback: tapRemoveRuleFilterConditionCallback,
// imagePath: imagePaths,
// )
// ),
],
);
default:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,9 +37,10 @@ class RuleFilterConditionWidget extends StatelessWidget {
@override
Widget build(BuildContext context) {
return Slidable(
enabled: ruleFilterConditionScreenType == RuleFilterConditionScreenType.mobile ? true : false,
// enabled: ruleFilterConditionScreenType == RuleFilterConditionScreenType.mobile ? true : false,
enabled: false,
endActionPane: ActionPane(
extentRatio: 0.1,
extentRatio: 0.1,
motion: const BehindMotion(),
children: [
CustomSlidableAction(
Expand Down
Loading