MOBILE-3637 core: Unify refresh and sync icons

main
Pau Ferrer Ocaña 2021-02-08 14:50:09 +01:00
parent c98fa810fa
commit d3e8b96946
14 changed files with 75 additions and 66 deletions

View File

@ -40,6 +40,7 @@ import { CoreNavigator } from '@services/navigator';
import { Params } from '@angular/router'; import { Params } from '@angular/router';
import { Subscription } from 'rxjs'; import { Subscription } from 'rxjs';
import { CoreUtils } from '@services/utils/utils'; import { CoreUtils } from '@services/utils/utils';
import { CoreConstants } from '@/core/constants';
/** /**
* Page that displays the calendar events for a certain day. * Page that displays the calendar events for a certain day.
@ -85,7 +86,7 @@ export class AddonCalendarDayPage implements OnInit, OnDestroy {
loaded = false; loaded = false;
hasOffline = false; hasOffline = false;
isOnline = false; isOnline = false;
syncIcon = 'spinner'; syncIcon = CoreConstants.ICON_LOADING;
isCurrentDay = false; isCurrentDay = false;
isPastDay = false; isPastDay = false;
currentMoment!: moment.Moment; currentMoment!: moment.Moment;
@ -260,7 +261,7 @@ export class AddonCalendarDayPage implements OnInit, OnDestroy {
*/ */
async fetchData(sync?: boolean): Promise<void> { async fetchData(sync?: boolean): Promise<void> {
this.syncIcon = 'spinner'; this.syncIcon = CoreConstants.ICON_LOADING;
this.isOnline = CoreApp.instance.isOnline(); this.isOnline = CoreApp.instance.isOnline();
if (sync) { if (sync) {
@ -320,7 +321,7 @@ export class AddonCalendarDayPage implements OnInit, OnDestroy {
} }
this.loaded = true; this.loaded = true;
this.syncIcon = 'fas-sync-alt'; this.syncIcon = CoreConstants.ICON_SYNC;
} }
/** /**
@ -450,7 +451,7 @@ export class AddonCalendarDayPage implements OnInit, OnDestroy {
* @return Promise resolved when done. * @return Promise resolved when done.
*/ */
async refreshData(sync?: boolean, afterChange?: boolean): Promise<void> { async refreshData(sync?: boolean, afterChange?: boolean): Promise<void> {
this.syncIcon = 'spinner'; this.syncIcon = CoreConstants.ICON_LOADING;
const promises: Promise<void>[] = []; const promises: Promise<void>[] = [];

View File

@ -45,6 +45,7 @@ import { CoreUtils } from '@services/utils/utils';
import { AddonCalendarReminderDBRecord } from '../../services/database/calendar'; import { AddonCalendarReminderDBRecord } from '../../services/database/calendar';
import { ActivatedRoute } from '@angular/router'; import { ActivatedRoute } from '@angular/router';
import { CoreScreen } from '@services/screen'; import { CoreScreen } from '@services/screen';
import { CoreConstants } from '@/core/constants';
/** /**
* Page that displays a single calendar event. * Page that displays a single calendar event.
@ -84,7 +85,7 @@ export class AddonCalendarEventPage implements OnInit, OnDestroy {
canDelete = false; canDelete = false;
hasOffline = false; hasOffline = false;
isOnline = false; isOnline = false;
syncIcon = 'spinner'; // Sync icon. syncIcon = CoreConstants.ICON_LOADING; // Sync icon.
isSplitViewOn = false; isSplitViewOn = false;
constructor( constructor(
@ -163,7 +164,7 @@ export class AddonCalendarEventPage implements OnInit, OnDestroy {
} }
this.eventId = eventId; this.eventId = eventId;
this.syncIcon = 'spinner'; this.syncIcon = CoreConstants.ICON_LOADING;
this.fetchEvent(); this.fetchEvent();
}); });
@ -338,7 +339,7 @@ export class AddonCalendarEventPage implements OnInit, OnDestroy {
} }
this.eventLoaded = true; this.eventLoaded = true;
this.syncIcon = 'fas-sync-alt'; this.syncIcon = CoreConstants.ICON_SYNC;
} }
/** /**
@ -417,7 +418,7 @@ export class AddonCalendarEventPage implements OnInit, OnDestroy {
* @return Promise resolved when done. * @return Promise resolved when done.
*/ */
async refreshEvent(sync = false, showErrors = false): Promise<void> { async refreshEvent(sync = false, showErrors = false): Promise<void> {
this.syncIcon = 'spinner'; this.syncIcon = CoreConstants.ICON_LOADING;
const promises: Promise<void>[] = []; const promises: Promise<void>[] = [];

View File

@ -32,6 +32,7 @@ import { AddonCalendarUpcomingEventsComponent } from '../../components/upcoming-
import { AddonCalendarFilterPopoverComponent } from '../../components/filter/filter'; import { AddonCalendarFilterPopoverComponent } from '../../components/filter/filter';
import { CoreNavigator } from '@services/navigator'; import { CoreNavigator } from '@services/navigator';
import { CoreLocalNotifications } from '@services/local-notifications'; import { CoreLocalNotifications } from '@services/local-notifications';
import { CoreConstants } from '@/core/constants';
/** /**
@ -68,7 +69,7 @@ export class AddonCalendarIndexPage implements OnInit, OnDestroy {
loaded = false; loaded = false;
hasOffline = false; hasOffline = false;
isOnline = false; isOnline = false;
syncIcon = 'spinner'; syncIcon = CoreConstants.ICON_LOADING;
showCalendar = true; showCalendar = true;
loadUpcoming = false; loadUpcoming = false;
filter: AddonCalendarFilter = { filter: AddonCalendarFilter = {
@ -194,7 +195,7 @@ export class AddonCalendarIndexPage implements OnInit, OnDestroy {
*/ */
async fetchData(sync?: boolean, showErrors?: boolean): Promise<void> { async fetchData(sync?: boolean, showErrors?: boolean): Promise<void> {
this.syncIcon = 'spinner'; this.syncIcon = CoreConstants.ICON_LOADING;
this.isOnline = CoreApp.instance.isOnline(); this.isOnline = CoreApp.instance.isOnline();
if (sync) { if (sync) {
@ -254,7 +255,7 @@ export class AddonCalendarIndexPage implements OnInit, OnDestroy {
} }
this.loaded = true; this.loaded = true;
this.syncIcon = 'fas-sync-alt'; this.syncIcon = CoreConstants.ICON_SYNC;
} }
/** /**
@ -285,7 +286,7 @@ export class AddonCalendarIndexPage implements OnInit, OnDestroy {
* @return Promise resolved when done. * @return Promise resolved when done.
*/ */
async refreshData(sync = false, showErrors = false): Promise<void> { async refreshData(sync = false, showErrors = false): Promise<void> {
this.syncIcon = 'spinner'; this.syncIcon = CoreConstants.ICON_LOADING;
const promises: Promise<void>[] = []; const promises: Promise<void>[] = [];

View File

@ -89,7 +89,7 @@ export class AddonCalendarListPage implements OnInit, OnDestroy {
canCreate = false; canCreate = false;
hasOffline = false; hasOffline = false;
isOnline = false; isOnline = false;
syncIcon = 'spinner'; syncIcon = CoreConstants.ICON_LOADING;
filter: AddonCalendarFilter = { filter: AddonCalendarFilter = {
filtered: false, filtered: false,
courseId: -1, courseId: -1,
@ -251,7 +251,7 @@ export class AddonCalendarListPage implements OnInit, OnDestroy {
this.gotoEvent(this.eventId); this.gotoEvent(this.eventId);
} }
this.syncIcon = 'spinner'; this.syncIcon = CoreConstants.ICON_LOADING;
await this.fetchData(false, true, false); await this.fetchData(false, true, false);
@ -361,7 +361,7 @@ export class AddonCalendarListPage implements OnInit, OnDestroy {
} }
this.eventsLoaded = true; this.eventsLoaded = true;
this.syncIcon = 'fas-sync-alt'; this.syncIcon = CoreConstants.ICON_SYNC;
} }
/** /**
@ -567,7 +567,7 @@ export class AddonCalendarListPage implements OnInit, OnDestroy {
* @return Promise resolved when done. * @return Promise resolved when done.
*/ */
async refreshEvents(sync?: boolean, showErrors?: boolean): Promise<void> { async refreshEvents(sync?: boolean, showErrors?: boolean): Promise<void> {
this.syncIcon = 'spinner'; this.syncIcon = CoreConstants.ICON_LOADING;
const promises: Promise<void>[] = []; const promises: Promise<void>[] = [];

View File

@ -49,6 +49,7 @@ import { CoreNavigator } from '@services/navigator';
import { CoreIonLoadingElement } from '@classes/ion-loading'; import { CoreIonLoadingElement } from '@classes/ion-loading';
import { ActivatedRoute } from '@angular/router'; import { ActivatedRoute } from '@angular/router';
import { AddonMessagesConversationInfoComponent } from '../../components/conversation-info/conversation-info'; import { AddonMessagesConversationInfoComponent } from '../../components/conversation-info/conversation-info';
import { CoreConstants } from '@/core/constants';
/** /**
* Page that displays a message discussion page. * Page that displays a message discussion page.
@ -1352,7 +1353,7 @@ export class AddonMessagesDiscussionPage implements OnInit, OnDestroy, AfterView
return; return;
} }
this.favouriteIcon = 'spinner'; this.favouriteIcon = CoreConstants.ICON_LOADING;
try { try {
await AddonMessages.instance.setFavouriteConversation(this.conversation.id, !this.conversation.isfavourite); await AddonMessages.instance.setFavouriteConversation(this.conversation.id, !this.conversation.isfavourite);
@ -1386,7 +1387,7 @@ export class AddonMessagesDiscussionPage implements OnInit, OnDestroy, AfterView
return; return;
} }
this.muteIcon = 'spinner'; this.muteIcon = CoreConstants.ICON_LOADING;
try { try {
await AddonMessages.instance.muteConversation(this.conversation.id, !this.conversation.ismuted); await AddonMessages.instance.muteConversation(this.conversation.id, !this.conversation.ismuted);
@ -1461,7 +1462,7 @@ export class AddonMessagesDiscussionPage implements OnInit, OnDestroy, AfterView
try { try {
await CoreDomUtils.instance.showConfirm(template, undefined, okText); await CoreDomUtils.instance.showConfirm(template, undefined, okText);
this.blockIcon = 'spinner'; this.blockIcon = CoreConstants.ICON_LOADING;
const modal = await CoreDomUtils.instance.showModalLoading('core.sending', true); const modal = await CoreDomUtils.instance.showModalLoading('core.sending', true);
this.showLoadingModal = true; this.showLoadingModal = true;
@ -1497,7 +1498,7 @@ export class AddonMessagesDiscussionPage implements OnInit, OnDestroy, AfterView
try { try {
await CoreDomUtils.instance.showDeleteConfirm(confirmMessage); await CoreDomUtils.instance.showDeleteConfirm(confirmMessage);
this.deleteIcon = 'spinner'; this.deleteIcon = CoreConstants.ICON_LOADING;
try { try {
try { try {
@ -1543,7 +1544,7 @@ export class AddonMessagesDiscussionPage implements OnInit, OnDestroy, AfterView
try { try {
await CoreDomUtils.instance.showConfirm(template, undefined, okText); await CoreDomUtils.instance.showConfirm(template, undefined, okText);
this.blockIcon = 'spinner'; this.blockIcon = CoreConstants.ICON_LOADING;
const modal = await CoreDomUtils.instance.showModalLoading('core.sending', true); const modal = await CoreDomUtils.instance.showModalLoading('core.sending', true);
this.showLoadingModal = true; this.showLoadingModal = true;
@ -1582,7 +1583,7 @@ export class AddonMessagesDiscussionPage implements OnInit, OnDestroy, AfterView
try { try {
await CoreDomUtils.instance.showConfirm(template, undefined, okText); await CoreDomUtils.instance.showConfirm(template, undefined, okText);
this.addRemoveIcon = 'spinner'; this.addRemoveIcon = CoreConstants.ICON_LOADING;
const modal = await CoreDomUtils.instance.showModalLoading('core.sending', true); const modal = await CoreDomUtils.instance.showModalLoading('core.sending', true);
this.showLoadingModal = true; this.showLoadingModal = true;
@ -1673,7 +1674,7 @@ export class AddonMessagesDiscussionPage implements OnInit, OnDestroy, AfterView
try { try {
await CoreDomUtils.instance.showConfirm(template, undefined, okText); await CoreDomUtils.instance.showConfirm(template, undefined, okText);
this.addRemoveIcon = 'spinner'; this.addRemoveIcon = CoreConstants.ICON_LOADING;
const modal = await CoreDomUtils.instance.showModalLoading('core.sending', true); const modal = await CoreDomUtils.instance.showModalLoading('core.sending', true);
this.showLoadingModal = true; this.showLoadingModal = true;

View File

@ -20,7 +20,7 @@
[iconAction]="prefetchStatusIcon" [closeOnClick]="false"> [iconAction]="prefetchStatusIcon" [closeOnClick]="false">
</core-context-menu-item> </core-context-menu-item>
<core-context-menu-item *ngIf="size" [priority]="400" [content]="'core.clearstoreddata' | translate:{$a: size}" <core-context-menu-item *ngIf="size" [priority]="400" [content]="'core.clearstoreddata' | translate:{$a: size}"
iconDescription="fas-cube" (action)="removeFiles($event)" iconAction="fas-trash" [closeOnClick]="false"> iconDescription="fas-archive" (action)="removeFiles($event)" iconAction="fas-trash" [closeOnClick]="false">
</core-context-menu-item> </core-context-menu-item>
</core-context-menu> </core-context-menu>
</core-navbar-buttons> </core-navbar-buttons>

View File

@ -624,8 +624,8 @@ export class AddonModLessonIndexComponent extends CoreCourseModuleMainActivityCo
} }
this.loaded = false; this.loaded = false;
this.refreshIcon = 'spinner'; this.refreshIcon = CoreConstants.ICON_LOADING;
this.syncIcon = 'spinner'; this.syncIcon = CoreConstants.ICON_LOADING;
try { try {
await this.validatePassword(<string> password); await this.validatePassword(<string> password);
@ -643,8 +643,8 @@ export class AddonModLessonIndexComponent extends CoreCourseModuleMainActivityCo
CoreDomUtils.instance.showErrorModal(error); CoreDomUtils.instance.showErrorModal(error);
} finally { } finally {
this.loaded = true; this.loaded = true;
this.refreshIcon = 'refresh'; this.refreshIcon = CoreConstants.ICON_REFRESH;
this.syncIcon = 'sync'; this.syncIcon = CoreConstants.ICON_SYNC;
CoreDomUtils.instance.triggerFormSubmittedEvent(this.formElement, true, this.siteId); CoreDomUtils.instance.triggerFormSubmittedEvent(this.formElement, true, this.siteId);
} }

View File

@ -12,6 +12,7 @@
// See the License for the specific language governing permissions and // See the License for the specific language governing permissions and
// limitations under the License. // limitations under the License.
import { CoreConstants } from '@/core/constants';
import { Component } from '@angular/core'; import { Component } from '@angular/core';
import { NavParams } from '@ionic/angular'; import { NavParams } from '@ionic/angular';
import { PopoverController } from '@singletons'; import { PopoverController } from '@singletons';
@ -58,7 +59,7 @@ export class CoreContextMenuPopoverComponent {
event.preventDefault(); event.preventDefault();
event.stopPropagation(); event.stopPropagation();
if (item.iconAction == 'spinner') { if (item.iconAction == CoreConstants.ICON_LOADING) {
return false; return false;
} }

View File

@ -77,12 +77,12 @@ export class CoreConstants {
static readonly OUTDATED = 'outdated'; static readonly OUTDATED = 'outdated';
static readonly NOT_DOWNLOADABLE = 'notdownloadable'; static readonly NOT_DOWNLOADABLE = 'notdownloadable';
// Download / prefetch status icon. @todo // Download / prefetch status icon.
static readonly DOWNLOADED_ICON = 'cloud-done'; static readonly ICON_DOWNLOADED = 'cloud-done';
static readonly DOWNLOADING_ICON = 'spinner'; static readonly ICON_DOWNLOADING = 'spinner';
static readonly NOT_DOWNLOADED_ICON = 'cloud-download'; static readonly ICON_NOT_DOWNLOADED = 'cloud-download';
static readonly OUTDATED_ICON = 'fas-redo-alt'; static readonly ICON_OUTDATED = 'fas-redo-alt';
static readonly NOT_DOWNLOADABLE_ICON = ''; static readonly ICON_NOT_DOWNLOADABLE = '';
// General download and sync icons. // General download and sync icons.
static readonly ICON_LOADING = 'spinner'; static readonly ICON_LOADING = 'spinner';

View File

@ -25,6 +25,7 @@ import { CoreUtils } from '@services/utils/utils';
import { CoreDomUtils } from '@services/utils/dom'; import { CoreDomUtils } from '@services/utils/dom';
import { CoreWSExternalWarning } from '@services/ws'; import { CoreWSExternalWarning } from '@services/ws';
import { CoreCourseContentsPage } from '../pages/contents/contents'; import { CoreCourseContentsPage } from '../pages/contents/contents';
import { CoreConstants } from '@/core/constants';
/** /**
* Template class to easily create CoreCourseModuleMainComponent of activities. * Template class to easily create CoreCourseModuleMainComponent of activities.
@ -70,7 +71,7 @@ export class CoreCourseModuleMainActivityComponent extends CoreCourseModuleMainR
super.ngOnInit(); super.ngOnInit();
this.hasOffline = false; this.hasOffline = false;
this.syncIcon = 'spinner'; this.syncIcon = CoreConstants.ICON_LOADING;
this.moduleName = CoreCourse.instance.translateModuleName(this.moduleName || ''); this.moduleName = CoreCourse.instance.translateModuleName(this.moduleName || '');
if (this.syncEventName) { if (this.syncEventName) {
@ -117,16 +118,16 @@ export class CoreCourseModuleMainActivityComponent extends CoreCourseModuleMainR
return; return;
} }
this.refreshIcon = 'spinner'; this.refreshIcon = CoreConstants.ICON_LOADING;
this.syncIcon = 'spinner'; this.syncIcon = CoreConstants.ICON_LOADING;
try { try {
await CoreUtils.instance.ignoreErrors(this.invalidateContent()); await CoreUtils.instance.ignoreErrors(this.invalidateContent());
await this.loadContent(true, sync, showErrors); await this.loadContent(true, sync, showErrors);
} finally { } finally {
this.refreshIcon = 'fas-redo'; this.refreshIcon = CoreConstants.ICON_REFRESH;
this.syncIcon = 'fas-sync'; this.syncIcon = CoreConstants.ICON_SYNC;
} }
} }
@ -138,16 +139,16 @@ export class CoreCourseModuleMainActivityComponent extends CoreCourseModuleMainR
* @return Resolved when done. * @return Resolved when done.
*/ */
protected async showLoadingAndFetch(sync: boolean = false, showErrors: boolean = false): Promise<void> { protected async showLoadingAndFetch(sync: boolean = false, showErrors: boolean = false): Promise<void> {
this.refreshIcon = 'spinner'; this.refreshIcon = CoreConstants.ICON_LOADING;
this.syncIcon = 'spinner'; this.syncIcon = CoreConstants.ICON_LOADING;
this.loaded = false; this.loaded = false;
this.content?.scrollToTop(); this.content?.scrollToTop();
try { try {
await this.loadContent(false, sync, showErrors); await this.loadContent(false, sync, showErrors);
} finally { } finally {
this.refreshIcon = 'fas-redo'; this.refreshIcon = CoreConstants.ICON_REFRESH;
this.syncIcon = 'fas-sync'; this.syncIcon = CoreConstants.ICON_REFRESH;
} }
} }
@ -159,8 +160,8 @@ export class CoreCourseModuleMainActivityComponent extends CoreCourseModuleMainR
* @return Resolved when done. * @return Resolved when done.
*/ */
protected showLoadingAndRefresh(sync: boolean = false, showErrors: boolean = false): Promise<void> { protected showLoadingAndRefresh(sync: boolean = false, showErrors: boolean = false): Promise<void> {
this.refreshIcon = 'spinner'; this.refreshIcon = CoreConstants.ICON_LOADING;
this.syncIcon = 'spinner'; this.syncIcon = CoreConstants.ICON_LOADING;
this.loaded = false; this.loaded = false;
this.content?.scrollToTop(); this.content?.scrollToTop();
@ -207,8 +208,8 @@ export class CoreCourseModuleMainActivityComponent extends CoreCourseModuleMainR
CoreDomUtils.instance.showErrorModalDefault(error, this.fetchContentDefaultError, true); CoreDomUtils.instance.showErrorModalDefault(error, this.fetchContentDefaultError, true);
} finally { } finally {
this.loaded = true; this.loaded = true;
this.refreshIcon = 'fas-redo'; this.refreshIcon = CoreConstants.ICON_REFRESH;
this.syncIcon = 'fas-sync'; this.syncIcon = CoreConstants.ICON_REFRESH;
} }
} }

View File

@ -45,6 +45,7 @@ import {
CoreEventCompletionModuleViewedData, CoreEventCompletionModuleViewedData,
} from '@singletons/events'; } from '@singletons/events';
import { CoreNavigator } from '@services/navigator'; import { CoreNavigator } from '@services/navigator';
import { CoreConstants } from '@/core/constants';
/** /**
* Page that displays the contents of a course. * Page that displays the contents of a course.
@ -71,7 +72,7 @@ export class CoreCourseContentsPage implements OnInit, OnDestroy {
displayEnableDownload = false; displayEnableDownload = false;
displayRefresher = false; displayRefresher = false;
prefetchCourseData: CorePrefetchStatusInfo = { prefetchCourseData: CorePrefetchStatusInfo = {
icon: 'spinner', icon: CoreConstants.ICON_LOADING,
statusTranslatable: 'core.course.downloadcourse', statusTranslatable: 'core.course.downloadcourse',
status: '', status: '',
loading: true, loading: true,
@ -171,7 +172,7 @@ export class CoreCourseContentsPage implements OnInit, OnDestroy {
// Determine the course prefetch status. // Determine the course prefetch status.
await this.determineCoursePrefetchIcon(); await this.determineCoursePrefetchIcon();
if (this.prefetchCourseData.icon != 'spinner') { if (this.prefetchCourseData.icon != CoreConstants.ICON_LOADING) {
return; return;
} }

View File

@ -359,7 +359,7 @@ export class CoreCourseHelperProvider {
const siteId = CoreSites.instance.getCurrentSiteId(); const siteId = CoreSites.instance.getCurrentSiteId();
data.downloadSucceeded = false; data.downloadSucceeded = false;
data.icon = 'spinner'; data.icon = CoreConstants.ICON_DOWNLOADING;
data.statusTranslatable = 'core.downloading'; data.statusTranslatable = 'core.downloading';
// Get the sections first if needed. // Get the sections first if needed.
@ -563,7 +563,7 @@ export class CoreCourseHelperProvider {
done?: () => void, done?: () => void,
): Promise<void> { ): Promise<void> {
const initialIcon = instance.prefetchStatusIcon; const initialIcon = instance.prefetchStatusIcon;
instance.prefetchStatusIcon = 'spinner'; // Show spinner since this operation might take a while. instance.prefetchStatusIcon = CoreConstants.ICON_DOWNLOADING; // Show spinner since this operation might take a while.
try { try {
// We need to call getDownloadSize, the package might have been updated. // We need to call getDownloadSize, the package might have been updated.
@ -1122,7 +1122,7 @@ export class CoreCourseHelperProvider {
if (prefetch.loading) { if (prefetch.loading) {
// It seems all courses are being downloaded, show a download button instead. // It seems all courses are being downloaded, show a download button instead.
prefetch.icon = CoreConstants.NOT_DOWNLOADED_ICON; prefetch.icon = CoreConstants.ICON_NOT_DOWNLOADED;
} }
return prefetch; return prefetch;
@ -1188,14 +1188,14 @@ export class CoreCourseHelperProvider {
prefetch: CorePrefetchStatusInfo, prefetch: CorePrefetchStatusInfo,
): Promise<void> { ): Promise<void> {
prefetch.loading = true; prefetch.loading = true;
prefetch.icon = CoreConstants.DOWNLOADING_ICON; prefetch.icon = CoreConstants.ICON_DOWNLOADING;
prefetch.badge = ''; prefetch.badge = '';
try { try {
await this.confirmAndPrefetchCourses(courses, (progress) => { await this.confirmAndPrefetchCourses(courses, (progress) => {
prefetch.badge = progress.count + ' / ' + progress.total; prefetch.badge = progress.count + ' / ' + progress.total;
}); });
prefetch.icon = CoreConstants.OUTDATED_ICON; prefetch.icon = CoreConstants.ICON_OUTDATED;
} finally { } finally {
prefetch.loading = false; prefetch.loading = false;
prefetch.badge = ''; prefetch.badge = '';
@ -1264,19 +1264,19 @@ export class CoreCourseHelperProvider {
*/ */
getPrefetchStatusIcon(status: string, trustDownload: boolean = false): string { getPrefetchStatusIcon(status: string, trustDownload: boolean = false): string {
if (status == CoreConstants.NOT_DOWNLOADED) { if (status == CoreConstants.NOT_DOWNLOADED) {
return CoreConstants.NOT_DOWNLOADED_ICON; return CoreConstants.ICON_NOT_DOWNLOADED;
} }
if (status == CoreConstants.OUTDATED || (status == CoreConstants.DOWNLOADED && !trustDownload)) { if (status == CoreConstants.OUTDATED || (status == CoreConstants.DOWNLOADED && !trustDownload)) {
return CoreConstants.OUTDATED_ICON; return CoreConstants.ICON_OUTDATED;
} }
if (status == CoreConstants.DOWNLOADED && trustDownload) { if (status == CoreConstants.DOWNLOADED && trustDownload) {
return CoreConstants.DOWNLOADED_ICON; return CoreConstants.ICON_DOWNLOADED;
} }
if (status == CoreConstants.DOWNLOADING) { if (status == CoreConstants.DOWNLOADING) {
return CoreConstants.DOWNLOADING_ICON; return CoreConstants.ICON_DOWNLOADING;
} }
return CoreConstants.DOWNLOADING_ICON; return CoreConstants.ICON_DOWNLOADING;
} }
/** /**
@ -1335,17 +1335,17 @@ export class CoreCourseHelperProvider {
moduleInfo.status = results[1]; moduleInfo.status = results[1];
switch (results[1]) { switch (results[1]) {
case CoreConstants.NOT_DOWNLOADED: case CoreConstants.NOT_DOWNLOADED:
moduleInfo.statusIcon = 'fas-cloud-download-alt'; moduleInfo.statusIcon = CoreConstants.ICON_NOT_DOWNLOADED;
break; break;
case CoreConstants.DOWNLOADING: case CoreConstants.DOWNLOADING:
moduleInfo.statusIcon = 'spinner'; moduleInfo.statusIcon = CoreConstants.ICON_DOWNLOADING;
break; break;
case CoreConstants.OUTDATED: case CoreConstants.OUTDATED:
moduleInfo.statusIcon = 'fas-redo'; moduleInfo.statusIcon = CoreConstants.ICON_OUTDATED;
break; break;
case CoreConstants.DOWNLOADED: case CoreConstants.DOWNLOADED:
if (!CoreCourseModulePrefetchDelegate.instance.canCheckUpdates()) { if (!CoreCourseModulePrefetchDelegate.instance.canCheckUpdates()) {
moduleInfo.statusIcon = 'fas-redo'; moduleInfo.statusIcon = CoreConstants.ICON_OUTDATED;
} }
break; break;
default: default:

View File

@ -45,7 +45,7 @@ export class CoreCoursesMyCoursesPage implements OnInit, OnDestroy {
filter = ''; filter = '';
showFilter = false; showFilter = false;
coursesLoaded = false; coursesLoaded = false;
downloadAllCoursesIcon = CoreConstants.NOT_DOWNLOADED_ICON; downloadAllCoursesIcon = CoreConstants.ICON_NOT_DOWNLOADED;
downloadAllCoursesLoading = false; downloadAllCoursesLoading = false;
downloadAllCoursesBadge = ''; downloadAllCoursesBadge = '';
downloadAllCoursesEnabled = false; downloadAllCoursesEnabled = false;

View File

@ -12,6 +12,8 @@
// See the License for the specific language governing permissions and // See the License for the specific language governing permissions and
// limitations under the License. // limitations under the License.
import { CoreConstants } from '@/core/constants';
/** /**
* Settings section. * Settings section.
*/ */
@ -40,7 +42,7 @@ export class CoreSettingsConstants {
{ {
name: 'synchronization', name: 'synchronization',
path: 'sync', path: 'sync',
icon: 'fas-sync-alt', icon: CoreConstants.ICON_SYNC,
}, },
// @TODO sharedfiles // @TODO sharedfiles
{ {