MOBILE-3660 core: Remove and mark some unused params

main
Pau Ferrer Ocaña 2021-02-04 14:39:32 +01:00
parent 1d39a3ed28
commit 66f64c02dc
8 changed files with 15 additions and 29 deletions

View File

@ -34,7 +34,6 @@ import { IonRefresher } from '@ionic/angular';
@Component({
selector: 'page-addon-messages-settings',
templateUrl: 'settings.html',
styleUrls: ['settings.scss'],
})
export class AddonMessagesSettingsPage implements OnInit, OnDestroy {

View File

@ -1,10 +0,0 @@
:host {
.list-header {
margin-bottom: 0;
border-top: 0;
}
.toggle {
display: inline-block;
}
}

View File

@ -13,7 +13,6 @@
// limitations under the License.
import { Injectable } from '@angular/core';
import { NavController } from '@ionic/angular';
import { CoreSites } from '@services/sites';
import { CoreDomUtils } from '@services/utils/dom';
import { CoreContentLinksDelegate, CoreContentLinksAction } from './contentlinks-delegate';
@ -83,6 +82,7 @@ export class CoreContentLinksHelperProvider {
* Goes to a certain page in a certain site. If the site is current site it will perform a regular navigation,
* otherwise it will 'redirect' to the other site.
*
* @param navCtrlUnused Deprecated param.
* @param pageName Name of the page to go.
* @param pageParams Params to send to the page.
* @param siteId Site ID. If not defined, current site.
@ -90,7 +90,7 @@ export class CoreContentLinksHelperProvider {
* @return Promise resolved when done.
* @deprecated since 3.9.5. Use CoreNavigator.navigateToSitePath instead.
*/
async goInSite(navCtrl: NavController, pageName: string, pageParams: Params, siteId?: string): Promise<void> {
async goInSite(navCtrlUnused: unknown, pageName: string, pageParams: Params, siteId?: string): Promise<void> {
await CoreNavigator.instance.navigateToSitePath(pageName, { params: pageParams, siteId });
}

View File

@ -223,7 +223,8 @@ export class CoreCourseModuleMainResourceComponent implements OnInit, OnDestroy,
* Go to blog posts.
*/
async gotoBlog(): Promise<void> {
// @todo return this.linkHelper.goInSite(this.navCtrl, 'AddonBlogEntriesPage', { cmId: this.module.id });
// const params: Params = { cmId: this.module?.id };
// @todo return CoreNavigator.instance.navigateToSitePath('AddonBlogEntriesPage', { params });
}
/**

View File

@ -13,7 +13,6 @@
// limitations under the License.
import { Injectable } from '@angular/core';
import { NavController } from '@ionic/angular';
import { CoreLogger } from '@singletons/logger';
import { CoreSites, CoreSitesReadingStrategy } from '@services/sites';
@ -440,7 +439,6 @@ export class CoreGradesHelperProvider {
* @param courseId Course ID to view.
* @param userId User to view. If not defined, current user.
* @param moduleId Module to view. If not defined, view all course grades.
* @param navCtrl NavController to use.
* @param siteId Site ID. If not defined, current site.
* @return Promise resolved when done.
*/
@ -448,11 +446,10 @@ export class CoreGradesHelperProvider {
courseId: number,
userId?: number,
moduleId?: number,
navCtrl?: NavController,
siteId?: string,
): Promise<void> {
const modal = await CoreDomUtils.instance.showModalLoading();
let currentUserId;
let currentUserId: number;
try {
const site = await CoreSites.instance.getSite(siteId);
@ -504,7 +501,7 @@ export class CoreGradesHelperProvider {
}
// View own grades. Check if we already are in the course index page.
if (CoreCourse.instance.currentViewIsCourse(navCtrl, courseId)) {
if (CoreCourse.instance.currentViewIsCourse(courseId)) {
// Current view is this course, just select the grades tab.
CoreCourse.instance.selectCourseTab('CoreGrades');

View File

@ -50,11 +50,11 @@ export class CoreGradesUserLinkHandlerService extends CoreContentLinksHandlerBas
data = data || {};
return [{
action: (siteId, navCtrl?): void => {
action: (siteId): void => {
const userId = params.userid && parseInt(params.userid, 10);
const moduleId = data?.cmid && parseInt(data.cmid, 10) || undefined;
CoreGradesHelper.instance.goToGrades(courseId!, userId, moduleId, navCtrl, siteId);
CoreGradesHelper.instance.goToGrades(courseId!, userId, moduleId, siteId);
},
}];
}

View File

@ -14,7 +14,6 @@
import { Injectable } from '@angular/core';
import { Params } from '@angular/router';
import { NavController } from '@ionic/angular';
import { Md5 } from 'ts-md5/dist/md5';
import { CoreApp, CoreStoreConfig } from '@services/app';
@ -447,7 +446,7 @@ export class CoreLoginHelperProvider {
/**
* Go to the initial page of a site depending on 'userhomepage' setting.
*
* @param navCtrl NavController to use. Defaults to app root NavController.
* @param navCtrlUnused Deprecated param.
* @param page Name of the page to load after loading the main page.
* @param params Params to pass to the page.
* @param options Navigation options.
@ -456,7 +455,7 @@ export class CoreLoginHelperProvider {
* @deprecated since 3.9.5. Use CoreNavigator.navigateToSiteHome or CoreNavigator.navigateToSitePath instead.
*/
// eslint-disable-next-line @typescript-eslint/no-explicit-any
async goToSiteInitialPage(navCtrl?: NavController, page?: string, params?: any, options?: any, url?: string): Promise<void> {
async goToSiteInitialPage(navCtrlUnused?: unknown, page?: string, params?: any, options?: any, url?: string): Promise<void> {
await CoreNavigator.instance.navigateToSiteHome({
...options,
params: {

View File

@ -12,6 +12,7 @@
// See the License for the specific language governing permissions and
// limitations under the License.
import { CoreContentLinksHelper } from '@features/contentlinks/services/contentlinks-helper';
import { NavController } from '@ionic/angular';
import { CoreFileHelper } from '@services/file-helper';
@ -21,6 +22,8 @@ import { CoreUtils } from '@services/utils/utils';
/**
* Options for the open function.
*
* @deprecated since 3.9.5
*/
export type CoreWindowOpenOptions = {
/**
@ -46,10 +49,9 @@ export class CoreWindow {
*
* @param url URL to open.
* @param name Name of the browsing context into which to load the URL.
* @param options Other options.
* @return Promise resolved when done.
*/
static async open(url: string, name?: string, options?: CoreWindowOpenOptions): Promise<void> {
static async open(url: string, name?: string): Promise<void> {
if (CoreUrlUtils.instance.isLocalFileUrl(url)) {
const filename = url.substr(url.lastIndexOf('/') + 1);
@ -64,13 +66,11 @@ export class CoreWindow {
await CoreUtils.instance.openFile(url);
} else {
let treated = false;
// eslint-disable-next-line @typescript-eslint/no-unused-vars
options = options || {};
if (name != '_system') {
// Check if it can be opened in the app.
treated = false;
// @todo await CoreContentLinksHelper.instance.handleLink(url, undefined, options.navCtrl, true, true);
await CoreContentLinksHelper.instance.handleLink(url, undefined, true, true);
}
if (!treated) {