From 37f9e03f72c357dd0093190de987a55df4248e8c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pau=20Ferrer=20Oca=C3=B1a?= Date: Fri, 9 Nov 2018 16:42:21 +0100 Subject: [PATCH] MOBILE-2722 dashboard: Fix dashboard for 3.1 --- src/addon/block/timeline/providers/block-handler.ts | 6 ++++-- src/addon/block/timeline/providers/timeline.ts | 3 ++- src/app/app.scss | 2 +- src/core/sitehome/components/index/index.ts | 2 +- 4 files changed, 8 insertions(+), 5 deletions(-) diff --git a/src/addon/block/timeline/providers/block-handler.ts b/src/addon/block/timeline/providers/block-handler.ts index c0f60e7dd..2e89d60fb 100644 --- a/src/addon/block/timeline/providers/block-handler.ts +++ b/src/addon/block/timeline/providers/block-handler.ts @@ -40,8 +40,10 @@ export class AddonBlockTimelineHandler extends CoreBlockBaseHandler { * @return {boolean} Whether or not the handler is enabled on a site level. */ isEnabled(): boolean | Promise { - return this.timelineProvider.isAvailable() && (this.sitesProvider.getCurrentSite().isVersionGreaterEqualThan('3.6') || - !this.coursesProvider.isMyCoursesDisabledInSite()); + return this.timelineProvider.isAvailable().then((enabled) => { + return enabled && (this.sitesProvider.getCurrentSite().isVersionGreaterEqualThan('3.6') || + !this.coursesProvider.isMyCoursesDisabledInSite()); + }); } /** diff --git a/src/addon/block/timeline/providers/timeline.ts b/src/addon/block/timeline/providers/timeline.ts index 5b629d012..942ba4ba5 100644 --- a/src/addon/block/timeline/providers/timeline.ts +++ b/src/addon/block/timeline/providers/timeline.ts @@ -218,7 +218,8 @@ export class AddonBlockTimelineProvider { */ isAvailable(siteId?: string): Promise { return this.sitesProvider.getSite(siteId).then((site) => { - return site.wsAvailable('core_calendar_get_action_events_by_courses'); + return site.wsAvailable('core_calendar_get_action_events_by_courses') && + site.wsAvailable('core_calendar_get_action_events_by_timesort'); }); } diff --git a/src/app/app.scss b/src/app/app.scss index 48cb44c71..a527a7016 100644 --- a/src/app/app.scss +++ b/src/app/app.scss @@ -205,7 +205,7 @@ ion-app.app-root { } input { - @include text-align('end'); + @include text-align('start'); @include rtl() { text-align: right; } diff --git a/src/core/sitehome/components/index/index.ts b/src/core/sitehome/components/index/index.ts index 36ae14d5a..be5e0bda3 100644 --- a/src/core/sitehome/components/index/index.ts +++ b/src/core/sitehome/components/index/index.ts @@ -37,7 +37,7 @@ export class CoreSiteHomeIndexComponent implements OnInit { hasSupportedBlock: boolean; items: any[] = []; siteHomeId: number; - blocks: any[]; + blocks = []; constructor(private domUtils: CoreDomUtilsProvider, private sitesProvider: CoreSitesProvider, private courseProvider: CoreCourseProvider, private courseHelper: CoreCourseHelperProvider,