Reestructuración del codigo del cliente web

This commit is contained in:
David Arranz 2026-10-08 19:25:02 +02:00
parent 5515191eff
commit d116fef653
693 changed files with 1810 additions and 1201 deletions

View File

@ -1,9 +1,3 @@
- Traducciones: Quiero que audites todo el código para extraer y reunir todas las cadenas de traducciones en ficheros JSON. El modelo a seguir es el módulo "core". En "modules/core/src/common/locales" se pueden ver los fichero "es.json" y "en.json" con las cadenas de cada idioma. Quiero lo mismo para el resto de módulos. Asi es más facil de mantener y de añadir nuevos idiomas ya que todo está localizado en un mismo sitio.
- Quiero añadir una página "Home" a modo de tablero inicial o dashboard inicial. Quiero que en esa página inicial se muestre información resumen para que el usuario, cuando entre, se haga una idea de la situación de un vistazo. Revisa si hay una pagina similar en otras aplicaciones similares del mercado y muestra en una lista sugerencias de la información a presentar. No cambies nada.
- Quiero que reestructures el código relativo a la parte web de los módulos. Es decir, el codigo que esá en el directorio: - Quiero que reestructures el código relativo a la parte web de los módulos. Es decir, el codigo que esá en el directorio:
```plaintext ```plaintext

View File

@ -10,12 +10,12 @@ import { renderToStaticMarkup } from "react-dom/server";
import { I18nextProvider } from "react-i18next"; import { I18nextProvider } from "react-i18next";
import { import {
DashboardNavigationButton,
DashboardStateBadge,
DashboardTable,
dashboardKeys, dashboardKeys,
entryDestination, entryDestination,
} from "../../../modules/companies/src/web/components/dashboard-api"; } from "../../../modules/companies/src/web/dashboard";
import { DashboardNavigationButton } from "../../../modules/companies/src/web/components/dashboard-navigation-button";
import { DashboardStateBadge } from "../../../modules/companies/src/web/components/dashboard-state-badge";
import { DashboardTable } from "../../../modules/companies/src/web/components/dashboard-table";
import { App } from "./app"; import { App } from "./app";
import { createAppI18n } from "./i18n"; import { createAppI18n } from "./i18n";

View File

@ -20,6 +20,10 @@ packages/
Los módulos funcionales seguirán esta estructura. Dentro de api, crear domain, application e infrastructure cuando existan responsabilidades que lo requieran. Los módulos funcionales seguirán esta estructura. Dentro de api, crear domain, application e infrastructure cuando existan responsabilidades que lo requieran.
Dentro de `web`, el código se organiza por entidad o área funcional y después por operación,
con ámbitos compartidos e índices explícitos según la
[estructura web por entidades y operaciones](../estructura-web-por-entidades-y-operaciones.md).
La primera entrega solo comprueba la vida del proceso. No hay reglas de negocio, agregados, repositorios ni casos de uso artificiales para esta comprobación técnica. La primera entrega solo comprueba la vida del proceso. No hay reglas de negocio, agregados, repositorios ni casos de uso artificiales para esta comprobación técnica.
## Dependencias ## Dependencias

View File

@ -112,6 +112,9 @@ BrandSelect, dentro del módulo assets, adapta SelectWithAction al catálogo rem
## Componentes modales de los módulos ## Componentes modales de los módulos
La ubicación de componentes, formularios y clientes HTTP sigue la
[estructura web por entidades y operaciones](estructura-web-por-entidades-y-operaciones.md).
El [inventario de modales](inventario-de-modales.md) localiza las interacciones de alta, edición, El [inventario de modales](inventario-de-modales.md) localiza las interacciones de alta, edición,
copia, confirmación, detalle, historial, selección, ayuda y configuración, incluyendo las altas copia, confirmación, detalle, historial, selección, ayuda y configuración, incluyendo las altas
rápidas dentro de otros formularios. La regla normativa de organización reside en AGENTS.md. rápidas dentro de otros formularios. La regla normativa de organización reside en AGENTS.md.
@ -193,7 +196,7 @@ dependientes de la cabecera que lo contiene.
## Avatar de iniciales ## Avatar de iniciales
`InitialsAvatar` (`modules/companies/src/web/components/initials-avatar.tsx`) es un `InitialsAvatar` (`modules/companies/src/web/shared/ui/initials-avatar.tsx`) es un
componente visual sin dependencias de compañías, DTO ni consultas. Recibe `name` componente visual sin dependencias de compañías, DTO ni consultas. Recibe `name`
y atributos de span; admite `className` para tamaño y `aria-hidden` cuando el y atributos de span; admite `className` para tamaño y `aria-hidden` cuando el
control contenedor ya tiene nombre accesible. Se reutiliza en las compañías de control contenedor ya tiene nombre accesible. Se reutiliza en las compañías de

View File

@ -0,0 +1,118 @@
# Estructura web por entidades y operaciones
El código de navegador de cada módulo se organiza primero por entidad o área funcional y,
dentro de ella, por las operaciones existentes. Esta estructura se aplica a `core`, `identity`,
`assets`, `resources` y `companies`. No modifica la composición del servidor ni los contratos HTTP.
## Ubicación de las responsabilidades
Ejemplo real de tickets en `modules/companies/src/web/`:
```text
tickets/
create/
ui/
intervention-ticket-create-dialog.tsx
ticket-quick-editor.tsx
ticket-quick-forms.tsx
ticket-target-create-dialog.tsx
index.ts
index.ts
detail/
ui/
ticket-detail.tsx
ticket-detail-dialog.tsx
index.ts
index.ts
list/
ui/
tickets-page.tsx
index.ts
index.ts
shared/
api/
ticket-api.ts
index.ts
ui/
ticket-form.tsx
ticket-editor-dialog.tsx
ticket-targets.tsx
ticket-classification-fields.tsx
ticket-feedback.tsx
ticket-help.tsx
index.ts
tickets.test.tsx
index.ts
index.ts
```
El árbol muestra las ubicaciones, no implica exportar todos los ficheros. Los índices declaran
únicamente los símbolos que sus consumidores necesitan. Las operaciones sin una responsabilidad
propia no reciben directorios vacíos: por ejemplo, el editor común de alta y edición permanece
en `tickets/shared/ui/`.
- `ui`: componentes y formularios existentes. Un componente principal por fichero, sin nuevas
subdivisiones de JSX trivial.
- `api`: funciones de acceso HTTP y claves de consultas existentes.
- `controllers` y `hooks`: responsabilidades React ya separadas en el código original, como
`catalog/shared/controllers/use-catalog-save.ts` y
`work-environments/detail/hooks/use-environment-queries.ts`.
- `types` y `helpers`: contratos y cálculos existentes, próximos a sus consumidores.
- `<entity>/shared`: código utilizado por varias operaciones de la misma entidad y pruebas
que cubren conjuntamente esas operaciones.
- `web/shared`: recursos de varias entidades del módulo, incluidas traducciones y componentes
comunes. No sustituye a `common`, que sigue conteniendo contratos y schemas compartidos con
el servidor.
No se han creado controllers, hooks, schemas ni adapters para trasladar lógica desde los
componentes. Esa auditoría queda para una tarea posterior. Las props y los schemas que ya
pertenecían a sus ficheros mantienen su contrato y ubicación relativa a la responsabilidad.
## Entidades y ámbitos compartidos
Los listados, detalles, altas específicas e historiales se sitúan en `list`, `detail`, `create`
y `history`. Las operaciones particulares conservan nombres explícitos, como `change-logo`,
`change`, `start`, `update` o `end`.
Áreas antes agrupadas por una categoría amplia quedan identificadas por sus entidades:
`mailboxes`, `mailbox-uses` y `mail-configurations`; `work-profiles` y `work-environments`;
`processes` y `process-templates`; `interventions` e `intervention-templates`.
Los componentes de dashboard y workspace siguen el mismo criterio funcional.
Los formularios y diálogos que sirven tanto para crear como para editar se mantienen en el
`shared/ui` de su entidad. No se duplican ni se introducen wrappers de alta y edición sin
comportamiento propio. Un diálogo de alta de tickets pertenece a `tickets/create`, aunque
se abra desde una intervención; el consumidor no determina la identidad del componente.
Los clientes HTTP existentes que abarcan varias entidades permanecen en el ámbito compartido
adecuado: por ejemplo, `identity/shared/api/identity-api.ts` y
`assets/shared/api/inventory-api.ts`. Separar sus métodos o auditar su lógica excede esta
reorganización. Las funciones, firmas y claves de consultas no cambian.
## Índices y dependencias
Cada nivel con un contrato consumido desde otra unidad dispone de un `index.ts` que enumera
sus exportaciones. No se crean índices vacíos, exportaciones `*`, exportaciones de tests ni
índices para detalles privados utilizados exclusivamente dentro de su propio directorio.
Los tipos se reexportan mediante `export type`.
Los consumidores utilizan el índice de la unidad correspondiente cuando ello no añade ciclos.
Los imports entre ficheros de la misma unidad permanecen directos. También se conservan
imports directos específicos cuando un índice agregado añadiría un ciclo de dependencias,
por ejemplo en flujos de altas anidadas. No se amplía la API pública para resolver esas
dependencias internas.
`web/index.ts` mantiene los símbolos públicos originales de `@metis/<module>/client` y
compone los índices internos. Las aplicaciones y otros módulos continúan utilizando ese
contrato público. Los antiguos caminos internos no tienen reexports de compatibilidad.
## Pruebas y mantenimiento
Las pruebas existentes acompañan al ámbito que comprueban. Los scripts de cada paquete
referencian sus nuevas ubicaciones; los imports, traducciones y enlaces de documentación
se actualizan junto con los movimientos.
Para futuros cambios, consultar también [componentes de interfaz](componentes-de-interfaz.md),
[inventario de modales](inventario-de-modales.md), [patrón de listados](patron-de-listados-de-entidades.md)
y [pruebas](arquitectura/pruebas.md). No trasladar una responsabilidad compartida a una
operación concreta ni extraer lógica nueva únicamente para reproducir un árbol de directorios.

