Merge pull request #3829 from crazyserver/MOBILE-4362

Mobile 4362
main
Dani Palou 2023-10-20 07:59:43 +02:00 committed by GitHub
commit 0477eebcc2
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
63 changed files with 329 additions and 142 deletions

View File

@ -18,6 +18,7 @@ const appConfig = {
'plugin:@angular-eslint/recommended',
'plugin:promise/recommended',
'plugin:jsdoc/recommended',
"plugin:deprecation/recommended",
],
parser: '@typescript-eslint/parser',
parserOptions: {
@ -204,6 +205,19 @@ const appConfig = {
'jsdoc/require-returns-type': 'off',
'jsdoc/require-param': 'off',
'jsdoc/check-values': 'off',
'jsdoc/check-tag-names': [
'warn',
{
"definedTags": ["deprecatedonmoodle"]
},
],
'jsdoc/check-param-names': [
'warn',
{
checkDestructured: false,
enableFixer: true
},
],
'linebreak-style': [
'error',
'unix',

109
package-lock.json generated
View File

@ -3409,6 +3409,23 @@
"integrity": "sha512-6U71C2Wp7r5XtFtQzYrW5iKFT67OixrSxjI4MptCHzdSVlgabczzqLe0ZSgnub/5Kp4hSbpDB1tMytZY9pwxxA==",
"dev": true
},
"@eslint-community/eslint-utils": {
"version": "4.4.0",
"resolved": "https://registry.npmjs.org/@eslint-community/eslint-utils/-/eslint-utils-4.4.0.tgz",
"integrity": "sha512-1/sA4dwrzBAyeUoQ6oxahHKmrZvsnLCg4RfxW3ZFGGmQkSNQPFNLV9CUEFQP1x9EYXHTo5p6xdhZM1Ne9p/AfA==",
"dev": true,
"requires": {
"eslint-visitor-keys": "^3.3.0"
},
"dependencies": {
"eslint-visitor-keys": {
"version": "3.4.3",
"resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-3.4.3.tgz",
"integrity": "sha512-wpc+LXeiyiisxPlEkUzU6svyS1frIO3Mgxj1fdy7Pm8Ygzguax2N3Fa/D/ag1WqbOprdI+uY6wMUl8/a2G+iag==",
"dev": true
}
}
},
"@eslint/eslintrc": {
"version": "0.4.3",
"resolved": "https://registry.npmjs.org/@eslint/eslintrc/-/eslintrc-0.4.3.tgz",
@ -8051,6 +8068,12 @@
"integrity": "sha512-5cJ8CB4yAx7BH1oMvdU0Jh9lrEXyPkar6F9G/ERswkCuvP4KQZfZkSjcMbAICCpQTN4OuZn8tz0HiKv9TGZgrQ==",
"dev": true
},
"@types/semver": {
"version": "7.5.3",
"resolved": "https://registry.npmjs.org/@types/semver/-/semver-7.5.3.tgz",
"integrity": "sha512-OxepLK9EuNEIPxWNME+C6WwbRAOOI2o2BaQEGzz5Lu2e4Z5eDnEo+/aVEDMIXywoJitJ7xWd641wrGLZdtwRyw==",
"dev": true
},
"@types/send": {
"version": "0.17.1",
"resolved": "https://registry.npmjs.org/@types/send/-/send-0.17.1.tgz",
@ -8385,6 +8408,81 @@
"tsutils": "^3.17.1"
}
},
"@typescript-eslint/utils": {
"version": "5.62.0",
"resolved": "https://registry.npmjs.org/@typescript-eslint/utils/-/utils-5.62.0.tgz",
"integrity": "sha512-n8oxjeb5aIbPFEtmQxQYOLI0i9n5ySBEY/ZEHHZqKQSFnxio1rv6dthascc9dLuwrL0RC5mPCxB7vnAVGAYWAQ==",
"dev": true,
"requires": {
"@eslint-community/eslint-utils": "^4.2.0",
"@types/json-schema": "^7.0.9",
"@types/semver": "^7.3.12",
"@typescript-eslint/scope-manager": "5.62.0",
"@typescript-eslint/types": "5.62.0",
"@typescript-eslint/typescript-estree": "5.62.0",
"eslint-scope": "^5.1.1",
"semver": "^7.3.7"
},
"dependencies": {
"@typescript-eslint/scope-manager": {
"version": "5.62.0",
"resolved": "https://registry.npmjs.org/@typescript-eslint/scope-manager/-/scope-manager-5.62.0.tgz",
"integrity": "sha512-VXuvVvZeQCQb5Zgf4HAxc04q5j+WrNAtNh9OwCsCgpKqESMTu3tF/jhZ3xG6T4NZwWl65Bg8KuS2uEvhSfLl0w==",
"dev": true,
"requires": {
"@typescript-eslint/types": "5.62.0",
"@typescript-eslint/visitor-keys": "5.62.0"
}
},
"@typescript-eslint/types": {
"version": "5.62.0",
"resolved": "https://registry.npmjs.org/@typescript-eslint/types/-/types-5.62.0.tgz",
"integrity": "sha512-87NVngcbVXUahrRTqIK27gD2t5Cu1yuCXxbLcFtCzZGlfyVWWh8mLHkoxzjsB6DDNnvdL+fW8MiwPEJyGJQDgQ==",
"dev": true
},
"@typescript-eslint/typescript-estree": {
"version": "5.62.0",
"resolved": "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-5.62.0.tgz",
"integrity": "sha512-CmcQ6uY7b9y694lKdRB8FEel7JbU/40iSAPomu++SjLMntB+2Leay2LO6i8VnJk58MtE9/nQSFIH6jpyRWyYzA==",
"dev": true,
"requires": {
"@typescript-eslint/types": "5.62.0",
"@typescript-eslint/visitor-keys": "5.62.0",
"debug": "^4.3.4",
"globby": "^11.1.0",
"is-glob": "^4.0.3",
"semver": "^7.3.7",
"tsutils": "^3.21.0"
}
},
"@typescript-eslint/visitor-keys": {
"version": "5.62.0",
"resolved": "https://registry.npmjs.org/@typescript-eslint/visitor-keys/-/visitor-keys-5.62.0.tgz",
"integrity": "sha512-07ny+LHRzQXepkGg6w0mFY41fVUNBrL2Roj/++7V1txKugfjm/Ci/qSND03r2RhlJhJYMcTn9AhhSSqQp0Ysyw==",
"dev": true,
"requires": {
"@typescript-eslint/types": "5.62.0",
"eslint-visitor-keys": "^3.3.0"
}
},
"eslint-scope": {
"version": "5.1.1",
"resolved": "https://registry.npmjs.org/eslint-scope/-/eslint-scope-5.1.1.tgz",
"integrity": "sha512-2NxwbF/hZ0KpepYN0cNbo+FN6XoK7GaHlQhgx/hIZl6Va0bF45RQOOwhLIy8lQDbuCiadSLCBnH2CFYquit5bw==",
"dev": true,
"requires": {
"esrecurse": "^4.3.0",
"estraverse": "^4.1.1"
}
},
"eslint-visitor-keys": {
"version": "3.4.3",
"resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-3.4.3.tgz",
"integrity": "sha512-wpc+LXeiyiisxPlEkUzU6svyS1frIO3Mgxj1fdy7Pm8Ygzguax2N3Fa/D/ag1WqbOprdI+uY6wMUl8/a2G+iag==",
"dev": true
}
}
},
"@typescript-eslint/visitor-keys": {
"version": "4.16.1",
"resolved": "https://registry.npmjs.org/@typescript-eslint/visitor-keys/-/visitor-keys-4.16.1.tgz",
@ -15446,6 +15544,17 @@
}
}
},
"eslint-plugin-deprecation": {
"version": "1.5.0",
"resolved": "https://registry.npmjs.org/eslint-plugin-deprecation/-/eslint-plugin-deprecation-1.5.0.tgz",
"integrity": "sha512-mRcssI/tLROueBQ6yf4LnnGTijbMsTCPIpbRbPj5R5wGYVCpk1zDmAS0SEkgcUDXOPc22qMNFR24Qw7vSPrlTA==",
"dev": true,
"requires": {
"@typescript-eslint/utils": "^5.57.0",
"tslib": "^2.3.1",
"tsutils": "^3.21.0"
}
},
"eslint-plugin-ecmascript-compat": {
"version": "1.1.1",
"resolved": "https://registry.npmjs.org/eslint-plugin-ecmascript-compat/-/eslint-plugin-ecmascript-compat-1.1.1.tgz",

View File

@ -166,6 +166,7 @@
"cross-env": "^7.0.3",
"eslint": "^7.25.0",
"eslint-config-prettier": "^8.3.0",
"eslint-plugin-deprecation": "^1.5.0",
"eslint-plugin-header": "^3.1.1",
"eslint-plugin-import": "^2.22.1",
"eslint-plugin-jest": "^24.3.6",

View File

@ -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.

View File

@ -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,

View File

@ -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.

View File

@ -274,7 +274,7 @@ export class AddonModImscpProvider {
* @param siteId Site ID. If not defined, current site.
* @returns Promise resolved when the WS call is successful.
*/
async logView(id: number, name?: string, siteId?: string): Promise<void> {
async logView(id: number, siteId?: string): Promise<void> {
const params: AddonModImscpViewImscpWSParams = {
imscpid: id,
};

View File

@ -104,7 +104,6 @@ export class AddonModLtiHelperProvider {
* @param courseId Course ID.
* @param module Module.
* @param ltiId LTI id.
* @param name Name of the lti.
* @param siteId Site ID. If not defined, current site.
* @returns Promise resolved when done.
*/

View File

@ -211,7 +211,7 @@ export class AddonModSurveyProvider {
* @param siteId Site ID. If not defined, current site.
* @returns Promise resolved when the WS call is successful.
*/
async logView(id: number, name?: string, siteId?: string): Promise<void> {
async logView(id: number, siteId?: string): Promise<void> {
const params: AddonModSurveyViewSurveyWSParams = {
surveyid: id,
};

View File

@ -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.

View File

@ -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.

View File

@ -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;
/**

View File

@ -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) {

View File

@ -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;

View File

@ -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 = {
/**

View File

@ -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');

View File

@ -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.

View File

@ -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;

View File

@ -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,

View File

@ -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/';
}

View File

@ -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.
/**

View File

@ -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);

View File

@ -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;

View File

@ -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 };

View File

@ -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,

View File

@ -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;

View File

@ -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));

View File

@ -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.

View File

@ -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.

View File

@ -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;

View File

@ -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;

View File

@ -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;

View File

@ -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,
],

View File

@ -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',

View File

@ -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;
}

View File

@ -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;

View File

@ -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.
]);
}

View File

@ -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;

View File

@ -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)));
}

View File

@ -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;

View File

@ -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();

View File

@ -370,7 +370,6 @@ export class CorePushNotificationsProvider {
* @param itemCategory The item category.
* @param wsName Name of the WS.
* @param data Other data to pass to the event.
* @param siteId Site ID. If not defined, current site.
* @returns Promise resolved when done. This promise is never rejected.
* @deprecated since 4.3. Use CoreAnalytics.logEvent instead.
*/
@ -387,6 +386,7 @@ export class CorePushNotificationsProvider {
data.category = itemCategory;
data.moodleaction = wsName;
// eslint-disable-next-line deprecation/deprecation
return this.logEvent('view_item', data);
}
@ -396,7 +396,6 @@ export class CorePushNotificationsProvider {
* @param itemCategory The item category.
* @param wsName Name of the WS.
* @param data Other data to pass to the event.
* @param siteId Site ID. If not defined, current site.
* @returns Promise resolved when done. This promise is never rejected.
* @deprecated since 4.3. Use CoreAnalytics.logEvent instead.
*/
@ -409,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);
}

View File

@ -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
};
/**

View File

@ -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;

View File

@ -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);
}

View File

@ -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;
}

View File

@ -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,
};

View File

@ -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;

View File

@ -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;

View File

@ -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');

View File

@ -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;

View File

@ -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,
],
})

View File

@ -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);
@ -617,6 +617,7 @@ export class CoreAppProvider {
this.logger.debug(`Set navigation bar color ${color}`);
// eslint-disable-next-line @typescript-eslint/no-explicit-any
(<any> window).StatusBar.navigationBackgroundColorByHexString(color);
}

View File

@ -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.');
}

View File

@ -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;

View File

@ -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);
}

View File

@ -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 (

View File

@ -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);

View File

@ -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;
};

View File

@ -105,6 +105,7 @@ export class CoreDirectivesRegistry {
* Get all directive instances and wait to be ready.
*
* @param element Root element.
* @param selector If defined, CSS Selector to wait for.
* @param directiveClass Directive class.
* @returns Promise resolved when done.
*/

View File

@ -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';

View File

@ -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);

View File

@ -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);