From 55b8a74d888485dc57eb8c38c1e2738fdfbbf28b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pau=20Ferrer=20Oca=C3=B1a?= Date: Tue, 16 Jul 2024 16:20:33 +0200 Subject: [PATCH 1/6] MOBILE-4616 chore: Make deprecated components standalone --- src/core/components/components.module.ts | 5 ----- src/core/components/style/style.ts | 7 ++++++- .../features/course/components/components.module.ts | 10 ---------- .../module-description/module-description.ts | 5 +++++ .../module-manual-completion.ts | 5 +++++ 5 files changed, 16 insertions(+), 16 deletions(-) diff --git a/src/core/components/components.module.ts b/src/core/components/components.module.ts index 23b32cf00..dcc352b09 100644 --- a/src/core/components/components.module.ts +++ b/src/core/components/components.module.ts @@ -48,7 +48,6 @@ import { CoreSendMessageFormComponent } from './send-message-form/send-message-f import { CoreShowPasswordComponent } from './show-password/show-password'; import { CoreSitePickerComponent } from './site-picker/site-picker'; import { CoreSplitViewComponent } from './split-view/split-view'; -import { CoreStyleComponent } from './style/style'; import { CoreTabComponent } from './tabs/tab'; import { CoreTabsComponent } from './tabs/tabs'; import { CoreTabsOutletComponent } from './tabs-outlet/tabs-outlet'; @@ -100,8 +99,6 @@ import { CoreSitesListComponent } from './sites-list/sites-list'; CoreShowPasswordComponent, // eslint-disable-line deprecation/deprecation CoreSitePickerComponent, CoreSplitViewComponent, - // eslint-disable-next-line deprecation/deprecation - CoreStyleComponent, CoreSwipeSlidesComponent, CoreTabComponent, CoreTabsComponent, @@ -156,8 +153,6 @@ import { CoreSitesListComponent } from './sites-list/sites-list'; CoreShowPasswordComponent, // eslint-disable-line deprecation/deprecation CoreSitePickerComponent, CoreSplitViewComponent, - // eslint-disable-next-line deprecation/deprecation - CoreStyleComponent, CoreSwipeSlidesComponent, CoreTabComponent, CoreTabsComponent, diff --git a/src/core/components/style/style.ts b/src/core/components/style/style.ts index f06a1450f..b49ab3cea 100644 --- a/src/core/components/style/style.ts +++ b/src/core/components/style/style.ts @@ -12,6 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. +import { CoreSharedModule } from '@/core/shared.module'; import { Component, ElementRef, Input, OnChanges } from '@angular/core'; import { CoreDom } from '@singletons/dom'; @@ -24,11 +25,15 @@ import { CoreDom } from '@singletons/dom'; * Example: * * - * @deprecated since 4.5.0. Not needed anymore, core-compile-html accepts now CSS code. + * @deprecated since 4.5. Not needed anymore, core-compile-html accepts now CSS code. */ @Component({ selector: 'core-style', template: '', + standalone: true, + imports: [ + CoreSharedModule, + ], }) export class CoreStyleComponent implements OnChanges { diff --git a/src/core/features/course/components/components.module.ts b/src/core/features/course/components/components.module.ts index b94aeef38..a9d757fa5 100644 --- a/src/core/features/course/components/components.module.ts +++ b/src/core/features/course/components/components.module.ts @@ -19,13 +19,11 @@ import { CoreBlockComponentsModule } from '@features/block/components/components import { CoreCourseFormatComponent } from './course-format/course-format'; import { CoreCourseModuleComponent } from './module/module'; import { CoreCourseModuleCompletionComponent } from './module-completion/module-completion'; -import { CoreCourseModuleDescriptionComponent } from './module-description/module-description'; import { CoreCourseCourseIndexComponent } from './course-index/course-index'; import { CoreCourseTagAreaComponent } from './tag-area/tag-area'; import { CoreCourseUnsupportedModuleComponent } from './unsupported-module/unsupported-module'; import { CoreCourseModuleCompletionLegacyComponent } from './module-completion-legacy/module-completion-legacy'; import { CoreCourseModuleInfoComponent } from './module-info/module-info'; -import { CoreCourseModuleManualCompletionComponent } from './module-manual-completion/module-manual-completion'; import { CoreCourseModuleNavigationComponent } from './module-navigation/module-navigation'; import { CoreCourseModuleSummaryComponent } from './module-summary/module-summary'; import { CoreCourseCourseIndexTourComponent } from './course-index-tour/course-index-tour'; @@ -38,11 +36,7 @@ import { CoreCourseModuleCompletionDetailsComponent } from './module-completion- CoreCourseModuleComponent, CoreCourseModuleCompletionComponent, CoreCourseModuleCompletionLegacyComponent, - // eslint-disable-next-line deprecation/deprecation - CoreCourseModuleDescriptionComponent, CoreCourseModuleInfoComponent, - // eslint-disable-next-line deprecation/deprecation - CoreCourseModuleManualCompletionComponent, CoreCourseCourseIndexComponent, CoreCourseCourseIndexTourComponent, CoreCourseTagAreaComponent, @@ -61,11 +55,7 @@ import { CoreCourseModuleCompletionDetailsComponent } from './module-completion- CoreCourseModuleComponent, CoreCourseModuleCompletionComponent, CoreCourseModuleCompletionLegacyComponent, - // eslint-disable-next-line deprecation/deprecation - CoreCourseModuleDescriptionComponent, CoreCourseModuleInfoComponent, - // eslint-disable-next-line deprecation/deprecation - CoreCourseModuleManualCompletionComponent, CoreCourseCourseIndexComponent, CoreCourseCourseIndexTourComponent, CoreCourseTagAreaComponent, diff --git a/src/core/features/course/components/module-description/module-description.ts b/src/core/features/course/components/module-description/module-description.ts index 738e89f9d..f55b42cb8 100644 --- a/src/core/features/course/components/module-description/module-description.ts +++ b/src/core/features/course/components/module-description/module-description.ts @@ -13,6 +13,7 @@ // limitations under the License. import { ContextLevel } from '@/core/constants'; +import { CoreSharedModule } from '@/core/shared.module'; import { Component, HostBinding, Input } from '@angular/core'; /** @@ -37,6 +38,10 @@ import { Component, HostBinding, Input } from '@angular/core'; @Component({ selector: 'core-course-module-description', templateUrl: 'core-course-module-description.html', + standalone: true, + imports: [ + CoreSharedModule, + ], }) export class CoreCourseModuleDescriptionComponent { diff --git a/src/core/features/course/components/module-manual-completion/module-manual-completion.ts b/src/core/features/course/components/module-manual-completion/module-manual-completion.ts index c59624f9a..857ac368a 100644 --- a/src/core/features/course/components/module-manual-completion/module-manual-completion.ts +++ b/src/core/features/course/components/module-manual-completion/module-manual-completion.ts @@ -12,6 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. +import { CoreSharedModule } from '@/core/shared.module'; import { Component, EventEmitter, Input, OnChanges, OnDestroy, OnInit, Output, SimpleChange } from '@angular/core'; import { CoreCourseHelper, CoreCourseModuleCompletionData } from '@features/course/services/course-helper'; import { CoreUser } from '@features/user/services/user'; @@ -26,6 +27,10 @@ import { CoreEventObserver, CoreEvents } from '@singletons/events'; @Component({ selector: 'core-course-module-manual-completion', templateUrl: 'core-course-module-manual-completion.html', + standalone: true, + imports: [ + CoreSharedModule, + ], }) export class CoreCourseModuleManualCompletionComponent implements OnInit, OnChanges, OnDestroy { From d424ba0f600c79fb1b4bd26a284f50bf7e420172 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pau=20Ferrer=20Oca=C3=B1a?= Date: Tue, 16 Jul 2024 16:22:54 +0200 Subject: [PATCH 2/6] MOBILE-4616 test: Fix linting --- .../features/courses/services/handlers/base-link-handler.ts | 5 +++++ .../editor/components/rich-text-editor/rich-text-editor.ts | 2 +- src/core/features/tag/components/components.module.ts | 2 -- src/core/features/user/components/components.module.ts | 2 -- 4 files changed, 6 insertions(+), 5 deletions(-) diff --git a/src/core/features/courses/services/handlers/base-link-handler.ts b/src/core/features/courses/services/handlers/base-link-handler.ts index 80880f4ee..77e082961 100644 --- a/src/core/features/courses/services/handlers/base-link-handler.ts +++ b/src/core/features/courses/services/handlers/base-link-handler.ts @@ -30,6 +30,11 @@ export class CoreCoursesLinksHandlerBase extends CoreContentLinksHandlerBase { /** * Get actions to open course content. + * + * @param url URL to treat. + * @param courseId Course ID. + * @param pageParams Params to send to the new page. + * @returns Promise resolved with the actions. */ protected getCourseActions(url: string, courseId: number, pageParams: Params = {}): CoreContentLinksAction[] { return [{ diff --git a/src/core/features/editor/components/rich-text-editor/rich-text-editor.ts b/src/core/features/editor/components/rich-text-editor/rich-text-editor.ts index c9c122540..44182ac56 100644 --- a/src/core/features/editor/components/rich-text-editor/rich-text-editor.ts +++ b/src/core/features/editor/components/rich-text-editor/rich-text-editor.ts @@ -550,7 +550,7 @@ export class CoreEditorRichTextEditorComponent implements OnInit, AfterViewInit, /** * Check if text is empty. * - * @param value Text or element containing the text. + * @param valueOrEl Text or element containing the text. * @returns If value is null only a white space. */ protected isNullOrWhiteSpace(valueOrEl: string | HTMLElement | null | undefined): boolean { diff --git a/src/core/features/tag/components/components.module.ts b/src/core/features/tag/components/components.module.ts index 2d9f500e9..216e1f1f0 100644 --- a/src/core/features/tag/components/components.module.ts +++ b/src/core/features/tag/components/components.module.ts @@ -26,8 +26,6 @@ import { CoreTagListComponent } from './list/list'; imports: [ CoreSharedModule, ], - providers: [ - ], exports: [ CoreTagFeedComponent, CoreTagListComponent, diff --git a/src/core/features/user/components/components.module.ts b/src/core/features/user/components/components.module.ts index eb21938b2..2f580aa89 100644 --- a/src/core/features/user/components/components.module.ts +++ b/src/core/features/user/components/components.module.ts @@ -26,8 +26,6 @@ import { CoreUserTagAreaComponent } from './tag-area/tag-area'; imports: [ CoreSharedModule, ], - providers: [ - ], exports: [ CoreUserProfileFieldComponent, CoreUserTagAreaComponent, From b394cce7bdee90428f3692b82e8d7f9a39dd043b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pau=20Ferrer=20Oca=C3=B1a?= Date: Fri, 19 Jul 2024 14:38:20 +0200 Subject: [PATCH 3/6] MOBILE-4616 login: Avoid infinite loop --- src/core/features/login/services/login-helper.ts | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/core/features/login/services/login-helper.ts b/src/core/features/login/services/login-helper.ts index 09b6cd7e0..5a9917de1 100644 --- a/src/core/features/login/services/login-helper.ts +++ b/src/core/features/login/services/login-helper.ts @@ -510,8 +510,12 @@ export class CoreLoginHelperProvider { * @deprecated since 4.4. Please use isFeatureDisabled in a site instance. */ isFeatureDisabled(feature: string, config?: CoreSitePublicConfigResponse): boolean { - // eslint-disable-next-line deprecation/deprecation - return this.isFeatureDisabled(feature, config); + // eslint-disable-next-line deprecation/deprecation + const disabledFeatures = this.getDisabledFeatures(config); + + const regEx = new RegExp('(,|^)' + feature + '(,|$)', 'g'); + + return !!disabledFeatures.match(regEx); } /** From da5d2fa2f85acbe144a51a6e19d5d81bff1c7c70 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pau=20Ferrer=20Oca=C3=B1a?= Date: Mon, 22 Jul 2024 14:42:50 +0200 Subject: [PATCH 4/6] MOBILE-4616 compile: Import standalone components and new services --- src/core/components/components.module.ts | 16 +++++- src/core/features/compile/services/compile.ts | 49 ++++++++++--------- src/core/features/course/course.module.ts | 19 +++++++ 3 files changed, 61 insertions(+), 23 deletions(-) diff --git a/src/core/components/components.module.ts b/src/core/components/components.module.ts index dcc352b09..fb73105cf 100644 --- a/src/core/components/components.module.ts +++ b/src/core/components/components.module.ts @@ -12,7 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -import { CUSTOM_ELEMENTS_SCHEMA, NgModule } from '@angular/core'; +import { CUSTOM_ELEMENTS_SCHEMA, NgModule, Type } from '@angular/core'; import { CommonModule } from '@angular/common'; import { IonicModule } from '@ionic/angular'; import { TranslateModule } from '@ngx-translate/core'; @@ -66,6 +66,20 @@ import { CoreSheetModalComponent } from '@components/sheet-modal/sheet-modal'; import { CoreCourseImageComponent } from '@components/course-image/course-image'; import { CoreSitesListComponent } from './sites-list/sites-list'; +/** + * Get standalone components for site plugins. + * + * @returns Returns core standalone components. + */ +export async function getCoreStandaloneComponents(): Promise[]> { + // eslint-disable-next-line deprecation/deprecation + const { CoreStyleComponent } = await import('@components/style/style'); + + return [ + CoreStyleComponent, + ]; +} + @NgModule({ declarations: [ CoreAttachmentsComponent, diff --git a/src/core/features/compile/services/compile.ts b/src/core/features/compile/services/compile.ts index b253c6149..f85f156b8 100644 --- a/src/core/features/compile/services/compile.ts +++ b/src/core/features/compile/services/compile.ts @@ -16,12 +16,10 @@ import { Injectable, Injector, Component, - NgModule, ComponentRef, NO_ERRORS_SCHEMA, Type, Provider, - createNgModule, ViewContainerRef, } from '@angular/core'; import { @@ -43,7 +41,7 @@ import { getCoreServices } from '@/core/core.module'; import { getBlockServices } from '@features/block/block.module'; import { getCommentsServices } from '@features/comments/comments.module'; import { getContentLinksExportedObjects, getContentLinksServices } from '@features/contentlinks/contentlinks.module'; -import { getCourseExportedObjects, getCourseServices } from '@features/course/course.module'; +import { getCourseExportedObjects, getCourseServices, getCourseStandaloneComponents } from '@features/course/course.module'; import { getCoursesServices } from '@features/courses/courses.module'; import { getEditorServices } from '@features/editor/editor.module'; import { getEnrolServices } from '@features/enrol/enrol.module'; @@ -77,9 +75,13 @@ import { Md5 } from 'ts-md5/dist/md5'; // Import core classes that can be useful for site plugins. import { CoreSyncBaseProvider } from '@classes/base-sync'; import { CoreArray } from '@singletons/array'; +import { CoreColors } from '@singletons/colors'; import { CoreDirectivesRegistry } from '@singletons/directives-registry'; import { CoreDom } from '@singletons/dom'; import { CoreForms } from '@singletons/form'; +import { CoreKeyboard } from '@singletons/keyboard'; +import { CoreObject } from '@singletons/object'; +import { CorePath } from '@singletons/path'; import { CoreText } from '@singletons/text'; import { CoreTime } from '@singletons/time'; import { CoreUrl } from '@singletons/url'; @@ -116,6 +118,9 @@ import { getNotesServices } from '@addons/notes/notes.module'; import { getNotificationsServices } from '@addons/notifications/notifications.module'; import { getPrivateFilesServices } from '@addons/privatefiles/privatefiles.module'; +// Import standalone components used by site plugins. +import { getCoreStandaloneComponents } from '@components/components.module'; + // Import some addon modules that define components, directives and pipes. Only import the important ones. import { CorePromisedValue } from '@classes/promised-value'; import { CorePlatform } from '@services/platform'; @@ -157,6 +162,8 @@ export class CoreCompileProvider { getModAssignComponentModules, getModQuizComponentModules, getModWorkshopComponentModules, + getCoreStandaloneComponents, + getCourseStandaloneComponents, ]; protected componentId = 0; @@ -187,13 +194,6 @@ export class CoreCompileProvider { // Import the Angular compiler to be able to compile components in runtime. await import('@angular/compiler'); - // Create the component using the template and the class. - const component = Component({ - template, - host: { 'compiled-component-id': String(this.componentId++) }, - styles, - })(componentClass); - const lazyImports = await Promise.all(this.LAZY_IMPORTS.map(getModules => getModules())); const imports = [ ...lazyImports.flat(), @@ -201,20 +201,21 @@ export class CoreCompileProvider { ...extraImports, ]; + // Create the component using the template and the class. + const component = Component({ + template, + host: { 'compiled-component-id': String(this.componentId++) }, + styles, + standalone: true, + imports, + schemas: [NO_ERRORS_SCHEMA], + })(componentClass); + try { viewContainerRef.clear(); - // Now create the module containing the component. - const ngModuleRef = createNgModule( - NgModule({ imports, declarations: [component], schemas: [NO_ERRORS_SCHEMA] })(class {}), - this.injector, - ); - return viewContainerRef.createComponent( component, - { - environmentInjector: ngModuleRef, - }, ); } catch (error) { this.logger.error('Error compiling template', template); @@ -299,13 +300,17 @@ export class CoreCompileProvider { * Keeping this a bit more to avoid plugins breaking. */ instance['Network'] = CoreNetwork.instance; - instance['CoreSyncBaseProvider'] = CoreSyncBaseProvider; - instance['CoreArray'] = CoreArray; - instance['CoreDirectivesRegistry'] = CoreDirectivesRegistry; instance['CoreNetwork'] = CoreNetwork.instance; instance['CorePlatform'] = CorePlatform.instance; + instance['CoreSyncBaseProvider'] = CoreSyncBaseProvider; + instance['CoreArray'] = CoreArray; + instance['CoreColors'] = CoreColors; + instance['CoreDirectivesRegistry'] = CoreDirectivesRegistry; instance['CoreDom'] = CoreDom; instance['CoreForms'] = CoreForms; + instance['CoreKeyboard'] = CoreKeyboard; + instance['CoreObject'] = CoreObject; + instance['CorePath'] = CorePath; instance['CoreText'] = CoreText; instance['CoreTime'] = CoreTime; instance['CoreUrl'] = CoreUrl; diff --git a/src/core/features/course/course.module.ts b/src/core/features/course/course.module.ts index a3b1a83da..bddcbe8a4 100644 --- a/src/core/features/course/course.module.ts +++ b/src/core/features/course/course.module.ts @@ -87,6 +87,25 @@ export async function getCourseExportedObjects(): Promise[]> { + // eslint-disable-next-line deprecation/deprecation + const { CoreCourseModuleDescriptionComponent } = + await import('@features/course/components/module-description/module-description'); + // eslint-disable-next-line deprecation/deprecation + const { CoreCourseModuleManualCompletionComponent } = + await import('@features/course/components/module-manual-completion/module-manual-completion'); + + return [ + CoreCourseModuleDescriptionComponent, + CoreCourseModuleManualCompletionComponent, + ]; +} + const routes: Routes = [ { matcher: buildRegExpUrlMatcher(new RegExp(`^${COURSE_PAGE_NAME}(/deep)*`)), From beb90472fc5ce20208a86ff4a4d089088fb28dfd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pau=20Ferrer=20Oca=C3=B1a?= Date: Thu, 18 Jul 2024 12:08:08 +0200 Subject: [PATCH 5/6] MOBILE-4616 chore: Migrate to standalone the ones with unused modules --- .../activitymodules/activitymodules.ts | 7 +++- .../components/components.module.ts | 29 ---------------- .../activityresults/activityresults.ts | 7 +++- .../components/components.module.ts | 28 ---------------- .../block/badges/components/badges/badges.ts | 7 +++- .../badges/components/components.module.ts | 28 ---------------- .../blogmenu/components/blogmenu/blogmenu.ts | 7 +++- .../blogmenu/components/components.module.ts | 28 ---------------- .../components/blogrecent/blogrecent.ts | 7 +++- .../components/components.module.ts | 28 ---------------- .../blogtags/components/blogtags/blogtags.ts | 7 +++- .../blogtags/components/components.module.ts | 28 ---------------- .../components/components.module.ts | 30 ----------------- .../components/myoverview/myoverview.ts | 9 ++++- .../newsitems/components/components.module.ts | 28 ---------------- .../components/newsitems/newsitems.ts | 7 +++- .../components/components.module.ts | 28 ---------------- .../components/onlineusers/onlineusers.ts | 7 +++- .../components/components.module.ts | 28 ---------------- .../recentactivity/recentactivity.ts | 7 +++- .../components/components.module.ts | 31 ----------------- .../recentlyaccessedcourses.ts | 7 ++++ .../components/components.module.ts | 31 ----------------- .../recentlyaccesseditems.ts | 7 +++- .../rssclient/components/components.module.ts | 28 ---------------- .../components/rssclient/rssclient.ts | 7 +++- .../components/components.module.ts | 31 ----------------- .../components/sitemainmenu/sitemainmenu.ts | 7 ++++ .../components/components.module.ts | 31 ----------------- .../starredcourses/starredcourses.ts | 7 ++++ .../tags/components/components.module.ts | 28 ---------------- src/addons/block/tags/components/tags/tags.ts | 7 +++- .../timeline/components/components.module.ts | 33 ------------------- .../timeline/components/events/events.ts | 7 +++- .../timeline/components/timeline/timeline.ts | 11 ++++++- 35 files changed, 117 insertions(+), 511 deletions(-) delete mode 100644 src/addons/block/activitymodules/components/components.module.ts delete mode 100644 src/addons/block/activityresults/components/components.module.ts delete mode 100644 src/addons/block/badges/components/components.module.ts delete mode 100644 src/addons/block/blogmenu/components/components.module.ts delete mode 100644 src/addons/block/blogrecent/components/components.module.ts delete mode 100644 src/addons/block/blogtags/components/components.module.ts delete mode 100644 src/addons/block/myoverview/components/components.module.ts delete mode 100644 src/addons/block/newsitems/components/components.module.ts delete mode 100644 src/addons/block/onlineusers/components/components.module.ts delete mode 100644 src/addons/block/recentactivity/components/components.module.ts delete mode 100644 src/addons/block/recentlyaccessedcourses/components/components.module.ts delete mode 100644 src/addons/block/recentlyaccesseditems/components/components.module.ts delete mode 100644 src/addons/block/rssclient/components/components.module.ts delete mode 100644 src/addons/block/sitemainmenu/components/components.module.ts delete mode 100644 src/addons/block/starredcourses/components/components.module.ts delete mode 100644 src/addons/block/tags/components/components.module.ts delete mode 100644 src/addons/block/timeline/components/components.module.ts diff --git a/src/addons/block/activitymodules/components/activitymodules/activitymodules.ts b/src/addons/block/activitymodules/components/activitymodules/activitymodules.ts index 009851c5b..6bd07f093 100644 --- a/src/addons/block/activitymodules/components/activitymodules/activitymodules.ts +++ b/src/addons/block/activitymodules/components/activitymodules/activitymodules.ts @@ -23,6 +23,7 @@ import { CoreUtils } from '@services/utils/utils'; import { CoreNavigator } from '@services/navigator'; import { CoreCourseHelper } from '@features/course/services/course-helper'; import { CoreUrlUtils } from '@services/utils/url'; +import { CoreSharedModule } from '@/core/shared.module'; /** * Component to render an "activity modules" block. @@ -30,7 +31,11 @@ import { CoreUrlUtils } from '@services/utils/url'; @Component({ selector: 'addon-block-activitymodules', templateUrl: 'addon-block-activitymodules.html', - styleUrls: ['activitymodules.scss'], + styleUrl: 'activitymodules.scss', + standalone: true, + imports: [ + CoreSharedModule, + ], }) export class AddonBlockActivityModulesComponent extends CoreBlockBaseComponent implements OnInit { diff --git a/src/addons/block/activitymodules/components/components.module.ts b/src/addons/block/activitymodules/components/components.module.ts deleted file mode 100644 index 5f9ba9269..000000000 --- a/src/addons/block/activitymodules/components/components.module.ts +++ /dev/null @@ -1,29 +0,0 @@ -// (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 { NgModule } from '@angular/core'; - -import { CoreSharedModule } from '@/core/shared.module'; - -import { AddonBlockActivityModulesComponent } from './activitymodules/activitymodules'; - -@NgModule({ - declarations: [ - AddonBlockActivityModulesComponent, - ], - imports: [ - CoreSharedModule, - ], -}) -export class AddonBlockActivityModulesComponentsModule {} diff --git a/src/addons/block/activityresults/components/activityresults/activityresults.ts b/src/addons/block/activityresults/components/activityresults/activityresults.ts index aaa609e3f..47e8f100a 100644 --- a/src/addons/block/activityresults/components/activityresults/activityresults.ts +++ b/src/addons/block/activityresults/components/activityresults/activityresults.ts @@ -12,6 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. +import { CoreSharedModule } from '@/core/shared.module'; import { Component } from '@angular/core'; import { CoreBlockPreRenderedComponent } from '@features/block/components/pre-rendered-block/pre-rendered-block'; @@ -21,6 +22,10 @@ import { CoreBlockPreRenderedComponent } from '@features/block/components/pre-re @Component({ selector: 'addon-block-activity-results', templateUrl: '../../../../../core/features/block/components/pre-rendered-block/core-block-pre-rendered.html', - styleUrls: ['activityresults.scss'], + styleUrl: 'activityresults.scss', + standalone: true, + imports: [ + CoreSharedModule, + ], }) export class AddonBlockActivityResultsComponent extends CoreBlockPreRenderedComponent {} diff --git a/src/addons/block/activityresults/components/components.module.ts b/src/addons/block/activityresults/components/components.module.ts deleted file mode 100644 index d088bd579..000000000 --- a/src/addons/block/activityresults/components/components.module.ts +++ /dev/null @@ -1,28 +0,0 @@ -// (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 { NgModule } from '@angular/core'; - -import { CoreSharedModule } from '@/core/shared.module'; -import { AddonBlockActivityResultsComponent } from './activityresults/activityresults'; - -@NgModule({ - declarations: [ - AddonBlockActivityResultsComponent, - ], - imports: [ - CoreSharedModule, - ], -}) -export class AddonBlockActivityResultsComponentsModule {} diff --git a/src/addons/block/badges/components/badges/badges.ts b/src/addons/block/badges/components/badges/badges.ts index 5f7f64a30..3c6b47eac 100644 --- a/src/addons/block/badges/components/badges/badges.ts +++ b/src/addons/block/badges/components/badges/badges.ts @@ -12,6 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. +import { CoreSharedModule } from '@/core/shared.module'; import { Component } from '@angular/core'; import { CoreBlockPreRenderedComponent } from '@features/block/components/pre-rendered-block/pre-rendered-block'; @@ -21,6 +22,10 @@ import { CoreBlockPreRenderedComponent } from '@features/block/components/pre-re @Component({ selector: 'addon-block-badges', templateUrl: '../../../../../core/features/block/components/pre-rendered-block/core-block-pre-rendered.html', - styleUrls: ['badges.scss'], + styleUrl: 'badges.scss', + standalone: true, + imports: [ + CoreSharedModule, + ], }) export class AddonBlockBadgesComponent extends CoreBlockPreRenderedComponent {} diff --git a/src/addons/block/badges/components/components.module.ts b/src/addons/block/badges/components/components.module.ts deleted file mode 100644 index 0db4364c0..000000000 --- a/src/addons/block/badges/components/components.module.ts +++ /dev/null @@ -1,28 +0,0 @@ -// (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 { NgModule } from '@angular/core'; - -import { CoreSharedModule } from '@/core/shared.module'; -import { AddonBlockBadgesComponent } from './badges/badges'; - -@NgModule({ - declarations: [ - AddonBlockBadgesComponent, - ], - imports: [ - CoreSharedModule, - ], -}) -export class AddonBlockBadgesComponentsModule {} diff --git a/src/addons/block/blogmenu/components/blogmenu/blogmenu.ts b/src/addons/block/blogmenu/components/blogmenu/blogmenu.ts index 415c09e87..7aa6ef6b1 100644 --- a/src/addons/block/blogmenu/components/blogmenu/blogmenu.ts +++ b/src/addons/block/blogmenu/components/blogmenu/blogmenu.ts @@ -12,6 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. +import { CoreSharedModule } from '@/core/shared.module'; import { Component } from '@angular/core'; import { CoreBlockPreRenderedComponent } from '@features/block/components/pre-rendered-block/pre-rendered-block'; @@ -21,6 +22,10 @@ import { CoreBlockPreRenderedComponent } from '@features/block/components/pre-re @Component({ selector: 'addon-block-blog-menu', templateUrl: '../../../../../core/features/block/components/pre-rendered-block/core-block-pre-rendered.html', - styleUrls: ['blogmenu.scss'], + styleUrl: 'blogmenu.scss', + standalone: true, + imports: [ + CoreSharedModule, + ], }) export class AddonBlockBlogMenuComponent extends CoreBlockPreRenderedComponent {} diff --git a/src/addons/block/blogmenu/components/components.module.ts b/src/addons/block/blogmenu/components/components.module.ts deleted file mode 100644 index f2f48abe3..000000000 --- a/src/addons/block/blogmenu/components/components.module.ts +++ /dev/null @@ -1,28 +0,0 @@ -// (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 { NgModule } from '@angular/core'; - -import { CoreSharedModule } from '@/core/shared.module'; -import { AddonBlockBlogMenuComponent } from './blogmenu/blogmenu'; - -@NgModule({ - declarations: [ - AddonBlockBlogMenuComponent, - ], - imports: [ - CoreSharedModule, - ], -}) -export class AddonBlockBlogMenuComponentsModule {} diff --git a/src/addons/block/blogrecent/components/blogrecent/blogrecent.ts b/src/addons/block/blogrecent/components/blogrecent/blogrecent.ts index 94715c86a..5316f8d5c 100644 --- a/src/addons/block/blogrecent/components/blogrecent/blogrecent.ts +++ b/src/addons/block/blogrecent/components/blogrecent/blogrecent.ts @@ -12,6 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. +import { CoreSharedModule } from '@/core/shared.module'; import { Component } from '@angular/core'; import { CoreBlockPreRenderedComponent } from '@features/block/components/pre-rendered-block/pre-rendered-block'; @@ -21,6 +22,10 @@ import { CoreBlockPreRenderedComponent } from '@features/block/components/pre-re @Component({ selector: 'addon-block-blog-recent', templateUrl: '../../../../../core/features/block/components/pre-rendered-block/core-block-pre-rendered.html', - styleUrls: ['blogrecent.scss'], + styleUrl: 'blogrecent.scss', + standalone: true, + imports: [ + CoreSharedModule, + ], }) export class AddonBlockBlogRecentComponent extends CoreBlockPreRenderedComponent {} diff --git a/src/addons/block/blogrecent/components/components.module.ts b/src/addons/block/blogrecent/components/components.module.ts deleted file mode 100644 index e961e8dde..000000000 --- a/src/addons/block/blogrecent/components/components.module.ts +++ /dev/null @@ -1,28 +0,0 @@ -// (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 { NgModule } from '@angular/core'; - -import { CoreSharedModule } from '@/core/shared.module'; -import { AddonBlockBlogRecentComponent } from './blogrecent/blogrecent'; - -@NgModule({ - declarations: [ - AddonBlockBlogRecentComponent, - ], - imports: [ - CoreSharedModule, - ], -}) -export class AddonBlockBlogRecentComponentsModule {} diff --git a/src/addons/block/blogtags/components/blogtags/blogtags.ts b/src/addons/block/blogtags/components/blogtags/blogtags.ts index df38a4007..8bbfb00cb 100644 --- a/src/addons/block/blogtags/components/blogtags/blogtags.ts +++ b/src/addons/block/blogtags/components/blogtags/blogtags.ts @@ -12,6 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. +import { CoreSharedModule } from '@/core/shared.module'; import { Component } from '@angular/core'; import { CoreBlockPreRenderedComponent } from '@features/block/components/pre-rendered-block/pre-rendered-block'; @@ -21,6 +22,10 @@ import { CoreBlockPreRenderedComponent } from '@features/block/components/pre-re @Component({ selector: 'addon-block-blog-tags', templateUrl: '../../../../../core/features/block/components/pre-rendered-block/core-block-pre-rendered.html', - styleUrls: ['blogtags.scss'], + styleUrl: 'blogtags.scss', + standalone: true, + imports: [ + CoreSharedModule, + ], }) export class AddonBlockBlogTagsComponent extends CoreBlockPreRenderedComponent {} diff --git a/src/addons/block/blogtags/components/components.module.ts b/src/addons/block/blogtags/components/components.module.ts deleted file mode 100644 index f63845b81..000000000 --- a/src/addons/block/blogtags/components/components.module.ts +++ /dev/null @@ -1,28 +0,0 @@ -// (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 { NgModule } from '@angular/core'; - -import { CoreSharedModule } from '@/core/shared.module'; -import { AddonBlockBlogTagsComponent } from './blogtags/blogtags'; - -@NgModule({ - declarations: [ - AddonBlockBlogTagsComponent, - ], - imports: [ - CoreSharedModule, - ], -}) -export class AddonBlockBlogTagsComponentsModule {} diff --git a/src/addons/block/myoverview/components/components.module.ts b/src/addons/block/myoverview/components/components.module.ts deleted file mode 100644 index 7bfa03f39..000000000 --- a/src/addons/block/myoverview/components/components.module.ts +++ /dev/null @@ -1,30 +0,0 @@ -// (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 { NgModule } from '@angular/core'; - -import { CoreSharedModule } from '@/core/shared.module'; -import { CoreCoursesComponentsModule } from '@features/courses/components/components.module'; -import { AddonBlockMyOverviewComponent } from './myoverview/myoverview'; - -@NgModule({ - declarations: [ - AddonBlockMyOverviewComponent, - ], - imports: [ - CoreSharedModule, - CoreCoursesComponentsModule, - ], -}) -export class AddonBlockMyOverviewComponentsModule {} diff --git a/src/addons/block/myoverview/components/myoverview/myoverview.ts b/src/addons/block/myoverview/components/myoverview/myoverview.ts index 53120bdfd..f8fbc1614 100644 --- a/src/addons/block/myoverview/components/myoverview/myoverview.ts +++ b/src/addons/block/myoverview/components/myoverview/myoverview.ts @@ -36,6 +36,8 @@ import { CoreNavigator } from '@services/navigator'; import { PageLoadWatcher } from '@classes/page-load-watcher'; import { PageLoadsManager } from '@classes/page-loads-manager'; import { DownloadStatus } from '@/core/constants'; +import { CoreSharedModule } from '@/core/shared.module'; +import { CoreCoursesComponentsModule } from '@features/courses/components/components.module'; const FILTER_PRIORITY: AddonBlockMyOverviewTimeFilters[] = ['all', 'inprogress', 'future', 'past', 'favourite', 'allincludinghidden', 'hidden']; @@ -46,7 +48,12 @@ const FILTER_PRIORITY: AddonBlockMyOverviewTimeFilters[] = @Component({ selector: 'addon-block-myoverview', templateUrl: 'addon-block-myoverview.html', - styleUrls: ['myoverview.scss'], + styleUrl: 'myoverview.scss', + standalone: true, + imports: [ + CoreSharedModule, + CoreCoursesComponentsModule, + ], }) export class AddonBlockMyOverviewComponent extends CoreBlockBaseComponent implements OnInit, OnDestroy, OnChanges { diff --git a/src/addons/block/newsitems/components/components.module.ts b/src/addons/block/newsitems/components/components.module.ts deleted file mode 100644 index 1a4db480b..000000000 --- a/src/addons/block/newsitems/components/components.module.ts +++ /dev/null @@ -1,28 +0,0 @@ -// (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 { NgModule } from '@angular/core'; - -import { CoreSharedModule } from '@/core/shared.module'; -import { AddonBlockNewsItemsComponent } from './newsitems/newsitems'; - -@NgModule({ - declarations: [ - AddonBlockNewsItemsComponent, - ], - imports: [ - CoreSharedModule, - ], -}) -export class AddonBlockNewsItemsComponentsModule {} diff --git a/src/addons/block/newsitems/components/newsitems/newsitems.ts b/src/addons/block/newsitems/components/newsitems/newsitems.ts index 749868338..c3fb0d331 100644 --- a/src/addons/block/newsitems/components/newsitems/newsitems.ts +++ b/src/addons/block/newsitems/components/newsitems/newsitems.ts @@ -12,6 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. +import { CoreSharedModule } from '@/core/shared.module'; import { Component } from '@angular/core'; import { CoreBlockPreRenderedComponent } from '@features/block/components/pre-rendered-block/pre-rendered-block'; @@ -21,6 +22,10 @@ import { CoreBlockPreRenderedComponent } from '@features/block/components/pre-re @Component({ selector: 'addon-block-news-items', templateUrl: '../../../../../core/features/block/components/pre-rendered-block/core-block-pre-rendered.html', - styleUrls: ['newsitems.scss'], + styleUrl: 'newsitems.scss', + standalone: true, + imports: [ + CoreSharedModule, + ], }) export class AddonBlockNewsItemsComponent extends CoreBlockPreRenderedComponent {} diff --git a/src/addons/block/onlineusers/components/components.module.ts b/src/addons/block/onlineusers/components/components.module.ts deleted file mode 100644 index 92d9a5861..000000000 --- a/src/addons/block/onlineusers/components/components.module.ts +++ /dev/null @@ -1,28 +0,0 @@ -// (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 { NgModule } from '@angular/core'; - -import { CoreSharedModule } from '@/core/shared.module'; -import { AddonBlockOnlineUsersComponent } from './onlineusers/onlineusers'; - -@NgModule({ - declarations: [ - AddonBlockOnlineUsersComponent, - ], - imports: [ - CoreSharedModule, - ], -}) -export class AddonBlockOnlineUsersComponentsModule {} diff --git a/src/addons/block/onlineusers/components/onlineusers/onlineusers.ts b/src/addons/block/onlineusers/components/onlineusers/onlineusers.ts index 38880fbfd..c39ce8f6b 100644 --- a/src/addons/block/onlineusers/components/onlineusers/onlineusers.ts +++ b/src/addons/block/onlineusers/components/onlineusers/onlineusers.ts @@ -12,6 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. +import { CoreSharedModule } from '@/core/shared.module'; import { Component } from '@angular/core'; import { CoreBlockPreRenderedComponent } from '@features/block/components/pre-rendered-block/pre-rendered-block'; @@ -21,6 +22,10 @@ import { CoreBlockPreRenderedComponent } from '@features/block/components/pre-re @Component({ selector: 'addon-block-online-users', templateUrl: '../../../../../core/features/block/components/pre-rendered-block/core-block-pre-rendered.html', - styleUrls: ['onlineusers.scss'], + styleUrl: 'onlineusers.scss', + standalone: true, + imports: [ + CoreSharedModule, + ], }) export class AddonBlockOnlineUsersComponent extends CoreBlockPreRenderedComponent {} diff --git a/src/addons/block/recentactivity/components/components.module.ts b/src/addons/block/recentactivity/components/components.module.ts deleted file mode 100644 index fb37f28c0..000000000 --- a/src/addons/block/recentactivity/components/components.module.ts +++ /dev/null @@ -1,28 +0,0 @@ -// (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 { NgModule } from '@angular/core'; - -import { CoreSharedModule } from '@/core/shared.module'; -import { AddonBlockRecentActivityComponent } from './recentactivity/recentactivity'; - -@NgModule({ - declarations: [ - AddonBlockRecentActivityComponent, - ], - imports: [ - CoreSharedModule, - ], -}) -export class AddonBlockRecentActivityComponentsModule {} diff --git a/src/addons/block/recentactivity/components/recentactivity/recentactivity.ts b/src/addons/block/recentactivity/components/recentactivity/recentactivity.ts index e13e693dc..22346c981 100644 --- a/src/addons/block/recentactivity/components/recentactivity/recentactivity.ts +++ b/src/addons/block/recentactivity/components/recentactivity/recentactivity.ts @@ -12,6 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. +import { CoreSharedModule } from '@/core/shared.module'; import { Component } from '@angular/core'; import { CoreBlockPreRenderedComponent } from '@features/block/components/pre-rendered-block/pre-rendered-block'; @@ -21,6 +22,10 @@ import { CoreBlockPreRenderedComponent } from '@features/block/components/pre-re @Component({ selector: 'addon-block-recent-activity', templateUrl: '../../../../../core/features/block/components/pre-rendered-block/core-block-pre-rendered.html', - styleUrls: ['recentactivity.scss'], + styleUrl: 'recentactivity.scss', + standalone: true, + imports: [ + CoreSharedModule, + ], }) export class AddonBlockRecentActivityComponent extends CoreBlockPreRenderedComponent {} diff --git a/src/addons/block/recentlyaccessedcourses/components/components.module.ts b/src/addons/block/recentlyaccessedcourses/components/components.module.ts deleted file mode 100644 index f2476ec05..000000000 --- a/src/addons/block/recentlyaccessedcourses/components/components.module.ts +++ /dev/null @@ -1,31 +0,0 @@ -// (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 { NgModule } from '@angular/core'; - -import { CoreSharedModule } from '@/core/shared.module'; -import { CoreCoursesComponentsModule } from '@features/courses/components/components.module'; - -import { AddonBlockRecentlyAccessedCoursesComponent } from './recentlyaccessedcourses/recentlyaccessedcourses'; - -@NgModule({ - declarations: [ - AddonBlockRecentlyAccessedCoursesComponent, - ], - imports: [ - CoreSharedModule, - CoreCoursesComponentsModule, - ], -}) -export class AddonBlockRecentlyAccessedCoursesComponentsModule {} diff --git a/src/addons/block/recentlyaccessedcourses/components/recentlyaccessedcourses/recentlyaccessedcourses.ts b/src/addons/block/recentlyaccessedcourses/components/recentlyaccessedcourses/recentlyaccessedcourses.ts index e45b1b6fe..ff4e94259 100644 --- a/src/addons/block/recentlyaccessedcourses/components/recentlyaccessedcourses/recentlyaccessedcourses.ts +++ b/src/addons/block/recentlyaccessedcourses/components/recentlyaccessedcourses/recentlyaccessedcourses.ts @@ -31,6 +31,8 @@ import { AddonCourseCompletion } from '@addons/coursecompletion/services/coursec import { CoreBlockBaseComponent } from '@features/block/classes/base-block-component'; import { CoreUtils } from '@services/utils/utils'; import { CoreSite } from '@classes/sites/site'; +import { CoreSharedModule } from '@/core/shared.module'; +import { CoreCoursesComponentsModule } from '@features/courses/components/components.module'; /** * Component to render a recent courses block. @@ -38,6 +40,11 @@ import { CoreSite } from '@classes/sites/site'; @Component({ selector: 'addon-block-recentlyaccessedcourses', templateUrl: 'addon-block-recentlyaccessedcourses.html', + standalone: true, + imports: [ + CoreSharedModule, + CoreCoursesComponentsModule, + ], }) export class AddonBlockRecentlyAccessedCoursesComponent extends CoreBlockBaseComponent implements OnInit, OnDestroy { diff --git a/src/addons/block/recentlyaccesseditems/components/components.module.ts b/src/addons/block/recentlyaccesseditems/components/components.module.ts deleted file mode 100644 index d61f5726e..000000000 --- a/src/addons/block/recentlyaccesseditems/components/components.module.ts +++ /dev/null @@ -1,31 +0,0 @@ -// (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 { NgModule } from '@angular/core'; - -import { CoreSharedModule } from '@/core/shared.module'; -import { CoreCoursesComponentsModule } from '@features/courses/components/components.module'; - -import { AddonBlockRecentlyAccessedItemsComponent } from './recentlyaccesseditems/recentlyaccesseditems'; - -@NgModule({ - declarations: [ - AddonBlockRecentlyAccessedItemsComponent, - ], - imports: [ - CoreSharedModule, - CoreCoursesComponentsModule, - ], -}) -export class AddonBlockRecentlyAccessedItemsComponentsModule {} diff --git a/src/addons/block/recentlyaccesseditems/components/recentlyaccesseditems/recentlyaccesseditems.ts b/src/addons/block/recentlyaccesseditems/components/recentlyaccesseditems/recentlyaccesseditems.ts index 90eb98e6d..8db3fa4a8 100644 --- a/src/addons/block/recentlyaccesseditems/components/recentlyaccesseditems/recentlyaccesseditems.ts +++ b/src/addons/block/recentlyaccesseditems/components/recentlyaccesseditems/recentlyaccesseditems.ts @@ -22,6 +22,7 @@ import { import { CoreTextUtils } from '@services/utils/text'; import { CoreDomUtils } from '@services/utils/dom'; import { CoreUtils } from '@services/utils/utils'; +import { CoreSharedModule } from '@/core/shared.module'; /** * Component to render a recently accessed items block. @@ -29,7 +30,11 @@ import { CoreUtils } from '@services/utils/utils'; @Component({ selector: 'addon-block-recentlyaccesseditems', templateUrl: 'addon-block-recentlyaccesseditems.html', - styleUrls: ['recentlyaccesseditems.scss'], + styleUrl: 'recentlyaccesseditems.scss', + standalone: true, + imports: [ + CoreSharedModule, + ], }) export class AddonBlockRecentlyAccessedItemsComponent extends CoreBlockBaseComponent implements OnInit { diff --git a/src/addons/block/rssclient/components/components.module.ts b/src/addons/block/rssclient/components/components.module.ts deleted file mode 100644 index 3482a995b..000000000 --- a/src/addons/block/rssclient/components/components.module.ts +++ /dev/null @@ -1,28 +0,0 @@ -// (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 { NgModule } from '@angular/core'; - -import { CoreSharedModule } from '@/core/shared.module'; -import { AddonBlockRssClientComponent } from './rssclient/rssclient'; - -@NgModule({ - declarations: [ - AddonBlockRssClientComponent, - ], - imports: [ - CoreSharedModule, - ], -}) -export class AddonBlockRssClientComponentsModule {} diff --git a/src/addons/block/rssclient/components/rssclient/rssclient.ts b/src/addons/block/rssclient/components/rssclient/rssclient.ts index c80610358..86ecae773 100644 --- a/src/addons/block/rssclient/components/rssclient/rssclient.ts +++ b/src/addons/block/rssclient/components/rssclient/rssclient.ts @@ -12,6 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. +import { CoreSharedModule } from '@/core/shared.module'; import { Component } from '@angular/core'; import { CoreBlockPreRenderedComponent } from '@features/block/components/pre-rendered-block/pre-rendered-block'; @@ -21,6 +22,10 @@ import { CoreBlockPreRenderedComponent } from '@features/block/components/pre-re @Component({ selector: 'addon-block-rss-client', templateUrl: '../../../../../core/features/block/components/pre-rendered-block/core-block-pre-rendered.html', - styleUrls: ['rssclient.scss'], + styleUrl: 'rssclient.scss', + standalone: true, + imports: [ + CoreSharedModule, + ], }) export class AddonBlockRssClientComponent extends CoreBlockPreRenderedComponent {} diff --git a/src/addons/block/sitemainmenu/components/components.module.ts b/src/addons/block/sitemainmenu/components/components.module.ts deleted file mode 100644 index 6b3371beb..000000000 --- a/src/addons/block/sitemainmenu/components/components.module.ts +++ /dev/null @@ -1,31 +0,0 @@ -// (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 { NgModule } from '@angular/core'; - -import { CoreSharedModule } from '@/core/shared.module'; -import { CoreCourseComponentsModule } from '@features/course/components/components.module'; - -import { AddonBlockSiteMainMenuComponent } from './sitemainmenu/sitemainmenu'; - -@NgModule({ - declarations: [ - AddonBlockSiteMainMenuComponent, - ], - imports: [ - CoreSharedModule, - CoreCourseComponentsModule, - ], -}) -export class AddonBlockSiteMainMenuComponentsModule {} diff --git a/src/addons/block/sitemainmenu/components/sitemainmenu/sitemainmenu.ts b/src/addons/block/sitemainmenu/components/sitemainmenu/sitemainmenu.ts index 486875273..41569c651 100644 --- a/src/addons/block/sitemainmenu/components/sitemainmenu/sitemainmenu.ts +++ b/src/addons/block/sitemainmenu/components/sitemainmenu/sitemainmenu.ts @@ -19,6 +19,8 @@ import { CoreCourseHelper, CoreCourseSection } from '@features/course/services/c import { CoreSiteHome, FrontPageItemNames } from '@features/sitehome/services/sitehome'; import { CoreCourseModulePrefetchDelegate } from '@features/course/services/module-prefetch-delegate'; import { CoreBlockBaseComponent } from '@features/block/classes/base-block-component'; +import { CoreSharedModule } from '@/core/shared.module'; +import { CoreCourseComponentsModule } from '@features/course/components/components.module'; /** * Component to render a site main menu block. @@ -26,6 +28,11 @@ import { CoreBlockBaseComponent } from '@features/block/classes/base-block-compo @Component({ selector: 'addon-block-sitemainmenu', templateUrl: 'addon-block-sitemainmenu.html', + standalone: true, + imports: [ + CoreSharedModule, + CoreCourseComponentsModule, + ], }) export class AddonBlockSiteMainMenuComponent extends CoreBlockBaseComponent implements OnInit { diff --git a/src/addons/block/starredcourses/components/components.module.ts b/src/addons/block/starredcourses/components/components.module.ts deleted file mode 100644 index 143335439..000000000 --- a/src/addons/block/starredcourses/components/components.module.ts +++ /dev/null @@ -1,31 +0,0 @@ -// (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 { NgModule } from '@angular/core'; - -import { CoreSharedModule } from '@/core/shared.module'; -import { CoreCoursesComponentsModule } from '@features/courses/components/components.module'; - -import { AddonBlockStarredCoursesComponent } from './starredcourses/starredcourses'; - -@NgModule({ - declarations: [ - AddonBlockStarredCoursesComponent, - ], - imports: [ - CoreSharedModule, - CoreCoursesComponentsModule, - ], -}) -export class AddonBlockStarredCoursesComponentsModule {} diff --git a/src/addons/block/starredcourses/components/starredcourses/starredcourses.ts b/src/addons/block/starredcourses/components/starredcourses/starredcourses.ts index f33825325..8aab432b1 100644 --- a/src/addons/block/starredcourses/components/starredcourses/starredcourses.ts +++ b/src/addons/block/starredcourses/components/starredcourses/starredcourses.ts @@ -26,6 +26,8 @@ import { CoreBlockBaseComponent } from '@features/block/classes/base-block-compo import { CoreUtils } from '@services/utils/utils'; import { CoreSite } from '@classes/sites/site'; import { AddonBlockStarredCourse, AddonBlockStarredCourses } from '../../services/starredcourses'; +import { CoreSharedModule } from '@/core/shared.module'; +import { CoreCoursesComponentsModule } from '@features/courses/components/components.module'; /** * Component to render a starred courses block. @@ -33,6 +35,11 @@ import { AddonBlockStarredCourse, AddonBlockStarredCourses } from '../../service @Component({ selector: 'addon-block-starredcourses', templateUrl: 'addon-block-starredcourses.html', + standalone: true, + imports: [ + CoreSharedModule, + CoreCoursesComponentsModule, + ], }) export class AddonBlockStarredCoursesComponent extends CoreBlockBaseComponent implements OnInit, OnDestroy { diff --git a/src/addons/block/tags/components/components.module.ts b/src/addons/block/tags/components/components.module.ts deleted file mode 100644 index 74384dffe..000000000 --- a/src/addons/block/tags/components/components.module.ts +++ /dev/null @@ -1,28 +0,0 @@ -// (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 { NgModule } from '@angular/core'; - -import { CoreSharedModule } from '@/core/shared.module'; -import { AddonBlockTagsComponent } from './tags/tags'; - -@NgModule({ - declarations: [ - AddonBlockTagsComponent, - ], - imports: [ - CoreSharedModule, - ], -}) -export class AddonBlockTagsComponentsModule {} diff --git a/src/addons/block/tags/components/tags/tags.ts b/src/addons/block/tags/components/tags/tags.ts index 9ae0e6c2c..61798e394 100644 --- a/src/addons/block/tags/components/tags/tags.ts +++ b/src/addons/block/tags/components/tags/tags.ts @@ -12,6 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. +import { CoreSharedModule } from '@/core/shared.module'; import { Component } from '@angular/core'; import { CoreBlockPreRenderedComponent } from '@features/block/components/pre-rendered-block/pre-rendered-block'; @@ -21,6 +22,10 @@ import { CoreBlockPreRenderedComponent } from '@features/block/components/pre-re @Component({ selector: 'addon-block-tags', templateUrl: '../../../../../core/features/block/components/pre-rendered-block/core-block-pre-rendered.html', - styleUrls: ['tags.scss'], + styleUrl: 'tags.scss', + standalone: true, + imports: [ + CoreSharedModule, + ], }) export class AddonBlockTagsComponent extends CoreBlockPreRenderedComponent {} diff --git a/src/addons/block/timeline/components/components.module.ts b/src/addons/block/timeline/components/components.module.ts deleted file mode 100644 index 6a951de0a..000000000 --- a/src/addons/block/timeline/components/components.module.ts +++ /dev/null @@ -1,33 +0,0 @@ -// (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 { NgModule } from '@angular/core'; - -import { CoreSharedModule } from '@/core/shared.module'; - -import { AddonBlockTimelineComponent } from './timeline/timeline'; -import { AddonBlockTimelineEventsComponent } from './events/events'; -import { CoreSearchComponentsModule } from '@features/search/components/components.module'; - -@NgModule({ - declarations: [ - AddonBlockTimelineComponent, - AddonBlockTimelineEventsComponent, - ], - imports: [ - CoreSharedModule, - CoreSearchComponentsModule, - ], -}) -export class AddonBlockTimelineComponentsModule {} diff --git a/src/addons/block/timeline/components/events/events.ts b/src/addons/block/timeline/components/events/events.ts index b3bc10d9a..041c22755 100644 --- a/src/addons/block/timeline/components/events/events.ts +++ b/src/addons/block/timeline/components/events/events.ts @@ -18,6 +18,7 @@ import { CoreDomUtils } from '@services/utils/dom'; import { CoreTextUtils } from '@services/utils/text'; import { CoreEnrolledCourseDataWithOptions } from '@features/courses/services/courses-helper'; import { AddonBlockTimelineDayEvents } from '@addons/block/timeline/classes/section'; +import { CoreSharedModule } from '@/core/shared.module'; /** * Directive to render a list of events in course overview. @@ -25,7 +26,11 @@ import { AddonBlockTimelineDayEvents } from '@addons/block/timeline/classes/sect @Component({ selector: 'addon-block-timeline-events', templateUrl: 'addon-block-timeline-events.html', - styleUrls: ['events.scss'], + styleUrl: 'events.scss', + standalone: true, + imports: [ + CoreSharedModule, + ], }) export class AddonBlockTimelineEventsComponent implements OnInit { diff --git a/src/addons/block/timeline/components/timeline/timeline.ts b/src/addons/block/timeline/components/timeline/timeline.ts index 76e7881c2..9a814c0e3 100644 --- a/src/addons/block/timeline/components/timeline/timeline.ts +++ b/src/addons/block/timeline/components/timeline/timeline.ts @@ -27,6 +27,9 @@ import { AddonBlockTimelineDateRange, AddonBlockTimelineSection } from '@addons/ import { FormControl } from '@angular/forms'; import { formControlValue, resolved } from '@/core/utils/rxjs'; import { CoreLogger } from '@singletons/logger'; +import { CoreSharedModule } from '@/core/shared.module'; +import { CoreSearchComponentsModule } from '@features/search/components/components.module'; +import { AddonBlockTimelineEventsComponent } from '../events/events'; /** * Component to render a timeline block. @@ -34,8 +37,14 @@ import { CoreLogger } from '@singletons/logger'; @Component({ selector: 'addon-block-timeline', templateUrl: 'addon-block-timeline.html', - styleUrls: ['timeline.scss'], + styleUrl: 'timeline.scss', changeDetection: ChangeDetectionStrategy.OnPush, + standalone: true, + imports: [ + CoreSharedModule, + CoreSearchComponentsModule, + AddonBlockTimelineEventsComponent, + ], }) export class AddonBlockTimelineComponent implements OnInit, ICoreBlockComponent { From ed357f357c03636eccb00313b16bd771527ed1fd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pau=20Ferrer=20Oca=C3=B1a?= Date: Mon, 22 Jul 2024 15:51:02 +0200 Subject: [PATCH 6/6] MOBILE-4616 behat: Fix communication matrix behat test --- src/core/features/course/tests/behat/communication.feature | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/core/features/course/tests/behat/communication.feature b/src/core/features/course/tests/behat/communication.feature index 00ecbe9c7..d5a79a9e7 100644 --- a/src/core/features/course/tests/behat/communication.feature +++ b/src/core/features/course/tests/behat/communication.feature @@ -20,8 +20,8 @@ Feature: Use custom communication link in course And I navigate to "Communication" in current page administration And I select "Custom link" from the "Provider" singleselect And I set the following fields to these values: - | communicationroomname | Test URL | - | customlinkurl | #wwwroot#/communication/provider/customlink/tests/behat/fixtures/custom_link_test_page.php | + | communication_customlinkroomname | Test URL | + | customlinkurl | #wwwroot#/communication/provider/customlink/tests/behat/fixtures/custom_link_test_page.php | And I press "Save changes" Scenario: Use communication link