From 988ddb4b9423a1e505afa4d72161eb11e98fe728 Mon Sep 17 00:00:00 2001 From: Dani Palou Date: Wed, 8 Nov 2023 12:15:39 +0100 Subject: [PATCH 1/8] MOBILE-4469 core: Move CoreSite class to new sites folder --- src/addons/badges/services/badges.ts | 2 +- .../myoverview/components/myoverview/myoverview.ts | 2 +- .../recentlyaccessedcourses.ts | 2 +- .../services/recentlyaccesseditems.ts | 2 +- .../components/starredcourses/starredcourses.ts | 2 +- .../block/starredcourses/services/starredcourses.ts | 2 +- src/addons/block/timeline/services/timeline.ts | 2 +- src/addons/blog/services/blog.ts | 2 +- src/addons/calendar/pages/edit-event/edit-event.ts | 2 +- src/addons/calendar/services/calendar.ts | 2 +- src/addons/competency/services/competency.ts | 2 +- .../coursecompletion/services/coursecompletion.ts | 2 +- src/addons/enrol/guest/services/guest.ts | 2 +- src/addons/enrol/self/services/self.ts | 2 +- .../activitynames/services/handlers/activitynames.ts | 2 +- .../filter/algebra/services/handlers/algebra.ts | 2 +- src/addons/filter/censor/services/handlers/censor.ts | 2 +- src/addons/filter/data/services/handlers/data.ts | 2 +- .../emailprotect/services/handlers/emailprotect.ts | 2 +- .../filter/emoticon/services/handlers/emoticon.ts | 2 +- .../filter/glossary/services/handlers/glossary.ts | 2 +- .../mathjaxloader/services/handlers/mathjaxloader.ts | 2 +- .../filter/multilang/services/handlers/multilang.ts | 2 +- src/addons/filter/tex/services/handlers/tex.ts | 2 +- src/addons/filter/tidy/services/handlers/tidy.ts | 2 +- .../filter/urltolink/services/handlers/urltolink.ts | 2 +- .../airnotifier/services/airnotifier.ts | 2 +- src/addons/messages/services/messages-sync.ts | 2 +- src/addons/messages/services/messages.ts | 2 +- src/addons/mod/assign/components/index/index.ts | 2 +- src/addons/mod/assign/services/assign.ts | 2 +- .../mod/bigbluebuttonbn/services/bigbluebuttonbn.ts | 2 +- src/addons/mod/book/services/book.ts | 2 +- src/addons/mod/chat/services/chat.ts | 2 +- src/addons/mod/choice/services/choice.ts | 2 +- src/addons/mod/data/services/data.ts | 2 +- src/addons/mod/feedback/pages/form/form.ts | 2 +- src/addons/mod/feedback/services/feedback.ts | 2 +- src/addons/mod/folder/services/folder.ts | 2 +- src/addons/mod/forum/services/forum.ts | 2 +- src/addons/mod/glossary/services/glossary.ts | 2 +- src/addons/mod/h5pactivity/components/index/index.ts | 2 +- src/addons/mod/h5pactivity/services/h5pactivity.ts | 2 +- src/addons/mod/imscp/services/imscp.ts | 2 +- src/addons/mod/label/services/label.ts | 2 +- src/addons/mod/lesson/services/lesson.ts | 2 +- src/addons/mod/lti/services/lti.ts | 2 +- src/addons/mod/page/services/page.ts | 2 +- src/addons/mod/quiz/services/quiz.ts | 2 +- src/addons/mod/resource/services/resource.ts | 2 +- src/addons/mod/scorm/services/scorm.ts | 2 +- src/addons/mod/survey/services/survey.ts | 2 +- src/addons/mod/url/services/url.ts | 2 +- src/addons/mod/wiki/services/wiki.ts | 2 +- src/addons/mod/workshop/services/workshop.ts | 2 +- src/addons/notes/services/notes.ts | 2 +- src/addons/notifications/services/notifications.ts | 2 +- src/addons/privatefiles/services/privatefiles.ts | 2 +- .../remotethemes/services/remotethemes-handler.ts | 2 +- src/addons/report/insights/services/insights.ts | 2 +- src/core/classes/delegate.ts | 2 +- src/core/classes/page-load-watcher.ts | 2 +- src/core/classes/{ => sites}/site.ts | 12 ++++++------ src/core/directives/external-content.ts | 2 +- src/core/directives/format-text.ts | 2 +- src/core/directives/tests/format-text.test.ts | 2 +- src/core/features/autologout/services/autologout.ts | 2 +- src/core/features/block/services/block-delegate.ts | 2 +- src/core/features/comments/services/comments.ts | 2 +- .../contentlinks/services/contentlinks-helper.ts | 2 +- src/core/features/course/services/course-helper.ts | 2 +- src/core/features/course/services/course.ts | 2 +- src/core/features/course/services/module-delegate.ts | 2 +- .../course/services/module-prefetch-delegate.ts | 2 +- src/core/features/courses/services/courses-helper.ts | 2 +- src/core/features/courses/services/courses.ts | 2 +- src/core/features/courses/services/dashboard.ts | 2 +- .../courses/services/handlers/my-courses-mainmenu.ts | 2 +- src/core/features/enrol/services/enrol.ts | 2 +- .../features/fileuploader/services/fileuploader.ts | 2 +- src/core/features/filter/services/filter-delegate.ts | 2 +- src/core/features/filter/services/filter-helper.ts | 2 +- src/core/features/filter/services/filter.ts | 2 +- .../filter/services/handlers/default-filter.ts | 2 +- src/core/features/grades/services/grades.ts | 2 +- .../features/h5p/components/h5p-iframe/h5p-iframe.ts | 2 +- .../features/h5p/components/h5p-player/h5p-player.ts | 2 +- src/core/features/h5p/services/h5p.ts | 2 +- .../login/components/login-methods/login-methods.ts | 2 +- .../features/login/pages/credentials/credentials.ts | 2 +- .../login/pages/email-signup/email-signup.ts | 2 +- .../pages/forgotten-password/forgotten-password.ts | 2 +- src/core/features/login/pages/reconnect/reconnect.ts | 2 +- .../features/login/pages/site-policy/site-policy.ts | 2 +- src/core/features/login/services/login-helper.ts | 2 +- .../components/user-menu-button/user-menu-button.ts | 2 +- .../mainmenu/components/user-menu/user-menu.ts | 2 +- .../pushnotifications/services/pushnotifications.ts | 2 +- src/core/features/rating/services/rating.ts | 2 +- .../features/reportbuilder/services/reportbuilder.ts | 2 +- src/core/features/search/services/global-search.ts | 2 +- src/core/features/settings/pages/about/about.ts | 2 +- .../features/settings/services/settings-helper.ts | 2 +- src/core/features/sitehome/pages/index/index.ts | 2 +- .../sitehome/services/handlers/sitehome-home.ts | 2 +- src/core/features/sitehome/services/sitehome.ts | 2 +- src/core/features/sitehome/tests/links.test.ts | 2 +- .../siteplugins/classes/call-ws-directive.ts | 2 +- .../components/module-index/module-index.ts | 2 +- .../components/plugin-content/plugin-content.ts | 2 +- .../siteplugins/directives/call-ws-new-content.ts | 2 +- .../features/siteplugins/directives/new-content.ts | 2 +- src/core/features/siteplugins/pages/plugin/plugin.ts | 2 +- .../siteplugins/services/siteplugins-helper.ts | 2 +- .../features/siteplugins/services/siteplugins.ts | 2 +- src/core/features/styles/services/styles.ts | 2 +- src/core/features/tag/services/tag.ts | 2 +- .../classes/support/authenticated-support-config.ts | 2 +- .../user/classes/support/guest-support-config.ts | 2 +- src/core/features/user/pages/about/about.ts | 2 +- src/core/features/user/pages/profile/profile.ts | 2 +- src/core/features/user/services/user.ts | 2 +- src/core/features/xapi/classes/item-agent.ts | 2 +- src/core/features/xapi/services/xapi.ts | 2 +- src/core/services/groups.ts | 2 +- src/core/services/lang.ts | 2 +- src/core/services/sites-factory.ts | 2 +- src/core/services/sites.ts | 2 +- src/core/services/storage.ts | 2 +- src/core/services/ws.ts | 2 +- src/core/singletons/events.ts | 2 +- src/core/singletons/tests/url.test.ts | 2 +- src/core/singletons/url.ts | 2 +- src/storybook/stubs/classes/site.ts | 2 +- src/storybook/stubs/services/sites.ts | 2 +- 135 files changed, 140 insertions(+), 140 deletions(-) rename src/core/classes/{ => sites}/site.ts (99%) diff --git a/src/addons/badges/services/badges.ts b/src/addons/badges/services/badges.ts index 939f18552df..2aed4eb2227 100644 --- a/src/addons/badges/services/badges.ts +++ b/src/addons/badges/services/badges.ts @@ -15,7 +15,7 @@ import { Injectable } from '@angular/core'; import { CoreSites } from '@services/sites'; import { CoreWSExternalWarning } from '@services/ws'; -import { CoreSite } from '@classes/site'; +import { CoreSite } from '@classes/sites/site'; import { makeSingleton } from '@singletons'; import { CoreError } from '@classes/errors/error'; diff --git a/src/addons/block/myoverview/components/myoverview/myoverview.ts b/src/addons/block/myoverview/components/myoverview/myoverview.ts index efe60ab1425..e749a714589 100644 --- a/src/addons/block/myoverview/components/myoverview/myoverview.ts +++ b/src/addons/block/myoverview/components/myoverview/myoverview.ts @@ -26,7 +26,7 @@ import { CoreCoursesHelper, CoreEnrolledCourseDataWithExtraInfoAndOptions } from import { CoreCourseHelper, CorePrefetchStatusInfo } from '@features/course/services/course-helper'; import { CoreCourseOptionsDelegate } from '@features/course/services/course-options-delegate'; import { CoreBlockBaseComponent } from '@features/block/classes/base-block-component'; -import { CoreSite } from '@classes/site'; +import { CoreSite } from '@classes/sites/site'; import { CoreUtils } from '@services/utils/utils'; import { CoreDomUtils } from '@services/utils/dom'; import { CoreTextUtils } from '@services/utils/text'; diff --git a/src/addons/block/recentlyaccessedcourses/components/recentlyaccessedcourses/recentlyaccessedcourses.ts b/src/addons/block/recentlyaccessedcourses/components/recentlyaccessedcourses/recentlyaccessedcourses.ts index 82d1834c3c6..e45b1b6fea7 100644 --- a/src/addons/block/recentlyaccessedcourses/components/recentlyaccessedcourses/recentlyaccessedcourses.ts +++ b/src/addons/block/recentlyaccessedcourses/components/recentlyaccessedcourses/recentlyaccessedcourses.ts @@ -30,7 +30,7 @@ import { CoreCourseOptionsDelegate } from '@features/course/services/course-opti import { AddonCourseCompletion } from '@addons/coursecompletion/services/coursecompletion'; import { CoreBlockBaseComponent } from '@features/block/classes/base-block-component'; import { CoreUtils } from '@services/utils/utils'; -import { CoreSite } from '@classes/site'; +import { CoreSite } from '@classes/sites/site'; /** * Component to render a recent courses block. diff --git a/src/addons/block/recentlyaccesseditems/services/recentlyaccesseditems.ts b/src/addons/block/recentlyaccesseditems/services/recentlyaccesseditems.ts index cbf2c518789..b9c790b5c48 100644 --- a/src/addons/block/recentlyaccesseditems/services/recentlyaccesseditems.ts +++ b/src/addons/block/recentlyaccesseditems/services/recentlyaccesseditems.ts @@ -16,7 +16,7 @@ import { Injectable } from '@angular/core'; import { CoreSites } from '@services/sites'; import { CoreDomUtils } from '@services/utils/dom'; import { CoreCourse } from '@features/course/services/course'; -import { CoreSiteWSPreSets } from '@classes/site'; +import { CoreSiteWSPreSets } from '@classes/sites/site'; import { makeSingleton } from '@singletons'; import { CoreCourseModuleDelegate } from '@features/course/services/module-delegate'; diff --git a/src/addons/block/starredcourses/components/starredcourses/starredcourses.ts b/src/addons/block/starredcourses/components/starredcourses/starredcourses.ts index 7f75e68bdab..f3382532527 100644 --- a/src/addons/block/starredcourses/components/starredcourses/starredcourses.ts +++ b/src/addons/block/starredcourses/components/starredcourses/starredcourses.ts @@ -24,7 +24,7 @@ import { CoreCourseOptionsDelegate } from '@features/course/services/course-opti import { AddonCourseCompletion } from '@addons/coursecompletion/services/coursecompletion'; import { CoreBlockBaseComponent } from '@features/block/classes/base-block-component'; import { CoreUtils } from '@services/utils/utils'; -import { CoreSite } from '@classes/site'; +import { CoreSite } from '@classes/sites/site'; import { AddonBlockStarredCourse, AddonBlockStarredCourses } from '../../services/starredcourses'; /** diff --git a/src/addons/block/starredcourses/services/starredcourses.ts b/src/addons/block/starredcourses/services/starredcourses.ts index 140bce94e8d..380da1bec27 100644 --- a/src/addons/block/starredcourses/services/starredcourses.ts +++ b/src/addons/block/starredcourses/services/starredcourses.ts @@ -14,7 +14,7 @@ import { Injectable } from '@angular/core'; import { CoreSites } from '@services/sites'; -import { CoreSiteWSPreSets } from '@classes/site'; +import { CoreSiteWSPreSets } from '@classes/sites/site'; import { makeSingleton } from '@singletons'; const ROOT_CACHE_KEY = 'AddonBlockStarredCourses:'; diff --git a/src/addons/block/timeline/services/timeline.ts b/src/addons/block/timeline/services/timeline.ts index b24aff0a279..a18750e468e 100644 --- a/src/addons/block/timeline/services/timeline.ts +++ b/src/addons/block/timeline/services/timeline.ts @@ -24,7 +24,7 @@ import { } from '@addons/calendar/services/calendar'; import moment from 'moment-timezone'; import { makeSingleton } from '@singletons'; -import { CoreSiteWSPreSets } from '@classes/site'; +import { CoreSiteWSPreSets } from '@classes/sites/site'; // Cache key was maintained from block myoverview when blocks were splitted. const ROOT_CACHE_KEY = 'myoverview:'; diff --git a/src/addons/blog/services/blog.ts b/src/addons/blog/services/blog.ts index c3491951e98..65b680911f5 100644 --- a/src/addons/blog/services/blog.ts +++ b/src/addons/blog/services/blog.ts @@ -13,7 +13,7 @@ // limitations under the License. import { Injectable } from '@angular/core'; -import { CoreSite, CoreSiteWSPreSets } from '@classes/site'; +import { CoreSite, CoreSiteWSPreSets } from '@classes/sites/site'; import { CoreTagItem } from '@features/tag/services/tag'; import { CoreSites } from '@services/sites'; import { CoreUtils } from '@services/utils/utils'; diff --git a/src/addons/calendar/pages/edit-event/edit-event.ts b/src/addons/calendar/pages/edit-event/edit-event.ts index 993603f9e1a..20e9d23f480 100644 --- a/src/addons/calendar/pages/edit-event/edit-event.ts +++ b/src/addons/calendar/pages/edit-event/edit-event.ts @@ -34,7 +34,7 @@ import { import { AddonCalendarOffline } from '../../services/calendar-offline'; import { AddonCalendarEventTypeOption, AddonCalendarHelper } from '../../services/calendar-helper'; import { AddonCalendarSync, AddonCalendarSyncProvider } from '../../services/calendar-sync'; -import { CoreSite } from '@classes/site'; +import { CoreSite } from '@classes/sites/site'; import { Translate } from '@singletons'; import { CoreFilterHelper } from '@features/filter/services/filter-helper'; import { AddonCalendarOfflineEventDBRecord } from '../../services/database/calendar-offline'; diff --git a/src/addons/calendar/services/calendar.ts b/src/addons/calendar/services/calendar.ts index c7b4067ee1d..e9668e221a5 100644 --- a/src/addons/calendar/services/calendar.ts +++ b/src/addons/calendar/services/calendar.ts @@ -14,7 +14,7 @@ import { Injectable } from '@angular/core'; import { CoreSites } from '@services/sites'; -import { CoreSite, CoreSiteWSPreSets } from '@classes/site'; +import { CoreSite, CoreSiteWSPreSets } from '@classes/sites/site'; import { CoreNetwork } from '@services/network'; import { CoreTextUtils } from '@services/utils/text'; import { CoreTimeUtils } from '@services/utils/time'; diff --git a/src/addons/competency/services/competency.ts b/src/addons/competency/services/competency.ts index 7f83cc0c2eb..62918299860 100644 --- a/src/addons/competency/services/competency.ts +++ b/src/addons/competency/services/competency.ts @@ -13,7 +13,7 @@ // limitations under the License. import { Injectable } from '@angular/core'; -import { CoreSite, CoreSiteWSPreSets } from '@classes/site'; +import { CoreSite, CoreSiteWSPreSets } from '@classes/sites/site'; import { CoreCommentsArea } from '@features/comments/services/comments'; import { CoreCourseSummary, CoreCourseModuleSummary } from '@features/course/services/course'; import { CoreUserSummary } from '@features/user/services/user'; diff --git a/src/addons/coursecompletion/services/coursecompletion.ts b/src/addons/coursecompletion/services/coursecompletion.ts index 5b257367bb1..1d173941b49 100644 --- a/src/addons/coursecompletion/services/coursecompletion.ts +++ b/src/addons/coursecompletion/services/coursecompletion.ts @@ -17,7 +17,7 @@ import { CoreLogger } from '@singletons/logger'; import { CoreSites, CoreSitesCommonWSOptions } from '@services/sites'; import { CoreUtils } from '@services/utils/utils'; import { CoreCourses } from '@features/courses/services/courses'; -import { CoreSite, CoreSiteWSPreSets, WSObservable } from '@classes/site'; +import { CoreSite, CoreSiteWSPreSets, WSObservable } from '@classes/sites/site'; import { CoreStatusWithWarningsWSResponse, CoreWSExternalWarning } from '@services/ws'; import { makeSingleton } from '@singletons'; import { CoreError } from '@classes/errors/error'; diff --git a/src/addons/enrol/guest/services/guest.ts b/src/addons/enrol/guest/services/guest.ts index c9b77b7d518..fe37cbfe403 100644 --- a/src/addons/enrol/guest/services/guest.ts +++ b/src/addons/enrol/guest/services/guest.ts @@ -13,7 +13,7 @@ // limitations under the License. import { Injectable } from '@angular/core'; -import { CoreSiteWSPreSets, CoreSite } from '@classes/site'; +import { CoreSiteWSPreSets, CoreSite } from '@classes/sites/site'; import { CoreEnrolEnrolmentInfo } from '@features/enrol/services/enrol'; import { CoreSites } from '@services/sites'; import { CoreWSExternalWarning } from '@services/ws'; diff --git a/src/addons/enrol/self/services/self.ts b/src/addons/enrol/self/services/self.ts index 178268decc8..b20e32dd0cc 100644 --- a/src/addons/enrol/self/services/self.ts +++ b/src/addons/enrol/self/services/self.ts @@ -14,7 +14,7 @@ import { Injectable } from '@angular/core'; import { CoreWSError } from '@classes/errors/wserror'; -import { CoreSiteWSPreSets, CoreSite } from '@classes/site'; +import { CoreSiteWSPreSets, CoreSite } from '@classes/sites/site'; import { CoreCoursesProvider } from '@features/courses/services/courses'; import { CoreSites } from '@services/sites'; import { CoreStatusWithWarningsWSResponse } from '@services/ws'; diff --git a/src/addons/filter/activitynames/services/handlers/activitynames.ts b/src/addons/filter/activitynames/services/handlers/activitynames.ts index 8b0ab6909e1..22610dd1d47 100644 --- a/src/addons/filter/activitynames/services/handlers/activitynames.ts +++ b/src/addons/filter/activitynames/services/handlers/activitynames.ts @@ -16,7 +16,7 @@ import { Injectable } from '@angular/core'; import { CoreFilterDefaultHandler } from '@features/filter/services/handlers/default-filter'; import { CoreFilterFormatTextOptions } from '@features/filter/services/filter'; -import { CoreSite } from '@classes/site'; +import { CoreSite } from '@classes/sites/site'; import { makeSingleton } from '@singletons'; /** diff --git a/src/addons/filter/algebra/services/handlers/algebra.ts b/src/addons/filter/algebra/services/handlers/algebra.ts index 4b7859f55bb..f77e374cf14 100644 --- a/src/addons/filter/algebra/services/handlers/algebra.ts +++ b/src/addons/filter/algebra/services/handlers/algebra.ts @@ -16,7 +16,7 @@ import { Injectable } from '@angular/core'; import { CoreFilterDefaultHandler } from '@features/filter/services/handlers/default-filter'; import { CoreFilterFormatTextOptions } from '@features/filter/services/filter'; -import { CoreSite } from '@classes/site'; +import { CoreSite } from '@classes/sites/site'; import { makeSingleton } from '@singletons'; /** diff --git a/src/addons/filter/censor/services/handlers/censor.ts b/src/addons/filter/censor/services/handlers/censor.ts index 8b62c4c3de5..2f4213fe6b0 100644 --- a/src/addons/filter/censor/services/handlers/censor.ts +++ b/src/addons/filter/censor/services/handlers/censor.ts @@ -16,7 +16,7 @@ import { Injectable } from '@angular/core'; import { CoreFilterDefaultHandler } from '@features/filter/services/handlers/default-filter'; import { CoreFilterFormatTextOptions } from '@features/filter/services/filter'; -import { CoreSite } from '@classes/site'; +import { CoreSite } from '@classes/sites/site'; import { makeSingleton } from '@singletons'; /** diff --git a/src/addons/filter/data/services/handlers/data.ts b/src/addons/filter/data/services/handlers/data.ts index cd81af23e99..7cea88a9d45 100644 --- a/src/addons/filter/data/services/handlers/data.ts +++ b/src/addons/filter/data/services/handlers/data.ts @@ -16,7 +16,7 @@ import { Injectable } from '@angular/core'; import { CoreFilterDefaultHandler } from '@features/filter/services/handlers/default-filter'; import { CoreFilterFormatTextOptions } from '@features/filter/services/filter'; -import { CoreSite } from '@classes/site'; +import { CoreSite } from '@classes/sites/site'; import { makeSingleton } from '@singletons'; /** diff --git a/src/addons/filter/emailprotect/services/handlers/emailprotect.ts b/src/addons/filter/emailprotect/services/handlers/emailprotect.ts index 0fa214c4616..d800e7111f6 100644 --- a/src/addons/filter/emailprotect/services/handlers/emailprotect.ts +++ b/src/addons/filter/emailprotect/services/handlers/emailprotect.ts @@ -16,7 +16,7 @@ import { Injectable } from '@angular/core'; import { CoreFilterDefaultHandler } from '@features/filter/services/handlers/default-filter'; import { CoreFilterFormatTextOptions } from '@features/filter/services/filter'; -import { CoreSite } from '@classes/site'; +import { CoreSite } from '@classes/sites/site'; import { makeSingleton } from '@singletons'; /** diff --git a/src/addons/filter/emoticon/services/handlers/emoticon.ts b/src/addons/filter/emoticon/services/handlers/emoticon.ts index dab7d5e75f9..02847ea42ea 100644 --- a/src/addons/filter/emoticon/services/handlers/emoticon.ts +++ b/src/addons/filter/emoticon/services/handlers/emoticon.ts @@ -16,7 +16,7 @@ import { Injectable } from '@angular/core'; import { CoreFilterDefaultHandler } from '@features/filter/services/handlers/default-filter'; import { CoreFilterFormatTextOptions } from '@features/filter/services/filter'; -import { CoreSite } from '@classes/site'; +import { CoreSite } from '@classes/sites/site'; import { makeSingleton } from '@singletons'; /** diff --git a/src/addons/filter/glossary/services/handlers/glossary.ts b/src/addons/filter/glossary/services/handlers/glossary.ts index fab73b6ebbe..4c769b0965d 100644 --- a/src/addons/filter/glossary/services/handlers/glossary.ts +++ b/src/addons/filter/glossary/services/handlers/glossary.ts @@ -16,7 +16,7 @@ import { Injectable } from '@angular/core'; import { CoreFilterDefaultHandler } from '@features/filter/services/handlers/default-filter'; import { CoreFilterFormatTextOptions } from '@features/filter/services/filter'; -import { CoreSite } from '@classes/site'; +import { CoreSite } from '@classes/sites/site'; import { makeSingleton } from '@singletons'; /** diff --git a/src/addons/filter/mathjaxloader/services/handlers/mathjaxloader.ts b/src/addons/filter/mathjaxloader/services/handlers/mathjaxloader.ts index 5d40042a93a..7589f5be83c 100644 --- a/src/addons/filter/mathjaxloader/services/handlers/mathjaxloader.ts +++ b/src/addons/filter/mathjaxloader/services/handlers/mathjaxloader.ts @@ -21,7 +21,7 @@ import { CoreSites } from '@services/sites'; import { CoreTextUtils } from '@services/utils/text'; import { CoreUtils } from '@services/utils/utils'; import { CoreEvents } from '@singletons/events'; -import { CoreSite } from '@classes/site'; +import { CoreSite } from '@classes/sites/site'; import { makeSingleton } from '@singletons'; /** diff --git a/src/addons/filter/multilang/services/handlers/multilang.ts b/src/addons/filter/multilang/services/handlers/multilang.ts index 657ba27b6e2..c8e127d6a52 100644 --- a/src/addons/filter/multilang/services/handlers/multilang.ts +++ b/src/addons/filter/multilang/services/handlers/multilang.ts @@ -17,7 +17,7 @@ import { Injectable } from '@angular/core'; import { CoreLang } from '@services/lang'; import { CoreFilterDefaultHandler } from '@features/filter/services/handlers/default-filter'; import { CoreFilterFilter, CoreFilterFormatTextOptions } from '@features/filter/services/filter'; -import { CoreSite } from '@classes/site'; +import { CoreSite } from '@classes/sites/site'; import { makeSingleton } from '@singletons'; /** diff --git a/src/addons/filter/tex/services/handlers/tex.ts b/src/addons/filter/tex/services/handlers/tex.ts index 479e7921655..80365429038 100644 --- a/src/addons/filter/tex/services/handlers/tex.ts +++ b/src/addons/filter/tex/services/handlers/tex.ts @@ -16,7 +16,7 @@ import { Injectable } from '@angular/core'; import { CoreFilterDefaultHandler } from '@features/filter/services/handlers/default-filter'; import { CoreFilterFormatTextOptions } from '@features/filter/services/filter'; -import { CoreSite } from '@classes/site'; +import { CoreSite } from '@classes/sites/site'; import { makeSingleton } from '@singletons'; /** diff --git a/src/addons/filter/tidy/services/handlers/tidy.ts b/src/addons/filter/tidy/services/handlers/tidy.ts index 542046dc0da..a40633a09d2 100644 --- a/src/addons/filter/tidy/services/handlers/tidy.ts +++ b/src/addons/filter/tidy/services/handlers/tidy.ts @@ -16,7 +16,7 @@ import { Injectable } from '@angular/core'; import { CoreFilterDefaultHandler } from '@features/filter/services/handlers/default-filter'; import { CoreFilterFormatTextOptions } from '@features/filter/services/filter'; -import { CoreSite } from '@classes/site'; +import { CoreSite } from '@classes/sites/site'; import { makeSingleton } from '@singletons'; /** diff --git a/src/addons/filter/urltolink/services/handlers/urltolink.ts b/src/addons/filter/urltolink/services/handlers/urltolink.ts index 4c27a49863e..9429361752b 100644 --- a/src/addons/filter/urltolink/services/handlers/urltolink.ts +++ b/src/addons/filter/urltolink/services/handlers/urltolink.ts @@ -16,7 +16,7 @@ import { Injectable } from '@angular/core'; import { CoreFilterDefaultHandler } from '@features/filter/services/handlers/default-filter'; import { CoreFilterFormatTextOptions } from '@features/filter/services/filter'; -import { CoreSite } from '@classes/site'; +import { CoreSite } from '@classes/sites/site'; import { makeSingleton } from '@singletons'; /** diff --git a/src/addons/messageoutput/airnotifier/services/airnotifier.ts b/src/addons/messageoutput/airnotifier/services/airnotifier.ts index 7324fc45a2d..9ed230627b5 100644 --- a/src/addons/messageoutput/airnotifier/services/airnotifier.ts +++ b/src/addons/messageoutput/airnotifier/services/airnotifier.ts @@ -17,7 +17,7 @@ import { Injectable } from '@angular/core'; import { CoreSites, CoreSitesCommonWSOptions, CoreSitesReadingStrategy } from '@services/sites'; import { CoreWSExternalWarning } from '@services/ws'; import { CoreConstants } from '@/core/constants'; -import { CoreSite, CoreSiteWSPreSets } from '@classes/site'; +import { CoreSite, CoreSiteWSPreSets } from '@classes/sites/site'; import { CoreError } from '@classes/errors/error'; import { CoreWSError } from '@classes/errors/wserror'; import { makeSingleton, Translate } from '@singletons'; diff --git a/src/addons/messages/services/messages-sync.ts b/src/addons/messages/services/messages-sync.ts index fdfbe6bad2a..954ce669317 100644 --- a/src/addons/messages/services/messages-sync.ts +++ b/src/addons/messages/services/messages-sync.ts @@ -31,7 +31,7 @@ import { CoreConstants } from '@/core/constants'; import { CoreUser } from '@features/user/services/user'; import { CoreError } from '@classes/errors/error'; import { CoreTextErrorObject, CoreTextUtils } from '@services/utils/text'; -import { CoreSiteWSPreSets } from '@classes/site'; +import { CoreSiteWSPreSets } from '@classes/sites/site'; /** * Service to sync messages. diff --git a/src/addons/messages/services/messages.ts b/src/addons/messages/services/messages.ts index b4a6e6cc63d..bfa00594c3f 100644 --- a/src/addons/messages/services/messages.ts +++ b/src/addons/messages/services/messages.ts @@ -26,7 +26,7 @@ import { import { CoreUtils } from '@services/utils/utils'; import { CoreTimeUtils } from '@services/utils/time'; import { CoreEvents } from '@singletons/events'; -import { CoreSite, CoreSiteWSPreSets } from '@classes/site'; +import { CoreSite, CoreSiteWSPreSets } from '@classes/sites/site'; import { CoreWSExternalWarning } from '@services/ws'; import { makeSingleton } from '@singletons'; import { CoreError } from '@classes/errors/error'; diff --git a/src/addons/mod/assign/components/index/index.ts b/src/addons/mod/assign/components/index/index.ts index e72b848c7d6..45cd4195fcd 100644 --- a/src/addons/mod/assign/components/index/index.ts +++ b/src/addons/mod/assign/components/index/index.ts @@ -15,7 +15,7 @@ import { Component, Optional, OnDestroy, OnInit, ViewChild } from '@angular/core'; import { Params } from '@angular/router'; import { CoreError } from '@classes/errors/error'; -import { CoreSite } from '@classes/site'; +import { CoreSite } from '@classes/sites/site'; import { CoreCourseModuleMainActivityComponent } from '@features/course/classes/main-activity-component'; import { CoreCourseContentsPage } from '@features/course/pages/contents/contents'; import { IonContent } from '@ionic/angular'; diff --git a/src/addons/mod/assign/services/assign.ts b/src/addons/mod/assign/services/assign.ts index ce34faf773d..4e410ab08c8 100644 --- a/src/addons/mod/assign/services/assign.ts +++ b/src/addons/mod/assign/services/assign.ts @@ -14,7 +14,7 @@ import { Injectable } from '@angular/core'; import { CoreSites, CoreSitesCommonWSOptions, CoreSitesReadingStrategy } from '@services/sites'; -import { CoreSite, CoreSiteWSPreSets } from '@classes/site'; +import { CoreSite, CoreSiteWSPreSets } from '@classes/sites/site'; import { CoreInterceptor } from '@classes/interceptor'; import { CoreWSExternalWarning, CoreWSExternalFile, CoreWSFile } from '@services/ws'; import { makeSingleton, Translate } from '@singletons'; diff --git a/src/addons/mod/bigbluebuttonbn/services/bigbluebuttonbn.ts b/src/addons/mod/bigbluebuttonbn/services/bigbluebuttonbn.ts index dd1e40225a5..cc3f7504309 100644 --- a/src/addons/mod/bigbluebuttonbn/services/bigbluebuttonbn.ts +++ b/src/addons/mod/bigbluebuttonbn/services/bigbluebuttonbn.ts @@ -15,7 +15,7 @@ import { Injectable } from '@angular/core'; import { CoreError } from '@classes/errors/error'; import { CoreWSError } from '@classes/errors/wserror'; -import { CoreSite, CoreSiteWSPreSets } from '@classes/site'; +import { CoreSite, CoreSiteWSPreSets } from '@classes/sites/site'; import { CoreCourseCommonModWSOptions } from '@features/course/services/course'; import { CoreCourseLogHelper } from '@features/course/services/log-helper'; import { CoreSites, CoreSitesCommonWSOptions } from '@services/sites'; diff --git a/src/addons/mod/book/services/book.ts b/src/addons/mod/book/services/book.ts index 19a86c64361..93a4b2e8933 100644 --- a/src/addons/mod/book/services/book.ts +++ b/src/addons/mod/book/services/book.ts @@ -14,7 +14,7 @@ import { Injectable } from '@angular/core'; import { CoreSites, CoreSitesCommonWSOptions } from '@services/sites'; -import { CoreSite, CoreSiteWSPreSets } from '@classes/site'; +import { CoreSite, CoreSiteWSPreSets } from '@classes/sites/site'; import { CoreTagItem } from '@features/tag/services/tag'; import { CoreWSExternalWarning, CoreWSExternalFile, CoreWS } from '@services/ws'; import { makeSingleton, Translate } from '@singletons'; diff --git a/src/addons/mod/chat/services/chat.ts b/src/addons/mod/chat/services/chat.ts index e413d72df14..8cf6d034688 100644 --- a/src/addons/mod/chat/services/chat.ts +++ b/src/addons/mod/chat/services/chat.ts @@ -14,7 +14,7 @@ import { Injectable } from '@angular/core'; import { CoreError } from '@classes/errors/error'; -import { CoreSite, CoreSiteWSPreSets } from '@classes/site'; +import { CoreSite, CoreSiteWSPreSets } from '@classes/sites/site'; import { CoreCourseCommonModWSOptions } from '@features/course/services/course'; import { CoreCourseLogHelper } from '@features/course/services/log-helper'; import { CoreUser } from '@features/user/services/user'; diff --git a/src/addons/mod/choice/services/choice.ts b/src/addons/mod/choice/services/choice.ts index 055b7affb03..5e99237a666 100644 --- a/src/addons/mod/choice/services/choice.ts +++ b/src/addons/mod/choice/services/choice.ts @@ -15,7 +15,7 @@ import { Injectable } from '@angular/core'; import { CoreError } from '@classes/errors/error'; import { CoreWSError } from '@classes/errors/wserror'; -import { CoreSite, CoreSiteWSPreSets } from '@classes/site'; +import { CoreSite, CoreSiteWSPreSets } from '@classes/sites/site'; import { CoreCourseCommonModWSOptions } from '@features/course/services/course'; import { CoreCourseLogHelper } from '@features/course/services/log-helper'; import { CoreNetwork } from '@services/network'; diff --git a/src/addons/mod/data/services/data.ts b/src/addons/mod/data/services/data.ts index a433b1bc0d5..8ba1573dd2c 100644 --- a/src/addons/mod/data/services/data.ts +++ b/src/addons/mod/data/services/data.ts @@ -14,7 +14,7 @@ import { Injectable } from '@angular/core'; import { CoreError } from '@classes/errors/error'; -import { CoreSite, CoreSiteWSPreSets } from '@classes/site'; +import { CoreSite, CoreSiteWSPreSets } from '@classes/sites/site'; import { CoreCourseCommonModWSOptions } from '@features/course/services/course'; import { CoreCourseLogHelper } from '@features/course/services/log-helper'; import { CoreRatingInfo } from '@features/rating/services/rating'; diff --git a/src/addons/mod/feedback/pages/form/form.ts b/src/addons/mod/feedback/pages/form/form.ts index 65f34f18cbb..928f705831a 100644 --- a/src/addons/mod/feedback/pages/form/form.ts +++ b/src/addons/mod/feedback/pages/form/form.ts @@ -13,7 +13,7 @@ // limitations under the License. import { Component, OnDestroy, OnInit, ViewChild } from '@angular/core'; -import { CoreSite } from '@classes/site'; +import { CoreSite } from '@classes/sites/site'; import { CoreCourse, CoreCourseCommonModWSOptions } from '@features/course/services/course'; import { CoreCourseModuleData } from '@features/course/services/course-helper'; import { CanLeave } from '@guards/can-leave'; diff --git a/src/addons/mod/feedback/services/feedback.ts b/src/addons/mod/feedback/services/feedback.ts index f44148a9713..77fb8c2816c 100644 --- a/src/addons/mod/feedback/services/feedback.ts +++ b/src/addons/mod/feedback/services/feedback.ts @@ -14,7 +14,7 @@ import { Injectable } from '@angular/core'; import { CoreError } from '@classes/errors/error'; -import { CoreSite, CoreSiteWSPreSets } from '@classes/site'; +import { CoreSite, CoreSiteWSPreSets } from '@classes/sites/site'; import { CoreCourseCommonModWSOptions } from '@features/course/services/course'; import { CoreCourseLogHelper } from '@features/course/services/log-helper'; import { CoreNetwork } from '@services/network'; diff --git a/src/addons/mod/folder/services/folder.ts b/src/addons/mod/folder/services/folder.ts index ab4f8f4507c..8ec75b0c081 100644 --- a/src/addons/mod/folder/services/folder.ts +++ b/src/addons/mod/folder/services/folder.ts @@ -14,7 +14,7 @@ import { Injectable } from '@angular/core'; import { CoreError } from '@classes/errors/error'; -import { CoreSite, CoreSiteWSPreSets } from '@classes/site'; +import { CoreSite, CoreSiteWSPreSets } from '@classes/sites/site'; import { CoreCourse } from '@features/course/services/course'; import { CoreCourseLogHelper } from '@features/course/services/log-helper'; import { CoreSites, CoreSitesCommonWSOptions } from '@services/sites'; diff --git a/src/addons/mod/forum/services/forum.ts b/src/addons/mod/forum/services/forum.ts index 650dbefcc30..4b8eb076c19 100644 --- a/src/addons/mod/forum/services/forum.ts +++ b/src/addons/mod/forum/services/forum.ts @@ -14,7 +14,7 @@ import { Injectable } from '@angular/core'; import { CoreError } from '@classes/errors/error'; -import { CoreSite, CoreSiteWSPreSets } from '@classes/site'; +import { CoreSite, CoreSiteWSPreSets } from '@classes/sites/site'; import { CoreCourseCommonModWSOptions } from '@features/course/services/course'; import { CoreCourseLogHelper } from '@features/course/services/log-helper'; import { CoreRatingInfo } from '@features/rating/services/rating'; diff --git a/src/addons/mod/glossary/services/glossary.ts b/src/addons/mod/glossary/services/glossary.ts index bb5e1eb0f2d..db4686056ab 100644 --- a/src/addons/mod/glossary/services/glossary.ts +++ b/src/addons/mod/glossary/services/glossary.ts @@ -14,7 +14,7 @@ import { Injectable } from '@angular/core'; import { CoreError } from '@classes/errors/error'; -import { CoreSite, CoreSiteWSPreSets } from '@classes/site'; +import { CoreSite, CoreSiteWSPreSets } from '@classes/sites/site'; import { CoreCourseCommonModWSOptions } from '@features/course/services/course'; import { CoreCourseLogHelper } from '@features/course/services/log-helper'; import { CoreFileUploaderStoreFilesResult } from '@features/fileuploader/services/fileuploader'; diff --git a/src/addons/mod/h5pactivity/components/index/index.ts b/src/addons/mod/h5pactivity/components/index/index.ts index 7af2521021a..b95684ca090 100644 --- a/src/addons/mod/h5pactivity/components/index/index.ts +++ b/src/addons/mod/h5pactivity/components/index/index.ts @@ -16,7 +16,7 @@ import { Component, Optional, OnInit, OnDestroy, Output, EventEmitter } from '@a import { IonContent } from '@ionic/angular'; import { CoreConstants } from '@/core/constants'; -import { CoreSite } from '@classes/site'; +import { CoreSite } from '@classes/sites/site'; import { CoreCourseModuleMainActivityComponent } from '@features/course/classes/main-activity-component'; import { CoreCourseContentsPage } from '@features/course/pages/contents/contents'; import { CoreH5PDisplayOptions } from '@features/h5p/classes/core'; diff --git a/src/addons/mod/h5pactivity/services/h5pactivity.ts b/src/addons/mod/h5pactivity/services/h5pactivity.ts index 5a23aa738a6..d2df04a1bbe 100644 --- a/src/addons/mod/h5pactivity/services/h5pactivity.ts +++ b/src/addons/mod/h5pactivity/services/h5pactivity.ts @@ -17,7 +17,7 @@ import { Injectable } from '@angular/core'; import { CoreSites, CoreSitesCommonWSOptions, CoreSitesReadingStrategy } from '@services/sites'; import { CoreWSExternalWarning, CoreWSExternalFile, CoreWSFile } from '@services/ws'; import { CoreUtils } from '@services/utils/utils'; -import { CoreSite, CoreSiteWSPreSets } from '@classes/site'; +import { CoreSite, CoreSiteWSPreSets } from '@classes/sites/site'; import { CoreCourseLogHelper } from '@features/course/services/log-helper'; import { CoreH5P } from '@features/h5p/services/h5p'; import { CoreH5PDisplayOptions } from '@features/h5p/classes/core'; diff --git a/src/addons/mod/imscp/services/imscp.ts b/src/addons/mod/imscp/services/imscp.ts index 304ff4ff25f..570e67df5e0 100644 --- a/src/addons/mod/imscp/services/imscp.ts +++ b/src/addons/mod/imscp/services/imscp.ts @@ -14,7 +14,7 @@ import { Injectable } from '@angular/core'; import { CoreError } from '@classes/errors/error'; -import { CoreSite, CoreSiteWSPreSets } from '@classes/site'; +import { CoreSite, CoreSiteWSPreSets } from '@classes/sites/site'; import { CoreCourse, CoreCourseModuleContentFile } from '@features/course/services/course'; import { CoreCourseModuleData } from '@features/course/services/course-helper'; import { CoreCourseLogHelper } from '@features/course/services/log-helper'; diff --git a/src/addons/mod/label/services/label.ts b/src/addons/mod/label/services/label.ts index b37ddffb954..b0ac56f3a30 100644 --- a/src/addons/mod/label/services/label.ts +++ b/src/addons/mod/label/services/label.ts @@ -14,7 +14,7 @@ import { Injectable } from '@angular/core'; import { CoreError } from '@classes/errors/error'; -import { CoreSite, CoreSiteWSPreSets } from '@classes/site'; +import { CoreSite, CoreSiteWSPreSets } from '@classes/sites/site'; import { CoreFilepool } from '@services/filepool'; import { CoreSites, CoreSitesCommonWSOptions } from '@services/sites'; import { CoreUtils } from '@services/utils/utils'; diff --git a/src/addons/mod/lesson/services/lesson.ts b/src/addons/mod/lesson/services/lesson.ts index af0b4945164..221e58a1561 100644 --- a/src/addons/mod/lesson/services/lesson.ts +++ b/src/addons/mod/lesson/services/lesson.ts @@ -14,7 +14,7 @@ import { Injectable } from '@angular/core'; import { CoreError } from '@classes/errors/error'; -import { CoreSite, CoreSiteWSPreSets } from '@classes/site'; +import { CoreSite, CoreSiteWSPreSets } from '@classes/sites/site'; import { CoreCourseCommonModWSOptions } from '@features/course/services/course'; import { CoreCourseLogHelper } from '@features/course/services/log-helper'; import { CoreGradesProvider } from '@features/grades/services/grades'; diff --git a/src/addons/mod/lti/services/lti.ts b/src/addons/mod/lti/services/lti.ts index 989432eab32..42f787dce32 100644 --- a/src/addons/mod/lti/services/lti.ts +++ b/src/addons/mod/lti/services/lti.ts @@ -15,7 +15,7 @@ import { Injectable } from '@angular/core'; import { CoreError } from '@classes/errors/error'; -import { CoreSite, CoreSiteWSPreSets } from '@classes/site'; +import { CoreSite, CoreSiteWSPreSets } from '@classes/sites/site'; import { CoreCourseLogHelper } from '@features/course/services/log-helper'; import { CoreFile } from '@services/file'; import { CorePlatform } from '@services/platform'; diff --git a/src/addons/mod/page/services/page.ts b/src/addons/mod/page/services/page.ts index 19579a5e8a1..347ba6d58bd 100644 --- a/src/addons/mod/page/services/page.ts +++ b/src/addons/mod/page/services/page.ts @@ -14,7 +14,7 @@ import { Injectable } from '@angular/core'; import { CoreSitesCommonWSOptions, CoreSites } from '@services/sites'; -import { CoreSite, CoreSiteWSPreSets } from '@classes/site'; +import { CoreSite, CoreSiteWSPreSets } from '@classes/sites/site'; import { CoreWSExternalWarning, CoreWSExternalFile } from '@services/ws'; import { makeSingleton, Translate } from '@singletons'; import { CoreFilepool } from '@services/filepool'; diff --git a/src/addons/mod/quiz/services/quiz.ts b/src/addons/mod/quiz/services/quiz.ts index 0c155e0b9b1..c1a919d41c1 100644 --- a/src/addons/mod/quiz/services/quiz.ts +++ b/src/addons/mod/quiz/services/quiz.ts @@ -17,7 +17,7 @@ import { Injectable } from '@angular/core'; import { CoreError } from '@classes/errors/error'; import { CoreWSError } from '@classes/errors/wserror'; -import { CoreSite, CoreSiteWSPreSets } from '@classes/site'; +import { CoreSite, CoreSiteWSPreSets } from '@classes/sites/site'; import { CoreCourseCommonModWSOptions } from '@features/course/services/course'; import { CoreCourseLogHelper } from '@features/course/services/log-helper'; import { CoreGradesFormattedItem, CoreGradesHelper } from '@features/grades/services/grades-helper'; diff --git a/src/addons/mod/resource/services/resource.ts b/src/addons/mod/resource/services/resource.ts index 2b0d1afe35c..32261a9dd1c 100644 --- a/src/addons/mod/resource/services/resource.ts +++ b/src/addons/mod/resource/services/resource.ts @@ -14,7 +14,7 @@ import { Injectable } from '@angular/core'; import { CoreError } from '@classes/errors/error'; -import { CoreSite, CoreSiteWSPreSets } from '@classes/site'; +import { CoreSite, CoreSiteWSPreSets } from '@classes/sites/site'; import { CoreCourse } from '@features/course/services/course'; import { CoreCourseLogHelper } from '@features/course/services/log-helper'; import { CoreFilepool } from '@services/filepool'; diff --git a/src/addons/mod/scorm/services/scorm.ts b/src/addons/mod/scorm/services/scorm.ts index 0754ec8a35a..d91c08700c0 100644 --- a/src/addons/mod/scorm/services/scorm.ts +++ b/src/addons/mod/scorm/services/scorm.ts @@ -15,7 +15,7 @@ import { CoreConstants } from '@/core/constants'; import { Injectable } from '@angular/core'; import { CoreError } from '@classes/errors/error'; -import { CoreSite, CoreSiteWSPreSets } from '@classes/site'; +import { CoreSite, CoreSiteWSPreSets } from '@classes/sites/site'; import { CoreCourseCommonModWSOptions } from '@features/course/services/course'; import { CoreCourseLogHelper } from '@features/course/services/log-helper'; import { CoreFilepool } from '@services/filepool'; diff --git a/src/addons/mod/survey/services/survey.ts b/src/addons/mod/survey/services/survey.ts index 8786e7d0ed6..ba412c31737 100644 --- a/src/addons/mod/survey/services/survey.ts +++ b/src/addons/mod/survey/services/survey.ts @@ -14,7 +14,7 @@ import { Injectable } from '@angular/core'; import { CoreError } from '@classes/errors/error'; -import { CoreSite, CoreSiteWSPreSets } from '@classes/site'; +import { CoreSite, CoreSiteWSPreSets } from '@classes/sites/site'; import { CoreCourseCommonModWSOptions } from '@features/course/services/course'; import { CoreCourseLogHelper } from '@features/course/services/log-helper'; import { CoreNetwork } from '@services/network'; diff --git a/src/addons/mod/url/services/url.ts b/src/addons/mod/url/services/url.ts index 216ac680c2a..170fdeb91ee 100644 --- a/src/addons/mod/url/services/url.ts +++ b/src/addons/mod/url/services/url.ts @@ -14,7 +14,7 @@ import { Injectable } from '@angular/core'; import { CoreSites, CoreSitesCommonWSOptions } from '@services/sites'; -import { CoreSite, CoreSiteWSPreSets } from '@classes/site'; +import { CoreSite, CoreSiteWSPreSets } from '@classes/sites/site'; import { CoreWSExternalWarning, CoreWSExternalFile } from '@services/ws'; import { makeSingleton, Translate } from '@singletons'; import { CoreConstants } from '@/core/constants'; diff --git a/src/addons/mod/wiki/services/wiki.ts b/src/addons/mod/wiki/services/wiki.ts index dc79309ebcc..4876e755103 100644 --- a/src/addons/mod/wiki/services/wiki.ts +++ b/src/addons/mod/wiki/services/wiki.ts @@ -14,7 +14,7 @@ import { Injectable } from '@angular/core'; import { CoreError } from '@classes/errors/error'; -import { CoreSite, CoreSiteWSPreSets } from '@classes/site'; +import { CoreSite, CoreSiteWSPreSets } from '@classes/sites/site'; import { CoreCourseCommonModWSOptions } from '@features/course/services/course'; import { CoreCourseLogHelper } from '@features/course/services/log-helper'; import { CoreTagItem } from '@features/tag/services/tag'; diff --git a/src/addons/mod/workshop/services/workshop.ts b/src/addons/mod/workshop/services/workshop.ts index a866a4c8e4f..1f3ddd9dcdc 100644 --- a/src/addons/mod/workshop/services/workshop.ts +++ b/src/addons/mod/workshop/services/workshop.ts @@ -14,7 +14,7 @@ import { Injectable } from '@angular/core'; import { CoreError } from '@classes/errors/error'; -import { CoreSite, CoreSiteWSPreSets } from '@classes/site'; +import { CoreSite, CoreSiteWSPreSets } from '@classes/sites/site'; import { CoreCourseCommonModWSOptions } from '@features/course/services/course'; import { CoreCourseLogHelper } from '@features/course/services/log-helper'; import { CoreGradesMenuItem } from '@features/grades/services/grades-helper'; diff --git a/src/addons/notes/services/notes.ts b/src/addons/notes/services/notes.ts index 0c2cfd8db4b..e9f10dd4cfc 100644 --- a/src/addons/notes/services/notes.ts +++ b/src/addons/notes/services/notes.ts @@ -14,7 +14,7 @@ import { Injectable } from '@angular/core'; import { CoreWSError } from '@classes/errors/wserror'; -import { CoreSite, CoreSiteWSPreSets } from '@classes/site'; +import { CoreSite, CoreSiteWSPreSets } from '@classes/sites/site'; import { CoreUser } from '@features/user/services/user'; import { CoreNetwork } from '@services/network'; import { CoreSites } from '@services/sites'; diff --git a/src/addons/notifications/services/notifications.ts b/src/addons/notifications/services/notifications.ts index 268551e63da..fced63e5df1 100644 --- a/src/addons/notifications/services/notifications.ts +++ b/src/addons/notifications/services/notifications.ts @@ -19,7 +19,7 @@ import { CoreWSExternalWarning } from '@services/ws'; import { CoreTextUtils } from '@services/utils/text'; import { CoreTimeUtils } from '@services/utils/time'; import { CoreUser, USER_NOREPLY_USER } from '@features/user/services/user'; -import { CoreSite, CoreSiteWSPreSets } from '@classes/site'; +import { CoreSite, CoreSiteWSPreSets } from '@classes/sites/site'; import { CoreLogger } from '@singletons/logger'; import { Translate, makeSingleton } from '@singletons'; import { CoreCourseModuleDelegate } from '@features/course/services/module-delegate'; diff --git a/src/addons/privatefiles/services/privatefiles.ts b/src/addons/privatefiles/services/privatefiles.ts index d1194fdba9a..3d5e4797d8f 100644 --- a/src/addons/privatefiles/services/privatefiles.ts +++ b/src/addons/privatefiles/services/privatefiles.ts @@ -17,7 +17,7 @@ import { Injectable } from '@angular/core'; import { CoreSites } from '@services/sites'; import { CoreMimetypeUtils } from '@services/utils/mimetype'; import { CoreWSExternalWarning } from '@services/ws'; -import { CoreSite } from '@classes/site'; +import { CoreSite } from '@classes/sites/site'; import { makeSingleton } from '@singletons'; const ROOT_CACHE_KEY = 'mmaFiles:'; diff --git a/src/addons/remotethemes/services/remotethemes-handler.ts b/src/addons/remotethemes/services/remotethemes-handler.ts index cf2673c1ac7..b356ff49a7c 100644 --- a/src/addons/remotethemes/services/remotethemes-handler.ts +++ b/src/addons/remotethemes/services/remotethemes-handler.ts @@ -14,7 +14,7 @@ import { Injectable } from '@angular/core'; import { CoreConstants } from '@/core/constants'; -import { CoreSitePublicConfigResponse } from '@classes/site'; +import { CoreSitePublicConfigResponse } from '@classes/sites/site'; import { CoreFile } from '@services/file'; import { CoreFilepool } from '@services/filepool'; import { CoreSites } from '@services/sites'; diff --git a/src/addons/report/insights/services/insights.ts b/src/addons/report/insights/services/insights.ts index 509e4fe448d..ff4f322a646 100644 --- a/src/addons/report/insights/services/insights.ts +++ b/src/addons/report/insights/services/insights.ts @@ -15,7 +15,7 @@ import { Injectable } from '@angular/core'; import { CoreSites } from '@services/sites'; -import { CoreSite } from '@classes/site'; +import { CoreSite } from '@classes/sites/site'; import { makeSingleton } from '@singletons'; import { CoreWSExternalWarning } from '@services/ws'; import { CoreWSError } from '@classes/errors/wserror'; diff --git a/src/core/classes/delegate.ts b/src/core/classes/delegate.ts index adc2023f036..2dd5141c9f0 100644 --- a/src/core/classes/delegate.ts +++ b/src/core/classes/delegate.ts @@ -14,7 +14,7 @@ import { CoreSites } from '@services/sites'; import { CoreEvents } from '@singletons/events'; -import { CoreSite } from '@classes/site'; +import { CoreSite } from '@classes/sites/site'; import { CoreLogger } from '@singletons/logger'; /** diff --git a/src/core/classes/page-load-watcher.ts b/src/core/classes/page-load-watcher.ts index e062e3b9810..2921ec65ec9 100644 --- a/src/core/classes/page-load-watcher.ts +++ b/src/core/classes/page-load-watcher.ts @@ -18,7 +18,7 @@ import { Subscription } from 'rxjs'; import { AsyncDirective } from './async-directive'; import { PageLoadsManager } from './page-loads-manager'; import { CorePromisedValue } from './promised-value'; -import { WSObservable } from './site'; +import { WSObservable } from './sites/site'; /** * Class to watch requests from a page load (including requests from page sub-components). diff --git a/src/core/classes/site.ts b/src/core/classes/sites/site.ts similarity index 99% rename from src/core/classes/site.ts rename to src/core/classes/sites/site.ts index c090d7dd713..1c8fb5a69c7 100644 --- a/src/core/classes/site.ts +++ b/src/core/classes/sites/site.ts @@ -41,13 +41,13 @@ import { CoreError } from '@classes/errors/error'; import { CoreWSError } from '@classes/errors/wserror'; import { CoreLogger } from '@singletons/logger'; import { Translate } from '@singletons'; -import { CoreIonLoadingElement } from './ion-loading'; +import { CoreIonLoadingElement } from '../ion-loading'; import { CoreLang, CoreLangFormat } from '@services/lang'; import { CoreSites, CoreSitesReadingStrategy } from '@services/sites'; -import { asyncInstance, AsyncInstance } from '../utils/async-instance'; -import { CoreDatabaseTable } from './database/database-table'; -import { CoreDatabaseCachingStrategy } from './database/database-table-proxy'; -import { CoreSilentError } from './errors/silenterror'; +import { asyncInstance, AsyncInstance } from '../../utils/async-instance'; +import { CoreDatabaseTable } from '../database/database-table'; +import { CoreDatabaseCachingStrategy } from '../database/database-table-proxy'; +import { CoreSilentError } from '../errors/silenterror'; import { CorePromisedValue } from '@classes/promised-value'; import { CONFIG_TABLE, @@ -59,7 +59,7 @@ import { } from '@services/database/sites'; import { Observable, ObservableInput, ObservedValueOf, OperatorFunction, Subject } from 'rxjs'; import { finalize, map, mergeMap } from 'rxjs/operators'; -import { firstValueFrom } from '../utils/rxjs'; +import { firstValueFrom } from '../../utils/rxjs'; import { CoreSiteError } from '@classes/errors/siteerror'; import { CoreUserAuthenticatedSupportConfig } from '@features/user/classes/support/authenticated-support-config'; import { CoreLoginHelper } from '@features/login/services/login-helper'; diff --git a/src/core/directives/external-content.ts b/src/core/directives/external-content.ts index d1a561b68ee..e8c239884d1 100644 --- a/src/core/directives/external-content.ts +++ b/src/core/directives/external-content.ts @@ -30,7 +30,7 @@ import { CoreUrlUtils } from '@services/utils/url'; import { CoreUtils } from '@services/utils/utils'; import { CoreLogger } from '@singletons/logger'; import { CoreError } from '@classes/errors/error'; -import { CoreSite } from '@classes/site'; +import { CoreSite } from '@classes/sites/site'; import { CoreEventObserver, CoreEvents } from '@singletons/events'; import { CoreConstants } from '../constants'; import { CoreNetwork } from '@services/network'; diff --git a/src/core/directives/format-text.ts b/src/core/directives/format-text.ts index 2046dbc943a..bc6a16d6206 100644 --- a/src/core/directives/format-text.ts +++ b/src/core/directives/format-text.ts @@ -34,7 +34,7 @@ import { CoreDomUtils } from '@services/utils/dom'; import { CoreIframeUtils, CoreIframeUtilsProvider } from '@services/utils/iframe'; import { CoreTextUtils } from '@services/utils/text'; import { CoreUtils } from '@services/utils/utils'; -import { CoreSite } from '@classes/site'; +import { CoreSite } from '@classes/sites/site'; import { NgZone, Translate } from '@singletons'; import { CoreExternalContentDirective } from './external-content'; import { CoreLinkDirective } from './link'; diff --git a/src/core/directives/tests/format-text.test.ts b/src/core/directives/tests/format-text.test.ts index 843e7674250..34c08c18b89 100644 --- a/src/core/directives/tests/format-text.test.ts +++ b/src/core/directives/tests/format-text.test.ts @@ -21,7 +21,7 @@ import { CoreFilepool } from '@services/filepool'; import { CoreFilter } from '@features/filter/services/filter'; import { CoreFilterHelper } from '@features/filter/services/filter-helper'; import { CoreFormatTextDirective } from '@directives/format-text'; -import { CoreSite } from '@classes/site'; +import { CoreSite } from '@classes/sites/site'; import { CoreSites } from '@services/sites'; import { CoreUtils } from '@services/utils/utils'; diff --git a/src/core/features/autologout/services/autologout.ts b/src/core/features/autologout/services/autologout.ts index 4d721cacf80..49ed2c3f807 100644 --- a/src/core/features/autologout/services/autologout.ts +++ b/src/core/features/autologout/services/autologout.ts @@ -13,7 +13,7 @@ // limitations under the License. import { Injectable } from '@angular/core'; -import { CoreSite } from '@classes/site'; +import { CoreSite } from '@classes/sites/site'; import { CorePlatform } from '@services/platform'; import { CoreSites } from '@services/sites'; import { CoreStorage } from '@services/storage'; diff --git a/src/core/features/block/services/block-delegate.ts b/src/core/features/block/services/block-delegate.ts index 8a579bdff0f..2f224c275ba 100644 --- a/src/core/features/block/services/block-delegate.ts +++ b/src/core/features/block/services/block-delegate.ts @@ -15,7 +15,7 @@ import { Injectable, Type } from '@angular/core'; import { CoreSites } from '@services/sites'; import { CoreDelegate, CoreDelegateHandler } from '@classes/delegate'; -import { CoreSite } from '@classes/site'; +import { CoreSite } from '@classes/sites/site'; import { Subject } from 'rxjs'; import { CoreCourseBlock } from '@features/course/services/course'; import { Params } from '@angular/router'; diff --git a/src/core/features/comments/services/comments.ts b/src/core/features/comments/services/comments.ts index a183e9ed07f..2e265f58b47 100644 --- a/src/core/features/comments/services/comments.ts +++ b/src/core/features/comments/services/comments.ts @@ -14,7 +14,7 @@ import { Injectable } from '@angular/core'; import { CoreError } from '@classes/errors/error'; -import { CoreSite, CoreSiteWSPreSets } from '@classes/site'; +import { CoreSite, CoreSiteWSPreSets } from '@classes/sites/site'; import { CoreNetwork } from '@services/network'; import { CoreSites } from '@services/sites'; import { CoreUtils } from '@services/utils/utils'; diff --git a/src/core/features/contentlinks/services/contentlinks-helper.ts b/src/core/features/contentlinks/services/contentlinks-helper.ts index 84291fe3808..cb2b0db6fe4 100644 --- a/src/core/features/contentlinks/services/contentlinks-helper.ts +++ b/src/core/features/contentlinks/services/contentlinks-helper.ts @@ -16,7 +16,7 @@ import { Injectable } from '@angular/core'; import { CoreSites } from '@services/sites'; import { CoreDomUtils } from '@services/utils/dom'; import { CoreContentLinksDelegate, CoreContentLinksAction } from './contentlinks-delegate'; -import { CoreSite } from '@classes/site'; +import { CoreSite } from '@classes/sites/site'; import { makeSingleton, Translate } from '@singletons'; import { CoreNavigator } from '@services/navigator'; import { CoreContentLinksChooseSiteModalComponent } from '../components/choose-site-modal/choose-site-modal'; diff --git a/src/core/features/course/services/course-helper.ts b/src/core/features/course/services/course-helper.ts index 7a0126609ca..b6de863d447 100644 --- a/src/core/features/course/services/course-helper.ts +++ b/src/core/features/course/services/course-helper.ts @@ -58,7 +58,7 @@ import { import { CoreFileSizeSum } from '@services/plugin-file-delegate'; import { CoreFileHelper } from '@services/file-helper'; import { CoreNetwork } from '@services/network'; -import { CoreSite } from '@classes/site'; +import { CoreSite } from '@classes/sites/site'; import { CoreFile } from '@services/file'; import { CoreUrlUtils } from '@services/utils/url'; import { CoreTextUtils } from '@services/utils/text'; diff --git a/src/core/features/course/services/course.ts b/src/core/features/course/services/course.ts index 2380f13c705..066f9e1bff9 100644 --- a/src/core/features/course/services/course.ts +++ b/src/core/features/course/services/course.ts @@ -21,7 +21,7 @@ import { CoreLogger } from '@singletons/logger'; import { CoreSitesCommonWSOptions, CoreSites, CoreSitesReadingStrategy } from '@services/sites'; import { CoreTimeUtils } from '@services/utils/time'; import { CoreUtils } from '@services/utils/utils'; -import { CoreSiteWSPreSets, CoreSite, WSObservable } from '@classes/site'; +import { CoreSiteWSPreSets, CoreSite, WSObservable } from '@classes/sites/site'; import { CoreConstants } from '@/core/constants'; import { makeSingleton, Translate } from '@singletons'; import { CoreStatusWithWarningsWSResponse, CoreWSExternalFile, CoreWSExternalWarning } from '@services/ws'; diff --git a/src/core/features/course/services/module-delegate.ts b/src/core/features/course/services/module-delegate.ts index 69474390803..1d0f9170f3a 100644 --- a/src/core/features/course/services/module-delegate.ts +++ b/src/core/features/course/services/module-delegate.ts @@ -15,7 +15,7 @@ import { Injectable, Type } from '@angular/core'; import { SafeUrl } from '@angular/platform-browser'; -import { CoreSite } from '@classes/site'; +import { CoreSite } from '@classes/sites/site'; import { CoreCourseModuleDefaultHandler } from './handlers/default-module'; import { CoreDelegate, CoreDelegateHandler } from '@classes/delegate'; import { CoreCourseAnyCourseData } from '@features/courses/services/courses'; diff --git a/src/core/features/course/services/module-prefetch-delegate.ts b/src/core/features/course/services/module-prefetch-delegate.ts index 39c18d65112..bed8172095e 100644 --- a/src/core/features/course/services/module-prefetch-delegate.ts +++ b/src/core/features/course/services/module-prefetch-delegate.ts @@ -24,7 +24,7 @@ import { CoreTimeUtils } from '@services/utils/time'; import { CoreUtils } from '@services/utils/utils'; import { CoreCourse, CoreCourseAnyModuleData, CoreCourseModuleContentFile } from './course'; import { CoreCache } from '@classes/cache'; -import { CoreSiteWSPreSets } from '@classes/site'; +import { CoreSiteWSPreSets } from '@classes/sites/site'; import { CoreConstants } from '@/core/constants'; import { CoreDelegate, CoreDelegateHandler } from '@classes/delegate'; import { makeSingleton } from '@singletons'; diff --git a/src/core/features/courses/services/courses-helper.ts b/src/core/features/courses/services/courses-helper.ts index 682397e0162..20c5b3b664e 100644 --- a/src/core/features/courses/services/courses-helper.ts +++ b/src/core/features/courses/services/courses-helper.ts @@ -29,7 +29,7 @@ import moment from 'moment-timezone'; import { of } from 'rxjs'; import { firstValueFrom, zipIncludingComplete } from '@/core/utils/rxjs'; import { catchError, map } from 'rxjs/operators'; -import { chainRequests, WSObservable } from '@classes/site'; +import { chainRequests, WSObservable } from '@classes/sites/site'; // Id for a course item representing all courses (for example, for course filters). export const ALL_COURSES_ID = -1; diff --git a/src/core/features/courses/services/courses.ts b/src/core/features/courses/services/courses.ts index f9a8be0ae10..26ad36153b7 100644 --- a/src/core/features/courses/services/courses.ts +++ b/src/core/features/courses/services/courses.ts @@ -14,7 +14,7 @@ import { Injectable } from '@angular/core'; import { CoreSites, CoreSitesCommonWSOptions, CoreSitesReadingStrategy } from '@services/sites'; -import { CoreSite, CoreSiteWSPreSets, WSObservable } from '@classes/site'; +import { CoreSite, CoreSiteWSPreSets, WSObservable } from '@classes/sites/site'; import { makeSingleton } from '@singletons'; import { CoreWarningsWSResponse, CoreWSExternalFile, CoreWSExternalWarning } from '@services/ws'; import { CoreEvents } from '@singletons/events'; diff --git a/src/core/features/courses/services/dashboard.ts b/src/core/features/courses/services/dashboard.ts index 194d32dc807..e72ad5ba5ad 100644 --- a/src/core/features/courses/services/dashboard.ts +++ b/src/core/features/courses/services/dashboard.ts @@ -14,7 +14,7 @@ import { Injectable } from '@angular/core'; import { CoreSites, CoreSitesCommonWSOptions } from '@services/sites'; -import { CoreSite, CoreSiteWSPreSets, WSObservable } from '@classes/site'; +import { CoreSite, CoreSiteWSPreSets, WSObservable } from '@classes/sites/site'; import { CoreCourseBlock } from '@features/course/services/course'; import { CoreStatusWithWarningsWSResponse } from '@services/ws'; import { makeSingleton } from '@singletons'; diff --git a/src/core/features/courses/services/handlers/my-courses-mainmenu.ts b/src/core/features/courses/services/handlers/my-courses-mainmenu.ts index 619327dc738..b962bfb2566 100644 --- a/src/core/features/courses/services/handlers/my-courses-mainmenu.ts +++ b/src/core/features/courses/services/handlers/my-courses-mainmenu.ts @@ -13,7 +13,7 @@ // limitations under the License. import { Injectable } from '@angular/core'; -import { CoreSiteInfoUserHomepage } from '@classes/site'; +import { CoreSiteInfoUserHomepage } from '@classes/sites/site'; import { CoreMainMenuHandler, CoreMainMenuHandlerData } from '@features/mainmenu/services/mainmenu-delegate'; import { CoreSiteHomeHomeHandler } from '@features/sitehome/services/handlers/sitehome-home'; import { CoreSites } from '@services/sites'; diff --git a/src/core/features/enrol/services/enrol.ts b/src/core/features/enrol/services/enrol.ts index 63117019f3a..c0a47825858 100644 --- a/src/core/features/enrol/services/enrol.ts +++ b/src/core/features/enrol/services/enrol.ts @@ -14,7 +14,7 @@ import { Injectable } from '@angular/core'; import { makeSingleton } from '@singletons'; -import { CoreSite } from '@classes/site'; +import { CoreSite } from '@classes/sites/site'; import { CoreSites } from '@services/sites'; import { CoreUtils } from '@services/utils/utils'; import { CoreEnrolAction, CoreEnrolDelegate } from './enrol-delegate'; diff --git a/src/core/features/fileuploader/services/fileuploader.ts b/src/core/features/fileuploader/services/fileuploader.ts index c64a654b6a9..b9565d276cf 100644 --- a/src/core/features/fileuploader/services/fileuploader.ts +++ b/src/core/features/fileuploader/services/fileuploader.ts @@ -28,7 +28,7 @@ import { CoreWSFile, CoreWSFileUploadOptions, CoreWSUploadFileResult } from '@se import { makeSingleton, Translate, MediaCapture, Camera } from '@singletons'; import { CoreLogger } from '@singletons/logger'; import { CoreError } from '@classes/errors/error'; -import { CoreSite } from '@classes/site'; +import { CoreSite } from '@classes/sites/site'; import { CoreFileEntry, CoreFileHelper } from '@services/file-helper'; import { CorePath } from '@singletons/path'; import { CorePlatform } from '@services/platform'; diff --git a/src/core/features/filter/services/filter-delegate.ts b/src/core/features/filter/services/filter-delegate.ts index 88eafb41bfd..07031aae76e 100644 --- a/src/core/features/filter/services/filter-delegate.ts +++ b/src/core/features/filter/services/filter-delegate.ts @@ -18,7 +18,7 @@ import { CoreSites } from '@services/sites'; import { CoreFilterFilter, CoreFilterFormatTextOptions } from './filter'; import { CoreFilterDefaultHandler } from './handlers/default-filter'; import { CoreDelegate, CoreDelegateHandler } from '@classes/delegate'; -import { CoreSite } from '@classes/site'; +import { CoreSite } from '@classes/sites/site'; import { makeSingleton } from '@singletons'; /** diff --git a/src/core/features/filter/services/filter-helper.ts b/src/core/features/filter/services/filter-helper.ts index 627518c592f..e5d6cb3088b 100644 --- a/src/core/features/filter/services/filter-helper.ts +++ b/src/core/features/filter/services/filter-helper.ts @@ -29,7 +29,7 @@ import { CoreCourses } from '@features/courses/services/courses'; import { makeSingleton } from '@singletons'; import { CoreEvents, CoreEventSiteData } from '@singletons/events'; import { CoreLogger } from '@singletons/logger'; -import { CoreSite } from '@classes/site'; +import { CoreSite } from '@classes/sites/site'; import { CoreCourseHelper } from '@features/course/services/course-helper'; import { firstValueFrom } from '@/core/utils/rxjs'; diff --git a/src/core/features/filter/services/filter.ts b/src/core/features/filter/services/filter.ts index 76ad93ff4dc..cc9d45e2ac4 100644 --- a/src/core/features/filter/services/filter.ts +++ b/src/core/features/filter/services/filter.ts @@ -16,7 +16,7 @@ import { Injectable } from '@angular/core'; import { CoreNetwork } from '@services/network'; import { CoreSites, CoreSitesReadingStrategy } from '@services/sites'; -import { CoreSite, CoreSiteWSPreSets } from '@classes/site'; +import { CoreSite, CoreSiteWSPreSets } from '@classes/sites/site'; import { CoreWSExternalWarning } from '@services/ws'; import { CoreTextUtils } from '@services/utils/text'; import { CoreFilterDelegate } from './filter-delegate'; diff --git a/src/core/features/filter/services/handlers/default-filter.ts b/src/core/features/filter/services/handlers/default-filter.ts index 625b5bd9bea..e94161ba679 100644 --- a/src/core/features/filter/services/handlers/default-filter.ts +++ b/src/core/features/filter/services/handlers/default-filter.ts @@ -16,7 +16,7 @@ import { Injectable, ViewContainerRef } from '@angular/core'; import { CoreFilterHandler } from '../filter-delegate'; import { CoreFilterFilter, CoreFilterFormatTextOptions } from '../filter'; -import { CoreSite } from '@classes/site'; +import { CoreSite } from '@classes/sites/site'; /** * Default handler used when the module doesn't have a specific implementation. diff --git a/src/core/features/grades/services/grades.ts b/src/core/features/grades/services/grades.ts index 1308c2d9455..7aa10b24a23 100644 --- a/src/core/features/grades/services/grades.ts +++ b/src/core/features/grades/services/grades.ts @@ -18,7 +18,7 @@ import { CoreSites } from '@services/sites'; import { makeSingleton } from '@singletons'; import { CoreLogger } from '@singletons/logger'; import { CoreWSExternalWarning } from '@services/ws'; -import { CoreSiteWSPreSets } from '@classes/site'; +import { CoreSiteWSPreSets } from '@classes/sites/site'; import { CoreError } from '@classes/errors/error'; import { SafeNumber } from '@/core/utils/types'; diff --git a/src/core/features/h5p/components/h5p-iframe/h5p-iframe.ts b/src/core/features/h5p/components/h5p-iframe/h5p-iframe.ts index 080140489c3..e4faf397d0c 100644 --- a/src/core/features/h5p/components/h5p-iframe/h5p-iframe.ts +++ b/src/core/features/h5p/components/h5p-iframe/h5p-iframe.ts @@ -25,7 +25,7 @@ import { CoreDomUtils } from '@services/utils/dom'; import { CoreUrlUtils } from '@services/utils/url'; import { CoreH5P } from '@features/h5p/services/h5p'; import { CoreConstants } from '@/core/constants'; -import { CoreSite } from '@classes/site'; +import { CoreSite } from '@classes/sites/site'; import { CoreLogger } from '@singletons/logger'; import { CoreH5PCore, CoreH5PDisplayOptions } from '../../classes/core'; import { CoreH5PHelper } from '../../classes/helper'; diff --git a/src/core/features/h5p/components/h5p-player/h5p-player.ts b/src/core/features/h5p/components/h5p-player/h5p-player.ts index 87b85e40a21..1b158ca877d 100644 --- a/src/core/features/h5p/components/h5p-player/h5p-player.ts +++ b/src/core/features/h5p/components/h5p-player/h5p-player.ts @@ -21,7 +21,7 @@ import { CoreDomUtils } from '@services/utils/dom'; import { CoreUrlUtils } from '@services/utils/url'; import { CorePluginFileDelegate } from '@services/plugin-file-delegate'; import { CoreConstants } from '@/core/constants'; -import { CoreSite } from '@classes/site'; +import { CoreSite } from '@classes/sites/site'; import { CoreEvents, CoreEventObserver } from '@singletons/events'; import { CoreLogger } from '@singletons/logger'; import { CoreH5P } from '@features/h5p/services/h5p'; diff --git a/src/core/features/h5p/services/h5p.ts b/src/core/features/h5p/services/h5p.ts index 0d0fe9c7476..6742c1f262b 100644 --- a/src/core/features/h5p/services/h5p.ts +++ b/src/core/features/h5p/services/h5p.ts @@ -18,7 +18,7 @@ import { CoreSites } from '@services/sites'; import { CoreWSExternalWarning, CoreWSExternalFile, CoreWSFile } from '@services/ws'; import { CoreUrlUtils } from '@services/utils/url'; import { CoreQueueRunner } from '@classes/queue-runner'; -import { CoreSite, CoreSiteWSPreSets } from '@classes/site'; +import { CoreSite, CoreSiteWSPreSets } from '@classes/sites/site'; import { CoreH5PCore } from '../classes/core'; import { CoreH5PFramework } from '../classes/framework'; diff --git a/src/core/features/login/components/login-methods/login-methods.ts b/src/core/features/login/components/login-methods/login-methods.ts index a934c1bc086..1e3b4d400be 100644 --- a/src/core/features/login/components/login-methods/login-methods.ts +++ b/src/core/features/login/components/login-methods/login-methods.ts @@ -13,7 +13,7 @@ // limitations under the License. import { Component, Input, OnInit } from '@angular/core'; -import { CoreSiteIdentityProvider, CoreSitePublicConfigResponse } from '@classes/site'; +import { CoreSiteIdentityProvider, CoreSitePublicConfigResponse } from '@classes/sites/site'; import { CoreLoginHelper, CoreLoginMethod } from '@features/login/services/login-helper'; import { CoreRedirectPayload } from '@services/navigator'; import { CoreSites } from '@services/sites'; diff --git a/src/core/features/login/pages/credentials/credentials.ts b/src/core/features/login/pages/credentials/credentials.ts index 87dc45aaf8e..c7f93476eb7 100644 --- a/src/core/features/login/pages/credentials/credentials.ts +++ b/src/core/features/login/pages/credentials/credentials.ts @@ -24,7 +24,7 @@ import { CoreDomUtils } from '@services/utils/dom'; import { CoreLoginHelper } from '@features/login/services/login-helper'; import { CoreConstants } from '@/core/constants'; import { Translate } from '@singletons'; -import { CoreSitePublicConfigResponse } from '@classes/site'; +import { CoreSitePublicConfigResponse } from '@classes/sites/site'; import { CoreEvents } from '@singletons/events'; import { CoreNavigator } from '@services/navigator'; import { CoreForms } from '@singletons/form'; diff --git a/src/core/features/login/pages/email-signup/email-signup.ts b/src/core/features/login/pages/email-signup/email-signup.ts index 4f22041bee3..f28905e0e7e 100644 --- a/src/core/features/login/pages/email-signup/email-signup.ts +++ b/src/core/features/login/pages/email-signup/email-signup.ts @@ -21,7 +21,7 @@ import { CoreTextUtils } from '@services/utils/text'; import { CoreCountry, CoreUtils } from '@services/utils/utils'; import { CoreWS, CoreWSExternalWarning } from '@services/ws'; import { Translate } from '@singletons'; -import { CoreSitePublicConfigResponse } from '@classes/site'; +import { CoreSitePublicConfigResponse } from '@classes/sites/site'; import { CoreUserProfileFieldDelegate } from '@features/user/services/user-profile-field-delegate'; import { diff --git a/src/core/features/login/pages/forgotten-password/forgotten-password.ts b/src/core/features/login/pages/forgotten-password/forgotten-password.ts index 4d20cf2c95f..1f60aaa26cb 100644 --- a/src/core/features/login/pages/forgotten-password/forgotten-password.ts +++ b/src/core/features/login/pages/forgotten-password/forgotten-password.ts @@ -21,7 +21,7 @@ import { Translate } from '@singletons'; import { CoreNavigator } from '@services/navigator'; import { CoreForms } from '@singletons/form'; import { CorePlatform } from '@services/platform'; -import { CoreSitePublicConfigResponse } from '@classes/site'; +import { CoreSitePublicConfigResponse } from '@classes/sites/site'; import { CoreUserSupportConfig } from '@features/user/classes/support/support-config'; import { CoreUserGuestSupportConfig } from '@features/user/classes/support/guest-support-config'; diff --git a/src/core/features/login/pages/reconnect/reconnect.ts b/src/core/features/login/pages/reconnect/reconnect.ts index fced7470633..06f64f38602 100644 --- a/src/core/features/login/pages/reconnect/reconnect.ts +++ b/src/core/features/login/pages/reconnect/reconnect.ts @@ -21,7 +21,7 @@ import { CoreSiteBasicInfo, CoreSites, CoreSitesReadingStrategy } from '@service import { CoreDomUtils } from '@services/utils/dom'; import { CoreUtils } from '@services/utils/utils'; import { CoreLoginHelper } from '@features/login/services/login-helper'; -import { CoreSite, CoreSitePublicConfigResponse } from '@classes/site'; +import { CoreSite, CoreSitePublicConfigResponse } from '@classes/sites/site'; import { CoreEvents } from '@singletons/events'; import { CoreError } from '@classes/errors/error'; import { CoreNavigator, CoreRedirectPayload } from '@services/navigator'; diff --git a/src/core/features/login/pages/site-policy/site-policy.ts b/src/core/features/login/pages/site-policy/site-policy.ts index 4131a118b13..3d28649b40b 100644 --- a/src/core/features/login/pages/site-policy/site-policy.ts +++ b/src/core/features/login/pages/site-policy/site-policy.ts @@ -19,7 +19,7 @@ import { CoreDomUtils } from '@services/utils/dom'; import { CoreUtils } from '@services/utils/utils'; import { CoreMimetypeUtils } from '@services/utils/mimetype'; import { CoreLoginHelper } from '@features/login/services/login-helper'; -import { CoreSite } from '@classes/site'; +import { CoreSite } from '@classes/sites/site'; import { CoreNavigator } from '@services/navigator'; import { CoreEvents } from '@singletons/events'; import { CoreAnalytics, CoreAnalyticsEventType } from '@services/analytics'; diff --git a/src/core/features/login/services/login-helper.ts b/src/core/features/login/services/login-helper.ts index 7d003b67a08..7f68d4515cd 100644 --- a/src/core/features/login/services/login-helper.ts +++ b/src/core/features/login/services/login-helper.ts @@ -26,7 +26,7 @@ import { CoreTextUtils } from '@services/utils/text'; import { CoreUrlParams, CoreUrlUtils } from '@services/utils/url'; import { CoreUtils } from '@services/utils/utils'; import { CoreConstants } from '@/core/constants'; -import { CoreSite, CoreSiteIdentityProvider, CoreSitePublicConfigResponse, CoreSiteQRCodeType, TypeOfLogin } from '@classes/site'; +import { CoreSite, CoreSiteIdentityProvider, CoreSitePublicConfigResponse, CoreSiteQRCodeType, TypeOfLogin } from '@classes/sites/site'; import { CoreError } from '@classes/errors/error'; import { CoreWSError } from '@classes/errors/wserror'; import { DomSanitizer, makeSingleton, Translate } from '@singletons'; diff --git a/src/core/features/mainmenu/components/user-menu-button/user-menu-button.ts b/src/core/features/mainmenu/components/user-menu-button/user-menu-button.ts index ec172ee3222..29926c8c1e0 100644 --- a/src/core/features/mainmenu/components/user-menu-button/user-menu-button.ts +++ b/src/core/features/mainmenu/components/user-menu-button/user-menu-button.ts @@ -13,7 +13,7 @@ // limitations under the License. import { Component, Input, OnInit } from '@angular/core'; -import { CoreSiteInfo } from '@classes/site'; +import { CoreSiteInfo } from '@classes/sites/site'; import { CoreUserTourDirectiveOptions } from '@directives/user-tour'; import { CoreUserToursAlignment, CoreUserToursSide } from '@features/usertours/services/user-tours'; import { IonRouterOutlet } from '@ionic/angular'; diff --git a/src/core/features/mainmenu/components/user-menu/user-menu.ts b/src/core/features/mainmenu/components/user-menu/user-menu.ts index c7bb9498a56..62b2acccfc8 100644 --- a/src/core/features/mainmenu/components/user-menu/user-menu.ts +++ b/src/core/features/mainmenu/components/user-menu/user-menu.ts @@ -14,7 +14,7 @@ import { CoreConstants } from '@/core/constants'; import { Component, OnDestroy, OnInit } from '@angular/core'; -import { CoreSite, CoreSiteInfo } from '@classes/site'; +import { CoreSite, CoreSiteInfo } from '@classes/sites/site'; import { CoreFilter } from '@features/filter/services/filter'; import { CoreLoginSitesModalComponent } from '@features/login/components/sites-modal/sites-modal'; import { CoreLoginHelper } from '@features/login/services/login-helper'; diff --git a/src/core/features/pushnotifications/services/pushnotifications.ts b/src/core/features/pushnotifications/services/pushnotifications.ts index 8b9091187b7..6c6e4e354b8 100644 --- a/src/core/features/pushnotifications/services/pushnotifications.ts +++ b/src/core/features/pushnotifications/services/pushnotifications.ts @@ -24,7 +24,7 @@ import { CoreUtils } from '@services/utils/utils'; import { CoreTextUtils } from '@services/utils/text'; import { CoreConfig } from '@services/config'; import { CoreConstants } from '@/core/constants'; -import { CoreSite, CoreSiteInfo } from '@classes/site'; +import { CoreSite, CoreSiteInfo } from '@classes/sites/site'; import { makeSingleton, Badge, Push, Device, Translate, ApplicationInit, NgZone } from '@singletons'; import { CoreLogger } from '@singletons/logger'; import { CoreEvents } from '@singletons/events'; diff --git a/src/core/features/rating/services/rating.ts b/src/core/features/rating/services/rating.ts index 7f13b613122..54441df2b7e 100644 --- a/src/core/features/rating/services/rating.ts +++ b/src/core/features/rating/services/rating.ts @@ -14,7 +14,7 @@ import { ContextLevel } from '@/core/constants'; import { Injectable } from '@angular/core'; -import { CoreSiteWSPreSets, CoreSite } from '@classes/site'; +import { CoreSiteWSPreSets, CoreSite } from '@classes/sites/site'; import { CoreUser } from '@features/user/services/user'; import { CoreNetwork } from '@services/network'; import { CoreSites } from '@services/sites'; diff --git a/src/core/features/reportbuilder/services/reportbuilder.ts b/src/core/features/reportbuilder/services/reportbuilder.ts index 00dfac43f4c..d1cba2e5a11 100644 --- a/src/core/features/reportbuilder/services/reportbuilder.ts +++ b/src/core/features/reportbuilder/services/reportbuilder.ts @@ -14,7 +14,7 @@ import { Injectable } from '@angular/core'; import { CoreError } from '@classes/errors/error'; -import { CoreSiteWSPreSets } from '@classes/site'; +import { CoreSiteWSPreSets } from '@classes/sites/site'; import { CoreSites } from '@services/sites'; import { CoreWSExternalWarning } from '@services/ws'; import { makeSingleton } from '@singletons'; diff --git a/src/core/features/search/services/global-search.ts b/src/core/features/search/services/global-search.ts index 9b89e16a8d5..ecfd8f5ccf4 100644 --- a/src/core/features/search/services/global-search.ts +++ b/src/core/features/search/services/global-search.ts @@ -19,7 +19,7 @@ import { CoreWSExternalWarning } from '@services/ws'; import { CoreCourseListItem, CoreCourses } from '@features/courses/services/courses'; import { CoreUserWithAvatar } from '@components/user-avatar/user-avatar'; import { CoreUser } from '@features/user/services/user'; -import { CoreSite } from '@classes/site'; +import { CoreSite } from '@classes/sites/site'; declare module '@singletons/events' { diff --git a/src/core/features/settings/pages/about/about.ts b/src/core/features/settings/pages/about/about.ts index e5331f72789..729f820dec0 100644 --- a/src/core/features/settings/pages/about/about.ts +++ b/src/core/features/settings/pages/about/about.ts @@ -17,7 +17,7 @@ import { Component } from '@angular/core'; import { CoreConstants } from '@/core/constants'; import { CoreSites } from '@services/sites'; import { CoreNavigator } from '@services/navigator'; -import { CoreSite } from '@classes/site'; +import { CoreSite } from '@classes/sites/site'; /** * App settings about menu page. diff --git a/src/core/features/settings/services/settings-helper.ts b/src/core/features/settings/services/settings-helper.ts index 477c4e93730..483e28c7ccd 100644 --- a/src/core/features/settings/services/settings-helper.ts +++ b/src/core/features/settings/services/settings-helper.ts @@ -18,7 +18,7 @@ import { CoreNetwork } from '@services/network'; import { CoreCronDelegate } from '@services/cron'; import { CoreEvents } from '@singletons/events'; import { CoreFilepool } from '@services/filepool'; -import { CoreSite } from '@classes/site'; +import { CoreSite } from '@classes/sites/site'; import { CoreSites } from '@services/sites'; import { CoreUtils } from '@services/utils/utils'; import { CoreConstants } from '@/core/constants'; diff --git a/src/core/features/sitehome/pages/index/index.ts b/src/core/features/sitehome/pages/index/index.ts index 3bfda7dc0de..a869bdbf1f0 100644 --- a/src/core/features/sitehome/pages/index/index.ts +++ b/src/core/features/sitehome/pages/index/index.ts @@ -15,7 +15,7 @@ import { Component, OnDestroy, OnInit } from '@angular/core'; import { ActivatedRoute } from '@angular/router'; -import { CoreSite, CoreSiteConfig } from '@classes/site'; +import { CoreSite, CoreSiteConfig } from '@classes/sites/site'; import { CoreCourse, CoreCourseWSSection } from '@features/course/services/course'; import { CoreDomUtils } from '@services/utils/dom'; import { CoreSites } from '@services/sites'; diff --git a/src/core/features/sitehome/services/handlers/sitehome-home.ts b/src/core/features/sitehome/services/handlers/sitehome-home.ts index 10d1a4fd19e..20c4b267878 100644 --- a/src/core/features/sitehome/services/handlers/sitehome-home.ts +++ b/src/core/features/sitehome/services/handlers/sitehome-home.ts @@ -17,7 +17,7 @@ import { CoreSites } from '@services/sites'; import { CoreMainMenuHomeHandler, CoreMainMenuHomeHandlerToDisplay } from '@features/mainmenu/services/home-delegate'; import { CoreSiteHome } from '../sitehome'; import { makeSingleton } from '@singletons'; -import { CoreSiteInfoUserHomepage } from '@classes/site'; +import { CoreSiteInfoUserHomepage } from '@classes/sites/site'; /** * Handler to add site home into home page. diff --git a/src/core/features/sitehome/services/sitehome.ts b/src/core/features/sitehome/services/sitehome.ts index f54cac477a8..bc83d96b5a4 100644 --- a/src/core/features/sitehome/services/sitehome.ts +++ b/src/core/features/sitehome/services/sitehome.ts @@ -15,7 +15,7 @@ import { Injectable } from '@angular/core'; import { CoreSites } from '@services/sites'; -import { CoreSite, CoreSiteWSPreSets } from '@classes/site'; +import { CoreSite, CoreSiteWSPreSets } from '@classes/sites/site'; import { makeSingleton } from '@singletons'; import { CoreCourse } from '../../course/services/course'; import { CoreCourses } from '../../courses/services/courses'; diff --git a/src/core/features/sitehome/tests/links.test.ts b/src/core/features/sitehome/tests/links.test.ts index fd25d399a50..513a2966c71 100644 --- a/src/core/features/sitehome/tests/links.test.ts +++ b/src/core/features/sitehome/tests/links.test.ts @@ -13,7 +13,7 @@ // limitations under the License. import { mock, mockSingleton } from '@/testing/utils'; -import { CoreSite } from '@classes/site'; +import { CoreSite } from '@classes/sites/site'; import { CoreContentLinksDelegate } from '@features/contentlinks/services/contentlinks-delegate'; import { CoreLoginHelper } from '@features/login/services/login-helper'; import { CoreSiteHomeIndexLinkHandlerService } from '@features/sitehome/services/handlers/index-link'; diff --git a/src/core/features/siteplugins/classes/call-ws-directive.ts b/src/core/features/siteplugins/classes/call-ws-directive.ts index d34411964d6..85348c69939 100644 --- a/src/core/features/siteplugins/classes/call-ws-directive.ts +++ b/src/core/features/siteplugins/classes/call-ws-directive.ts @@ -15,7 +15,7 @@ import { Input, OnInit, OnDestroy, ElementRef, Output, EventEmitter, Directive } from '@angular/core'; import { Subscription } from 'rxjs'; -import { CoreSiteWSPreSets } from '@classes/site'; +import { CoreSiteWSPreSets } from '@classes/sites/site'; import { CoreSitePluginsPluginContentComponent } from '../components/plugin-content/plugin-content'; import { CoreSitePlugins } from '../services/siteplugins'; import { CoreLogger } from '@singletons/logger'; diff --git a/src/core/features/siteplugins/components/module-index/module-index.ts b/src/core/features/siteplugins/components/module-index/module-index.ts index 71f1934f4e2..5fe9c342ae5 100644 --- a/src/core/features/siteplugins/components/module-index/module-index.ts +++ b/src/core/features/siteplugins/components/module-index/module-index.ts @@ -14,7 +14,7 @@ import { Component, OnInit, OnDestroy, Input, ViewChild, HostBinding } from '@angular/core'; -import { CoreSiteWSPreSets } from '@classes/site'; +import { CoreSiteWSPreSets } from '@classes/sites/site'; import { CoreCourseModuleSummaryResult, CoreCourseModuleSummaryComponent, diff --git a/src/core/features/siteplugins/components/plugin-content/plugin-content.ts b/src/core/features/siteplugins/components/plugin-content/plugin-content.ts index 1f96ac3ef2f..c132c3e1222 100644 --- a/src/core/features/siteplugins/components/plugin-content/plugin-content.ts +++ b/src/core/features/siteplugins/components/plugin-content/plugin-content.ts @@ -27,7 +27,7 @@ import { import { Subject } from 'rxjs'; import { Md5 } from 'ts-md5'; -import { CoreSiteWSPreSets } from '@classes/site'; +import { CoreSiteWSPreSets } from '@classes/sites/site'; import { CoreCompileHtmlComponent } from '@features/compile/components/compile-html/compile-html'; import { CoreSitePlugins, CoreSitePluginsContent, CoreSitePluginsProvider } from '@features/siteplugins/services/siteplugins'; import { CoreNavigator } from '@services/navigator'; diff --git a/src/core/features/siteplugins/directives/call-ws-new-content.ts b/src/core/features/siteplugins/directives/call-ws-new-content.ts index 98424da814b..8e4e836a5d7 100644 --- a/src/core/features/siteplugins/directives/call-ws-new-content.ts +++ b/src/core/features/siteplugins/directives/call-ws-new-content.ts @@ -13,7 +13,7 @@ // limitations under the License. import { Directive, Input, ElementRef, Optional } from '@angular/core'; -import { CoreSiteWSPreSets } from '@classes/site'; +import { CoreSiteWSPreSets } from '@classes/sites/site'; import { CoreNavigator } from '@services/navigator'; import { CoreUtils } from '@services/utils/utils'; import { Md5 } from 'ts-md5'; diff --git a/src/core/features/siteplugins/directives/new-content.ts b/src/core/features/siteplugins/directives/new-content.ts index e7d219bfb95..ffa1afa296a 100644 --- a/src/core/features/siteplugins/directives/new-content.ts +++ b/src/core/features/siteplugins/directives/new-content.ts @@ -15,7 +15,7 @@ import { Directive, Input, OnInit, ElementRef, Optional } from '@angular/core'; import { Md5 } from 'ts-md5'; -import { CoreSiteWSPreSets } from '@classes/site'; +import { CoreSiteWSPreSets } from '@classes/sites/site'; import { CoreNavigator } from '@services/navigator'; import { CoreUtils } from '@services/utils/utils'; import { CoreSitePluginsPluginContentComponent } from '../components/plugin-content/plugin-content'; diff --git a/src/core/features/siteplugins/pages/plugin/plugin.ts b/src/core/features/siteplugins/pages/plugin/plugin.ts index 6ad96e620ad..d2b0fca98fc 100644 --- a/src/core/features/siteplugins/pages/plugin/plugin.ts +++ b/src/core/features/siteplugins/pages/plugin/plugin.ts @@ -14,7 +14,7 @@ import { Component, OnInit, ViewChild } from '@angular/core'; -import { CoreSiteWSPreSets } from '@classes/site'; +import { CoreSiteWSPreSets } from '@classes/sites/site'; import { CoreSitePluginsContent } from '@features/siteplugins/services/siteplugins'; import { CanLeave } from '@guards/can-leave'; import { CoreNavigator } from '@services/navigator'; diff --git a/src/core/features/siteplugins/services/siteplugins-helper.ts b/src/core/features/siteplugins/services/siteplugins-helper.ts index d0d55948b96..a1514bbf74d 100644 --- a/src/core/features/siteplugins/services/siteplugins-helper.ts +++ b/src/core/features/siteplugins/services/siteplugins-helper.ts @@ -20,7 +20,7 @@ import { AddonModAssignSubmissionDelegate } from '@addons/mod/assign/services/su import { AddonModQuizAccessRuleDelegate } from '@addons/mod/quiz/services/access-rules-delegate'; import { CoreDelegate, CoreDelegateHandler } from '@classes/delegate'; import { CoreError } from '@classes/errors/error'; -import { CoreSiteWSPreSets } from '@classes/site'; +import { CoreSiteWSPreSets } from '@classes/sites/site'; import { CoreBlockDelegate } from '@features/block/services/block-delegate'; import { CoreCompile } from '@features/compile/services/compile'; import { CoreCourseOptionsDelegate } from '@features/course/services/course-options-delegate'; diff --git a/src/core/features/siteplugins/services/siteplugins.ts b/src/core/features/siteplugins/services/siteplugins.ts index 51324a9af25..4a133b1ffc1 100644 --- a/src/core/features/siteplugins/services/siteplugins.ts +++ b/src/core/features/siteplugins/services/siteplugins.ts @@ -15,7 +15,7 @@ import { Injectable } from '@angular/core'; import { CoreConstants } from '@/core/constants'; -import { CoreSite, CoreSiteWSPreSets } from '@classes/site'; +import { CoreSite, CoreSiteWSPreSets } from '@classes/sites/site'; import { CoreCourseAnyModuleData } from '@features/course/services/course'; import { CoreCourses } from '@features/courses/services/courses'; import { CoreApp } from '@services/app'; diff --git a/src/core/features/styles/services/styles.ts b/src/core/features/styles/services/styles.ts index 119730d1202..24c49c287fd 100644 --- a/src/core/features/styles/services/styles.ts +++ b/src/core/features/styles/services/styles.ts @@ -14,7 +14,7 @@ import { Injectable } from '@angular/core'; import { CoreError } from '@classes/errors/error'; -import { CoreSitePublicConfigResponse } from '@classes/site'; +import { CoreSitePublicConfigResponse } from '@classes/sites/site'; import { CoreApp } from '@services/app'; import { CoreSites } from '@services/sites'; import { CoreUtils } from '@services/utils/utils'; diff --git a/src/core/features/tag/services/tag.ts b/src/core/features/tag/services/tag.ts index fe86e0b2909..25d0660cd8e 100644 --- a/src/core/features/tag/services/tag.ts +++ b/src/core/features/tag/services/tag.ts @@ -14,7 +14,7 @@ import { Injectable } from '@angular/core'; import { CoreSites } from '@services/sites'; -import { CoreSite, CoreSiteWSPreSets } from '@classes/site'; +import { CoreSite, CoreSiteWSPreSets } from '@classes/sites/site'; import { CoreWSExternalWarning } from '@services/ws'; import { makeSingleton, Translate } from '@singletons'; import { CoreError } from '@classes/errors/error'; diff --git a/src/core/features/user/classes/support/authenticated-support-config.ts b/src/core/features/user/classes/support/authenticated-support-config.ts index 361b82b546a..53acd290b51 100644 --- a/src/core/features/user/classes/support/authenticated-support-config.ts +++ b/src/core/features/user/classes/support/authenticated-support-config.ts @@ -12,7 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -import { CoreSite, CoreSiteConfigSupportAvailability } from '@classes/site'; +import { CoreSite, CoreSiteConfigSupportAvailability } from '@classes/sites/site'; import { CoreSites } from '@services/sites'; import { CoreUserSupportConfig } from './support-config'; diff --git a/src/core/features/user/classes/support/guest-support-config.ts b/src/core/features/user/classes/support/guest-support-config.ts index 4861bf4ca34..aa2679b3a8b 100644 --- a/src/core/features/user/classes/support/guest-support-config.ts +++ b/src/core/features/user/classes/support/guest-support-config.ts @@ -12,7 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -import { CoreSiteConfigSupportAvailability, CoreSitePublicConfigResponse } from '@classes/site'; +import { CoreSiteConfigSupportAvailability, CoreSitePublicConfigResponse } from '@classes/sites/site'; import { CoreLoginHelper } from '@features/login/services/login-helper'; import { CoreUserNullSupportConfig } from '@features/user/classes/support/null-support-config'; import { CoreSites } from '@services/sites'; diff --git a/src/core/features/user/pages/about/about.ts b/src/core/features/user/pages/about/about.ts index e6e38c9ee1a..4315f084397 100644 --- a/src/core/features/user/pages/about/about.ts +++ b/src/core/features/user/pages/about/about.ts @@ -28,7 +28,7 @@ import { import { CoreUserHelper } from '@features/user/services/user-helper'; import { CoreNavigator } from '@services/navigator'; import { CoreIonLoadingElement } from '@classes/ion-loading'; -import { CoreSite } from '@classes/site'; +import { CoreSite } from '@classes/sites/site'; import { CoreFileUploaderHelper } from '@features/fileuploader/services/fileuploader-helper'; import { CoreMimetypeUtils } from '@services/utils/mimetype'; import { Translate } from '@singletons'; diff --git a/src/core/features/user/pages/profile/profile.ts b/src/core/features/user/pages/profile/profile.ts index cbbb6e5c5bb..e056c0acd8e 100644 --- a/src/core/features/user/pages/profile/profile.ts +++ b/src/core/features/user/pages/profile/profile.ts @@ -16,7 +16,7 @@ import { ActivatedRoute, ActivatedRouteSnapshot } from '@angular/router'; import { Component, OnDestroy, OnInit } from '@angular/core'; import { Subscription } from 'rxjs'; -import { CoreSite } from '@classes/site'; +import { CoreSite } from '@classes/sites/site'; import { CoreSites } from '@services/sites'; import { CoreDomUtils } from '@services/utils/dom'; import { CoreEventObserver, CoreEvents } from '@singletons/events'; diff --git a/src/core/features/user/services/user.ts b/src/core/features/user/services/user.ts index 09d2dc0dfee..eb62ff86c61 100644 --- a/src/core/features/user/services/user.ts +++ b/src/core/features/user/services/user.ts @@ -20,7 +20,7 @@ import { CoreSites } from '@services/sites'; import { CoreUtils } from '@services/utils/utils'; import { CoreUserOffline } from './user-offline'; import { CoreLogger } from '@singletons/logger'; -import { CoreSite, CoreSiteWSPreSets } from '@classes/site'; +import { CoreSite, CoreSiteWSPreSets } from '@classes/sites/site'; import { makeSingleton, Translate } from '@singletons'; import { CoreEvents, CoreEventSiteData, CoreEventUserDeletedData, CoreEventUserSuspendedData } from '@singletons/events'; import { CoreStatusWithWarningsWSResponse, CoreWSExternalWarning } from '@services/ws'; diff --git a/src/core/features/xapi/classes/item-agent.ts b/src/core/features/xapi/classes/item-agent.ts index 64c2d9e5d73..f1f120ce26a 100644 --- a/src/core/features/xapi/classes/item-agent.ts +++ b/src/core/features/xapi/classes/item-agent.ts @@ -12,7 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -import { CoreSite } from '@classes/site'; +import { CoreSite } from '@classes/sites/site'; /** * Statement agent (user) object for xAPI structure checking and usage. diff --git a/src/core/features/xapi/services/xapi.ts b/src/core/features/xapi/services/xapi.ts index fd30ccb2471..2171c85dfb2 100644 --- a/src/core/features/xapi/services/xapi.ts +++ b/src/core/features/xapi/services/xapi.ts @@ -17,7 +17,7 @@ import { Injectable } from '@angular/core'; import { CoreNetwork } from '@services/network'; import { CoreSites, CoreSitesCommonWSOptions } from '@services/sites'; import { CoreUtils } from '@services/utils/utils'; -import { CoreSite, CoreSiteWSPreSets } from '@classes/site'; +import { CoreSite, CoreSiteWSPreSets } from '@classes/sites/site'; import { CoreXAPIOffline, CoreXAPIOfflineSaveStatementsOptions } from './offline'; import { makeSingleton } from '@singletons'; import { CoreXAPIItemAgent } from '../classes/item-agent'; diff --git a/src/core/services/groups.ts b/src/core/services/groups.ts index e537c5012f8..1831cdc644a 100644 --- a/src/core/services/groups.ts +++ b/src/core/services/groups.ts @@ -15,7 +15,7 @@ import { Injectable } from '@angular/core'; import { CoreSites } from '@services/sites'; -import { CoreSite, CoreSiteWSPreSets } from '@classes/site'; +import { CoreSite, CoreSiteWSPreSets } from '@classes/sites/site'; import { CoreError } from '@classes/errors/error'; import { makeSingleton, Translate } from '@singletons'; import { CoreWSExternalWarning } from '@services/ws'; diff --git a/src/core/services/lang.ts b/src/core/services/lang.ts index f7e14e9117b..128e2fad5ef 100644 --- a/src/core/services/lang.ts +++ b/src/core/services/lang.ts @@ -22,7 +22,7 @@ import { CoreSubscriptions } from '@singletons/subscriptions'; import { makeSingleton, Translate, Http } from '@singletons'; import moment from 'moment-timezone'; -import { CoreSite } from '../classes/site'; +import { CoreSite } from '../classes/sites/site'; import { CorePlatform } from '@services/platform'; import { AddonFilterMultilangHandler } from '@addons/filter/multilang/services/handlers/multilang'; import { AddonFilterMultilang2Handler } from '@addons/filter/multilang2/services/handlers/multilang2'; diff --git a/src/core/services/sites-factory.ts b/src/core/services/sites-factory.ts index da22e6d9135..fd1d21bf9ca 100644 --- a/src/core/services/sites-factory.ts +++ b/src/core/services/sites-factory.ts @@ -14,7 +14,7 @@ import { Injectable } from '@angular/core'; -import { CoreSite, CoreSiteConfig, CoreSiteInfo } from '@classes/site'; +import { CoreSite, CoreSiteConfig, CoreSiteInfo } from '@classes/sites/site'; import { makeSingleton } from '@singletons'; /* diff --git a/src/core/services/sites.ts b/src/core/services/sites.ts index f3ec0137bc3..e598544329f 100644 --- a/src/core/services/sites.ts +++ b/src/core/services/sites.ts @@ -31,7 +31,7 @@ import { CoreSiteConfig, CoreSitePublicConfigResponse, CoreSiteInfoResponse, -} from '@classes/site'; +} from '@classes/sites/site'; import { SQLiteDB, SQLiteDBRecordValues, SQLiteDBTableSchema } from '@classes/sqlitedb'; import { CoreError } from '@classes/errors/error'; import { CoreLoginError, CoreLoginErrorOptions } from '@classes/errors/loginerror'; diff --git a/src/core/services/storage.ts b/src/core/services/storage.ts index a2fb8fc380f..90e607fa360 100644 --- a/src/core/services/storage.ts +++ b/src/core/services/storage.ts @@ -23,7 +23,7 @@ import { SQLiteDB } from '@classes/sqlitedb'; import { APP_SCHEMA, CoreStorageRecord, TABLE_NAME } from './database/storage'; import { CoreSites } from './sites'; -import { CoreSite } from '@classes/site'; +import { CoreSite } from '@classes/sites/site'; /** * Service to store data using key-value pairs. diff --git a/src/core/services/ws.ts b/src/core/services/ws.ts index e227d4f48f2..6e3284a41bb 100644 --- a/src/core/services/ws.ts +++ b/src/core/services/ws.ts @@ -35,7 +35,7 @@ import { CoreWSError } from '@classes/errors/wserror'; import { CoreAjaxError } from '@classes/errors/ajaxerror'; import { CoreAjaxWSError } from '@classes/errors/ajaxwserror'; import { CoreNetworkError } from '@classes/errors/network-error'; -import { CoreSite } from '@classes/site'; +import { CoreSite } from '@classes/sites/site'; import { CoreHttpError } from '@classes/errors/httperror'; import { CorePromisedValue } from '@classes/promised-value'; import { CorePlatform } from '@services/platform'; diff --git a/src/core/singletons/events.ts b/src/core/singletons/events.ts index 42bec511fb9..fd8b0fa972b 100644 --- a/src/core/singletons/events.ts +++ b/src/core/singletons/events.ts @@ -15,7 +15,7 @@ import { Subject } from 'rxjs'; import { CoreLogger } from '@singletons/logger'; -import { CoreSite, CoreSiteInfoResponse, CoreSitePublicConfigResponse } from '@classes/site'; +import { CoreSite, CoreSiteInfoResponse, CoreSitePublicConfigResponse } from '@classes/sites/site'; import { CoreFilepoolComponentFileEventData } from '@services/filepool'; import { CoreRedirectPayload } from '@services/navigator'; import { CoreCourseModuleCompletionData } from '@features/course/services/course-helper'; diff --git a/src/core/singletons/tests/url.test.ts b/src/core/singletons/tests/url.test.ts index 4fd2cf620cb..228fb7cf809 100644 --- a/src/core/singletons/tests/url.test.ts +++ b/src/core/singletons/tests/url.test.ts @@ -13,7 +13,7 @@ // limitations under the License. import { mock } from '@/testing/utils'; -import { CoreSite } from '@classes/site'; +import { CoreSite } from '@classes/sites/site'; import { CoreUrl } from '@singletons/url'; describe('CoreUrl singleton', () => { diff --git a/src/core/singletons/url.ts b/src/core/singletons/url.ts index 7c2524cd45f..dea4022c144 100644 --- a/src/core/singletons/url.ts +++ b/src/core/singletons/url.ts @@ -12,7 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -import { CoreSite } from '@classes/site'; +import { CoreSite } from '@classes/sites/site'; import { CorePath } from './path'; import { CoreText } from './text'; diff --git a/src/storybook/stubs/classes/site.ts b/src/storybook/stubs/classes/site.ts index 12d8f89c2da..d754ea3a982 100644 --- a/src/storybook/stubs/classes/site.ts +++ b/src/storybook/stubs/classes/site.ts @@ -12,7 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -import { CoreSite, CoreSiteConfigResponse, CoreSiteInfo, CoreSiteWSPreSets, WSObservable } from '@classes/site'; +import { CoreSite, CoreSiteConfigResponse, CoreSiteInfo, CoreSiteWSPreSets, WSObservable } from '@classes/sites/site'; import { of } from 'rxjs'; export interface CoreSiteFixture { diff --git a/src/storybook/stubs/services/sites.ts b/src/storybook/stubs/services/sites.ts index 8fa901a92f1..52a60f3515b 100644 --- a/src/storybook/stubs/services/sites.ts +++ b/src/storybook/stubs/services/sites.ts @@ -17,7 +17,7 @@ import { schoolBarbaraSite } from '@/assets/storybook/sites/schoolbarbara'; import { schoolJefferySite } from '@/assets/storybook/sites/schooljeffery'; import { CoreSiteFixture, CoreSiteStub } from '@/storybook/stubs/classes/site'; import { CoreError } from '@classes/errors/error'; -import { CoreSite } from '@classes/site'; +import { CoreSite } from '@classes/sites/site'; import { SiteDBEntry } from '@services/database/sites'; import { CoreSiteBasicInfo, CoreSitesProvider } from '@services/sites'; import { makeSingleton } from '@singletons'; From 954ce48d7b2f5237bea054e1c72ff4cd261d5797 Mon Sep 17 00:00:00 2001 From: Dani Palou Date: Thu, 9 Nov 2023 13:20:27 +0100 Subject: [PATCH 2/8] MOBILE-4469 core: Create new CoreUnauthenticatedSite class --- .../post-options-menu/post-options-menu.ts | 2 +- .../mod/forum/pages/discussion/discussion.ts | 2 +- .../services/remotethemes-handler.ts | 2 +- src/core/classes/sites/site.ts | 315 +------------- .../classes/sites/unauthenticated-site.ts | 409 ++++++++++++++++++ src/core/components/sites-list/sites-list.ts | 5 +- .../components/user-avatar/user-avatar.ts | 2 +- .../choose-site-modal/choose-site-modal.ts | 3 +- .../module-summary/module-summary.ts | 2 +- .../course-summary/course-summary.page.ts | 2 +- .../pages/module-preview/module-preview.ts | 2 +- .../services/handlers/my-courses-mainmenu.ts | 2 +- .../components/login-methods/login-methods.ts | 2 +- .../login/pages/credentials/credentials.html | 12 +- .../login/pages/credentials/credentials.ts | 39 +- .../pages/email-signup/email-signup.html | 6 +- .../login/pages/email-signup/email-signup.ts | 34 +- .../forgotten-password/forgotten-password.ts | 2 +- .../login/pages/reconnect/reconnect.html | 12 +- .../login/pages/reconnect/reconnect.ts | 54 ++- src/core/features/login/pages/site/site.html | 2 +- src/core/features/login/pages/site/site.ts | 10 +- .../features/login/services/login-helper.ts | 26 +- .../user-menu-button/user-menu-button.ts | 2 +- .../components/user-menu/user-menu.ts | 11 +- .../services/pushnotifications.ts | 3 +- .../settings/pages/deviceinfo/deviceinfo.ts | 4 +- .../services/handlers/sitehome-home.ts | 2 +- src/core/features/styles/services/styles.ts | 2 +- .../support/authenticated-support-config.ts | 3 +- .../classes/support/guest-support-config.ts | 2 +- src/core/services/sites-factory.ts | 13 +- src/core/services/sites.ts | 46 +- src/core/singletons/events.ts | 3 +- src/storybook/stubs/classes/site.ts | 3 +- 35 files changed, 562 insertions(+), 479 deletions(-) create mode 100644 src/core/classes/sites/unauthenticated-site.ts diff --git a/src/addons/mod/forum/components/post-options-menu/post-options-menu.ts b/src/addons/mod/forum/components/post-options-menu/post-options-menu.ts index a32c5f97ecb..8dccdcb0250 100644 --- a/src/addons/mod/forum/components/post-options-menu/post-options-menu.ts +++ b/src/addons/mod/forum/components/post-options-menu/post-options-menu.ts @@ -86,7 +86,7 @@ export class AddonModForumPostOptionsMenuComponent implements OnInit { */ protected setOpenInBrowserUrl(): void { const site = CoreSites.getRequiredCurrentSite(); - if (!CoreSites.shouldDisplayInformativeLinks(site)) { + if (!site.shouldDisplayInformativeLinks()) { return; } diff --git a/src/addons/mod/forum/pages/discussion/discussion.ts b/src/addons/mod/forum/pages/discussion/discussion.ts index 3d40cf2da8d..0779c78fa1d 100644 --- a/src/addons/mod/forum/pages/discussion/discussion.ts +++ b/src/addons/mod/forum/pages/discussion/discussion.ts @@ -167,7 +167,7 @@ export class AddonModForumDiscussionPage implements OnInit, AfterViewInit, OnDes const currentSite = CoreSites.getCurrentSite(); this.isOnline = CoreNetwork.isOnline(); - this.externalUrl = currentSite && CoreSites.shouldDisplayInformativeLinks(currentSite) ? + this.externalUrl = currentSite && currentSite.shouldDisplayInformativeLinks() ? currentSite.createSiteUrl('/mod/forum/discuss.php', { d: this.discussionId.toString() }) : undefined; this.onlineObserver = CoreNetwork.onChange().subscribe(() => { diff --git a/src/addons/remotethemes/services/remotethemes-handler.ts b/src/addons/remotethemes/services/remotethemes-handler.ts index b356ff49a7c..c4c96e5b58d 100644 --- a/src/addons/remotethemes/services/remotethemes-handler.ts +++ b/src/addons/remotethemes/services/remotethemes-handler.ts @@ -14,7 +14,7 @@ import { Injectable } from '@angular/core'; import { CoreConstants } from '@/core/constants'; -import { CoreSitePublicConfigResponse } from '@classes/sites/site'; +import { CoreSitePublicConfigResponse } from '@classes/sites/unauthenticated-site'; import { CoreFile } from '@services/file'; import { CoreFilepool } from '@services/filepool'; import { CoreSites } from '@services/sites'; diff --git a/src/core/classes/sites/site.ts b/src/core/classes/sites/site.ts index 1c8fb5a69c7..9e461dd256c 100644 --- a/src/core/classes/sites/site.ts +++ b/src/core/classes/sites/site.ts @@ -24,7 +24,6 @@ import { CoreWS, CoreWSPreSets, CoreWSFileUploadOptions, - CoreWSAjaxPreSets, CoreWSExternalWarning, CoreWSUploadFileResult, CoreWSPreSetsSplitRequest, @@ -62,19 +61,9 @@ import { finalize, map, mergeMap } from 'rxjs/operators'; import { firstValueFrom } from '../../utils/rxjs'; import { CoreSiteError } from '@classes/errors/siteerror'; import { CoreUserAuthenticatedSupportConfig } from '@features/user/classes/support/authenticated-support-config'; -import { CoreLoginHelper } from '@features/login/services/login-helper'; -import { CorePath } from '@singletons/path'; import { CoreErrorLogs } from '@singletons/error-logs'; import { CoreFilepool } from '@services/filepool'; - -/** - * QR Code type enumeration. - */ -export enum CoreSiteQRCodeType { - QR_CODE_DISABLED = 0, // QR code disabled value - QR_CODE_URL = 1, // QR code type URL value - QR_CODE_LOGIN = 2, // QR code type login value -} +import { CoreSiteInfo, CoreSiteInfoResponse, CoreSitePublicConfigResponse, CoreUnauthenticatedSite } from './unauthenticated-site'; // WS that we allow to call even if the site is logged out. const ALLOWED_LOGGEDOUT_WS = [ @@ -89,7 +78,7 @@ const ALLOWED_LOGGEDOUT_WS = [ * * @todo Refactor this class to improve "temporary" sites support (not fully authenticated). */ -export class CoreSite { +export class CoreSite extends CoreUnauthenticatedSite { static readonly REQUEST_QUEUE_FORCE_WS = false; // Use "tool_mobile_call_external_functions" even for calling a single function. @@ -161,8 +150,9 @@ export class CoreSite { public config?: CoreSiteConfig, public loggedOut?: boolean, ) { + super(siteUrl); + this.logger = CoreLogger.getInstance('CoreSite'); - this.siteUrl = CoreUrlUtils.removeUrlParams(this.siteUrl); // Make sure the URL doesn't have params. this.cacheTable = asyncInstance(() => CoreSites.getSiteTable(WS_CACHE_TABLE, { siteId: this.getId(), @@ -212,15 +202,6 @@ export class CoreSite { return this.id; } - /** - * Get site URL. - * - * @returns Site URL. - */ - getURL(): string { - return this.siteUrl; - } - /** * Get site token. * @@ -236,9 +217,7 @@ export class CoreSite { } /** - * Get site info. - * - * @returns Site info. + * @inheritdoc */ getInfo(): CoreSiteInfo | undefined { return this.infos; @@ -290,32 +269,6 @@ export class CoreSite { return this.infos?.siteid || 1; } - /** - * Get site name. - * - * @returns Site name. - */ - async getSiteName(): Promise { - if (this.isDemoModeSite()) { - return CoreConstants.CONFIG.appname; - } - - if (this.infos?.sitename) { - return this.infos?.sitename; - } - - // Fallback. - const isSingleFixedSite = await CoreLoginHelper.isSingleFixedSite(); - - if (isSingleFixedSite) { - const sites = await CoreLoginHelper.getAvailableSites(); - - return sites[0].name; - } - - return ''; - } - /** * Set site ID. * @@ -1623,47 +1576,11 @@ export class CoreSite { } /** - * Returns a url to link an specific page on the site. - * - * @param path Path of the url to go to. - * @param params Object with the params to add. - * @param anchor Anchor text if needed. - * @returns URL with params. - */ - createSiteUrl(path: string, params?: Record, anchor?: string): string { - return CoreUrlUtils.addParamsToUrl(CorePath.concatenatePaths(this.siteUrl, path), params, anchor); - } - - /** - * Check if a URL belongs to this site. - * - * @param url URL to check. - * @returns Whether the URL belongs to this site. - */ - containsUrl(url?: string): boolean { - if (!url) { - return false; - } - - const siteUrl = CoreTextUtils.addEndingSlash(CoreUrlUtils.removeProtocolAndWWW(this.siteUrl)); - url = CoreTextUtils.addEndingSlash(CoreUrlUtils.removeProtocolAndWWW(url)); - - return url.indexOf(siteUrl) == 0; - } - - /** - * Get the public config of this site. - * - * @param options Options. - * @returns Promise resolved with public config. Rejected with an object if error, see CoreWSProvider.callAjax. + * @inheritdoc */ async getPublicConfig(options: { readingStrategy?: CoreSitesReadingStrategy } = {}): Promise { if (!this.db) { - if (options.readingStrategy === CoreSitesReadingStrategy.ONLY_CACHE) { - throw new CoreError('Cache not available to read public config'); - } - - return this.requestPublicConfig(); + return super.getPublicConfig(options); } const method = 'tool_mobile_get_public_config'; @@ -1754,47 +1671,12 @@ export class CoreSite { } /** - * Perform a request to the server to get the public config of this site. + * Check if GET method is supported for AJAX calls. * - * @returns Promise resolved with public config. + * @returns Whether it's supported. */ - protected async requestPublicConfig(): Promise { - const preSets: CoreWSAjaxPreSets = { - siteUrl: this.siteUrl, - }; - - let config: CoreSitePublicConfigResponse; - - try { - config = await CoreWS.callAjax('tool_mobile_get_public_config', {}, preSets); - } catch (error) { - if (!error || error.errorcode !== 'codingerror' || (this.getInfo() && !this.isVersionGreaterEqualThan('3.8'))) { - throw error; - } - - // This error probably means that there is a redirect in the site. Try to use a GET request. - preSets.noLogin = true; - preSets.useGet = true; - - try { - config = await CoreWS.callAjax('tool_mobile_get_public_config', {}, preSets); - } catch (error2) { - if (this.getInfo() && this.isVersionGreaterEqualThan('3.8')) { - // GET is supported, return the second error. - throw error2; - } else { - // GET not supported or we don't know if it's supported. Return first error. - throw error; - } - } - } - - // Use the wwwroot returned by the server. - if (config.httpswwwroot) { - this.siteUrl = CoreUrlUtils.removeUrlParams(config.httpswwwroot); // Make sure the URL doesn't have params. - } - - return config; + protected isAjaxGetSupported(): boolean { + return !!this.getInfo() && this.isVersionGreaterEqualThan('3.8'); } /** @@ -2325,35 +2207,6 @@ export class CoreSite { return this.tokenPluginFileWorksPromise; } - /** - * Check if a URL to a file belongs to the site and uses the pluginfileurl or tokenpluginfileurl endpoints. - * - * @param url File URL to check. - * @returns Whether it's a site file URL. - */ - isSitePluginFileUrl(url: string): boolean { - const isPluginFileUrl = CoreUrlUtils.isPluginFileUrl(url) || CoreUrlUtils.isTokenPluginFileUrl(url); - if (!isPluginFileUrl) { - return false; - } - - return this.containsUrl(url); - } - - /** - * Check if a URL to a file belongs to the site and is a theme image file. - * - * @param url File URL to check. - * @returns Whether it's a site theme image URL. - */ - isSiteThemeImageUrl(url: string): boolean { - if (!CoreUrlUtils.isThemeImageUrl(url)) { - return false; - } - - return this.containsUrl(url); - } - /** * Deletes last viewed records based on some conditions. * @@ -2431,17 +2284,6 @@ export class CoreSite { }); } - /** - * Check if the site is a demo mode site. - * - * @returns Whether the site is a demo mode site. - */ - isDemoModeSite(): boolean { - const demoSiteData = CoreLoginHelper.getDemoModeSiteInfo(); - - return this.containsUrl(demoSiteData?.url); - } - } /** @@ -2647,65 +2489,6 @@ type RequestQueueItem = { deferred: CorePromisedValue; }; -/** - * Result of WS core_webservice_get_site_info. - */ -export type CoreSiteInfoResponse = { - sitename: string; // Site name. - username: string; // Username. - firstname: string; // First name. - lastname: string; // Last name. - fullname: string; // User full name. - lang: string; // Current language. - userid: number; // User id. - siteurl: string; // Site url. - userpictureurl: string; // The user profile picture. - functions: { - name: string; // Function name. - version: string; // The version number of the component to which the function belongs. - }[]; - downloadfiles?: number; // 1 if users are allowed to download files, 0 if not. - uploadfiles?: number; // 1 if users are allowed to upload files, 0 if not. - release?: string; // Moodle release number. - version?: string; // Moodle version number. - mobilecssurl?: string; // Mobile custom CSS theme. - advancedfeatures?: { // Advanced features availability. - name: string; // Feature name. - value: number; // Feature value. Usually 1 means enabled. - }[]; - usercanmanageownfiles?: boolean; // True if the user can manage his own files. - userquota?: number; // User quota (bytes). 0 means user can ignore the quota. - usermaxuploadfilesize?: number; // User max upload file size (bytes). -1 means the user can ignore the upload file size. - userhomepage?: CoreSiteInfoUserHomepage; // The default home page for the user. - userprivateaccesskey?: string; // Private user access key for fetching files. - siteid?: number; // Site course ID. - sitecalendartype?: string; // Calendar type set in the site. - usercalendartype?: string; // Calendar typed used by the user. - userissiteadmin?: boolean; // Whether the user is a site admin or not. - theme?: string; // Current theme for the user. -}; - -/** - * Site info, including some calculated data. - */ -export type CoreSiteInfo = CoreSiteInfoResponse & { - functionsByName?: { - [name: string]: { - name: string; // Function name. - version: string; // The version number of the component to which the function belongs. - }; - }; -}; - -/** - * Enum constants that define default user home page. - */ -export enum CoreSiteInfoUserHomepage { - HOMEPAGE_SITE = 0, // Site home. - HOMEPAGE_MY = 1, // Dashboard. - HOMEPAGE_MYCOURSES = 3, // My courses. -} - /** * Result of WS tool_mobile_get_config. */ @@ -2717,15 +2500,6 @@ export type CoreSiteConfigResponse = { warnings?: CoreWSExternalWarning[]; }; -/** - * Possible values for 'supportavailability' config. - */ -export const enum CoreSiteConfigSupportAvailability { - Disabled = 0, - Authenticated = 1, - Anyone = 2, -} - /** * Site config indexed by name. */ @@ -2735,64 +2509,6 @@ export type CoreSiteConfig = Record & { searchbannerenable?: string; // Whether search banner is enabled. }; -/** - * Result of WS tool_mobile_get_public_config. - */ -export type CoreSitePublicConfigResponse = { - wwwroot: string; // Site URL. - httpswwwroot: string; // Site https URL (if httpslogin is enabled). - sitename: string; // Site name. - guestlogin: number; // Whether guest login is enabled. - rememberusername: number; // Values: 0 for No, 1 for Yes, 2 for optional. - authloginviaemail: number; // Whether log in via email is enabled. - registerauth: string; // Authentication method for user registration. - forgottenpasswordurl: string; // Forgotten password URL. - authinstructions: string; // Authentication instructions. - authnoneenabled: number; // Whether auth none is enabled. - enablewebservices: number; // Whether Web Services are enabled. - enablemobilewebservice: number; // Whether the Mobile service is enabled. - maintenanceenabled: number; // Whether site maintenance is enabled. - maintenancemessage: string; // Maintenance message. - logourl?: string; // The site logo URL. - compactlogourl?: string; // The site compact logo URL. - typeoflogin: TypeOfLogin; // The type of login. 1 for app, 2 for browser, 3 for embedded. - launchurl?: string; // SSO login launch URL. - mobilecssurl?: string; // Mobile custom CSS theme. - // eslint-disable-next-line @typescript-eslint/naming-convention - tool_mobile_disabledfeatures?: string; // Disabled features in the app. - identityproviders?: CoreSiteIdentityProvider[]; // Identity providers. - country?: string; // Default site country. - agedigitalconsentverification?: boolean; // Whether age digital consent verification is enabled. - supportname?: string; // Site support contact name (only if age verification is enabled). - supportemail?: string; // Site support contact email (only if age verification is enabled). - supportavailability?: CoreSiteConfigSupportAvailability; - supportpage?: string; // Site support contact url. - autolang?: number; // Whether to detect default language from browser setting. - lang?: string; // Default language for the site. - langmenu?: number; // Whether the language menu should be displayed. - langlist?: string; // Languages on language menu. - locale?: string; // Sitewide locale. - // eslint-disable-next-line @typescript-eslint/naming-convention - tool_mobile_minimumversion?: string; // Minimum required version to access. - // eslint-disable-next-line @typescript-eslint/naming-convention - tool_mobile_iosappid?: string; // IOS app's unique identifier. - // eslint-disable-next-line @typescript-eslint/naming-convention - tool_mobile_androidappid?: string; // Android app's unique identifier. - // eslint-disable-next-line @typescript-eslint/naming-convention - tool_mobile_setuplink?: string; // App download page. - tool_mobile_qrcodetype?: CoreSiteQRCodeType; // eslint-disable-line @typescript-eslint/naming-convention - warnings?: CoreWSExternalWarning[]; -}; - -/** - * Identity provider. - */ -export type CoreSiteIdentityProvider = { - name: string; // The identity provider name. - iconurl: string; // The icon URL for the provider. - url: string; // The URL of the provider. -}; - /** * Result of WS tool_mobile_get_autologin_key. */ @@ -2853,12 +2569,3 @@ enum OngoingRequestType { STANDARD = 0, UPDATE_IN_BACKGROUND = 1, } - -/** - * The type of login. 1 for app, 2 for browser, 3 for embedded. - */ -export enum TypeOfLogin { - APP = 1, - BROWSER = 2, // SSO in browser window is required. - EMBEDDED = 3, // SSO in embedded browser is required. -} diff --git a/src/core/classes/sites/unauthenticated-site.ts b/src/core/classes/sites/unauthenticated-site.ts new file mode 100644 index 00000000000..0cc01352434 --- /dev/null +++ b/src/core/classes/sites/unauthenticated-site.ts @@ -0,0 +1,409 @@ +// (C) Copyright 2015 Moodle Pty Ltd. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +import { CoreConstants } from '@/core/constants'; +import { CoreError } from '@classes/errors/error'; +import { CoreLoginHelper } from '@features/login/services/login-helper'; +import { CoreSitesReadingStrategy } from '@services/sites'; +import { CoreTextUtils } from '@services/utils/text'; +import { CoreUrlUtils } from '@services/utils/url'; +import { CoreWS, CoreWSAjaxPreSets, CoreWSExternalWarning } from '@services/ws'; +import { CorePath } from '@singletons/path'; + +/** + * Class that represents a Moodle site where the user still hasn't authenticated. + */ +export class CoreUnauthenticatedSite { + + siteUrl: string; + + /** + * Create a site. + * + * @param siteUrl Site URL. + */ + constructor(siteUrl: string) { + this.siteUrl = CoreUrlUtils.removeUrlParams(siteUrl); // Make sure the URL doesn't have params. + } + + /** + * Get site URL. + * + * @returns Site URL. + */ + getURL(): string { + return this.siteUrl; + } + + /** + * Set site URL. + * + * @param url Site URL. + */ + setURL(url: string): void { + this.siteUrl = url; + } + + /** + * Get site info. + * + * @returns Site info. + */ + getInfo(): CoreSiteInfo | undefined { + // Cannot retrieve info for unauthenticated sites. + return undefined; + } + + /** + * Get site name. + * + * @returns Site name. + */ + async getSiteName(): Promise { + if (this.isDemoModeSite()) { + return CoreConstants.CONFIG.appname; + } + + const siteName = this.getInfo()?.sitename; + if (siteName) { + return siteName; + } + + // Fallback. + const isSingleFixedSite = await CoreLoginHelper.isSingleFixedSite(); + + if (isSingleFixedSite) { + const sites = await CoreLoginHelper.getAvailableSites(); + + return sites[0].name; + } + + return ''; + } + + /** + * Check whether the app should use the local logo instead of the remote one. + * + * @returns Whether local logo is forced. + */ + forcesLocalLogo(): boolean { + return CoreConstants.CONFIG.forceLoginLogo || this.isDemoModeSite(); + } + + /** + * Get logo URL from a site public config. + * + * @param config Site public config. + * @returns Logo URL. + */ + getLogoUrl(config?: CoreSitePublicConfigResponse): string | undefined { + if (!config || this.forcesLocalLogo()) { + return 'assets/img/login_logo.png'; + } + + return config.logourl || config.compactlogourl || 'assets/img/login_logo.png'; + } + + /** + * Returns a url to link an specific page on the site. + * + * @param path Path of the url to go to. + * @param params Object with the params to add. + * @param anchor Anchor text if needed. + * @returns URL with params. + */ + createSiteUrl(path: string, params?: Record, anchor?: string): string { + return CoreUrlUtils.addParamsToUrl(CorePath.concatenatePaths(this.siteUrl, path), params, anchor); + } + + /** + * Check if a URL belongs to this site. + * + * @param url URL to check. + * @returns Whether the URL belongs to this site. + */ + containsUrl(url?: string): boolean { + if (!url) { + return false; + } + + const siteUrl = CoreTextUtils.addEndingSlash(CoreUrlUtils.removeProtocolAndWWW(this.siteUrl)); + url = CoreTextUtils.addEndingSlash(CoreUrlUtils.removeProtocolAndWWW(url)); + + return url.indexOf(siteUrl) == 0; + } + + /** + * Get the public config of this site. + * + * @param options Options. + * @returns Promise resolved with public config. Rejected with an object if error, see CoreWSProvider.callAjax. + */ + async getPublicConfig(options: { readingStrategy?: CoreSitesReadingStrategy } = {}): Promise { + if (options.readingStrategy === CoreSitesReadingStrategy.ONLY_CACHE) { + throw new CoreError('Cache not available to read public config'); + } + + return this.requestPublicConfig(); + } + + /** + * Perform a request to the server to get the public config of this site. + * + * @returns Promise resolved with public config. + */ + protected async requestPublicConfig(): Promise { + const preSets: CoreWSAjaxPreSets = { + siteUrl: this.siteUrl, + }; + + let config: CoreSitePublicConfigResponse; + + try { + config = await CoreWS.callAjax('tool_mobile_get_public_config', {}, preSets); + } catch (error) { + if (!error || error.errorcode !== 'codingerror' || (this.getInfo() && !this.isAjaxGetSupported())) { + throw error; + } + + // This error probably means that there is a redirect in the site. Try to use a GET request. + preSets.noLogin = true; + preSets.useGet = true; + + try { + config = await CoreWS.callAjax('tool_mobile_get_public_config', {}, preSets); + } catch (error2) { + if (this.isAjaxGetSupported()) { + // GET is supported, return the second error. + throw error2; + } else { + // GET not supported or we don't know if it's supported. Return first error. + throw error; + } + } + } + + // Use the wwwroot returned by the server. + if (config.httpswwwroot) { + this.siteUrl = CoreUrlUtils.removeUrlParams(config.httpswwwroot); // Make sure the URL doesn't have params. + } + + return config; + } + + /** + * Check if GET method is supported for AJAX calls. + * + * @returns Whether it's supported. + * @since Moodle 3.8 + */ + protected isAjaxGetSupported(): boolean { + // We don't know if it's supported, assume it's not. + return false; + } + + /** + * Check if a URL to a file belongs to the site and uses the pluginfileurl or tokenpluginfileurl endpoints. + * + * @param url File URL to check. + * @returns Whether it's a site file URL. + */ + isSitePluginFileUrl(url: string): boolean { + const isPluginFileUrl = CoreUrlUtils.isPluginFileUrl(url) || CoreUrlUtils.isTokenPluginFileUrl(url); + if (!isPluginFileUrl) { + return false; + } + + return this.containsUrl(url); + } + + /** + * Check if a URL to a file belongs to the site and is a theme image file. + * + * @param url File URL to check. + * @returns Whether it's a site theme image URL. + */ + isSiteThemeImageUrl(url: string): boolean { + if (!CoreUrlUtils.isThemeImageUrl(url)) { + return false; + } + + return this.containsUrl(url); + } + + /** + * Check if the site is a demo mode site. + * + * @returns Whether the site is a demo mode site. + */ + isDemoModeSite(): boolean { + const demoSiteData = CoreLoginHelper.getDemoModeSiteInfo(); + + return this.containsUrl(demoSiteData?.url); + } + + /** + * Check whether informative links should be displayed for this site. + * + * @returns Whether informative links should be displayed. + */ + shouldDisplayInformativeLinks(): boolean { + return !CoreConstants.CONFIG.hideInformativeLinks && !this.isDemoModeSite(); + } + +} + +/** + * Result of WS core_webservice_get_site_info. + */ +export type CoreSiteInfoResponse = { + sitename: string; // Site name. + username: string; // Username. + firstname: string; // First name. + lastname: string; // Last name. + fullname: string; // User full name. + lang: string; // Current language. + userid: number; // User id. + siteurl: string; // Site url. + userpictureurl: string; // The user profile picture. + functions: { + name: string; // Function name. + version: string; // The version number of the component to which the function belongs. + }[]; + downloadfiles?: number; // 1 if users are allowed to download files, 0 if not. + uploadfiles?: number; // 1 if users are allowed to upload files, 0 if not. + release?: string; // Moodle release number. + version?: string; // Moodle version number. + mobilecssurl?: string; // Mobile custom CSS theme. + advancedfeatures?: { // Advanced features availability. + name: string; // Feature name. + value: number; // Feature value. Usually 1 means enabled. + }[]; + usercanmanageownfiles?: boolean; // True if the user can manage his own files. + userquota?: number; // User quota (bytes). 0 means user can ignore the quota. + usermaxuploadfilesize?: number; // User max upload file size (bytes). -1 means the user can ignore the upload file size. + userhomepage?: CoreSiteInfoUserHomepage; // The default home page for the user. + userprivateaccesskey?: string; // Private user access key for fetching files. + siteid?: number; // Site course ID. + sitecalendartype?: string; // Calendar type set in the site. + usercalendartype?: string; // Calendar typed used by the user. + userissiteadmin?: boolean; // Whether the user is a site admin or not. + theme?: string; // Current theme for the user. +}; + +/** + * Site info, including some calculated data. + */ +export type CoreSiteInfo = CoreSiteInfoResponse & { + functionsByName?: { + [name: string]: { + name: string; // Function name. + version: string; // The version number of the component to which the function belongs. + }; + }; +}; + +/** + * Enum constants that define default user home page. + */ +export enum CoreSiteInfoUserHomepage { + HOMEPAGE_SITE = 0, // Site home. + HOMEPAGE_MY = 1, // Dashboard. + HOMEPAGE_MYCOURSES = 3, // My courses. +} + +/** + * Possible values for 'supportavailability' config. + */ +export const enum CoreSiteConfigSupportAvailability { + Disabled = 0, + Authenticated = 1, + Anyone = 2, +} + +/** + * Result of WS tool_mobile_get_public_config. + */ +export type CoreSitePublicConfigResponse = { + wwwroot: string; // Site URL. + httpswwwroot: string; // Site https URL (if httpslogin is enabled). + sitename: string; // Site name. + guestlogin: number; // Whether guest login is enabled. + rememberusername: number; // Values: 0 for No, 1 for Yes, 2 for optional. + authloginviaemail: number; // Whether log in via email is enabled. + registerauth: string; // Authentication method for user registration. + forgottenpasswordurl: string; // Forgotten password URL. + authinstructions: string; // Authentication instructions. + authnoneenabled: number; // Whether auth none is enabled. + enablewebservices: number; // Whether Web Services are enabled. + enablemobilewebservice: number; // Whether the Mobile service is enabled. + maintenanceenabled: number; // Whether site maintenance is enabled. + maintenancemessage: string; // Maintenance message. + logourl?: string; // The site logo URL. + compactlogourl?: string; // The site compact logo URL. + typeoflogin: TypeOfLogin; // The type of login. 1 for app, 2 for browser, 3 for embedded. + launchurl?: string; // SSO login launch URL. + mobilecssurl?: string; // Mobile custom CSS theme. + // eslint-disable-next-line @typescript-eslint/naming-convention + tool_mobile_disabledfeatures?: string; // Disabled features in the app. + identityproviders?: CoreSiteIdentityProvider[]; // Identity providers. + country?: string; // Default site country. + agedigitalconsentverification?: boolean; // Whether age digital consent verification is enabled. + supportname?: string; // Site support contact name (only if age verification is enabled). + supportemail?: string; // Site support contact email (only if age verification is enabled). + supportavailability?: CoreSiteConfigSupportAvailability; + supportpage?: string; // Site support contact url. + autolang?: number; // Whether to detect default language from browser setting. + lang?: string; // Default language for the site. + langmenu?: number; // Whether the language menu should be displayed. + langlist?: string; // Languages on language menu. + locale?: string; // Sitewide locale. + // eslint-disable-next-line @typescript-eslint/naming-convention + tool_mobile_minimumversion?: string; // Minimum required version to access. + // eslint-disable-next-line @typescript-eslint/naming-convention + tool_mobile_iosappid?: string; // IOS app's unique identifier. + // eslint-disable-next-line @typescript-eslint/naming-convention + tool_mobile_androidappid?: string; // Android app's unique identifier. + // eslint-disable-next-line @typescript-eslint/naming-convention + tool_mobile_setuplink?: string; // App download page. + tool_mobile_qrcodetype?: CoreSiteQRCodeType; // eslint-disable-line @typescript-eslint/naming-convention + warnings?: CoreWSExternalWarning[]; +}; + +/** + * QR Code type enumeration. + */ +export enum CoreSiteQRCodeType { + QR_CODE_DISABLED = 0, // QR code disabled value + QR_CODE_URL = 1, // QR code type URL value + QR_CODE_LOGIN = 2, // QR code type login value +} + +/** + * Identity provider. + */ +export type CoreSiteIdentityProvider = { + name: string; // The identity provider name. + iconurl: string; // The icon URL for the provider. + url: string; // The URL of the provider. +}; + +/** + * The type of login. 1 for app, 2 for browser, 3 for embedded. + */ +export enum TypeOfLogin { + APP = 1, + BROWSER = 2, // SSO in browser window is required. + EMBEDDED = 3, // SSO in embedded browser is required. +} diff --git a/src/core/components/sites-list/sites-list.ts b/src/core/components/sites-list/sites-list.ts index b92dd59cab7..812cade37dc 100644 --- a/src/core/components/sites-list/sites-list.ts +++ b/src/core/components/sites-list/sites-list.ts @@ -14,8 +14,9 @@ import { Component, ContentChild, Input, Output, TemplateRef, EventEmitter } from '@angular/core'; -import { CoreSiteBasicInfo, CoreSites } from '@services/sites'; +import { CoreSiteBasicInfo } from '@services/sites'; import { CoreAccountsList } from '@features/login/services/login-helper'; +import { CoreSitesFactory } from '@services/sites-factory'; /** * Component to display a list of sites (accounts). @@ -84,7 +85,7 @@ export class CoreSitesListComponent { * @returns Whether to display URL. */ displaySiteUrl(site: CoreSiteBasicInfo): boolean { - return CoreSites.shouldDisplayInformativeLinks(site.siteUrl); + return CoreSitesFactory.makeSite(site.id, site.siteUrl, '', { info: site.info }).shouldDisplayInformativeLinks(); } } diff --git a/src/core/components/user-avatar/user-avatar.ts b/src/core/components/user-avatar/user-avatar.ts index 6c3e137e5d2..6b8778014b6 100644 --- a/src/core/components/user-avatar/user-avatar.ts +++ b/src/core/components/user-avatar/user-avatar.ts @@ -22,7 +22,7 @@ import { CoreNavigator } from '@services/navigator'; import { CoreNetwork } from '@services/network'; import { CoreUserHelper } from '@features/user/services/user-helper'; import { CoreUrlUtils } from '@services/utils/url'; -import { CoreSiteInfo } from '@classes/site'; +import { CoreSiteInfo } from '@classes/sites/unauthenticated-site'; /** * Component to display a "user avatar". diff --git a/src/core/features/contentlinks/components/choose-site-modal/choose-site-modal.ts b/src/core/features/contentlinks/components/choose-site-modal/choose-site-modal.ts index 1bcbe6325f1..193b1996b4b 100644 --- a/src/core/features/contentlinks/components/choose-site-modal/choose-site-modal.ts +++ b/src/core/features/contentlinks/components/choose-site-modal/choose-site-modal.ts @@ -20,6 +20,7 @@ import { CoreContentLinksAction } from '../../services/contentlinks-delegate'; import { CoreContentLinksHelper } from '../../services/contentlinks-helper'; import { CoreError } from '@classes/errors/error'; import { CoreNavigator } from '@services/navigator'; +import { CoreSitesFactory } from '@services/sites-factory'; /** * Page to display the list of sites to choose one to perform a content link action. @@ -73,7 +74,7 @@ export class CoreContentLinksChooseSiteModalComponent implements OnInit { this.sites = await CoreSites.getSites(siteIds); // All sites have the same URL, use the first one. - this.displaySiteUrl = CoreSites.shouldDisplayInformativeLinks(this.sites[0].siteUrl); + this.displaySiteUrl = CoreSitesFactory.makeUnauthenticatedSite(this.sites[0].siteUrl).shouldDisplayInformativeLinks(); } catch (error) { CoreDomUtils.showErrorModalDefault(error, 'core.contentlinks.errornosites', true); this.closeModal(); diff --git a/src/core/features/course/components/module-summary/module-summary.ts b/src/core/features/course/components/module-summary/module-summary.ts index 8500ecd47b3..8c908987ed9 100644 --- a/src/core/features/course/components/module-summary/module-summary.ts +++ b/src/core/features/course/components/module-summary/module-summary.ts @@ -101,7 +101,7 @@ export class CoreCourseModuleSummaryComponent implements OnInit, OnDestroy { } this.displayOptions = Object.assign({ - displayOpenInBrowser: CoreSites.shouldDisplayInformativeLinks(), + displayOpenInBrowser: !!CoreSites.getCurrentSite()?.shouldDisplayInformativeLinks(), displayDescription: true, displayRefresh: true, displayPrefetch: true, diff --git a/src/core/features/course/pages/course-summary/course-summary.page.ts b/src/core/features/course/pages/course-summary/course-summary.page.ts index 73512e8224e..c1943250dae 100644 --- a/src/core/features/course/pages/course-summary/course-summary.page.ts +++ b/src/core/features/course/pages/course-summary/course-summary.page.ts @@ -138,7 +138,7 @@ export class CoreCourseSummaryPage implements OnInit, OnDestroy { const currentSiteUrl = CoreSites.getRequiredCurrentSite().getURL(); this.enrolUrl = CorePath.concatenatePaths(currentSiteUrl, 'enrol/index.php?id=' + this.courseId); this.courseUrl = CorePath.concatenatePaths(currentSiteUrl, 'course/view.php?id=' + this.courseId); - this.displayOpenInBrowser = CoreSites.shouldDisplayInformativeLinks(); + this.displayOpenInBrowser = CoreSites.getRequiredCurrentSite().shouldDisplayInformativeLinks(); await this.getCourse(); } diff --git a/src/core/features/course/pages/module-preview/module-preview.ts b/src/core/features/course/pages/module-preview/module-preview.ts index c5192b9d6b3..bbaf90c66a7 100644 --- a/src/core/features/course/pages/module-preview/module-preview.ts +++ b/src/core/features/course/pages/module-preview/module-preview.ts @@ -63,7 +63,7 @@ export class CoreCourseModulePreviewPage implements OnInit { return; } - this.displayOpenInBrowser = CoreSites.shouldDisplayInformativeLinks(); + this.displayOpenInBrowser = !!CoreSites.getCurrentSite()?.shouldDisplayInformativeLinks(); this.debouncedUpdateModule = CoreUtils.debounce(() => { this.doRefresh(); }, 10000); diff --git a/src/core/features/courses/services/handlers/my-courses-mainmenu.ts b/src/core/features/courses/services/handlers/my-courses-mainmenu.ts index b962bfb2566..110d8f1e70a 100644 --- a/src/core/features/courses/services/handlers/my-courses-mainmenu.ts +++ b/src/core/features/courses/services/handlers/my-courses-mainmenu.ts @@ -13,7 +13,7 @@ // limitations under the License. import { Injectable } from '@angular/core'; -import { CoreSiteInfoUserHomepage } from '@classes/sites/site'; +import { CoreSiteInfoUserHomepage } from '@classes/sites/unauthenticated-site'; import { CoreMainMenuHandler, CoreMainMenuHandlerData } from '@features/mainmenu/services/mainmenu-delegate'; import { CoreSiteHomeHomeHandler } from '@features/sitehome/services/handlers/sitehome-home'; import { CoreSites } from '@services/sites'; diff --git a/src/core/features/login/components/login-methods/login-methods.ts b/src/core/features/login/components/login-methods/login-methods.ts index 1e3b4d400be..f3366b29648 100644 --- a/src/core/features/login/components/login-methods/login-methods.ts +++ b/src/core/features/login/components/login-methods/login-methods.ts @@ -13,7 +13,7 @@ // limitations under the License. import { Component, Input, OnInit } from '@angular/core'; -import { CoreSiteIdentityProvider, CoreSitePublicConfigResponse } from '@classes/sites/site'; +import { CoreSiteIdentityProvider, CoreSitePublicConfigResponse } from '@classes/sites/unauthenticated-site'; import { CoreLoginHelper, CoreLoginMethod } from '@features/login/services/login-helper'; import { CoreRedirectPayload } from '@services/navigator'; import { CoreSites } from '@services/sites'; diff --git a/src/core/features/login/pages/credentials/credentials.html b/src/core/features/login/pages/credentials/credentials.html index 300cb545fb1..f5f3b5db713 100644 --- a/src/core/features/login/pages/credentials/credentials.html +++ b/src/core/features/login/pages/credentials/credentials.html @@ -20,19 +20,17 @@

{{ 'core.login.login' | translate }}

- +