From 7cdb06c69f510bf4d6274f136d9ab35a9025d2bd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pau=20Ferrer=20Oca=C3=B1a?= Date: Wed, 10 Jun 2020 10:27:20 +0200 Subject: [PATCH 1/3] MOBILE-3401 login: Fix site logo show on fixed sites --- src/core/login/login.scss | 9 +++------ src/core/login/pages/credentials/credentials.html | 2 +- src/core/login/pages/reconnect/reconnect.html | 2 +- src/core/login/pages/reconnect/reconnect.ts | 2 +- src/core/login/pages/site/site.scss | 3 ++- 5 files changed, 8 insertions(+), 10 deletions(-) diff --git a/src/core/login/login.scss b/src/core/login/login.scss index 2ea9290ef..ea34c1161 100644 --- a/src/core/login/login.scss +++ b/src/core/login/login.scss @@ -93,11 +93,8 @@ ion-app.app-root page-core-login-site { } .core-login-site-logo { - margin-top: 5px; - margin-bottom: 5px; - img { - width: 90%; - max-width: 300px; - } + width: 90%; + max-width: 300px; + margin: 5px auto; } } diff --git a/src/core/login/pages/credentials/credentials.html b/src/core/login/pages/credentials/credentials.html index 3bcde32fa..eb2eab7ed 100644 --- a/src/core/login/pages/credentials/credentials.html +++ b/src/core/login/pages/credentials/credentials.html @@ -14,7 +14,7 @@
diff --git a/src/core/login/pages/reconnect/reconnect.html b/src/core/login/pages/reconnect/reconnect.html index 986354d87..afd1a75da 100644 --- a/src/core/login/pages/reconnect/reconnect.html +++ b/src/core/login/pages/reconnect/reconnect.html @@ -14,7 +14,7 @@ diff --git a/src/core/login/pages/reconnect/reconnect.ts b/src/core/login/pages/reconnect/reconnect.ts index f36a21975..ca2789441 100644 --- a/src/core/login/pages/reconnect/reconnect.ts +++ b/src/core/login/pages/reconnect/reconnect.ts @@ -105,8 +105,8 @@ export class CoreLoginReconnectPage { // Check logoURL if user avatar is not set. if (this.site.avatar.startsWith(site.infos.siteurl + '/theme/image.php')) { this.showSiteAvatar = false; - this.logoUrl = this.loginHelper.getLogoUrl(config); } + this.logoUrl = this.loginHelper.getLogoUrl(config); this.getDataFromConfig(this.siteConfig); }).catch(() => { diff --git a/src/core/login/pages/site/site.scss b/src/core/login/pages/site/site.scss index 4ea5a43fe..2cf512a3a 100644 --- a/src/core/login/pages/site/site.scss +++ b/src/core/login/pages/site/site.scss @@ -54,7 +54,8 @@ ion-app.app-root page-core-login-site { &.hidden { opacity: 0; visibility: hidden; - margin: 0; + margin-top: 0; + margin-bottom: 0; padding: 0; max-height: 0; } From 0db91392a439fa1ea496d0f9f8757186ddce55b6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pau=20Ferrer=20Oca=C3=B1a?= Date: Thu, 11 Jun 2020 14:13:25 +0200 Subject: [PATCH 2/3] MOBILE-3401 travis: Fail with lint --- scripts/mirror.sh | 3 +++ 1 file changed, 3 insertions(+) diff --git a/scripts/mirror.sh b/scripts/mirror.sh index 42a2ad88b..5ff8468c8 100755 --- a/scripts/mirror.sh +++ b/scripts/mirror.sh @@ -2,6 +2,9 @@ source "scripts/functions.sh" npm run build --bailOnLintError true --typeCheckOnLint true +if [ $? -ne 0 ]; then + exit 1 +fi if [ -z $GIT_ORG_PRIVATE ] || [ -z $GIT_TOKEN ]; then print_error "Env vars not correctly defined" From b8cc0e4f572bae1b22b5a5796fc64589aae948ff Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pau=20Ferrer=20Oca=C3=B1a?= Date: Thu, 11 Jun 2020 15:07:10 +0200 Subject: [PATCH 3/3] MOBILE-3401 ws: Add platform ready to override user agent --- src/providers/ws.ts | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/src/providers/ws.ts b/src/providers/ws.ts index 4e37fdd89..6220a9de5 100644 --- a/src/providers/ws.ts +++ b/src/providers/ws.ts @@ -13,6 +13,7 @@ // limitations under the License. import { Injectable } from '@angular/core'; +import { Platform } from 'ionic-angular'; import { HttpClient, HttpResponse } from '@angular/common/http'; import { TranslateService } from '@ngx-translate/core'; import { FileTransfer, FileUploadOptions } from '@ionic-native/file-transfer'; @@ -156,12 +157,15 @@ export class CoreWSProvider { protected fileProvider: CoreFileProvider, protected fileTransfer: FileTransfer, protected mimeUtils: CoreMimetypeUtilsProvider, - logger: CoreLoggerProvider) { + logger: CoreLoggerProvider, + platform: Platform) { this.logger = logger.getInstance('CoreWSProvider'); - if (this.appProvider.isMobile()) { - ( cordova).plugin.http.setHeader('User-Agent', navigator.userAgent); - } + platform.ready().then(() => { + if (this.appProvider.isMobile()) { + ( cordova).plugin.http.setHeader('User-Agent', navigator.userAgent); + } + }); } /**