Merge pull request #1600 from crazyserver/MOBILE-2722

MOBILE-2722 dashboard: Fix dashboard for 3.1
main
Juan Leyva 2018-11-12 16:53:13 +01:00 committed by GitHub
commit 321af91cb3
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 8 additions and 5 deletions

View File

@ -40,8 +40,10 @@ export class AddonBlockTimelineHandler extends CoreBlockBaseHandler {
* @return {boolean} Whether or not the handler is enabled on a site level. * @return {boolean} Whether or not the handler is enabled on a site level.
*/ */
isEnabled(): boolean | Promise<boolean> { isEnabled(): boolean | Promise<boolean> {
return this.timelineProvider.isAvailable() && (this.sitesProvider.getCurrentSite().isVersionGreaterEqualThan('3.6') || return this.timelineProvider.isAvailable().then((enabled) => {
!this.coursesProvider.isMyCoursesDisabledInSite()); return enabled && (this.sitesProvider.getCurrentSite().isVersionGreaterEqualThan('3.6') ||
!this.coursesProvider.isMyCoursesDisabledInSite());
});
} }
/** /**

View File

@ -218,7 +218,8 @@ export class AddonBlockTimelineProvider {
*/ */
isAvailable(siteId?: string): Promise<boolean> { isAvailable(siteId?: string): Promise<boolean> {
return this.sitesProvider.getSite(siteId).then((site) => { 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');
}); });
} }

View File

@ -205,7 +205,7 @@ ion-app.app-root {
} }
input { input {
@include text-align('end'); @include text-align('start');
@include rtl() { @include rtl() {
text-align: right; text-align: right;
} }

View File

@ -37,7 +37,7 @@ export class CoreSiteHomeIndexComponent implements OnInit {
hasSupportedBlock: boolean; hasSupportedBlock: boolean;
items: any[] = []; items: any[] = [];
siteHomeId: number; siteHomeId: number;
blocks: any[]; blocks = [];
constructor(private domUtils: CoreDomUtilsProvider, private sitesProvider: CoreSitesProvider, constructor(private domUtils: CoreDomUtilsProvider, private sitesProvider: CoreSitesProvider,
private courseProvider: CoreCourseProvider, private courseHelper: CoreCourseHelperProvider, private courseProvider: CoreCourseProvider, private courseHelper: CoreCourseHelperProvider,