Merge pull request #4126 from crazyserver/MOBILE-4616

Mobile 4616
main
Dani Palou 2024-07-22 16:52:50 +02:00 committed by GitHub
commit 337c69d60f
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
48 changed files with 208 additions and 559 deletions

View File

@ -23,6 +23,7 @@ import { CoreUtils } from '@services/utils/utils';
import { CoreNavigator } from '@services/navigator'; import { CoreNavigator } from '@services/navigator';
import { CoreCourseHelper } from '@features/course/services/course-helper'; import { CoreCourseHelper } from '@features/course/services/course-helper';
import { CoreUrlUtils } from '@services/utils/url'; import { CoreUrlUtils } from '@services/utils/url';
import { CoreSharedModule } from '@/core/shared.module';
/** /**
* Component to render an "activity modules" block. * Component to render an "activity modules" block.
@ -30,7 +31,11 @@ import { CoreUrlUtils } from '@services/utils/url';
@Component({ @Component({
selector: 'addon-block-activitymodules', selector: 'addon-block-activitymodules',
templateUrl: 'addon-block-activitymodules.html', templateUrl: 'addon-block-activitymodules.html',
styleUrls: ['activitymodules.scss'], styleUrl: 'activitymodules.scss',
standalone: true,
imports: [
CoreSharedModule,
],
}) })
export class AddonBlockActivityModulesComponent extends CoreBlockBaseComponent implements OnInit { export class AddonBlockActivityModulesComponent extends CoreBlockBaseComponent implements OnInit {

View File

@ -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 {}

View File

@ -12,6 +12,7 @@
// See the License for the specific language governing permissions and // See the License for the specific language governing permissions and
// limitations under the License. // limitations under the License.
import { CoreSharedModule } from '@/core/shared.module';
import { Component } from '@angular/core'; import { Component } from '@angular/core';
import { CoreBlockPreRenderedComponent } from '@features/block/components/pre-rendered-block/pre-rendered-block'; 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({ @Component({
selector: 'addon-block-activity-results', selector: 'addon-block-activity-results',
templateUrl: '../../../../../core/features/block/components/pre-rendered-block/core-block-pre-rendered.html', 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 {} export class AddonBlockActivityResultsComponent extends CoreBlockPreRenderedComponent {}

View File

@ -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 {}

View File

@ -12,6 +12,7 @@
// See the License for the specific language governing permissions and // See the License for the specific language governing permissions and
// limitations under the License. // limitations under the License.
import { CoreSharedModule } from '@/core/shared.module';
import { Component } from '@angular/core'; import { Component } from '@angular/core';
import { CoreBlockPreRenderedComponent } from '@features/block/components/pre-rendered-block/pre-rendered-block'; 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({ @Component({
selector: 'addon-block-badges', selector: 'addon-block-badges',
templateUrl: '../../../../../core/features/block/components/pre-rendered-block/core-block-pre-rendered.html', 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 {} export class AddonBlockBadgesComponent extends CoreBlockPreRenderedComponent {}

View File

@ -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 {}

View File

@ -12,6 +12,7 @@
// See the License for the specific language governing permissions and // See the License for the specific language governing permissions and
// limitations under the License. // limitations under the License.
import { CoreSharedModule } from '@/core/shared.module';
import { Component } from '@angular/core'; import { Component } from '@angular/core';
import { CoreBlockPreRenderedComponent } from '@features/block/components/pre-rendered-block/pre-rendered-block'; 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({ @Component({
selector: 'addon-block-blog-menu', selector: 'addon-block-blog-menu',
templateUrl: '../../../../../core/features/block/components/pre-rendered-block/core-block-pre-rendered.html', 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 {} export class AddonBlockBlogMenuComponent extends CoreBlockPreRenderedComponent {}

View File

@ -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 {}

View File

@ -12,6 +12,7 @@
// See the License for the specific language governing permissions and // See the License for the specific language governing permissions and
// limitations under the License. // limitations under the License.
import { CoreSharedModule } from '@/core/shared.module';
import { Component } from '@angular/core'; import { Component } from '@angular/core';
import { CoreBlockPreRenderedComponent } from '@features/block/components/pre-rendered-block/pre-rendered-block'; 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({ @Component({
selector: 'addon-block-blog-recent', selector: 'addon-block-blog-recent',
templateUrl: '../../../../../core/features/block/components/pre-rendered-block/core-block-pre-rendered.html', 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 {} export class AddonBlockBlogRecentComponent extends CoreBlockPreRenderedComponent {}

View File

@ -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 {}

View File

@ -12,6 +12,7 @@
// See the License for the specific language governing permissions and // See the License for the specific language governing permissions and
// limitations under the License. // limitations under the License.
import { CoreSharedModule } from '@/core/shared.module';
import { Component } from '@angular/core'; import { Component } from '@angular/core';
import { CoreBlockPreRenderedComponent } from '@features/block/components/pre-rendered-block/pre-rendered-block'; 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({ @Component({
selector: 'addon-block-blog-tags', selector: 'addon-block-blog-tags',
templateUrl: '../../../../../core/features/block/components/pre-rendered-block/core-block-pre-rendered.html', 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 {} export class AddonBlockBlogTagsComponent extends CoreBlockPreRenderedComponent {}

View File

@ -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 {}

View File

@ -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 {}

View File

@ -36,6 +36,8 @@ import { CoreNavigator } from '@services/navigator';
import { PageLoadWatcher } from '@classes/page-load-watcher'; import { PageLoadWatcher } from '@classes/page-load-watcher';
import { PageLoadsManager } from '@classes/page-loads-manager'; import { PageLoadsManager } from '@classes/page-loads-manager';
import { DownloadStatus } from '@/core/constants'; import { DownloadStatus } from '@/core/constants';
import { CoreSharedModule } from '@/core/shared.module';
import { CoreCoursesComponentsModule } from '@features/courses/components/components.module';
const FILTER_PRIORITY: AddonBlockMyOverviewTimeFilters[] = const FILTER_PRIORITY: AddonBlockMyOverviewTimeFilters[] =
['all', 'inprogress', 'future', 'past', 'favourite', 'allincludinghidden', 'hidden']; ['all', 'inprogress', 'future', 'past', 'favourite', 'allincludinghidden', 'hidden'];
@ -46,7 +48,12 @@ const FILTER_PRIORITY: AddonBlockMyOverviewTimeFilters[] =
@Component({ @Component({
selector: 'addon-block-myoverview', selector: 'addon-block-myoverview',
templateUrl: 'addon-block-myoverview.html', 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 { export class AddonBlockMyOverviewComponent extends CoreBlockBaseComponent implements OnInit, OnDestroy, OnChanges {

View File

@ -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 {}

View File

@ -12,6 +12,7 @@
// See the License for the specific language governing permissions and // See the License for the specific language governing permissions and
// limitations under the License. // limitations under the License.
import { CoreSharedModule } from '@/core/shared.module';
import { Component } from '@angular/core'; import { Component } from '@angular/core';
import { CoreBlockPreRenderedComponent } from '@features/block/components/pre-rendered-block/pre-rendered-block'; 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({ @Component({
selector: 'addon-block-news-items', selector: 'addon-block-news-items',
templateUrl: '../../../../../core/features/block/components/pre-rendered-block/core-block-pre-rendered.html', 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 {} export class AddonBlockNewsItemsComponent extends CoreBlockPreRenderedComponent {}

View File

@ -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 {}

View File

@ -12,6 +12,7 @@
// See the License for the specific language governing permissions and // See the License for the specific language governing permissions and
// limitations under the License. // limitations under the License.
import { CoreSharedModule } from '@/core/shared.module';
import { Component } from '@angular/core'; import { Component } from '@angular/core';
import { CoreBlockPreRenderedComponent } from '@features/block/components/pre-rendered-block/pre-rendered-block'; 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({ @Component({
selector: 'addon-block-online-users', selector: 'addon-block-online-users',
templateUrl: '../../../../../core/features/block/components/pre-rendered-block/core-block-pre-rendered.html', 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 {} export class AddonBlockOnlineUsersComponent extends CoreBlockPreRenderedComponent {}

View File

@ -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 {}

View File

@ -12,6 +12,7 @@
// See the License for the specific language governing permissions and // See the License for the specific language governing permissions and
// limitations under the License. // limitations under the License.
import { CoreSharedModule } from '@/core/shared.module';
import { Component } from '@angular/core'; import { Component } from '@angular/core';
import { CoreBlockPreRenderedComponent } from '@features/block/components/pre-rendered-block/pre-rendered-block'; 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({ @Component({
selector: 'addon-block-recent-activity', selector: 'addon-block-recent-activity',
templateUrl: '../../../../../core/features/block/components/pre-rendered-block/core-block-pre-rendered.html', 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 {} export class AddonBlockRecentActivityComponent extends CoreBlockPreRenderedComponent {}

View File

@ -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 {}

View File

@ -31,6 +31,8 @@ import { AddonCourseCompletion } from '@addons/coursecompletion/services/coursec
import { CoreBlockBaseComponent } from '@features/block/classes/base-block-component'; import { CoreBlockBaseComponent } from '@features/block/classes/base-block-component';
import { CoreUtils } from '@services/utils/utils'; import { CoreUtils } from '@services/utils/utils';
import { CoreSite } from '@classes/sites/site'; 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. * Component to render a recent courses block.
@ -38,6 +40,11 @@ import { CoreSite } from '@classes/sites/site';
@Component({ @Component({
selector: 'addon-block-recentlyaccessedcourses', selector: 'addon-block-recentlyaccessedcourses',
templateUrl: 'addon-block-recentlyaccessedcourses.html', templateUrl: 'addon-block-recentlyaccessedcourses.html',
standalone: true,
imports: [
CoreSharedModule,
CoreCoursesComponentsModule,
],
}) })
export class AddonBlockRecentlyAccessedCoursesComponent extends CoreBlockBaseComponent implements OnInit, OnDestroy { export class AddonBlockRecentlyAccessedCoursesComponent extends CoreBlockBaseComponent implements OnInit, OnDestroy {

View File

@ -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 {}

View File

@ -22,6 +22,7 @@ import {
import { CoreTextUtils } from '@services/utils/text'; import { CoreTextUtils } from '@services/utils/text';
import { CoreDomUtils } from '@services/utils/dom'; import { CoreDomUtils } from '@services/utils/dom';
import { CoreUtils } from '@services/utils/utils'; import { CoreUtils } from '@services/utils/utils';
import { CoreSharedModule } from '@/core/shared.module';
/** /**
* Component to render a recently accessed items block. * Component to render a recently accessed items block.
@ -29,7 +30,11 @@ import { CoreUtils } from '@services/utils/utils';
@Component({ @Component({
selector: 'addon-block-recentlyaccesseditems', selector: 'addon-block-recentlyaccesseditems',
templateUrl: 'addon-block-recentlyaccesseditems.html', templateUrl: 'addon-block-recentlyaccesseditems.html',
styleUrls: ['recentlyaccesseditems.scss'], styleUrl: 'recentlyaccesseditems.scss',
standalone: true,
imports: [
CoreSharedModule,
],
}) })
export class AddonBlockRecentlyAccessedItemsComponent extends CoreBlockBaseComponent implements OnInit { export class AddonBlockRecentlyAccessedItemsComponent extends CoreBlockBaseComponent implements OnInit {

View File

@ -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 {}

View File

@ -12,6 +12,7 @@
// See the License for the specific language governing permissions and // See the License for the specific language governing permissions and
// limitations under the License. // limitations under the License.
import { CoreSharedModule } from '@/core/shared.module';
import { Component } from '@angular/core'; import { Component } from '@angular/core';
import { CoreBlockPreRenderedComponent } from '@features/block/components/pre-rendered-block/pre-rendered-block'; 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({ @Component({
selector: 'addon-block-rss-client', selector: 'addon-block-rss-client',
templateUrl: '../../../../../core/features/block/components/pre-rendered-block/core-block-pre-rendered.html', 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 {} export class AddonBlockRssClientComponent extends CoreBlockPreRenderedComponent {}

View File

@ -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 {}

View File

@ -19,6 +19,8 @@ import { CoreCourseHelper, CoreCourseSection } from '@features/course/services/c
import { CoreSiteHome, FrontPageItemNames } from '@features/sitehome/services/sitehome'; import { CoreSiteHome, FrontPageItemNames } from '@features/sitehome/services/sitehome';
import { CoreCourseModulePrefetchDelegate } from '@features/course/services/module-prefetch-delegate'; import { CoreCourseModulePrefetchDelegate } from '@features/course/services/module-prefetch-delegate';
import { CoreBlockBaseComponent } from '@features/block/classes/base-block-component'; 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. * Component to render a site main menu block.
@ -26,6 +28,11 @@ import { CoreBlockBaseComponent } from '@features/block/classes/base-block-compo
@Component({ @Component({
selector: 'addon-block-sitemainmenu', selector: 'addon-block-sitemainmenu',
templateUrl: 'addon-block-sitemainmenu.html', templateUrl: 'addon-block-sitemainmenu.html',
standalone: true,
imports: [
CoreSharedModule,
CoreCourseComponentsModule,
],
}) })
export class AddonBlockSiteMainMenuComponent extends CoreBlockBaseComponent implements OnInit { export class AddonBlockSiteMainMenuComponent extends CoreBlockBaseComponent implements OnInit {

View File

@ -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 {}

View File

@ -26,6 +26,8 @@ import { CoreBlockBaseComponent } from '@features/block/classes/base-block-compo
import { CoreUtils } from '@services/utils/utils'; import { CoreUtils } from '@services/utils/utils';
import { CoreSite } from '@classes/sites/site'; import { CoreSite } from '@classes/sites/site';
import { AddonBlockStarredCourse, AddonBlockStarredCourses } from '../../services/starredcourses'; 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. * Component to render a starred courses block.
@ -33,6 +35,11 @@ import { AddonBlockStarredCourse, AddonBlockStarredCourses } from '../../service
@Component({ @Component({
selector: 'addon-block-starredcourses', selector: 'addon-block-starredcourses',
templateUrl: 'addon-block-starredcourses.html', templateUrl: 'addon-block-starredcourses.html',
standalone: true,
imports: [
CoreSharedModule,
CoreCoursesComponentsModule,
],
}) })
export class AddonBlockStarredCoursesComponent extends CoreBlockBaseComponent implements OnInit, OnDestroy { export class AddonBlockStarredCoursesComponent extends CoreBlockBaseComponent implements OnInit, OnDestroy {

View File

@ -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 {}

View File

@ -12,6 +12,7 @@
// See the License for the specific language governing permissions and // See the License for the specific language governing permissions and
// limitations under the License. // limitations under the License.
import { CoreSharedModule } from '@/core/shared.module';
import { Component } from '@angular/core'; import { Component } from '@angular/core';
import { CoreBlockPreRenderedComponent } from '@features/block/components/pre-rendered-block/pre-rendered-block'; 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({ @Component({
selector: 'addon-block-tags', selector: 'addon-block-tags',
templateUrl: '../../../../../core/features/block/components/pre-rendered-block/core-block-pre-rendered.html', 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 {} export class AddonBlockTagsComponent extends CoreBlockPreRenderedComponent {}

View File

@ -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 {}

View File

@ -18,6 +18,7 @@ import { CoreDomUtils } from '@services/utils/dom';
import { CoreTextUtils } from '@services/utils/text'; import { CoreTextUtils } from '@services/utils/text';
import { CoreEnrolledCourseDataWithOptions } from '@features/courses/services/courses-helper'; import { CoreEnrolledCourseDataWithOptions } from '@features/courses/services/courses-helper';
import { AddonBlockTimelineDayEvents } from '@addons/block/timeline/classes/section'; import { AddonBlockTimelineDayEvents } from '@addons/block/timeline/classes/section';
import { CoreSharedModule } from '@/core/shared.module';
/** /**
* Directive to render a list of events in course overview. * Directive to render a list of events in course overview.
@ -25,7 +26,11 @@ import { AddonBlockTimelineDayEvents } from '@addons/block/timeline/classes/sect
@Component({ @Component({
selector: 'addon-block-timeline-events', selector: 'addon-block-timeline-events',
templateUrl: 'addon-block-timeline-events.html', templateUrl: 'addon-block-timeline-events.html',
styleUrls: ['events.scss'], styleUrl: 'events.scss',
standalone: true,
imports: [
CoreSharedModule,
],
}) })
export class AddonBlockTimelineEventsComponent implements OnInit { export class AddonBlockTimelineEventsComponent implements OnInit {

View File

@ -27,6 +27,9 @@ import { AddonBlockTimelineDateRange, AddonBlockTimelineSection } from '@addons/
import { FormControl } from '@angular/forms'; import { FormControl } from '@angular/forms';
import { formControlValue, resolved } from '@/core/utils/rxjs'; import { formControlValue, resolved } from '@/core/utils/rxjs';
import { CoreLogger } from '@singletons/logger'; 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. * Component to render a timeline block.
@ -34,8 +37,14 @@ import { CoreLogger } from '@singletons/logger';
@Component({ @Component({
selector: 'addon-block-timeline', selector: 'addon-block-timeline',
templateUrl: 'addon-block-timeline.html', templateUrl: 'addon-block-timeline.html',
styleUrls: ['timeline.scss'], styleUrl: 'timeline.scss',
changeDetection: ChangeDetectionStrategy.OnPush, changeDetection: ChangeDetectionStrategy.OnPush,
standalone: true,
imports: [
CoreSharedModule,
CoreSearchComponentsModule,
AddonBlockTimelineEventsComponent,
],
}) })
export class AddonBlockTimelineComponent implements OnInit, ICoreBlockComponent { export class AddonBlockTimelineComponent implements OnInit, ICoreBlockComponent {

View File

@ -12,7 +12,7 @@
// See the License for the specific language governing permissions and // See the License for the specific language governing permissions and
// limitations under the License. // limitations under the License.
import { CUSTOM_ELEMENTS_SCHEMA, NgModule } from '@angular/core'; import { CUSTOM_ELEMENTS_SCHEMA, NgModule, Type } from '@angular/core';
import { CommonModule } from '@angular/common'; import { CommonModule } from '@angular/common';
import { IonicModule } from '@ionic/angular'; import { IonicModule } from '@ionic/angular';
import { TranslateModule } from '@ngx-translate/core'; import { TranslateModule } from '@ngx-translate/core';
@ -48,7 +48,6 @@ import { CoreSendMessageFormComponent } from './send-message-form/send-message-f
import { CoreShowPasswordComponent } from './show-password/show-password'; import { CoreShowPasswordComponent } from './show-password/show-password';
import { CoreSitePickerComponent } from './site-picker/site-picker'; import { CoreSitePickerComponent } from './site-picker/site-picker';
import { CoreSplitViewComponent } from './split-view/split-view'; import { CoreSplitViewComponent } from './split-view/split-view';
import { CoreStyleComponent } from './style/style';
import { CoreTabComponent } from './tabs/tab'; import { CoreTabComponent } from './tabs/tab';
import { CoreTabsComponent } from './tabs/tabs'; import { CoreTabsComponent } from './tabs/tabs';
import { CoreTabsOutletComponent } from './tabs-outlet/tabs-outlet'; import { CoreTabsOutletComponent } from './tabs-outlet/tabs-outlet';
@ -67,6 +66,20 @@ import { CoreSheetModalComponent } from '@components/sheet-modal/sheet-modal';
import { CoreCourseImageComponent } from '@components/course-image/course-image'; import { CoreCourseImageComponent } from '@components/course-image/course-image';
import { CoreSitesListComponent } from './sites-list/sites-list'; import { CoreSitesListComponent } from './sites-list/sites-list';
/**
* Get standalone components for site plugins.
*
* @returns Returns core standalone components.
*/
export async function getCoreStandaloneComponents(): Promise<Type<unknown>[]> {
// eslint-disable-next-line deprecation/deprecation
const { CoreStyleComponent } = await import('@components/style/style');
return [
CoreStyleComponent,
];
}
@NgModule({ @NgModule({
declarations: [ declarations: [
CoreAttachmentsComponent, CoreAttachmentsComponent,
@ -100,8 +113,6 @@ import { CoreSitesListComponent } from './sites-list/sites-list';
CoreShowPasswordComponent, // eslint-disable-line deprecation/deprecation CoreShowPasswordComponent, // eslint-disable-line deprecation/deprecation
CoreSitePickerComponent, CoreSitePickerComponent,
CoreSplitViewComponent, CoreSplitViewComponent,
// eslint-disable-next-line deprecation/deprecation
CoreStyleComponent,
CoreSwipeSlidesComponent, CoreSwipeSlidesComponent,
CoreTabComponent, CoreTabComponent,
CoreTabsComponent, CoreTabsComponent,
@ -156,8 +167,6 @@ import { CoreSitesListComponent } from './sites-list/sites-list';
CoreShowPasswordComponent, // eslint-disable-line deprecation/deprecation CoreShowPasswordComponent, // eslint-disable-line deprecation/deprecation
CoreSitePickerComponent, CoreSitePickerComponent,
CoreSplitViewComponent, CoreSplitViewComponent,
// eslint-disable-next-line deprecation/deprecation
CoreStyleComponent,
CoreSwipeSlidesComponent, CoreSwipeSlidesComponent,
CoreTabComponent, CoreTabComponent,
CoreTabsComponent, CoreTabsComponent,

View File

@ -12,6 +12,7 @@
// See the License for the specific language governing permissions and // See the License for the specific language governing permissions and
// limitations under the License. // limitations under the License.
import { CoreSharedModule } from '@/core/shared.module';
import { Component, ElementRef, Input, OnChanges } from '@angular/core'; import { Component, ElementRef, Input, OnChanges } from '@angular/core';
import { CoreDom } from '@singletons/dom'; import { CoreDom } from '@singletons/dom';
@ -24,11 +25,15 @@ import { CoreDom } from '@singletons/dom';
* Example: * Example:
* *
* <core-style [css]="'p { color: red; }'" prefix=".custom-rules"></core-style> * <core-style [css]="'p { color: red; }'" prefix=".custom-rules"></core-style>
* @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({ @Component({
selector: 'core-style', selector: 'core-style',
template: '', template: '',
standalone: true,
imports: [
CoreSharedModule,
],
}) })
export class CoreStyleComponent implements OnChanges { export class CoreStyleComponent implements OnChanges {

View File

@ -16,12 +16,10 @@ import {
Injectable, Injectable,
Injector, Injector,
Component, Component,
NgModule,
ComponentRef, ComponentRef,
NO_ERRORS_SCHEMA, NO_ERRORS_SCHEMA,
Type, Type,
Provider, Provider,
createNgModule,
ViewContainerRef, ViewContainerRef,
} from '@angular/core'; } from '@angular/core';
import { import {
@ -43,7 +41,7 @@ import { getCoreServices } from '@/core/core.module';
import { getBlockServices } from '@features/block/block.module'; import { getBlockServices } from '@features/block/block.module';
import { getCommentsServices } from '@features/comments/comments.module'; import { getCommentsServices } from '@features/comments/comments.module';
import { getContentLinksExportedObjects, getContentLinksServices } from '@features/contentlinks/contentlinks.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 { getCoursesServices } from '@features/courses/courses.module';
import { getEditorServices } from '@features/editor/editor.module'; import { getEditorServices } from '@features/editor/editor.module';
import { getEnrolServices } from '@features/enrol/enrol.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 core classes that can be useful for site plugins.
import { CoreSyncBaseProvider } from '@classes/base-sync'; import { CoreSyncBaseProvider } from '@classes/base-sync';
import { CoreArray } from '@singletons/array'; import { CoreArray } from '@singletons/array';
import { CoreColors } from '@singletons/colors';
import { CoreDirectivesRegistry } from '@singletons/directives-registry'; import { CoreDirectivesRegistry } from '@singletons/directives-registry';
import { CoreDom } from '@singletons/dom'; import { CoreDom } from '@singletons/dom';
import { CoreForms } from '@singletons/form'; 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 { CoreText } from '@singletons/text';
import { CoreTime } from '@singletons/time'; import { CoreTime } from '@singletons/time';
import { CoreUrl } from '@singletons/url'; import { CoreUrl } from '@singletons/url';
@ -116,6 +118,9 @@ import { getNotesServices } from '@addons/notes/notes.module';
import { getNotificationsServices } from '@addons/notifications/notifications.module'; import { getNotificationsServices } from '@addons/notifications/notifications.module';
import { getPrivateFilesServices } from '@addons/privatefiles/privatefiles.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 some addon modules that define components, directives and pipes. Only import the important ones.
import { CorePromisedValue } from '@classes/promised-value'; import { CorePromisedValue } from '@classes/promised-value';
import { CorePlatform } from '@services/platform'; import { CorePlatform } from '@services/platform';
@ -157,6 +162,8 @@ export class CoreCompileProvider {
getModAssignComponentModules, getModAssignComponentModules,
getModQuizComponentModules, getModQuizComponentModules,
getModWorkshopComponentModules, getModWorkshopComponentModules,
getCoreStandaloneComponents,
getCourseStandaloneComponents,
]; ];
protected componentId = 0; protected componentId = 0;
@ -187,13 +194,6 @@ export class CoreCompileProvider {
// Import the Angular compiler to be able to compile components in runtime. // Import the Angular compiler to be able to compile components in runtime.
await import('@angular/compiler'); 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 lazyImports = await Promise.all(this.LAZY_IMPORTS.map(getModules => getModules()));
const imports = [ const imports = [
...lazyImports.flat(), ...lazyImports.flat(),
@ -201,20 +201,21 @@ export class CoreCompileProvider {
...extraImports, ...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 { try {
viewContainerRef.clear(); 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( return viewContainerRef.createComponent(
component, component,
{
environmentInjector: ngModuleRef,
},
); );
} catch (error) { } catch (error) {
this.logger.error('Error compiling template', template); this.logger.error('Error compiling template', template);
@ -299,13 +300,17 @@ export class CoreCompileProvider {
* Keeping this a bit more to avoid plugins breaking. * Keeping this a bit more to avoid plugins breaking.
*/ */
instance['Network'] = CoreNetwork.instance; instance['Network'] = CoreNetwork.instance;
instance['CoreSyncBaseProvider'] = CoreSyncBaseProvider;
instance['CoreArray'] = CoreArray;
instance['CoreDirectivesRegistry'] = CoreDirectivesRegistry;
instance['CoreNetwork'] = CoreNetwork.instance; instance['CoreNetwork'] = CoreNetwork.instance;
instance['CorePlatform'] = CorePlatform.instance; instance['CorePlatform'] = CorePlatform.instance;
instance['CoreSyncBaseProvider'] = CoreSyncBaseProvider;
instance['CoreArray'] = CoreArray;
instance['CoreColors'] = CoreColors;
instance['CoreDirectivesRegistry'] = CoreDirectivesRegistry;
instance['CoreDom'] = CoreDom; instance['CoreDom'] = CoreDom;
instance['CoreForms'] = CoreForms; instance['CoreForms'] = CoreForms;
instance['CoreKeyboard'] = CoreKeyboard;
instance['CoreObject'] = CoreObject;
instance['CorePath'] = CorePath;
instance['CoreText'] = CoreText; instance['CoreText'] = CoreText;
instance['CoreTime'] = CoreTime; instance['CoreTime'] = CoreTime;
instance['CoreUrl'] = CoreUrl; instance['CoreUrl'] = CoreUrl;

View File

@ -19,13 +19,11 @@ import { CoreBlockComponentsModule } from '@features/block/components/components
import { CoreCourseFormatComponent } from './course-format/course-format'; import { CoreCourseFormatComponent } from './course-format/course-format';
import { CoreCourseModuleComponent } from './module/module'; import { CoreCourseModuleComponent } from './module/module';
import { CoreCourseModuleCompletionComponent } from './module-completion/module-completion'; import { CoreCourseModuleCompletionComponent } from './module-completion/module-completion';
import { CoreCourseModuleDescriptionComponent } from './module-description/module-description';
import { CoreCourseCourseIndexComponent } from './course-index/course-index'; import { CoreCourseCourseIndexComponent } from './course-index/course-index';
import { CoreCourseTagAreaComponent } from './tag-area/tag-area'; import { CoreCourseTagAreaComponent } from './tag-area/tag-area';
import { CoreCourseUnsupportedModuleComponent } from './unsupported-module/unsupported-module'; import { CoreCourseUnsupportedModuleComponent } from './unsupported-module/unsupported-module';
import { CoreCourseModuleCompletionLegacyComponent } from './module-completion-legacy/module-completion-legacy'; import { CoreCourseModuleCompletionLegacyComponent } from './module-completion-legacy/module-completion-legacy';
import { CoreCourseModuleInfoComponent } from './module-info/module-info'; import { CoreCourseModuleInfoComponent } from './module-info/module-info';
import { CoreCourseModuleManualCompletionComponent } from './module-manual-completion/module-manual-completion';
import { CoreCourseModuleNavigationComponent } from './module-navigation/module-navigation'; import { CoreCourseModuleNavigationComponent } from './module-navigation/module-navigation';
import { CoreCourseModuleSummaryComponent } from './module-summary/module-summary'; import { CoreCourseModuleSummaryComponent } from './module-summary/module-summary';
import { CoreCourseCourseIndexTourComponent } from './course-index-tour/course-index-tour'; import { CoreCourseCourseIndexTourComponent } from './course-index-tour/course-index-tour';
@ -38,11 +36,7 @@ import { CoreCourseModuleCompletionDetailsComponent } from './module-completion-
CoreCourseModuleComponent, CoreCourseModuleComponent,
CoreCourseModuleCompletionComponent, CoreCourseModuleCompletionComponent,
CoreCourseModuleCompletionLegacyComponent, CoreCourseModuleCompletionLegacyComponent,
// eslint-disable-next-line deprecation/deprecation
CoreCourseModuleDescriptionComponent,
CoreCourseModuleInfoComponent, CoreCourseModuleInfoComponent,
// eslint-disable-next-line deprecation/deprecation
CoreCourseModuleManualCompletionComponent,
CoreCourseCourseIndexComponent, CoreCourseCourseIndexComponent,
CoreCourseCourseIndexTourComponent, CoreCourseCourseIndexTourComponent,
CoreCourseTagAreaComponent, CoreCourseTagAreaComponent,
@ -61,11 +55,7 @@ import { CoreCourseModuleCompletionDetailsComponent } from './module-completion-
CoreCourseModuleComponent, CoreCourseModuleComponent,
CoreCourseModuleCompletionComponent, CoreCourseModuleCompletionComponent,
CoreCourseModuleCompletionLegacyComponent, CoreCourseModuleCompletionLegacyComponent,
// eslint-disable-next-line deprecation/deprecation
CoreCourseModuleDescriptionComponent,
CoreCourseModuleInfoComponent, CoreCourseModuleInfoComponent,
// eslint-disable-next-line deprecation/deprecation
CoreCourseModuleManualCompletionComponent,
CoreCourseCourseIndexComponent, CoreCourseCourseIndexComponent,
CoreCourseCourseIndexTourComponent, CoreCourseCourseIndexTourComponent,
CoreCourseTagAreaComponent, CoreCourseTagAreaComponent,

View File

@ -13,6 +13,7 @@
// limitations under the License. // limitations under the License.
import { ContextLevel } from '@/core/constants'; import { ContextLevel } from '@/core/constants';
import { CoreSharedModule } from '@/core/shared.module';
import { Component, HostBinding, Input } from '@angular/core'; import { Component, HostBinding, Input } from '@angular/core';
/** /**
@ -37,6 +38,10 @@ import { Component, HostBinding, Input } from '@angular/core';
@Component({ @Component({
selector: 'core-course-module-description', selector: 'core-course-module-description',
templateUrl: 'core-course-module-description.html', templateUrl: 'core-course-module-description.html',
standalone: true,
imports: [
CoreSharedModule,
],
}) })
export class CoreCourseModuleDescriptionComponent { export class CoreCourseModuleDescriptionComponent {

View File

@ -12,6 +12,7 @@
// See the License for the specific language governing permissions and // See the License for the specific language governing permissions and
// limitations under the License. // limitations under the License.
import { CoreSharedModule } from '@/core/shared.module';
import { Component, EventEmitter, Input, OnChanges, OnDestroy, OnInit, Output, SimpleChange } from '@angular/core'; import { Component, EventEmitter, Input, OnChanges, OnDestroy, OnInit, Output, SimpleChange } from '@angular/core';
import { CoreCourseHelper, CoreCourseModuleCompletionData } from '@features/course/services/course-helper'; import { CoreCourseHelper, CoreCourseModuleCompletionData } from '@features/course/services/course-helper';
import { CoreUser } from '@features/user/services/user'; import { CoreUser } from '@features/user/services/user';
@ -26,6 +27,10 @@ import { CoreEventObserver, CoreEvents } from '@singletons/events';
@Component({ @Component({
selector: 'core-course-module-manual-completion', selector: 'core-course-module-manual-completion',
templateUrl: 'core-course-module-manual-completion.html', templateUrl: 'core-course-module-manual-completion.html',
standalone: true,
imports: [
CoreSharedModule,
],
}) })
export class CoreCourseModuleManualCompletionComponent implements OnInit, OnChanges, OnDestroy { export class CoreCourseModuleManualCompletionComponent implements OnInit, OnChanges, OnDestroy {

View File

@ -87,6 +87,25 @@ export async function getCourseExportedObjects(): Promise<Record<string, unknown
/* eslint-enable @typescript-eslint/naming-convention */ /* eslint-enable @typescript-eslint/naming-convention */
} }
/**
* Get standalone components for site plugins.
*
* @returns Returns standalone components.
*/
export async function getCourseStandaloneComponents(): Promise<Type<unknown>[]> {
// 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 = [ const routes: Routes = [
{ {
matcher: buildRegExpUrlMatcher(new RegExp(`^${COURSE_PAGE_NAME}(/deep)*`)), matcher: buildRegExpUrlMatcher(new RegExp(`^${COURSE_PAGE_NAME}(/deep)*`)),

View File

@ -20,7 +20,7 @@ Feature: Use custom communication link in course
And I navigate to "Communication" in current page administration And I navigate to "Communication" in current page administration
And I select "Custom link" from the "Provider" singleselect And I select "Custom link" from the "Provider" singleselect
And I set the following fields to these values: And I set the following fields to these values:
| communicationroomname | Test URL | | communication_customlinkroomname | Test URL |
| customlinkurl | #wwwroot#/communication/provider/customlink/tests/behat/fixtures/custom_link_test_page.php | | customlinkurl | #wwwroot#/communication/provider/customlink/tests/behat/fixtures/custom_link_test_page.php |
And I press "Save changes" And I press "Save changes"

View File

@ -30,6 +30,11 @@ export class CoreCoursesLinksHandlerBase extends CoreContentLinksHandlerBase {
/** /**
* Get actions to open course content. * 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[] { protected getCourseActions(url: string, courseId: number, pageParams: Params = {}): CoreContentLinksAction[] {
return [{ return [{

View File

@ -550,7 +550,7 @@ export class CoreEditorRichTextEditorComponent implements OnInit, AfterViewInit,
/** /**
* Check if text is empty. * 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. * @returns If value is null only a white space.
*/ */
protected isNullOrWhiteSpace(valueOrEl: string | HTMLElement | null | undefined): boolean { protected isNullOrWhiteSpace(valueOrEl: string | HTMLElement | null | undefined): boolean {

View File

@ -511,7 +511,11 @@ export class CoreLoginHelperProvider {
*/ */
isFeatureDisabled(feature: string, config?: CoreSitePublicConfigResponse): boolean { isFeatureDisabled(feature: string, config?: CoreSitePublicConfigResponse): boolean {
// eslint-disable-next-line deprecation/deprecation // eslint-disable-next-line deprecation/deprecation
return this.isFeatureDisabled(feature, config); const disabledFeatures = this.getDisabledFeatures(config);
const regEx = new RegExp('(,|^)' + feature + '(,|$)', 'g');
return !!disabledFeatures.match(regEx);
} }
/** /**

View File

@ -26,8 +26,6 @@ import { CoreTagListComponent } from './list/list';
imports: [ imports: [
CoreSharedModule, CoreSharedModule,
], ],
providers: [
],
exports: [ exports: [
CoreTagFeedComponent, CoreTagFeedComponent,
CoreTagListComponent, CoreTagListComponent,

View File

@ -26,8 +26,6 @@ import { CoreUserTagAreaComponent } from './tag-area/tag-area';
imports: [ imports: [
CoreSharedModule, CoreSharedModule,
], ],
providers: [
],
exports: [ exports: [
CoreUserProfileFieldComponent, CoreUserProfileFieldComponent,
CoreUserTagAreaComponent, CoreUserTagAreaComponent,