Skip to content

Commit

Permalink
Merge pull request #28860 from nextcloud/backport/28822/stable22
Browse files Browse the repository at this point in the history
[stable22] Add email addresses to contacts menu
  • Loading branch information
kesselb authored Sep 18, 2021
2 parents 81cd110 + 74ba526 commit 4ac4c0a
Show file tree
Hide file tree
Showing 7 changed files with 9 additions and 5 deletions.
2 changes: 1 addition & 1 deletion core/js/dist/login.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion core/js/dist/login.js.map

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion core/js/dist/main.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion core/js/dist/main.js.map

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions core/src/OC/contactsmenu/contact.handlebars
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
<div class="body">
<div class="full-name">{{contact.fullName}}</div>
<div class="last-message">{{contact.lastMessage}}</div>
<div class="email-address">{{contact.emailAddresses}}</div>
</div>
{{#if contact.topAction}}
<a class="top-action" href="{{contact.topAction.hyperlink}}" title="{{contact.topAction.title}}">
Expand Down
1 change: 1 addition & 0 deletions lib/private/Contacts/ContactsMenu/Entry.php
Original file line number Diff line number Diff line change
Expand Up @@ -165,6 +165,7 @@ public function jsonSerialize(): array {
'topAction' => $topAction,
'actions' => $otherActions,
'lastMessage' => '',
'emailAddresses' => $this->getEMailAddresses(),
];
}
}
4 changes: 3 additions & 1 deletion tests/lib/Contacts/ContactsMenu/EntryTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -96,16 +96,18 @@ public function testSetGetProperties() {

public function testJsonSerialize() {
$expectedJson = [
'id' => 123,
'id' => '123',
'fullName' => 'Guadalupe Frisbey',
'topAction' => null,
'actions' => [],
'lastMessage' => '',
'avatar' => null,
'emailAddresses' => ['user@example.com']
];

$this->entry->setId(123);
$this->entry->setFullName('Guadalupe Frisbey');
$this->entry->addEMailAddress('user@example.com');
$json = $this->entry->jsonSerialize();

$this->assertEquals($expectedJson, $json);
Expand Down

0 comments on commit 4ac4c0a

Please sign in to comment.