From 11d052e65987315fb8fc642569cce2c652dc95fd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pau=20Ferrer=20Oca=C3=B1a?= Date: Thu, 1 Mar 2018 16:55:49 +0100 Subject: [PATCH] MOBILE-2327 core: Change all import paths --- src/addon/calendar/calendar.module.ts | 8 +++--- .../calendar/pages/event/event.module.ts | 6 ++--- src/addon/calendar/pages/event/event.ts | 10 +++---- src/addon/calendar/pages/list/list.module.ts | 6 ++--- src/addon/calendar/pages/list/list.ts | 18 ++++++------- .../pages/settings/settings.module.ts | 2 +- src/addon/calendar/pages/settings/settings.ts | 4 +-- src/addon/calendar/providers/calendar.ts | 18 ++++++------- src/addon/calendar/providers/helper.ts | 4 +-- .../calendar/providers/mainmenu-handler.ts | 2 +- src/addon/files/files.module.ts | 2 +- src/addon/files/pages/list/list.module.ts | 4 +-- src/addon/files/pages/list/list.ts | 10 +++---- src/addon/files/providers/files.ts | 6 ++--- src/addon/files/providers/helper.ts | 6 ++--- src/addon/files/providers/mainmenu-handler.ts | 2 +- .../messages/components/components.module.ts | 10 +++---- .../components/discussions/discussions.ts | 22 +++++++++++---- src/addon/messages/messages.module.ts | 15 +++++------ .../pages/discussion/discussion.module.ts | 6 ++--- .../messages/pages/discussion/discussion.ts | 16 +++++------ src/addon/messages/pages/index/index.html | 4 +-- .../messages/pages/index/index.module.ts | 6 ++--- src/addon/messages/pages/index/index.ts | 6 ++--- .../pages/settings/settings.module.ts | 4 +-- .../providers/discussion-link-handler.ts | 8 +++--- .../messages/providers/index-link-handler.ts | 6 ++--- .../messages/providers/mainmenu-handler.ts | 22 +++++++++++---- .../messages/providers/messages-offline.ts | 6 ++--- src/addon/messages/providers/messages.ts | 24 ++++++++--------- .../messages/providers/sync-cron-handler.ts | 4 +-- src/addon/messages/providers/sync.ts | 12 ++++----- .../providers/user-send-message-handler.ts | 6 ++--- src/addon/mod/book/book.module.ts | 6 ++--- .../mod/book/components/components.module.ts | 6 ++--- src/addon/mod/book/components/index/index.ts | 12 ++++----- .../mod/book/pages/index/index.module.ts | 2 +- src/addon/mod/book/providers/book.ts | 16 +++++------ src/addon/mod/book/providers/link-handler.ts | 4 +-- .../mod/book/providers/module-handler.ts | 4 +-- .../mod/book/providers/prefetch-handler.ts | 2 +- src/addon/mod/label/label.module.ts | 4 +-- src/addon/mod/label/providers/link-handler.ts | 4 +-- .../mod/label/providers/module-handler.ts | 2 +- .../pushnotifications/providers/delegate.ts | 2 +- .../providers/pushnotifications.ts | 25 +++++++---------- .../pushnotifications.module.ts | 13 ++++++--- .../checkbox/checkbox.module.ts | 4 +-- .../checkbox/component/checkbox.ts | 2 +- .../datetime/component/datetime.ts | 4 +-- .../datetime/datetime.module.ts | 6 ++--- .../userprofilefield/menu/menu.module.ts | 6 ++--- .../userprofilefield/text/component/text.ts | 2 +- .../text/providers/handler.ts | 2 +- .../userprofilefield/text/text.module.ts | 6 ++--- .../textarea/providers/handler.ts | 2 +- .../textarea/textarea.module.ts | 6 ++--- src/classes/base-sync.ts | 8 +++--- src/classes/delegate.ts | 6 ++--- src/classes/site.ts | 24 ++++++++--------- src/components/components.module.ts | 4 +-- .../context-menu/context-menu-popover.ts | 2 +- src/components/context-menu/context-menu.ts | 2 +- .../dynamic-component/dynamic-component.ts | 2 +- src/components/file/file.ts | 18 ++++++------- src/components/iframe/iframe.ts | 14 +++++----- src/components/loading/loading.ts | 2 +- src/components/local-file/local-file.ts | 10 +++---- src/components/mark-required/mark-required.ts | 4 +-- .../navbar-buttons/navbar-buttons.ts | 4 +-- .../rich-text-editor/rich-text-editor.ts | 2 +- src/components/search-box/search-box.ts | 2 +- .../send-message-form/send-message-form.ts | 4 +-- src/components/show-password/show-password.ts | 2 +- src/components/site-picker/site-picker.ts | 4 +-- src/components/tabs/tab.ts | 2 +- .../classes/module-grade-handler.ts | 4 +-- .../pages/choose-site/choose-site.module.ts | 4 +-- .../pages/choose-site/choose-site.ts | 4 +-- src/core/contentlinks/providers/delegate.ts | 8 +++--- src/core/contentlinks/providers/helper.ts | 16 +++++------ .../course/classes/module-prefetch-handler.ts | 10 +++---- .../course/components/components.module.ts | 4 +-- src/core/course/components/format/format.ts | 8 +++--- .../module-completion/module-completion.ts | 6 ++--- src/core/course/components/module/module.ts | 6 ++--- .../singleactivity/singleactivity.module.ts | 2 +- .../course/formats/weeks/providers/handler.ts | 2 +- .../course/pages/section/section.module.ts | 4 +-- src/core/course/pages/section/section.ts | 8 +++--- .../unsupported-module.module.ts | 4 +-- .../unsupported-module/unsupported-module.ts | 2 +- src/core/course/providers/course.ts | 12 ++++----- src/core/course/providers/format-delegate.ts | 8 +++--- src/core/course/providers/helper.ts | 16 +++++------ src/core/course/providers/module-delegate.ts | 10 +++---- .../providers/module-prefetch-delegate.ts | 20 +++++++------- src/core/course/providers/options-delegate.ts | 10 +++---- .../courses/components/components.module.ts | 6 ++--- .../course-progress/course-progress.ts | 6 ++--- .../overview-events/overview-events.ts | 8 +++--- .../available-courses.module.ts | 2 +- .../available-courses/available-courses.ts | 4 +-- .../pages/categories/categories.module.ts | 4 +-- .../courses/pages/categories/categories.ts | 6 ++--- .../course-preview/course-preview.module.ts | 6 ++--- .../pages/course-preview/course-preview.ts | 10 +++---- .../pages/my-courses/my-courses.module.ts | 2 +- .../courses/pages/my-courses/my-courses.ts | 6 ++--- .../pages/my-overview/my-overview.module.ts | 2 +- .../courses/pages/my-overview/my-overview.ts | 4 +-- .../courses/pages/search/search.module.ts | 2 +- src/core/courses/pages/search/search.ts | 2 +- .../self-enrol-password.module.ts | 4 +-- .../courses/providers/course-link-handler.ts | 4 +-- src/core/courses/providers/courses.ts | 6 ++--- src/core/courses/providers/my-overview.ts | 4 +-- .../emulator/classes/inappbrowserobject.ts | 6 ++--- src/core/emulator/classes/sqlitedb.ts | 2 +- src/core/emulator/emulator.module.ts | 18 ++++++------- .../capture-media/capture-media.module.ts | 2 +- .../pages/capture-media/capture-media.ts | 8 +++--- src/core/emulator/providers/capture-helper.ts | 4 +-- src/core/emulator/providers/clipboard.ts | 2 +- src/core/emulator/providers/file-transfer.ts | 4 +-- src/core/emulator/providers/file.ts | 4 +-- src/core/emulator/providers/globalization.ts | 2 +- src/core/emulator/providers/helper.ts | 6 ++--- src/core/emulator/providers/inappbrowser.ts | 6 ++--- .../emulator/providers/local-notifications.ts | 6 ++--- src/core/emulator/providers/zip.ts | 2 +- .../fileuploader/providers/album-handler.ts | 4 +-- .../fileuploader/providers/audio-handler.ts | 4 +-- .../fileuploader/providers/camera-handler.ts | 4 +-- src/core/fileuploader/providers/delegate.ts | 8 +++--- .../fileuploader/providers/file-handler.ts | 6 ++--- .../fileuploader/providers/fileuploader.ts | 18 ++++++------- src/core/fileuploader/providers/helper.ts | 12 ++++----- .../fileuploader/providers/video-handler.ts | 4 +-- .../grades/components/components.module.ts | 6 ++--- src/core/grades/components/course/course.ts | 8 +++--- src/core/grades/grades.module.ts | 4 +-- src/core/grades/pages/course/course.ts | 2 +- .../grades/pages/courses/courses.module.ts | 4 +-- src/core/grades/pages/courses/courses.ts | 4 +-- .../pages/coursesplit/coursesplit.module.ts | 2 +- .../grades/pages/coursesplit/coursesplit.ts | 2 +- src/core/grades/pages/grade/grade.module.ts | 4 +-- src/core/grades/pages/grade/grade.ts | 4 +-- src/core/grades/providers/grades.ts | 6 ++--- src/core/grades/providers/helper.ts | 10 +++---- src/core/grades/providers/user-handler.ts | 2 +- .../pages/credentials/credentials.module.ts | 4 +-- .../login/pages/credentials/credentials.ts | 10 +++---- .../pages/email-signup/email-signup.module.ts | 4 +-- .../login/pages/email-signup/email-signup.ts | 10 +++---- .../forgotten-password/forgotten-password.ts | 2 +- src/core/login/pages/init/init.ts | 16 ++++++----- .../login/pages/reconnect/reconnect.module.ts | 4 +-- src/core/login/pages/reconnect/reconnect.ts | 6 ++--- .../pages/site-error/site-error.module.ts | 2 +- .../login/pages/site-help/site-help.module.ts | 2 +- .../pages/site-policy/site-policy.module.ts | 4 +-- .../login/pages/site-policy/site-policy.ts | 8 +++--- src/core/login/pages/site/site.module.ts | 2 +- src/core/login/pages/site/site.ts | 6 ++--- src/core/login/pages/sites/sites.module.ts | 2 +- src/core/login/pages/sites/sites.ts | 25 ++++++++++------- src/core/login/providers/helper.ts | 22 +++++++-------- src/core/mainmenu/pages/menu/menu.ts | 4 +-- src/core/mainmenu/pages/more/more.module.ts | 4 +-- src/core/mainmenu/pages/more/more.ts | 4 +-- src/core/mainmenu/providers/delegate.ts | 8 +++--- src/core/mainmenu/providers/mainmenu.ts | 4 +-- src/core/settings/pages/list/list.module.ts | 4 +-- .../pages/choose-site/choose-site.module.ts | 4 +-- .../pages/choose-site/choose-site.ts | 6 ++--- .../sharedfiles/pages/list/list.module.ts | 4 +-- src/core/sharedfiles/pages/list/list.ts | 8 +++--- src/core/sharedfiles/providers/helper.ts | 14 +++++----- src/core/sharedfiles/providers/sharedfiles.ts | 16 +++++------ .../sitehome/components/components.module.ts | 4 +-- src/core/sitehome/components/index/index.ts | 4 +-- src/core/sitehome/components/news/news.ts | 2 +- src/core/sitehome/pages/index/index.ts | 2 +- .../sitehome/providers/index-link-handler.ts | 2 +- src/core/sitehome/providers/sitehome.ts | 6 ++--- src/core/user/components/components.module.ts | 6 ++--- .../components/participants/participants.ts | 4 +-- .../user-profile-field/user-profile-field.ts | 2 +- src/core/user/pages/about/about.module.ts | 4 +-- src/core/user/pages/about/about.ts | 6 ++--- src/core/user/pages/profile/profile.module.ts | 4 +-- src/core/user/pages/profile/profile.ts | 10 +++---- src/core/user/providers/helper.ts | 2 +- .../providers/participants-link-handler.ts | 6 ++--- src/core/user/providers/user-delegate.ts | 10 +++---- src/core/user/providers/user-handler.ts | 2 +- .../providers/user-profile-field-delegate.ts | 8 +++--- src/core/user/providers/user.ts | 13 ++++----- src/core/user/user.module.ts | 4 +-- src/core/viewer/pages/iframe/iframe.module.ts | 2 +- src/core/viewer/pages/image/image.module.ts | 2 +- src/core/viewer/pages/text/text.module.ts | 2 +- src/core/viewer/pages/text/text.ts | 2 +- src/directives/auto-focus.ts | 4 +-- src/directives/external-content.ts | 12 ++++----- src/directives/format-text.ts | 20 +++++++------- src/directives/keep-keyboard.ts | 4 +-- src/directives/link.ts | 10 +++---- src/pipes/bytes-to-size.ts | 4 +-- src/pipes/date-day-or-time.ts | 2 +- src/pipes/duration.ts | 2 +- src/pipes/format-date.ts | 2 +- src/pipes/seconds-to-hms.ts | 6 ++--- src/pipes/time-ago.ts | 2 +- src/pipes/to-locale-string.ts | 2 +- src/providers/config.ts | 2 +- src/providers/cron.ts | 4 +-- src/providers/db.ts | 4 +-- src/providers/events.ts | 2 +- src/providers/filepool.ts | 4 +-- src/providers/local-notifications.ts | 4 +-- src/providers/sites-factory.ts | 2 +- src/providers/sites.ts | 27 +++++-------------- src/providers/utils/dom.ts | 2 +- src/providers/utils/time.ts | 2 +- src/providers/ws.ts | 4 +-- tsconfig.json | 2 +- 229 files changed, 725 insertions(+), 711 deletions(-) diff --git a/src/addon/calendar/calendar.module.ts b/src/addon/calendar/calendar.module.ts index 3fcfdf52b..1f4bea922 100644 --- a/src/addon/calendar/calendar.module.ts +++ b/src/addon/calendar/calendar.module.ts @@ -16,10 +16,10 @@ import { NgModule } from '@angular/core'; import { AddonCalendarProvider } from './providers/calendar'; import { AddonCalendarHelperProvider } from './providers/helper'; import { AddonCalendarMainMenuHandler } from './providers/mainmenu-handler'; -import { CoreMainMenuDelegate } from '../../core/mainmenu/providers/delegate'; -import { CoreInitDelegate } from '../../providers/init'; -import { CoreLocalNotificationsProvider } from '../../providers/local-notifications'; -import { CoreLoginHelperProvider } from '../../core/login/providers/helper'; +import { CoreMainMenuDelegate } from '@core/mainmenu/providers/delegate'; +import { CoreInitDelegate } from '@providers/init'; +import { CoreLocalNotificationsProvider } from '@providers/local-notifications'; +import { CoreLoginHelperProvider } from '@core/login/providers/helper'; @NgModule({ declarations: [ diff --git a/src/addon/calendar/pages/event/event.module.ts b/src/addon/calendar/pages/event/event.module.ts index 7731c3b2d..d579114cc 100644 --- a/src/addon/calendar/pages/event/event.module.ts +++ b/src/addon/calendar/pages/event/event.module.ts @@ -15,9 +15,9 @@ import { NgModule } from '@angular/core'; import { IonicPageModule } from 'ionic-angular'; import { TranslateModule } from '@ngx-translate/core'; -import { CoreComponentsModule } from '../../../../components/components.module'; -import { CoreDirectivesModule } from '../../../../directives/directives.module'; -import { CorePipesModule } from '../../../../pipes/pipes.module'; +import { CoreComponentsModule } from '@components/components.module'; +import { CoreDirectivesModule } from '@directives'; +import { CorePipesModule } from '@pipes'; import { AddonCalendarEventPage } from './event'; @NgModule({ diff --git a/src/addon/calendar/pages/event/event.ts b/src/addon/calendar/pages/event/event.ts index 85dfd003a..0be9e4935 100644 --- a/src/addon/calendar/pages/event/event.ts +++ b/src/addon/calendar/pages/event/event.ts @@ -17,11 +17,11 @@ import { IonicPage, Content, NavParams } from 'ionic-angular'; import { TranslateService } from '@ngx-translate/core'; import { AddonCalendarProvider } from '../../providers/calendar'; import { AddonCalendarHelperProvider } from '../../providers/helper'; -import { CoreCoursesProvider } from '../../../../core/courses/providers/courses'; -import { CoreDomUtilsProvider } from '../../../../providers/utils/dom'; -import { CoreSitesProvider } from '../../../../providers/sites'; -import { CoreLocalNotificationsProvider } from '../../../../providers/local-notifications'; -import { CoreCourseProvider } from '../../../../core/course/providers/course'; +import { CoreCoursesProvider } from '@core/courses/providers/courses'; +import { CoreDomUtilsProvider } from '@providers/utils/dom'; +import { CoreSitesProvider } from '@providers/sites'; +import { CoreLocalNotificationsProvider } from '@providers/local-notifications'; +import { CoreCourseProvider } from '@core/course/providers/course'; import * as moment from 'moment'; /** diff --git a/src/addon/calendar/pages/list/list.module.ts b/src/addon/calendar/pages/list/list.module.ts index 9335a8061..b685b6578 100644 --- a/src/addon/calendar/pages/list/list.module.ts +++ b/src/addon/calendar/pages/list/list.module.ts @@ -15,9 +15,9 @@ import { NgModule } from '@angular/core'; import { IonicPageModule } from 'ionic-angular'; import { TranslateModule } from '@ngx-translate/core'; -import { CoreComponentsModule } from '../../../../components/components.module'; -import { CoreDirectivesModule } from '../../../../directives/directives.module'; -import { CorePipesModule } from '../../../../pipes/pipes.module'; +import { CoreComponentsModule } from '@components/components.module'; +import { CoreDirectivesModule } from '@directives'; +import { CorePipesModule } from '@pipes'; import { AddonCalendarListPage } from './list'; @NgModule({ diff --git a/src/addon/calendar/pages/list/list.ts b/src/addon/calendar/pages/list/list.ts index 85847215b..8f82a3258 100644 --- a/src/addon/calendar/pages/list/list.ts +++ b/src/addon/calendar/pages/list/list.ts @@ -17,15 +17,15 @@ import { IonicPage, Content, PopoverController, NavParams, NavController } from import { TranslateService } from '@ngx-translate/core'; import { AddonCalendarProvider } from '../../providers/calendar'; import { AddonCalendarHelperProvider } from '../../providers/helper'; -import { CoreCoursesProvider } from '../../../../core/courses/providers/courses'; -import { CoreDomUtilsProvider } from '../../../../providers/utils/dom'; -import { CoreUtilsProvider } from '../../../../providers/utils/utils'; -import { CoreSitesProvider } from '../../../../providers/sites'; -import { CoreLocalNotificationsProvider } from '../../../../providers/local-notifications'; -import { CoreCoursePickerMenuPopoverComponent } from '../../../../components/course-picker-menu/course-picker-menu-popover'; -import { CoreEventsProvider } from '../../../../providers/events'; -import { CoreAppProvider } from '../../../../providers/app'; -import { CoreSplitViewComponent } from '../../../../components/split-view/split-view'; +import { CoreCoursesProvider } from '@core/courses/providers/courses'; +import { CoreDomUtilsProvider } from '@providers/utils/dom'; +import { CoreUtilsProvider } from '@providers/utils/utils'; +import { CoreSitesProvider } from '@providers/sites'; +import { CoreLocalNotificationsProvider } from '@providers/local-notifications'; +import { CoreCoursePickerMenuPopoverComponent } from '@components/course-picker-menu/course-picker-menu-popover'; +import { CoreEventsProvider } from '@providers/events'; +import { CoreAppProvider } from '@providers/app'; +import { CoreSplitViewComponent } from '@components/split-view/split-view'; /** * Page that displays the list of calendar events. diff --git a/src/addon/calendar/pages/settings/settings.module.ts b/src/addon/calendar/pages/settings/settings.module.ts index 59067baa6..93f443bd0 100644 --- a/src/addon/calendar/pages/settings/settings.module.ts +++ b/src/addon/calendar/pages/settings/settings.module.ts @@ -16,7 +16,7 @@ import { NgModule } from '@angular/core'; import { IonicPageModule } from 'ionic-angular'; import { TranslateModule } from '@ngx-translate/core'; import { AddonCalendarSettingsPage } from './settings'; -import { CorePipesModule } from '../../../../pipes/pipes.module'; +import { CorePipesModule } from '@pipes'; @NgModule({ declarations: [ diff --git a/src/addon/calendar/pages/settings/settings.ts b/src/addon/calendar/pages/settings/settings.ts index 5cb59dda4..bebc4f1e9 100644 --- a/src/addon/calendar/pages/settings/settings.ts +++ b/src/addon/calendar/pages/settings/settings.ts @@ -15,8 +15,8 @@ import { Component } from '@angular/core'; import { IonicPage } from 'ionic-angular'; import { AddonCalendarProvider } from '../../providers/calendar'; -import { CoreEventsProvider } from '../../../../providers/events'; -import { CoreSitesProvider } from '../../../../providers/sites'; +import { CoreEventsProvider } from '@providers/events'; +import { CoreSitesProvider } from '@providers/sites'; /** * Page that displays the calendar settings. diff --git a/src/addon/calendar/providers/calendar.ts b/src/addon/calendar/providers/calendar.ts index 20532f254..741160a88 100644 --- a/src/addon/calendar/providers/calendar.ts +++ b/src/addon/calendar/providers/calendar.ts @@ -13,15 +13,15 @@ // limitations under the License. import { Injectable } from '@angular/core'; -import { CoreLoggerProvider } from '../../../providers/logger'; -import { CoreSitesProvider } from '../../../providers/sites'; -import { CoreSite } from '../../../classes/site'; -import { CoreCoursesProvider } from '../../../core/courses/providers/courses'; -import { CoreTimeUtilsProvider } from '../../../providers/utils/time'; -import { CoreGroupsProvider } from '../../../providers/groups'; -import { CoreConstants } from '../../../core/constants'; -import { CoreLocalNotificationsProvider } from '../../../providers/local-notifications'; -import { CoreConfigProvider } from '../../../providers/config'; +import { CoreLoggerProvider } from '@providers/logger'; +import { CoreSitesProvider } from '@providers/sites'; +import { CoreSite } from '@classes/site'; +import { CoreCoursesProvider } from '@core/courses/providers/courses'; +import { CoreTimeUtilsProvider } from '@providers/utils/time'; +import { CoreGroupsProvider } from '@providers/groups'; +import { CoreConstants } from '@core/constants'; +import { CoreLocalNotificationsProvider } from '@providers/local-notifications'; +import { CoreConfigProvider } from '@providers/config'; /** * Service to handle calendar events. diff --git a/src/addon/calendar/providers/helper.ts b/src/addon/calendar/providers/helper.ts index 9c2bdcf9f..c1a0a8888 100644 --- a/src/addon/calendar/providers/helper.ts +++ b/src/addon/calendar/providers/helper.ts @@ -13,8 +13,8 @@ // limitations under the License. import { Injectable } from '@angular/core'; -import { CoreLoggerProvider } from '../../../providers/logger'; -import { CoreCourseProvider } from '../../../core/course/providers/course'; +import { CoreLoggerProvider } from '@providers/logger'; +import { CoreCourseProvider } from '@core/course/providers/course'; /** * Service that provides some features regarding lists of courses and categories. diff --git a/src/addon/calendar/providers/mainmenu-handler.ts b/src/addon/calendar/providers/mainmenu-handler.ts index 92e038527..2769f0e0b 100644 --- a/src/addon/calendar/providers/mainmenu-handler.ts +++ b/src/addon/calendar/providers/mainmenu-handler.ts @@ -14,7 +14,7 @@ import { Injectable } from '@angular/core'; import { AddonCalendarProvider } from './calendar'; -import { CoreMainMenuHandler, CoreMainMenuHandlerData } from '../../../core/mainmenu/providers/delegate'; +import { CoreMainMenuHandler, CoreMainMenuHandlerData } from '@core/mainmenu/providers/delegate'; /** * Handler to inject an option into main menu. diff --git a/src/addon/files/files.module.ts b/src/addon/files/files.module.ts index 56560abc2..25f500ee2 100644 --- a/src/addon/files/files.module.ts +++ b/src/addon/files/files.module.ts @@ -16,7 +16,7 @@ import { NgModule } from '@angular/core'; import { AddonFilesProvider } from './providers/files'; import { AddonFilesHelperProvider } from './providers/helper'; import { AddonFilesMainMenuHandler } from './providers/mainmenu-handler'; -import { CoreMainMenuDelegate } from '../../core/mainmenu/providers/delegate'; +import { CoreMainMenuDelegate } from '@core/mainmenu/providers/delegate'; @NgModule({ declarations: [ diff --git a/src/addon/files/pages/list/list.module.ts b/src/addon/files/pages/list/list.module.ts index 50a40684d..f819f5512 100644 --- a/src/addon/files/pages/list/list.module.ts +++ b/src/addon/files/pages/list/list.module.ts @@ -15,8 +15,8 @@ import { NgModule } from '@angular/core'; import { IonicPageModule } from 'ionic-angular'; import { TranslateModule } from '@ngx-translate/core'; -import { CoreComponentsModule } from '../../../../components/components.module'; -import { CoreDirectivesModule } from '../../../../directives/directives.module'; +import { CoreComponentsModule } from '@components/components.module'; +import { CoreDirectivesModule } from '@directives'; import { AddonFilesListPage } from './list'; @NgModule({ diff --git a/src/addon/files/pages/list/list.ts b/src/addon/files/pages/list/list.ts index f79b3c19f..f2491f52f 100644 --- a/src/addon/files/pages/list/list.ts +++ b/src/addon/files/pages/list/list.ts @@ -15,11 +15,11 @@ import { Component, ViewChild, OnDestroy } from '@angular/core'; import { IonicPage, NavParams, NavController } from 'ionic-angular'; import { TranslateService } from '@ngx-translate/core'; -import { CoreAppProvider } from '../../../../providers/app'; -import { CoreEventsProvider } from '../../../../providers/events'; -import { CoreSitesProvider } from '../../../../providers/sites'; -import { CoreDomUtilsProvider } from '../../../../providers/utils/dom'; -import { CoreTextUtilsProvider } from '../../../../providers/utils/text'; +import { CoreAppProvider } from '@providers/app'; +import { CoreEventsProvider } from '@providers/events'; +import { CoreSitesProvider } from '@providers/sites'; +import { CoreDomUtilsProvider } from '@providers/utils/dom'; +import { CoreTextUtilsProvider } from '@providers/utils/text'; import { AddonFilesProvider } from '../../providers/files'; import { AddonFilesHelperProvider } from '../../providers/helper'; diff --git a/src/addon/files/providers/files.ts b/src/addon/files/providers/files.ts index 5c45c913e..a44a08d9c 100644 --- a/src/addon/files/providers/files.ts +++ b/src/addon/files/providers/files.ts @@ -13,9 +13,9 @@ // limitations under the License. import { Injectable } from '@angular/core'; -import { CoreSitesProvider } from '../../../providers/sites'; -import { CoreMimetypeUtilsProvider } from '../../../providers/utils/mimetype'; -import { CoreSite } from '../../../classes/site'; +import { CoreSitesProvider } from '@providers/sites'; +import { CoreMimetypeUtilsProvider } from '@providers/utils/mimetype'; +import { CoreSite } from '@classes/site'; import { Md5 } from 'ts-md5/dist/md5'; /** diff --git a/src/addon/files/providers/helper.ts b/src/addon/files/providers/helper.ts index 019cde0a0..4962b88e0 100644 --- a/src/addon/files/providers/helper.ts +++ b/src/addon/files/providers/helper.ts @@ -13,9 +13,9 @@ // limitations under the License. import { Injectable } from '@angular/core'; -import { CoreSitesProvider } from '../../../providers/sites'; -import { CoreDomUtilsProvider } from '../../../providers/utils/dom'; -import { CoreFileUploaderHelperProvider } from '../../../core/fileuploader/providers/helper'; +import { CoreSitesProvider } from '@providers/sites'; +import { CoreDomUtilsProvider } from '@providers/utils/dom'; +import { CoreFileUploaderHelperProvider } from '@core/fileuploader/providers/helper'; import { AddonFilesProvider } from './files'; /** diff --git a/src/addon/files/providers/mainmenu-handler.ts b/src/addon/files/providers/mainmenu-handler.ts index 44c1bfd09..bb47f8cb5 100644 --- a/src/addon/files/providers/mainmenu-handler.ts +++ b/src/addon/files/providers/mainmenu-handler.ts @@ -14,7 +14,7 @@ import { Injectable } from '@angular/core'; import { AddonFilesProvider } from './files'; -import { CoreMainMenuHandler, CoreMainMenuHandlerData } from '../../../core/mainmenu/providers/delegate'; +import { CoreMainMenuHandler, CoreMainMenuHandlerData } from '@core/mainmenu/providers/delegate'; /** * Handler to inject an option into main menu. diff --git a/src/addon/messages/components/components.module.ts b/src/addon/messages/components/components.module.ts index ffe6a06d5..5d81ea357 100644 --- a/src/addon/messages/components/components.module.ts +++ b/src/addon/messages/components/components.module.ts @@ -16,14 +16,14 @@ import { NgModule } from '@angular/core'; import { CommonModule } from '@angular/common'; import { IonicModule } from 'ionic-angular'; import { TranslateModule } from '@ngx-translate/core'; -import { CoreComponentsModule } from '../../../components/components.module'; -import { CoreDirectivesModule } from '../../../directives/directives.module'; -import { CorePipesModule } from '../../../pipes/pipes.module'; +import { CoreComponentsModule } from '@components/components.module'; +import { CoreDirectivesModule } from '@directives'; +import { CorePipesModule } from '@pipes'; import { AddonMessagesDiscussionsComponent } from '../components/discussions/discussions'; @NgModule({ declarations: [ - AddonMessagesDiscussionsComponent + AddonMessagesDiscussionsComponent, ], imports: [ CommonModule, @@ -36,7 +36,7 @@ import { AddonMessagesDiscussionsComponent } from '../components/discussions/dis providers: [ ], exports: [ - AddonMessagesDiscussionsComponent + AddonMessagesDiscussionsComponent, ] }) export class AddonMessagesComponentsModule {} diff --git a/src/addon/messages/components/discussions/discussions.ts b/src/addon/messages/components/discussions/discussions.ts index a0bafaf96..ec31793dc 100644 --- a/src/addon/messages/components/discussions/discussions.ts +++ b/src/addon/messages/components/discussions/discussions.ts @@ -15,11 +15,13 @@ import { Component, OnDestroy, ViewChild } from '@angular/core'; import { Platform, NavParams } from 'ionic-angular'; import { TranslateService } from '@ngx-translate/core'; -import { CoreEventsProvider } from '../../../../providers/events'; -import { CoreSitesProvider } from '../../../../providers/sites'; +import { CoreEventsProvider } from '@providers/events'; +import { CoreSitesProvider } from '@providers/sites'; import { AddonMessagesProvider } from '../../providers/messages'; -import { CoreDomUtilsProvider } from '../../../../providers/utils/dom'; -import { CoreAppProvider } from '../../../../providers/app'; +import { CoreDomUtilsProvider } from '@providers/utils/dom'; +import { CoreUtilsProvider } from '@providers/utils/utils'; +import { CoreAppProvider } from '@providers/app'; +import { AddonPushNotificationsDelegate } from '@addon/pushnotifications/providers/delegate'; /** * Component that displays the list of discussions. @@ -51,7 +53,8 @@ export class AddonMessagesDiscussionsComponent implements OnDestroy { constructor(private eventsProvider: CoreEventsProvider, sitesProvider: CoreSitesProvider, translate: TranslateService, private messagesProvider: AddonMessagesProvider, private domUtils: CoreDomUtilsProvider, navParams: NavParams, - private appProvider: CoreAppProvider, platform: Platform) { + private appProvider: CoreAppProvider, platform: Platform, utils: CoreUtilsProvider, + private pushNotificationsDelegate: AddonPushNotificationsDelegate) { this.search.loading = translate.instant('core.searching'); this.loadingMessages = translate.instant('core.loading'); @@ -109,6 +112,14 @@ export class AddonMessagesDiscussionsComponent implements OnDestroy { }); this.discussionUserId = navParams.get('discussionUserId') || false; + + // If a message push notification is received, refresh the view. + pushNotificationsDelegate.registerReceiveHandler('AddonMessagesDiscussionsComponent', (notification) => { + // New message received. If it's from current site, refresh the data. + if (utils.isFalseOrZero(notification.notif) && notification.site == this.siteId) { + this.refreshData(); + } + }); } /** @@ -234,5 +245,6 @@ export class AddonMessagesDiscussionsComponent implements OnDestroy { this.readChangedObserver && this.readChangedObserver.off(); this.cronObserver && this.cronObserver.off(); this.appResumeSubscription && this.appResumeSubscription.unsubscribe(); + this.pushNotificationsDelegate.unregisterReceiveHandler('AddonMessagesDiscussionsComponent'); } } diff --git a/src/addon/messages/messages.module.ts b/src/addon/messages/messages.module.ts index 1fda12a49..83970ce91 100644 --- a/src/addon/messages/messages.module.ts +++ b/src/addon/messages/messages.module.ts @@ -97,16 +97,13 @@ pushNotificationsDelegate: AddonPushNotificationsDelegate, utils: CoreUtilsProvi localNotifications.registerClick(AddonMessagesProvider.PUSH_SIMULATION_COMPONENT, notificationClicked); } - // @todo: use addon manager $mmPushNotificationsDelegate = $mmAddonManager.get('$mmPushNotificationsDelegate'); // Register push notification clicks. - if (pushNotificationsDelegate) { - pushNotificationsDelegate.registerHandler('mmaMessages', (notification) => { - if (utils.isFalseOrZero(notification.notif)) { - notificationClicked(notification); + pushNotificationsDelegate.registerHandler('mmaMessages', (notification) => { + if (utils.isFalseOrZero(notification.notif)) { + notificationClicked(notification); - return true; - } - }); - } + return true; + } + }); } } diff --git a/src/addon/messages/pages/discussion/discussion.module.ts b/src/addon/messages/pages/discussion/discussion.module.ts index 9e5fd17d7..e0f82d74a 100644 --- a/src/addon/messages/pages/discussion/discussion.module.ts +++ b/src/addon/messages/pages/discussion/discussion.module.ts @@ -16,9 +16,9 @@ import { NgModule } from '@angular/core'; import { IonicPageModule } from 'ionic-angular'; import { TranslateModule } from '@ngx-translate/core'; import { AddonMessagesDiscussionPage } from './discussion'; -import { CoreComponentsModule } from '../../../../components/components.module'; -import { CoreDirectivesModule } from '../../../../directives/directives.module'; -import { CorePipesModule } from '../../../../pipes/pipes.module'; +import { CoreComponentsModule } from '@components/components.module'; +import { CoreDirectivesModule } from '@directives'; +import { CorePipesModule } from '@pipes'; @NgModule({ declarations: [ diff --git a/src/addon/messages/pages/discussion/discussion.ts b/src/addon/messages/pages/discussion/discussion.ts index 23a2f5095..f550a6b7c 100644 --- a/src/addon/messages/pages/discussion/discussion.ts +++ b/src/addon/messages/pages/discussion/discussion.ts @@ -15,16 +15,16 @@ import { Component, OnDestroy, ViewChild } from '@angular/core'; import { IonicPage, NavParams, NavController, Content } from 'ionic-angular'; import { TranslateService } from '@ngx-translate/core'; -import { CoreEventsProvider } from '../../../../providers/events'; -import { CoreSitesProvider } from '../../../../providers/sites'; +import { CoreEventsProvider } from '@providers/events'; +import { CoreSitesProvider } from '@providers/sites'; import { AddonMessagesProvider } from '../../providers/messages'; import { AddonMessagesSyncProvider } from '../../providers/sync'; -import { CoreUserProvider } from '../../../../core/user/providers/user'; -import { CoreDomUtilsProvider } from '../../../../providers/utils/dom'; -import { CoreUtilsProvider } from '../../../../providers/utils/utils'; -import { CoreLoggerProvider } from '../../../../providers/logger'; -import { CoreAppProvider } from '../../../../providers/app'; -import { coreSlideInOut } from '../../../../classes/animations'; +import { CoreUserProvider } from '@core/user/providers/user'; +import { CoreDomUtilsProvider } from '@providers/utils/dom'; +import { CoreUtilsProvider } from '@providers/utils/utils'; +import { CoreLoggerProvider } from '@providers/logger'; +import { CoreAppProvider } from '@providers/app'; +import { coreSlideInOut } from '@classes/animations'; import { Md5 } from 'ts-md5/dist/md5'; import * as moment from 'moment'; diff --git a/src/addon/messages/pages/index/index.html b/src/addon/messages/pages/index/index.html index 9b13187bb..9c9ef294a 100644 --- a/src/addon/messages/pages/index/index.html +++ b/src/addon/messages/pages/index/index.html @@ -12,11 +12,11 @@ - + \ No newline at end of file diff --git a/src/addon/messages/pages/index/index.module.ts b/src/addon/messages/pages/index/index.module.ts index b2b1cdf17..a896440b7 100644 --- a/src/addon/messages/pages/index/index.module.ts +++ b/src/addon/messages/pages/index/index.module.ts @@ -16,9 +16,9 @@ import { NgModule } from '@angular/core'; import { IonicPageModule } from 'ionic-angular'; import { TranslateModule } from '@ngx-translate/core'; import { AddonMessagesIndexPage } from './index'; -import { CoreComponentsModule } from '../../../../components/components.module'; -import { CoreDirectivesModule } from '../../../../directives/directives.module'; -import { CorePipesModule } from '../../../../pipes/pipes.module'; +import { CoreComponentsModule } from '@components/components.module'; +import { CoreDirectivesModule } from '@directives'; +import { CorePipesModule } from '@pipes'; import { AddonMessagesComponentsModule } from '../../components/components.module'; @NgModule({ diff --git a/src/addon/messages/pages/index/index.ts b/src/addon/messages/pages/index/index.ts index c90ded7d5..e3b2975d2 100644 --- a/src/addon/messages/pages/index/index.ts +++ b/src/addon/messages/pages/index/index.ts @@ -14,10 +14,10 @@ import { Component, OnDestroy, ViewChild } from '@angular/core'; import { IonicPage } from 'ionic-angular'; -import { CoreEventsProvider } from '../../../../providers/events'; -import { CoreSitesProvider } from '../../../../providers/sites'; +import { CoreEventsProvider } from '@providers/events'; +import { CoreSitesProvider } from '@providers/sites'; import { AddonMessagesProvider } from '../../providers/messages'; -import { CoreSplitViewComponent } from '../../../../components/split-view/split-view'; +import { CoreSplitViewComponent } from '@components/split-view/split-view'; /** * Page that displays the messages index page. diff --git a/src/addon/messages/pages/settings/settings.module.ts b/src/addon/messages/pages/settings/settings.module.ts index ce9ec9475..a20e5f382 100644 --- a/src/addon/messages/pages/settings/settings.module.ts +++ b/src/addon/messages/pages/settings/settings.module.ts @@ -16,8 +16,8 @@ import { NgModule } from '@angular/core'; import { IonicPageModule } from 'ionic-angular'; import { TranslateModule } from '@ngx-translate/core'; import { AddonMessagesSettingsPage } from './settings'; -import { CoreComponentsModule } from '../../../../components/components.module'; -import { CoreDirectivesModule } from '../../../../directives/directives.module'; +import { CoreComponentsModule } from '@components/components.module'; +import { CoreDirectivesModule } from '@directives'; import { AddonMessagesComponentsModule } from '../../components/components.module'; @NgModule({ diff --git a/src/addon/messages/providers/discussion-link-handler.ts b/src/addon/messages/providers/discussion-link-handler.ts index d52dde403..869e9461b 100644 --- a/src/addon/messages/providers/discussion-link-handler.ts +++ b/src/addon/messages/providers/discussion-link-handler.ts @@ -13,11 +13,11 @@ // limitations under the License. import { Injectable } from '@angular/core'; -import { CoreContentLinksHandlerBase } from '../../../core/contentlinks/classes/base-handler'; -import { CoreContentLinksAction } from '../../../core/contentlinks/providers/delegate'; -import { CoreContentLinksHelperProvider } from '../../../core/contentlinks/providers/helper'; +import { CoreContentLinksHandlerBase } from '@core/contentlinks/classes/base-handler'; +import { CoreContentLinksAction } from '@core/contentlinks/providers/delegate'; +import { CoreContentLinksHelperProvider } from '@core/contentlinks/providers/helper'; import { AddonMessagesProvider } from './messages'; -import { CoreSitesProvider } from '../../../providers/sites'; +import { CoreSitesProvider } from '@providers/sites'; /** * Content links handler for a discussion. diff --git a/src/addon/messages/providers/index-link-handler.ts b/src/addon/messages/providers/index-link-handler.ts index a4ebfcbd1..5b162b772 100644 --- a/src/addon/messages/providers/index-link-handler.ts +++ b/src/addon/messages/providers/index-link-handler.ts @@ -13,9 +13,9 @@ // limitations under the License. import { Injectable } from '@angular/core'; -import { CoreContentLinksHandlerBase } from '../../../core/contentlinks/classes/base-handler'; -import { CoreContentLinksAction } from '../../../core/contentlinks/providers/delegate'; -import { CoreContentLinksHelperProvider } from '../../../core/contentlinks/providers/helper'; +import { CoreContentLinksHandlerBase } from '@core/contentlinks/classes/base-handler'; +import { CoreContentLinksAction } from '@core/contentlinks/providers/delegate'; +import { CoreContentLinksHelperProvider } from '@core/contentlinks/providers/helper'; import { AddonMessagesProvider } from './messages'; /** diff --git a/src/addon/messages/providers/mainmenu-handler.ts b/src/addon/messages/providers/mainmenu-handler.ts index 414e4fa38..82dec12b0 100644 --- a/src/addon/messages/providers/mainmenu-handler.ts +++ b/src/addon/messages/providers/mainmenu-handler.ts @@ -20,8 +20,10 @@ import { CoreSitesProvider } from '@providers/sites'; import { CoreEventsProvider } from '@providers/events'; import { CoreAppProvider } from '@providers/app'; import { CoreTextUtilsProvider } from '@providers/utils/text'; +import { CoreUtilsProvider } from '@providers/utils/utils'; import { CoreLocalNotificationsProvider } from '@providers/local-notifications'; import { AddonPushNotificationsProvider } from '@addon/pushnotifications/providers/pushnotifications'; +import { AddonPushNotificationsDelegate } from '@addon/pushnotifications/providers/delegate'; /** * Handler to inject an option into main menu. @@ -36,7 +38,8 @@ export class AddonMessagesMainMenuHandler implements CoreMainMenuHandler, CoreCr constructor(private messagesProvider: AddonMessagesProvider, private sitesProvider: CoreSitesProvider, private eventsProvider: CoreEventsProvider, private appProvider: CoreAppProvider, private localNotificationsProvider: CoreLocalNotificationsProvider, private textUtils: CoreTextUtilsProvider, - private pushNotificationsProvider: AddonPushNotificationsProvider) { + private pushNotificationsProvider: AddonPushNotificationsProvider, utils: CoreUtilsProvider, + pushNotificationsDelegate: AddonPushNotificationsDelegate) { eventsProvider.on(AddonMessagesProvider.READ_CHANGED_EVENT, (data) => { this.updateBadge(data.siteId); @@ -51,6 +54,17 @@ export class AddonMessagesMainMenuHandler implements CoreMainMenuHandler, CoreCr this.badge = ''; this.loading = true; }); + + // If a message push notification is received, refresh the count. + pushNotificationsDelegate.registerReceiveHandler('AddonMessagesMainMenuHandler', (notification) => { + // New message received. If it's from current site, refresh the data. + if (utils.isFalseOrZero(notification.notif) && this.sitesProvider.isCurrentSite(notification.site)) { + this.updateBadge(notification.site); + } + }); + + // Register Badge counter. + pushNotificationsDelegate.registerCounterHandler('mmaMessages'); } /** @@ -97,11 +111,8 @@ export class AddonMessagesMainMenuHandler implements CoreMainMenuHandler, CoreCr this.messagesProvider.getUnreadConversationsCount(undefined, siteId).then((unread) => { // Leave badge enter if there is a 0+ or a 0. this.badge = parseInt(unread, 10) > 0 ? unread : ''; - // @todo: use addon manager $mmaPushNotifications = $mmAddonManager.get('$mmaPushNotifications'); // Update badge. - if (this.pushNotificationsProvider) { - this.pushNotificationsProvider.updateAddonCounter('mmaMessages', unread, siteId); - } + this.pushNotificationsProvider.updateAddonCounter('mmaMessages', unread, siteId); }).catch(() => { this.badge = ''; }).finally(() => { @@ -126,6 +137,7 @@ export class AddonMessagesMainMenuHandler implements CoreMainMenuHandler, CoreCr } if (this.appProvider.isDesktop() && this.localNotificationsProvider.isAvailable()) { + // @todo /*$mmEmulatorHelper.checkNewNotifications( AddonMessagesProvider.PUSH_SIMULATION_COMPONENT, this.fetchMessages, this.getTitleAndText, siteId);*/ } diff --git a/src/addon/messages/providers/messages-offline.ts b/src/addon/messages/providers/messages-offline.ts index 04d7170f2..29799fbde 100644 --- a/src/addon/messages/providers/messages-offline.ts +++ b/src/addon/messages/providers/messages-offline.ts @@ -13,9 +13,9 @@ // limitations under the License. import { Injectable } from '@angular/core'; -import { CoreLoggerProvider } from '../../../providers/logger'; -import { CoreSitesProvider } from '../../../providers/sites'; -import { CoreAppProvider } from '../../../providers/app'; +import { CoreLoggerProvider } from '@providers/logger'; +import { CoreSitesProvider } from '@providers/sites'; +import { CoreAppProvider } from '@providers/app'; /** * Service to handle Offline messages. diff --git a/src/addon/messages/providers/messages.ts b/src/addon/messages/providers/messages.ts index 60f8bea99..3373e28ff 100644 --- a/src/addon/messages/providers/messages.ts +++ b/src/addon/messages/providers/messages.ts @@ -13,13 +13,13 @@ // limitations under the License. import { Injectable } from '@angular/core'; -import { CoreLoggerProvider } from '../../../providers/logger'; -import { CoreSitesProvider } from '../../../providers/sites'; -import { CoreAppProvider } from '../../../providers/app'; -import { CoreUserProvider } from '../../../core/user/providers/user'; +import { CoreLoggerProvider } from '@providers/logger'; +import { CoreSitesProvider } from '@providers/sites'; +import { CoreAppProvider } from '@providers/app'; +import { CoreUserProvider } from '@core/user/providers/user'; import { AddonMessagesOfflineProvider } from './messages-offline'; -import { CoreUtilsProvider } from '../../../providers/utils/utils'; -import { CoreTimeUtilsProvider } from '../../../providers/utils/time'; +import { CoreUtilsProvider } from '@providers/utils/utils'; +import { CoreTimeUtilsProvider } from '@providers/utils/time'; /** * Service to handle messages. @@ -872,13 +872,11 @@ export class AddonMessagesProvider { protected storeUsersFromDiscussions(discussions: any, siteId?: string): void { const users = []; for (const userId in discussions) { - if (typeof userId != 'undefined' && !isNaN(parseInt(userId))) { - users.push({ - id: userId, - fullname: discussions[userId].fullname, - profileimageurl: discussions[userId].profileimageurl - }); - } + users.push({ + id: userId, + fullname: discussions[userId].fullname, + profileimageurl: discussions[userId].profileimageurl + }); } this.userProvider.storeUsers(users, siteId); } diff --git a/src/addon/messages/providers/sync-cron-handler.ts b/src/addon/messages/providers/sync-cron-handler.ts index 4e4226953..4c643df83 100644 --- a/src/addon/messages/providers/sync-cron-handler.ts +++ b/src/addon/messages/providers/sync-cron-handler.ts @@ -13,8 +13,8 @@ // limitations under the License. import { Injectable } from '@angular/core'; -import { CoreCronHandler } from '../../../providers/cron'; -import { CoreSitesProvider } from '../../../providers/sites'; +import { CoreCronHandler } from '@providers/cron'; +import { CoreSitesProvider } from '@providers/sites'; import { AddonMessagesSyncProvider } from './sync'; /** diff --git a/src/addon/messages/providers/sync.ts b/src/addon/messages/providers/sync.ts index 66adb839f..c270ea0d9 100644 --- a/src/addon/messages/providers/sync.ts +++ b/src/addon/messages/providers/sync.ts @@ -13,14 +13,14 @@ // limitations under the License. import { Injectable } from '@angular/core'; -import { CoreLoggerProvider } from '../../../providers/logger'; -import { CoreSitesProvider } from '../../../providers/sites'; -import { CoreSyncBaseProvider } from '../../../classes/base-sync'; -import { CoreAppProvider } from '../../../providers/app'; +import { CoreLoggerProvider } from '@providers/logger'; +import { CoreSitesProvider } from '@providers/sites'; +import { CoreSyncBaseProvider } from '@classes/base-sync'; +import { CoreAppProvider } from '@providers/app'; import { AddonMessagesOfflineProvider } from './messages-offline'; import { AddonMessagesProvider } from './messages'; -import { CoreUserProvider } from '../../../core/user/providers/user'; -import { CoreEventsProvider } from '../../../providers/events'; +import { CoreUserProvider } from '@core/user/providers/user'; +import { CoreEventsProvider } from '@providers/events'; import { TranslateService } from '@ngx-translate/core'; /** diff --git a/src/addon/messages/providers/user-send-message-handler.ts b/src/addon/messages/providers/user-send-message-handler.ts index aae083c26..4ba84dbd1 100644 --- a/src/addon/messages/providers/user-send-message-handler.ts +++ b/src/addon/messages/providers/user-send-message-handler.ts @@ -13,9 +13,9 @@ // limitations under the License. import { Injectable } from '@angular/core'; -import { CoreUserDelegate, CoreUserProfileHandler, CoreUserProfileHandlerData } from '../../../core/user/providers/user-delegate'; -import { CoreSitesProvider } from '../../../providers/sites'; -import { CoreContentLinksHelperProvider } from '../../../core/contentlinks/providers/helper'; +import { CoreUserDelegate, CoreUserProfileHandler, CoreUserProfileHandlerData } from '@core/user/providers/user-delegate'; +import { CoreSitesProvider } from '@providers/sites'; +import { CoreContentLinksHelperProvider } from '@core/contentlinks/providers/helper'; import { AddonMessagesProvider } from './messages'; /** diff --git a/src/addon/mod/book/book.module.ts b/src/addon/mod/book/book.module.ts index cebd7bb9e..e2d43fe6c 100644 --- a/src/addon/mod/book/book.module.ts +++ b/src/addon/mod/book/book.module.ts @@ -18,9 +18,9 @@ import { AddonModBookProvider } from './providers/book'; import { AddonModBookModuleHandler } from './providers/module-handler'; import { AddonModBookLinkHandler } from './providers/link-handler'; import { AddonModBookPrefetchHandler } from './providers/prefetch-handler'; -import { CoreCourseModuleDelegate } from '../../../core/course/providers/module-delegate'; -import { CoreContentLinksDelegate } from '../../../core/contentlinks/providers/delegate'; -import { CoreCourseModulePrefetchDelegate } from '../../../core/course/providers/module-prefetch-delegate'; +import { CoreCourseModuleDelegate } from '@core/course/providers/module-delegate'; +import { CoreContentLinksDelegate } from '@core/contentlinks/providers/delegate'; +import { CoreCourseModulePrefetchDelegate } from '@core/course/providers/module-prefetch-delegate'; @NgModule({ declarations: [ diff --git a/src/addon/mod/book/components/components.module.ts b/src/addon/mod/book/components/components.module.ts index 1ea1ff532..cf175a12f 100644 --- a/src/addon/mod/book/components/components.module.ts +++ b/src/addon/mod/book/components/components.module.ts @@ -16,9 +16,9 @@ import { NgModule } from '@angular/core'; import { CommonModule } from '@angular/common'; import { IonicModule } from 'ionic-angular'; import { TranslateModule } from '@ngx-translate/core'; -import { CoreComponentsModule } from '../../../../components/components.module'; -import { CoreDirectivesModule } from '../../../../directives/directives.module'; -import { CoreCourseComponentsModule } from '../../../../core/course/components/components.module'; +import { CoreComponentsModule } from '@components/components.module'; +import { CoreDirectivesModule } from '@directives'; +import { CoreCourseComponentsModule } from '@core/course/components/components.module'; import { AddonModBookIndexComponent } from './index/index'; import { AddonModBookTocPopoverComponent } from './toc-popover/toc-popover'; import { AddonModBookNavigationArrowsComponent } from './navigation-arrows/navigation-arrows'; diff --git a/src/addon/mod/book/components/index/index.ts b/src/addon/mod/book/components/index/index.ts index 48e2592ed..8e2b4bb92 100644 --- a/src/addon/mod/book/components/index/index.ts +++ b/src/addon/mod/book/components/index/index.ts @@ -15,12 +15,12 @@ import { Component, OnInit, OnDestroy, Input, Output, EventEmitter, Optional } from '@angular/core'; import { NavParams, NavController, Content, PopoverController } from 'ionic-angular'; import { TranslateService } from '@ngx-translate/core'; -import { CoreAppProvider } from '../../../../../providers/app'; -import { CoreDomUtilsProvider } from '../../../../../providers/utils/dom'; -import { CoreTextUtilsProvider } from '../../../../../providers/utils/text'; -import { CoreCourseProvider } from '../../../../../core/course/providers/course'; -import { CoreCourseHelperProvider } from '../../../../../core/course/providers/helper'; -import { CoreCourseModuleMainComponent } from '../../../../../core/course/providers/module-delegate'; +import { CoreAppProvider } from '@providers/app'; +import { CoreDomUtilsProvider } from '@providers/utils/dom'; +import { CoreTextUtilsProvider } from '@providers/utils/text'; +import { CoreCourseProvider } from '@core/course/providers/course'; +import { CoreCourseHelperProvider } from '@core/course/providers/helper'; +import { CoreCourseModuleMainComponent } from '@core/course/providers/module-delegate'; import { AddonModBookProvider, AddonModBookContentsMap, AddonModBookTocChapter } from '../../providers/book'; import { AddonModBookPrefetchHandler } from '../../providers/prefetch-handler'; import { AddonModBookTocPopoverComponent } from '../../components/toc-popover/toc-popover'; diff --git a/src/addon/mod/book/pages/index/index.module.ts b/src/addon/mod/book/pages/index/index.module.ts index 02b409af8..bce50baa7 100644 --- a/src/addon/mod/book/pages/index/index.module.ts +++ b/src/addon/mod/book/pages/index/index.module.ts @@ -15,7 +15,7 @@ import { NgModule } from '@angular/core'; import { IonicPageModule } from 'ionic-angular'; import { TranslateModule } from '@ngx-translate/core'; -import { CoreDirectivesModule } from '../../../../../directives/directives.module'; +import { CoreDirectivesModule } from '@directives'; import { AddonModBookComponentsModule } from '../../components/components.module'; import { AddonModBookIndexPage } from './index'; diff --git a/src/addon/mod/book/providers/book.ts b/src/addon/mod/book/providers/book.ts index ba93df02a..b6d36e194 100644 --- a/src/addon/mod/book/providers/book.ts +++ b/src/addon/mod/book/providers/book.ts @@ -14,14 +14,14 @@ import { Injectable } from '@angular/core'; import { Http, Response } from '@angular/http'; -import { CoreFileProvider } from '../../../../providers/file'; -import { CoreFilepoolProvider } from '../../../../providers/filepool'; -import { CoreLoggerProvider } from '../../../../providers/logger'; -import { CoreSitesProvider } from '../../../../providers/sites'; -import { CoreDomUtilsProvider } from '../../../../providers/utils/dom'; -import { CoreTextUtilsProvider } from '../../../../providers/utils/text'; -import { CoreUtilsProvider } from '../../../../providers/utils/utils'; -import { CoreCourseProvider } from '../../../../core/course/providers/course'; +import { CoreFileProvider } from '@providers/file'; +import { CoreFilepoolProvider } from '@providers/filepool'; +import { CoreLoggerProvider } from '@providers/logger'; +import { CoreSitesProvider } from '@providers/sites'; +import { CoreDomUtilsProvider } from '@providers/utils/dom'; +import { CoreTextUtilsProvider } from '@providers/utils/text'; +import { CoreUtilsProvider } from '@providers/utils/utils'; +import { CoreCourseProvider } from '@core/course/providers/course'; /** * A book chapter inside the toc list. diff --git a/src/addon/mod/book/providers/link-handler.ts b/src/addon/mod/book/providers/link-handler.ts index 4013d4226..8f10bade7 100644 --- a/src/addon/mod/book/providers/link-handler.ts +++ b/src/addon/mod/book/providers/link-handler.ts @@ -13,8 +13,8 @@ // limitations under the License. import { Injectable } from '@angular/core'; -import { CoreContentLinksModuleIndexHandler } from '../../../../core/contentlinks/classes/module-index-handler'; -import { CoreCourseHelperProvider } from '../../../../core/course/providers/helper'; +import { CoreContentLinksModuleIndexHandler } from '@core/contentlinks/classes/module-index-handler'; +import { CoreCourseHelperProvider } from '@core/course/providers/helper'; /** * Handler to treat links to book. diff --git a/src/addon/mod/book/providers/module-handler.ts b/src/addon/mod/book/providers/module-handler.ts index 88fc25d7e..d88e95a24 100644 --- a/src/addon/mod/book/providers/module-handler.ts +++ b/src/addon/mod/book/providers/module-handler.ts @@ -16,8 +16,8 @@ import { Injectable } from '@angular/core'; import { NavController, NavOptions } from 'ionic-angular'; import { AddonModBookProvider } from './book'; import { AddonModBookIndexComponent } from '../components/index/index'; -import { CoreCourseModuleHandler, CoreCourseModuleHandlerData } from '../../../../core/course/providers/module-delegate'; -import { CoreCourseProvider } from '../../../../core/course/providers/course'; +import { CoreCourseModuleHandler, CoreCourseModuleHandlerData } from '@core/course/providers/module-delegate'; +import { CoreCourseProvider } from '@core/course/providers/course'; /** * Handler to support book modules. diff --git a/src/addon/mod/book/providers/prefetch-handler.ts b/src/addon/mod/book/providers/prefetch-handler.ts index 74bfd0aae..ca99a83fc 100644 --- a/src/addon/mod/book/providers/prefetch-handler.ts +++ b/src/addon/mod/book/providers/prefetch-handler.ts @@ -13,7 +13,7 @@ // limitations under the License. import { Injectable, Injector } from '@angular/core'; -import { CoreCourseModulePrefetchHandlerBase } from '../../../../core/course/classes/module-prefetch-handler'; +import { CoreCourseModulePrefetchHandlerBase } from '@core/course/classes/module-prefetch-handler'; import { AddonModBookProvider } from './book'; /** diff --git a/src/addon/mod/label/label.module.ts b/src/addon/mod/label/label.module.ts index f35ee2eaa..15be0e3cc 100644 --- a/src/addon/mod/label/label.module.ts +++ b/src/addon/mod/label/label.module.ts @@ -15,8 +15,8 @@ import { NgModule } from '@angular/core'; import { AddonModLabelModuleHandler } from './providers/module-handler'; import { AddonModLabelLinkHandler } from './providers/link-handler'; -import { CoreCourseModuleDelegate } from '../../../core/course/providers/module-delegate'; -import { CoreContentLinksDelegate } from '../../../core/contentlinks/providers/delegate'; +import { CoreCourseModuleDelegate } from '@core/course/providers/module-delegate'; +import { CoreContentLinksDelegate } from '@core/contentlinks/providers/delegate'; @NgModule({ declarations: [ diff --git a/src/addon/mod/label/providers/link-handler.ts b/src/addon/mod/label/providers/link-handler.ts index 5dc547d8c..72ed0d615 100644 --- a/src/addon/mod/label/providers/link-handler.ts +++ b/src/addon/mod/label/providers/link-handler.ts @@ -13,8 +13,8 @@ // limitations under the License. import { Injectable } from '@angular/core'; -import { CoreContentLinksModuleIndexHandler } from '../../../../core/contentlinks/classes/module-index-handler'; -import { CoreCourseHelperProvider } from '../../../../core/course/providers/helper'; +import { CoreContentLinksModuleIndexHandler } from '@core/contentlinks/classes/module-index-handler'; +import { CoreCourseHelperProvider } from '@core/course/providers/helper'; /** * Handler to treat links to label. diff --git a/src/addon/mod/label/providers/module-handler.ts b/src/addon/mod/label/providers/module-handler.ts index 5b76b9818..90cfdd780 100644 --- a/src/addon/mod/label/providers/module-handler.ts +++ b/src/addon/mod/label/providers/module-handler.ts @@ -13,7 +13,7 @@ // limitations under the License. import { Injectable } from '@angular/core'; -import { CoreCourseModuleHandler, CoreCourseModuleHandlerData } from '../../../../core/course/providers/module-delegate'; +import { CoreCourseModuleHandler, CoreCourseModuleHandlerData } from '@core/course/providers/module-delegate'; /** * Handler to support label modules. diff --git a/src/addon/pushnotifications/providers/delegate.ts b/src/addon/pushnotifications/providers/delegate.ts index 14b520240..6ecfaaa48 100644 --- a/src/addon/pushnotifications/providers/delegate.ts +++ b/src/addon/pushnotifications/providers/delegate.ts @@ -13,7 +13,7 @@ // limitations under the License. import { Injectable } from '@angular/core'; -import { CoreLoggerProvider } from '../../../providers/logger'; +import { CoreLoggerProvider } from '@providers/logger'; /** * Service to handle push notifications clicks. diff --git a/src/addon/pushnotifications/providers/pushnotifications.ts b/src/addon/pushnotifications/providers/pushnotifications.ts index ed6e368df..94607105a 100644 --- a/src/addon/pushnotifications/providers/pushnotifications.ts +++ b/src/addon/pushnotifications/providers/pushnotifications.ts @@ -78,14 +78,7 @@ export class AddonPushNotificationsProvider { * @return {Promise} Resolved when done. */ cleanSiteCounters(siteId: string): Promise { - return this.appDB.getRecords(this.BADGE_TABLE, {siteid: siteId} ).then((entries) => { - const promises = []; - entries.forEach((entry) => { - promises.push(this.appDB.remove(this.BADGE_TABLE, { siteid: entry.siteid, addon: entry.addon })); - }); - - return Promise.all(promises); - }).finally(() => { + return this.appDB.deleteRecords(this.BADGE_TABLE, {siteid: siteId} ).finally(() => { this.updateAppCounter(); }); } @@ -95,7 +88,7 @@ export class AddonPushNotificationsProvider { * @return {Promise} [description] */ protected getOptions(): Promise { - // @TODO: CoreSettingsProvider.NOTIFICATION_SOUND + // @todo: CoreSettingsProvider.NOTIFICATION_SOUND return this.configProvider.get('CoreSettingsProvider.NOTIFICATION_SOUND', true).then((soundEnabled) => { return { android: { @@ -195,8 +188,8 @@ export class AddonPushNotificationsProvider { this.pushNotificationsDelegate.received(data); }); } else { - // The notification was clicked. For compatibility with old push plugin implementation - // we'll merge all the notification data in a single object. + // The notification was clicked. + // For compatibility with old push plugin implementation we'll merge all the notification data in a single object. data.title = notification.title; data.message = notification.message; this.notificationClicked(data); @@ -289,9 +282,9 @@ export class AddonPushNotificationsProvider { const addons = this.pushNotificationsDelegate.getCounterHandlers(), promises = []; - addons.forEach((addon) => { - promises.push(this.getAddonBadge(siteId, addon)); - }); + for (const x in addons) { + promises.push(this.getAddonBadge(siteId, addons[x])); + } return Promise.all(promises).then((counters) => { let plus = false, @@ -334,7 +327,9 @@ export class AddonPushNotificationsProvider { pushObject.on('registration').subscribe((registrationId: any) => { this.pushID = registrationId; - this.registerDeviceOnMoodle(); + this.registerDeviceOnMoodle().catch((error) => { + this.logger.warn('Can\'t register device', error); + }); }); pushObject.on('error').subscribe((error: any) => { diff --git a/src/addon/pushnotifications/pushnotifications.module.ts b/src/addon/pushnotifications/pushnotifications.module.ts index ea2b0a360..56dfd1abb 100644 --- a/src/addon/pushnotifications/pushnotifications.module.ts +++ b/src/addon/pushnotifications/pushnotifications.module.ts @@ -17,6 +17,7 @@ import { Platform } from 'ionic-angular'; import { AddonPushNotificationsProvider } from './providers/pushnotifications'; import { AddonPushNotificationsDelegate } from './providers/delegate'; import { CoreEventsProvider } from '@providers/events'; +import { CoreLoggerProvider } from '@providers/logger'; import { CoreLocalNotificationsProvider } from '@providers/local-notifications'; @NgModule({ @@ -31,7 +32,9 @@ import { CoreLocalNotificationsProvider } from '@providers/local-notifications'; }) export class AddonPushNotificationsModule { constructor(platform: Platform, pushNotificationsProvider: AddonPushNotificationsProvider, eventsProvider: CoreEventsProvider, - localNotificationsProvider: CoreLocalNotificationsProvider) { + localNotificationsProvider: CoreLocalNotificationsProvider, loggerProvider: CoreLoggerProvider) { + + const logger = loggerProvider.getInstance('AddonPushNotificationsModule'); // Register device on GCM or APNS server. platform.ready().then(() => { @@ -45,11 +48,15 @@ export class AddonPushNotificationsModule { // Register device on Moodle site when login. eventsProvider.on(CoreEventsProvider.LOGIN, () => { - pushNotificationsProvider.registerDeviceOnMoodle(); + pushNotificationsProvider.registerDeviceOnMoodle().catch((error) => { + logger.warn('Can\'t register device', error); + }); }); eventsProvider.on(CoreEventsProvider.SITE_DELETED, (site) => { - pushNotificationsProvider.unregisterDeviceOnMoodle(site); + pushNotificationsProvider.unregisterDeviceOnMoodle(site).catch((error) => { + logger.warn('Can\'t unregister device', error); + }); pushNotificationsProvider.cleanSiteCounters(site.id); }); diff --git a/src/addon/userprofilefield/checkbox/checkbox.module.ts b/src/addon/userprofilefield/checkbox/checkbox.module.ts index c8358a518..ac828e8d4 100644 --- a/src/addon/userprofilefield/checkbox/checkbox.module.ts +++ b/src/addon/userprofilefield/checkbox/checkbox.module.ts @@ -16,9 +16,9 @@ import { NgModule } from '@angular/core'; import { IonicModule } from 'ionic-angular'; import { TranslateModule } from '@ngx-translate/core'; import { AddonUserProfileFieldCheckboxHandler } from './providers/handler'; -import { CoreUserProfileFieldDelegate } from '../../../core/user/providers/user-profile-field-delegate'; +import { CoreUserProfileFieldDelegate } from '@core/user/providers/user-profile-field-delegate'; import { AddonUserProfileFieldCheckboxComponent } from './component/checkbox'; -import { CoreComponentsModule } from '../../../components/components.module'; +import { CoreComponentsModule } from '@components/components.module'; @NgModule({ declarations: [ diff --git a/src/addon/userprofilefield/checkbox/component/checkbox.ts b/src/addon/userprofilefield/checkbox/component/checkbox.ts index 839c38e88..998187701 100644 --- a/src/addon/userprofilefield/checkbox/component/checkbox.ts +++ b/src/addon/userprofilefield/checkbox/component/checkbox.ts @@ -14,7 +14,7 @@ import { Component, Input, OnInit } from '@angular/core'; import { FormGroup, FormBuilder, Validators } from '@angular/forms'; -import { CoreUtilsProvider } from '../../../../providers/utils/utils'; +import { CoreUtilsProvider } from '@providers/utils/utils'; /** * Directive to render a checkbox user profile field. diff --git a/src/addon/userprofilefield/datetime/component/datetime.ts b/src/addon/userprofilefield/datetime/component/datetime.ts index 5c797ae92..1d43eaf80 100644 --- a/src/addon/userprofilefield/datetime/component/datetime.ts +++ b/src/addon/userprofilefield/datetime/component/datetime.ts @@ -14,8 +14,8 @@ import { Component, Input, OnInit } from '@angular/core'; import { FormGroup, FormBuilder, Validators } from '@angular/forms'; -import { CoreTimeUtilsProvider } from '../../../../providers/utils/time'; -import { CoreUtilsProvider } from '../../../../providers/utils/utils'; +import { CoreTimeUtilsProvider } from '@providers/utils/time'; +import { CoreUtilsProvider } from '@providers/utils/utils'; /** * Directive to render a datetime user profile field. diff --git a/src/addon/userprofilefield/datetime/datetime.module.ts b/src/addon/userprofilefield/datetime/datetime.module.ts index b1946bf1e..9814fc7e5 100644 --- a/src/addon/userprofilefield/datetime/datetime.module.ts +++ b/src/addon/userprofilefield/datetime/datetime.module.ts @@ -16,10 +16,10 @@ import { NgModule } from '@angular/core'; import { IonicModule } from 'ionic-angular'; import { TranslateModule } from '@ngx-translate/core'; import { AddonUserProfileFieldDatetimeHandler } from './providers/handler'; -import { CoreUserProfileFieldDelegate } from '../../../core/user/providers/user-profile-field-delegate'; +import { CoreUserProfileFieldDelegate } from '@core/user/providers/user-profile-field-delegate'; import { AddonUserProfileFieldDatetimeComponent } from './component/datetime'; -import { CoreComponentsModule } from '../../../components/components.module'; -import { CorePipesModule } from '../../../pipes/pipes.module'; +import { CoreComponentsModule } from '@components/components.module'; +import { CorePipesModule } from '@pipes'; @NgModule({ declarations: [ diff --git a/src/addon/userprofilefield/menu/menu.module.ts b/src/addon/userprofilefield/menu/menu.module.ts index 89965cb30..0329b2c78 100644 --- a/src/addon/userprofilefield/menu/menu.module.ts +++ b/src/addon/userprofilefield/menu/menu.module.ts @@ -16,10 +16,10 @@ import { NgModule } from '@angular/core'; import { IonicModule } from 'ionic-angular'; import { TranslateModule } from '@ngx-translate/core'; import { AddonUserProfileFieldMenuHandler } from './providers/handler'; -import { CoreUserProfileFieldDelegate } from '../../../core/user/providers/user-profile-field-delegate'; +import { CoreUserProfileFieldDelegate } from '@core/user/providers/user-profile-field-delegate'; import { AddonUserProfileFieldMenuComponent } from './component/menu'; -import { CoreComponentsModule } from '../../../components/components.module'; -import { CoreDirectivesModule } from '../../../directives/directives.module'; +import { CoreComponentsModule } from '@components/components.module'; +import { CoreDirectivesModule } from '@directives'; @NgModule({ declarations: [ diff --git a/src/addon/userprofilefield/text/component/text.ts b/src/addon/userprofilefield/text/component/text.ts index e8a8ea696..84f1f44c1 100644 --- a/src/addon/userprofilefield/text/component/text.ts +++ b/src/addon/userprofilefield/text/component/text.ts @@ -14,7 +14,7 @@ import { Component, Input, OnInit } from '@angular/core'; import { FormGroup, FormBuilder, Validators } from '@angular/forms'; -import { CoreUtilsProvider } from '../../../../providers/utils/utils'; +import { CoreUtilsProvider } from '@providers/utils/utils'; /** * Directive to render a text user profile field. diff --git a/src/addon/userprofilefield/text/providers/handler.ts b/src/addon/userprofilefield/text/providers/handler.ts index 1e75cc866..1953660ce 100644 --- a/src/addon/userprofilefield/text/providers/handler.ts +++ b/src/addon/userprofilefield/text/providers/handler.ts @@ -16,7 +16,7 @@ import { Injectable } from '@angular/core'; import { CoreUserProfileFieldHandler, CoreUserProfileFieldHandlerData } from '../../../../core/user/providers/user-profile-field-delegate'; import { AddonUserProfileFieldTextComponent } from '../component/text'; -import { CoreTextUtilsProvider } from '../../../../providers/utils/text'; +import { CoreTextUtilsProvider } from '@providers/utils/text'; /** * Text user profile field handlers. diff --git a/src/addon/userprofilefield/text/text.module.ts b/src/addon/userprofilefield/text/text.module.ts index c23f6bbea..a0cf647a6 100644 --- a/src/addon/userprofilefield/text/text.module.ts +++ b/src/addon/userprofilefield/text/text.module.ts @@ -16,10 +16,10 @@ import { NgModule } from '@angular/core'; import { IonicModule } from 'ionic-angular'; import { TranslateModule } from '@ngx-translate/core'; import { AddonUserProfileFieldTextHandler } from './providers/handler'; -import { CoreUserProfileFieldDelegate } from '../../../core/user/providers/user-profile-field-delegate'; +import { CoreUserProfileFieldDelegate } from '@core/user/providers/user-profile-field-delegate'; import { AddonUserProfileFieldTextComponent } from './component/text'; -import { CoreComponentsModule } from '../../../components/components.module'; -import { CoreDirectivesModule } from '../../../directives/directives.module'; +import { CoreComponentsModule } from '@components/components.module'; +import { CoreDirectivesModule } from '@directives'; @NgModule({ declarations: [ diff --git a/src/addon/userprofilefield/textarea/providers/handler.ts b/src/addon/userprofilefield/textarea/providers/handler.ts index 10044f151..1c07057db 100644 --- a/src/addon/userprofilefield/textarea/providers/handler.ts +++ b/src/addon/userprofilefield/textarea/providers/handler.ts @@ -16,7 +16,7 @@ import { Injectable } from '@angular/core'; import { CoreUserProfileFieldHandler, CoreUserProfileFieldHandlerData } from '../../../../core/user/providers/user-profile-field-delegate'; import { AddonUserProfileFieldTextareaComponent } from '../component/textarea'; -import { CoreTextUtilsProvider } from '../../../../providers/utils/text'; +import { CoreTextUtilsProvider } from '@providers/utils/text'; /** * Textarea user profile field handlers. diff --git a/src/addon/userprofilefield/textarea/textarea.module.ts b/src/addon/userprofilefield/textarea/textarea.module.ts index 6b5f696dc..1c2ce58ef 100644 --- a/src/addon/userprofilefield/textarea/textarea.module.ts +++ b/src/addon/userprofilefield/textarea/textarea.module.ts @@ -16,10 +16,10 @@ import { NgModule } from '@angular/core'; import { IonicModule } from 'ionic-angular'; import { TranslateModule } from '@ngx-translate/core'; import { AddonUserProfileFieldTextareaHandler } from './providers/handler'; -import { CoreUserProfileFieldDelegate } from '../../../core/user/providers/user-profile-field-delegate'; +import { CoreUserProfileFieldDelegate } from '@core/user/providers/user-profile-field-delegate'; import { AddonUserProfileFieldTextareaComponent } from './component/textarea'; -import { CoreComponentsModule } from '../../../components/components.module'; -import { CoreDirectivesModule } from '../../../directives/directives.module'; +import { CoreComponentsModule } from '@components/components.module'; +import { CoreDirectivesModule } from '@directives'; @NgModule({ declarations: [ diff --git a/src/classes/base-sync.ts b/src/classes/base-sync.ts index deeb06243..ee01ffe4d 100644 --- a/src/classes/base-sync.ts +++ b/src/classes/base-sync.ts @@ -12,10 +12,10 @@ // See the License for the specific language governing permissions and // limitations under the License. -import { CoreSitesProvider } from '../providers/sites'; -import { CoreSyncProvider } from '../providers/sync'; -import { CoreLoggerProvider } from '../providers/logger'; -import { CoreAppProvider } from '../providers/app'; +import { CoreSitesProvider } from '@providers/sites'; +import { CoreSyncProvider } from '@providers/sync'; +import { CoreLoggerProvider } from '@providers/logger'; +import { CoreAppProvider } from '@providers/app'; /** * Base class to create sync providers. It provides some common functions. diff --git a/src/classes/delegate.ts b/src/classes/delegate.ts index b26d26a32..00e1bf791 100644 --- a/src/classes/delegate.ts +++ b/src/classes/delegate.ts @@ -13,9 +13,9 @@ // limitations under the License. import { Injectable } from '@angular/core'; -import { CoreLoggerProvider } from '../providers/logger'; -import { CoreSitesProvider } from '../providers/sites'; -import { CoreEventsProvider } from '../providers/events'; +import { CoreLoggerProvider } from '@providers/logger'; +import { CoreSitesProvider } from '@providers/sites'; +import { CoreEventsProvider } from '@providers/events'; export interface CoreDelegateHandler { /** diff --git a/src/classes/site.ts b/src/classes/site.ts index e5e280cb3..276a1a0e7 100644 --- a/src/classes/site.ts +++ b/src/classes/site.ts @@ -16,18 +16,18 @@ import { Injector } from '@angular/core'; import { TranslateService } from '@ngx-translate/core'; import { HttpClient } from '@angular/common/http'; import { SQLiteDB } from './sqlitedb'; -import { CoreAppProvider } from '../providers/app'; -import { CoreDbProvider } from '../providers/db'; -import { CoreEventsProvider } from '../providers/events'; -import { CoreFileProvider } from '../providers/file'; -import { CoreLoggerProvider } from '../providers/logger'; -import { CoreWSProvider, CoreWSPreSets, CoreWSFileUploadOptions } from '../providers/ws'; -import { CoreDomUtilsProvider } from '../providers/utils/dom'; -import { CoreTextUtilsProvider } from '../providers/utils/text'; -import { CoreTimeUtilsProvider } from '../providers/utils/time'; -import { CoreUrlUtilsProvider } from '../providers/utils/url'; -import { CoreUtilsProvider } from '../providers/utils/utils'; -import { CoreConstants } from '../core/constants'; +import { CoreAppProvider } from '@providers/app'; +import { CoreDbProvider } from '@providers/db'; +import { CoreEventsProvider } from '@providers/events'; +import { CoreFileProvider } from '@providers/file'; +import { CoreLoggerProvider } from '@providers/logger'; +import { CoreWSProvider, CoreWSPreSets, CoreWSFileUploadOptions } from '@providers/ws'; +import { CoreDomUtilsProvider } from '@providers/utils/dom'; +import { CoreTextUtilsProvider } from '@providers/utils/text'; +import { CoreTimeUtilsProvider } from '@providers/utils/time'; +import { CoreUrlUtilsProvider } from '@providers/utils/url'; +import { CoreUtilsProvider } from '@providers/utils/utils'; +import { CoreConstants } from '@core/constants'; import { CoreConfigConstants } from '../configconstants'; import { Md5 } from 'ts-md5/dist/md5'; import { InAppBrowserObject } from '@ionic-native/in-app-browser'; diff --git a/src/components/components.module.ts b/src/components/components.module.ts index caa1d5a05..0c4a8b7de 100644 --- a/src/components/components.module.ts +++ b/src/components/components.module.ts @@ -15,8 +15,8 @@ import { NgModule } from '@angular/core'; import { IonicModule } from 'ionic-angular'; import { TranslateModule } from '@ngx-translate/core'; -import { CoreDirectivesModule } from '../directives/directives.module'; -import { CorePipesModule } from '../pipes/pipes.module'; +import { CoreDirectivesModule } from '@directives'; +import { CorePipesModule } from '@pipes'; import { CoreLoadingComponent } from './loading/loading'; import { CoreMarkRequiredComponent } from './mark-required/mark-required'; import { CoreInputErrorsComponent } from './input-errors/input-errors'; diff --git a/src/components/context-menu/context-menu-popover.ts b/src/components/context-menu/context-menu-popover.ts index 0dfc26b31..1d80f29be 100644 --- a/src/components/context-menu/context-menu-popover.ts +++ b/src/components/context-menu/context-menu-popover.ts @@ -15,7 +15,7 @@ import { Component } from '@angular/core'; import { NavParams, ViewController } from 'ionic-angular'; import { CoreContextMenuItemComponent } from './context-menu-item'; -import { CoreLoggerProvider } from '../../providers/logger'; +import { CoreLoggerProvider } from '@providers/logger'; /** * Component to display a list of items received by param in a popover. diff --git a/src/components/context-menu/context-menu.ts b/src/components/context-menu/context-menu.ts index 022305118..335aa2932 100644 --- a/src/components/context-menu/context-menu.ts +++ b/src/components/context-menu/context-menu.ts @@ -15,7 +15,7 @@ import { Component, Input, OnInit, OnDestroy, ElementRef } from '@angular/core'; import { PopoverController } from 'ionic-angular'; import { TranslateService } from '@ngx-translate/core'; -import { CoreDomUtilsProvider } from '../../providers/utils/dom'; +import { CoreDomUtilsProvider } from '@providers/utils/dom'; import { CoreContextMenuItemComponent } from './context-menu-item'; import { CoreContextMenuPopoverComponent } from './context-menu-popover'; import { Subject } from 'rxjs'; diff --git a/src/components/dynamic-component/dynamic-component.ts b/src/components/dynamic-component/dynamic-component.ts index 2c8e5898b..f2a045043 100644 --- a/src/components/dynamic-component/dynamic-component.ts +++ b/src/components/dynamic-component/dynamic-component.ts @@ -16,7 +16,7 @@ import { Component, Input, ViewChild, OnInit, OnChanges, DoCheck, ViewContainerRef, ComponentFactoryResolver, KeyValueDiffers, SimpleChange } from '@angular/core'; -import { CoreLoggerProvider } from '../../providers/logger'; +import { CoreLoggerProvider } from '@providers/logger'; /** * Component to create another component dynamically. diff --git a/src/components/file/file.ts b/src/components/file/file.ts index 60825b2f8..20023d454 100644 --- a/src/components/file/file.ts +++ b/src/components/file/file.ts @@ -14,15 +14,15 @@ import { Component, Input, Output, OnInit, OnDestroy, EventEmitter } from '@angular/core'; import { TranslateService } from '@ngx-translate/core'; -import { CoreAppProvider } from '../../providers/app'; -import { CoreEventsProvider } from '../../providers/events'; -import { CoreFileProvider } from '../../providers/file'; -import { CoreFilepoolProvider } from '../../providers/filepool'; -import { CoreSitesProvider } from '../../providers/sites'; -import { CoreDomUtilsProvider } from '../../providers/utils/dom'; -import { CoreMimetypeUtilsProvider } from '../../providers/utils/mimetype'; -import { CoreUtilsProvider } from '../../providers/utils/utils'; -import { CoreConstants } from '../../core/constants'; +import { CoreAppProvider } from '@providers/app'; +import { CoreEventsProvider } from '@providers/events'; +import { CoreFileProvider } from '@providers/file'; +import { CoreFilepoolProvider } from '@providers/filepool'; +import { CoreSitesProvider } from '@providers/sites'; +import { CoreDomUtilsProvider } from '@providers/utils/dom'; +import { CoreMimetypeUtilsProvider } from '@providers/utils/mimetype'; +import { CoreUtilsProvider } from '@providers/utils/utils'; +import { CoreConstants } from '@core/constants'; /** * Component to handle a remote file. Shows the file name, icon (depending on mimetype) and a button diff --git a/src/components/iframe/iframe.ts b/src/components/iframe/iframe.ts index 01686ac9e..005ec72a9 100644 --- a/src/components/iframe/iframe.ts +++ b/src/components/iframe/iframe.ts @@ -15,13 +15,13 @@ import { Component, Input, OnInit, ViewChild, ElementRef } from '@angular/core'; import { DomSanitizer, SafeResourceUrl } from '@angular/platform-browser'; import { Platform } from 'ionic-angular'; -import { CoreFileProvider } from '../../providers/file'; -import { CoreLoggerProvider } from '../../providers/logger'; -import { CoreSitesProvider } from '../../providers/sites'; -import { CoreDomUtilsProvider } from '../../providers/utils/dom'; -import { CoreTextUtilsProvider } from '../../providers/utils/text'; -import { CoreUrlUtilsProvider } from '../../providers/utils/url'; -import { CoreUtilsProvider } from '../../providers/utils/utils'; +import { CoreFileProvider } from '@providers/file'; +import { CoreLoggerProvider } from '@providers/logger'; +import { CoreSitesProvider } from '@providers/sites'; +import { CoreDomUtilsProvider } from '@providers/utils/dom'; +import { CoreTextUtilsProvider } from '@providers/utils/text'; +import { CoreUrlUtilsProvider } from '@providers/utils/url'; +import { CoreUtilsProvider } from '@providers/utils/utils'; /** */ diff --git a/src/components/loading/loading.ts b/src/components/loading/loading.ts index 0962eca65..e04326540 100644 --- a/src/components/loading/loading.ts +++ b/src/components/loading/loading.ts @@ -14,7 +14,7 @@ import { Component, Input, OnInit } from '@angular/core'; import { TranslateService } from '@ngx-translate/core'; -import { coreShowHideAnimation } from '../../classes/animations'; +import { coreShowHideAnimation } from '@classes/animations'; /** * Component to show a loading spinner and message while data is being loaded. diff --git a/src/components/local-file/local-file.ts b/src/components/local-file/local-file.ts index f2573959b..6f7dbb871 100644 --- a/src/components/local-file/local-file.ts +++ b/src/components/local-file/local-file.ts @@ -14,11 +14,11 @@ import { Component, Input, Output, OnInit, EventEmitter } from '@angular/core'; import { TranslateService } from '@ngx-translate/core'; -import { CoreFileProvider } from '../../providers/file'; -import { CoreDomUtilsProvider } from '../../providers/utils/dom'; -import { CoreMimetypeUtilsProvider } from '../../providers/utils/mimetype'; -import { CoreTextUtilsProvider } from '../../providers/utils/text'; -import { CoreUtilsProvider } from '../../providers/utils/utils'; +import { CoreFileProvider } from '@providers/file'; +import { CoreDomUtilsProvider } from '@providers/utils/dom'; +import { CoreMimetypeUtilsProvider } from '@providers/utils/mimetype'; +import { CoreTextUtilsProvider } from '@providers/utils/text'; +import { CoreUtilsProvider } from '@providers/utils/utils'; import * as moment from 'moment'; /** diff --git a/src/components/mark-required/mark-required.ts b/src/components/mark-required/mark-required.ts index bbc85d34b..c78a1692b 100644 --- a/src/components/mark-required/mark-required.ts +++ b/src/components/mark-required/mark-required.ts @@ -14,8 +14,8 @@ import { Component, Input, OnInit, AfterViewInit, ElementRef } from '@angular/core'; import { TranslateService } from '@ngx-translate/core'; -import { CoreTextUtilsProvider } from '../../providers/utils/text'; -import { CoreUtilsProvider } from '../../providers/utils/utils'; +import { CoreTextUtilsProvider } from '@providers/utils/text'; +import { CoreUtilsProvider } from '@providers/utils/utils'; /** * Directive to add a red asterisk for required input fields. diff --git a/src/components/navbar-buttons/navbar-buttons.ts b/src/components/navbar-buttons/navbar-buttons.ts index 6b969dfbb..d682248a6 100644 --- a/src/components/navbar-buttons/navbar-buttons.ts +++ b/src/components/navbar-buttons/navbar-buttons.ts @@ -14,8 +14,8 @@ import { Component, Input, OnInit, OnDestroy, ContentChildren, ElementRef, QueryList } from '@angular/core'; import { Button } from 'ionic-angular'; -import { CoreLoggerProvider } from '../../providers/logger'; -import { CoreDomUtilsProvider } from '../../providers/utils/dom'; +import { CoreLoggerProvider } from '@providers/logger'; +import { CoreDomUtilsProvider } from '@providers/utils/dom'; import { CoreContextMenuComponent } from '../context-menu/context-menu'; /** diff --git a/src/components/rich-text-editor/rich-text-editor.ts b/src/components/rich-text-editor/rich-text-editor.ts index 354e1d57d..bf0e9c0ec 100644 --- a/src/components/rich-text-editor/rich-text-editor.ts +++ b/src/components/rich-text-editor/rich-text-editor.ts @@ -14,7 +14,7 @@ import { Component, Input, Output, EventEmitter, ViewChild, ElementRef } from '@angular/core'; import { TextInput } from 'ionic-angular'; -import { CoreDomUtilsProvider } from '../../providers/utils/dom'; +import { CoreDomUtilsProvider } from '@providers/utils/dom'; import { FormControl } from '@angular/forms'; import { Keyboard } from '@ionic-native/keyboard'; diff --git a/src/components/search-box/search-box.ts b/src/components/search-box/search-box.ts index 497de1fb6..f8c9b5ec3 100644 --- a/src/components/search-box/search-box.ts +++ b/src/components/search-box/search-box.ts @@ -14,7 +14,7 @@ import { Component, Input, Output, EventEmitter, OnInit } from '@angular/core'; import { TranslateService } from '@ngx-translate/core'; -import { CoreUtilsProvider } from '../../providers/utils/utils'; +import { CoreUtilsProvider } from '@providers/utils/utils'; /** * Component to display a "search box". diff --git a/src/components/send-message-form/send-message-form.ts b/src/components/send-message-form/send-message-form.ts index 0b68d1f8f..2342d42e5 100644 --- a/src/components/send-message-form/send-message-form.ts +++ b/src/components/send-message-form/send-message-form.ts @@ -13,8 +13,8 @@ // limitations under the License. import { Component, Input, Output, EventEmitter, OnInit } from '@angular/core'; -import { CoreUtilsProvider } from '../../providers/utils/utils'; -import { CoreTextUtilsProvider } from '../../providers/utils/text'; +import { CoreUtilsProvider } from '@providers/utils/utils'; +import { CoreTextUtilsProvider } from '@providers/utils/text'; /** * Component to display a "send message form". diff --git a/src/components/show-password/show-password.ts b/src/components/show-password/show-password.ts index 6317be448..9da04c954 100644 --- a/src/components/show-password/show-password.ts +++ b/src/components/show-password/show-password.ts @@ -13,7 +13,7 @@ // limitations under the License. import { Component, OnInit, AfterViewInit, Input, ElementRef } from '@angular/core'; -import { CoreUtilsProvider } from '../../providers/utils/utils'; +import { CoreUtilsProvider } from '@providers/utils/utils'; /** * Component to allow showing and hiding a password. The affected input MUST have a name to identify it. diff --git a/src/components/site-picker/site-picker.ts b/src/components/site-picker/site-picker.ts index 9562f207a..6611a2190 100644 --- a/src/components/site-picker/site-picker.ts +++ b/src/components/site-picker/site-picker.ts @@ -14,8 +14,8 @@ import { Component, Input, Output, EventEmitter, OnInit } from '@angular/core'; import { TranslateService } from '@ngx-translate/core'; -import { CoreSitesProvider } from '../../providers/sites'; -import { CoreTextUtilsProvider } from '../../providers/utils/text'; +import { CoreSitesProvider } from '@providers/sites'; +import { CoreTextUtilsProvider } from '@providers/utils/text'; /** * Component to display a site selector. It will display a select with the list of sites. If the selected site changes, diff --git a/src/components/tabs/tab.ts b/src/components/tabs/tab.ts index 6a36878a1..95102e758 100644 --- a/src/components/tabs/tab.ts +++ b/src/components/tabs/tab.ts @@ -15,7 +15,7 @@ import { Component, Input, Output, OnInit, OnDestroy, ElementRef, EventEmitter, ContentChild, TemplateRef } from '@angular/core'; import { CoreTabsComponent } from './tabs'; import { Content } from 'ionic-angular'; -import { CoreDomUtilsProvider } from '../../providers/utils/dom'; +import { CoreDomUtilsProvider } from '@providers/utils/dom'; import { CoreNavBarButtonsComponent } from '../navbar-buttons/navbar-buttons'; /** diff --git a/src/core/contentlinks/classes/module-grade-handler.ts b/src/core/contentlinks/classes/module-grade-handler.ts index edf7bcac0..36296e5b6 100644 --- a/src/core/contentlinks/classes/module-grade-handler.ts +++ b/src/core/contentlinks/classes/module-grade-handler.ts @@ -15,8 +15,8 @@ import { NavController } from 'ionic-angular'; import { CoreContentLinksAction } from '../providers/delegate'; import { CoreContentLinksHandlerBase } from './base-handler'; -import { CoreSitesProvider } from '../../../providers/sites'; -import { CoreDomUtilsProvider } from '../../../providers/utils/dom'; +import { CoreSitesProvider } from '@providers/sites'; +import { CoreDomUtilsProvider } from '@providers/utils/dom'; import { CoreCourseHelperProvider } from '../../course/providers/helper'; /** diff --git a/src/core/contentlinks/pages/choose-site/choose-site.module.ts b/src/core/contentlinks/pages/choose-site/choose-site.module.ts index abd8544de..10e7ffe90 100644 --- a/src/core/contentlinks/pages/choose-site/choose-site.module.ts +++ b/src/core/contentlinks/pages/choose-site/choose-site.module.ts @@ -16,8 +16,8 @@ import { NgModule } from '@angular/core'; import { IonicPageModule } from 'ionic-angular'; import { CoreContentLinksChooseSitePage } from './choose-site'; import { TranslateModule } from '@ngx-translate/core'; -import { CoreComponentsModule } from '../../../../components/components.module'; -import { CoreDirectivesModule } from '../../../../directives/directives.module'; +import { CoreComponentsModule } from '@components/components.module'; +import { CoreDirectivesModule } from '@directives'; @NgModule({ declarations: [ diff --git a/src/core/contentlinks/pages/choose-site/choose-site.ts b/src/core/contentlinks/pages/choose-site/choose-site.ts index 922e743ea..64bfceead 100644 --- a/src/core/contentlinks/pages/choose-site/choose-site.ts +++ b/src/core/contentlinks/pages/choose-site/choose-site.ts @@ -14,8 +14,8 @@ import { Component, OnInit } from '@angular/core'; import { IonicPage, NavController, NavParams } from 'ionic-angular'; -import { CoreSitesProvider } from '../../../../providers/sites'; -import { CoreDomUtilsProvider } from '../../../../providers/utils/dom'; +import { CoreSitesProvider } from '@providers/sites'; +import { CoreDomUtilsProvider } from '@providers/utils/dom'; import { CoreContentLinksDelegate, CoreContentLinksAction } from '../../providers/delegate'; import { CoreContentLinksHelperProvider } from '../../providers/helper'; diff --git a/src/core/contentlinks/providers/delegate.ts b/src/core/contentlinks/providers/delegate.ts index 5aecc1f5a..21b1da364 100644 --- a/src/core/contentlinks/providers/delegate.ts +++ b/src/core/contentlinks/providers/delegate.ts @@ -14,10 +14,10 @@ import { Injectable } from '@angular/core'; import { NavController } from 'ionic-angular'; -import { CoreLoggerProvider } from '../../../providers/logger'; -import { CoreSitesProvider } from '../../../providers/sites'; -import { CoreUrlUtilsProvider } from '../../../providers/utils/url'; -import { CoreUtilsProvider } from '../../../providers/utils/utils'; +import { CoreLoggerProvider } from '@providers/logger'; +import { CoreSitesProvider } from '@providers/sites'; +import { CoreUrlUtilsProvider } from '@providers/utils/url'; +import { CoreUtilsProvider } from '@providers/utils/utils'; /** * Interface that all handlers must implement. diff --git a/src/core/contentlinks/providers/helper.ts b/src/core/contentlinks/providers/helper.ts index cdf1be398..c160a86b1 100644 --- a/src/core/contentlinks/providers/helper.ts +++ b/src/core/contentlinks/providers/helper.ts @@ -15,14 +15,14 @@ import { Injectable } from '@angular/core'; import { NavController } from 'ionic-angular'; import { TranslateService } from '@ngx-translate/core'; -import { CoreAppProvider } from '../../../providers/app'; -import { CoreEventsProvider } from '../../../providers/events'; -import { CoreInitDelegate } from '../../../providers/init'; -import { CoreLoggerProvider } from '../../../providers/logger'; -import { CoreSitesProvider } from '../../../providers/sites'; -import { CoreDomUtilsProvider } from '../../../providers/utils/dom'; -import { CoreTextUtilsProvider } from '../../../providers/utils/text'; -import { CoreUrlUtilsProvider } from '../../../providers/utils/url'; +import { CoreAppProvider } from '@providers/app'; +import { CoreEventsProvider } from '@providers/events'; +import { CoreInitDelegate } from '@providers/init'; +import { CoreLoggerProvider } from '@providers/logger'; +import { CoreSitesProvider } from '@providers/sites'; +import { CoreDomUtilsProvider } from '@providers/utils/dom'; +import { CoreTextUtilsProvider } from '@providers/utils/text'; +import { CoreUrlUtilsProvider } from '@providers/utils/url'; import { CoreLoginHelperProvider } from '../../login/providers/helper'; import { CoreContentLinksDelegate, CoreContentLinksAction } from './delegate'; import { CoreConstants } from '../../constants'; diff --git a/src/core/course/classes/module-prefetch-handler.ts b/src/core/course/classes/module-prefetch-handler.ts index 47b115140..7fde10f08 100644 --- a/src/core/course/classes/module-prefetch-handler.ts +++ b/src/core/course/classes/module-prefetch-handler.ts @@ -14,11 +14,11 @@ import { Injector } from '@angular/core'; import { TranslateService } from '@ngx-translate/core'; -import { CoreAppProvider } from '../../../providers/app'; -import { CoreFilepoolProvider } from '../../../providers/filepool'; -import { CoreSitesProvider } from '../../../providers/sites'; -import { CoreDomUtilsProvider } from '../../../providers/utils/dom'; -import { CoreUtilsProvider } from '../../../providers/utils/utils'; +import { CoreAppProvider } from '@providers/app'; +import { CoreFilepoolProvider } from '@providers/filepool'; +import { CoreSitesProvider } from '@providers/sites'; +import { CoreDomUtilsProvider } from '@providers/utils/dom'; +import { CoreUtilsProvider } from '@providers/utils/utils'; import { CoreCourseProvider } from '../providers/course'; import { CoreCourseModulePrefetchHandler } from '../providers/module-prefetch-delegate'; import { CoreConstants } from '../../constants'; diff --git a/src/core/course/components/components.module.ts b/src/core/course/components/components.module.ts index ab679c5f3..021427bf3 100644 --- a/src/core/course/components/components.module.ts +++ b/src/core/course/components/components.module.ts @@ -16,8 +16,8 @@ import { NgModule } from '@angular/core'; import { CommonModule } from '@angular/common'; import { IonicModule } from 'ionic-angular'; import { TranslateModule } from '@ngx-translate/core'; -import { CoreComponentsModule } from '../../../components/components.module'; -import { CoreDirectivesModule } from '../../../directives/directives.module'; +import { CoreComponentsModule } from '@components/components.module'; +import { CoreDirectivesModule } from '@directives'; import { CoreCourseFormatComponent } from './format/format'; import { CoreCourseModuleComponent } from './module/module'; import { CoreCourseModuleCompletionComponent } from './module-completion/module-completion'; diff --git a/src/core/course/components/format/format.ts b/src/core/course/components/format/format.ts index ceb8780ca..b4a2985a9 100644 --- a/src/core/course/components/format/format.ts +++ b/src/core/course/components/format/format.ts @@ -17,14 +17,14 @@ import { } from '@angular/core'; import { Content } from 'ionic-angular'; import { TranslateService } from '@ngx-translate/core'; -import { CoreEventsProvider } from '../../../../providers/events'; -import { CoreSitesProvider } from '../../../../providers/sites'; -import { CoreDomUtilsProvider } from '../../../../providers/utils/dom'; +import { CoreEventsProvider } from '@providers/events'; +import { CoreSitesProvider } from '@providers/sites'; +import { CoreDomUtilsProvider } from '@providers/utils/dom'; import { CoreCourseProvider } from '../../../course/providers/course'; import { CoreCourseHelperProvider } from '../../../course/providers/helper'; import { CoreCourseFormatDelegate } from '../../../course/providers/format-delegate'; import { CoreCourseModulePrefetchDelegate } from '../../../course/providers/module-prefetch-delegate'; -import { CoreDynamicComponent } from '../../../../components/dynamic-component/dynamic-component'; +import { CoreDynamicComponent } from '@components/dynamic-component/dynamic-component'; /** * Component to display course contents using a certain format. If the format isn't found, use default one. diff --git a/src/core/course/components/module-completion/module-completion.ts b/src/core/course/components/module-completion/module-completion.ts index 56b910978..6290ae798 100644 --- a/src/core/course/components/module-completion/module-completion.ts +++ b/src/core/course/components/module-completion/module-completion.ts @@ -14,9 +14,9 @@ import { Component, Input, Output, EventEmitter, OnChanges, SimpleChange } from '@angular/core'; import { TranslateService } from '@ngx-translate/core'; -import { CoreSitesProvider } from '../../../../providers/sites'; -import { CoreDomUtilsProvider } from '../../../../providers/utils/dom'; -import { CoreTextUtilsProvider } from '../../../../providers/utils/text'; +import { CoreSitesProvider } from '@providers/sites'; +import { CoreDomUtilsProvider } from '@providers/utils/dom'; +import { CoreTextUtilsProvider } from '@providers/utils/text'; import { CoreUserProvider } from '../../../user/providers/user'; /** diff --git a/src/core/course/components/module/module.ts b/src/core/course/components/module/module.ts index 15a66286b..00d0bbf1f 100644 --- a/src/core/course/components/module/module.ts +++ b/src/core/course/components/module/module.ts @@ -14,9 +14,9 @@ import { Component, Input, Output, EventEmitter, OnInit, OnDestroy } from '@angular/core'; import { NavController } from 'ionic-angular'; -import { CoreEventsProvider } from '../../../../providers/events'; -import { CoreSitesProvider } from '../../../../providers/sites'; -import { CoreDomUtilsProvider } from '../../../../providers/utils/dom'; +import { CoreEventsProvider } from '@providers/events'; +import { CoreSitesProvider } from '@providers/sites'; +import { CoreDomUtilsProvider } from '@providers/utils/dom'; import { CoreCourseHelperProvider } from '../../providers/helper'; import { CoreCourseModuleHandlerButton } from '../../providers/module-delegate'; import { CoreCourseModulePrefetchDelegate, CoreCourseModulePrefetchHandler } from '../../providers/module-prefetch-delegate'; diff --git a/src/core/course/formats/singleactivity/singleactivity.module.ts b/src/core/course/formats/singleactivity/singleactivity.module.ts index 8899f01db..a35d4ad93 100644 --- a/src/core/course/formats/singleactivity/singleactivity.module.ts +++ b/src/core/course/formats/singleactivity/singleactivity.module.ts @@ -16,7 +16,7 @@ import { NgModule } from '@angular/core'; import { CoreCourseFormatSingleActivityComponent } from './components/singleactivity'; import { CoreCourseFormatSingleActivityHandler } from './providers/handler'; import { CoreCourseFormatDelegate } from '../../providers/format-delegate'; -import { CoreComponentsModule } from '../../../../components/components.module'; +import { CoreComponentsModule } from '@components/components.module'; @NgModule({ declarations: [ diff --git a/src/core/course/formats/weeks/providers/handler.ts b/src/core/course/formats/weeks/providers/handler.ts index 6feca32cd..7fea18e9a 100644 --- a/src/core/course/formats/weeks/providers/handler.ts +++ b/src/core/course/formats/weeks/providers/handler.ts @@ -14,7 +14,7 @@ import { Injectable } from '@angular/core'; import { CoreCourseFormatHandler } from '../../../providers/format-delegate'; -import { CoreTimeUtilsProvider } from '../../../../../providers/utils/time'; +import { CoreTimeUtilsProvider } from '@providers/utils/time'; import { CoreConstants } from '../../../../constants'; /** diff --git a/src/core/course/pages/section/section.module.ts b/src/core/course/pages/section/section.module.ts index c9ab2da0f..bfa4d3eb3 100644 --- a/src/core/course/pages/section/section.module.ts +++ b/src/core/course/pages/section/section.module.ts @@ -16,8 +16,8 @@ import { NgModule } from '@angular/core'; import { IonicPageModule } from 'ionic-angular'; import { TranslateModule } from '@ngx-translate/core'; import { CoreCourseSectionPage } from './section'; -import { CoreComponentsModule } from '../../../../components/components.module'; -import { CoreDirectivesModule } from '../../../../directives/directives.module'; +import { CoreComponentsModule } from '@components/components.module'; +import { CoreDirectivesModule } from '@directives'; import { CoreCourseComponentsModule } from '../../components/components.module'; @NgModule({ diff --git a/src/core/course/pages/section/section.ts b/src/core/course/pages/section/section.ts index d0cd1647c..0e0ced8b7 100644 --- a/src/core/course/pages/section/section.ts +++ b/src/core/course/pages/section/section.ts @@ -15,10 +15,10 @@ import { Component, ViewChild, OnDestroy } from '@angular/core'; import { IonicPage, NavParams, Content, NavController } from 'ionic-angular'; import { TranslateService } from '@ngx-translate/core'; -import { CoreEventsProvider } from '../../../../providers/events'; -import { CoreSitesProvider } from '../../../../providers/sites'; -import { CoreDomUtilsProvider } from '../../../../providers/utils/dom'; -import { CoreTextUtilsProvider } from '../../../../providers/utils/text'; +import { CoreEventsProvider } from '@providers/events'; +import { CoreSitesProvider } from '@providers/sites'; +import { CoreDomUtilsProvider } from '@providers/utils/dom'; +import { CoreTextUtilsProvider } from '@providers/utils/text'; import { CoreCourseProvider } from '../../providers/course'; import { CoreCourseHelperProvider } from '../../providers/helper'; import { CoreCourseFormatDelegate } from '../../providers/format-delegate'; diff --git a/src/core/course/pages/unsupported-module/unsupported-module.module.ts b/src/core/course/pages/unsupported-module/unsupported-module.module.ts index d45906da4..5d2ca24a9 100644 --- a/src/core/course/pages/unsupported-module/unsupported-module.module.ts +++ b/src/core/course/pages/unsupported-module/unsupported-module.module.ts @@ -16,8 +16,8 @@ import { NgModule } from '@angular/core'; import { IonicPageModule } from 'ionic-angular'; import { TranslateModule } from '@ngx-translate/core'; import { CoreCourseUnsupportedModulePage } from './unsupported-module'; -import { CoreComponentsModule } from '../../../../components/components.module'; -import { CoreDirectivesModule } from '../../../../directives/directives.module'; +import { CoreComponentsModule } from '@components/components.module'; +import { CoreDirectivesModule } from '@directives'; import { CoreCourseComponentsModule } from '../../components/components.module'; @NgModule({ diff --git a/src/core/course/pages/unsupported-module/unsupported-module.ts b/src/core/course/pages/unsupported-module/unsupported-module.ts index 7e8554f59..e52c44b1f 100644 --- a/src/core/course/pages/unsupported-module/unsupported-module.ts +++ b/src/core/course/pages/unsupported-module/unsupported-module.ts @@ -15,7 +15,7 @@ import { Component } from '@angular/core'; import { IonicPage, NavParams } from 'ionic-angular'; import { TranslateService } from '@ngx-translate/core'; -import { CoreTextUtilsProvider } from '../../../../providers/utils/text'; +import { CoreTextUtilsProvider } from '@providers/utils/text'; /** * Page that displays info about an unsupported module. diff --git a/src/core/course/providers/course.ts b/src/core/course/providers/course.ts index b814689d7..9239b8921 100644 --- a/src/core/course/providers/course.ts +++ b/src/core/course/providers/course.ts @@ -14,12 +14,12 @@ import { Injectable } from '@angular/core'; import { TranslateService } from '@ngx-translate/core'; -import { CoreEventsProvider } from '../../../providers/events'; -import { CoreLoggerProvider } from '../../../providers/logger'; -import { CoreSitesProvider } from '../../../providers/sites'; -import { CoreTimeUtilsProvider } from '../../../providers/utils/time'; -import { CoreUtilsProvider } from '../../../providers/utils/utils'; -import { CoreSiteWSPreSets } from '../../../classes/site'; +import { CoreEventsProvider } from '@providers/events'; +import { CoreLoggerProvider } from '@providers/logger'; +import { CoreSitesProvider } from '@providers/sites'; +import { CoreTimeUtilsProvider } from '@providers/utils/time'; +import { CoreUtilsProvider } from '@providers/utils/utils'; +import { CoreSiteWSPreSets } from '@classes/site'; import { CoreConstants } from '../../constants'; /** diff --git a/src/core/course/providers/format-delegate.ts b/src/core/course/providers/format-delegate.ts index 48d43bd34..2398f4192 100644 --- a/src/core/course/providers/format-delegate.ts +++ b/src/core/course/providers/format-delegate.ts @@ -14,12 +14,12 @@ import { Injectable } from '@angular/core'; import { NavController } from 'ionic-angular'; -import { CoreEventsProvider } from '../../../providers/events'; -import { CoreLoggerProvider } from '../../../providers/logger'; -import { CoreSitesProvider } from '../../../providers/sites'; +import { CoreEventsProvider } from '@providers/events'; +import { CoreLoggerProvider } from '@providers/logger'; +import { CoreSitesProvider } from '@providers/sites'; import { CoreCourseProvider } from './course'; import { CoreCourseFormatDefaultHandler } from './default-format'; -import { CoreDelegate, CoreDelegateHandler } from '../../../classes/delegate'; +import { CoreDelegate, CoreDelegateHandler } from '@classes/delegate'; /** * Interface that all course format handlers must implement. diff --git a/src/core/course/providers/helper.ts b/src/core/course/providers/helper.ts index 36fbc2433..fedffa140 100644 --- a/src/core/course/providers/helper.ts +++ b/src/core/course/providers/helper.ts @@ -15,13 +15,13 @@ import { Injectable } from '@angular/core'; import { NavController } from 'ionic-angular'; import { TranslateService } from '@ngx-translate/core'; -import { CoreEventsProvider } from '../../../providers/events'; -import { CoreFilepoolProvider } from '../../../providers/filepool'; -import { CoreSitesProvider } from '../../../providers/sites'; -import { CoreDomUtilsProvider } from '../../../providers/utils/dom'; -import { CoreTextUtilsProvider } from '../../../providers/utils/text'; -import { CoreTimeUtilsProvider } from '../../../providers/utils/time'; -import { CoreUtilsProvider } from '../../../providers/utils/utils'; +import { CoreEventsProvider } from '@providers/events'; +import { CoreFilepoolProvider } from '@providers/filepool'; +import { CoreSitesProvider } from '@providers/sites'; +import { CoreDomUtilsProvider } from '@providers/utils/dom'; +import { CoreTextUtilsProvider } from '@providers/utils/text'; +import { CoreTimeUtilsProvider } from '@providers/utils/time'; +import { CoreUtilsProvider } from '@providers/utils/utils'; import { CoreCourseOptionsDelegate, CoreCourseOptionsHandlerToDisplay } from './options-delegate'; import { CoreSiteHomeProvider } from '../../sitehome/providers/sitehome'; import { CoreCourseProvider } from './course'; @@ -29,7 +29,7 @@ import { CoreCourseModuleDelegate } from './module-delegate'; import { CoreCourseModulePrefetchDelegate } from './module-prefetch-delegate'; import { CoreLoginHelperProvider } from '../../login/providers/helper'; import { CoreConstants } from '../../constants'; -import { CoreSite } from '../../../classes/site'; +import { CoreSite } from '@classes/site'; import * as moment from 'moment'; /** diff --git a/src/core/course/providers/module-delegate.ts b/src/core/course/providers/module-delegate.ts index 1a2e8c057..53f910b08 100644 --- a/src/core/course/providers/module-delegate.ts +++ b/src/core/course/providers/module-delegate.ts @@ -14,12 +14,12 @@ import { Injectable } from '@angular/core'; import { NavController, NavOptions } from 'ionic-angular'; -import { CoreEventsProvider } from '../../../providers/events'; -import { CoreLoggerProvider } from '../../../providers/logger'; -import { CoreSitesProvider } from '../../../providers/sites'; +import { CoreEventsProvider } from '@providers/events'; +import { CoreLoggerProvider } from '@providers/logger'; +import { CoreSitesProvider } from '@providers/sites'; import { CoreCourseProvider } from './course'; -import { CoreSite } from '../../../classes/site'; -import { CoreDelegate, CoreDelegateHandler } from '../../../classes/delegate'; +import { CoreSite } from '@classes/site'; +import { CoreDelegate, CoreDelegateHandler } from '@classes/delegate'; /** * Interface that all course module handlers must implement. diff --git a/src/core/course/providers/module-prefetch-delegate.ts b/src/core/course/providers/module-prefetch-delegate.ts index 964f67ac2..76589a93e 100644 --- a/src/core/course/providers/module-prefetch-delegate.ts +++ b/src/core/course/providers/module-prefetch-delegate.ts @@ -13,20 +13,20 @@ // limitations under the License. import { Injectable } from '@angular/core'; -import { CoreEventsProvider } from '../../../providers/events'; -import { CoreFileProvider } from '../../../providers/file'; -import { CoreFilepoolProvider } from '../../../providers/filepool'; -import { CoreLoggerProvider } from '../../../providers/logger'; -import { CoreSitesProvider } from '../../../providers/sites'; -import { CoreTimeUtilsProvider } from '../../../providers/utils/time'; -import { CoreUtilsProvider } from '../../../providers/utils/utils'; +import { CoreEventsProvider } from '@providers/events'; +import { CoreFileProvider } from '@providers/file'; +import { CoreFilepoolProvider } from '@providers/filepool'; +import { CoreLoggerProvider } from '@providers/logger'; +import { CoreSitesProvider } from '@providers/sites'; +import { CoreTimeUtilsProvider } from '@providers/utils/time'; +import { CoreUtilsProvider } from '@providers/utils/utils'; import { CoreCourseProvider } from './course'; -import { CoreCache } from '../../../classes/cache'; -import { CoreSiteWSPreSets } from '../../../classes/site'; +import { CoreCache } from '@classes/cache'; +import { CoreSiteWSPreSets } from '@classes/site'; import { CoreConstants } from '../../constants'; import { Md5 } from 'ts-md5/dist/md5'; import { Subject, BehaviorSubject, Subscription } from 'rxjs'; -import { CoreDelegate, CoreDelegateHandler } from '../../../classes/delegate'; +import { CoreDelegate, CoreDelegateHandler } from '@classes/delegate'; /** * Progress of downloading a list of modules. diff --git a/src/core/course/providers/options-delegate.ts b/src/core/course/providers/options-delegate.ts index 6cb0e43aa..35182a369 100644 --- a/src/core/course/providers/options-delegate.ts +++ b/src/core/course/providers/options-delegate.ts @@ -13,11 +13,11 @@ // limitations under the License. import { Injectable } from '@angular/core'; -import { CoreDelegate, CoreDelegateHandler } from '../../../classes/delegate'; -import { CoreEventsProvider } from '../../../providers/events'; -import { CoreLoggerProvider } from '../../../providers/logger'; -import { CoreSitesProvider } from '../../../providers/sites'; -import { CoreUtilsProvider, PromiseDefer } from '../../../providers/utils/utils'; +import { CoreDelegate, CoreDelegateHandler } from '@classes/delegate'; +import { CoreEventsProvider } from '@providers/events'; +import { CoreLoggerProvider } from '@providers/logger'; +import { CoreSitesProvider } from '@providers/sites'; +import { CoreUtilsProvider, PromiseDefer } from '@providers/utils/utils'; import { CoreCoursesProvider } from '../../courses/providers/courses'; import { CoreCourseProvider } from './course'; diff --git a/src/core/courses/components/components.module.ts b/src/core/courses/components/components.module.ts index d34f17cac..d8dbe5a35 100644 --- a/src/core/courses/components/components.module.ts +++ b/src/core/courses/components/components.module.ts @@ -16,9 +16,9 @@ import { NgModule } from '@angular/core'; import { CommonModule } from '@angular/common'; import { IonicModule } from 'ionic-angular'; import { TranslateModule } from '@ngx-translate/core'; -import { CoreComponentsModule } from '../../../components/components.module'; -import { CoreDirectivesModule } from '../../../directives/directives.module'; -import { CorePipesModule } from '../../../pipes/pipes.module'; +import { CoreComponentsModule } from '@components/components.module'; +import { CoreDirectivesModule } from '@directives'; +import { CorePipesModule } from '@pipes'; import { CoreCoursesCourseProgressComponent } from '../components/course-progress/course-progress'; import { CoreCoursesCourseListItemComponent } from '../components/course-list-item/course-list-item'; import { CoreCoursesOverviewEventsComponent } from '../components/overview-events/overview-events'; diff --git a/src/core/courses/components/course-progress/course-progress.ts b/src/core/courses/components/course-progress/course-progress.ts index 59e4b9f85..f5152e3ff 100644 --- a/src/core/courses/components/course-progress/course-progress.ts +++ b/src/core/courses/components/course-progress/course-progress.ts @@ -14,9 +14,9 @@ import { Component, Input, OnInit, OnDestroy } from '@angular/core'; import { NavController } from 'ionic-angular'; -import { CoreEventsProvider } from '../../../../providers/events'; -import { CoreSitesProvider } from '../../../../providers/sites'; -import { CoreDomUtilsProvider } from '../../../../providers/utils/dom'; +import { CoreEventsProvider } from '@providers/events'; +import { CoreSitesProvider } from '@providers/sites'; +import { CoreDomUtilsProvider } from '@providers/utils/dom'; import { CoreCourseFormatDelegate } from '../../../course/providers/format-delegate'; import { CoreCourseProvider } from '../../../course/providers/course'; import { CoreCourseHelperProvider } from '../../../course/providers/helper'; diff --git a/src/core/courses/components/overview-events/overview-events.ts b/src/core/courses/components/overview-events/overview-events.ts index 6ca8f682d..4ffc4e3fb 100644 --- a/src/core/courses/components/overview-events/overview-events.ts +++ b/src/core/courses/components/overview-events/overview-events.ts @@ -14,10 +14,10 @@ import { Component, Input, Output, OnChanges, EventEmitter, SimpleChange } from '@angular/core'; import { NavController } from 'ionic-angular'; -import { CoreSitesProvider } from '../../../../providers/sites'; -import { CoreDomUtilsProvider } from '../../../../providers/utils/dom'; -import { CoreTextUtilsProvider } from '../../../../providers/utils/text'; -import { CoreUtilsProvider } from '../../../../providers/utils/utils'; +import { CoreSitesProvider } from '@providers/sites'; +import { CoreDomUtilsProvider } from '@providers/utils/dom'; +import { CoreTextUtilsProvider } from '@providers/utils/text'; +import { CoreUtilsProvider } from '@providers/utils/utils'; import { CoreCourseProvider } from '../../../course/providers/course'; import { CoreContentLinksHelperProvider } from '../../../contentlinks/providers/helper'; import * as moment from 'moment'; diff --git a/src/core/courses/pages/available-courses/available-courses.module.ts b/src/core/courses/pages/available-courses/available-courses.module.ts index 5fb00ab0a..ca8ae39c5 100644 --- a/src/core/courses/pages/available-courses/available-courses.module.ts +++ b/src/core/courses/pages/available-courses/available-courses.module.ts @@ -16,7 +16,7 @@ import { NgModule } from '@angular/core'; import { IonicPageModule } from 'ionic-angular'; import { TranslateModule } from '@ngx-translate/core'; import { CoreCoursesAvailableCoursesPage } from './available-courses'; -import { CoreComponentsModule } from '../../../../components/components.module'; +import { CoreComponentsModule } from '@components/components.module'; import { CoreCoursesComponentsModule } from '../../components/components.module'; @NgModule({ diff --git a/src/core/courses/pages/available-courses/available-courses.ts b/src/core/courses/pages/available-courses/available-courses.ts index 9df1dcc54..5e244e7cb 100644 --- a/src/core/courses/pages/available-courses/available-courses.ts +++ b/src/core/courses/pages/available-courses/available-courses.ts @@ -14,8 +14,8 @@ import { Component } from '@angular/core'; import { IonicPage } from 'ionic-angular'; -import { CoreSitesProvider } from '../../../../providers/sites'; -import { CoreDomUtilsProvider } from '../../../../providers/utils/dom'; +import { CoreSitesProvider } from '@providers/sites'; +import { CoreDomUtilsProvider } from '@providers/utils/dom'; import { CoreCoursesProvider } from '../../providers/courses'; /** diff --git a/src/core/courses/pages/categories/categories.module.ts b/src/core/courses/pages/categories/categories.module.ts index 3033dc219..2e27333b6 100644 --- a/src/core/courses/pages/categories/categories.module.ts +++ b/src/core/courses/pages/categories/categories.module.ts @@ -16,8 +16,8 @@ import { NgModule } from '@angular/core'; import { IonicPageModule } from 'ionic-angular'; import { TranslateModule } from '@ngx-translate/core'; import { CoreCoursesCategoriesPage } from './categories'; -import { CoreComponentsModule } from '../../../../components/components.module'; -import { CoreDirectivesModule } from '../../../../directives/directives.module'; +import { CoreComponentsModule } from '@components/components.module'; +import { CoreDirectivesModule } from '@directives'; import { CoreCoursesComponentsModule } from '../../components/components.module'; @NgModule({ diff --git a/src/core/courses/pages/categories/categories.ts b/src/core/courses/pages/categories/categories.ts index 149e78d24..ab9a35cb1 100644 --- a/src/core/courses/pages/categories/categories.ts +++ b/src/core/courses/pages/categories/categories.ts @@ -15,9 +15,9 @@ import { Component } from '@angular/core'; import { IonicPage, NavController, NavParams } from 'ionic-angular'; import { TranslateService } from '@ngx-translate/core'; -import { CoreSitesProvider } from '../../../../providers/sites'; -import { CoreDomUtilsProvider } from '../../../../providers/utils/dom'; -import { CoreUtilsProvider } from '../../../../providers/utils/utils'; +import { CoreSitesProvider } from '@providers/sites'; +import { CoreDomUtilsProvider } from '@providers/utils/dom'; +import { CoreUtilsProvider } from '@providers/utils/utils'; import { CoreCoursesProvider } from '../../providers/courses'; /** diff --git a/src/core/courses/pages/course-preview/course-preview.module.ts b/src/core/courses/pages/course-preview/course-preview.module.ts index 00e38e14b..9b65092c2 100644 --- a/src/core/courses/pages/course-preview/course-preview.module.ts +++ b/src/core/courses/pages/course-preview/course-preview.module.ts @@ -16,9 +16,9 @@ import { NgModule } from '@angular/core'; import { IonicPageModule } from 'ionic-angular'; import { TranslateModule } from '@ngx-translate/core'; import { CoreCoursesCoursePreviewPage } from './course-preview'; -import { CoreComponentsModule } from '../../../../components/components.module'; -import { CoreDirectivesModule } from '../../../../directives/directives.module'; -import { CorePipesModule } from '../../../../pipes/pipes.module'; +import { CoreComponentsModule } from '@components/components.module'; +import { CoreDirectivesModule } from '@directives'; +import { CorePipesModule } from '@pipes'; @NgModule({ declarations: [ diff --git a/src/core/courses/pages/course-preview/course-preview.ts b/src/core/courses/pages/course-preview/course-preview.ts index 81a97cb18..a7877ece2 100644 --- a/src/core/courses/pages/course-preview/course-preview.ts +++ b/src/core/courses/pages/course-preview/course-preview.ts @@ -15,11 +15,11 @@ import { Component, OnDestroy } from '@angular/core'; import { IonicPage, NavController, NavParams, Platform, ModalController, Modal } from 'ionic-angular'; import { TranslateService } from '@ngx-translate/core'; -import { CoreAppProvider } from '../../../../providers/app'; -import { CoreEventsProvider } from '../../../../providers/events'; -import { CoreSitesProvider } from '../../../../providers/sites'; -import { CoreDomUtilsProvider } from '../../../../providers/utils/dom'; -import { CoreTextUtilsProvider } from '../../../../providers/utils/text'; +import { CoreAppProvider } from '@providers/app'; +import { CoreEventsProvider } from '@providers/events'; +import { CoreSitesProvider } from '@providers/sites'; +import { CoreDomUtilsProvider } from '@providers/utils/dom'; +import { CoreTextUtilsProvider } from '@providers/utils/text'; import { CoreCoursesProvider } from '../../providers/courses'; import { CoreCourseOptionsDelegate } from '../../../course/providers/options-delegate'; import { CoreCourseProvider } from '../../../course/providers/course'; diff --git a/src/core/courses/pages/my-courses/my-courses.module.ts b/src/core/courses/pages/my-courses/my-courses.module.ts index 45c404a78..70314f712 100644 --- a/src/core/courses/pages/my-courses/my-courses.module.ts +++ b/src/core/courses/pages/my-courses/my-courses.module.ts @@ -16,7 +16,7 @@ import { NgModule } from '@angular/core'; import { IonicPageModule } from 'ionic-angular'; import { TranslateModule } from '@ngx-translate/core'; import { CoreCoursesMyCoursesPage } from './my-courses'; -import { CoreComponentsModule } from '../../../../components/components.module'; +import { CoreComponentsModule } from '@components/components.module'; import { CoreCoursesComponentsModule } from '../../components/components.module'; @NgModule({ diff --git a/src/core/courses/pages/my-courses/my-courses.ts b/src/core/courses/pages/my-courses/my-courses.ts index 0c9949a9b..9ad191833 100644 --- a/src/core/courses/pages/my-courses/my-courses.ts +++ b/src/core/courses/pages/my-courses/my-courses.ts @@ -14,9 +14,9 @@ import { Component, OnDestroy } from '@angular/core'; import { IonicPage, NavController } from 'ionic-angular'; -import { CoreEventsProvider } from '../../../../providers/events'; -import { CoreSitesProvider } from '../../../../providers/sites'; -import { CoreDomUtilsProvider } from '../../../../providers/utils/dom'; +import { CoreEventsProvider } from '@providers/events'; +import { CoreSitesProvider } from '@providers/sites'; +import { CoreDomUtilsProvider } from '@providers/utils/dom'; import { CoreCoursesProvider } from '../../providers/courses'; import { CoreCourseHelperProvider } from '../../../course/providers/helper'; import { CoreCourseOptionsDelegate } from '../../../course/providers/options-delegate'; diff --git a/src/core/courses/pages/my-overview/my-overview.module.ts b/src/core/courses/pages/my-overview/my-overview.module.ts index 041267ef4..8825f5ab0 100644 --- a/src/core/courses/pages/my-overview/my-overview.module.ts +++ b/src/core/courses/pages/my-overview/my-overview.module.ts @@ -16,7 +16,7 @@ import { NgModule } from '@angular/core'; import { IonicPageModule } from 'ionic-angular'; import { TranslateModule } from '@ngx-translate/core'; import { CoreCoursesMyOverviewPage } from './my-overview'; -import { CoreComponentsModule } from '../../../../components/components.module'; +import { CoreComponentsModule } from '@components/components.module'; import { CoreCoursesComponentsModule } from '../../components/components.module'; import { CoreSiteHomeComponentsModule } from '../../../sitehome/components/components.module'; diff --git a/src/core/courses/pages/my-overview/my-overview.ts b/src/core/courses/pages/my-overview/my-overview.ts index 79aa6e4dd..a90972fb1 100644 --- a/src/core/courses/pages/my-overview/my-overview.ts +++ b/src/core/courses/pages/my-overview/my-overview.ts @@ -14,8 +14,8 @@ import { Component, OnDestroy } from '@angular/core'; import { IonicPage, NavController } from 'ionic-angular'; -import { CoreSitesProvider } from '../../../../providers/sites'; -import { CoreDomUtilsProvider } from '../../../../providers/utils/dom'; +import { CoreSitesProvider } from '@providers/sites'; +import { CoreDomUtilsProvider } from '@providers/utils/dom'; import { CoreCoursesProvider } from '../../providers/courses'; import { CoreCoursesMyOverviewProvider } from '../../providers/my-overview'; import { CoreCourseHelperProvider } from '../../../course/providers/helper'; diff --git a/src/core/courses/pages/search/search.module.ts b/src/core/courses/pages/search/search.module.ts index c74212c21..3527ebcb3 100644 --- a/src/core/courses/pages/search/search.module.ts +++ b/src/core/courses/pages/search/search.module.ts @@ -16,7 +16,7 @@ import { NgModule } from '@angular/core'; import { IonicPageModule } from 'ionic-angular'; import { TranslateModule } from '@ngx-translate/core'; import { CoreCoursesSearchPage } from './search'; -import { CoreComponentsModule } from '../../../../components/components.module'; +import { CoreComponentsModule } from '@components/components.module'; import { CoreCoursesComponentsModule } from '../../components/components.module'; @NgModule({ diff --git a/src/core/courses/pages/search/search.ts b/src/core/courses/pages/search/search.ts index 696215a1a..43c988d3d 100644 --- a/src/core/courses/pages/search/search.ts +++ b/src/core/courses/pages/search/search.ts @@ -14,7 +14,7 @@ import { Component } from '@angular/core'; import { IonicPage } from 'ionic-angular'; -import { CoreDomUtilsProvider } from '../../../../providers/utils/dom'; +import { CoreDomUtilsProvider } from '@providers/utils/dom'; import { CoreCoursesProvider } from '../../providers/courses'; /** diff --git a/src/core/courses/pages/self-enrol-password/self-enrol-password.module.ts b/src/core/courses/pages/self-enrol-password/self-enrol-password.module.ts index 80a4f5183..d1aaa6da6 100644 --- a/src/core/courses/pages/self-enrol-password/self-enrol-password.module.ts +++ b/src/core/courses/pages/self-enrol-password/self-enrol-password.module.ts @@ -16,8 +16,8 @@ import { NgModule } from '@angular/core'; import { IonicPageModule } from 'ionic-angular'; import { CoreCoursesSelfEnrolPasswordPage } from './self-enrol-password'; import { TranslateModule } from '@ngx-translate/core'; -import { CoreComponentsModule } from '../../../../components/components.module'; -import { CoreDirectivesModule } from '../../../../directives/directives.module'; +import { CoreComponentsModule } from '@components/components.module'; +import { CoreDirectivesModule } from '@directives'; @NgModule({ declarations: [ diff --git a/src/core/courses/providers/course-link-handler.ts b/src/core/courses/providers/course-link-handler.ts index cec8933d3..3dfb1fd39 100644 --- a/src/core/courses/providers/course-link-handler.ts +++ b/src/core/courses/providers/course-link-handler.ts @@ -14,8 +14,8 @@ import { Injectable } from '@angular/core'; import { TranslateService } from '@ngx-translate/core'; -import { CoreSitesProvider } from '../../../providers/sites'; -import { CoreDomUtilsProvider } from '../../../providers/utils/dom'; +import { CoreSitesProvider } from '@providers/sites'; +import { CoreDomUtilsProvider } from '@providers/utils/dom'; import { CoreContentLinksHandlerBase } from '../../contentlinks/classes/base-handler'; import { CoreContentLinksAction } from '../../contentlinks/providers/delegate'; import { CoreLoginHelperProvider } from '../../login/providers/helper'; diff --git a/src/core/courses/providers/courses.ts b/src/core/courses/providers/courses.ts index 395c40838..3118858dd 100644 --- a/src/core/courses/providers/courses.ts +++ b/src/core/courses/providers/courses.ts @@ -13,9 +13,9 @@ // limitations under the License. import { Injectable } from '@angular/core'; -import { CoreLoggerProvider } from '../../../providers/logger'; -import { CoreSitesProvider } from '../../../providers/sites'; -import { CoreSite } from '../../../classes/site'; +import { CoreLoggerProvider } from '@providers/logger'; +import { CoreSitesProvider } from '@providers/sites'; +import { CoreSite } from '@classes/site'; /** * Service that provides some features regarding lists of courses and categories. diff --git a/src/core/courses/providers/my-overview.ts b/src/core/courses/providers/my-overview.ts index f188f6d82..1e744da3c 100644 --- a/src/core/courses/providers/my-overview.ts +++ b/src/core/courses/providers/my-overview.ts @@ -13,8 +13,8 @@ // limitations under the License. import { Injectable } from '@angular/core'; -import { CoreSitesProvider } from '../../../providers/sites'; -import { CoreSite } from '../../../classes/site'; +import { CoreSitesProvider } from '@providers/sites'; +import { CoreSite } from '@classes/site'; import * as moment from 'moment'; /** diff --git a/src/core/emulator/classes/inappbrowserobject.ts b/src/core/emulator/classes/inappbrowserobject.ts index f13df5d8c..b557003f7 100644 --- a/src/core/emulator/classes/inappbrowserobject.ts +++ b/src/core/emulator/classes/inappbrowserobject.ts @@ -12,9 +12,9 @@ // See the License for the specific language governing permissions and // limitations under the License. -import { CoreAppProvider } from '../../../providers/app'; -import { CoreFileProvider } from '../../../providers/file'; -import { CoreUrlUtilsProvider } from '../../../providers/utils/url'; +import { CoreAppProvider } from '@providers/app'; +import { CoreFileProvider } from '@providers/file'; +import { CoreUrlUtilsProvider } from '@providers/utils/url'; import { Observable, Observer } from 'rxjs'; import { InAppBrowserObject, InAppBrowserEvent } from '@ionic-native/in-app-browser'; diff --git a/src/core/emulator/classes/sqlitedb.ts b/src/core/emulator/classes/sqlitedb.ts index b39b2bbd5..33f5f3029 100644 --- a/src/core/emulator/classes/sqlitedb.ts +++ b/src/core/emulator/classes/sqlitedb.ts @@ -12,7 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -import { SQLiteDB } from '../../../classes/sqlitedb'; +import { SQLiteDB } from '@classes/sqlitedb'; /** * Class to mock the interaction with the SQLite database. diff --git a/src/core/emulator/emulator.module.ts b/src/core/emulator/emulator.module.ts index 8069da54e..353369710 100644 --- a/src/core/emulator/emulator.module.ts +++ b/src/core/emulator/emulator.module.ts @@ -48,13 +48,13 @@ import { ZipMock } from './providers/zip'; import { CoreEmulatorHelperProvider } from './providers/helper'; import { CoreEmulatorCaptureHelperProvider } from './providers/capture-helper'; -import { CoreAppProvider } from '../../providers/app'; -import { CoreFileProvider } from '../../providers/file'; -import { CoreTextUtilsProvider } from '../../providers/utils/text'; -import { CoreMimetypeUtilsProvider } from '../../providers/utils/mimetype'; -import { CoreUrlUtilsProvider } from '../../providers/utils/url'; -import { CoreUtilsProvider } from '../../providers/utils/utils'; -import { CoreInitDelegate } from '../../providers/init'; +import { CoreAppProvider } from '@providers/app'; +import { CoreFileProvider } from '@providers/file'; +import { CoreTextUtilsProvider } from '@providers/utils/text'; +import { CoreMimetypeUtilsProvider } from '@providers/utils/mimetype'; +import { CoreUrlUtilsProvider } from '@providers/utils/url'; +import { CoreUtilsProvider } from '@providers/utils/utils'; +import { CoreInitDelegate } from '@providers/init'; /** * This module handles the emulation of Cordova plugins in browser and desktop. @@ -71,7 +71,7 @@ import { CoreInitDelegate } from '../../providers/init'; imports: [ ], providers: [ - Badge, + Badge, // @todo: Mock CoreEmulatorHelperProvider, CoreEmulatorCaptureHelperProvider, { @@ -144,7 +144,7 @@ import { CoreInitDelegate } from '../../providers/init'; return platform.is('cordova') ? new Network() : new NetworkMock(); } }, - Push, + Push, // @todo: Mock SplashScreen, StatusBar, SQLite, diff --git a/src/core/emulator/pages/capture-media/capture-media.module.ts b/src/core/emulator/pages/capture-media/capture-media.module.ts index 133671a75..c849d91f4 100644 --- a/src/core/emulator/pages/capture-media/capture-media.module.ts +++ b/src/core/emulator/pages/capture-media/capture-media.module.ts @@ -16,7 +16,7 @@ import { NgModule } from '@angular/core'; import { IonicPageModule } from 'ionic-angular'; import { CoreEmulatorCaptureMediaPage } from './capture-media'; import { TranslateModule } from '@ngx-translate/core'; -import { CoreComponentsModule } from '../../../../components/components.module'; +import { CoreComponentsModule } from '@components/components.module'; @NgModule({ declarations: [ diff --git a/src/core/emulator/pages/capture-media/capture-media.ts b/src/core/emulator/pages/capture-media/capture-media.ts index 5ccdc7f7a..360183441 100644 --- a/src/core/emulator/pages/capture-media/capture-media.ts +++ b/src/core/emulator/pages/capture-media/capture-media.ts @@ -14,10 +14,10 @@ import { Component, OnInit, OnDestroy, ViewChild, ElementRef, ChangeDetectorRef } from '@angular/core'; import { IonicPage, ViewController, NavParams } from 'ionic-angular'; -import { CoreFileProvider } from '../../../../providers/file'; -import { CoreDomUtilsProvider } from '../../../../providers/utils/dom'; -import { CoreTextUtilsProvider } from '../../../../providers/utils/text'; -import { CoreTimeUtilsProvider } from '../../../../providers/utils/time'; +import { CoreFileProvider } from '@providers/file'; +import { CoreDomUtilsProvider } from '@providers/utils/dom'; +import { CoreTextUtilsProvider } from '@providers/utils/text'; +import { CoreTimeUtilsProvider } from '@providers/utils/time'; /** * Page to capture media in browser or desktop. diff --git a/src/core/emulator/providers/capture-helper.ts b/src/core/emulator/providers/capture-helper.ts index 4d4ab87d9..cf66fbf92 100644 --- a/src/core/emulator/providers/capture-helper.ts +++ b/src/core/emulator/providers/capture-helper.ts @@ -14,8 +14,8 @@ import { Injectable } from '@angular/core'; import { ModalController, Modal } from 'ionic-angular'; -import { CoreMimetypeUtilsProvider } from '../../../providers/utils/mimetype'; -import { CoreUtilsProvider } from '../../../providers/utils/utils'; +import { CoreMimetypeUtilsProvider } from '@providers/utils/mimetype'; +import { CoreUtilsProvider } from '@providers/utils/utils'; /** * Helper service with some features to capture media (image, audio, video). diff --git a/src/core/emulator/providers/clipboard.ts b/src/core/emulator/providers/clipboard.ts index eb47fd6d6..40390a883 100644 --- a/src/core/emulator/providers/clipboard.ts +++ b/src/core/emulator/providers/clipboard.ts @@ -14,7 +14,7 @@ import { Injectable } from '@angular/core'; import { Clipboard } from '@ionic-native/clipboard'; -import { CoreAppProvider } from '../../../providers/app'; +import { CoreAppProvider } from '@providers/app'; /** * Emulates the Cordova Clipboard plugin in desktop apps and in browser. diff --git a/src/core/emulator/providers/file-transfer.ts b/src/core/emulator/providers/file-transfer.ts index 7c05fd8dd..7adff60e3 100644 --- a/src/core/emulator/providers/file-transfer.ts +++ b/src/core/emulator/providers/file-transfer.ts @@ -14,8 +14,8 @@ import { Injectable } from '@angular/core'; import { FileTransfer, FileTransferObject, FileUploadResult, FileTransferError } from '@ionic-native/file-transfer'; -import { CoreAppProvider } from '../../../providers/app'; -import { CoreFileProvider } from '../../../providers/file'; +import { CoreAppProvider } from '@providers/app'; +import { CoreFileProvider } from '@providers/file'; /** * Mock the File Transfer Error. diff --git a/src/core/emulator/providers/file.ts b/src/core/emulator/providers/file.ts index 8f756821c..cf6c77e8c 100644 --- a/src/core/emulator/providers/file.ts +++ b/src/core/emulator/providers/file.ts @@ -14,8 +14,8 @@ import { Injectable } from '@angular/core'; import { File, Entry, DirectoryEntry, FileEntry, FileError, IWriteOptions } from '@ionic-native/file'; -import { CoreAppProvider } from '../../../providers/app'; -import { CoreTextUtilsProvider } from '../../../providers/utils/text'; +import { CoreAppProvider } from '@providers/app'; +import { CoreTextUtilsProvider } from '@providers/utils/text'; import { CoreConfigConstants } from '../../../configconstants'; /** diff --git a/src/core/emulator/providers/globalization.ts b/src/core/emulator/providers/globalization.ts index 5ceeec8a9..6bcd6008c 100644 --- a/src/core/emulator/providers/globalization.ts +++ b/src/core/emulator/providers/globalization.ts @@ -14,7 +14,7 @@ import { Injectable } from '@angular/core'; import { Globalization } from '@ionic-native/globalization'; -import { CoreAppProvider } from '../../../providers/app'; +import { CoreAppProvider } from '@providers/app'; /** * Emulates the Cordova Globalization plugin in desktop apps and in browser. diff --git a/src/core/emulator/providers/helper.ts b/src/core/emulator/providers/helper.ts index cea59f24d..7314ded11 100644 --- a/src/core/emulator/providers/helper.ts +++ b/src/core/emulator/providers/helper.ts @@ -13,11 +13,11 @@ // limitations under the License. import { Injectable } from '@angular/core'; -import { CoreFileProvider } from '../../../providers/file'; -import { CoreUtilsProvider } from '../../../providers/utils/utils'; +import { CoreFileProvider } from '@providers/file'; +import { CoreUtilsProvider } from '@providers/utils/utils'; import { File } from '@ionic-native/file'; import { LocalNotifications } from '@ionic-native/local-notifications'; -import { CoreInitDelegate, CoreInitHandler } from '../../../providers/init'; +import { CoreInitDelegate, CoreInitHandler } from '@providers/init'; import { FileTransferErrorMock } from './file-transfer'; import { CoreEmulatorCaptureHelperProvider } from './capture-helper'; diff --git a/src/core/emulator/providers/inappbrowser.ts b/src/core/emulator/providers/inappbrowser.ts index bcae07e73..21c18d3f2 100644 --- a/src/core/emulator/providers/inappbrowser.ts +++ b/src/core/emulator/providers/inappbrowser.ts @@ -14,9 +14,9 @@ import { Injectable } from '@angular/core'; import { InAppBrowser, InAppBrowserObject } from '@ionic-native/in-app-browser'; -import { CoreAppProvider } from '../../../providers/app'; -import { CoreFileProvider } from '../../../providers/file'; -import { CoreUrlUtilsProvider } from '../../../providers/utils/url'; +import { CoreAppProvider } from '@providers/app'; +import { CoreFileProvider } from '@providers/file'; +import { CoreUrlUtilsProvider } from '@providers/utils/url'; import { InAppBrowserObjectMock } from '../classes/inappbrowserobject'; /** diff --git a/src/core/emulator/providers/local-notifications.ts b/src/core/emulator/providers/local-notifications.ts index 9ea0c3318..6e19d6474 100644 --- a/src/core/emulator/providers/local-notifications.ts +++ b/src/core/emulator/providers/local-notifications.ts @@ -14,9 +14,9 @@ import { Injectable } from '@angular/core'; import { LocalNotifications, ILocalNotification } from '@ionic-native/local-notifications'; -import { CoreAppProvider } from '../../../providers/app'; -import { CoreUtilsProvider } from '../../../providers/utils/utils'; -import { SQLiteDB } from '../../../classes/sqlitedb'; +import { CoreAppProvider } from '@providers/app'; +import { CoreUtilsProvider } from '@providers/utils/utils'; +import { SQLiteDB } from '@classes/sqlitedb'; import { CoreConstants } from '../../constants'; import { CoreConfigConstants } from '../../../configconstants'; import * as moment from 'moment'; diff --git a/src/core/emulator/providers/zip.ts b/src/core/emulator/providers/zip.ts index 2d3e27b77..9bc3d315a 100644 --- a/src/core/emulator/providers/zip.ts +++ b/src/core/emulator/providers/zip.ts @@ -16,7 +16,7 @@ import { Injectable } from '@angular/core'; import { Zip } from '@ionic-native/zip'; import { JSZip } from 'jszip'; import { File } from '@ionic-native/file'; -import { CoreMimetypeUtilsProvider } from '../../../providers/utils/mimetype'; +import { CoreMimetypeUtilsProvider } from '@providers/utils/mimetype'; /** * Emulates the Cordova Zip plugin in desktop apps and in browser. diff --git a/src/core/fileuploader/providers/album-handler.ts b/src/core/fileuploader/providers/album-handler.ts index b1221ef34..729539db1 100644 --- a/src/core/fileuploader/providers/album-handler.ts +++ b/src/core/fileuploader/providers/album-handler.ts @@ -13,8 +13,8 @@ // limitations under the License. import { Injectable } from '@angular/core'; -import { CoreAppProvider } from '../../../providers/app'; -import { CoreUtilsProvider } from '../../../providers/utils/utils'; +import { CoreAppProvider } from '@providers/app'; +import { CoreUtilsProvider } from '@providers/utils/utils'; import { CoreFileUploaderHandler, CoreFileUploaderHandlerData } from './delegate'; import { CoreFileUploaderHelperProvider } from './helper'; /** diff --git a/src/core/fileuploader/providers/audio-handler.ts b/src/core/fileuploader/providers/audio-handler.ts index a3d8a2cd0..c6c73b9c2 100644 --- a/src/core/fileuploader/providers/audio-handler.ts +++ b/src/core/fileuploader/providers/audio-handler.ts @@ -14,8 +14,8 @@ import { Injectable } from '@angular/core'; import { Platform } from 'ionic-angular'; -import { CoreAppProvider } from '../../../providers/app'; -import { CoreUtilsProvider } from '../../../providers/utils/utils'; +import { CoreAppProvider } from '@providers/app'; +import { CoreUtilsProvider } from '@providers/utils/utils'; import { CoreFileUploaderHandler, CoreFileUploaderHandlerData } from './delegate'; import { CoreFileUploaderHelperProvider } from './helper'; /** diff --git a/src/core/fileuploader/providers/camera-handler.ts b/src/core/fileuploader/providers/camera-handler.ts index 9e772ecea..c4a9db2d3 100644 --- a/src/core/fileuploader/providers/camera-handler.ts +++ b/src/core/fileuploader/providers/camera-handler.ts @@ -13,8 +13,8 @@ // limitations under the License. import { Injectable } from '@angular/core'; -import { CoreAppProvider } from '../../../providers/app'; -import { CoreUtilsProvider } from '../../../providers/utils/utils'; +import { CoreAppProvider } from '@providers/app'; +import { CoreUtilsProvider } from '@providers/utils/utils'; import { CoreFileUploaderHandler, CoreFileUploaderHandlerData } from './delegate'; import { CoreFileUploaderHelperProvider } from './helper'; /** diff --git a/src/core/fileuploader/providers/delegate.ts b/src/core/fileuploader/providers/delegate.ts index 5187e3c9e..e0b149c81 100644 --- a/src/core/fileuploader/providers/delegate.ts +++ b/src/core/fileuploader/providers/delegate.ts @@ -13,10 +13,10 @@ // limitations under the License. import { Injectable } from '@angular/core'; -import { CoreEventsProvider } from '../../../providers/events'; -import { CoreLoggerProvider } from '../../../providers/logger'; -import { CoreSitesProvider } from '../../../providers/sites'; -import { CoreDelegate, CoreDelegateHandler } from '../../../classes/delegate'; +import { CoreEventsProvider } from '@providers/events'; +import { CoreLoggerProvider } from '@providers/logger'; +import { CoreSitesProvider } from '@providers/sites'; +import { CoreDelegate, CoreDelegateHandler } from '@classes/delegate'; /** * Interface that all handlers must implement. diff --git a/src/core/fileuploader/providers/file-handler.ts b/src/core/fileuploader/providers/file-handler.ts index e045682f2..4479880f0 100644 --- a/src/core/fileuploader/providers/file-handler.ts +++ b/src/core/fileuploader/providers/file-handler.ts @@ -14,9 +14,9 @@ import { Injectable } from '@angular/core'; import { Platform } from 'ionic-angular'; -import { CoreAppProvider } from '../../../providers/app'; -import { CoreDomUtilsProvider } from '../../../providers/utils/dom'; -import { CoreTimeUtilsProvider } from '../../../providers/utils/time'; +import { CoreAppProvider } from '@providers/app'; +import { CoreDomUtilsProvider } from '@providers/utils/dom'; +import { CoreTimeUtilsProvider } from '@providers/utils/time'; import { CoreFileUploaderHandler, CoreFileUploaderHandlerData } from './delegate'; import { CoreFileUploaderHelperProvider } from './helper'; import { CoreFileUploaderProvider } from './fileuploader'; diff --git a/src/core/fileuploader/providers/fileuploader.ts b/src/core/fileuploader/providers/fileuploader.ts index abc48fbc5..4934ead60 100644 --- a/src/core/fileuploader/providers/fileuploader.ts +++ b/src/core/fileuploader/providers/fileuploader.ts @@ -16,15 +16,15 @@ import { Injectable } from '@angular/core'; import { Platform } from 'ionic-angular'; import { MediaFile } from '@ionic-native/media-capture'; import { TranslateService } from '@ngx-translate/core'; -import { CoreFileProvider } from '../../../providers/file'; -import { CoreFilepoolProvider } from '../../../providers/filepool'; -import { CoreLoggerProvider } from '../../../providers/logger'; -import { CoreSitesProvider } from '../../../providers/sites'; -import { CoreMimetypeUtilsProvider } from '../../../providers/utils/mimetype'; -import { CoreTextUtilsProvider } from '../../../providers/utils/text'; -import { CoreTimeUtilsProvider } from '../../../providers/utils/time'; -import { CoreUtilsProvider } from '../../../providers/utils/utils'; -import { CoreWSFileUploadOptions } from '../../../providers/ws'; +import { CoreFileProvider } from '@providers/file'; +import { CoreFilepoolProvider } from '@providers/filepool'; +import { CoreLoggerProvider } from '@providers/logger'; +import { CoreSitesProvider } from '@providers/sites'; +import { CoreMimetypeUtilsProvider } from '@providers/utils/mimetype'; +import { CoreTextUtilsProvider } from '@providers/utils/text'; +import { CoreTimeUtilsProvider } from '@providers/utils/time'; +import { CoreUtilsProvider } from '@providers/utils/utils'; +import { CoreWSFileUploadOptions } from '@providers/ws'; /** * File upload options. diff --git a/src/core/fileuploader/providers/helper.ts b/src/core/fileuploader/providers/helper.ts index e955869a3..3518c3b54 100644 --- a/src/core/fileuploader/providers/helper.ts +++ b/src/core/fileuploader/providers/helper.ts @@ -17,12 +17,12 @@ import { ActionSheetController, ActionSheet, Platform } from 'ionic-angular'; import { MediaCapture, MediaFile } from '@ionic-native/media-capture'; import { Camera, CameraOptions } from '@ionic-native/camera'; import { TranslateService } from '@ngx-translate/core'; -import { CoreAppProvider } from '../../../providers/app'; -import { CoreFileProvider } from '../../../providers/file'; -import { CoreLoggerProvider } from '../../../providers/logger'; -import { CoreDomUtilsProvider } from '../../../providers/utils/dom'; -import { CoreTextUtilsProvider } from '../../../providers/utils/text'; -import { CoreUtilsProvider, PromiseDefer } from '../../../providers/utils/utils'; +import { CoreAppProvider } from '@providers/app'; +import { CoreFileProvider } from '@providers/file'; +import { CoreLoggerProvider } from '@providers/logger'; +import { CoreDomUtilsProvider } from '@providers/utils/dom'; +import { CoreTextUtilsProvider } from '@providers/utils/text'; +import { CoreUtilsProvider, PromiseDefer } from '@providers/utils/utils'; import { CoreFileUploaderProvider, CoreFileUploaderOptions } from './fileuploader'; import { CoreFileUploaderDelegate } from './delegate'; diff --git a/src/core/fileuploader/providers/video-handler.ts b/src/core/fileuploader/providers/video-handler.ts index 8d66019e0..22c70ecac 100644 --- a/src/core/fileuploader/providers/video-handler.ts +++ b/src/core/fileuploader/providers/video-handler.ts @@ -14,8 +14,8 @@ import { Injectable } from '@angular/core'; import { Platform } from 'ionic-angular'; -import { CoreAppProvider } from '../../../providers/app'; -import { CoreUtilsProvider } from '../../../providers/utils/utils'; +import { CoreAppProvider } from '@providers/app'; +import { CoreUtilsProvider } from '@providers/utils/utils'; import { CoreFileUploaderHandler, CoreFileUploaderHandlerData } from './delegate'; import { CoreFileUploaderHelperProvider } from './helper'; /** diff --git a/src/core/grades/components/components.module.ts b/src/core/grades/components/components.module.ts index 5e50f4d7a..872bb100f 100644 --- a/src/core/grades/components/components.module.ts +++ b/src/core/grades/components/components.module.ts @@ -17,9 +17,9 @@ import { CommonModule } from '@angular/common'; import { IonicModule } from 'ionic-angular'; import { TranslateModule } from '@ngx-translate/core'; import { CoreGradesCourseComponent } from './course/course'; -import { CoreComponentsModule } from '../../../components/components.module'; -import { CoreDirectivesModule } from '../../../directives/directives.module'; -import { CorePipesModule } from '../../../pipes/pipes.module'; +import { CoreComponentsModule } from '@components/components.module'; +import { CoreDirectivesModule } from '@directives'; +import { CorePipesModule } from '@pipes'; @NgModule({ declarations: [ diff --git a/src/core/grades/components/course/course.ts b/src/core/grades/components/course/course.ts index bdbe66489..181080f4d 100644 --- a/src/core/grades/components/course/course.ts +++ b/src/core/grades/components/course/course.ts @@ -15,11 +15,11 @@ import { Component, ViewChild, Input, Optional } from '@angular/core'; import { Content, NavParams, NavController } from 'ionic-angular'; import { CoreGradesProvider } from '../../providers/grades'; -import { CoreSitesProvider } from '../../../../providers/sites'; -import { CoreDomUtilsProvider } from '../../../../providers/utils/dom'; +import { CoreSitesProvider } from '@providers/sites'; +import { CoreDomUtilsProvider } from '@providers/utils/dom'; import { CoreGradesHelperProvider } from '../../providers/helper'; -import { CoreSplitViewComponent } from '../../../../components/split-view/split-view'; -import { CoreAppProvider } from '../../../../providers/app'; +import { CoreSplitViewComponent } from '@components/split-view/split-view'; +import { CoreAppProvider } from '@providers/app'; /** * Component that displays a course grades. diff --git a/src/core/grades/grades.module.ts b/src/core/grades/grades.module.ts index 44bd085fb..d090f2e00 100644 --- a/src/core/grades/grades.module.ts +++ b/src/core/grades/grades.module.ts @@ -25,8 +25,8 @@ import { CoreGradesOverviewLinkHandler } from './providers/overview-link-handler import { CoreContentLinksDelegate } from '../contentlinks/providers/delegate'; import { CoreGradesUserHandler } from './providers/user-handler'; import { CoreUserDelegate } from '../user/providers/user-delegate'; -import { CoreEventsProvider } from '../../providers/events'; -import { CoreSitesProvider } from '../../providers/sites'; +import { CoreEventsProvider } from '@providers/events'; +import { CoreSitesProvider } from '@providers/sites'; import { CoreUserProvider } from '../user/providers/user'; @NgModule({ diff --git a/src/core/grades/pages/course/course.ts b/src/core/grades/pages/course/course.ts index ce40b75e5..af07df6a3 100644 --- a/src/core/grades/pages/course/course.ts +++ b/src/core/grades/pages/course/course.ts @@ -14,7 +14,7 @@ import { Component } from '@angular/core'; import { IonicPage, NavParams } from 'ionic-angular'; -import { CoreSitesProvider } from '../../../../providers/sites'; +import { CoreSitesProvider } from '@providers/sites'; /** * Page that displays a course grades. diff --git a/src/core/grades/pages/courses/courses.module.ts b/src/core/grades/pages/courses/courses.module.ts index b4c8b834d..05bb74eab 100644 --- a/src/core/grades/pages/courses/courses.module.ts +++ b/src/core/grades/pages/courses/courses.module.ts @@ -16,8 +16,8 @@ import { NgModule } from '@angular/core'; import { IonicPageModule } from 'ionic-angular'; import { TranslateModule } from '@ngx-translate/core'; import { CoreGradesCoursesPage } from './courses'; -import { CoreComponentsModule } from '../../../../components/components.module'; -import { CoreDirectivesModule } from '../../../../directives/directives.module'; +import { CoreComponentsModule } from '@components/components.module'; +import { CoreDirectivesModule } from '@directives'; @NgModule({ declarations: [ diff --git a/src/core/grades/pages/courses/courses.ts b/src/core/grades/pages/courses/courses.ts index 4610fdce7..14a7e83dd 100644 --- a/src/core/grades/pages/courses/courses.ts +++ b/src/core/grades/pages/courses/courses.ts @@ -15,8 +15,8 @@ import { Component, ViewChild } from '@angular/core'; import { IonicPage, Content } from 'ionic-angular'; import { CoreGradesProvider } from '../../providers/grades'; -import { CoreDomUtilsProvider } from '../../../../providers/utils/dom'; -import { CoreSplitViewComponent } from '../../../../components/split-view/split-view'; +import { CoreDomUtilsProvider } from '@providers/utils/dom'; +import { CoreSplitViewComponent } from '@components/split-view/split-view'; import { CoreGradesHelperProvider } from '../../providers/helper'; /** diff --git a/src/core/grades/pages/coursesplit/coursesplit.module.ts b/src/core/grades/pages/coursesplit/coursesplit.module.ts index fb9bab05a..18775db1d 100644 --- a/src/core/grades/pages/coursesplit/coursesplit.module.ts +++ b/src/core/grades/pages/coursesplit/coursesplit.module.ts @@ -16,7 +16,7 @@ import { NgModule } from '@angular/core'; import { IonicPageModule } from 'ionic-angular'; import { TranslateModule } from '@ngx-translate/core'; import { CoreGradesCourseSplitPage } from './coursesplit'; -import { CoreComponentsModule } from '../../../../components/components.module'; +import { CoreComponentsModule } from '@components/components.module'; import { CoreGradesComponentsModule } from '../../components/components.module'; @NgModule({ diff --git a/src/core/grades/pages/coursesplit/coursesplit.ts b/src/core/grades/pages/coursesplit/coursesplit.ts index f759b72ca..beca318b2 100644 --- a/src/core/grades/pages/coursesplit/coursesplit.ts +++ b/src/core/grades/pages/coursesplit/coursesplit.ts @@ -14,7 +14,7 @@ import { Component } from '@angular/core'; import { IonicPage, NavParams } from 'ionic-angular'; -import { CoreSitesProvider } from '../../../../providers/sites'; +import { CoreSitesProvider } from '@providers/sites'; /** * Page that displays a course grades. diff --git a/src/core/grades/pages/grade/grade.module.ts b/src/core/grades/pages/grade/grade.module.ts index 5b591fddd..159a3c28e 100644 --- a/src/core/grades/pages/grade/grade.module.ts +++ b/src/core/grades/pages/grade/grade.module.ts @@ -16,8 +16,8 @@ import { NgModule } from '@angular/core'; import { IonicPageModule } from 'ionic-angular'; import { TranslateModule } from '@ngx-translate/core'; import { CoreGradesGradePage } from './grade'; -import { CoreComponentsModule } from '../../../../components/components.module'; -import { CoreDirectivesModule } from '../../../../directives/directives.module'; +import { CoreComponentsModule } from '@components/components.module'; +import { CoreDirectivesModule } from '@directives'; @NgModule({ declarations: [ diff --git a/src/core/grades/pages/grade/grade.ts b/src/core/grades/pages/grade/grade.ts index 181b1d6f1..fc94c0497 100644 --- a/src/core/grades/pages/grade/grade.ts +++ b/src/core/grades/pages/grade/grade.ts @@ -15,9 +15,9 @@ import { Component, ViewChild } from '@angular/core'; import { IonicPage, Content, NavParams } from 'ionic-angular'; import { CoreGradesProvider } from '../../providers/grades'; -import { CoreDomUtilsProvider } from '../../../../providers/utils/dom'; +import { CoreDomUtilsProvider } from '@providers/utils/dom'; import { CoreGradesHelperProvider } from '../../providers/helper'; -import { CoreSitesProvider } from '../../../../providers/sites'; +import { CoreSitesProvider } from '@providers/sites'; /** * Page that displays activity grade. diff --git a/src/core/grades/providers/grades.ts b/src/core/grades/providers/grades.ts index 21cf6afe3..15f21e1b4 100644 --- a/src/core/grades/providers/grades.ts +++ b/src/core/grades/providers/grades.ts @@ -13,9 +13,9 @@ // limitations under the License. import { Injectable } from '@angular/core'; -import { CoreLoggerProvider } from '../../../providers/logger'; -import { CoreSite } from '../../../classes/site'; -import { CoreSitesProvider } from '../../../providers/sites'; +import { CoreLoggerProvider } from '@providers/logger'; +import { CoreSite } from '@classes/site'; +import { CoreSitesProvider } from '@providers/sites'; import { CoreCoursesProvider } from '../../courses/providers/courses'; /** diff --git a/src/core/grades/providers/helper.ts b/src/core/grades/providers/helper.ts index 8c7a42dfc..ceffae450 100644 --- a/src/core/grades/providers/helper.ts +++ b/src/core/grades/providers/helper.ts @@ -13,15 +13,15 @@ // limitations under the License. import { Injectable } from '@angular/core'; -import { CoreLoggerProvider } from '../../../providers/logger'; -import { CoreSitesProvider } from '../../../providers/sites'; +import { CoreLoggerProvider } from '@providers/logger'; +import { CoreSitesProvider } from '@providers/sites'; import { TranslateService } from '@ngx-translate/core'; import { CoreCoursesProvider } from '../../courses/providers/courses'; import { CoreCourseProvider } from '../../course/providers/course'; import { CoreGradesProvider } from './grades'; -import { CoreTextUtilsProvider } from '../../../providers/utils/text'; -import { CoreUrlUtilsProvider } from '../../../providers/utils/url'; -import { CoreDomUtilsProvider } from '../../../providers/utils/dom'; +import { CoreTextUtilsProvider } from '@providers/utils/text'; +import { CoreUrlUtilsProvider } from '@providers/utils/url'; +import { CoreDomUtilsProvider } from '@providers/utils/dom'; /** * Service that provides some features regarding grades information. diff --git a/src/core/grades/providers/user-handler.ts b/src/core/grades/providers/user-handler.ts index 593b7cdab..ba95dc857 100644 --- a/src/core/grades/providers/user-handler.ts +++ b/src/core/grades/providers/user-handler.ts @@ -14,7 +14,7 @@ import { Injectable } from '@angular/core'; import { CoreUserDelegate, CoreUserProfileHandler, CoreUserProfileHandlerData } from '../../user/providers/user-delegate'; -import { CoreSitesProvider } from '../../../providers/sites'; +import { CoreSitesProvider } from '@providers/sites'; import { CoreContentLinksHelperProvider } from '../../contentlinks/providers/helper'; import { CoreGradesProvider } from './grades'; diff --git a/src/core/login/pages/credentials/credentials.module.ts b/src/core/login/pages/credentials/credentials.module.ts index 88e6e955e..a5b767d10 100644 --- a/src/core/login/pages/credentials/credentials.module.ts +++ b/src/core/login/pages/credentials/credentials.module.ts @@ -16,8 +16,8 @@ import { NgModule } from '@angular/core'; import { IonicPageModule } from 'ionic-angular'; import { CoreLoginCredentialsPage } from './credentials'; import { TranslateModule } from '@ngx-translate/core'; -import { CoreComponentsModule } from '../../../../components/components.module'; -import { CoreDirectivesModule } from '../../../../directives/directives.module'; +import { CoreComponentsModule } from '@components/components.module'; +import { CoreDirectivesModule } from '@directives'; @NgModule({ declarations: [ diff --git a/src/core/login/pages/credentials/credentials.ts b/src/core/login/pages/credentials/credentials.ts index 790ea8df5..75ffd2b0b 100644 --- a/src/core/login/pages/credentials/credentials.ts +++ b/src/core/login/pages/credentials/credentials.ts @@ -15,11 +15,11 @@ import { Component } from '@angular/core'; import { IonicPage, NavController, NavParams } from 'ionic-angular'; import { TranslateService } from '@ngx-translate/core'; -import { CoreAppProvider } from '../../../../providers/app'; -import { CoreEventsProvider } from '../../../../providers/events'; -import { CoreSitesProvider } from '../../../../providers/sites'; -import { CoreDomUtilsProvider } from '../../../../providers/utils/dom'; -import { CoreUtilsProvider } from '../../../../providers/utils/utils'; +import { CoreAppProvider } from '@providers/app'; +import { CoreEventsProvider } from '@providers/events'; +import { CoreSitesProvider } from '@providers/sites'; +import { CoreDomUtilsProvider } from '@providers/utils/dom'; +import { CoreUtilsProvider } from '@providers/utils/utils'; import { CoreLoginHelperProvider } from '../../providers/helper'; import { CoreContentLinksDelegate } from '../../../contentlinks/providers/delegate'; import { CoreContentLinksHelperProvider } from '../../../contentlinks/providers/helper'; diff --git a/src/core/login/pages/email-signup/email-signup.module.ts b/src/core/login/pages/email-signup/email-signup.module.ts index 422f4271f..cf128a353 100644 --- a/src/core/login/pages/email-signup/email-signup.module.ts +++ b/src/core/login/pages/email-signup/email-signup.module.ts @@ -16,8 +16,8 @@ import { NgModule } from '@angular/core'; import { IonicPageModule } from 'ionic-angular'; import { CoreLoginEmailSignupPage } from './email-signup'; import { TranslateModule } from '@ngx-translate/core'; -import { CoreComponentsModule } from '../../../../components/components.module'; -import { CoreDirectivesModule } from '../../../../directives/directives.module'; +import { CoreComponentsModule } from '@components/components.module'; +import { CoreDirectivesModule } from '@directives'; import { CoreUserComponentsModule } from '../../../user/components/components.module'; @NgModule({ diff --git a/src/core/login/pages/email-signup/email-signup.ts b/src/core/login/pages/email-signup/email-signup.ts index cbe3349b5..606178f13 100644 --- a/src/core/login/pages/email-signup/email-signup.ts +++ b/src/core/login/pages/email-signup/email-signup.ts @@ -15,11 +15,11 @@ import { Component, ViewChild } from '@angular/core'; import { IonicPage, NavController, NavParams, Content } from 'ionic-angular'; import { TranslateService } from '@ngx-translate/core'; -import { CoreSitesProvider } from '../../../../providers/sites'; -import { CoreDomUtilsProvider } from '../../../../providers/utils/dom'; -import { CoreTextUtilsProvider } from '../../../../providers/utils/text'; -import { CoreUtilsProvider } from '../../../../providers/utils/utils'; -import { CoreWSProvider } from '../../../../providers/ws'; +import { CoreSitesProvider } from '@providers/sites'; +import { CoreDomUtilsProvider } from '@providers/utils/dom'; +import { CoreTextUtilsProvider } from '@providers/utils/text'; +import { CoreUtilsProvider } from '@providers/utils/utils'; +import { CoreWSProvider } from '@providers/ws'; import { CoreLoginHelperProvider } from '../../providers/helper'; import { FormBuilder, FormGroup, Validators } from '@angular/forms'; import { CoreUserProfileFieldDelegate } from '../../../user/providers/user-profile-field-delegate'; diff --git a/src/core/login/pages/forgotten-password/forgotten-password.ts b/src/core/login/pages/forgotten-password/forgotten-password.ts index 1c37f23ab..3aec2d353 100644 --- a/src/core/login/pages/forgotten-password/forgotten-password.ts +++ b/src/core/login/pages/forgotten-password/forgotten-password.ts @@ -15,7 +15,7 @@ import { Component } from '@angular/core'; import { IonicPage, NavController, NavParams } from 'ionic-angular'; import { TranslateService } from '@ngx-translate/core'; -import { CoreDomUtilsProvider } from '../../../../providers/utils/dom'; +import { CoreDomUtilsProvider } from '@providers/utils/dom'; import { CoreLoginHelperProvider } from '../../providers/helper'; import { FormBuilder, FormGroup, Validators } from '@angular/forms'; diff --git a/src/core/login/pages/init/init.ts b/src/core/login/pages/init/init.ts index c5ccb35aa..2770bcf4e 100644 --- a/src/core/login/pages/init/init.ts +++ b/src/core/login/pages/init/init.ts @@ -14,9 +14,9 @@ import { Component } from '@angular/core'; import { IonicPage, NavController } from 'ionic-angular'; -import { CoreAppProvider } from '../../../../providers/app'; -import { CoreInitDelegate } from '../../../../providers/init'; -import { CoreSitesProvider } from '../../../../providers/sites'; +import { CoreAppProvider } from '@providers/app'; +import { CoreInitDelegate } from '@providers/init'; +import { CoreSitesProvider } from '@providers/sites'; import { CoreConstants } from '../../../constants'; import { CoreLoginHelperProvider } from '../../providers/helper'; @@ -77,10 +77,12 @@ export class CoreLoginInitPage { this.loginHelper.goToSiteInitialPage(); } } else { - this.sitesProvider.hasSites().then(() => { - this.navCtrl.setRoot('CoreLoginSitesPage'); - }, () => { - this.loginHelper.goToAddSite(true); + this.sitesProvider.hasSites().then((hasSites) => { + if (hasSites) { + this.navCtrl.setRoot('CoreLoginSitesPage'); + } else { + this.loginHelper.goToAddSite(true); + } }); } } diff --git a/src/core/login/pages/reconnect/reconnect.module.ts b/src/core/login/pages/reconnect/reconnect.module.ts index 10260486f..40f59485f 100644 --- a/src/core/login/pages/reconnect/reconnect.module.ts +++ b/src/core/login/pages/reconnect/reconnect.module.ts @@ -16,8 +16,8 @@ import { NgModule } from '@angular/core'; import { IonicPageModule } from 'ionic-angular'; import { TranslateModule } from '@ngx-translate/core'; import { CoreLoginReconnectPage } from './reconnect'; -import { CoreComponentsModule } from '../../../../components/components.module'; -import { CoreDirectivesModule } from '../../../../directives/directives.module'; +import { CoreComponentsModule } from '@components/components.module'; +import { CoreDirectivesModule } from '@directives'; @NgModule({ declarations: [ diff --git a/src/core/login/pages/reconnect/reconnect.ts b/src/core/login/pages/reconnect/reconnect.ts index cbbabea19..1dc684011 100644 --- a/src/core/login/pages/reconnect/reconnect.ts +++ b/src/core/login/pages/reconnect/reconnect.ts @@ -14,9 +14,9 @@ import { Component } from '@angular/core'; import { IonicPage, NavController, NavParams } from 'ionic-angular'; -import { CoreAppProvider } from '../../../../providers/app'; -import { CoreSitesProvider } from '../../../../providers/sites'; -import { CoreDomUtilsProvider } from '../../../../providers/utils/dom'; +import { CoreAppProvider } from '@providers/app'; +import { CoreSitesProvider } from '@providers/sites'; +import { CoreDomUtilsProvider } from '@providers/utils/dom'; import { CoreLoginHelperProvider } from '../../providers/helper'; import { FormBuilder, FormGroup, Validators } from '@angular/forms'; diff --git a/src/core/login/pages/site-error/site-error.module.ts b/src/core/login/pages/site-error/site-error.module.ts index 30b2036d5..60284f65f 100644 --- a/src/core/login/pages/site-error/site-error.module.ts +++ b/src/core/login/pages/site-error/site-error.module.ts @@ -16,7 +16,7 @@ import { NgModule } from '@angular/core'; import { IonicPageModule } from 'ionic-angular'; import { CoreLoginSiteErrorPage } from './site-error'; import { TranslateModule } from '@ngx-translate/core'; -import { CoreDirectivesModule } from '../../../../directives/directives.module'; +import { CoreDirectivesModule } from '@directives'; @NgModule({ declarations: [ diff --git a/src/core/login/pages/site-help/site-help.module.ts b/src/core/login/pages/site-help/site-help.module.ts index 942199b3d..c9f01d134 100644 --- a/src/core/login/pages/site-help/site-help.module.ts +++ b/src/core/login/pages/site-help/site-help.module.ts @@ -16,7 +16,7 @@ import { NgModule } from '@angular/core'; import { IonicPageModule } from 'ionic-angular'; import { CoreLoginSiteHelpPage } from './site-help'; import { TranslateModule } from '@ngx-translate/core'; -import { CoreDirectivesModule } from '../../../../directives/directives.module'; +import { CoreDirectivesModule } from '@directives'; @NgModule({ declarations: [ diff --git a/src/core/login/pages/site-policy/site-policy.module.ts b/src/core/login/pages/site-policy/site-policy.module.ts index c029e1c64..65475306b 100644 --- a/src/core/login/pages/site-policy/site-policy.module.ts +++ b/src/core/login/pages/site-policy/site-policy.module.ts @@ -16,8 +16,8 @@ import { NgModule } from '@angular/core'; import { IonicPageModule } from 'ionic-angular'; import { CoreLoginSitePolicyPage } from './site-policy'; import { TranslateModule } from '@ngx-translate/core'; -import { CoreComponentsModule } from '../../../../components/components.module'; -import { CoreDirectivesModule } from '../../../../directives/directives.module'; +import { CoreComponentsModule } from '@components/components.module'; +import { CoreDirectivesModule } from '@directives'; @NgModule({ declarations: [ diff --git a/src/core/login/pages/site-policy/site-policy.ts b/src/core/login/pages/site-policy/site-policy.ts index c9fc76eed..c63026f8c 100644 --- a/src/core/login/pages/site-policy/site-policy.ts +++ b/src/core/login/pages/site-policy/site-policy.ts @@ -14,11 +14,11 @@ import { Component } from '@angular/core'; import { IonicPage, NavController, NavParams } from 'ionic-angular'; -import { CoreSitesProvider } from '../../../../providers/sites'; -import { CoreDomUtilsProvider } from '../../../../providers/utils/dom'; -import { CoreMimetypeUtilsProvider } from '../../../../providers/utils/mimetype'; +import { CoreSitesProvider } from '@providers/sites'; +import { CoreDomUtilsProvider } from '@providers/utils/dom'; +import { CoreMimetypeUtilsProvider } from '@providers/utils/mimetype'; import { CoreLoginHelperProvider } from '../../providers/helper'; -import { CoreSite } from '../../../../classes/site'; +import { CoreSite } from '@classes/site'; /** * Page to accept a site policy. diff --git a/src/core/login/pages/site/site.module.ts b/src/core/login/pages/site/site.module.ts index b446ba9fb..a188fdfc9 100644 --- a/src/core/login/pages/site/site.module.ts +++ b/src/core/login/pages/site/site.module.ts @@ -16,7 +16,7 @@ import { NgModule } from '@angular/core'; import { IonicPageModule } from 'ionic-angular'; import { CoreLoginSitePage } from './site'; import { TranslateModule } from '@ngx-translate/core'; -import { CoreDirectivesModule } from '../../../../directives/directives.module'; +import { CoreDirectivesModule } from '@directives'; @NgModule({ declarations: [ diff --git a/src/core/login/pages/site/site.ts b/src/core/login/pages/site/site.ts index fd7799502..77bb3eb2c 100644 --- a/src/core/login/pages/site/site.ts +++ b/src/core/login/pages/site/site.ts @@ -14,9 +14,9 @@ import { Component } from '@angular/core'; import { IonicPage, NavController, ModalController } from 'ionic-angular'; -import { CoreAppProvider } from '../../../../providers/app'; -import { CoreSitesProvider } from '../../../../providers/sites'; -import { CoreDomUtilsProvider } from '../../../../providers/utils/dom'; +import { CoreAppProvider } from '@providers/app'; +import { CoreSitesProvider } from '@providers/sites'; +import { CoreDomUtilsProvider } from '@providers/utils/dom'; import { CoreConfigConstants } from '../../../../configconstants'; import { CoreLoginHelperProvider } from '../../providers/helper'; import { FormBuilder, FormGroup, Validators } from '@angular/forms'; diff --git a/src/core/login/pages/sites/sites.module.ts b/src/core/login/pages/sites/sites.module.ts index c643dbe4e..5bf8716fd 100644 --- a/src/core/login/pages/sites/sites.module.ts +++ b/src/core/login/pages/sites/sites.module.ts @@ -16,7 +16,7 @@ import { NgModule } from '@angular/core'; import { IonicPageModule } from 'ionic-angular'; import { TranslateModule } from '@ngx-translate/core'; import { CoreLoginSitesPage } from './sites'; -import { CoreDirectivesModule } from '../../../../directives/directives.module'; +import { CoreDirectivesModule } from '@directives'; @NgModule({ declarations: [ diff --git a/src/core/login/pages/sites/sites.ts b/src/core/login/pages/sites/sites.ts index bbc36bb8c..77dfb0d73 100644 --- a/src/core/login/pages/sites/sites.ts +++ b/src/core/login/pages/sites/sites.ts @@ -15,10 +15,11 @@ import { Component } from '@angular/core'; import { IonicPage } from 'ionic-angular'; import { TranslateService } from '@ngx-translate/core'; -import { CoreLoggerProvider } from '../../../../providers/logger'; -import { CoreSitesProvider, CoreSiteBasicInfo } from '../../../../providers/sites'; -import { CoreDomUtilsProvider } from '../../../../providers/utils/dom'; -import { CoreTextUtilsProvider } from '../../../../providers/utils/text'; +import { CoreLoggerProvider } from '@providers/logger'; +import { CoreSitesProvider, CoreSiteBasicInfo } from '@providers/sites'; +import { CoreDomUtilsProvider } from '@providers/utils/dom'; +import { CoreTextUtilsProvider } from '@providers/utils/text'; +import { AddonPushNotificationsProvider } from '@addon/pushnotifications/providers/pushnotifications'; import { CoreLoginHelperProvider } from '../../providers/helper'; /** @@ -35,8 +36,8 @@ export class CoreLoginSitesPage { protected logger; constructor(private domUtils: CoreDomUtilsProvider, private textUtils: CoreTextUtilsProvider, - private sitesProvider: CoreSitesProvider, private loginHelper: CoreLoginHelperProvider, - private translate: TranslateService, logger: CoreLoggerProvider) { + private sitesProvider: CoreSitesProvider, private loginHelper: CoreLoginHelperProvider, logger: CoreLoggerProvider, + private translate: TranslateService, private pushNotificationsProvider: AddonPushNotificationsProvider) { this.logger = logger.getInstance('CoreLoginSitesPage'); } @@ -48,8 +49,10 @@ export class CoreLoginSitesPage { // Remove protocol from the url to show more url text. sites = sites.map((site) => { site.siteUrl = site.siteUrl.replace(/^https?:\/\//, ''); - site.badge = 10; - // @todo: Implement it once push notifications addon is implemented: $mmaPushNotifications.getSiteCounter(site.id) + site.badge = 0; + this.pushNotificationsProvider.getSiteCounter(site.id).then((counter) => { + site.badge = counter; + }); return site; }); @@ -104,8 +107,10 @@ export class CoreLoginSitesPage { this.showDelete = false; // If there are no sites left, go to add site. - this.sitesProvider.hasNoSites().then(() => { - this.loginHelper.goToAddSite(true); + this.sitesProvider.hasSites().then((hasSites) => { + if (!hasSites) { + this.loginHelper.goToAddSite(true); + } }); }).catch((error) => { this.logger.error('Error deleting site ' + site.id, error); diff --git a/src/core/login/providers/helper.ts b/src/core/login/providers/helper.ts index a36be792d..d75c7f3e5 100644 --- a/src/core/login/providers/helper.ts +++ b/src/core/login/providers/helper.ts @@ -15,17 +15,17 @@ import { Injectable } from '@angular/core'; import { Platform } from 'ionic-angular'; import { TranslateService } from '@ngx-translate/core'; -import { CoreAppProvider } from '../../../providers/app'; -import { CoreConfigProvider } from '../../../providers/config'; -import { CoreEventsProvider } from '../../../providers/events'; -import { CoreInitDelegate } from '../../../providers/init'; -import { CoreLoggerProvider } from '../../../providers/logger'; -import { CoreSitesProvider } from '../../../providers/sites'; -import { CoreWSProvider } from '../../../providers/ws'; -import { CoreDomUtilsProvider } from '../../../providers/utils/dom'; -import { CoreTextUtilsProvider } from '../../../providers/utils/text'; -import { CoreUrlUtilsProvider } from '../../../providers/utils/url'; -import { CoreUtilsProvider } from '../../../providers/utils/utils'; +import { CoreAppProvider } from '@providers/app'; +import { CoreConfigProvider } from '@providers/config'; +import { CoreEventsProvider } from '@providers/events'; +import { CoreInitDelegate } from '@providers/init'; +import { CoreLoggerProvider } from '@providers/logger'; +import { CoreSitesProvider } from '@providers/sites'; +import { CoreWSProvider } from '@providers/ws'; +import { CoreDomUtilsProvider } from '@providers/utils/dom'; +import { CoreTextUtilsProvider } from '@providers/utils/text'; +import { CoreUrlUtilsProvider } from '@providers/utils/url'; +import { CoreUtilsProvider } from '@providers/utils/utils'; import { CoreConfigConstants } from '../../../configconstants'; import { CoreConstants } from '../../constants'; import { Md5 } from 'ts-md5/dist/md5'; diff --git a/src/core/mainmenu/pages/menu/menu.ts b/src/core/mainmenu/pages/menu/menu.ts index 94cd7cccb..b4406407b 100644 --- a/src/core/mainmenu/pages/menu/menu.ts +++ b/src/core/mainmenu/pages/menu/menu.ts @@ -14,8 +14,8 @@ import { Component, OnDestroy, ViewChild } from '@angular/core'; import { IonicPage, NavController, NavParams, Tabs } from 'ionic-angular'; -import { CoreEventsProvider } from '../../../../providers/events'; -import { CoreSitesProvider } from '../../../../providers/sites'; +import { CoreEventsProvider } from '@providers/events'; +import { CoreSitesProvider } from '@providers/sites'; import { CoreMainMenuProvider } from '../../providers/mainmenu'; import { CoreMainMenuDelegate, CoreMainMenuHandlerData } from '../../providers/delegate'; diff --git a/src/core/mainmenu/pages/more/more.module.ts b/src/core/mainmenu/pages/more/more.module.ts index f755c35c6..0f2e6b72c 100644 --- a/src/core/mainmenu/pages/more/more.module.ts +++ b/src/core/mainmenu/pages/more/more.module.ts @@ -16,8 +16,8 @@ import { NgModule } from '@angular/core'; import { IonicPageModule } from 'ionic-angular'; import { TranslateModule } from '@ngx-translate/core'; import { CoreMainMenuMorePage } from './more'; -import { CoreComponentsModule } from '../../../../components/components.module'; -import { CoreDirectivesModule } from '../../../../directives/directives.module'; +import { CoreComponentsModule } from '@components/components.module'; +import { CoreDirectivesModule } from '@directives'; @NgModule({ declarations: [ diff --git a/src/core/mainmenu/pages/more/more.ts b/src/core/mainmenu/pages/more/more.ts index be392a961..be6199ffd 100644 --- a/src/core/mainmenu/pages/more/more.ts +++ b/src/core/mainmenu/pages/more/more.ts @@ -14,8 +14,8 @@ import { Component, OnDestroy } from '@angular/core'; import { IonicPage, NavController } from 'ionic-angular'; -import { CoreEventsProvider } from '../../../../providers/events'; -import { CoreSitesProvider } from '../../../../providers/sites'; +import { CoreEventsProvider } from '@providers/events'; +import { CoreSitesProvider } from '@providers/sites'; import { CoreMainMenuDelegate, CoreMainMenuHandlerData } from '../../providers/delegate'; import { CoreMainMenuProvider, CoreMainMenuCustomItem } from '../../providers/mainmenu'; diff --git a/src/core/mainmenu/providers/delegate.ts b/src/core/mainmenu/providers/delegate.ts index de7302f8b..5d8b64865 100644 --- a/src/core/mainmenu/providers/delegate.ts +++ b/src/core/mainmenu/providers/delegate.ts @@ -13,10 +13,10 @@ // limitations under the License. import { Injectable } from '@angular/core'; -import { CoreEventsProvider } from '../../../providers/events'; -import { CoreDelegate, CoreDelegateHandler } from '../../../classes/delegate'; -import { CoreLoggerProvider } from '../../../providers/logger'; -import { CoreSitesProvider } from '../../../providers/sites'; +import { CoreEventsProvider } from '@providers/events'; +import { CoreDelegate, CoreDelegateHandler } from '@classes/delegate'; +import { CoreLoggerProvider } from '@providers/logger'; +import { CoreSitesProvider } from '@providers/sites'; import { Subject, BehaviorSubject } from 'rxjs'; /** diff --git a/src/core/mainmenu/providers/mainmenu.ts b/src/core/mainmenu/providers/mainmenu.ts index 679445442..abcec6f65 100644 --- a/src/core/mainmenu/providers/mainmenu.ts +++ b/src/core/mainmenu/providers/mainmenu.ts @@ -13,8 +13,8 @@ // limitations under the License. import { Injectable } from '@angular/core'; -import { CoreLangProvider } from '../../../providers/lang'; -import { CoreSitesProvider } from '../../../providers/sites'; +import { CoreLangProvider } from '@providers/lang'; +import { CoreSitesProvider } from '@providers/sites'; import { CoreConfigConstants } from '../../../configconstants'; /** diff --git a/src/core/settings/pages/list/list.module.ts b/src/core/settings/pages/list/list.module.ts index 6cc3bf981..5c2fcaf3a 100644 --- a/src/core/settings/pages/list/list.module.ts +++ b/src/core/settings/pages/list/list.module.ts @@ -16,8 +16,8 @@ import { NgModule } from '@angular/core'; import { IonicPageModule } from 'ionic-angular'; import { TranslateModule } from '@ngx-translate/core'; import { CoreSettingsListPage } from './list'; -import { CoreComponentsModule } from '../../../../components/components.module'; -import { CoreDirectivesModule } from '../../../../directives/directives.module'; +import { CoreComponentsModule } from '@components/components.module'; +import { CoreDirectivesModule } from '@directives'; @NgModule({ declarations: [ diff --git a/src/core/sharedfiles/pages/choose-site/choose-site.module.ts b/src/core/sharedfiles/pages/choose-site/choose-site.module.ts index 2436ede4b..4acb401d6 100644 --- a/src/core/sharedfiles/pages/choose-site/choose-site.module.ts +++ b/src/core/sharedfiles/pages/choose-site/choose-site.module.ts @@ -16,8 +16,8 @@ import { NgModule } from '@angular/core'; import { IonicPageModule } from 'ionic-angular'; import { CoreSharedFilesChooseSitePage } from './choose-site'; import { TranslateModule } from '@ngx-translate/core'; -import { CoreComponentsModule } from '../../../../components/components.module'; -import { CoreDirectivesModule } from '../../../../directives/directives.module'; +import { CoreComponentsModule } from '@components/components.module'; +import { CoreDirectivesModule } from '@directives'; @NgModule({ declarations: [ diff --git a/src/core/sharedfiles/pages/choose-site/choose-site.ts b/src/core/sharedfiles/pages/choose-site/choose-site.ts index 86ca16621..e8cc53e08 100644 --- a/src/core/sharedfiles/pages/choose-site/choose-site.ts +++ b/src/core/sharedfiles/pages/choose-site/choose-site.ts @@ -14,9 +14,9 @@ import { Component, OnInit } from '@angular/core'; import { IonicPage, NavController, NavParams } from 'ionic-angular'; -import { CoreFileProvider } from '../../../../providers/file'; -import { CoreSitesProvider } from '../../../../providers/sites'; -import { CoreDomUtilsProvider } from '../../../../providers/utils/dom'; +import { CoreFileProvider } from '@providers/file'; +import { CoreSitesProvider } from '@providers/sites'; +import { CoreDomUtilsProvider } from '@providers/utils/dom'; import { CoreSharedFilesHelperProvider } from '../../providers/helper'; /** diff --git a/src/core/sharedfiles/pages/list/list.module.ts b/src/core/sharedfiles/pages/list/list.module.ts index af48247d6..9fbe43b58 100644 --- a/src/core/sharedfiles/pages/list/list.module.ts +++ b/src/core/sharedfiles/pages/list/list.module.ts @@ -16,8 +16,8 @@ import { NgModule } from '@angular/core'; import { IonicPageModule } from 'ionic-angular'; import { CoreSharedFilesListPage } from './list'; import { TranslateModule } from '@ngx-translate/core'; -import { CoreComponentsModule } from '../../../../components/components.module'; -import { CoreDirectivesModule } from '../../../../directives/directives.module'; +import { CoreComponentsModule } from '@components/components.module'; +import { CoreDirectivesModule } from '@directives'; @NgModule({ declarations: [ diff --git a/src/core/sharedfiles/pages/list/list.ts b/src/core/sharedfiles/pages/list/list.ts index c018d4175..ad3f6f136 100644 --- a/src/core/sharedfiles/pages/list/list.ts +++ b/src/core/sharedfiles/pages/list/list.ts @@ -15,10 +15,10 @@ import { Component, OnInit, OnDestroy } from '@angular/core'; import { IonicPage, ViewController, NavParams, NavController } from 'ionic-angular'; import { TranslateService } from '@ngx-translate/core'; -import { CoreEventsProvider } from '../../../../providers/events'; -import { CoreFileProvider } from '../../../../providers/file'; -import { CoreSitesProvider } from '../../../../providers/sites'; -import { CoreTextUtilsProvider } from '../../../../providers/utils/text'; +import { CoreEventsProvider } from '@providers/events'; +import { CoreFileProvider } from '@providers/file'; +import { CoreSitesProvider } from '@providers/sites'; +import { CoreTextUtilsProvider } from '@providers/utils/text'; import { CoreSharedFilesProvider } from '../../providers/sharedfiles'; /** diff --git a/src/core/sharedfiles/providers/helper.ts b/src/core/sharedfiles/providers/helper.ts index b7307bdd7..36cbcbba7 100644 --- a/src/core/sharedfiles/providers/helper.ts +++ b/src/core/sharedfiles/providers/helper.ts @@ -15,13 +15,13 @@ import { Injectable } from '@angular/core'; import { AlertController, ModalController } from 'ionic-angular'; import { TranslateService } from '@ngx-translate/core'; -import { CoreAppProvider } from '../../../providers/app'; -import { CoreFileProvider } from '../../../providers/file'; -import { CoreLoggerProvider } from '../../../providers/logger'; -import { CoreInitDelegate } from '../../../providers/init'; -import { CoreSitesProvider } from '../../../providers/sites'; -import { CoreDomUtilsProvider } from '../../../providers/utils/dom'; -import { CoreUtilsProvider } from '../../../providers/utils/utils'; +import { CoreAppProvider } from '@providers/app'; +import { CoreFileProvider } from '@providers/file'; +import { CoreLoggerProvider } from '@providers/logger'; +import { CoreInitDelegate } from '@providers/init'; +import { CoreSitesProvider } from '@providers/sites'; +import { CoreDomUtilsProvider } from '@providers/utils/dom'; +import { CoreUtilsProvider } from '@providers/utils/utils'; import { CoreSharedFilesProvider } from './sharedfiles'; import { CoreFileUploaderProvider } from '../../fileuploader/providers/fileuploader'; diff --git a/src/core/sharedfiles/providers/sharedfiles.ts b/src/core/sharedfiles/providers/sharedfiles.ts index c34daf4d6..32e5fd716 100644 --- a/src/core/sharedfiles/providers/sharedfiles.ts +++ b/src/core/sharedfiles/providers/sharedfiles.ts @@ -13,15 +13,15 @@ // limitations under the License. import { Injectable } from '@angular/core'; -import { CoreAppProvider } from '../../../providers/app'; -import { CoreEventsProvider } from '../../../providers/events'; -import { CoreFileProvider } from '../../../providers/file'; -import { CoreLoggerProvider } from '../../../providers/logger'; -import { CoreSitesProvider } from '../../../providers/sites'; -import { CoreMimetypeUtilsProvider } from '../../../providers/utils/mimetype'; -import { CoreTextUtilsProvider } from '../../../providers/utils/text'; +import { CoreAppProvider } from '@providers/app'; +import { CoreEventsProvider } from '@providers/events'; +import { CoreFileProvider } from '@providers/file'; +import { CoreLoggerProvider } from '@providers/logger'; +import { CoreSitesProvider } from '@providers/sites'; +import { CoreMimetypeUtilsProvider } from '@providers/utils/mimetype'; +import { CoreTextUtilsProvider } from '@providers/utils/text'; import { Md5 } from 'ts-md5/dist/md5'; -import { SQLiteDB } from '../../../classes/sqlitedb'; +import { SQLiteDB } from '@classes/sqlitedb'; /** * Service to share files with the app. diff --git a/src/core/sitehome/components/components.module.ts b/src/core/sitehome/components/components.module.ts index 044a2fa01..9a2a04469 100644 --- a/src/core/sitehome/components/components.module.ts +++ b/src/core/sitehome/components/components.module.ts @@ -16,8 +16,8 @@ import { NgModule } from '@angular/core'; import { CommonModule } from '@angular/common'; import { IonicModule } from 'ionic-angular'; import { TranslateModule } from '@ngx-translate/core'; -import { CoreComponentsModule } from '../../../components/components.module'; -import { CoreDirectivesModule } from '../../../directives/directives.module'; +import { CoreComponentsModule } from '@components/components.module'; +import { CoreDirectivesModule } from '@directives'; import { CoreCourseComponentsModule } from '../../course/components/components.module'; import { CoreSiteHomeIndexComponent } from './index/index'; import { CoreSiteHomeAllCourseListComponent } from './all-course-list/all-course-list'; diff --git a/src/core/sitehome/components/index/index.ts b/src/core/sitehome/components/index/index.ts index f2dadf33a..2c6140efb 100644 --- a/src/core/sitehome/components/index/index.ts +++ b/src/core/sitehome/components/index/index.ts @@ -13,8 +13,8 @@ // limitations under the License. import { Component, OnInit } from '@angular/core'; -import { CoreSitesProvider } from '../../../../providers/sites'; -import { CoreDomUtilsProvider } from '../../../../providers/utils/dom'; +import { CoreSitesProvider } from '@providers/sites'; +import { CoreDomUtilsProvider } from '@providers/utils/dom'; import { CoreCourseProvider } from '../../../course/providers/course'; import { CoreCourseHelperProvider } from '../../../course/providers/helper'; import { CoreCourseModulePrefetchDelegate } from '../../../course/providers/module-prefetch-delegate'; diff --git a/src/core/sitehome/components/news/news.ts b/src/core/sitehome/components/news/news.ts index 2e3381ac1..5f928e845 100644 --- a/src/core/sitehome/components/news/news.ts +++ b/src/core/sitehome/components/news/news.ts @@ -13,7 +13,7 @@ // limitations under the License. import { Component, OnInit } from '@angular/core'; -import { CoreSitesProvider } from '../../../../providers/sites'; +import { CoreSitesProvider } from '@providers/sites'; /** * Component that displays site home news. diff --git a/src/core/sitehome/pages/index/index.ts b/src/core/sitehome/pages/index/index.ts index b2b7cea63..162ca1561 100644 --- a/src/core/sitehome/pages/index/index.ts +++ b/src/core/sitehome/pages/index/index.ts @@ -14,7 +14,7 @@ import { Component } from '@angular/core'; import { IonicPage, NavParams, NavController } from 'ionic-angular'; -import { CoreSitesProvider } from '../../../../providers/sites'; +import { CoreSitesProvider } from '@providers/sites'; import { CoreCourseHelperProvider } from '../../../course/providers/helper'; /** diff --git a/src/core/sitehome/providers/index-link-handler.ts b/src/core/sitehome/providers/index-link-handler.ts index 06eeb9cd6..12ec609cb 100644 --- a/src/core/sitehome/providers/index-link-handler.ts +++ b/src/core/sitehome/providers/index-link-handler.ts @@ -13,7 +13,7 @@ // limitations under the License. import { Injectable } from '@angular/core'; -import { CoreSitesProvider } from '../../../providers/sites'; +import { CoreSitesProvider } from '@providers/sites'; import { CoreContentLinksHandlerBase } from '../../contentlinks/classes/base-handler'; import { CoreContentLinksAction } from '../../contentlinks/providers/delegate'; import { CoreLoginHelperProvider } from '../../login/providers/helper'; diff --git a/src/core/sitehome/providers/sitehome.ts b/src/core/sitehome/providers/sitehome.ts index 3f9e131be..036828a8a 100644 --- a/src/core/sitehome/providers/sitehome.ts +++ b/src/core/sitehome/providers/sitehome.ts @@ -13,9 +13,9 @@ // limitations under the License. import { Injectable } from '@angular/core'; -import { CoreLoggerProvider } from '../../../providers/logger'; -import { CoreSitesProvider } from '../../../providers/sites'; -import { CoreSite } from '../../../classes/site'; +import { CoreLoggerProvider } from '@providers/logger'; +import { CoreSitesProvider } from '@providers/sites'; +import { CoreSite } from '@classes/site'; import { CoreCourseProvider } from '../../course/providers/course'; /** diff --git a/src/core/user/components/components.module.ts b/src/core/user/components/components.module.ts index 215319610..a996fbb8c 100644 --- a/src/core/user/components/components.module.ts +++ b/src/core/user/components/components.module.ts @@ -18,9 +18,9 @@ import { IonicModule } from 'ionic-angular'; import { TranslateModule } from '@ngx-translate/core'; import { CoreUserParticipantsComponent } from './participants/participants'; import { CoreUserProfileFieldComponent } from './user-profile-field/user-profile-field'; -import { CoreComponentsModule } from '../../../components/components.module'; -import { CoreDirectivesModule } from '../../../directives/directives.module'; -import { CorePipesModule } from '../../../pipes/pipes.module'; +import { CoreComponentsModule } from '@components/components.module'; +import { CoreDirectivesModule } from '@directives'; +import { CorePipesModule } from '@pipes'; @NgModule({ declarations: [ diff --git a/src/core/user/components/participants/participants.ts b/src/core/user/components/participants/participants.ts index 675be0144..ccc807479 100644 --- a/src/core/user/components/participants/participants.ts +++ b/src/core/user/components/participants/participants.ts @@ -15,8 +15,8 @@ import { Component, ViewChild, Input, OnInit } from '@angular/core'; import { Content, NavParams } from 'ionic-angular'; import { CoreUserProvider } from '../../providers/user'; -import { CoreDomUtilsProvider } from '../../../../providers/utils/dom'; -import { CoreSplitViewComponent } from '../../../../components/split-view/split-view'; +import { CoreDomUtilsProvider } from '@providers/utils/dom'; +import { CoreSplitViewComponent } from '@components/split-view/split-view'; /** * Component that displays the list of course participants. diff --git a/src/core/user/components/user-profile-field/user-profile-field.ts b/src/core/user/components/user-profile-field/user-profile-field.ts index 7cbd32d4f..65b401a32 100644 --- a/src/core/user/components/user-profile-field/user-profile-field.ts +++ b/src/core/user/components/user-profile-field/user-profile-field.ts @@ -14,7 +14,7 @@ import { Component, Input, OnInit } from '@angular/core'; import { CoreUserProfileFieldDelegate } from '../../providers/user-profile-field-delegate'; -import { CoreUtilsProvider } from '../../../../providers/utils/utils'; +import { CoreUtilsProvider } from '@providers/utils/utils'; /** * Directive to render user profile field. diff --git a/src/core/user/pages/about/about.module.ts b/src/core/user/pages/about/about.module.ts index 22ea2afdd..18abe73ea 100644 --- a/src/core/user/pages/about/about.module.ts +++ b/src/core/user/pages/about/about.module.ts @@ -16,8 +16,8 @@ import { NgModule } from '@angular/core'; import { IonicPageModule } from 'ionic-angular'; import { TranslateModule } from '@ngx-translate/core'; import { CoreUserAboutPage } from './about'; -import { CoreDirectivesModule } from '../../../../directives/directives.module'; -import { CoreComponentsModule } from '../../../../components/components.module'; +import { CoreDirectivesModule } from '@directives'; +import { CoreComponentsModule } from '@components/components.module'; import { CoreUserComponentsModule } from '../../components/components.module'; @NgModule({ diff --git a/src/core/user/pages/about/about.ts b/src/core/user/pages/about/about.ts index 856760407..9d9b77a05 100644 --- a/src/core/user/pages/about/about.ts +++ b/src/core/user/pages/about/about.ts @@ -16,9 +16,9 @@ import { Component } from '@angular/core'; import { IonicPage, NavParams, Platform } from 'ionic-angular'; import { CoreUserProvider } from '../../providers/user'; import { CoreUserHelperProvider } from '../../providers/helper'; -import { CoreDomUtilsProvider } from '../../../../providers/utils/dom'; -import { CoreEventsProvider } from '../../../../providers/events'; -import { CoreSitesProvider } from '../../../../providers/sites'; +import { CoreDomUtilsProvider } from '@providers/utils/dom'; +import { CoreEventsProvider } from '@providers/events'; +import { CoreSitesProvider } from '@providers/sites'; /** * Page that displays an user about page. diff --git a/src/core/user/pages/profile/profile.module.ts b/src/core/user/pages/profile/profile.module.ts index f8a6d8922..3b7e17e5c 100644 --- a/src/core/user/pages/profile/profile.module.ts +++ b/src/core/user/pages/profile/profile.module.ts @@ -16,8 +16,8 @@ import { NgModule } from '@angular/core'; import { IonicPageModule } from 'ionic-angular'; import { TranslateModule } from '@ngx-translate/core'; import { CoreUserProfilePage } from './profile'; -import { CoreDirectivesModule } from '../../../../directives/directives.module'; -import { CoreComponentsModule } from '../../../../components/components.module'; +import { CoreDirectivesModule } from '@directives'; +import { CoreComponentsModule } from '@components/components.module'; @NgModule({ declarations: [ diff --git a/src/core/user/pages/profile/profile.ts b/src/core/user/pages/profile/profile.ts index 0c188c07c..c72d2051e 100644 --- a/src/core/user/pages/profile/profile.ts +++ b/src/core/user/pages/profile/profile.ts @@ -16,15 +16,15 @@ import { Component, Optional } from '@angular/core'; import { IonicPage, NavParams, NavController } from 'ionic-angular'; import { CoreUserProvider } from '../../providers/user'; import { CoreUserHelperProvider } from '../../providers/helper'; -import { CoreDomUtilsProvider } from '../../../../providers/utils/dom'; +import { CoreDomUtilsProvider } from '@providers/utils/dom'; import { TranslateService } from '@ngx-translate/core'; import { CoreCoursesProvider } from '../../../courses/providers/courses'; -import { CoreEventsProvider } from '../../../../providers/events'; -import { CoreSitesProvider } from '../../../../providers/sites'; -import { CoreMimetypeUtilsProvider } from '../../../../providers/utils/mimetype'; +import { CoreEventsProvider } from '@providers/events'; +import { CoreSitesProvider } from '@providers/sites'; +import { CoreMimetypeUtilsProvider } from '@providers/utils/mimetype'; import { CoreFileUploaderHelperProvider } from '../../../fileuploader/providers/helper'; import { CoreUserDelegate, CoreUserProfileHandlerData } from '../../providers/user-delegate'; -import { CoreSplitViewComponent } from '../../../../components/split-view/split-view'; +import { CoreSplitViewComponent } from '@components/split-view/split-view'; /** * Page that displays an user profile page. diff --git a/src/core/user/providers/helper.ts b/src/core/user/providers/helper.ts index 044c85bd6..fd9367869 100644 --- a/src/core/user/providers/helper.ts +++ b/src/core/user/providers/helper.ts @@ -13,7 +13,7 @@ // limitations under the License. import { Injectable } from '@angular/core'; -import { CoreLoggerProvider } from '../../../providers/logger'; +import { CoreLoggerProvider } from '@providers/logger'; import { TranslateService } from '@ngx-translate/core'; /** diff --git a/src/core/user/providers/participants-link-handler.ts b/src/core/user/providers/participants-link-handler.ts index f085458f8..2d6f1a4b7 100644 --- a/src/core/user/providers/participants-link-handler.ts +++ b/src/core/user/providers/participants-link-handler.ts @@ -13,9 +13,9 @@ // limitations under the License. import { Injectable } from '@angular/core'; -import { CoreContentLinksHandlerBase } from '../../../core/contentlinks/classes/base-handler'; -import { CoreContentLinksAction } from '../../../core/contentlinks/providers/delegate'; -import { CoreLoginHelperProvider } from '../../../core/login/providers/helper'; +import { CoreContentLinksHandlerBase } from '@core/contentlinks/classes/base-handler'; +import { CoreContentLinksAction } from '@core/contentlinks/providers/delegate'; +import { CoreLoginHelperProvider } from '@core/login/providers/helper'; import { CoreUserProvider } from './user'; /** diff --git a/src/core/user/providers/user-delegate.ts b/src/core/user/providers/user-delegate.ts index 62452c596..c5aec03b3 100644 --- a/src/core/user/providers/user-delegate.ts +++ b/src/core/user/providers/user-delegate.ts @@ -14,11 +14,11 @@ import { Injectable } from '@angular/core'; import { NavController } from 'ionic-angular'; -import { CoreDelegate, CoreDelegateHandler } from '../../../classes/delegate'; -import { CoreCoursesProvider } from '../../../core/courses/providers/courses'; -import { CoreLoggerProvider } from '../../../providers/logger'; -import { CoreSitesProvider } from '../../../providers/sites'; -import { CoreEventsProvider } from '../../../providers/events'; +import { CoreDelegate, CoreDelegateHandler } from '@classes/delegate'; +import { CoreCoursesProvider } from '@core/courses/providers/courses'; +import { CoreLoggerProvider } from '@providers/logger'; +import { CoreSitesProvider } from '@providers/sites'; +import { CoreEventsProvider } from '@providers/events'; /** * Interface that all user profile handlers must implement. diff --git a/src/core/user/providers/user-handler.ts b/src/core/user/providers/user-handler.ts index e8127290f..5ddb638b2 100644 --- a/src/core/user/providers/user-handler.ts +++ b/src/core/user/providers/user-handler.ts @@ -14,7 +14,7 @@ import { Injectable } from '@angular/core'; import { CoreUserDelegate, CoreUserProfileHandler, CoreUserProfileHandlerData } from './user-delegate'; -import { CoreSitesProvider } from '../../../providers/sites'; +import { CoreSitesProvider } from '@providers/sites'; /** * Profile links email handler. diff --git a/src/core/user/providers/user-profile-field-delegate.ts b/src/core/user/providers/user-profile-field-delegate.ts index c3e8b7282..41c4b3d47 100644 --- a/src/core/user/providers/user-profile-field-delegate.ts +++ b/src/core/user/providers/user-profile-field-delegate.ts @@ -13,10 +13,10 @@ // limitations under the License. import { Injectable } from '@angular/core'; -import { CoreDelegate, CoreDelegateHandler } from '../../../classes/delegate'; -import { CoreLoggerProvider } from '../../../providers/logger'; -import { CoreSitesProvider } from '../../../providers/sites'; -import { CoreEventsProvider } from '../../../providers/events'; +import { CoreDelegate, CoreDelegateHandler } from '@classes/delegate'; +import { CoreLoggerProvider } from '@providers/logger'; +import { CoreSitesProvider } from '@providers/sites'; +import { CoreEventsProvider } from '@providers/events'; export interface CoreUserProfileFieldHandler extends CoreDelegateHandler { diff --git a/src/core/user/providers/user.ts b/src/core/user/providers/user.ts index 5047b352e..052caa938 100644 --- a/src/core/user/providers/user.ts +++ b/src/core/user/providers/user.ts @@ -13,10 +13,10 @@ // limitations under the License. import { Injectable } from '@angular/core'; -import { CoreLoggerProvider } from '../../../providers/logger'; -import { CoreSite } from '../../../classes/site'; -import { CoreSitesProvider } from '../../../providers/sites'; -import { CoreUtilsProvider } from '../../../providers/utils/utils'; +import { CoreLoggerProvider } from '@providers/logger'; +import { CoreSite } from '@classes/site'; +import { CoreSitesProvider } from '@providers/sites'; +import { CoreUtilsProvider } from '@providers/utils/utils'; /** * Service to provide user functionalities. @@ -398,8 +398,8 @@ export class CoreUserProvider { const promises = []; users.forEach((user) => { - if (typeof user.id != 'undefined') { - promises.push(this.storeUser(user.id, user.fullname, user.profileimageurl, siteId)); + if (typeof user.id != 'undefined' && !isNaN(parseInt(user.id, 10))) { + promises.push(this.storeUser(parseInt(user.id, 10), user.fullname, user.profileimageurl, siteId)); } }); @@ -422,6 +422,7 @@ export class CoreUserProvider { value: value } ]; + return this.updateUserPreferences(preferences, undefined, userId, siteId); } diff --git a/src/core/user/user.module.ts b/src/core/user/user.module.ts index 92588ca57..38adb10f6 100644 --- a/src/core/user/user.module.ts +++ b/src/core/user/user.module.ts @@ -18,8 +18,8 @@ import { CoreUserProfileFieldDelegate } from './providers/user-profile-field-del import { CoreUserProvider } from './providers/user'; import { CoreUserHelperProvider } from './providers/helper'; import { CoreUserProfileMailHandler } from './providers/user-handler'; -import { CoreEventsProvider } from '../../providers/events'; -import { CoreSitesProvider } from '../../providers/sites'; +import { CoreEventsProvider } from '@providers/events'; +import { CoreSitesProvider } from '@providers/sites'; import { CoreContentLinksDelegate } from '../contentlinks/providers/delegate'; import { CoreUserProfileLinkHandler } from './providers/user-link-handler'; import { CoreUserParticipantsCourseOptionHandler } from './providers/course-option-handler'; diff --git a/src/core/viewer/pages/iframe/iframe.module.ts b/src/core/viewer/pages/iframe/iframe.module.ts index f5cd9ddf4..d2dab2f6b 100644 --- a/src/core/viewer/pages/iframe/iframe.module.ts +++ b/src/core/viewer/pages/iframe/iframe.module.ts @@ -15,7 +15,7 @@ import { NgModule } from '@angular/core'; import { IonicPageModule } from 'ionic-angular'; import { CoreViewerIframePage } from './iframe'; -import { CoreComponentsModule } from '../../../../components/components.module'; +import { CoreComponentsModule } from '@components/components.module'; @NgModule({ declarations: [ diff --git a/src/core/viewer/pages/image/image.module.ts b/src/core/viewer/pages/image/image.module.ts index 62cd6dff0..1f1a6f8e6 100644 --- a/src/core/viewer/pages/image/image.module.ts +++ b/src/core/viewer/pages/image/image.module.ts @@ -16,7 +16,7 @@ import { NgModule } from '@angular/core'; import { IonicPageModule } from 'ionic-angular'; import { TranslateModule } from '@ngx-translate/core'; import { CoreViewerImagePage } from './image'; -import { CoreDirectivesModule } from '../../../../directives/directives.module'; +import { CoreDirectivesModule } from '@directives'; @NgModule({ declarations: [ diff --git a/src/core/viewer/pages/text/text.module.ts b/src/core/viewer/pages/text/text.module.ts index 01fc3cf39..2a951b7d3 100644 --- a/src/core/viewer/pages/text/text.module.ts +++ b/src/core/viewer/pages/text/text.module.ts @@ -16,7 +16,7 @@ import { NgModule } from '@angular/core'; import { IonicPageModule } from 'ionic-angular'; import { TranslateModule } from '@ngx-translate/core'; import { CoreViewerTextPage } from './text'; -import { CoreDirectivesModule } from '../../../../directives/directives.module'; +import { CoreDirectivesModule } from '@directives'; /** * Module to lazy load the page. diff --git a/src/core/viewer/pages/text/text.ts b/src/core/viewer/pages/text/text.ts index 64da6c45f..98d1bf6ad 100644 --- a/src/core/viewer/pages/text/text.ts +++ b/src/core/viewer/pages/text/text.ts @@ -14,7 +14,7 @@ import { Component } from '@angular/core'; import { IonicPage, ViewController, NavParams } from 'ionic-angular'; -import { CoreTextUtilsProvider } from '../../../../providers/utils/text'; +import { CoreTextUtilsProvider } from '@providers/utils/text'; /** * Page to render a certain text. If opened as a modal, it will have a button to close the modal. diff --git a/src/directives/auto-focus.ts b/src/directives/auto-focus.ts index 98988335a..ce2aa6608 100644 --- a/src/directives/auto-focus.ts +++ b/src/directives/auto-focus.ts @@ -14,8 +14,8 @@ import { Directive, Input, OnInit, ElementRef } from '@angular/core'; import { NavController } from 'ionic-angular'; -import { CoreDomUtilsProvider } from '../providers/utils/dom'; -import { CoreUtilsProvider } from '../providers/utils/utils'; +import { CoreDomUtilsProvider } from '@providers/utils/dom'; +import { CoreUtilsProvider } from '@providers/utils/utils'; /** * Directive to auto focus an element when a view is loaded. diff --git a/src/directives/external-content.ts b/src/directives/external-content.ts index b6e89722b..e57585817 100644 --- a/src/directives/external-content.ts +++ b/src/directives/external-content.ts @@ -14,12 +14,12 @@ import { Directive, Input, AfterViewInit, ElementRef } from '@angular/core'; import { Platform } from 'ionic-angular'; -import { CoreAppProvider } from '../providers/app'; -import { CoreLoggerProvider } from '../providers/logger'; -import { CoreFilepoolProvider } from '../providers/filepool'; -import { CoreSitesProvider } from '../providers/sites'; -import { CoreDomUtilsProvider } from '../providers/utils/dom'; -import { CoreUrlUtilsProvider } from '../providers/utils/url'; +import { CoreAppProvider } from '@providers/app'; +import { CoreLoggerProvider } from '@providers/logger'; +import { CoreFilepoolProvider } from '@providers/filepool'; +import { CoreSitesProvider } from '@providers/sites'; +import { CoreDomUtilsProvider } from '@providers/utils/dom'; +import { CoreUrlUtilsProvider } from '@providers/utils/url'; /** * Directive to handle external content. diff --git a/src/directives/format-text.ts b/src/directives/format-text.ts index d48e0f6a8..b65a5107d 100644 --- a/src/directives/format-text.ts +++ b/src/directives/format-text.ts @@ -15,18 +15,18 @@ import { Directive, ElementRef, Input, Output, EventEmitter, OnChanges, SimpleChange, Optional } from '@angular/core'; import { Platform, NavController, Content } from 'ionic-angular'; import { TranslateService } from '@ngx-translate/core'; -import { CoreAppProvider } from '../providers/app'; -import { CoreFilepoolProvider } from '../providers/filepool'; -import { CoreLoggerProvider } from '../providers/logger'; -import { CoreSitesProvider } from '../providers/sites'; -import { CoreDomUtilsProvider } from '../providers/utils/dom'; -import { CoreTextUtilsProvider } from '../providers/utils/text'; -import { CoreUrlUtilsProvider } from '../providers/utils/url'; -import { CoreUtilsProvider } from '../providers/utils/utils'; -import { CoreSite } from '../classes/site'; +import { CoreAppProvider } from '@providers/app'; +import { CoreFilepoolProvider } from '@providers/filepool'; +import { CoreLoggerProvider } from '@providers/logger'; +import { CoreSitesProvider } from '@providers/sites'; +import { CoreDomUtilsProvider } from '@providers/utils/dom'; +import { CoreTextUtilsProvider } from '@providers/utils/text'; +import { CoreUrlUtilsProvider } from '@providers/utils/url'; +import { CoreUtilsProvider } from '@providers/utils/utils'; +import { CoreSite } from '@classes/site'; import { CoreLinkDirective } from '../directives/link'; import { CoreExternalContentDirective } from '../directives/external-content'; -import { CoreContentLinksHelperProvider } from '../core/contentlinks/providers/helper'; +import { CoreContentLinksHelperProvider } from '@core/contentlinks/providers/helper'; /** * Directive to format text rendered. It renders the HTML and treats all links and media, using CoreLinkDirective diff --git a/src/directives/keep-keyboard.ts b/src/directives/keep-keyboard.ts index f953020a7..2cdc41e1f 100644 --- a/src/directives/keep-keyboard.ts +++ b/src/directives/keep-keyboard.ts @@ -13,8 +13,8 @@ // limitations under the License. import { Directive, AfterViewInit, Input, ElementRef, OnDestroy } from '@angular/core'; -import { CoreDomUtilsProvider } from '../providers/utils/dom'; -import { CoreUtilsProvider } from '../providers/utils/utils'; +import { CoreDomUtilsProvider } from '@providers/utils/dom'; +import { CoreUtilsProvider } from '@providers/utils/utils'; /** * Directive to keep the keyboard open when clicking a certain element (usually a button). diff --git a/src/directives/link.ts b/src/directives/link.ts index 2069ce479..d37179cf0 100644 --- a/src/directives/link.ts +++ b/src/directives/link.ts @@ -14,11 +14,11 @@ import { Directive, Input, OnInit, ElementRef, Optional } from '@angular/core'; import { NavController, Content } from 'ionic-angular'; -import { CoreSitesProvider } from '../providers/sites'; -import { CoreDomUtilsProvider } from '../providers/utils/dom'; -import { CoreUrlUtilsProvider } from '../providers/utils/url'; -import { CoreUtilsProvider } from '../providers/utils/utils'; -import { CoreContentLinksHelperProvider } from '../core/contentlinks/providers/helper'; +import { CoreSitesProvider } from '@providers/sites'; +import { CoreDomUtilsProvider } from '@providers/utils/dom'; +import { CoreUrlUtilsProvider } from '@providers/utils/url'; +import { CoreUtilsProvider } from '@providers/utils/utils'; +import { CoreContentLinksHelperProvider } from '@core/contentlinks/providers/helper'; import { CoreConfigConstants } from '../configconstants'; /** diff --git a/src/pipes/bytes-to-size.ts b/src/pipes/bytes-to-size.ts index de73241fe..6e2d07127 100644 --- a/src/pipes/bytes-to-size.ts +++ b/src/pipes/bytes-to-size.ts @@ -13,8 +13,8 @@ // limitations under the License. import { Pipe, PipeTransform } from '@angular/core'; -import { CoreLoggerProvider } from '../providers/logger'; -import { CoreTextUtilsProvider } from '../providers/utils/text'; +import { CoreLoggerProvider } from '@providers/logger'; +import { CoreTextUtilsProvider } from '@providers/utils/text'; /** * Pipe to turn a number in bytes to a human readable size (e.g. 5,25 MB). diff --git a/src/pipes/date-day-or-time.ts b/src/pipes/date-day-or-time.ts index 95875799d..5a77f0f7b 100644 --- a/src/pipes/date-day-or-time.ts +++ b/src/pipes/date-day-or-time.ts @@ -14,7 +14,7 @@ import { Pipe, PipeTransform } from '@angular/core'; import { TranslateService } from '@ngx-translate/core'; -import { CoreLoggerProvider } from '../providers/logger'; +import { CoreLoggerProvider } from '@providers/logger'; import * as moment from 'moment'; /** diff --git a/src/pipes/duration.ts b/src/pipes/duration.ts index 71ce2d1ce..cf6f615c4 100644 --- a/src/pipes/duration.ts +++ b/src/pipes/duration.ts @@ -13,7 +13,7 @@ // limitations under the License. import { Pipe, PipeTransform } from '@angular/core'; -import { CoreLoggerProvider } from '../providers/logger'; +import { CoreLoggerProvider } from '@providers/logger'; import * as moment from 'moment'; /** diff --git a/src/pipes/format-date.ts b/src/pipes/format-date.ts index 796f7b9e0..e1b238fd4 100644 --- a/src/pipes/format-date.ts +++ b/src/pipes/format-date.ts @@ -14,7 +14,7 @@ import { Pipe, PipeTransform } from '@angular/core'; import { TranslateService } from '@ngx-translate/core'; -import { CoreLoggerProvider } from '../providers/logger'; +import { CoreLoggerProvider } from '@providers/logger'; import * as moment from 'moment'; /** diff --git a/src/pipes/seconds-to-hms.ts b/src/pipes/seconds-to-hms.ts index 05f7825f7..dd71624d6 100644 --- a/src/pipes/seconds-to-hms.ts +++ b/src/pipes/seconds-to-hms.ts @@ -13,9 +13,9 @@ // limitations under the License. import { Pipe, PipeTransform } from '@angular/core'; -import { CoreLoggerProvider } from '../providers/logger'; -import { CoreTextUtilsProvider } from '../providers/utils/text'; -import { CoreConstants } from '../core/constants'; +import { CoreLoggerProvider } from '@providers/logger'; +import { CoreTextUtilsProvider } from '@providers/utils/text'; +import { CoreConstants } from '@core/constants'; /** * Pipe to convert a number of seconds to Hours:Minutes:Seconds. diff --git a/src/pipes/time-ago.ts b/src/pipes/time-ago.ts index d0283e9ec..07f8d3dd6 100644 --- a/src/pipes/time-ago.ts +++ b/src/pipes/time-ago.ts @@ -13,7 +13,7 @@ // limitations under the License. import { Pipe, PipeTransform } from '@angular/core'; -import { CoreLoggerProvider } from '../providers/logger'; +import { CoreLoggerProvider } from '@providers/logger'; import * as moment from 'moment'; /** diff --git a/src/pipes/to-locale-string.ts b/src/pipes/to-locale-string.ts index 84f880054..19c3434fb 100644 --- a/src/pipes/to-locale-string.ts +++ b/src/pipes/to-locale-string.ts @@ -13,7 +13,7 @@ // limitations under the License. import { Pipe, PipeTransform } from '@angular/core'; -import { CoreLoggerProvider } from '../providers/logger'; +import { CoreLoggerProvider } from '@providers/logger'; /** * Filter to format a timestamp to a locale string. Timestamp can be in seconds or milliseconds. diff --git a/src/providers/config.ts b/src/providers/config.ts index d062a8d22..554ee3b21 100644 --- a/src/providers/config.ts +++ b/src/providers/config.ts @@ -14,7 +14,7 @@ import { Injectable } from '@angular/core'; import { CoreAppProvider } from './app'; -import { SQLiteDB } from '../classes/sqlitedb'; +import { SQLiteDB } from '@classes/sqlitedb'; /** * Factory to provide access to dynamic and permanent config and settings. diff --git a/src/providers/cron.ts b/src/providers/cron.ts index c3bdc18fb..930d324a2 100644 --- a/src/providers/cron.ts +++ b/src/providers/cron.ts @@ -18,8 +18,8 @@ import { CoreAppProvider } from './app'; import { CoreConfigProvider } from './config'; import { CoreLoggerProvider } from './logger'; import { CoreUtilsProvider } from './utils/utils'; -import { CoreConstants } from '../core/constants'; -import { SQLiteDB } from '../classes/sqlitedb'; +import { CoreConstants } from '@core/constants'; +import { SQLiteDB } from '@classes/sqlitedb'; /** * Interface that all cron handlers must implement. diff --git a/src/providers/db.ts b/src/providers/db.ts index fa4fd6192..e1007fa27 100644 --- a/src/providers/db.ts +++ b/src/providers/db.ts @@ -15,8 +15,8 @@ import { Injectable } from '@angular/core'; import { SQLite } from '@ionic-native/sqlite'; import { Platform } from 'ionic-angular'; -import { SQLiteDB } from '../classes/sqlitedb'; -import { SQLiteDBMock } from '../core/emulator/classes/sqlitedb'; +import { SQLiteDB } from '@classes/sqlitedb'; +import { SQLiteDBMock } from '@core/emulator/classes/sqlitedb'; /** * This service allows interacting with the local database to store and retrieve data. diff --git a/src/providers/events.ts b/src/providers/events.ts index 5ca5c2ab1..bbe557636 100644 --- a/src/providers/events.ts +++ b/src/providers/events.ts @@ -14,7 +14,7 @@ import { Injectable } from '@angular/core'; import { Subject } from 'rxjs'; -import { CoreLoggerProvider } from '../providers/logger'; +import { CoreLoggerProvider } from '@providers/logger'; /** * Observer instance to stop listening to an event. diff --git a/src/providers/filepool.ts b/src/providers/filepool.ts index ab2dba3e6..cc677fef9 100644 --- a/src/providers/filepool.ts +++ b/src/providers/filepool.ts @@ -27,8 +27,8 @@ import { CoreTextUtilsProvider } from './utils/text'; import { CoreTimeUtilsProvider } from './utils/time'; import { CoreUrlUtilsProvider } from './utils/url'; import { CoreUtilsProvider } from './utils/utils'; -import { SQLiteDB } from '../classes/sqlitedb'; -import { CoreConstants } from '../core/constants'; +import { SQLiteDB } from '@classes/sqlitedb'; +import { CoreConstants } from '@core/constants'; import { Md5 } from 'ts-md5/dist/md5'; /** diff --git a/src/providers/local-notifications.ts b/src/providers/local-notifications.ts index 894d228e3..5d4bdd647 100644 --- a/src/providers/local-notifications.ts +++ b/src/providers/local-notifications.ts @@ -20,8 +20,8 @@ import { CoreConfigProvider } from './config'; import { CoreLoggerProvider } from './logger'; import { CoreDomUtilsProvider } from './utils/dom'; import { CoreUtilsProvider } from './utils/utils'; -import { SQLiteDB } from '../classes/sqlitedb'; -import { CoreConstants } from '../core/constants'; +import { SQLiteDB } from '@classes/sqlitedb'; +import { CoreConstants } from '@core/constants'; import { Subject } from 'rxjs'; /** diff --git a/src/providers/sites-factory.ts b/src/providers/sites-factory.ts index e28519e1e..dda512f8c 100644 --- a/src/providers/sites-factory.ts +++ b/src/providers/sites-factory.ts @@ -13,7 +13,7 @@ // limitations under the License. import { Injectable, Injector } from '@angular/core'; -import { CoreSite } from '../classes/site'; +import { CoreSite } from '@classes/site'; /* * Provider to create sites instances. diff --git a/src/providers/sites.ts b/src/providers/sites.ts index 21aa9efd3..435024ee0 100644 --- a/src/providers/sites.ts +++ b/src/providers/sites.ts @@ -21,10 +21,10 @@ import { CoreLoggerProvider } from './logger'; import { CoreSitesFactoryProvider } from './sites-factory'; import { CoreUrlUtilsProvider } from './utils/url'; import { CoreUtilsProvider } from './utils/utils'; -import { CoreConstants } from '../core/constants'; +import { CoreConstants } from '@core/constants'; import { CoreConfigConstants } from '../configconstants'; -import { CoreSite } from '../classes/site'; -import { SQLiteDB } from '../classes/sqlitedb'; +import { CoreSite } from '@classes/site'; +import { SQLiteDB } from '@classes/sqlitedb'; import { Md5 } from 'ts-md5/dist/md5'; /** @@ -744,29 +744,14 @@ export class CoreSitesProvider { }); } - /** - * Check if there are no sites stored. - * - * @return {Promise} Promise resolved if there are no sites, and rejected if there is at least one. - */ - hasNoSites(): Promise { - return this.appDB.countRecords(this.SITES_TABLE).then((count) => { - if (count > 0) { - return Promise.reject(null); - } - }); - } - /** * Check if there are sites stored. * - * @return {Promise} Promise resolved if there is at least one site, and rejected if there aren't. + * @return {Promise} Promise resolved with true if there are sites and false if there aren't. */ - hasSites(): Promise { + hasSites(): Promise { return this.appDB.countRecords(this.SITES_TABLE).then((count) => { - if (count == 0) { - return Promise.reject(null); - } + return count > 0; }); } diff --git a/src/providers/utils/dom.ts b/src/providers/utils/dom.ts index 292cf4315..72843064c 100644 --- a/src/providers/utils/dom.ts +++ b/src/providers/utils/dom.ts @@ -22,7 +22,7 @@ import { CoreTextUtilsProvider } from './text'; import { CoreAppProvider } from '../app'; import { CoreConfigProvider } from '../config'; import { CoreUrlUtilsProvider } from './url'; -import { CoreConstants } from '../../core/constants'; +import { CoreConstants } from '@core/constants'; /* * "Utils" service with helper functions for UI, DOM elements and HTML code. diff --git a/src/providers/utils/time.ts b/src/providers/utils/time.ts index 2cdd4e771..8ab41f1f9 100644 --- a/src/providers/utils/time.ts +++ b/src/providers/utils/time.ts @@ -15,7 +15,7 @@ import { Injectable } from '@angular/core'; import { TranslateService } from '@ngx-translate/core'; import * as moment from 'moment'; -import { CoreConstants } from '../../core/constants'; +import { CoreConstants } from '@core/constants'; /* * "Utils" service with helper functions for date and time. diff --git a/src/providers/ws.ts b/src/providers/ws.ts index dac52324d..6e9a3a516 100644 --- a/src/providers/ws.ts +++ b/src/providers/ws.ts @@ -23,9 +23,9 @@ import { CoreLoggerProvider } from './logger'; import { CoreMimetypeUtilsProvider } from './utils/mimetype'; import { CoreTextUtilsProvider } from './utils/text'; import { CoreUtilsProvider } from './utils/utils'; -import { CoreConstants } from '../core/constants'; +import { CoreConstants } from '@core/constants'; import { Md5 } from 'ts-md5/dist/md5'; -import { CoreInterceptor } from '../classes/interceptor'; +import { CoreInterceptor } from '@classes/interceptor'; /** * PreSets accepted by the WS call. diff --git a/tsconfig.json b/tsconfig.json index 9654b0fb9..a6feed9c8 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -18,7 +18,7 @@ "@classes/*": ["classes/*"], "@core/*": ["core/*"], "@providers/*": ["providers/*"], - "@components": ["components/*"], + "@components/*": ["components/*"], "@directives": ["directives/directives.module"], "@pipes": ["pipes/pipes.module"] }