TF-3416 Implement preview EML attachment

This commit is contained in:
dab246
2025-01-13 10:02:50 +07:00
committed by Dat H. Pham
parent 7cbdfddb6d
commit d304083b2e
54 changed files with 1489 additions and 148 deletions
+1
View File
@@ -16,4 +16,5 @@ abstract class AppRoutes {
static const searchMailbox = '/search_mailbox';
static const mailtoURL = '/mailto';
static const emailRecovery = '/email_recovery';
static const emailEMLPreviewer = '/mail/eml/preview';
}
+17 -1
View File
@@ -83,12 +83,22 @@ abstract class RouteUtils {
return servicePath;
}
static ServicePath _createEmailEMLPreviewerServicePath(String route, {String? previewId}) {
ServicePath servicePath = ServicePath(route);
if (previewId?.trim().isNotEmpty == true) {
servicePath = servicePath.withQueryParameters([
StringQueryParameter(paramID, previewId!)
]);
}
return servicePath;
}
static ServicePath _createServicePath(String route) {
ServicePath servicePath = ServicePath(route);
return servicePath;
}
static Uri createUrlWebLocationBar(String route, {NavigationRouter? router}) {
static Uri createUrlWebLocationBar(String route, {NavigationRouter? router, String? previewId}) {
if (route == AppRoutes.dashboard) {
final servicePath = _createDashboardServicePath(
'$baseOriginUrl$route',
@@ -98,6 +108,12 @@ abstract class RouteUtils {
} else if (route == AppRoutes.settings) {
final servicePath = _createSettingServicePath('$baseOriginUrl$route', router: router);
return Uri.parse(servicePath.path);
} else if (route == AppRoutes.emailEMLPreviewer) {
final servicePath = _createEmailEMLPreviewerServicePath(
'$baseOriginUrl$route',
previewId: previewId,
);
return Uri.parse(servicePath.path);
} else {
final servicePath = _createServicePath('$baseOriginUrl$route');
return Uri.parse(servicePath.path);