Skip to content

Commit

Permalink
13519 fixed steps example broken (#13527)
Browse files Browse the repository at this point in the history
* Fixed routing module

* Added ButtonModule and Fragment in navigate to go to the anchor

* formatted file

* formatted files
  • Loading branch information
SoyDiego committed Aug 26, 2023
1 parent 83e7e7e commit 8f60f39
Show file tree
Hide file tree
Showing 15 changed files with 30 additions and 24 deletions.
10 changes: 8 additions & 2 deletions src/app/components/calendar/calendar.ts
Original file line number Diff line number Diff line change
Expand Up @@ -197,8 +197,14 @@ export const CALENDAR_VALUE_ACCESSOR: any = {
</span>
</div>
<div class="p-yearpicker" *ngIf="currentView === 'year'">
<span *ngFor="let y of yearPickerValues()" (click)="onYearSelect($event, y)" (keydown)="onYearCellKeydown($event, y)"
class="p-yearpicker-year" [ngClass]="{ 'p-highlight': isYearSelected(y), 'p-disabled': isYearDisabled(y) }" pRipple>
<span
*ngFor="let y of yearPickerValues()"
(click)="onYearSelect($event, y)"
(keydown)="onYearCellKeydown($event, y)"
class="p-yearpicker-year"
[ngClass]="{ 'p-highlight': isYearSelected(y), 'p-disabled': isYearDisabled(y) }"
pRipple
>
{{ y }}
</span>
</div>
Expand Down
2 changes: 1 addition & 1 deletion src/app/components/paginator/paginator.ts
Original file line number Diff line number Diff line change
Expand Up @@ -217,7 +217,7 @@ export class Paginator implements OnInit, AfterContentInit, OnChanges {
@Output() onPageChange: EventEmitter<PaginatorState> = new EventEmitter<PaginatorState>();

@ContentChildren(PrimeTemplate) templates: Nullable<QueryList<any>>;

firstPageLinkIconTemplate: Nullable<TemplateRef<any>>;

previousPageLinkIconTemplate: Nullable<TemplateRef<any>>;
Expand Down
2 changes: 1 addition & 1 deletion src/app/components/table/table.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion src/app/components/tooltip/tooltip.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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));
Expand Down
2 changes: 1 addition & 1 deletion src/app/showcase/doc/paginator/localedoc.ts
Original file line number Diff line number Diff line change
Expand Up @@ -95,4 +95,4 @@ export class PaginatorLocaleDemo {
}
}`
};
}
}
2 changes: 1 addition & 1 deletion src/app/showcase/doc/steps/basicdoc.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ export class BasicDoc implements OnInit {
this.items = [
{
label: 'Personal',
routerLink: ''
routerLink: 'personal'
},
{
label: 'Seat',
Expand Down
2 changes: 1 addition & 1 deletion src/app/showcase/doc/steps/confirmationdemo.ts
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,6 @@ export class ConfirmationDemo implements OnInit {
}

prevPage() {
this.router.navigate(['steps/payment']);
this.router.navigate(['steps/payment'], { fragment: 'routing' });
}
}
4 changes: 2 additions & 2 deletions src/app/showcase/doc/steps/paymentdemo.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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' });
}
}
2 changes: 1 addition & 1 deletion src/app/showcase/doc/steps/personaldemo.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down
4 changes: 2 additions & 2 deletions src/app/showcase/doc/steps/routingdoc.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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' },
]
}
])`,
Expand Down
4 changes: 2 additions & 2 deletions src/app/showcase/doc/steps/seatdemo.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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' });
}
}
3 changes: 2 additions & 1 deletion src/app/showcase/doc/steps/stepsdoc.module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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]
Expand Down
6 changes: 2 additions & 4 deletions src/app/showcase/doc/tooltip/templatedoc.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,7 @@ import { Code } from '../../domain/code';
<ng-template #tooltipContent>
<div class="flex align-items-center">
<img src="https://primefaces.org/cdn/primeng/images/primeng.svg" height="20" class="mr-2" />
<span>
<b>PrimeNG</b> rocks!
</span>
<span> <b>PrimeNG</b> rocks! </span>
</div>
</ng-template>
</div>
Expand Down Expand Up @@ -51,4 +49,4 @@ export class TemplateDoc {
</div>
</ng-template>`
};
}
}
2 changes: 1 addition & 1 deletion src/app/showcase/doc/treetable/paginatorlocaledoc.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ interface Column {
selector: 'paginator-locale-doc',
template: ` <section>
<app-docsectiontext [title]="title" [id]="id" [level]="3" #docsectiontext>
<p>paginator localization information such as page numbers and rows per page options are defined with the <i>paginatorLocale</i> property which defaults to the user locale.</p>
<p>paginator localization information such as page numbers and rows per page options are defined with the <i>paginatorLocale</i> property which defaults to the user locale.</p>
</app-docsectiontext>
<div class="card">
<p-treeTable paginatorLocale="fa-IR" [value]="files" [columns]="cols" [paginator]="true" [rows]="10" [scrollable]="true" [tableStyle]="{ 'min-width': '50rem' }">
Expand Down
7 changes: 4 additions & 3 deletions src/app/showcase/pages/steps/stepsdemo-routing.module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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' }
]
}
])
Expand Down

0 comments on commit 8f60f39

Please sign in to comment.