From 8e3da0a1083050bdda46c278e727b31225c6ffee Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pau=20Ferrer=20Oca=C3=B1a?= Date: Tue, 15 Dec 2020 10:27:16 +0100 Subject: [PATCH] MOBILE-3624 core: Fix migration linting problems --- gulpfile.js | 2 +- .../components/myoverview/myoverview.ts | 22 +++++++--------- .../addon-block-sitemainmenu.html | 5 +++- .../services/coursecompletion.ts | 12 ++++----- .../core-context-menu-popover.html | 6 +++-- .../show-password/show-password.scss | 2 +- .../pages/choose-site/choose-site.html | 18 ++++++++----- .../course-progress/course-progress.ts | 2 +- .../self-enrol-password.html | 24 +++++++++-------- .../pages/course-preview/course-preview.html | 2 +- .../emulator/services/capture-helper.ts | 2 +- .../services/fileuploader-helper.ts | 2 +- .../fileuploader/services/fileuploader.ts | 2 +- .../login/pages/credentials/credentials.html | 22 +++++++++------- .../forgotten-password.html | 12 +++++---- .../login/pages/reconnect/reconnect.html | 14 +++++----- src/core/features/login/pages/site/site.html | 6 ++++- .../features/mainmenu/pages/more/more.html | 6 ++--- .../search-box/core-search-box.html | 2 +- .../settings/pages/general/general.html | 8 +++--- .../features/settings/pages/site/site.html | 2 +- src/core/features/user/pages/about/about.html | 6 ++--- .../features/user/pages/profile/profile.html | 26 ++++++++++--------- src/core/services/utils/dom.ts | 2 +- 24 files changed, 117 insertions(+), 90 deletions(-) diff --git a/gulpfile.js b/gulpfile.js index ae1ef0a8c..739e799c2 100644 --- a/gulpfile.js +++ b/gulpfile.js @@ -41,5 +41,5 @@ gulp.task('push', (done) => { gulp.task('default', gulp.parallel('lang')); gulp.task('watch', () => { - gulp.watch(langsPaths, { interval: 500 }, gulp.parallel('lang')); + gulp.watch(paths.lang, { interval: 500 }, gulp.parallel('lang')); }); diff --git a/src/addons/block/myoverview/components/myoverview/myoverview.ts b/src/addons/block/myoverview/components/myoverview/myoverview.ts index 63a6956c8..c4b8eae72 100644 --- a/src/addons/block/myoverview/components/myoverview/myoverview.ts +++ b/src/addons/block/myoverview/components/myoverview/myoverview.ts @@ -231,7 +231,7 @@ export class AddonBlockMyOverviewComponent extends CoreBlockBaseComponent implem protected async fetchContent(): Promise { const config = this.block.configsRecord || {}; - const showCategories = config && config.displaycategories && config.displaycategories.value == '1'; + const showCategories = config?.displaycategories?.value == '1'; const courses = await CoreCoursesHelper.instance.getUserCoursesWithOptions(this.sort, undefined, undefined, showCategories); @@ -257,26 +257,26 @@ export class AddonBlockMyOverviewComponent extends CoreBlockBaseComponent implem this.showFilter = false; this.showFilters.all = this.getShowFilterValue( - !config || config.displaygroupingall.value == '1', + !config || config.displaygroupingall?.value == '1', this.courses.all.length === 0, ); // Do not show allincludinghiddenif config it's not present (before 3.8). this.showFilters.allincludinghidden = this.getShowFilterValue( - config.displaygroupingallincludinghidden.value == '1', + config?.displaygroupingallincludinghidden?.value == '1', this.courses.allincludinghidden.length === 0, ); this.showFilters.inprogress = this.getShowFilterValue( - !config || config.displaygroupinginprogress.value == '1', + !config || config.displaygroupinginprogress?.value == '1', this.courses.inprogress.length === 0, ); this.showFilters.past = this.getShowFilterValue( - !config || config.displaygroupingpast.value == '1', + !config || config.displaygroupingpast?.value == '1', this.courses.past.length === 0, ); this.showFilters.future = this.getShowFilterValue( - !config || config.displaygroupingfuture.value == '1', + !config || config.displaygroupingfuture?.value == '1', this.courses.future.length === 0, ); @@ -285,24 +285,22 @@ export class AddonBlockMyOverviewComponent extends CoreBlockBaseComponent implem this.showFilters.hidden = this.getShowFilterValue( this.showSelectorFilter && typeof courses[0].hidden != 'undefined' && - (!config || config.displaygroupinghidden.value == '1'), + (!config || config.displaygroupinghidden?.value == '1'), this.courses.hidden.length === 0, ); this.showFilters.favourite = this.getShowFilterValue( this.showSelectorFilter && typeof courses[0].isfavourite != 'undefined' && - (!config || (config.displaygroupingstarred && config.displaygroupingstarred.value == '1') || - (config.displaygroupingfavourites && config.displaygroupingfavourites.value == '1')), + (!config || config.displaygroupingstarred?.value == '1' || config.displaygroupingfavourites?.value == '1'), this.courses.favourite.length === 0, ); this.showFilters.custom = this.getShowFilterValue( - this.showSelectorFilter && config?.displaygroupingcustomfield.value == '1' && - !!config?.customfieldsexport && !!config?.customfieldsexport.value, + this.showSelectorFilter && config?.displaygroupingcustomfield?.value == '1' && !!config?.customfieldsexport?.value, false, ); if (this.showFilters.custom == 'show') { - this.customFilter = CoreTextUtils.instance.parseJSON(config.customfieldsexport.value, []); + this.customFilter = CoreTextUtils.instance.parseJSON(config?.customfieldsexport?.value, []); } else { this.customFilter = []; } diff --git a/src/addons/block/sitemainmenu/components/sitemainmenu/addon-block-sitemainmenu.html b/src/addons/block/sitemainmenu/components/sitemainmenu/addon-block-sitemainmenu.html index eceb7a099..a9e637d33 100644 --- a/src/addons/block/sitemainmenu/components/sitemainmenu/addon-block-sitemainmenu.html +++ b/src/addons/block/sitemainmenu/components/sitemainmenu/addon-block-sitemainmenu.html @@ -6,7 +6,10 @@ - + + + diff --git a/src/addons/coursecompletion/services/coursecompletion.ts b/src/addons/coursecompletion/services/coursecompletion.ts index 6dc4e6811..6ae4d2b92 100644 --- a/src/addons/coursecompletion/services/coursecompletion.ts +++ b/src/addons/coursecompletion/services/coursecompletion.ts @@ -103,7 +103,7 @@ export class AddonCourseCompletionProvider { userId = userId || site.getUserId(); this.logger.debug('Get completion for course ' + courseId + ' and user ' + userId); - const data: CoreCompletionGetCourseCompletionStatusWSParams = { + const data: AddonCourseCompletionGetCourseCompletionStatusWSParams = { courseid: courseId, userid: userId, }; @@ -112,7 +112,7 @@ export class AddonCourseCompletionProvider { preSets.updateFrequency = preSets.updateFrequency || CoreSite.FREQUENCY_SOMETIMES; preSets.cacheErrors = ['notenroled']; - const result: CoreCompletionGetCourseCompletionStatusWSResponse = + const result: AddonCourseCompletionGetCourseCompletionStatusWSResponse = await site.read('core_completion_get_course_completion_status', data, preSets); if (result.completionstatus) { return result.completionstatus; @@ -253,7 +253,7 @@ export class AddonCourseCompletionProvider { async markCourseAsSelfCompleted(courseId: number, siteId?: string): Promise { const site = await CoreSites.instance.getSite(siteId); - const params: CoreCompletionMarkCourseSelfCompletedWSParams = { + const params: AddonCourseCompletionMarkCourseSelfCompletedWSParams = { courseid: courseId, }; @@ -292,7 +292,7 @@ export type AddonCourseCompletionCourseCompletionStatus = { /** * Params of core_completion_get_course_completion_status WS. */ -export type CoreCompletionGetCourseCompletionStatusWSParams = { +export type AddonCourseCompletionGetCourseCompletionStatusWSParams = { courseid: number; // Course ID. userid: number; // User ID. }; @@ -300,7 +300,7 @@ export type CoreCompletionGetCourseCompletionStatusWSParams = { /** * Data returned by core_completion_get_course_completion_status WS. */ -export type CoreCompletionGetCourseCompletionStatusWSResponse = { +export type AddonCourseCompletionGetCourseCompletionStatusWSResponse = { completionstatus: AddonCourseCompletionCourseCompletionStatus; // Course status. warnings?: CoreWSExternalWarning[]; }; @@ -308,6 +308,6 @@ export type CoreCompletionGetCourseCompletionStatusWSResponse = { /** * Params of core_completion_mark_course_self_completed WS. */ -export type CoreCompletionMarkCourseSelfCompletedWSParams = { +export type AddonCourseCompletionMarkCourseSelfCompletedWSParams = { courseid: number; // Course ID. }; diff --git a/src/core/components/context-menu/core-context-menu-popover.html b/src/core/components/context-menu/core-context-menu-popover.html index 36cfcacdd..971d6a9ef 100644 --- a/src/core/components/context-menu/core-context-menu-popover.html +++ b/src/core/components/context-menu/core-context-menu-popover.html @@ -1,11 +1,13 @@ - {{title}} + + {{title}} + - + diff --git a/src/core/components/show-password/show-password.scss b/src/core/components/show-password/show-password.scss index 1f98c810c..a0960f099 100644 --- a/src/core/components/show-password/show-password.scss +++ b/src/core/components/show-password/show-password.scss @@ -6,7 +6,7 @@ padding: 0 calc(var(--padding-start) / 2); position: absolute; right: 0; - bottom: calc(var(--padding-bottom) / 2); + bottom: 8px; margin-top: 0; margin-bottom: 0; z-index: 3; diff --git a/src/core/features/contentlinks/pages/choose-site/choose-site.html b/src/core/features/contentlinks/pages/choose-site/choose-site.html index c88916023..488670d69 100644 --- a/src/core/features/contentlinks/pages/choose-site/choose-site.html +++ b/src/core/features/contentlinks/pages/choose-site/choose-site.html @@ -10,8 +10,10 @@ -

{{ 'core.contentlinks.chooseaccounttoopenlink' | translate }}

-

{{ url }}

+ +

{{ 'core.contentlinks.chooseaccounttoopenlink' | translate }}

+

{{ url }}

+
@@ -19,12 +21,16 @@ alt="{{ 'core.pictureof' | translate:{$a: site.fullName} }}" role="presentation" onError="this.src='assets/img/user-avatar.png'"> -

{{site.fullName}}

-

-

{{site.siteUrl}}

+ +

{{site.fullName}}

+

+

{{site.siteUrl}}

+
- {{ 'core.login.cancel' | translate }} + + {{ 'core.login.cancel' | translate }} +
diff --git a/src/core/features/courses/components/course-progress/course-progress.ts b/src/core/features/courses/components/course-progress/course-progress.ts index 057156451..54f9755fd 100644 --- a/src/core/features/courses/components/course-progress/course-progress.ts +++ b/src/core/features/courses/components/course-progress/course-progress.ts @@ -213,7 +213,7 @@ export class CoreCoursesCourseProgressComponent implements OnInit, OnDestroy { }, event: e, }); - popover.present(); + await popover.present(); const action = await popover.onDidDismiss(); diff --git a/src/core/features/courses/components/self-enrol-password/self-enrol-password.html b/src/core/features/courses/components/self-enrol-password/self-enrol-password.html index 3012c1939..ee4c213f3 100644 --- a/src/core/features/courses/components/self-enrol-password/self-enrol-password.html +++ b/src/core/features/courses/components/self-enrol-password/self-enrol-password.html @@ -15,17 +15,19 @@
- - - - + + + + + +
{{ 'core.courses.enrolme' | translate }} diff --git a/src/core/features/courses/pages/course-preview/course-preview.html b/src/core/features/courses/pages/course-preview/course-preview.html index 0baa7286b..4f2a6a09a 100644 --- a/src/core/features/courses/pages/course-preview/course-preview.html +++ b/src/core/features/courses/pages/course-preview/course-preview.html @@ -52,7 +52,7 @@

{{contact.fullname}}

- + diff --git a/src/core/features/emulator/services/capture-helper.ts b/src/core/features/emulator/services/capture-helper.ts index d282ae4d6..7b9079727 100644 --- a/src/core/features/emulator/services/capture-helper.ts +++ b/src/core/features/emulator/services/capture-helper.ts @@ -107,7 +107,7 @@ export class CoreEmulatorCaptureHelperProvider { componentProps: params, }); - modal.present(); + await modal.present(); const result = await modal.onDidDismiss(); diff --git a/src/core/features/fileuploader/services/fileuploader-helper.ts b/src/core/features/fileuploader/services/fileuploader-helper.ts index 36d2924ec..a303ee0bd 100644 --- a/src/core/features/fileuploader/services/fileuploader-helper.ts +++ b/src/core/features/fileuploader/services/fileuploader-helper.ts @@ -420,7 +420,7 @@ export class CoreFileUploaderHelperProvider { header: title ? title : Translate.instance.instant('core.fileuploader.' + (upload ? 'uploadafile' : 'selectafile')), buttons: buttons, }); - this.actionSheet.present(); + await this.actionSheet.present(); // Call afterRender for each button. setTimeout(() => { diff --git a/src/core/features/fileuploader/services/fileuploader.ts b/src/core/features/fileuploader/services/fileuploader.ts index 58dfa0e7e..6cbc4bb91 100644 --- a/src/core/features/fileuploader/services/fileuploader.ts +++ b/src/core/features/fileuploader/services/fileuploader.ts @@ -130,7 +130,7 @@ export class CoreFileUploaderProvider { backdropDismiss: false, }); - modal.present(); + await modal.present(); const result = await modal.onWillDismiss(); diff --git a/src/core/features/login/pages/credentials/credentials.html b/src/core/features/login/pages/credentials/credentials.html index 3ba70db0b..498b4f7ec 100644 --- a/src/core/features/login/pages/credentials/credentials.html +++ b/src/core/features/login/pages/credentials/credentials.html @@ -31,17 +31,21 @@ - + + + - - - - + + + + + + - - - - + + + + + + diff --git a/src/core/features/login/pages/site/site.html b/src/core/features/login/pages/site/site.html index 29def2140..51d15e67d 100644 --- a/src/core/features/login/pages/site/site.html +++ b/src/core/features/login/pages/site/site.html @@ -74,7 +74,11 @@ - {{ 'core.login.connect' | translate }} + + + {{ 'core.login.connect' | translate }} + + diff --git a/src/core/features/mainmenu/pages/more/more.html b/src/core/features/mainmenu/pages/more/more.html index aba57a084..20a7eb21b 100644 --- a/src/core/features/mainmenu/pages/more/more.html +++ b/src/core/features/mainmenu/pages/more/more.html @@ -20,9 +20,9 @@

