fix: TypeScript build errors in frontend
- Fix CFDI type errors (ivaTraslado, tipoCambio, id types) - Fix sidebar navigation type errors (Role vs literal tuples) - Fix user invite type errors (UserInvite['role']) - Fix login page PlatformRole type cast
This commit is contained in:
@@ -177,8 +177,8 @@ export const CfdiInvoice = forwardRef<HTMLDivElement, CfdiInvoiceProps>(
|
||||
<div className="bg-gray-50 rounded-lg p-3 text-center">
|
||||
<p className="text-xs text-gray-500 uppercase tracking-wide">Moneda</p>
|
||||
<p className="text-sm font-semibold text-gray-800 mt-1">{cfdi.moneda || 'MXN'}</p>
|
||||
{cfdi.typeCambio && cfdi.typeCambio !== 1 && (
|
||||
<p className="text-xs text-gray-500">TC: {cfdi.typeCambio}</p>
|
||||
{cfdi.tipoCambio && cfdi.tipoCambio !== 1 && (
|
||||
<p className="text-xs text-gray-500">TC: {cfdi.tipoCambio}</p>
|
||||
)}
|
||||
</div>
|
||||
<div className="bg-gray-50 rounded-lg p-3 text-center">
|
||||
|
||||
@@ -121,7 +121,7 @@ export function CfdiViewerModal({ cfdi, open, onClose }: CfdiViewerModalProps) {
|
||||
let xml = xmlContent;
|
||||
|
||||
if (!xml) {
|
||||
xml = await getCfdiXml(cfdi.id);
|
||||
xml = await getCfdiXml(String(cfdi.id));
|
||||
}
|
||||
|
||||
if (!xml) {
|
||||
|
||||
@@ -22,9 +22,9 @@ import { useAuthStore } from '@/stores/auth-store';
|
||||
import { logout } from '@/lib/api/auth';
|
||||
import { useRouter } from 'next/navigation';
|
||||
import { useState } from 'react';
|
||||
import { hasFeature, isGlobalAdminRfc, type Plan } from '@horux/shared';
|
||||
import { hasFeature, isGlobalAdminRfc, type Plan, type Role } from '@horux/shared';
|
||||
|
||||
const navigation = [
|
||||
const navigation: { name: string; href: string; icon: React.ElementType; feature?: string; roles?: Role[] }[] = [
|
||||
{ name: 'Dashboard', href: '/dashboard', icon: LayoutDashboard, roles: ['owner', 'contador'] },
|
||||
{ name: 'CFDI', href: '/cfdi', icon: FileText },
|
||||
{ name: 'Impuestos', href: '/impuestos', icon: Calculator },
|
||||
@@ -35,7 +35,7 @@ const navigation = [
|
||||
{ name: 'Facturación', href: '/facturacion', icon: Send, roles: ['owner', 'contador'] },
|
||||
{ name: 'Usuarios', href: '/usuarios', icon: Users, roles: ['owner'] },
|
||||
{ name: 'Configuración', href: '/configuracion', icon: Settings, roles: ['owner'] },
|
||||
] as const;
|
||||
];
|
||||
|
||||
const adminNavigation = [
|
||||
{ name: 'Clientes', href: '/clientes', icon: Building2 },
|
||||
|
||||
@@ -21,9 +21,9 @@ import {
|
||||
import { useAuthStore } from '@/stores/auth-store';
|
||||
import { logout } from '@/lib/api/auth';
|
||||
import { useRouter } from 'next/navigation';
|
||||
import { hasFeature, isGlobalAdminRfc, type Plan } from '@horux/shared';
|
||||
import { hasFeature, isGlobalAdminRfc, type Plan, type Role } from '@horux/shared';
|
||||
|
||||
const navigation = [
|
||||
const navigation: { name: string; href: string; icon: React.ElementType; feature?: string; roles?: Role[] }[] = [
|
||||
{ name: 'Dashboard', href: '/dashboard', icon: LayoutDashboard, roles: ['owner', 'contador'] },
|
||||
{ name: 'CFDI', href: '/cfdi', icon: FileText },
|
||||
{ name: 'Impuestos', href: '/impuestos', icon: Calculator },
|
||||
@@ -34,7 +34,7 @@ const navigation = [
|
||||
{ name: 'Facturación', href: '/facturacion', icon: Send, roles: ['owner', 'contador'] },
|
||||
{ name: 'Usuarios', href: '/usuarios', icon: Users, roles: ['owner'] },
|
||||
{ name: 'Config', href: '/configuracion', icon: Settings, roles: ['owner'] },
|
||||
] as const;
|
||||
];
|
||||
|
||||
const adminNavigation = [
|
||||
{ name: 'Clientes', href: '/clientes', icon: Building2 },
|
||||
|
||||
@@ -22,9 +22,9 @@ import { useAuthStore } from '@/stores/auth-store';
|
||||
import { logout } from '@/lib/api/auth';
|
||||
import { useRouter } from 'next/navigation';
|
||||
import { useState } from 'react';
|
||||
import { hasFeature, isGlobalAdminRfc, type Plan } from '@horux/shared';
|
||||
import { hasFeature, isGlobalAdminRfc, type Plan, type Role } from '@horux/shared';
|
||||
|
||||
const navigation = [
|
||||
const navigation: { name: string; href: string; icon: React.ElementType; feature?: string; roles?: Role[] }[] = [
|
||||
{ name: 'Dashboard', href: '/dashboard', icon: LayoutDashboard, roles: ['owner', 'contador'] },
|
||||
{ name: 'CFDI', href: '/cfdi', icon: FileText },
|
||||
{ name: 'Impuestos', href: '/impuestos', icon: Calculator },
|
||||
@@ -35,7 +35,7 @@ const navigation = [
|
||||
{ name: 'Facturación', href: '/facturacion', icon: Send, roles: ['owner', 'contador'] },
|
||||
{ name: 'Usuarios', href: '/usuarios', icon: Users, roles: ['owner'] },
|
||||
{ name: 'Config', href: '/configuracion', icon: Settings, roles: ['owner'] },
|
||||
] as const;
|
||||
];
|
||||
|
||||
const adminNavigation = [
|
||||
{ name: 'Clientes', href: '/clientes', icon: Building2 },
|
||||
|
||||
Reference in New Issue
Block a user