TF-3416 Implement preview EML attachment
This commit is contained in:
@@ -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';
|
||||
}
|
||||
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user