From 884c86044477399eff0499778455d9947a2d89f1 Mon Sep 17 00:00:00 2001 From: Alfonso Salces Date: Thu, 9 Nov 2023 11:09:25 +0100 Subject: [PATCH] MOBILE-4464 siteplugins: Add class to identify site plugins --- .../siteplugins/components/block/block.ts | 4 ++-- .../components/course-format/course-format.ts | 4 ++-- .../components/module-index/module-index.ts | 4 ++-- .../components/plugin-content/plugin-content.ts | 15 +++++++++++++-- 4 files changed, 19 insertions(+), 8 deletions(-) diff --git a/src/core/features/siteplugins/components/block/block.ts b/src/core/features/siteplugins/components/block/block.ts index f655cb4b8c0..0dfc2e82544 100644 --- a/src/core/features/siteplugins/components/block/block.ts +++ b/src/core/features/siteplugins/components/block/block.ts @@ -12,7 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -import { Component, OnChanges, ViewChild } from '@angular/core'; +import { Component, HostBinding, OnChanges, ViewChild } from '@angular/core'; import { CoreBlockBaseComponent } from '@features/block/classes/base-block-component'; import { CoreBlockDelegate } from '@features/block/services/block-delegate'; @@ -31,7 +31,7 @@ export class CoreSitePluginsBlockComponent extends CoreBlockBaseComponent implem @ViewChild(CoreSitePluginsPluginContentComponent) content?: CoreSitePluginsPluginContentComponent; - component?: string; + @HostBinding('class') component?: string; method?: string; args?: Record; initResult?: CoreSitePluginsContent | null; diff --git a/src/core/features/siteplugins/components/course-format/course-format.ts b/src/core/features/siteplugins/components/course-format/course-format.ts index 299f2459cd5..24ba3cc3730 100644 --- a/src/core/features/siteplugins/components/course-format/course-format.ts +++ b/src/core/features/siteplugins/components/course-format/course-format.ts @@ -12,7 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -import { Component, OnChanges, Input, ViewChild, Output, EventEmitter } from '@angular/core'; +import { Component, OnChanges, Input, ViewChild, Output, EventEmitter, HostBinding } from '@angular/core'; import { IonRefresher } from '@ionic/angular'; import { CoreCourseFormatComponent } from '@features/course/components/course-format/course-format'; @@ -51,7 +51,7 @@ export class CoreSitePluginsCourseFormatComponent implements OnChanges { @ViewChild(CoreSitePluginsPluginContentComponent) content?: CoreSitePluginsPluginContentComponent; - component?: string; + @HostBinding('class') component?: string; method?: string; args?: Record; initResult?: CoreSitePluginsContent | null; diff --git a/src/core/features/siteplugins/components/module-index/module-index.ts b/src/core/features/siteplugins/components/module-index/module-index.ts index 0b22b979661..47869e78781 100644 --- a/src/core/features/siteplugins/components/module-index/module-index.ts +++ b/src/core/features/siteplugins/components/module-index/module-index.ts @@ -13,7 +13,7 @@ // limitations under the License. import { CoreConstants } from '@/core/constants'; -import { Component, OnInit, OnDestroy, Input, ViewChild } from '@angular/core'; +import { Component, OnInit, OnDestroy, Input, ViewChild, HostBinding } from '@angular/core'; import { CoreIonLoadingElement } from '@classes/ion-loading'; import { CoreSiteWSPreSets } from '@classes/site'; @@ -54,7 +54,7 @@ export class CoreSitePluginsModuleIndexComponent implements OnInit, OnDestroy, C @ViewChild(CoreSitePluginsPluginContentComponent) content?: CoreSitePluginsPluginContentComponent; - component?: string; + @HostBinding('class') component?: string; method?: string; args?: Record; initResult?: CoreSitePluginsContent | null; diff --git a/src/core/features/siteplugins/components/plugin-content/plugin-content.ts b/src/core/features/siteplugins/components/plugin-content/plugin-content.ts index 9f40f08c57c..1f96ac3ef2f 100644 --- a/src/core/features/siteplugins/components/plugin-content/plugin-content.ts +++ b/src/core/features/siteplugins/components/plugin-content/plugin-content.ts @@ -12,7 +12,18 @@ // See the License for the specific language governing permissions and // limitations under the License. -import { Component, OnInit, Input, Output, EventEmitter, DoCheck, KeyValueDiffers, ViewChild, KeyValueDiffer } from '@angular/core'; +import { + Component, + OnInit, + Input, + Output, + EventEmitter, + DoCheck, + KeyValueDiffers, + ViewChild, + KeyValueDiffer, + HostBinding, +} from '@angular/core'; import { Subject } from 'rxjs'; import { Md5 } from 'ts-md5'; @@ -37,7 +48,7 @@ export class CoreSitePluginsPluginContentComponent implements OnInit, DoCheck { // Get the compile element. Don't set the right type to prevent circular dependencies. @ViewChild('compile') compileComponent?: CoreCompileHtmlComponent; - @Input() component!: string; + @HostBinding('class') @Input() component!: string; @Input() method!: string; @Input() args?: Record; @Input() initResult?: CoreSitePluginsContent | null; // Result of the init WS call of the handler.