forked from EVOgeek/Vmeda.Online
		
	
						commit
						20ed414550
					
				| @ -17,6 +17,7 @@ const appConfig = { | |||||||
|         'prettier', |         'prettier', | ||||||
|         'plugin:@angular-eslint/recommended', |         'plugin:@angular-eslint/recommended', | ||||||
|         'plugin:promise/recommended', |         'plugin:promise/recommended', | ||||||
|  |         'plugin:jsdoc/recommended', | ||||||
|     ], |     ], | ||||||
|     parser: '@typescript-eslint/parser', |     parser: '@typescript-eslint/parser', | ||||||
|     parserOptions: { |     parserOptions: { | ||||||
| @ -199,6 +200,10 @@ const appConfig = { | |||||||
|         'id-match': 'error', |         'id-match': 'error', | ||||||
|         'jsdoc/check-alignment': 'error', |         'jsdoc/check-alignment': 'error', | ||||||
|         'jsdoc/newline-after-description': 'error', |         'jsdoc/newline-after-description': 'error', | ||||||
|  |         'jsdoc/require-param-type': 'off', | ||||||
|  |         'jsdoc/require-returns-type': 'off', | ||||||
|  |         'jsdoc/require-param': 'off', | ||||||
|  |         'jsdoc/check-values': 'off', | ||||||
|         'linebreak-style': [ |         'linebreak-style': [ | ||||||
|             'error', |             'error', | ||||||
|             'unix', |             'unix', | ||||||
|  | |||||||
| @ -33,7 +33,7 @@ | |||||||
|     "test:ci": "NODE_ENV=testing gulp && jest -ci --runInBand --verbose", |     "test:ci": "NODE_ENV=testing gulp && jest -ci --runInBand --verbose", | ||||||
|     "test:watch": "NODE_ENV=testing gulp watch & jest --watch", |     "test:watch": "NODE_ENV=testing gulp watch & jest --watch", | ||||||
|     "test:coverage": "NODE_ENV=testing gulp && jest --coverage", |     "test:coverage": "NODE_ENV=testing gulp && jest --coverage", | ||||||
|     "lint": "NODE_OPTIONS=--max-old-space-size=4096 ng lint", |     "lint": "NODE_OPTIONS=--max-old-space-size=8192 ng lint", | ||||||
|     "ionic:serve:before": "gulp", |     "ionic:serve:before": "gulp", | ||||||
|     "ionic:serve": "cross-env-shell ./scripts/serve.sh", |     "ionic:serve": "cross-env-shell ./scripts/serve.sh", | ||||||
|     "ionic:build:before": "gulp", |     "ionic:build:before": "gulp", | ||||||
|  | |||||||
| @ -81,7 +81,7 @@ export class AddonBadgesIssuedBadgePage implements OnInit, OnDestroy { | |||||||
|     /** |     /** | ||||||
|      * Fetch the issued badge required for the view. |      * Fetch the issued badge required for the view. | ||||||
|      * |      * | ||||||
|      * @return Promise resolved when done. |      * @returns Promise resolved when done. | ||||||
|      */ |      */ | ||||||
|     async fetchIssuedBadge(): Promise<void> { |     async fetchIssuedBadge(): Promise<void> { | ||||||
|         this.currentTime = CoreTimeUtils.timestamp(); |         this.currentTime = CoreTimeUtils.timestamp(); | ||||||
|  | |||||||
| @ -34,7 +34,7 @@ export class AddonBadgesProvider { | |||||||
|      * check, we should not be calling WS from here. |      * check, we should not be calling WS from here. | ||||||
|      * |      * | ||||||
|      * @param siteId Site ID. If not defined, current site. |      * @param siteId Site ID. If not defined, current site. | ||||||
|      * @return Promise resolved with true if enabled, false otherwise. |      * @returns Promise resolved with true if enabled, false otherwise. | ||||||
|      */ |      */ | ||||||
|     async isPluginEnabled(siteId?: string): Promise<boolean> { |     async isPluginEnabled(siteId?: string): Promise<boolean> { | ||||||
|         const site = await CoreSites.getSite(siteId); |         const site = await CoreSites.getSite(siteId); | ||||||
| @ -47,7 +47,7 @@ export class AddonBadgesProvider { | |||||||
|      * |      * | ||||||
|      * @param courseId ID of the course to get the badges from. |      * @param courseId ID of the course to get the badges from. | ||||||
|      * @param userId ID of the user to get the badges from. |      * @param userId ID of the user to get the badges from. | ||||||
|      * @return Cache key. |      * @returns Cache key. | ||||||
|      */ |      */ | ||||||
|     protected getBadgesCacheKey(courseId: number, userId: number): string { |     protected getBadgesCacheKey(courseId: number, userId: number): string { | ||||||
|         return ROOT_CACHE_KEY + 'badges:' + courseId + ':' + userId; |         return ROOT_CACHE_KEY + 'badges:' + courseId + ':' + userId; | ||||||
| @ -59,7 +59,7 @@ export class AddonBadgesProvider { | |||||||
|      * @param courseId ID of the course to get the badges from. |      * @param courseId ID of the course to get the badges from. | ||||||
|      * @param userId ID of the user to get the badges from. |      * @param userId ID of the user to get the badges from. | ||||||
|      * @param siteId Site ID. If not defined, current site. |      * @param siteId Site ID. If not defined, current site. | ||||||
|      * @return Promise to be resolved when the badges are retrieved. |      * @returns Promise to be resolved when the badges are retrieved. | ||||||
|      */ |      */ | ||||||
|     async getUserBadges(courseId: number, userId: number, siteId?: string): Promise<AddonBadgesUserBadge[]> { |     async getUserBadges(courseId: number, userId: number, siteId?: string): Promise<AddonBadgesUserBadge[]> { | ||||||
| 
 | 
 | ||||||
| @ -98,7 +98,7 @@ export class AddonBadgesProvider { | |||||||
|      * @param courseId Course ID. |      * @param courseId Course ID. | ||||||
|      * @param userId ID of the user to get the badges from. |      * @param userId ID of the user to get the badges from. | ||||||
|      * @param siteId Site ID. If not defined, current site. |      * @param siteId Site ID. If not defined, current site. | ||||||
|      * @return Promise resolved when data is invalidated. |      * @returns Promise resolved when data is invalidated. | ||||||
|      */ |      */ | ||||||
|     async invalidateUserBadges(courseId: number, userId: number, siteId?: string): Promise<void> { |     async invalidateUserBadges(courseId: number, userId: number, siteId?: string): Promise<void> { | ||||||
|         const site = await CoreSites.getSite(siteId); |         const site = await CoreSites.getSite(siteId); | ||||||
|  | |||||||
| @ -30,13 +30,7 @@ export class AddonBadgesBadgeLinkHandlerService extends CoreContentLinksHandlerB | |||||||
|     pattern = /\/badges\/badge\.php.*([?&]hash=)/; |     pattern = /\/badges\/badge\.php.*([?&]hash=)/; | ||||||
| 
 | 
 | ||||||
|     /** |     /** | ||||||
|      * Get the list of actions for a link (url). |      * @inheritdoc | ||||||
|      * |  | ||||||
|      * @param siteIds List of sites the URL belongs to. |  | ||||||
|      * @param url The URL to treat. |  | ||||||
|      * @param params The params of the URL. E.g. 'mysite.com?id=1' -> {id: 1} |  | ||||||
|      * @param courseId Course ID related to the URL. Optional but recommended. |  | ||||||
|      * @return List of (or promise resolved with list of) actions. |  | ||||||
|      */ |      */ | ||||||
|     getActions(siteIds: string[], url: string, params: Record<string, string>): CoreContentLinksAction[] { |     getActions(siteIds: string[], url: string, params: Record<string, string>): CoreContentLinksAction[] { | ||||||
| 
 | 
 | ||||||
| @ -48,14 +42,7 @@ export class AddonBadgesBadgeLinkHandlerService extends CoreContentLinksHandlerB | |||||||
|     } |     } | ||||||
| 
 | 
 | ||||||
|     /** |     /** | ||||||
|      * Check if the handler is enabled for a certain site (site + user) and a URL. |      * @inheritdoc | ||||||
|      * If not defined, defaults to true. |  | ||||||
|      * |  | ||||||
|      * @param siteId The site ID. |  | ||||||
|      * @param url The URL to treat. |  | ||||||
|      * @param params The params of the URL. E.g. 'mysite.com?id=1' -> {id: 1} |  | ||||||
|      * @param courseId Course ID related to the URL. Optional but recommended. |  | ||||||
|      * @return Whether the handler is enabled for the URL and site. |  | ||||||
|      */ |      */ | ||||||
|     isEnabled(siteId: string): Promise<boolean> { |     isEnabled(siteId: string): Promise<boolean> { | ||||||
|         return AddonBadges.isPluginEnabled(siteId); |         return AddonBadges.isPluginEnabled(siteId); | ||||||
|  | |||||||
| @ -32,7 +32,7 @@ export class AddonBadgesMyBadgesLinkHandlerService extends CoreContentLinksHandl | |||||||
|     /** |     /** | ||||||
|      * Get the list of actions for a link (url). |      * Get the list of actions for a link (url). | ||||||
|      * |      * | ||||||
|      * @return List of (or promise resolved with list of) actions. |      * @returns List of (or promise resolved with list of) actions. | ||||||
|      */ |      */ | ||||||
|     getActions(): CoreContentLinksAction[] { |     getActions(): CoreContentLinksAction[] { | ||||||
|         return [{ |         return [{ | ||||||
| @ -47,7 +47,7 @@ export class AddonBadgesMyBadgesLinkHandlerService extends CoreContentLinksHandl | |||||||
|      * If not defined, defaults to true. |      * If not defined, defaults to true. | ||||||
|      * |      * | ||||||
|      * @param siteId The site ID. |      * @param siteId The site ID. | ||||||
|      * @return Whether the handler is enabled for the URL and site. |      * @returns Whether the handler is enabled for the URL and site. | ||||||
|      */ |      */ | ||||||
|     async isEnabled(siteId: string): Promise<boolean> { |     async isEnabled(siteId: string): Promise<boolean> { | ||||||
|         return AddonBadges.isPluginEnabled(siteId); |         return AddonBadges.isPluginEnabled(siteId); | ||||||
|  | |||||||
| @ -35,7 +35,7 @@ export class AddonBadgesPushClickHandlerService implements CorePushNotifications | |||||||
|      * Check if a notification click is handled by this handler. |      * Check if a notification click is handled by this handler. | ||||||
|      * |      * | ||||||
|      * @param notification The notification to check. |      * @param notification The notification to check. | ||||||
|      * @return Whether the notification click is handled by this handler |      * @returns Whether the notification click is handled by this handler | ||||||
|      */ |      */ | ||||||
|     async handles(notification: CorePushNotificationsNotificationBasicData): Promise<boolean> { |     async handles(notification: CorePushNotificationsNotificationBasicData): Promise<boolean> { | ||||||
|         const data = notification.customdata || {}; |         const data = notification.customdata || {}; | ||||||
| @ -52,7 +52,7 @@ export class AddonBadgesPushClickHandlerService implements CorePushNotifications | |||||||
|      * Handle the notification click. |      * Handle the notification click. | ||||||
|      * |      * | ||||||
|      * @param notification The notification to check. |      * @param notification The notification to check. | ||||||
|      * @return Promise resolved when done. |      * @returns Promise resolved when done. | ||||||
|      */ |      */ | ||||||
|     async handleClick(notification: CorePushNotificationsNotificationBasicData): Promise<void> { |     async handleClick(notification: CorePushNotificationsNotificationBasicData): Promise<void> { | ||||||
|         const data = notification.customdata || {}; |         const data = notification.customdata || {}; | ||||||
|  | |||||||
| @ -44,7 +44,7 @@ export class AddonBlockActivityModulesComponent extends CoreBlockBaseComponent i | |||||||
|     /** |     /** | ||||||
|      * Perform the invalidate content function. |      * Perform the invalidate content function. | ||||||
|      * |      * | ||||||
|      * @return Resolved when done. |      * @returns Resolved when done. | ||||||
|      */ |      */ | ||||||
|     async invalidateContent(): Promise<void> { |     async invalidateContent(): Promise<void> { | ||||||
|         await CoreCourse.invalidateSections(this.instanceId); |         await CoreCourse.invalidateSections(this.instanceId); | ||||||
| @ -53,7 +53,7 @@ export class AddonBlockActivityModulesComponent extends CoreBlockBaseComponent i | |||||||
|     /** |     /** | ||||||
|      * Fetch the data to render the block. |      * Fetch the data to render the block. | ||||||
|      * |      * | ||||||
|      * @return Promise resolved when done. |      * @returns Promise resolved when done. | ||||||
|      */ |      */ | ||||||
|     protected async fetchContent(): Promise<void> { |     protected async fetchContent(): Promise<void> { | ||||||
|         const sections = await CoreCourse.getSections(this.getCourseId(), false, true); |         const sections = await CoreCourse.getSections(this.getCourseId(), false, true); | ||||||
| @ -114,7 +114,7 @@ export class AddonBlockActivityModulesComponent extends CoreBlockBaseComponent i | |||||||
|     /** |     /** | ||||||
|      * Obtain the appropiate course id for the block. |      * Obtain the appropiate course id for the block. | ||||||
|      * |      * | ||||||
|      * @return Course id. |      * @returns Course id. | ||||||
|      */ |      */ | ||||||
|     protected getCourseId(): number { |     protected getCourseId(): number { | ||||||
|         if (this.contextLevel == ContextLevel.COURSE) { |         if (this.contextLevel == ContextLevel.COURSE) { | ||||||
|  | |||||||
| @ -30,7 +30,7 @@ export class AddonBlockActivityModulesHandlerService extends CoreBlockBaseHandle | |||||||
|     /** |     /** | ||||||
|      * Returns the data needed to render the block. |      * Returns the data needed to render the block. | ||||||
|      * |      * | ||||||
|      * @return Data or promise resolved with the data. |      * @returns Data or promise resolved with the data. | ||||||
|      */ |      */ | ||||||
|     getDisplayData(): CoreBlockHandlerData { |     getDisplayData(): CoreBlockHandlerData { | ||||||
| 
 | 
 | ||||||
|  | |||||||
| @ -31,7 +31,7 @@ export class AddonBlockActivityResultsHandlerService extends CoreBlockBaseHandle | |||||||
|     /** |     /** | ||||||
|      * Returns the data needed to render the block. |      * Returns the data needed to render the block. | ||||||
|      * |      * | ||||||
|      * @return Data or promise resolved with the data. |      * @returns Data or promise resolved with the data. | ||||||
|      */ |      */ | ||||||
|     getDisplayData(): CoreBlockHandlerData { |     getDisplayData(): CoreBlockHandlerData { | ||||||
| 
 | 
 | ||||||
|  | |||||||
| @ -31,7 +31,7 @@ export class AddonBlockBadgesHandlerService extends CoreBlockBaseHandler { | |||||||
|     /** |     /** | ||||||
|      * Returns the data needed to render the block. |      * Returns the data needed to render the block. | ||||||
|      * |      * | ||||||
|      * @return Data or promise resolved with the data. |      * @returns Data or promise resolved with the data. | ||||||
|      */ |      */ | ||||||
|     getDisplayData(): CoreBlockHandlerData { |     getDisplayData(): CoreBlockHandlerData { | ||||||
| 
 | 
 | ||||||
|  | |||||||
| @ -31,7 +31,7 @@ export class AddonBlockBlogMenuHandlerService extends CoreBlockBaseHandler { | |||||||
|     /** |     /** | ||||||
|      * Returns the data needed to render the block. |      * Returns the data needed to render the block. | ||||||
|      * |      * | ||||||
|      * @return Data or promise resolved with the data. |      * @returns Data or promise resolved with the data. | ||||||
|      */ |      */ | ||||||
|     getDisplayData(): CoreBlockHandlerData { |     getDisplayData(): CoreBlockHandlerData { | ||||||
| 
 | 
 | ||||||
|  | |||||||
| @ -31,7 +31,7 @@ export class AddonBlockBlogRecentHandlerService extends CoreBlockBaseHandler { | |||||||
|     /** |     /** | ||||||
|      * Returns the data needed to render the block. |      * Returns the data needed to render the block. | ||||||
|      * |      * | ||||||
|      * @return Data or promise resolved with the data. |      * @returns Data or promise resolved with the data. | ||||||
|      */ |      */ | ||||||
|     getDisplayData(): CoreBlockHandlerData { |     getDisplayData(): CoreBlockHandlerData { | ||||||
| 
 | 
 | ||||||
|  | |||||||
| @ -31,7 +31,7 @@ export class AddonBlockBlogTagsHandlerService extends CoreBlockBaseHandler { | |||||||
|     /** |     /** | ||||||
|      * Returns the data needed to render the block. |      * Returns the data needed to render the block. | ||||||
|      * |      * | ||||||
|      * @return Data or promise resolved with the data. |      * @returns Data or promise resolved with the data. | ||||||
|      */ |      */ | ||||||
|     getDisplayData(): CoreBlockHandlerData { |     getDisplayData(): CoreBlockHandlerData { | ||||||
| 
 | 
 | ||||||
|  | |||||||
| @ -36,7 +36,7 @@ export class AddonBlockCalendarMonthHandlerService extends CoreBlockBaseHandler | |||||||
|      * @param block The block to render. |      * @param block The block to render. | ||||||
|      * @param contextLevel The context where the block will be used. |      * @param contextLevel The context where the block will be used. | ||||||
|      * @param instanceId The instance ID associated with the context level. |      * @param instanceId The instance ID associated with the context level. | ||||||
|      * @return Data or promise resolved with the data. |      * @returns Data or promise resolved with the data. | ||||||
|      */ |      */ | ||||||
|     getDisplayData(block: CoreCourseBlock, contextLevel: string, instanceId: number): CoreBlockHandlerData { |     getDisplayData(block: CoreCourseBlock, contextLevel: string, instanceId: number): CoreBlockHandlerData { | ||||||
|         const linkParams: Params = contextLevel == 'course' ? { courseId: instanceId } : {}; |         const linkParams: Params = contextLevel == 'course' ? { courseId: instanceId } : {}; | ||||||
|  | |||||||
| @ -37,7 +37,7 @@ export class AddonBlockCalendarUpcomingHandlerService extends CoreBlockBaseHandl | |||||||
|      * @param block The block to render. |      * @param block The block to render. | ||||||
|      * @param contextLevel The context where the block will be used. |      * @param contextLevel The context where the block will be used. | ||||||
|      * @param instanceId The instance ID associated with the context level. |      * @param instanceId The instance ID associated with the context level. | ||||||
|      * @return Data or promise resolved with the data. |      * @returns Data or promise resolved with the data. | ||||||
|      */ |      */ | ||||||
|     getDisplayData(block: CoreCourseBlock, contextLevel: string, instanceId: number): CoreBlockHandlerData { |     getDisplayData(block: CoreCourseBlock, contextLevel: string, instanceId: number): CoreBlockHandlerData { | ||||||
|         const linkParams: Params = { upcoming: true }; |         const linkParams: Params = { upcoming: true }; | ||||||
|  | |||||||
| @ -34,7 +34,7 @@ export class AddonBlockCommentsHandlerService extends CoreBlockBaseHandler { | |||||||
|      * @param block The block to render. |      * @param block The block to render. | ||||||
|      * @param contextLevel The context where the block will be used. |      * @param contextLevel The context where the block will be used. | ||||||
|      * @param instanceId The instance ID associated with the context level. |      * @param instanceId The instance ID associated with the context level. | ||||||
|      * @return Data or promise resolved with the data. |      * @returns Data or promise resolved with the data. | ||||||
|      */ |      */ | ||||||
|     getDisplayData(block: CoreCourseBlock, contextLevel: string, instanceId: number): CoreBlockHandlerData { |     getDisplayData(block: CoreCourseBlock, contextLevel: string, instanceId: number): CoreBlockHandlerData { | ||||||
|         return { |         return { | ||||||
|  | |||||||
| @ -33,7 +33,7 @@ export class AddonBlockGlossaryRandomHandlerService extends CoreBlockBaseHandler | |||||||
|      * Returns the data needed to render the block. |      * Returns the data needed to render the block. | ||||||
|      * |      * | ||||||
|      * @param block The block to render. |      * @param block The block to render. | ||||||
|      * @return Data or promise resolved with the data. |      * @returns Data or promise resolved with the data. | ||||||
|      */ |      */ | ||||||
|     getDisplayData(block: CoreCourseBlock): CoreBlockHandlerData { |     getDisplayData(block: CoreCourseBlock): CoreBlockHandlerData { | ||||||
|         return { |         return { | ||||||
|  | |||||||
| @ -33,7 +33,7 @@ export class AddonBlockHtmlHandlerService extends CoreBlockBaseHandler { | |||||||
|      * Returns the data needed to render the block. |      * Returns the data needed to render the block. | ||||||
|      * |      * | ||||||
|      * @param block The block to render. |      * @param block The block to render. | ||||||
|      * @return Data or promise resolved with the data. |      * @returns Data or promise resolved with the data. | ||||||
|      */ |      */ | ||||||
|     getDisplayData(block: CoreCourseBlock): CoreBlockHandlerData { |     getDisplayData(block: CoreCourseBlock): CoreBlockHandlerData { | ||||||
| 
 | 
 | ||||||
|  | |||||||
| @ -31,7 +31,7 @@ export class AddonBlockLearningPlansHandlerService extends CoreBlockBaseHandler | |||||||
|     /** |     /** | ||||||
|      * Returns the data needed to render the block. |      * Returns the data needed to render the block. | ||||||
|      * |      * | ||||||
|      * @return Data or promise resolved with the data. |      * @returns Data or promise resolved with the data. | ||||||
|      */ |      */ | ||||||
|     getDisplayData(): CoreBlockHandlerData { |     getDisplayData(): CoreBlockHandlerData { | ||||||
|         return { |         return { | ||||||
|  | |||||||
| @ -187,7 +187,7 @@ export class AddonBlockMyOverviewComponent extends CoreBlockBaseComponent implem | |||||||
|      * |      * | ||||||
|      * @param refresher Refresher. |      * @param refresher Refresher. | ||||||
|      * @param done Function to call when done. |      * @param done Function to call when done. | ||||||
|      * @return Promise resolved when done. |      * @returns Promise resolved when done. | ||||||
|      */ |      */ | ||||||
|     async doRefresh(refresher?: IonRefresher, done?: () => void): Promise<void> { |     async doRefresh(refresher?: IonRefresher, done?: () => void): Promise<void> { | ||||||
|         if (this.loaded) { |         if (this.loaded) { | ||||||
| @ -211,7 +211,7 @@ export class AddonBlockMyOverviewComponent extends CoreBlockBaseComponent implem | |||||||
|     /** |     /** | ||||||
|      * Invalidate list of courses. |      * Invalidate list of courses. | ||||||
|      * |      * | ||||||
|      * @return Promise resolved when done. |      * @returns Promise resolved when done. | ||||||
|      */ |      */ | ||||||
|     protected invalidateCourseList(): Promise<void> { |     protected invalidateCourseList(): Promise<void> { | ||||||
|         return CoreCourses.invalidateUserCourses(); |         return CoreCourses.invalidateUserCourses(); | ||||||
| @ -221,7 +221,7 @@ export class AddonBlockMyOverviewComponent extends CoreBlockBaseComponent implem | |||||||
|      * Helper function to invalidate only selected courses. |      * Helper function to invalidate only selected courses. | ||||||
|      * |      * | ||||||
|      * @param courseIds Course Id array. |      * @param courseIds Course Id array. | ||||||
|      * @return Promise resolved when done. |      * @returns Promise resolved when done. | ||||||
|      */ |      */ | ||||||
|     protected async invalidateCourses(courseIds: number[]): Promise<void> { |     protected async invalidateCourses(courseIds: number[]): Promise<void> { | ||||||
|         const promises: Promise<void>[] = []; |         const promises: Promise<void>[] = []; | ||||||
| @ -269,7 +269,7 @@ export class AddonBlockMyOverviewComponent extends CoreBlockBaseComponent implem | |||||||
|      * Load all courses. |      * Load all courses. | ||||||
|      * |      * | ||||||
|      * @param loadWatcher To manage the requests. |      * @param loadWatcher To manage the requests. | ||||||
|      * @return Promise resolved when done. |      * @returns Promise resolved when done. | ||||||
|      */ |      */ | ||||||
|     protected async loadAllCourses(loadWatcher: PageLoadWatcher): Promise<void> { |     protected async loadAllCourses(loadWatcher: PageLoadWatcher): Promise<void> { | ||||||
|         const showCategories = this.block.configsRecord?.displaycategories?.value === '1'; |         const showCategories = this.block.configsRecord?.displaycategories?.value === '1'; | ||||||
| @ -290,7 +290,7 @@ export class AddonBlockMyOverviewComponent extends CoreBlockBaseComponent implem | |||||||
|      * Load grace period. |      * Load grace period. | ||||||
|      * |      * | ||||||
|      * @param loadWatcher To manage the requests. |      * @param loadWatcher To manage the requests. | ||||||
|      * @return Promise resolved when done. |      * @returns Promise resolved when done. | ||||||
|      */ |      */ | ||||||
|     protected async loadGracePeriod(loadWatcher: PageLoadWatcher): Promise<void> { |     protected async loadGracePeriod(loadWatcher: PageLoadWatcher): Promise<void> { | ||||||
|         this.hasCourses = this.allCourses.length > 0; |         this.hasCourses = this.allCourses.length > 0; | ||||||
| @ -334,7 +334,7 @@ export class AddonBlockMyOverviewComponent extends CoreBlockBaseComponent implem | |||||||
|      * |      * | ||||||
|      * @param config Block configuration. |      * @param config Block configuration. | ||||||
|      * @param loadWatcher To manage the requests. |      * @param loadWatcher To manage the requests. | ||||||
|      * @return Promise resolved when done. |      * @returns Promise resolved when done. | ||||||
|      */ |      */ | ||||||
|     protected async loadFilters( |     protected async loadFilters( | ||||||
|         config?: Record<string, { name: string; value: string; type: string }>, |         config?: Record<string, { name: string; value: string; type: string }>, | ||||||
| @ -421,7 +421,7 @@ export class AddonBlockMyOverviewComponent extends CoreBlockBaseComponent implem | |||||||
|      * Refresh course list based on a EVENT_MY_COURSES_UPDATED event. |      * Refresh course list based on a EVENT_MY_COURSES_UPDATED event. | ||||||
|      * |      * | ||||||
|      * @param data Event data. |      * @param data Event data. | ||||||
|      * @return Promise resolved when done. |      * @returns Promise resolved when done. | ||||||
|      */ |      */ | ||||||
|     protected async refreshCourseList(data: CoreCoursesMyCoursesUpdatedEventData): Promise<void> { |     protected async refreshCourseList(data: CoreCoursesMyCoursesUpdatedEventData): Promise<void> { | ||||||
|         if (data.action == CoreCoursesProvider.ACTION_ENROL) { |         if (data.action == CoreCoursesProvider.ACTION_ENROL) { | ||||||
| @ -464,7 +464,7 @@ export class AddonBlockMyOverviewComponent extends CoreBlockBaseComponent implem | |||||||
|     /** |     /** | ||||||
|      * Initialize the prefetch icon for selected courses. |      * Initialize the prefetch icon for selected courses. | ||||||
|      * |      * | ||||||
|      * @return Promise resolved when done. |      * @returns Promise resolved when done. | ||||||
|      */ |      */ | ||||||
|     async initPrefetchCoursesIcons(): Promise<void> { |     async initPrefetchCoursesIcons(): Promise<void> { | ||||||
|         if (this.prefetchIconsInitialized) { |         if (this.prefetchIconsInitialized) { | ||||||
| @ -480,7 +480,7 @@ export class AddonBlockMyOverviewComponent extends CoreBlockBaseComponent implem | |||||||
|     /** |     /** | ||||||
|      * Prefetch all the shown courses. |      * Prefetch all the shown courses. | ||||||
|      * |      * | ||||||
|      * @return Promise resolved when done. |      * @returns Promise resolved when done. | ||||||
|      */ |      */ | ||||||
|     async prefetchCourses(): Promise<void> { |     async prefetchCourses(): Promise<void> { | ||||||
|         const initialIcon = this.prefetchCoursesData.icon; |         const initialIcon = this.prefetchCoursesData.icon; | ||||||
| @ -510,7 +510,7 @@ export class AddonBlockMyOverviewComponent extends CoreBlockBaseComponent implem | |||||||
|      * Set selected courses filter. |      * Set selected courses filter. | ||||||
|      * |      * | ||||||
|      * @param loadWatcher To manage the requests. |      * @param loadWatcher To manage the requests. | ||||||
|      * @return Promise resolved when done. |      * @returns Promise resolved when done. | ||||||
|      */ |      */ | ||||||
|     protected async filterCourses(loadWatcher?: PageLoadWatcher): Promise<void> { |     protected async filterCourses(loadWatcher?: PageLoadWatcher): Promise<void> { | ||||||
|         let timeFilter = this.filters.timeFilterSelected; |         let timeFilter = this.filters.timeFilterSelected; | ||||||
| @ -655,7 +655,7 @@ export class AddonBlockMyOverviewComponent extends CoreBlockBaseComponent implem | |||||||
|      * Saves filters value. |      * Saves filters value. | ||||||
|      * |      * | ||||||
|      * @param timeFilter New time filter. |      * @param timeFilter New time filter. | ||||||
|      * @return Promise resolved when done. |      * @returns Promise resolved when done. | ||||||
|      */ |      */ | ||||||
|     async saveFilters(timeFilter: string): Promise<void> { |     async saveFilters(timeFilter: string): Promise<void> { | ||||||
|         this.filters.timeFilterSelected = timeFilter; |         this.filters.timeFilterSelected = timeFilter; | ||||||
| @ -666,7 +666,7 @@ export class AddonBlockMyOverviewComponent extends CoreBlockBaseComponent implem | |||||||
|      * Toggle layout value. |      * Toggle layout value. | ||||||
|      * |      * | ||||||
|      * @param layout New layout. |      * @param layout New layout. | ||||||
|      * @return Promise resolved when done. |      * @returns Promise resolved when done. | ||||||
|      */ |      */ | ||||||
|     async toggleLayout(layout: AddonBlockMyOverviewLayouts): Promise<void> { |     async toggleLayout(layout: AddonBlockMyOverviewLayouts): Promise<void> { | ||||||
|         this.layout = layout; |         this.layout = layout; | ||||||
| @ -678,7 +678,7 @@ export class AddonBlockMyOverviewComponent extends CoreBlockBaseComponent implem | |||||||
|      * Saves sort courses value. |      * Saves sort courses value. | ||||||
|      * |      * | ||||||
|      * @param sort New sorting. |      * @param sort New sorting. | ||||||
|      * @return Promise resolved when done. |      * @returns Promise resolved when done. | ||||||
|      */ |      */ | ||||||
|     async saveSort(sort: string): Promise<void> { |     async saveSort(sort: string): Promise<void> { | ||||||
|         this.sort.selected = sort; |         this.sort.selected = sort; | ||||||
| @ -690,7 +690,7 @@ export class AddonBlockMyOverviewComponent extends CoreBlockBaseComponent implem | |||||||
|      * Option selected save and apply filter. |      * Option selected save and apply filter. | ||||||
|      * |      * | ||||||
|      * @param selected Option selected. |      * @param selected Option selected. | ||||||
|      * @return Promise resolved when done. |      * @returns Promise resolved when done. | ||||||
|      */ |      */ | ||||||
|     async filterOptionsChanged(selected: AddonBlockMyOverviewTimeFilters): Promise<void> { |     async filterOptionsChanged(selected: AddonBlockMyOverviewTimeFilters): Promise<void> { | ||||||
|         this.filters.timeFilterSelected = selected; |         this.filters.timeFilterSelected = selected; | ||||||
| @ -709,7 +709,7 @@ export class AddonBlockMyOverviewComponent extends CoreBlockBaseComponent implem | |||||||
|      * |      * | ||||||
|      * @param previousCourses Previous courses. |      * @param previousCourses Previous courses. | ||||||
|      * @param newCourses New courses. |      * @param newCourses New courses. | ||||||
|      * @return Whether it has meaningful changes. |      * @returns Whether it has meaningful changes. | ||||||
|      */ |      */ | ||||||
|     protected async coursesHaveMeaningfulChanges( |     protected async coursesHaveMeaningfulChanges( | ||||||
|         previousCourses: CoreEnrolledCourseDataWithExtraInfoAndOptions[], |         previousCourses: CoreEnrolledCourseDataWithExtraInfoAndOptions[], | ||||||
| @ -744,7 +744,7 @@ export class AddonBlockMyOverviewComponent extends CoreBlockBaseComponent implem | |||||||
|      * |      * | ||||||
|      * @param previousCourses Previous courses. |      * @param previousCourses Previous courses. | ||||||
|      * @param newCourses New courses. |      * @param newCourses New courses. | ||||||
|      * @return Whether it has meaningful changes. |      * @returns Whether it has meaningful changes. | ||||||
|      */ |      */ | ||||||
|     protected async customFilterCoursesHaveMeaningfulChanges( |     protected async customFilterCoursesHaveMeaningfulChanges( | ||||||
|         previousCourses: CoreCourseSummaryData[], |         previousCourses: CoreCourseSummaryData[], | ||||||
|  | |||||||
| @ -32,7 +32,7 @@ export class AddonBlockMyOverviewHandlerService extends CoreBlockBaseHandler { | |||||||
|     /** |     /** | ||||||
|      * Check if the handler is enabled on a site level. |      * Check if the handler is enabled on a site level. | ||||||
|      * |      * | ||||||
|      * @return Whether or not the handler is enabled on a site level. |      * @returns Whether or not the handler is enabled on a site level. | ||||||
|      */ |      */ | ||||||
|     async isEnabled(): Promise<boolean> { |     async isEnabled(): Promise<boolean> { | ||||||
|         return (CoreSites.getCurrentSite()?.isVersionGreaterEqualThan('3.6')) || |         return (CoreSites.getCurrentSite()?.isVersionGreaterEqualThan('3.6')) || | ||||||
| @ -42,7 +42,7 @@ export class AddonBlockMyOverviewHandlerService extends CoreBlockBaseHandler { | |||||||
|     /** |     /** | ||||||
|      * Returns the data needed to render the block. |      * Returns the data needed to render the block. | ||||||
|      * |      * | ||||||
|      * @return Data or promise resolved with the data. |      * @returns Data or promise resolved with the data. | ||||||
|      */ |      */ | ||||||
|     getDisplayData(): CoreBlockHandlerData { |     getDisplayData(): CoreBlockHandlerData { | ||||||
| 
 | 
 | ||||||
|  | |||||||
| @ -31,7 +31,7 @@ export class AddonBlockNewsItemsHandlerService extends CoreBlockBaseHandler { | |||||||
|     /** |     /** | ||||||
|      * Returns the data needed to render the block. |      * Returns the data needed to render the block. | ||||||
|      * |      * | ||||||
|      * @return Data or promise resolved with the data. |      * @returns Data or promise resolved with the data. | ||||||
|      */ |      */ | ||||||
|     getDisplayData(): CoreBlockHandlerData { |     getDisplayData(): CoreBlockHandlerData { | ||||||
| 
 | 
 | ||||||
|  | |||||||
| @ -30,7 +30,7 @@ export class AddonBlockOnlineUsersHandlerService extends CoreBlockBaseHandler { | |||||||
|     /** |     /** | ||||||
|      * Returns the data needed to render the block. |      * Returns the data needed to render the block. | ||||||
|      * |      * | ||||||
|      * @return Data or promise resolved with the data. |      * @returns Data or promise resolved with the data. | ||||||
|      */ |      */ | ||||||
|     getDisplayData(): CoreBlockHandlerData { |     getDisplayData(): CoreBlockHandlerData { | ||||||
| 
 | 
 | ||||||
|  | |||||||
| @ -31,7 +31,7 @@ export class AddonBlockPrivateFilesHandlerService extends CoreBlockBaseHandler { | |||||||
|     /** |     /** | ||||||
|      * Returns the data needed to render the block. |      * Returns the data needed to render the block. | ||||||
|      * |      * | ||||||
|      * @return Data or promise resolved with the data. |      * @returns Data or promise resolved with the data. | ||||||
|      */ |      */ | ||||||
|     getDisplayData(): CoreBlockHandlerData { |     getDisplayData(): CoreBlockHandlerData { | ||||||
| 
 | 
 | ||||||
|  | |||||||
| @ -31,7 +31,7 @@ export class AddonBlockRecentActivityHandlerService extends CoreBlockBaseHandler | |||||||
|     /** |     /** | ||||||
|      * Returns the data needed to render the block. |      * Returns the data needed to render the block. | ||||||
|      * |      * | ||||||
|      * @return Data or promise resolved with the data. |      * @returns Data or promise resolved with the data. | ||||||
|      */ |      */ | ||||||
|     getDisplayData(): CoreBlockHandlerData { |     getDisplayData(): CoreBlockHandlerData { | ||||||
| 
 | 
 | ||||||
|  | |||||||
| @ -88,7 +88,7 @@ export class AddonBlockRecentlyAccessedCoursesComponent extends CoreBlockBaseCom | |||||||
|     /** |     /** | ||||||
|      * Invalidate list of courses. |      * Invalidate list of courses. | ||||||
|      * |      * | ||||||
|      * @return Promise resolved when done. |      * @returns Promise resolved when done. | ||||||
|      */ |      */ | ||||||
|     protected async invalidateCourseList(): Promise<void> { |     protected async invalidateCourseList(): Promise<void> { | ||||||
|         return this.site.isVersionGreaterEqualThan('3.8') |         return this.site.isVersionGreaterEqualThan('3.8') | ||||||
| @ -100,7 +100,7 @@ export class AddonBlockRecentlyAccessedCoursesComponent extends CoreBlockBaseCom | |||||||
|      * Helper function to invalidate only selected courses. |      * Helper function to invalidate only selected courses. | ||||||
|      * |      * | ||||||
|      * @param courseIds Course Id array. |      * @param courseIds Course Id array. | ||||||
|      * @return Promise resolved when done. |      * @returns Promise resolved when done. | ||||||
|      */ |      */ | ||||||
|     protected async invalidateCourses(courseIds: number[]): Promise<void> { |     protected async invalidateCourses(courseIds: number[]): Promise<void> { | ||||||
|         const promises: Promise<void>[] = []; |         const promises: Promise<void>[] = []; | ||||||
| @ -166,7 +166,7 @@ export class AddonBlockRecentlyAccessedCoursesComponent extends CoreBlockBaseCom | |||||||
|      * Refresh course list based on a EVENT_MY_COURSES_UPDATED event. |      * Refresh course list based on a EVENT_MY_COURSES_UPDATED event. | ||||||
|      * |      * | ||||||
|      * @param data Event data. |      * @param data Event data. | ||||||
|      * @return Promise resolved when done. |      * @returns Promise resolved when done. | ||||||
|      */ |      */ | ||||||
|     protected async refreshCourseList(data: CoreCoursesMyCoursesUpdatedEventData): Promise<void> { |     protected async refreshCourseList(data: CoreCoursesMyCoursesUpdatedEventData): Promise<void> { | ||||||
|         if (data.action == CoreCoursesProvider.ACTION_ENROL) { |         if (data.action == CoreCoursesProvider.ACTION_ENROL) { | ||||||
|  | |||||||
| @ -30,7 +30,7 @@ export class AddonBlockRecentlyAccessedCoursesHandlerService extends CoreBlockBa | |||||||
|     /** |     /** | ||||||
|      * Returns the data needed to render the block. |      * Returns the data needed to render the block. | ||||||
|      * |      * | ||||||
|      * @return Data or promise resolved with the data. |      * @returns Data or promise resolved with the data. | ||||||
|      */ |      */ | ||||||
|     getDisplayData(): CoreBlockHandlerData { |     getDisplayData(): CoreBlockHandlerData { | ||||||
| 
 | 
 | ||||||
|  | |||||||
| @ -58,7 +58,7 @@ export class AddonBlockRecentlyAccessedItemsComponent extends CoreBlockBaseCompo | |||||||
|     /** |     /** | ||||||
|      * Perform the invalidate content function. |      * Perform the invalidate content function. | ||||||
|      * |      * | ||||||
|      * @return Resolved when done. |      * @returns Resolved when done. | ||||||
|      */ |      */ | ||||||
|     async invalidateContent(): Promise<void> { |     async invalidateContent(): Promise<void> { | ||||||
|         await AddonBlockRecentlyAccessedItems.invalidateRecentItems(); |         await AddonBlockRecentlyAccessedItems.invalidateRecentItems(); | ||||||
| @ -67,7 +67,7 @@ export class AddonBlockRecentlyAccessedItemsComponent extends CoreBlockBaseCompo | |||||||
|     /** |     /** | ||||||
|      * Fetch the data to render the block. |      * Fetch the data to render the block. | ||||||
|      * |      * | ||||||
|      * @return Promise resolved when done. |      * @returns Promise resolved when done. | ||||||
|      */ |      */ | ||||||
|     protected async fetchContent(): Promise<void> { |     protected async fetchContent(): Promise<void> { | ||||||
|         this.items = await AddonBlockRecentlyAccessedItems.getRecentItems(); |         this.items = await AddonBlockRecentlyAccessedItems.getRecentItems(); | ||||||
| @ -78,6 +78,7 @@ export class AddonBlockRecentlyAccessedItemsComponent extends CoreBlockBaseCompo | |||||||
|      * |      * | ||||||
|      * @param e Click event. |      * @param e Click event. | ||||||
|      * @param item Activity item info. |      * @param item Activity item info. | ||||||
|  |      * @returns Promise resolved when done. | ||||||
|      */ |      */ | ||||||
|     async action(e: Event, item: AddonBlockRecentlyAccessedItemsItem): Promise<void> { |     async action(e: Event, item: AddonBlockRecentlyAccessedItemsItem): Promise<void> { | ||||||
|         e.preventDefault(); |         e.preventDefault(); | ||||||
|  | |||||||
| @ -28,12 +28,7 @@ export class AddonBlockRecentlyAccessedItemsHandlerService extends CoreBlockBase | |||||||
|     blockName = 'recentlyaccesseditems'; |     blockName = 'recentlyaccesseditems'; | ||||||
| 
 | 
 | ||||||
|     /** |     /** | ||||||
|      * Returns the data needed to render the block. |      * @inheritdoc | ||||||
|      * |  | ||||||
|      * @param block The block to render. |  | ||||||
|      * @param contextLevel The context where the block will be used. |  | ||||||
|      * @param instanceId The instance ID associated with the context level. |  | ||||||
|      * @return Data or promise resolved with the data. |  | ||||||
|      */ |      */ | ||||||
|     getDisplayData(): CoreBlockHandlerData{ |     getDisplayData(): CoreBlockHandlerData{ | ||||||
| 
 | 
 | ||||||
|  | |||||||
| @ -30,7 +30,7 @@ export class AddonBlockRecentlyAccessedItemsProvider { | |||||||
|     /** |     /** | ||||||
|      * Get cache key for get last accessed items value WS call. |      * Get cache key for get last accessed items value WS call. | ||||||
|      * |      * | ||||||
|      * @return Cache key. |      * @returns Cache key. | ||||||
|      */ |      */ | ||||||
|     protected getRecentItemsCacheKey(): string { |     protected getRecentItemsCacheKey(): string { | ||||||
|         return ROOT_CACHE_KEY + ':recentitems'; |         return ROOT_CACHE_KEY + ':recentitems'; | ||||||
| @ -40,7 +40,7 @@ export class AddonBlockRecentlyAccessedItemsProvider { | |||||||
|      * Get last accessed items. |      * Get last accessed items. | ||||||
|      * |      * | ||||||
|      * @param siteId Site ID. If not defined, use current site. |      * @param siteId Site ID. If not defined, use current site. | ||||||
|      * @return Promise resolved when the info is retrieved. |      * @returns Promise resolved when the info is retrieved. | ||||||
|      */ |      */ | ||||||
|     async getRecentItems(siteId?: string): Promise<AddonBlockRecentlyAccessedItemsItem[]> { |     async getRecentItems(siteId?: string): Promise<AddonBlockRecentlyAccessedItemsItem[]> { | ||||||
|         const site = await CoreSites.getSite(siteId); |         const site = await CoreSites.getSite(siteId); | ||||||
| @ -90,7 +90,7 @@ export class AddonBlockRecentlyAccessedItemsProvider { | |||||||
|      * Invalidates get last accessed items WS call. |      * Invalidates get last accessed items WS call. | ||||||
|      * |      * | ||||||
|      * @param siteId Site ID to invalidate. If not defined, use current site. |      * @param siteId Site ID to invalidate. If not defined, use current site. | ||||||
|      * @return Promise resolved when the data is invalidated. |      * @returns Promise resolved when the data is invalidated. | ||||||
|      */ |      */ | ||||||
|     async invalidateRecentItems(siteId?: string): Promise<void> { |     async invalidateRecentItems(siteId?: string): Promise<void> { | ||||||
|         const site = await CoreSites.getSite(siteId); |         const site = await CoreSites.getSite(siteId); | ||||||
|  | |||||||
| @ -33,7 +33,7 @@ export class AddonBlockRssClientHandlerService extends CoreBlockBaseHandler { | |||||||
|      * Returns the data needed to render the block. |      * Returns the data needed to render the block. | ||||||
|      * |      * | ||||||
|      * @param block The block to render. |      * @param block The block to render. | ||||||
|      * @return Data or promise resolved with the data. |      * @returns Data or promise resolved with the data. | ||||||
|      */ |      */ | ||||||
|     getDisplayData(block: CoreCourseBlock): CoreBlockHandlerData { |     getDisplayData(block: CoreCourseBlock): CoreBlockHandlerData { | ||||||
| 
 | 
 | ||||||
|  | |||||||
| @ -40,7 +40,7 @@ export class AddonBlockSiteMainMenuComponent extends CoreBlockBaseComponent impl | |||||||
|     } |     } | ||||||
| 
 | 
 | ||||||
|     /** |     /** | ||||||
|      * Component being initialized. |      * @inheritdoc | ||||||
|      */ |      */ | ||||||
|     async ngOnInit(): Promise<void> { |     async ngOnInit(): Promise<void> { | ||||||
|         this.siteHomeId = CoreSites.getCurrentSiteHomeId(); |         this.siteHomeId = CoreSites.getCurrentSiteHomeId(); | ||||||
| @ -51,7 +51,7 @@ export class AddonBlockSiteMainMenuComponent extends CoreBlockBaseComponent impl | |||||||
|     /** |     /** | ||||||
|      * Perform the invalidate content function. |      * Perform the invalidate content function. | ||||||
|      * |      * | ||||||
|      * @return Resolved when done. |      * @returns Resolved when done. | ||||||
|      */ |      */ | ||||||
|     async invalidateContent(): Promise<void> { |     async invalidateContent(): Promise<void> { | ||||||
|         const promises: Promise<void>[] = []; |         const promises: Promise<void>[] = []; | ||||||
| @ -70,7 +70,7 @@ export class AddonBlockSiteMainMenuComponent extends CoreBlockBaseComponent impl | |||||||
|     /** |     /** | ||||||
|      * Fetch the data to render the block. |      * Fetch the data to render the block. | ||||||
|      * |      * | ||||||
|      * @return Promise resolved when done. |      * @returns Promise resolved when done. | ||||||
|      */ |      */ | ||||||
|     protected async fetchContent(): Promise<void> { |     protected async fetchContent(): Promise<void> { | ||||||
|         const sections = await CoreCourse.getSections(this.siteHomeId, false, true); |         const sections = await CoreCourse.getSections(this.siteHomeId, false, true); | ||||||
|  | |||||||
| @ -30,7 +30,7 @@ export class AddonBlockSiteMainMenuHandlerService extends CoreBlockBaseHandler { | |||||||
|     /** |     /** | ||||||
|      * Returns the data needed to render the block. |      * Returns the data needed to render the block. | ||||||
|      * |      * | ||||||
|      * @return Data or promise resolved with the data. |      * @returns Data or promise resolved with the data. | ||||||
|      */ |      */ | ||||||
|     getDisplayData(): CoreBlockHandlerData { |     getDisplayData(): CoreBlockHandlerData { | ||||||
| 
 | 
 | ||||||
|  | |||||||
| @ -84,7 +84,7 @@ export class AddonBlockStarredCoursesComponent extends CoreBlockBaseComponent im | |||||||
|     /** |     /** | ||||||
|      * Invalidate list of courses. |      * Invalidate list of courses. | ||||||
|      * |      * | ||||||
|      * @return Promise resolved when done. |      * @returns Promise resolved when done. | ||||||
|      */ |      */ | ||||||
|     protected async invalidateCourseList(): Promise<void> { |     protected async invalidateCourseList(): Promise<void> { | ||||||
|         return AddonBlockStarredCourses.invalidateStarredCourses(); |         return AddonBlockStarredCourses.invalidateStarredCourses(); | ||||||
| @ -94,7 +94,7 @@ export class AddonBlockStarredCoursesComponent extends CoreBlockBaseComponent im | |||||||
|      * Helper function to invalidate only selected courses. |      * Helper function to invalidate only selected courses. | ||||||
|      * |      * | ||||||
|      * @param courseIds Course Id array. |      * @param courseIds Course Id array. | ||||||
|      * @return Promise resolved when done. |      * @returns Promise resolved when done. | ||||||
|      */ |      */ | ||||||
|     protected async invalidateCourses(courseIds: number[]): Promise<void> { |     protected async invalidateCourses(courseIds: number[]): Promise<void> { | ||||||
|         const promises: Promise<void>[] = []; |         const promises: Promise<void>[] = []; | ||||||
| @ -153,7 +153,7 @@ export class AddonBlockStarredCoursesComponent extends CoreBlockBaseComponent im | |||||||
|      * Refresh course list based on a EVENT_MY_COURSES_UPDATED event. |      * Refresh course list based on a EVENT_MY_COURSES_UPDATED event. | ||||||
|      * |      * | ||||||
|      * @param data Event data. |      * @param data Event data. | ||||||
|      * @return Promise resolved when done. |      * @returns Promise resolved when done. | ||||||
|      */ |      */ | ||||||
|     protected async refreshCourseList(data: CoreCoursesMyCoursesUpdatedEventData): Promise<void> { |     protected async refreshCourseList(data: CoreCoursesMyCoursesUpdatedEventData): Promise<void> { | ||||||
|         if (data.action == CoreCoursesProvider.ACTION_ENROL) { |         if (data.action == CoreCoursesProvider.ACTION_ENROL) { | ||||||
|  | |||||||
| @ -30,7 +30,7 @@ export class AddonBlockStarredCoursesHandlerService extends CoreBlockBaseHandler | |||||||
|     /** |     /** | ||||||
|      * Returns the data needed to render the block. |      * Returns the data needed to render the block. | ||||||
|      * |      * | ||||||
|      * @return Data or promise resolved with the data. |      * @returns Data or promise resolved with the data. | ||||||
|      */ |      */ | ||||||
|     getDisplayData(): CoreBlockHandlerData { |     getDisplayData(): CoreBlockHandlerData { | ||||||
| 
 | 
 | ||||||
|  | |||||||
| @ -28,7 +28,7 @@ export class AddonBlockStarredCoursesProvider { | |||||||
|     /** |     /** | ||||||
|      * Get cache key for get starred courrses value WS call. |      * Get cache key for get starred courrses value WS call. | ||||||
|      * |      * | ||||||
|      * @return Cache key. |      * @returns Cache key. | ||||||
|      */ |      */ | ||||||
|     protected getStarredCoursesCacheKey(): string { |     protected getStarredCoursesCacheKey(): string { | ||||||
|         return ROOT_CACHE_KEY + ':starredcourses'; |         return ROOT_CACHE_KEY + ':starredcourses'; | ||||||
| @ -38,7 +38,7 @@ export class AddonBlockStarredCoursesProvider { | |||||||
|      * Get starred courrses. |      * Get starred courrses. | ||||||
|      * |      * | ||||||
|      * @param siteId Site ID. If not defined, use current site. |      * @param siteId Site ID. If not defined, use current site. | ||||||
|      * @return Promise resolved when the info is retrieved. |      * @returns Promise resolved when the info is retrieved. | ||||||
|      */ |      */ | ||||||
|     async getStarredCourses(siteId?: string): Promise<AddonBlockStarredCourse[]> { |     async getStarredCourses(siteId?: string): Promise<AddonBlockStarredCourse[]> { | ||||||
|         const site = await CoreSites.getSite(siteId); |         const site = await CoreSites.getSite(siteId); | ||||||
| @ -54,7 +54,7 @@ export class AddonBlockStarredCoursesProvider { | |||||||
|      * Invalidates get starred courrses WS call. |      * Invalidates get starred courrses WS call. | ||||||
|      * |      * | ||||||
|      * @param siteId Site ID to invalidate. If not defined, use current site. |      * @param siteId Site ID to invalidate. If not defined, use current site. | ||||||
|      * @return Promise resolved when the data is invalidated. |      * @returns Promise resolved when the data is invalidated. | ||||||
|      */ |      */ | ||||||
|     async invalidateStarredCourses(siteId?: string): Promise<void> { |     async invalidateStarredCourses(siteId?: string): Promise<void> { | ||||||
|         const site = await CoreSites.getSite(siteId); |         const site = await CoreSites.getSite(siteId); | ||||||
|  | |||||||
| @ -31,7 +31,7 @@ export class AddonBlockTagsHandlerService extends CoreBlockBaseHandler { | |||||||
|     /** |     /** | ||||||
|      * Returns the data needed to render the block. |      * Returns the data needed to render the block. | ||||||
|      * |      * | ||||||
|      * @return Data or promise resolved with the data. |      * @returns Data or promise resolved with the data. | ||||||
|      */ |      */ | ||||||
|     getDisplayData(): CoreBlockHandlerData { |     getDisplayData(): CoreBlockHandlerData { | ||||||
| 
 | 
 | ||||||
|  | |||||||
| @ -42,6 +42,7 @@ export class AddonBlockTimelineEventsComponent { | |||||||
|      * |      * | ||||||
|      * @param event Click event. |      * @param event Click event. | ||||||
|      * @param url Url of the action. |      * @param url Url of the action. | ||||||
|  |      * @returns Promise resolved when done. | ||||||
|      */ |      */ | ||||||
|     async action(event: Event, url: string): Promise<void> { |     async action(event: Event, url: string): Promise<void> { | ||||||
|         event.preventDefault(); |         event.preventDefault(); | ||||||
|  | |||||||
| @ -33,7 +33,7 @@ export class AddonBlockTimelineHandlerService extends CoreBlockBaseHandler { | |||||||
|     /** |     /** | ||||||
|      * Check if the handler is enabled on a site level. |      * Check if the handler is enabled on a site level. | ||||||
|      * |      * | ||||||
|      * @return Whether or not the handler is enabled on a site level. |      * @returns Whether or not the handler is enabled on a site level. | ||||||
|      */ |      */ | ||||||
|     async isEnabled(): Promise<boolean> { |     async isEnabled(): Promise<boolean> { | ||||||
|         const enabled = !CoreCoursesDashboard.isDisabledInSite(); |         const enabled = !CoreCoursesDashboard.isDisabledInSite(); | ||||||
| @ -46,7 +46,7 @@ export class AddonBlockTimelineHandlerService extends CoreBlockBaseHandler { | |||||||
|     /** |     /** | ||||||
|      * Returns the data needed to render the block. |      * Returns the data needed to render the block. | ||||||
|      * |      * | ||||||
|      * @return Data or promise resolved with the data. |      * @returns Data or promise resolved with the data. | ||||||
|      */ |      */ | ||||||
|     getDisplayData(): CoreBlockHandlerData { |     getDisplayData(): CoreBlockHandlerData { | ||||||
| 
 | 
 | ||||||
|  | |||||||
| @ -45,7 +45,7 @@ export class AddonBlockTimelineProvider { | |||||||
|      * @param afterEventId The last seen event id. |      * @param afterEventId The last seen event id. | ||||||
|      * @param searchValue The value a user wishes to search against. |      * @param searchValue The value a user wishes to search against. | ||||||
|      * @param siteId Site ID. If not defined, use current site. |      * @param siteId Site ID. If not defined, use current site. | ||||||
|      * @return Promise resolved when the info is retrieved. |      * @returns Promise resolved when the info is retrieved. | ||||||
|      */ |      */ | ||||||
|     async getActionEventsByCourse( |     async getActionEventsByCourse( | ||||||
|         courseId: number, |         courseId: number, | ||||||
| @ -88,7 +88,7 @@ export class AddonBlockTimelineProvider { | |||||||
|      * Get cache key for get calendar action events for the given course value WS call. |      * Get cache key for get calendar action events for the given course value WS call. | ||||||
|      * |      * | ||||||
|      * @param courseId Only events in this course. |      * @param courseId Only events in this course. | ||||||
|      * @return Cache key. |      * @returns Cache key. | ||||||
|      */ |      */ | ||||||
|     protected getActionEventsByCourseCacheKey(courseId: number): string { |     protected getActionEventsByCourseCacheKey(courseId: number): string { | ||||||
|         return this.getActionEventsByCoursesCacheKey() + ':' + courseId; |         return this.getActionEventsByCoursesCacheKey() + ':' + courseId; | ||||||
| @ -98,9 +98,9 @@ export class AddonBlockTimelineProvider { | |||||||
|      * Get calendar action events for a given list of courses. |      * Get calendar action events for a given list of courses. | ||||||
|      * |      * | ||||||
|      * @param courseIds Course IDs. |      * @param courseIds Course IDs. | ||||||
|      * @param siteId Site ID. If not defined, use current site. |  | ||||||
|      * @param searchValue The value a user wishes to search against. |      * @param searchValue The value a user wishes to search against. | ||||||
|      * @return Promise resolved when the info is retrieved. |      * @param siteId Site ID. If not defined, use current site. | ||||||
|  |      * @returns Promise resolved when the info is retrieved. | ||||||
|      */ |      */ | ||||||
|     async getActionEventsByCourses( |     async getActionEventsByCourses( | ||||||
|         courseIds: number[], |         courseIds: number[], | ||||||
| @ -147,7 +147,7 @@ export class AddonBlockTimelineProvider { | |||||||
|     /** |     /** | ||||||
|      * Get cache key for get calendar action events for a given list of courses value WS call. |      * Get cache key for get calendar action events for a given list of courses value WS call. | ||||||
|      * |      * | ||||||
|      * @return Cache key. |      * @returns Cache key. | ||||||
|      */ |      */ | ||||||
|     protected getActionEventsByCoursesCacheKey(): string { |     protected getActionEventsByCoursesCacheKey(): string { | ||||||
|         return ROOT_CACHE_KEY + 'bycourse'; |         return ROOT_CACHE_KEY + 'bycourse'; | ||||||
| @ -159,7 +159,7 @@ export class AddonBlockTimelineProvider { | |||||||
|      * @param afterEventId The last seen event id. |      * @param afterEventId The last seen event id. | ||||||
|      * @param searchValue The value a user wishes to search against. |      * @param searchValue The value a user wishes to search against. | ||||||
|      * @param siteId Site ID. If not defined, use current site. |      * @param siteId Site ID. If not defined, use current site. | ||||||
|      * @return Promise resolved when the info is retrieved. |      * @returns Promise resolved when the info is retrieved. | ||||||
|      */ |      */ | ||||||
|     async getActionEventsByTimesort( |     async getActionEventsByTimesort( | ||||||
|         afterEventId?: number, |         afterEventId?: number, | ||||||
| @ -211,7 +211,7 @@ export class AddonBlockTimelineProvider { | |||||||
|     /** |     /** | ||||||
|      * Get prefix cache key for calendar action events based on the timesort value WS calls. |      * Get prefix cache key for calendar action events based on the timesort value WS calls. | ||||||
|      * |      * | ||||||
|      * @return Cache key. |      * @returns Cache key. | ||||||
|      */ |      */ | ||||||
|     protected getActionEventsByTimesortPrefixCacheKey(): string { |     protected getActionEventsByTimesortPrefixCacheKey(): string { | ||||||
|         return ROOT_CACHE_KEY + 'bytimesort:'; |         return ROOT_CACHE_KEY + 'bytimesort:'; | ||||||
| @ -222,7 +222,7 @@ export class AddonBlockTimelineProvider { | |||||||
|      * |      * | ||||||
|      * @param afterEventId The last seen event id. |      * @param afterEventId The last seen event id. | ||||||
|      * @param limit Limit num of the call. |      * @param limit Limit num of the call. | ||||||
|      * @return Cache key. |      * @returns Cache key. | ||||||
|      */ |      */ | ||||||
|     protected getActionEventsByTimesortCacheKey(afterEventId?: number, limit?: number): string { |     protected getActionEventsByTimesortCacheKey(afterEventId?: number, limit?: number): string { | ||||||
|         afterEventId = afterEventId || 0; |         afterEventId = afterEventId || 0; | ||||||
| @ -235,7 +235,7 @@ export class AddonBlockTimelineProvider { | |||||||
|      * Invalidates get calendar action events for a given list of courses WS call. |      * Invalidates get calendar action events for a given list of courses WS call. | ||||||
|      * |      * | ||||||
|      * @param siteId Site ID to invalidate. If not defined, use current site. |      * @param siteId Site ID to invalidate. If not defined, use current site. | ||||||
|      * @return Promise resolved when the data is invalidated. |      * @returns Promise resolved when the data is invalidated. | ||||||
|      */ |      */ | ||||||
|     async invalidateActionEventsByCourses(siteId?: string): Promise<void> { |     async invalidateActionEventsByCourses(siteId?: string): Promise<void> { | ||||||
|         const site = await CoreSites.getSite(siteId); |         const site = await CoreSites.getSite(siteId); | ||||||
| @ -247,7 +247,7 @@ export class AddonBlockTimelineProvider { | |||||||
|      * Invalidates get calendar action events based on the timesort value WS call. |      * Invalidates get calendar action events based on the timesort value WS call. | ||||||
|      * |      * | ||||||
|      * @param siteId Site ID to invalidate. If not defined, use current site. |      * @param siteId Site ID to invalidate. If not defined, use current site. | ||||||
|      * @return Promise resolved when the data is invalidated. |      * @returns Promise resolved when the data is invalidated. | ||||||
|      */ |      */ | ||||||
|     async invalidateActionEventsByTimesort(siteId?: string): Promise<void> { |     async invalidateActionEventsByTimesort(siteId?: string): Promise<void> { | ||||||
|         const site = await CoreSites.getSite(siteId); |         const site = await CoreSites.getSite(siteId); | ||||||
| @ -260,7 +260,7 @@ export class AddonBlockTimelineProvider { | |||||||
|      * |      * | ||||||
|      * @param course Object containing response course events info. |      * @param course Object containing response course events info. | ||||||
|      * @param timeFrom Current time to filter events from. |      * @param timeFrom Current time to filter events from. | ||||||
|      * @return Object with course events and last loaded event id if more can be loaded. |      * @returns Object with course events and last loaded event id if more can be loaded. | ||||||
|      */ |      */ | ||||||
|     protected treatCourseEvents( |     protected treatCourseEvents( | ||||||
|         course: AddonCalendarEvents, |         course: AddonCalendarEvents, | ||||||
| @ -283,7 +283,7 @@ export class AddonBlockTimelineProvider { | |||||||
|      * Returns the timestamp at the start of the day with an optional offset. |      * Returns the timestamp at the start of the day with an optional offset. | ||||||
|      * |      * | ||||||
|      * @param daysOffset Offset days to add or substract. |      * @param daysOffset Offset days to add or substract. | ||||||
|      * @return timestamp. |      * @returns timestamp. | ||||||
|      */ |      */ | ||||||
|     getDayStart(daysOffset = 0): number { |     getDayStart(daysOffset = 0): number { | ||||||
|         return moment().startOf('day').add(daysOffset, 'days').unix(); |         return moment().startOf('day').add(daysOffset, 'days').unix(); | ||||||
|  | |||||||
| @ -131,7 +131,7 @@ export class AddonBlogEntriesPage implements OnInit { | |||||||
|      * Fetch blog entries. |      * Fetch blog entries. | ||||||
|      * |      * | ||||||
|      * @param refresh Empty events array first. |      * @param refresh Empty events array first. | ||||||
|      * @return Promise with the entries. |      * @returns Promise with the entries. | ||||||
|      */ |      */ | ||||||
|     protected async fetchEntries(refresh: boolean = false): Promise<void> { |     protected async fetchEntries(refresh: boolean = false): Promise<void> { | ||||||
|         this.loadMoreError = false; |         this.loadMoreError = false; | ||||||
| @ -240,7 +240,7 @@ export class AddonBlogEntriesPage implements OnInit { | |||||||
|      * Function to load more entries. |      * Function to load more entries. | ||||||
|      * |      * | ||||||
|      * @param infiniteComplete Infinite scroll complete function. Only used from core-infinite-loading. |      * @param infiniteComplete Infinite scroll complete function. Only used from core-infinite-loading. | ||||||
|      * @return Resolved when done. |      * @returns Resolved when done. | ||||||
|      */ |      */ | ||||||
|     loadMore(infiniteComplete?: () => void): Promise<void> { |     loadMore(infiniteComplete?: () => void): Promise<void> { | ||||||
|         return this.fetchEntries().finally(() => { |         return this.fetchEntries().finally(() => { | ||||||
|  | |||||||
| @ -39,7 +39,7 @@ export class AddonBlogProvider { | |||||||
|      * check, we should not be calling WS from here. |      * check, we should not be calling WS from here. | ||||||
|      * |      * | ||||||
|      * @param siteId Site ID. If not defined, current site. |      * @param siteId Site ID. If not defined, current site. | ||||||
|      * @return Promise resolved with true if enabled, resolved with false or rejected otherwise. |      * @returns Promise resolved with true if enabled, resolved with false or rejected otherwise. | ||||||
|      * @since 3.6 |      * @since 3.6 | ||||||
|      */ |      */ | ||||||
|     async isPluginEnabled(siteId?: string): Promise<boolean> { |     async isPluginEnabled(siteId?: string): Promise<boolean> { | ||||||
| @ -52,7 +52,7 @@ export class AddonBlogProvider { | |||||||
|      * Get the cache key for the blog entries. |      * Get the cache key for the blog entries. | ||||||
|      * |      * | ||||||
|      * @param filter Filter to apply on search. |      * @param filter Filter to apply on search. | ||||||
|      * @return Cache key. |      * @returns Cache key. | ||||||
|      */ |      */ | ||||||
|     getEntriesCacheKey(filter: AddonBlogFilter = {}): string { |     getEntriesCacheKey(filter: AddonBlogFilter = {}): string { | ||||||
|         return ROOT_CACHE_KEY + CoreUtils.sortAndStringify(filter); |         return ROOT_CACHE_KEY + CoreUtils.sortAndStringify(filter); | ||||||
| @ -64,7 +64,7 @@ export class AddonBlogProvider { | |||||||
|      * @param filter Filter to apply on search. |      * @param filter Filter to apply on search. | ||||||
|      * @param page Page of the blog entries to fetch. |      * @param page Page of the blog entries to fetch. | ||||||
|      * @param siteId Site ID. If not defined, current site. |      * @param siteId Site ID. If not defined, current site. | ||||||
|      * @return Promise to be resolved when the entries are retrieved. |      * @returns Promise to be resolved when the entries are retrieved. | ||||||
|      */ |      */ | ||||||
|     async getEntries(filter: AddonBlogFilter = {}, page: number = 0, siteId?: string): Promise<CoreBlogGetEntriesWSResponse> { |     async getEntries(filter: AddonBlogFilter = {}, page: number = 0, siteId?: string): Promise<CoreBlogGetEntriesWSResponse> { | ||||||
|         const site = await CoreSites.getSite(siteId); |         const site = await CoreSites.getSite(siteId); | ||||||
| @ -88,7 +88,7 @@ export class AddonBlogProvider { | |||||||
|      * |      * | ||||||
|      * @param filter Filter to apply on search |      * @param filter Filter to apply on search | ||||||
|      * @param siteId Site ID. If not defined, current site. |      * @param siteId Site ID. If not defined, current site. | ||||||
|      * @return Promise resolved when data is invalidated. |      * @returns Promise resolved when data is invalidated. | ||||||
|      */ |      */ | ||||||
|     async invalidateEntries(filter: AddonBlogFilter = {}, siteId?: string): Promise<void> { |     async invalidateEntries(filter: AddonBlogFilter = {}, siteId?: string): Promise<void> { | ||||||
|         const site = await CoreSites.getSite(siteId); |         const site = await CoreSites.getSite(siteId); | ||||||
| @ -101,7 +101,7 @@ export class AddonBlogProvider { | |||||||
|      * |      * | ||||||
|      * @param filter Filter to apply on search. |      * @param filter Filter to apply on search. | ||||||
|      * @param siteId Site ID. If not defined, current site. |      * @param siteId Site ID. If not defined, current site. | ||||||
|      * @return Promise to be resolved when done. |      * @returns Promise to be resolved when done. | ||||||
|      */ |      */ | ||||||
|     async logView(filter: AddonBlogFilter = {}, siteId?: string): Promise<CoreStatusWithWarningsWSResponse> { |     async logView(filter: AddonBlogFilter = {}, siteId?: string): Promise<CoreStatusWithWarningsWSResponse> { | ||||||
|         CorePushNotifications.logViewListEvent('blog', 'core_blog_view_entries', filter, siteId); |         CorePushNotifications.logViewListEvent('blog', 'core_blog_view_entries', filter, siteId); | ||||||
|  | |||||||
| @ -169,7 +169,7 @@ export class AddonCalendarCalendarComponent implements OnInit, DoCheck, OnDestro | |||||||
|     /** |     /** | ||||||
|      * Fetch contacts. |      * Fetch contacts. | ||||||
|      * |      * | ||||||
|      * @return Promise resolved when done. |      * @returns Promise resolved when done. | ||||||
|      */ |      */ | ||||||
|     async fetchData(): Promise<void> { |     async fetchData(): Promise<void> { | ||||||
|         try { |         try { | ||||||
| @ -200,7 +200,7 @@ export class AddonCalendarCalendarComponent implements OnInit, DoCheck, OnDestro | |||||||
|      * Refresh events. |      * Refresh events. | ||||||
|      * |      * | ||||||
|      * @param afterChange Whether the refresh is done after an event has changed or has been synced. |      * @param afterChange Whether the refresh is done after an event has changed or has been synced. | ||||||
|      * @return Promise resolved when done. |      * @returns Promise resolved when done. | ||||||
|      */ |      */ | ||||||
|     async refreshData(afterChange = false): Promise<void> { |     async refreshData(afterChange = false): Promise<void> { | ||||||
|         const selectedMonth = this.manager?.getSelectedItem() || null; |         const selectedMonth = this.manager?.getSelectedItem() || null; | ||||||
| @ -264,6 +264,8 @@ export class AddonCalendarCalendarComponent implements OnInit, DoCheck, OnDestro | |||||||
| 
 | 
 | ||||||
|     /** |     /** | ||||||
|      * Check whether selected month is loaded. |      * Check whether selected month is loaded. | ||||||
|  |      * | ||||||
|  |      * @returns If selected month has been loaded. | ||||||
|      */ |      */ | ||||||
|     selectedMonthLoaded(): boolean { |     selectedMonthLoaded(): boolean { | ||||||
|         return !!this.manager?.getSelectedItem()?.loaded; |         return !!this.manager?.getSelectedItem()?.loaded; | ||||||
| @ -271,6 +273,8 @@ export class AddonCalendarCalendarComponent implements OnInit, DoCheck, OnDestro | |||||||
| 
 | 
 | ||||||
|     /** |     /** | ||||||
|      * Check whether selected month is current month. |      * Check whether selected month is current month. | ||||||
|  |      * | ||||||
|  |      * @returns If selected month is the current. | ||||||
|      */ |      */ | ||||||
|     selectedMonthIsCurrent(): boolean { |     selectedMonthIsCurrent(): boolean { | ||||||
|         return !!this.manager?.getSelectedItem()?.isCurrentMonth; |         return !!this.manager?.getSelectedItem()?.isCurrentMonth; | ||||||
| @ -387,7 +391,7 @@ class AddonCalendarMonthSlidesItemsManagerSource extends CoreSwipeSlidesDynamicI | |||||||
|     /** |     /** | ||||||
|      * Fetch data. |      * Fetch data. | ||||||
|      * |      * | ||||||
|      * @return Promise resolved when done. |      * @returns Promise resolved when done. | ||||||
|      */ |      */ | ||||||
|     async fetchData(): Promise<void> { |     async fetchData(): Promise<void> { | ||||||
|         await Promise.all([ |         await Promise.all([ | ||||||
| @ -422,7 +426,7 @@ class AddonCalendarMonthSlidesItemsManagerSource extends CoreSwipeSlidesDynamicI | |||||||
|     /** |     /** | ||||||
|      * Load categories to be able to filter events. |      * Load categories to be able to filter events. | ||||||
|      * |      * | ||||||
|      * @return Promise resolved when done. |      * @returns Promise resolved when done. | ||||||
|      */ |      */ | ||||||
|     async loadCategories(): Promise<void> { |     async loadCategories(): Promise<void> { | ||||||
|         if (this.categories) { |         if (this.categories) { | ||||||
| @ -443,7 +447,7 @@ class AddonCalendarMonthSlidesItemsManagerSource extends CoreSwipeSlidesDynamicI | |||||||
|     /** |     /** | ||||||
|      * Load events created or edited in offline. |      * Load events created or edited in offline. | ||||||
|      * |      * | ||||||
|      * @return Promise resolved when done. |      * @returns Promise resolved when done. | ||||||
|      */ |      */ | ||||||
|     async loadOfflineEvents(): Promise<void> { |     async loadOfflineEvents(): Promise<void> { | ||||||
|         // Get offline events.
 |         // Get offline events.
 | ||||||
| @ -459,7 +463,7 @@ class AddonCalendarMonthSlidesItemsManagerSource extends CoreSwipeSlidesDynamicI | |||||||
|     /** |     /** | ||||||
|      * Load events deleted in offline. |      * Load events deleted in offline. | ||||||
|      * |      * | ||||||
|      * @return Promise resolved when done. |      * @returns Promise resolved when done. | ||||||
|      */ |      */ | ||||||
|     async loadOfflineDeletedEvents(): Promise<void> { |     async loadOfflineDeletedEvents(): Promise<void> { | ||||||
|         this.deletedEvents = await AddonCalendarOffline.getAllDeletedEventsIds(); |         this.deletedEvents = await AddonCalendarOffline.getAllDeletedEventsIds(); | ||||||
| @ -468,7 +472,7 @@ class AddonCalendarMonthSlidesItemsManagerSource extends CoreSwipeSlidesDynamicI | |||||||
|     /** |     /** | ||||||
|      * Load time format. |      * Load time format. | ||||||
|      * |      * | ||||||
|      * @return Promise resolved when done. |      * @returns Promise resolved when done. | ||||||
|      */ |      */ | ||||||
|     async loadTimeFormat(): Promise<void> { |     async loadTimeFormat(): Promise<void> { | ||||||
|         this.timeFormat = await AddonCalendar.getCalendarTimeFormat(); |         this.timeFormat = await AddonCalendar.getCalendarTimeFormat(); | ||||||
| @ -612,7 +616,7 @@ class AddonCalendarMonthSlidesItemsManagerSource extends CoreSwipeSlidesDynamicI | |||||||
|      * |      * | ||||||
|      * @param event Event object. |      * @param event Event object. | ||||||
|      * @param currentTime Current time. |      * @param currentTime Current time. | ||||||
|      * @return True if it's in the past. |      * @returns True if it's in the past. | ||||||
|      */ |      */ | ||||||
|     isEventPast(event: { timestart: number; timeduration: number}, currentTime: number): boolean { |     isEventPast(event: { timestart: number; timeduration: number}, currentTime: number): boolean { | ||||||
|         return (event.timestart + event.timeduration) < currentTime; |         return (event.timestart + event.timeduration) < currentTime; | ||||||
| @ -622,7 +626,7 @@ class AddonCalendarMonthSlidesItemsManagerSource extends CoreSwipeSlidesDynamicI | |||||||
|      * Invalidate content. |      * Invalidate content. | ||||||
|      * |      * | ||||||
|      * @param selectedMonth The current selected month. |      * @param selectedMonth The current selected month. | ||||||
|      * @return Promise resolved when done. |      * @returns Promise resolved when done. | ||||||
|      */ |      */ | ||||||
|     async invalidateContent(selectedMonth: PreloadedMonth | null): Promise<void> { |     async invalidateContent(selectedMonth: PreloadedMonth | null): Promise<void> { | ||||||
|         const promises: Promise<void>[] = []; |         const promises: Promise<void>[] = []; | ||||||
|  | |||||||
| @ -107,7 +107,7 @@ export class AddonCalendarUpcomingEventsComponent implements OnInit, DoCheck, On | |||||||
|     /** |     /** | ||||||
|      * Fetch data. |      * Fetch data. | ||||||
|      * |      * | ||||||
|      * @return Promise resolved when done. |      * @returns Promise resolved when done. | ||||||
|      */ |      */ | ||||||
|     async fetchData(): Promise<void> { |     async fetchData(): Promise<void> { | ||||||
|         const promises: Promise<void>[] = []; |         const promises: Promise<void>[] = []; | ||||||
| @ -160,7 +160,7 @@ export class AddonCalendarUpcomingEventsComponent implements OnInit, DoCheck, On | |||||||
|     /** |     /** | ||||||
|      * Fetch upcoming events. |      * Fetch upcoming events. | ||||||
|      * |      * | ||||||
|      * @return Promise resolved when done. |      * @returns Promise resolved when done. | ||||||
|      */ |      */ | ||||||
|     async fetchEvents(): Promise<void> { |     async fetchEvents(): Promise<void> { | ||||||
|         // Don't pass courseId and categoryId, we'll filter them locally.
 |         // Don't pass courseId and categoryId, we'll filter them locally.
 | ||||||
| @ -185,7 +185,7 @@ export class AddonCalendarUpcomingEventsComponent implements OnInit, DoCheck, On | |||||||
|     /** |     /** | ||||||
|      * Load categories to be able to filter events. |      * Load categories to be able to filter events. | ||||||
|      * |      * | ||||||
|      * @return Promise resolved when done. |      * @returns Promise resolved when done. | ||||||
|      */ |      */ | ||||||
|     protected async loadCategories(): Promise<void> { |     protected async loadCategories(): Promise<void> { | ||||||
|         if (this.categoriesRetrieved) { |         if (this.categoriesRetrieved) { | ||||||
| @ -217,7 +217,7 @@ export class AddonCalendarUpcomingEventsComponent implements OnInit, DoCheck, On | |||||||
|     /** |     /** | ||||||
|      * Refresh events. |      * Refresh events. | ||||||
|      * |      * | ||||||
|      * @return Promise resolved when done. |      * @returns Promise resolved when done. | ||||||
|      */ |      */ | ||||||
|     async refreshData(): Promise<void> { |     async refreshData(): Promise<void> { | ||||||
|         const promises: Promise<void>[] = []; |         const promises: Promise<void>[] = []; | ||||||
| @ -246,7 +246,7 @@ export class AddonCalendarUpcomingEventsComponent implements OnInit, DoCheck, On | |||||||
|     /** |     /** | ||||||
|      * Merge online events with the offline events of that period. |      * Merge online events with the offline events of that period. | ||||||
|      * |      * | ||||||
|      * @return Merged events. |      * @returns Merged events. | ||||||
|      */ |      */ | ||||||
|     protected mergeEvents(): AddonCalendarEventToDisplay[] { |     protected mergeEvents(): AddonCalendarEventToDisplay[] { | ||||||
|         if (!this.offlineEvents.length && !this.deletedEvents.length) { |         if (!this.offlineEvents.length && !this.deletedEvents.length) { | ||||||
|  | |||||||
| @ -232,8 +232,7 @@ export class AddonCalendarDayPage implements OnInit, OnDestroy { | |||||||
|      * Fetch all the data required for the view. |      * Fetch all the data required for the view. | ||||||
|      * |      * | ||||||
|      * @param sync Whether it should try to synchronize offline events. |      * @param sync Whether it should try to synchronize offline events. | ||||||
|      * @param showErrors Whether to show sync errors to the user. |      * @returns Promise resolved when done. | ||||||
|      * @return Promise resolved when done. |  | ||||||
|      */ |      */ | ||||||
|     async fetchData(sync?: boolean): Promise<void> { |     async fetchData(sync?: boolean): Promise<void> { | ||||||
|         this.syncIcon = CoreConstants.ICON_LOADING; |         this.syncIcon = CoreConstants.ICON_LOADING; | ||||||
| @ -272,7 +271,7 @@ export class AddonCalendarDayPage implements OnInit, OnDestroy { | |||||||
|      * |      * | ||||||
|      * @param refresher Refresher. |      * @param refresher Refresher. | ||||||
|      * @param done Function to call when done. |      * @param done Function to call when done. | ||||||
|      * @return Promise resolved when done. |      * @returns Promise resolved when done. | ||||||
|      */ |      */ | ||||||
|     async doRefresh(refresher?: IonRefresher, done?: () => void): Promise<void> { |     async doRefresh(refresher?: IonRefresher, done?: () => void): Promise<void> { | ||||||
|         if (!this.loaded) { |         if (!this.loaded) { | ||||||
| @ -290,7 +289,7 @@ export class AddonCalendarDayPage implements OnInit, OnDestroy { | |||||||
|      * |      * | ||||||
|      * @param sync Whether it should try to synchronize offline events. |      * @param sync Whether it should try to synchronize offline events. | ||||||
|      * @param afterChange Whether the refresh is done after an event has changed or has been synced. |      * @param afterChange Whether the refresh is done after an event has changed or has been synced. | ||||||
|      * @return Promise resolved when done. |      * @returns Promise resolved when done. | ||||||
|      */ |      */ | ||||||
|     async refreshData(sync?: boolean, afterChange?: boolean): Promise<void> { |     async refreshData(sync?: boolean, afterChange?: boolean): Promise<void> { | ||||||
|         this.syncIcon = CoreConstants.ICON_LOADING; |         this.syncIcon = CoreConstants.ICON_LOADING; | ||||||
| @ -307,7 +306,7 @@ export class AddonCalendarDayPage implements OnInit, OnDestroy { | |||||||
|      * Try to synchronize offline events. |      * Try to synchronize offline events. | ||||||
|      * |      * | ||||||
|      * @param showErrors Whether to show sync errors to the user. |      * @param showErrors Whether to show sync errors to the user. | ||||||
|      * @return Promise resolved when done. |      * @returns Promise resolved when done. | ||||||
|      */ |      */ | ||||||
|     protected async sync(showErrors?: boolean): Promise<void> { |     protected async sync(showErrors?: boolean): Promise<void> { | ||||||
|         try { |         try { | ||||||
| @ -335,6 +334,8 @@ export class AddonCalendarDayPage implements OnInit, OnDestroy { | |||||||
| 
 | 
 | ||||||
|     /** |     /** | ||||||
|      * Check whether selected day is current day. |      * Check whether selected day is current day. | ||||||
|  |      * | ||||||
|  |      * @returns If selected day is current. | ||||||
|      */ |      */ | ||||||
|     selectedDayIsCurrent(): boolean { |     selectedDayIsCurrent(): boolean { | ||||||
|         return !!this.manager?.getSelectedItem()?.isCurrentDay; |         return !!this.manager?.getSelectedItem()?.isCurrentDay; | ||||||
| @ -393,7 +394,7 @@ export class AddonCalendarDayPage implements OnInit, OnDestroy { | |||||||
|     /** |     /** | ||||||
|      * Check whether selected day has offline data. |      * Check whether selected day has offline data. | ||||||
|      * |      * | ||||||
|      * @return Whether selected day has offline data. |      * @returns Whether selected day has offline data. | ||||||
|      */ |      */ | ||||||
|     selectedDayHasOffline(): boolean { |     selectedDayHasOffline(): boolean { | ||||||
|         const selectedDay = this.manager?.getSelectedItem(); |         const selectedDay = this.manager?.getSelectedItem(); | ||||||
| @ -510,7 +511,7 @@ class AddonCalendarDaySlidesItemsManagerSource extends CoreSwipeSlidesDynamicIte | |||||||
|      * Fetch data. |      * Fetch data. | ||||||
|      * |      * | ||||||
|      * @param courseId Current selected course id (if any). |      * @param courseId Current selected course id (if any). | ||||||
|      * @return Promise resolved when done. |      * @returns Promise resolved when done. | ||||||
|      */ |      */ | ||||||
|     async fetchData(courseId?: number): Promise<void> { |     async fetchData(courseId?: number): Promise<void> { | ||||||
|         await Promise.all([ |         await Promise.all([ | ||||||
| @ -548,7 +549,7 @@ class AddonCalendarDaySlidesItemsManagerSource extends CoreSwipeSlidesDynamicIte | |||||||
|      * Load courses. |      * Load courses. | ||||||
|      * |      * | ||||||
|      * @param courseId Current selected course id (if any). |      * @param courseId Current selected course id (if any). | ||||||
|      * @return Promise resolved when done. |      * @returns Promise resolved when done. | ||||||
|      */ |      */ | ||||||
|     async loadCourses(courseId?: number): Promise<void> { |     async loadCourses(courseId?: number): Promise<void> { | ||||||
|         const data = await CoreCoursesHelper.getCoursesForPopover(courseId); |         const data = await CoreCoursesHelper.getCoursesForPopover(courseId); | ||||||
| @ -560,7 +561,7 @@ class AddonCalendarDaySlidesItemsManagerSource extends CoreSwipeSlidesDynamicIte | |||||||
|      * Load whether user can create events. |      * Load whether user can create events. | ||||||
|      * |      * | ||||||
|      * @param courseId Current selected course id (if any). |      * @param courseId Current selected course id (if any). | ||||||
|      * @return Promise resolved when done. |      * @returns Promise resolved when done. | ||||||
|      */ |      */ | ||||||
|     async loadCanCreate(courseId?: number): Promise<void> { |     async loadCanCreate(courseId?: number): Promise<void> { | ||||||
|         this.canCreate = await AddonCalendarHelper.canEditEvents(courseId); |         this.canCreate = await AddonCalendarHelper.canEditEvents(courseId); | ||||||
| @ -569,7 +570,7 @@ class AddonCalendarDaySlidesItemsManagerSource extends CoreSwipeSlidesDynamicIte | |||||||
|     /** |     /** | ||||||
|      * Load categories to be able to filter events. |      * Load categories to be able to filter events. | ||||||
|      * |      * | ||||||
|      * @return Promise resolved when done. |      * @returns Promise resolved when done. | ||||||
|      */ |      */ | ||||||
|     async loadCategories(): Promise<void> { |     async loadCategories(): Promise<void> { | ||||||
|         if (this.categories) { |         if (this.categories) { | ||||||
| @ -590,7 +591,7 @@ class AddonCalendarDaySlidesItemsManagerSource extends CoreSwipeSlidesDynamicIte | |||||||
|     /** |     /** | ||||||
|      * Load events created or edited in offline. |      * Load events created or edited in offline. | ||||||
|      * |      * | ||||||
|      * @return Promise resolved when done. |      * @returns Promise resolved when done. | ||||||
|      */ |      */ | ||||||
|     async loadOfflineEvents(): Promise<void> { |     async loadOfflineEvents(): Promise<void> { | ||||||
|         // Get offline events.
 |         // Get offline events.
 | ||||||
| @ -606,7 +607,7 @@ class AddonCalendarDaySlidesItemsManagerSource extends CoreSwipeSlidesDynamicIte | |||||||
|     /** |     /** | ||||||
|      * Load events deleted in offline. |      * Load events deleted in offline. | ||||||
|      * |      * | ||||||
|      * @return Promise resolved when done. |      * @returns Promise resolved when done. | ||||||
|      */ |      */ | ||||||
|     async loadOfflineDeletedEvents(): Promise<void> { |     async loadOfflineDeletedEvents(): Promise<void> { | ||||||
|         const deletedEventsIds = await AddonCalendarOffline.getAllDeletedEventsIds(); |         const deletedEventsIds = await AddonCalendarOffline.getAllDeletedEventsIds(); | ||||||
| @ -617,7 +618,7 @@ class AddonCalendarDaySlidesItemsManagerSource extends CoreSwipeSlidesDynamicIte | |||||||
|     /** |     /** | ||||||
|      * Load time format. |      * Load time format. | ||||||
|      * |      * | ||||||
|      * @return Promise resolved when done. |      * @returns Promise resolved when done. | ||||||
|      */ |      */ | ||||||
|     async loadTimeFormat(): Promise<void> { |     async loadTimeFormat(): Promise<void> { | ||||||
|         this.timeFormat = await AddonCalendar.getCalendarTimeFormat(); |         this.timeFormat = await AddonCalendar.getCalendarTimeFormat(); | ||||||
| @ -704,7 +705,7 @@ class AddonCalendarDaySlidesItemsManagerSource extends CoreSwipeSlidesDynamicIte | |||||||
|      * |      * | ||||||
|      * @param event Event object. |      * @param event Event object. | ||||||
|      * @param currentTime Current time. |      * @param currentTime Current time. | ||||||
|      * @return True if it's in the past. |      * @returns True if it's in the past. | ||||||
|      */ |      */ | ||||||
|     isEventPast(event: AddonCalendarEventToDisplay, currentTime: number): boolean { |     isEventPast(event: AddonCalendarEventToDisplay, currentTime: number): boolean { | ||||||
|         return (event.timestart + event.timeduration) < currentTime; |         return (event.timestart + event.timeduration) < currentTime; | ||||||
| @ -714,7 +715,7 @@ class AddonCalendarDaySlidesItemsManagerSource extends CoreSwipeSlidesDynamicIte | |||||||
|      * Merge online events with the offline events of that period. |      * Merge online events with the offline events of that period. | ||||||
|      * |      * | ||||||
|      * @param day Day with the events. |      * @param day Day with the events. | ||||||
|      * @return Merged events. |      * @returns Merged events. | ||||||
|      */ |      */ | ||||||
|     mergeEvents(day: PreloadedDay): AddonCalendarEventToDisplay[] { |     mergeEvents(day: PreloadedDay): AddonCalendarEventToDisplay[] { | ||||||
|         day.hasOffline = false; |         day.hasOffline = false; | ||||||
| @ -762,7 +763,7 @@ class AddonCalendarDaySlidesItemsManagerSource extends CoreSwipeSlidesDynamicIte | |||||||
|      * |      * | ||||||
|      * @param selectedDay The current selected day. |      * @param selectedDay The current selected day. | ||||||
|      * @param invalidateDayEvents Whether to invalidate selected day events. |      * @param invalidateDayEvents Whether to invalidate selected day events. | ||||||
|      * @return Promise resolved when done. |      * @returns Promise resolved when done. | ||||||
|      */ |      */ | ||||||
|     async invalidateContent(selectedDay: PreloadedDay | null, invalidateDayEvents?: boolean): Promise<void> { |     async invalidateContent(selectedDay: PreloadedDay | null, invalidateDayEvents?: boolean): Promise<void> { | ||||||
|         const promises: Promise<void>[] = []; |         const promises: Promise<void>[] = []; | ||||||
|  | |||||||
| @ -160,7 +160,7 @@ export class AddonCalendarEditEventPage implements OnInit, OnDestroy, CanLeave { | |||||||
|     /** |     /** | ||||||
|      * Fetch the data needed to render the form. |      * Fetch the data needed to render the form. | ||||||
|      * |      * | ||||||
|      * @return Promise resolved when done. |      * @returns Promise resolved when done. | ||||||
|      */ |      */ | ||||||
|     protected async fetchData(): Promise<void> { |     protected async fetchData(): Promise<void> { | ||||||
|         this.error = false; |         this.error = false; | ||||||
| @ -318,7 +318,7 @@ export class AddonCalendarEditEventPage implements OnInit, OnDestroy, CanLeave { | |||||||
|      * |      * | ||||||
|      * @param event Event data. |      * @param event Event data. | ||||||
|      * @param isOffline Whether the data is from offline or not. |      * @param isOffline Whether the data is from offline or not. | ||||||
|      * @return Promise resolved when done. |      * @returns Promise resolved when done. | ||||||
|      */ |      */ | ||||||
|     protected async loadEventData( |     protected async loadEventData( | ||||||
|         event: AddonCalendarEvent | AddonCalendarOfflineEventDBRecord, |         event: AddonCalendarEvent | AddonCalendarOfflineEventDBRecord, | ||||||
| @ -435,7 +435,7 @@ export class AddonCalendarEditEventPage implements OnInit, OnDestroy, CanLeave { | |||||||
|      * Load groups of a certain course. |      * Load groups of a certain course. | ||||||
|      * |      * | ||||||
|      * @param courseId Course ID. |      * @param courseId Course ID. | ||||||
|      * @return Promise resolved when done. |      * @returns Promise resolved when done. | ||||||
|      */ |      */ | ||||||
|     protected async loadGroups(courseId: number): Promise<void> { |     protected async loadGroups(courseId: number): Promise<void> { | ||||||
|         this.loadingGroups = true; |         this.loadingGroups = true; | ||||||
| @ -622,7 +622,7 @@ export class AddonCalendarEditEventPage implements OnInit, OnDestroy, CanLeave { | |||||||
|     /** |     /** | ||||||
|      * Check if we can leave the page or not. |      * Check if we can leave the page or not. | ||||||
|      * |      * | ||||||
|      * @return Resolved with true if we can leave it, rejected if not. |      * @returns Resolved with true if we can leave it, rejected if not. | ||||||
|      */ |      */ | ||||||
|     async canLeave(): Promise<boolean> { |     async canLeave(): Promise<boolean> { | ||||||
|         if (AddonCalendarHelper.hasEventDataChanged(this.form.value, this.originalData)) { |         if (AddonCalendarHelper.hasEventDataChanged(this.form.value, this.originalData)) { | ||||||
| @ -647,7 +647,7 @@ export class AddonCalendarEditEventPage implements OnInit, OnDestroy, CanLeave { | |||||||
|     /** |     /** | ||||||
|      * Init reminders. |      * Init reminders. | ||||||
|      * |      * | ||||||
|      * @return Promise resolved when done. |      * @returns Promise resolved when done. | ||||||
|      */ |      */ | ||||||
|     protected async initReminders(): Promise<void> { |     protected async initReminders(): Promise<void> { | ||||||
|         // Don't init reminders when editing an event. Right now, only allow adding reminders for new events.
 |         // Don't init reminders when editing an event. Right now, only allow adding reminders for new events.
 | ||||||
|  | |||||||
| @ -145,7 +145,7 @@ export class AddonCalendarEventPage implements OnInit, OnDestroy { | |||||||
|     /** |     /** | ||||||
|      * Load reminders. |      * Load reminders. | ||||||
|      * |      * | ||||||
|      * @return Promise resolved when done. |      * @returns Promise resolved when done. | ||||||
|      */ |      */ | ||||||
|     protected async loadReminders(): Promise<void> { |     protected async loadReminders(): Promise<void> { | ||||||
|         if (!this.remindersEnabled || !this.event) { |         if (!this.remindersEnabled || !this.event) { | ||||||
| @ -180,7 +180,7 @@ export class AddonCalendarEventPage implements OnInit, OnDestroy { | |||||||
|      * |      * | ||||||
|      * @param sync Whether it should try to synchronize offline events. |      * @param sync Whether it should try to synchronize offline events. | ||||||
|      * @param showErrors Whether to show sync errors to the user. |      * @param showErrors Whether to show sync errors to the user. | ||||||
|      * @return Promise resolved when done. |      * @returns Promise resolved when done. | ||||||
|      */ |      */ | ||||||
|     async fetchEvent(sync = false, showErrors = false): Promise<void> { |     async fetchEvent(sync = false, showErrors = false): Promise<void> { | ||||||
|         this.isOnline = CoreNetwork.isOnline(); |         this.isOnline = CoreNetwork.isOnline(); | ||||||
| @ -319,7 +319,7 @@ export class AddonCalendarEventPage implements OnInit, OnDestroy { | |||||||
|      * Sync offline events. |      * Sync offline events. | ||||||
|      * |      * | ||||||
|      * @param showErrors Whether to show sync errors to the user. |      * @param showErrors Whether to show sync errors to the user. | ||||||
|      * @return Promise resolved with boolean: whether event was deleted on sync. |      * @returns Promise resolved with boolean: whether event was deleted on sync. | ||||||
|      */ |      */ | ||||||
|     protected async syncEvents(showErrors = false): Promise<boolean> { |     protected async syncEvents(showErrors = false): Promise<boolean> { | ||||||
|         let deleted = false; |         let deleted = false; | ||||||
| @ -363,7 +363,7 @@ export class AddonCalendarEventPage implements OnInit, OnDestroy { | |||||||
|      * |      * | ||||||
|      * @param event Event. |      * @param event Event. | ||||||
|      * @param courseId Course ID. |      * @param courseId Course ID. | ||||||
|      * @return Promise resolved when done. |      * @returns Promise resolved when done. | ||||||
|      */ |      */ | ||||||
|     protected async loadGroupName(event: AddonCalendarEventToDisplay, courseId: number): Promise<void> { |     protected async loadGroupName(event: AddonCalendarEventToDisplay, courseId: number): Promise<void> { | ||||||
|         try { |         try { | ||||||
| @ -438,7 +438,7 @@ export class AddonCalendarEventPage implements OnInit, OnDestroy { | |||||||
|      * @param refresher Refresher. |      * @param refresher Refresher. | ||||||
|      * @param done Function to call when done. |      * @param done Function to call when done. | ||||||
|      * @param showErrors Whether to show sync errors to the user. |      * @param showErrors Whether to show sync errors to the user. | ||||||
|      * @return Promise resolved when done. |      * @returns Promise resolved when done. | ||||||
|      */ |      */ | ||||||
|     async doRefresh(refresher?: IonRefresher, done?: () => void, showErrors= false): Promise<void> { |     async doRefresh(refresher?: IonRefresher, done?: () => void, showErrors= false): Promise<void> { | ||||||
|         if (!this.eventLoaded) { |         if (!this.eventLoaded) { | ||||||
| @ -456,7 +456,7 @@ export class AddonCalendarEventPage implements OnInit, OnDestroy { | |||||||
|      * |      * | ||||||
|      * @param sync Whether it should try to synchronize offline events. |      * @param sync Whether it should try to synchronize offline events. | ||||||
|      * @param showErrors Whether to show sync errors to the user. |      * @param showErrors Whether to show sync errors to the user. | ||||||
|      * @return Promise resolved when done. |      * @returns Promise resolved when done. | ||||||
|      */ |      */ | ||||||
|     async refreshEvent(sync = false, showErrors = false): Promise<void> { |     async refreshEvent(sync = false, showErrors = false): Promise<void> { | ||||||
|         this.syncIcon = CoreConstants.ICON_LOADING; |         this.syncIcon = CoreConstants.ICON_LOADING; | ||||||
|  | |||||||
| @ -188,7 +188,7 @@ export class AddonCalendarIndexPage implements OnInit, OnDestroy { | |||||||
|      * |      * | ||||||
|      * @param sync Whether it should try to synchronize offline events. |      * @param sync Whether it should try to synchronize offline events. | ||||||
|      * @param showErrors Whether to show sync errors to the user. |      * @param showErrors Whether to show sync errors to the user. | ||||||
|      * @return Promise resolved when done. |      * @returns Promise resolved when done. | ||||||
|      */ |      */ | ||||||
|     async fetchData(sync?: boolean, showErrors?: boolean): Promise<void> { |     async fetchData(sync?: boolean, showErrors?: boolean): Promise<void> { | ||||||
| 
 | 
 | ||||||
| @ -261,7 +261,7 @@ export class AddonCalendarIndexPage implements OnInit, OnDestroy { | |||||||
|      * @param refresher Refresher. |      * @param refresher Refresher. | ||||||
|      * @param done Function to call when done. |      * @param done Function to call when done. | ||||||
|      * @param showErrors Whether to show sync errors to the user. |      * @param showErrors Whether to show sync errors to the user. | ||||||
|      * @return Promise resolved when done. |      * @returns Promise resolved when done. | ||||||
|      */ |      */ | ||||||
|     async doRefresh(refresher?: IonRefresher, done?: () => void, showErrors?: boolean): Promise<void> { |     async doRefresh(refresher?: IonRefresher, done?: () => void, showErrors?: boolean): Promise<void> { | ||||||
|         if (!this.loaded) { |         if (!this.loaded) { | ||||||
| @ -280,7 +280,7 @@ export class AddonCalendarIndexPage implements OnInit, OnDestroy { | |||||||
|      * @param sync Whether it should try to synchronize offline events. |      * @param sync Whether it should try to synchronize offline events. | ||||||
|      * @param showErrors Whether to show sync errors to the user. |      * @param showErrors Whether to show sync errors to the user. | ||||||
|      * @param afterChange Whether the refresh is done after an event has changed or has been synced. |      * @param afterChange Whether the refresh is done after an event has changed or has been synced. | ||||||
|      * @return Promise resolved when done. |      * @returns Promise resolved when done. | ||||||
|      */ |      */ | ||||||
|     async refreshData(sync = false, showErrors = false, afterChange = false): Promise<void> { |     async refreshData(sync = false, showErrors = false, afterChange = false): Promise<void> { | ||||||
|         this.syncIcon = CoreConstants.ICON_LOADING; |         this.syncIcon = CoreConstants.ICON_LOADING; | ||||||
|  | |||||||
| @ -44,7 +44,7 @@ export class AddonCalendarSettingsPage implements OnInit { | |||||||
|      * Change default time. |      * Change default time. | ||||||
|      * |      * | ||||||
|      * @param e Event. |      * @param e Event. | ||||||
|      * @return Promise resolved when done. |      * @returns Promise resolved when done. | ||||||
|      */ |      */ | ||||||
|     async changeDefaultTime(e: Event): Promise<void> { |     async changeDefaultTime(e: Event): Promise<void> { | ||||||
|         e.stopPropagation(); |         e.stopPropagation(); | ||||||
|  | |||||||
| @ -61,7 +61,7 @@ export class AddonCalendarHelperProvider { | |||||||
|      * Returns event icon based on event type. |      * Returns event icon based on event type. | ||||||
|      * |      * | ||||||
|      * @param eventType Type of the event. |      * @param eventType Type of the event. | ||||||
|      * @return Event icon. |      * @returns Event icon. | ||||||
|      */ |      */ | ||||||
|     getEventIcon(eventType: AddonCalendarEventType | string): string { |     getEventIcon(eventType: AddonCalendarEventType | string): string { | ||||||
|         if (this.eventTypeIcons.length == 0) { |         if (this.eventTypeIcons.length == 0) { | ||||||
| @ -101,7 +101,7 @@ export class AddonCalendarHelperProvider { | |||||||
|      * |      * | ||||||
|      * @param courseId Course ID. If not defined, site calendar. |      * @param courseId Course ID. If not defined, site calendar. | ||||||
|      * @param siteId Site ID. If not defined, current site. |      * @param siteId Site ID. If not defined, current site. | ||||||
|      * @return Promise resolved with boolean: whether the user can create events. |      * @returns Promise resolved with boolean: whether the user can create events. | ||||||
|      */ |      */ | ||||||
|     async canEditEvents(courseId?: number, siteId?: string): Promise<boolean> { |     async canEditEvents(courseId?: number, siteId?: string): Promise<boolean> { | ||||||
|         try { |         try { | ||||||
| @ -123,7 +123,7 @@ export class AddonCalendarHelperProvider { | |||||||
|      * it will be included in all the days it lasts. |      * it will be included in all the days it lasts. | ||||||
|      * |      * | ||||||
|      * @param offlineEvents Events to classify. |      * @param offlineEvents Events to classify. | ||||||
|      * @return Object with the classified events. |      * @returns Object with the classified events. | ||||||
|      */ |      */ | ||||||
|     classifyIntoMonths( |     classifyIntoMonths( | ||||||
|         offlineEvents: AddonCalendarOfflineEventDBRecord[], |         offlineEvents: AddonCalendarOfflineEventDBRecord[], | ||||||
| @ -162,6 +162,7 @@ export class AddonCalendarHelperProvider { | |||||||
|      * Convenience function to format some event data to be rendered. |      * Convenience function to format some event data to be rendered. | ||||||
|      * |      * | ||||||
|      * @param event Event to format. |      * @param event Event to format. | ||||||
|  |      * @returns The formatted event to display. | ||||||
|      */ |      */ | ||||||
|     formatEventData( |     formatEventData( | ||||||
|         event: AddonCalendarEvent | AddonCalendarEventBase | AddonCalendarGetEventsEvent, |         event: AddonCalendarEvent | AddonCalendarEventBase | AddonCalendarGetEventsEvent, | ||||||
| @ -219,6 +220,7 @@ export class AddonCalendarHelperProvider { | |||||||
|      * Convenience function to format some event data to be rendered. |      * Convenience function to format some event data to be rendered. | ||||||
|      * |      * | ||||||
|      * @param event Event to format. |      * @param event Event to format. | ||||||
|  |      * @returns The formatted offline event to display. | ||||||
|      */ |      */ | ||||||
|     formatOfflineEventData(event: AddonCalendarOfflineEventDBRecord): AddonCalendarEventToDisplay { |     formatOfflineEventData(event: AddonCalendarOfflineEventDBRecord): AddonCalendarEventToDisplay { | ||||||
| 
 | 
 | ||||||
| @ -293,7 +295,7 @@ export class AddonCalendarHelperProvider { | |||||||
|      * @param reminders Reminders. |      * @param reminders Reminders. | ||||||
|      * @param timestart Event timestart. |      * @param timestart Event timestart. | ||||||
|      * @param siteId Site ID. |      * @param siteId Site ID. | ||||||
|      * @return Formatted reminders. |      * @returns Formatted reminders. | ||||||
|      * @deprecated since 4.1 Use AddonCalendarHelper.getEventReminders. |      * @deprecated since 4.1 Use AddonCalendarHelper.getEventReminders. | ||||||
|      */ |      */ | ||||||
|     async formatReminders( |     async formatReminders( | ||||||
| @ -314,7 +316,7 @@ export class AddonCalendarHelperProvider { | |||||||
|      * @param eventId Event Id. |      * @param eventId Event Id. | ||||||
|      * @param eventTimestart Event timestart. |      * @param eventTimestart Event timestart. | ||||||
|      * @param siteId Site ID. |      * @param siteId Site ID. | ||||||
|      * @return Formatted reminders. |      * @returns Formatted reminders. | ||||||
|      */ |      */ | ||||||
|     async getEventReminders( |     async getEventReminders( | ||||||
|         eventId: number, |         eventId: number, | ||||||
| @ -370,7 +372,7 @@ export class AddonCalendarHelperProvider { | |||||||
|      * Get options (name & value) for each allowed event type. |      * Get options (name & value) for each allowed event type. | ||||||
|      * |      * | ||||||
|      * @param eventTypes Result of getAllowedEventTypes. |      * @param eventTypes Result of getAllowedEventTypes. | ||||||
|      * @return Options. |      * @returns Options. | ||||||
|      */ |      */ | ||||||
|     getEventTypeOptions(eventTypes: {[name: string]: boolean}): AddonCalendarEventTypeOption[] { |     getEventTypeOptions(eventTypes: {[name: string]: boolean}): AddonCalendarEventTypeOption[] { | ||||||
|         const options: AddonCalendarEventTypeOption[] = []; |         const options: AddonCalendarEventTypeOption[] = []; | ||||||
| @ -398,7 +400,7 @@ export class AddonCalendarHelperProvider { | |||||||
|      * Get the month "id". |      * Get the month "id". | ||||||
|      * |      * | ||||||
|      * @param moment Month moment. |      * @param moment Month moment. | ||||||
|      * @return The "id". |      * @returns The "id". | ||||||
|      */ |      */ | ||||||
|     getMonthId(moment: moment.Moment): string { |     getMonthId(moment: moment.Moment): string { | ||||||
|         return `${moment.year()}#${moment.month() + 1}`; |         return `${moment.year()}#${moment.month() + 1}`; | ||||||
| @ -408,7 +410,7 @@ export class AddonCalendarHelperProvider { | |||||||
|      * Get the day "id". |      * Get the day "id". | ||||||
|      * |      * | ||||||
|      * @param moment Day moment. |      * @param moment Day moment. | ||||||
|      * @return The "id". |      * @returns The "id". | ||||||
|      */ |      */ | ||||||
|     getDayId(moment: moment.Moment): string { |     getDayId(moment: moment.Moment): string { | ||||||
|         return `${this.getMonthId(moment)}#${moment.date()}`; |         return `${this.getMonthId(moment)}#${moment.date()}`; | ||||||
| @ -422,7 +424,7 @@ export class AddonCalendarHelperProvider { | |||||||
|      * @param year Year to get. |      * @param year Year to get. | ||||||
|      * @param month Month to get. |      * @param month Month to get. | ||||||
|      * @param siteId Site ID. If not defined, current site. |      * @param siteId Site ID. If not defined, current site. | ||||||
|      * @return Promise resolved with the response. |      * @returns Promise resolved with the response. | ||||||
|      */ |      */ | ||||||
|     async getOfflineMonthWeeks( |     async getOfflineMonthWeeks( | ||||||
|         year: number, |         year: number, | ||||||
| @ -497,7 +499,7 @@ export class AddonCalendarHelperProvider { | |||||||
|      * |      * | ||||||
|      * @param data Current data. |      * @param data Current data. | ||||||
|      * @param original Original data. |      * @param original Original data. | ||||||
|      * @return True if data has changed, false otherwise. |      * @returns True if data has changed, false otherwise. | ||||||
|      */ |      */ | ||||||
|     hasEventDataChanged(data: AddonCalendarOfflineEventDBRecord, original?: AddonCalendarOfflineEventDBRecord): boolean { |     hasEventDataChanged(data: AddonCalendarOfflineEventDBRecord, original?: AddonCalendarOfflineEventDBRecord): boolean { | ||||||
|         if (!original) { |         if (!original) { | ||||||
| @ -539,7 +541,7 @@ export class AddonCalendarHelperProvider { | |||||||
|      * @param events Events without filtering. |      * @param events Events without filtering. | ||||||
|      * @param filter Filter from popover. |      * @param filter Filter from popover. | ||||||
|      * @param categories Categories indexed by ID. |      * @param categories Categories indexed by ID. | ||||||
|      * @return Filtered events. |      * @returns Filtered events. | ||||||
|      */ |      */ | ||||||
|     getFilteredEvents( |     getFilteredEvents( | ||||||
|         events: AddonCalendarEventToDisplay[], |         events: AddonCalendarEventToDisplay[], | ||||||
| @ -571,7 +573,7 @@ export class AddonCalendarHelperProvider { | |||||||
|      * @param categories Categories indexed by ID. |      * @param categories Categories indexed by ID. | ||||||
|      * @param courseId Course ID to filter. |      * @param courseId Course ID to filter. | ||||||
|      * @param categoryId Category ID the course belongs to. |      * @param categoryId Category ID the course belongs to. | ||||||
|      * @return Whether it should be displayed. |      * @returns Whether it should be displayed. | ||||||
|      */ |      */ | ||||||
|     protected shouldDisplayEvent( |     protected shouldDisplayEvent( | ||||||
|         event: AddonCalendarEventToDisplay, |         event: AddonCalendarEventToDisplay, | ||||||
| @ -624,7 +626,7 @@ export class AddonCalendarHelperProvider { | |||||||
|      * |      * | ||||||
|      * @param events Events that have been touched and number of times each event is repeated. |      * @param events Events that have been touched and number of times each event is repeated. | ||||||
|      * @param siteId Site ID. If not defined, current site. |      * @param siteId Site ID. If not defined, current site. | ||||||
|      * @return Resolved when done. |      * @returns Resolved when done. | ||||||
|      */ |      */ | ||||||
|     async refreshAfterChangeEvents(events: AddonCalendarSyncInvalidateEvent[], siteId?: string): Promise<void> { |     async refreshAfterChangeEvents(events: AddonCalendarSyncInvalidateEvent[], siteId?: string): Promise<void> { | ||||||
|         const site = await CoreSites.getSite(siteId); |         const site = await CoreSites.getSite(siteId); | ||||||
| @ -759,7 +761,7 @@ export class AddonCalendarHelperProvider { | |||||||
|      * @param event Event that has been touched. |      * @param event Event that has been touched. | ||||||
|      * @param repeated Number of times the event is repeated. |      * @param repeated Number of times the event is repeated. | ||||||
|      * @param siteId Site ID. If not defined, current site. |      * @param siteId Site ID. If not defined, current site. | ||||||
|      * @return Resolved when done. |      * @returns Resolved when done. | ||||||
|      */ |      */ | ||||||
|     refreshAfterChangeEvent( |     refreshAfterChangeEvent( | ||||||
|         event: { |         event: { | ||||||
| @ -785,6 +787,7 @@ export class AddonCalendarHelperProvider { | |||||||
|      * Sort events by timestart. |      * Sort events by timestart. | ||||||
|      * |      * | ||||||
|      * @param events List to sort. |      * @param events List to sort. | ||||||
|  |      * @returns Events sorted. | ||||||
|      */ |      */ | ||||||
|     sortEvents(events: (AddonCalendarEventToDisplay)[]): (AddonCalendarEventToDisplay)[] { |     sortEvents(events: (AddonCalendarEventToDisplay)[]): (AddonCalendarEventToDisplay)[] { | ||||||
|         return events.sort((a, b) => { |         return events.sort((a, b) => { | ||||||
|  | |||||||
| @ -36,7 +36,7 @@ export class AddonCalendarOfflineProvider { | |||||||
|      * |      * | ||||||
|      * @param eventId Event ID. |      * @param eventId Event ID. | ||||||
|      * @param siteId Site ID. If not defined, current site. |      * @param siteId Site ID. If not defined, current site. | ||||||
|      * @return Promise resolved if deleted, rejected if failure. |      * @returns Promise resolved if deleted, rejected if failure. | ||||||
|      */ |      */ | ||||||
|     async deleteEvent(eventId: number, siteId?: string): Promise<void> { |     async deleteEvent(eventId: number, siteId?: string): Promise<void> { | ||||||
|         const site = await CoreSites.getSite(siteId); |         const site = await CoreSites.getSite(siteId); | ||||||
| @ -52,7 +52,7 @@ export class AddonCalendarOfflineProvider { | |||||||
|      * Get the IDs of all the events created/edited/deleted in offline. |      * Get the IDs of all the events created/edited/deleted in offline. | ||||||
|      * |      * | ||||||
|      * @param siteId Site ID. If not defined, current site. |      * @param siteId Site ID. If not defined, current site. | ||||||
|      * @return Promise resolved with the IDs. |      * @returns Promise resolved with the IDs. | ||||||
|      */ |      */ | ||||||
|     async getAllEventsIds(siteId?: string): Promise<number[]> { |     async getAllEventsIds(siteId?: string): Promise<number[]> { | ||||||
|         const promises: Promise<number[]>[] = []; |         const promises: Promise<number[]>[] = []; | ||||||
| @ -69,7 +69,7 @@ export class AddonCalendarOfflineProvider { | |||||||
|      * Get all the events deleted in offline. |      * Get all the events deleted in offline. | ||||||
|      * |      * | ||||||
|      * @param siteId Site ID. If not defined, current site. |      * @param siteId Site ID. If not defined, current site. | ||||||
|      * @return Promise resolved with all the events deleted in offline. |      * @returns Promise resolved with all the events deleted in offline. | ||||||
|      */ |      */ | ||||||
|     async getAllDeletedEvents(siteId?: string): Promise<AddonCalendarOfflineDeletedEventDBRecord[]> { |     async getAllDeletedEvents(siteId?: string): Promise<AddonCalendarOfflineDeletedEventDBRecord[]> { | ||||||
|         const site = await CoreSites.getSite(siteId); |         const site = await CoreSites.getSite(siteId); | ||||||
| @ -81,7 +81,7 @@ export class AddonCalendarOfflineProvider { | |||||||
|      * Get the IDs of all the events deleted in offline. |      * Get the IDs of all the events deleted in offline. | ||||||
|      * |      * | ||||||
|      * @param siteId Site ID. If not defined, current site. |      * @param siteId Site ID. If not defined, current site. | ||||||
|      * @return Promise resolved with the IDs of all the events deleted in offline. |      * @returns Promise resolved with the IDs of all the events deleted in offline. | ||||||
|      */ |      */ | ||||||
|     async getAllDeletedEventsIds(siteId?: string): Promise<number[]> { |     async getAllDeletedEventsIds(siteId?: string): Promise<number[]> { | ||||||
|         const events = await this.getAllDeletedEvents(siteId); |         const events = await this.getAllDeletedEvents(siteId); | ||||||
| @ -93,7 +93,7 @@ export class AddonCalendarOfflineProvider { | |||||||
|      * Get all the events created/edited in offline. |      * Get all the events created/edited in offline. | ||||||
|      * |      * | ||||||
|      * @param siteId Site ID. If not defined, current site. |      * @param siteId Site ID. If not defined, current site. | ||||||
|      * @return Promise resolved with events. |      * @returns Promise resolved with events. | ||||||
|      */ |      */ | ||||||
|     async getAllEditedEvents(siteId?: string): Promise<AddonCalendarOfflineEventDBRecord[]> { |     async getAllEditedEvents(siteId?: string): Promise<AddonCalendarOfflineEventDBRecord[]> { | ||||||
|         const site = await CoreSites.getSite(siteId); |         const site = await CoreSites.getSite(siteId); | ||||||
| @ -105,7 +105,7 @@ export class AddonCalendarOfflineProvider { | |||||||
|      * Get the IDs of all the events created/edited in offline. |      * Get the IDs of all the events created/edited in offline. | ||||||
|      * |      * | ||||||
|      * @param siteId Site ID. If not defined, current site. |      * @param siteId Site ID. If not defined, current site. | ||||||
|      * @return Promise resolved with events IDs. |      * @returns Promise resolved with events IDs. | ||||||
|      */ |      */ | ||||||
|     async getAllEditedEventsIds(siteId?: string): Promise<number[]> { |     async getAllEditedEventsIds(siteId?: string): Promise<number[]> { | ||||||
|         const events = await this.getAllEditedEvents(siteId); |         const events = await this.getAllEditedEvents(siteId); | ||||||
| @ -118,7 +118,7 @@ export class AddonCalendarOfflineProvider { | |||||||
|      * |      * | ||||||
|      * @param eventId Event ID. |      * @param eventId Event ID. | ||||||
|      * @param siteId Site ID. If not defined, current site. |      * @param siteId Site ID. If not defined, current site. | ||||||
|      * @return Promise resolved with the deleted event. |      * @returns Promise resolved with the deleted event. | ||||||
|      */ |      */ | ||||||
|     async getDeletedEvent(eventId: number, siteId?: string): Promise<AddonCalendarOfflineDeletedEventDBRecord> { |     async getDeletedEvent(eventId: number, siteId?: string): Promise<AddonCalendarOfflineDeletedEventDBRecord> { | ||||||
|         const site = await CoreSites.getSite(siteId); |         const site = await CoreSites.getSite(siteId); | ||||||
| @ -134,7 +134,7 @@ export class AddonCalendarOfflineProvider { | |||||||
|      * |      * | ||||||
|      * @param eventId Event ID. |      * @param eventId Event ID. | ||||||
|      * @param siteId Site ID. If not defined, current site. |      * @param siteId Site ID. If not defined, current site. | ||||||
|      * @return Promise resolved with the event. |      * @returns Promise resolved with the event. | ||||||
|      */ |      */ | ||||||
|     async getEvent(eventId: number, siteId?: string): Promise<AddonCalendarOfflineEventDBRecord> { |     async getEvent(eventId: number, siteId?: string): Promise<AddonCalendarOfflineEventDBRecord> { | ||||||
|         const site = await CoreSites.getSite(siteId); |         const site = await CoreSites.getSite(siteId); | ||||||
| @ -149,7 +149,7 @@ export class AddonCalendarOfflineProvider { | |||||||
|      * Check if there are offline events to send. |      * Check if there are offline events to send. | ||||||
|      * |      * | ||||||
|      * @param siteId Site ID. If not defined, current site. |      * @param siteId Site ID. If not defined, current site. | ||||||
|      * @return Promise resolved with boolean: true if has offline events, false otherwise. |      * @returns Promise resolved with boolean: true if has offline events, false otherwise. | ||||||
|      */ |      */ | ||||||
|     async hasEditedEvents(siteId?: string): Promise<boolean> { |     async hasEditedEvents(siteId?: string): Promise<boolean> { | ||||||
|         try { |         try { | ||||||
| @ -166,7 +166,7 @@ export class AddonCalendarOfflineProvider { | |||||||
|      * Check whether there's offline data for a site. |      * Check whether there's offline data for a site. | ||||||
|      * |      * | ||||||
|      * @param siteId Site ID. If not defined, current site. |      * @param siteId Site ID. If not defined, current site. | ||||||
|      * @return Promise resolved with boolean: true if has offline data, false otherwise. |      * @returns Promise resolved with boolean: true if has offline data, false otherwise. | ||||||
|      */ |      */ | ||||||
|     async hasOfflineData(siteId?: string): Promise<boolean> { |     async hasOfflineData(siteId?: string): Promise<boolean> { | ||||||
|         const ids = await this.getAllEventsIds(siteId); |         const ids = await this.getAllEventsIds(siteId); | ||||||
| @ -179,7 +179,7 @@ export class AddonCalendarOfflineProvider { | |||||||
|      * |      * | ||||||
|      * @param eventId Event ID. |      * @param eventId Event ID. | ||||||
|      * @param siteId Site ID. If not defined, current site. |      * @param siteId Site ID. If not defined, current site. | ||||||
|      * @return Promise resolved with boolean: whether the event is deleted. |      * @returns Promise resolved with boolean: whether the event is deleted. | ||||||
|      */ |      */ | ||||||
|     async isEventDeleted(eventId: number, siteId?: string): Promise<boolean> { |     async isEventDeleted(eventId: number, siteId?: string): Promise<boolean> { | ||||||
|         try { |         try { | ||||||
| @ -198,7 +198,7 @@ export class AddonCalendarOfflineProvider { | |||||||
|      * @param name Name of the event to delete. |      * @param name Name of the event to delete. | ||||||
|      * @param deleteAll If it's a repeated event. whether to delete all events of the series. |      * @param deleteAll If it's a repeated event. whether to delete all events of the series. | ||||||
|      * @param siteId Site ID. If not defined, current site. |      * @param siteId Site ID. If not defined, current site. | ||||||
|      * @return Promise resolved when done. |      * @returns Promise resolved when done. | ||||||
|      */ |      */ | ||||||
|     async markDeleted(eventId: number, name: string, deleteAll?: boolean, siteId?: string): Promise<number> { |     async markDeleted(eventId: number, name: string, deleteAll?: boolean, siteId?: string): Promise<number> { | ||||||
|         const site = await CoreSites.getSite(siteId); |         const site = await CoreSites.getSite(siteId); | ||||||
| @ -218,7 +218,7 @@ export class AddonCalendarOfflineProvider { | |||||||
|      * @param eventId Event ID. Negative value to edit offline event. If it's a new event, set it to undefined/null. |      * @param eventId Event ID. Negative value to edit offline event. If it's a new event, set it to undefined/null. | ||||||
|      * @param data Event data. |      * @param data Event data. | ||||||
|      * @param siteId Site ID. If not defined, current site. |      * @param siteId Site ID. If not defined, current site. | ||||||
|      * @return Promise resolved with the stored event. |      * @returns Promise resolved with the stored event. | ||||||
|      */ |      */ | ||||||
|     async saveEvent( |     async saveEvent( | ||||||
|         eventId: number | undefined, |         eventId: number | undefined, | ||||||
| @ -258,7 +258,7 @@ export class AddonCalendarOfflineProvider { | |||||||
|      * |      * | ||||||
|      * @param eventId Event ID. |      * @param eventId Event ID. | ||||||
|      * @param siteId Site ID. If not defined, current site. |      * @param siteId Site ID. If not defined, current site. | ||||||
|      * @return Promise resolved if deleted, rejected if failure. |      * @returns Promise resolved if deleted, rejected if failure. | ||||||
|      */ |      */ | ||||||
|     async unmarkDeleted(eventId: number, siteId?: string): Promise<void> { |     async unmarkDeleted(eventId: number, siteId?: string): Promise<void> { | ||||||
|         const site = await CoreSites.getSite(siteId); |         const site = await CoreSites.getSite(siteId); | ||||||
|  | |||||||
| @ -52,7 +52,7 @@ export class AddonCalendarSyncProvider extends CoreSyncBaseProvider<AddonCalenda | |||||||
|      * |      * | ||||||
|      * @param siteId Site ID to sync. If not defined, sync all sites. |      * @param siteId Site ID to sync. If not defined, sync all sites. | ||||||
|      * @param force Wether to force sync not depending on last execution. |      * @param force Wether to force sync not depending on last execution. | ||||||
|      * @return Promise resolved if sync is successful, rejected if sync fails. |      * @returns Promise resolved if sync is successful, rejected if sync fails. | ||||||
|      */ |      */ | ||||||
|     async syncAllEvents(siteId?: string, force = false): Promise<void> { |     async syncAllEvents(siteId?: string, force = false): Promise<void> { | ||||||
|         await this.syncOnSites('all calendar events', (siteId) => this.syncAllEventsFunc(force, siteId), siteId); |         await this.syncOnSites('all calendar events', (siteId) => this.syncAllEventsFunc(force, siteId), siteId); | ||||||
| @ -63,7 +63,7 @@ export class AddonCalendarSyncProvider extends CoreSyncBaseProvider<AddonCalenda | |||||||
|      * |      * | ||||||
|      * @param force Wether to force sync not depending on last execution. |      * @param force Wether to force sync not depending on last execution. | ||||||
|      * @param siteId Site ID to sync. |      * @param siteId Site ID to sync. | ||||||
|      * @return Promise resolved if sync is successful, rejected if sync fails. |      * @returns Promise resolved if sync is successful, rejected if sync fails. | ||||||
|      */ |      */ | ||||||
|     protected async syncAllEventsFunc(force = false, siteId?: string): Promise<void> { |     protected async syncAllEventsFunc(force = false, siteId?: string): Promise<void> { | ||||||
|         const result = force |         const result = force | ||||||
| @ -80,7 +80,7 @@ export class AddonCalendarSyncProvider extends CoreSyncBaseProvider<AddonCalenda | |||||||
|      * Sync a site events only if a certain time has passed since the last time. |      * Sync a site events only if a certain time has passed since the last time. | ||||||
|      * |      * | ||||||
|      * @param siteId Site ID. If not defined, current site. |      * @param siteId Site ID. If not defined, current site. | ||||||
|      * @return Promise resolved when the events are synced or if it doesn't need to be synced. |      * @returns Promise resolved when the events are synced or if it doesn't need to be synced. | ||||||
|      */ |      */ | ||||||
|     async syncEventsIfNeeded(siteId?: string): Promise<AddonCalendarSyncEvents | undefined> { |     async syncEventsIfNeeded(siteId?: string): Promise<AddonCalendarSyncEvents | undefined> { | ||||||
|         siteId = siteId || CoreSites.getCurrentSiteId(); |         siteId = siteId || CoreSites.getCurrentSiteId(); | ||||||
| @ -96,7 +96,7 @@ export class AddonCalendarSyncProvider extends CoreSyncBaseProvider<AddonCalenda | |||||||
|      * Synchronize all offline events of a certain site. |      * Synchronize all offline events of a certain site. | ||||||
|      * |      * | ||||||
|      * @param siteId Site ID. If not defined, current site. |      * @param siteId Site ID. If not defined, current site. | ||||||
|      * @return Promise resolved if sync is successful, rejected otherwise. |      * @returns Promise resolved if sync is successful, rejected otherwise. | ||||||
|      */ |      */ | ||||||
|     async syncEvents(siteId?: string): Promise<AddonCalendarSyncEvents> { |     async syncEvents(siteId?: string): Promise<AddonCalendarSyncEvents> { | ||||||
|         siteId = siteId || CoreSites.getCurrentSiteId(); |         siteId = siteId || CoreSites.getCurrentSiteId(); | ||||||
| @ -119,7 +119,7 @@ export class AddonCalendarSyncProvider extends CoreSyncBaseProvider<AddonCalenda | |||||||
|      * Sync user preferences of a site. |      * Sync user preferences of a site. | ||||||
|      * |      * | ||||||
|      * @param siteId Site ID to sync. |      * @param siteId Site ID to sync. | ||||||
|      * @param Promise resolved if sync is successful, rejected if sync fails. |      * @returns Promise resolved if sync is successful, rejected if sync fails. | ||||||
|      */ |      */ | ||||||
|     protected async performSyncEvents(siteId: string): Promise<AddonCalendarSyncEvents> { |     protected async performSyncEvents(siteId: string): Promise<AddonCalendarSyncEvents> { | ||||||
|         const result: AddonCalendarSyncEvents = { |         const result: AddonCalendarSyncEvents = { | ||||||
| @ -168,7 +168,7 @@ export class AddonCalendarSyncProvider extends CoreSyncBaseProvider<AddonCalenda | |||||||
|      * @param eventId The event ID to sync. |      * @param eventId The event ID to sync. | ||||||
|      * @param result Object where to store the result of the sync. |      * @param result Object where to store the result of the sync. | ||||||
|      * @param siteId Site ID. If not defined, current site. |      * @param siteId Site ID. If not defined, current site. | ||||||
|      * @return Promise resolved if sync is successful, rejected otherwise. |      * @returns Promise resolved if sync is successful, rejected otherwise. | ||||||
|      */ |      */ | ||||||
|     protected async syncOfflineEvent(eventId: number, result: AddonCalendarSyncEvents, siteId?: string): Promise<void> { |     protected async syncOfflineEvent(eventId: number, result: AddonCalendarSyncEvents, siteId?: string): Promise<void> { | ||||||
| 
 | 
 | ||||||
|  | |||||||
| @ -149,7 +149,7 @@ export class AddonCalendarProvider { | |||||||
|      * Check if a certain site allows creating and editing events. |      * Check if a certain site allows creating and editing events. | ||||||
|      * |      * | ||||||
|      * @param siteId Site Id. If not defined, use current site. |      * @param siteId Site Id. If not defined, use current site. | ||||||
|      * @return Promise resolved with true if can create/edit. |      * @returns Promise resolved with true if can create/edit. | ||||||
|      * @since 3.7.1 |      * @since 3.7.1 | ||||||
|      */ |      */ | ||||||
|     async canEditEvents(siteId?: string): Promise<boolean> { |     async canEditEvents(siteId?: string): Promise<boolean> { | ||||||
| @ -166,7 +166,7 @@ export class AddonCalendarProvider { | |||||||
|      * Check if a certain site allows creating and editing events. |      * Check if a certain site allows creating and editing events. | ||||||
|      * |      * | ||||||
|      * @param site Site. If not defined, use current site. |      * @param site Site. If not defined, use current site. | ||||||
|      * @return Whether events can be created and edited. |      * @returns Whether events can be created and edited. | ||||||
|      * @since 3.7.1 |      * @since 3.7.1 | ||||||
|      */ |      */ | ||||||
|     canEditEventsInSite(site?: CoreSite): boolean { |     canEditEventsInSite(site?: CoreSite): boolean { | ||||||
| @ -180,7 +180,7 @@ export class AddonCalendarProvider { | |||||||
|      * Given a number of seconds, convert it to a unit&value format compatible with reminders. |      * Given a number of seconds, convert it to a unit&value format compatible with reminders. | ||||||
|      * |      * | ||||||
|      * @param seconds Number of seconds. |      * @param seconds Number of seconds. | ||||||
|      * @return Value and unit. |      * @returns Value and unit. | ||||||
|      * @deprecated since 4.1 Use CoreRemindersService.convertSecondsToValueAndUnit instead. |      * @deprecated since 4.1 Use CoreRemindersService.convertSecondsToValueAndUnit instead. | ||||||
|      */ |      */ | ||||||
|     static convertSecondsToValueAndUnit(seconds: number): CoreReminderValueAndUnit { |     static convertSecondsToValueAndUnit(seconds: number): CoreReminderValueAndUnit { | ||||||
| @ -195,7 +195,7 @@ export class AddonCalendarProvider { | |||||||
|      * @param deleteAll If it's a repeated event. whether to delete all events of the series. |      * @param deleteAll If it's a repeated event. whether to delete all events of the series. | ||||||
|      * @param forceOffline True to always save it in offline. |      * @param forceOffline True to always save it in offline. | ||||||
|      * @param siteId Site ID. If not defined, current site. |      * @param siteId Site ID. If not defined, current site. | ||||||
|      * @return Promise resolved when done. |      * @returns Promise resolved when done. | ||||||
|      */ |      */ | ||||||
|     async deleteEvent( |     async deleteEvent( | ||||||
|         eventId: number, |         eventId: number, | ||||||
| @ -239,7 +239,7 @@ export class AddonCalendarProvider { | |||||||
|      * @param eventId Event ID to delete. |      * @param eventId Event ID to delete. | ||||||
|      * @param deleteAll If it's a repeated event. whether to delete all events of the series. |      * @param deleteAll If it's a repeated event. whether to delete all events of the series. | ||||||
|      * @param siteId Site ID. If not defined, current site. |      * @param siteId Site ID. If not defined, current site. | ||||||
|      * @return Promise resolved when done. |      * @returns Promise resolved when done. | ||||||
|      */ |      */ | ||||||
|     async deleteEventOnline(eventId: number, deleteAll = false, siteId?: string): Promise<void> { |     async deleteEventOnline(eventId: number, deleteAll = false, siteId?: string): Promise<void> { | ||||||
|         const site = await CoreSites.getSite(siteId); |         const site = await CoreSites.getSite(siteId); | ||||||
| @ -263,7 +263,7 @@ export class AddonCalendarProvider { | |||||||
|      * |      * | ||||||
|      * @param eventId Event ID. |      * @param eventId Event ID. | ||||||
|      * @param siteId ID of the site the event belongs to. If not defined, use current site. |      * @param siteId ID of the site the event belongs to. If not defined, use current site. | ||||||
|      * @return Resolved when done. |      * @returns Resolved when done. | ||||||
|      */ |      */ | ||||||
|     protected async deleteLocalEvent(eventId: number, siteId?: string): Promise<void> { |     protected async deleteLocalEvent(eventId: number, siteId?: string): Promise<void> { | ||||||
|         const site = await CoreSites.getSite(siteId); |         const site = await CoreSites.getSite(siteId); | ||||||
| @ -286,7 +286,7 @@ export class AddonCalendarProvider { | |||||||
|     /** |     /** | ||||||
|      * Initialize the service. |      * Initialize the service. | ||||||
|      * |      * | ||||||
|      * @return Promise resolved when done. |      * @returns Promise resolved when done. | ||||||
|      */ |      */ | ||||||
|     async initialize(): Promise<void> { |     async initialize(): Promise<void> { | ||||||
|         CoreLocalNotifications.registerClick<CoreRemindersPushNotificationData>( |         CoreLocalNotifications.registerClick<CoreRemindersPushNotificationData>( | ||||||
| @ -303,7 +303,7 @@ export class AddonCalendarProvider { | |||||||
|      * Notification has been clicked. |      * Notification has been clicked. | ||||||
|      * |      * | ||||||
|      * @param notification Calendar notification. |      * @param notification Calendar notification. | ||||||
|      * @return Promise resolved when done. |      * @returns Promise resolved when done. | ||||||
|      */ |      */ | ||||||
|     async notificationClicked(notification: CoreRemindersPushNotificationData): Promise<void> { |     async notificationClicked(notification: CoreRemindersPushNotificationData): Promise<void> { | ||||||
|         const disabled = await this.isDisabled(notification.siteId); |         const disabled = await this.isDisabled(notification.siteId); | ||||||
| @ -334,7 +334,7 @@ export class AddonCalendarProvider { | |||||||
|      * @param seenDay Timestamp of day currently seen. If set, the function will not add links to this day. |      * @param seenDay Timestamp of day currently seen. If set, the function will not add links to this day. | ||||||
|      * @param showTime Determine the show time GMT timestamp. |      * @param showTime Determine the show time GMT timestamp. | ||||||
|      * @param siteId Site ID. If not defined, current site. |      * @param siteId Site ID. If not defined, current site. | ||||||
|      * @return Promise resolved with the formatted event time. |      * @returns Promise resolved with the formatted event time. | ||||||
|      */ |      */ | ||||||
|     async formatEventTime( |     async formatEventTime( | ||||||
|         event: AddonCalendarEventToDisplay, |         event: AddonCalendarEventToDisplay, | ||||||
| @ -422,7 +422,7 @@ export class AddonCalendarProvider { | |||||||
|      * |      * | ||||||
|      * @param courseId Course ID. If not defined, site calendar. |      * @param courseId Course ID. If not defined, site calendar. | ||||||
|      * @param siteId Site ID. If not defined, current site. |      * @param siteId Site ID. If not defined, current site. | ||||||
|      * @return Promise resolved with object with access information. |      * @returns Promise resolved with object with access information. | ||||||
|      * @since 3.7 |      * @since 3.7 | ||||||
|      */ |      */ | ||||||
|     async getAccessInformation(courseId?: number, siteId?: string): Promise<AddonCalendarGetCalendarAccessInformationWSResponse> { |     async getAccessInformation(courseId?: number, siteId?: string): Promise<AddonCalendarGetCalendarAccessInformationWSResponse> { | ||||||
| @ -442,7 +442,7 @@ export class AddonCalendarProvider { | |||||||
|      * Get cache key for calendar access information WS calls. |      * Get cache key for calendar access information WS calls. | ||||||
|      * |      * | ||||||
|      * @param courseId Course ID. |      * @param courseId Course ID. | ||||||
|      * @return Cache key. |      * @returns Cache key. | ||||||
|      */ |      */ | ||||||
|     protected getAccessInformationCacheKey(courseId?: number): string { |     protected getAccessInformationCacheKey(courseId?: number): string { | ||||||
|         return ROOT_CACHE_KEY + 'accessInformation:' + (courseId || 0); |         return ROOT_CACHE_KEY + 'accessInformation:' + (courseId || 0); | ||||||
| @ -452,7 +452,7 @@ export class AddonCalendarProvider { | |||||||
|      * Get all calendar events from local Db. |      * Get all calendar events from local Db. | ||||||
|      * |      * | ||||||
|      * @param siteId ID of the site the event belongs to. If not defined, use current site. |      * @param siteId ID of the site the event belongs to. If not defined, use current site. | ||||||
|      * @return Promise resolved with all the events. |      * @returns Promise resolved with all the events. | ||||||
|      */ |      */ | ||||||
|     async getAllEventsFromLocalDb(siteId?: string): Promise<AddonCalendarEventDBRecord[]> { |     async getAllEventsFromLocalDb(siteId?: string): Promise<AddonCalendarEventDBRecord[]> { | ||||||
|         const site = await CoreSites.getSite(siteId); |         const site = await CoreSites.getSite(siteId); | ||||||
| @ -465,7 +465,7 @@ export class AddonCalendarProvider { | |||||||
|      * |      * | ||||||
|      * @param courseId Course ID. If not defined, site calendar. |      * @param courseId Course ID. If not defined, site calendar. | ||||||
|      * @param siteId Site ID. If not defined, current site. |      * @param siteId Site ID. If not defined, current site. | ||||||
|      * @return Promise resolved with an object indicating the types. |      * @returns Promise resolved with an object indicating the types. | ||||||
|      * @since 3.7 |      * @since 3.7 | ||||||
|      */ |      */ | ||||||
|     async getAllowedEventTypes(courseId?: number, siteId?: string): Promise<{[name: string]: boolean}> { |     async getAllowedEventTypes(courseId?: number, siteId?: string): Promise<{[name: string]: boolean}> { | ||||||
| @ -495,7 +495,7 @@ export class AddonCalendarProvider { | |||||||
|      * Get cache key for calendar allowed event types WS calls. |      * Get cache key for calendar allowed event types WS calls. | ||||||
|      * |      * | ||||||
|      * @param courseId Course ID. |      * @param courseId Course ID. | ||||||
|      * @return Cache key. |      * @returns Cache key. | ||||||
|      */ |      */ | ||||||
|     protected getAllowedEventTypesCacheKey(courseId?: number): string { |     protected getAllowedEventTypesCacheKey(courseId?: number): string { | ||||||
|         return ROOT_CACHE_KEY + 'allowedEventTypes:' + (courseId || 0); |         return ROOT_CACHE_KEY + 'allowedEventTypes:' + (courseId || 0); | ||||||
| @ -505,7 +505,7 @@ export class AddonCalendarProvider { | |||||||
|      * Get the "look ahead" for a certain user. |      * Get the "look ahead" for a certain user. | ||||||
|      * |      * | ||||||
|      * @param siteId ID of the site. If not defined, use current site. |      * @param siteId ID of the site. If not defined, use current site. | ||||||
|      * @return Promise resolved with the look ahead (number of days). |      * @returns Promise resolved with the look ahead (number of days). | ||||||
|      */ |      */ | ||||||
|     async getCalendarLookAhead(siteId?: string): Promise<number> { |     async getCalendarLookAhead(siteId?: string): Promise<number> { | ||||||
|         const site = await CoreSites.getSite(siteId); |         const site = await CoreSites.getSite(siteId); | ||||||
| @ -527,7 +527,7 @@ export class AddonCalendarProvider { | |||||||
|      * Get the time format to use in calendar. |      * Get the time format to use in calendar. | ||||||
|      * |      * | ||||||
|      * @param siteId ID of the site. If not defined, use current site. |      * @param siteId ID of the site. If not defined, use current site. | ||||||
|      * @return Promise resolved with the format. |      * @returns Promise resolved with the format. | ||||||
|      */ |      */ | ||||||
|     async getCalendarTimeFormat(siteId?: string): Promise<string> { |     async getCalendarTimeFormat(siteId?: string): Promise<string> { | ||||||
|         const site = await CoreSites.getSite(siteId); |         const site = await CoreSites.getSite(siteId); | ||||||
| @ -557,7 +557,7 @@ export class AddonCalendarProvider { | |||||||
|      * |      * | ||||||
|      * @param time Timestamp to get the day from. |      * @param time Timestamp to get the day from. | ||||||
|      * @param useCommonWords Whether to use common words like "Today", "Yesterday", etc. |      * @param useCommonWords Whether to use common words like "Today", "Yesterday", etc. | ||||||
|      * @return The formatted date/time. |      * @returns The formatted date/time. | ||||||
|      */ |      */ | ||||||
|     getDayRepresentation(time: number, useCommonWords: boolean = true): string { |     getDayRepresentation(time: number, useCommonWords: boolean = true): string { | ||||||
| 
 | 
 | ||||||
| @ -586,7 +586,7 @@ export class AddonCalendarProvider { | |||||||
|      * Get the configured default notification time. |      * Get the configured default notification time. | ||||||
|      * |      * | ||||||
|      * @param siteId ID of the site. If not defined, use current site. |      * @param siteId ID of the site. If not defined, use current site. | ||||||
|      * @return Promise resolved with the default time (in seconds). |      * @returns Promise resolved with the default time (in seconds). | ||||||
|      * @deprecated since 4.1 Use CoreReminders.getDefaultNotificationTime instead. |      * @deprecated since 4.1 Use CoreReminders.getDefaultNotificationTime instead. | ||||||
|      */ |      */ | ||||||
|     async getDefaultNotificationTime(siteId?: string): Promise<number> { |     async getDefaultNotificationTime(siteId?: string): Promise<number> { | ||||||
| @ -598,7 +598,7 @@ export class AddonCalendarProvider { | |||||||
|      * |      * | ||||||
|      * @param id Event ID. |      * @param id Event ID. | ||||||
|      * @param siteId ID of the site. If not defined, use current site. |      * @param siteId ID of the site. If not defined, use current site. | ||||||
|      * @return Promise resolved when the event data is retrieved. |      * @returns Promise resolved when the event data is retrieved. | ||||||
|      */ |      */ | ||||||
|     async getEvent(id: number, siteId?: string): Promise<AddonCalendarGetEventsEvent | AddonCalendarEventBase> { |     async getEvent(id: number, siteId?: string): Promise<AddonCalendarGetEventsEvent | AddonCalendarEventBase> { | ||||||
|         const site = await CoreSites.getSite(siteId); |         const site = await CoreSites.getSite(siteId); | ||||||
| @ -634,7 +634,7 @@ export class AddonCalendarProvider { | |||||||
|      * |      * | ||||||
|      * @param id Event ID. |      * @param id Event ID. | ||||||
|      * @param siteId ID of the site. If not defined, use current site. |      * @param siteId ID of the site. If not defined, use current site. | ||||||
|      * @return Promise resolved when the event data is retrieved. |      * @returns Promise resolved when the event data is retrieved. | ||||||
|      */ |      */ | ||||||
|     async getEventById(id: number, siteId?: string): Promise<AddonCalendarEvent> { |     async getEventById(id: number, siteId?: string): Promise<AddonCalendarEvent> { | ||||||
|         const site = await CoreSites.getSite(siteId); |         const site = await CoreSites.getSite(siteId); | ||||||
| @ -666,7 +666,7 @@ export class AddonCalendarProvider { | |||||||
|      * Get cache key for a single event WS call. |      * Get cache key for a single event WS call. | ||||||
|      * |      * | ||||||
|      * @param id Event ID. |      * @param id Event ID. | ||||||
|      * @return Cache key. |      * @returns Cache key. | ||||||
|      */ |      */ | ||||||
|     protected getEventCacheKey(id: number): string { |     protected getEventCacheKey(id: number): string { | ||||||
|         return ROOT_CACHE_KEY + 'events:' + id; |         return ROOT_CACHE_KEY + 'events:' + id; | ||||||
| @ -677,7 +677,7 @@ export class AddonCalendarProvider { | |||||||
|      * |      * | ||||||
|      * @param id Event ID. |      * @param id Event ID. | ||||||
|      * @param siteId ID of the site the event belongs to. If not defined, use current site. |      * @param siteId ID of the site the event belongs to. If not defined, use current site. | ||||||
|      * @return Promise resolved when the event data is retrieved. |      * @returns Promise resolved when the event data is retrieved. | ||||||
|      */ |      */ | ||||||
|     async getEventFromLocalDb(id: number, siteId?: string): Promise<AddonCalendarGetEventsEvent | AddonCalendarEvent> { |     async getEventFromLocalDb(id: number, siteId?: string): Promise<AddonCalendarGetEventsEvent | AddonCalendarEvent> { | ||||||
|         const site = await CoreSites.getSite(siteId); |         const site = await CoreSites.getSite(siteId); | ||||||
| @ -719,7 +719,7 @@ export class AddonCalendarProvider { | |||||||
|      * @param event Event to set the reminder. |      * @param event Event to set the reminder. | ||||||
|      * @param timebefore Amount of seconds of the reminder. Undefined for default reminder. |      * @param timebefore Amount of seconds of the reminder. Undefined for default reminder. | ||||||
|      * @param siteId ID of the site the event belongs to. If not defined, use current site. |      * @param siteId ID of the site the event belongs to. If not defined, use current site. | ||||||
|      * @return Promise resolved when the notification is updated. |      * @returns Promise resolved when the notification is updated. | ||||||
|      */ |      */ | ||||||
|     async addEventReminder( |     async addEventReminder( | ||||||
|         event: AddonCalendarEvent | AddonCalendarEventDBRecord | AddonCalendarEventToDisplay | AddonCalendarOfflineEventDBRecord, |         event: AddonCalendarEvent | AddonCalendarEventDBRecord | AddonCalendarEventToDisplay | AddonCalendarOfflineEventDBRecord, | ||||||
| @ -761,7 +761,7 @@ export class AddonCalendarProvider { | |||||||
|      * Activity events are normalised to be course events. |      * Activity events are normalised to be course events. | ||||||
|      * |      * | ||||||
|      * @param event The event to get its type. |      * @param event The event to get its type. | ||||||
|      * @return Event type. |      * @returns Event type. | ||||||
|      */ |      */ | ||||||
|     getEventType(event: { modulename?: string; eventtype: AddonCalendarEventType | string }): string { |     getEventType(event: { modulename?: string; eventtype: AddonCalendarEventType | string }): string { | ||||||
|         if (event.modulename) { |         if (event.modulename) { | ||||||
| @ -776,7 +776,7 @@ export class AddonCalendarProvider { | |||||||
|      * |      * | ||||||
|      * @param id Reminder ID. |      * @param id Reminder ID. | ||||||
|      * @param siteId ID of the site the event belongs to. If not defined, use current site. |      * @param siteId ID of the site the event belongs to. If not defined, use current site. | ||||||
|      * @return Promise resolved when the notification is updated. |      * @returns Promise resolved when the notification is updated. | ||||||
|      * @deprecated since 4.1. Use CoreReminders.removeReminder instead. |      * @deprecated since 4.1. Use CoreReminders.removeReminder instead. | ||||||
|      */ |      */ | ||||||
|     async deleteEventReminder(id: number, siteId?: string): Promise<void> { |     async deleteEventReminder(id: number, siteId?: string): Promise<void> { | ||||||
| @ -793,7 +793,7 @@ export class AddonCalendarProvider { | |||||||
|      * @param categoryId Category to get. |      * @param categoryId Category to get. | ||||||
|      * @param ignoreCache True if it should ignore cached data (it will always fail in offline or server down). |      * @param ignoreCache True if it should ignore cached data (it will always fail in offline or server down). | ||||||
|      * @param siteId Site ID. If not defined, current site. |      * @param siteId Site ID. If not defined, current site. | ||||||
|      * @return Promise resolved with the response. |      * @returns Promise resolved with the response. | ||||||
|      */ |      */ | ||||||
|     async getDayEvents( |     async getDayEvents( | ||||||
|         year: number, |         year: number, | ||||||
| @ -835,7 +835,7 @@ export class AddonCalendarProvider { | |||||||
|     /** |     /** | ||||||
|      * Get prefix cache key for day events WS calls. |      * Get prefix cache key for day events WS calls. | ||||||
|      * |      * | ||||||
|      * @return Prefix Cache key. |      * @returns Prefix Cache key. | ||||||
|      */ |      */ | ||||||
|     protected getDayEventsPrefixCacheKey(): string { |     protected getDayEventsPrefixCacheKey(): string { | ||||||
|         return ROOT_CACHE_KEY + 'day:'; |         return ROOT_CACHE_KEY + 'day:'; | ||||||
| @ -847,7 +847,7 @@ export class AddonCalendarProvider { | |||||||
|      * @param year Year to get. |      * @param year Year to get. | ||||||
|      * @param month Month to get. |      * @param month Month to get. | ||||||
|      * @param day Day to get. |      * @param day Day to get. | ||||||
|      * @return Prefix Cache key. |      * @returns Prefix Cache key. | ||||||
|      */ |      */ | ||||||
|     protected getDayEventsDayPrefixCacheKey(year: number, month: number, day: number): string { |     protected getDayEventsDayPrefixCacheKey(year: number, month: number, day: number): string { | ||||||
|         return this.getDayEventsPrefixCacheKey() + year + ':' + month + ':' + day + ':'; |         return this.getDayEventsPrefixCacheKey() + year + ':' + month + ':' + day + ':'; | ||||||
| @ -861,7 +861,7 @@ export class AddonCalendarProvider { | |||||||
|      * @param day Day to get. |      * @param day Day to get. | ||||||
|      * @param courseId Course to get. |      * @param courseId Course to get. | ||||||
|      * @param categoryId Category to get. |      * @param categoryId Category to get. | ||||||
|      * @return Cache key. |      * @returns Cache key. | ||||||
|      */ |      */ | ||||||
|     protected getDayEventsCacheKey(year: number, month: number, day: number, courseId?: number, categoryId?: number): string { |     protected getDayEventsCacheKey(year: number, month: number, day: number, courseId?: number, categoryId?: number): string { | ||||||
|         return this.getDayEventsDayPrefixCacheKey(year, month, day) + (courseId ? courseId : '') + ':' + |         return this.getDayEventsDayPrefixCacheKey(year, month, day) + (courseId ? courseId : '') + ':' + | ||||||
| @ -873,7 +873,7 @@ export class AddonCalendarProvider { | |||||||
|      * |      * | ||||||
|      * @param eventId Event ID. |      * @param eventId Event ID. | ||||||
|      * @param siteId ID of the site the event belongs to. If not defined, use current site. |      * @param siteId ID of the site the event belongs to. If not defined, use current site. | ||||||
|      * @return Promise resolved when the event data is retrieved. |      * @returns Promise resolved when the event data is retrieved. | ||||||
|      * @deprecated since 4.1. Use CoreReminders.getReminders instead. |      * @deprecated since 4.1. Use CoreReminders.getReminders instead. | ||||||
|      */ |      */ | ||||||
|     async getEventReminders(eventId: number, siteId?: string): Promise<CoreReminderDBRecord[]> { |     async getEventReminders(eventId: number, siteId?: string): Promise<CoreReminderDBRecord[]> { | ||||||
| @ -894,7 +894,7 @@ export class AddonCalendarProvider { | |||||||
|      * @param daysToStart Number of days from now to start getting events. |      * @param daysToStart Number of days from now to start getting events. | ||||||
|      * @param daysInterval Number of days between timestart and timeend. |      * @param daysInterval Number of days between timestart and timeend. | ||||||
|      * @param siteId Site to get the events from. If not defined, use current site. |      * @param siteId Site to get the events from. If not defined, use current site. | ||||||
|      * @return Promise to be resolved when the events are retrieved. |      * @returns Promise to be resolved when the events are retrieved. | ||||||
|      */ |      */ | ||||||
|     async getEventsList( |     async getEventsList( | ||||||
|         initialTime?: number, |         initialTime?: number, | ||||||
| @ -958,7 +958,7 @@ export class AddonCalendarProvider { | |||||||
|     /** |     /** | ||||||
|      * Get prefix cache key for events list WS calls. |      * Get prefix cache key for events list WS calls. | ||||||
|      * |      * | ||||||
|      * @return Prefix Cache key. |      * @returns Prefix Cache key. | ||||||
|      */ |      */ | ||||||
|     protected getEventsListPrefixCacheKey(): string { |     protected getEventsListPrefixCacheKey(): string { | ||||||
|         return ROOT_CACHE_KEY + 'events:'; |         return ROOT_CACHE_KEY + 'events:'; | ||||||
| @ -969,7 +969,7 @@ export class AddonCalendarProvider { | |||||||
|      * |      * | ||||||
|      * @param daysToStart Number of days from now to start getting events. |      * @param daysToStart Number of days from now to start getting events. | ||||||
|      * @param daysInterval Number of days between timestart and timeend. |      * @param daysInterval Number of days between timestart and timeend. | ||||||
|      * @return Cache key. |      * @returns Cache key. | ||||||
|      */ |      */ | ||||||
|     protected getEventsListCacheKey(daysToStart: number, daysInterval: number): string { |     protected getEventsListCacheKey(daysToStart: number, daysInterval: number): string { | ||||||
|         return this.getEventsListPrefixCacheKey() + daysToStart + ':' + daysInterval; |         return this.getEventsListPrefixCacheKey() + daysToStart + ':' + daysInterval; | ||||||
| @ -980,7 +980,7 @@ export class AddonCalendarProvider { | |||||||
|      * |      * | ||||||
|      * @param repeatId Repeat Id of the event. |      * @param repeatId Repeat Id of the event. | ||||||
|      * @param siteId ID of the site the event belongs to. If not defined, use current site. |      * @param siteId ID of the site the event belongs to. If not defined, use current site. | ||||||
|      * @return Promise resolved with all the events. |      * @returns Promise resolved with all the events. | ||||||
|      */ |      */ | ||||||
|     async getLocalEventsByRepeatIdFromLocalDb(repeatId: number, siteId?: string): Promise<AddonCalendarEventDBRecord[]> { |     async getLocalEventsByRepeatIdFromLocalDb(repeatId: number, siteId?: string): Promise<AddonCalendarEventDBRecord[]> { | ||||||
|         const site = await CoreSites.getSite(siteId); |         const site = await CoreSites.getSite(siteId); | ||||||
| @ -997,7 +997,7 @@ export class AddonCalendarProvider { | |||||||
|      * @param categoryId Category to get. |      * @param categoryId Category to get. | ||||||
|      * @param ignoreCache True if it should ignore cached data (it will always fail in offline or server down). |      * @param ignoreCache True if it should ignore cached data (it will always fail in offline or server down). | ||||||
|      * @param siteId Site ID. If not defined, current site. |      * @param siteId Site ID. If not defined, current site. | ||||||
|      * @return Promise resolved with the response. |      * @returns Promise resolved with the response. | ||||||
|      */ |      */ | ||||||
|     async getMonthlyEvents( |     async getMonthlyEvents( | ||||||
|         year: number, |         year: number, | ||||||
| @ -1049,7 +1049,7 @@ export class AddonCalendarProvider { | |||||||
|     /** |     /** | ||||||
|      * Get prefix cache key for monthly events WS calls. |      * Get prefix cache key for monthly events WS calls. | ||||||
|      * |      * | ||||||
|      * @return Prefix Cache key. |      * @returns Prefix Cache key. | ||||||
|      */ |      */ | ||||||
|     protected getMonthlyEventsPrefixCacheKey(): string { |     protected getMonthlyEventsPrefixCacheKey(): string { | ||||||
|         return ROOT_CACHE_KEY + 'monthly:'; |         return ROOT_CACHE_KEY + 'monthly:'; | ||||||
| @ -1060,7 +1060,7 @@ export class AddonCalendarProvider { | |||||||
|      * |      * | ||||||
|      * @param year Year to get. |      * @param year Year to get. | ||||||
|      * @param month Month to get. |      * @param month Month to get. | ||||||
|      * @return Prefix Cache key. |      * @returns Prefix Cache key. | ||||||
|      */ |      */ | ||||||
|     protected getMonthlyEventsMonthPrefixCacheKey(year: number, month: number): string { |     protected getMonthlyEventsMonthPrefixCacheKey(year: number, month: number): string { | ||||||
|         return this.getMonthlyEventsPrefixCacheKey() + year + ':' + month + ':'; |         return this.getMonthlyEventsPrefixCacheKey() + year + ':' + month + ':'; | ||||||
| @ -1073,7 +1073,7 @@ export class AddonCalendarProvider { | |||||||
|      * @param month Month to get. |      * @param month Month to get. | ||||||
|      * @param courseId Course to get. |      * @param courseId Course to get. | ||||||
|      * @param categoryId Category to get. |      * @param categoryId Category to get. | ||||||
|      * @return Cache key. |      * @returns Cache key. | ||||||
|      */ |      */ | ||||||
|     protected getMonthlyEventsCacheKey(year: number, month: number, courseId?: number, categoryId?: number): string { |     protected getMonthlyEventsCacheKey(year: number, month: number, courseId?: number, categoryId?: number): string { | ||||||
|         return this.getMonthlyEventsMonthPrefixCacheKey(year, month) + (courseId ? courseId : '') + ':' + |         return this.getMonthlyEventsMonthPrefixCacheKey(year, month) + (courseId ? courseId : '') + ':' + | ||||||
| @ -1086,7 +1086,7 @@ export class AddonCalendarProvider { | |||||||
|      * @param value Value. |      * @param value Value. | ||||||
|      * @param unit Unit. |      * @param unit Unit. | ||||||
|      * @param addDefaultLabel Whether to add the "Default" text. |      * @param addDefaultLabel Whether to add the "Default" text. | ||||||
|      * @return Translated label. |      * @returns Translated label. | ||||||
|      * @deprecated since 4.1 Use CoreReminders.getUnitValueLabel instead. |      * @deprecated since 4.1 Use CoreReminders.getUnitValueLabel instead. | ||||||
|      */ |      */ | ||||||
|     getUnitValueLabel(value: number, unit: CoreRemindersUnits, addDefaultLabel = false): string { |     getUnitValueLabel(value: number, unit: CoreRemindersUnits, addDefaultLabel = false): string { | ||||||
| @ -1100,7 +1100,7 @@ export class AddonCalendarProvider { | |||||||
|      * @param categoryId Category to get. |      * @param categoryId Category to get. | ||||||
|      * @param ignoreCache True if it should ignore cached data (it will always fail in offline or server down). |      * @param ignoreCache True if it should ignore cached data (it will always fail in offline or server down). | ||||||
|      * @param siteId Site ID. If not defined, current site. |      * @param siteId Site ID. If not defined, current site. | ||||||
|      * @return Promise resolved with the response. |      * @returns Promise resolved with the response. | ||||||
|      */ |      */ | ||||||
|     async getUpcomingEvents( |     async getUpcomingEvents( | ||||||
|         courseId?: number, |         courseId?: number, | ||||||
| @ -1140,7 +1140,7 @@ export class AddonCalendarProvider { | |||||||
|     /** |     /** | ||||||
|      * Get prefix cache key for upcoming events WS calls. |      * Get prefix cache key for upcoming events WS calls. | ||||||
|      * |      * | ||||||
|      * @return Prefix Cache key. |      * @returns Prefix Cache key. | ||||||
|      */ |      */ | ||||||
|     protected getUpcomingEventsPrefixCacheKey(): string { |     protected getUpcomingEventsPrefixCacheKey(): string { | ||||||
|         return ROOT_CACHE_KEY + 'upcoming:'; |         return ROOT_CACHE_KEY + 'upcoming:'; | ||||||
| @ -1151,7 +1151,7 @@ export class AddonCalendarProvider { | |||||||
|      * |      * | ||||||
|      * @param courseId Course to get. |      * @param courseId Course to get. | ||||||
|      * @param categoryId Category to get. |      * @param categoryId Category to get. | ||||||
|      * @return Cache key. |      * @returns Cache key. | ||||||
|      */ |      */ | ||||||
|     protected getUpcomingEventsCacheKey(courseId?: number, categoryId?: number): string { |     protected getUpcomingEventsCacheKey(courseId?: number, categoryId?: number): string { | ||||||
|         return this.getUpcomingEventsPrefixCacheKey() + (courseId ? courseId : '') + ':' + (categoryId ? categoryId : ''); |         return this.getUpcomingEventsPrefixCacheKey() + (courseId ? courseId : '') + ':' + (categoryId ? categoryId : ''); | ||||||
| @ -1164,7 +1164,7 @@ export class AddonCalendarProvider { | |||||||
|      * @param time Time to load. If not defined, current time. |      * @param time Time to load. If not defined, current time. | ||||||
|      * @param courseId Course to load. If not defined, all courses. |      * @param courseId Course to load. If not defined, all courses. | ||||||
|      * @param siteId Site ID. If not defined, current site. |      * @param siteId Site ID. If not defined, current site. | ||||||
|      * @return Promise resolved with the URL.x |      * @returns Promise resolved with the URL.x | ||||||
|      */ |      */ | ||||||
|     async getViewUrl(view: string, time?: number, courseId?: string, siteId?: string): Promise<string> { |     async getViewUrl(view: string, time?: number, courseId?: string, siteId?: string): Promise<string> { | ||||||
|         const site = await CoreSites.getSite(siteId); |         const site = await CoreSites.getSite(siteId); | ||||||
| @ -1184,7 +1184,7 @@ export class AddonCalendarProvider { | |||||||
|      * Get the week days, already ordered according to a specified starting day. |      * Get the week days, already ordered according to a specified starting day. | ||||||
|      * |      * | ||||||
|      * @param startingDay Starting day. 0=Sunday, 1=Monday, ... |      * @param startingDay Starting day. 0=Sunday, 1=Monday, ... | ||||||
|      * @return Week days. |      * @returns Week days. | ||||||
|      */ |      */ | ||||||
|     getWeekDays(startingDay?: number): AddonCalendarWeekDaysTranslationKeys[] { |     getWeekDays(startingDay?: number): AddonCalendarWeekDaysTranslationKeys[] { | ||||||
|         startingDay = startingDay || 0; |         startingDay = startingDay || 0; | ||||||
| @ -1197,7 +1197,7 @@ export class AddonCalendarProvider { | |||||||
|      * |      * | ||||||
|      * @param courseId Course ID. If not defined, site calendar. |      * @param courseId Course ID. If not defined, site calendar. | ||||||
|      * @param siteId Site ID. If not defined, current site. |      * @param siteId Site ID. If not defined, current site. | ||||||
|      * @return Promise resolved when the data is invalidated. |      * @returns Promise resolved when the data is invalidated. | ||||||
|      */ |      */ | ||||||
|     async invalidateAccessInformation(courseId?: number, siteId?: string): Promise<void> { |     async invalidateAccessInformation(courseId?: number, siteId?: string): Promise<void> { | ||||||
|         const site = await CoreSites.getSite(siteId); |         const site = await CoreSites.getSite(siteId); | ||||||
| @ -1210,7 +1210,7 @@ export class AddonCalendarProvider { | |||||||
|      * |      * | ||||||
|      * @param courseId Course ID. If not defined, site calendar. |      * @param courseId Course ID. If not defined, site calendar. | ||||||
|      * @param siteId Site ID. If not defined, current site. |      * @param siteId Site ID. If not defined, current site. | ||||||
|      * @return Promise resolved when the data is invalidated. |      * @returns Promise resolved when the data is invalidated. | ||||||
|      */ |      */ | ||||||
|     async invalidateAllowedEventTypes(courseId?: number, siteId?: string): Promise<void> { |     async invalidateAllowedEventTypes(courseId?: number, siteId?: string): Promise<void> { | ||||||
|         const site = await CoreSites.getSite(siteId); |         const site = await CoreSites.getSite(siteId); | ||||||
| @ -1222,7 +1222,7 @@ export class AddonCalendarProvider { | |||||||
|      * Invalidates day events for all days. |      * Invalidates day events for all days. | ||||||
|      * |      * | ||||||
|      * @param siteId Site Id. If not defined, use current site. |      * @param siteId Site Id. If not defined, use current site. | ||||||
|      * @return Promise resolved when the data is invalidated. |      * @returns Promise resolved when the data is invalidated. | ||||||
|      */ |      */ | ||||||
|     async invalidateAllDayEvents(siteId?: string): Promise<void> { |     async invalidateAllDayEvents(siteId?: string): Promise<void> { | ||||||
|         const site = await CoreSites.getSite(siteId); |         const site = await CoreSites.getSite(siteId); | ||||||
| @ -1236,7 +1236,7 @@ export class AddonCalendarProvider { | |||||||
|      * @param year Year. |      * @param year Year. | ||||||
|      * @param month Month. |      * @param month Month. | ||||||
|      * @param day Day. |      * @param day Day. | ||||||
|      * @return Promise resolved when the data is invalidated. |      * @returns Promise resolved when the data is invalidated. | ||||||
|      */ |      */ | ||||||
|     async invalidateDayEvents(year: number, month: number, day: number, siteId?: string): Promise<void> { |     async invalidateDayEvents(year: number, month: number, day: number, siteId?: string): Promise<void> { | ||||||
|         const site = await CoreSites.getSite(siteId); |         const site = await CoreSites.getSite(siteId); | ||||||
| @ -1248,7 +1248,7 @@ export class AddonCalendarProvider { | |||||||
|      * Invalidates events list and all the single events and related info. |      * Invalidates events list and all the single events and related info. | ||||||
|      * |      * | ||||||
|      * @param siteId Site Id. If not defined, use current site. |      * @param siteId Site Id. If not defined, use current site. | ||||||
|      * @return Promise resolved when the list is invalidated. |      * @returns Promise resolved when the list is invalidated. | ||||||
|      */ |      */ | ||||||
|     async invalidateEventsList(siteId?: string): Promise<void> { |     async invalidateEventsList(siteId?: string): Promise<void> { | ||||||
|         const site = await CoreSites.getSite(siteId); |         const site = await CoreSites.getSite(siteId); | ||||||
| @ -1267,7 +1267,7 @@ export class AddonCalendarProvider { | |||||||
|      * |      * | ||||||
|      * @param eventId List of courses or course ids. |      * @param eventId List of courses or course ids. | ||||||
|      * @param siteId Site Id. If not defined, use current site. |      * @param siteId Site Id. If not defined, use current site. | ||||||
|      * @return Promise resolved when the list is invalidated. |      * @returns Promise resolved when the list is invalidated. | ||||||
|      */ |      */ | ||||||
|     async invalidateEvent(eventId: number, siteId?: string): Promise<void> { |     async invalidateEvent(eventId: number, siteId?: string): Promise<void> { | ||||||
|         const site = await CoreSites.getSite(siteId); |         const site = await CoreSites.getSite(siteId); | ||||||
| @ -1279,7 +1279,7 @@ export class AddonCalendarProvider { | |||||||
|      * Invalidates monthly events for all months. |      * Invalidates monthly events for all months. | ||||||
|      * |      * | ||||||
|      * @param siteId Site Id. If not defined, use current site. |      * @param siteId Site Id. If not defined, use current site. | ||||||
|      * @return Promise resolved when the data is invalidated. |      * @returns Promise resolved when the data is invalidated. | ||||||
|      */ |      */ | ||||||
|     async invalidateAllMonthlyEvents(siteId?: string): Promise<void> { |     async invalidateAllMonthlyEvents(siteId?: string): Promise<void> { | ||||||
|         const site = await CoreSites.getSite(siteId); |         const site = await CoreSites.getSite(siteId); | ||||||
| @ -1292,7 +1292,7 @@ export class AddonCalendarProvider { | |||||||
|      * |      * | ||||||
|      * @param year Year. |      * @param year Year. | ||||||
|      * @param month Month. |      * @param month Month. | ||||||
|      * @return Promise resolved when the data is invalidated. |      * @returns Promise resolved when the data is invalidated. | ||||||
|      */ |      */ | ||||||
|     async invalidateMonthlyEvents(year: number, month: number, siteId?: string): Promise<void> { |     async invalidateMonthlyEvents(year: number, month: number, siteId?: string): Promise<void> { | ||||||
|         const site = await CoreSites.getSite(siteId); |         const site = await CoreSites.getSite(siteId); | ||||||
| @ -1304,7 +1304,7 @@ export class AddonCalendarProvider { | |||||||
|      * Invalidates upcoming events for all courses and categories. |      * Invalidates upcoming events for all courses and categories. | ||||||
|      * |      * | ||||||
|      * @param siteId Site Id. If not defined, use current site. |      * @param siteId Site Id. If not defined, use current site. | ||||||
|      * @return Promise resolved when the data is invalidated. |      * @returns Promise resolved when the data is invalidated. | ||||||
|      */ |      */ | ||||||
|     async invalidateAllUpcomingEvents(siteId?: string): Promise<void> { |     async invalidateAllUpcomingEvents(siteId?: string): Promise<void> { | ||||||
|         const site = await CoreSites.getSite(siteId); |         const site = await CoreSites.getSite(siteId); | ||||||
| @ -1318,7 +1318,7 @@ export class AddonCalendarProvider { | |||||||
|      * @param courseId Course ID. |      * @param courseId Course ID. | ||||||
|      * @param categoryId Category ID. |      * @param categoryId Category ID. | ||||||
|      * @param siteId Site Id. If not defined, use current site. |      * @param siteId Site Id. If not defined, use current site. | ||||||
|      * @return Promise resolved when the data is invalidated. |      * @returns Promise resolved when the data is invalidated. | ||||||
|      */ |      */ | ||||||
|     async invalidateUpcomingEvents(courseId?: number, categoryId?: number, siteId?: string): Promise<void> { |     async invalidateUpcomingEvents(courseId?: number, categoryId?: number, siteId?: string): Promise<void> { | ||||||
|         const site = await CoreSites.getSite(siteId); |         const site = await CoreSites.getSite(siteId); | ||||||
| @ -1330,7 +1330,7 @@ export class AddonCalendarProvider { | |||||||
|      * Invalidates look ahead setting. |      * Invalidates look ahead setting. | ||||||
|      * |      * | ||||||
|      * @param siteId Site Id. If not defined, use current site. |      * @param siteId Site Id. If not defined, use current site. | ||||||
|      * @return Promise resolved when the data is invalidated. |      * @returns Promise resolved when the data is invalidated. | ||||||
|      */ |      */ | ||||||
|     async invalidateLookAhead(siteId?: string): Promise<void> { |     async invalidateLookAhead(siteId?: string): Promise<void> { | ||||||
|         await CoreUser.invalidateUserPreference('calendar_lookahead', siteId); |         await CoreUser.invalidateUserPreference('calendar_lookahead', siteId); | ||||||
| @ -1340,7 +1340,7 @@ export class AddonCalendarProvider { | |||||||
|      * Invalidates time format setting. |      * Invalidates time format setting. | ||||||
|      * |      * | ||||||
|      * @param siteId Site Id. If not defined, use current site. |      * @param siteId Site Id. If not defined, use current site. | ||||||
|      * @return Promise resolved when the data is invalidated. |      * @returns Promise resolved when the data is invalidated. | ||||||
|      */ |      */ | ||||||
|     invalidateTimeFormat(siteId?: string): Promise<void> { |     invalidateTimeFormat(siteId?: string): Promise<void> { | ||||||
|         return CoreUser.invalidateUserPreference('calendar_timeformat', siteId); |         return CoreUser.invalidateUserPreference('calendar_timeformat', siteId); | ||||||
| @ -1350,7 +1350,7 @@ export class AddonCalendarProvider { | |||||||
|      * Check if Calendar is disabled in a certain site. |      * Check if Calendar is disabled in a certain site. | ||||||
|      * |      * | ||||||
|      * @param site Site. If not defined, use current site. |      * @param site Site. If not defined, use current site. | ||||||
|      * @return Whether it's disabled. |      * @returns Whether it's disabled. | ||||||
|      */ |      */ | ||||||
|     isCalendarDisabledInSite(site?: CoreSite): boolean { |     isCalendarDisabledInSite(site?: CoreSite): boolean { | ||||||
|         site = site || CoreSites.getCurrentSite(); |         site = site || CoreSites.getCurrentSite(); | ||||||
| @ -1362,7 +1362,7 @@ export class AddonCalendarProvider { | |||||||
|      * Check if Calendar is disabled in a certain site. |      * Check if Calendar is disabled in a certain site. | ||||||
|      * |      * | ||||||
|      * @param siteId Site Id. If not defined, use current site. |      * @param siteId Site Id. If not defined, use current site. | ||||||
|      * @return Promise resolved with true if disabled, rejected or resolved with false otherwise. |      * @returns Promise resolved with true if disabled, rejected or resolved with false otherwise. | ||||||
|      */ |      */ | ||||||
|     async isDisabled(siteId?: string): Promise<boolean> { |     async isDisabled(siteId?: string): Promise<boolean> { | ||||||
|         const site = await CoreSites.getSite(siteId); |         const site = await CoreSites.getSite(siteId); | ||||||
| @ -1373,7 +1373,7 @@ export class AddonCalendarProvider { | |||||||
|     /** |     /** | ||||||
|      * Get the next events for all the sites and schedules their notifications. |      * Get the next events for all the sites and schedules their notifications. | ||||||
|      * |      * | ||||||
|      * @return Promise resolved when done. |      * @returns Promise resolved when done. | ||||||
|      * @deprecated since 4.1 Use AddonCalendar.updateAllSitesEventReminders. |      * @deprecated since 4.1 Use AddonCalendar.updateAllSitesEventReminders. | ||||||
|      */ |      */ | ||||||
|     async scheduleAllSitesEventsNotifications(): Promise<void> { |     async scheduleAllSitesEventsNotifications(): Promise<void> { | ||||||
| @ -1385,7 +1385,7 @@ export class AddonCalendarProvider { | |||||||
|      * If an event notification time is 0, cancel its scheduled notification (if any). |      * If an event notification time is 0, cancel its scheduled notification (if any). | ||||||
|      * If local notification plugin is not enabled, resolve the promise. |      * If local notification plugin is not enabled, resolve the promise. | ||||||
|      * |      * | ||||||
|      * @return Promise resolved when all the notifications have been scheduled. |      * @returns Promise resolved when all the notifications have been scheduled. | ||||||
|      */ |      */ | ||||||
|     async updateAllSitesEventReminders(): Promise<void> { |     async updateAllSitesEventReminders(): Promise<void> { | ||||||
|         await CorePlatform.ready(); |         await CorePlatform.ready(); | ||||||
| @ -1407,7 +1407,7 @@ export class AddonCalendarProvider { | |||||||
|     /** |     /** | ||||||
|      * Get the next events for all the sites and schedules their notifications. |      * Get the next events for all the sites and schedules their notifications. | ||||||
|      * |      * | ||||||
|      * @return Promise resolved when done. |      * @returns Promise resolved when done. | ||||||
|      * @deprecated since 4.1. No replacement for that function. |      * @deprecated since 4.1. No replacement for that function. | ||||||
|      */ |      */ | ||||||
|     async scheduleEventsNotifications( |     async scheduleEventsNotifications( | ||||||
| @ -1426,7 +1426,7 @@ export class AddonCalendarProvider { | |||||||
|      * |      * | ||||||
|      * @param events Events to schedule. |      * @param events Events to schedule. | ||||||
|      * @param siteId ID of the site the events belong to. |      * @param siteId ID of the site the events belong to. | ||||||
|      * @return Promise resolved when all the notifications have been scheduled. |      * @returns Promise resolved when all the notifications have been scheduled. | ||||||
|      */ |      */ | ||||||
|     protected async updateEventsReminders( |     protected async updateEventsReminders( | ||||||
|         events: ({ id: number; timestart: number; name: string})[], |         events: ({ id: number; timestart: number; name: string})[], | ||||||
| @ -1464,7 +1464,7 @@ export class AddonCalendarProvider { | |||||||
|      * |      * | ||||||
|      * @param time New default time. |      * @param time New default time. | ||||||
|      * @param siteId ID of the site. If not defined, use current site. |      * @param siteId ID of the site. If not defined, use current site. | ||||||
|      * @return Promise resolved when stored. |      * @returns Promise resolved when stored. | ||||||
|      * @deprecated since 4.1 Use CoreReminders.setDefaultNotificationTime. |      * @deprecated since 4.1 Use CoreReminders.setDefaultNotificationTime. | ||||||
|      */ |      */ | ||||||
|     async setDefaultNotificationTime(time: number, siteId?: string): Promise<void> { |     async setDefaultNotificationTime(time: number, siteId?: string): Promise<void> { | ||||||
| @ -1476,7 +1476,7 @@ export class AddonCalendarProvider { | |||||||
|      * |      * | ||||||
|      * @param event Event to store. |      * @param event Event to store. | ||||||
|      * @param options Options. |      * @param options Options. | ||||||
|      * @return Promise resolved when stored. |      * @returns Promise resolved when stored. | ||||||
|      */ |      */ | ||||||
|     protected async storeEventInLocalDb( |     protected async storeEventInLocalDb( | ||||||
|         event: AddonCalendarGetEventsEvent | AddonCalendarCalendarEvent | AddonCalendarEvent, |         event: AddonCalendarGetEventsEvent | AddonCalendarCalendarEvent | AddonCalendarEvent, | ||||||
| @ -1578,7 +1578,7 @@ export class AddonCalendarProvider { | |||||||
|      * |      * | ||||||
|      * @param events Events to store. |      * @param events Events to store. | ||||||
|      * @param options Options. |      * @param options Options. | ||||||
|      * @return Promise resolved when the events are stored. |      * @returns Promise resolved when the events are stored. | ||||||
|      */ |      */ | ||||||
|     protected async storeEventsInLocalDB( |     protected async storeEventsInLocalDB( | ||||||
|         events: (AddonCalendarGetEventsEvent | AddonCalendarCalendarEvent | AddonCalendarEvent)[], |         events: (AddonCalendarGetEventsEvent | AddonCalendarCalendarEvent | AddonCalendarEvent)[], | ||||||
| @ -1593,7 +1593,7 @@ export class AddonCalendarProvider { | |||||||
|      * @param eventId ID of the event. Negative value to edit offline event. If undefined/null, create a new event. |      * @param eventId ID of the event. Negative value to edit offline event. If undefined/null, create a new event. | ||||||
|      * @param formData Form data. |      * @param formData Form data. | ||||||
|      * @param options Calendar submit event options. |      * @param options Calendar submit event options. | ||||||
|      * @return Promise resolved with the event and a boolean indicating if data was sent to server or stored in offline. |      * @returns Promise resolved with the event and a boolean indicating if data was sent to server or stored in offline. | ||||||
|      */ |      */ | ||||||
|     async submitEvent( |     async submitEvent( | ||||||
|         eventId: number | undefined, |         eventId: number | undefined, | ||||||
| @ -1656,7 +1656,7 @@ export class AddonCalendarProvider { | |||||||
|      * @param eventId ID of the event. If undefined/null or negative number, create a new event. |      * @param eventId ID of the event. If undefined/null or negative number, create a new event. | ||||||
|      * @param formData Form data. |      * @param formData Form data. | ||||||
|      * @param siteId Site ID. If not provided, current site. |      * @param siteId Site ID. If not provided, current site. | ||||||
|      * @return Promise resolved when done. |      * @returns Promise resolved when done. | ||||||
|      */ |      */ | ||||||
|     async submitEventOnline( |     async submitEventOnline( | ||||||
|         eventId: number = 0, |         eventId: number = 0, | ||||||
|  | |||||||
| @ -31,7 +31,7 @@ export class AddonCalendarMainMenuHandlerService implements CoreMainMenuHandler | |||||||
|     /** |     /** | ||||||
|      * Check if the handler is enabled on a site level. |      * Check if the handler is enabled on a site level. | ||||||
|      * |      * | ||||||
|      * @return Whether or not the handler is enabled on a site level. |      * @returns Whether or not the handler is enabled on a site level. | ||||||
|      */ |      */ | ||||||
|     async isEnabled(): Promise<boolean> { |     async isEnabled(): Promise<boolean> { | ||||||
|         return !AddonCalendar.isCalendarDisabledInSite(); |         return !AddonCalendar.isCalendarDisabledInSite(); | ||||||
| @ -40,7 +40,7 @@ export class AddonCalendarMainMenuHandlerService implements CoreMainMenuHandler | |||||||
|     /** |     /** | ||||||
|      * Returns the data needed to render the handler. |      * Returns the data needed to render the handler. | ||||||
|      * |      * | ||||||
|      * @return Data needed to render the handler. |      * @returns Data needed to render the handler. | ||||||
|      */ |      */ | ||||||
|     getDisplayData(): CoreMainMenuHandlerData { |     getDisplayData(): CoreMainMenuHandlerData { | ||||||
|         return { |         return { | ||||||
|  | |||||||
| @ -31,7 +31,7 @@ export class AddonCalendarSyncCronHandlerService implements CoreCronHandler { | |||||||
|      * |      * | ||||||
|      * @param siteId ID of the site affected, undefined for all sites. |      * @param siteId ID of the site affected, undefined for all sites. | ||||||
|      * @param force Wether the execution is forced (manual sync). |      * @param force Wether the execution is forced (manual sync). | ||||||
|      * @return Promise resolved when done, rejected if failure. |      * @returns Promise resolved when done, rejected if failure. | ||||||
|      */ |      */ | ||||||
|     async execute(siteId?: string, force?: boolean): Promise<void> { |     async execute(siteId?: string, force?: boolean): Promise<void> { | ||||||
|         await AddonCalendarSync.syncAllEvents(siteId, force); |         await AddonCalendarSync.syncAllEvents(siteId, force); | ||||||
| @ -40,7 +40,7 @@ export class AddonCalendarSyncCronHandlerService implements CoreCronHandler { | |||||||
|     /** |     /** | ||||||
|      * Get the time between consecutive executions. |      * Get the time between consecutive executions. | ||||||
|      * |      * | ||||||
|      * @return Time between consecutive executions (in ms). |      * @returns Time between consecutive executions (in ms). | ||||||
|      */ |      */ | ||||||
|     getInterval(): number { |     getInterval(): number { | ||||||
|         return AddonCalendarSync.syncInterval; |         return AddonCalendarSync.syncInterval; | ||||||
|  | |||||||
| @ -39,7 +39,7 @@ export class AddonCalendarViewLinkHandlerService extends CoreContentLinksHandler | |||||||
|      * @param siteIds List of sites the URL belongs to. |      * @param siteIds List of sites the URL belongs to. | ||||||
|      * @param url The URL to treat. |      * @param url The URL to treat. | ||||||
|      * @param params The params of the URL. E.g. 'mysite.com?id=1' -> {id: 1} |      * @param params The params of the URL. E.g. 'mysite.com?id=1' -> {id: 1} | ||||||
|      * @return List of (or promise resolved with list of) actions. |      * @returns List of (or promise resolved with list of) actions. | ||||||
|      */ |      */ | ||||||
|     getActions( |     getActions( | ||||||
|         siteIds: string[], |         siteIds: string[], | ||||||
| @ -104,7 +104,7 @@ export class AddonCalendarViewLinkHandlerService extends CoreContentLinksHandler | |||||||
|      * @param siteId The site ID. |      * @param siteId The site ID. | ||||||
|      * @param url The URL to treat. |      * @param url The URL to treat. | ||||||
|      * @param params The params of the URL. E.g. 'mysite.com?id=1' -> {id: 1} |      * @param params The params of the URL. E.g. 'mysite.com?id=1' -> {id: 1} | ||||||
|      * @return Whether the handler is enabled for the URL and site. |      * @returns Whether the handler is enabled for the URL and site. | ||||||
|      */ |      */ | ||||||
|     async isEnabled(siteId: string, url: string, params: Record<string, string>): Promise<boolean> { |     async isEnabled(siteId: string, url: string, params: Record<string, string>): Promise<boolean> { | ||||||
|         if (params.view && SUPPORTED_VIEWS.indexOf(params.view) == -1) { |         if (params.view && SUPPORTED_VIEWS.indexOf(params.view) == -1) { | ||||||
|  | |||||||
| @ -64,4 +64,4 @@ Feature: Test creation of calendar events in app | |||||||
|     And I press "OK" in the app |     And I press "OK" in the app | ||||||
|     Then the app should have opened a browser tab with url "google.com" |     Then the app should have opened a browser tab with url "google.com" | ||||||
| 
 | 
 | ||||||
|   # @todo: Add more Scenarios to test teacher, different values, and creating events from other views (e.g. day view). |   # @todo Add more Scenarios to test teacher, different values, and creating events from other views (e.g. day view). | ||||||
|  | |||||||
| @ -79,7 +79,7 @@ export class AddonCompetencyCompetenciesPage implements AfterViewInit, OnDestroy | |||||||
|     /** |     /** | ||||||
|      * Fetches the competencies and updates the view. |      * Fetches the competencies and updates the view. | ||||||
|      * |      * | ||||||
|      * @return Promise resolved when done. |      * @returns Promise resolved when done. | ||||||
|      */ |      */ | ||||||
|     protected async fetchCompetencies(): Promise<void> { |     protected async fetchCompetencies(): Promise<void> { | ||||||
|         try { |         try { | ||||||
|  | |||||||
| @ -134,7 +134,7 @@ export class AddonCompetencyCompetencyPage implements OnInit, OnDestroy { | |||||||
|     /** |     /** | ||||||
|      * Fetches the competency and updates the view. |      * Fetches the competency and updates the view. | ||||||
|      * |      * | ||||||
|      * @return Promise resolved when done. |      * @returns Promise resolved when done. | ||||||
|      */ |      */ | ||||||
|     protected async fetchCompetency(): Promise<void> { |     protected async fetchCompetency(): Promise<void> { | ||||||
|         try { |         try { | ||||||
| @ -208,7 +208,7 @@ export class AddonCompetencyCompetencyPage implements OnInit, OnDestroy { | |||||||
|     /** |     /** | ||||||
|      * Opens the summary of a competency. |      * Opens the summary of a competency. | ||||||
|      * |      * | ||||||
|      * @param competencyId |      * @param competencyId Competency Id. | ||||||
|      */ |      */ | ||||||
|     openCompetencySummary(competencyId: number): void { |     openCompetencySummary(competencyId: number): void { | ||||||
|         CoreNavigator.navigate( |         CoreNavigator.navigate( | ||||||
|  | |||||||
| @ -64,7 +64,7 @@ export class AddonCompetencyCompetencySummaryPage implements OnInit { | |||||||
|     /** |     /** | ||||||
|      * Fetches the competency summary and updates the view. |      * Fetches the competency summary and updates the view. | ||||||
|      * |      * | ||||||
|      * @return Promise resolved when done. |      * @returns Promise resolved when done. | ||||||
|      */ |      */ | ||||||
|     protected async fetchCompetency(): Promise<void> { |     protected async fetchCompetency(): Promise<void> { | ||||||
|         try { |         try { | ||||||
| @ -102,7 +102,7 @@ export class AddonCompetencyCompetencySummaryPage implements OnInit { | |||||||
|     /** |     /** | ||||||
|      * Opens the summary of a competency. |      * Opens the summary of a competency. | ||||||
|      * |      * | ||||||
|      * @param competencyId |      * @param competencyId Competency Id. | ||||||
|      */ |      */ | ||||||
|     openCompetencySummary(competencyId: number): void { |     openCompetencySummary(competencyId: number): void { | ||||||
|         CoreNavigator.navigate( |         CoreNavigator.navigate( | ||||||
|  | |||||||
| @ -107,7 +107,7 @@ export class AddonCompetencyCourseCompetenciesPage implements OnInit, OnDestroy | |||||||
|     /** |     /** | ||||||
|      * Fetches the competencies and updates the view. |      * Fetches the competencies and updates the view. | ||||||
|      * |      * | ||||||
|      * @return Promise resolved when done. |      * @returns Promise resolved when done. | ||||||
|      */ |      */ | ||||||
|     protected async fetchCourseCompetencies(): Promise<void> { |     protected async fetchCourseCompetencies(): Promise<void> { | ||||||
|         try { |         try { | ||||||
| @ -120,7 +120,7 @@ export class AddonCompetencyCourseCompetenciesPage implements OnInit, OnDestroy | |||||||
|     /** |     /** | ||||||
|      * Opens the summary of a competency. |      * Opens the summary of a competency. | ||||||
|      * |      * | ||||||
|      * @param competencyId |      * @param competencyId Competency Id. | ||||||
|      */ |      */ | ||||||
|     openCompetencySummary(competencyId: number): void { |     openCompetencySummary(competencyId: number): void { | ||||||
|         CoreNavigator.navigateToSitePath( |         CoreNavigator.navigateToSitePath( | ||||||
|  | |||||||
| @ -88,7 +88,7 @@ export class AddonCompetencyPlanPage implements OnInit, OnDestroy { | |||||||
|     /** |     /** | ||||||
|      * Fetches the learning plan and updates the view. |      * Fetches the learning plan and updates the view. | ||||||
|      * |      * | ||||||
|      * @return Promise resolved when done. |      * @returns Promise resolved when done. | ||||||
|      */ |      */ | ||||||
|     protected async fetchLearningPlan(): Promise<void> { |     protected async fetchLearningPlan(): Promise<void> { | ||||||
|         try { |         try { | ||||||
|  | |||||||
| @ -53,7 +53,7 @@ export class AddonCompetencyPlanListPage implements AfterViewInit, OnDestroy { | |||||||
|     /** |     /** | ||||||
|      * Fetches the learning plans and updates the view. |      * Fetches the learning plans and updates the view. | ||||||
|      * |      * | ||||||
|      * @return Promise resolved when done. |      * @returns Promise resolved when done. | ||||||
|      */ |      */ | ||||||
|     protected async fetchLearningPlans(): Promise<void> { |     protected async fetchLearningPlans(): Promise<void> { | ||||||
|         try { |         try { | ||||||
|  | |||||||
| @ -28,7 +28,7 @@ export class AddonCompetencyHelperProvider { | |||||||
|      * Convenient helper to get the user profile image. |      * Convenient helper to get the user profile image. | ||||||
|      * |      * | ||||||
|      * @param userId User Id |      * @param userId User Id | ||||||
|      * @return User profile Image URL or true if default icon. |      * @returns User profile Image URL or true if default icon. | ||||||
|      */ |      */ | ||||||
|     async getProfile(userId?: number): Promise<CoreUserProfile | undefined> { |     async getProfile(userId?: number): Promise<CoreUserProfile | undefined> { | ||||||
|         if (!userId || userId == CoreSites.getCurrentSiteUserId()) { |         if (!userId || userId == CoreSites.getCurrentSiteUserId()) { | ||||||
| @ -42,7 +42,9 @@ export class AddonCompetencyHelperProvider { | |||||||
|     /** |     /** | ||||||
|      * Get the review status name translated. |      * Get the review status name translated. | ||||||
|      * |      * | ||||||
|      * @param status |      * @param status Competency Status name. | ||||||
|  |      * @returns The status name translated. | ||||||
|  |      * @todo Move statutes into an enum. | ||||||
|      */ |      */ | ||||||
|     getCompetencyStatusName(status: number): string { |     getCompetencyStatusName(status: number): string { | ||||||
|         let statusTranslateName: string; |         let statusTranslateName: string; | ||||||
| @ -67,7 +69,9 @@ export class AddonCompetencyHelperProvider { | |||||||
|     /** |     /** | ||||||
|      * Get the status name translated. |      * Get the status name translated. | ||||||
|      * |      * | ||||||
|      * @param status |      * @param status Plan Status name. | ||||||
|  |      * @returns The status name translated. | ||||||
|  |      * @todo Move statutes into an enum. | ||||||
|      */ |      */ | ||||||
|     getPlanStatusName(status: number): string { |     getPlanStatusName(status: number): string { | ||||||
|         let statusTranslateName: string; |         let statusTranslateName: string; | ||||||
|  | |||||||
| @ -46,7 +46,7 @@ export class AddonCompetencyProvider { | |||||||
|      * Check if all competencies features are disabled. |      * Check if all competencies features are disabled. | ||||||
|      * |      * | ||||||
|      * @param siteId Site ID. If not defined, current site. |      * @param siteId Site ID. If not defined, current site. | ||||||
|      * @return Promise resolved with boolean: whether all competency features are disabled. |      * @returns Promise resolved with boolean: whether all competency features are disabled. | ||||||
|      */ |      */ | ||||||
|     async allCompetenciesDisabled(siteId?: string): Promise<boolean> { |     async allCompetenciesDisabled(siteId?: string): Promise<boolean> { | ||||||
|         const site = await CoreSites.getSite(siteId); |         const site = await CoreSites.getSite(siteId); | ||||||
| @ -62,7 +62,7 @@ export class AddonCompetencyProvider { | |||||||
|      * @param courseId Course ID. |      * @param courseId Course ID. | ||||||
|      * @param userId User ID. |      * @param userId User ID. | ||||||
|      * @param siteId Site ID. If not defined, current site. |      * @param siteId Site ID. If not defined, current site. | ||||||
|      * @return Promise resolved with boolean: whether the user can view the competencies. |      * @returns Promise resolved with boolean: whether the user can view the competencies. | ||||||
|      */ |      */ | ||||||
|     async canViewUserCompetenciesInCourse(courseId: number, userId?: number, siteId?: string): Promise<boolean> { |     async canViewUserCompetenciesInCourse(courseId: number, userId?: number, siteId?: string): Promise<boolean> { | ||||||
|         if (!CoreSites.isLoggedIn()) { |         if (!CoreSites.isLoggedIn()) { | ||||||
| @ -95,7 +95,7 @@ export class AddonCompetencyProvider { | |||||||
|      * Get cache key for user learning plans data WS calls. |      * Get cache key for user learning plans data WS calls. | ||||||
|      * |      * | ||||||
|      * @param userId User ID. |      * @param userId User ID. | ||||||
|      * @return Cache key. |      * @returns Cache key. | ||||||
|      */ |      */ | ||||||
|     protected getLearningPlansCacheKey(userId: number): string { |     protected getLearningPlansCacheKey(userId: number): string { | ||||||
|         return ROOT_CACHE_KEY + 'userplans:' + userId; |         return ROOT_CACHE_KEY + 'userplans:' + userId; | ||||||
| @ -105,7 +105,7 @@ export class AddonCompetencyProvider { | |||||||
|      * Get cache key for learning plan data WS calls. |      * Get cache key for learning plan data WS calls. | ||||||
|      * |      * | ||||||
|      * @param planId Plan ID. |      * @param planId Plan ID. | ||||||
|      * @return Cache key. |      * @returns Cache key. | ||||||
|      */ |      */ | ||||||
|     protected getLearningPlanCacheKey(planId: number): string { |     protected getLearningPlanCacheKey(planId: number): string { | ||||||
|         return ROOT_CACHE_KEY + 'learningplan:' + planId; |         return ROOT_CACHE_KEY + 'learningplan:' + planId; | ||||||
| @ -116,7 +116,7 @@ export class AddonCompetencyProvider { | |||||||
|      * |      * | ||||||
|      * @param planId Plan ID. |      * @param planId Plan ID. | ||||||
|      * @param competencyId Competency ID. |      * @param competencyId Competency ID. | ||||||
|      * @return Cache key. |      * @returns Cache key. | ||||||
|      */ |      */ | ||||||
|     protected getCompetencyInPlanCacheKey(planId: number, competencyId: number): string { |     protected getCompetencyInPlanCacheKey(planId: number, competencyId: number): string { | ||||||
|         return ROOT_CACHE_KEY + 'plancompetency:' + planId + ':' + competencyId; |         return ROOT_CACHE_KEY + 'plancompetency:' + planId + ':' + competencyId; | ||||||
| @ -128,7 +128,7 @@ export class AddonCompetencyProvider { | |||||||
|      * @param courseId Course ID. |      * @param courseId Course ID. | ||||||
|      * @param competencyId Competency ID. |      * @param competencyId Competency ID. | ||||||
|      * @param userId User ID. |      * @param userId User ID. | ||||||
|      * @return Cache key. |      * @returns Cache key. | ||||||
|      */ |      */ | ||||||
|     protected getCompetencyInCourseCacheKey(courseId: number, competencyId: number, userId: number): string { |     protected getCompetencyInCourseCacheKey(courseId: number, competencyId: number, userId: number): string { | ||||||
|         return ROOT_CACHE_KEY + 'coursecompetency:' + userId + ':' + courseId + ':' + competencyId; |         return ROOT_CACHE_KEY + 'coursecompetency:' + userId + ':' + courseId + ':' + competencyId; | ||||||
| @ -139,7 +139,7 @@ export class AddonCompetencyProvider { | |||||||
|      * |      * | ||||||
|      * @param competencyId Competency ID. |      * @param competencyId Competency ID. | ||||||
|      * @param userId User ID. |      * @param userId User ID. | ||||||
|      * @return Cache key. |      * @returns Cache key. | ||||||
|      */ |      */ | ||||||
|     protected getCompetencySummaryCacheKey(competencyId: number, userId: number): string { |     protected getCompetencySummaryCacheKey(competencyId: number, userId: number): string { | ||||||
|         return ROOT_CACHE_KEY + 'competencysummary:' + userId + ':' + competencyId; |         return ROOT_CACHE_KEY + 'competencysummary:' + userId + ':' + competencyId; | ||||||
| @ -149,7 +149,7 @@ export class AddonCompetencyProvider { | |||||||
|      * Get cache key for course competencies data WS calls. |      * Get cache key for course competencies data WS calls. | ||||||
|      * |      * | ||||||
|      * @param courseId Course ID. |      * @param courseId Course ID. | ||||||
|      * @return Cache key. |      * @returns Cache key. | ||||||
|      */ |      */ | ||||||
|     protected getCourseCompetenciesCacheKey(courseId: number): string { |     protected getCourseCompetenciesCacheKey(courseId: number): string { | ||||||
|         return ROOT_CACHE_KEY + 'coursecompetencies:' + courseId; |         return ROOT_CACHE_KEY + 'coursecompetencies:' + courseId; | ||||||
| @ -160,7 +160,7 @@ export class AddonCompetencyProvider { | |||||||
|      * |      * | ||||||
|      * @param courseId Course ID. |      * @param courseId Course ID. | ||||||
|      * @param siteId Site ID. If not defined, current site. |      * @param siteId Site ID. If not defined, current site. | ||||||
|      * @return competencies if enabled for the given course, false otherwise. |      * @returns competencies if enabled for the given course, false otherwise. | ||||||
|      */ |      */ | ||||||
|     async isPluginForCourseEnabled(courseId: number, siteId?: string): Promise<boolean> { |     async isPluginForCourseEnabled(courseId: number, siteId?: string): Promise<boolean> { | ||||||
|         if (!CoreSites.isLoggedIn()) { |         if (!CoreSites.isLoggedIn()) { | ||||||
| @ -175,7 +175,7 @@ export class AddonCompetencyProvider { | |||||||
|      * |      * | ||||||
|      * @param userId ID of the user. If not defined, current user. |      * @param userId ID of the user. If not defined, current user. | ||||||
|      * @param siteId Site ID. If not defined, current site. |      * @param siteId Site ID. If not defined, current site. | ||||||
|      * @return Promise to be resolved when the plans are retrieved. |      * @returns Promise to be resolved when the plans are retrieved. | ||||||
|      */ |      */ | ||||||
|     async getLearningPlans(userId?: number, siteId?: string): Promise<AddonCompetencyPlan[]> { |     async getLearningPlans(userId?: number, siteId?: string): Promise<AddonCompetencyPlan[]> { | ||||||
|         const site = await CoreSites.getSite(siteId); |         const site = await CoreSites.getSite(siteId); | ||||||
| @ -200,7 +200,7 @@ export class AddonCompetencyProvider { | |||||||
|      * |      * | ||||||
|      * @param planId ID of the plan. |      * @param planId ID of the plan. | ||||||
|      * @param siteId Site ID. If not defined, current site. |      * @param siteId Site ID. If not defined, current site. | ||||||
|      * @return Promise to be resolved when the plan is retrieved. |      * @returns Promise to be resolved when the plan is retrieved. | ||||||
|      */ |      */ | ||||||
|     async getLearningPlan(planId: number, siteId?: string): Promise<AddonCompetencyDataForPlanPageWSResponse> { |     async getLearningPlan(planId: number, siteId?: string): Promise<AddonCompetencyDataForPlanPageWSResponse> { | ||||||
|         const site = await CoreSites.getSite(siteId); |         const site = await CoreSites.getSite(siteId); | ||||||
| @ -223,7 +223,7 @@ export class AddonCompetencyProvider { | |||||||
|      * @param planId ID of the plan. |      * @param planId ID of the plan. | ||||||
|      * @param competencyId ID of the competency. |      * @param competencyId ID of the competency. | ||||||
|      * @param siteId Site ID. If not defined, current site. |      * @param siteId Site ID. If not defined, current site. | ||||||
|      * @return Promise to be resolved when the competency is retrieved. |      * @returns Promise to be resolved when the competency is retrieved. | ||||||
|      */ |      */ | ||||||
|     async getCompetencyInPlan( |     async getCompetencyInPlan( | ||||||
|         planId: number, |         planId: number, | ||||||
| @ -257,7 +257,7 @@ export class AddonCompetencyProvider { | |||||||
|      * @param userId ID of the user. If not defined, current user. |      * @param userId ID of the user. If not defined, current user. | ||||||
|      * @param siteId Site ID. If not defined, current site. |      * @param siteId Site ID. If not defined, current site. | ||||||
|      * @param ignoreCache True if it should ignore cached data (it will always fail in offline or server down). |      * @param ignoreCache True if it should ignore cached data (it will always fail in offline or server down). | ||||||
|      * @return Promise to be resolved when the competency is retrieved. |      * @returns Promise to be resolved when the competency is retrieved. | ||||||
|      */ |      */ | ||||||
|     async getCompetencyInCourse( |     async getCompetencyInCourse( | ||||||
|         courseId: number, |         courseId: number, | ||||||
| @ -295,7 +295,7 @@ export class AddonCompetencyProvider { | |||||||
|      * @param userId ID of the user. If not defined, current user. |      * @param userId ID of the user. If not defined, current user. | ||||||
|      * @param siteId Site ID. If not defined, current site. |      * @param siteId Site ID. If not defined, current site. | ||||||
|      * @param ignoreCache True if it should ignore cached data (it will always fail in offline or server down). |      * @param ignoreCache True if it should ignore cached data (it will always fail in offline or server down). | ||||||
|      * @return Promise to be resolved when the competency summary is retrieved. |      * @returns Promise to be resolved when the competency summary is retrieved. | ||||||
|      */ |      */ | ||||||
|     async getCompetencySummary( |     async getCompetencySummary( | ||||||
|         competencyId: number, |         competencyId: number, | ||||||
| @ -331,7 +331,7 @@ export class AddonCompetencyProvider { | |||||||
|      * @param userId ID of the user. |      * @param userId ID of the user. | ||||||
|      * @param siteId Site ID. If not defined, current site. |      * @param siteId Site ID. If not defined, current site. | ||||||
|      * @param ignoreCache True if it should ignore cached data (it will always fail in offline or server down). |      * @param ignoreCache True if it should ignore cached data (it will always fail in offline or server down). | ||||||
|      * @return Promise to be resolved when the course competencies are retrieved. |      * @returns Promise to be resolved when the course competencies are retrieved. | ||||||
|      */ |      */ | ||||||
|     async getCourseCompetencies( |     async getCourseCompetencies( | ||||||
|         courseId: number, |         courseId: number, | ||||||
| @ -364,7 +364,7 @@ export class AddonCompetencyProvider { | |||||||
|      * @param courseId ID of the course. |      * @param courseId ID of the course. | ||||||
|      * @param siteId Site ID. If not defined, current site. |      * @param siteId Site ID. If not defined, current site. | ||||||
|      * @param ignoreCache True if it should ignore cached data (it will always fail in offline or server down). |      * @param ignoreCache True if it should ignore cached data (it will always fail in offline or server down). | ||||||
|      * @return Promise to be resolved when the course competencies are retrieved. |      * @returns Promise to be resolved when the course competencies are retrieved. | ||||||
|      */ |      */ | ||||||
|     async getCourseCompetenciesPage( |     async getCourseCompetenciesPage( | ||||||
|         courseId: number, |         courseId: number, | ||||||
| @ -399,7 +399,7 @@ export class AddonCompetencyProvider { | |||||||
|      * |      * | ||||||
|      * @param userId ID of the user. If not defined, current user. |      * @param userId ID of the user. If not defined, current user. | ||||||
|      * @param siteId Site ID. If not defined, current site. |      * @param siteId Site ID. If not defined, current site. | ||||||
|      * @return Promise resolved when the data is invalidated. |      * @returns Promise resolved when the data is invalidated. | ||||||
|      */ |      */ | ||||||
|     async invalidateLearningPlans(userId?: number, siteId?: string): Promise<void> { |     async invalidateLearningPlans(userId?: number, siteId?: string): Promise<void> { | ||||||
|         const site = await CoreSites.getSite(siteId); |         const site = await CoreSites.getSite(siteId); | ||||||
| @ -413,7 +413,7 @@ export class AddonCompetencyProvider { | |||||||
|      * |      * | ||||||
|      * @param planId ID of the plan. |      * @param planId ID of the plan. | ||||||
|      * @param siteId Site ID. If not defined, current site. |      * @param siteId Site ID. If not defined, current site. | ||||||
|      * @return Promise resolved when the data is invalidated. |      * @returns Promise resolved when the data is invalidated. | ||||||
|      */ |      */ | ||||||
|     async invalidateLearningPlan(planId: number, siteId?: string): Promise<void> { |     async invalidateLearningPlan(planId: number, siteId?: string): Promise<void> { | ||||||
|         const site = await CoreSites.getSite(siteId); |         const site = await CoreSites.getSite(siteId); | ||||||
| @ -427,7 +427,7 @@ export class AddonCompetencyProvider { | |||||||
|      * @param planId ID of the plan. |      * @param planId ID of the plan. | ||||||
|      * @param competencyId ID of the competency. |      * @param competencyId ID of the competency. | ||||||
|      * @param siteId Site ID. If not defined, current site. |      * @param siteId Site ID. If not defined, current site. | ||||||
|      * @return Promise resolved when the data is invalidated. |      * @returns Promise resolved when the data is invalidated. | ||||||
|      */ |      */ | ||||||
|     async invalidateCompetencyInPlan(planId: number, competencyId: number, siteId?: string): Promise<void> { |     async invalidateCompetencyInPlan(planId: number, competencyId: number, siteId?: string): Promise<void> { | ||||||
|         const site = await CoreSites.getSite(siteId); |         const site = await CoreSites.getSite(siteId); | ||||||
| @ -442,7 +442,7 @@ export class AddonCompetencyProvider { | |||||||
|      * @param competencyId ID of the competency. |      * @param competencyId ID of the competency. | ||||||
|      * @param userId ID of the user. If not defined, current user. |      * @param userId ID of the user. If not defined, current user. | ||||||
|      * @param siteId Site ID. If not defined, current site. |      * @param siteId Site ID. If not defined, current site. | ||||||
|      * @return Promise resolved when the data is invalidated. |      * @returns Promise resolved when the data is invalidated. | ||||||
|      */ |      */ | ||||||
|     async invalidateCompetencyInCourse(courseId: number, competencyId: number, userId?: number, siteId?: string): Promise<void> { |     async invalidateCompetencyInCourse(courseId: number, competencyId: number, userId?: number, siteId?: string): Promise<void> { | ||||||
|         const site = await CoreSites.getSite(siteId); |         const site = await CoreSites.getSite(siteId); | ||||||
| @ -457,7 +457,7 @@ export class AddonCompetencyProvider { | |||||||
|      * @param competencyId ID of the competency. |      * @param competencyId ID of the competency. | ||||||
|      * @param userId ID of the user. If not defined, current user. |      * @param userId ID of the user. If not defined, current user. | ||||||
|      * @param siteId Site ID. If not defined, current site. |      * @param siteId Site ID. If not defined, current site. | ||||||
|      * @return Promise resolved when the data is invalidated. |      * @returns Promise resolved when the data is invalidated. | ||||||
|      */ |      */ | ||||||
|     async invalidateCompetencySummary(competencyId: number, userId?: number, siteId?: string): Promise<void> { |     async invalidateCompetencySummary(competencyId: number, userId?: number, siteId?: string): Promise<void> { | ||||||
|         const site = await CoreSites.getSite(siteId); |         const site = await CoreSites.getSite(siteId); | ||||||
| @ -472,7 +472,7 @@ export class AddonCompetencyProvider { | |||||||
|      * @param courseId ID of the course. |      * @param courseId ID of the course. | ||||||
|      * @param userId ID of the user. |      * @param userId ID of the user. | ||||||
|      * @param siteId Site ID. If not defined, current site. |      * @param siteId Site ID. If not defined, current site. | ||||||
|      * @return Promise resolved when the data is invalidated. |      * @returns Promise resolved when the data is invalidated. | ||||||
|      */ |      */ | ||||||
|     async invalidateCourseCompetencies(courseId: number, userId?: number, siteId?: string): Promise<void> { |     async invalidateCourseCompetencies(courseId: number, userId?: number, siteId?: string): Promise<void> { | ||||||
|         const site = await CoreSites.getSite(siteId); |         const site = await CoreSites.getSite(siteId); | ||||||
| @ -498,7 +498,7 @@ export class AddonCompetencyProvider { | |||||||
|      * @param name Name of the competency. |      * @param name Name of the competency. | ||||||
|      * @param userId User ID. If not defined, current user. |      * @param userId User ID. If not defined, current user. | ||||||
|      * @param siteId Site ID. If not defined, current site. |      * @param siteId Site ID. If not defined, current site. | ||||||
|      * @return Promise resolved when the WS call is successful. |      * @returns Promise resolved when the WS call is successful. | ||||||
|      */ |      */ | ||||||
|     async logCompetencyInPlanView( |     async logCompetencyInPlanView( | ||||||
|         planId: number, |         planId: number, | ||||||
| @ -542,7 +542,7 @@ export class AddonCompetencyProvider { | |||||||
|      * @param name Name of the competency. |      * @param name Name of the competency. | ||||||
|      * @param userId User ID. If not defined, current user. |      * @param userId User ID. If not defined, current user. | ||||||
|      * @param siteId Site ID. If not defined, current site. |      * @param siteId Site ID. If not defined, current site. | ||||||
|      * @return Promise resolved when the WS call is successful. |      * @returns Promise resolved when the WS call is successful. | ||||||
|      */ |      */ | ||||||
|     async logCompetencyInCourseView( |     async logCompetencyInCourseView( | ||||||
|         courseId: number, |         courseId: number, | ||||||
| @ -580,7 +580,7 @@ export class AddonCompetencyProvider { | |||||||
|      * @param competencyId ID of the competency. |      * @param competencyId ID of the competency. | ||||||
|      * @param name Name of the competency. |      * @param name Name of the competency. | ||||||
|      * @param siteId Site ID. If not defined, current site. |      * @param siteId Site ID. If not defined, current site. | ||||||
|      * @return Promise resolved when the WS call is successful. |      * @returns Promise resolved when the WS call is successful. | ||||||
|      */ |      */ | ||||||
|     async logCompetencyView(competencyId: number, name?: string, siteId?: string): Promise<void> { |     async logCompetencyView(competencyId: number, name?: string, siteId?: string): Promise<void> { | ||||||
|         const site = await CoreSites.getSite(siteId); |         const site = await CoreSites.getSite(siteId); | ||||||
|  | |||||||
| @ -65,7 +65,7 @@ export class AddonCourseCompletionReportPage implements OnInit { | |||||||
|     /** |     /** | ||||||
|      * Fetch compleiton data. |      * Fetch compleiton data. | ||||||
|      * |      * | ||||||
|      * @return Promise resolved when done. |      * @returns Promise resolved when done. | ||||||
|      */ |      */ | ||||||
|     protected async fetchCompletion(): Promise<void> { |     protected async fetchCompletion(): Promise<void> { | ||||||
|         try { |         try { | ||||||
|  | |||||||
| @ -44,7 +44,7 @@ export class AddonCourseCompletionProvider { | |||||||
|      * |      * | ||||||
|      * @param userId User ID. |      * @param userId User ID. | ||||||
|      * @param completion Course completion. |      * @param completion Course completion. | ||||||
|      * @return True if user can mark course as self completed, false otherwise. |      * @returns True if user can mark course as self completed, false otherwise. | ||||||
|      */ |      */ | ||||||
|     canMarkSelfCompleted(userId: number, completion: AddonCourseCompletionCourseCompletionStatus): boolean { |     canMarkSelfCompleted(userId: number, completion: AddonCourseCompletionCourseCompletionStatus): boolean { | ||||||
|         if (CoreSites.getCurrentSiteUserId() != userId) { |         if (CoreSites.getCurrentSiteUserId() != userId) { | ||||||
| @ -69,7 +69,7 @@ export class AddonCourseCompletionProvider { | |||||||
|      * Get completed status text. The language code returned is meant to be translated. |      * Get completed status text. The language code returned is meant to be translated. | ||||||
|      * |      * | ||||||
|      * @param completion Course completion. |      * @param completion Course completion. | ||||||
|      * @return Language code of the text to show. |      * @returns Language code of the text to show. | ||||||
|      */ |      */ | ||||||
|     getCompletedStatusText(completion: AddonCourseCompletionCourseCompletionStatus): string { |     getCompletedStatusText(completion: AddonCourseCompletionCourseCompletionStatus): string { | ||||||
|         if (completion.completed) { |         if (completion.completed) { | ||||||
| @ -93,7 +93,7 @@ export class AddonCourseCompletionProvider { | |||||||
|      * @param userId User ID. If not defined, use current user. |      * @param userId User ID. If not defined, use current user. | ||||||
|      * @param preSets Presets to use when calling the WebService. |      * @param preSets Presets to use when calling the WebService. | ||||||
|      * @param siteId Site ID. If not defined, use current site. |      * @param siteId Site ID. If not defined, use current site. | ||||||
|      * @return Promise to be resolved when the completion is retrieved. |      * @returns Promise to be resolved when the completion is retrieved. | ||||||
|      */ |      */ | ||||||
|     getCompletion( |     getCompletion( | ||||||
|         courseId: number, |         courseId: number, | ||||||
| @ -113,7 +113,7 @@ export class AddonCourseCompletionProvider { | |||||||
|      * |      * | ||||||
|      * @param courseId Course ID. |      * @param courseId Course ID. | ||||||
|      * @param options Options. |      * @param options Options. | ||||||
|      * @return Observable returning the completion. |      * @returns Observable returning the completion. | ||||||
|      */ |      */ | ||||||
|     getCompletionObservable( |     getCompletionObservable( | ||||||
|         courseId: number, |         courseId: number, | ||||||
| @ -150,8 +150,8 @@ export class AddonCourseCompletionProvider { | |||||||
|      * Get cache key for get completion WS calls. |      * Get cache key for get completion WS calls. | ||||||
|      * |      * | ||||||
|      * @param courseId Course ID. |      * @param courseId Course ID. | ||||||
|      * @param useIid User ID. |      * @param userId User ID. | ||||||
|      * @return Cache key. |      * @returns Cache key. | ||||||
|      */ |      */ | ||||||
|     protected getCompletionCacheKey(courseId: number, userId: number): string { |     protected getCompletionCacheKey(courseId: number, userId: number): string { | ||||||
|         return ROOT_CACHE_KEY + 'view:' + courseId + ':' + userId; |         return ROOT_CACHE_KEY + 'view:' + courseId + ':' + userId; | ||||||
| @ -163,7 +163,7 @@ export class AddonCourseCompletionProvider { | |||||||
|      * @param courseId Course ID. |      * @param courseId Course ID. | ||||||
|      * @param userId User ID. If not defined, use current user. |      * @param userId User ID. If not defined, use current user. | ||||||
|      * @param siteId Site ID. If not defined, use current site. |      * @param siteId Site ID. If not defined, use current site. | ||||||
|      * @return Promise resolved when the list is invalidated. |      * @returns Promise resolved when the list is invalidated. | ||||||
|      */ |      */ | ||||||
|     async invalidateCourseCompletion(courseId: number, userId?: number, siteId?: string): Promise<void> { |     async invalidateCourseCompletion(courseId: number, userId?: number, siteId?: string): Promise<void> { | ||||||
|         const site = await CoreSites.getSite(siteId); |         const site = await CoreSites.getSite(siteId); | ||||||
| @ -175,7 +175,7 @@ export class AddonCourseCompletionProvider { | |||||||
|     /** |     /** | ||||||
|      * Returns whether or not the view course completion plugin is enabled for the current site. |      * Returns whether or not the view course completion plugin is enabled for the current site. | ||||||
|      * |      * | ||||||
|      * @return True if plugin enabled, false otherwise. |      * @returns True if plugin enabled, false otherwise. | ||||||
|      */ |      */ | ||||||
|     isPluginViewEnabled(): boolean { |     isPluginViewEnabled(): boolean { | ||||||
|         return CoreSites.isLoggedIn(); |         return CoreSites.isLoggedIn(); | ||||||
| @ -186,7 +186,7 @@ export class AddonCourseCompletionProvider { | |||||||
|      * |      * | ||||||
|      * @param courseId Course ID. |      * @param courseId Course ID. | ||||||
|      * @param preferCache True if shouldn't call WS if data is cached, false otherwise. |      * @param preferCache True if shouldn't call WS if data is cached, false otherwise. | ||||||
|      * @return Promise resolved with true if plugin is enabled, rejected or resolved with false otherwise. |      * @returns Promise resolved with true if plugin is enabled, rejected or resolved with false otherwise. | ||||||
|      */ |      */ | ||||||
|     async isPluginViewEnabledForCourse(courseId?: number, preferCache: boolean = true): Promise<boolean> { |     async isPluginViewEnabledForCourse(courseId?: number, preferCache: boolean = true): Promise<boolean> { | ||||||
|         if (!courseId) { |         if (!courseId) { | ||||||
| @ -216,7 +216,7 @@ export class AddonCourseCompletionProvider { | |||||||
|      * @param courseId Course ID. |      * @param courseId Course ID. | ||||||
|      * @param userId User ID. If not defined, use current user. |      * @param userId User ID. If not defined, use current user. | ||||||
|      * @param siteId Site ID. If not defined, use current site. |      * @param siteId Site ID. If not defined, use current site. | ||||||
|      * @return Promise resolved with true if plugin is enabled, rejected or resolved with false otherwise. |      * @returns Promise resolved with true if plugin is enabled, rejected or resolved with false otherwise. | ||||||
|      */ |      */ | ||||||
|     async isPluginViewEnabledForUser(courseId: number, userId?: number, siteId?: string): Promise<boolean> { |     async isPluginViewEnabledForUser(courseId: number, userId?: number, siteId?: string): Promise<boolean> { | ||||||
|         const site = await CoreSites.getSite(siteId); |         const site = await CoreSites.getSite(siteId); | ||||||
| @ -273,7 +273,7 @@ export class AddonCourseCompletionProvider { | |||||||
|      * |      * | ||||||
|      * @param courseId Course ID. |      * @param courseId Course ID. | ||||||
|      * @param siteId Site ID. If not defined, use current site. |      * @param siteId Site ID. If not defined, use current site. | ||||||
|      * @return Promise resolved on success. |      * @returns Promise resolved on success. | ||||||
|      */ |      */ | ||||||
|     async markCourseAsSelfCompleted(courseId: number, siteId?: string): Promise<void> { |     async markCourseAsSelfCompleted(courseId: number, siteId?: string): Promise<void> { | ||||||
|         const site = await CoreSites.getSite(siteId); |         const site = await CoreSites.getSite(siteId); | ||||||
|  | |||||||
| @ -33,7 +33,7 @@ export class AddonFilterActivityNamesHandlerService extends CoreFilterDefaultHan | |||||||
|      * |      * | ||||||
|      * @param options Options. |      * @param options Options. | ||||||
|      * @param site Site. |      * @param site Site. | ||||||
|      * @return Whether filter should be applied. |      * @returns Whether filter should be applied. | ||||||
|      */ |      */ | ||||||
|     // eslint-disable-next-line @typescript-eslint/no-unused-vars
 |     // eslint-disable-next-line @typescript-eslint/no-unused-vars
 | ||||||
|     shouldBeApplied(options: CoreFilterFormatTextOptions, site?: CoreSite): boolean { |     shouldBeApplied(options: CoreFilterFormatTextOptions, site?: CoreSite): boolean { | ||||||
|  | |||||||
| @ -33,7 +33,7 @@ export class AddonFilterAlgebraHandlerService extends CoreFilterDefaultHandler { | |||||||
|      * |      * | ||||||
|      * @param options Options. |      * @param options Options. | ||||||
|      * @param site Site. |      * @param site Site. | ||||||
|      * @return Whether filter should be applied. |      * @returns Whether filter should be applied. | ||||||
|      */ |      */ | ||||||
|     // eslint-disable-next-line @typescript-eslint/no-unused-vars
 |     // eslint-disable-next-line @typescript-eslint/no-unused-vars
 | ||||||
|     shouldBeApplied(options: CoreFilterFormatTextOptions, site?: CoreSite): boolean { |     shouldBeApplied(options: CoreFilterFormatTextOptions, site?: CoreSite): boolean { | ||||||
|  | |||||||
| @ -33,7 +33,7 @@ export class AddonFilterCensorHandlerService extends CoreFilterDefaultHandler { | |||||||
|      * |      * | ||||||
|      * @param options Options. |      * @param options Options. | ||||||
|      * @param site Site. |      * @param site Site. | ||||||
|      * @return Whether filter should be applied. |      * @returns Whether filter should be applied. | ||||||
|      */ |      */ | ||||||
|     // eslint-disable-next-line @typescript-eslint/no-unused-vars
 |     // eslint-disable-next-line @typescript-eslint/no-unused-vars
 | ||||||
|     shouldBeApplied(options: CoreFilterFormatTextOptions, site?: CoreSite): boolean { |     shouldBeApplied(options: CoreFilterFormatTextOptions, site?: CoreSite): boolean { | ||||||
|  | |||||||
| @ -33,7 +33,7 @@ export class AddonFilterDataHandlerService extends CoreFilterDefaultHandler { | |||||||
|      * |      * | ||||||
|      * @param options Options. |      * @param options Options. | ||||||
|      * @param site Site. |      * @param site Site. | ||||||
|      * @return Whether filter should be applied. |      * @returns Whether filter should be applied. | ||||||
|      */ |      */ | ||||||
|     // eslint-disable-next-line @typescript-eslint/no-unused-vars
 |     // eslint-disable-next-line @typescript-eslint/no-unused-vars
 | ||||||
|     shouldBeApplied(options: CoreFilterFormatTextOptions, site?: CoreSite): boolean { |     shouldBeApplied(options: CoreFilterFormatTextOptions, site?: CoreSite): boolean { | ||||||
|  | |||||||
| @ -37,19 +37,10 @@ export class AddonFilterDisplayH5PHandlerService extends CoreFilterDefaultHandle | |||||||
|     } |     } | ||||||
| 
 | 
 | ||||||
|     /** |     /** | ||||||
|      * Filter some text. |      * @inheritdoc | ||||||
|      * |  | ||||||
|      * @param text The text to filter. |  | ||||||
|      * @param filter The filter. |  | ||||||
|      * @param options Options passed to the filters. |  | ||||||
|      * @param siteId Site ID. If not defined, current site. |  | ||||||
|      * @return Filtered text (or promise resolved with the filtered text). |  | ||||||
|      */ |      */ | ||||||
|     filter( |     filter( | ||||||
|         text: string, |         text: string, | ||||||
|         filter: CoreFilterFilter, // eslint-disable-line @typescript-eslint/no-unused-vars
 |  | ||||||
|         options: CoreFilterFormatTextOptions, // eslint-disable-line @typescript-eslint/no-unused-vars
 |  | ||||||
|         siteId?: string, // eslint-disable-line @typescript-eslint/no-unused-vars
 |  | ||||||
|     ): string | Promise<string> { |     ): string | Promise<string> { | ||||||
|         this.template.innerHTML = text; |         this.template.innerHTML = text; | ||||||
| 
 | 
 | ||||||
| @ -87,17 +78,7 @@ export class AddonFilterDisplayH5PHandlerService extends CoreFilterDefaultHandle | |||||||
|     } |     } | ||||||
| 
 | 
 | ||||||
|     /** |     /** | ||||||
|      * Handle HTML. This function is called after "filter", and it will receive an HTMLElement containing the text that was |      * @inheritdoc | ||||||
|      * filtered. |  | ||||||
|      * |  | ||||||
|      * @param container The HTML container to handle. |  | ||||||
|      * @param filter The filter. |  | ||||||
|      * @param options Options passed to the filters. |  | ||||||
|      * @param viewContainerRef The ViewContainerRef where the container is. |  | ||||||
|      * @param component Component. |  | ||||||
|      * @param componentId Component ID. |  | ||||||
|      * @param siteId Site ID. If not defined, current site. |  | ||||||
|      * @return If async, promise resolved when done. |  | ||||||
|      */ |      */ | ||||||
|     handleHtml( |     handleHtml( | ||||||
|         container: HTMLElement, |         container: HTMLElement, | ||||||
| @ -106,7 +87,6 @@ export class AddonFilterDisplayH5PHandlerService extends CoreFilterDefaultHandle | |||||||
|         viewContainerRef: ViewContainerRef, |         viewContainerRef: ViewContainerRef, | ||||||
|         component?: string, |         component?: string, | ||||||
|         componentId?: string | number, |         componentId?: string | number, | ||||||
|         siteId?: string, // eslint-disable-line @typescript-eslint/no-unused-vars
 |  | ||||||
|     ): void | Promise<void> { |     ): void | Promise<void> { | ||||||
| 
 | 
 | ||||||
|         const placeholders = <HTMLElement[]> Array.from(container.querySelectorAll('div.core-h5p-tmp-placeholder')); |         const placeholders = <HTMLElement[]> Array.from(container.querySelectorAll('div.core-h5p-tmp-placeholder')); | ||||||
|  | |||||||
| @ -33,7 +33,7 @@ export class AddonFilterEmailProtectHandlerService extends CoreFilterDefaultHand | |||||||
|      * |      * | ||||||
|      * @param options Options. |      * @param options Options. | ||||||
|      * @param site Site. |      * @param site Site. | ||||||
|      * @return Whether filter should be applied. |      * @returns Whether filter should be applied. | ||||||
|      */ |      */ | ||||||
|     // eslint-disable-next-line @typescript-eslint/no-unused-vars
 |     // eslint-disable-next-line @typescript-eslint/no-unused-vars
 | ||||||
|     shouldBeApplied(options: CoreFilterFormatTextOptions, site?: CoreSite): boolean { |     shouldBeApplied(options: CoreFilterFormatTextOptions, site?: CoreSite): boolean { | ||||||
|  | |||||||
| @ -33,7 +33,7 @@ export class AddonFilterEmoticonHandlerService extends CoreFilterDefaultHandler | |||||||
|      * |      * | ||||||
|      * @param options Options. |      * @param options Options. | ||||||
|      * @param site Site. |      * @param site Site. | ||||||
|      * @return Whether filter should be applied. |      * @returns Whether filter should be applied. | ||||||
|      */ |      */ | ||||||
|     // eslint-disable-next-line @typescript-eslint/no-unused-vars
 |     // eslint-disable-next-line @typescript-eslint/no-unused-vars
 | ||||||
|     shouldBeApplied(options: CoreFilterFormatTextOptions, site?: CoreSite): boolean { |     shouldBeApplied(options: CoreFilterFormatTextOptions, site?: CoreSite): boolean { | ||||||
|  | |||||||
| @ -33,7 +33,7 @@ export class AddonFilterGlossaryHandlerService extends CoreFilterDefaultHandler | |||||||
|      * |      * | ||||||
|      * @param options Options. |      * @param options Options. | ||||||
|      * @param site Site. |      * @param site Site. | ||||||
|      * @return Whether filter should be applied. |      * @returns Whether filter should be applied. | ||||||
|      */ |      */ | ||||||
|     // eslint-disable-next-line @typescript-eslint/no-unused-vars
 |     // eslint-disable-next-line @typescript-eslint/no-unused-vars
 | ||||||
|     shouldBeApplied(options: CoreFilterFormatTextOptions, site?: CoreSite): boolean { |     shouldBeApplied(options: CoreFilterFormatTextOptions, site?: CoreSite): boolean { | ||||||
|  | |||||||
| @ -79,7 +79,7 @@ export class AddonFilterMathJaxLoaderHandlerService extends CoreFilterDefaultHan | |||||||
|     /** |     /** | ||||||
|      * Initialize MathJax. |      * Initialize MathJax. | ||||||
|      * |      * | ||||||
|      * @return Promise resolved when done. |      * @returns Promise resolved when done. | ||||||
|      */ |      */ | ||||||
|     async initialize(): Promise<void> { |     async initialize(): Promise<void> { | ||||||
|         this.loadJS(); |         this.loadJS(); | ||||||
| @ -112,7 +112,7 @@ export class AddonFilterMathJaxLoaderHandlerService extends CoreFilterDefaultHan | |||||||
|      * @param filter The filter. |      * @param filter The filter. | ||||||
|      * @param options Options passed to the filters. |      * @param options Options passed to the filters. | ||||||
|      * @param siteId Site ID. If not defined, current site. |      * @param siteId Site ID. If not defined, current site. | ||||||
|      * @return Filtered text (or promise resolved with the filtered text). |      * @returns Filtered text (or promise resolved with the filtered text). | ||||||
|      */ |      */ | ||||||
|     async filter( |     async filter( | ||||||
|         text: string, |         text: string, | ||||||
| @ -163,7 +163,7 @@ export class AddonFilterMathJaxLoaderHandlerService extends CoreFilterDefaultHan | |||||||
|      * @param component Component. |      * @param component Component. | ||||||
|      * @param componentId Component ID. |      * @param componentId Component ID. | ||||||
|      * @param siteId Site ID. If not defined, current site. |      * @param siteId Site ID. If not defined, current site. | ||||||
|      * @return If async, promise resolved when done. |      * @returns If async, promise resolved when done. | ||||||
|      */ |      */ | ||||||
|     async handleHtml( |     async handleHtml( | ||||||
|         container: HTMLElement, |         container: HTMLElement, | ||||||
| @ -185,7 +185,7 @@ export class AddonFilterMathJaxLoaderHandlerService extends CoreFilterDefaultHan | |||||||
|      * @param text The text to modify. |      * @param text The text to modify. | ||||||
|      * @param start The start index of the substring in text that should be wrapped in the span. |      * @param start The start index of the substring in text that should be wrapped in the span. | ||||||
|      * @param end The end index of the substring in text that should be wrapped in the span. |      * @param end The end index of the substring in text that should be wrapped in the span. | ||||||
|      * @return The whole text with the span inserted around the defined substring. |      * @returns The whole text with the span inserted around the defined substring. | ||||||
|      */ |      */ | ||||||
|     protected insertSpan(text: string, start: number, end: number): string { |     protected insertSpan(text: string, start: number, end: number): string { | ||||||
|         return CoreTextUtils.substrReplace( |         return CoreTextUtils.substrReplace( | ||||||
| @ -273,7 +273,7 @@ export class AddonFilterMathJaxLoaderHandlerService extends CoreFilterDefaultHan | |||||||
|      * Perform a mapping of the app language code to the equivalent for MathJax. |      * Perform a mapping of the app language code to the equivalent for MathJax. | ||||||
|      * |      * | ||||||
|      * @param langCode The app language code. |      * @param langCode The app language code. | ||||||
|      * @return The MathJax language code. |      * @returns The MathJax language code. | ||||||
|      */ |      */ | ||||||
|     protected mapLanguageCode(langCode: string): string { |     protected mapLanguageCode(langCode: string): string { | ||||||
| 
 | 
 | ||||||
| @ -302,7 +302,7 @@ export class AddonFilterMathJaxLoaderHandlerService extends CoreFilterDefaultHan | |||||||
|      * |      * | ||||||
|      * @param options Options. |      * @param options Options. | ||||||
|      * @param site Site. |      * @param site Site. | ||||||
|      * @return Whether filter should be applied. |      * @returns Whether filter should be applied. | ||||||
|      */ |      */ | ||||||
|     shouldBeApplied(options: CoreFilterFormatTextOptions, site?: CoreSite): boolean { |     shouldBeApplied(options: CoreFilterFormatTextOptions, site?: CoreSite): boolean { | ||||||
|         // Only apply the filter if logged in and we're filtering current site.
 |         // Only apply the filter if logged in and we're filtering current site.
 | ||||||
| @ -313,7 +313,7 @@ export class AddonFilterMathJaxLoaderHandlerService extends CoreFilterDefaultHan | |||||||
|      * Wait for the MathJax library and our JS object to be loaded. |      * Wait for the MathJax library and our JS object to be loaded. | ||||||
|      * |      * | ||||||
|      * @param retries Number of times this has been retried. |      * @param retries Number of times this has been retried. | ||||||
|      * @return Promise resolved when ready or if it took too long to load. |      * @returns Promise resolved when ready or if it took too long to load. | ||||||
|      */ |      */ | ||||||
|     protected async waitForReady(retries: number = 0): Promise<void> { |     protected async waitForReady(retries: number = 0): Promise<void> { | ||||||
|         if (this.window.MathJax || retries >= 20) { |         if (this.window.MathJax || retries >= 20) { | ||||||
| @ -334,7 +334,7 @@ export class AddonFilterMathJaxLoaderHandlerService extends CoreFilterDefaultHan | |||||||
|      * mathematics and \( \) for inline mathematics. |      * mathematics and \( \) for inline mathematics. | ||||||
|      * |      * | ||||||
|      * @param text The text to filter. |      * @param text The text to filter. | ||||||
|      * @return Object containing the potentially modified text and a boolean that is true if any changes were made to the text. |      * @returns Object containing the potentially modified text and a boolean that is true if any changes were made to the text. | ||||||
|      */ |      */ | ||||||
|     protected wrapMathInNoLink(text: string): {text: string; changed: boolean} { |     protected wrapMathInNoLink(text: string): {text: string; changed: boolean} { | ||||||
|         let len = text.length; |         let len = text.length; | ||||||
|  | |||||||
| @ -36,7 +36,7 @@ export class AddonFilterMultilangHandlerService extends CoreFilterDefaultHandler | |||||||
|      * @param filter The filter. |      * @param filter The filter. | ||||||
|      * @param options Options passed to the filters. |      * @param options Options passed to the filters. | ||||||
|      * @param siteId Site ID. If not defined, current site. |      * @param siteId Site ID. If not defined, current site. | ||||||
|      * @return Filtered text (or promise resolved with the filtered text). |      * @returns Filtered text (or promise resolved with the filtered text). | ||||||
|      */ |      */ | ||||||
|     async filter( |     async filter( | ||||||
|         text: string, |         text: string, | ||||||
| @ -75,7 +75,7 @@ export class AddonFilterMultilangHandlerService extends CoreFilterDefaultHandler | |||||||
|      * |      * | ||||||
|      * @param options Options. |      * @param options Options. | ||||||
|      * @param site Site. |      * @param site Site. | ||||||
|      * @return Whether filter should be applied. |      * @returns Whether filter should be applied. | ||||||
|      */ |      */ | ||||||
|     shouldBeApplied(options: CoreFilterFormatTextOptions, site?: CoreSite): boolean { |     shouldBeApplied(options: CoreFilterFormatTextOptions, site?: CoreSite): boolean { | ||||||
|         // The filter should be applied if site is older than 3.7 or the WS didn't filter the text.
 |         // The filter should be applied if site is older than 3.7 or the WS didn't filter the text.
 | ||||||
|  | |||||||
| @ -33,7 +33,7 @@ export class AddonFilterTexHandlerService extends CoreFilterDefaultHandler { | |||||||
|      * |      * | ||||||
|      * @param options Options. |      * @param options Options. | ||||||
|      * @param site Site. |      * @param site Site. | ||||||
|      * @return Whether filter should be applied. |      * @returns Whether filter should be applied. | ||||||
|      */ |      */ | ||||||
|     // eslint-disable-next-line @typescript-eslint/no-unused-vars
 |     // eslint-disable-next-line @typescript-eslint/no-unused-vars
 | ||||||
|     shouldBeApplied(options: CoreFilterFormatTextOptions, site?: CoreSite): boolean { |     shouldBeApplied(options: CoreFilterFormatTextOptions, site?: CoreSite): boolean { | ||||||
|  | |||||||
| @ -33,7 +33,7 @@ export class AddonFilterTidyHandlerService extends CoreFilterDefaultHandler { | |||||||
|      * |      * | ||||||
|      * @param options Options. |      * @param options Options. | ||||||
|      * @param site Site. |      * @param site Site. | ||||||
|      * @return Whether filter should be applied. |      * @returns Whether filter should be applied. | ||||||
|      */ |      */ | ||||||
|     // eslint-disable-next-line @typescript-eslint/no-unused-vars
 |     // eslint-disable-next-line @typescript-eslint/no-unused-vars
 | ||||||
|     shouldBeApplied(options: CoreFilterFormatTextOptions, site?: CoreSite): boolean { |     shouldBeApplied(options: CoreFilterFormatTextOptions, site?: CoreSite): boolean { | ||||||
|  | |||||||
| @ -33,7 +33,7 @@ export class AddonFilterUrlToLinkHandlerService extends CoreFilterDefaultHandler | |||||||
|      * |      * | ||||||
|      * @param options Options. |      * @param options Options. | ||||||
|      * @param site Site. |      * @param site Site. | ||||||
|      * @return Whether filter should be applied. |      * @returns Whether filter should be applied. | ||||||
|      */ |      */ | ||||||
|     // eslint-disable-next-line @typescript-eslint/no-unused-vars
 |     // eslint-disable-next-line @typescript-eslint/no-unused-vars
 | ||||||
|     shouldBeApplied(options: CoreFilterFormatTextOptions, site?: CoreSite): boolean { |     shouldBeApplied(options: CoreFilterFormatTextOptions, site?: CoreSite): boolean { | ||||||
|  | |||||||
| @ -44,7 +44,7 @@ export class AddonMessageOutputAirnotifierDevicesPage implements OnInit, OnDestr | |||||||
|     /** |     /** | ||||||
|      * Fetches the list of devices. |      * Fetches the list of devices. | ||||||
|      * |      * | ||||||
|      * @return Promise resolved when done. |      * @returns Promise resolved when done. | ||||||
|      */ |      */ | ||||||
|     protected async fetchDevices(): Promise<void> { |     protected async fetchDevices(): Promise<void> { | ||||||
|         try { |         try { | ||||||
|  | |||||||
| @ -54,7 +54,7 @@ export class AddonMessageOutputAirnotifierProvider { | |||||||
|      * @param deviceId Device ID. |      * @param deviceId Device ID. | ||||||
|      * @param enable True to enable, false to disable. |      * @param enable True to enable, false to disable. | ||||||
|      * @param siteId Site ID. If not defined, current site. |      * @param siteId Site ID. If not defined, current site. | ||||||
|      * @return Promise resolved if success. |      * @returns Promise resolved if success. | ||||||
|      */ |      */ | ||||||
|     async enableDevice(deviceId: number, enable: boolean, siteId?: string): Promise<void> { |     async enableDevice(deviceId: number, enable: boolean, siteId?: string): Promise<void> { | ||||||
|         const site = await CoreSites.getSite(siteId); |         const site = await CoreSites.getSite(siteId); | ||||||
| @ -84,7 +84,7 @@ export class AddonMessageOutputAirnotifierProvider { | |||||||
|     /** |     /** | ||||||
|      * Get the cache key for the is system configured call. |      * Get the cache key for the is system configured call. | ||||||
|      * |      * | ||||||
|      * @return Cache key. |      * @returns Cache key. | ||||||
|      */ |      */ | ||||||
|     protected getSystemConfiguredCacheKey(): string { |     protected getSystemConfiguredCacheKey(): string { | ||||||
|         return ROOT_CACHE_KEY + 'isAirnotifierConfigured'; |         return ROOT_CACHE_KEY + 'isAirnotifierConfigured'; | ||||||
| @ -94,7 +94,7 @@ export class AddonMessageOutputAirnotifierProvider { | |||||||
|      * Check if airnotifier is configured. |      * Check if airnotifier is configured. | ||||||
|      * |      * | ||||||
|      * @param options Options. |      * @param options Options. | ||||||
|      * @return Promise resolved with boolean: whether it's configured. |      * @returns Promise resolved with boolean: whether it's configured. | ||||||
|      */ |      */ | ||||||
|     async isSystemConfigured(options: CoreSitesCommonWSOptions = {}): Promise<boolean> { |     async isSystemConfigured(options: CoreSitesCommonWSOptions = {}): Promise<boolean> { | ||||||
|         const site = await CoreSites.getSite(options.siteId); |         const site = await CoreSites.getSite(options.siteId); | ||||||
| @ -113,7 +113,7 @@ export class AddonMessageOutputAirnotifierProvider { | |||||||
|     /** |     /** | ||||||
|      * Get the cache key for the get user devices call. |      * Get the cache key for the get user devices call. | ||||||
|      * |      * | ||||||
|      * @return Cache key. |      * @returns Cache key. | ||||||
|      */ |      */ | ||||||
|     protected getUserDevicesCacheKey(): string { |     protected getUserDevicesCacheKey(): string { | ||||||
|         return ROOT_CACHE_KEY + 'userDevices'; |         return ROOT_CACHE_KEY + 'userDevices'; | ||||||
| @ -124,7 +124,7 @@ export class AddonMessageOutputAirnotifierProvider { | |||||||
|      * |      * | ||||||
|      * @param ignoreCache Whether to ignore cache. |      * @param ignoreCache Whether to ignore cache. | ||||||
|      * @param siteId Site ID. If not defined, use current site. |      * @param siteId Site ID. If not defined, use current site. | ||||||
|      * @return Promise resolved with the devices. |      * @returns Promise resolved with the devices. | ||||||
|      */ |      */ | ||||||
|     async getUserDevices(ignoreCache?: boolean, siteId?: string): Promise<AddonMessageOutputAirnotifierDevice[]> { |     async getUserDevices(ignoreCache?: boolean, siteId?: string): Promise<AddonMessageOutputAirnotifierDevice[]> { | ||||||
| 
 | 
 | ||||||
| @ -156,7 +156,7 @@ export class AddonMessageOutputAirnotifierProvider { | |||||||
|      * Invalidate get user devices. |      * Invalidate get user devices. | ||||||
|      * |      * | ||||||
|      * @param siteId Site ID. If not defined, current site. |      * @param siteId Site ID. If not defined, current site. | ||||||
|      * @return Promise resolved when data is invalidated. |      * @returns Promise resolved when data is invalidated. | ||||||
|      */ |      */ | ||||||
|     async invalidateUserDevices(siteId?: string): Promise<void> { |     async invalidateUserDevices(siteId?: string): Promise<void> { | ||||||
|         const site = await CoreSites.getSite(siteId); |         const site = await CoreSites.getSite(siteId); | ||||||
| @ -168,7 +168,7 @@ export class AddonMessageOutputAirnotifierProvider { | |||||||
|      * Is user is an admin and push are disabled, notify him. |      * Is user is an admin and push are disabled, notify him. | ||||||
|      * |      * | ||||||
|      * @param siteId Site ID. |      * @param siteId Site ID. | ||||||
|      * @return Promise resolved when done. |      * @returns Promise resolved when done. | ||||||
|      */ |      */ | ||||||
|     protected async warnPushDisabledForAdmin(siteId?: string): Promise<void> { |     protected async warnPushDisabledForAdmin(siteId?: string): Promise<void> { | ||||||
|         if (!siteId) { |         if (!siteId) { | ||||||
|  | |||||||
| @ -31,7 +31,7 @@ export class AddonMessageOutputAirnotifierHandlerService implements AddonMessage | |||||||
|     /** |     /** | ||||||
|      * Whether or not the module is enabled for the site. |      * Whether or not the module is enabled for the site. | ||||||
|      * |      * | ||||||
|      * @return True if enabled, false otherwise. |      * @returns True if enabled, false otherwise. | ||||||
|      */ |      */ | ||||||
|     async isEnabled(): Promise<boolean> { |     async isEnabled(): Promise<boolean> { | ||||||
|         return true; |         return true; | ||||||
| @ -41,7 +41,7 @@ export class AddonMessageOutputAirnotifierHandlerService implements AddonMessage | |||||||
|      * Returns the data needed to render the handler. |      * Returns the data needed to render the handler. | ||||||
|      * |      * | ||||||
|      * @param processor The processor object. |      * @param processor The processor object. | ||||||
|      * @return Data. |      * @returns Data. | ||||||
|      */ |      */ | ||||||
|     // eslint-disable-next-line @typescript-eslint/no-unused-vars
 |     // eslint-disable-next-line @typescript-eslint/no-unused-vars
 | ||||||
|     getDisplayData(processor: Record<string, unknown>): AddonMessageOutputHandlerData { |     getDisplayData(processor: Record<string, unknown>): AddonMessageOutputHandlerData { | ||||||
|  | |||||||
| @ -31,7 +31,7 @@ export interface AddonMessageOutputHandler extends CoreDelegateHandler { | |||||||
|      * Returns the data needed to render the handler. |      * Returns the data needed to render the handler. | ||||||
|      * |      * | ||||||
|      * @param processor The processor object. |      * @param processor The processor object. | ||||||
|      * @return Data. |      * @returns Data. | ||||||
|      */ |      */ | ||||||
|     getDisplayData(processor: Record<string, unknown>): AddonMessageOutputHandlerData; |     getDisplayData(processor: Record<string, unknown>): AddonMessageOutputHandlerData; | ||||||
| } | } | ||||||
| @ -82,7 +82,7 @@ export class AddonMessageOutputDelegateService extends CoreDelegate<AddonMessage | |||||||
|      * Get the display data of the handler. |      * Get the display data of the handler. | ||||||
|      * |      * | ||||||
|      * @param processor The processor object. |      * @param processor The processor object. | ||||||
|      * @return Data. |      * @returns Data. | ||||||
|      */ |      */ | ||||||
|     getDisplayData(processor: Record<string, unknown>): AddonMessageOutputHandlerData | undefined { |     getDisplayData(processor: Record<string, unknown>): AddonMessageOutputHandlerData | undefined { | ||||||
|         return this.executeFunctionOnEnabled(<string> processor.name, 'getDisplayData', [processor]); |         return this.executeFunctionOnEnabled(<string> processor.name, 'getDisplayData', [processor]); | ||||||
|  | |||||||
| @ -57,7 +57,7 @@ export class AddonMessagesConversationInfoComponent implements OnInit { | |||||||
|     /** |     /** | ||||||
|      * Fetch the required data. |      * Fetch the required data. | ||||||
|      * |      * | ||||||
|      * @return Promise resolved when done. |      * @returns Promise resolved when done. | ||||||
|      */ |      */ | ||||||
|     protected async fetchData(): Promise<void> { |     protected async fetchData(): Promise<void> { | ||||||
|         // Get the conversation data first.
 |         // Get the conversation data first.
 | ||||||
| @ -76,7 +76,7 @@ export class AddonMessagesConversationInfoComponent implements OnInit { | |||||||
|      * Get conversation members. |      * Get conversation members. | ||||||
|      * |      * | ||||||
|      * @param loadingMore Whether we are loading more data or just the first ones. |      * @param loadingMore Whether we are loading more data or just the first ones. | ||||||
|      * @return Promise resolved when done. |      * @returns Promise resolved when done. | ||||||
|      */ |      */ | ||||||
|     protected async fetchMembers(loadingMore?: boolean): Promise<void> { |     protected async fetchMembers(loadingMore?: boolean): Promise<void> { | ||||||
|         this.loadMoreError = false; |         this.loadMoreError = false; | ||||||
| @ -97,7 +97,7 @@ export class AddonMessagesConversationInfoComponent implements OnInit { | |||||||
|      * Function to load more members. |      * Function to load more members. | ||||||
|      * |      * | ||||||
|      * @param infiniteComplete Infinite scroll complete function. Only used from core-infinite-loading. |      * @param infiniteComplete Infinite scroll complete function. Only used from core-infinite-loading. | ||||||
|      * @return Resolved when done. |      * @returns Resolved when done. | ||||||
|      */ |      */ | ||||||
|     async loadMoreMembers(infiniteComplete?: () => void): Promise<void> { |     async loadMoreMembers(infiniteComplete?: () => void): Promise<void> { | ||||||
|         try { |         try { | ||||||
| @ -114,7 +114,7 @@ export class AddonMessagesConversationInfoComponent implements OnInit { | |||||||
|      * Refresh the data. |      * Refresh the data. | ||||||
|      * |      * | ||||||
|      * @param refresher Refresher. |      * @param refresher Refresher. | ||||||
|      * @return Promise resolved when done. |      * @returns Promise resolved when done. | ||||||
|      */ |      */ | ||||||
|     async refreshData(refresher?: IonRefresher): Promise<void> { |     async refreshData(refresher?: IonRefresher): Promise<void> { | ||||||
|         const promises: Promise<void>[] = []; |         const promises: Promise<void>[] = []; | ||||||
|  | |||||||
| @ -33,6 +33,8 @@ export class AddonMessagesIndexGuard implements CanActivate { | |||||||
| 
 | 
 | ||||||
|     /** |     /** | ||||||
|      * Check if there is a pending redirect and trigger it. |      * Check if there is a pending redirect and trigger it. | ||||||
|  |      * | ||||||
|  |      * @returns The redirection route. | ||||||
|      */ |      */ | ||||||
|     private guard(route: ActivatedRouteSnapshot): UrlTree { |     private guard(route: ActivatedRouteSnapshot): UrlTree { | ||||||
|         const enabled = AddonMessages.isGroupMessagingEnabled(); |         const enabled = AddonMessages.isGroupMessagingEnabled(); | ||||||
|  | |||||||
| @ -124,7 +124,7 @@ export class AddonMessagesContacts35Page implements OnInit, OnDestroy { | |||||||
|      * Refresh the data. |      * Refresh the data. | ||||||
|      * |      * | ||||||
|      * @param refresher Refresher. |      * @param refresher Refresher. | ||||||
|      * @return Promise resolved when done. |      * @returns Promise resolved when done. | ||||||
|      */ |      */ | ||||||
|     async refreshData(refresher?: IonRefresher): Promise<void> { |     async refreshData(refresher?: IonRefresher): Promise<void> { | ||||||
|         try { |         try { | ||||||
| @ -144,7 +144,7 @@ export class AddonMessagesContacts35Page implements OnInit, OnDestroy { | |||||||
|     /** |     /** | ||||||
|      * Fetch contacts. |      * Fetch contacts. | ||||||
|      * |      * | ||||||
|      * @return Promise resolved when done. |      * @returns Promise resolved when done. | ||||||
|      */ |      */ | ||||||
|     protected async fetchData(): Promise<void> { |     protected async fetchData(): Promise<void> { | ||||||
|         this.loadingMessage = this.loadingMessages; |         this.loadingMessage = this.loadingMessages; | ||||||
| @ -169,7 +169,7 @@ export class AddonMessagesContacts35Page implements OnInit, OnDestroy { | |||||||
|      * Sort user list by fullname |      * Sort user list by fullname | ||||||
|      * |      * | ||||||
|      * @param list List to sort. |      * @param list List to sort. | ||||||
|      * @return Sorted list. |      * @returns Sorted list. | ||||||
|      */ |      */ | ||||||
|     protected sortUsers(list: AddonMessagesSearchContactsContact[]): AddonMessagesSearchContactsContact[] { |     protected sortUsers(list: AddonMessagesSearchContactsContact[]): AddonMessagesSearchContactsContact[] { | ||||||
|         return list.sort((a, b) => { |         return list.sort((a, b) => { | ||||||
| @ -201,7 +201,7 @@ export class AddonMessagesContacts35Page implements OnInit, OnDestroy { | |||||||
|      * Search users from the UI. |      * Search users from the UI. | ||||||
|      * |      * | ||||||
|      * @param query Text to search for. |      * @param query Text to search for. | ||||||
|      * @return Resolved when done. |      * @returns Resolved when done. | ||||||
|      */ |      */ | ||||||
|     search(query: string): Promise<void> { |     search(query: string): Promise<void> { | ||||||
|         CoreApp.closeKeyboard(); |         CoreApp.closeKeyboard(); | ||||||
| @ -218,7 +218,7 @@ export class AddonMessagesContacts35Page implements OnInit, OnDestroy { | |||||||
|      * Perform the search of users. |      * Perform the search of users. | ||||||
|      * |      * | ||||||
|      * @param query Text to search for. |      * @param query Text to search for. | ||||||
|      * @return Resolved when done. |      * @returns Resolved when done. | ||||||
|      */ |      */ | ||||||
|     protected async performSearch(query: string): Promise<void> { |     protected async performSearch(query: string): Promise<void> { | ||||||
|         try { |         try { | ||||||
|  | |||||||
| @ -159,7 +159,7 @@ export class AddonMessagesContactsPage implements OnInit, OnDestroy { | |||||||
|      * Fetch contacts. |      * Fetch contacts. | ||||||
|      * |      * | ||||||
|      * @param refresh True if we are refreshing contacts, false if we are loading more. |      * @param refresh True if we are refreshing contacts, false if we are loading more. | ||||||
|      * @return Promise resolved when done. |      * @returns Promise resolved when done. | ||||||
|      */ |      */ | ||||||
|     async confirmedFetchData(refresh: boolean = false): Promise<void> { |     async confirmedFetchData(refresh: boolean = false): Promise<void> { | ||||||
|         this.confirmedLoadMoreError = false; |         this.confirmedLoadMoreError = false; | ||||||
| @ -185,7 +185,7 @@ export class AddonMessagesContactsPage implements OnInit, OnDestroy { | |||||||
|      * Fetch contact requests. |      * Fetch contact requests. | ||||||
|      * |      * | ||||||
|      * @param refresh True if we are refreshing contact requests, false if we are loading more. |      * @param refresh True if we are refreshing contact requests, false if we are loading more. | ||||||
|      * @return Promise resolved when done. |      * @returns Promise resolved when done. | ||||||
|      */ |      */ | ||||||
|     async requestsFetchData(refresh: boolean = false): Promise<void> { |     async requestsFetchData(refresh: boolean = false): Promise<void> { | ||||||
|         this.requestsLoadMoreError = false; |         this.requestsLoadMoreError = false; | ||||||
| @ -211,7 +211,7 @@ export class AddonMessagesContactsPage implements OnInit, OnDestroy { | |||||||
|      * Refresh contacts or requests. |      * Refresh contacts or requests. | ||||||
|      * |      * | ||||||
|      * @param refresher Refresher. |      * @param refresher Refresher. | ||||||
|      * @return Promise resolved when done. |      * @returns Promise resolved when done. | ||||||
|      */ |      */ | ||||||
|     async refreshData(refresher?: IonRefresher): Promise<void> { |     async refreshData(refresher?: IonRefresher): Promise<void> { | ||||||
|         try { |         try { | ||||||
| @ -234,7 +234,7 @@ export class AddonMessagesContactsPage implements OnInit, OnDestroy { | |||||||
|      * Load more contacts or requests. |      * Load more contacts or requests. | ||||||
|      * |      * | ||||||
|      * @param infiniteComplete Infinite scroll complete function. Only used from core-infinite-loading. |      * @param infiniteComplete Infinite scroll complete function. Only used from core-infinite-loading. | ||||||
|      * @return Resolved when done. |      * @returns Resolved when done. | ||||||
|      */ |      */ | ||||||
|     async loadMore(infiniteComplete?: () => void): Promise<void> { |     async loadMore(infiniteComplete?: () => void): Promise<void> { | ||||||
|         try { |         try { | ||||||
|  | |||||||
| @ -176,7 +176,7 @@ export class AddonMessagesDiscussionPage implements OnInit, OnDestroy, AfterView | |||||||
|      * |      * | ||||||
|      * @param message Message to be added. |      * @param message Message to be added. | ||||||
|      * @param keep If set the keep flag or not. |      * @param keep If set the keep flag or not. | ||||||
|      * @return If message is not mine and was recently added. |      * @returns If message is not mine and was recently added. | ||||||
|      */ |      */ | ||||||
|     protected addMessage( |     protected addMessage( | ||||||
|         message: AddonMessagesConversationMessageFormatted, |         message: AddonMessagesConversationMessageFormatted, | ||||||
| @ -225,7 +225,7 @@ export class AddonMessagesDiscussionPage implements OnInit, OnDestroy, AfterView | |||||||
|     /** |     /** | ||||||
|      * Convenience function to fetch the conversation data. |      * Convenience function to fetch the conversation data. | ||||||
|      * |      * | ||||||
|      * @return Resolved when done. |      * @returns Resolved when done. | ||||||
|      */ |      */ | ||||||
|     protected async fetchData(): Promise<void> { |     protected async fetchData(): Promise<void> { | ||||||
|         let loader: CoreIonLoadingElement | undefined; |         let loader: CoreIonLoadingElement | undefined; | ||||||
| @ -365,7 +365,7 @@ export class AddonMessagesDiscussionPage implements OnInit, OnDestroy, AfterView | |||||||
|      * Convenience function to fetch messages. |      * Convenience function to fetch messages. | ||||||
|      * |      * | ||||||
|      * @param messagesAreNew If messages loaded are new messages. |      * @param messagesAreNew If messages loaded are new messages. | ||||||
|      * @return Resolved when done. |      * @returns Resolved when done. | ||||||
|      */ |      */ | ||||||
|     protected async fetchMessages(messagesAreNew: boolean = true): Promise<void> { |     protected async fetchMessages(messagesAreNew: boolean = true): Promise<void> { | ||||||
|         this.loadMoreError = false; |         this.loadMoreError = false; | ||||||
| @ -417,8 +417,8 @@ export class AddonMessagesDiscussionPage implements OnInit, OnDestroy, AfterView | |||||||
|     /** |     /** | ||||||
|      * Format and load a list of messages into the view. |      * Format and load a list of messages into the view. | ||||||
|      * |      * | ||||||
|      * @param messagesAreNew If messages loaded are new messages. |  | ||||||
|      * @param messages Messages to load. |      * @param messages Messages to load. | ||||||
|  |      * @param messagesAreNew If messages loaded are new messages. | ||||||
|      */ |      */ | ||||||
|     protected loadMessages( |     protected loadMessages( | ||||||
|         messages: AddonMessagesConversationMessageFormatted[], |         messages: AddonMessagesConversationMessageFormatted[], | ||||||
| @ -531,7 +531,7 @@ export class AddonMessagesDiscussionPage implements OnInit, OnDestroy, AfterView | |||||||
|      * |      * | ||||||
|      * @param conversationId Conversation ID. |      * @param conversationId Conversation ID. | ||||||
|      * @param userId User ID. |      * @param userId User ID. | ||||||
|      * @return Promise resolved with a boolean: whether the conversation exists or not. |      * @returns Promise resolved with a boolean: whether the conversation exists or not. | ||||||
|      */ |      */ | ||||||
|     protected async getConversation(conversationId?: number, userId?: number): Promise<boolean> { |     protected async getConversation(conversationId?: number, userId?: number): Promise<boolean> { | ||||||
|         let fallbackConversation: AddonMessagesConversationFormatted | undefined; |         let fallbackConversation: AddonMessagesConversationFormatted | undefined; | ||||||
| @ -611,7 +611,7 @@ export class AddonMessagesDiscussionPage implements OnInit, OnDestroy, AfterView | |||||||
|      * |      * | ||||||
|      * @param pagesToLoad Number of "pages" to load. |      * @param pagesToLoad Number of "pages" to load. | ||||||
|      * @param offset Offset for message list. |      * @param offset Offset for message list. | ||||||
|      * @return Promise resolved with the list of messages. |      * @returns Promise resolved with the list of messages. | ||||||
|      */ |      */ | ||||||
|     protected async getConversationMessages( |     protected async getConversationMessages( | ||||||
|         pagesToLoad: number, |         pagesToLoad: number, | ||||||
| @ -664,7 +664,7 @@ export class AddonMessagesDiscussionPage implements OnInit, OnDestroy, AfterView | |||||||
|      * @param lfReceivedRead Number of read received messages already fetched, so fetch will be done from this. |      * @param lfReceivedRead Number of read received messages already fetched, so fetch will be done from this. | ||||||
|      * @param lfSentUnread Number of unread sent messages already fetched, so fetch will be done from this. |      * @param lfSentUnread Number of unread sent messages already fetched, so fetch will be done from this. | ||||||
|      * @param lfSentRead Number of read sent messages already fetched, so fetch will be done from this. |      * @param lfSentRead Number of read sent messages already fetched, so fetch will be done from this. | ||||||
|      * @return Resolved when done. |      * @returns Resolved when done. | ||||||
|      */ |      */ | ||||||
|     protected async getDiscussionMessages( |     protected async getDiscussionMessages( | ||||||
|         pagesToLoad: number, |         pagesToLoad: number, | ||||||
| @ -874,7 +874,7 @@ export class AddonMessagesDiscussionPage implements OnInit, OnDestroy, AfterView | |||||||
|     /** |     /** | ||||||
|      * Wait until fetching is false. |      * Wait until fetching is false. | ||||||
|      * |      * | ||||||
|      * @return Resolved when done. |      * @returns Resolved when done. | ||||||
|      */ |      */ | ||||||
|     protected async waitForFetch(): Promise<void> { |     protected async waitForFetch(): Promise<void> { | ||||||
|         if (!this.fetching) { |         if (!this.fetching) { | ||||||
| @ -982,7 +982,7 @@ export class AddonMessagesDiscussionPage implements OnInit, OnDestroy, AfterView | |||||||
|      * Function to load previous messages. |      * Function to load previous messages. | ||||||
|      * |      * | ||||||
|      * @param infiniteComplete Infinite scroll complete function. Only used from core-infinite-loading. |      * @param infiniteComplete Infinite scroll complete function. Only used from core-infinite-loading. | ||||||
|      * @return Resolved when done. |      * @returns Resolved when done. | ||||||
|      */ |      */ | ||||||
|     async loadPrevious(infiniteComplete?: () => void): Promise<void> { |     async loadPrevious(infiniteComplete?: () => void): Promise<void> { | ||||||
|         if (!this.initialized) { |         if (!this.initialized) { | ||||||
| @ -1189,7 +1189,7 @@ export class AddonMessagesDiscussionPage implements OnInit, OnDestroy, AfterView | |||||||
|      * |      * | ||||||
|      * @param message Current message where to show the date. |      * @param message Current message where to show the date. | ||||||
|      * @param prevMessage Previous message where to compare the date with. |      * @param prevMessage Previous message where to compare the date with. | ||||||
|      * @return If date has changed and should be shown. |      * @returns If date has changed and should be shown. | ||||||
|      */ |      */ | ||||||
|     showDate( |     showDate( | ||||||
|         message: AddonMessagesConversationMessageFormatted, |         message: AddonMessagesConversationMessageFormatted, | ||||||
| @ -1211,7 +1211,7 @@ export class AddonMessagesDiscussionPage implements OnInit, OnDestroy, AfterView | |||||||
|      * |      * | ||||||
|      * @param message Current message where to show the user info. |      * @param message Current message where to show the user info. | ||||||
|      * @param prevMessage Previous message. |      * @param prevMessage Previous message. | ||||||
|      * @return Whether user data should be shown. |      * @returns Whether user data should be shown. | ||||||
|      */ |      */ | ||||||
|     showUserData( |     showUserData( | ||||||
|         message: AddonMessagesConversationMessageFormatted, |         message: AddonMessagesConversationMessageFormatted, | ||||||
| @ -1227,7 +1227,7 @@ export class AddonMessagesDiscussionPage implements OnInit, OnDestroy, AfterView | |||||||
|      * |      * | ||||||
|      * @param message Current message where to show the user info. |      * @param message Current message where to show the user info. | ||||||
|      * @param nextMessage Next message. |      * @param nextMessage Next message. | ||||||
|      * @return Whether user data should be shown. |      * @returns Whether user data should be shown. | ||||||
|      */ |      */ | ||||||
|     showTail( |     showTail( | ||||||
|         message: AddonMessagesConversationMessageFormatted, |         message: AddonMessagesConversationMessageFormatted, | ||||||
| @ -1378,7 +1378,7 @@ export class AddonMessagesDiscussionPage implements OnInit, OnDestroy, AfterView | |||||||
|     /** |     /** | ||||||
|      * Displays a confirmation modal to block the user of the individual conversation. |      * Displays a confirmation modal to block the user of the individual conversation. | ||||||
|      * |      * | ||||||
|      * @return Promise resolved when user is blocked or dialog is cancelled. |      * @returns Promise resolved when user is blocked or dialog is cancelled. | ||||||
|      */ |      */ | ||||||
|     async blockUser(): Promise<void> { |     async blockUser(): Promise<void> { | ||||||
|         if (!this.otherMember) { |         if (!this.otherMember) { | ||||||
| @ -1465,7 +1465,7 @@ export class AddonMessagesDiscussionPage implements OnInit, OnDestroy, AfterView | |||||||
|     /** |     /** | ||||||
|      * Displays a confirmation modal to unblock the user of the individual conversation. |      * Displays a confirmation modal to unblock the user of the individual conversation. | ||||||
|      * |      * | ||||||
|      * @return Promise resolved when user is unblocked or dialog is cancelled. |      * @returns Promise resolved when user is unblocked or dialog is cancelled. | ||||||
|      */ |      */ | ||||||
|     async unblockUser(): Promise<void> { |     async unblockUser(): Promise<void> { | ||||||
|         if (!this.otherMember) { |         if (!this.otherMember) { | ||||||
| @ -1504,7 +1504,7 @@ export class AddonMessagesDiscussionPage implements OnInit, OnDestroy, AfterView | |||||||
|     /** |     /** | ||||||
|      * Displays a confirmation modal to send a contact request to the other user of the individual conversation. |      * Displays a confirmation modal to send a contact request to the other user of the individual conversation. | ||||||
|      * |      * | ||||||
|      * @return Promise resolved when the request is sent or the dialog is cancelled. |      * @returns Promise resolved when the request is sent or the dialog is cancelled. | ||||||
|      */ |      */ | ||||||
|     async createContactRequest(): Promise<void> { |     async createContactRequest(): Promise<void> { | ||||||
|         if (!this.otherMember) { |         if (!this.otherMember) { | ||||||
| @ -1543,7 +1543,7 @@ export class AddonMessagesDiscussionPage implements OnInit, OnDestroy, AfterView | |||||||
|     /** |     /** | ||||||
|      * Confirms the contact request of the other user of the individual conversation. |      * Confirms the contact request of the other user of the individual conversation. | ||||||
|      * |      * | ||||||
|      * @return Promise resolved when the request is confirmed. |      * @returns Promise resolved when the request is confirmed. | ||||||
|      */ |      */ | ||||||
|     async confirmContactRequest(): Promise<void> { |     async confirmContactRequest(): Promise<void> { | ||||||
|         if (!this.otherMember) { |         if (!this.otherMember) { | ||||||
| @ -1569,7 +1569,7 @@ export class AddonMessagesDiscussionPage implements OnInit, OnDestroy, AfterView | |||||||
|     /** |     /** | ||||||
|      * Declines the contact request of the other user of the individual conversation. |      * Declines the contact request of the other user of the individual conversation. | ||||||
|      * |      * | ||||||
|      * @return Promise resolved when the request is confirmed. |      * @returns Promise resolved when the request is confirmed. | ||||||
|      */ |      */ | ||||||
|     async declineContactRequest(): Promise<void> { |     async declineContactRequest(): Promise<void> { | ||||||
|         if (!this.otherMember) { |         if (!this.otherMember) { | ||||||
| @ -1595,7 +1595,7 @@ export class AddonMessagesDiscussionPage implements OnInit, OnDestroy, AfterView | |||||||
|     /** |     /** | ||||||
|      * Displays a confirmation modal to remove the other user of the conversation from contacts. |      * Displays a confirmation modal to remove the other user of the conversation from contacts. | ||||||
|      * |      * | ||||||
|      * @return Promise resolved when the request is sent or the dialog is cancelled. |      * @returns Promise resolved when the request is sent or the dialog is cancelled. | ||||||
|      */ |      */ | ||||||
|     async removeContact(): Promise<void> { |     async removeContact(): Promise<void> { | ||||||
|         if (!this.otherMember) { |         if (!this.otherMember) { | ||||||
|  | |||||||
| @ -161,7 +161,7 @@ export class AddonMessagesDiscussions35Page implements OnInit, OnDestroy { | |||||||
|      * |      * | ||||||
|      * @param refresher Refresher. |      * @param refresher Refresher. | ||||||
|      * @param refreshUnreadCounts Whteher to refresh unread counts. |      * @param refreshUnreadCounts Whteher to refresh unread counts. | ||||||
|      * @return Promise resolved when done. |      * @returns Promise resolved when done. | ||||||
|      */ |      */ | ||||||
|     async refreshData(refresher?: IonRefresher, refreshUnreadCounts: boolean = true): Promise<void> { |     async refreshData(refresher?: IonRefresher, refreshUnreadCounts: boolean = true): Promise<void> { | ||||||
|         const promises: Promise<void>[] = []; |         const promises: Promise<void>[] = []; | ||||||
| @ -181,7 +181,7 @@ export class AddonMessagesDiscussions35Page implements OnInit, OnDestroy { | |||||||
|     /** |     /** | ||||||
|      * Fetch discussions. |      * Fetch discussions. | ||||||
|      * |      * | ||||||
|      * @return Promise resolved when done. |      * @returns Promise resolved when done. | ||||||
|      */ |      */ | ||||||
|     protected async fetchData(): Promise<void> { |     protected async fetchData(): Promise<void> { | ||||||
|         this.loadingMessage = this.loadingMessages; |         this.loadingMessage = this.loadingMessages; | ||||||
| @ -229,7 +229,7 @@ export class AddonMessagesDiscussions35Page implements OnInit, OnDestroy { | |||||||
|      * Search messages cotaining text. |      * Search messages cotaining text. | ||||||
|      * |      * | ||||||
|      * @param query Text to search for. |      * @param query Text to search for. | ||||||
|      * @return Resolved when done. |      * @returns Resolved when done. | ||||||
|      */ |      */ | ||||||
|     async searchMessage(query: string): Promise<void> { |     async searchMessage(query: string): Promise<void> { | ||||||
|         CoreApp.closeKeyboard(); |         CoreApp.closeKeyboard(); | ||||||
| @ -252,7 +252,6 @@ export class AddonMessagesDiscussions35Page implements OnInit, OnDestroy { | |||||||
|      * |      * | ||||||
|      * @param discussionUserId Discussion Id to load. |      * @param discussionUserId Discussion Id to load. | ||||||
|      * @param messageId Message to scroll after loading the discussion. Used when searching. |      * @param messageId Message to scroll after loading the discussion. Used when searching. | ||||||
|      * @param onlyWithSplitView Only go to Discussion if split view is on. |  | ||||||
|      */ |      */ | ||||||
|     async gotoDiscussion(discussionUserId: number, messageId?: number): Promise<void> { |     async gotoDiscussion(discussionUserId: number, messageId?: number): Promise<void> { | ||||||
|         this.discussionUserId = discussionUserId; |         this.discussionUserId = discussionUserId; | ||||||
|  | |||||||
| @ -307,7 +307,7 @@ export class AddonMessagesGroupConversationsPage implements OnInit, OnDestroy { | |||||||
|      * Fetch conversations. |      * Fetch conversations. | ||||||
|      * |      * | ||||||
|      * @param refreshUnreadCounts Whether to refresh unread counts. |      * @param refreshUnreadCounts Whether to refresh unread counts. | ||||||
|      * @return Promise resolved when done. |      * @returns Promise resolved when done. | ||||||
|      */ |      */ | ||||||
|     protected async fetchData(refreshUnreadCounts: boolean = true): Promise<void> { |     protected async fetchData(refreshUnreadCounts: boolean = true): Promise<void> { | ||||||
|         // Load the amount of conversations and contact requests.
 |         // Load the amount of conversations and contact requests.
 | ||||||
| @ -359,7 +359,7 @@ export class AddonMessagesGroupConversationsPage implements OnInit, OnDestroy { | |||||||
|     /** |     /** | ||||||
|      * Fetch data for the expanded option. |      * Fetch data for the expanded option. | ||||||
|      * |      * | ||||||
|      * @return Promise resolved when done. |      * @returns Promise resolved when done. | ||||||
|      */ |      */ | ||||||
|     protected async fetchDataForExpandedOption(): Promise<void> { |     protected async fetchDataForExpandedOption(): Promise<void> { | ||||||
|         if (this.favourites.expanded === undefined) { |         if (this.favourites.expanded === undefined) { | ||||||
| @ -384,7 +384,7 @@ export class AddonMessagesGroupConversationsPage implements OnInit, OnDestroy { | |||||||
|      * @param option The option to fetch data for. |      * @param option The option to fetch data for. | ||||||
|      * @param loadingMore Whether we are loading more data or just the first ones. |      * @param loadingMore Whether we are loading more data or just the first ones. | ||||||
|      * @param getCounts Whether to get counts data. |      * @param getCounts Whether to get counts data. | ||||||
|      * @return Promise resolved when done. |      * @returns Promise resolved when done. | ||||||
|      */ |      */ | ||||||
|     async fetchDataForOption( |     async fetchDataForOption( | ||||||
|         option: AddonMessagesGroupConversationOption, |         option: AddonMessagesGroupConversationOption, | ||||||
| @ -444,7 +444,7 @@ export class AddonMessagesGroupConversationsPage implements OnInit, OnDestroy { | |||||||
|     /** |     /** | ||||||
|      * Fetch conversation counts. |      * Fetch conversation counts. | ||||||
|      * |      * | ||||||
|      * @return Promise resolved when done. |      * @returns Promise resolved when done. | ||||||
|      */ |      */ | ||||||
|     protected async fetchConversationCounts(): Promise<void> { |     protected async fetchConversationCounts(): Promise<void> { | ||||||
|         // Always try to get the latest data.
 |         // Always try to get the latest data.
 | ||||||
| @ -462,7 +462,7 @@ export class AddonMessagesGroupConversationsPage implements OnInit, OnDestroy { | |||||||
|      * @param conversationId The conversation ID to search. |      * @param conversationId The conversation ID to search. | ||||||
|      * @param userId User ID to search (if no conversationId). |      * @param userId User ID to search (if no conversationId). | ||||||
|      * @param option The option to search in. If not defined, search in all options. |      * @param option The option to search in. If not defined, search in all options. | ||||||
|      * @return Conversation. |      * @returns Conversation. | ||||||
|      */ |      */ | ||||||
|     protected findConversation( |     protected findConversation( | ||||||
|         conversationId?: number, |         conversationId?: number, | ||||||
| @ -488,7 +488,7 @@ export class AddonMessagesGroupConversationsPage implements OnInit, OnDestroy { | |||||||
|     /** |     /** | ||||||
|      * Get the option that is currently expanded, undefined if they are all collapsed. |      * Get the option that is currently expanded, undefined if they are all collapsed. | ||||||
|      * |      * | ||||||
|      * @return Option currently expanded. |      * @returns Option currently expanded. | ||||||
|      */ |      */ | ||||||
|     protected getExpandedOption(): AddonMessagesGroupConversationOption | undefined { |     protected getExpandedOption(): AddonMessagesGroupConversationOption | undefined { | ||||||
|         if (this.favourites.expanded) { |         if (this.favourites.expanded) { | ||||||
| @ -541,7 +541,7 @@ export class AddonMessagesGroupConversationsPage implements OnInit, OnDestroy { | |||||||
|      * |      * | ||||||
|      * @param option The option to fetch data for. |      * @param option The option to fetch data for. | ||||||
|      * @param infiniteComplete Infinite scroll complete function. Only used from core-infinite-loading. |      * @param infiniteComplete Infinite scroll complete function. Only used from core-infinite-loading. | ||||||
|      * @return Promise resolved when done. |      * @returns Promise resolved when done. | ||||||
|      */ |      */ | ||||||
|     async loadMoreConversations(option: AddonMessagesGroupConversationOption, infiniteComplete?: () => void): Promise<void> { |     async loadMoreConversations(option: AddonMessagesGroupConversationOption, infiniteComplete?: () => void): Promise<void> { | ||||||
|         try { |         try { | ||||||
| @ -559,7 +559,7 @@ export class AddonMessagesGroupConversationsPage implements OnInit, OnDestroy { | |||||||
|      * |      * | ||||||
|      * @param option The option where the messages should be loaded. |      * @param option The option where the messages should be loaded. | ||||||
|      * @param messages Offline messages. |      * @param messages Offline messages. | ||||||
|      * @return Promise resolved when done. |      * @returns Promise resolved when done. | ||||||
|      */ |      */ | ||||||
|     protected async loadOfflineMessages( |     protected async loadOfflineMessages( | ||||||
|         option: AddonMessagesGroupConversationOption, |         option: AddonMessagesGroupConversationOption, | ||||||
| @ -675,7 +675,7 @@ export class AddonMessagesGroupConversationsPage implements OnInit, OnDestroy { | |||||||
|      * Given a conversation, return its option (favourites, group, individual). |      * Given a conversation, return its option (favourites, group, individual). | ||||||
|      * |      * | ||||||
|      * @param conversation Conversation to check. |      * @param conversation Conversation to check. | ||||||
|      * @return Option object. |      * @returns Option object. | ||||||
|      */ |      */ | ||||||
|     protected getConversationOption( |     protected getConversationOption( | ||||||
|         conversation: AddonMessagesConversationForList | AddonMessagesNewMessagedEventData, |         conversation: AddonMessagesConversationForList | AddonMessagesNewMessagedEventData, | ||||||
| @ -696,7 +696,7 @@ export class AddonMessagesGroupConversationsPage implements OnInit, OnDestroy { | |||||||
|      * |      * | ||||||
|      * @param refresher Refresher. |      * @param refresher Refresher. | ||||||
|      * @param refreshUnreadCounts Whether to refresh unread counts. |      * @param refreshUnreadCounts Whether to refresh unread counts. | ||||||
|      * @return Promise resolved when done. |      * @returns Promise resolved when done. | ||||||
|      */ |      */ | ||||||
|     async refreshData(refresher?: IonRefresher, refreshUnreadCounts: boolean = true): Promise<void> { |     async refreshData(refresher?: IonRefresher, refreshUnreadCounts: boolean = true): Promise<void> { | ||||||
|         // Don't invalidate conversations and so, they always try to get latest data.
 |         // Don't invalidate conversations and so, they always try to get latest data.
 | ||||||
| @ -736,7 +736,7 @@ export class AddonMessagesGroupConversationsPage implements OnInit, OnDestroy { | |||||||
|      * |      * | ||||||
|      * @param option The option to expand. |      * @param option The option to expand. | ||||||
|      * @param getCounts Whether to get counts data. |      * @param getCounts Whether to get counts data. | ||||||
|      * @return Promise resolved when done. |      * @returns Promise resolved when done. | ||||||
|      */ |      */ | ||||||
|     protected async expandOption(option: AddonMessagesGroupConversationOption, getCounts = false): Promise<void> { |     protected async expandOption(option: AddonMessagesGroupConversationOption, getCounts = false): Promise<void> { | ||||||
|         // Collapse all and expand the right one.
 |         // Collapse all and expand the right one.
 | ||||||
|  | |||||||
| @ -118,7 +118,7 @@ export class AddonMessagesSearchPage implements OnDestroy { | |||||||
|      * @param query Text to search for. |      * @param query Text to search for. | ||||||
|      * @param loadMore Load more contacts, noncontacts or messages. If undefined, start a new search. |      * @param loadMore Load more contacts, noncontacts or messages. If undefined, start a new search. | ||||||
|      * @param infiniteComplete Infinite scroll complete function. Only used from core-infinite-loading. |      * @param infiniteComplete Infinite scroll complete function. Only used from core-infinite-loading. | ||||||
|      * @return Resolved when done. |      * @returns Resolved when done. | ||||||
|      */ |      */ | ||||||
|     async search(query: string, loadMore?: 'contacts' | 'noncontacts' | 'messages', infiniteComplete?: () => void): Promise<void> { |     async search(query: string, loadMore?: 'contacts' | 'noncontacts' | 'messages', infiniteComplete?: () => void): Promise<void> { | ||||||
|         CoreApp.closeKeyboard(); |         CoreApp.closeKeyboard(); | ||||||
|  | |||||||
| @ -79,7 +79,7 @@ export class AddonMessagesSettingsPage implements OnInit, OnDestroy { | |||||||
|     /** |     /** | ||||||
|      * Fetches preference data. |      * Fetches preference data. | ||||||
|      * |      * | ||||||
|      * @return Promise resolved when done. |      * @returns Promise resolved when done. | ||||||
|      */ |      */ | ||||||
|     protected async fetchPreferences(): Promise<void> { |     protected async fetchPreferences(): Promise<void> { | ||||||
|         try { |         try { | ||||||
|  | |||||||
| @ -31,7 +31,7 @@ export class AddonMessagesContactRequestLinkHandlerService extends CoreContentLi | |||||||
|     /** |     /** | ||||||
|      * Get the list of actions for a link (url). |      * Get the list of actions for a link (url). | ||||||
|      * |      * | ||||||
|      * @return List of (or promise resolved with list of) actions. |      * @returns List of (or promise resolved with list of) actions. | ||||||
|      */ |      */ | ||||||
|     getActions(): CoreContentLinksAction[] | Promise<CoreContentLinksAction[]> { |     getActions(): CoreContentLinksAction[] | Promise<CoreContentLinksAction[]> { | ||||||
|         return [{ |         return [{ | ||||||
| @ -46,7 +46,7 @@ export class AddonMessagesContactRequestLinkHandlerService extends CoreContentLi | |||||||
|      * If not defined, defaults to true. |      * If not defined, defaults to true. | ||||||
|      * |      * | ||||||
|      * @param siteId The site ID. |      * @param siteId The site ID. | ||||||
|      * @return Whether the handler is enabled for the URL and site. |      * @returns Whether the handler is enabled for the URL and site. | ||||||
|      */ |      */ | ||||||
|     async isEnabled(siteId: string): Promise<boolean> { |     async isEnabled(siteId: string): Promise<boolean> { | ||||||
|         const enabled = await AddonMessages.isPluginEnabled(siteId); |         const enabled = await AddonMessages.isPluginEnabled(siteId); | ||||||
|  | |||||||
| @ -37,7 +37,7 @@ export class AddonMessagesDiscussionLinkHandlerService extends CoreContentLinksH | |||||||
|      * @param siteIds List of sites the URL belongs to. |      * @param siteIds List of sites the URL belongs to. | ||||||
|      * @param url The URL to treat. |      * @param url The URL to treat. | ||||||
|      * @param params The params of the URL. E.g. 'mysite.com?id=1' -> {id: 1} |      * @param params The params of the URL. E.g. 'mysite.com?id=1' -> {id: 1} | ||||||
|      * @return List of (or promise resolved with list of) actions. |      * @returns List of (or promise resolved with list of) actions. | ||||||
|      */ |      */ | ||||||
|     getActions( |     getActions( | ||||||
|         siteIds: string[], |         siteIds: string[], | ||||||
| @ -59,7 +59,7 @@ export class AddonMessagesDiscussionLinkHandlerService extends CoreContentLinksH | |||||||
|      * @param siteId The site ID. |      * @param siteId The site ID. | ||||||
|      * @param url The URL to treat. |      * @param url The URL to treat. | ||||||
|      * @param params The params of the URL. E.g. 'mysite.com?id=1' -> {id: 1} |      * @param params The params of the URL. E.g. 'mysite.com?id=1' -> {id: 1} | ||||||
|      * @return Whether the handler is enabled for the URL and site. |      * @returns Whether the handler is enabled for the URL and site. | ||||||
|      */ |      */ | ||||||
|     async isEnabled(siteId: string, url: string, params: Record<string, string>): Promise<boolean> { |     async isEnabled(siteId: string, url: string, params: Record<string, string>): Promise<boolean> { | ||||||
|         const enabled = await AddonMessages.isPluginEnabled(siteId); |         const enabled = await AddonMessages.isPluginEnabled(siteId); | ||||||
|  | |||||||
| @ -33,7 +33,7 @@ export class AddonMessagesIndexLinkHandlerService extends CoreContentLinksHandle | |||||||
|     /** |     /** | ||||||
|      * Get the list of actions for a link (url). |      * Get the list of actions for a link (url). | ||||||
|      * |      * | ||||||
|      * @return List of (or promise resolved with list of) actions. |      * @returns List of (or promise resolved with list of) actions. | ||||||
|      */ |      */ | ||||||
|     getActions(): CoreContentLinksAction[] | Promise<CoreContentLinksAction[]> { |     getActions(): CoreContentLinksAction[] | Promise<CoreContentLinksAction[]> { | ||||||
|         return [{ |         return [{ | ||||||
| @ -51,7 +51,7 @@ export class AddonMessagesIndexLinkHandlerService extends CoreContentLinksHandle | |||||||
|      * If not defined, defaults to true. |      * If not defined, defaults to true. | ||||||
|      * |      * | ||||||
|      * @param siteId The site ID. |      * @param siteId The site ID. | ||||||
|      * @return Whether the handler is enabled for the URL and site. |      * @returns Whether the handler is enabled for the URL and site. | ||||||
|      */ |      */ | ||||||
|     isEnabled(siteId: string): Promise<boolean> { |     isEnabled(siteId: string): Promise<boolean> { | ||||||
|         return AddonMessages.isPluginEnabled(siteId); |         return AddonMessages.isPluginEnabled(siteId); | ||||||
|  | |||||||
| @ -99,7 +99,7 @@ export class AddonMessagesMainMenuHandlerService implements CoreMainMenuHandler, | |||||||
|     /** |     /** | ||||||
|      * Check if the handler is enabled on a site level. |      * Check if the handler is enabled on a site level. | ||||||
|      * |      * | ||||||
|      * @return Whether or not the handler is enabled on a site level. |      * @returns Whether or not the handler is enabled on a site level. | ||||||
|      */ |      */ | ||||||
|     isEnabled(): Promise<boolean> { |     isEnabled(): Promise<boolean> { | ||||||
|         return AddonMessages.isPluginEnabled(); |         return AddonMessages.isPluginEnabled(); | ||||||
| @ -108,7 +108,7 @@ export class AddonMessagesMainMenuHandlerService implements CoreMainMenuHandler, | |||||||
|     /** |     /** | ||||||
|      * Returns the data needed to render the handler. |      * Returns the data needed to render the handler. | ||||||
|      * |      * | ||||||
|      * @return Data needed to render the handler. |      * @returns Data needed to render the handler. | ||||||
|      */ |      */ | ||||||
|     getDisplayData(): CoreMainMenuHandlerToDisplay { |     getDisplayData(): CoreMainMenuHandlerToDisplay { | ||||||
|         if (this.handler.loading) { |         if (this.handler.loading) { | ||||||
| @ -123,7 +123,7 @@ export class AddonMessagesMainMenuHandlerService implements CoreMainMenuHandler, | |||||||
|      * |      * | ||||||
|      * @param siteId Site ID or current Site if undefined. |      * @param siteId Site ID or current Site if undefined. | ||||||
|      * @param unreadOnly If true only the unread conversations count is refreshed. |      * @param unreadOnly If true only the unread conversations count is refreshed. | ||||||
|      * @return Resolve when done. |      * @returns Resolve when done. | ||||||
|      */ |      */ | ||||||
|     async refreshBadge(siteId?: string, unreadOnly?: boolean): Promise<void> { |     async refreshBadge(siteId?: string, unreadOnly?: boolean): Promise<void> { | ||||||
|         const badgeSiteId = siteId || CoreSites.getCurrentSiteId(); |         const badgeSiteId = siteId || CoreSites.getCurrentSiteId(); | ||||||
| @ -188,7 +188,7 @@ export class AddonMessagesMainMenuHandlerService implements CoreMainMenuHandler, | |||||||
|      * Receives the ID of the site affected, undefined for all sites. |      * Receives the ID of the site affected, undefined for all sites. | ||||||
|      * |      * | ||||||
|      * @param siteId ID of the site affected, undefined for all sites. |      * @param siteId ID of the site affected, undefined for all sites. | ||||||
|      * @return Promise resolved when done, rejected if failure. |      * @returns Promise resolved when done, rejected if failure. | ||||||
|      */ |      */ | ||||||
|     async execute(siteId?: string): Promise<void> { |     async execute(siteId?: string): Promise<void> { | ||||||
|         if (!CoreSites.isCurrentSite(siteId)) { |         if (!CoreSites.isCurrentSite(siteId)) { | ||||||
| @ -201,7 +201,7 @@ export class AddonMessagesMainMenuHandlerService implements CoreMainMenuHandler, | |||||||
|     /** |     /** | ||||||
|      * Get the time between consecutive executions. |      * Get the time between consecutive executions. | ||||||
|      * |      * | ||||||
|      * @return Time between consecutive executions (in ms). |      * @returns Time between consecutive executions (in ms). | ||||||
|      */ |      */ | ||||||
|     getInterval(): number { |     getInterval(): number { | ||||||
|         if (!this.isSync()) { |         if (!this.isSync()) { | ||||||
| @ -214,7 +214,7 @@ export class AddonMessagesMainMenuHandlerService implements CoreMainMenuHandler, | |||||||
|     /** |     /** | ||||||
|      * Whether it's a synchronization process or not. |      * Whether it's a synchronization process or not. | ||||||
|      * |      * | ||||||
|      * @return True if is a sync process, false otherwise. |      * @returns True if is a sync process, false otherwise. | ||||||
|      */ |      */ | ||||||
|     isSync(): boolean { |     isSync(): boolean { | ||||||
|         return false; |         return false; | ||||||
| @ -223,7 +223,7 @@ export class AddonMessagesMainMenuHandlerService implements CoreMainMenuHandler, | |||||||
|     /** |     /** | ||||||
|      * Whether the process should be executed during a manual sync. |      * Whether the process should be executed during a manual sync. | ||||||
|      * |      * | ||||||
|      * @return True if is a manual sync process, false otherwise. |      * @returns True if is a manual sync process, false otherwise. | ||||||
|      */ |      */ | ||||||
|     canManualSync(): boolean { |     canManualSync(): boolean { | ||||||
|         return true; |         return true; | ||||||
|  | |||||||
| @ -35,7 +35,7 @@ export class AddonMessagesPushClickHandlerService implements CorePushNotificatio | |||||||
|      * Check if a notification click is handled by this handler. |      * Check if a notification click is handled by this handler. | ||||||
|      * |      * | ||||||
|      * @param notification The notification to check. |      * @param notification The notification to check. | ||||||
|      * @return Whether the notification click is handled by this handler |      * @returns Whether the notification click is handled by this handler | ||||||
|      */ |      */ | ||||||
|     async handles(notification: AddonMessagesPushNotificationData): Promise<boolean> { |     async handles(notification: AddonMessagesPushNotificationData): Promise<boolean> { | ||||||
|         if (CoreUtils.isTrueOrOne(notification.notif) && notification.name != 'messagecontactrequests') { |         if (CoreUtils.isTrueOrOne(notification.notif) && notification.name != 'messagecontactrequests') { | ||||||
| @ -50,7 +50,7 @@ export class AddonMessagesPushClickHandlerService implements CorePushNotificatio | |||||||
|      * Handle the notification click. |      * Handle the notification click. | ||||||
|      * |      * | ||||||
|      * @param notification The notification to check. |      * @param notification The notification to check. | ||||||
|      * @return Promise resolved when done. |      * @returns Promise resolved when done. | ||||||
|      */ |      */ | ||||||
|     async handleClick(notification: AddonMessagesPushNotificationData): Promise<void> { |     async handleClick(notification: AddonMessagesPushNotificationData): Promise<void> { | ||||||
|         try { |         try { | ||||||
|  | |||||||
| @ -31,7 +31,7 @@ export class AddonMessagesSettingsHandlerService implements CoreSettingsHandler | |||||||
|     /** |     /** | ||||||
|      * Check if the handler is enabled on a site level. |      * Check if the handler is enabled on a site level. | ||||||
|      * |      * | ||||||
|      * @return Whether or not the handler is enabled on a site level. |      * @returns Whether or not the handler is enabled on a site level. | ||||||
|      */ |      */ | ||||||
|     async isEnabled(): Promise<boolean> { |     async isEnabled(): Promise<boolean> { | ||||||
|         return AddonMessages.isPluginEnabled(); |         return AddonMessages.isPluginEnabled(); | ||||||
| @ -40,7 +40,7 @@ export class AddonMessagesSettingsHandlerService implements CoreSettingsHandler | |||||||
|     /** |     /** | ||||||
|      * Returns the data needed to render the handler. |      * Returns the data needed to render the handler. | ||||||
|      * |      * | ||||||
|      * @return Data needed to render the handler. |      * @returns Data needed to render the handler. | ||||||
|      */ |      */ | ||||||
|     getDisplayData(): CoreSettingsHandlerData { |     getDisplayData(): CoreSettingsHandlerData { | ||||||
|         return { |         return { | ||||||
|  | |||||||
Some files were not shown because too many files have changed in this diff Show More
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user