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