TF-1961 Refactor html transformer
(cherry picked from commit 0272e45226ddb12827b7ef4820b00632758c353a)
This commit is contained in:
@@ -20,10 +20,15 @@ import 'package:tmail_ui_user/main/exceptions/exception_thrower.dart';
|
||||
|
||||
class IdentityDataSourceImpl extends IdentityDataSource {
|
||||
|
||||
final HtmlTransform _htmlTransform;
|
||||
final IdentityAPI _identityAPI;
|
||||
final ExceptionThrower _exceptionThrower;
|
||||
|
||||
IdentityDataSourceImpl(this._identityAPI, this._exceptionThrower);
|
||||
IdentityDataSourceImpl(
|
||||
this._htmlTransform,
|
||||
this._identityAPI,
|
||||
this._exceptionThrower
|
||||
);
|
||||
|
||||
@override
|
||||
Future<IdentitiesResponse> getAllIdentities(Session session, AccountId accountId, {Properties? properties}) {
|
||||
@@ -56,7 +61,8 @@ class IdentityDataSourceImpl extends IdentityDataSource {
|
||||
@override
|
||||
Future<String> transformHtmlSignature(String signature) {
|
||||
return Future.sync(() async {
|
||||
final signatureUnescape = await HtmlTransform(signature).transformToHtml(
|
||||
final signatureUnescape = await _htmlTransform.transformToHtml(
|
||||
contentHtml: signature,
|
||||
transformConfiguration: TransformConfiguration.create(customDomTransformers: [
|
||||
const RemoveScriptTransformer(),
|
||||
const BlockQuotedTransformer(),
|
||||
|
||||
+2
@@ -1,3 +1,4 @@
|
||||
import 'package:core/presentation/utils/html_transformer/html_transform.dart';
|
||||
import 'package:get/get.dart';
|
||||
import 'package:tmail_ui_user/features/base/interactors_bindings.dart';
|
||||
import 'package:tmail_ui_user/features/manage_account/data/datasource/identity_data_source.dart';
|
||||
@@ -35,6 +36,7 @@ class IdentityInteractorsBindings extends InteractorsBindings {
|
||||
@override
|
||||
void bindingsDataSourceImpl() {
|
||||
Get.lazyPut(() => IdentityDataSourceImpl(
|
||||
Get.find<HtmlTransform>(),
|
||||
Get.find<IdentityAPI>(),
|
||||
Get.find<RemoteExceptionThrower>()));
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user