From c457b6ea01a8bc26d84d0464a7030896c1ecb856 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pau=20Ferrer=20Oca=C3=B1a?= Date: Fri, 21 Dec 2018 16:38:33 +0100 Subject: [PATCH 1/3] MOBILE-2795 message: Expand option when selecting user from group info --- .../pages/group-conversations/group-conversations.ts | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/src/addon/messages/pages/group-conversations/group-conversations.ts b/src/addon/messages/pages/group-conversations/group-conversations.ts index 4ab86a489..86b78189a 100644 --- a/src/addon/messages/pages/group-conversations/group-conversations.ts +++ b/src/addon/messages/pages/group-conversations/group-conversations.ts @@ -266,7 +266,7 @@ export class AddonMessagesGroupConversationsPage implements OnInit, OnDestroy { const conversation = this.findConversation(this.conversationId); if (conversation) { const option = this.getConversationOption(conversation); - option.expanded = true; + this.expandOption(option); return; } @@ -336,11 +336,13 @@ export class AddonMessagesGroupConversationsPage implements OnInit, OnDestroy { return conversations.find((conv) => { return conv.id == conversationId; }); - } else if (this.individual.conversations) { - return this.individual.conversations.find((conv) => { - return conv.userid == userId; - }); } + + const conversations = (this.favourites.conversations || []).concat(this.individual.conversations || []); + + return conversations.find((conv) => { + return conv.userid == userId; + }); } /** From bd937fc0521c85eec2fece962dec61be4d7bd2d1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pau=20Ferrer=20Oca=C3=B1a?= Date: Fri, 21 Dec 2018 16:59:38 +0100 Subject: [PATCH 2/3] MOBILE-2795 ux: Fix adding on core-button-select --- src/addon/messages/pages/discussion/discussion.ts | 2 +- src/app/app.scss | 7 +++++-- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/src/addon/messages/pages/discussion/discussion.ts b/src/addon/messages/pages/discussion/discussion.ts index 03b442b54..8de0d7dd0 100644 --- a/src/addon/messages/pages/discussion/discussion.ts +++ b/src/addon/messages/pages/discussion/discussion.ts @@ -229,7 +229,7 @@ export class AddonMessagesDiscussionPage implements OnDestroy { this.conversationImage = member.profileimageurl; this.title = member.fullname; } - this.blockIcon = this.otherMember && this.otherMember.isblocked ? 'close-circle' : 'checkmark-circle'; + this.blockIcon = this.otherMember && this.otherMember.isblocked ? 'checkmark-circle' : 'close-circle'; this.addRemoveIcon = this.otherMember && this.otherMember.iscontact ? 'remove' : 'add'; })); } else { diff --git a/src/app/app.scss b/src/app/app.scss index 0e82d8f59..169ad18e3 100644 --- a/src/app/app.scss +++ b/src/app/app.scss @@ -900,10 +900,13 @@ body.keyboard-is-open { } } -.safe-padding-horizontal, +.safe-padding-horizontal{ + @include safe-area-padding-horizontal(0px, 0px); +} + [padding].safe-padding-horizontal, ion-app.ios [padding].safe-padding-horizontal { - @include safe-area-padding-horizontal(0px, 0px); + @include safe-area-padding-horizontal($content-padding, $content-padding); } ion-app.ios .split-pane-side, From 9749ac647fbd4fe577a6d85032386056cdb07644 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pau=20Ferrer=20Oca=C3=B1a?= Date: Fri, 21 Dec 2018 17:24:00 +0100 Subject: [PATCH 3/3] MOBILE-2795 ux: Add ago message in coreTimeAgo pipe --- scripts/langindex.json | 1 + src/assets/lang/en.json | 1 + src/lang/en.json | 1 + src/pipes/time-ago.ts | 5 +++-- 4 files changed, 6 insertions(+), 2 deletions(-) diff --git a/scripts/langindex.json b/scripts/langindex.json index 2e339fcb0..53803707e 100644 --- a/scripts/langindex.json +++ b/scripts/langindex.json @@ -1156,6 +1156,7 @@ "core.accounts": "admin", "core.add": "moodle", "core.agelocationverification": "moodle", + "core.ago": "message", "core.all": "moodle", "core.allparticipants": "moodle", "core.android": "local_moodlemobileapp", diff --git a/src/assets/lang/en.json b/src/assets/lang/en.json index 6c3410e73..7ec923ad5 100644 --- a/src/assets/lang/en.json +++ b/src/assets/lang/en.json @@ -1156,6 +1156,7 @@ "core.accounts": "Accounts", "core.add": "Add", "core.agelocationverification": "Age and location verification", + "core.ago": "{{$a}} ago", "core.all": "All", "core.allparticipants": "All participants", "core.android": "Android", diff --git a/src/lang/en.json b/src/lang/en.json index 317c08547..dc10e000f 100644 --- a/src/lang/en.json +++ b/src/lang/en.json @@ -2,6 +2,7 @@ "accounts": "Accounts", "add": "Add", "agelocationverification": "Age and location verification", + "ago": "{{$a}} ago", "all": "All", "allparticipants": "All participants", "android": "Android", diff --git a/src/pipes/time-ago.ts b/src/pipes/time-ago.ts index 07f8d3dd6..bef10d8f0 100644 --- a/src/pipes/time-ago.ts +++ b/src/pipes/time-ago.ts @@ -13,6 +13,7 @@ // limitations under the License. import { Pipe, PipeTransform } from '@angular/core'; +import { TranslateService } from '@ngx-translate/core'; import { CoreLoggerProvider } from '@providers/logger'; import * as moment from 'moment'; @@ -25,7 +26,7 @@ import * as moment from 'moment'; export class CoreTimeAgoPipe implements PipeTransform { protected logger; - constructor(logger: CoreLoggerProvider) { + constructor(logger: CoreLoggerProvider, private translate: TranslateService) { this.logger = logger.getInstance('CoreTimeAgoPipe'); } @@ -47,6 +48,6 @@ export class CoreTimeAgoPipe implements PipeTransform { timestamp = numberTimestamp; } - return moment(timestamp * 1000).fromNow(true); + return this.translate.instant('core.ago', {$a: moment(timestamp * 1000).fromNow(true)}); } }