Merge pull request #3027 from crazyserver/MOBILE-3833

Mobile 3833
main
Dani Palou 2021-12-16 07:23:47 +01:00 committed by GitHub
commit 8a97b0251d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 14 additions and 3 deletions

View File

@ -2118,7 +2118,7 @@ export type CoreSiteInfoResponse = {
usercanmanageownfiles?: boolean; // True if the user can manage his own files.
userquota?: number; // User quota (bytes). 0 means user can ignore the quota.
usermaxuploadfilesize?: number; // User max upload file size (bytes). -1 means the user can ignore the upload file size.
userhomepage?: number; // The default home page for the user: 0 for the site home, 1 for dashboard.
userhomepage?: CoreSiteInfoUserHomepage; // The default home page for the user.
userprivateaccesskey?: string; // Private user access key for fetching files.
siteid?: number; // Site course ID.
sitecalendartype?: string; // Calendar type set in the site.
@ -2139,6 +2139,15 @@ export type CoreSiteInfo = CoreSiteInfoResponse & {
};
};
/**
* Enum constants that define default user home page.
*/
export enum CoreSiteInfoUserHomepage {
HOMEPAGE_SITE = 0, // Site home.
HOMEPAGE_MY = 1, // Dashboard.
HOMEPAGE_MYCOURSES = 3, // My courses.
};
/**
* Result of WS tool_mobile_get_config.
*/

View File

@ -107,7 +107,7 @@ export class CoreCollapsibleHeaderDirective implements OnDestroy {
}
// Wait animations to finish.
const animations = this.content.getAnimations();
const animations = (this.content.getAnimations && this.content.getAnimations()) || [];
await Promise.all(animations.map(async (animation) => {
await animation.finished;
}));

View File

@ -17,6 +17,7 @@ import { CoreSites } from '@services/sites';
import { CoreMainMenuHomeHandler, CoreMainMenuHomeHandlerToDisplay } from '@features/mainmenu/services/home-delegate';
import { CoreSiteHome } from '../sitehome';
import { makeSingleton } from '@singletons';
import { CoreSiteInfoUserHomepage } from '@classes/site';
/**
* Handler to add site home into home page.
@ -55,7 +56,8 @@ export class CoreSiteHomeHomeHandlerService implements CoreMainMenuHomeHandler {
*/
getDisplayData(): CoreMainMenuHomeHandlerToDisplay {
const site = CoreSites.getCurrentSite();
const displaySiteHome = site?.getInfo() && site?.getInfo()?.userhomepage === 0;
const displaySiteHome = site?.getInfo() && site?.getInfo()?.userhomepage === CoreSiteInfoUserHomepage.HOMEPAGE_SITE;
return {
title: 'core.sitehome.sitehome',