Skip to content

TF-2948 Apply new identity view #3322

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

Open
wants to merge 23 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
23 commits
Select commit Hold shift + click to select a range
d339dd8
TF-3298 Fix blink when refresh email list (#3299)
dab246 Nov 25, 2024
e50a23d
Update TMail backend docker to memory-1.0.0
tddang-linagora Nov 27, 2024
1a58542
TF-3265 Fix double scrolling composer
tddang-linagora Nov 18, 2024
c475735
TF-3291 Fix [SEARCH] No results if you add > 1 address in the From field
dab246 Nov 22, 2024
2128a6e
TF-3264 Fix composer drag drop all modes (#3279)
tddang-linagora Nov 28, 2024
9c3954a
Delegate cache control from Flutter to browser (#3289)
tddang-linagora Nov 28, 2024
eaee8a0
TF-3292 Fix [SEARCH] If I filter emails by date and then sort them by…
dab246 Nov 23, 2024
e59fc1f
TF-3292 Write integration test for search emails by date and then sor…
dab246 Nov 27, 2024
c5b1e87
TF-3294 Fix BLUE-BAR mail to attendees duplicated recipients
dab246 Nov 22, 2024
6fff59a
TF-3295 Fix BLUE-BAR attendees mail addresses are not clickable
dab246 Nov 22, 2024
3a5f91b
TF-3296 Fix [SEARCH] Can't apply the "Starred" filter in search
dab246 Nov 22, 2024
9202925
fixup! TF-3296 Fix [SEARCH] Can't apply the "Starred" filter in search
dab246 Dec 2, 2024
fe2062d
TF-3315 Fix TMail web could not display embedded table correctly
dab246 Dec 3, 2024
ed0b14c
TF-3189 new option to enable/disable subaddressing for a personal folder
florentos17 Oct 21, 2024
810e304
TF-3189 new option to copy a folder's subaddress
florentos17 Nov 29, 2024
0f61e3d
TF-3189 subaddressing features only shown if supported by the server
florentos17 Nov 29, 2024
d939ffb
TF-3189 new confirmation popup when enabling subaddressing for a folder
florentos17 Nov 29, 2024
20c4720
TF-3189 new `reply to` field in the mail composer
florentos17 Oct 30, 2024
47b842d
TF-3189 composer now correctly encodes subaddresses
florentos17 Nov 15, 2024
2ae09ad
TF-2948 Apply new identity view for web
dab246 Dec 4, 2024
1654db1
TF-2948 Apply new identity view for mobile
dab246 Dec 4, 2024
4bc211c
TF-2948 Set identity as default
dab246 Dec 4, 2024
eaa8fd5
fixup! TF-2948 Set identity as default
dab246 Dec 5, 2024
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
3 changes: 3 additions & 0 deletions assets/images/ic_copy.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
6 changes: 2 additions & 4 deletions assets/images/ic_delete_rule.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
3 changes: 3 additions & 0 deletions assets/images/ic_subaddressing_allow.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
8 changes: 8 additions & 0 deletions assets/images/ic_subaddressing_disallow.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion backend-docker/docker-compose.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ version: "3"

services:
tmail-backend:
image: linagora/tmail-backend:memory-branch-master
image: linagora/tmail-backend:memory-1.0.0
container_name: tmail-backend
volumes:
- ./jwt_publickey:/root/conf/jwt_publickey
Expand Down
1 change: 1 addition & 0 deletions core/lib/presentation/extensions/color_extension.dart
Original file line number Diff line number Diff line change
Expand Up @@ -234,6 +234,7 @@ extension AppColor on Color {
static const colorStarredSearchFilterIcon = Color(0xFFFFCC00);
static const colorMobileSearchFilterButton = Color(0xFFEBEDF0);
static const colorContactViewClearFilterButton = Color(0x001C3D0D);
static const colorDisableRadioButton = Color(0xFF86888B);

static const mapGradientColor = [
[Color(0xFF21D4FD), Color(0xFFB721FF)],
Expand Down
3 changes: 3 additions & 0 deletions core/lib/presentation/resources/image_paths.dart
Original file line number Diff line number Diff line change
Expand Up @@ -221,6 +221,9 @@ class ImagePaths {
String get icBadSignature => _getImagePath('ic_bad_signature.svg');
String get icDeleteSelection => _getImagePath('ic_delete_selection.svg');
String get icLogoTwakeWelcome => _getImagePath('ic_logo_twake_welcome.svg');
String get icCopy => _getImagePath('ic_copy.svg');
String get icSubaddressingAllow => _getImagePath('ic_subaddressing_allow.svg');
String get icSubaddressingDisallow => _getImagePath('ic_subaddressing_disallow.svg');

String _getImagePath(String imageName) {
return AssetsPaths.images + imageName;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,9 @@ class StandardizeHtmlSanitizingTransformers extends TextTransformer {
'style',
'body',
'section',
'google-sheets-html-origin',
'colgroup',
'col',
];

const StandardizeHtmlSanitizingTransformers();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,16 @@ class TransformConfiguration {
const RemoveMaxWidthInImageStyleTransformer(),
]);

factory TransformConfiguration.forSignatureIdentity() => TransformConfiguration.create(
customDomTransformers: [
const RemoveScriptTransformer(),
const BlockQuotedTransformer(),
const BlockCodeTransformer(),
SanitizeHyperLinkTagInHtmlTransformer(useTooltip: PlatformInfo.isWeb),
const ImageTransformer(),
],
);

/// Provides easy access to a standard configuration that does not block external images.
static TransformConfiguration standardConfiguration = TransformConfiguration(
standardDomTransformers,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,11 @@ class ConfirmDialogBuilder {

Key? _key;
String _title = '';
String _content = '';
String _textContent = '';
String _confirmText = '';
String _cancelText = '';
Widget? _iconWidget;
Widget? _additionalWidgetContent;
Color? _colorCancelButton;
Color? _colorConfirmButton;
TextStyle? _styleTextCancelButton;
Expand Down Expand Up @@ -63,7 +64,11 @@ class ConfirmDialogBuilder {
}

void content(String content) {
_content = content;
_textContent = content;
}

void addWidgetContent(Widget? icon) {
_additionalWidgetContent = icon;
}

void addIcon(Widget? icon) {
Expand Down Expand Up @@ -210,11 +215,11 @@ class ConfirmDialogBuilder {
)
)
),
if (_content.isNotEmpty)
if (_textContent.isNotEmpty)
Padding(
padding: _paddingContent ?? const EdgeInsets.symmetric(horizontal: 16, vertical: 24),
child: Center(
child: Text(_content,
child: Text(_textContent,
textAlign: TextAlign.center,
style: _styleContent ?? const TextStyle(fontSize: 17.0, color: AppColor.colorMessageDialog)
),
Expand All @@ -233,6 +238,11 @@ class ConfirmDialogBuilder {
),
),
),
if (_additionalWidgetContent != null)
Padding(
padding: const EdgeInsets.symmetric(horizontal: 16),
child: _additionalWidgetContent,
),
if (isArrangeActionButtonsVertical)
...[
if (_cancelText.isNotEmpty)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,10 @@ class HtmlContentViewerOnWeb extends StatefulWidget {
final double widthContent;
final double heightContent;
final TextDirection? direction;
final double? minWidth;
final double? maxHeight;
final double? contentPadding;
final bool adjustHeight;

/// Handler for mailto: links
final Function(Uri?)? mailtoDelegate;
Expand All @@ -30,6 +34,10 @@ class HtmlContentViewerOnWeb extends StatefulWidget {
required this.widthContent,
required this.heightContent,
this.allowResizeToDocumentSize = true,
this.adjustHeight = false,
this.minWidth,
this.maxHeight,
this.contentPadding,
this.mailtoDelegate,
this.direction,
}) : super(key: key);
Expand All @@ -40,14 +48,16 @@ class HtmlContentViewerOnWeb extends StatefulWidget {

class _HtmlContentViewerOnWebState extends State<HtmlContentViewerOnWeb> {

static const double _minWidth = 300;
static const double _defaultMinWidth = 300;
/// The view ID for the IFrameElement. Must be unique.
late String _createdViewId;
/// The actual height of the content view, used to automatically set the height
late double _actualHeight;
/// The actual width of the content view, used to automatically set the width
late double _actualWidth;

late double _minWidth;

Future<bool>? _webInit;
String? _htmlData;
bool _isLoading = true;
Expand All @@ -61,6 +71,7 @@ class _HtmlContentViewerOnWebState extends State<HtmlContentViewerOnWeb> {
super.initState();
_actualHeight = widget.heightContent;
_actualWidth = widget.widthContent;
_minWidth = widget.minWidth ?? _defaultMinWidth;
_createdViewId = _getRandString(10);
_setUpWeb();

Expand All @@ -78,8 +89,9 @@ class _HtmlContentViewerOnWebState extends State<HtmlContentViewerOnWeb> {
if (data['type'] != null && data['type'].contains('toDart: htmlHeight')) {
final docHeight = data['height'] ?? _actualHeight;
if (docHeight != null && mounted) {
final scrollHeightWithBuffer = docHeight + 30.0;
if (scrollHeightWithBuffer > minHeight) {
final bottomPadding = widget.adjustHeight ? 0 : 30.0;
final scrollHeightWithBuffer = docHeight + bottomPadding;
if (scrollHeightWithBuffer > minHeight || widget.adjustHeight) {
setState(() {
_actualHeight = scrollHeightWithBuffer;
_isLoading = false;
Expand Down Expand Up @@ -214,11 +226,13 @@ class _HtmlContentViewerOnWebState extends State<HtmlContentViewerOnWeb> {

final htmlTemplate = HtmlUtils.generateHtmlDocument(
content: content,
minHeight: minHeight,
minHeight: widget.adjustHeight ? 0 : minHeight,
minWidth: _minWidth,
styleCSS: HtmlTemplate.tooltipLinkCss,
javaScripts: webViewActionScripts + scriptsDisableZoom + HtmlInteraction.scriptsHandleLazyLoadingBackgroundImage,
direction: widget.direction);
direction: widget.direction,
contentPadding: widget.contentPadding
);

return htmlTemplate;
}
Expand Down Expand Up @@ -246,47 +260,58 @@ class _HtmlContentViewerOnWebState extends State<HtmlContentViewerOnWeb> {

@override
Widget build(BuildContext context) {
return LayoutBuilder(builder: (context, constraint) {
minHeight = math.max(constraint.maxHeight, minHeight);
return Stack(
children: [
if (_htmlData?.isNotEmpty == false)
const SizedBox.shrink()
else
FutureBuilder<bool>(
future: _webInit,
builder: (context, snapshot) {
if (snapshot.hasData) {
return SizedBox(
height: _actualHeight,
width: _actualWidth,
child: HtmlElementView(
key: ValueKey(_htmlData),
viewType: _createdViewId,
),
);
} else {
return const SizedBox.shrink();
}
return Stack(
children: [
if (_htmlData?.isNotEmpty == false)
const SizedBox.shrink()
else
FutureBuilder<bool>(
future: _webInit,
builder: (context, snapshot) {
if (!snapshot.hasData) {
return const SizedBox.shrink();
}

if (widget.adjustHeight) {
return Container(
height: _actualHeight,
width: _actualWidth,
constraints: widget.maxHeight != null
? BoxConstraints(maxHeight: widget.maxHeight!)
: null,
child: HtmlElementView(
key: ValueKey(_htmlData),
viewType: _createdViewId,
),
);
}
),
if (_isLoading)
const Align(
alignment: Alignment.topCenter,
child: Padding(
padding: EdgeInsets.all(16),
child: SizedBox(
width: 30,
height: 30,
child: CupertinoActivityIndicator(
color: AppColor.colorLoading
)

return SizedBox(
height: _actualHeight,
width: _actualWidth,
child: HtmlElementView(
key: ValueKey(_htmlData),
viewType: _createdViewId,
),
);
}
),
if (_isLoading)
const Align(
alignment: Alignment.topCenter,
child: Padding(
padding: EdgeInsets.all(16),
child: SizedBox(
width: 30,
height: 30,
child: CupertinoActivityIndicator(
color: AppColor.colorLoading
)
)
)
],
);
});
)
],
);
}

@override
Expand Down
Loading
Loading