{{ siteUrl }}

- + - + @@ -83,7 +83,7 @@

{{ logoutLabel | translate }}

- + diff --git a/src/core/features/search/components/search-box/core-search-box.html b/src/core/features/search/components/search-box/core-search-box.html index e8f4b3aa5..70b6e55da 100644 --- a/src/core/features/search/components/search-box/core-search-box.html +++ b/src/core/features/search/components/search-box/core-search-box.html @@ -21,7 +21,7 @@ (click)="historyClicked($event, item.searchedtext)" tabindex="1" detail> - {{item.searchedtext}} + {{item.searchedtext}} diff --git a/src/core/features/settings/pages/general/general.html b/src/core/features/settings/pages/general/general.html index 141186cd4..9f1b8ccab 100644 --- a/src/core/features/settings/pages/general/general.html +++ b/src/core/features/settings/pages/general/general.html @@ -24,9 +24,11 @@ - {{ 'core.settings.fontsizecharacter' | translate }} - - + + {{ 'core.settings.fontsizecharacter' | translate }} + + + diff --git a/src/core/features/settings/pages/site/site.html b/src/core/features/settings/pages/site/site.html index b20ac3539..aafde72c6 100644 --- a/src/core/features/settings/pages/site/site.html +++ b/src/core/features/settings/pages/site/site.html @@ -24,7 +24,7 @@

