From 600b4f3ae7eb3ec029c8252af9555143fc3c6e77 Mon Sep 17 00:00:00 2001 From: Nicolas Molina Monroy Date: Mon, 19 Aug 2024 18:06:24 -0400 Subject: [PATCH] chore: fix some typing errors (#29630) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ### Parent Issue https://github.com/dotCMS/core/issues/29635 ### Proposed Changes * Fix some type errors * Fix typing error handling input event Screenshot 2024-08-19 at 9 38 49 AM ### Checklist - [x] Tests - [x] Translations - [x] Security Implications Contemplated (add notes if applicable) --- .../dot-categories-list.component.html | 10 +++++----- .../container-list/container-list.component.html | 2 +- .../dot-edit-page-view-as-controller-seo.component.ts | 2 +- .../dot-pages-listing-panel.component.html | 2 +- .../dot-pages-listing-panel.component.spec.ts | 8 ++++++-- .../dot-template-list/dot-template-list.component.html | 2 +- .../dot-template-list/dot-template-list.component.ts | 9 ++++++--- .../dot-listing-data-table.component.html | 2 +- .../src/stories/primeng/data/Table.stories.ts | 3 ++- 9 files changed, 24 insertions(+), 16 deletions(-) diff --git a/core-web/apps/dotcms-ui/src/app/portlets/dot-categories/dot-categories-list/dot-categories-list.component.html b/core-web/apps/dotcms-ui/src/app/portlets/dot-categories/dot-categories-list/dot-categories-list.component.html index f9b62081ce59..020eec06b11b 100644 --- a/core-web/apps/dotcms-ui/src/app/portlets/dot-categories/dot-categories-list/dot-categories-list.component.html +++ b/core-web/apps/dotcms-ui/src/app/portlets/dot-categories/dot-categories-list/dot-categories-list.component.html @@ -8,9 +8,9 @@
+ data-testId="actions">
diff --git a/core-web/apps/dotcms-ui/src/app/portlets/dot-containers/container-list/container-list.component.html b/core-web/apps/dotcms-ui/src/app/portlets/dot-containers/container-list/container-list.component.html index 89d6b9948a79..be1fa6ffa0b6 100644 --- a/core-web/apps/dotcms-ui/src/app/portlets/dot-containers/container-list/container-list.component.html +++ b/core-web/apps/dotcms-ui/src/app/portlets/dot-containers/container-list/container-list.component.html @@ -3,9 +3,9 @@
{ it('should send event to filter keyword', () => { const elem = de.query(By.css('.dot-pages-listing-header__inputs input')); - elem.triggerEventHandler('input', { target: { value: 'test' } }); + elem.nativeElement.focus(); + elem.nativeElement.value = 'test'; + elem.triggerEventHandler('input'); expect(store.setKeyword).toHaveBeenCalledWith('test'); expect(store.getPages).toHaveBeenCalledWith({ offset: 0 }); @@ -239,7 +241,9 @@ describe('DotPagesListingPanelComponent', () => { it('should send event to filter keyword when cleaning', () => { const elem = de.query(By.css('.dot-pages-listing-header__inputs input')); - elem.triggerEventHandler('input', { target: { value: 'test' } }); + elem.nativeElement.focus(); + elem.nativeElement.value = 'test'; + elem.triggerEventHandler('input'); const elemClean = de.query( By.css('[data-testid="dot-pages-listing-header__keyword-input-clear"]') diff --git a/core-web/apps/dotcms-ui/src/app/portlets/dot-templates/dot-template-list/dot-template-list.component.html b/core-web/apps/dotcms-ui/src/app/portlets/dot-templates/dot-template-list/dot-template-list.component.html index 0d099d33d92d..a4f8c988ea20 100644 --- a/core-web/apps/dotcms-ui/src/app/portlets/dot-templates/dot-template-list/dot-template-list.component.html +++ b/core-web/apps/dotcms-ui/src/app/portlets/dot-templates/dot-template-list/dot-template-list.component.html @@ -28,7 +28,7 @@ type="button" pButton icon="pi pi-ellipsis-v" - attr.data-testid="bulkActions"> + data-testid="bulkActions">
diff --git a/core-web/apps/dotcms-ui/src/app/portlets/dot-templates/dot-template-list/dot-template-list.component.ts b/core-web/apps/dotcms-ui/src/app/portlets/dot-templates/dot-template-list/dot-template-list.component.ts index 15fc44e052a1..e6bbf704f1d2 100644 --- a/core-web/apps/dotcms-ui/src/app/portlets/dot-templates/dot-template-list/dot-template-list.component.ts +++ b/core-web/apps/dotcms-ui/src/app/portlets/dot-templates/dot-template-list/dot-template-list.component.ts @@ -112,7 +112,8 @@ export class DotTemplateListComponent implements OnInit, OnDestroy { * @param {DotTemplate} { template } * @memberof DotTemplateListComponent */ - editTemplate(template: DotTemplate): void { + editTemplate(event: unknown): void { + const template = event as DotTemplate; this.isTemplateAsFile(template) ? this.dotSiteBrowserService.setSelectedFolder(template.identifier).subscribe(() => { this.dotRouterService.goToSiteBrowser(); @@ -139,7 +140,8 @@ export class DotTemplateListComponent implements OnInit, OnDestroy { * * @memberof DotTemplateListComponent */ - updateSelectedTemplates(templates: DotTemplate[]): void { + updateSelectedTemplates(event: unknown): void { + const templates = event as DotTemplate[]; this.selectedTemplates = templates; } @@ -174,7 +176,8 @@ export class DotTemplateListComponent implements OnInit, OnDestroy { * @param {DotTemplate} template * @memberof DotTemplateListComponent */ - setContextMenu(template: DotTemplate): void { + setContextMenu(event: unknown): void { + const template = event as DotTemplate; this.listing.contextMenuItems = this.setTemplateActions(template).map( ({ menuItem }: DotActionMenuItem) => menuItem ); diff --git a/core-web/apps/dotcms-ui/src/app/view/components/dot-listing-data-table/dot-listing-data-table.component.html b/core-web/apps/dotcms-ui/src/app/view/components/dot-listing-data-table/dot-listing-data-table.component.html index 73c3a5bf214b..5bfe27209ccb 100644 --- a/core-web/apps/dotcms-ui/src/app/view/components/dot-listing-data-table/dot-listing-data-table.component.html +++ b/core-web/apps/dotcms-ui/src/app/view/components/dot-listing-data-table/dot-listing-data-table.component.html @@ -1,10 +1,10 @@ diff --git a/core-web/apps/dotcms-ui/src/stories/primeng/data/Table.stories.ts b/core-web/apps/dotcms-ui/src/stories/primeng/data/Table.stories.ts index b1e8b3a413af..b5f9f602a039 100644 --- a/core-web/apps/dotcms-ui/src/stories/primeng/data/Table.stories.ts +++ b/core-web/apps/dotcms-ui/src/stories/primeng/data/Table.stories.ts @@ -133,7 +133,8 @@ const PrimaryTemplate = `