TF-4178 Implement create new label
This commit is contained in:
@@ -0,0 +1 @@
|
||||
class InteractorNotInitialized implements Exception {}
|
||||
@@ -5556,13 +5556,6 @@ class AppLocalizations {
|
||||
);
|
||||
}
|
||||
|
||||
String get tagNameCannotContainSpecialCharacters {
|
||||
return Intl.message(
|
||||
'Tag name cannot contain special characters',
|
||||
name: 'tagNameCannotContainSpecialCharacters',
|
||||
);
|
||||
}
|
||||
|
||||
String get tagNameAlreadyExists {
|
||||
return Intl.message(
|
||||
'A tag with this name already exists. Please choose a different name.',
|
||||
@@ -5583,4 +5576,19 @@ class AppLocalizations {
|
||||
name: 'chooseAColourForThisLabel',
|
||||
);
|
||||
}
|
||||
|
||||
String createLabelSuccessfullyMessage(String labelName) {
|
||||
return Intl.message(
|
||||
'You successfully created $labelName label',
|
||||
name: 'createLabelSuccessfullyMessage',
|
||||
args: [labelName],
|
||||
);
|
||||
}
|
||||
|
||||
String get createNewLabelFailure {
|
||||
return Intl.message(
|
||||
'Create new label failure',
|
||||
name: 'createNewLabelFailure',
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -15,6 +15,7 @@ import 'package:flutter_svg/svg.dart';
|
||||
import 'package:jmap_dart_client/jmap/core/error/method/error_method_response.dart';
|
||||
import 'package:jmap_dart_client/jmap/core/error/method/exception/error_method_response_exception.dart';
|
||||
import 'package:jmap_dart_client/jmap/core/error/set_error.dart';
|
||||
import 'package:labels/extensions/label_extension.dart';
|
||||
import 'package:model/email/email_action_type.dart';
|
||||
import 'package:model/email/mark_star_action.dart';
|
||||
import 'package:model/mailbox/presentation_mailbox.dart';
|
||||
@@ -27,6 +28,7 @@ import 'package:tmail_ui_user/features/download/domain/state/parse_email_by_blob
|
||||
import 'package:tmail_ui_user/features/download/domain/state/preview_email_from_eml_file_state.dart';
|
||||
import 'package:tmail_ui_user/features/home/data/exceptions/session_exceptions.dart';
|
||||
import 'package:tmail_ui_user/features/home/domain/state/get_session_state.dart';
|
||||
import 'package:tmail_ui_user/features/labels/domain/state/create_new_label_state.dart';
|
||||
import 'package:tmail_ui_user/features/login/data/network/oidc_error.dart';
|
||||
import 'package:tmail_ui_user/features/login/domain/exceptions/authentication_exception.dart';
|
||||
import 'package:tmail_ui_user/features/login/domain/exceptions/oauth_authorization_error.dart';
|
||||
@@ -196,6 +198,9 @@ class ToastManager {
|
||||
} else if (failure is MoveFolderContentFailure) {
|
||||
message = message ??
|
||||
appLocalizations.moveFolderContentToastMessage;
|
||||
} else if (failure is CreateNewLabelFailure) {
|
||||
message = message ??
|
||||
appLocalizations.createNewLabelFailure;
|
||||
}
|
||||
log('ToastManager::showMessageFailure: Message: $message');
|
||||
if (message?.trim().isNotEmpty == true) {
|
||||
@@ -259,6 +264,10 @@ class ToastManager {
|
||||
message = success.markStarAction == MarkStarAction.markStar
|
||||
? appLocalizations.mailHasBeenStarred
|
||||
: appLocalizations.mailHasBeenUnstarred;
|
||||
} else if (success is CreateNewLabelSuccess) {
|
||||
message = appLocalizations.createLabelSuccessfullyMessage(
|
||||
success.newLabel.safeDisplayName,
|
||||
);
|
||||
}
|
||||
log('ToastManager::showMessageSuccess: Message: $message');
|
||||
if (message?.trim().isNotEmpty == true) {
|
||||
|
||||
Reference in New Issue
Block a user