feat(help-page): enhance help section with dynamic footer links and add pending help page

This commit is contained in:
2026-07-23 17:13:43 -03:00
parent afaa761acc
commit 1d5c94b9bc
9 changed files with 116 additions and 56 deletions

View File

@@ -4,19 +4,13 @@
<nav class="help-sidebar__nav" aria-label="Secciones de ayuda">
@for (menu of submenues(); track menu.code) {
@if (isAvailable(menu)) {
<a
class="help-sidebar__link"
[routerLink]="menu.route"
routerLinkActive="help-sidebar__link--active"
>
{{ menuLabel(menu) }}
</a>
} @else {
<span class="help-sidebar__link help-sidebar__link--unavailable">
{{ menuLabel(menu) }}
</span>
}
<a
class="help-sidebar__link"
[routerLink]="menu.route"
routerLinkActive="help-sidebar__link--active"
>
{{ menuLabel(menu) }}
</a>
}
</nav>
</aside>

View File

@@ -48,10 +48,6 @@
font-weight: 600;
}
.help-sidebar__link--unavailable {
cursor: default;
}
@media (max-width: 767.98px) {
.help-sidebar__nav {
flex-flow: row wrap;

View File

@@ -1,18 +1,10 @@
import { Component, computed, inject } from '@angular/core';
import { RouterLink, RouterLinkActive } from '@angular/router';
import { findMenu } from '../../../../../../core/services/menu.utils';
import { findMenu, getMenuLabel } from '../../../../../../core/services/menu.utils';
import { Menu } from '../../../../../../core/services/tenant.interface';
import { TenantService } from '../../../../../../core/services/tenant.service';
const MENU_LABELS: Record<string, string> = {
'help.faq': 'Preguntas frecuentes',
'help.contact': 'Contacto',
'help.payment-methods': 'Medios de pago',
'help.shipping': 'Envíos',
'help.terms-and-conditions': 'Términos y condiciones',
};
@Component({
selector: 'app-help-sidebar',
imports: [RouterLink, RouterLinkActive],
@@ -27,16 +19,6 @@ export class HelpSidebar {
);
protected menuLabel(menu: Menu): string {
return MENU_LABELS[menu.code] ?? this.fallbackLabel(menu.code);
}
protected isAvailable(menu: Menu): boolean {
return menu.code === 'help.faq';
}
private fallbackLabel(code: string): string {
const label = code.split('.').at(-1)?.replaceAll('-', ' ') ?? code;
return label.charAt(0).toUpperCase() + label.slice(1);
return getMenuLabel(menu);
}
}

View File

@@ -0,0 +1,7 @@
import { Component } from '@angular/core';
@Component({
selector: 'app-pending-help-page',
template: '',
})
export class PendingHelpPage {}

View File

@@ -98,6 +98,13 @@ export const routes: Routes = [
redirectTo: 'preguntas-frecuentes',
pathMatch: 'full',
},
{
path: '**',
loadComponent: () =>
import('./pages/help-page/pages/pending-help-page/pending-help-page').then(
(m) => m.PendingHelpPage,
),
},
],
},
{