diff --git a/src/addon/mod/glossary/components/index/index.ts b/src/addon/mod/glossary/components/index/index.ts index cb19029fa..618b642ca 100644 --- a/src/addon/mod/glossary/components/index/index.ts +++ b/src/addon/mod/glossary/components/index/index.ts @@ -229,7 +229,7 @@ export class AddonModGlossaryIndexComponent extends CoreCourseModuleMainActivity this.fetchArguments = [this.glossary.id, 'ALL', 'LASTNAME', 'ASC']; this.getDivider = (entry: any): string => entry.userfullname; this.showDivider = (entry: any, previous?: any): boolean => { - return previous === 'undefined' || entry.userid != previous.userid; + return typeof previous === 'undefined' || entry.userid != previous.userid; }; break; case 'cat_all': diff --git a/src/addon/mod/glossary/pages/entry/entry.html b/src/addon/mod/glossary/pages/entry/entry.html index 5bccd5f20..117741895 100644 --- a/src/addon/mod/glossary/pages/entry/entry.html +++ b/src/addon/mod/glossary/pages/entry/entry.html @@ -1,9 +1,6 @@ - - - diff --git a/src/addon/mod/glossary/providers/glossary.ts b/src/addon/mod/glossary/providers/glossary.ts index 02482f0e9..943e91532 100644 --- a/src/addon/mod/glossary/providers/glossary.ts +++ b/src/addon/mod/glossary/providers/glossary.ts @@ -609,7 +609,7 @@ export class AddonModGlossaryProvider { /** * Invalidate the prefetched content for a given glossary, except files. - * To invalidate files, use $mmaModGlossary#invalidateFiles. + * To invalidate files, use AddonModGlossaryProvider#invalidateFiles. * * @param {any} glossary The glossary object. * @param {boolean} [onlyEntriesList] If true, entries won't be invalidated. @@ -705,7 +705,8 @@ export class AddonModGlossaryProvider { * @param {string} definition Glossary entry concept definition. * @param {number} courseId Course ID of the glossary. * @param {any} [options] Array of options for the entry. - * @param {any} [attach] Attachments ID if sending online, result of $mmFileUploader#storeFilesToUpload otherwise. + * @param {any} [attach] Attachments ID if sending online, result of CoreFileUploaderProvider#storeFilesToUpload + * otherwise. * @param {number} [timeCreated] The time the entry was created. If not defined, current time. * @param {string} [siteId] Site ID. If not defined, current site. * @param {any} [discardEntry] The entry provided will be discarded if found. diff --git a/src/addon/mod/glossary/providers/helper.ts b/src/addon/mod/glossary/providers/helper.ts index 55a36960b..d4cf592b1 100644 --- a/src/addon/mod/glossary/providers/helper.ts +++ b/src/addon/mod/glossary/providers/helper.ts @@ -39,7 +39,7 @@ export class AddonModGlossaryHelperProvider { */ deleteStoredFiles(glossaryId: number, entryName: string, timeCreated: number, siteId?: string): Promise { return this.glossaryOffline.getEntryFolder(glossaryId, entryName, timeCreated, siteId).then((folderPath) => { - this.fileProvider.removeDir(folderPath).catch(() => { + return this.fileProvider.removeDir(folderPath).catch(() => { // Ignore any errors, CoreFileProvider.removeDir fails if folder doesn't exists. }); }); diff --git a/src/addon/mod/glossary/providers/prefetch-handler.ts b/src/addon/mod/glossary/providers/prefetch-handler.ts index 16e088851..dc3dcad35 100644 --- a/src/addon/mod/glossary/providers/prefetch-handler.ts +++ b/src/addon/mod/glossary/providers/prefetch-handler.ts @@ -16,7 +16,6 @@ import { Injectable, Injector } from '@angular/core'; import { CoreCourseModulePrefetchHandlerBase } from '@core/course/classes/module-prefetch-handler'; import { CoreUserProvider } from '@core/user/providers/user'; import { AddonModGlossaryProvider } from './glossary'; -import { CoreConstants } from '@core/constants'; /** * Handler to prefetch forums. @@ -34,25 +33,6 @@ export class AddonModGlossaryPrefetchHandler extends CoreCourseModulePrefetchHan super(injector); } - /** - * Return the status to show based on current status. E.g. a module might want to show outdated instead of downloaded. - * If not implemented, the original status will be returned. - * - * @param {any} module Module. - * @param {string} status The current status. - * @param {boolean} canCheck Whether the site allows checking for updates. - * @return {string} Status to display. - */ - determineStatus(module: any, status: string, canCheck: boolean): string { - if (!canCheck && status === CoreConstants.DOWNLOADED) { - /* Glossary are always marked as outdated if updates cannot be checked because we can't tell if there's something - new without having to call all the WebServices. */ - return CoreConstants.OUTDATED; - } else { - return status; - } - } - /** * Download the module. * diff --git a/src/addon/mod/glossary/providers/sync.ts b/src/addon/mod/glossary/providers/sync.ts index ea509a690..aa82f859a 100644 --- a/src/addon/mod/glossary/providers/sync.ts +++ b/src/addon/mod/glossary/providers/sync.ts @@ -49,7 +49,7 @@ export class AddonModGlossarySyncProvider extends CoreSyncBaseProvider { textUtils: CoreTextUtilsProvider, private uploaderProvider: CoreFileUploaderProvider, private utils: CoreUtilsProvider, - private glossaruProvider: AddonModGlossaryProvider, + private glossaryProvider: AddonModGlossaryProvider, private glossaryHelper: AddonModGlossaryHelperProvider, private glossaryOffline: AddonModGlossaryOfflineProvider) { @@ -181,7 +181,7 @@ export class AddonModGlossarySyncProvider extends CoreSyncBaseProvider { // First of all upload the attachments (if any). promise = this.uploadAttachments(glossaryId, data, siteId).then((itemId) => { // Now try to add the entry. - return this.glossaruProvider.addEntryOnline( + return this.glossaryProvider.addEntryOnline( glossaryId, data.concept, data.definition, data.options, itemId, siteId); }); @@ -213,8 +213,8 @@ export class AddonModGlossarySyncProvider extends CoreSyncBaseProvider { }).then(() => { if (result.updated && courseId) { // Data has been sent to server. Now invalidate the WS calls. - return this.glossaruProvider.getGlossaryById(courseId, glossaryId).then((glossary) => { - return this.glossaruProvider.invalidateGlossaryEntries(glossary, true); + return this.glossaryProvider.getGlossaryById(courseId, glossaryId).then((glossary) => { + return this.glossaryProvider.invalidateGlossaryEntries(glossary, true); }).catch(() => { // Ignore errors. });