From 8f60f39938c832386a742168db251619fee253cc Mon Sep 17 00:00:00 2001 From: Diego Franchina Date: Sun, 27 Aug 2023 01:22:40 +0200 Subject: [PATCH] 13519 fixed steps example broken (#13527) * Fixed routing module * Added ButtonModule and Fragment in navigate to go to the anchor * formatted file * formatted files --- src/app/components/calendar/calendar.ts | 10 ++++++++-- src/app/components/paginator/paginator.ts | 2 +- src/app/components/table/table.ts | 2 +- src/app/components/tooltip/tooltip.ts | 2 +- src/app/showcase/doc/paginator/localedoc.ts | 2 +- src/app/showcase/doc/steps/basicdoc.ts | 2 +- src/app/showcase/doc/steps/confirmationdemo.ts | 2 +- src/app/showcase/doc/steps/paymentdemo.ts | 4 ++-- src/app/showcase/doc/steps/personaldemo.ts | 2 +- src/app/showcase/doc/steps/routingdoc.ts | 4 ++-- src/app/showcase/doc/steps/seatdemo.ts | 4 ++-- src/app/showcase/doc/steps/stepsdoc.module.ts | 3 ++- src/app/showcase/doc/tooltip/templatedoc.ts | 6 ++---- src/app/showcase/doc/treetable/paginatorlocaledoc.ts | 2 +- .../showcase/pages/steps/stepsdemo-routing.module.ts | 7 ++++--- 15 files changed, 30 insertions(+), 24 deletions(-) diff --git a/src/app/components/calendar/calendar.ts b/src/app/components/calendar/calendar.ts index cdc9f308c6e..d3c5768f106 100755 --- a/src/app/components/calendar/calendar.ts +++ b/src/app/components/calendar/calendar.ts @@ -197,8 +197,14 @@ export const CALENDAR_VALUE_ACCESSOR: any = {
- + {{ y }}
diff --git a/src/app/components/paginator/paginator.ts b/src/app/components/paginator/paginator.ts index e6127e3b71f..d6c07db80a7 100755 --- a/src/app/components/paginator/paginator.ts +++ b/src/app/components/paginator/paginator.ts @@ -217,7 +217,7 @@ export class Paginator implements OnInit, AfterContentInit, OnChanges { @Output() onPageChange: EventEmitter = new EventEmitter(); @ContentChildren(PrimeTemplate) templates: Nullable>; - + firstPageLinkIconTemplate: Nullable>; previousPageLinkIconTemplate: Nullable>; diff --git a/src/app/components/table/table.ts b/src/app/components/table/table.ts index 5a04b040f8b..2679ce9468d 100644 --- a/src/app/components/table/table.ts +++ b/src/app/components/table/table.ts @@ -684,7 +684,7 @@ export class Table implements OnInit, AfterViewInit, AfterContentInit, Blockable * The breakpoint to define the maximum width boundary when using stack responsive layout. * @group Props */ - @Input() breakpoint: string = '960px'; + @Input() breakpoint: string = '960px'; /** * Locale to be used in paginator formatting. * @group Props diff --git a/src/app/components/tooltip/tooltip.ts b/src/app/components/tooltip/tooltip.ts index 6954670d46b..bec4d0466d2 100755 --- a/src/app/components/tooltip/tooltip.ts +++ b/src/app/components/tooltip/tooltip.ts @@ -440,7 +440,7 @@ export class Tooltip implements AfterViewInit, OnDestroy { if (content instanceof TemplateRef) { const embeddedViewRef = this.viewContainer.createEmbeddedView(content); embeddedViewRef.detectChanges(); - embeddedViewRef.rootNodes.forEach(node => this.tooltipText.appendChild(node)); + embeddedViewRef.rootNodes.forEach((node) => this.tooltipText.appendChild(node)); } else if (this.getOption('escape')) { this.tooltipText.innerHTML = ''; this.tooltipText.appendChild(document.createTextNode(content)); diff --git a/src/app/showcase/doc/paginator/localedoc.ts b/src/app/showcase/doc/paginator/localedoc.ts index c49b15968e7..eea0b1c80d6 100644 --- a/src/app/showcase/doc/paginator/localedoc.ts +++ b/src/app/showcase/doc/paginator/localedoc.ts @@ -95,4 +95,4 @@ export class PaginatorLocaleDemo { } }` }; -} \ No newline at end of file +} diff --git a/src/app/showcase/doc/steps/basicdoc.ts b/src/app/showcase/doc/steps/basicdoc.ts index a7dc7673ac3..450b352fedc 100644 --- a/src/app/showcase/doc/steps/basicdoc.ts +++ b/src/app/showcase/doc/steps/basicdoc.ts @@ -25,7 +25,7 @@ export class BasicDoc implements OnInit { this.items = [ { label: 'Personal', - routerLink: '' + routerLink: 'personal' }, { label: 'Seat', diff --git a/src/app/showcase/doc/steps/confirmationdemo.ts b/src/app/showcase/doc/steps/confirmationdemo.ts index f45f87415ef..8639fb31d20 100644 --- a/src/app/showcase/doc/steps/confirmationdemo.ts +++ b/src/app/showcase/doc/steps/confirmationdemo.ts @@ -70,6 +70,6 @@ export class ConfirmationDemo implements OnInit { } prevPage() { - this.router.navigate(['steps/payment']); + this.router.navigate(['steps/payment'], { fragment: 'routing' }); } } diff --git a/src/app/showcase/doc/steps/paymentdemo.ts b/src/app/showcase/doc/steps/paymentdemo.ts index 8b0f966b419..7e0f3ca2c54 100644 --- a/src/app/showcase/doc/steps/paymentdemo.ts +++ b/src/app/showcase/doc/steps/paymentdemo.ts @@ -53,10 +53,10 @@ export class PaymentDemo implements OnInit { nextPage() { this.ticketService.ticketInformation.paymentInformation = this.paymentInformation; - this.router.navigate(['steps/confirmation']); + this.router.navigate(['steps/confirmation'], { fragment: 'routing' }); } prevPage() { - this.router.navigate(['steps/seat']); + this.router.navigate(['steps/seat'], { fragment: 'routing' }); } } diff --git a/src/app/showcase/doc/steps/personaldemo.ts b/src/app/showcase/doc/steps/personaldemo.ts index bf2bd0e60e4..bfd7e2e7eb3 100644 --- a/src/app/showcase/doc/steps/personaldemo.ts +++ b/src/app/showcase/doc/steps/personaldemo.ts @@ -58,7 +58,7 @@ export class PersonalDemo implements OnInit { nextPage() { if (this.personalInformation.firstname && this.personalInformation.lastname && this.personalInformation.age) { this.ticketService.ticketInformation.personalInformation = this.personalInformation; - this.router.navigate(['steps/seat']); + this.router.navigate(['steps/seat'], { fragment: 'routing' }); return; } diff --git a/src/app/showcase/doc/steps/routingdoc.ts b/src/app/showcase/doc/steps/routingdoc.ts index caf120c518e..23e62580d89 100644 --- a/src/app/showcase/doc/steps/routingdoc.ts +++ b/src/app/showcase/doc/steps/routingdoc.ts @@ -129,11 +129,11 @@ export class StepsRoutingDemo implements OnInit { { path: '', children: [ - { path: '', redirectTo: 'personal', pathMatch: 'full' }, { path: 'personal', component: PersonalDemo }, - { path: 'confirmation', component: ConfirmationDemo }, { path: 'seat', component: SeatDemo }, { path: 'payment', component: PaymentDemo } + { path: 'confirmation', component: ConfirmationDemo }, + { path: '', redirectTo: 'personal', pathMatch: 'full' }, ] } ])`, diff --git a/src/app/showcase/doc/steps/seatdemo.ts b/src/app/showcase/doc/steps/seatdemo.ts index 434f9113879..7f417356755 100644 --- a/src/app/showcase/doc/steps/seatdemo.ts +++ b/src/app/showcase/doc/steps/seatdemo.ts @@ -76,10 +76,10 @@ export class SeatDemo implements OnInit { nextPage() { this.ticketService.ticketInformation.seatInformation = this.seatInformation; - this.router.navigate(['steps/payment']); + this.router.navigate(['steps/payment'], { fragment: 'routing' }); } prevPage() { - this.router.navigate(['steps/personal']); + this.router.navigate(['steps/personal'], { fragment: 'routing' }); } } diff --git a/src/app/showcase/doc/steps/stepsdoc.module.ts b/src/app/showcase/doc/steps/stepsdoc.module.ts index e4270eed081..af6da85c7f5 100644 --- a/src/app/showcase/doc/steps/stepsdoc.module.ts +++ b/src/app/showcase/doc/steps/stepsdoc.module.ts @@ -21,9 +21,10 @@ import { SeatDemo } from './seatdemo'; import { StyleDoc } from './styledoc'; import { TicketService } from '../../service/ticketservice'; import { AccessibilityDoc } from './accessibilitydoc'; +import { ButtonModule } from 'primeng/button'; @NgModule({ - imports: [CommonModule, AppCodeModule, StepsModule, ToastModule, AppDocModule, FormsModule, DropdownModule, InputTextModule, InputMaskModule, CheckboxModule, CardModule], + imports: [CommonModule, AppCodeModule, StepsModule, ToastModule, AppDocModule, FormsModule, DropdownModule, InputTextModule, InputMaskModule, CheckboxModule, CardModule, ButtonModule], declarations: [BasicDoc, ImportDoc, StyleDoc, InteractiveDoc, ConfirmationDemo, PaymentDemo, PersonalDemo, SeatDemo, RoutingDoc, AccessibilityDoc], exports: [AppDocModule], providers: [TicketService] diff --git a/src/app/showcase/doc/tooltip/templatedoc.ts b/src/app/showcase/doc/tooltip/templatedoc.ts index 2dbbdc3fd46..763d4706d95 100644 --- a/src/app/showcase/doc/tooltip/templatedoc.ts +++ b/src/app/showcase/doc/tooltip/templatedoc.ts @@ -12,9 +12,7 @@ import { Code } from '../../domain/code';
- - PrimeNG rocks! - + PrimeNG rocks!
@@ -51,4 +49,4 @@ export class TemplateDoc { ` }; -} \ No newline at end of file +} diff --git a/src/app/showcase/doc/treetable/paginatorlocaledoc.ts b/src/app/showcase/doc/treetable/paginatorlocaledoc.ts index 22047957029..5e22307f116 100644 --- a/src/app/showcase/doc/treetable/paginatorlocaledoc.ts +++ b/src/app/showcase/doc/treetable/paginatorlocaledoc.ts @@ -12,7 +12,7 @@ interface Column { selector: 'paginator-locale-doc', template: `
-

paginator localization information such as page numbers and rows per page options are defined with the paginatorLocale property which defaults to the user locale.

+

paginator localization information such as page numbers and rows per page options are defined with the paginatorLocale property which defaults to the user locale.

diff --git a/src/app/showcase/pages/steps/stepsdemo-routing.module.ts b/src/app/showcase/pages/steps/stepsdemo-routing.module.ts index 84f1d7009d2..16e6c8073fc 100755 --- a/src/app/showcase/pages/steps/stepsdemo-routing.module.ts +++ b/src/app/showcase/pages/steps/stepsdemo-routing.module.ts @@ -13,10 +13,11 @@ import { StepsDemo } from './stepsdemo'; path: '', component: StepsDemo, children: [ - { path: '', component: PersonalDemo }, - { path: 'confirmation', component: ConfirmationDemo }, + { path: 'personal', component: PersonalDemo }, { path: 'seat', component: SeatDemo }, - { path: 'payment', component: PaymentDemo } + { path: 'payment', component: PaymentDemo }, + { path: 'confirmation', component: ConfirmationDemo }, + { path: '', redirectTo: 'personal', pathMatch: 'full' } ] } ])