forked from EVOgeek/Vmeda.Online
		
	MOBILE-4362 lint: Solve deprecation linting
This commit is contained in:
		
							parent
							
								
									7f8081f01b
								
							
						
					
					
						commit
						58d571d64f
					
				| @ -194,7 +194,7 @@ export type AddonBadgesUserBadge = { | ||||
|         targetframework?: string; // Target framework.
 | ||||
|         targetcode?: string; // Target code.
 | ||||
|     }[]; | ||||
|     competencies?: { // @deprecatedonmoodle from 3.7. @since 3.6. In 3.7 it was renamed to alignment.
 | ||||
|     competencies?: { // @deprecatedonmoodle since 3.7. @since 3.6. In 3.7 it was renamed to alignment.
 | ||||
|         id?: number; // Alignment id.
 | ||||
|         badgeid?: number; // Badge id.
 | ||||
|         targetname?: string; // Target name.
 | ||||
|  | ||||
| @ -646,7 +646,7 @@ export class AddonCalendarEditEventPage implements OnInit, OnDestroy, CanLeave { | ||||
|      */ | ||||
|     async addReminder(): Promise<void> { | ||||
|         const formData = this.form.value; | ||||
|         const eventTime = CoreTimeUtils.convertToTimestamp(formData.timestart, true); | ||||
|         const eventTime = moment(formData.timestart).unix(); | ||||
| 
 | ||||
|         const reminderTime = await CoreDomUtils.openPopover<{timeBefore: number}>({ | ||||
|             component: CoreRemindersSetReminderMenuComponent, | ||||
|  | ||||
| @ -97,7 +97,7 @@ export class AddonMessagesProvider { | ||||
|      * @param userId User ID of the person to add. | ||||
|      * @param siteId Site ID. If not defined, use current site. | ||||
|      * @returns Resolved when done. | ||||
|      * @deprecated since Moodle 3.6 | ||||
|      * @deprecatedonmoodle since 3.6 | ||||
|      */ | ||||
|     protected async addContact(userId: number, siteId?: string): Promise<void> { | ||||
|         const site = await CoreSites.getSite(siteId); | ||||
| @ -582,7 +582,7 @@ export class AddonMessagesProvider { | ||||
|      * | ||||
|      * @param siteId Site ID. If not defined, use current site. | ||||
|      * @returns Promise resolved with the WS data. | ||||
|      * @deprecated since Moodle 3.6 | ||||
|      * @deprecatedonmoodle since 3.6 | ||||
|      */ | ||||
|     async getAllContacts(siteId?: string): Promise<AddonMessagesGetContactsWSResponse> { | ||||
|         siteId = siteId || CoreSites.getCurrentSiteId(); | ||||
| @ -634,7 +634,7 @@ export class AddonMessagesProvider { | ||||
|      * | ||||
|      * @param siteId Site ID. If not defined, use current site. | ||||
|      * @returns Promise resolved with the WS data. | ||||
|      * @deprecated since Moodle 3.6 | ||||
|      * @deprecatedonmoodle since 3.6 | ||||
|      */ | ||||
|     async getContacts(siteId?: string): Promise<AddonMessagesGetContactsWSResponse> { | ||||
|         const site = await CoreSites.getSite(siteId); | ||||
| @ -2120,7 +2120,7 @@ export class AddonMessagesProvider { | ||||
|      * | ||||
|      * @param userIdFrom User Id for the sender. | ||||
|      * @returns Promise resolved with boolean marking success or not. | ||||
|      * @deprecated since Moodle 3.6 | ||||
|      * @deprecatedonmoodle since 3.6 | ||||
|      */ | ||||
|     async markAllMessagesRead(userIdFrom?: number): Promise<boolean> { | ||||
|         const params: AddonMessagesMarkAllMessagesAsReadWSParams = { | ||||
| @ -3049,12 +3049,14 @@ export type AddonMessagesMessagePreferencesNotificationProcessor = { | ||||
|     lockedmessage?: string; // @since 3.6. Text to display if locked.
 | ||||
|     userconfigured: number; // Is configured?.
 | ||||
|     enabled?: boolean; // @since 4.0. Processor enabled.
 | ||||
|     loggedin: AddonNotificationsPreferencesNotificationProcessorState; // @deprecated removed on 4.0.
 | ||||
|     loggedoff: AddonNotificationsPreferencesNotificationProcessorState; // @deprecated removed on 4.0.
 | ||||
|     loggedin: AddonNotificationsPreferencesNotificationProcessorState; // @deprecatedonmoodle since 4.0.
 | ||||
|     loggedoff: AddonNotificationsPreferencesNotificationProcessorState; // @deprecatedonmoodle since 4.0.
 | ||||
| }; | ||||
| 
 | ||||
| /** | ||||
|  * Message discussion (before 3.6). | ||||
|  * | ||||
|  * @deprecatedonmoodle since 3.6. | ||||
|  */ | ||||
| export type AddonMessagesDiscussion = { | ||||
|     fullname: string; // Full name of the other user in the discussion.
 | ||||
|  | ||||
| @ -332,7 +332,7 @@ export class AddonNotificationsSettingsPage implements OnInit, OnDestroy { | ||||
|     } | ||||
| 
 | ||||
|     /** | ||||
|      * Page destroyed. | ||||
|      * @inheritdoc | ||||
|      */ | ||||
|     ngOnDestroy(): void { | ||||
|         // If there is a pending action to update preferences, execute it right now.
 | ||||
| @ -347,7 +347,7 @@ export class AddonNotificationsSettingsPage implements OnInit, OnDestroy { | ||||
| /** | ||||
|  * State in notification processor in notification preferences component with some calculated data. | ||||
|  * | ||||
|  * @deprecated 4.0 | ||||
|  * @deprecatedonmoodle since 4.0 | ||||
|  */ | ||||
| type ProcessorStateFormatted = AddonNotificationsPreferencesNotificationProcessorState & { | ||||
|     updating?: boolean; // Calculated in the app. Whether the state is being updated.
 | ||||
|  | ||||
| @ -496,14 +496,14 @@ export type AddonNotificationsPreferencesNotificationProcessor = { | ||||
|     lockedmessage?: string; // @since 3.6. Text to display if locked.
 | ||||
|     userconfigured: number; // Is configured?.
 | ||||
|     enabled?: boolean; // @since 4.0. Processor enabled.
 | ||||
|     loggedin: AddonNotificationsPreferencesNotificationProcessorState; // @deprecated removed on 4.0.
 | ||||
|     loggedoff: AddonNotificationsPreferencesNotificationProcessorState; // @deprecated removed on 4.0.
 | ||||
|     loggedin: AddonNotificationsPreferencesNotificationProcessorState; // @deprecatedonmoodle since 4.0.
 | ||||
|     loggedoff: AddonNotificationsPreferencesNotificationProcessorState; // @deprecatedonmoodle since 4.0.
 | ||||
| }; | ||||
| 
 | ||||
| /** | ||||
|  * State in notification processor in notification preferences component. | ||||
|  * | ||||
|  * @deprecated removed on 4.0. | ||||
|  * @deprecatedonmoodle since 4.0 | ||||
|  */ | ||||
| export type AddonNotificationsPreferencesNotificationProcessorState = { | ||||
|     name: 'loggedoff' | 'loggedin'; // Name.
 | ||||
|  | ||||
| @ -14,6 +14,11 @@ | ||||
| 
 | ||||
| import { ElementController } from './ElementController'; | ||||
| 
 | ||||
| /** | ||||
|  * Possible types of frame elements. | ||||
|  * | ||||
|  * @todo Remove frame TAG support. | ||||
|  */ | ||||
| export type FrameElement = HTMLIFrameElement | HTMLFrameElement | HTMLObjectElement | HTMLEmbedElement; | ||||
| 
 | ||||
| /** | ||||
|  | ||||
| @ -19,7 +19,10 @@ import { CoreSiteError, CoreSiteErrorOptions } from '@classes/errors/siteerror'; | ||||
|  */ | ||||
| export class CoreAjaxError extends CoreSiteError { | ||||
| 
 | ||||
|     available = 1; // @deprecated since app 4.0. AJAX endpoint should always be available in supported Moodle versions.
 | ||||
|     /** | ||||
|      * @deprecated since 4.0. AJAX endpoint should always be available in supported Moodle versions. | ||||
|      */ | ||||
|     available = 1; | ||||
|     status?: number; | ||||
| 
 | ||||
|     constructor(messageOrOptions: string | CoreSiteErrorOptions, available?: number, status?: number) { | ||||
|  | ||||
| @ -57,7 +57,7 @@ export class CorePromisedValue<T = unknown> extends CorePromise<T> { | ||||
| 
 | ||||
|     /** | ||||
|      * @returns Promise. | ||||
|      * @deprecated since app 4.1. The instance can be directly used as a promise. | ||||
|      * @deprecated since 4.1. The instance can be directly used as a promise. | ||||
|      */ | ||||
|     get promise(): Promise<T> { | ||||
|         return this; | ||||
|  | ||||
| @ -1607,8 +1607,9 @@ export class CoreSite { | ||||
|      * Check if the local_mobile plugin is installed in the Moodle site. | ||||
|      * | ||||
|      * @returns Promise resolved when the check is done. | ||||
|      * @deprecated since app 4.0 | ||||
|      * @deprecated since 4.0. | ||||
|      */ | ||||
|     // eslint-disable-next-line deprecation/deprecation
 | ||||
|     async checkLocalMobilePlugin(): Promise<LocalMobileResponse> { | ||||
|         // Not used anymore.
 | ||||
|         return { code: 0, coreSupported: true }; | ||||
| @ -1618,7 +1619,7 @@ export class CoreSite { | ||||
|      * Check if local_mobile has been installed in Moodle. | ||||
|      * | ||||
|      * @returns Whether the App is able to use local_mobile plugin for this site. | ||||
|      * @deprecated since app 4.0 | ||||
|      * @deprecated since 4.0. | ||||
|      */ | ||||
|     checkIfAppUsesLocalMobile(): boolean { | ||||
|         return false; | ||||
| @ -1628,7 +1629,7 @@ export class CoreSite { | ||||
|      * Check if local_mobile has been installed in Moodle but the app is not using it. | ||||
|      * | ||||
|      * @returns Promise resolved it local_mobile was added, rejected otherwise. | ||||
|      * @deprecated since app 4.0 | ||||
|      * @deprecated since 4.0. | ||||
|      */ | ||||
|     async checkIfLocalMobileInstalledAndNotUsed(): Promise<void> { | ||||
|         throw new CoreError('Deprecated.'); | ||||
| @ -2125,7 +2126,7 @@ export class CoreSite { | ||||
|                 CoreConstants.SECONDS_MINUTE * 6, | ||||
|             ); | ||||
| 
 | ||||
|             if (CoreTimeUtils.timestamp() - this.lastAutoLogin < timeBetweenRequests) { | ||||
|             if (CoreTimeUtils.timestamp() - this.lastAutoLogin < Number(timeBetweenRequests)) { | ||||
|                 // Not enough time has passed since last auto login.
 | ||||
|                 return url; | ||||
|             } | ||||
| @ -2626,7 +2627,7 @@ export type CoreSiteWSPreSets = { | ||||
| /** | ||||
|  * Response of checking local_mobile status. | ||||
|  * | ||||
|  * @deprecated since app 4.0 | ||||
|  * @deprecated since 4.0. | ||||
|  */ | ||||
| export type LocalMobileResponse = { | ||||
|     /** | ||||
|  | ||||
| @ -59,9 +59,9 @@ export class CoreContextMenuItemComponent implements OnInit, OnDestroy, OnChange | ||||
|     @Output() toggleChange = new EventEmitter<boolean>();// Will emit an event when toggle changes to enable 2-way data binding.
 | ||||
| 
 | ||||
|     /** | ||||
|      * @deprecated since 4.0. | ||||
|      * @deprecated since 4.0. Not used anymore. | ||||
|      */ | ||||
|     @Input() iconDescription?: string; // Name of the icon to be shown on the left side of the item. Not used anymore.
 | ||||
|     @Input() iconDescription?: string; | ||||
| 
 | ||||
|     protected hasAction = false; | ||||
|     protected destroyed = false; | ||||
| @ -93,6 +93,7 @@ export class CoreContextMenuItemComponent implements OnInit, OnDestroy, OnChange | ||||
|             this.ctxtMenu.addItem(this); | ||||
|         } | ||||
| 
 | ||||
|         // eslint-disable-next-line deprecation/deprecation
 | ||||
|         if (this.iconDescription !== undefined) { | ||||
|             CoreLogger.getInstance('CoreContextMenuItemComponent') | ||||
|                 .warn('iconDescription Input is deprecated and should not be used'); | ||||
|  | ||||
| @ -36,7 +36,7 @@ export class CoreDownloadRefreshComponent { | ||||
|     @Input() enabled = false; // Whether the download is enabled.
 | ||||
|     @Input() loading = true; // Force loading status when is not downloading.
 | ||||
|     /** | ||||
|      * @deprecated since 4.0. It has no effect. | ||||
|      * @deprecated since 4.0. Not used anymore. | ||||
|      */ | ||||
|     @Input() size = ''; // Size of the buttons.
 | ||||
|     @Input() canTrustDownload = false; // If false, refresh will be shown if downloaded.
 | ||||
|  | ||||
| @ -36,7 +36,7 @@ export class CoreEmptyBoxComponent { | ||||
|     @Input() flipIconRtl = false; // Whether to flip the icon in RTL. Defaults to false.
 | ||||
| 
 | ||||
|     /** | ||||
|      * @deprecated not used anymore. | ||||
|      * @deprecated since 4.0. Not used anymore. | ||||
|      */ | ||||
|     @Input() inline = false; | ||||
| 
 | ||||
|  | ||||
| @ -155,6 +155,7 @@ export class CoreLoadingComponent implements OnInit, OnChanges, AfterViewInit, A | ||||
|         } | ||||
| 
 | ||||
|         // Event has been deprecated since app 4.0.
 | ||||
|         // eslint-disable-next-line deprecation/deprecation
 | ||||
|         CoreEvents.trigger(CoreEvents.CORE_LOADING_CHANGED, <CoreEventLoadingChangedData> { | ||||
|             loaded, | ||||
|             uniqueId: this.uniqueId, | ||||
|  | ||||
| @ -44,7 +44,7 @@ export class CoreModIconComponent implements OnInit, OnChanges { | ||||
|     isLocalUrl = true; | ||||
|     linkIconWithComponent = false; | ||||
| 
 | ||||
|     protected legacyIcon = true; // @deprecatedonmoodle since Moodle 3.11.
 | ||||
|     protected legacyIcon = true; // @deprecatedonmoodle since 3.11.
 | ||||
| 
 | ||||
|     constructor(protected el: ElementRef) { } | ||||
| 
 | ||||
| @ -122,7 +122,7 @@ export class CoreModIconComponent implements OnInit, OnChanges { | ||||
| 
 | ||||
|         let path = assetsPath + 'mod/'; | ||||
|         if (this.legacyIcon) { | ||||
|             // @deprecatedonmoodle since Moodle 3.11.
 | ||||
|             // @deprecatedonmoodle since 3.11.
 | ||||
|             path = assetsPath + 'mod_legacy/'; | ||||
|         } | ||||
| 
 | ||||
|  | ||||
| @ -78,7 +78,10 @@ export class CoreConstants { | ||||
|     // WS constants.
 | ||||
|     static readonly WS_TIMEOUT = 30000; // Timeout when not in WiFi.
 | ||||
|     static readonly WS_TIMEOUT_WIFI = 30000; // Timeout when in WiFi.
 | ||||
|     static readonly WS_PREFIX = 'local_mobile_'; // @deprecated since app 4.0.
 | ||||
|     /** | ||||
|      * @deprecated since 4.0. Not used anymore. | ||||
|      */ | ||||
|     static readonly WS_PREFIX = 'local_mobile_'; | ||||
| 
 | ||||
|     // Login constants.
 | ||||
|     /** | ||||
|  | ||||
| @ -52,7 +52,7 @@ import { CoreRefreshContext, CORE_REFRESH_CONTEXT } from '@/core/utils/refresh-c | ||||
| import { CorePlatform } from '@services/platform'; | ||||
| import { ElementController } from '@classes/element-controllers/ElementController'; | ||||
| import { MediaElementController } from '@classes/element-controllers/MediaElementController'; | ||||
| import { FrameElementController } from '@classes/element-controllers/FrameElementController'; | ||||
| import { FrameElement, FrameElementController } from '@classes/element-controllers/FrameElementController'; | ||||
| import { CoreUrl } from '@singletons/url'; | ||||
| import { CoreIcons } from '@singletons/icons'; | ||||
| 
 | ||||
| @ -90,12 +90,20 @@ export class CoreFormatTextDirective implements OnChanges, OnDestroy, AsyncDirec | ||||
|     @Input() hideIfEmpty = false; // If true, the tag will contain nothing if text is empty.
 | ||||
|     @Input() disabled?: boolean; // If disabled, autoplay elements will be disabled.
 | ||||
| 
 | ||||
|     @Input() fullOnClick?: boolean | string; // @deprecated on 4.0 Won't do anything.
 | ||||
|     @Input() fullTitle?: string; // @deprecated on 4.0 Won't do anything.
 | ||||
|     /** | ||||
|      * @deprecated since 4.0. Not used anymore. | ||||
|      */ | ||||
|     @Input() fullOnClick?: boolean | string; | ||||
|     /** | ||||
|      * @deprecated since 4.0. Not used anymore. | ||||
|      */ | ||||
|     @Input() fullTitle?: string; | ||||
|     /** | ||||
|      * Max height in pixels to render the content box. It should be 50 at least to make sense. | ||||
|      * | ||||
|      * @deprecated since 4.0 Use collapsible-item directive instead. | ||||
|      */ | ||||
|     @Input() maxHeight?: number; // @deprecated on 4.0 Use collapsible-item directive instead.
 | ||||
|     @Input() maxHeight?: number; | ||||
| 
 | ||||
|     @Output() afterRender: EventEmitter<void>; // Called when the data is rendered.
 | ||||
|     @Output() onClick: EventEmitter<void> = new EventEmitter(); // Called when clicked.
 | ||||
| @ -373,8 +381,10 @@ export class CoreFormatTextDirective implements OnChanges, OnDestroy, AsyncDirec | ||||
|         await CoreUtils.nextTick(); | ||||
| 
 | ||||
|         // Use collapsible-item directive instead.
 | ||||
|         // eslint-disable-next-line deprecation/deprecation
 | ||||
|         if (this.maxHeight && !this.collapsible) { | ||||
|             this.collapsible = new CoreCollapsibleItemDirective(new ElementRef(this.element)); | ||||
|             // eslint-disable-next-line deprecation/deprecation
 | ||||
|             this.collapsible.height = this.maxHeight; | ||||
|             this.collapsible.ngOnInit(); | ||||
|         } | ||||
| @ -574,7 +584,7 @@ export class CoreFormatTextDirective implements OnChanges, OnDestroy, AsyncDirec | ||||
|         }); | ||||
| 
 | ||||
|         // Handle all kind of frames.
 | ||||
|         const frameControllers = frames.map((frame: HTMLFrameElement | HTMLObjectElement | HTMLEmbedElement) => { | ||||
|         const frameControllers = frames.map((frame: FrameElement) => { | ||||
|             CoreIframeUtils.treatFrame(frame, false); | ||||
| 
 | ||||
|             return new FrameElementController(frame, !this.disabled); | ||||
|  | ||||
| @ -353,10 +353,11 @@ export class CoreCompileProvider { | ||||
|         instance['CoreLoggerProvider'] = CoreLogger; | ||||
|         instance['moment'] = moment; | ||||
|         instance['Md5'] = Md5; | ||||
|         instance['Network'] = CoreNetwork.instance; // @deprecated on 4.1, plugins should use CoreNetwork instead.
 | ||||
|         instance['Platform'] = CorePlatform.instance; // @deprecated on 4.1, plugins should use CorePlatform instead.
 | ||||
|         instance['Network'] = CoreNetwork.instance; // @deprecated since 4.1, plugins should use CoreNetwork instead.
 | ||||
|         instance['Platform'] = CorePlatform.instance; // @deprecated since 4.1, plugins should use CorePlatform instead.
 | ||||
|         instance['CoreSyncBaseProvider'] = CoreSyncBaseProvider; | ||||
|         instance['CoreArray'] = CoreArray; | ||||
|         // eslint-disable-next-line deprecation/deprecation
 | ||||
|         instance['CoreComponentsRegistry'] = CoreComponentsRegistry; | ||||
|         instance['CoreDirectivesRegistry'] = CoreDirectivesRegistry; | ||||
|         instance['CoreNetwork'] = CoreNetwork.instance; | ||||
|  | ||||
| @ -59,7 +59,7 @@ export class CoreContentLinksModuleIndexHandler extends CoreContentLinksHandlerB | ||||
|      * @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. | ||||
|      * @returns List of params to pass to navigateToModule / navigateToModuleByInstance. | ||||
|      * @deprecated since 4.0 | ||||
|      * @deprecated since 4.0. Not used anymore. | ||||
|      */ | ||||
|     // eslint-disable-next-line @typescript-eslint/no-unused-vars
 | ||||
|     getPageParams(url: string, params: Record<string, string>, courseId?: number): Params { | ||||
| @ -101,6 +101,7 @@ export class CoreContentLinksModuleIndexHandler extends CoreContentLinksHandlerB | ||||
|             let modNavOptions = this.getModNavOptions(url, params, siteId, courseId); | ||||
|             if (!modNavOptions) { | ||||
|                 // Use the old function, currently deprecated.
 | ||||
|                 // eslint-disable-next-line deprecation/deprecation
 | ||||
|                 const pageParams = this.getPageParams(url, params, courseId); | ||||
|                 if (pageParams && Object.keys(pageParams).length > 0) { | ||||
|                     modNavOptions = { params: pageParams }; | ||||
|  | ||||
| @ -38,8 +38,10 @@ import { CoreCourseModuleCompletionDetailsComponent } from './module-completion- | ||||
|         CoreCourseModuleComponent, | ||||
|         CoreCourseModuleCompletionComponent, | ||||
|         CoreCourseModuleCompletionLegacyComponent, | ||||
|         // eslint-disable-next-line deprecation/deprecation
 | ||||
|         CoreCourseModuleDescriptionComponent, | ||||
|         CoreCourseModuleInfoComponent, | ||||
|         // eslint-disable-next-line deprecation/deprecation
 | ||||
|         CoreCourseModuleManualCompletionComponent, | ||||
|         CoreCourseCourseIndexComponent, | ||||
|         CoreCourseCourseIndexTourComponent, | ||||
| @ -59,8 +61,10 @@ import { CoreCourseModuleCompletionDetailsComponent } from './module-completion- | ||||
|         CoreCourseModuleComponent, | ||||
|         CoreCourseModuleCompletionComponent, | ||||
|         CoreCourseModuleCompletionLegacyComponent, | ||||
|         // eslint-disable-next-line deprecation/deprecation
 | ||||
|         CoreCourseModuleDescriptionComponent, | ||||
|         CoreCourseModuleInfoComponent, | ||||
|         // eslint-disable-next-line deprecation/deprecation
 | ||||
|         CoreCourseModuleManualCompletionComponent, | ||||
|         CoreCourseCourseIndexComponent, | ||||
|         CoreCourseCourseIndexTourComponent, | ||||
|  | ||||
| @ -199,6 +199,7 @@ export class CoreCourseModuleComponent implements OnInit, OnDestroy { | ||||
|      * @param event Click event. | ||||
|      */ | ||||
|     buttonClicked(event: Event): void { | ||||
|         // eslint-disable-next-line deprecation/deprecation
 | ||||
|         const button = this.module.handlerData?.button ?? this.module.handlerData?.buttons?.[0]; | ||||
|         if (!button || !button.action) { | ||||
|             return; | ||||
|  | ||||
| @ -41,7 +41,7 @@ import { CoreTime } from '@singletons/time'; | ||||
| import { CoreAnalytics, CoreAnalyticsEventType } from '@services/analytics'; | ||||
| import { CoreEnrolHelper } from '@features/enrol/services/enrol-helper'; | ||||
| import { CoreEnrolDelegate } from '@features/enrol/services/enrol-delegate'; | ||||
| import { CoreEnrolEnrolmentMethod } from '@features/enrol/services/enrol'; | ||||
| import { CoreEnrol, CoreEnrolEnrolmentMethod } from '@features/enrol/services/enrol'; | ||||
| 
 | ||||
| /** | ||||
|  * Page that shows the summary of a course including buttons to enrol and other available options. | ||||
| @ -407,8 +407,7 @@ export class CoreCourseSummaryPage implements OnInit, OnDestroy { | ||||
|         promises.push(CoreCourses.invalidateCourse(this.courseId)); | ||||
|         promises.push(CoreCourseOptionsDelegate.clearAndInvalidateCoursesOptions(this.courseId)); | ||||
|         promises.push(CoreCourses.invalidateCoursesByField('id', this.courseId)); | ||||
| 
 | ||||
|         promises.push(CoreCourses.invalidateCourseEnrolmentMethods(this.courseId)); | ||||
|         promises.push(CoreEnrol.invalidateCourseEnrolmentMethods(this.courseId)); | ||||
| 
 | ||||
|         this.selfEnrolInstances.forEach((method) => { | ||||
|             promises.push(CoreEnrolDelegate.invalidate(method)); | ||||
|  | ||||
| @ -261,8 +261,8 @@ export class CoreCourseHelperProvider { | ||||
|     /** | ||||
|      * Calculate completion data of a module. | ||||
|      * | ||||
|      * @deprecated since 4.0. | ||||
|      * @param module Module. | ||||
|      * @deprecated since 4.0. | ||||
|      */ | ||||
|     calculateModuleCompletionData(module: CoreCourseModuleData): void { | ||||
|         if (!module.completiondata || !module.completion) { | ||||
| @ -312,6 +312,7 @@ export class CoreCourseHelperProvider { | ||||
|         } | ||||
| 
 | ||||
|         sectionWithStatus.downloadStatus = result.status; | ||||
|         // eslint-disable-next-line deprecation/deprecation
 | ||||
|         sectionWithStatus.canCheckUpdates = true; | ||||
| 
 | ||||
|         // Set this section data.
 | ||||
| @ -374,6 +375,7 @@ export class CoreCourseHelperProvider { | ||||
|             if (allSectionsSection) { | ||||
|                 // Set "All sections" data.
 | ||||
|                 allSectionsSection.downloadStatus = allSectionsStatus; | ||||
|                 // eslint-disable-next-line deprecation/deprecation
 | ||||
|                 allSectionsSection.canCheckUpdates = true; | ||||
|                 allSectionsSection.isDownloading = allSectionsStatus === CoreConstants.DOWNLOADING; | ||||
|             } | ||||
| @ -518,7 +520,7 @@ export class CoreCourseHelperProvider { | ||||
|      * @param module Module to remove the files. | ||||
|      * @param courseId Course ID the module belongs to. | ||||
|      * @returns Promise resolved when done. | ||||
|      * @deprecated since 4.0 | ||||
|      * @deprecated since 4.0. | ||||
|      */ | ||||
|     async confirmAndRemoveFiles(module: CoreCourseModuleData, courseId: number): Promise<void> { | ||||
|         let modal: CoreIonLoadingElement | undefined; | ||||
| @ -646,6 +648,7 @@ export class CoreCourseHelperProvider { | ||||
|                 } | ||||
|             }); | ||||
| 
 | ||||
|             // eslint-disable-next-line deprecation/deprecation
 | ||||
|             accessData.passwordRequired = accessData.requiresUserInput; // For backwards compatibility.
 | ||||
| 
 | ||||
|             return accessData; | ||||
| @ -1358,11 +1361,11 @@ export class CoreCourseHelperProvider { | ||||
|     /** | ||||
|      * Get the course ID from a module instance ID, showing an error message if it can't be retrieved. | ||||
|      * | ||||
|      * @deprecated since 4.0. | ||||
|      * @param instanceId Instance ID. | ||||
|      * @param moduleName Name of the module. E.g. 'glossary'. | ||||
|      * @param siteId Site ID. If not defined, current site. | ||||
|      * @returns Promise resolved with the module's course ID. | ||||
|      * @deprecated since 4.0. | ||||
|      */ | ||||
|     async getModuleCourseIdByInstance(instanceId: number, moduleName: string, siteId?: string): Promise<number> { | ||||
|         try { | ||||
| @ -1802,6 +1805,7 @@ export class CoreCourseHelperProvider { | ||||
| 
 | ||||
|             // Set "All sections" data.
 | ||||
|             section.downloadStatus = allSectionsStatus; | ||||
|             // eslint-disable-next-line deprecation/deprecation
 | ||||
|             section.canCheckUpdates = true; | ||||
|             section.isDownloading = allSectionsStatus === CoreConstants.DOWNLOADING; | ||||
|         } finally { | ||||
| @ -2116,7 +2120,10 @@ export type CoreCourseSection = CoreCourseWSSection & { | ||||
|  */ | ||||
| export type CoreCourseSectionWithStatus = CoreCourseSection & { | ||||
|     downloadStatus?: string; // Section status.
 | ||||
|     canCheckUpdates?: boolean; // Whether can check updates. @deprecated since app 4.0
 | ||||
|     /** | ||||
|      * @deprecated since 4.0. | ||||
|      */ | ||||
|     canCheckUpdates?: boolean; // Whether can check updates.
 | ||||
|     isDownloading?: boolean; // Whether section is being downloaded.
 | ||||
|     total?: number; // Total of modules being downloaded.
 | ||||
|     count?: number; // Number of downloaded modules.
 | ||||
|  | ||||
| @ -855,7 +855,7 @@ export class CoreCourseProvider { | ||||
| 
 | ||||
|         let path = 'assets/img/mod/'; | ||||
|         if (!CoreSites.getCurrentSite()?.isVersionGreaterEqualThan('4.0')) { | ||||
|             // @deprecatedonmoodle since Moodle 3.11.
 | ||||
|             // @deprecatedonmoodle since 3.11.
 | ||||
|             path = 'assets/img/mod_legacy/'; | ||||
|         } | ||||
| 
 | ||||
| @ -866,10 +866,10 @@ export class CoreCourseProvider { | ||||
|     /** | ||||
|      * Get the section ID a module belongs to. | ||||
|      * | ||||
|      * @deprecated since 4.0. | ||||
|      * @param moduleId The module ID. | ||||
|      * @param siteId Site ID. If not defined, current site. | ||||
|      * @returns Promise resolved with the section ID. | ||||
|      * @deprecated since 4.0. | ||||
|      */ | ||||
|     async getModuleSectionId(moduleId: number, siteId?: string): Promise<number> { | ||||
|         // Try to get the section using getModuleBasicInfo.
 | ||||
|  | ||||
| @ -60,18 +60,18 @@ export interface CoreCourseFormatHandler extends CoreDelegateHandler { | ||||
|     /** | ||||
|      * Whether the option to enable section/module download should be displayed. | ||||
|      * | ||||
|      * @deprecated on 4.0 Not used anymore because prefetch has been moved to storage manager. | ||||
|      * @param course The course to check. | ||||
|      * @returns Whether the option to enable section/module download should be displayed. | ||||
|      * @deprecated since 4.0 Not used anymore because prefetch has been moved to storage manager. | ||||
|      */ | ||||
|     displayEnableDownload?(course: CoreCourseAnyCourseData): boolean; | ||||
| 
 | ||||
|     /** | ||||
|      * Whether the default course index should be displayed. Defaults to true. | ||||
|      * | ||||
|      * @deprecated on 4.0. Please use displayCourseIndex instead. | ||||
|      * @param course The course to check. | ||||
|      * @returns Whether the default course index should be displayed. | ||||
|      * @deprecated since 4.0. Please use displayCourseIndex instead. | ||||
|      */ | ||||
|     displaySectionSelector?(course: CoreCourseAnyCourseData): boolean; | ||||
| 
 | ||||
|  | ||||
| @ -60,7 +60,7 @@ export class CoreCourseModuleDefaultHandler implements CoreCourseModuleHandler { | ||||
|         if ('url' in module && module.url) { | ||||
|             const url = module.url; | ||||
| 
 | ||||
|             defaultData.buttons = [{ | ||||
|             defaultData.button = { | ||||
|                 icon: 'fas-up-right-from-square', | ||||
|                 label: 'core.openinbrowser', | ||||
|                 action: (e: Event): void => { | ||||
| @ -69,7 +69,7 @@ export class CoreCourseModuleDefaultHandler implements CoreCourseModuleHandler { | ||||
| 
 | ||||
|                     CoreSites.getRequiredCurrentSite().openInBrowserWithAutoLogin(url); | ||||
|                 }, | ||||
|             }]; | ||||
|             }; | ||||
|         } | ||||
| 
 | ||||
|         return defaultData; | ||||
|  | ||||
| @ -81,7 +81,7 @@ export class CoreCourseModulePrefetchDelegateService extends CoreDelegate<CoreCo | ||||
|      * Check if current site can check updates using core_course_check_updates. | ||||
|      * | ||||
|      * @returns True if can check updates, false otherwise. | ||||
|      * @deprecated since app 4.0 | ||||
|      * @deprecated since 4.0. | ||||
|      */ | ||||
|     canCheckUpdates(): boolean { | ||||
|         return true; | ||||
| @ -704,6 +704,8 @@ export class CoreCourseModulePrefetchDelegateService extends CoreDelegate<CoreCo | ||||
| 
 | ||||
|         await Promise.all(modules.map(async (module) => { | ||||
|             const handler = this.getPrefetchHandlerFor(module.modname); | ||||
| 
 | ||||
|             // eslint-disable-next-line deprecation/deprecation
 | ||||
|             if (!handler || (onlyToDisplay && handler.skipListStatus)) { | ||||
|                 return; | ||||
|             } | ||||
| @ -1366,7 +1368,7 @@ export interface CoreCourseModulePrefetchHandler extends CoreDelegateHandler { | ||||
|      * If true, this module will be treated as not downloadable when determining the status of a list of modules. The module will | ||||
|      * still be downloaded when downloading the section/course, it only affects whether the button should be displayed. | ||||
|      * | ||||
|      * @deprecated since app 4.0. | ||||
|      * @deprecated since 4.0. | ||||
|      */ | ||||
|     skipListStatus?: boolean; | ||||
| 
 | ||||
|  | ||||
| @ -22,6 +22,7 @@ import { CoreCoursesCourseOptionsMenuComponent } from './course-options-menu/cou | ||||
| @NgModule({ | ||||
|     declarations: [ | ||||
|         CoreCoursesCourseListItemComponent, | ||||
|         // eslint-disable-next-line deprecation/deprecation
 | ||||
|         CoreCoursesCourseProgressComponent, | ||||
|         CoreCoursesCourseOptionsMenuComponent, | ||||
|     ], | ||||
| @ -30,6 +31,7 @@ import { CoreCoursesCourseOptionsMenuComponent } from './course-options-menu/cou | ||||
|     ], | ||||
|     exports: [ | ||||
|         CoreCoursesCourseListItemComponent, | ||||
|         // eslint-disable-next-line deprecation/deprecation
 | ||||
|         CoreCoursesCourseProgressComponent, | ||||
|         CoreCoursesCourseOptionsMenuComponent, | ||||
|     ], | ||||
|  | ||||
| @ -36,7 +36,7 @@ import { CoreUser } from '@features/user/services/user'; | ||||
|  * <core-courses-course-progress [course]="course"> | ||||
|  * </core-courses-course-progress> | ||||
|  * | ||||
|  * @deprecated since 4.0 Use core-courses-course-list-item instead. | ||||
|  * @deprecated since 4.0. Use core-courses-course-list-item instead. | ||||
|  */ | ||||
| @Component({ | ||||
|     selector: 'core-courses-course-progress', | ||||
|  | ||||
| @ -211,14 +211,14 @@ export class CoreCoursesHelperProvider { | ||||
|         } | ||||
| 
 | ||||
|         if (course.courseimage !== undefined) { | ||||
|             course.courseImage = course.courseimage; // @deprecated sinde 4.3 use courseimage instead.
 | ||||
|             course.courseImage = course.courseimage; // @deprecated since 4.3 use courseimage instead.
 | ||||
| 
 | ||||
|             return; | ||||
|         } | ||||
| 
 | ||||
|         if (course.overviewfiles && course.overviewfiles[0]) { | ||||
|             course.courseimage = course.overviewfiles[0].fileurl; | ||||
|             course.courseImage = course.courseimage; // @deprecated sinde 4.3 use courseimage instead.
 | ||||
|             course.courseImage = course.courseimage; // @deprecated since 4.3 use courseimage instead.
 | ||||
| 
 | ||||
|             return; | ||||
|         } | ||||
|  | ||||
| @ -74,7 +74,7 @@ export class CoreCoursesProvider { | ||||
|      * Whether current site supports getting course options. | ||||
|      * | ||||
|      * @returns Whether current site supports getting course options. | ||||
|      * @deprecated since app 4.0 | ||||
|      * @deprecated since 4.0. | ||||
|      */ | ||||
|     canGetAdminAndNavOptions(): boolean { | ||||
|         return true; | ||||
| @ -606,7 +606,7 @@ export class CoreCoursesProvider { | ||||
|      * Check if get courses by field WS is available in a certain site. | ||||
|      * | ||||
|      * @returns Whether get courses by field is available. | ||||
|      * @deprecated since app 4.0 | ||||
|      * @deprecated since 4.0. | ||||
|      */ | ||||
|     isGetCoursesByFieldAvailable(): boolean { | ||||
|         return true; | ||||
| @ -616,7 +616,7 @@ export class CoreCoursesProvider { | ||||
|      * Check if get courses by field WS is available in a certain site, by site ID. | ||||
|      * | ||||
|      * @returns Promise resolved with boolean: whether get courses by field is available. | ||||
|      * @deprecated since app 4.0 | ||||
|      * @deprecated since 4.0. | ||||
|      */ | ||||
|     async isGetCoursesByFieldAvailableInSite(): Promise<boolean> { | ||||
|         return true; | ||||
| @ -1041,7 +1041,7 @@ export class CoreCoursesProvider { | ||||
|      * @param courseId Course ID. | ||||
|      * @param siteId Site Id. If not defined, use current site. | ||||
|      * @returns Promise resolved when the data is invalidated. | ||||
|      * @deprecated since 4.3, use CoreEnrol.invalidateCourseEnrolmentMethods instead. | ||||
|      * @deprecated since 4.3 use CoreEnrol.invalidateCourseEnrolmentMethods instead. | ||||
|      */ | ||||
|     async invalidateCourseEnrolmentMethods(courseId: number, siteId?: string): Promise<void> { | ||||
|         return CoreEnrol.invalidateCourseEnrolmentMethods(courseId, siteId); | ||||
| @ -1053,7 +1053,7 @@ export class CoreCoursesProvider { | ||||
|      * @param instanceId Guest instance ID. | ||||
|      * @param siteId Site Id. If not defined, use current site. | ||||
|      * @returns Promise resolved when the data is invalidated. | ||||
|      * @deprecated since 4.3, use CoreEnrolDelegate.invalidate instead. | ||||
|      * @deprecated since 4.3 use CoreEnrolDelegate.invalidate instead. | ||||
|      */ | ||||
|     async invalidateCourseGuestEnrolmentInfo(instanceId: number, siteId?: string): Promise<void> { | ||||
|         return AddonEnrolGuest.invalidateGuestEnrolmentInfo(instanceId, siteId); | ||||
| @ -1249,7 +1249,7 @@ export class CoreCoursesProvider { | ||||
|      * @param siteId Site ID. If not defined, use current site. | ||||
|      * @returns Promise resolved if the user is enrolled. If the password is invalid, the promise is rejected | ||||
|      *         with an object with errorcode = CoreCoursesProvider.ENROL_INVALID_KEY. | ||||
|      * @deprecated since 4.3, use CoreEnrolDelegate.enrol instead. | ||||
|      * @deprecated since 4.3 use CoreEnrolDelegate.enrol instead. | ||||
|      */ | ||||
|     async selfEnrol(courseId: number, password: string = '', instanceId?: number, siteId?: string): Promise<boolean> { | ||||
|         return AddonEnrolSelf.selfEnrol(courseId, password, instanceId, siteId); | ||||
| @ -1462,7 +1462,7 @@ export type CoreCourseGetCoursesData = CoreEnrolledCourseBasicData & { | ||||
|     /** | ||||
|      * Number of weeks/topics. | ||||
|      * | ||||
|      * @deprecated use courseformatoptions. | ||||
|      * @deprecated use courseformatoptions. This attribute is deprecated in moodle since 2.4 but still present. | ||||
|      */ | ||||
|     numsections?: number; | ||||
|     maxbytes?: number; // Largest size of file that can be uploaded into the course.
 | ||||
| @ -1470,7 +1470,7 @@ export type CoreCourseGetCoursesData = CoreEnrolledCourseBasicData & { | ||||
|     /** | ||||
|      * How the hidden sections in the course are displayed to students. | ||||
|      * | ||||
|      * @deprecated use courseformatoptions. | ||||
|      * @deprecated use courseformatoptions. This attribute is deprecated in moodle since 2.4 but still present. | ||||
|      */ | ||||
|     hiddensections?: number; | ||||
|     groupmode?: number; // No group, separate, visible.
 | ||||
| @ -1704,14 +1704,14 @@ export type CoreCourseUserAdminOrNavOptionIndexed = { | ||||
| /** | ||||
|  * Course enrolment basic info. | ||||
|  * | ||||
|  * @deprecated since 4.3 use CoreEnrolEnrolmentInfo instead. | ||||
|  * @deprecated since 4.3. Use CoreEnrolEnrolmentInfo instead. | ||||
|  */ | ||||
| export type CoreCourseEnrolmentInfo = CoreEnrolEnrolmentInfo; | ||||
| 
 | ||||
| /** | ||||
|  * Course enrolment method. | ||||
|  * | ||||
|  * @deprecated since 4.3 use CoreEnrolEnrolmentMethod instead. | ||||
|  * @deprecated since 4.3. Use CoreEnrolEnrolmentMethod instead. | ||||
|  */ | ||||
| export type CoreCourseEnrolmentMethod = CoreEnrolEnrolmentMethod; | ||||
| 
 | ||||
|  | ||||
| @ -97,7 +97,7 @@ export class CoreEnrolService { | ||||
| 
 | ||||
|         await Promise.all([ | ||||
|             site.invalidateWsCacheForKey(this.getCourseEnrolmentMethodsCacheKey(courseId)), | ||||
|             site.invalidateWsCacheForKey(`mmCourses:enrolmentmethods:${courseId}`), // @todo: Remove after 4.3 release.
 | ||||
|             site.invalidateWsCacheForKey(`mmCourses:enrolmentmethods:${courseId}`), // @todo 4.4 Remove after 4.3 release.
 | ||||
|         ]); | ||||
|     } | ||||
| 
 | ||||
|  | ||||
| @ -64,7 +64,7 @@ export class CoreFilterProvider { | ||||
|      * Returns whether or not WS get available in context is available. | ||||
|      * | ||||
|      * @returns Promise resolved with true if ws is available, false otherwise. | ||||
|      * @deprecated since app 4.0 | ||||
|      * @deprecated since 4.0. | ||||
|      */ | ||||
|     async canGetAvailableInContext(): Promise<boolean> { | ||||
|         return true; | ||||
| @ -74,7 +74,7 @@ export class CoreFilterProvider { | ||||
|      * Returns whether or not WS get available in context is available in a certain site. | ||||
|      * | ||||
|      * @returns Promise resolved with true if ws is available, false otherwise. | ||||
|      * @deprecated since app 4.0 | ||||
|      * @deprecated since 4.0. | ||||
|      */ | ||||
|     canGetAvailableInContextInSite(): boolean { | ||||
|         return true; | ||||
|  | ||||
| @ -65,7 +65,7 @@ export class CoreGradesHelperProvider { | ||||
|      * | ||||
|      * @param tableRow JSON object representing row of grades table data. | ||||
|      * @returns Formatted row object. | ||||
|      * @deprecated since app 4.0 | ||||
|      * @deprecated since 4.0. | ||||
|      */ | ||||
|     protected async formatGradeRow(tableRow: CoreGradesTableRow): Promise<CoreGradesFormattedRow> { | ||||
|         const row: CoreGradesFormattedRow = { | ||||
| @ -362,7 +362,7 @@ export class CoreGradesHelperProvider { | ||||
|      * @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). | ||||
|      * @returns Promise to be resolved when the grades are retrieved. | ||||
|      * @deprecated since app 4.0 | ||||
|      * @deprecated since 4.0. | ||||
|      */ | ||||
|     async getGradeItem( | ||||
|         courseId: number, | ||||
| @ -377,6 +377,7 @@ export class CoreGradesHelperProvider { | ||||
|             throw new CoreError('Couldn\'t get grade item'); | ||||
|         } | ||||
| 
 | ||||
|         // eslint-disable-next-line deprecation/deprecation
 | ||||
|         return this.getGradesTableRow(grades, gradeId); | ||||
|     } | ||||
| 
 | ||||
| @ -465,7 +466,7 @@ export class CoreGradesHelperProvider { | ||||
|      * @param table JSON object representing a table with data. | ||||
|      * @param gradeId Grade Object identifier. | ||||
|      * @returns Formatted HTML table. | ||||
|      * @deprecated since app 4.0 | ||||
|      * @deprecated since 4.0. | ||||
|      */ | ||||
|     async getGradesTableRow(table: CoreGradesTable, gradeId: number): Promise<CoreGradesFormattedRow | null> { | ||||
|         if (table.tabledata) { | ||||
| @ -478,6 +479,7 @@ export class CoreGradesHelperProvider { | ||||
|             ); | ||||
| 
 | ||||
|             if (selectedRow) { | ||||
|                 // eslint-disable-next-line deprecation/deprecation
 | ||||
|                 return await this.formatGradeRow(selectedRow); | ||||
|             } | ||||
|         } | ||||
| @ -491,7 +493,7 @@ export class CoreGradesHelperProvider { | ||||
|      * @param table JSON object representing a table with data. | ||||
|      * @param moduleId Grade Object identifier. | ||||
|      * @returns Formatted HTML table. | ||||
|      * @deprecated since app 4.0 | ||||
|      * @deprecated since 4.0. | ||||
|      */ | ||||
|     async getModuleGradesTableRows(table: CoreGradesTable, moduleId: number): Promise<CoreGradesFormattedRow[]> { | ||||
|         if (!table.tabledata) { | ||||
| @ -513,6 +515,7 @@ export class CoreGradesHelperProvider { | ||||
|             } | ||||
| 
 | ||||
|             return false; | ||||
|         // eslint-disable-next-line deprecation/deprecation
 | ||||
|         }).map((row) => this.formatGradeRow(row))); | ||||
|     } | ||||
| 
 | ||||
|  | ||||
| @ -346,7 +346,7 @@ export class CoreGradesProvider { | ||||
|      * Returns whether or not WS Grade Items is available. | ||||
|      * | ||||
|      * @returns True if ws is available, false otherwise. | ||||
|      * @deprecated since app 4.0 | ||||
|      * @deprecated since 4.0. | ||||
|      */ | ||||
|     async isGradeItemsAvailable(): Promise<boolean> { | ||||
|         return true; | ||||
|  | ||||
| @ -365,7 +365,7 @@ export class CoreLoginHelperProvider { | ||||
|      * Get fixed site or sites. | ||||
|      * | ||||
|      * @returns Fixed site or list of fixed sites. | ||||
|      * @deprecated since 4.2.0. Use CoreConstants.CONFIG.sites or getAvailableSites() instead. | ||||
|      * @deprecated since 4.2. Use CoreConstants.CONFIG.sites or getAvailableSites() instead. | ||||
|      */ | ||||
|     getFixedSites(): string | CoreLoginSiteInfo[] { | ||||
|         const notStagingSites = CoreConstants.CONFIG.sites.filter(site => !site.staging); | ||||
| @ -482,7 +482,7 @@ export class CoreLoginHelperProvider { | ||||
|      * Check if the app is configured to use several fixed URLs. | ||||
|      * | ||||
|      * @returns Whether there are several fixed URLs. | ||||
|      * @deprecated 4.2.0 Use CoreConstants.CONFIG.sites.length > 1 instead. | ||||
|      * @deprecated since 4.2. Use CoreConstants.CONFIG.sites.length > 1 instead. | ||||
|      */ | ||||
|     async hasSeveralFixedSites(): Promise<boolean> { | ||||
|         const sites = await this.getAvailableSites(); | ||||
| @ -523,7 +523,7 @@ export class CoreLoginHelperProvider { | ||||
|      * Check if the app is configured to use a fixed URL (only 1). | ||||
|      * | ||||
|      * @returns Whether there is 1 fixed URL. | ||||
|      * @deprecated 4.2.0 Use isSingleFixedSite instead. | ||||
|      * @deprecated since 4.2. Use isSingleFixedSite instead. | ||||
|      */ | ||||
|     isFixedUrlSet(): boolean { | ||||
|         return CoreConstants.CONFIG.sites.filter(site => !site.staging).length === 1; | ||||
| @ -909,7 +909,7 @@ export class CoreLoginHelperProvider { | ||||
|      * | ||||
|      * @param typeOfLogin TypeOfLogin.BROWSER or TypeOfLogin.EMBEDDED. | ||||
|      * @returns True if confirm modal should be shown, false otherwise. | ||||
|      * @deprecated since 4.3 Not used anymore. See shouldSkipCredentialsScreenOnSSO. | ||||
|      * @deprecated since 4.3. Not used anymore. See shouldSkipCredentialsScreenOnSSO. | ||||
|      */ | ||||
|     shouldShowSSOConfirm(typeOfLogin: TypeOfLogin): boolean { | ||||
|         return !this.isSSOEmbeddedBrowser(typeOfLogin) && !this.shouldSkipCredentialsScreenOnSSO(); | ||||
|  | ||||
| @ -386,6 +386,7 @@ export class CorePushNotificationsProvider { | ||||
|         data.category = itemCategory; | ||||
|         data.moodleaction = wsName; | ||||
| 
 | ||||
|         // eslint-disable-next-line deprecation/deprecation
 | ||||
|         return this.logEvent('view_item', data); | ||||
|     } | ||||
| 
 | ||||
| @ -407,6 +408,7 @@ export class CorePushNotificationsProvider { | ||||
|         data.moodleaction = wsName; | ||||
|         data.category = itemCategory; | ||||
| 
 | ||||
|         // eslint-disable-next-line deprecation/deprecation
 | ||||
|         return this.logEvent('view_item_list', data); | ||||
|     } | ||||
| 
 | ||||
|  | ||||
| @ -385,7 +385,7 @@ export class CoreQuestionProvider { | ||||
|         const parsedQuestions: CoreQuestionQuestionParsed[] = questions; | ||||
| 
 | ||||
|         parsedQuestions.forEach((question) => { | ||||
|             if (typeof question.questionnumber === 'undefined' && typeof question.number === 'number') { | ||||
|             if (question.questionnumber === undefined && typeof question.number === 'number') { | ||||
|                 question.questionnumber = String(question.number); | ||||
|             } | ||||
| 
 | ||||
| @ -603,7 +603,7 @@ export type CoreQuestionQuestionWSData = { | ||||
|     maxmark?: number; // The maximum mark possible for this question attempt.
 | ||||
|     settings?: string; // Question settings (JSON encoded).
 | ||||
| 
 | ||||
|     /** @deprecated Since 4.2. Use questionnumber instead. */ | ||||
|     /** @deprecatedonmoodle since 4.2. Use questionnumber instead. */ | ||||
|     number?: number; // eslint-disable-line id-blacklist
 | ||||
| }; | ||||
| /** | ||||
|  | ||||
| @ -48,7 +48,7 @@ export class CoreRatingProvider { | ||||
|      * Returns whether the web serivce to add ratings is available. | ||||
|      * | ||||
|      * @returns If WS is available. | ||||
|      * @deprecated since app 4.0 | ||||
|      * @deprecated since 4.0. | ||||
|      */ | ||||
|     isAddRatingWSAvailable(): boolean { | ||||
|         return true; | ||||
|  | ||||
| @ -18,7 +18,6 @@ import { CoreConfig } from '@services/config'; | ||||
| import { CoreEvents } from '@singletons/events'; | ||||
| import { CoreLang } from '@services/lang'; | ||||
| import { CoreDomUtils } from '@services/utils/dom'; | ||||
| import { CorePushNotifications } from '@features/pushnotifications/services/pushnotifications'; | ||||
| import { CoreSettingsHelper, CoreColorScheme, CoreZoomLevel } from '../../services/settings-helper'; | ||||
| import { CoreIframeUtils } from '@services/utils/iframe'; | ||||
| import { Diagnostic, Translate } from '@singletons'; | ||||
| @ -250,7 +249,7 @@ export class CoreSettingsGeneralPage { | ||||
|         ev.stopPropagation(); | ||||
|         ev.preventDefault(); | ||||
| 
 | ||||
|         await CorePushNotifications.enableAnalytics(this.analyticsEnabled); | ||||
|         await CoreAnalytics.enableAnalytics(this.analyticsEnabled); | ||||
| 
 | ||||
|         CoreConfig.set(CoreConstants.SETTINGS_ANALYTICS_ENABLED, this.analyticsEnabled ? 1 : 0); | ||||
|     } | ||||
|  | ||||
| @ -40,6 +40,7 @@ export class CoreSitePluginsCourseFormatHandler extends CoreSitePluginsBaseHandl | ||||
|      */ | ||||
|     displayCourseIndex(): boolean { | ||||
|         // Use displaysectionselector while is not completely deprecated.
 | ||||
|         // eslint-disable-next-line deprecation/deprecation
 | ||||
|         return this.handlerSchema.displaycourseindex ?? this.handlerSchema.displaysectionselector ?? true; | ||||
|     } | ||||
| 
 | ||||
|  | ||||
| @ -37,7 +37,11 @@ export class CoreSitePluginsCourseFormatComponent implements OnChanges { | ||||
|     @Input() initialSectionId?: number; // The section to load first (by ID).
 | ||||
|     @Input() initialSectionNumber?: number; // The section to load first (by number).
 | ||||
|     @Input() moduleId?: number; // The module ID to scroll to. Must be inside the initial selected section.
 | ||||
|     // Notify when any module completion changes. @deprecated since 4.0, now we use CoreEvents.
 | ||||
|     /** | ||||
|      * Notify when any module completion changes. | ||||
|      * | ||||
|      * @deprecated since 4.0. Use CoreEvents instead. | ||||
|      */ | ||||
|     @Output() completionChanged = new EventEmitter<CoreCourseModuleCompletionData>(); | ||||
| 
 | ||||
|     // Special input, allows access to the parent instance properties and methods.
 | ||||
| @ -54,7 +58,7 @@ export class CoreSitePluginsCourseFormatComponent implements OnChanges { | ||||
|     data?: Record<string, unknown>; | ||||
| 
 | ||||
|     /** | ||||
|      * Detect changes on input properties. | ||||
|      * @inheritdoc | ||||
|      */ | ||||
|     ngOnChanges(): void { | ||||
|         if (!this.course || !this.course.format) { | ||||
| @ -83,6 +87,7 @@ export class CoreSitePluginsCourseFormatComponent implements OnChanges { | ||||
|             initialSectionId: this.initialSectionId, | ||||
|             initialSectionNumber: this.initialSectionNumber, | ||||
|             moduleId: this.moduleId, | ||||
|             // eslint-disable-next-line deprecation/deprecation
 | ||||
|             completionChanged: this.completionChanged, | ||||
|             coreCourseFormatComponent: this.coreCourseFormatComponent, | ||||
|         }; | ||||
|  | ||||
| @ -70,7 +70,7 @@ export class CoreSitePluginsModuleIndexComponent implements OnInit, OnDestroy, C | ||||
|      */ | ||||
|     refreshIcon = CoreConstants.ICON_REFRESH; | ||||
|     /** | ||||
|      * @deprecated since 4.0.. It won't be populated anymore. | ||||
|      * @deprecated since 4.0. It won't be populated anymore. | ||||
|      */ | ||||
|     prefetchStatus?: string; | ||||
|     /** | ||||
| @ -142,6 +142,7 @@ export class CoreSitePluginsModuleIndexComponent implements OnInit, OnDestroy, C | ||||
| 
 | ||||
|         // Get the data for the context menu.
 | ||||
|         this.description = this.module.description; | ||||
|         // eslint-disable-next-line deprecation/deprecation
 | ||||
|         this.externalUrl = this.module.url; | ||||
|     } | ||||
| 
 | ||||
| @ -180,7 +181,7 @@ export class CoreSitePluginsModuleIndexComponent implements OnInit, OnDestroy, C | ||||
|     /** | ||||
|      * Expand the description. | ||||
|      * | ||||
|      * @deprecated since 4.0 | ||||
|      * @deprecated since 4.0. | ||||
|      */ | ||||
|     expandDescription(): void { | ||||
|         this.openModuleSummary(); | ||||
| @ -222,7 +223,7 @@ export class CoreSitePluginsModuleIndexComponent implements OnInit, OnDestroy, C | ||||
|     /** | ||||
|      * Prefetch the module. | ||||
|      * | ||||
|      * @deprecated since 4.0 | ||||
|      * @deprecated since 4.0. | ||||
|      */ | ||||
|     async prefetch(): Promise<void> { | ||||
|         try { | ||||
| @ -242,7 +243,7 @@ export class CoreSitePluginsModuleIndexComponent implements OnInit, OnDestroy, C | ||||
|     /** | ||||
|      * Confirm and remove downloaded files. | ||||
|      * | ||||
|      * @deprecated since 4.0 | ||||
|      * @deprecated since 4.0. | ||||
|      */ | ||||
|     async removeFiles(): Promise<void> { | ||||
|         let modal: CoreIonLoadingElement | undefined; | ||||
|  | ||||
| @ -395,7 +395,7 @@ export class CoreSitePluginsProvider { | ||||
|      * Check if the get content WS is available. | ||||
|      * | ||||
|      * @returns If get content WS is available. | ||||
|      * @deprecated since app 4.0 | ||||
|      * @deprecated since 4.0 | ||||
|      */ | ||||
|     isGetContentAvailable(): boolean { | ||||
|         return true; | ||||
| @ -905,7 +905,7 @@ export type CoreSitePluginsCourseFormatHandlerData = CoreSitePluginsHandlerCommo | ||||
|     canviewallsections?: boolean; | ||||
|     displayenabledownload?: boolean; | ||||
|     /** | ||||
|      * @deprecated on 4.0, use displaycourseindex instead. | ||||
|      * @deprecated since 4.0. Use displaycourseindex instead. | ||||
|      */ | ||||
|     displaysectionselector?: boolean; | ||||
|     displaycourseindex?: boolean; | ||||
|  | ||||
| @ -89,7 +89,7 @@ export class CoreUserHelperProvider { | ||||
|      * @param city City. | ||||
|      * @param country Country. | ||||
|      * @returns Formatted address. | ||||
|      * @deprecated since 4.3 Not used anymore. | ||||
|      * @deprecated since 4.3. Not used anymore. | ||||
|      */ | ||||
|     formatAddress(address?: string, city?: string, country?: string): string { | ||||
|         const separator = Translate.instant('core.listsep'); | ||||
|  | ||||
| @ -113,7 +113,7 @@ export class CoreUserProvider { | ||||
|      * Check if WS to update profile picture is available in site. | ||||
|      * | ||||
|      * @returns Promise resolved with boolean: whether it's available. | ||||
|      * @deprecated since app 4.0 | ||||
|      * @deprecated since 4.0. | ||||
|      */ | ||||
|     async canUpdatePicture(): Promise<boolean> { | ||||
|         return true; | ||||
| @ -123,7 +123,7 @@ export class CoreUserProvider { | ||||
|      * Check if WS to search participants is available in site. | ||||
|      * | ||||
|      * @returns Whether it's available. | ||||
|      * @deprecated since app 4.0 | ||||
|      * @deprecated since 4.0. | ||||
|      */ | ||||
|     canUpdatePictureInSite(): boolean { | ||||
|         return true; | ||||
|  | ||||
| @ -34,6 +34,7 @@ import { CoreToLocaleStringPipe } from './to-locale-string'; | ||||
|         CoreNoTagsPipe, | ||||
|         CoreSecondsToHMSPipe, | ||||
|         CoreTimeAgoPipe, | ||||
|         // eslint-disable-next-line deprecation/deprecation
 | ||||
|         CoreToLocaleStringPipe, | ||||
|     ], | ||||
|     exports: [ | ||||
| @ -45,6 +46,7 @@ import { CoreToLocaleStringPipe } from './to-locale-string'; | ||||
|         CoreNoTagsPipe, | ||||
|         CoreSecondsToHMSPipe, | ||||
|         CoreTimeAgoPipe, | ||||
|         // eslint-disable-next-line deprecation/deprecation
 | ||||
|         CoreToLocaleStringPipe, | ||||
|     ], | ||||
| }) | ||||
|  | ||||
| @ -272,7 +272,7 @@ export class CoreAppProvider { | ||||
|      * Checks if the app is running in a mobile or tablet device (Cordova). | ||||
|      * | ||||
|      * @returns Whether the app is running in a mobile or tablet device. | ||||
|      * @deprecated since 4.1. use CorePlatform instead. | ||||
|      * @deprecated since 4.1. Use CorePlatform instead. | ||||
|      */ | ||||
|     isMobile(): boolean { | ||||
|         return CorePlatform.isMobile(); | ||||
| @ -291,7 +291,7 @@ export class CoreAppProvider { | ||||
|      * Returns whether we are online. | ||||
|      * | ||||
|      * @returns Whether the app is online. | ||||
|      * @deprecated since 4.1.0. Use CoreNetwork instead. | ||||
|      * @deprecated since 4.1. Use CoreNetwork instead. | ||||
|      */ | ||||
|     isOnline(): boolean { | ||||
|         return CoreNetwork.isOnline(); | ||||
| @ -301,7 +301,7 @@ export class CoreAppProvider { | ||||
|      * Check if device uses a limited connection. | ||||
|      * | ||||
|      * @returns Whether the device uses a limited connection. | ||||
|      * @deprecated since 4.1.0. Use CoreNetwork instead. | ||||
|      * @deprecated since 4.1. Use CoreNetwork instead. | ||||
|      */ | ||||
|     isNetworkAccessLimited(): boolean { | ||||
|         return CoreNetwork.isNetworkAccessLimited(); | ||||
| @ -311,7 +311,7 @@ export class CoreAppProvider { | ||||
|      * Check if device uses a wifi connection. | ||||
|      * | ||||
|      * @returns Whether the device uses a wifi connection. | ||||
|      * @deprecated since 4.1.0. Use CoreNetwork instead. | ||||
|      * @deprecated since 4.1. Use CoreNetwork instead. | ||||
|      */ | ||||
|     isWifi(): boolean { | ||||
|         return CoreNetwork.isWifi(); | ||||
| @ -576,7 +576,7 @@ export class CoreAppProvider { | ||||
|      * Set value of forceOffline flag. If true, the app will think the device is offline. | ||||
|      * | ||||
|      * @param value Value to set. | ||||
|      * @deprecated since 4.1.0. Use CoreNetwork.setForceConnectionMode instead. | ||||
|      * @deprecated since 4.1. Use CoreNetwork.setForceConnectionMode instead. | ||||
|      */ | ||||
|     setForceOffline(value: boolean): void { | ||||
|         CoreNetwork.setForceConnectionMode(value ? CoreNetworkConnection.NONE : CoreNetworkConnection.WIFI); | ||||
|  | ||||
| @ -154,9 +154,7 @@ export class CoreLocalNotificationsProvider { | ||||
|      * @returns Promise resolved when the notifications are cancelled. | ||||
|      */ | ||||
|     async cancelSiteNotifications(siteId: string): Promise<void> { | ||||
|         if (!this.isAvailable()) { | ||||
|             return; | ||||
|         } else if (!siteId) { | ||||
|         if (!siteId) { | ||||
|             throw new Error('No site ID supplied.'); | ||||
|         } | ||||
| 
 | ||||
|  | ||||
| @ -413,7 +413,7 @@ export class CoreSitesProvider { | ||||
|      * | ||||
|      * @param siteUrl URL of the site to check. | ||||
|      * @returns A promise to be resolved if the site exists. | ||||
|      * @deprecated since app 4.0. Now the app calls uses tool_mobile_get_public_config to check if site exists. | ||||
|      * @deprecated since 4.0. Now the app calls uses tool_mobile_get_public_config to check if site exists. | ||||
|      */ | ||||
|     async siteExists(siteUrl: string): Promise<void> { | ||||
|         let data: CoreSitesLoginTokenResponse; | ||||
| @ -703,7 +703,7 @@ export class CoreSitesProvider { | ||||
|      * Function for determine which service we should use (default or extended plugin). | ||||
|      * | ||||
|      * @returns The service shortname. | ||||
|      * @deprecated since app 4.0 | ||||
|      * @deprecated since 4.0. | ||||
|      */ | ||||
|     determineService(): string { | ||||
|         return CoreConstants.CONFIG.wsservice; | ||||
| @ -2132,7 +2132,9 @@ export type CoreSiteCheckResponse = { | ||||
|     service: string; | ||||
| 
 | ||||
|     /** | ||||
|      * Code of the warning message to show to the user. @deprecated since app 4.0 | ||||
|      * Code of the warning message to show to the user. | ||||
|      * | ||||
|      * @deprecated since 4.0. | ||||
|      */ | ||||
|     warning?: string; | ||||
| 
 | ||||
|  | ||||
| @ -106,7 +106,7 @@ export class CoreDomUtilsProvider { | ||||
|      * @param element DOM Element. | ||||
|      * @param selector Selector to search. | ||||
|      * @returns Closest ancestor. | ||||
|      * @deprecated since app 4.0 Not needed anymore since it's supported on both Android and iOS. Use closest instead. | ||||
|      * @deprecated since 4.0. Not needed anymore since it's supported on both Android and iOS. Use closest instead. | ||||
|      */ | ||||
|     closest(element: Element | undefined | null, selector: string): Element | null { | ||||
|         return element?.closest(selector) ?? null; | ||||
| @ -404,7 +404,7 @@ export class CoreDomUtilsProvider { | ||||
|      * @param useBorder Whether to use borders to calculate the measure. | ||||
|      * @param innerMeasure If inner measure is needed: padding, margin or borders will be substracted. | ||||
|      * @returns Height in pixels. | ||||
|      * @deprecated since app 4.0 Use getBoundingClientRect.height instead. | ||||
|      * @deprecated since 4.0 Use getBoundingClientRect.height instead. | ||||
|      */ | ||||
|     getElementHeight( | ||||
|         element: HTMLElement, | ||||
| @ -413,6 +413,7 @@ export class CoreDomUtilsProvider { | ||||
|         useBorder?: boolean, | ||||
|         innerMeasure?: boolean, | ||||
|     ): number { | ||||
|         // eslint-disable-next-line deprecation/deprecation
 | ||||
|         return this.getElementMeasure(element, false, usePadding, useMargin, useBorder, innerMeasure); | ||||
|     } | ||||
| 
 | ||||
| @ -426,7 +427,7 @@ export class CoreDomUtilsProvider { | ||||
|      * @param useBorder Whether to use borders to calculate the measure. | ||||
|      * @param innerMeasure If inner measure is needed: padding, margin or borders will be substracted. | ||||
|      * @returns Measure in pixels. | ||||
|      * @deprecated since app 4.0 Use getBoundingClientRect.height or width instead. | ||||
|      * @deprecated since 4.0. Use getBoundingClientRect.height or width instead. | ||||
|      */ | ||||
|     getElementMeasure( | ||||
|         element: HTMLElement, | ||||
| @ -499,7 +500,7 @@ export class CoreDomUtilsProvider { | ||||
|      * @param useBorder Whether to use borders to calculate the measure. | ||||
|      * @param innerMeasure If inner measure is needed: padding, margin or borders will be substracted. | ||||
|      * @returns Width in pixels. | ||||
|      * @deprecated since app 4.0 Use getBoundingClientRect.width instead. | ||||
|      * @deprecated since 4.0. Use getBoundingClientRect.width instead. | ||||
|      */ | ||||
|     getElementWidth( | ||||
|         element: HTMLElement, | ||||
| @ -508,6 +509,7 @@ export class CoreDomUtilsProvider { | ||||
|         useBorder?: boolean, | ||||
|         innerMeasure?: boolean, | ||||
|     ): number { | ||||
|         // eslint-disable-next-line deprecation/deprecation
 | ||||
|         return this.getElementMeasure(element, true, usePadding, useMargin, useBorder, innerMeasure); | ||||
|     } | ||||
| 
 | ||||
| @ -518,7 +520,7 @@ export class CoreDomUtilsProvider { | ||||
|      * @param selector Selector to find the element to gets the position. | ||||
|      * @param positionParentClass Parent Class where to stop calculating the position. Default inner-scroll. | ||||
|      * @returns positionLeft, positionTop of the element relative to. | ||||
|      * @deprecated since app 4.0. Use CoreDom.getRelativeElementPosition instead. | ||||
|      * @deprecated since 4.0. Use CoreDom.getRelativeElementPosition instead. | ||||
|      */ | ||||
|     getElementXY(element: HTMLElement, selector?: string, positionParentClass = 'inner-scroll'): [number, number] | null { | ||||
|         if (selector) { | ||||
| @ -642,7 +644,7 @@ export class CoreDomUtilsProvider { | ||||
|      * | ||||
|      * @param element The root element of the component/directive. | ||||
|      * @returns The instance, undefined if not found. | ||||
|      * @deprecated since 4.0.0. Use CoreDirectivesRegistry instead. | ||||
|      * @deprecated since 4.0. Use CoreDirectivesRegistry instead. | ||||
|      */ | ||||
|     getInstanceByElement<T = unknown>(element: Element): T | undefined { | ||||
|         return CoreDirectivesRegistry.resolve<T>(element) ?? undefined; | ||||
| @ -675,7 +677,7 @@ export class CoreDomUtilsProvider { | ||||
|      * @param retries Number of retries before giving up. | ||||
|      * @param retryAfter Milliseconds to wait before retrying if the element wasn't found. | ||||
|      * @returns Resolved if found, rejected if too many tries. | ||||
|      * @deprecated since app 4.0 Use CoreDom.waitToBeInsideElement instead. | ||||
|      * @deprecated since 4.0. Use CoreDom.waitToBeInsideElement instead. | ||||
|      */ | ||||
|     async waitElementToExist( | ||||
|         findFunction: () => HTMLElement | null, | ||||
| @ -691,6 +693,7 @@ export class CoreDomUtilsProvider { | ||||
|         if (!element) { | ||||
|             await CoreUtils.wait(retryAfter); | ||||
| 
 | ||||
|             // eslint-disable-next-line deprecation/deprecation
 | ||||
|             return this.waitElementToExist(findFunction, retries - 1); | ||||
|         } | ||||
| 
 | ||||
| @ -852,7 +855,7 @@ export class CoreDomUtilsProvider { | ||||
|      * Remove a component/directive instance using the DOM Element. | ||||
|      * | ||||
|      * @param element The root element of the component/directive. | ||||
|      * @deprecated since 4.0.0. It's no longer necessary to remove instances. | ||||
|      * @deprecated since 4.0. It's no longer necessary to remove instances. | ||||
|      */ | ||||
|     // eslint-disable-next-line @typescript-eslint/no-unused-vars
 | ||||
|     removeInstanceByElement(element: Element): void { | ||||
| @ -863,7 +866,7 @@ export class CoreDomUtilsProvider { | ||||
|      * Remove a component/directive instance using the ID. | ||||
|      * | ||||
|      * @param id The ID to remove. | ||||
|      * @deprecated since 4.0.0. It's no longer necessary to remove instances. | ||||
|      * @deprecated since 4.0. It's no longer necessary to remove instances. | ||||
|      */ | ||||
|     // eslint-disable-next-line @typescript-eslint/no-unused-vars
 | ||||
|     removeInstanceById(id: string): void { | ||||
| @ -1001,7 +1004,7 @@ export class CoreDomUtilsProvider { | ||||
|      * @param scrollParentClass Not used anymore. | ||||
|      * @param duration Duration of the scroll animation in milliseconds. | ||||
|      * @returns True if the element is found, false otherwise. | ||||
|      * @deprecated since app 4.0 Use CoreDom.scrollToElement instead. | ||||
|      * @deprecated since 4.0. Use CoreDom.scrollToElement instead. | ||||
|      */ | ||||
|     scrollToElement(content: IonContent, element: HTMLElement, scrollParentClass?: string, duration?: number): boolean { | ||||
|         CoreDom.scrollToElement(element, undefined, { duration }); | ||||
| @ -1018,7 +1021,7 @@ export class CoreDomUtilsProvider { | ||||
|      * @param scrollParentClass Not used anymore. | ||||
|      * @param duration Duration of the scroll animation in milliseconds. | ||||
|      * @returns True if the element is found, false otherwise. | ||||
|      * @deprecated since app 4.0 Use CoreDom.scrollToElement instead. | ||||
|      * @deprecated since 4.0. Use CoreDom.scrollToElement instead. | ||||
|      */ | ||||
|     scrollToElementBySelector( | ||||
|         container: HTMLElement | null, | ||||
| @ -1042,7 +1045,7 @@ export class CoreDomUtilsProvider { | ||||
|      * | ||||
|      * @param container The element that contains the element that must be scrolled. | ||||
|      * @returns True if the element is found, false otherwise. | ||||
|      * @deprecated since app 4.0 Use CoreDom.scrollToInputError instead. | ||||
|      * @deprecated since 4.0. Use CoreDom.scrollToInputError instead. | ||||
|      */ | ||||
|     scrollToInputError(container: HTMLElement | null): boolean { | ||||
|         if (!container) { | ||||
| @ -1669,7 +1672,7 @@ export class CoreDomUtilsProvider { | ||||
|      * | ||||
|      * @param element The root element of the component/directive. | ||||
|      * @param instance The instance to store. | ||||
|      * @deprecated since 4.0.0. Use CoreDirectivesRegistry instead. | ||||
|      * @deprecated since 4.0. Use CoreDirectivesRegistry instead. | ||||
|      */ | ||||
|     storeInstanceByElement(element: Element, instance: unknown): void { | ||||
|         CoreDirectivesRegistry.register(element, instance); | ||||
| @ -2027,7 +2030,7 @@ export class CoreDomUtilsProvider { | ||||
|     ): void { | ||||
|         document.documentElement.classList.toggle(className, enable); | ||||
| 
 | ||||
|         // @deprecated since 4.1
 | ||||
|         // @deprecated since 4.1.
 | ||||
|         document.body.classList.toggle(className, enable && options.includeLegacy); | ||||
|     } | ||||
| 
 | ||||
|  | ||||
| @ -32,11 +32,9 @@ import { CoreContentLinksHelper } from '@features/contentlinks/services/contentl | ||||
| import { CorePath } from '@singletons/path'; | ||||
| import { CorePromisedValue } from '@classes/promised-value'; | ||||
| import { CorePlatform } from '@services/platform'; | ||||
| import { FrameElement } from '@classes/element-controllers/FrameElementController'; | ||||
| 
 | ||||
| /** | ||||
|  * Possible types of frame elements. | ||||
|  */ | ||||
| type CoreFrameElement = (HTMLIFrameElement | HTMLFrameElement | HTMLObjectElement | HTMLEmbedElement) & { | ||||
| type CoreFrameElement = FrameElement & { | ||||
|     window?: Window; | ||||
|     getWindow?(): Window; | ||||
| }; | ||||
| @ -64,6 +62,8 @@ export class CoreIframeUtilsProvider { | ||||
|      * @returns True if frame is online and the app is offline, false otherwise. | ||||
|      */ | ||||
|     checkOnlineFrameInOffline(element: CoreFrameElement, isSubframe?: boolean): boolean { | ||||
|         // @todo Drop frame tag support to avoid deprecation.
 | ||||
|         // eslint-disable-next-line deprecation/deprecation
 | ||||
|         const src = 'src' in element ? element.src : element.data; | ||||
| 
 | ||||
|         if (src && src != 'about:blank' && !CoreUrlUtils.isLocalFileUrl(src) && !CoreNetwork.isOnline()) { | ||||
| @ -91,7 +91,8 @@ export class CoreIframeUtilsProvider { | ||||
|             // Reload the frame.
 | ||||
|             if ('src' in element) { | ||||
|                 // eslint-disable-next-line no-self-assign
 | ||||
|                 element.src = element.src; | ||||
|                 element.src = element.src; // eslint-disable-line deprecation/deprecation
 | ||||
| 
 | ||||
|             } else { | ||||
|                 // eslint-disable-next-line no-self-assign
 | ||||
|                 element.data = element.data; | ||||
| @ -231,18 +232,21 @@ export class CoreIframeUtilsProvider { | ||||
|      * @returns Window and Document. | ||||
|      */ | ||||
|     getContentWindowAndDocument(element: CoreFrameElement): { window: Window | null; document: Document | null } { | ||||
|         // @todo Drop frame tag support to avoid deprecation.
 | ||||
|         // eslint-disable-next-line deprecation/deprecation
 | ||||
|         const src = 'src' in element ? element.src : element.data; | ||||
|         if (src !== 'about:blank' && !CoreUrlUtils.isLocalFileUrl(src)) { | ||||
|             // No permissions to access the iframe.
 | ||||
|             return { window: null, document: null }; | ||||
|         } | ||||
| 
 | ||||
|         // eslint-disable-next-line deprecation/deprecation
 | ||||
|         let contentWindow: Window | null = 'contentWindow' in element ? element.contentWindow : null; | ||||
|         let contentDocument: Document | null = null; | ||||
| 
 | ||||
|         try { | ||||
|             contentDocument = 'contentDocument' in element && element.contentDocument | ||||
|                 ? element.contentDocument | ||||
|             contentDocument = 'contentDocument' in element && element.contentDocument // eslint-disable-line deprecation/deprecation
 | ||||
|                 ? element.contentDocument // eslint-disable-line deprecation/deprecation
 | ||||
|                 : contentWindow && contentWindow.document; | ||||
|         } catch { | ||||
|             // Ignore errors.
 | ||||
| @ -421,8 +425,9 @@ export class CoreIframeUtilsProvider { | ||||
|         const scheme = CoreUrlUtils.getUrlScheme(url); | ||||
|         if (!scheme) { | ||||
|             // It's a relative URL, use the frame src to create the full URL.
 | ||||
|             // @todo Drop frame tag support to avoid deprecation.
 | ||||
|             const src = element | ||||
|                 ? ('src' in element ? element.src : element.data) | ||||
|                 ? ('src' in element ? element.src : element.data)  // eslint-disable-line deprecation/deprecation
 | ||||
|                 : null; | ||||
|             if (src) { | ||||
|                 const dirAndFile = CoreFile.getFileAndDirectoryFromPath(src); | ||||
| @ -492,7 +497,7 @@ export class CoreIframeUtilsProvider { | ||||
|             // Scheme suggests it's an external resource.
 | ||||
|             event && event.preventDefault(); | ||||
| 
 | ||||
|             const frameSrc = element && ((<HTMLFrameElement> element).src || (<HTMLObjectElement> element).data); | ||||
|             const frameSrc = element && ((<HTMLIFrameElement> element).src || (<HTMLObjectElement> element).data); | ||||
| 
 | ||||
|             // If the frame is not local, check the target to identify how to treat the link.
 | ||||
|             if ( | ||||
|  | ||||
| @ -161,7 +161,7 @@ export class CoreTimeUtilsProvider { | ||||
|      * @param seconds A number of seconds | ||||
|      * @param precision Number of elements to have in precision. | ||||
|      * @returns Seconds in a human readable format. | ||||
|      * @deprecated since app 4.0. Use CoreTime.formatTime instead. | ||||
|      * @deprecated since 4.0. Use CoreTime.formatTime instead. | ||||
|      */ | ||||
|     formatTime(seconds: number, precision = 2): string { | ||||
|         return CoreTime.formatTime(seconds, precision); | ||||
| @ -172,7 +172,7 @@ export class CoreTimeUtilsProvider { | ||||
|      * | ||||
|      * @param duration Seconds | ||||
|      * @returns Short human readable text. | ||||
|      * @deprecated since app 4.0. Use CoreTime.formatTimeShort instead. | ||||
|      * @deprecated since 4.0. Use CoreTime.formatTimeShort instead. | ||||
|      */ | ||||
|     formatTimeShort(duration: number): string { | ||||
|         return CoreTime.formatTimeShort(duration); | ||||
| @ -184,7 +184,7 @@ export class CoreTimeUtilsProvider { | ||||
|      * @param duration Duration in seconds | ||||
|      * @param precision Number of elements to have in precision. 0 or undefined to full precission. | ||||
|      * @returns Duration in a human readable format. | ||||
|      * @deprecated since app 4.0. Use CoreTime.formatTime instead. | ||||
|      * @deprecated since 4.0. Use CoreTime.formatTime instead. | ||||
|      */ | ||||
|     formatDuration(duration: number, precision?: number): string { | ||||
|         return CoreTime.formatTime(duration, precision); | ||||
| @ -195,7 +195,7 @@ export class CoreTimeUtilsProvider { | ||||
|      * | ||||
|      * @param duration Duration in seconds | ||||
|      * @returns Duration in a short human readable format. | ||||
|      * @deprecated since app 4.0. Use CoreTime.formatTimeShort instead. | ||||
|      * @deprecated since 4.0. Use CoreTime.formatTimeShort instead. | ||||
|      */ | ||||
|     formatDurationShort(duration: number): string { | ||||
|         return CoreTime.formatTimeShort(duration); | ||||
|  | ||||
| @ -1182,6 +1182,7 @@ export class CoreUtilsProvider { | ||||
|      * @param options Options. | ||||
|      */ | ||||
|     async openInBrowser(url: string, options: CoreUtilsOpenInBrowserOptions = {}): Promise<void> { | ||||
|         // eslint-disable-next-line deprecation/deprecation
 | ||||
|         const originaUrl = CoreUrlUtils.unfixPluginfileURL(options.originalUrl ?? options.browserWarningUrl ?? url); | ||||
|         if (options.showBrowserWarning || options.showBrowserWarning === undefined) { | ||||
|             try { | ||||
| @ -1412,7 +1413,7 @@ export class CoreUtilsProvider { | ||||
|      * Create a deferred promise that can be resolved or rejected explicitly. | ||||
|      * | ||||
|      * @returns The deferred promise. | ||||
|      * @deprecated since app 4.1. Use CorePromisedValue instead. | ||||
|      * @deprecated since 4.1. Use CorePromisedValue instead. | ||||
|      */ | ||||
|     promiseDefer<T>(): CorePromisedValue<T> { | ||||
|         return new CorePromisedValue<T>(); | ||||
| @ -1924,7 +1925,7 @@ export type CoreUtilsOpenInBrowserOptions = { | ||||
|     showBrowserWarning?: boolean; // Whether to display a warning before opening in browser. Defaults to true.
 | ||||
|     originalUrl?: string; // Original URL to open (in case the URL was treated, e.g. to add a token or an auto-login).
 | ||||
|     /** | ||||
|      * @deprecated since 4.3, use originalUrl instead. | ||||
|      * @deprecated since 4.3. Use originalUrl instead. | ||||
|      */ | ||||
|     browserWarningUrl?: string; | ||||
| }; | ||||
|  | ||||
| @ -39,6 +39,7 @@ export interface CoreEventsData { | ||||
|     [CoreEvents.SITE_ADDED]: CoreEventSiteAddedData; | ||||
|     [CoreEvents.SITE_DELETED]: CoreSite; | ||||
|     [CoreEvents.SESSION_EXPIRED]: CoreEventSessionExpiredData; | ||||
|     // eslint-disable-next-line deprecation/deprecation
 | ||||
|     [CoreEvents.CORE_LOADING_CHANGED]: CoreEventLoadingChangedData; | ||||
|     [CoreEvents.COURSE_STATUS_CHANGED]: CoreEventCourseStatusChanged; | ||||
|     [CoreEvents.PACKAGE_STATUS_CHANGED]: CoreEventPackageStatusChanged; | ||||
| @ -84,11 +85,7 @@ export class CoreEvents { | ||||
|     static readonly SITE_UPDATED = 'site_updated'; | ||||
|     static readonly SITE_DELETED = 'site_deleted'; | ||||
|     static readonly COMPLETION_MODULE_VIEWED = 'completion_module_viewed'; | ||||
|     /** | ||||
|      * Deprecated on 4.0 use COMPLETION_CHANGED instead. | ||||
|      */ | ||||
|     static readonly MANUAL_COMPLETION_CHANGED = 'manual_completion_changed'; | ||||
|     static readonly COMPLETION_CHANGED = 'completion_changed'; | ||||
|     static readonly USER_DELETED = 'user_deleted'; | ||||
|     static readonly USER_SUSPENDED = 'user_suspended'; | ||||
|     static readonly USER_NO_LOGIN = 'user_no_login'; | ||||
| @ -108,7 +105,7 @@ export class CoreEvents { | ||||
|     static readonly FILE_SHARED = 'file_shared'; | ||||
|     static readonly KEYBOARD_CHANGE = 'keyboard_change'; | ||||
|     /** | ||||
|      * @deprecated since app 4.0. Use CoreDirectivesRegistry promises instead. | ||||
|      * @deprecated since 4.0. Use CoreDirectivesRegistry promises instead. | ||||
|      */ | ||||
|     static readonly CORE_LOADING_CHANGED = 'core_loading_changed'; | ||||
|     static readonly ORIENTATION_CHANGE = 'orientation_change'; | ||||
|  | ||||
| @ -142,6 +142,8 @@ export function makeSingleton<Service extends object = object>( // eslint-disabl | ||||
|                 throw new Error('Can\'t resolve a singleton instance without an injector'); | ||||
|             } | ||||
| 
 | ||||
|             // @todo Check type to avoid deprecation.
 | ||||
|             // eslint-disable-next-line deprecation/deprecation
 | ||||
|             const instance = injector.get(injectionToken); | ||||
| 
 | ||||
|             singleton.setInstance(instance); | ||||
|  | ||||
| @ -76,7 +76,7 @@ export class CoreText { | ||||
|      * @param leftPath Left path. | ||||
|      * @param rightPath Right path. | ||||
|      * @returns Concatenated path. | ||||
|      * @deprecated since 4.1.0. Please use CorePath.concatenatePaths instead. | ||||
|      * @deprecated since 4.1. Use CorePath.concatenatePaths instead. | ||||
|      */ | ||||
|     static concatenatePaths(leftPath: string, rightPath: string): string { | ||||
|         return CorePath.concatenatePaths(leftPath, rightPath); | ||||
|  | ||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user