View File

@ -35,137 +35,142 @@ recuperar desde Git.
## Componentes por área ## Componentes por área
Las rutas reflejan la [estructura por entidades y operaciones](estructura-web-por-entidades-y-operaciones.md).
### modules/assets/src/web ### modules/assets/src/web
- [AssetDetailDialog](../modules/assets/src/web/asset-detail-dialog.tsx) - [AssetDetailDialog](../modules/assets/src/web/assets/detail/ui/asset-detail-dialog.tsx)
- [AssetEditorDialog](../modules/assets/src/web/asset-editor-dialog.tsx) - [AssetEditorDialog](../modules/assets/src/web/assets/shared/ui/asset-editor-dialog.tsx)
- [BrandEditorDialog](../modules/assets/src/web/brand-editor-dialog.tsx) - [BrandEditorDialog](../modules/assets/src/web/brands/shared/ui/brand-editor-dialog.tsx)
- [CatalogDefinitionDialog](../modules/assets/src/web/catalog-definition-dialog.tsx) - [CatalogDefinitionDialog](../modules/assets/src/web/catalog/detail/ui/catalog-definition-dialog.tsx)
- [CatalogEditorDialog](../modules/assets/src/web/catalog-editor-dialog.tsx) - [CatalogEditorDialog](../modules/assets/src/web/catalog/shared/ui/catalog-editor-dialog.tsx)
- [CatalogFieldCreateDialog](../modules/assets/src/web/catalog-field-create-dialog.tsx) - [CatalogFieldCreateDialog](../modules/assets/src/web/catalog-fields/create/ui/catalog-field-create-dialog.tsx)
- [CatalogRelationCreateDialog](../modules/assets/src/web/catalog-relation-create-dialog.tsx) - [CatalogRelationCreateDialog](../modules/assets/src/web/catalog-relations/create/ui/catalog-relation-create-dialog.tsx)
- [CatalogTemplateCreateDialog](../modules/assets/src/web/catalog-template-create-dialog.tsx) - [CatalogTemplateCreateDialog](../modules/assets/src/web/catalog-templates/create/ui/catalog-template-create-dialog.tsx)
- [EndRelationshipDialog](../modules/assets/src/web/end-relationship-dialog.tsx) - [EndRelationshipDialog](../modules/assets/src/web/asset-relationships/end/ui/end-relationship-dialog.tsx)
- [RelationshipEditorDialog](../modules/assets/src/web/relationship-editor-dialog.tsx) - [RelationshipEditorDialog](../modules/assets/src/web/asset-relationships/shared/ui/relationship-editor-dialog.tsx)
- [SupportConnectionEditorDialog](../modules/assets/src/web/support-connection-editor-dialog.tsx) - [SupportConnectionEditorDialog](../modules/assets/src/web/support-connections/shared/ui/support-connection-editor-dialog.tsx)
- [SupportHistoryDialog](../modules/assets/src/web/support-history-dialog.tsx) - [SupportHistoryDialog](../modules/assets/src/web/support-connections/history/ui/support-history-dialog.tsx)
- [SupportToolEditorDialog](../modules/assets/src/web/support-tool-editor-dialog.tsx) - [SupportToolEditorDialog](../modules/assets/src/web/support-tools/shared/ui/support-tool-editor-dialog.tsx)
- [SupportToolsDialog](../modules/assets/src/web/support-tools-dialog.tsx) - [SupportToolsDialog](../modules/assets/src/web/support-tools/list/ui/support-tools-dialog.tsx)
- [WorkstationAssetCreateDialog](../modules/assets/src/web/workstation-asset-create-dialog.tsx) - [WorkstationAssetCreateDialog](../modules/assets/src/web/assets/create/ui/workstation-asset-create-dialog.tsx)
- [WorkstationEditorDialog](../modules/assets/src/web/workstation-editor-dialog.tsx) - [WorkstationEditorDialog](../modules/assets/src/web/workstations/shared/ui/workstation-editor-dialog.tsx)
- [WorkstationHistoryDialog](../modules/assets/src/web/workstation-history-dialog.tsx) - [WorkstationHistoryDialog](../modules/assets/src/web/workstations/history/ui/workstation-history-dialog.tsx)
### modules/companies/src/web/access ### modules/companies/src/web/access
- [AccessEditorDialog](../modules/companies/src/web/access/access-editor-dialog.tsx) - [AccessEditorDialog](../modules/companies/src/web/access/shared/ui/access-editor-dialog.tsx)
- [AccessHelpDialog](../modules/companies/src/web/access/access-help-dialog.tsx) - [AccessHelpDialog](../modules/companies/src/web/access/help/ui/access-help-dialog.tsx)
- [AccessHistory](../modules/companies/src/web/access/access-history.tsx) - [AccessHistory](../modules/companies/src/web/access/history/ui/access-history.tsx)
- [AccessQuickEditor](../modules/companies/src/web/access/access-quick-editor.tsx) - [AccessQuickEditor](../modules/companies/src/web/access/create/ui/access-quick-editor.tsx)
- [QuickCreateDialog](../modules/companies/src/web/access/quick-create-dialog.tsx) - [QuickCreateDialog](../modules/companies/src/web/access/create/ui/quick-create-dialog.tsx)
### modules/companies/src/web/applications ### modules/companies/src/web/application-configurations
- [ApplicationConfigurationEditorDialog](../modules/companies/src/web/applications/application-configuration-editor-dialog.tsx) - [ApplicationConfigurationEditorDialog](../modules/companies/src/web/application-configurations/shared/ui/application-configuration-editor-dialog.tsx)
- [ApplicationHistoryDialog](../modules/companies/src/web/applications/application-history-dialog.tsx) - [ApplicationHistoryDialog](../modules/companies/src/web/application-configurations/history/ui/application-history-dialog.tsx)
- [ApplicationQuickEditor](../modules/companies/src/web/applications/application-quick-editor.tsx) - [ApplicationQuickEditor](../modules/companies/src/web/application-configurations/create/ui/application-quick-editor.tsx)
### modules/companies/src/web/certificates ### modules/companies/src/web/certificate-configurations
- [CertificateConfigurationEditorDialog](../modules/companies/src/web/certificates/certificate-configuration-editor-dialog.tsx) - [CertificateConfigurationEditorDialog](../modules/companies/src/web/certificate-configurations/shared/ui/certificate-configuration-editor-dialog.tsx)
- [CertificateHistoryDialog](../modules/companies/src/web/certificates/certificate-history-dialog.tsx) - [CertificateHistoryDialog](../modules/companies/src/web/certificate-configurations/history/ui/certificate-history-dialog.tsx)
- [CertificateQuickEditor](../modules/companies/src/web/certificates/certificate-quick-editor.tsx) - [CertificateQuickEditor](../modules/companies/src/web/certificate-configurations/create/ui/certificate-quick-editor.tsx)
### modules/companies/src/web/components ### Compañías, organización, dashboard y workspace de companies
- [AssignmentEditorDialog](../modules/companies/src/web/components/assignment-editor-dialog.tsx) - [AssignmentEditorDialog](../modules/companies/src/web/assignments/shared/ui/assignment-editor-dialog.tsx)
- [AssignmentHistoryDialog](../modules/companies/src/web/components/assignment-history-dialog.tsx) - [AssignmentHistoryDialog](../modules/companies/src/web/assignments/history/ui/assignment-history-dialog.tsx)
- [CompanyEditorDialog](../modules/companies/src/web/components/company-editor-dialog.tsx) - [CompanyEditorDialog](../modules/companies/src/web/companies/shared/ui/company-editor-dialog.tsx)
- [ConfigurationQuickEditor](../modules/companies/src/web/components/configuration-quick-editor.tsx) - [ConfigurationQuickEditor](../modules/companies/src/web/shared/ui/configuration-quick-editor.tsx)
- [DashboardDetailsDialog](../modules/companies/src/web/components/dashboard-details-dialog.tsx) - [DashboardDetailsDialog](../modules/companies/src/web/dashboard/detail/ui/dashboard-details-dialog.tsx)
- [DashboardQuickCreate](../modules/companies/src/web/components/dashboard-quick-create.tsx) - [DashboardQuickCreate](../modules/companies/src/web/dashboard/create/ui/dashboard-quick-create.tsx)
- [DepartmentEditorDialog](../modules/companies/src/web/components/department-editor-dialog.tsx) - [DepartmentEditorDialog](../modules/companies/src/web/departments/shared/ui/department-editor-dialog.tsx)
- [InventoryQuickCreateDialog](../modules/companies/src/web/components/inventory-quick-create-dialog.tsx) - [InventoryQuickCreateDialog](../modules/companies/src/web/companies/detail/ui/inventory-quick-create-dialog.tsx)
- [PersonEditorDialog](../modules/companies/src/web/components/person-editor-dialog.tsx) - [PersonEditorDialog](../modules/companies/src/web/people/shared/ui/person-editor-dialog.tsx)
- [SiteEditorDialog](../modules/companies/src/web/components/site-editor-dialog.tsx) - [SiteEditorDialog](../modules/companies/src/web/sites/shared/ui/site-editor-dialog.tsx)
- [WorkspaceSettingsDialog](../modules/companies/src/web/components/workspace-settings-dialog.tsx) - [WorkspaceSettingsDialog](../modules/companies/src/web/workspace/settings/ui/workspace-settings-dialog.tsx)
### modules/companies/src/web/folders ### modules/companies/src/web/folder-mappings
- [FolderMappingEditorDialog](../modules/companies/src/web/folders/folder-mapping-editor-dialog.tsx) - [FolderMappingEditorDialog](../modules/companies/src/web/folder-mappings/shared/ui/folder-mapping-editor-dialog.tsx)
- [FolderMappingHistoryDialog](../modules/companies/src/web/folders/folder-mapping-history-dialog.tsx) - [FolderMappingHistoryDialog](../modules/companies/src/web/folder-mappings/history/ui/folder-mapping-history-dialog.tsx)
- [FolderQuickEditor](../modules/companies/src/web/folders/folder-quick-editor.tsx) - [FolderQuickEditor](../modules/companies/src/web/folder-mappings/create/ui/folder-quick-editor.tsx)
### modules/companies/src/web/intervention-templates ### modules/companies/src/web/intervention-templates
- [InterventionTemplateEditorDialog](../modules/companies/src/web/intervention-templates/intervention-template-editor-dialog.tsx) - [InterventionTemplateCreateDialog](../modules/companies/src/web/intervention-templates/create/ui/intervention-template-create-dialog.tsx)
- [InterventionTemplateEditorDialog](../modules/companies/src/web/intervention-templates/shared/ui/intervention-template-editor-dialog.tsx)
### modules/companies/src/web/interventions ### modules/companies/src/web/interventions
- [InterventionDetailDialog](../modules/companies/src/web/interventions/intervention-detail-dialog.tsx) - [InterventionDetailDialog](../modules/companies/src/web/interventions/detail/ui/intervention-detail-dialog.tsx)
- [InterventionEditorDialog](../modules/companies/src/web/interventions/intervention-editor-dialog.tsx) - [InterventionEditorDialog](../modules/companies/src/web/interventions/shared/ui/intervention-editor-dialog.tsx)
- [InterventionTemplateCreateDialog](../modules/companies/src/web/interventions/intervention-template-create-dialog.tsx) - [TicketInterventionDialog](../modules/companies/src/web/interventions/create/ui/ticket-intervention-dialog.tsx)
- [InterventionTicketCreateDialog](../modules/companies/src/web/interventions/intervention-ticket-create-dialog.tsx)
### modules/companies/src/web/mail ### Buzones, usos y configuraciones de correo de companies
- [MailboxCreateDialog](../modules/companies/src/web/mail/mailbox-create-dialog.tsx) - [MailboxCreateDialog](../modules/companies/src/web/mailboxes/create/ui/mailbox-create-dialog.tsx)
- [MailboxUseEditorDialog](../modules/companies/src/web/mail/mailbox-use-editor-dialog.tsx) - [MailboxUseEditorDialog](../modules/companies/src/web/mailbox-uses/shared/ui/mailbox-use-editor-dialog.tsx)
- [MailConfigurationEditorDialog](../modules/companies/src/web/mail/mail-configuration-editor-dialog.tsx) - [MailConfigurationEditorDialog](../modules/companies/src/web/mail-configurations/shared/ui/mail-configuration-editor-dialog.tsx)
- [MailConfigurationHistoryDialog](../modules/companies/src/web/mail/mail-configuration-history-dialog.tsx) - [MailConfigurationHistoryDialog](../modules/companies/src/web/mail-configurations/history/ui/mail-configuration-history-dialog.tsx)
- [MailQuickEditor](../modules/companies/src/web/mail/mail-quick-editor.tsx) - [MailQuickEditor](../modules/companies/src/web/mail-configurations/create/ui/mail-quick-editor.tsx)
### modules/companies/src/web/printers ### modules/companies/src/web/printer-configurations
- [PrinterConfigurationEditorDialog](../modules/companies/src/web/printers/printer-configuration-editor-dialog.tsx) - [PrinterConfigurationEditorDialog](../modules/companies/src/web/printer-configurations/shared/ui/printer-configuration-editor-dialog.tsx)
- [PrinterHistoryDialog](../modules/companies/src/web/printers/printer-history-dialog.tsx) - [PrinterHistoryDialog](../modules/companies/src/web/printer-configurations/history/ui/printer-history-dialog.tsx)
- [PrinterProfileCreateDialog](../modules/companies/src/web/printers/printer-profile-create-dialog.tsx) - [PrinterProfileCreateDialog](../modules/companies/src/web/printer-configurations/create/ui/printer-profile-create-dialog.tsx)
### modules/companies/src/web/processes ### modules/companies/src/web/processes
- [ProcessEditDialog](../modules/companies/src/web/processes/process-edit-dialog.tsx) - [ProcessEditDialog](../modules/companies/src/web/processes/update/ui/process-edit-dialog.tsx)
- [ProcessQuickCreateDialog](../modules/companies/src/web/processes/process-quick-create-dialog.tsx) - [ProcessQuickCreateDialog](../modules/companies/src/web/processes/create/ui/process-quick-create-dialog.tsx)
- [ProcessStartDialog](../modules/companies/src/web/processes/process-start-dialog.tsx) - [ProcessStartDialog](../modules/companies/src/web/processes/start/ui/process-start-dialog.tsx)
- [ProcessTemplateEditorDialog](../modules/companies/src/web/processes/process-template-editor-dialog.tsx)
### modules/companies/src/web/profiles ### modules/companies/src/web/process-templates
- [WorkProfileEditorDialog](../modules/companies/src/web/profiles/work-profile-editor-dialog.tsx) - [ProcessTemplateEditorDialog](../modules/companies/src/web/process-templates/shared/ui/process-template-editor-dialog.tsx)
- [WorkProfileHistoryDialog](../modules/companies/src/web/profiles/work-profile-history-dialog.tsx)
### modules/companies/src/web/remote ### modules/companies/src/web/work-profiles
- [RemoteConnectionEditorDialog](../modules/companies/src/web/remote/remote-connection-editor-dialog.tsx) - [WorkProfileEditorDialog](../modules/companies/src/web/work-profiles/shared/ui/work-profile-editor-dialog.tsx)
- [RemoteConnectionHistoryDialog](../modules/companies/src/web/remote/remote-connection-history-dialog.tsx) - [WorkProfileHistoryDialog](../modules/companies/src/web/work-profiles/history/ui/work-profile-history-dialog.tsx)
- [RemoteQuickEditor](../modules/companies/src/web/remote/remote-quick-editor.tsx)
### modules/companies/src/web/telework ### modules/companies/src/web/remote-connections
- [TeleworkAuthorizationEditorDialog](../modules/companies/src/web/telework/telework-authorization-editor-dialog.tsx) - [RemoteConnectionEditorDialog](../modules/companies/src/web/remote-connections/shared/ui/remote-connection-editor-dialog.tsx)
- [TeleworkAuthorizationHistoryDialog](../modules/companies/src/web/telework/telework-authorization-history-dialog.tsx) - [RemoteConnectionHistoryDialog](../modules/companies/src/web/remote-connections/history/ui/remote-connection-history-dialog.tsx)
- [RemoteQuickEditor](../modules/companies/src/web/remote-connections/create/ui/remote-quick-editor.tsx)
### modules/companies/src/web/telework-authorizations
- [TeleworkAuthorizationEditorDialog](../modules/companies/src/web/telework-authorizations/shared/ui/telework-authorization-editor-dialog.tsx)
- [TeleworkAuthorizationHistoryDialog](../modules/companies/src/web/telework-authorizations/history/ui/telework-authorization-history-dialog.tsx)
### modules/companies/src/web/tickets ### modules/companies/src/web/tickets
- [TicketDetailDialog](../modules/companies/src/web/tickets/ticket-detail-dialog.tsx) - [InterventionTicketCreateDialog](../modules/companies/src/web/tickets/create/ui/intervention-ticket-create-dialog.tsx)
- [TicketEditorDialog](../modules/companies/src/web/tickets/ticket-editor-dialog.tsx) - [TicketDetailDialog](../modules/companies/src/web/tickets/detail/ui/ticket-detail-dialog.tsx)
- [TicketInterventionDialog](../modules/companies/src/web/tickets/ticket-intervention-dialog.tsx) - [TicketEditorDialog](../modules/companies/src/web/tickets/shared/ui/ticket-editor-dialog.tsx)
- [TicketQuickEditor](../modules/companies/src/web/tickets/ticket-quick-editor.tsx) - [TicketQuickEditor](../modules/companies/src/web/tickets/create/ui/ticket-quick-editor.tsx)
- [TicketQuickForms](../modules/companies/src/web/tickets/ticket-quick-forms.tsx) - [TicketQuickForms](../modules/companies/src/web/tickets/create/ui/ticket-quick-forms.tsx)
- [TicketTargetCreateDialog](../modules/companies/src/web/tickets/ticket-target-create-dialog.tsx) - [TicketTargetCreateDialog](../modules/companies/src/web/tickets/create/ui/ticket-target-create-dialog.tsx)
### modules/identity/src/web/components ### modules/identity/src/web
- [AccountPasswordDialog](../modules/identity/src/web/components/account-password-dialog.tsx) - [AccountPasswordDialog](../modules/identity/src/web/passwords/change/ui/account-password-dialog.tsx)
- [UserEditorDialog](../modules/identity/src/web/components/user-editor-dialog.tsx) - [UserEditorDialog](../modules/identity/src/web/users/shared/ui/user-editor-dialog.tsx)
- [UserManagementDialog](../modules/identity/src/web/components/user-management-dialog.tsx) - [UserManagementDialog](../modules/identity/src/web/users/list/ui/user-management-dialog.tsx)
### modules/resources/src/web ### modules/resources/src/web
- [CatalogDefinitionDialog](../modules/resources/src/web/catalog-definition-dialog.tsx) - [CatalogDefinitionDialog](../modules/resources/src/web/catalog/detail/ui/catalog-definition-dialog.tsx)
- [CatalogEditorDialog](../modules/resources/src/web/catalog-editor-dialog.tsx) - [CatalogEditorDialog](../modules/resources/src/web/catalog/shared/ui/catalog-editor-dialog.tsx)
- [CatalogFieldCreateDialog](../modules/resources/src/web/catalog-field-create-dialog.tsx) - [CatalogFieldCreateDialog](../modules/resources/src/web/catalog-fields/create/ui/catalog-field-create-dialog.tsx)
- [CatalogTemplateCreateDialog](../modules/resources/src/web/catalog-template-create-dialog.tsx) - [CatalogTemplateCreateDialog](../modules/resources/src/web/catalog-templates/create/ui/catalog-template-create-dialog.tsx)
- [ResourceDetailDialog](../modules/resources/src/web/resource-detail-dialog.tsx) - [ResourceDetailDialog](../modules/resources/src/web/resources/detail/ui/resource-detail-dialog.tsx)
- [ResourceEditorDialog](../modules/resources/src/web/resource-editor-dialog.tsx) - [ResourceEditorDialog](../modules/resources/src/web/resources/shared/ui/resource-editor-dialog.tsx)
## Comprobaciones y límites ## Comprobaciones y límites

