You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
PURPOSE
Displaying the subject when the name of the record is exactly the same is
redundant and crowds the interface needlessly
SPECIFICATION
Subject should only be displayed if it is different than the name of the
record
LINKS
closesodoo#61044
Taskid: 2363130
Pr: odoo#61044
Signed-off-by: Sébastien Theys (seb) <seb@odoo.com>
Copy file name to clipboardExpand all lines: addons/mail/static/src/components/discuss/tests/discuss_inbox_tests.js
+168Lines changed: 168 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -550,6 +550,174 @@ QUnit.test('click on (non-channel/non-partner) origin thread link should redirec
550
550
assert.verifySteps(['do-action'],"should have made an action on click on origin thread (to open form view)");
551
551
});
552
552
553
+
QUnit.test('subject should not be shown when subject is the same as the thread name',asyncfunction(assert){
554
+
assert.expect(1);
555
+
556
+
this.data['mail.message'].records.push({
557
+
body: "not empty",
558
+
channel_ids: [100],
559
+
model: 'mail.channel',
560
+
res_id: 100,
561
+
needaction: true,
562
+
subject: "Salutations, voyageur",
563
+
});
564
+
this.data['mail.channel'].records.push({
565
+
id: 100,
566
+
name: "Salutations, voyageur",
567
+
});
568
+
awaitthis.start();
569
+
570
+
assert.containsNone(
571
+
document.body,
572
+
'.o_Message_subject',
573
+
"subject should not be shown when subject is the same as the thread name"
574
+
);
575
+
});
576
+
577
+
QUnit.test('subject should not be shown when subject is the same as the thread name and both have the same prefix',asyncfunction(assert){
578
+
assert.expect(1);
579
+
580
+
this.data['mail.message'].records.push({
581
+
body: "not empty",
582
+
channel_ids: [100],
583
+
model: 'mail.channel',
584
+
res_id: 100,
585
+
needaction: true,
586
+
subject: "Re: Salutations, voyageur",
587
+
});
588
+
this.data['mail.channel'].records.push({
589
+
id: 100,
590
+
name: "Re: Salutations, voyageur",
591
+
});
592
+
awaitthis.start();
593
+
594
+
assert.containsNone(
595
+
document.body,
596
+
'.o_Message_subject',
597
+
"subject should not be shown when subject is the same as the thread name and both have the same prefix"
598
+
);
599
+
});
600
+
601
+
QUnit.test('subject should not be shown when subject differs from thread name only by the "Re:" prefix',asyncfunction(assert){
602
+
assert.expect(1);
603
+
604
+
this.data['mail.message'].records.push({
605
+
body: "not empty",
606
+
channel_ids: [100],
607
+
model: 'mail.channel',
608
+
res_id: 100,
609
+
needaction: true,
610
+
subject: "Re: Salutations, voyageur",
611
+
});
612
+
this.data['mail.channel'].records.push({
613
+
id: 100,
614
+
name: "Salutations, voyageur",
615
+
});
616
+
awaitthis.start();
617
+
618
+
assert.containsNone(
619
+
document.body,
620
+
'.o_Message_subject',
621
+
"should not display subject when subject differs from thread name only by the 'Re:' prefix"
622
+
);
623
+
});
624
+
625
+
QUnit.test('subject should not be shown when subject differs from thread name only by the "Fw:" and "Re:" prefix',asyncfunction(assert){
626
+
assert.expect(1);
627
+
628
+
this.data['mail.message'].records.push({
629
+
body: "not empty",
630
+
channel_ids: [100],
631
+
model: 'mail.channel',
632
+
res_id: 100,
633
+
needaction: true,
634
+
subject: "Fw: Re: Salutations, voyageur",
635
+
});
636
+
this.data['mail.channel'].records.push({
637
+
id: 100,
638
+
name: "Salutations, voyageur",
639
+
});
640
+
awaitthis.start();
641
+
642
+
assert.containsNone(
643
+
document.body,
644
+
'.o_Message_subject',
645
+
"should not display subject when subject differs from thread name only by the 'Fw:' and Re:' prefix"
646
+
);
647
+
});
648
+
649
+
QUnit.test('subject should be shown when the thread name has an extra prefix compared to subject',asyncfunction(assert){
650
+
assert.expect(1);
651
+
652
+
this.data['mail.message'].records.push({
653
+
body: "not empty",
654
+
channel_ids: [100],
655
+
model: 'mail.channel',
656
+
res_id: 100,
657
+
needaction: true,
658
+
subject: "Salutations, voyageur",
659
+
});
660
+
this.data['mail.channel'].records.push({
661
+
id: 100,
662
+
name: "Re: Salutations, voyageur",
663
+
});
664
+
awaitthis.start();
665
+
666
+
assert.containsOnce(
667
+
document.body,
668
+
'.o_Message_subject',
669
+
"subject should be shown when the thread name has an extra prefix compared to subject"
670
+
);
671
+
});
672
+
673
+
QUnit.test('subject should not be shown when subject differs from thread name only by the "fw:" prefix and both contain another common prefix',asyncfunction(assert){
674
+
assert.expect(1);
675
+
676
+
this.data['mail.message'].records.push({
677
+
body: "not empty",
678
+
channel_ids: [100],
679
+
model: 'mail.channel',
680
+
res_id: 100,
681
+
needaction: true,
682
+
subject: "fw: re: Salutations, voyageur",
683
+
});
684
+
this.data['mail.channel'].records.push({
685
+
id: 100,
686
+
name: "Re: Salutations, voyageur",
687
+
});
688
+
awaitthis.start();
689
+
690
+
assert.containsNone(
691
+
document.body,
692
+
'.o_Message_subject',
693
+
"subject should not be shown when subject differs from thread name only by the 'fw:' prefix and both contain another common prefix"
694
+
);
695
+
});
696
+
697
+
QUnit.test('subject should not be shown when subject differs from thread name only by the "Re: Re:" prefix',asyncfunction(assert){
698
+
assert.expect(1);
699
+
700
+
this.data['mail.message'].records.push({
701
+
body: "not empty",
702
+
channel_ids: [100],
703
+
model: 'mail.channel',
704
+
res_id: 100,
705
+
needaction: true,
706
+
subject: "Re: Re: Salutations, voyageur",
707
+
});
708
+
this.data['mail.channel'].records.push({
709
+
id: 100,
710
+
name: "Salutations, voyageur",
711
+
});
712
+
awaitthis.start();
713
+
714
+
assert.containsNone(
715
+
document.body,
716
+
'.o_Message_subject',
717
+
"should not display subject when subject differs from thread name only by the 'Re: Re:'' prefix"
Copy file name to clipboardExpand all lines: addons/mail/static/src/components/message/message.xml
+1-1Lines changed: 1 addition & 1 deletion
Original file line number
Diff line number
Diff line change
@@ -177,7 +177,7 @@
177
177
</ul>
178
178
</t>
179
179
</div>
180
-
<tt-if="message.subject and threadView and threadView.thread and (threadView.thread.mass_mailing or [env.messaging.inbox, env.messaging.history].includes(threadView.thread))">
180
+
<tt-if="message.subject and !message.isSubjectSimilarToOriginThreadName and threadView and threadView.thread and (threadView.thread.mass_mailing or [env.messaging.inbox, env.messaging.history].includes(threadView.thread))">
0 commit comments