diff --git a/src/addon/messages/pages/discussion/discussion.scss b/src/addon/messages/pages/discussion/discussion.scss index 240d98af0..4b323f98f 100644 --- a/src/addon/messages/pages/discussion/discussion.scss +++ b/src/addon/messages/pages/discussion/discussion.scss @@ -204,6 +204,8 @@ $core-discussion-messages-badge-text: $white !default; ion-fab button { overflow: visible; position: relative; + box-shadow: $fab-md-box-shadow; + .core-discussion-messages-badge { position: absolute; border-radius: 50%; diff --git a/src/core/login/pages/site-onboarding/site-onboarding.html b/src/core/login/pages/site-onboarding/site-onboarding.html index df63a68bd..4f0b51b2f 100644 --- a/src/core/login/pages/site-onboarding/site-onboarding.html +++ b/src/core/login/pages/site-onboarding/site-onboarding.html @@ -6,7 +6,7 @@ - + {{'core.skip' | translate}} diff --git a/src/core/login/pages/site/site.html b/src/core/login/pages/site/site.html index feaa73b99..9e7291312 100644 --- a/src/core/login/pages/site/site.html +++ b/src/core/login/pages/site/site.html @@ -11,7 +11,7 @@ - + @@ -23,19 +23,28 @@ - - - {{ 'core.login.selectsite' | translate }} - + + {{ 'core.login.selectsite' | translate }} + - - - + - {{site.name}} ({{site.alias}}) - {{site.noProtocolUrl}} - {{site.city}} - {{site.country}} + {{enteredSiteUrl.name}} + {{enteredSiteUrl.noProtocolUrl}} + + + + + + + + + {{site.name}} ({{site.alias}}) + {{site.noProtocolUrl}} + {{site.city}} - {{site.country}} + + @@ -48,7 +57,7 @@ - + {{ 'core.login.or' | translate }} diff --git a/src/core/login/pages/site/site.scss b/src/core/login/pages/site/site.scss index 85bc01d69..4ea5a43fe 100644 --- a/src/core/login/pages/site/site.scss +++ b/src/core/login/pages/site/site.scss @@ -43,7 +43,8 @@ ion-app.app-root page-core-login-site { } .core-login-site-logo, - .core-login-site-list { + .core-login-site-list, + .core-login-site-list-found { transition-delay: 0s; visibility: visible; opacity: 1; @@ -59,7 +60,7 @@ ion-app.app-root page-core-login-site { } } - .core-login-site-list.dimmed { + .core-login-site-list-found.dimmed { pointer-events: none; position: relative; } diff --git a/src/core/login/pages/site/site.ts b/src/core/login/pages/site/site.ts index 4585bfbb8..b0ba96541 100644 --- a/src/core/login/pages/site/site.ts +++ b/src/core/login/pages/site/site.ts @@ -34,7 +34,6 @@ import { TranslateService } from '@ngx-translate/core'; * Extended data for UI implementation. */ type CoreLoginSiteInfoExtended = CoreLoginSiteInfo & { - fromWS?: boolean; // If the site came from the WS call. noProtocolUrl?: string; // Url wihtout protocol. country?: string; // Based on countrycode. }; @@ -60,9 +59,9 @@ export class CoreLoginSitePage { sites: CoreLoginSiteInfoExtended[] = []; hasSites = false; loadingSites = false; - onlyWrittenSite = false; searchFnc: Function; showScanQR: boolean; + enteredSiteUrl: CoreLoginSiteInfoExtended; constructor(navParams: NavParams, protected navCtrl: NavController, @@ -108,33 +107,19 @@ export class CoreLoginSitePage { siteUrl: [url, this.moodleUrlValidator()] }); - this.searchFnc = this.utils.debounce(async (search: string, isValid: boolean = false) => { + this.searchFnc = this.utils.debounce(async (search: string) => { search = search.trim(); if (search.length >= 3) { - this.onlyWrittenSite = false; - // Update the sites list. this.sites = await this.sitesProvider.findSites(search); // UI tweaks. this.sites.forEach((site) => { site.noProtocolUrl = CoreUrl.removeProtocol(site.url); - site.fromWS = true; site.country = this.utils.getCountryName(site.countrycode); }); - // If it's a valid URL, add it. - if (isValid) { - this.onlyWrittenSite = !!this.sites.length; - this.sites.unshift({ - url: search, - fromWS: false, - name: this.translate.instant('core.login.yourenteredsite'), - noProtocolUrl: CoreUrl.removeProtocol(search), - }); - } - this.hasSites = !!this.sites.length; } else { // Not reseting the array to allow animation to be displayed. @@ -268,7 +253,7 @@ export class CoreLoginSitePage { error = this.domUtils.getErrorMessage(error); if (error == this.translate.instant('core.cannotconnecttrouble')) { - const found = this.sites.find((site) => site.fromWS && site.url == url); + const found = this.sites.find((site) => site.url == url); if (!found) { error += ' ' + this.translate.instant('core.cannotconnectverify'); @@ -311,7 +296,19 @@ export class CoreLoginSitePage { searchSite(e: Event, search: string): void { this.loadingSites = true; - this.searchFnc(search.trim(), this.siteForm.valid); + search = search.trim(); + + if (this.siteForm.valid && search.length >= 3) { + this.enteredSiteUrl = { + url: search, + name: this.translate.instant('core.login.yourenteredsite'), + noProtocolUrl: CoreUrl.removeProtocol(search), + }; + } else { + this.enteredSiteUrl = null; + } + + this.searchFnc(search.trim()); } /**
{{site.noProtocolUrl}}
{{site.city}} - {{site.country}}
{{enteredSiteUrl.noProtocolUrl}}