{{ siteUrl }}

- + - {{ 'core.user.contact' | translate}} + {{ 'core.user.contact' | translate}}

{{ 'core.user.email' | translate }}

@@ -60,7 +60,7 @@
- {{ 'core.userdetails' | translate}} + {{ 'core.userdetails' | translate}}

{{ 'core.user.webpage' | translate}}

@@ -80,7 +80,7 @@
- {{ 'core.user.description' | translate}} + {{ 'core.user.description' | translate}}

diff --git a/src/core/features/user/pages/profile/profile.html b/src/core/features/user/pages/profile/profile.html index 0b1befa4f..256ce3568 100644 --- a/src/core/features/user/pages/profile/profile.html +++ b/src/core/features/user/pages/profile/profile.html @@ -34,7 +34,7 @@ -

{{handler.title | translate}}

@@ -56,11 +56,11 @@
- + @@ -69,15 +69,17 @@ - - - - {{ handler.title | translate }} - - - + + + + + {{ handler.title | translate }} + + + +
diff --git a/src/core/services/utils/dom.ts b/src/core/services/utils/dom.ts index cff84e7d1..9e9db3227 100644 --- a/src/core/services/utils/dom.ts +++ b/src/core/services/utils/dom.ts @@ -1574,7 +1574,7 @@ export class CoreDomUtilsProvider { cssClass: cssClass, }); - loader.present(); + await loader.present(); return loader; }