View File

@ -90,10 +90,10 @@ garantía de ausencia de cualquier defecto posible.
## Archivos especialmente modificados ## Archivos especialmente modificados
- modules/companies/src/web/components/companies-workspace.tsx, dashboard-page.tsx y sus - modules/companies/src/web/workspace/ y modules/companies/src/web/dashboard/: espacio de
componentes de navegación, búsqueda y paneles. trabajo, página del dashboard y componentes de navegación, búsqueda y paneles.
- modules/companies/src/web/access/access-form.tsx, access-form-fields.tsx, - modules/companies/src/web/access/: formularios en shared/ui, altas rápidas en create/ui
access-quick-editor.tsx y access-workspace.tsx. y listado en list/ui.
- Listados y formularios de companies, assets y resources: diálogos editor/detail/history/create - Listados y formularios de companies, assets y resources: diálogos editor/detail/history/create
próximos a cada funcionalidad, enumerados en el inventario de modales. próximos a cada funcionalidad, enumerados en el inventario de modales.
- modules/identity/src/web/components: composición del espacio, gestión de usuarios y - modules/identity/src/web/components: composición del espacio, gestión de usuarios y

View File

@ -10,7 +10,7 @@
}, },
"scripts": { "scripts": {
"typecheck": "tsc -p tsconfig.json", "typecheck": "tsc -p tsconfig.json",
"test": "TSX_TSCONFIG_PATH=../../tsconfig.json node --import tsx --test src/api/domain/asset-catalog.test.ts src/api/domain/asset.test.ts src/api/domain/workstation.test.ts src/api/domain/asset-relationship.test.ts src/web/catalog.test.tsx src/web/inventory.test.tsx src/api/domain/support.test.ts src/web/support.test.tsx src/api/domain/brand.test.ts src/web/brands.test.tsx" "test": "TSX_TSCONFIG_PATH=../../tsconfig.json node --import tsx --test src/api/domain/asset-catalog.test.ts src/api/domain/asset.test.ts src/api/domain/workstation.test.ts src/api/domain/asset-relationship.test.ts src/web/catalog/shared/catalog.test.tsx src/web/assets/shared/inventory.test.tsx src/api/domain/support.test.ts src/web/support-connections/shared/support.test.tsx src/api/domain/brand.test.ts src/web/brands/shared/brands.test.tsx"
}, },
"dependencies": { "dependencies": {
"@repo/rdx-ddd": "workspace:*", "@repo/rdx-ddd": "workspace:*",

View File

@ -0,0 +1 @@
export { EndRelationshipDialog } from "./ui";

View File

@ -3,10 +3,8 @@ import { FormActions, FormDialog } from "@repo/shadcn-ui/components/form-dialog"
import { useMutation, useQueryClient } from "@tanstack/react-query"; import { useMutation, useQueryClient } from "@tanstack/react-query";
import { useTranslation } from "react-i18next"; import { useTranslation } from "react-i18next";
import type { RelationshipDTO } from "../common"; import type { RelationshipDTO } from "../../../../common";
import { InventoryFeedback, inventoryApi, inventoryKeys } from "../../../shared";
import { inventoryApi, inventoryKeys } from "./inventory-api";
import { InventoryFeedback } from "./inventory-feedback";
export function EndRelationshipDialog({ export function EndRelationshipDialog({
relationship, relationship,

View File

@ -0,0 +1 @@
export { EndRelationshipDialog } from "./end-relationship-dialog";

View File

@ -0,0 +1 @@
export { AssetRelationships } from "./list";

View File

@ -0,0 +1 @@
export { AssetRelationships } from "./ui";

View File

@ -3,11 +3,10 @@ import { useQuery } from "@tanstack/react-query";
import { useState } from "react"; import { useState } from "react";
import { useTranslation } from "react-i18next"; import { useTranslation } from "react-i18next";
import type { RelationshipDTO } from "../common"; import type { RelationshipDTO } from "../../../../common";
import { inventoryApi, inventoryKeys } from "../../../shared";
import { EndRelationshipDialog } from "./end-relationship-dialog"; import { EndRelationshipDialog } from "../../end";
import { inventoryApi, inventoryKeys } from "./inventory-api"; import { RelationshipEditorDialog } from "../../shared";
import { RelationshipEditorDialog } from "./relationship-editor-dialog";
export function AssetRelationships({ export function AssetRelationships({
companyId, companyId,

View File

@ -0,0 +1 @@
export { AssetRelationships } from "./asset-relationships";

View File

@ -0,0 +1 @@
export { RelationshipEditorDialog } from "./ui";

View File

@ -0,0 +1 @@
export { RelationshipEditorDialog } from "./relationship-editor-dialog";

View File

@ -8,12 +8,10 @@ import { useMutation, useQuery, useQueryClient } from "@tanstack/react-query";
import { useId, useState } from "react"; import { useId, useState } from "react";
import { useTranslation } from "react-i18next"; import { useTranslation } from "react-i18next";
import type { RelationshipInputDTO } from "../common"; import type { RelationshipInputDTO } from "../../../../common";
import { catalogApi, catalogKeys } from "../../../catalog";
import { catalogApi, catalogKeys } from "./catalog-api"; import { CatalogRelationCreateDialog } from "../../../catalog-relations";
import { CatalogRelationCreateDialog } from "./catalog-relation-create-dialog"; import { InventoryFeedback, inventoryApi, inventoryKeys } from "../../../shared";
import { inventoryApi, inventoryKeys } from "./inventory-api";
import { InventoryFeedback } from "./inventory-feedback";
export function RelationshipForm({ export function RelationshipForm({
companyId, companyId,

View File

@ -0,0 +1 @@
export { WorkstationAssetCreateDialog } from "./ui";

View File

@ -0,0 +1 @@
export { WorkstationAssetCreateDialog } from "./workstation-asset-create-dialog";

View File

@ -2,7 +2,7 @@ import { FormDialog } from "@repo/shadcn-ui/components/form-dialog";
import type { ComponentProps } from "react"; import type { ComponentProps } from "react";
import { useTranslation } from "react-i18next"; import { useTranslation } from "react-i18next";
import { AssetForm } from "./asset-form"; import { AssetForm } from "../../shared";
export function WorkstationAssetCreateDialog({ export function WorkstationAssetCreateDialog({
companyId, companyId,

View File

@ -0,0 +1 @@
export { AssetDetailDialog, AssetSelectionPanel } from "./ui";

View File

@ -2,9 +2,10 @@ import { FormDialog } from "@repo/shadcn-ui/components/form-dialog";
import type { ComponentProps } from "react"; import type { ComponentProps } from "react";
import { useTranslation } from "react-i18next"; import { useTranslation } from "react-i18next";
import { AssetRelationships } from "../../../asset-relationships";
import { AssetSupport } from "../../../support-connections";
import { AssetDetail } from "./asset-detail"; import { AssetDetail } from "./asset-detail";
import { AssetRelationships } from "./asset-relationships";
import { AssetSupport } from "./asset-support";
export function AssetDetailDialog({ export function AssetDetailDialog({
asset, asset,

View File

@ -2,10 +2,9 @@ import { useQuery } from "@tanstack/react-query";
import type { ReactNode } from "react"; import type { ReactNode } from "react";
import { useTranslation } from "react-i18next"; import { useTranslation } from "react-i18next";
import type { AssetDTO } from "../common/inventory"; import type { AssetDTO } from "../../../../common/inventory";
import { inventoryApi, inventoryKeys } from "../../../shared";
import type { InventoryLookups } from "./asset-form"; import type { InventoryLookups } from "../../shared";
import { inventoryApi, inventoryKeys } from "./inventory-api";
export function AssetDetail({ export function AssetDetail({
asset, asset,
lookups, lookups,

View File

@ -1,12 +1,12 @@
import { Button } from "@repo/shadcn-ui/components/button"; import { Button } from "@repo/shadcn-ui/components/button";
import { useTranslation } from "react-i18next"; import { useTranslation } from "react-i18next";
import type { AssetDTO } from "../common/inventory"; import type { AssetDTO } from "../../../../common/inventory";
import { AssetRelationships } from "../../../asset-relationships";
import { AssetSupport } from "../../../support-connections";
import type { InventoryLookups } from "../../shared";
import { AssetDetail } from "./asset-detail"; import { AssetDetail } from "./asset-detail";
import type { InventoryLookups } from "./asset-form";
import { AssetRelationships } from "./asset-relationships";
import { AssetSupport } from "./asset-support";
export function AssetSelectionPanel({ export function AssetSelectionPanel({
companyId, companyId,

View File

@ -0,0 +1,2 @@
export { AssetDetailDialog } from "./asset-detail-dialog";
export { AssetSelectionPanel } from "./asset-selection-panel";

View File

@ -0,0 +1,4 @@
export { WorkstationAssetCreateDialog } from "./create";
export { AssetInventoryPage } from "./list";
export type { InventoryLookups } from "./shared";
export { AssetForm } from "./shared";

View File

@ -0,0 +1 @@
export { AssetInventoryPage } from "./ui";

View File

@ -0,0 +1 @@
export { AssetInventoryPage } from "./inventory-page";

View File

@ -10,14 +10,11 @@ import { useQuery } from "@tanstack/react-query";
import { useState } from "react"; import { useState } from "react";
import { useTranslation } from "react-i18next"; import { useTranslation } from "react-i18next";
import { AssetDetailDialog } from "./asset-detail-dialog"; import { CatalogError, catalogApi, catalogKeys } from "../../../catalog";
import { AssetEditorDialog } from "./asset-editor-dialog"; import { InventoryFeedback, inventoryApi, inventoryKeys } from "../../../shared";
import type { InventoryLookups } from "./asset-form"; import { AssetDetailDialog, AssetSelectionPanel } from "../../detail";
import { AssetSelectionPanel } from "./asset-selection-panel"; import type { InventoryLookups } from "../../shared";
import { catalogApi, catalogKeys } from "./catalog-api"; import { AssetEditorDialog } from "../../shared";
import { CatalogError } from "./catalog-error";
import { inventoryApi, inventoryKeys } from "./inventory-api";
import { InventoryFeedback } from "./inventory-feedback";
export function AssetInventoryPage({ export function AssetInventoryPage({
companyId, companyId,

View File

@ -0,0 +1,2 @@
export type { InventoryLookups } from "./ui";
export { AssetEditorDialog, AssetForm } from "./ui";

View File

@ -9,21 +9,19 @@ import type { ReactNode } from "react";
import { renderToStaticMarkup } from "react-dom/server"; import { renderToStaticMarkup } from "react-dom/server";
import { I18nextProvider } from "react-i18next"; import { I18nextProvider } from "react-i18next";
import { buildCatalogResponse } from "../api/application/asset-catalog-response.builder"; import { buildCatalogResponse } from "../../../api/application/asset-catalog-response.builder";
import { AssetCatalog } from "../api/domain/asset-catalog.aggregate"; import { AssetCatalog } from "../../../api/domain/asset-catalog.aggregate";
import { seedAssetCatalog } from "../api/domain/asset-catalog-seed"; import { seedAssetCatalog } from "../../../api/domain/asset-catalog-seed";
import type { RelationshipDTO } from "../common"; import type { RelationshipDTO } from "../../../common";
import { AssetRelationships } from "../../asset-relationships";
import { catalogKeys } from "../../catalog";
import { CatalogRelationForm } from "../../catalog-relations";
import { CatalogTemplateForm } from "../../catalog-templates";
import { assetsEnglish, assetsSpanish, inventoryKeys } from "../../shared";
import { WorkstationForm, WorkstationsPage } from "../../workstations";
import { AssetInventoryPage } from "../list";
import { AssetForm } from "./asset-form"; import { AssetForm } from "./ui";
import { AssetRelationships } from "./asset-relationships";
import { catalogKeys } from "./catalog-api";
import { CatalogRelationForm } from "./catalog-relation-form";
import { CatalogTemplateForm } from "./catalog-template-form";
import { assetsEnglish, assetsSpanish } from "./i18n";
import { inventoryKeys } from "./inventory-api";
import { AssetInventoryPage } from "./inventory-page";
import { WorkstationForm } from "./workstation-form";
import { WorkstationsPage } from "./workstations-page";
const companyId = UniqueID.generateNewID().toPrimitive(); const companyId = UniqueID.generateNewID().toPrimitive();
const lookups = { const lookups = {

View File

@ -3,7 +3,7 @@ import { Label } from "@repo/shadcn-ui/components/label";
import { SelectWithAction } from "@repo/shadcn-ui/components/select-with-action"; import { SelectWithAction } from "@repo/shadcn-ui/components/select-with-action";
import { useTranslation } from "react-i18next"; import { useTranslation } from "react-i18next";
import type { AssetCharacteristic, AssetInput } from "../common/inventory"; import type { AssetCharacteristic, AssetInput } from "../../../../common/inventory";
type CharacteristicValue = AssetInput["characteristics"][string]; type CharacteristicValue = AssetInput["characteristics"][string];
export function AssetCharacteristicControl({ export function AssetCharacteristicControl({

View File

@ -11,15 +11,14 @@ import { useEffect, useId, useRef, useState } from "react";
import { useForm } from "react-hook-form"; import { useForm } from "react-hook-form";
import { useTranslation } from "react-i18next"; import { useTranslation } from "react-i18next";
import type { CatalogItemDTO } from "../common"; import type { CatalogItemDTO } from "../../../../common";
import type { AssetDTO, AssetInput } from "../common/inventory"; import type { AssetDTO, AssetInput } from "../../../../common/inventory";
import { AssetInputSchema, AssetStatusSchema } from "../common/inventory"; import { AssetInputSchema, AssetStatusSchema } from "../../../../common/inventory";
import { BrandSelect } from "../../../brands";
import { CatalogTemplateCreateDialog } from "../../../catalog-templates";
import { InventoryFeedback, inventoryApi, inventoryKeys } from "../../../shared";
import { AssetCharacteristicControl } from "./asset-characteristic-control"; import { AssetCharacteristicControl } from "./asset-characteristic-control";
import { BrandSelect } from "./brand-select";
import { CatalogTemplateCreateDialog } from "./catalog-template-create-dialog";
import { inventoryApi, inventoryKeys } from "./inventory-api";
import { InventoryFeedback } from "./inventory-feedback";
export type InventoryLookups = { export type InventoryLookups = {
sites: readonly { id: string; name: string }[]; sites: readonly { id: string; name: string }[];

View File

@ -0,0 +1,3 @@
export { AssetEditorDialog } from "./asset-editor-dialog";
export type { InventoryLookups } from "./asset-form";
export { AssetForm } from "./asset-form";

View File

@ -0,0 +1,2 @@
export { BrandCatalogPage } from "./list";
export { BrandSelect } from "./shared";

View File

@ -0,0 +1 @@
export { BrandCatalogPage } from "./ui";

View File

@ -11,10 +11,8 @@ import { useQuery } from "@tanstack/react-query";
import { useId, useState } from "react"; import { useId, useState } from "react";
import { useTranslation } from "react-i18next"; import { useTranslation } from "react-i18next";
import type { BrandDTO } from "../common/brands"; import type { BrandDTO } from "../../../../common/brands";
import { BrandEditorDialog, brandApi, brandKeys } from "../../shared";
import { brandApi, brandKeys } from "./brand-api";
import { BrandEditorDialog } from "./brand-editor-dialog";
export function BrandCatalogPage({ csrfToken }: { csrfToken: string }) { export function BrandCatalogPage({ csrfToken }: { csrfToken: string }) {
const { t, i18n } = useTranslation("assets"); const { t, i18n } = useTranslation("assets");

View File

@ -0,0 +1 @@
export { BrandCatalogPage } from "./brands-page";

View File

@ -1,7 +1,7 @@
import { z } from "zod/v4"; import { z } from "zod/v4";
import type { BrandInput } from "../common/brands"; import type { BrandInput } from "../../../../common/brands";
import { BrandResponseSchema, BrandsResponseSchema } from "../common/brands"; import { BrandResponseSchema, BrandsResponseSchema } from "../../../../common/brands";
export const brandKeys = { all: ["asset-brands"] as const }; export const brandKeys = { all: ["asset-brands"] as const };
export class BrandApiError extends Error { export class BrandApiError extends Error {
constructor(public readonly code: string) { constructor(public readonly code: string) {

View File

@ -0,0 +1 @@
export { BrandApiError, brandApi, brandKeys } from "./brand-api";

View File

@ -9,16 +9,15 @@ import type { ReactNode } from "react";
import { renderToStaticMarkup } from "react-dom/server"; import { renderToStaticMarkup } from "react-dom/server";
import { I18nextProvider } from "react-i18next"; import { I18nextProvider } from "react-i18next";
import { buildCatalogResponse } from "../api/application/asset-catalog-response.builder"; import { buildCatalogResponse } from "../../../api/application/asset-catalog-response.builder";
import { AssetCatalog } from "../api/domain/asset-catalog.aggregate"; import { AssetCatalog } from "../../../api/domain/asset-catalog.aggregate";
import { seedAssetCatalog } from "../api/domain/asset-catalog-seed"; import { seedAssetCatalog } from "../../../api/domain/asset-catalog-seed";
import { AssetForm } from "../../assets";
import { assetsEnglish, assetsSpanish } from "../../shared";
import { BrandCatalogPage } from "../list";
import { AssetForm } from "./asset-form"; import { brandKeys } from "./api";
import { brandKeys } from "./brand-api"; import { BrandForm, BrandSelect } from "./ui";
import { BrandForm } from "./brand-form";
import { BrandSelect } from "./brand-select";
import { BrandCatalogPage } from "./brands-page";
import { assetsEnglish, assetsSpanish } from "./i18n";
const brand = { const brand = {
id: UniqueID.generateNewID().toPrimitive(), id: UniqueID.generateNewID().toPrimitive(),

View File

@ -0,0 +1,2 @@
export { brandApi, brandKeys } from "./api";
export { BrandEditorDialog, BrandSelect } from "./ui";

View File

@ -9,10 +9,9 @@ import { useEffect, useId, useRef } from "react";
import { useForm } from "react-hook-form"; import { useForm } from "react-hook-form";
import { useTranslation } from "react-i18next"; import { useTranslation } from "react-i18next";
import type { BrandDTO, BrandInput } from "../common/brands"; import type { BrandDTO, BrandInput } from "../../../../common/brands";
import { BrandInputSchema } from "../common/brands"; import { BrandInputSchema } from "../../../../common/brands";
import { BrandApiError, brandApi, brandKeys } from "../api";
import { BrandApiError, brandApi, brandKeys } from "./brand-api";
export function BrandForm({ export function BrandForm({
csrfToken, csrfToken,

View File

@ -5,9 +5,9 @@ import { useQuery } from "@tanstack/react-query";
import { useState } from "react"; import { useState } from "react";
import { useTranslation } from "react-i18next"; import { useTranslation } from "react-i18next";
import type { BrandDTO } from "../common/brands"; import type { BrandDTO } from "../../../../common/brands";
import { brandApi, brandKeys } from "../api";
import { brandApi, brandKeys } from "./brand-api";
import { BrandEditorDialog } from "./brand-editor-dialog"; import { BrandEditorDialog } from "./brand-editor-dialog";
const LEGACY = "legacy"; const LEGACY = "legacy";

View File

@ -0,0 +1,3 @@
export { BrandEditorDialog } from "./brand-editor-dialog";
export { BrandForm } from "./brand-form";
export { BrandSelect } from "./brand-select";

View File

@ -0,0 +1 @@
export { CatalogFieldCreateDialog } from "./ui";

View File

@ -1,7 +1,7 @@
import { FormDialog } from "@repo/shadcn-ui/components/form-dialog"; import { FormDialog } from "@repo/shadcn-ui/components/form-dialog";
import { useTranslation } from "react-i18next"; import { useTranslation } from "react-i18next";
import { CatalogFieldForm } from "./catalog-form"; import { CatalogFieldForm } from "../../shared";
export function CatalogFieldCreateDialog({ export function CatalogFieldCreateDialog({
scope, scope,

View File

@ -0,0 +1 @@
export { CatalogFieldCreateDialog } from "./catalog-field-create-dialog";

View File

@ -0,0 +1,2 @@
export { CatalogFieldCreateDialog } from "./create";
export { CatalogFieldForm } from "./shared";

View File

@ -0,0 +1 @@
export { CatalogFieldForm } from "./ui";

View File

@ -10,13 +10,12 @@ import { useForm } from "react-hook-form";
import { useTranslation } from "react-i18next"; import { useTranslation } from "react-i18next";
import { z } from "zod/v4"; import { z } from "zod/v4";
import type { CatalogItemDTO } from "../common"; import type { CatalogItemDTO } from "../../../../common";
import { AssetDefinitionSchema, FieldTypeSchema } from "../common"; import { AssetDefinitionSchema, FieldTypeSchema } from "../../../../common";
import type { CatalogSaved } from "../../../catalog/shared/controllers";
import { CatalogError } from "./catalog-error"; import { useCatalogSave } from "../../../catalog/shared/controllers";
import { CatalogHelp } from "./catalog-help"; import { CatalogError } from "../../../catalog/shared/ui/catalog-error";
import type { CatalogSaved } from "./use-catalog-save"; import { CatalogHelp } from "../../../catalog/shared/ui/catalog-help";
import { useCatalogSave } from "./use-catalog-save";
const FieldFormSchema = AssetDefinitionSchema.options[0].omit({ choices: true }).extend({ const FieldFormSchema = AssetDefinitionSchema.options[0].omit({ choices: true }).extend({
choicesText: z.string().max(10000), choicesText: z.string().max(10000),

View File

@ -0,0 +1 @@
export { CatalogFieldForm } from "./catalog-form";

View File

@ -0,0 +1 @@
export { CatalogRelationCreateDialog } from "./ui";

View File

@ -1,7 +1,7 @@
import { FormDialog } from "@repo/shadcn-ui/components/form-dialog"; import { FormDialog } from "@repo/shadcn-ui/components/form-dialog";
import { useTranslation } from "react-i18next"; import { useTranslation } from "react-i18next";
import { CatalogRelationForm } from "./catalog-relation-form"; import { CatalogRelationForm } from "../../shared";
export function CatalogRelationCreateDialog({ export function CatalogRelationCreateDialog({
companyId, companyId,

View File

@ -0,0 +1 @@
export { CatalogRelationCreateDialog } from "./catalog-relation-create-dialog";

View File

@ -0,0 +1,2 @@
export { CatalogRelationCreateDialog } from "./create";
export { CatalogRelationForm } from "./shared";

View File

@ -0,0 +1 @@
export { CatalogRelationForm } from "./ui";

View File

@ -9,13 +9,12 @@ import { useForm } from "react-hook-form";
import { useTranslation } from "react-i18next"; import { useTranslation } from "react-i18next";
import type { z } from "zod/v4"; import type { z } from "zod/v4";
import type { CatalogItemDTO } from "../common"; import type { CatalogItemDTO } from "../../../../common";
import { AssetDefinitionSchema } from "../common"; import { AssetDefinitionSchema } from "../../../../common";
import type { CatalogSaved } from "../../../catalog/shared/controllers";
import { CatalogError } from "./catalog-error"; import { useCatalogSave } from "../../../catalog/shared/controllers";
import { CatalogHelp } from "./catalog-help"; import { CatalogError } from "../../../catalog/shared/ui/catalog-error";
import type { CatalogSaved } from "./use-catalog-save"; import { CatalogHelp } from "../../../catalog/shared/ui/catalog-help";
import { useCatalogSave } from "./use-catalog-save";
const schema = AssetDefinitionSchema.options[2]; const schema = AssetDefinitionSchema.options[2];
export function CatalogRelationForm({ export function CatalogRelationForm({

View File

@ -0,0 +1 @@
export { CatalogRelationForm } from "./catalog-relation-form";

View File

@ -0,0 +1 @@
export { CatalogTemplateCreateDialog } from "./ui";

View File

@ -2,7 +2,7 @@ import { FormDialog } from "@repo/shadcn-ui/components/form-dialog";
import type { ComponentProps } from "react"; import type { ComponentProps } from "react";
import { useTranslation } from "react-i18next"; import { useTranslation } from "react-i18next";
import { CatalogTemplateForm } from "./catalog-template-form"; import { CatalogTemplateForm } from "../../shared";
export function CatalogTemplateCreateDialog({ export function CatalogTemplateCreateDialog({
scope, scope,

View File

@ -0,0 +1 @@
export { CatalogTemplateCreateDialog } from "./catalog-template-create-dialog";

View File

@ -0,0 +1,2 @@
export { CatalogTemplateCreateDialog } from "./create";
export { CatalogTemplateForm } from "./shared";

View File

@ -0,0 +1 @@
export { CatalogTemplateForm } from "./ui";

View File

@ -11,14 +11,13 @@ import { useForm } from "react-hook-form";
import { useTranslation } from "react-i18next"; import { useTranslation } from "react-i18next";
import type { z } from "zod/v4"; import type { z } from "zod/v4";
import type { CatalogItemDTO } from "../common"; import type { CatalogItemDTO } from "../../../../common";
import { AssetDefinitionSchema } from "../common"; import { AssetDefinitionSchema } from "../../../../common";
import type { CatalogSaved } from "../../../catalog/shared/controllers";
import { CatalogError } from "./catalog-error"; import { useCatalogSave } from "../../../catalog/shared/controllers";
import { CatalogFieldCreateDialog } from "./catalog-field-create-dialog"; import { CatalogError } from "../../../catalog/shared/ui/catalog-error";
import { CatalogHelp } from "./catalog-help"; import { CatalogHelp } from "../../../catalog/shared/ui/catalog-help";
import type { CatalogSaved } from "./use-catalog-save"; import { CatalogFieldCreateDialog } from "../../../catalog-fields";
import { useCatalogSave } from "./use-catalog-save";
const TemplateFormSchema = AssetDefinitionSchema.options[1]; const TemplateFormSchema = AssetDefinitionSchema.options[1];
type TemplateFormValues = z.infer<typeof TemplateFormSchema>; type TemplateFormValues = z.infer<typeof TemplateFormSchema>;

View File

@ -0,0 +1 @@
export { CatalogTemplateForm } from "./catalog-template-form";

View File

@ -0,0 +1 @@
export { CatalogDefinitionDialog } from "./ui";

View File

@ -1,9 +1,8 @@
import { FormDialog } from "@repo/shadcn-ui/components/form-dialog"; import { FormDialog } from "@repo/shadcn-ui/components/form-dialog";
import { useTranslation } from "react-i18next"; import { useTranslation } from "react-i18next";
import type { CatalogItemDTO } from "../common"; import type { CatalogItemDTO } from "../../../../common";
import { CatalogHelp } from "../../shared";
import { CatalogHelp } from "./catalog-help";
export function CatalogDefinitionDialog({ export function CatalogDefinitionDialog({
item, item,
items, items,

View File

@ -0,0 +1 @@
export { CatalogDefinitionDialog } from "./catalog-definition-dialog";

View File

@ -0,0 +1,2 @@
export { AssetCatalogPage } from "./list";
export { CatalogError, catalogApi, catalogKeys } from "./shared";

View File

@ -0,0 +1 @@
export { AssetCatalogPage } from "./ui";

View File

@ -1,10 +1,10 @@
import { EntityRowActions, EntityStatus } from "@repo/shadcn-ui/components/entity-list"; import { EntityRowActions, EntityStatus } from "@repo/shadcn-ui/components/entity-list";
import { useTranslation } from "react-i18next"; import { useTranslation } from "react-i18next";
import type { CatalogItemDTO } from "../common"; import type { CatalogItemDTO } from "../../../../common";
import { CatalogName } from "../../shared";
import { CatalogDetails } from "./catalog-details"; import { CatalogDetails } from "./catalog-details";
import { CatalogName } from "./catalog-name";
import { CatalogRowActions } from "./catalog-row-actions"; import { CatalogRowActions } from "./catalog-row-actions";
export function CatalogCell({ export function CatalogCell({

View File

@ -1,6 +1,6 @@
import { useTranslation } from "react-i18next"; import { useTranslation } from "react-i18next";
import type { CatalogItemDTO } from "../common"; import type { CatalogItemDTO } from "../../../../common";
export function CatalogDetails({ item }: { item: CatalogItemDTO }) { export function CatalogDetails({ item }: { item: CatalogItemDTO }) {
const { t } = useTranslation("assets"); const { t } = useTranslation("assets");

View File

@ -4,14 +4,12 @@ import { useMutation, useQuery, useQueryClient } from "@tanstack/react-query";
import { useState } from "react"; import { useState } from "react";
import { useTranslation } from "react-i18next"; import { useTranslation } from "react-i18next";
import type { CatalogItemDTO } from "../common"; import type { CatalogItemDTO } from "../../../../common";
import { CatalogDefinitionDialog } from "../../detail";
import type { CatalogEditor } from "../../shared";
import { CatalogEditorDialog, CatalogError, catalogApi, catalogKeys } from "../../shared";
import { catalogApi, catalogKeys } from "./catalog-api";
import { CatalogCell } from "./catalog-cell"; import { CatalogCell } from "./catalog-cell";
import { CatalogDefinitionDialog } from "./catalog-definition-dialog";
import type { CatalogEditor } from "./catalog-editor-dialog";
import { CatalogEditorDialog } from "./catalog-editor-dialog";
import { CatalogError } from "./catalog-error";
export function AssetCatalogPage({ scope, csrfToken }: { scope: string; csrfToken: string }) { export function AssetCatalogPage({ scope, csrfToken }: { scope: string; csrfToken: string }) {
const { t, i18n } = useTranslation("assets"); const { t, i18n } = useTranslation("assets");

View File

@ -1,7 +1,7 @@
import { EntityAction } from "@repo/shadcn-ui/components/entity-list"; import { EntityAction } from "@repo/shadcn-ui/components/entity-list";
import { useTranslation } from "react-i18next"; import { useTranslation } from "react-i18next";
import type { CatalogItemDTO } from "../common"; import type { CatalogItemDTO } from "../../../../common";
export function CatalogRowActions({ export function CatalogRowActions({
item, item,

View File

@ -0,0 +1 @@
export { AssetCatalogPage } from "./catalog-page";

View File

@ -1,7 +1,7 @@
import { z } from "zod/v4"; import { z } from "zod/v4";
import type { AssetDefinitionSpec } from "../common"; import type { AssetDefinitionSpec } from "../../../../common";
import { CatalogResponseSchema, SaveDefinitionResponseSchema } from "../common"; import { CatalogResponseSchema, SaveDefinitionResponseSchema } from "../../../../common";
export const catalogKeys = { scope: (scope: string) => ["asset-catalog", scope] }; export const catalogKeys = { scope: (scope: string) => ["asset-catalog", scope] };
export class CatalogApiError extends Error { export class CatalogApiError extends Error {
constructor(public readonly code: string) { constructor(public readonly code: string) {

View File

@ -0,0 +1 @@
export { CatalogApiError, catalogApi, catalogKeys } from "./catalog-api";

View File

@ -8,15 +8,15 @@ import type { ReactNode } from "react";
import { renderToStaticMarkup } from "react-dom/server"; import { renderToStaticMarkup } from "react-dom/server";
import { I18nextProvider } from "react-i18next"; import { I18nextProvider } from "react-i18next";
import { buildCatalogResponse } from "../api/application/asset-catalog-response.builder"; import { buildCatalogResponse } from "../../../api/application/asset-catalog-response.builder";
import { AssetCatalog } from "../api/domain/asset-catalog.aggregate"; import { AssetCatalog } from "../../../api/domain/asset-catalog.aggregate";
import { seedAssetCatalog } from "../api/domain/asset-catalog-seed"; import { seedAssetCatalog } from "../../../api/domain/asset-catalog-seed";
import { CatalogFieldForm } from "../../catalog-fields";
import { CatalogTemplateForm } from "../../catalog-templates";
import { assetsEnglish, assetsSpanish } from "../../shared";
import { AssetCatalogPage } from "../list";
import { catalogKeys } from "./catalog-api"; import { catalogKeys } from "./api";
import { CatalogFieldForm } from "./catalog-form";
import { AssetCatalogPage } from "./catalog-page";
import { CatalogTemplateForm } from "./catalog-template-form";
import { assetsEnglish, assetsSpanish } from "./i18n";
async function render(language: string, children: ReactNode) { async function render(language: string, children: ReactNode) {
const i18n = createInstance(); const i18n = createInstance();

View File

@ -0,0 +1,2 @@
export type { CatalogSaved } from "./use-catalog-save";
export { useCatalogSave } from "./use-catalog-save";

View File

@ -1,9 +1,8 @@
import { useMutation, useQueryClient } from "@tanstack/react-query"; import { useMutation, useQueryClient } from "@tanstack/react-query";
import { useEffect, useRef } from "react"; import { useEffect, useRef } from "react";
import type { AssetDefinitionSpec, SaveDefinitionResponseDTO } from "../common"; import type { AssetDefinitionSpec, SaveDefinitionResponseDTO } from "../../../../common";
import { catalogApi, catalogKeys } from "../api";
import { catalogApi, catalogKeys } from "./catalog-api";
export type CatalogSaved = (id: string, data: SaveDefinitionResponseDTO) => void; export type CatalogSaved = (id: string, data: SaveDefinitionResponseDTO) => void;

View File

@ -0,0 +1,3 @@
export { catalogApi, catalogKeys } from "./api";
export type { CatalogEditor } from "./ui";
export { CatalogEditorDialog, CatalogError, CatalogHelp, CatalogName } from "./ui";

View File

@ -1,11 +1,10 @@
import { FormDialog } from "@repo/shadcn-ui/components/form-dialog"; import { FormDialog } from "@repo/shadcn-ui/components/form-dialog";
import { useTranslation } from "react-i18next"; import { useTranslation } from "react-i18next";
import type { CatalogItemDTO } from "../common"; import type { CatalogItemDTO } from "../../../../common";
import { CatalogFieldForm } from "../../../catalog-fields";
import { CatalogFieldForm } from "./catalog-form"; import { CatalogRelationForm } from "../../../catalog-relations";
import { CatalogRelationForm } from "./catalog-relation-form"; import { CatalogTemplateForm } from "../../../catalog-templates";
import { CatalogTemplateForm } from "./catalog-template-form";
export type CatalogEditor = { export type CatalogEditor = {
kind: "field" | "template" | "relation"; kind: "field" | "template" | "relation";

View File

@ -1,6 +1,6 @@
import { useTranslation } from "react-i18next"; import { useTranslation } from "react-i18next";
import { CatalogApiError } from "./catalog-api"; import { CatalogApiError } from "../api";
export function CatalogError({ export function CatalogError({
error, error,

View File

@ -1,6 +1,6 @@
import { useTranslation } from "react-i18next"; import { useTranslation } from "react-i18next";
import type { CatalogItemDTO } from "../common"; import type { CatalogItemDTO } from "../../../../common";
export function CatalogName({ export function CatalogName({
item, item,

View File

@ -0,0 +1,5 @@
export type { CatalogEditor } from "./catalog-editor-dialog";
export { CatalogEditorDialog } from "./catalog-editor-dialog";
export { CatalogError } from "./catalog-error";
export { CatalogHelp } from "./catalog-help";
export { CatalogName } from "./catalog-name";

View File

@ -1,2 +0,0 @@
export { default as assetsEnglish } from "../common/locales/en.json";
export { default as assetsSpanish } from "../common/locales/es.json";

View File

@ -1,10 +1,6 @@
export { AssetForm } from "./asset-form"; export { AssetForm, AssetInventoryPage } from "./assets";
export { AssetSupport } from "./asset-support"; export { BrandCatalogPage } from "./brands";
export { BrandCatalogPage } from "./brands-page"; export { AssetCatalogPage, catalogApi, catalogKeys } from "./catalog";
export { catalogApi, catalogKeys } from "./catalog-api"; export { assetsEnglish, assetsSpanish, inventoryApi, inventoryKeys } from "./shared";
export { AssetCatalogPage } from "./catalog-page"; export { AssetSupport } from "./support-connections";
export { assetsEnglish, assetsSpanish } from "./i18n"; export { WorkstationForm, WorkstationsPage } from "./workstations";
export { inventoryApi, inventoryKeys } from "./inventory-api";
export { AssetInventoryPage } from "./inventory-page";
export { WorkstationForm } from "./workstation-form";
export { WorkstationsPage } from "./workstations-page";

View File

@ -0,0 +1,2 @@
export { InventoryApiError, inventoryApi, inventoryKeys } from "./inventory-api";
export { SupportApiError, supportApi, supportKeys } from "./support-api";

View File

@ -1,11 +1,11 @@
import { z } from "zod/v4"; import { z } from "zod/v4";
import type { AssetInput } from "../common/inventory"; import type { AssetInput } from "../../../common/inventory";
import { AssetResponseSchema, InventoryResponseSchema } from "../common/inventory"; import { AssetResponseSchema, InventoryResponseSchema } from "../../../common/inventory";
import type { RelationshipInputDTO } from "../common/relationships"; import type { RelationshipInputDTO } from "../../../common/relationships";
import { RelationshipResponseSchema } from "../common/relationships"; import { RelationshipResponseSchema } from "../../../common/relationships";
import type { WorkstationInput } from "../common/workstations"; import type { WorkstationInput } from "../../../common/workstations";
import { WorkstationResponseSchema } from "../common/workstations"; import { WorkstationResponseSchema } from "../../../common/workstations";
export const inventoryKeys = { company: (id: string) => ["inventory", id] }; export const inventoryKeys = { company: (id: string) => ["inventory", id] };
export class InventoryApiError extends Error { export class InventoryApiError extends Error {
constructor(public readonly code: string) { constructor(public readonly code: string) {

View File

@ -1,12 +1,12 @@
import { z } from "zod/v4"; import { z } from "zod/v4";
import type { SupportInput, SupportToolInput } from "../common/support"; import type { SupportInput, SupportToolInput } from "../../../common/support";
import { import {
SupportListSchema, SupportListSchema,
SupportResponseSchema, SupportResponseSchema,
SupportToolResponseSchema, SupportToolResponseSchema,
SupportToolsSchema, SupportToolsSchema,
} from "../common/support"; } from "../../../common/support";
export const supportKeys = { export const supportKeys = {
asset: (companyId: string, assetId: string) => ["asset-support", companyId, assetId], asset: (companyId: string, assetId: string) => ["asset-support", companyId, assetId],
tools: ["support-tools"], tools: ["support-tools"],

View File

@ -0,0 +1,2 @@
export { default as assetsEnglish } from "../../common/locales/en.json";
export { default as assetsSpanish } from "../../common/locales/es.json";

View File

@ -0,0 +1,3 @@
export { inventoryApi, inventoryKeys, supportApi, supportKeys } from "./api";
export { assetsEnglish, assetsSpanish } from "./i18n";
export { InventoryFeedback, SupportFeedback } from "./ui";

View File

@ -0,0 +1,2 @@
export { InventoryFeedback } from "./inventory-feedback";
export { SupportFeedback } from "./support-feedback";

View File

@ -1,6 +1,6 @@
import { useTranslation } from "react-i18next"; import { useTranslation } from "react-i18next";
import { InventoryApiError } from "./inventory-api"; import { InventoryApiError } from "../api";
export function InventoryFeedback({ error }: { error: Error | null }) { export function InventoryFeedback({ error }: { error: Error | null }) {
const { t } = useTranslation("assets"); const { t } = useTranslation("assets");

Some files were not shown because too many files have changed in this diff Show More