From d116fef6537717acfa40c145ae2987d4000e1adb Mon Sep 17 00:00:00 2001 From: David Date: Thu, 8 Oct 2026 19:25:02 +0200 Subject: [PATCH] =?UTF-8?q?Reestructuraci=C3=B3n=20del=20codigo=20del=20cl?= =?UTF-8?q?iente=20web?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- TODO.md | 6 - apps/web/src/app.test.tsx | 8 +- docs/arquitectura/capas-del-servidor.md | 4 + docs/componentes-de-interfaz.md | 5 +- ...ructura-web-por-entidades-y-operaciones.md | 118 +++++++++++ docs/inventario-de-modales.md | 187 +++++++++--------- docs/revision-de-buenas-practicas.md | 8 +- modules/assets/package.json | 2 +- .../src/web/asset-relationships/end/index.ts | 1 + .../end/ui}/end-relationship-dialog.tsx | 6 +- .../web/asset-relationships/end/ui/index.ts | 1 + .../src/web/asset-relationships/index.ts | 1 + .../src/web/asset-relationships/list/index.ts | 1 + .../list/ui}/asset-relationships.tsx | 9 +- .../web/asset-relationships/list/ui/index.ts | 1 + .../web/asset-relationships/shared/index.ts | 1 + .../asset-relationships/shared/ui/index.ts | 1 + .../shared/ui}/relationship-editor-dialog.tsx | 0 .../shared/ui}/relationship-form.tsx | 10 +- modules/assets/src/web/assets/create/index.ts | 1 + .../assets/src/web/assets/create/ui/index.ts | 1 + .../ui}/workstation-asset-create-dialog.tsx | 2 +- modules/assets/src/web/assets/detail/index.ts | 1 + .../detail/ui}/asset-detail-dialog.tsx | 5 +- .../{ => assets/detail/ui}/asset-detail.tsx | 7 +- .../detail/ui}/asset-selection-panel.tsx | 8 +- .../assets/src/web/assets/detail/ui/index.ts | 2 + modules/assets/src/web/assets/index.ts | 4 + modules/assets/src/web/assets/list/index.ts | 1 + .../assets/src/web/assets/list/ui/index.ts | 1 + .../{ => assets/list/ui}/inventory-page.tsx | 13 +- modules/assets/src/web/assets/shared/index.ts | 2 + .../{ => assets/shared}/inventory.test.tsx | 26 ++- .../ui}/asset-characteristic-control.tsx | 2 +- .../shared/ui}/asset-editor-dialog.tsx | 0 .../web/{ => assets/shared/ui}/asset-form.tsx | 13 +- .../assets/src/web/assets/shared/ui/index.ts | 3 + modules/assets/src/web/brands/index.ts | 2 + modules/assets/src/web/brands/list/index.ts | 1 + .../web/{ => brands/list/ui}/brands-page.tsx | 6 +- .../assets/src/web/brands/list/ui/index.ts | 1 + .../web/{ => brands/shared/api}/brand-api.ts | 4 +- .../assets/src/web/brands/shared/api/index.ts | 1 + .../web/{ => brands/shared}/brands.test.tsx | 17 +- modules/assets/src/web/brands/shared/index.ts | 2 + .../shared/ui}/brand-editor-dialog.tsx | 0 .../web/{ => brands/shared/ui}/brand-form.tsx | 7 +- .../{ => brands/shared/ui}/brand-select.tsx | 4 +- .../assets/src/web/brands/shared/ui/index.ts | 3 + .../src/web/catalog-fields/create/index.ts | 1 + .../ui}/catalog-field-create-dialog.tsx | 2 +- .../src/web/catalog-fields/create/ui/index.ts | 1 + .../assets/src/web/catalog-fields/index.ts | 2 + .../src/web/catalog-fields/shared/index.ts | 1 + .../shared/ui}/catalog-form.tsx | 13 +- .../src/web/catalog-fields/shared/ui/index.ts | 1 + .../src/web/catalog-relations/create/index.ts | 1 + .../ui}/catalog-relation-create-dialog.tsx | 2 +- .../web/catalog-relations/create/ui/index.ts | 1 + .../assets/src/web/catalog-relations/index.ts | 2 + .../src/web/catalog-relations/shared/index.ts | 1 + .../shared/ui}/catalog-relation-form.tsx | 13 +- .../web/catalog-relations/shared/ui/index.ts | 1 + .../src/web/catalog-templates/create/index.ts | 1 + .../ui}/catalog-template-create-dialog.tsx | 2 +- .../web/catalog-templates/create/ui/index.ts | 1 + .../assets/src/web/catalog-templates/index.ts | 2 + .../src/web/catalog-templates/shared/index.ts | 1 + .../shared/ui}/catalog-template-form.tsx | 15 +- .../web/catalog-templates/shared/ui/index.ts | 1 + .../assets/src/web/catalog/detail/index.ts | 1 + .../detail/ui}/catalog-definition-dialog.tsx | 5 +- .../assets/src/web/catalog/detail/ui/index.ts | 1 + modules/assets/src/web/catalog/index.ts | 2 + modules/assets/src/web/catalog/list/index.ts | 1 + .../{ => catalog/list/ui}/catalog-cell.tsx | 4 +- .../{ => catalog/list/ui}/catalog-details.tsx | 2 +- .../{ => catalog/list/ui}/catalog-page.tsx | 10 +- .../list/ui}/catalog-row-actions.tsx | 2 +- .../assets/src/web/catalog/list/ui/index.ts | 1 + .../{ => catalog/shared/api}/catalog-api.ts | 4 +- .../src/web/catalog/shared/api/index.ts | 1 + .../web/{ => catalog/shared}/catalog.test.tsx | 16 +- .../web/catalog/shared/controllers/index.ts | 2 + .../shared/controllers}/use-catalog-save.ts | 5 +- .../assets/src/web/catalog/shared/index.ts | 3 + .../shared/ui}/catalog-editor-dialog.tsx | 9 +- .../{ => catalog/shared/ui}/catalog-error.tsx | 2 +- .../{ => catalog/shared/ui}/catalog-help.tsx | 0 .../{ => catalog/shared/ui}/catalog-name.tsx | 2 +- .../assets/src/web/catalog/shared/ui/index.ts | 5 + modules/assets/src/web/i18n.ts | 2 - modules/assets/src/web/index.ts | 16 +- modules/assets/src/web/shared/api/index.ts | 2 + .../src/web/{ => shared/api}/inventory-api.ts | 12 +- .../src/web/{ => shared/api}/support-api.ts | 4 +- modules/assets/src/web/shared/i18n.ts | 2 + modules/assets/src/web/shared/index.ts | 3 + modules/assets/src/web/shared/ui/index.ts | 2 + .../{ => shared/ui}/inventory-feedback.tsx | 2 +- .../web/{ => shared/ui}/support-feedback.tsx | 2 +- .../web/support-connections/detail/index.ts | 1 + .../support-connections/detail/ui/index.ts | 1 + .../detail/ui}/support-summary.tsx | 2 +- .../web/support-connections/history/index.ts | 1 + .../support-connections/history/ui/index.ts | 1 + .../history/ui}/support-history-dialog.tsx | 5 +- .../src/web/support-connections/index.ts | 1 + .../src/web/support-connections/list/index.ts | 1 + .../list/ui}/asset-support.tsx | 13 +- .../web/support-connections/list/ui/index.ts | 1 + .../web/support-connections/shared/index.ts | 1 + .../shared}/support.test.tsx | 9 +- .../support-connections/shared/ui/index.ts | 2 + .../ui}/support-connection-editor-dialog.tsx | 0 .../shared/ui}/support-form.tsx | 13 +- .../shared/ui}/support-help.tsx | 0 modules/assets/src/web/support-tools/index.ts | 2 + .../src/web/support-tools/list/index.ts | 1 + .../src/web/support-tools/list/ui/index.ts | 1 + .../list/ui}/support-tools-dialog.tsx | 0 .../list/ui}/support-tools.tsx | 7 +- .../src/web/support-tools/shared/index.ts | 1 + .../src/web/support-tools/shared/ui/index.ts | 2 + .../shared/ui}/support-tool-editor-dialog.tsx | 0 .../shared/ui}/support-tool-form.tsx | 10 +- .../src/web/workstations/history/index.ts | 1 + .../src/web/workstations/history/ui/index.ts | 1 + .../ui}/workstation-history-dialog.tsx | 2 +- modules/assets/src/web/workstations/index.ts | 2 + .../assets/src/web/workstations/list/index.ts | 1 + .../src/web/workstations/list/ui/index.ts | 1 + .../list/ui}/workstations-page.tsx | 9 +- .../src/web/workstations/shared/index.ts | 1 + .../src/web/workstations/shared/ui/index.ts | 2 + .../shared/ui}/workstation-editor-dialog.tsx | 0 .../shared/ui}/workstation-form.tsx | 14 +- modules/companies/package.json | 2 +- .../src/web/access/create/helpers/index.ts | 2 + .../{ => create/helpers}/quick-create-plan.ts | 8 +- .../companies/src/web/access/create/index.ts | 3 + .../{ => create/ui}/access-quick-editor.tsx | 12 +- .../src/web/access/create/ui/index.ts | 1 + .../{ => create/ui}/quick-create-dialog.tsx | 9 +- .../companies/src/web/access/help/index.ts | 1 + .../{ => help/ui}/access-help-dialog.tsx | 2 +- .../web/access/{ => help/ui}/entity-help.tsx | 2 +- .../companies/src/web/access/help/ui/index.ts | 2 + .../companies/src/web/access/history/index.ts | 1 + .../{ => history/ui}/access-history.tsx | 5 +- .../src/web/access/history/ui/index.ts | 1 + modules/companies/src/web/access/index.ts | 10 + .../companies/src/web/access/list/index.ts | 1 + .../web/access/{ => list/ui}/access-row.tsx | 4 +- .../access/{ => list/ui}/access-workspace.tsx | 19 +- .../web/access/{ => list/ui}/entry-state.tsx | 2 +- .../companies/src/web/access/list/ui/index.ts | 1 + .../web/access/{ => shared}/access.test.tsx | 14 +- .../web/access/{ => shared/api}/access-api.ts | 4 +- .../src/web/access/shared/api/index.ts | 1 + .../{ => shared/helpers}/access-fields.ts | 2 +- .../helpers}/access-form-values.ts | 2 +- .../{ => shared/helpers}/access-labels.ts | 2 +- .../src/web/access/shared/helpers/index.ts | 5 + .../src/web/access/{ => shared}/i18n.ts | 6 +- .../companies/src/web/access/shared/index.ts | 4 + .../{ => shared/types}/access-field-option.ts | 0 .../{ => shared/types}/access-form-props.ts | 5 +- .../src/web/access/shared/types/index.ts | 2 + .../{ => shared/ui}/access-editor-dialog.tsx | 4 +- .../{ => shared/ui}/access-field-control.tsx | 6 +- .../{ => shared/ui}/access-form-fields.tsx | 22 +-- .../access/{ => shared/ui}/access-form.tsx | 3 +- .../src/web/access/shared/ui/index.ts | 2 + .../{ => shared/ui}/permissions-control.tsx | 4 +- .../create/index.ts | 1 + .../create/ui}/application-quick-editor.tsx | 4 +- .../create/ui/index.ts | 1 + .../history/index.ts | 1 + .../ui}/application-history-dialog.tsx | 2 +- .../history/ui/index.ts | 1 + .../web/application-configurations/index.ts | 2 + .../application-configurations/list/index.ts | 1 + .../ui}/application-configurations-page.tsx | 16 +- .../list/ui/index.ts | 1 + .../shared/api}/application-api.ts | 4 +- .../shared/api/index.ts | 1 + .../shared}/application.test.tsx | 10 +- .../shared/index.ts | 2 + ...pplication-configuration-editor-dialog.tsx | 2 +- .../ui}/application-configuration-form.tsx | 12 +- .../shared/ui}/application-feedback.tsx | 2 +- .../shared/ui/index.ts | 3 + .../src/web/assignments/history/index.ts | 1 + .../history/ui}/assignment-history-dialog.tsx | 2 +- .../src/web/assignments/history/ui/index.ts | 1 + .../companies/src/web/assignments/index.ts | 2 + .../src/web/assignments/shared/index.ts | 1 + .../shared/ui}/assignment-editor-dialog.tsx | 2 +- .../shared/ui}/assignment-form.tsx | 10 +- .../src/web/assignments/shared/ui/index.ts | 2 + .../create/index.ts | 1 + .../create/ui}/certificate-quick-editor.tsx | 4 +- .../create/ui/index.ts | 1 + .../history/index.ts | 1 + .../ui}/certificate-history-dialog.tsx | 2 +- .../history/ui/index.ts | 1 + .../web/certificate-configurations/index.ts | 2 + .../certificate-configurations/list/index.ts | 1 + .../ui}/certificate-configurations-page.tsx | 16 +- .../list/ui/index.ts | 1 + .../shared/api}/certificate-api.ts | 4 +- .../shared/api/index.ts | 1 + .../shared}/certificate.test.tsx | 10 +- .../shared/index.ts | 2 + ...ertificate-configuration-editor-dialog.tsx | 2 +- .../ui}/certificate-configuration-form.tsx | 12 +- .../shared/ui}/certificate-feedback.tsx | 2 +- .../shared/ui/index.ts | 3 + .../change-logo}/api/company-logo-api.ts | 5 +- .../web/companies/change-logo/api/index.ts | 1 + .../src/web/companies/change-logo/index.ts | 2 + .../change-logo/ui}/company-logo-field.tsx | 5 +- .../src/web/companies/change-logo/ui/index.ts | 1 + .../src/web/companies/detail/index.ts | 1 + .../detail/ui}/company-detail.tsx | 13 +- .../detail/ui}/company-inventory.tsx | 2 +- .../detail/ui}/company-section.tsx | 38 ++-- .../src/web/companies/detail/ui/index.ts | 1 + .../ui}/inventory-quick-create-dialog.tsx | 4 +- modules/companies/src/web/companies/index.ts | 12 ++ .../companies/src/web/companies/list/index.ts | 1 + .../list/ui}/companies-page.tsx | 16 +- .../src/web/companies/list/ui/index.ts | 1 + .../{ => companies/shared}/api/company-api.ts | 2 +- .../src/web/companies/shared/api/index.ts | 1 + .../shared}/companies-page.test.tsx | 14 +- .../shared}/company-avatar.test.tsx | 5 +- .../src/web/companies/shared/index.ts | 10 + .../shared/types}/company-tab.ts | 0 .../src/web/companies/shared/types/index.ts | 1 + .../shared/ui}/company-avatar.tsx | 7 +- .../shared/ui}/company-editor-dialog.tsx | 0 .../shared/ui}/company-feedback.tsx | 2 +- .../shared/ui}/company-form.tsx | 11 +- .../shared/ui}/company-identity.tsx | 0 .../shared/ui}/company-select.tsx | 0 .../src/web/companies/shared/ui/index.ts | 6 + .../src/web/dashboard/create/index.ts | 1 + .../create/ui}/dashboard-quick-create.tsx | 15 +- .../src/web/dashboard/create/ui/index.ts | 1 + .../src/web/dashboard/detail/index.ts | 1 + .../detail/ui}/dashboard-details-dialog.tsx | 19 +- .../src/web/dashboard/detail/ui/index.ts | 1 + modules/companies/src/web/dashboard/index.ts | 9 + .../shared/api}/dashboard-api.ts | 4 +- .../src/web/dashboard/shared/api/index.ts | 2 + .../shared/helpers}/dashboard-kind-icons.ts | 0 .../src/web/dashboard/shared/helpers/index.ts | 1 + .../src/web/dashboard/shared/index.ts | 10 + .../shared/ui}/dashboard-block.tsx | 0 .../ui}/dashboard-navigation-button.tsx | 0 .../shared/ui}/dashboard-panel.tsx | 0 .../shared/ui}/dashboard-state-badge.tsx | 0 .../shared/ui}/dashboard-table.tsx | 0 .../src/web/dashboard/shared/ui/index.ts | 5 + .../companies/src/web/dashboard/view/index.ts | 1 + .../view/ui}/dashboard-activity-panel.tsx | 18 +- .../view/ui}/dashboard-attention-panel.tsx | 7 +- .../view/ui}/dashboard-companies-panel.tsx | 17 +- .../view/ui}/dashboard-page.tsx | 13 +- .../view/ui}/dashboard-statistics.tsx | 5 +- .../view/ui}/dashboard-work-panel.tsx | 22 ++- .../src/web/dashboard/view/ui/index.ts | 1 + .../companies/src/web/departments/index.ts | 2 + .../src/web/departments/list/index.ts | 1 + .../list/ui}/department-section.tsx | 5 +- .../src/web/departments/list/ui/index.ts | 1 + .../src/web/departments/shared/index.ts | 1 + .../shared/ui}/department-editor-dialog.tsx | 0 .../shared/ui}/department-form.tsx | 10 +- .../src/web/departments/shared/ui/index.ts | 1 + .../src/web/folder-mappings/create/index.ts | 1 + .../create/ui}/folder-quick-editor.tsx | 6 +- .../web/folder-mappings/create/ui/index.ts | 1 + .../src/web/folder-mappings/history/index.ts | 1 + .../ui}/folder-mapping-history-dialog.tsx | 2 +- .../web/folder-mappings/history/ui/index.ts | 1 + .../src/web/folder-mappings/index.ts | 2 + .../src/web/folder-mappings/list/index.ts | 1 + .../list/ui}/folder-mappings-page.tsx | 13 +- .../src/web/folder-mappings/list/ui/index.ts | 1 + .../shared/api}/folder-api.ts | 4 +- .../web/folder-mappings/shared/api/index.ts | 1 + .../src/web/folder-mappings/shared/index.ts | 2 + .../shared/ui}/folder-feedback.tsx | 2 +- .../ui}/folder-mapping-editor-dialog.tsx | 2 +- .../shared/ui}/folder-mapping-form.tsx | 17 +- .../shared/ui}/folder-mapping-targets.tsx | 8 +- .../web/folder-mappings/shared/ui/index.ts | 2 + modules/companies/src/web/i18n.ts | 5 - modules/companies/src/web/index.ts | 10 +- .../intervention-templates/create/index.ts | 1 + .../intervention-templates/create/ui/index.ts | 1 + .../intervention-template-create-dialog.tsx | 2 +- .../intervention-templates/detail/index.ts | 1 + .../intervention-templates/detail/ui/index.ts | 1 + .../{ => detail/ui}/template-detail.tsx | 2 +- .../intervention-templates/history/index.ts | 1 + .../history/ui/index.ts | 1 + .../{ => history/ui}/template-history.tsx | 5 +- .../src/web/intervention-templates/index.ts | 2 + .../web/intervention-templates/list/index.ts | 1 + .../intervention-templates/list/ui/index.ts | 1 + .../{ => list/ui}/templates-page.tsx | 13 +- .../shared/api/index.ts | 5 + .../{ => shared/api}/template-api.ts | 4 +- .../intervention-templates/shared/index.ts | 6 + .../{ => shared}/templates.test.tsx | 10 +- .../intervention-templates/shared/ui/index.ts | 3 + .../intervention-template-editor-dialog.tsx | 0 .../{ => shared/ui}/template-feedback.tsx | 2 +- .../{ => shared/ui}/template-form.tsx | 6 +- .../{ => shared/ui}/template-help.tsx | 0 .../{ => shared/ui}/template-step-fields.tsx | 2 +- .../src/web/interventions/create/index.ts | 1 + .../src/web/interventions/create/ui/index.ts | 1 + .../create/ui}/ticket-intervention-dialog.tsx | 2 +- .../ui}/ticket-intervention-form.tsx | 12 +- .../src/web/interventions/detail/index.ts | 1 + .../src/web/interventions/detail/ui/index.ts | 2 + .../ui}/intervention-detail-dialog.tsx | 0 .../{ => detail/ui}/intervention-detail.tsx | 4 +- .../{ => detail/ui}/intervention-snapshot.tsx | 6 +- .../companies/src/web/interventions/index.ts | 2 + .../src/web/interventions/list/index.ts | 1 + .../src/web/interventions/list/ui/index.ts | 1 + .../{ => list/ui}/interventions-page.tsx | 19 +- .../{ => list/ui}/ticket-interventions.tsx | 3 +- .../src/web/interventions/shared/api/index.ts | 1 + .../{ => shared/api}/intervention-api.ts | 4 +- .../src/web/interventions/shared/index.ts | 2 + .../{ => shared}/interventions.test.tsx | 12 +- .../src/web/interventions/shared/ui/index.ts | 3 + .../ui}/intervention-company-field.tsx | 4 +- .../ui}/intervention-editor-dialog.tsx | 0 .../{ => shared/ui}/intervention-feedback.tsx | 2 +- .../{ => shared/ui}/intervention-fields.tsx | 7 +- .../{ => shared/ui}/intervention-form.tsx | 15 +- .../{ => shared/ui}/intervention-help.tsx | 0 .../ui}/intervention-procedure-fields.tsx | 2 +- .../{ => shared/ui}/intervention-steps.tsx | 4 +- .../web/mail-configurations/create/index.ts | 1 + .../mail-configurations/create/ui/index.ts | 1 + .../create/ui}/mail-quick-editor.tsx | 13 +- .../web/mail-configurations/history/index.ts | 1 + .../mail-configurations/history/ui/index.ts | 1 + .../ui}/mail-configuration-history-dialog.tsx | 2 +- .../src/web/mail-configurations/index.ts | 2 + .../src/web/mail-configurations/list/index.ts | 1 + .../web/mail-configurations/list/ui/index.ts | 1 + .../list/ui}/mail-configurations-page.tsx | 15 +- .../mail-configurations/shared/api/index.ts | 1 + .../shared/api}/mail-api.ts | 4 +- .../web/mail-configurations/shared/index.ts | 2 + .../shared}/mail.test.tsx | 16 +- .../mail-configurations/shared/ui/index.ts | 3 + .../ui}/mail-configuration-editor-dialog.tsx | 2 +- .../shared/ui}/mail-configuration-form.tsx | 20 +- .../shared/ui}/mail-configuration-targets.tsx | 4 +- .../shared/ui}/mail-feedback.tsx | 2 +- .../src/web/mailbox-uses/create/index.ts | 1 + .../src/web/mailbox-uses/create/ui/index.ts | 1 + .../create/ui}/mailbox-usage-prompt.tsx | 4 +- .../companies/src/web/mailbox-uses/index.ts | 2 + .../src/web/mailbox-uses/shared/index.ts | 1 + .../src/web/mailbox-uses/shared/ui/index.ts | 2 + .../shared/ui}/mailbox-use-editor-dialog.tsx | 2 +- .../shared/ui}/mailbox-use-form.tsx | 17 +- .../src/web/mailboxes/create/index.ts | 1 + .../src/web/mailboxes/create/ui/index.ts | 1 + .../create/ui}/mailbox-create-dialog.tsx | 5 +- modules/companies/src/web/mailboxes/index.ts | 1 + .../src/web/mailboxes/shared/api/index.ts | 1 + .../shared/api}/mailbox-api.ts | 7 +- .../src/web/mailboxes/shared/index.ts | 2 + .../src/web/mailboxes/shared/ui/index.ts | 2 + .../shared/ui}/mailbox-form.tsx | 4 +- .../shared/ui}/mailbox-relations.tsx | 9 +- .../companies/src/web/people/detail/index.ts | 1 + .../src/web/people/detail/ui/index.ts | 1 + .../detail/ui}/person-details.tsx | 6 +- modules/companies/src/web/people/index.ts | 2 + .../companies/src/web/people/list/index.ts | 1 + .../companies/src/web/people/list/ui/index.ts | 1 + .../list/ui}/people-section.tsx | 7 +- .../companies/src/web/people/shared/index.ts | 1 + .../src/web/people/shared/ui/index.ts | 2 + .../shared/ui}/person-editor-dialog.tsx | 0 .../shared/ui}/person-form.tsx | 16 +- .../printer-configurations/create/index.ts | 1 + .../printer-configurations/create/ui/index.ts | 1 + .../ui}/printer-profile-create-dialog.tsx | 4 +- .../printer-configurations/history/index.ts | 1 + .../history/ui/index.ts | 1 + .../history/ui}/printer-history-dialog.tsx | 2 +- .../src/web/printer-configurations/index.ts | 2 + .../web/printer-configurations/list/index.ts | 1 + .../printer-configurations/list/ui/index.ts | 1 + .../list/ui}/printer-configurations-page.tsx | 16 +- .../shared/api/index.ts | 1 + .../shared/api}/printer-api.ts | 4 +- .../printer-configurations/shared/index.ts | 2 + .../shared}/printer.test.tsx | 10 +- .../printer-configurations/shared/ui/index.ts | 3 + .../printer-configuration-editor-dialog.tsx | 2 +- .../shared/ui}/printer-configuration-form.tsx | 14 +- .../shared/ui}/printer-feedback.tsx | 2 +- .../src/web/process-templates/index.ts | 2 + .../src/web/process-templates/list/index.ts | 1 + .../web/process-templates/list/ui/index.ts | 1 + .../list/ui}/process-templates-page.tsx | 5 +- .../src/web/process-templates/shared/index.ts | 1 + .../web/process-templates/shared/ui/index.ts | 2 + .../ui}/process-template-editor-dialog.tsx | 0 .../shared/ui}/process-template-form.tsx | 9 +- .../src/web/processes/create/index.ts | 1 + .../src/web/processes/create/ui/index.ts | 1 + .../ui}/process-quick-create-dialog.tsx | 5 +- .../src/web/processes/detail/index.ts | 1 + .../src/web/processes/detail/ui/index.ts | 1 + .../{ => detail/ui}/process-detail.tsx | 15 +- modules/companies/src/web/processes/index.ts | 1 + .../companies/src/web/processes/list/index.ts | 1 + .../src/web/processes/list/ui/index.ts | 1 + .../{ => list/ui}/processes-page.tsx | 12 +- .../src/web/processes/shared/api/index.ts | 1 + .../processes/{ => shared/api}/process-api.ts | 4 +- .../src/web/processes/shared/helpers/index.ts | 1 + .../{ => shared/helpers}/process-labels.ts | 2 +- .../src/web/processes/shared/index.ts | 3 + .../processes/{ => shared}/processes.test.tsx | 17 +- .../src/web/processes/shared/ui/index.ts | 2 + .../{ => shared/ui}/process-feedback.tsx | 2 +- .../{ => shared/ui}/process-help.tsx | 0 .../src/web/processes/start/index.ts | 1 + .../src/web/processes/start/ui/index.ts | 2 + .../{ => start/ui}/process-start-dialog.tsx | 2 +- .../{ => start/ui}/process-start-form.tsx | 13 +- .../src/web/processes/update/index.ts | 1 + .../src/web/processes/update/ui/index.ts | 2 + .../{ => update/ui}/process-edit-dialog.tsx | 0 .../{ => update/ui}/process-edit-form.tsx | 8 +- .../{ => update/ui}/process-task-field.tsx | 7 +- .../web/remote-connections/create/index.ts | 2 + .../web/remote-connections/create/ui/index.ts | 2 + .../create/ui}/remote-quick-editor.tsx | 6 +- .../web/remote-connections/detail/index.ts | 1 + .../web/remote-connections/detail/ui/index.ts | 1 + .../detail/ui}/remote-summary.tsx | 7 +- .../web/remote-connections/history/index.ts | 1 + .../remote-connections/history/ui/index.ts | 1 + .../ui}/remote-connection-history-dialog.tsx | 7 +- .../src/web/remote-connections/index.ts | 3 + .../src/web/remote-connections/list/index.ts | 1 + .../web/remote-connections/list/ui/index.ts | 1 + .../list/ui}/remote-connections-page.tsx | 11 +- .../remote-connections/shared/api/index.ts | 1 + .../shared/api}/remote-api.ts | 4 +- .../web/remote-connections/shared/index.ts | 2 + .../shared}/remote.test.tsx | 12 +- .../web/remote-connections/shared/ui/index.ts | 3 + .../ui}/remote-connection-editor-dialog.tsx | 2 +- .../shared/ui}/remote-connection-form.tsx | 15 +- .../shared/ui}/remote-endpoint-fields.tsx | 9 +- .../shared/ui}/remote-feedback.tsx | 2 +- .../companies/src/web/shared/helpers/index.ts | 1 + .../helpers}/initials-avatar-appearance.ts | 0 modules/companies/src/web/shared/i18n.ts | 5 + modules/companies/src/web/shared/index.ts | 3 + .../initials-avatar.test.tsx | 4 +- .../ui}/configuration-quick-editor.tsx | 8 +- modules/companies/src/web/shared/ui/index.ts | 3 + .../ui}/initials-avatar.tsx | 2 +- modules/companies/src/web/sites/index.ts | 2 + modules/companies/src/web/sites/list/index.ts | 1 + .../companies/src/web/sites/list/ui/index.ts | 1 + .../list/ui}/site-section.tsx | 5 +- .../companies/src/web/sites/shared/index.ts | 1 + .../src/web/sites/shared/ui/index.ts | 2 + .../shared/ui}/site-editor-dialog.tsx | 0 .../shared/ui}/site-form.tsx | 10 +- .../telework-authorizations/detail/index.ts | 1 + .../detail/ui/index.ts | 1 + .../ui}/telework-authorization-summary.tsx | 2 +- .../telework-authorizations/history/index.ts | 1 + .../history/ui/index.ts | 1 + .../telework-authorization-history-dialog.tsx | 2 +- .../src/web/telework-authorizations/index.ts | 3 + .../web/telework-authorizations/list/index.ts | 1 + .../telework-authorizations/list/ui/index.ts | 1 + .../list/ui}/telework-authorizations-page.tsx | 16 +- .../shared/api/index.ts | 1 + .../shared/api}/telework-api.ts | 4 +- .../telework-authorizations/shared/index.ts | 2 + .../shared}/telework.test.tsx | 12 +- .../shared/ui/index.ts | 3 + .../telework-authorization-editor-dialog.tsx | 2 +- .../ui}/telework-authorization-form.tsx | 12 +- .../shared/ui}/telework-feedback.tsx | 2 +- .../companies/src/web/tickets/create/index.ts | 1 + .../src/web/tickets/create/ui/index.ts | 2 + .../ui}/intervention-ticket-create-dialog.tsx | 2 +- .../{ => create/ui}/ticket-quick-editor.tsx | 11 +- .../{ => create/ui}/ticket-quick-forms.tsx | 4 +- .../ui}/ticket-target-create-dialog.tsx | 0 .../companies/src/web/tickets/detail/index.ts | 1 + .../src/web/tickets/detail/ui/index.ts | 1 + .../{ => detail/ui}/ticket-detail-dialog.tsx | 0 .../tickets/{ => detail/ui}/ticket-detail.tsx | 8 +- modules/companies/src/web/tickets/index.ts | 2 + .../companies/src/web/tickets/list/index.ts | 1 + .../src/web/tickets/list/ui/index.ts | 1 + .../tickets/{ => list/ui}/tickets-page.tsx | 16 +- .../src/web/tickets/shared/api/index.ts | 1 + .../tickets/{ => shared/api}/ticket-api.ts | 8 +- .../companies/src/web/tickets/shared/index.ts | 8 + .../web/tickets/{ => shared}/tickets.test.tsx | 10 +- .../src/web/tickets/shared/ui/index.ts | 4 + .../ui}/ticket-classification-fields.tsx | 8 +- .../{ => shared/ui}/ticket-editor-dialog.tsx | 0 .../{ => shared/ui}/ticket-feedback.tsx | 2 +- .../tickets/{ => shared/ui}/ticket-form.tsx | 10 +- .../tickets/{ => shared/ui}/ticket-help.tsx | 0 .../{ => shared/ui}/ticket-targets.tsx | 7 +- .../work-environments/detail/hooks/index.ts | 1 + .../detail/hooks}/use-environment-queries.ts | 21 +- .../src/web/work-environments/detail/index.ts | 1 + .../detail/ui}/environment-content.tsx | 16 +- .../detail/ui}/environment-section.tsx | 2 +- .../detail/ui}/hardware-characteristics.tsx | 0 .../web/work-environments/detail/ui/index.ts | 2 + .../detail/ui}/profile-configurations.tsx | 18 +- .../detail/ui}/work-environment-page.tsx | 6 +- .../src/web/work-environments/index.ts | 1 + .../work-environments/shared/helpers/index.ts | 6 + .../shared/helpers}/work-environment.model.ts | 2 +- .../src/web/work-environments/shared/index.ts | 2 + .../shared}/work-environment.test.tsx | 32 +-- .../src/web/work-profiles/history/index.ts | 1 + .../src/web/work-profiles/history/ui/index.ts | 1 + .../ui}/work-profile-history-dialog.tsx | 2 +- .../companies/src/web/work-profiles/index.ts | 2 + .../src/web/work-profiles/list/index.ts | 1 + .../src/web/work-profiles/list/ui/index.ts | 1 + .../list/ui}/work-profiles-page.tsx | 16 +- .../src/web/work-profiles/shared/api/index.ts | 1 + .../shared/api}/work-profile-api.ts | 7 +- .../src/web/work-profiles/shared/index.ts | 3 + .../shared}/profile.test.tsx | 10 +- .../web/work-profiles/shared/types/index.ts | 1 + .../shared/types}/profile-selection.ts | 2 +- .../src/web/work-profiles/shared/ui/index.ts | 3 + .../shared/ui}/profile-feedback.tsx | 2 +- .../shared/ui}/work-profile-editor-dialog.tsx | 2 +- .../shared/ui}/work-profile-form.tsx | 15 +- .../src/web/workspace/catalogs/index.ts | 1 + .../catalogs/ui}/global-catalog-content.tsx | 4 +- .../src/web/workspace/catalogs/ui/index.ts | 1 + modules/companies/src/web/workspace/index.ts | 1 + .../src/web/workspace/settings/index.ts | 1 + .../src/web/workspace/settings/ui/index.ts | 1 + .../ui}/workspace-settings-dialog.tsx | 0 .../src/web/workspace/shared/index.ts | 2 + .../src/web/workspace/shared/types/index.ts | 1 + .../shared/types}/workspace-location.ts | 2 +- .../src/web/workspace/shared/ui/index.ts | 1 + .../ui}/workspace-navigation-button.tsx | 0 .../companies/src/web/workspace/view/index.ts | 1 + .../view/ui}/companies-workspace.tsx | 8 +- .../src/web/workspace/view/ui/index.ts | 1 + .../view/ui}/workspace-content.tsx | 15 +- .../view/ui}/workspace-header.tsx | 6 +- .../view/ui}/workspace-sidebar.tsx | 7 +- .../web/{ => health/check}/api/core.api.ts | 4 +- .../core/src/web/health/check/api/index.ts | 1 + modules/core/src/web/health/check/index.ts | 1 + modules/core/src/web/health/index.ts | 2 + modules/core/src/web/health/shared/index.ts | 1 + .../shared}/queries/core.query-keys.ts | 0 .../src/web/health/shared/queries/index.ts | 1 + modules/core/src/web/index.ts | 2 +- modules/core/src/web/workspace/index.ts | 1 + modules/core/src/web/workspace/view/index.ts | 1 + .../view/ui}/home-page.tsx | 3 +- .../core/src/web/workspace/view/ui/index.ts | 1 + modules/identity/src/web/i18n.ts | 2 - modules/identity/src/web/index.ts | 5 +- .../src/web/passwords/change/index.ts | 1 + .../change/ui}/account-password-dialog.tsx | 2 +- .../src/web/passwords/change/ui/index.ts | 1 + modules/identity/src/web/passwords/index.ts | 2 + .../src/web/passwords/shared/index.ts | 1 + .../src/web/passwords/shared/ui/index.ts | 1 + .../shared/ui}/password-form.tsx | 8 +- modules/identity/src/web/sessions/index.ts | 1 + .../identity/src/web/sessions/shared/index.ts | 1 + .../shared/ui}/credential-form.tsx | 8 +- .../src/web/sessions/shared/ui/index.ts | 1 + .../src/web/{ => shared}/api/identity-api.ts | 2 +- modules/identity/src/web/shared/api/index.ts | 1 + modules/identity/src/web/shared/i18n.ts | 2 + modules/identity/src/web/shared/index.ts | 3 + .../ui}/form-feedback.tsx | 2 +- modules/identity/src/web/shared/ui/index.ts | 1 + modules/identity/src/web/users/index.ts | 1 + modules/identity/src/web/users/list/index.ts | 1 + .../identity/src/web/users/list/ui/index.ts | 2 + .../list/ui}/user-management-dialog.tsx | 0 .../list/ui}/user-management.tsx | 8 +- .../identity/src/web/users/shared/index.ts | 1 + .../identity/src/web/users/shared/ui/index.ts | 1 + .../shared/ui}/user-editor-dialog.tsx | 4 +- .../shared/ui}/user-form.tsx | 8 +- modules/identity/src/web/workspace/index.ts | 1 + .../src/web/workspace/shared/index.ts | 1 + .../src/web/workspace/shared/types/index.ts | 1 + .../shared/types}/workspace-page.ts | 2 +- .../identity/src/web/workspace/view/index.ts | 1 + .../view/ui}/authenticated-workspace.tsx | 11 +- .../view/ui}/custom-workspace.tsx | 11 +- .../view/ui}/identity-workspace.tsx | 7 +- .../src/web/workspace/view/ui/index.ts | 1 + modules/resources/package.json | 2 +- .../src/web/catalog-fields/create/index.ts | 1 + .../ui}/catalog-field-create-dialog.tsx | 2 +- .../src/web/catalog-fields/create/ui/index.ts | 1 + .../resources/src/web/catalog-fields/index.ts | 2 + .../src/web/catalog-fields/shared/index.ts | 1 + .../shared/ui}/catalog-form.tsx | 13 +- .../src/web/catalog-fields/shared/ui/index.ts | 1 + .../src/web/catalog-templates/create/index.ts | 1 + .../ui}/catalog-template-create-dialog.tsx | 2 +- .../web/catalog-templates/create/ui/index.ts | 1 + .../src/web/catalog-templates/index.ts | 2 + .../src/web/catalog-templates/shared/index.ts | 1 + .../shared/ui}/catalog-template-form.tsx | 15 +- .../web/catalog-templates/shared/ui/index.ts | 1 + .../resources/src/web/catalog/detail/index.ts | 1 + .../detail/ui}/catalog-definition-dialog.tsx | 5 +- .../src/web/catalog/detail/ui/index.ts | 1 + modules/resources/src/web/catalog/index.ts | 2 + .../resources/src/web/catalog/list/index.ts | 1 + .../{ => catalog/list/ui}/catalog-cell.tsx | 4 +- .../{ => catalog/list/ui}/catalog-page.tsx | 10 +- .../list/ui}/catalog-row-actions.tsx | 2 +- .../src/web/catalog/list/ui/index.ts | 1 + .../{ => catalog/shared/api}/catalog-api.ts | 4 +- .../src/web/catalog/shared/api/index.ts | 1 + .../web/{ => catalog/shared}/catalog.test.tsx | 16 +- .../web/catalog/shared/controllers/index.ts | 2 + .../shared/controllers}/use-catalog-save.ts | 5 +- .../resources/src/web/catalog/shared/index.ts | 3 + .../shared/ui}/catalog-editor-dialog.tsx | 7 +- .../{ => catalog/shared/ui}/catalog-error.tsx | 2 +- .../{ => catalog/shared/ui}/catalog-help.tsx | 0 .../{ => catalog/shared/ui}/catalog-name.tsx | 2 +- .../src/web/catalog/shared/ui/index.ts | 5 + modules/resources/src/web/i18n.ts | 2 - modules/resources/src/web/index.ts | 9 +- .../src/web/resources/detail/index.ts | 1 + .../src/web/resources/detail/ui/index.ts | 1 + .../detail/ui}/integration-summary.tsx | 2 +- .../detail/ui}/resource-detail-dialog.tsx | 0 .../detail/ui}/resource-detail.tsx | 2 +- modules/resources/src/web/resources/index.ts | 2 + .../resources/src/web/resources/list/index.ts | 1 + .../src/web/resources/list/ui/index.ts | 1 + .../list/ui}/resources-page.tsx | 12 +- .../src/web/resources/shared/api/index.ts | 1 + .../shared/api}/inventory-api.ts | 4 +- .../src/web/resources/shared/index.ts | 2 + .../{ => resources/shared}/resources.test.tsx | 16 +- .../src/web/resources/shared/ui/index.ts | 3 + .../ui}/resource-characteristic-control.tsx | 2 +- .../shared/ui}/resource-editor-dialog.tsx | 0 .../shared/ui}/resource-editor.tsx | 7 +- .../shared/ui}/resource-form.tsx | 12 +- .../ui}/resource-integration-fields.tsx | 2 +- modules/resources/src/web/shared/i18n.ts | 2 + modules/resources/src/web/shared/index.ts | 2 + modules/resources/src/web/shared/ui/index.ts | 1 + .../{ => shared/ui}/inventory-feedback.tsx | 2 +- 693 files changed, 1810 insertions(+), 1201 deletions(-) create mode 100644 docs/estructura-web-por-entidades-y-operaciones.md create mode 100644 modules/assets/src/web/asset-relationships/end/index.ts rename modules/assets/src/web/{ => asset-relationships/end/ui}/end-relationship-dialog.tsx (90%) create mode 100644 modules/assets/src/web/asset-relationships/end/ui/index.ts create mode 100644 modules/assets/src/web/asset-relationships/index.ts create mode 100644 modules/assets/src/web/asset-relationships/list/index.ts rename modules/assets/src/web/{ => asset-relationships/list/ui}/asset-relationships.tsx (93%) create mode 100644 modules/assets/src/web/asset-relationships/list/ui/index.ts create mode 100644 modules/assets/src/web/asset-relationships/shared/index.ts create mode 100644 modules/assets/src/web/asset-relationships/shared/ui/index.ts rename modules/assets/src/web/{ => asset-relationships/shared/ui}/relationship-editor-dialog.tsx (100%) rename modules/assets/src/web/{ => asset-relationships/shared/ui}/relationship-form.tsx (93%) create mode 100644 modules/assets/src/web/assets/create/index.ts create mode 100644 modules/assets/src/web/assets/create/ui/index.ts rename modules/assets/src/web/{ => assets/create/ui}/workstation-asset-create-dialog.tsx (96%) create mode 100644 modules/assets/src/web/assets/detail/index.ts rename modules/assets/src/web/{ => assets/detail/ui}/asset-detail-dialog.tsx (89%) rename modules/assets/src/web/{ => assets/detail/ui}/asset-detail.tsx (96%) rename modules/assets/src/web/{ => assets/detail/ui}/asset-selection-panel.tsx (88%) create mode 100644 modules/assets/src/web/assets/detail/ui/index.ts create mode 100644 modules/assets/src/web/assets/index.ts create mode 100644 modules/assets/src/web/assets/list/index.ts create mode 100644 modules/assets/src/web/assets/list/ui/index.ts rename modules/assets/src/web/{ => assets/list/ui}/inventory-page.tsx (95%) create mode 100644 modules/assets/src/web/assets/shared/index.ts rename modules/assets/src/web/{ => assets/shared}/inventory.test.tsx (88%) rename modules/assets/src/web/{ => assets/shared/ui}/asset-characteristic-control.tsx (96%) rename modules/assets/src/web/{ => assets/shared/ui}/asset-editor-dialog.tsx (100%) rename modules/assets/src/web/{ => assets/shared/ui}/asset-form.tsx (96%) create mode 100644 modules/assets/src/web/assets/shared/ui/index.ts create mode 100644 modules/assets/src/web/brands/index.ts create mode 100644 modules/assets/src/web/brands/list/index.ts rename modules/assets/src/web/{ => brands/list/ui}/brands-page.tsx (96%) create mode 100644 modules/assets/src/web/brands/list/ui/index.ts rename modules/assets/src/web/{ => brands/shared/api}/brand-api.ts (88%) create mode 100644 modules/assets/src/web/brands/shared/api/index.ts rename modules/assets/src/web/{ => brands/shared}/brands.test.tsx (89%) create mode 100644 modules/assets/src/web/brands/shared/index.ts rename modules/assets/src/web/{ => brands/shared/ui}/brand-editor-dialog.tsx (100%) rename modules/assets/src/web/{ => brands/shared/ui}/brand-form.tsx (94%) rename modules/assets/src/web/{ => brands/shared/ui}/brand-select.tsx (96%) create mode 100644 modules/assets/src/web/brands/shared/ui/index.ts create mode 100644 modules/assets/src/web/catalog-fields/create/index.ts rename modules/assets/src/web/{ => catalog-fields/create/ui}/catalog-field-create-dialog.tsx (93%) create mode 100644 modules/assets/src/web/catalog-fields/create/ui/index.ts create mode 100644 modules/assets/src/web/catalog-fields/index.ts create mode 100644 modules/assets/src/web/catalog-fields/shared/index.ts rename modules/assets/src/web/{ => catalog-fields/shared/ui}/catalog-form.tsx (90%) create mode 100644 modules/assets/src/web/catalog-fields/shared/ui/index.ts create mode 100644 modules/assets/src/web/catalog-relations/create/index.ts rename modules/assets/src/web/{ => catalog-relations/create/ui}/catalog-relation-create-dialog.tsx (92%) create mode 100644 modules/assets/src/web/catalog-relations/create/ui/index.ts create mode 100644 modules/assets/src/web/catalog-relations/index.ts create mode 100644 modules/assets/src/web/catalog-relations/shared/index.ts rename modules/assets/src/web/{ => catalog-relations/shared/ui}/catalog-relation-form.tsx (88%) create mode 100644 modules/assets/src/web/catalog-relations/shared/ui/index.ts create mode 100644 modules/assets/src/web/catalog-templates/create/index.ts rename modules/assets/src/web/{ => catalog-templates/create/ui}/catalog-template-create-dialog.tsx (93%) create mode 100644 modules/assets/src/web/catalog-templates/create/ui/index.ts create mode 100644 modules/assets/src/web/catalog-templates/index.ts create mode 100644 modules/assets/src/web/catalog-templates/shared/index.ts rename modules/assets/src/web/{ => catalog-templates/shared/ui}/catalog-template-form.tsx (93%) create mode 100644 modules/assets/src/web/catalog-templates/shared/ui/index.ts create mode 100644 modules/assets/src/web/catalog/detail/index.ts rename modules/assets/src/web/{ => catalog/detail/ui}/catalog-definition-dialog.tsx (96%) create mode 100644 modules/assets/src/web/catalog/detail/ui/index.ts create mode 100644 modules/assets/src/web/catalog/index.ts create mode 100644 modules/assets/src/web/catalog/list/index.ts rename modules/assets/src/web/{ => catalog/list/ui}/catalog-cell.tsx (95%) rename modules/assets/src/web/{ => catalog/list/ui}/catalog-details.tsx (86%) rename modules/assets/src/web/{ => catalog/list/ui}/catalog-page.tsx (95%) rename modules/assets/src/web/{ => catalog/list/ui}/catalog-row-actions.tsx (94%) create mode 100644 modules/assets/src/web/catalog/list/ui/index.ts rename modules/assets/src/web/{ => catalog/shared/api}/catalog-api.ts (94%) create mode 100644 modules/assets/src/web/catalog/shared/api/index.ts rename modules/assets/src/web/{ => catalog/shared}/catalog.test.tsx (82%) create mode 100644 modules/assets/src/web/catalog/shared/controllers/index.ts rename modules/assets/src/web/{ => catalog/shared/controllers}/use-catalog-save.ts (92%) create mode 100644 modules/assets/src/web/catalog/shared/index.ts rename modules/assets/src/web/{ => catalog/shared/ui}/catalog-editor-dialog.tsx (87%) rename modules/assets/src/web/{ => catalog/shared/ui}/catalog-error.tsx (90%) rename modules/assets/src/web/{ => catalog/shared/ui}/catalog-help.tsx (100%) rename modules/assets/src/web/{ => catalog/shared/ui}/catalog-name.tsx (94%) create mode 100644 modules/assets/src/web/catalog/shared/ui/index.ts delete mode 100644 modules/assets/src/web/i18n.ts create mode 100644 modules/assets/src/web/shared/api/index.ts rename modules/assets/src/web/{ => shared/api}/inventory-api.ts (83%) rename modules/assets/src/web/{ => shared/api}/support-api.ts (93%) create mode 100644 modules/assets/src/web/shared/i18n.ts create mode 100644 modules/assets/src/web/shared/index.ts create mode 100644 modules/assets/src/web/shared/ui/index.ts rename modules/assets/src/web/{ => shared/ui}/inventory-feedback.tsx (87%) rename modules/assets/src/web/{ => shared/ui}/support-feedback.tsx (91%) create mode 100644 modules/assets/src/web/support-connections/detail/index.ts create mode 100644 modules/assets/src/web/support-connections/detail/ui/index.ts rename modules/assets/src/web/{ => support-connections/detail/ui}/support-summary.tsx (90%) create mode 100644 modules/assets/src/web/support-connections/history/index.ts create mode 100644 modules/assets/src/web/support-connections/history/ui/index.ts rename modules/assets/src/web/{ => support-connections/history/ui}/support-history-dialog.tsx (89%) create mode 100644 modules/assets/src/web/support-connections/index.ts create mode 100644 modules/assets/src/web/support-connections/list/index.ts rename modules/assets/src/web/{ => support-connections/list/ui}/asset-support.tsx (91%) create mode 100644 modules/assets/src/web/support-connections/list/ui/index.ts create mode 100644 modules/assets/src/web/support-connections/shared/index.ts rename modules/assets/src/web/{ => support-connections/shared}/support.test.tsx (92%) create mode 100644 modules/assets/src/web/support-connections/shared/ui/index.ts rename modules/assets/src/web/{ => support-connections/shared/ui}/support-connection-editor-dialog.tsx (100%) rename modules/assets/src/web/{ => support-connections/shared/ui}/support-form.tsx (93%) rename modules/assets/src/web/{ => support-connections/shared/ui}/support-help.tsx (100%) create mode 100644 modules/assets/src/web/support-tools/index.ts create mode 100644 modules/assets/src/web/support-tools/list/index.ts create mode 100644 modules/assets/src/web/support-tools/list/ui/index.ts rename modules/assets/src/web/{ => support-tools/list/ui}/support-tools-dialog.tsx (100%) rename modules/assets/src/web/{ => support-tools/list/ui}/support-tools.tsx (94%) create mode 100644 modules/assets/src/web/support-tools/shared/index.ts create mode 100644 modules/assets/src/web/support-tools/shared/ui/index.ts rename modules/assets/src/web/{ => support-tools/shared/ui}/support-tool-editor-dialog.tsx (100%) rename modules/assets/src/web/{ => support-tools/shared/ui}/support-tool-form.tsx (88%) create mode 100644 modules/assets/src/web/workstations/history/index.ts create mode 100644 modules/assets/src/web/workstations/history/ui/index.ts rename modules/assets/src/web/{ => workstations/history/ui}/workstation-history-dialog.tsx (96%) create mode 100644 modules/assets/src/web/workstations/index.ts create mode 100644 modules/assets/src/web/workstations/list/index.ts create mode 100644 modules/assets/src/web/workstations/list/ui/index.ts rename modules/assets/src/web/{ => workstations/list/ui}/workstations-page.tsx (95%) create mode 100644 modules/assets/src/web/workstations/shared/index.ts create mode 100644 modules/assets/src/web/workstations/shared/ui/index.ts rename modules/assets/src/web/{ => workstations/shared/ui}/workstation-editor-dialog.tsx (100%) rename modules/assets/src/web/{ => workstations/shared/ui}/workstation-form.tsx (95%) create mode 100644 modules/companies/src/web/access/create/helpers/index.ts rename modules/companies/src/web/access/{ => create/helpers}/quick-create-plan.ts (94%) create mode 100644 modules/companies/src/web/access/create/index.ts rename modules/companies/src/web/access/{ => create/ui}/access-quick-editor.tsx (91%) create mode 100644 modules/companies/src/web/access/create/ui/index.ts rename modules/companies/src/web/access/{ => create/ui}/quick-create-dialog.tsx (95%) create mode 100644 modules/companies/src/web/access/help/index.ts rename modules/companies/src/web/access/{ => help/ui}/access-help-dialog.tsx (91%) rename modules/companies/src/web/access/{ => help/ui}/entity-help.tsx (93%) create mode 100644 modules/companies/src/web/access/help/ui/index.ts create mode 100644 modules/companies/src/web/access/history/index.ts rename modules/companies/src/web/access/{ => history/ui}/access-history.tsx (95%) create mode 100644 modules/companies/src/web/access/history/ui/index.ts create mode 100644 modules/companies/src/web/access/index.ts create mode 100644 modules/companies/src/web/access/list/index.ts rename modules/companies/src/web/access/{ => list/ui}/access-row.tsx (97%) rename modules/companies/src/web/access/{ => list/ui}/access-workspace.tsx (94%) rename modules/companies/src/web/access/{ => list/ui}/entry-state.tsx (94%) create mode 100644 modules/companies/src/web/access/list/ui/index.ts rename modules/companies/src/web/access/{ => shared}/access.test.tsx (96%) rename modules/companies/src/web/access/{ => shared/api}/access-api.ts (88%) create mode 100644 modules/companies/src/web/access/shared/api/index.ts rename modules/companies/src/web/access/{ => shared/helpers}/access-fields.ts (98%) rename modules/companies/src/web/access/{ => shared/helpers}/access-form-values.ts (97%) rename modules/companies/src/web/access/{ => shared/helpers}/access-labels.ts (95%) create mode 100644 modules/companies/src/web/access/shared/helpers/index.ts rename modules/companies/src/web/access/{ => shared}/i18n.ts (73%) create mode 100644 modules/companies/src/web/access/shared/index.ts rename modules/companies/src/web/access/{ => shared/types}/access-field-option.ts (100%) rename modules/companies/src/web/access/{ => shared/types}/access-form-props.ts (83%) create mode 100644 modules/companies/src/web/access/shared/types/index.ts rename modules/companies/src/web/access/{ => shared/ui}/access-editor-dialog.tsx (92%) rename modules/companies/src/web/access/{ => shared/ui}/access-field-control.tsx (94%) rename modules/companies/src/web/access/{ => shared/ui}/access-form-fields.tsx (90%) rename modules/companies/src/web/access/{ => shared/ui}/access-form.tsx (93%) create mode 100644 modules/companies/src/web/access/shared/ui/index.ts rename modules/companies/src/web/access/{ => shared/ui}/permissions-control.tsx (92%) create mode 100644 modules/companies/src/web/application-configurations/create/index.ts rename modules/companies/src/web/{applications => application-configurations/create/ui}/application-quick-editor.tsx (91%) create mode 100644 modules/companies/src/web/application-configurations/create/ui/index.ts create mode 100644 modules/companies/src/web/application-configurations/history/index.ts rename modules/companies/src/web/{applications => application-configurations/history/ui}/application-history-dialog.tsx (95%) create mode 100644 modules/companies/src/web/application-configurations/history/ui/index.ts create mode 100644 modules/companies/src/web/application-configurations/index.ts create mode 100644 modules/companies/src/web/application-configurations/list/index.ts rename modules/companies/src/web/{applications => application-configurations/list/ui}/application-configurations-page.tsx (94%) create mode 100644 modules/companies/src/web/application-configurations/list/ui/index.ts rename modules/companies/src/web/{applications => application-configurations/shared/api}/application-api.ts (90%) create mode 100644 modules/companies/src/web/application-configurations/shared/api/index.ts rename modules/companies/src/web/{applications => application-configurations/shared}/application.test.tsx (90%) create mode 100644 modules/companies/src/web/application-configurations/shared/index.ts rename modules/companies/src/web/{applications => application-configurations/shared/ui}/application-configuration-editor-dialog.tsx (95%) rename modules/companies/src/web/{applications => application-configurations/shared/ui}/application-configuration-form.tsx (96%) rename modules/companies/src/web/{applications => application-configurations/shared/ui}/application-feedback.tsx (87%) create mode 100644 modules/companies/src/web/application-configurations/shared/ui/index.ts create mode 100644 modules/companies/src/web/assignments/history/index.ts rename modules/companies/src/web/{components => assignments/history/ui}/assignment-history-dialog.tsx (96%) create mode 100644 modules/companies/src/web/assignments/history/ui/index.ts create mode 100644 modules/companies/src/web/assignments/index.ts create mode 100644 modules/companies/src/web/assignments/shared/index.ts rename modules/companies/src/web/{components => assignments/shared/ui}/assignment-editor-dialog.tsx (95%) rename modules/companies/src/web/{components => assignments/shared/ui}/assignment-form.tsx (96%) create mode 100644 modules/companies/src/web/assignments/shared/ui/index.ts create mode 100644 modules/companies/src/web/certificate-configurations/create/index.ts rename modules/companies/src/web/{certificates => certificate-configurations/create/ui}/certificate-quick-editor.tsx (91%) create mode 100644 modules/companies/src/web/certificate-configurations/create/ui/index.ts create mode 100644 modules/companies/src/web/certificate-configurations/history/index.ts rename modules/companies/src/web/{certificates => certificate-configurations/history/ui}/certificate-history-dialog.tsx (95%) create mode 100644 modules/companies/src/web/certificate-configurations/history/ui/index.ts create mode 100644 modules/companies/src/web/certificate-configurations/index.ts create mode 100644 modules/companies/src/web/certificate-configurations/list/index.ts rename modules/companies/src/web/{certificates => certificate-configurations/list/ui}/certificate-configurations-page.tsx (94%) create mode 100644 modules/companies/src/web/certificate-configurations/list/ui/index.ts rename modules/companies/src/web/{certificates => certificate-configurations/shared/api}/certificate-api.ts (90%) create mode 100644 modules/companies/src/web/certificate-configurations/shared/api/index.ts rename modules/companies/src/web/{certificates => certificate-configurations/shared}/certificate.test.tsx (90%) create mode 100644 modules/companies/src/web/certificate-configurations/shared/index.ts rename modules/companies/src/web/{certificates => certificate-configurations/shared/ui}/certificate-configuration-editor-dialog.tsx (95%) rename modules/companies/src/web/{certificates => certificate-configurations/shared/ui}/certificate-configuration-form.tsx (96%) rename modules/companies/src/web/{certificates => certificate-configurations/shared/ui}/certificate-feedback.tsx (87%) create mode 100644 modules/companies/src/web/certificate-configurations/shared/ui/index.ts rename modules/companies/src/web/{ => companies/change-logo}/api/company-logo-api.ts (92%) create mode 100644 modules/companies/src/web/companies/change-logo/api/index.ts create mode 100644 modules/companies/src/web/companies/change-logo/index.ts rename modules/companies/src/web/{components => companies/change-logo/ui}/company-logo-field.tsx (95%) create mode 100644 modules/companies/src/web/companies/change-logo/ui/index.ts create mode 100644 modules/companies/src/web/companies/detail/index.ts rename modules/companies/src/web/{components => companies/detail/ui}/company-detail.tsx (96%) rename modules/companies/src/web/{components => companies/detail/ui}/company-inventory.tsx (96%) rename modules/companies/src/web/{components => companies/detail/ui}/company-section.tsx (71%) create mode 100644 modules/companies/src/web/companies/detail/ui/index.ts rename modules/companies/src/web/{components => companies/detail/ui}/inventory-quick-create-dialog.tsx (93%) create mode 100644 modules/companies/src/web/companies/index.ts create mode 100644 modules/companies/src/web/companies/list/index.ts rename modules/companies/src/web/{components => companies/list/ui}/companies-page.tsx (94%) create mode 100644 modules/companies/src/web/companies/list/ui/index.ts rename modules/companies/src/web/{ => companies/shared}/api/company-api.ts (98%) create mode 100644 modules/companies/src/web/companies/shared/api/index.ts rename modules/companies/src/web/{components => companies/shared}/companies-page.test.tsx (93%) rename modules/companies/src/web/{components => companies/shared}/company-avatar.test.tsx (94%) create mode 100644 modules/companies/src/web/companies/shared/index.ts rename modules/companies/src/web/{components => companies/shared/types}/company-tab.ts (100%) create mode 100644 modules/companies/src/web/companies/shared/types/index.ts rename modules/companies/src/web/{components => companies/shared/ui}/company-avatar.tsx (90%) rename modules/companies/src/web/{components => companies/shared/ui}/company-editor-dialog.tsx (100%) rename modules/companies/src/web/{components => companies/shared/ui}/company-feedback.tsx (93%) rename modules/companies/src/web/{components => companies/shared/ui}/company-form.tsx (93%) rename modules/companies/src/web/{components => companies/shared/ui}/company-identity.tsx (100%) rename modules/companies/src/web/{components => companies/shared/ui}/company-select.tsx (100%) create mode 100644 modules/companies/src/web/companies/shared/ui/index.ts create mode 100644 modules/companies/src/web/dashboard/create/index.ts rename modules/companies/src/web/{components => dashboard/create/ui}/dashboard-quick-create.tsx (88%) create mode 100644 modules/companies/src/web/dashboard/create/ui/index.ts create mode 100644 modules/companies/src/web/dashboard/detail/index.ts rename modules/companies/src/web/{components => dashboard/detail/ui}/dashboard-details-dialog.tsx (94%) create mode 100644 modules/companies/src/web/dashboard/detail/ui/index.ts create mode 100644 modules/companies/src/web/dashboard/index.ts rename modules/companies/src/web/{components => dashboard/shared/api}/dashboard-api.ts (96%) create mode 100644 modules/companies/src/web/dashboard/shared/api/index.ts rename modules/companies/src/web/{components => dashboard/shared/helpers}/dashboard-kind-icons.ts (100%) create mode 100644 modules/companies/src/web/dashboard/shared/helpers/index.ts create mode 100644 modules/companies/src/web/dashboard/shared/index.ts rename modules/companies/src/web/{components => dashboard/shared/ui}/dashboard-block.tsx (100%) rename modules/companies/src/web/{components => dashboard/shared/ui}/dashboard-navigation-button.tsx (100%) rename modules/companies/src/web/{components => dashboard/shared/ui}/dashboard-panel.tsx (100%) rename modules/companies/src/web/{components => dashboard/shared/ui}/dashboard-state-badge.tsx (100%) rename modules/companies/src/web/{components => dashboard/shared/ui}/dashboard-table.tsx (100%) create mode 100644 modules/companies/src/web/dashboard/shared/ui/index.ts create mode 100644 modules/companies/src/web/dashboard/view/index.ts rename modules/companies/src/web/{components => dashboard/view/ui}/dashboard-activity-panel.tsx (85%) rename modules/companies/src/web/{components => dashboard/view/ui}/dashboard-attention-panel.tsx (91%) rename modules/companies/src/web/{components => dashboard/view/ui}/dashboard-companies-panel.tsx (90%) rename modules/companies/src/web/{components => dashboard/view/ui}/dashboard-page.tsx (90%) rename modules/companies/src/web/{components => dashboard/view/ui}/dashboard-statistics.tsx (94%) rename modules/companies/src/web/{components => dashboard/view/ui}/dashboard-work-panel.tsx (84%) create mode 100644 modules/companies/src/web/dashboard/view/ui/index.ts create mode 100644 modules/companies/src/web/departments/index.ts create mode 100644 modules/companies/src/web/departments/list/index.ts rename modules/companies/src/web/{components => departments/list/ui}/department-section.tsx (95%) create mode 100644 modules/companies/src/web/departments/list/ui/index.ts create mode 100644 modules/companies/src/web/departments/shared/index.ts rename modules/companies/src/web/{components => departments/shared/ui}/department-editor-dialog.tsx (100%) rename modules/companies/src/web/{components => departments/shared/ui}/department-form.tsx (92%) create mode 100644 modules/companies/src/web/departments/shared/ui/index.ts create mode 100644 modules/companies/src/web/folder-mappings/create/index.ts rename modules/companies/src/web/{folders => folder-mappings/create/ui}/folder-quick-editor.tsx (92%) create mode 100644 modules/companies/src/web/folder-mappings/create/ui/index.ts create mode 100644 modules/companies/src/web/folder-mappings/history/index.ts rename modules/companies/src/web/{folders => folder-mappings/history/ui}/folder-mapping-history-dialog.tsx (94%) create mode 100644 modules/companies/src/web/folder-mappings/history/ui/index.ts create mode 100644 modules/companies/src/web/folder-mappings/index.ts create mode 100644 modules/companies/src/web/folder-mappings/list/index.ts rename modules/companies/src/web/{folders => folder-mappings/list/ui}/folder-mappings-page.tsx (94%) create mode 100644 modules/companies/src/web/folder-mappings/list/ui/index.ts rename modules/companies/src/web/{folders => folder-mappings/shared/api}/folder-api.ts (91%) create mode 100644 modules/companies/src/web/folder-mappings/shared/api/index.ts create mode 100644 modules/companies/src/web/folder-mappings/shared/index.ts rename modules/companies/src/web/{folders => folder-mappings/shared/ui}/folder-feedback.tsx (88%) rename modules/companies/src/web/{folders => folder-mappings/shared/ui}/folder-mapping-editor-dialog.tsx (95%) rename modules/companies/src/web/{folders => folder-mappings/shared/ui}/folder-mapping-form.tsx (95%) rename modules/companies/src/web/{folders => folder-mappings/shared/ui}/folder-mapping-targets.tsx (90%) create mode 100644 modules/companies/src/web/folder-mappings/shared/ui/index.ts delete mode 100644 modules/companies/src/web/i18n.ts create mode 100644 modules/companies/src/web/intervention-templates/create/index.ts create mode 100644 modules/companies/src/web/intervention-templates/create/ui/index.ts rename modules/companies/src/web/{interventions => intervention-templates/create/ui}/intervention-template-create-dialog.tsx (90%) create mode 100644 modules/companies/src/web/intervention-templates/detail/index.ts create mode 100644 modules/companies/src/web/intervention-templates/detail/ui/index.ts rename modules/companies/src/web/intervention-templates/{ => detail/ui}/template-detail.tsx (90%) create mode 100644 modules/companies/src/web/intervention-templates/history/index.ts create mode 100644 modules/companies/src/web/intervention-templates/history/ui/index.ts rename modules/companies/src/web/intervention-templates/{ => history/ui}/template-history.tsx (86%) create mode 100644 modules/companies/src/web/intervention-templates/index.ts create mode 100644 modules/companies/src/web/intervention-templates/list/index.ts create mode 100644 modules/companies/src/web/intervention-templates/list/ui/index.ts rename modules/companies/src/web/intervention-templates/{ => list/ui}/templates-page.tsx (94%) create mode 100644 modules/companies/src/web/intervention-templates/shared/api/index.ts rename modules/companies/src/web/intervention-templates/{ => shared/api}/template-api.ts (90%) create mode 100644 modules/companies/src/web/intervention-templates/shared/index.ts rename modules/companies/src/web/intervention-templates/{ => shared}/templates.test.tsx (92%) create mode 100644 modules/companies/src/web/intervention-templates/shared/ui/index.ts rename modules/companies/src/web/intervention-templates/{ => shared/ui}/intervention-template-editor-dialog.tsx (100%) rename modules/companies/src/web/intervention-templates/{ => shared/ui}/template-feedback.tsx (90%) rename modules/companies/src/web/intervention-templates/{ => shared/ui}/template-form.tsx (97%) rename modules/companies/src/web/intervention-templates/{ => shared/ui}/template-help.tsx (100%) rename modules/companies/src/web/intervention-templates/{ => shared/ui}/template-step-fields.tsx (96%) create mode 100644 modules/companies/src/web/interventions/create/index.ts create mode 100644 modules/companies/src/web/interventions/create/ui/index.ts rename modules/companies/src/web/{tickets => interventions/create/ui}/ticket-intervention-dialog.tsx (91%) rename modules/companies/src/web/interventions/{ => create/ui}/ticket-intervention-form.tsx (81%) create mode 100644 modules/companies/src/web/interventions/detail/index.ts create mode 100644 modules/companies/src/web/interventions/detail/ui/index.ts rename modules/companies/src/web/interventions/{ => detail/ui}/intervention-detail-dialog.tsx (100%) rename modules/companies/src/web/interventions/{ => detail/ui}/intervention-detail.tsx (97%) rename modules/companies/src/web/interventions/{ => detail/ui}/intervention-snapshot.tsx (95%) create mode 100644 modules/companies/src/web/interventions/index.ts create mode 100644 modules/companies/src/web/interventions/list/index.ts create mode 100644 modules/companies/src/web/interventions/list/ui/index.ts rename modules/companies/src/web/interventions/{ => list/ui}/interventions-page.tsx (95%) rename modules/companies/src/web/interventions/{ => list/ui}/ticket-interventions.tsx (89%) create mode 100644 modules/companies/src/web/interventions/shared/api/index.ts rename modules/companies/src/web/interventions/{ => shared/api}/intervention-api.ts (92%) create mode 100644 modules/companies/src/web/interventions/shared/index.ts rename modules/companies/src/web/interventions/{ => shared}/interventions.test.tsx (93%) create mode 100644 modules/companies/src/web/interventions/shared/ui/index.ts rename modules/companies/src/web/interventions/{ => shared/ui}/intervention-company-field.tsx (88%) rename modules/companies/src/web/interventions/{ => shared/ui}/intervention-editor-dialog.tsx (100%) rename modules/companies/src/web/interventions/{ => shared/ui}/intervention-feedback.tsx (90%) rename modules/companies/src/web/interventions/{ => shared/ui}/intervention-fields.tsx (95%) rename modules/companies/src/web/interventions/{ => shared/ui}/intervention-form.tsx (95%) rename modules/companies/src/web/interventions/{ => shared/ui}/intervention-help.tsx (100%) rename modules/companies/src/web/interventions/{ => shared/ui}/intervention-procedure-fields.tsx (98%) rename modules/companies/src/web/interventions/{ => shared/ui}/intervention-steps.tsx (97%) create mode 100644 modules/companies/src/web/mail-configurations/create/index.ts create mode 100644 modules/companies/src/web/mail-configurations/create/ui/index.ts rename modules/companies/src/web/{mail => mail-configurations/create/ui}/mail-quick-editor.tsx (82%) create mode 100644 modules/companies/src/web/mail-configurations/history/index.ts create mode 100644 modules/companies/src/web/mail-configurations/history/ui/index.ts rename modules/companies/src/web/{mail => mail-configurations/history/ui}/mail-configuration-history-dialog.tsx (94%) create mode 100644 modules/companies/src/web/mail-configurations/index.ts create mode 100644 modules/companies/src/web/mail-configurations/list/index.ts create mode 100644 modules/companies/src/web/mail-configurations/list/ui/index.ts rename modules/companies/src/web/{mail => mail-configurations/list/ui}/mail-configurations-page.tsx (93%) create mode 100644 modules/companies/src/web/mail-configurations/shared/api/index.ts rename modules/companies/src/web/{mail => mail-configurations/shared/api}/mail-api.ts (90%) create mode 100644 modules/companies/src/web/mail-configurations/shared/index.ts rename modules/companies/src/web/{mail => mail-configurations/shared}/mail.test.tsx (91%) create mode 100644 modules/companies/src/web/mail-configurations/shared/ui/index.ts rename modules/companies/src/web/{mail => mail-configurations/shared/ui}/mail-configuration-editor-dialog.tsx (95%) rename modules/companies/src/web/{mail => mail-configurations/shared/ui}/mail-configuration-form.tsx (93%) rename modules/companies/src/web/{mail => mail-configurations/shared/ui}/mail-configuration-targets.tsx (95%) rename modules/companies/src/web/{mail => mail-configurations/shared/ui}/mail-feedback.tsx (88%) create mode 100644 modules/companies/src/web/mailbox-uses/create/index.ts create mode 100644 modules/companies/src/web/mailbox-uses/create/ui/index.ts rename modules/companies/src/web/{mail => mailbox-uses/create/ui}/mailbox-usage-prompt.tsx (84%) create mode 100644 modules/companies/src/web/mailbox-uses/index.ts create mode 100644 modules/companies/src/web/mailbox-uses/shared/index.ts create mode 100644 modules/companies/src/web/mailbox-uses/shared/ui/index.ts rename modules/companies/src/web/{mail => mailbox-uses/shared/ui}/mailbox-use-editor-dialog.tsx (94%) rename modules/companies/src/web/{mail => mailbox-uses/shared/ui}/mailbox-use-form.tsx (92%) create mode 100644 modules/companies/src/web/mailboxes/create/index.ts create mode 100644 modules/companies/src/web/mailboxes/create/ui/index.ts rename modules/companies/src/web/{mail => mailboxes/create/ui}/mailbox-create-dialog.tsx (86%) create mode 100644 modules/companies/src/web/mailboxes/index.ts create mode 100644 modules/companies/src/web/mailboxes/shared/api/index.ts rename modules/companies/src/web/{mail => mailboxes/shared/api}/mailbox-api.ts (81%) create mode 100644 modules/companies/src/web/mailboxes/shared/index.ts create mode 100644 modules/companies/src/web/mailboxes/shared/ui/index.ts rename modules/companies/src/web/{mail => mailboxes/shared/ui}/mailbox-form.tsx (85%) rename modules/companies/src/web/{mail => mailboxes/shared/ui}/mailbox-relations.tsx (89%) create mode 100644 modules/companies/src/web/people/detail/index.ts create mode 100644 modules/companies/src/web/people/detail/ui/index.ts rename modules/companies/src/web/{components => people/detail/ui}/person-details.tsx (96%) create mode 100644 modules/companies/src/web/people/index.ts create mode 100644 modules/companies/src/web/people/list/index.ts create mode 100644 modules/companies/src/web/people/list/ui/index.ts rename modules/companies/src/web/{components => people/list/ui}/people-section.tsx (97%) create mode 100644 modules/companies/src/web/people/shared/index.ts create mode 100644 modules/companies/src/web/people/shared/ui/index.ts rename modules/companies/src/web/{components => people/shared/ui}/person-editor-dialog.tsx (100%) rename modules/companies/src/web/{components => people/shared/ui}/person-form.tsx (91%) create mode 100644 modules/companies/src/web/printer-configurations/create/index.ts create mode 100644 modules/companies/src/web/printer-configurations/create/ui/index.ts rename modules/companies/src/web/{printers => printer-configurations/create/ui}/printer-profile-create-dialog.tsx (86%) create mode 100644 modules/companies/src/web/printer-configurations/history/index.ts create mode 100644 modules/companies/src/web/printer-configurations/history/ui/index.ts rename modules/companies/src/web/{printers => printer-configurations/history/ui}/printer-history-dialog.tsx (95%) create mode 100644 modules/companies/src/web/printer-configurations/index.ts create mode 100644 modules/companies/src/web/printer-configurations/list/index.ts create mode 100644 modules/companies/src/web/printer-configurations/list/ui/index.ts rename modules/companies/src/web/{printers => printer-configurations/list/ui}/printer-configurations-page.tsx (94%) create mode 100644 modules/companies/src/web/printer-configurations/shared/api/index.ts rename modules/companies/src/web/{printers => printer-configurations/shared/api}/printer-api.ts (90%) create mode 100644 modules/companies/src/web/printer-configurations/shared/index.ts rename modules/companies/src/web/{printers => printer-configurations/shared}/printer.test.tsx (89%) create mode 100644 modules/companies/src/web/printer-configurations/shared/ui/index.ts rename modules/companies/src/web/{printers => printer-configurations/shared/ui}/printer-configuration-editor-dialog.tsx (95%) rename modules/companies/src/web/{printers => printer-configurations/shared/ui}/printer-configuration-form.tsx (95%) rename modules/companies/src/web/{printers => printer-configurations/shared/ui}/printer-feedback.tsx (88%) create mode 100644 modules/companies/src/web/process-templates/index.ts create mode 100644 modules/companies/src/web/process-templates/list/index.ts create mode 100644 modules/companies/src/web/process-templates/list/ui/index.ts rename modules/companies/src/web/{processes => process-templates/list/ui}/process-templates-page.tsx (96%) create mode 100644 modules/companies/src/web/process-templates/shared/index.ts create mode 100644 modules/companies/src/web/process-templates/shared/ui/index.ts rename modules/companies/src/web/{processes => process-templates/shared/ui}/process-template-editor-dialog.tsx (100%) rename modules/companies/src/web/{processes => process-templates/shared/ui}/process-template-form.tsx (95%) create mode 100644 modules/companies/src/web/processes/create/index.ts create mode 100644 modules/companies/src/web/processes/create/ui/index.ts rename modules/companies/src/web/processes/{ => create/ui}/process-quick-create-dialog.tsx (88%) create mode 100644 modules/companies/src/web/processes/detail/index.ts create mode 100644 modules/companies/src/web/processes/detail/ui/index.ts rename modules/companies/src/web/processes/{ => detail/ui}/process-detail.tsx (94%) create mode 100644 modules/companies/src/web/processes/index.ts create mode 100644 modules/companies/src/web/processes/list/index.ts create mode 100644 modules/companies/src/web/processes/list/ui/index.ts rename modules/companies/src/web/processes/{ => list/ui}/processes-page.tsx (95%) create mode 100644 modules/companies/src/web/processes/shared/api/index.ts rename modules/companies/src/web/processes/{ => shared/api}/process-api.ts (96%) create mode 100644 modules/companies/src/web/processes/shared/helpers/index.ts rename modules/companies/src/web/processes/{ => shared/helpers}/process-labels.ts (94%) create mode 100644 modules/companies/src/web/processes/shared/index.ts rename modules/companies/src/web/processes/{ => shared}/processes.test.tsx (91%) create mode 100644 modules/companies/src/web/processes/shared/ui/index.ts rename modules/companies/src/web/processes/{ => shared/ui}/process-feedback.tsx (92%) rename modules/companies/src/web/processes/{ => shared/ui}/process-help.tsx (100%) create mode 100644 modules/companies/src/web/processes/start/index.ts create mode 100644 modules/companies/src/web/processes/start/ui/index.ts rename modules/companies/src/web/processes/{ => start/ui}/process-start-dialog.tsx (93%) rename modules/companies/src/web/processes/{ => start/ui}/process-start-form.tsx (93%) create mode 100644 modules/companies/src/web/processes/update/index.ts create mode 100644 modules/companies/src/web/processes/update/ui/index.ts rename modules/companies/src/web/processes/{ => update/ui}/process-edit-dialog.tsx (100%) rename modules/companies/src/web/processes/{ => update/ui}/process-edit-form.tsx (94%) rename modules/companies/src/web/processes/{ => update/ui}/process-task-field.tsx (93%) create mode 100644 modules/companies/src/web/remote-connections/create/index.ts create mode 100644 modules/companies/src/web/remote-connections/create/ui/index.ts rename modules/companies/src/web/{remote => remote-connections/create/ui}/remote-quick-editor.tsx (90%) create mode 100644 modules/companies/src/web/remote-connections/detail/index.ts create mode 100644 modules/companies/src/web/remote-connections/detail/ui/index.ts rename modules/companies/src/web/{remote => remote-connections/detail/ui}/remote-summary.tsx (93%) create mode 100644 modules/companies/src/web/remote-connections/history/index.ts create mode 100644 modules/companies/src/web/remote-connections/history/ui/index.ts rename modules/companies/src/web/{remote => remote-connections/history/ui}/remote-connection-history-dialog.tsx (90%) create mode 100644 modules/companies/src/web/remote-connections/index.ts create mode 100644 modules/companies/src/web/remote-connections/list/index.ts create mode 100644 modules/companies/src/web/remote-connections/list/ui/index.ts rename modules/companies/src/web/{remote => remote-connections/list/ui}/remote-connections-page.tsx (94%) create mode 100644 modules/companies/src/web/remote-connections/shared/api/index.ts rename modules/companies/src/web/{remote => remote-connections/shared/api}/remote-api.ts (90%) create mode 100644 modules/companies/src/web/remote-connections/shared/index.ts rename modules/companies/src/web/{remote => remote-connections/shared}/remote.test.tsx (91%) create mode 100644 modules/companies/src/web/remote-connections/shared/ui/index.ts rename modules/companies/src/web/{remote => remote-connections/shared/ui}/remote-connection-editor-dialog.tsx (95%) rename modules/companies/src/web/{remote => remote-connections/shared/ui}/remote-connection-form.tsx (95%) rename modules/companies/src/web/{remote => remote-connections/shared/ui}/remote-endpoint-fields.tsx (94%) rename modules/companies/src/web/{remote => remote-connections/shared/ui}/remote-feedback.tsx (91%) create mode 100644 modules/companies/src/web/shared/helpers/index.ts rename modules/companies/src/web/{components => shared/helpers}/initials-avatar-appearance.ts (100%) create mode 100644 modules/companies/src/web/shared/i18n.ts create mode 100644 modules/companies/src/web/shared/index.ts rename modules/companies/src/web/{components => shared}/initials-avatar.test.tsx (94%) rename modules/companies/src/web/{components => shared/ui}/configuration-quick-editor.tsx (93%) create mode 100644 modules/companies/src/web/shared/ui/index.ts rename modules/companies/src/web/{components => shared/ui}/initials-avatar.tsx (90%) create mode 100644 modules/companies/src/web/sites/index.ts create mode 100644 modules/companies/src/web/sites/list/index.ts create mode 100644 modules/companies/src/web/sites/list/ui/index.ts rename modules/companies/src/web/{components => sites/list/ui}/site-section.tsx (95%) create mode 100644 modules/companies/src/web/sites/shared/index.ts create mode 100644 modules/companies/src/web/sites/shared/ui/index.ts rename modules/companies/src/web/{components => sites/shared/ui}/site-editor-dialog.tsx (100%) rename modules/companies/src/web/{components => sites/shared/ui}/site-form.tsx (90%) create mode 100644 modules/companies/src/web/telework-authorizations/detail/index.ts create mode 100644 modules/companies/src/web/telework-authorizations/detail/ui/index.ts rename modules/companies/src/web/{telework => telework-authorizations/detail/ui}/telework-authorization-summary.tsx (94%) create mode 100644 modules/companies/src/web/telework-authorizations/history/index.ts create mode 100644 modules/companies/src/web/telework-authorizations/history/ui/index.ts rename modules/companies/src/web/{telework => telework-authorizations/history/ui}/telework-authorization-history-dialog.tsx (94%) create mode 100644 modules/companies/src/web/telework-authorizations/index.ts create mode 100644 modules/companies/src/web/telework-authorizations/list/index.ts create mode 100644 modules/companies/src/web/telework-authorizations/list/ui/index.ts rename modules/companies/src/web/{telework => telework-authorizations/list/ui}/telework-authorizations-page.tsx (92%) create mode 100644 modules/companies/src/web/telework-authorizations/shared/api/index.ts rename modules/companies/src/web/{telework => telework-authorizations/shared/api}/telework-api.ts (90%) create mode 100644 modules/companies/src/web/telework-authorizations/shared/index.ts rename modules/companies/src/web/{telework => telework-authorizations/shared}/telework.test.tsx (90%) create mode 100644 modules/companies/src/web/telework-authorizations/shared/ui/index.ts rename modules/companies/src/web/{telework => telework-authorizations/shared/ui}/telework-authorization-editor-dialog.tsx (95%) rename modules/companies/src/web/{telework => telework-authorizations/shared/ui}/telework-authorization-form.tsx (94%) rename modules/companies/src/web/{telework => telework-authorizations/shared/ui}/telework-feedback.tsx (90%) create mode 100644 modules/companies/src/web/tickets/create/index.ts create mode 100644 modules/companies/src/web/tickets/create/ui/index.ts rename modules/companies/src/web/{interventions => tickets/create/ui}/intervention-ticket-create-dialog.tsx (95%) rename modules/companies/src/web/tickets/{ => create/ui}/ticket-quick-editor.tsx (91%) rename modules/companies/src/web/tickets/{ => create/ui}/ticket-quick-forms.tsx (89%) rename modules/companies/src/web/tickets/{ => create/ui}/ticket-target-create-dialog.tsx (100%) create mode 100644 modules/companies/src/web/tickets/detail/index.ts create mode 100644 modules/companies/src/web/tickets/detail/ui/index.ts rename modules/companies/src/web/tickets/{ => detail/ui}/ticket-detail-dialog.tsx (100%) rename modules/companies/src/web/tickets/{ => detail/ui}/ticket-detail.tsx (93%) create mode 100644 modules/companies/src/web/tickets/index.ts create mode 100644 modules/companies/src/web/tickets/list/index.ts create mode 100644 modules/companies/src/web/tickets/list/ui/index.ts rename modules/companies/src/web/tickets/{ => list/ui}/tickets-page.tsx (95%) create mode 100644 modules/companies/src/web/tickets/shared/api/index.ts rename modules/companies/src/web/tickets/{ => shared/api}/ticket-api.ts (88%) create mode 100644 modules/companies/src/web/tickets/shared/index.ts rename modules/companies/src/web/tickets/{ => shared}/tickets.test.tsx (93%) create mode 100644 modules/companies/src/web/tickets/shared/ui/index.ts rename modules/companies/src/web/tickets/{ => shared/ui}/ticket-classification-fields.tsx (91%) rename modules/companies/src/web/tickets/{ => shared/ui}/ticket-editor-dialog.tsx (100%) rename modules/companies/src/web/tickets/{ => shared/ui}/ticket-feedback.tsx (91%) rename modules/companies/src/web/tickets/{ => shared/ui}/ticket-form.tsx (96%) rename modules/companies/src/web/tickets/{ => shared/ui}/ticket-help.tsx (100%) rename modules/companies/src/web/tickets/{ => shared/ui}/ticket-targets.tsx (96%) create mode 100644 modules/companies/src/web/work-environments/detail/hooks/index.ts rename modules/companies/src/web/{profiles => work-environments/detail/hooks}/use-environment-queries.ts (81%) create mode 100644 modules/companies/src/web/work-environments/detail/index.ts rename modules/companies/src/web/{profiles => work-environments/detail/ui}/environment-content.tsx (94%) rename modules/companies/src/web/{profiles => work-environments/detail/ui}/environment-section.tsx (98%) rename modules/companies/src/web/{profiles => work-environments/detail/ui}/hardware-characteristics.tsx (100%) create mode 100644 modules/companies/src/web/work-environments/detail/ui/index.ts rename modules/companies/src/web/{profiles => work-environments/detail/ui}/profile-configurations.tsx (74%) rename modules/companies/src/web/{profiles => work-environments/detail/ui}/work-environment-page.tsx (89%) create mode 100644 modules/companies/src/web/work-environments/index.ts create mode 100644 modules/companies/src/web/work-environments/shared/helpers/index.ts rename modules/companies/src/web/{profiles => work-environments/shared/helpers}/work-environment.model.ts (99%) create mode 100644 modules/companies/src/web/work-environments/shared/index.ts rename modules/companies/src/web/{profiles => work-environments/shared}/work-environment.test.tsx (93%) create mode 100644 modules/companies/src/web/work-profiles/history/index.ts create mode 100644 modules/companies/src/web/work-profiles/history/ui/index.ts rename modules/companies/src/web/{profiles => work-profiles/history/ui}/work-profile-history-dialog.tsx (97%) create mode 100644 modules/companies/src/web/work-profiles/index.ts create mode 100644 modules/companies/src/web/work-profiles/list/index.ts create mode 100644 modules/companies/src/web/work-profiles/list/ui/index.ts rename modules/companies/src/web/{profiles => work-profiles/list/ui}/work-profiles-page.tsx (94%) create mode 100644 modules/companies/src/web/work-profiles/shared/api/index.ts rename modules/companies/src/web/{profiles => work-profiles/shared/api}/work-profile-api.ts (86%) create mode 100644 modules/companies/src/web/work-profiles/shared/index.ts rename modules/companies/src/web/{profiles => work-profiles/shared}/profile.test.tsx (90%) create mode 100644 modules/companies/src/web/work-profiles/shared/types/index.ts rename modules/companies/src/web/{profiles => work-profiles/shared/types}/profile-selection.ts (65%) create mode 100644 modules/companies/src/web/work-profiles/shared/ui/index.ts rename modules/companies/src/web/{profiles => work-profiles/shared/ui}/profile-feedback.tsx (86%) rename modules/companies/src/web/{profiles => work-profiles/shared/ui}/work-profile-editor-dialog.tsx (94%) rename modules/companies/src/web/{profiles => work-profiles/shared/ui}/work-profile-form.tsx (93%) create mode 100644 modules/companies/src/web/workspace/catalogs/index.ts rename modules/companies/src/web/{components => workspace/catalogs/ui}/global-catalog-content.tsx (84%) create mode 100644 modules/companies/src/web/workspace/catalogs/ui/index.ts create mode 100644 modules/companies/src/web/workspace/index.ts create mode 100644 modules/companies/src/web/workspace/settings/index.ts create mode 100644 modules/companies/src/web/workspace/settings/ui/index.ts rename modules/companies/src/web/{components => workspace/settings/ui}/workspace-settings-dialog.tsx (100%) create mode 100644 modules/companies/src/web/workspace/shared/index.ts create mode 100644 modules/companies/src/web/workspace/shared/types/index.ts rename modules/companies/src/web/{components => workspace/shared/types}/workspace-location.ts (60%) create mode 100644 modules/companies/src/web/workspace/shared/ui/index.ts rename modules/companies/src/web/{components => workspace/shared/ui}/workspace-navigation-button.tsx (100%) create mode 100644 modules/companies/src/web/workspace/view/index.ts rename modules/companies/src/web/{components => workspace/view/ui}/companies-workspace.tsx (92%) create mode 100644 modules/companies/src/web/workspace/view/ui/index.ts rename modules/companies/src/web/{components => workspace/view/ui}/workspace-content.tsx (82%) rename modules/companies/src/web/{components => workspace/view/ui}/workspace-header.tsx (97%) rename modules/companies/src/web/{components => workspace/view/ui}/workspace-sidebar.tsx (97%) rename modules/core/src/web/{ => health/check}/api/core.api.ts (70%) create mode 100644 modules/core/src/web/health/check/api/index.ts create mode 100644 modules/core/src/web/health/check/index.ts create mode 100644 modules/core/src/web/health/index.ts create mode 100644 modules/core/src/web/health/shared/index.ts rename modules/core/src/web/{ => health/shared}/queries/core.query-keys.ts (100%) create mode 100644 modules/core/src/web/health/shared/queries/index.ts create mode 100644 modules/core/src/web/workspace/index.ts create mode 100644 modules/core/src/web/workspace/view/index.ts rename modules/core/src/web/{pages => workspace/view/ui}/home-page.tsx (95%) create mode 100644 modules/core/src/web/workspace/view/ui/index.ts delete mode 100644 modules/identity/src/web/i18n.ts create mode 100644 modules/identity/src/web/passwords/change/index.ts rename modules/identity/src/web/{components => passwords/change/ui}/account-password-dialog.tsx (92%) create mode 100644 modules/identity/src/web/passwords/change/ui/index.ts create mode 100644 modules/identity/src/web/passwords/index.ts create mode 100644 modules/identity/src/web/passwords/shared/index.ts create mode 100644 modules/identity/src/web/passwords/shared/ui/index.ts rename modules/identity/src/web/{components => passwords/shared/ui}/password-form.tsx (94%) create mode 100644 modules/identity/src/web/sessions/index.ts create mode 100644 modules/identity/src/web/sessions/shared/index.ts rename modules/identity/src/web/{components => sessions/shared/ui}/credential-form.tsx (94%) create mode 100644 modules/identity/src/web/sessions/shared/ui/index.ts rename modules/identity/src/web/{ => shared}/api/identity-api.ts (98%) create mode 100644 modules/identity/src/web/shared/api/index.ts create mode 100644 modules/identity/src/web/shared/i18n.ts create mode 100644 modules/identity/src/web/shared/index.ts rename modules/identity/src/web/{components => shared/ui}/form-feedback.tsx (90%) create mode 100644 modules/identity/src/web/shared/ui/index.ts create mode 100644 modules/identity/src/web/users/index.ts create mode 100644 modules/identity/src/web/users/list/index.ts create mode 100644 modules/identity/src/web/users/list/ui/index.ts rename modules/identity/src/web/{components => users/list/ui}/user-management-dialog.tsx (100%) rename modules/identity/src/web/{components => users/list/ui}/user-management.tsx (94%) create mode 100644 modules/identity/src/web/users/shared/index.ts create mode 100644 modules/identity/src/web/users/shared/ui/index.ts rename modules/identity/src/web/{components => users/shared/ui}/user-editor-dialog.tsx (92%) rename modules/identity/src/web/{components => users/shared/ui}/user-form.tsx (96%) create mode 100644 modules/identity/src/web/workspace/index.ts create mode 100644 modules/identity/src/web/workspace/shared/index.ts create mode 100644 modules/identity/src/web/workspace/shared/types/index.ts rename modules/identity/src/web/{components => workspace/shared/types}/workspace-page.ts (82%) create mode 100644 modules/identity/src/web/workspace/view/index.ts rename modules/identity/src/web/{components => workspace/view/ui}/authenticated-workspace.tsx (91%) rename modules/identity/src/web/{components => workspace/view/ui}/custom-workspace.tsx (85%) rename modules/identity/src/web/{components => workspace/view/ui}/identity-workspace.tsx (90%) create mode 100644 modules/identity/src/web/workspace/view/ui/index.ts create mode 100644 modules/resources/src/web/catalog-fields/create/index.ts rename modules/resources/src/web/{ => catalog-fields/create/ui}/catalog-field-create-dialog.tsx (93%) create mode 100644 modules/resources/src/web/catalog-fields/create/ui/index.ts create mode 100644 modules/resources/src/web/catalog-fields/index.ts create mode 100644 modules/resources/src/web/catalog-fields/shared/index.ts rename modules/resources/src/web/{ => catalog-fields/shared/ui}/catalog-form.tsx (90%) create mode 100644 modules/resources/src/web/catalog-fields/shared/ui/index.ts create mode 100644 modules/resources/src/web/catalog-templates/create/index.ts rename modules/resources/src/web/{ => catalog-templates/create/ui}/catalog-template-create-dialog.tsx (93%) create mode 100644 modules/resources/src/web/catalog-templates/create/ui/index.ts create mode 100644 modules/resources/src/web/catalog-templates/index.ts create mode 100644 modules/resources/src/web/catalog-templates/shared/index.ts rename modules/resources/src/web/{ => catalog-templates/shared/ui}/catalog-template-form.tsx (94%) create mode 100644 modules/resources/src/web/catalog-templates/shared/ui/index.ts create mode 100644 modules/resources/src/web/catalog/detail/index.ts rename modules/resources/src/web/{ => catalog/detail/ui}/catalog-definition-dialog.tsx (96%) create mode 100644 modules/resources/src/web/catalog/detail/ui/index.ts create mode 100644 modules/resources/src/web/catalog/index.ts create mode 100644 modules/resources/src/web/catalog/list/index.ts rename modules/resources/src/web/{ => catalog/list/ui}/catalog-cell.tsx (95%) rename modules/resources/src/web/{ => catalog/list/ui}/catalog-page.tsx (95%) rename modules/resources/src/web/{ => catalog/list/ui}/catalog-row-actions.tsx (94%) create mode 100644 modules/resources/src/web/catalog/list/ui/index.ts rename modules/resources/src/web/{ => catalog/shared/api}/catalog-api.ts (94%) create mode 100644 modules/resources/src/web/catalog/shared/api/index.ts rename modules/resources/src/web/{ => catalog/shared}/catalog.test.tsx (82%) create mode 100644 modules/resources/src/web/catalog/shared/controllers/index.ts rename modules/resources/src/web/{ => catalog/shared/controllers}/use-catalog-save.ts (92%) create mode 100644 modules/resources/src/web/catalog/shared/index.ts rename modules/resources/src/web/{ => catalog/shared/ui}/catalog-editor-dialog.tsx (88%) rename modules/resources/src/web/{ => catalog/shared/ui}/catalog-error.tsx (90%) rename modules/resources/src/web/{ => catalog/shared/ui}/catalog-help.tsx (100%) rename modules/resources/src/web/{ => catalog/shared/ui}/catalog-name.tsx (94%) create mode 100644 modules/resources/src/web/catalog/shared/ui/index.ts delete mode 100644 modules/resources/src/web/i18n.ts create mode 100644 modules/resources/src/web/resources/detail/index.ts create mode 100644 modules/resources/src/web/resources/detail/ui/index.ts rename modules/resources/src/web/{ => resources/detail/ui}/integration-summary.tsx (93%) rename modules/resources/src/web/{ => resources/detail/ui}/resource-detail-dialog.tsx (100%) rename modules/resources/src/web/{ => resources/detail/ui}/resource-detail.tsx (97%) create mode 100644 modules/resources/src/web/resources/index.ts create mode 100644 modules/resources/src/web/resources/list/index.ts create mode 100644 modules/resources/src/web/resources/list/ui/index.ts rename modules/resources/src/web/{ => resources/list/ui}/resources-page.tsx (93%) create mode 100644 modules/resources/src/web/resources/shared/api/index.ts rename modules/resources/src/web/{ => resources/shared/api}/inventory-api.ts (93%) create mode 100644 modules/resources/src/web/resources/shared/index.ts rename modules/resources/src/web/{ => resources/shared}/resources.test.tsx (89%) create mode 100644 modules/resources/src/web/resources/shared/ui/index.ts rename modules/resources/src/web/{ => resources/shared/ui}/resource-characteristic-control.tsx (96%) rename modules/resources/src/web/{ => resources/shared/ui}/resource-editor-dialog.tsx (100%) rename modules/resources/src/web/{ => resources/shared/ui}/resource-editor.tsx (92%) rename modules/resources/src/web/{ => resources/shared/ui}/resource-form.tsx (96%) rename modules/resources/src/web/{ => resources/shared/ui}/resource-integration-fields.tsx (99%) create mode 100644 modules/resources/src/web/shared/i18n.ts create mode 100644 modules/resources/src/web/shared/index.ts create mode 100644 modules/resources/src/web/shared/ui/index.ts rename modules/resources/src/web/{ => shared/ui}/inventory-feedback.tsx (85%) diff --git a/TODO.md b/TODO.md index 7677a2e..8ca552a 100644 --- a/TODO.md +++ b/TODO.md @@ -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: ```plaintext diff --git a/apps/web/src/app.test.tsx b/apps/web/src/app.test.tsx index 78f5d37..95d3efa 100644 --- a/apps/web/src/app.test.tsx +++ b/apps/web/src/app.test.tsx @@ -10,12 +10,12 @@ import { renderToStaticMarkup } from "react-dom/server"; import { I18nextProvider } from "react-i18next"; import { + DashboardNavigationButton, + DashboardStateBadge, + DashboardTable, dashboardKeys, entryDestination, -} from "../../../modules/companies/src/web/components/dashboard-api"; -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"; +} from "../../../modules/companies/src/web/dashboard"; import { App } from "./app"; import { createAppI18n } from "./i18n"; diff --git a/docs/arquitectura/capas-del-servidor.md b/docs/arquitectura/capas-del-servidor.md index 3863c8c..ce30def 100644 --- a/docs/arquitectura/capas-del-servidor.md +++ b/docs/arquitectura/capas-del-servidor.md @@ -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. +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. ## Dependencias diff --git a/docs/componentes-de-interfaz.md b/docs/componentes-de-interfaz.md index 12a6393..c193cc7 100644 --- a/docs/componentes-de-interfaz.md +++ b/docs/componentes-de-interfaz.md @@ -112,6 +112,9 @@ BrandSelect, dentro del módulo assets, adapta SelectWithAction al catálogo rem ## 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, 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. @@ -193,7 +196,7 @@ dependientes de la cabecera que lo contiene. ## 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` 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 diff --git a/docs/estructura-web-por-entidades-y-operaciones.md b/docs/estructura-web-por-entidades-y-operaciones.md new file mode 100644 index 0000000..8107ecf --- /dev/null +++ b/docs/estructura-web-por-entidades-y-operaciones.md @@ -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. +- `/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//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. diff --git a/docs/inventario-de-modales.md b/docs/inventario-de-modales.md index f573163..a1646e5 100644 --- a/docs/inventario-de-modales.md +++ b/docs/inventario-de-modales.md @@ -35,137 +35,142 @@ recuperar desde Git. ## Componentes por área +Las rutas reflejan la [estructura por entidades y operaciones](estructura-web-por-entidades-y-operaciones.md). + ### modules/assets/src/web -- [AssetDetailDialog](../modules/assets/src/web/asset-detail-dialog.tsx) -- [AssetEditorDialog](../modules/assets/src/web/asset-editor-dialog.tsx) -- [BrandEditorDialog](../modules/assets/src/web/brand-editor-dialog.tsx) -- [CatalogDefinitionDialog](../modules/assets/src/web/catalog-definition-dialog.tsx) -- [CatalogEditorDialog](../modules/assets/src/web/catalog-editor-dialog.tsx) -- [CatalogFieldCreateDialog](../modules/assets/src/web/catalog-field-create-dialog.tsx) -- [CatalogRelationCreateDialog](../modules/assets/src/web/catalog-relation-create-dialog.tsx) -- [CatalogTemplateCreateDialog](../modules/assets/src/web/catalog-template-create-dialog.tsx) -- [EndRelationshipDialog](../modules/assets/src/web/end-relationship-dialog.tsx) -- [RelationshipEditorDialog](../modules/assets/src/web/relationship-editor-dialog.tsx) -- [SupportConnectionEditorDialog](../modules/assets/src/web/support-connection-editor-dialog.tsx) -- [SupportHistoryDialog](../modules/assets/src/web/support-history-dialog.tsx) -- [SupportToolEditorDialog](../modules/assets/src/web/support-tool-editor-dialog.tsx) -- [SupportToolsDialog](../modules/assets/src/web/support-tools-dialog.tsx) -- [WorkstationAssetCreateDialog](../modules/assets/src/web/workstation-asset-create-dialog.tsx) -- [WorkstationEditorDialog](../modules/assets/src/web/workstation-editor-dialog.tsx) -- [WorkstationHistoryDialog](../modules/assets/src/web/workstation-history-dialog.tsx) +- [AssetDetailDialog](../modules/assets/src/web/assets/detail/ui/asset-detail-dialog.tsx) +- [AssetEditorDialog](../modules/assets/src/web/assets/shared/ui/asset-editor-dialog.tsx) +- [BrandEditorDialog](../modules/assets/src/web/brands/shared/ui/brand-editor-dialog.tsx) +- [CatalogDefinitionDialog](../modules/assets/src/web/catalog/detail/ui/catalog-definition-dialog.tsx) +- [CatalogEditorDialog](../modules/assets/src/web/catalog/shared/ui/catalog-editor-dialog.tsx) +- [CatalogFieldCreateDialog](../modules/assets/src/web/catalog-fields/create/ui/catalog-field-create-dialog.tsx) +- [CatalogRelationCreateDialog](../modules/assets/src/web/catalog-relations/create/ui/catalog-relation-create-dialog.tsx) +- [CatalogTemplateCreateDialog](../modules/assets/src/web/catalog-templates/create/ui/catalog-template-create-dialog.tsx) +- [EndRelationshipDialog](../modules/assets/src/web/asset-relationships/end/ui/end-relationship-dialog.tsx) +- [RelationshipEditorDialog](../modules/assets/src/web/asset-relationships/shared/ui/relationship-editor-dialog.tsx) +- [SupportConnectionEditorDialog](../modules/assets/src/web/support-connections/shared/ui/support-connection-editor-dialog.tsx) +- [SupportHistoryDialog](../modules/assets/src/web/support-connections/history/ui/support-history-dialog.tsx) +- [SupportToolEditorDialog](../modules/assets/src/web/support-tools/shared/ui/support-tool-editor-dialog.tsx) +- [SupportToolsDialog](../modules/assets/src/web/support-tools/list/ui/support-tools-dialog.tsx) +- [WorkstationAssetCreateDialog](../modules/assets/src/web/assets/create/ui/workstation-asset-create-dialog.tsx) +- [WorkstationEditorDialog](../modules/assets/src/web/workstations/shared/ui/workstation-editor-dialog.tsx) +- [WorkstationHistoryDialog](../modules/assets/src/web/workstations/history/ui/workstation-history-dialog.tsx) ### modules/companies/src/web/access -- [AccessEditorDialog](../modules/companies/src/web/access/access-editor-dialog.tsx) -- [AccessHelpDialog](../modules/companies/src/web/access/access-help-dialog.tsx) -- [AccessHistory](../modules/companies/src/web/access/access-history.tsx) -- [AccessQuickEditor](../modules/companies/src/web/access/access-quick-editor.tsx) -- [QuickCreateDialog](../modules/companies/src/web/access/quick-create-dialog.tsx) +- [AccessEditorDialog](../modules/companies/src/web/access/shared/ui/access-editor-dialog.tsx) +- [AccessHelpDialog](../modules/companies/src/web/access/help/ui/access-help-dialog.tsx) +- [AccessHistory](../modules/companies/src/web/access/history/ui/access-history.tsx) +- [AccessQuickEditor](../modules/companies/src/web/access/create/ui/access-quick-editor.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) -- [ApplicationHistoryDialog](../modules/companies/src/web/applications/application-history-dialog.tsx) -- [ApplicationQuickEditor](../modules/companies/src/web/applications/application-quick-editor.tsx) +- [ApplicationConfigurationEditorDialog](../modules/companies/src/web/application-configurations/shared/ui/application-configuration-editor-dialog.tsx) +- [ApplicationHistoryDialog](../modules/companies/src/web/application-configurations/history/ui/application-history-dialog.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) -- [CertificateHistoryDialog](../modules/companies/src/web/certificates/certificate-history-dialog.tsx) -- [CertificateQuickEditor](../modules/companies/src/web/certificates/certificate-quick-editor.tsx) +- [CertificateConfigurationEditorDialog](../modules/companies/src/web/certificate-configurations/shared/ui/certificate-configuration-editor-dialog.tsx) +- [CertificateHistoryDialog](../modules/companies/src/web/certificate-configurations/history/ui/certificate-history-dialog.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) -- [AssignmentHistoryDialog](../modules/companies/src/web/components/assignment-history-dialog.tsx) -- [CompanyEditorDialog](../modules/companies/src/web/components/company-editor-dialog.tsx) -- [ConfigurationQuickEditor](../modules/companies/src/web/components/configuration-quick-editor.tsx) -- [DashboardDetailsDialog](../modules/companies/src/web/components/dashboard-details-dialog.tsx) -- [DashboardQuickCreate](../modules/companies/src/web/components/dashboard-quick-create.tsx) -- [DepartmentEditorDialog](../modules/companies/src/web/components/department-editor-dialog.tsx) -- [InventoryQuickCreateDialog](../modules/companies/src/web/components/inventory-quick-create-dialog.tsx) -- [PersonEditorDialog](../modules/companies/src/web/components/person-editor-dialog.tsx) -- [SiteEditorDialog](../modules/companies/src/web/components/site-editor-dialog.tsx) -- [WorkspaceSettingsDialog](../modules/companies/src/web/components/workspace-settings-dialog.tsx) +- [AssignmentEditorDialog](../modules/companies/src/web/assignments/shared/ui/assignment-editor-dialog.tsx) +- [AssignmentHistoryDialog](../modules/companies/src/web/assignments/history/ui/assignment-history-dialog.tsx) +- [CompanyEditorDialog](../modules/companies/src/web/companies/shared/ui/company-editor-dialog.tsx) +- [ConfigurationQuickEditor](../modules/companies/src/web/shared/ui/configuration-quick-editor.tsx) +- [DashboardDetailsDialog](../modules/companies/src/web/dashboard/detail/ui/dashboard-details-dialog.tsx) +- [DashboardQuickCreate](../modules/companies/src/web/dashboard/create/ui/dashboard-quick-create.tsx) +- [DepartmentEditorDialog](../modules/companies/src/web/departments/shared/ui/department-editor-dialog.tsx) +- [InventoryQuickCreateDialog](../modules/companies/src/web/companies/detail/ui/inventory-quick-create-dialog.tsx) +- [PersonEditorDialog](../modules/companies/src/web/people/shared/ui/person-editor-dialog.tsx) +- [SiteEditorDialog](../modules/companies/src/web/sites/shared/ui/site-editor-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) -- [FolderMappingHistoryDialog](../modules/companies/src/web/folders/folder-mapping-history-dialog.tsx) -- [FolderQuickEditor](../modules/companies/src/web/folders/folder-quick-editor.tsx) +- [FolderMappingEditorDialog](../modules/companies/src/web/folder-mappings/shared/ui/folder-mapping-editor-dialog.tsx) +- [FolderMappingHistoryDialog](../modules/companies/src/web/folder-mappings/history/ui/folder-mapping-history-dialog.tsx) +- [FolderQuickEditor](../modules/companies/src/web/folder-mappings/create/ui/folder-quick-editor.tsx) ### 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 -- [InterventionDetailDialog](../modules/companies/src/web/interventions/intervention-detail-dialog.tsx) -- [InterventionEditorDialog](../modules/companies/src/web/interventions/intervention-editor-dialog.tsx) -- [InterventionTemplateCreateDialog](../modules/companies/src/web/interventions/intervention-template-create-dialog.tsx) -- [InterventionTicketCreateDialog](../modules/companies/src/web/interventions/intervention-ticket-create-dialog.tsx) +- [InterventionDetailDialog](../modules/companies/src/web/interventions/detail/ui/intervention-detail-dialog.tsx) +- [InterventionEditorDialog](../modules/companies/src/web/interventions/shared/ui/intervention-editor-dialog.tsx) +- [TicketInterventionDialog](../modules/companies/src/web/interventions/create/ui/ticket-intervention-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) -- [MailboxUseEditorDialog](../modules/companies/src/web/mail/mailbox-use-editor-dialog.tsx) -- [MailConfigurationEditorDialog](../modules/companies/src/web/mail/mail-configuration-editor-dialog.tsx) -- [MailConfigurationHistoryDialog](../modules/companies/src/web/mail/mail-configuration-history-dialog.tsx) -- [MailQuickEditor](../modules/companies/src/web/mail/mail-quick-editor.tsx) +- [MailboxCreateDialog](../modules/companies/src/web/mailboxes/create/ui/mailbox-create-dialog.tsx) +- [MailboxUseEditorDialog](../modules/companies/src/web/mailbox-uses/shared/ui/mailbox-use-editor-dialog.tsx) +- [MailConfigurationEditorDialog](../modules/companies/src/web/mail-configurations/shared/ui/mail-configuration-editor-dialog.tsx) +- [MailConfigurationHistoryDialog](../modules/companies/src/web/mail-configurations/history/ui/mail-configuration-history-dialog.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) -- [PrinterHistoryDialog](../modules/companies/src/web/printers/printer-history-dialog.tsx) -- [PrinterProfileCreateDialog](../modules/companies/src/web/printers/printer-profile-create-dialog.tsx) +- [PrinterConfigurationEditorDialog](../modules/companies/src/web/printer-configurations/shared/ui/printer-configuration-editor-dialog.tsx) +- [PrinterHistoryDialog](../modules/companies/src/web/printer-configurations/history/ui/printer-history-dialog.tsx) +- [PrinterProfileCreateDialog](../modules/companies/src/web/printer-configurations/create/ui/printer-profile-create-dialog.tsx) ### modules/companies/src/web/processes -- [ProcessEditDialog](../modules/companies/src/web/processes/process-edit-dialog.tsx) -- [ProcessQuickCreateDialog](../modules/companies/src/web/processes/process-quick-create-dialog.tsx) -- [ProcessStartDialog](../modules/companies/src/web/processes/process-start-dialog.tsx) -- [ProcessTemplateEditorDialog](../modules/companies/src/web/processes/process-template-editor-dialog.tsx) +- [ProcessEditDialog](../modules/companies/src/web/processes/update/ui/process-edit-dialog.tsx) +- [ProcessQuickCreateDialog](../modules/companies/src/web/processes/create/ui/process-quick-create-dialog.tsx) +- [ProcessStartDialog](../modules/companies/src/web/processes/start/ui/process-start-dialog.tsx) -### modules/companies/src/web/profiles +### modules/companies/src/web/process-templates -- [WorkProfileEditorDialog](../modules/companies/src/web/profiles/work-profile-editor-dialog.tsx) -- [WorkProfileHistoryDialog](../modules/companies/src/web/profiles/work-profile-history-dialog.tsx) +- [ProcessTemplateEditorDialog](../modules/companies/src/web/process-templates/shared/ui/process-template-editor-dialog.tsx) -### modules/companies/src/web/remote +### modules/companies/src/web/work-profiles -- [RemoteConnectionEditorDialog](../modules/companies/src/web/remote/remote-connection-editor-dialog.tsx) -- [RemoteConnectionHistoryDialog](../modules/companies/src/web/remote/remote-connection-history-dialog.tsx) -- [RemoteQuickEditor](../modules/companies/src/web/remote/remote-quick-editor.tsx) +- [WorkProfileEditorDialog](../modules/companies/src/web/work-profiles/shared/ui/work-profile-editor-dialog.tsx) +- [WorkProfileHistoryDialog](../modules/companies/src/web/work-profiles/history/ui/work-profile-history-dialog.tsx) -### modules/companies/src/web/telework +### modules/companies/src/web/remote-connections -- [TeleworkAuthorizationEditorDialog](../modules/companies/src/web/telework/telework-authorization-editor-dialog.tsx) -- [TeleworkAuthorizationHistoryDialog](../modules/companies/src/web/telework/telework-authorization-history-dialog.tsx) +- [RemoteConnectionEditorDialog](../modules/companies/src/web/remote-connections/shared/ui/remote-connection-editor-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 -- [TicketDetailDialog](../modules/companies/src/web/tickets/ticket-detail-dialog.tsx) -- [TicketEditorDialog](../modules/companies/src/web/tickets/ticket-editor-dialog.tsx) -- [TicketInterventionDialog](../modules/companies/src/web/tickets/ticket-intervention-dialog.tsx) -- [TicketQuickEditor](../modules/companies/src/web/tickets/ticket-quick-editor.tsx) -- [TicketQuickForms](../modules/companies/src/web/tickets/ticket-quick-forms.tsx) -- [TicketTargetCreateDialog](../modules/companies/src/web/tickets/ticket-target-create-dialog.tsx) +- [InterventionTicketCreateDialog](../modules/companies/src/web/tickets/create/ui/intervention-ticket-create-dialog.tsx) +- [TicketDetailDialog](../modules/companies/src/web/tickets/detail/ui/ticket-detail-dialog.tsx) +- [TicketEditorDialog](../modules/companies/src/web/tickets/shared/ui/ticket-editor-dialog.tsx) +- [TicketQuickEditor](../modules/companies/src/web/tickets/create/ui/ticket-quick-editor.tsx) +- [TicketQuickForms](../modules/companies/src/web/tickets/create/ui/ticket-quick-forms.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) -- [UserEditorDialog](../modules/identity/src/web/components/user-editor-dialog.tsx) -- [UserManagementDialog](../modules/identity/src/web/components/user-management-dialog.tsx) +- [AccountPasswordDialog](../modules/identity/src/web/passwords/change/ui/account-password-dialog.tsx) +- [UserEditorDialog](../modules/identity/src/web/users/shared/ui/user-editor-dialog.tsx) +- [UserManagementDialog](../modules/identity/src/web/users/list/ui/user-management-dialog.tsx) ### modules/resources/src/web -- [CatalogDefinitionDialog](../modules/resources/src/web/catalog-definition-dialog.tsx) -- [CatalogEditorDialog](../modules/resources/src/web/catalog-editor-dialog.tsx) -- [CatalogFieldCreateDialog](../modules/resources/src/web/catalog-field-create-dialog.tsx) -- [CatalogTemplateCreateDialog](../modules/resources/src/web/catalog-template-create-dialog.tsx) -- [ResourceDetailDialog](../modules/resources/src/web/resource-detail-dialog.tsx) -- [ResourceEditorDialog](../modules/resources/src/web/resource-editor-dialog.tsx) +- [CatalogDefinitionDialog](../modules/resources/src/web/catalog/detail/ui/catalog-definition-dialog.tsx) +- [CatalogEditorDialog](../modules/resources/src/web/catalog/shared/ui/catalog-editor-dialog.tsx) +- [CatalogFieldCreateDialog](../modules/resources/src/web/catalog-fields/create/ui/catalog-field-create-dialog.tsx) +- [CatalogTemplateCreateDialog](../modules/resources/src/web/catalog-templates/create/ui/catalog-template-create-dialog.tsx) +- [ResourceDetailDialog](../modules/resources/src/web/resources/detail/ui/resource-detail-dialog.tsx) +- [ResourceEditorDialog](../modules/resources/src/web/resources/shared/ui/resource-editor-dialog.tsx) ## Comprobaciones y límites diff --git a/docs/revision-de-buenas-practicas.md b/docs/revision-de-buenas-practicas.md index 1994bac..45674b7 100644 --- a/docs/revision-de-buenas-practicas.md +++ b/docs/revision-de-buenas-practicas.md @@ -90,10 +90,10 @@ garantía de ausencia de cualquier defecto posible. ## Archivos especialmente modificados -- modules/companies/src/web/components/companies-workspace.tsx, dashboard-page.tsx y sus - componentes de navegación, búsqueda y paneles. -- modules/companies/src/web/access/access-form.tsx, access-form-fields.tsx, - access-quick-editor.tsx y access-workspace.tsx. +- modules/companies/src/web/workspace/ y modules/companies/src/web/dashboard/: espacio de + trabajo, página del dashboard y componentes de navegación, búsqueda y paneles. +- modules/companies/src/web/access/: formularios en shared/ui, altas rápidas en create/ui + y listado en list/ui. - 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. - modules/identity/src/web/components: composición del espacio, gestión de usuarios y diff --git a/modules/assets/package.json b/modules/assets/package.json index 1954f15..30af365 100644 --- a/modules/assets/package.json +++ b/modules/assets/package.json @@ -10,7 +10,7 @@ }, "scripts": { "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": { "@repo/rdx-ddd": "workspace:*", diff --git a/modules/assets/src/web/asset-relationships/end/index.ts b/modules/assets/src/web/asset-relationships/end/index.ts new file mode 100644 index 0000000..ae1de2b --- /dev/null +++ b/modules/assets/src/web/asset-relationships/end/index.ts @@ -0,0 +1 @@ +export { EndRelationshipDialog } from "./ui"; diff --git a/modules/assets/src/web/end-relationship-dialog.tsx b/modules/assets/src/web/asset-relationships/end/ui/end-relationship-dialog.tsx similarity index 90% rename from modules/assets/src/web/end-relationship-dialog.tsx rename to modules/assets/src/web/asset-relationships/end/ui/end-relationship-dialog.tsx index 5863383..d257df5 100644 --- a/modules/assets/src/web/end-relationship-dialog.tsx +++ b/modules/assets/src/web/asset-relationships/end/ui/end-relationship-dialog.tsx @@ -3,10 +3,8 @@ import { FormActions, FormDialog } from "@repo/shadcn-ui/components/form-dialog" import { useMutation, useQueryClient } from "@tanstack/react-query"; import { useTranslation } from "react-i18next"; -import type { RelationshipDTO } from "../common"; - -import { inventoryApi, inventoryKeys } from "./inventory-api"; -import { InventoryFeedback } from "./inventory-feedback"; +import type { RelationshipDTO } from "../../../../common"; +import { InventoryFeedback, inventoryApi, inventoryKeys } from "../../../shared"; export function EndRelationshipDialog({ relationship, diff --git a/modules/assets/src/web/asset-relationships/end/ui/index.ts b/modules/assets/src/web/asset-relationships/end/ui/index.ts new file mode 100644 index 0000000..cb1ac48 --- /dev/null +++ b/modules/assets/src/web/asset-relationships/end/ui/index.ts @@ -0,0 +1 @@ +export { EndRelationshipDialog } from "./end-relationship-dialog"; diff --git a/modules/assets/src/web/asset-relationships/index.ts b/modules/assets/src/web/asset-relationships/index.ts new file mode 100644 index 0000000..b0e2ca3 --- /dev/null +++ b/modules/assets/src/web/asset-relationships/index.ts @@ -0,0 +1 @@ +export { AssetRelationships } from "./list"; diff --git a/modules/assets/src/web/asset-relationships/list/index.ts b/modules/assets/src/web/asset-relationships/list/index.ts new file mode 100644 index 0000000..e90b32c --- /dev/null +++ b/modules/assets/src/web/asset-relationships/list/index.ts @@ -0,0 +1 @@ +export { AssetRelationships } from "./ui"; diff --git a/modules/assets/src/web/asset-relationships.tsx b/modules/assets/src/web/asset-relationships/list/ui/asset-relationships.tsx similarity index 93% rename from modules/assets/src/web/asset-relationships.tsx rename to modules/assets/src/web/asset-relationships/list/ui/asset-relationships.tsx index 5ffa5c1..cc37d5b 100644 --- a/modules/assets/src/web/asset-relationships.tsx +++ b/modules/assets/src/web/asset-relationships/list/ui/asset-relationships.tsx @@ -3,11 +3,10 @@ import { useQuery } from "@tanstack/react-query"; import { useState } from "react"; import { useTranslation } from "react-i18next"; -import type { RelationshipDTO } from "../common"; - -import { EndRelationshipDialog } from "./end-relationship-dialog"; -import { inventoryApi, inventoryKeys } from "./inventory-api"; -import { RelationshipEditorDialog } from "./relationship-editor-dialog"; +import type { RelationshipDTO } from "../../../../common"; +import { inventoryApi, inventoryKeys } from "../../../shared"; +import { EndRelationshipDialog } from "../../end"; +import { RelationshipEditorDialog } from "../../shared"; export function AssetRelationships({ companyId, diff --git a/modules/assets/src/web/asset-relationships/list/ui/index.ts b/modules/assets/src/web/asset-relationships/list/ui/index.ts new file mode 100644 index 0000000..c13763f --- /dev/null +++ b/modules/assets/src/web/asset-relationships/list/ui/index.ts @@ -0,0 +1 @@ +export { AssetRelationships } from "./asset-relationships"; diff --git a/modules/assets/src/web/asset-relationships/shared/index.ts b/modules/assets/src/web/asset-relationships/shared/index.ts new file mode 100644 index 0000000..abeb70d --- /dev/null +++ b/modules/assets/src/web/asset-relationships/shared/index.ts @@ -0,0 +1 @@ +export { RelationshipEditorDialog } from "./ui"; diff --git a/modules/assets/src/web/asset-relationships/shared/ui/index.ts b/modules/assets/src/web/asset-relationships/shared/ui/index.ts new file mode 100644 index 0000000..3fef4d5 --- /dev/null +++ b/modules/assets/src/web/asset-relationships/shared/ui/index.ts @@ -0,0 +1 @@ +export { RelationshipEditorDialog } from "./relationship-editor-dialog"; diff --git a/modules/assets/src/web/relationship-editor-dialog.tsx b/modules/assets/src/web/asset-relationships/shared/ui/relationship-editor-dialog.tsx similarity index 100% rename from modules/assets/src/web/relationship-editor-dialog.tsx rename to modules/assets/src/web/asset-relationships/shared/ui/relationship-editor-dialog.tsx diff --git a/modules/assets/src/web/relationship-form.tsx b/modules/assets/src/web/asset-relationships/shared/ui/relationship-form.tsx similarity index 93% rename from modules/assets/src/web/relationship-form.tsx rename to modules/assets/src/web/asset-relationships/shared/ui/relationship-form.tsx index 9619d5b..ab825d9 100644 --- a/modules/assets/src/web/relationship-form.tsx +++ b/modules/assets/src/web/asset-relationships/shared/ui/relationship-form.tsx @@ -8,12 +8,10 @@ import { useMutation, useQuery, useQueryClient } from "@tanstack/react-query"; import { useId, useState } from "react"; import { useTranslation } from "react-i18next"; -import type { RelationshipInputDTO } from "../common"; - -import { catalogApi, catalogKeys } from "./catalog-api"; -import { CatalogRelationCreateDialog } from "./catalog-relation-create-dialog"; -import { inventoryApi, inventoryKeys } from "./inventory-api"; -import { InventoryFeedback } from "./inventory-feedback"; +import type { RelationshipInputDTO } from "../../../../common"; +import { catalogApi, catalogKeys } from "../../../catalog"; +import { CatalogRelationCreateDialog } from "../../../catalog-relations"; +import { InventoryFeedback, inventoryApi, inventoryKeys } from "../../../shared"; export function RelationshipForm({ companyId, diff --git a/modules/assets/src/web/assets/create/index.ts b/modules/assets/src/web/assets/create/index.ts new file mode 100644 index 0000000..d35d711 --- /dev/null +++ b/modules/assets/src/web/assets/create/index.ts @@ -0,0 +1 @@ +export { WorkstationAssetCreateDialog } from "./ui"; diff --git a/modules/assets/src/web/assets/create/ui/index.ts b/modules/assets/src/web/assets/create/ui/index.ts new file mode 100644 index 0000000..75df7e2 --- /dev/null +++ b/modules/assets/src/web/assets/create/ui/index.ts @@ -0,0 +1 @@ +export { WorkstationAssetCreateDialog } from "./workstation-asset-create-dialog"; diff --git a/modules/assets/src/web/workstation-asset-create-dialog.tsx b/modules/assets/src/web/assets/create/ui/workstation-asset-create-dialog.tsx similarity index 96% rename from modules/assets/src/web/workstation-asset-create-dialog.tsx rename to modules/assets/src/web/assets/create/ui/workstation-asset-create-dialog.tsx index 7e207c4..741fe09 100644 --- a/modules/assets/src/web/workstation-asset-create-dialog.tsx +++ b/modules/assets/src/web/assets/create/ui/workstation-asset-create-dialog.tsx @@ -2,7 +2,7 @@ import { FormDialog } from "@repo/shadcn-ui/components/form-dialog"; import type { ComponentProps } from "react"; import { useTranslation } from "react-i18next"; -import { AssetForm } from "./asset-form"; +import { AssetForm } from "../../shared"; export function WorkstationAssetCreateDialog({ companyId, diff --git a/modules/assets/src/web/assets/detail/index.ts b/modules/assets/src/web/assets/detail/index.ts new file mode 100644 index 0000000..0a0930e --- /dev/null +++ b/modules/assets/src/web/assets/detail/index.ts @@ -0,0 +1 @@ +export { AssetDetailDialog, AssetSelectionPanel } from "./ui"; diff --git a/modules/assets/src/web/asset-detail-dialog.tsx b/modules/assets/src/web/assets/detail/ui/asset-detail-dialog.tsx similarity index 89% rename from modules/assets/src/web/asset-detail-dialog.tsx rename to modules/assets/src/web/assets/detail/ui/asset-detail-dialog.tsx index 358ffa9..55000a8 100644 --- a/modules/assets/src/web/asset-detail-dialog.tsx +++ b/modules/assets/src/web/assets/detail/ui/asset-detail-dialog.tsx @@ -2,9 +2,10 @@ import { FormDialog } from "@repo/shadcn-ui/components/form-dialog"; import type { ComponentProps } from "react"; import { useTranslation } from "react-i18next"; +import { AssetRelationships } from "../../../asset-relationships"; +import { AssetSupport } from "../../../support-connections"; + import { AssetDetail } from "./asset-detail"; -import { AssetRelationships } from "./asset-relationships"; -import { AssetSupport } from "./asset-support"; export function AssetDetailDialog({ asset, diff --git a/modules/assets/src/web/asset-detail.tsx b/modules/assets/src/web/assets/detail/ui/asset-detail.tsx similarity index 96% rename from modules/assets/src/web/asset-detail.tsx rename to modules/assets/src/web/assets/detail/ui/asset-detail.tsx index 4a9db36..42f952c 100644 --- a/modules/assets/src/web/asset-detail.tsx +++ b/modules/assets/src/web/assets/detail/ui/asset-detail.tsx @@ -2,10 +2,9 @@ import { useQuery } from "@tanstack/react-query"; import type { ReactNode } from "react"; import { useTranslation } from "react-i18next"; -import type { AssetDTO } from "../common/inventory"; - -import type { InventoryLookups } from "./asset-form"; -import { inventoryApi, inventoryKeys } from "./inventory-api"; +import type { AssetDTO } from "../../../../common/inventory"; +import { inventoryApi, inventoryKeys } from "../../../shared"; +import type { InventoryLookups } from "../../shared"; export function AssetDetail({ asset, lookups, diff --git a/modules/assets/src/web/asset-selection-panel.tsx b/modules/assets/src/web/assets/detail/ui/asset-selection-panel.tsx similarity index 88% rename from modules/assets/src/web/asset-selection-panel.tsx rename to modules/assets/src/web/assets/detail/ui/asset-selection-panel.tsx index 475e06a..9ea6ac3 100644 --- a/modules/assets/src/web/asset-selection-panel.tsx +++ b/modules/assets/src/web/assets/detail/ui/asset-selection-panel.tsx @@ -1,12 +1,12 @@ import { Button } from "@repo/shadcn-ui/components/button"; 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 type { InventoryLookups } from "./asset-form"; -import { AssetRelationships } from "./asset-relationships"; -import { AssetSupport } from "./asset-support"; export function AssetSelectionPanel({ companyId, diff --git a/modules/assets/src/web/assets/detail/ui/index.ts b/modules/assets/src/web/assets/detail/ui/index.ts new file mode 100644 index 0000000..abfb2c3 --- /dev/null +++ b/modules/assets/src/web/assets/detail/ui/index.ts @@ -0,0 +1,2 @@ +export { AssetDetailDialog } from "./asset-detail-dialog"; +export { AssetSelectionPanel } from "./asset-selection-panel"; diff --git a/modules/assets/src/web/assets/index.ts b/modules/assets/src/web/assets/index.ts new file mode 100644 index 0000000..5cf2e69 --- /dev/null +++ b/modules/assets/src/web/assets/index.ts @@ -0,0 +1,4 @@ +export { WorkstationAssetCreateDialog } from "./create"; +export { AssetInventoryPage } from "./list"; +export type { InventoryLookups } from "./shared"; +export { AssetForm } from "./shared"; diff --git a/modules/assets/src/web/assets/list/index.ts b/modules/assets/src/web/assets/list/index.ts new file mode 100644 index 0000000..ad5655b --- /dev/null +++ b/modules/assets/src/web/assets/list/index.ts @@ -0,0 +1 @@ +export { AssetInventoryPage } from "./ui"; diff --git a/modules/assets/src/web/assets/list/ui/index.ts b/modules/assets/src/web/assets/list/ui/index.ts new file mode 100644 index 0000000..165e1cb --- /dev/null +++ b/modules/assets/src/web/assets/list/ui/index.ts @@ -0,0 +1 @@ +export { AssetInventoryPage } from "./inventory-page"; diff --git a/modules/assets/src/web/inventory-page.tsx b/modules/assets/src/web/assets/list/ui/inventory-page.tsx similarity index 95% rename from modules/assets/src/web/inventory-page.tsx rename to modules/assets/src/web/assets/list/ui/inventory-page.tsx index 2d9bb1b..06bd20a 100644 --- a/modules/assets/src/web/inventory-page.tsx +++ b/modules/assets/src/web/assets/list/ui/inventory-page.tsx @@ -10,14 +10,11 @@ import { useQuery } from "@tanstack/react-query"; import { useState } from "react"; import { useTranslation } from "react-i18next"; -import { AssetDetailDialog } from "./asset-detail-dialog"; -import { AssetEditorDialog } from "./asset-editor-dialog"; -import type { InventoryLookups } from "./asset-form"; -import { AssetSelectionPanel } from "./asset-selection-panel"; -import { catalogApi, catalogKeys } from "./catalog-api"; -import { CatalogError } from "./catalog-error"; -import { inventoryApi, inventoryKeys } from "./inventory-api"; -import { InventoryFeedback } from "./inventory-feedback"; +import { CatalogError, catalogApi, catalogKeys } from "../../../catalog"; +import { InventoryFeedback, inventoryApi, inventoryKeys } from "../../../shared"; +import { AssetDetailDialog, AssetSelectionPanel } from "../../detail"; +import type { InventoryLookups } from "../../shared"; +import { AssetEditorDialog } from "../../shared"; export function AssetInventoryPage({ companyId, diff --git a/modules/assets/src/web/assets/shared/index.ts b/modules/assets/src/web/assets/shared/index.ts new file mode 100644 index 0000000..82bfe19 --- /dev/null +++ b/modules/assets/src/web/assets/shared/index.ts @@ -0,0 +1,2 @@ +export type { InventoryLookups } from "./ui"; +export { AssetEditorDialog, AssetForm } from "./ui"; diff --git a/modules/assets/src/web/inventory.test.tsx b/modules/assets/src/web/assets/shared/inventory.test.tsx similarity index 88% rename from modules/assets/src/web/inventory.test.tsx rename to modules/assets/src/web/assets/shared/inventory.test.tsx index a8c08c2..1a78db3 100644 --- a/modules/assets/src/web/inventory.test.tsx +++ b/modules/assets/src/web/assets/shared/inventory.test.tsx @@ -9,21 +9,19 @@ import type { ReactNode } from "react"; import { renderToStaticMarkup } from "react-dom/server"; import { I18nextProvider } from "react-i18next"; -import { buildCatalogResponse } from "../api/application/asset-catalog-response.builder"; -import { AssetCatalog } from "../api/domain/asset-catalog.aggregate"; -import { seedAssetCatalog } from "../api/domain/asset-catalog-seed"; -import type { RelationshipDTO } from "../common"; +import { buildCatalogResponse } from "../../../api/application/asset-catalog-response.builder"; +import { AssetCatalog } from "../../../api/domain/asset-catalog.aggregate"; +import { seedAssetCatalog } from "../../../api/domain/asset-catalog-seed"; +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 { 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"; +import { AssetForm } from "./ui"; const companyId = UniqueID.generateNewID().toPrimitive(); const lookups = { diff --git a/modules/assets/src/web/asset-characteristic-control.tsx b/modules/assets/src/web/assets/shared/ui/asset-characteristic-control.tsx similarity index 96% rename from modules/assets/src/web/asset-characteristic-control.tsx rename to modules/assets/src/web/assets/shared/ui/asset-characteristic-control.tsx index bac645d..9738ce8 100644 --- a/modules/assets/src/web/asset-characteristic-control.tsx +++ b/modules/assets/src/web/assets/shared/ui/asset-characteristic-control.tsx @@ -3,7 +3,7 @@ import { Label } from "@repo/shadcn-ui/components/label"; import { SelectWithAction } from "@repo/shadcn-ui/components/select-with-action"; import { useTranslation } from "react-i18next"; -import type { AssetCharacteristic, AssetInput } from "../common/inventory"; +import type { AssetCharacteristic, AssetInput } from "../../../../common/inventory"; type CharacteristicValue = AssetInput["characteristics"][string]; export function AssetCharacteristicControl({ diff --git a/modules/assets/src/web/asset-editor-dialog.tsx b/modules/assets/src/web/assets/shared/ui/asset-editor-dialog.tsx similarity index 100% rename from modules/assets/src/web/asset-editor-dialog.tsx rename to modules/assets/src/web/assets/shared/ui/asset-editor-dialog.tsx diff --git a/modules/assets/src/web/asset-form.tsx b/modules/assets/src/web/assets/shared/ui/asset-form.tsx similarity index 96% rename from modules/assets/src/web/asset-form.tsx rename to modules/assets/src/web/assets/shared/ui/asset-form.tsx index f238d47..2e860d4 100644 --- a/modules/assets/src/web/asset-form.tsx +++ b/modules/assets/src/web/assets/shared/ui/asset-form.tsx @@ -11,15 +11,14 @@ import { useEffect, useId, useRef, useState } from "react"; import { useForm } from "react-hook-form"; import { useTranslation } from "react-i18next"; -import type { CatalogItemDTO } from "../common"; -import type { AssetDTO, AssetInput } from "../common/inventory"; -import { AssetInputSchema, AssetStatusSchema } from "../common/inventory"; +import type { CatalogItemDTO } from "../../../../common"; +import type { AssetDTO, AssetInput } 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 { 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 = { sites: readonly { id: string; name: string }[]; diff --git a/modules/assets/src/web/assets/shared/ui/index.ts b/modules/assets/src/web/assets/shared/ui/index.ts new file mode 100644 index 0000000..45f774c --- /dev/null +++ b/modules/assets/src/web/assets/shared/ui/index.ts @@ -0,0 +1,3 @@ +export { AssetEditorDialog } from "./asset-editor-dialog"; +export type { InventoryLookups } from "./asset-form"; +export { AssetForm } from "./asset-form"; diff --git a/modules/assets/src/web/brands/index.ts b/modules/assets/src/web/brands/index.ts new file mode 100644 index 0000000..82dcb18 --- /dev/null +++ b/modules/assets/src/web/brands/index.ts @@ -0,0 +1,2 @@ +export { BrandCatalogPage } from "./list"; +export { BrandSelect } from "./shared"; diff --git a/modules/assets/src/web/brands/list/index.ts b/modules/assets/src/web/brands/list/index.ts new file mode 100644 index 0000000..7289220 --- /dev/null +++ b/modules/assets/src/web/brands/list/index.ts @@ -0,0 +1 @@ +export { BrandCatalogPage } from "./ui"; diff --git a/modules/assets/src/web/brands-page.tsx b/modules/assets/src/web/brands/list/ui/brands-page.tsx similarity index 96% rename from modules/assets/src/web/brands-page.tsx rename to modules/assets/src/web/brands/list/ui/brands-page.tsx index cc08e98..2a5ef75 100644 --- a/modules/assets/src/web/brands-page.tsx +++ b/modules/assets/src/web/brands/list/ui/brands-page.tsx @@ -11,10 +11,8 @@ import { useQuery } from "@tanstack/react-query"; import { useId, useState } from "react"; import { useTranslation } from "react-i18next"; -import type { BrandDTO } from "../common/brands"; - -import { brandApi, brandKeys } from "./brand-api"; -import { BrandEditorDialog } from "./brand-editor-dialog"; +import type { BrandDTO } from "../../../../common/brands"; +import { BrandEditorDialog, brandApi, brandKeys } from "../../shared"; export function BrandCatalogPage({ csrfToken }: { csrfToken: string }) { const { t, i18n } = useTranslation("assets"); diff --git a/modules/assets/src/web/brands/list/ui/index.ts b/modules/assets/src/web/brands/list/ui/index.ts new file mode 100644 index 0000000..a2e3f6a --- /dev/null +++ b/modules/assets/src/web/brands/list/ui/index.ts @@ -0,0 +1 @@ +export { BrandCatalogPage } from "./brands-page"; diff --git a/modules/assets/src/web/brand-api.ts b/modules/assets/src/web/brands/shared/api/brand-api.ts similarity index 88% rename from modules/assets/src/web/brand-api.ts rename to modules/assets/src/web/brands/shared/api/brand-api.ts index 78f71c4..96db33e 100644 --- a/modules/assets/src/web/brand-api.ts +++ b/modules/assets/src/web/brands/shared/api/brand-api.ts @@ -1,7 +1,7 @@ import { z } from "zod/v4"; -import type { BrandInput } from "../common/brands"; -import { BrandResponseSchema, BrandsResponseSchema } from "../common/brands"; +import type { BrandInput } from "../../../../common/brands"; +import { BrandResponseSchema, BrandsResponseSchema } from "../../../../common/brands"; export const brandKeys = { all: ["asset-brands"] as const }; export class BrandApiError extends Error { constructor(public readonly code: string) { diff --git a/modules/assets/src/web/brands/shared/api/index.ts b/modules/assets/src/web/brands/shared/api/index.ts new file mode 100644 index 0000000..d33242c --- /dev/null +++ b/modules/assets/src/web/brands/shared/api/index.ts @@ -0,0 +1 @@ +export { BrandApiError, brandApi, brandKeys } from "./brand-api"; diff --git a/modules/assets/src/web/brands.test.tsx b/modules/assets/src/web/brands/shared/brands.test.tsx similarity index 89% rename from modules/assets/src/web/brands.test.tsx rename to modules/assets/src/web/brands/shared/brands.test.tsx index eaf97ed..8ce51b7 100644 --- a/modules/assets/src/web/brands.test.tsx +++ b/modules/assets/src/web/brands/shared/brands.test.tsx @@ -9,16 +9,15 @@ import type { ReactNode } from "react"; import { renderToStaticMarkup } from "react-dom/server"; import { I18nextProvider } from "react-i18next"; -import { buildCatalogResponse } from "../api/application/asset-catalog-response.builder"; -import { AssetCatalog } from "../api/domain/asset-catalog.aggregate"; -import { seedAssetCatalog } from "../api/domain/asset-catalog-seed"; +import { buildCatalogResponse } from "../../../api/application/asset-catalog-response.builder"; +import { AssetCatalog } from "../../../api/domain/asset-catalog.aggregate"; +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 "./brand-api"; -import { BrandForm } from "./brand-form"; -import { BrandSelect } from "./brand-select"; -import { BrandCatalogPage } from "./brands-page"; -import { assetsEnglish, assetsSpanish } from "./i18n"; +import { brandKeys } from "./api"; +import { BrandForm, BrandSelect } from "./ui"; const brand = { id: UniqueID.generateNewID().toPrimitive(), diff --git a/modules/assets/src/web/brands/shared/index.ts b/modules/assets/src/web/brands/shared/index.ts new file mode 100644 index 0000000..a525f8a --- /dev/null +++ b/modules/assets/src/web/brands/shared/index.ts @@ -0,0 +1,2 @@ +export { brandApi, brandKeys } from "./api"; +export { BrandEditorDialog, BrandSelect } from "./ui"; diff --git a/modules/assets/src/web/brand-editor-dialog.tsx b/modules/assets/src/web/brands/shared/ui/brand-editor-dialog.tsx similarity index 100% rename from modules/assets/src/web/brand-editor-dialog.tsx rename to modules/assets/src/web/brands/shared/ui/brand-editor-dialog.tsx diff --git a/modules/assets/src/web/brand-form.tsx b/modules/assets/src/web/brands/shared/ui/brand-form.tsx similarity index 94% rename from modules/assets/src/web/brand-form.tsx rename to modules/assets/src/web/brands/shared/ui/brand-form.tsx index a1207bc..1db43d3 100644 --- a/modules/assets/src/web/brand-form.tsx +++ b/modules/assets/src/web/brands/shared/ui/brand-form.tsx @@ -9,10 +9,9 @@ import { useEffect, useId, useRef } from "react"; import { useForm } from "react-hook-form"; import { useTranslation } from "react-i18next"; -import type { BrandDTO, BrandInput } from "../common/brands"; -import { BrandInputSchema } from "../common/brands"; - -import { BrandApiError, brandApi, brandKeys } from "./brand-api"; +import type { BrandDTO, BrandInput } from "../../../../common/brands"; +import { BrandInputSchema } from "../../../../common/brands"; +import { BrandApiError, brandApi, brandKeys } from "../api"; export function BrandForm({ csrfToken, diff --git a/modules/assets/src/web/brand-select.tsx b/modules/assets/src/web/brands/shared/ui/brand-select.tsx similarity index 96% rename from modules/assets/src/web/brand-select.tsx rename to modules/assets/src/web/brands/shared/ui/brand-select.tsx index 04adea2..0f887c6 100644 --- a/modules/assets/src/web/brand-select.tsx +++ b/modules/assets/src/web/brands/shared/ui/brand-select.tsx @@ -5,9 +5,9 @@ import { useQuery } from "@tanstack/react-query"; import { useState } from "react"; 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"; const LEGACY = "legacy"; diff --git a/modules/assets/src/web/brands/shared/ui/index.ts b/modules/assets/src/web/brands/shared/ui/index.ts new file mode 100644 index 0000000..bccfee6 --- /dev/null +++ b/modules/assets/src/web/brands/shared/ui/index.ts @@ -0,0 +1,3 @@ +export { BrandEditorDialog } from "./brand-editor-dialog"; +export { BrandForm } from "./brand-form"; +export { BrandSelect } from "./brand-select"; diff --git a/modules/assets/src/web/catalog-fields/create/index.ts b/modules/assets/src/web/catalog-fields/create/index.ts new file mode 100644 index 0000000..a9f6306 --- /dev/null +++ b/modules/assets/src/web/catalog-fields/create/index.ts @@ -0,0 +1 @@ +export { CatalogFieldCreateDialog } from "./ui"; diff --git a/modules/assets/src/web/catalog-field-create-dialog.tsx b/modules/assets/src/web/catalog-fields/create/ui/catalog-field-create-dialog.tsx similarity index 93% rename from modules/assets/src/web/catalog-field-create-dialog.tsx rename to modules/assets/src/web/catalog-fields/create/ui/catalog-field-create-dialog.tsx index e6d2ae9..6888d0e 100644 --- a/modules/assets/src/web/catalog-field-create-dialog.tsx +++ b/modules/assets/src/web/catalog-fields/create/ui/catalog-field-create-dialog.tsx @@ -1,7 +1,7 @@ import { FormDialog } from "@repo/shadcn-ui/components/form-dialog"; import { useTranslation } from "react-i18next"; -import { CatalogFieldForm } from "./catalog-form"; +import { CatalogFieldForm } from "../../shared"; export function CatalogFieldCreateDialog({ scope, diff --git a/modules/assets/src/web/catalog-fields/create/ui/index.ts b/modules/assets/src/web/catalog-fields/create/ui/index.ts new file mode 100644 index 0000000..ee5ccb5 --- /dev/null +++ b/modules/assets/src/web/catalog-fields/create/ui/index.ts @@ -0,0 +1 @@ +export { CatalogFieldCreateDialog } from "./catalog-field-create-dialog"; diff --git a/modules/assets/src/web/catalog-fields/index.ts b/modules/assets/src/web/catalog-fields/index.ts new file mode 100644 index 0000000..2339c38 --- /dev/null +++ b/modules/assets/src/web/catalog-fields/index.ts @@ -0,0 +1,2 @@ +export { CatalogFieldCreateDialog } from "./create"; +export { CatalogFieldForm } from "./shared"; diff --git a/modules/assets/src/web/catalog-fields/shared/index.ts b/modules/assets/src/web/catalog-fields/shared/index.ts new file mode 100644 index 0000000..a0f73fc --- /dev/null +++ b/modules/assets/src/web/catalog-fields/shared/index.ts @@ -0,0 +1 @@ +export { CatalogFieldForm } from "./ui"; diff --git a/modules/assets/src/web/catalog-form.tsx b/modules/assets/src/web/catalog-fields/shared/ui/catalog-form.tsx similarity index 90% rename from modules/assets/src/web/catalog-form.tsx rename to modules/assets/src/web/catalog-fields/shared/ui/catalog-form.tsx index ca99a6c..0d99d7b 100644 --- a/modules/assets/src/web/catalog-form.tsx +++ b/modules/assets/src/web/catalog-fields/shared/ui/catalog-form.tsx @@ -10,13 +10,12 @@ import { useForm } from "react-hook-form"; import { useTranslation } from "react-i18next"; import { z } from "zod/v4"; -import type { CatalogItemDTO } from "../common"; -import { AssetDefinitionSchema, FieldTypeSchema } from "../common"; - -import { CatalogError } from "./catalog-error"; -import { CatalogHelp } from "./catalog-help"; -import type { CatalogSaved } from "./use-catalog-save"; -import { useCatalogSave } from "./use-catalog-save"; +import type { CatalogItemDTO } from "../../../../common"; +import { AssetDefinitionSchema, FieldTypeSchema } from "../../../../common"; +import type { CatalogSaved } from "../../../catalog/shared/controllers"; +import { useCatalogSave } from "../../../catalog/shared/controllers"; +import { CatalogError } from "../../../catalog/shared/ui/catalog-error"; +import { CatalogHelp } from "../../../catalog/shared/ui/catalog-help"; const FieldFormSchema = AssetDefinitionSchema.options[0].omit({ choices: true }).extend({ choicesText: z.string().max(10000), diff --git a/modules/assets/src/web/catalog-fields/shared/ui/index.ts b/modules/assets/src/web/catalog-fields/shared/ui/index.ts new file mode 100644 index 0000000..1a5343d --- /dev/null +++ b/modules/assets/src/web/catalog-fields/shared/ui/index.ts @@ -0,0 +1 @@ +export { CatalogFieldForm } from "./catalog-form"; diff --git a/modules/assets/src/web/catalog-relations/create/index.ts b/modules/assets/src/web/catalog-relations/create/index.ts new file mode 100644 index 0000000..10703bc --- /dev/null +++ b/modules/assets/src/web/catalog-relations/create/index.ts @@ -0,0 +1 @@ +export { CatalogRelationCreateDialog } from "./ui"; diff --git a/modules/assets/src/web/catalog-relation-create-dialog.tsx b/modules/assets/src/web/catalog-relations/create/ui/catalog-relation-create-dialog.tsx similarity index 92% rename from modules/assets/src/web/catalog-relation-create-dialog.tsx rename to modules/assets/src/web/catalog-relations/create/ui/catalog-relation-create-dialog.tsx index a72d751..1e64b5f 100644 --- a/modules/assets/src/web/catalog-relation-create-dialog.tsx +++ b/modules/assets/src/web/catalog-relations/create/ui/catalog-relation-create-dialog.tsx @@ -1,7 +1,7 @@ import { FormDialog } from "@repo/shadcn-ui/components/form-dialog"; import { useTranslation } from "react-i18next"; -import { CatalogRelationForm } from "./catalog-relation-form"; +import { CatalogRelationForm } from "../../shared"; export function CatalogRelationCreateDialog({ companyId, diff --git a/modules/assets/src/web/catalog-relations/create/ui/index.ts b/modules/assets/src/web/catalog-relations/create/ui/index.ts new file mode 100644 index 0000000..55ef70d --- /dev/null +++ b/modules/assets/src/web/catalog-relations/create/ui/index.ts @@ -0,0 +1 @@ +export { CatalogRelationCreateDialog } from "./catalog-relation-create-dialog"; diff --git a/modules/assets/src/web/catalog-relations/index.ts b/modules/assets/src/web/catalog-relations/index.ts new file mode 100644 index 0000000..c2c16d6 --- /dev/null +++ b/modules/assets/src/web/catalog-relations/index.ts @@ -0,0 +1,2 @@ +export { CatalogRelationCreateDialog } from "./create"; +export { CatalogRelationForm } from "./shared"; diff --git a/modules/assets/src/web/catalog-relations/shared/index.ts b/modules/assets/src/web/catalog-relations/shared/index.ts new file mode 100644 index 0000000..fba988e --- /dev/null +++ b/modules/assets/src/web/catalog-relations/shared/index.ts @@ -0,0 +1 @@ +export { CatalogRelationForm } from "./ui"; diff --git a/modules/assets/src/web/catalog-relation-form.tsx b/modules/assets/src/web/catalog-relations/shared/ui/catalog-relation-form.tsx similarity index 88% rename from modules/assets/src/web/catalog-relation-form.tsx rename to modules/assets/src/web/catalog-relations/shared/ui/catalog-relation-form.tsx index 4de7279..8333b17 100644 --- a/modules/assets/src/web/catalog-relation-form.tsx +++ b/modules/assets/src/web/catalog-relations/shared/ui/catalog-relation-form.tsx @@ -9,13 +9,12 @@ import { useForm } from "react-hook-form"; import { useTranslation } from "react-i18next"; import type { z } from "zod/v4"; -import type { CatalogItemDTO } from "../common"; -import { AssetDefinitionSchema } from "../common"; - -import { CatalogError } from "./catalog-error"; -import { CatalogHelp } from "./catalog-help"; -import type { CatalogSaved } from "./use-catalog-save"; -import { useCatalogSave } from "./use-catalog-save"; +import type { CatalogItemDTO } from "../../../../common"; +import { AssetDefinitionSchema } from "../../../../common"; +import type { CatalogSaved } from "../../../catalog/shared/controllers"; +import { useCatalogSave } from "../../../catalog/shared/controllers"; +import { CatalogError } from "../../../catalog/shared/ui/catalog-error"; +import { CatalogHelp } from "../../../catalog/shared/ui/catalog-help"; const schema = AssetDefinitionSchema.options[2]; export function CatalogRelationForm({ diff --git a/modules/assets/src/web/catalog-relations/shared/ui/index.ts b/modules/assets/src/web/catalog-relations/shared/ui/index.ts new file mode 100644 index 0000000..2381604 --- /dev/null +++ b/modules/assets/src/web/catalog-relations/shared/ui/index.ts @@ -0,0 +1 @@ +export { CatalogRelationForm } from "./catalog-relation-form"; diff --git a/modules/assets/src/web/catalog-templates/create/index.ts b/modules/assets/src/web/catalog-templates/create/index.ts new file mode 100644 index 0000000..d3cde63 --- /dev/null +++ b/modules/assets/src/web/catalog-templates/create/index.ts @@ -0,0 +1 @@ +export { CatalogTemplateCreateDialog } from "./ui"; diff --git a/modules/assets/src/web/catalog-template-create-dialog.tsx b/modules/assets/src/web/catalog-templates/create/ui/catalog-template-create-dialog.tsx similarity index 93% rename from modules/assets/src/web/catalog-template-create-dialog.tsx rename to modules/assets/src/web/catalog-templates/create/ui/catalog-template-create-dialog.tsx index 66b6d70..a727e1b 100644 --- a/modules/assets/src/web/catalog-template-create-dialog.tsx +++ b/modules/assets/src/web/catalog-templates/create/ui/catalog-template-create-dialog.tsx @@ -2,7 +2,7 @@ import { FormDialog } from "@repo/shadcn-ui/components/form-dialog"; import type { ComponentProps } from "react"; import { useTranslation } from "react-i18next"; -import { CatalogTemplateForm } from "./catalog-template-form"; +import { CatalogTemplateForm } from "../../shared"; export function CatalogTemplateCreateDialog({ scope, diff --git a/modules/assets/src/web/catalog-templates/create/ui/index.ts b/modules/assets/src/web/catalog-templates/create/ui/index.ts new file mode 100644 index 0000000..bbbbe5f --- /dev/null +++ b/modules/assets/src/web/catalog-templates/create/ui/index.ts @@ -0,0 +1 @@ +export { CatalogTemplateCreateDialog } from "./catalog-template-create-dialog"; diff --git a/modules/assets/src/web/catalog-templates/index.ts b/modules/assets/src/web/catalog-templates/index.ts new file mode 100644 index 0000000..39c0ca8 --- /dev/null +++ b/modules/assets/src/web/catalog-templates/index.ts @@ -0,0 +1,2 @@ +export { CatalogTemplateCreateDialog } from "./create"; +export { CatalogTemplateForm } from "./shared"; diff --git a/modules/assets/src/web/catalog-templates/shared/index.ts b/modules/assets/src/web/catalog-templates/shared/index.ts new file mode 100644 index 0000000..9c4e0ca --- /dev/null +++ b/modules/assets/src/web/catalog-templates/shared/index.ts @@ -0,0 +1 @@ +export { CatalogTemplateForm } from "./ui"; diff --git a/modules/assets/src/web/catalog-template-form.tsx b/modules/assets/src/web/catalog-templates/shared/ui/catalog-template-form.tsx similarity index 93% rename from modules/assets/src/web/catalog-template-form.tsx rename to modules/assets/src/web/catalog-templates/shared/ui/catalog-template-form.tsx index b344bbe..d5d5079 100644 --- a/modules/assets/src/web/catalog-template-form.tsx +++ b/modules/assets/src/web/catalog-templates/shared/ui/catalog-template-form.tsx @@ -11,14 +11,13 @@ import { useForm } from "react-hook-form"; import { useTranslation } from "react-i18next"; import type { z } from "zod/v4"; -import type { CatalogItemDTO } from "../common"; -import { AssetDefinitionSchema } from "../common"; - -import { CatalogError } from "./catalog-error"; -import { CatalogFieldCreateDialog } from "./catalog-field-create-dialog"; -import { CatalogHelp } from "./catalog-help"; -import type { CatalogSaved } from "./use-catalog-save"; -import { useCatalogSave } from "./use-catalog-save"; +import type { CatalogItemDTO } from "../../../../common"; +import { AssetDefinitionSchema } from "../../../../common"; +import type { CatalogSaved } from "../../../catalog/shared/controllers"; +import { useCatalogSave } from "../../../catalog/shared/controllers"; +import { CatalogError } from "../../../catalog/shared/ui/catalog-error"; +import { CatalogHelp } from "../../../catalog/shared/ui/catalog-help"; +import { CatalogFieldCreateDialog } from "../../../catalog-fields"; const TemplateFormSchema = AssetDefinitionSchema.options[1]; type TemplateFormValues = z.infer; diff --git a/modules/assets/src/web/catalog-templates/shared/ui/index.ts b/modules/assets/src/web/catalog-templates/shared/ui/index.ts new file mode 100644 index 0000000..16ff970 --- /dev/null +++ b/modules/assets/src/web/catalog-templates/shared/ui/index.ts @@ -0,0 +1 @@ +export { CatalogTemplateForm } from "./catalog-template-form"; diff --git a/modules/assets/src/web/catalog/detail/index.ts b/modules/assets/src/web/catalog/detail/index.ts new file mode 100644 index 0000000..a027060 --- /dev/null +++ b/modules/assets/src/web/catalog/detail/index.ts @@ -0,0 +1 @@ +export { CatalogDefinitionDialog } from "./ui"; diff --git a/modules/assets/src/web/catalog-definition-dialog.tsx b/modules/assets/src/web/catalog/detail/ui/catalog-definition-dialog.tsx similarity index 96% rename from modules/assets/src/web/catalog-definition-dialog.tsx rename to modules/assets/src/web/catalog/detail/ui/catalog-definition-dialog.tsx index 127e34f..9a472a8 100644 --- a/modules/assets/src/web/catalog-definition-dialog.tsx +++ b/modules/assets/src/web/catalog/detail/ui/catalog-definition-dialog.tsx @@ -1,9 +1,8 @@ import { FormDialog } from "@repo/shadcn-ui/components/form-dialog"; import { useTranslation } from "react-i18next"; -import type { CatalogItemDTO } from "../common"; - -import { CatalogHelp } from "./catalog-help"; +import type { CatalogItemDTO } from "../../../../common"; +import { CatalogHelp } from "../../shared"; export function CatalogDefinitionDialog({ item, items, diff --git a/modules/assets/src/web/catalog/detail/ui/index.ts b/modules/assets/src/web/catalog/detail/ui/index.ts new file mode 100644 index 0000000..70ad731 --- /dev/null +++ b/modules/assets/src/web/catalog/detail/ui/index.ts @@ -0,0 +1 @@ +export { CatalogDefinitionDialog } from "./catalog-definition-dialog"; diff --git a/modules/assets/src/web/catalog/index.ts b/modules/assets/src/web/catalog/index.ts new file mode 100644 index 0000000..73c1b88 --- /dev/null +++ b/modules/assets/src/web/catalog/index.ts @@ -0,0 +1,2 @@ +export { AssetCatalogPage } from "./list"; +export { CatalogError, catalogApi, catalogKeys } from "./shared"; diff --git a/modules/assets/src/web/catalog/list/index.ts b/modules/assets/src/web/catalog/list/index.ts new file mode 100644 index 0000000..92a3f7c --- /dev/null +++ b/modules/assets/src/web/catalog/list/index.ts @@ -0,0 +1 @@ +export { AssetCatalogPage } from "./ui"; diff --git a/modules/assets/src/web/catalog-cell.tsx b/modules/assets/src/web/catalog/list/ui/catalog-cell.tsx similarity index 95% rename from modules/assets/src/web/catalog-cell.tsx rename to modules/assets/src/web/catalog/list/ui/catalog-cell.tsx index 2cfa8d3..7378d18 100644 --- a/modules/assets/src/web/catalog-cell.tsx +++ b/modules/assets/src/web/catalog/list/ui/catalog-cell.tsx @@ -1,10 +1,10 @@ import { EntityRowActions, EntityStatus } from "@repo/shadcn-ui/components/entity-list"; 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 { CatalogName } from "./catalog-name"; import { CatalogRowActions } from "./catalog-row-actions"; export function CatalogCell({ diff --git a/modules/assets/src/web/catalog-details.tsx b/modules/assets/src/web/catalog/list/ui/catalog-details.tsx similarity index 86% rename from modules/assets/src/web/catalog-details.tsx rename to modules/assets/src/web/catalog/list/ui/catalog-details.tsx index 35155e4..0dae785 100644 --- a/modules/assets/src/web/catalog-details.tsx +++ b/modules/assets/src/web/catalog/list/ui/catalog-details.tsx @@ -1,6 +1,6 @@ import { useTranslation } from "react-i18next"; -import type { CatalogItemDTO } from "../common"; +import type { CatalogItemDTO } from "../../../../common"; export function CatalogDetails({ item }: { item: CatalogItemDTO }) { const { t } = useTranslation("assets"); diff --git a/modules/assets/src/web/catalog-page.tsx b/modules/assets/src/web/catalog/list/ui/catalog-page.tsx similarity index 95% rename from modules/assets/src/web/catalog-page.tsx rename to modules/assets/src/web/catalog/list/ui/catalog-page.tsx index b579c24..8f0afc1 100644 --- a/modules/assets/src/web/catalog-page.tsx +++ b/modules/assets/src/web/catalog/list/ui/catalog-page.tsx @@ -4,14 +4,12 @@ import { useMutation, useQuery, useQueryClient } from "@tanstack/react-query"; import { useState } from "react"; 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 { 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 }) { const { t, i18n } = useTranslation("assets"); diff --git a/modules/assets/src/web/catalog-row-actions.tsx b/modules/assets/src/web/catalog/list/ui/catalog-row-actions.tsx similarity index 94% rename from modules/assets/src/web/catalog-row-actions.tsx rename to modules/assets/src/web/catalog/list/ui/catalog-row-actions.tsx index 87145a1..20ff9bf 100644 --- a/modules/assets/src/web/catalog-row-actions.tsx +++ b/modules/assets/src/web/catalog/list/ui/catalog-row-actions.tsx @@ -1,7 +1,7 @@ import { EntityAction } from "@repo/shadcn-ui/components/entity-list"; import { useTranslation } from "react-i18next"; -import type { CatalogItemDTO } from "../common"; +import type { CatalogItemDTO } from "../../../../common"; export function CatalogRowActions({ item, diff --git a/modules/assets/src/web/catalog/list/ui/index.ts b/modules/assets/src/web/catalog/list/ui/index.ts new file mode 100644 index 0000000..095ed64 --- /dev/null +++ b/modules/assets/src/web/catalog/list/ui/index.ts @@ -0,0 +1 @@ +export { AssetCatalogPage } from "./catalog-page"; diff --git a/modules/assets/src/web/catalog-api.ts b/modules/assets/src/web/catalog/shared/api/catalog-api.ts similarity index 94% rename from modules/assets/src/web/catalog-api.ts rename to modules/assets/src/web/catalog/shared/api/catalog-api.ts index 326bd71..54ba6c6 100644 --- a/modules/assets/src/web/catalog-api.ts +++ b/modules/assets/src/web/catalog/shared/api/catalog-api.ts @@ -1,7 +1,7 @@ import { z } from "zod/v4"; -import type { AssetDefinitionSpec } from "../common"; -import { CatalogResponseSchema, SaveDefinitionResponseSchema } from "../common"; +import type { AssetDefinitionSpec } from "../../../../common"; +import { CatalogResponseSchema, SaveDefinitionResponseSchema } from "../../../../common"; export const catalogKeys = { scope: (scope: string) => ["asset-catalog", scope] }; export class CatalogApiError extends Error { constructor(public readonly code: string) { diff --git a/modules/assets/src/web/catalog/shared/api/index.ts b/modules/assets/src/web/catalog/shared/api/index.ts new file mode 100644 index 0000000..8dddb63 --- /dev/null +++ b/modules/assets/src/web/catalog/shared/api/index.ts @@ -0,0 +1 @@ +export { CatalogApiError, catalogApi, catalogKeys } from "./catalog-api"; diff --git a/modules/assets/src/web/catalog.test.tsx b/modules/assets/src/web/catalog/shared/catalog.test.tsx similarity index 82% rename from modules/assets/src/web/catalog.test.tsx rename to modules/assets/src/web/catalog/shared/catalog.test.tsx index de01587..0b13241 100644 --- a/modules/assets/src/web/catalog.test.tsx +++ b/modules/assets/src/web/catalog/shared/catalog.test.tsx @@ -8,15 +8,15 @@ import type { ReactNode } from "react"; import { renderToStaticMarkup } from "react-dom/server"; import { I18nextProvider } from "react-i18next"; -import { buildCatalogResponse } from "../api/application/asset-catalog-response.builder"; -import { AssetCatalog } from "../api/domain/asset-catalog.aggregate"; -import { seedAssetCatalog } from "../api/domain/asset-catalog-seed"; +import { buildCatalogResponse } from "../../../api/application/asset-catalog-response.builder"; +import { AssetCatalog } from "../../../api/domain/asset-catalog.aggregate"; +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 { CatalogFieldForm } from "./catalog-form"; -import { AssetCatalogPage } from "./catalog-page"; -import { CatalogTemplateForm } from "./catalog-template-form"; -import { assetsEnglish, assetsSpanish } from "./i18n"; +import { catalogKeys } from "./api"; async function render(language: string, children: ReactNode) { const i18n = createInstance(); diff --git a/modules/assets/src/web/catalog/shared/controllers/index.ts b/modules/assets/src/web/catalog/shared/controllers/index.ts new file mode 100644 index 0000000..2dca0db --- /dev/null +++ b/modules/assets/src/web/catalog/shared/controllers/index.ts @@ -0,0 +1,2 @@ +export type { CatalogSaved } from "./use-catalog-save"; +export { useCatalogSave } from "./use-catalog-save"; diff --git a/modules/assets/src/web/use-catalog-save.ts b/modules/assets/src/web/catalog/shared/controllers/use-catalog-save.ts similarity index 92% rename from modules/assets/src/web/use-catalog-save.ts rename to modules/assets/src/web/catalog/shared/controllers/use-catalog-save.ts index 69ba895..ef4ffbf 100644 --- a/modules/assets/src/web/use-catalog-save.ts +++ b/modules/assets/src/web/catalog/shared/controllers/use-catalog-save.ts @@ -1,9 +1,8 @@ import { useMutation, useQueryClient } from "@tanstack/react-query"; import { useEffect, useRef } from "react"; -import type { AssetDefinitionSpec, SaveDefinitionResponseDTO } from "../common"; - -import { catalogApi, catalogKeys } from "./catalog-api"; +import type { AssetDefinitionSpec, SaveDefinitionResponseDTO } from "../../../../common"; +import { catalogApi, catalogKeys } from "../api"; export type CatalogSaved = (id: string, data: SaveDefinitionResponseDTO) => void; diff --git a/modules/assets/src/web/catalog/shared/index.ts b/modules/assets/src/web/catalog/shared/index.ts new file mode 100644 index 0000000..5a63eb3 --- /dev/null +++ b/modules/assets/src/web/catalog/shared/index.ts @@ -0,0 +1,3 @@ +export { catalogApi, catalogKeys } from "./api"; +export type { CatalogEditor } from "./ui"; +export { CatalogEditorDialog, CatalogError, CatalogHelp, CatalogName } from "./ui"; diff --git a/modules/assets/src/web/catalog-editor-dialog.tsx b/modules/assets/src/web/catalog/shared/ui/catalog-editor-dialog.tsx similarity index 87% rename from modules/assets/src/web/catalog-editor-dialog.tsx rename to modules/assets/src/web/catalog/shared/ui/catalog-editor-dialog.tsx index bd25914..1751954 100644 --- a/modules/assets/src/web/catalog-editor-dialog.tsx +++ b/modules/assets/src/web/catalog/shared/ui/catalog-editor-dialog.tsx @@ -1,11 +1,10 @@ import { FormDialog } from "@repo/shadcn-ui/components/form-dialog"; import { useTranslation } from "react-i18next"; -import type { CatalogItemDTO } from "../common"; - -import { CatalogFieldForm } from "./catalog-form"; -import { CatalogRelationForm } from "./catalog-relation-form"; -import { CatalogTemplateForm } from "./catalog-template-form"; +import type { CatalogItemDTO } from "../../../../common"; +import { CatalogFieldForm } from "../../../catalog-fields"; +import { CatalogRelationForm } from "../../../catalog-relations"; +import { CatalogTemplateForm } from "../../../catalog-templates"; export type CatalogEditor = { kind: "field" | "template" | "relation"; diff --git a/modules/assets/src/web/catalog-error.tsx b/modules/assets/src/web/catalog/shared/ui/catalog-error.tsx similarity index 90% rename from modules/assets/src/web/catalog-error.tsx rename to modules/assets/src/web/catalog/shared/ui/catalog-error.tsx index 4e57523..653101e 100644 --- a/modules/assets/src/web/catalog-error.tsx +++ b/modules/assets/src/web/catalog/shared/ui/catalog-error.tsx @@ -1,6 +1,6 @@ import { useTranslation } from "react-i18next"; -import { CatalogApiError } from "./catalog-api"; +import { CatalogApiError } from "../api"; export function CatalogError({ error, diff --git a/modules/assets/src/web/catalog-help.tsx b/modules/assets/src/web/catalog/shared/ui/catalog-help.tsx similarity index 100% rename from modules/assets/src/web/catalog-help.tsx rename to modules/assets/src/web/catalog/shared/ui/catalog-help.tsx diff --git a/modules/assets/src/web/catalog-name.tsx b/modules/assets/src/web/catalog/shared/ui/catalog-name.tsx similarity index 94% rename from modules/assets/src/web/catalog-name.tsx rename to modules/assets/src/web/catalog/shared/ui/catalog-name.tsx index 67f8e9c..fcac15d 100644 --- a/modules/assets/src/web/catalog-name.tsx +++ b/modules/assets/src/web/catalog/shared/ui/catalog-name.tsx @@ -1,6 +1,6 @@ import { useTranslation } from "react-i18next"; -import type { CatalogItemDTO } from "../common"; +import type { CatalogItemDTO } from "../../../../common"; export function CatalogName({ item, diff --git a/modules/assets/src/web/catalog/shared/ui/index.ts b/modules/assets/src/web/catalog/shared/ui/index.ts new file mode 100644 index 0000000..b30947d --- /dev/null +++ b/modules/assets/src/web/catalog/shared/ui/index.ts @@ -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"; diff --git a/modules/assets/src/web/i18n.ts b/modules/assets/src/web/i18n.ts deleted file mode 100644 index 64c1f8d..0000000 --- a/modules/assets/src/web/i18n.ts +++ /dev/null @@ -1,2 +0,0 @@ -export { default as assetsEnglish } from "../common/locales/en.json"; -export { default as assetsSpanish } from "../common/locales/es.json"; diff --git a/modules/assets/src/web/index.ts b/modules/assets/src/web/index.ts index 0eb6799..7026b67 100644 --- a/modules/assets/src/web/index.ts +++ b/modules/assets/src/web/index.ts @@ -1,10 +1,6 @@ -export { AssetForm } from "./asset-form"; -export { AssetSupport } from "./asset-support"; -export { BrandCatalogPage } from "./brands-page"; -export { catalogApi, catalogKeys } from "./catalog-api"; -export { AssetCatalogPage } from "./catalog-page"; -export { assetsEnglish, assetsSpanish } from "./i18n"; -export { inventoryApi, inventoryKeys } from "./inventory-api"; -export { AssetInventoryPage } from "./inventory-page"; -export { WorkstationForm } from "./workstation-form"; -export { WorkstationsPage } from "./workstations-page"; +export { AssetForm, AssetInventoryPage } from "./assets"; +export { BrandCatalogPage } from "./brands"; +export { AssetCatalogPage, catalogApi, catalogKeys } from "./catalog"; +export { assetsEnglish, assetsSpanish, inventoryApi, inventoryKeys } from "./shared"; +export { AssetSupport } from "./support-connections"; +export { WorkstationForm, WorkstationsPage } from "./workstations"; diff --git a/modules/assets/src/web/shared/api/index.ts b/modules/assets/src/web/shared/api/index.ts new file mode 100644 index 0000000..d79c15b --- /dev/null +++ b/modules/assets/src/web/shared/api/index.ts @@ -0,0 +1,2 @@ +export { InventoryApiError, inventoryApi, inventoryKeys } from "./inventory-api"; +export { SupportApiError, supportApi, supportKeys } from "./support-api"; diff --git a/modules/assets/src/web/inventory-api.ts b/modules/assets/src/web/shared/api/inventory-api.ts similarity index 83% rename from modules/assets/src/web/inventory-api.ts rename to modules/assets/src/web/shared/api/inventory-api.ts index 705f851..c522850 100644 --- a/modules/assets/src/web/inventory-api.ts +++ b/modules/assets/src/web/shared/api/inventory-api.ts @@ -1,11 +1,11 @@ import { z } from "zod/v4"; -import type { AssetInput } from "../common/inventory"; -import { AssetResponseSchema, InventoryResponseSchema } from "../common/inventory"; -import type { RelationshipInputDTO } from "../common/relationships"; -import { RelationshipResponseSchema } from "../common/relationships"; -import type { WorkstationInput } from "../common/workstations"; -import { WorkstationResponseSchema } from "../common/workstations"; +import type { AssetInput } from "../../../common/inventory"; +import { AssetResponseSchema, InventoryResponseSchema } from "../../../common/inventory"; +import type { RelationshipInputDTO } from "../../../common/relationships"; +import { RelationshipResponseSchema } from "../../../common/relationships"; +import type { WorkstationInput } from "../../../common/workstations"; +import { WorkstationResponseSchema } from "../../../common/workstations"; export const inventoryKeys = { company: (id: string) => ["inventory", id] }; export class InventoryApiError extends Error { constructor(public readonly code: string) { diff --git a/modules/assets/src/web/support-api.ts b/modules/assets/src/web/shared/api/support-api.ts similarity index 93% rename from modules/assets/src/web/support-api.ts rename to modules/assets/src/web/shared/api/support-api.ts index a667b19..c4af60f 100644 --- a/modules/assets/src/web/support-api.ts +++ b/modules/assets/src/web/shared/api/support-api.ts @@ -1,12 +1,12 @@ import { z } from "zod/v4"; -import type { SupportInput, SupportToolInput } from "../common/support"; +import type { SupportInput, SupportToolInput } from "../../../common/support"; import { SupportListSchema, SupportResponseSchema, SupportToolResponseSchema, SupportToolsSchema, -} from "../common/support"; +} from "../../../common/support"; export const supportKeys = { asset: (companyId: string, assetId: string) => ["asset-support", companyId, assetId], tools: ["support-tools"], diff --git a/modules/assets/src/web/shared/i18n.ts b/modules/assets/src/web/shared/i18n.ts new file mode 100644 index 0000000..fd606c6 --- /dev/null +++ b/modules/assets/src/web/shared/i18n.ts @@ -0,0 +1,2 @@ +export { default as assetsEnglish } from "../../common/locales/en.json"; +export { default as assetsSpanish } from "../../common/locales/es.json"; diff --git a/modules/assets/src/web/shared/index.ts b/modules/assets/src/web/shared/index.ts new file mode 100644 index 0000000..060e96a --- /dev/null +++ b/modules/assets/src/web/shared/index.ts @@ -0,0 +1,3 @@ +export { inventoryApi, inventoryKeys, supportApi, supportKeys } from "./api"; +export { assetsEnglish, assetsSpanish } from "./i18n"; +export { InventoryFeedback, SupportFeedback } from "./ui"; diff --git a/modules/assets/src/web/shared/ui/index.ts b/modules/assets/src/web/shared/ui/index.ts new file mode 100644 index 0000000..f01ad03 --- /dev/null +++ b/modules/assets/src/web/shared/ui/index.ts @@ -0,0 +1,2 @@ +export { InventoryFeedback } from "./inventory-feedback"; +export { SupportFeedback } from "./support-feedback"; diff --git a/modules/assets/src/web/inventory-feedback.tsx b/modules/assets/src/web/shared/ui/inventory-feedback.tsx similarity index 87% rename from modules/assets/src/web/inventory-feedback.tsx rename to modules/assets/src/web/shared/ui/inventory-feedback.tsx index 5068d91..0dccb0c 100644 --- a/modules/assets/src/web/inventory-feedback.tsx +++ b/modules/assets/src/web/shared/ui/inventory-feedback.tsx @@ -1,6 +1,6 @@ import { useTranslation } from "react-i18next"; -import { InventoryApiError } from "./inventory-api"; +import { InventoryApiError } from "../api"; export function InventoryFeedback({ error }: { error: Error | null }) { const { t } = useTranslation("assets"); diff --git a/modules/assets/src/web/support-feedback.tsx b/modules/assets/src/web/shared/ui/support-feedback.tsx similarity index 91% rename from modules/assets/src/web/support-feedback.tsx rename to modules/assets/src/web/shared/ui/support-feedback.tsx index ee0f329..73cdad1 100644 --- a/modules/assets/src/web/support-feedback.tsx +++ b/modules/assets/src/web/shared/ui/support-feedback.tsx @@ -1,6 +1,6 @@ import { useTranslation } from "react-i18next"; -import { SupportApiError } from "./support-api"; +import { SupportApiError } from "../api"; export function SupportFeedback({ error, invalid = false }: { error: unknown; invalid?: boolean }) { const { t } = useTranslation("assets"); diff --git a/modules/assets/src/web/support-connections/detail/index.ts b/modules/assets/src/web/support-connections/detail/index.ts new file mode 100644 index 0000000..408f04c --- /dev/null +++ b/modules/assets/src/web/support-connections/detail/index.ts @@ -0,0 +1 @@ +export { SupportSummary } from "./ui"; diff --git a/modules/assets/src/web/support-connections/detail/ui/index.ts b/modules/assets/src/web/support-connections/detail/ui/index.ts new file mode 100644 index 0000000..67f8fff --- /dev/null +++ b/modules/assets/src/web/support-connections/detail/ui/index.ts @@ -0,0 +1 @@ +export { SupportSummary } from "./support-summary"; diff --git a/modules/assets/src/web/support-summary.tsx b/modules/assets/src/web/support-connections/detail/ui/support-summary.tsx similarity index 90% rename from modules/assets/src/web/support-summary.tsx rename to modules/assets/src/web/support-connections/detail/ui/support-summary.tsx index f8b27fb..536030d 100644 --- a/modules/assets/src/web/support-summary.tsx +++ b/modules/assets/src/web/support-connections/detail/ui/support-summary.tsx @@ -1,6 +1,6 @@ import { useTranslation } from "react-i18next"; -import type { SupportConnectionDTO, SupportToolDTO } from "../common/support"; +import type { SupportConnectionDTO, SupportToolDTO } from "../../../../common/support"; export function SupportSummary({ values, diff --git a/modules/assets/src/web/support-connections/history/index.ts b/modules/assets/src/web/support-connections/history/index.ts new file mode 100644 index 0000000..e6bb752 --- /dev/null +++ b/modules/assets/src/web/support-connections/history/index.ts @@ -0,0 +1 @@ +export { SupportHistoryDialog } from "./ui"; diff --git a/modules/assets/src/web/support-connections/history/ui/index.ts b/modules/assets/src/web/support-connections/history/ui/index.ts new file mode 100644 index 0000000..1728e5f --- /dev/null +++ b/modules/assets/src/web/support-connections/history/ui/index.ts @@ -0,0 +1 @@ +export { SupportHistoryDialog } from "./support-history-dialog"; diff --git a/modules/assets/src/web/support-history-dialog.tsx b/modules/assets/src/web/support-connections/history/ui/support-history-dialog.tsx similarity index 89% rename from modules/assets/src/web/support-history-dialog.tsx rename to modules/assets/src/web/support-connections/history/ui/support-history-dialog.tsx index fac62cf..0834cf8 100644 --- a/modules/assets/src/web/support-history-dialog.tsx +++ b/modules/assets/src/web/support-connections/history/ui/support-history-dialog.tsx @@ -1,9 +1,8 @@ import { FormDialog } from "@repo/shadcn-ui/components/form-dialog"; import { useTranslation } from "react-i18next"; -import type { SupportConnectionDTO, SupportToolDTO } from "../common/support"; - -import { SupportSummary } from "./support-summary"; +import type { SupportConnectionDTO, SupportToolDTO } from "../../../../common/support"; +import { SupportSummary } from "../../detail"; export function SupportHistoryDialog({ history, diff --git a/modules/assets/src/web/support-connections/index.ts b/modules/assets/src/web/support-connections/index.ts new file mode 100644 index 0000000..4107031 --- /dev/null +++ b/modules/assets/src/web/support-connections/index.ts @@ -0,0 +1 @@ +export { AssetSupport } from "./list"; diff --git a/modules/assets/src/web/support-connections/list/index.ts b/modules/assets/src/web/support-connections/list/index.ts new file mode 100644 index 0000000..1d69c76 --- /dev/null +++ b/modules/assets/src/web/support-connections/list/index.ts @@ -0,0 +1 @@ +export { AssetSupport } from "./ui"; diff --git a/modules/assets/src/web/asset-support.tsx b/modules/assets/src/web/support-connections/list/ui/asset-support.tsx similarity index 91% rename from modules/assets/src/web/asset-support.tsx rename to modules/assets/src/web/support-connections/list/ui/asset-support.tsx index 5c5da91..9e73b92 100644 --- a/modules/assets/src/web/asset-support.tsx +++ b/modules/assets/src/web/support-connections/list/ui/asset-support.tsx @@ -3,13 +3,12 @@ import { useQuery } from "@tanstack/react-query"; import { useState } from "react"; import { useTranslation } from "react-i18next"; -import type { SupportConnectionDTO } from "../common/support"; - -import { supportApi, supportKeys } from "./support-api"; -import { SupportConnectionEditorDialog } from "./support-connection-editor-dialog"; -import { SupportHistoryDialog } from "./support-history-dialog"; -import { SupportSummary } from "./support-summary"; -import { SupportToolsDialog } from "./support-tools-dialog"; +import type { SupportConnectionDTO } from "../../../../common/support"; +import { supportApi, supportKeys } from "../../../shared"; +import { SupportToolsDialog } from "../../../support-tools"; +import { SupportSummary } from "../../detail"; +import { SupportHistoryDialog } from "../../history"; +import { SupportConnectionEditorDialog } from "../../shared"; export function AssetSupport({ companyId, diff --git a/modules/assets/src/web/support-connections/list/ui/index.ts b/modules/assets/src/web/support-connections/list/ui/index.ts new file mode 100644 index 0000000..4bf3866 --- /dev/null +++ b/modules/assets/src/web/support-connections/list/ui/index.ts @@ -0,0 +1 @@ +export { AssetSupport } from "./asset-support"; diff --git a/modules/assets/src/web/support-connections/shared/index.ts b/modules/assets/src/web/support-connections/shared/index.ts new file mode 100644 index 0000000..e68db48 --- /dev/null +++ b/modules/assets/src/web/support-connections/shared/index.ts @@ -0,0 +1 @@ +export { SupportConnectionEditorDialog } from "./ui"; diff --git a/modules/assets/src/web/support.test.tsx b/modules/assets/src/web/support-connections/shared/support.test.tsx similarity index 92% rename from modules/assets/src/web/support.test.tsx rename to modules/assets/src/web/support-connections/shared/support.test.tsx index 9138814..91d742f 100644 --- a/modules/assets/src/web/support.test.tsx +++ b/modules/assets/src/web/support-connections/shared/support.test.tsx @@ -8,10 +8,11 @@ import type { ReactNode } from "react"; import { renderToStaticMarkup } from "react-dom/server"; import { I18nextProvider } from "react-i18next"; -import { assetsEnglish, assetsSpanish } from "./i18n"; -import { SupportForm } from "./support-form"; -import { SupportSummary } from "./support-summary"; -import { SupportToolForm } from "./support-tool-form"; +import { assetsEnglish, assetsSpanish } from "../../shared"; +import { SupportToolForm } from "../../support-tools"; +import { SupportSummary } from "../detail"; + +import { SupportForm } from "./ui"; const tool = { id: UniqueID.generateNewID().toPrimitive(), diff --git a/modules/assets/src/web/support-connections/shared/ui/index.ts b/modules/assets/src/web/support-connections/shared/ui/index.ts new file mode 100644 index 0000000..28af2ce --- /dev/null +++ b/modules/assets/src/web/support-connections/shared/ui/index.ts @@ -0,0 +1,2 @@ +export { SupportConnectionEditorDialog } from "./support-connection-editor-dialog"; +export { SupportForm } from "./support-form"; diff --git a/modules/assets/src/web/support-connection-editor-dialog.tsx b/modules/assets/src/web/support-connections/shared/ui/support-connection-editor-dialog.tsx similarity index 100% rename from modules/assets/src/web/support-connection-editor-dialog.tsx rename to modules/assets/src/web/support-connections/shared/ui/support-connection-editor-dialog.tsx diff --git a/modules/assets/src/web/support-form.tsx b/modules/assets/src/web/support-connections/shared/ui/support-form.tsx similarity index 93% rename from modules/assets/src/web/support-form.tsx rename to modules/assets/src/web/support-connections/shared/ui/support-form.tsx index 382d7bd..1b02ef4 100644 --- a/modules/assets/src/web/support-form.tsx +++ b/modules/assets/src/web/support-connections/shared/ui/support-form.tsx @@ -9,13 +9,16 @@ import { useId, useState } from "react"; import { useForm } from "react-hook-form"; import { useTranslation } from "react-i18next"; -import type { SupportConnectionDTO, SupportInput, SupportToolDTO } from "../common/support"; -import { SupportValuesSchema } from "../common/support"; +import type { + SupportConnectionDTO, + SupportInput, + SupportToolDTO, +} from "../../../../common/support"; +import { SupportValuesSchema } from "../../../../common/support"; +import { SupportFeedback, supportApi, supportKeys } from "../../../shared"; +import { SupportToolEditorDialog } from "../../../support-tools"; -import { supportApi, supportKeys } from "./support-api"; -import { SupportFeedback } from "./support-feedback"; import { SupportHelp } from "./support-help"; -import { SupportToolEditorDialog } from "./support-tool-editor-dialog"; export function SupportForm({ companyId, assetId, diff --git a/modules/assets/src/web/support-help.tsx b/modules/assets/src/web/support-connections/shared/ui/support-help.tsx similarity index 100% rename from modules/assets/src/web/support-help.tsx rename to modules/assets/src/web/support-connections/shared/ui/support-help.tsx diff --git a/modules/assets/src/web/support-tools/index.ts b/modules/assets/src/web/support-tools/index.ts new file mode 100644 index 0000000..d2d3151 --- /dev/null +++ b/modules/assets/src/web/support-tools/index.ts @@ -0,0 +1,2 @@ +export { SupportToolsDialog } from "./list"; +export { SupportToolEditorDialog, SupportToolForm } from "./shared"; diff --git a/modules/assets/src/web/support-tools/list/index.ts b/modules/assets/src/web/support-tools/list/index.ts new file mode 100644 index 0000000..c9811fc --- /dev/null +++ b/modules/assets/src/web/support-tools/list/index.ts @@ -0,0 +1 @@ +export { SupportToolsDialog } from "./ui"; diff --git a/modules/assets/src/web/support-tools/list/ui/index.ts b/modules/assets/src/web/support-tools/list/ui/index.ts new file mode 100644 index 0000000..122989b --- /dev/null +++ b/modules/assets/src/web/support-tools/list/ui/index.ts @@ -0,0 +1 @@ +export { SupportToolsDialog } from "./support-tools-dialog"; diff --git a/modules/assets/src/web/support-tools-dialog.tsx b/modules/assets/src/web/support-tools/list/ui/support-tools-dialog.tsx similarity index 100% rename from modules/assets/src/web/support-tools-dialog.tsx rename to modules/assets/src/web/support-tools/list/ui/support-tools-dialog.tsx diff --git a/modules/assets/src/web/support-tools.tsx b/modules/assets/src/web/support-tools/list/ui/support-tools.tsx similarity index 94% rename from modules/assets/src/web/support-tools.tsx rename to modules/assets/src/web/support-tools/list/ui/support-tools.tsx index b2d4d30..b22292a 100644 --- a/modules/assets/src/web/support-tools.tsx +++ b/modules/assets/src/web/support-tools/list/ui/support-tools.tsx @@ -10,10 +10,9 @@ import { useQuery } from "@tanstack/react-query"; import { useState } from "react"; import { useTranslation } from "react-i18next"; -import type { SupportToolDTO } from "../common/support"; - -import { supportApi, supportKeys } from "./support-api"; -import { SupportToolEditorDialog } from "./support-tool-editor-dialog"; +import type { SupportToolDTO } from "../../../../common/support"; +import { supportApi, supportKeys } from "../../../shared"; +import { SupportToolEditorDialog } from "../../shared"; export function SupportTools({ csrfToken }: { csrfToken: string }) { const { t, i18n } = useTranslation("assets"); const query = useQuery({ queryKey: supportKeys.tools, queryFn: () => supportApi.tools() }); diff --git a/modules/assets/src/web/support-tools/shared/index.ts b/modules/assets/src/web/support-tools/shared/index.ts new file mode 100644 index 0000000..a9eda4b --- /dev/null +++ b/modules/assets/src/web/support-tools/shared/index.ts @@ -0,0 +1 @@ +export { SupportToolEditorDialog, SupportToolForm } from "./ui"; diff --git a/modules/assets/src/web/support-tools/shared/ui/index.ts b/modules/assets/src/web/support-tools/shared/ui/index.ts new file mode 100644 index 0000000..df08f6b --- /dev/null +++ b/modules/assets/src/web/support-tools/shared/ui/index.ts @@ -0,0 +1,2 @@ +export { SupportToolEditorDialog } from "./support-tool-editor-dialog"; +export { SupportToolForm } from "./support-tool-form"; diff --git a/modules/assets/src/web/support-tool-editor-dialog.tsx b/modules/assets/src/web/support-tools/shared/ui/support-tool-editor-dialog.tsx similarity index 100% rename from modules/assets/src/web/support-tool-editor-dialog.tsx rename to modules/assets/src/web/support-tools/shared/ui/support-tool-editor-dialog.tsx diff --git a/modules/assets/src/web/support-tool-form.tsx b/modules/assets/src/web/support-tools/shared/ui/support-tool-form.tsx similarity index 88% rename from modules/assets/src/web/support-tool-form.tsx rename to modules/assets/src/web/support-tools/shared/ui/support-tool-form.tsx index e8b0b12..83f5f34 100644 --- a/modules/assets/src/web/support-tool-form.tsx +++ b/modules/assets/src/web/support-tools/shared/ui/support-tool-form.tsx @@ -8,12 +8,10 @@ import { useId } from "react"; import { useForm } from "react-hook-form"; import { useTranslation } from "react-i18next"; -import type { SupportToolDTO, SupportToolInput } from "../common/support"; -import { SupportToolInputSchema } from "../common/support"; - -import { supportApi, supportKeys } from "./support-api"; -import { SupportFeedback } from "./support-feedback"; -import { SupportHelp } from "./support-help"; +import type { SupportToolDTO, SupportToolInput } from "../../../../common/support"; +import { SupportToolInputSchema } from "../../../../common/support"; +import { SupportFeedback, supportApi, supportKeys } from "../../../shared"; +import { SupportHelp } from "../../../support-connections/shared/ui/support-help"; export function SupportToolForm({ csrfToken, tool, diff --git a/modules/assets/src/web/workstations/history/index.ts b/modules/assets/src/web/workstations/history/index.ts new file mode 100644 index 0000000..2442d87 --- /dev/null +++ b/modules/assets/src/web/workstations/history/index.ts @@ -0,0 +1 @@ +export { WorkstationHistoryDialog } from "./ui"; diff --git a/modules/assets/src/web/workstations/history/ui/index.ts b/modules/assets/src/web/workstations/history/ui/index.ts new file mode 100644 index 0000000..60376ad --- /dev/null +++ b/modules/assets/src/web/workstations/history/ui/index.ts @@ -0,0 +1 @@ +export { WorkstationHistoryDialog } from "./workstation-history-dialog"; diff --git a/modules/assets/src/web/workstation-history-dialog.tsx b/modules/assets/src/web/workstations/history/ui/workstation-history-dialog.tsx similarity index 96% rename from modules/assets/src/web/workstation-history-dialog.tsx rename to modules/assets/src/web/workstations/history/ui/workstation-history-dialog.tsx index 3719c6f..e085892 100644 --- a/modules/assets/src/web/workstation-history-dialog.tsx +++ b/modules/assets/src/web/workstations/history/ui/workstation-history-dialog.tsx @@ -1,7 +1,7 @@ import { FormDialog } from "@repo/shadcn-ui/components/form-dialog"; import { useTranslation } from "react-i18next"; -import type { WorkstationDTO } from "../common"; +import type { WorkstationDTO } from "../../../../common"; export function WorkstationHistoryDialog({ workstation, diff --git a/modules/assets/src/web/workstations/index.ts b/modules/assets/src/web/workstations/index.ts new file mode 100644 index 0000000..f824cf3 --- /dev/null +++ b/modules/assets/src/web/workstations/index.ts @@ -0,0 +1,2 @@ +export { WorkstationsPage } from "./list"; +export { WorkstationForm } from "./shared"; diff --git a/modules/assets/src/web/workstations/list/index.ts b/modules/assets/src/web/workstations/list/index.ts new file mode 100644 index 0000000..3078da8 --- /dev/null +++ b/modules/assets/src/web/workstations/list/index.ts @@ -0,0 +1 @@ +export { WorkstationsPage } from "./ui"; diff --git a/modules/assets/src/web/workstations/list/ui/index.ts b/modules/assets/src/web/workstations/list/ui/index.ts new file mode 100644 index 0000000..92bdf42 --- /dev/null +++ b/modules/assets/src/web/workstations/list/ui/index.ts @@ -0,0 +1 @@ +export { WorkstationsPage } from "./workstations-page"; diff --git a/modules/assets/src/web/workstations-page.tsx b/modules/assets/src/web/workstations/list/ui/workstations-page.tsx similarity index 95% rename from modules/assets/src/web/workstations-page.tsx rename to modules/assets/src/web/workstations/list/ui/workstations-page.tsx index e565255..3c4cf5e 100644 --- a/modules/assets/src/web/workstations-page.tsx +++ b/modules/assets/src/web/workstations/list/ui/workstations-page.tsx @@ -10,11 +10,10 @@ import { useQuery } from "@tanstack/react-query"; import { useState } from "react"; import { useTranslation } from "react-i18next"; -import type { InventoryLookups } from "./asset-form"; -import { inventoryApi, inventoryKeys } from "./inventory-api"; -import { InventoryFeedback } from "./inventory-feedback"; -import { WorkstationEditorDialog } from "./workstation-editor-dialog"; -import { WorkstationHistoryDialog } from "./workstation-history-dialog"; +import type { InventoryLookups } from "../../../assets"; +import { InventoryFeedback, inventoryApi, inventoryKeys } from "../../../shared"; +import { WorkstationHistoryDialog } from "../../history"; +import { WorkstationEditorDialog } from "../../shared"; export function WorkstationsPage({ companyId, csrfToken, diff --git a/modules/assets/src/web/workstations/shared/index.ts b/modules/assets/src/web/workstations/shared/index.ts new file mode 100644 index 0000000..e60bbfc --- /dev/null +++ b/modules/assets/src/web/workstations/shared/index.ts @@ -0,0 +1 @@ +export { WorkstationEditorDialog, WorkstationForm } from "./ui"; diff --git a/modules/assets/src/web/workstations/shared/ui/index.ts b/modules/assets/src/web/workstations/shared/ui/index.ts new file mode 100644 index 0000000..4156026 --- /dev/null +++ b/modules/assets/src/web/workstations/shared/ui/index.ts @@ -0,0 +1,2 @@ +export { WorkstationEditorDialog } from "./workstation-editor-dialog"; +export { WorkstationForm } from "./workstation-form"; diff --git a/modules/assets/src/web/workstation-editor-dialog.tsx b/modules/assets/src/web/workstations/shared/ui/workstation-editor-dialog.tsx similarity index 100% rename from modules/assets/src/web/workstation-editor-dialog.tsx rename to modules/assets/src/web/workstations/shared/ui/workstation-editor-dialog.tsx diff --git a/modules/assets/src/web/workstation-form.tsx b/modules/assets/src/web/workstations/shared/ui/workstation-form.tsx similarity index 95% rename from modules/assets/src/web/workstation-form.tsx rename to modules/assets/src/web/workstations/shared/ui/workstation-form.tsx index 929abb6..ac8ff36 100644 --- a/modules/assets/src/web/workstation-form.tsx +++ b/modules/assets/src/web/workstations/shared/ui/workstation-form.tsx @@ -10,14 +10,12 @@ import { useEffect, useId, useRef, useState } from "react"; import { useForm } from "react-hook-form"; import { useTranslation } from "react-i18next"; -import type { WorkstationDTO, WorkstationInput } from "../common"; -import { WorkstationInputSchema } from "../common"; - -import type { InventoryLookups } from "./asset-form"; -import { catalogApi, catalogKeys } from "./catalog-api"; -import { inventoryApi, inventoryKeys } from "./inventory-api"; -import { InventoryFeedback } from "./inventory-feedback"; -import { WorkstationAssetCreateDialog } from "./workstation-asset-create-dialog"; +import type { WorkstationDTO, WorkstationInput } from "../../../../common"; +import { WorkstationInputSchema } from "../../../../common"; +import type { InventoryLookups } from "../../../assets"; +import { WorkstationAssetCreateDialog } from "../../../assets"; +import { catalogApi, catalogKeys } from "../../../catalog"; +import { InventoryFeedback, inventoryApi, inventoryKeys } from "../../../shared"; export function WorkstationForm({ companyId, csrfToken, diff --git a/modules/companies/package.json b/modules/companies/package.json index d719a48..69687a0 100644 --- a/modules/companies/package.json +++ b/modules/companies/package.json @@ -10,7 +10,7 @@ }, "scripts": { "typecheck": "tsc -p tsconfig.json", - "test": "TSX_TSCONFIG_PATH=../../tsconfig.json node --import tsx --test src/api/domain/company.aggregate.test.ts src/api/domain/people.test.ts src/web/components/companies-page.test.tsx src/api/domain/access/access.test.ts src/api/domain/mail-configuration.test.ts src/api/domain/mailbox.test.ts src/web/access/access.test.tsx src/web/mail/mail.test.tsx src/api/domain/work-profile.test.ts src/web/profiles/profile.test.tsx src/api/domain/printer-configuration.test.ts src/web/printers/printer.test.tsx src/api/domain/application-configuration.test.ts src/web/applications/application.test.tsx src/api/domain/certificate-configuration.test.ts src/web/certificates/certificate.test.tsx src/web/profiles/work-environment.test.tsx src/api/domain/telework-authorization.test.ts src/web/telework/telework.test.tsx src/api/domain/remote-connection.test.ts src/api/domain/process.test.ts src/web/remote/remote.test.tsx src/web/processes/processes.test.tsx src/api/domain/ticket.test.ts src/web/tickets/tickets.test.tsx src/api/domain/intervention-template.test.ts src/web/intervention-templates/templates.test.tsx src/api/domain/intervention.test.ts src/web/interventions/interventions.test.tsx src/web/components/initials-avatar.test.tsx src/api/infrastructure/company-logo-processor.test.ts src/web/components/company-avatar.test.tsx" + "test": "TSX_TSCONFIG_PATH=../../tsconfig.json node --import tsx --test src/api/domain/company.aggregate.test.ts src/api/domain/people.test.ts src/web/companies/shared/companies-page.test.tsx src/api/domain/access/access.test.ts src/api/domain/mail-configuration.test.ts src/api/domain/mailbox.test.ts src/web/access/shared/access.test.tsx src/web/mail-configurations/shared/mail.test.tsx src/api/domain/work-profile.test.ts src/web/work-profiles/shared/profile.test.tsx src/api/domain/printer-configuration.test.ts src/web/printer-configurations/shared/printer.test.tsx src/api/domain/application-configuration.test.ts src/web/application-configurations/shared/application.test.tsx src/api/domain/certificate-configuration.test.ts src/web/certificate-configurations/shared/certificate.test.tsx src/web/work-environments/shared/work-environment.test.tsx src/api/domain/telework-authorization.test.ts src/web/telework-authorizations/shared/telework.test.tsx src/api/domain/remote-connection.test.ts src/api/domain/process.test.ts src/web/remote-connections/shared/remote.test.tsx src/web/processes/shared/processes.test.tsx src/api/domain/ticket.test.ts src/web/tickets/shared/tickets.test.tsx src/api/domain/intervention-template.test.ts src/web/intervention-templates/shared/templates.test.tsx src/api/domain/intervention.test.ts src/web/interventions/shared/interventions.test.tsx src/web/shared/initials-avatar.test.tsx src/api/infrastructure/company-logo-processor.test.ts src/web/companies/shared/company-avatar.test.tsx" }, "dependencies": { "@hookform/resolvers": "5.2.2", diff --git a/modules/companies/src/web/access/create/helpers/index.ts b/modules/companies/src/web/access/create/helpers/index.ts new file mode 100644 index 0000000..e988574 --- /dev/null +++ b/modules/companies/src/web/access/create/helpers/index.ts @@ -0,0 +1,2 @@ +export type { QuickCreatePlan } from "./quick-create-plan"; +export { matchesSubmittedValues, quickCreatePlan } from "./quick-create-plan"; diff --git a/modules/companies/src/web/access/quick-create-plan.ts b/modules/companies/src/web/access/create/helpers/quick-create-plan.ts similarity index 94% rename from modules/companies/src/web/access/quick-create-plan.ts rename to modules/companies/src/web/access/create/helpers/quick-create-plan.ts index 3188200..6ae7f15 100644 --- a/modules/companies/src/web/access/quick-create-plan.ts +++ b/modules/companies/src/web/access/create/helpers/quick-create-plan.ts @@ -1,8 +1,6 @@ -import type { AccessFieldsDTO, AccessKind, AccessResponseDTO } from "../../common"; - -import type { AccessField } from "./access-fields"; -import type { AccessFormValues } from "./access-form-values"; -import type { QuickCreateTarget } from "./quick-create-dialog"; +import type { AccessFieldsDTO, AccessKind, AccessResponseDTO } from "../../../../common"; +import type { AccessField, AccessFormValues } from "../../shared/helpers"; +import type { QuickCreateTarget } from "../ui/quick-create-dialog"; export type QuickCreatePlan = | { type: "simple"; target: QuickCreateTarget } diff --git a/modules/companies/src/web/access/create/index.ts b/modules/companies/src/web/access/create/index.ts new file mode 100644 index 0000000..7a65736 --- /dev/null +++ b/modules/companies/src/web/access/create/index.ts @@ -0,0 +1,3 @@ +export type { QuickCreatePlan } from "./helpers"; +export { matchesSubmittedValues, quickCreatePlan } from "./helpers"; +export { AccessQuickEditor } from "./ui"; diff --git a/modules/companies/src/web/access/access-quick-editor.tsx b/modules/companies/src/web/access/create/ui/access-quick-editor.tsx similarity index 91% rename from modules/companies/src/web/access/access-quick-editor.tsx rename to modules/companies/src/web/access/create/ui/access-quick-editor.tsx index a04c1a5..befd4b4 100644 --- a/modules/companies/src/web/access/access-quick-editor.tsx +++ b/modules/companies/src/web/access/create/ui/access-quick-editor.tsx @@ -4,14 +4,14 @@ import type { ComponentType } from "react"; import { useEffect, useRef } from "react"; import { useTranslation } from "react-i18next"; -import type { AccessFieldsDTO, AccessResponseDTO, PersonDTO } from "../../common"; -import { PersonForm } from "../components/person-form"; +import type { AccessFieldsDTO, AccessResponseDTO, PersonDTO } from "../../../../common"; +import { PersonForm } from "../../../people"; +import { accessApi, accessKeys } from "../../shared/api"; +import { createLabels } from "../../shared/helpers"; +import type { AccessFormProps } from "../../shared/types"; +import type { QuickCreatePlan } from "../helpers"; -import { accessApi, accessKeys } from "./access-api"; -import { createLabels } from "./access-fields"; -import type { AccessFormProps } from "./access-form-props"; import { QuickCreateDialog } from "./quick-create-dialog"; -import type { QuickCreatePlan } from "./quick-create-plan"; export function AccessQuickEditor({ plan, diff --git a/modules/companies/src/web/access/create/ui/index.ts b/modules/companies/src/web/access/create/ui/index.ts new file mode 100644 index 0000000..cc1e418 --- /dev/null +++ b/modules/companies/src/web/access/create/ui/index.ts @@ -0,0 +1 @@ +export { AccessQuickEditor } from "./access-quick-editor"; diff --git a/modules/companies/src/web/access/quick-create-dialog.tsx b/modules/companies/src/web/access/create/ui/quick-create-dialog.tsx similarity index 95% rename from modules/companies/src/web/access/quick-create-dialog.tsx rename to modules/companies/src/web/access/create/ui/quick-create-dialog.tsx index fce51aa..ab03a4a 100644 --- a/modules/companies/src/web/access/quick-create-dialog.tsx +++ b/modules/companies/src/web/access/create/ui/quick-create-dialog.tsx @@ -7,11 +7,10 @@ import { useId, useRef } from "react"; import { useForm } from "react-hook-form"; import { useTranslation } from "react-i18next"; -import type { AccessFieldsDTO, AccessItemDTO } from "../../common"; -import { AccessFieldsSchema } from "../../common"; - -import { AccessApiError, accessApi, accessKeys } from "./access-api"; -import { EntityHelp } from "./entity-help"; +import type { AccessFieldsDTO, AccessItemDTO } from "../../../../common"; +import { AccessFieldsSchema } from "../../../../common"; +import { EntityHelp } from "../../help"; +import { AccessApiError, accessApi, accessKeys } from "../../shared/api"; export type QuickCreateTarget = | { kind: "system" } diff --git a/modules/companies/src/web/access/help/index.ts b/modules/companies/src/web/access/help/index.ts new file mode 100644 index 0000000..e424312 --- /dev/null +++ b/modules/companies/src/web/access/help/index.ts @@ -0,0 +1 @@ +export { AccessHelpDialog, EntityHelp } from "./ui"; diff --git a/modules/companies/src/web/access/access-help-dialog.tsx b/modules/companies/src/web/access/help/ui/access-help-dialog.tsx similarity index 91% rename from modules/companies/src/web/access/access-help-dialog.tsx rename to modules/companies/src/web/access/help/ui/access-help-dialog.tsx index 6fc59f4..7bfe737 100644 --- a/modules/companies/src/web/access/access-help-dialog.tsx +++ b/modules/companies/src/web/access/help/ui/access-help-dialog.tsx @@ -1,7 +1,7 @@ import { FormDialog } from "@repo/shadcn-ui/components/form-dialog"; import { useTranslation } from "react-i18next"; -import type { AccessKind } from "../../common"; +import type { AccessKind } from "../../../../common"; import { EntityHelp } from "./entity-help"; diff --git a/modules/companies/src/web/access/entity-help.tsx b/modules/companies/src/web/access/help/ui/entity-help.tsx similarity index 93% rename from modules/companies/src/web/access/entity-help.tsx rename to modules/companies/src/web/access/help/ui/entity-help.tsx index f6e208c..366822d 100644 --- a/modules/companies/src/web/access/entity-help.tsx +++ b/modules/companies/src/web/access/help/ui/entity-help.tsx @@ -1,7 +1,7 @@ import { ContextHelp } from "@repo/shadcn-ui/components/context-help"; import { useTranslation } from "react-i18next"; -import type { HelpKind } from "./i18n"; +import type { HelpKind } from "../../shared/i18n"; export function EntityHelp({ kind, scope }: { kind: HelpKind; scope?: string }) { const { t } = useTranslation("access"); diff --git a/modules/companies/src/web/access/help/ui/index.ts b/modules/companies/src/web/access/help/ui/index.ts new file mode 100644 index 0000000..7507b03 --- /dev/null +++ b/modules/companies/src/web/access/help/ui/index.ts @@ -0,0 +1,2 @@ +export { AccessHelpDialog } from "./access-help-dialog"; +export { EntityHelp } from "./entity-help"; diff --git a/modules/companies/src/web/access/history/index.ts b/modules/companies/src/web/access/history/index.ts new file mode 100644 index 0000000..9ce10f4 --- /dev/null +++ b/modules/companies/src/web/access/history/index.ts @@ -0,0 +1 @@ +export { AccessHistory } from "./ui"; diff --git a/modules/companies/src/web/access/access-history.tsx b/modules/companies/src/web/access/history/ui/access-history.tsx similarity index 95% rename from modules/companies/src/web/access/access-history.tsx rename to modules/companies/src/web/access/history/ui/access-history.tsx index 5d56d6d..bfec51f 100644 --- a/modules/companies/src/web/access/access-history.tsx +++ b/modules/companies/src/web/access/history/ui/access-history.tsx @@ -1,9 +1,8 @@ import { FormDialog } from "@repo/shadcn-ui/components/form-dialog"; import { useTranslation } from "react-i18next"; -import type { AccessItemDTO, PersonDTO } from "../../common"; - -import { accessLabel } from "./access-labels"; +import type { AccessItemDTO, PersonDTO } from "../../../../common"; +import { accessLabel } from "../../shared"; function historyValue( key: string, diff --git a/modules/companies/src/web/access/history/ui/index.ts b/modules/companies/src/web/access/history/ui/index.ts new file mode 100644 index 0000000..3cc0f40 --- /dev/null +++ b/modules/companies/src/web/access/history/ui/index.ts @@ -0,0 +1 @@ +export { AccessHistory } from "./access-history"; diff --git a/modules/companies/src/web/access/index.ts b/modules/companies/src/web/access/index.ts new file mode 100644 index 0000000..b495dea --- /dev/null +++ b/modules/companies/src/web/access/index.ts @@ -0,0 +1,10 @@ +export { EntityHelp } from "./help"; +export { AccessWorkspacePage } from "./list"; +export { + AccessForm, + accessApi, + accessEnglish, + accessKeys, + accessLabel, + accessSpanish, +} from "./shared"; diff --git a/modules/companies/src/web/access/list/index.ts b/modules/companies/src/web/access/list/index.ts new file mode 100644 index 0000000..83463ae --- /dev/null +++ b/modules/companies/src/web/access/list/index.ts @@ -0,0 +1 @@ +export { AccessWorkspacePage } from "./ui"; diff --git a/modules/companies/src/web/access/access-row.tsx b/modules/companies/src/web/access/list/ui/access-row.tsx similarity index 97% rename from modules/companies/src/web/access/access-row.tsx rename to modules/companies/src/web/access/list/ui/access-row.tsx index e41b161..8148e44 100644 --- a/modules/companies/src/web/access/access-row.tsx +++ b/modules/companies/src/web/access/list/ui/access-row.tsx @@ -1,9 +1,9 @@ import { EntityAction, EntityRowActions } from "@repo/shadcn-ui/components/entity-list"; import { useTranslation } from "react-i18next"; -import type { AccessItemDTO, AccessResponseDTO, PersonDTO } from "../../common"; +import type { AccessItemDTO, AccessResponseDTO, PersonDTO } from "../../../../common"; +import { accessLabel } from "../../shared"; -import { accessLabel } from "./access-labels"; import { EntryState } from "./entry-state"; export function AccessCell({ diff --git a/modules/companies/src/web/access/access-workspace.tsx b/modules/companies/src/web/access/list/ui/access-workspace.tsx similarity index 94% rename from modules/companies/src/web/access/access-workspace.tsx rename to modules/companies/src/web/access/list/ui/access-workspace.tsx index f11259b..8d49617 100644 --- a/modules/companies/src/web/access/access-workspace.tsx +++ b/modules/companies/src/web/access/list/ui/access-workspace.tsx @@ -4,14 +4,19 @@ import { useQuery } from "@tanstack/react-query"; import { useState } from "react"; import { useTranslation } from "react-i18next"; -import type { AccessKind, PersonDTO } from "../../common"; +import type { AccessKind, PersonDTO } from "../../../../common"; +import { AccessHelpDialog } from "../../help"; +import { AccessHistory } from "../../history"; +import { + AccessApiError, + AccessEditorDialog, + accessApi, + accessFields, + accessKeys, + accessLabel, + createLabels, +} from "../../shared"; -import { AccessApiError, accessApi, accessKeys } from "./access-api"; -import { AccessEditorDialog } from "./access-editor-dialog"; -import { accessFields, createLabels } from "./access-fields"; -import { AccessHelpDialog } from "./access-help-dialog"; -import { AccessHistory } from "./access-history"; -import { accessLabel } from "./access-labels"; import { AccessCell } from "./access-row"; export function AccessWorkspacePage({ diff --git a/modules/companies/src/web/access/entry-state.tsx b/modules/companies/src/web/access/list/ui/entry-state.tsx similarity index 94% rename from modules/companies/src/web/access/entry-state.tsx rename to modules/companies/src/web/access/list/ui/entry-state.tsx index b68cdb1..146baf9 100644 --- a/modules/companies/src/web/access/entry-state.tsx +++ b/modules/companies/src/web/access/list/ui/entry-state.tsx @@ -1,7 +1,7 @@ import { EntityStatus } from "@repo/shadcn-ui/components/entity-list"; import { useTranslation } from "react-i18next"; -import type { AccessFieldsDTO } from "../../common"; +import type { AccessFieldsDTO } from "../../../../common"; export function EntryState({ value }: { value: AccessFieldsDTO }) { const { t } = useTranslation("access"); diff --git a/modules/companies/src/web/access/list/ui/index.ts b/modules/companies/src/web/access/list/ui/index.ts new file mode 100644 index 0000000..be515e2 --- /dev/null +++ b/modules/companies/src/web/access/list/ui/index.ts @@ -0,0 +1 @@ +export { AccessWorkspacePage } from "./access-workspace"; diff --git a/modules/companies/src/web/access/access.test.tsx b/modules/companies/src/web/access/shared/access.test.tsx similarity index 96% rename from modules/companies/src/web/access/access.test.tsx rename to modules/companies/src/web/access/shared/access.test.tsx index 0e519d1..2bc64e2 100644 --- a/modules/companies/src/web/access/access.test.tsx +++ b/modules/companies/src/web/access/shared/access.test.tsx @@ -6,14 +6,14 @@ import { createInstance } from "i18next"; import { renderToStaticMarkup } from "react-dom/server"; import { I18nextProvider } from "react-i18next"; -import type { AccessResponseDTO } from "../../common"; +import type { AccessResponseDTO } from "../../../common"; +import { quickCreatePlan } from "../create"; +import { AccessWorkspacePage } from "../list"; -import { accessKeys } from "./access-api"; -import { accessFields } from "./access-fields"; -import { AccessForm } from "./access-form"; -import { AccessWorkspacePage } from "./access-workspace"; +import { accessKeys } from "./api"; +import { accessFields } from "./helpers"; import { accessEnglish, accessSpanish } from "./i18n"; -import { quickCreatePlan } from "./quick-create-plan"; +import { AccessForm } from "./ui"; test("los catálogos presentan alta mediante acción y no un formulario junto al listado", async () => { for (const [language, label] of [ @@ -69,7 +69,7 @@ test("cuentas ofrecen caducidad opcional y campos sin contraseña", async () => }); test("la ayuda explica todos los elementos en ambos idiomas y distingue el ámbito", async () => { - const { EntityHelp } = await import("./entity-help"); + const { EntityHelp } = await import("../help/ui/entity-help"); const { accessSpanish: helpSpanish, accessEnglish: helpEnglish } = await import("./i18n"); for (const [language, content] of [ ["es", helpSpanish], diff --git a/modules/companies/src/web/access/access-api.ts b/modules/companies/src/web/access/shared/api/access-api.ts similarity index 88% rename from modules/companies/src/web/access/access-api.ts rename to modules/companies/src/web/access/shared/api/access-api.ts index 425ecc6..202982a 100644 --- a/modules/companies/src/web/access/access-api.ts +++ b/modules/companies/src/web/access/shared/api/access-api.ts @@ -1,7 +1,7 @@ import { z } from "zod/v4"; -import type { AccessFieldsDTO } from "../../common"; -import { AccessResponseSchema } from "../../common"; +import type { AccessFieldsDTO } from "../../../../common"; +import { AccessResponseSchema } from "../../../../common"; export const accessKeys = { scope: (scope: string) => ["access", scope] }; export class AccessApiError extends Error { constructor(public readonly code: string) { diff --git a/modules/companies/src/web/access/shared/api/index.ts b/modules/companies/src/web/access/shared/api/index.ts new file mode 100644 index 0000000..c308e59 --- /dev/null +++ b/modules/companies/src/web/access/shared/api/index.ts @@ -0,0 +1 @@ +export { AccessApiError, accessApi, accessKeys } from "./access-api"; diff --git a/modules/companies/src/web/access/access-fields.ts b/modules/companies/src/web/access/shared/helpers/access-fields.ts similarity index 98% rename from modules/companies/src/web/access/access-fields.ts rename to modules/companies/src/web/access/shared/helpers/access-fields.ts index c178aee..abd5bff 100644 --- a/modules/companies/src/web/access/access-fields.ts +++ b/modules/companies/src/web/access/shared/helpers/access-fields.ts @@ -1,4 +1,4 @@ -import type { AccessKind } from "../../common"; +import type { AccessKind } from "../../../../common"; export type AccessField = { key: string; type: "text" | "note" | "date" | "boolean" | "select" | "permissions"; diff --git a/modules/companies/src/web/access/access-form-values.ts b/modules/companies/src/web/access/shared/helpers/access-form-values.ts similarity index 97% rename from modules/companies/src/web/access/access-form-values.ts rename to modules/companies/src/web/access/shared/helpers/access-form-values.ts index bc95725..1b35ab5 100644 --- a/modules/companies/src/web/access/access-form-values.ts +++ b/modules/companies/src/web/access/shared/helpers/access-form-values.ts @@ -1,4 +1,4 @@ -import type { AccessFieldsDTO, AccessItemDTO } from "../../common"; +import type { AccessFieldsDTO, AccessItemDTO } from "../../../../common"; import type { AccessField } from "./access-fields"; export type AccessFormValues = Record; diff --git a/modules/companies/src/web/access/access-labels.ts b/modules/companies/src/web/access/shared/helpers/access-labels.ts similarity index 95% rename from modules/companies/src/web/access/access-labels.ts rename to modules/companies/src/web/access/shared/helpers/access-labels.ts index e3257bf..bd5b63c 100644 --- a/modules/companies/src/web/access/access-labels.ts +++ b/modules/companies/src/web/access/shared/helpers/access-labels.ts @@ -1,4 +1,4 @@ -import type { AccessItemDTO, PersonDTO } from "../../common"; +import type { AccessItemDTO, PersonDTO } from "../../../../common"; export function accessLabel( item: AccessItemDTO, items: readonly AccessItemDTO[], diff --git a/modules/companies/src/web/access/shared/helpers/index.ts b/modules/companies/src/web/access/shared/helpers/index.ts new file mode 100644 index 0000000..c28a6d6 --- /dev/null +++ b/modules/companies/src/web/access/shared/helpers/index.ts @@ -0,0 +1,5 @@ +export type { AccessField } from "./access-fields"; +export { accessFields, createLabels } from "./access-fields"; +export type { AccessFormValues } from "./access-form-values"; +export { compatibleOption, fieldDefault, formBody } from "./access-form-values"; +export { accessLabel } from "./access-labels"; diff --git a/modules/companies/src/web/access/i18n.ts b/modules/companies/src/web/access/shared/i18n.ts similarity index 73% rename from modules/companies/src/web/access/i18n.ts rename to modules/companies/src/web/access/shared/i18n.ts index d280895..b58b534 100644 --- a/modules/companies/src/web/access/i18n.ts +++ b/modules/companies/src/web/access/shared/i18n.ts @@ -1,6 +1,6 @@ -import type { AccessKind } from "../../common"; -import english from "../../common/locales/en.json"; -import spanish from "../../common/locales/es.json"; +import type { AccessKind } from "../../../common"; +import english from "../../../common/locales/en.json"; +import spanish from "../../../common/locales/es.json"; export type HelpKind = AccessKind | "company" | "person" | "department" | "site" | "assignment"; type HelpContent = Record; diff --git a/modules/companies/src/web/access/shared/index.ts b/modules/companies/src/web/access/shared/index.ts new file mode 100644 index 0000000..2d31d48 --- /dev/null +++ b/modules/companies/src/web/access/shared/index.ts @@ -0,0 +1,4 @@ +export { AccessApiError, accessApi, accessKeys } from "./api"; +export { accessFields, accessLabel, createLabels } from "./helpers"; +export { accessEnglish, accessSpanish } from "./i18n"; +export { AccessEditorDialog, AccessForm } from "./ui"; diff --git a/modules/companies/src/web/access/access-field-option.ts b/modules/companies/src/web/access/shared/types/access-field-option.ts similarity index 100% rename from modules/companies/src/web/access/access-field-option.ts rename to modules/companies/src/web/access/shared/types/access-field-option.ts diff --git a/modules/companies/src/web/access/access-form-props.ts b/modules/companies/src/web/access/shared/types/access-form-props.ts similarity index 83% rename from modules/companies/src/web/access/access-form-props.ts rename to modules/companies/src/web/access/shared/types/access-form-props.ts index 28ec520..a41b421 100644 --- a/modules/companies/src/web/access/access-form-props.ts +++ b/modules/companies/src/web/access/shared/types/access-form-props.ts @@ -4,9 +4,8 @@ import type { AccessKind, AccessResponseDTO, PersonDTO, -} from "../../common"; - -import type { AccessFormValues } from "./access-form-values"; +} from "../../../../common"; +import type { AccessFormValues } from "../helpers"; export type AccessFormProps = { scope: string; diff --git a/modules/companies/src/web/access/shared/types/index.ts b/modules/companies/src/web/access/shared/types/index.ts new file mode 100644 index 0000000..a29f4f0 --- /dev/null +++ b/modules/companies/src/web/access/shared/types/index.ts @@ -0,0 +1,2 @@ +export type { Option } from "./access-field-option"; +export type { AccessFormProps } from "./access-form-props"; diff --git a/modules/companies/src/web/access/access-editor-dialog.tsx b/modules/companies/src/web/access/shared/ui/access-editor-dialog.tsx similarity index 92% rename from modules/companies/src/web/access/access-editor-dialog.tsx rename to modules/companies/src/web/access/shared/ui/access-editor-dialog.tsx index 4803337..4ed85e5 100644 --- a/modules/companies/src/web/access/access-editor-dialog.tsx +++ b/modules/companies/src/web/access/shared/ui/access-editor-dialog.tsx @@ -2,9 +2,9 @@ import { FormDialog } from "@repo/shadcn-ui/components/form-dialog"; import type { ComponentProps } from "react"; import { useTranslation } from "react-i18next"; -import type { AccessKind } from "../../common"; +import type { AccessKind } from "../../../../common"; +import { createLabels } from "../helpers"; -import { createLabels } from "./access-fields"; import { AccessForm } from "./access-form"; export function AccessEditorDialog({ diff --git a/modules/companies/src/web/access/access-field-control.tsx b/modules/companies/src/web/access/shared/ui/access-field-control.tsx similarity index 94% rename from modules/companies/src/web/access/access-field-control.tsx rename to modules/companies/src/web/access/shared/ui/access-field-control.tsx index 49d6e81..fd334e1 100644 --- a/modules/companies/src/web/access/access-field-control.tsx +++ b/modules/companies/src/web/access/shared/ui/access-field-control.tsx @@ -7,9 +7,9 @@ import { Textarea } from "@repo/shadcn-ui/components/textarea"; import type { UseFormReturn } from "react-hook-form"; import { useTranslation } from "react-i18next"; -import type { Option } from "./access-field-option"; -import type { AccessField } from "./access-fields"; -import type { AccessFormValues } from "./access-form-values"; +import type { AccessField, AccessFormValues } from "../helpers"; +import type { Option } from "../types"; + import { PermissionsControl } from "./permissions-control"; export function AccessFieldControl({ diff --git a/modules/companies/src/web/access/access-form-fields.tsx b/modules/companies/src/web/access/shared/ui/access-form-fields.tsx similarity index 90% rename from modules/companies/src/web/access/access-form-fields.tsx rename to modules/companies/src/web/access/shared/ui/access-form-fields.tsx index 7296ab4..3efa82d 100644 --- a/modules/companies/src/web/access/access-form-fields.tsx +++ b/modules/companies/src/web/access/shared/ui/access-form-fields.tsx @@ -6,21 +6,17 @@ import { useId, useState } from "react"; import { useForm } from "react-hook-form"; import { useTranslation } from "react-i18next"; -import type { AccessFieldsDTO } from "../../common"; -import { AccessFieldsSchema } from "../../common"; +import type { AccessFieldsDTO } from "../../../../common"; +import { AccessFieldsSchema } from "../../../../common"; +import type { QuickCreatePlan } from "../../create"; +import { AccessQuickEditor, matchesSubmittedValues, quickCreatePlan } from "../../create"; +import { EntityHelp } from "../../help"; +import { AccessApiError, accessApi, accessKeys } from "../api"; +import type { AccessField, AccessFormValues } from "../helpers"; +import { accessFields, accessLabel, compatibleOption, fieldDefault, formBody } from "../helpers"; +import type { AccessFormProps } from "../types"; -import { AccessApiError, accessApi, accessKeys } from "./access-api"; import { AccessFieldControl } from "./access-field-control"; -import type { AccessField } from "./access-fields"; -import { accessFields } from "./access-fields"; -import type { AccessFormProps } from "./access-form-props"; -import type { AccessFormValues } from "./access-form-values"; -import { compatibleOption, fieldDefault, formBody } from "./access-form-values"; -import { accessLabel } from "./access-labels"; -import { AccessQuickEditor } from "./access-quick-editor"; -import { EntityHelp } from "./entity-help"; -import type { QuickCreatePlan } from "./quick-create-plan"; -import { matchesSubmittedValues, quickCreatePlan } from "./quick-create-plan"; export function AccessFormFields({ scope, diff --git a/modules/companies/src/web/access/access-form.tsx b/modules/companies/src/web/access/shared/ui/access-form.tsx similarity index 93% rename from modules/companies/src/web/access/access-form.tsx rename to modules/companies/src/web/access/shared/ui/access-form.tsx index c689eb3..c5e04c4 100644 --- a/modules/companies/src/web/access/access-form.tsx +++ b/modules/companies/src/web/access/shared/ui/access-form.tsx @@ -1,7 +1,8 @@ import { ResourceEditor } from "@metis/resources/client"; +import type { AccessFormProps } from "../types"; + import { AccessFormFields } from "./access-form-fields"; -import type { AccessFormProps } from "./access-form-props"; export function AccessForm(props: AccessFormProps) { if (props.kind === "resource") { diff --git a/modules/companies/src/web/access/shared/ui/index.ts b/modules/companies/src/web/access/shared/ui/index.ts new file mode 100644 index 0000000..6e3b134 --- /dev/null +++ b/modules/companies/src/web/access/shared/ui/index.ts @@ -0,0 +1,2 @@ +export { AccessEditorDialog } from "./access-editor-dialog"; +export { AccessForm } from "./access-form"; diff --git a/modules/companies/src/web/access/permissions-control.tsx b/modules/companies/src/web/access/shared/ui/permissions-control.tsx similarity index 92% rename from modules/companies/src/web/access/permissions-control.tsx rename to modules/companies/src/web/access/shared/ui/permissions-control.tsx index 2699188..b15d19a 100644 --- a/modules/companies/src/web/access/permissions-control.tsx +++ b/modules/companies/src/web/access/shared/ui/permissions-control.tsx @@ -3,8 +3,8 @@ import { Label } from "@repo/shadcn-ui/components/label"; import type { UseFormReturn } from "react-hook-form"; import { useTranslation } from "react-i18next"; -import type { Option } from "./access-field-option"; -import type { AccessFormValues } from "./access-form-values"; +import type { AccessFormValues } from "../helpers"; +import type { Option } from "../types"; export function PermissionsControl({ fieldKey, diff --git a/modules/companies/src/web/application-configurations/create/index.ts b/modules/companies/src/web/application-configurations/create/index.ts new file mode 100644 index 0000000..3e43c00 --- /dev/null +++ b/modules/companies/src/web/application-configurations/create/index.ts @@ -0,0 +1 @@ +export { ApplicationQuickEditor } from "./ui"; diff --git a/modules/companies/src/web/applications/application-quick-editor.tsx b/modules/companies/src/web/application-configurations/create/ui/application-quick-editor.tsx similarity index 91% rename from modules/companies/src/web/applications/application-quick-editor.tsx rename to modules/companies/src/web/application-configurations/create/ui/application-quick-editor.tsx index a537a9a..4623d51 100644 --- a/modules/companies/src/web/applications/application-quick-editor.tsx +++ b/modules/companies/src/web/application-configurations/create/ui/application-quick-editor.tsx @@ -2,8 +2,8 @@ import { ResourceEditor } from "@metis/resources/client"; import { FormDialog } from "@repo/shadcn-ui/components/form-dialog"; import { useTranslation } from "react-i18next"; -import type { CompanyDTO } from "../../common"; -import { WorkProfileForm } from "../profiles/work-profile-form"; +import type { CompanyDTO } from "../../../../common"; +import { WorkProfileForm } from "../../../work-profiles/shared"; export function ApplicationQuickEditor({ kind, diff --git a/modules/companies/src/web/application-configurations/create/ui/index.ts b/modules/companies/src/web/application-configurations/create/ui/index.ts new file mode 100644 index 0000000..e07e33c --- /dev/null +++ b/modules/companies/src/web/application-configurations/create/ui/index.ts @@ -0,0 +1 @@ +export { ApplicationQuickEditor } from "./application-quick-editor"; diff --git a/modules/companies/src/web/application-configurations/history/index.ts b/modules/companies/src/web/application-configurations/history/index.ts new file mode 100644 index 0000000..622aee5 --- /dev/null +++ b/modules/companies/src/web/application-configurations/history/index.ts @@ -0,0 +1 @@ +export { ApplicationHistoryDialog } from "./ui"; diff --git a/modules/companies/src/web/applications/application-history-dialog.tsx b/modules/companies/src/web/application-configurations/history/ui/application-history-dialog.tsx similarity index 95% rename from modules/companies/src/web/applications/application-history-dialog.tsx rename to modules/companies/src/web/application-configurations/history/ui/application-history-dialog.tsx index b2abee7..7022f30 100644 --- a/modules/companies/src/web/applications/application-history-dialog.tsx +++ b/modules/companies/src/web/application-configurations/history/ui/application-history-dialog.tsx @@ -1,7 +1,7 @@ import { FormDialog } from "@repo/shadcn-ui/components/form-dialog"; import { useTranslation } from "react-i18next"; -import type { ApplicationConfigurationDTO } from "../../common"; +import type { ApplicationConfigurationDTO } from "../../../../common"; export function ApplicationHistoryDialog({ configuration, diff --git a/modules/companies/src/web/application-configurations/history/ui/index.ts b/modules/companies/src/web/application-configurations/history/ui/index.ts new file mode 100644 index 0000000..8c2b31c --- /dev/null +++ b/modules/companies/src/web/application-configurations/history/ui/index.ts @@ -0,0 +1 @@ +export { ApplicationHistoryDialog } from "./application-history-dialog"; diff --git a/modules/companies/src/web/application-configurations/index.ts b/modules/companies/src/web/application-configurations/index.ts new file mode 100644 index 0000000..7d312b6 --- /dev/null +++ b/modules/companies/src/web/application-configurations/index.ts @@ -0,0 +1,2 @@ +export { ApplicationConfigurationsPage } from "./list"; +export { applicationApi, applicationKeys } from "./shared"; diff --git a/modules/companies/src/web/application-configurations/list/index.ts b/modules/companies/src/web/application-configurations/list/index.ts new file mode 100644 index 0000000..fb83582 --- /dev/null +++ b/modules/companies/src/web/application-configurations/list/index.ts @@ -0,0 +1 @@ +export { ApplicationConfigurationsPage } from "./ui"; diff --git a/modules/companies/src/web/applications/application-configurations-page.tsx b/modules/companies/src/web/application-configurations/list/ui/application-configurations-page.tsx similarity index 94% rename from modules/companies/src/web/applications/application-configurations-page.tsx rename to modules/companies/src/web/application-configurations/list/ui/application-configurations-page.tsx index 707dbb3..6acaf2a 100644 --- a/modules/companies/src/web/applications/application-configurations-page.tsx +++ b/modules/companies/src/web/application-configurations/list/ui/application-configurations-page.tsx @@ -15,13 +15,15 @@ import { useQuery } from "@tanstack/react-query"; import { useState } from "react"; import { useTranslation } from "react-i18next"; -import type { CompanyDTO } from "../../common"; -import { profileApi, profileKeys } from "../profiles/work-profile-api"; - -import { applicationApi, applicationKeys } from "./application-api"; -import { ApplicationConfigurationEditorDialog } from "./application-configuration-editor-dialog"; -import { ApplicationFeedback } from "./application-feedback"; -import { ApplicationHistoryDialog } from "./application-history-dialog"; +import type { CompanyDTO } from "../../../../common"; +import { profileApi, profileKeys } from "../../../work-profiles/shared"; +import { ApplicationHistoryDialog } from "../../history"; +import { + ApplicationConfigurationEditorDialog, + ApplicationFeedback, + applicationApi, + applicationKeys, +} from "../../shared"; export function ApplicationConfigurationsPage({ company, diff --git a/modules/companies/src/web/application-configurations/list/ui/index.ts b/modules/companies/src/web/application-configurations/list/ui/index.ts new file mode 100644 index 0000000..9ed4e52 --- /dev/null +++ b/modules/companies/src/web/application-configurations/list/ui/index.ts @@ -0,0 +1 @@ +export { ApplicationConfigurationsPage } from "./application-configurations-page"; diff --git a/modules/companies/src/web/applications/application-api.ts b/modules/companies/src/web/application-configurations/shared/api/application-api.ts similarity index 90% rename from modules/companies/src/web/applications/application-api.ts rename to modules/companies/src/web/application-configurations/shared/api/application-api.ts index 245ab77..a82e192 100644 --- a/modules/companies/src/web/applications/application-api.ts +++ b/modules/companies/src/web/application-configurations/shared/api/application-api.ts @@ -1,10 +1,10 @@ import { z } from "zod/v4"; -import type { ApplicationConfigurationInput } from "../../common/application-configurations"; +import type { ApplicationConfigurationInput } from "../../../../common/application-configurations"; import { ApplicationConfigurationResponseSchema, ApplicationConfigurationsResponseSchema, -} from "../../common/application-configurations"; +} from "../../../../common/application-configurations"; export const applicationKeys = { company: (id: string) => ["application-configurations", id] }; export class ApplicationApiError extends Error { constructor(public readonly code: string) { diff --git a/modules/companies/src/web/application-configurations/shared/api/index.ts b/modules/companies/src/web/application-configurations/shared/api/index.ts new file mode 100644 index 0000000..5479953 --- /dev/null +++ b/modules/companies/src/web/application-configurations/shared/api/index.ts @@ -0,0 +1 @@ +export { ApplicationApiError, applicationApi, applicationKeys } from "./application-api"; diff --git a/modules/companies/src/web/applications/application.test.tsx b/modules/companies/src/web/application-configurations/shared/application.test.tsx similarity index 90% rename from modules/companies/src/web/applications/application.test.tsx rename to modules/companies/src/web/application-configurations/shared/application.test.tsx index 7b36565..81793b9 100644 --- a/modules/companies/src/web/applications/application.test.tsx +++ b/modules/companies/src/web/application-configurations/shared/application.test.tsx @@ -9,12 +9,12 @@ import type { ReactNode } from "react"; import { renderToStaticMarkup } from "react-dom/server"; import { I18nextProvider } from "react-i18next"; -import { companiesEnglish, companiesSpanish } from "../i18n"; -import { profileKeys } from "../profiles/work-profile-api"; +import { companiesEnglish, companiesSpanish } from "../../shared"; +import { profileKeys } from "../../work-profiles"; +import { ApplicationConfigurationsPage } from "../list"; -import { applicationKeys } from "./application-api"; -import { ApplicationConfigurationForm } from "./application-configuration-form"; -import { ApplicationConfigurationsPage } from "./application-configurations-page"; +import { applicationKeys } from "./api"; +import { ApplicationConfigurationForm } from "./ui"; const company = { id: "0199b200-0000-7000-8000-000000000001", diff --git a/modules/companies/src/web/application-configurations/shared/index.ts b/modules/companies/src/web/application-configurations/shared/index.ts new file mode 100644 index 0000000..f69c68f --- /dev/null +++ b/modules/companies/src/web/application-configurations/shared/index.ts @@ -0,0 +1,2 @@ +export { applicationApi, applicationKeys } from "./api"; +export { ApplicationConfigurationEditorDialog, ApplicationFeedback } from "./ui"; diff --git a/modules/companies/src/web/applications/application-configuration-editor-dialog.tsx b/modules/companies/src/web/application-configurations/shared/ui/application-configuration-editor-dialog.tsx similarity index 95% rename from modules/companies/src/web/applications/application-configuration-editor-dialog.tsx rename to modules/companies/src/web/application-configurations/shared/ui/application-configuration-editor-dialog.tsx index 7ca56fd..ccac913 100644 --- a/modules/companies/src/web/applications/application-configuration-editor-dialog.tsx +++ b/modules/companies/src/web/application-configurations/shared/ui/application-configuration-editor-dialog.tsx @@ -2,7 +2,7 @@ import { FormDialog } from "@repo/shadcn-ui/components/form-dialog"; import type { ComponentProps } from "react"; import { useTranslation } from "react-i18next"; -import type { CompanyDTO } from "../../common"; +import type { CompanyDTO } from "../../../../common"; import { ApplicationConfigurationForm } from "./application-configuration-form"; diff --git a/modules/companies/src/web/applications/application-configuration-form.tsx b/modules/companies/src/web/application-configurations/shared/ui/application-configuration-form.tsx similarity index 96% rename from modules/companies/src/web/applications/application-configuration-form.tsx rename to modules/companies/src/web/application-configurations/shared/ui/application-configuration-form.tsx index 193e940..203e320 100644 --- a/modules/companies/src/web/applications/application-configuration-form.tsx +++ b/modules/companies/src/web/application-configurations/shared/ui/application-configuration-form.tsx @@ -14,20 +14,20 @@ import type { UseFormReturn } from "react-hook-form"; import { useForm } from "react-hook-form"; import { useTranslation } from "react-i18next"; -import type { CompanyDTO, WorkProfileDTO } from "../../common"; +import type { CompanyDTO, WorkProfileDTO } from "../../../../common"; import type { ApplicationConfigurationDTO, ApplicationConfigurationInput, -} from "../../common/application-configurations"; +} from "../../../../common/application-configurations"; import { APPLICATION_STATE_TRANSITIONS, ApplicationConfigurationInputSchema, -} from "../../common/application-configurations"; -import { profileApi, profileKeys } from "../profiles/work-profile-api"; +} from "../../../../common/application-configurations"; +import { profileApi, profileKeys } from "../../../work-profiles/shared"; +import { ApplicationQuickEditor } from "../../create"; +import { applicationApi, applicationKeys } from "../api"; -import { applicationApi, applicationKeys } from "./application-api"; import { ApplicationFeedback } from "./application-feedback"; -import { ApplicationQuickEditor } from "./application-quick-editor"; export function ApplicationConfigurationForm({ company, diff --git a/modules/companies/src/web/applications/application-feedback.tsx b/modules/companies/src/web/application-configurations/shared/ui/application-feedback.tsx similarity index 87% rename from modules/companies/src/web/applications/application-feedback.tsx rename to modules/companies/src/web/application-configurations/shared/ui/application-feedback.tsx index f5e9a92..cf1ad9f 100644 --- a/modules/companies/src/web/applications/application-feedback.tsx +++ b/modules/companies/src/web/application-configurations/shared/ui/application-feedback.tsx @@ -1,6 +1,6 @@ import { useTranslation } from "react-i18next"; -import { ApplicationApiError } from "./application-api"; +import { ApplicationApiError } from "../api"; export function ApplicationFeedback({ error }: { error: Error | null }) { const { t } = useTranslation("companies"); return error ? ( diff --git a/modules/companies/src/web/application-configurations/shared/ui/index.ts b/modules/companies/src/web/application-configurations/shared/ui/index.ts new file mode 100644 index 0000000..fc2d50d --- /dev/null +++ b/modules/companies/src/web/application-configurations/shared/ui/index.ts @@ -0,0 +1,3 @@ +export { ApplicationConfigurationEditorDialog } from "./application-configuration-editor-dialog"; +export { ApplicationConfigurationForm } from "./application-configuration-form"; +export { ApplicationFeedback } from "./application-feedback"; diff --git a/modules/companies/src/web/assignments/history/index.ts b/modules/companies/src/web/assignments/history/index.ts new file mode 100644 index 0000000..6cf5f21 --- /dev/null +++ b/modules/companies/src/web/assignments/history/index.ts @@ -0,0 +1 @@ +export { AssignmentHistoryDialog } from "./ui"; diff --git a/modules/companies/src/web/components/assignment-history-dialog.tsx b/modules/companies/src/web/assignments/history/ui/assignment-history-dialog.tsx similarity index 96% rename from modules/companies/src/web/components/assignment-history-dialog.tsx rename to modules/companies/src/web/assignments/history/ui/assignment-history-dialog.tsx index eb7be1c..2768533 100644 --- a/modules/companies/src/web/components/assignment-history-dialog.tsx +++ b/modules/companies/src/web/assignments/history/ui/assignment-history-dialog.tsx @@ -1,7 +1,7 @@ import { FormDialog } from "@repo/shadcn-ui/components/form-dialog"; import { useTranslation } from "react-i18next"; -import type { CompanyDTO } from "../../common"; +import type { CompanyDTO } from "../../../../common"; export function AssignmentHistoryDialog({ history, diff --git a/modules/companies/src/web/assignments/history/ui/index.ts b/modules/companies/src/web/assignments/history/ui/index.ts new file mode 100644 index 0000000..291bc95 --- /dev/null +++ b/modules/companies/src/web/assignments/history/ui/index.ts @@ -0,0 +1 @@ +export { AssignmentHistoryDialog } from "./assignment-history-dialog"; diff --git a/modules/companies/src/web/assignments/index.ts b/modules/companies/src/web/assignments/index.ts new file mode 100644 index 0000000..a216664 --- /dev/null +++ b/modules/companies/src/web/assignments/index.ts @@ -0,0 +1,2 @@ +export { AssignmentHistoryDialog } from "./history"; +export { AssignmentEditorDialog, AssignmentForm } from "./shared"; diff --git a/modules/companies/src/web/assignments/shared/index.ts b/modules/companies/src/web/assignments/shared/index.ts new file mode 100644 index 0000000..a8e33bc --- /dev/null +++ b/modules/companies/src/web/assignments/shared/index.ts @@ -0,0 +1 @@ +export { AssignmentEditorDialog, AssignmentForm } from "./ui"; diff --git a/modules/companies/src/web/components/assignment-editor-dialog.tsx b/modules/companies/src/web/assignments/shared/ui/assignment-editor-dialog.tsx similarity index 95% rename from modules/companies/src/web/components/assignment-editor-dialog.tsx rename to modules/companies/src/web/assignments/shared/ui/assignment-editor-dialog.tsx index 139be4e..5a323a3 100644 --- a/modules/companies/src/web/components/assignment-editor-dialog.tsx +++ b/modules/companies/src/web/assignments/shared/ui/assignment-editor-dialog.tsx @@ -2,7 +2,7 @@ import { FormDialog } from "@repo/shadcn-ui/components/form-dialog"; import type { ComponentProps } from "react"; import { useTranslation } from "react-i18next"; -import type { CompanyDTO } from "../../common"; +import type { CompanyDTO } from "../../../../common"; import { AssignmentForm } from "./assignment-form"; diff --git a/modules/companies/src/web/components/assignment-form.tsx b/modules/companies/src/web/assignments/shared/ui/assignment-form.tsx similarity index 96% rename from modules/companies/src/web/components/assignment-form.tsx rename to modules/companies/src/web/assignments/shared/ui/assignment-form.tsx index 247358f..3981a89 100644 --- a/modules/companies/src/web/components/assignment-form.tsx +++ b/modules/companies/src/web/assignments/shared/ui/assignment-form.tsx @@ -11,12 +11,10 @@ import { useForm } from "react-hook-form"; import { useTranslation } from "react-i18next"; import { z } from "zod/v4"; -import type { CompanyDTO, DepartmentAssignmentDTO } from "../../common"; -import { EntityHelp } from "../access/entity-help"; -import { companyApi, companyKeys } from "../api/company-api"; - -import { CompanyFeedback } from "./company-feedback"; -import { DepartmentEditorDialog } from "./department-editor-dialog"; +import type { CompanyDTO, DepartmentAssignmentDTO } from "../../../../common"; +import { EntityHelp } from "../../../access/help"; +import { CompanyFeedback, companyApi, companyKeys } from "../../../companies/shared"; +import { DepartmentEditorDialog } from "../../../departments"; const FormSchema = z.strictObject({ departmentId: z.uuid(), diff --git a/modules/companies/src/web/assignments/shared/ui/index.ts b/modules/companies/src/web/assignments/shared/ui/index.ts new file mode 100644 index 0000000..b8d1cb3 --- /dev/null +++ b/modules/companies/src/web/assignments/shared/ui/index.ts @@ -0,0 +1,2 @@ +export { AssignmentEditorDialog } from "./assignment-editor-dialog"; +export { AssignmentForm } from "./assignment-form"; diff --git a/modules/companies/src/web/certificate-configurations/create/index.ts b/modules/companies/src/web/certificate-configurations/create/index.ts new file mode 100644 index 0000000..07fd307 --- /dev/null +++ b/modules/companies/src/web/certificate-configurations/create/index.ts @@ -0,0 +1 @@ +export { CertificateQuickEditor } from "./ui"; diff --git a/modules/companies/src/web/certificates/certificate-quick-editor.tsx b/modules/companies/src/web/certificate-configurations/create/ui/certificate-quick-editor.tsx similarity index 91% rename from modules/companies/src/web/certificates/certificate-quick-editor.tsx rename to modules/companies/src/web/certificate-configurations/create/ui/certificate-quick-editor.tsx index 4be3a0f..2652828 100644 --- a/modules/companies/src/web/certificates/certificate-quick-editor.tsx +++ b/modules/companies/src/web/certificate-configurations/create/ui/certificate-quick-editor.tsx @@ -2,8 +2,8 @@ import { ResourceEditor } from "@metis/resources/client"; import { FormDialog } from "@repo/shadcn-ui/components/form-dialog"; import { useTranslation } from "react-i18next"; -import type { CompanyDTO } from "../../common"; -import { WorkProfileForm } from "../profiles/work-profile-form"; +import type { CompanyDTO } from "../../../../common"; +import { WorkProfileForm } from "../../../work-profiles/shared"; export function CertificateQuickEditor({ kind, diff --git a/modules/companies/src/web/certificate-configurations/create/ui/index.ts b/modules/companies/src/web/certificate-configurations/create/ui/index.ts new file mode 100644 index 0000000..8bdad38 --- /dev/null +++ b/modules/companies/src/web/certificate-configurations/create/ui/index.ts @@ -0,0 +1 @@ +export { CertificateQuickEditor } from "./certificate-quick-editor"; diff --git a/modules/companies/src/web/certificate-configurations/history/index.ts b/modules/companies/src/web/certificate-configurations/history/index.ts new file mode 100644 index 0000000..3567962 --- /dev/null +++ b/modules/companies/src/web/certificate-configurations/history/index.ts @@ -0,0 +1 @@ +export { CertificateHistoryDialog } from "./ui"; diff --git a/modules/companies/src/web/certificates/certificate-history-dialog.tsx b/modules/companies/src/web/certificate-configurations/history/ui/certificate-history-dialog.tsx similarity index 95% rename from modules/companies/src/web/certificates/certificate-history-dialog.tsx rename to modules/companies/src/web/certificate-configurations/history/ui/certificate-history-dialog.tsx index 9bc6876..87280da 100644 --- a/modules/companies/src/web/certificates/certificate-history-dialog.tsx +++ b/modules/companies/src/web/certificate-configurations/history/ui/certificate-history-dialog.tsx @@ -1,7 +1,7 @@ import { FormDialog } from "@repo/shadcn-ui/components/form-dialog"; import { useTranslation } from "react-i18next"; -import type { CertificateConfigurationDTO } from "../../common"; +import type { CertificateConfigurationDTO } from "../../../../common"; export function CertificateHistoryDialog({ configuration, diff --git a/modules/companies/src/web/certificate-configurations/history/ui/index.ts b/modules/companies/src/web/certificate-configurations/history/ui/index.ts new file mode 100644 index 0000000..8515154 --- /dev/null +++ b/modules/companies/src/web/certificate-configurations/history/ui/index.ts @@ -0,0 +1 @@ +export { CertificateHistoryDialog } from "./certificate-history-dialog"; diff --git a/modules/companies/src/web/certificate-configurations/index.ts b/modules/companies/src/web/certificate-configurations/index.ts new file mode 100644 index 0000000..80732c5 --- /dev/null +++ b/modules/companies/src/web/certificate-configurations/index.ts @@ -0,0 +1,2 @@ +export { CertificateConfigurationsPage } from "./list"; +export { certificateApi, certificateKeys } from "./shared"; diff --git a/modules/companies/src/web/certificate-configurations/list/index.ts b/modules/companies/src/web/certificate-configurations/list/index.ts new file mode 100644 index 0000000..6c14dec --- /dev/null +++ b/modules/companies/src/web/certificate-configurations/list/index.ts @@ -0,0 +1 @@ +export { CertificateConfigurationsPage } from "./ui"; diff --git a/modules/companies/src/web/certificates/certificate-configurations-page.tsx b/modules/companies/src/web/certificate-configurations/list/ui/certificate-configurations-page.tsx similarity index 94% rename from modules/companies/src/web/certificates/certificate-configurations-page.tsx rename to modules/companies/src/web/certificate-configurations/list/ui/certificate-configurations-page.tsx index 64f3f73..dc39da0 100644 --- a/modules/companies/src/web/certificates/certificate-configurations-page.tsx +++ b/modules/companies/src/web/certificate-configurations/list/ui/certificate-configurations-page.tsx @@ -15,13 +15,15 @@ import { useQuery } from "@tanstack/react-query"; import { useState } from "react"; import { useTranslation } from "react-i18next"; -import type { CompanyDTO } from "../../common"; -import { profileApi, profileKeys } from "../profiles/work-profile-api"; - -import { certificateApi, certificateKeys } from "./certificate-api"; -import { CertificateConfigurationEditorDialog } from "./certificate-configuration-editor-dialog"; -import { CertificateFeedback } from "./certificate-feedback"; -import { CertificateHistoryDialog } from "./certificate-history-dialog"; +import type { CompanyDTO } from "../../../../common"; +import { profileApi, profileKeys } from "../../../work-profiles/shared"; +import { CertificateHistoryDialog } from "../../history"; +import { + CertificateConfigurationEditorDialog, + CertificateFeedback, + certificateApi, + certificateKeys, +} from "../../shared"; export function CertificateConfigurationsPage({ company, diff --git a/modules/companies/src/web/certificate-configurations/list/ui/index.ts b/modules/companies/src/web/certificate-configurations/list/ui/index.ts new file mode 100644 index 0000000..f4f3767 --- /dev/null +++ b/modules/companies/src/web/certificate-configurations/list/ui/index.ts @@ -0,0 +1 @@ +export { CertificateConfigurationsPage } from "./certificate-configurations-page"; diff --git a/modules/companies/src/web/certificates/certificate-api.ts b/modules/companies/src/web/certificate-configurations/shared/api/certificate-api.ts similarity index 90% rename from modules/companies/src/web/certificates/certificate-api.ts rename to modules/companies/src/web/certificate-configurations/shared/api/certificate-api.ts index 18a13eb..7e6fe8c 100644 --- a/modules/companies/src/web/certificates/certificate-api.ts +++ b/modules/companies/src/web/certificate-configurations/shared/api/certificate-api.ts @@ -1,10 +1,10 @@ import { z } from "zod/v4"; -import type { CertificateConfigurationInput } from "../../common/certificate-configurations"; +import type { CertificateConfigurationInput } from "../../../../common/certificate-configurations"; import { CertificateConfigurationResponseSchema, CertificateConfigurationsResponseSchema, -} from "../../common/certificate-configurations"; +} from "../../../../common/certificate-configurations"; export const certificateKeys = { company: (id: string) => ["certificate-configurations", id] }; export class CertificateApiError extends Error { constructor(public readonly code: string) { diff --git a/modules/companies/src/web/certificate-configurations/shared/api/index.ts b/modules/companies/src/web/certificate-configurations/shared/api/index.ts new file mode 100644 index 0000000..ef2decc --- /dev/null +++ b/modules/companies/src/web/certificate-configurations/shared/api/index.ts @@ -0,0 +1 @@ +export { CertificateApiError, certificateApi, certificateKeys } from "./certificate-api"; diff --git a/modules/companies/src/web/certificates/certificate.test.tsx b/modules/companies/src/web/certificate-configurations/shared/certificate.test.tsx similarity index 90% rename from modules/companies/src/web/certificates/certificate.test.tsx rename to modules/companies/src/web/certificate-configurations/shared/certificate.test.tsx index 6df640d..b7f8c65 100644 --- a/modules/companies/src/web/certificates/certificate.test.tsx +++ b/modules/companies/src/web/certificate-configurations/shared/certificate.test.tsx @@ -9,12 +9,12 @@ import type { ReactNode } from "react"; import { renderToStaticMarkup } from "react-dom/server"; import { I18nextProvider } from "react-i18next"; -import { companiesEnglish, companiesSpanish } from "../i18n"; -import { profileKeys } from "../profiles/work-profile-api"; +import { companiesEnglish, companiesSpanish } from "../../shared"; +import { profileKeys } from "../../work-profiles"; +import { CertificateConfigurationsPage } from "../list"; -import { certificateKeys } from "./certificate-api"; -import { CertificateConfigurationForm } from "./certificate-configuration-form"; -import { CertificateConfigurationsPage } from "./certificate-configurations-page"; +import { certificateKeys } from "./api"; +import { CertificateConfigurationForm } from "./ui"; const company = { id: "0199b200-0000-7000-8000-000000000001", diff --git a/modules/companies/src/web/certificate-configurations/shared/index.ts b/modules/companies/src/web/certificate-configurations/shared/index.ts new file mode 100644 index 0000000..5407e67 --- /dev/null +++ b/modules/companies/src/web/certificate-configurations/shared/index.ts @@ -0,0 +1,2 @@ +export { certificateApi, certificateKeys } from "./api"; +export { CertificateConfigurationEditorDialog, CertificateFeedback } from "./ui"; diff --git a/modules/companies/src/web/certificates/certificate-configuration-editor-dialog.tsx b/modules/companies/src/web/certificate-configurations/shared/ui/certificate-configuration-editor-dialog.tsx similarity index 95% rename from modules/companies/src/web/certificates/certificate-configuration-editor-dialog.tsx rename to modules/companies/src/web/certificate-configurations/shared/ui/certificate-configuration-editor-dialog.tsx index af47a2b..19f174b 100644 --- a/modules/companies/src/web/certificates/certificate-configuration-editor-dialog.tsx +++ b/modules/companies/src/web/certificate-configurations/shared/ui/certificate-configuration-editor-dialog.tsx @@ -2,7 +2,7 @@ import { FormDialog } from "@repo/shadcn-ui/components/form-dialog"; import type { ComponentProps } from "react"; import { useTranslation } from "react-i18next"; -import type { CompanyDTO } from "../../common"; +import type { CompanyDTO } from "../../../../common"; import { CertificateConfigurationForm } from "./certificate-configuration-form"; diff --git a/modules/companies/src/web/certificates/certificate-configuration-form.tsx b/modules/companies/src/web/certificate-configurations/shared/ui/certificate-configuration-form.tsx similarity index 96% rename from modules/companies/src/web/certificates/certificate-configuration-form.tsx rename to modules/companies/src/web/certificate-configurations/shared/ui/certificate-configuration-form.tsx index 9be9e14..da4f1ce 100644 --- a/modules/companies/src/web/certificates/certificate-configuration-form.tsx +++ b/modules/companies/src/web/certificate-configurations/shared/ui/certificate-configuration-form.tsx @@ -13,20 +13,20 @@ import { useEffect, useId, useRef, useState } from "react"; import { useForm } from "react-hook-form"; import { useTranslation } from "react-i18next"; -import type { CompanyDTO, WorkProfileDTO } from "../../common"; +import type { CompanyDTO, WorkProfileDTO } from "../../../../common"; import type { CertificateConfigurationDTO, CertificateConfigurationInput, -} from "../../common/certificate-configurations"; +} from "../../../../common/certificate-configurations"; import { CERTIFICATE_STATE_TRANSITIONS, CertificateConfigurationInputSchema, -} from "../../common/certificate-configurations"; -import { profileApi, profileKeys } from "../profiles/work-profile-api"; +} from "../../../../common/certificate-configurations"; +import { profileApi, profileKeys } from "../../../work-profiles/shared"; +import { CertificateQuickEditor } from "../../create"; +import { certificateApi, certificateKeys } from "../api"; -import { certificateApi, certificateKeys } from "./certificate-api"; import { CertificateFeedback } from "./certificate-feedback"; -import { CertificateQuickEditor } from "./certificate-quick-editor"; export function CertificateConfigurationForm({ company, diff --git a/modules/companies/src/web/certificates/certificate-feedback.tsx b/modules/companies/src/web/certificate-configurations/shared/ui/certificate-feedback.tsx similarity index 87% rename from modules/companies/src/web/certificates/certificate-feedback.tsx rename to modules/companies/src/web/certificate-configurations/shared/ui/certificate-feedback.tsx index 99d0e8e..0c161f3 100644 --- a/modules/companies/src/web/certificates/certificate-feedback.tsx +++ b/modules/companies/src/web/certificate-configurations/shared/ui/certificate-feedback.tsx @@ -1,6 +1,6 @@ import { useTranslation } from "react-i18next"; -import { CertificateApiError } from "./certificate-api"; +import { CertificateApiError } from "../api"; export function CertificateFeedback({ error }: { error: Error | null }) { const { t } = useTranslation("companies"); return error ? ( diff --git a/modules/companies/src/web/certificate-configurations/shared/ui/index.ts b/modules/companies/src/web/certificate-configurations/shared/ui/index.ts new file mode 100644 index 0000000..1d12462 --- /dev/null +++ b/modules/companies/src/web/certificate-configurations/shared/ui/index.ts @@ -0,0 +1,3 @@ +export { CertificateConfigurationEditorDialog } from "./certificate-configuration-editor-dialog"; +export { CertificateConfigurationForm } from "./certificate-configuration-form"; +export { CertificateFeedback } from "./certificate-feedback"; diff --git a/modules/companies/src/web/api/company-logo-api.ts b/modules/companies/src/web/companies/change-logo/api/company-logo-api.ts similarity index 92% rename from modules/companies/src/web/api/company-logo-api.ts rename to modules/companies/src/web/companies/change-logo/api/company-logo-api.ts index 0bb7358..ad3eb73 100644 --- a/modules/companies/src/web/api/company-logo-api.ts +++ b/modules/companies/src/web/companies/change-logo/api/company-logo-api.ts @@ -1,6 +1,5 @@ -import { CompanyErrorResponseSchema, CompanyLogoResponseSchema } from "../../common"; - -import { CompanyApiError } from "./company-api"; +import { CompanyErrorResponseSchema, CompanyLogoResponseSchema } from "../../../../common"; +import { CompanyApiError } from "../../shared/api"; export async function saveCompanyLogo(companyId: string, logo: File | null, csrfToken: string) { const response = await fetch(`/api/companies/${companyId}/logo${logo ? "" : "/remove"}`, { method: "POST", diff --git a/modules/companies/src/web/companies/change-logo/api/index.ts b/modules/companies/src/web/companies/change-logo/api/index.ts new file mode 100644 index 0000000..1bc9953 --- /dev/null +++ b/modules/companies/src/web/companies/change-logo/api/index.ts @@ -0,0 +1 @@ +export { companyLogoUrl, saveCompanyLogo } from "./company-logo-api"; diff --git a/modules/companies/src/web/companies/change-logo/index.ts b/modules/companies/src/web/companies/change-logo/index.ts new file mode 100644 index 0000000..aa6b47a --- /dev/null +++ b/modules/companies/src/web/companies/change-logo/index.ts @@ -0,0 +1,2 @@ +export { saveCompanyLogo } from "./api"; +export { CompanyLogoField } from "./ui"; diff --git a/modules/companies/src/web/components/company-logo-field.tsx b/modules/companies/src/web/companies/change-logo/ui/company-logo-field.tsx similarity index 95% rename from modules/companies/src/web/components/company-logo-field.tsx rename to modules/companies/src/web/companies/change-logo/ui/company-logo-field.tsx index 65ecd78..ae1a882 100644 --- a/modules/companies/src/web/components/company-logo-field.tsx +++ b/modules/companies/src/web/companies/change-logo/ui/company-logo-field.tsx @@ -4,9 +4,8 @@ import { Label } from "@repo/shadcn-ui/components/label"; import { useId, useState } from "react"; import { useTranslation } from "react-i18next"; -import { COMPANY_LOGO_LIMITS, COMPANY_LOGO_TYPES } from "../../common"; - -import { CompanyAvatar } from "./company-avatar"; +import { COMPANY_LOGO_LIMITS, COMPANY_LOGO_TYPES } from "../../../../common"; +import { CompanyAvatar } from "../../shared/ui/company-avatar"; export function CompanyLogoField({ companyId, name, diff --git a/modules/companies/src/web/companies/change-logo/ui/index.ts b/modules/companies/src/web/companies/change-logo/ui/index.ts new file mode 100644 index 0000000..1e7ee72 --- /dev/null +++ b/modules/companies/src/web/companies/change-logo/ui/index.ts @@ -0,0 +1 @@ +export { CompanyLogoField } from "./company-logo-field"; diff --git a/modules/companies/src/web/companies/detail/index.ts b/modules/companies/src/web/companies/detail/index.ts new file mode 100644 index 0000000..b1bba49 --- /dev/null +++ b/modules/companies/src/web/companies/detail/index.ts @@ -0,0 +1 @@ +export { CompanyDetail } from "./ui"; diff --git a/modules/companies/src/web/components/company-detail.tsx b/modules/companies/src/web/companies/detail/ui/company-detail.tsx similarity index 96% rename from modules/companies/src/web/components/company-detail.tsx rename to modules/companies/src/web/companies/detail/ui/company-detail.tsx index 65e1c57..e894db8 100644 --- a/modules/companies/src/web/components/company-detail.tsx +++ b/modules/companies/src/web/companies/detail/ui/company-detail.tsx @@ -14,13 +14,16 @@ import type { ReactNode } from "react"; import { useState } from "react"; import { useTranslation } from "react-i18next"; -import { companyApi, companyKeys } from "../api/company-api"; +import type { CompanyTab } from "../../shared"; +import { + CompanyEditorDialog, + CompanyFeedback, + CompanyIdentity, + companyApi, + companyKeys, +} from "../../shared"; -import { CompanyEditorDialog } from "./company-editor-dialog"; -import { CompanyFeedback } from "./company-feedback"; -import { CompanyIdentity } from "./company-identity"; import { CompanySection } from "./company-section"; -import type { CompanyTab } from "./company-tab"; export function CompanyDetail({ id, diff --git a/modules/companies/src/web/components/company-inventory.tsx b/modules/companies/src/web/companies/detail/ui/company-inventory.tsx similarity index 96% rename from modules/companies/src/web/components/company-inventory.tsx rename to modules/companies/src/web/companies/detail/ui/company-inventory.tsx index 3823616..0c6d95f 100644 --- a/modules/companies/src/web/components/company-inventory.tsx +++ b/modules/companies/src/web/companies/detail/ui/company-inventory.tsx @@ -1,7 +1,7 @@ import { AssetInventoryPage, WorkstationsPage } from "@metis/assets/client"; import { useState } from "react"; -import type { CompanyDTO } from "../../common"; +import type { CompanyDTO } from "../../../../common"; import { InventoryQuickCreateDialog } from "./inventory-quick-create-dialog"; export function CompanyInventory({ diff --git a/modules/companies/src/web/components/company-section.tsx b/modules/companies/src/web/companies/detail/ui/company-section.tsx similarity index 71% rename from modules/companies/src/web/components/company-section.tsx rename to modules/companies/src/web/companies/detail/ui/company-section.tsx index 18a524d..8d4f1d7 100644 --- a/modules/companies/src/web/components/company-section.tsx +++ b/modules/companies/src/web/companies/detail/ui/company-section.tsx @@ -1,27 +1,27 @@ import { AssetCatalogPage } from "@metis/assets/client"; import { ResourceCatalogPage, ResourcesPage } from "@metis/resources/client"; -import type { CompanyDTO } from "../../common"; -import { AccessWorkspacePage } from "../access/access-workspace"; -import { ApplicationConfigurationsPage } from "../applications/application-configurations-page"; -import { CertificateConfigurationsPage } from "../certificates/certificate-configurations-page"; -import { FolderMappingsPage } from "../folders/folder-mappings-page"; -import { InterventionTemplatesPage } from "../intervention-templates/templates-page"; -import { InterventionsPage } from "../interventions/interventions-page"; -import { MailConfigurationsPage } from "../mail/mail-configurations-page"; -import { MailboxRelations } from "../mail/mailbox-relations"; -import { PrinterConfigurationsPage } from "../printers/printer-configurations-page"; -import { ProcessesPage } from "../processes/processes-page"; -import { WorkProfilesPage } from "../profiles/work-profiles-page"; -import { RemoteConnectionsPage } from "../remote/remote-connections-page"; -import { TeleworkAuthorizationsPage } from "../telework/telework-authorizations-page"; -import { TicketsPage } from "../tickets/tickets-page"; +import type { CompanyDTO } from "../../../../common"; +import { AccessWorkspacePage } from "../../../access"; +import { ApplicationConfigurationsPage } from "../../../application-configurations"; +import { CertificateConfigurationsPage } from "../../../certificate-configurations"; +import { DepartmentSection } from "../../../departments"; +import { FolderMappingsPage } from "../../../folder-mappings"; +import { InterventionTemplatesPage } from "../../../intervention-templates"; +import { InterventionsPage } from "../../../interventions"; +import { MailConfigurationsPage } from "../../../mail-configurations"; +import { MailboxRelations } from "../../../mailboxes"; +import { PeopleSection } from "../../../people"; +import { PrinterConfigurationsPage } from "../../../printer-configurations"; +import { ProcessesPage } from "../../../processes"; +import { RemoteConnectionsPage } from "../../../remote-connections"; +import { SiteSection } from "../../../sites"; +import { TeleworkAuthorizationsPage } from "../../../telework-authorizations"; +import { TicketsPage } from "../../../tickets"; +import { WorkProfilesPage } from "../../../work-profiles"; +import type { CompanyTab } from "../../shared"; import { CompanyInventory } from "./company-inventory"; -import type { CompanyTab } from "./company-tab"; -import { DepartmentSection } from "./department-section"; -import { PeopleSection } from "./people-section"; -import { SiteSection } from "./site-section"; export function CompanySection({ company, diff --git a/modules/companies/src/web/companies/detail/ui/index.ts b/modules/companies/src/web/companies/detail/ui/index.ts new file mode 100644 index 0000000..f984121 --- /dev/null +++ b/modules/companies/src/web/companies/detail/ui/index.ts @@ -0,0 +1 @@ +export { CompanyDetail } from "./company-detail"; diff --git a/modules/companies/src/web/components/inventory-quick-create-dialog.tsx b/modules/companies/src/web/companies/detail/ui/inventory-quick-create-dialog.tsx similarity index 93% rename from modules/companies/src/web/components/inventory-quick-create-dialog.tsx rename to modules/companies/src/web/companies/detail/ui/inventory-quick-create-dialog.tsx index 7d6884f..1a89c4b 100644 --- a/modules/companies/src/web/components/inventory-quick-create-dialog.tsx +++ b/modules/companies/src/web/companies/detail/ui/inventory-quick-create-dialog.tsx @@ -1,8 +1,8 @@ import { FormDialog } from "@repo/shadcn-ui/components/form-dialog"; import { useTranslation } from "react-i18next"; -import { PersonForm } from "./person-form"; -import { SiteForm } from "./site-form"; +import { PersonForm } from "../../../people"; +import { SiteForm } from "../../../sites"; export function InventoryQuickCreateDialog({ companyId, diff --git a/modules/companies/src/web/companies/index.ts b/modules/companies/src/web/companies/index.ts new file mode 100644 index 0000000..63b5467 --- /dev/null +++ b/modules/companies/src/web/companies/index.ts @@ -0,0 +1,12 @@ +export { CompanyDetail } from "./detail"; +export { CompaniesPage } from "./list"; +export { + CompanyAvatar, + CompanyEditorDialog, + CompanyFeedback, + CompanyForm, + CompanyIdentity, + CompanySelect, + companyApi, + companyKeys, +} from "./shared"; diff --git a/modules/companies/src/web/companies/list/index.ts b/modules/companies/src/web/companies/list/index.ts new file mode 100644 index 0000000..f78818a --- /dev/null +++ b/modules/companies/src/web/companies/list/index.ts @@ -0,0 +1 @@ +export { CompaniesPage } from "./ui"; diff --git a/modules/companies/src/web/components/companies-page.tsx b/modules/companies/src/web/companies/list/ui/companies-page.tsx similarity index 94% rename from modules/companies/src/web/components/companies-page.tsx rename to modules/companies/src/web/companies/list/ui/companies-page.tsx index e233c81..c311e9e 100644 --- a/modules/companies/src/web/components/companies-page.tsx +++ b/modules/companies/src/web/companies/list/ui/companies-page.tsx @@ -12,13 +12,15 @@ import { getCoreRowModel, getFilteredRowModel, useReactTable } from "@tanstack/r import { useState } from "react"; import { useTranslation } from "react-i18next"; -import type { CompanySummaryDTO } from "../../common"; -import { companyApi, companyKeys } from "../api/company-api"; - -import { CompanyDetail } from "./company-detail"; -import { CompanyEditorDialog } from "./company-editor-dialog"; -import { CompanyFeedback } from "./company-feedback"; -import { CompanyIdentity } from "./company-identity"; +import type { CompanySummaryDTO } from "../../../../common"; +import { CompanyDetail } from "../../detail"; +import { + CompanyEditorDialog, + CompanyFeedback, + CompanyIdentity, + companyApi, + companyKeys, +} from "../../shared"; const EMPTY_COMPANIES: CompanySummaryDTO[] = []; const COMPANY_COLUMNS: ColumnDef[] = [ diff --git a/modules/companies/src/web/companies/list/ui/index.ts b/modules/companies/src/web/companies/list/ui/index.ts new file mode 100644 index 0000000..557c9e8 --- /dev/null +++ b/modules/companies/src/web/companies/list/ui/index.ts @@ -0,0 +1 @@ +export { CompaniesPage } from "./companies-page"; diff --git a/modules/companies/src/web/api/company-api.ts b/modules/companies/src/web/companies/shared/api/company-api.ts similarity index 98% rename from modules/companies/src/web/api/company-api.ts rename to modules/companies/src/web/companies/shared/api/company-api.ts index 32c3e22..9b953c8 100644 --- a/modules/companies/src/web/api/company-api.ts +++ b/modules/companies/src/web/companies/shared/api/company-api.ts @@ -4,7 +4,7 @@ import { CompaniesResponseSchema, CompanyErrorResponseSchema, CompanyResponseSchema, -} from "../../common"; +} from "../../../../common"; export const companyKeys = { all: ["companies"], diff --git a/modules/companies/src/web/companies/shared/api/index.ts b/modules/companies/src/web/companies/shared/api/index.ts new file mode 100644 index 0000000..4000eb6 --- /dev/null +++ b/modules/companies/src/web/companies/shared/api/index.ts @@ -0,0 +1 @@ +export { CompanyApiError, companyApi, companyKeys } from "./company-api"; diff --git a/modules/companies/src/web/components/companies-page.test.tsx b/modules/companies/src/web/companies/shared/companies-page.test.tsx similarity index 93% rename from modules/companies/src/web/components/companies-page.test.tsx rename to modules/companies/src/web/companies/shared/companies-page.test.tsx index 40a9ab0..a36f2c1 100644 --- a/modules/companies/src/web/components/companies-page.test.tsx +++ b/modules/companies/src/web/companies/shared/companies-page.test.tsx @@ -7,14 +7,14 @@ import type { ReactNode } from "react"; import { renderToStaticMarkup } from "react-dom/server"; import { I18nextProvider } from "react-i18next"; -import { companyKeys } from "../api/company-api"; -import { companiesEnglish, companiesSpanish } from "../i18n"; +import { AssignmentForm } from "../../assignments"; +import { PersonForm } from "../../people"; +import { companiesEnglish, companiesSpanish } from "../../shared"; +import { SiteForm } from "../../sites"; +import { CompanyDetail } from "../detail"; +import { CompaniesPage } from "../list"; -import { AssignmentForm } from "./assignment-form"; -import { CompaniesPage } from "./companies-page"; -import { CompanyDetail } from "./company-detail"; -import { PersonForm } from "./person-form"; -import { SiteForm } from "./site-form"; +import { companyKeys } from "./api"; const companyId = "e0420eb9-2aab-4368-96a0-2ce83dd23eb4"; async function renderPage( diff --git a/modules/companies/src/web/components/company-avatar.test.tsx b/modules/companies/src/web/companies/shared/company-avatar.test.tsx similarity index 94% rename from modules/companies/src/web/components/company-avatar.test.tsx rename to modules/companies/src/web/companies/shared/company-avatar.test.tsx index 853e81d..f159a8f 100644 --- a/modules/companies/src/web/components/company-avatar.test.tsx +++ b/modules/companies/src/web/companies/shared/company-avatar.test.tsx @@ -4,9 +4,8 @@ import { test } from "node:test"; import { QueryClient, QueryClientProvider } from "@tanstack/react-query"; import { renderToStaticMarkup } from "react-dom/server"; -import { companyKeys } from "../api/company-api"; - -import { CompanyAvatar } from "./company-avatar"; +import { companyKeys } from "./api"; +import { CompanyAvatar } from "./ui"; const companyId = "0199b200-0000-7000-8000-000000000001"; const version = "a".repeat(64); diff --git a/modules/companies/src/web/companies/shared/index.ts b/modules/companies/src/web/companies/shared/index.ts new file mode 100644 index 0000000..973efe4 --- /dev/null +++ b/modules/companies/src/web/companies/shared/index.ts @@ -0,0 +1,10 @@ +export { companyApi, companyKeys } from "./api"; +export type { CompanyTab } from "./types"; +export { + CompanyAvatar, + CompanyEditorDialog, + CompanyFeedback, + CompanyForm, + CompanyIdentity, + CompanySelect, +} from "./ui"; diff --git a/modules/companies/src/web/components/company-tab.ts b/modules/companies/src/web/companies/shared/types/company-tab.ts similarity index 100% rename from modules/companies/src/web/components/company-tab.ts rename to modules/companies/src/web/companies/shared/types/company-tab.ts diff --git a/modules/companies/src/web/companies/shared/types/index.ts b/modules/companies/src/web/companies/shared/types/index.ts new file mode 100644 index 0000000..398d5df --- /dev/null +++ b/modules/companies/src/web/companies/shared/types/index.ts @@ -0,0 +1 @@ +export type { CompanyTab } from "./company-tab"; diff --git a/modules/companies/src/web/components/company-avatar.tsx b/modules/companies/src/web/companies/shared/ui/company-avatar.tsx similarity index 90% rename from modules/companies/src/web/components/company-avatar.tsx rename to modules/companies/src/web/companies/shared/ui/company-avatar.tsx index 792d581..d40fa3f 100644 --- a/modules/companies/src/web/components/company-avatar.tsx +++ b/modules/companies/src/web/companies/shared/ui/company-avatar.tsx @@ -3,10 +3,9 @@ import { useQuery } from "@tanstack/react-query"; import type { ComponentProps } from "react"; import { useState } from "react"; -import { companyApi, companyKeys } from "../api/company-api"; -import { companyLogoUrl } from "../api/company-logo-api"; - -import { InitialsAvatar } from "./initials-avatar"; +import { InitialsAvatar } from "../../../shared/ui/initials-avatar"; +import { companyLogoUrl } from "../../change-logo/api"; +import { companyApi, companyKeys } from "../api"; export type CompanyAvatarProps = Omit, "children"> & { companyId?: string | undefined; diff --git a/modules/companies/src/web/components/company-editor-dialog.tsx b/modules/companies/src/web/companies/shared/ui/company-editor-dialog.tsx similarity index 100% rename from modules/companies/src/web/components/company-editor-dialog.tsx rename to modules/companies/src/web/companies/shared/ui/company-editor-dialog.tsx diff --git a/modules/companies/src/web/components/company-feedback.tsx b/modules/companies/src/web/companies/shared/ui/company-feedback.tsx similarity index 93% rename from modules/companies/src/web/components/company-feedback.tsx rename to modules/companies/src/web/companies/shared/ui/company-feedback.tsx index d322df9..fc7bb27 100644 --- a/modules/companies/src/web/components/company-feedback.tsx +++ b/modules/companies/src/web/companies/shared/ui/company-feedback.tsx @@ -1,6 +1,6 @@ import { useTranslation } from "react-i18next"; -import { CompanyApiError } from "../api/company-api"; +import { CompanyApiError } from "../api"; export function CompanyFeedback({ error, diff --git a/modules/companies/src/web/components/company-form.tsx b/modules/companies/src/web/companies/shared/ui/company-form.tsx similarity index 93% rename from modules/companies/src/web/components/company-form.tsx rename to modules/companies/src/web/companies/shared/ui/company-form.tsx index f8cc317..f6746c5 100644 --- a/modules/companies/src/web/components/company-form.tsx +++ b/modules/companies/src/web/companies/shared/ui/company-form.tsx @@ -9,14 +9,13 @@ import { useId, useState } from "react"; import { useForm } from "react-hook-form"; import { useTranslation } from "react-i18next"; -import type { CompanyRequestDTO, CompanySummaryDTO } from "../../common"; -import { CompanyRequestSchema } from "../../common"; -import { EntityHelp } from "../access/entity-help"; -import { companyApi, companyKeys } from "../api/company-api"; -import { saveCompanyLogo } from "../api/company-logo-api"; +import type { CompanyRequestDTO, CompanySummaryDTO } from "../../../../common"; +import { CompanyRequestSchema } from "../../../../common"; +import { EntityHelp } from "../../../access/help"; +import { CompanyLogoField, saveCompanyLogo } from "../../change-logo"; +import { companyApi, companyKeys } from "../api"; import { CompanyFeedback } from "./company-feedback"; -import { CompanyLogoField } from "./company-logo-field"; export function CompanyForm({ company, diff --git a/modules/companies/src/web/components/company-identity.tsx b/modules/companies/src/web/companies/shared/ui/company-identity.tsx similarity index 100% rename from modules/companies/src/web/components/company-identity.tsx rename to modules/companies/src/web/companies/shared/ui/company-identity.tsx diff --git a/modules/companies/src/web/components/company-select.tsx b/modules/companies/src/web/companies/shared/ui/company-select.tsx similarity index 100% rename from modules/companies/src/web/components/company-select.tsx rename to modules/companies/src/web/companies/shared/ui/company-select.tsx diff --git a/modules/companies/src/web/companies/shared/ui/index.ts b/modules/companies/src/web/companies/shared/ui/index.ts new file mode 100644 index 0000000..e1c49e5 --- /dev/null +++ b/modules/companies/src/web/companies/shared/ui/index.ts @@ -0,0 +1,6 @@ +export { CompanyAvatar } from "./company-avatar"; +export { CompanyEditorDialog } from "./company-editor-dialog"; +export { CompanyFeedback } from "./company-feedback"; +export { CompanyForm } from "./company-form"; +export { CompanyIdentity } from "./company-identity"; +export { CompanySelect } from "./company-select"; diff --git a/modules/companies/src/web/dashboard/create/index.ts b/modules/companies/src/web/dashboard/create/index.ts new file mode 100644 index 0000000..ff59d4a --- /dev/null +++ b/modules/companies/src/web/dashboard/create/index.ts @@ -0,0 +1 @@ +export { DashboardQuickCreate } from "./ui"; diff --git a/modules/companies/src/web/components/dashboard-quick-create.tsx b/modules/companies/src/web/dashboard/create/ui/dashboard-quick-create.tsx similarity index 88% rename from modules/companies/src/web/components/dashboard-quick-create.tsx rename to modules/companies/src/web/dashboard/create/ui/dashboard-quick-create.tsx index c492280..c0cb9ff 100644 --- a/modules/companies/src/web/components/dashboard-quick-create.tsx +++ b/modules/companies/src/web/dashboard/create/ui/dashboard-quick-create.tsx @@ -5,16 +5,11 @@ import { useQuery, useQueryClient } from "@tanstack/react-query"; import { useState } from "react"; import { useTranslation } from "react-i18next"; -import { companyApi, companyKeys } from "../api/company-api"; -import { interventionApi, interventionKeys } from "../interventions/intervention-api"; -import { InterventionForm } from "../interventions/intervention-form"; -import { ticketApi, ticketKeys } from "../tickets/ticket-api"; -import { TicketForm } from "../tickets/ticket-form"; - -import { CompanyEditorDialog } from "./company-editor-dialog"; -import { CompanyForm } from "./company-form"; -import type { DashboardNavigation } from "./dashboard-api"; -import { BlockState } from "./dashboard-block"; +import { CompanyEditorDialog, CompanyForm, companyApi, companyKeys } from "../../../companies"; +import { InterventionForm, interventionApi, interventionKeys } from "../../../interventions"; +import { TicketForm, ticketApi, ticketKeys } from "../../../tickets"; +import type { DashboardNavigation } from "../../shared"; +import { BlockState } from "../../shared"; export function DashboardQuickCreate({ kind, diff --git a/modules/companies/src/web/dashboard/create/ui/index.ts b/modules/companies/src/web/dashboard/create/ui/index.ts new file mode 100644 index 0000000..9baaf2b --- /dev/null +++ b/modules/companies/src/web/dashboard/create/ui/index.ts @@ -0,0 +1 @@ +export { DashboardQuickCreate } from "./dashboard-quick-create"; diff --git a/modules/companies/src/web/dashboard/detail/index.ts b/modules/companies/src/web/dashboard/detail/index.ts new file mode 100644 index 0000000..99774b3 --- /dev/null +++ b/modules/companies/src/web/dashboard/detail/index.ts @@ -0,0 +1 @@ +export { DashboardDetailsDialog } from "./ui"; diff --git a/modules/companies/src/web/components/dashboard-details-dialog.tsx b/modules/companies/src/web/dashboard/detail/ui/dashboard-details-dialog.tsx similarity index 94% rename from modules/companies/src/web/components/dashboard-details-dialog.tsx rename to modules/companies/src/web/dashboard/detail/ui/dashboard-details-dialog.tsx index 824a8a9..28d73bc 100644 --- a/modules/companies/src/web/components/dashboard-details-dialog.tsx +++ b/modules/companies/src/web/dashboard/detail/ui/dashboard-details-dialog.tsx @@ -6,14 +6,17 @@ import { useQuery } from "@tanstack/react-query"; import { useState } from "react"; import { useTranslation } from "react-i18next"; -import type { DashboardIssue } from "../../common/dashboard"; - -import { CompanyIdentity } from "./company-identity"; -import type { DashboardNavigation } from "./dashboard-api"; -import { dashboardApi, dashboardKeys, entryDestination } from "./dashboard-api"; -import { BlockState } from "./dashboard-block"; -import { DashboardNavigationButton } from "./dashboard-navigation-button"; -import { DashboardTable } from "./dashboard-table"; +import type { DashboardIssue } from "../../../../common/dashboard"; +import { CompanyIdentity } from "../../../companies"; +import type { DashboardNavigation } from "../../shared"; +import { + BlockState, + DashboardNavigationButton, + DashboardTable, + dashboardApi, + dashboardKeys, + entryDestination, +} from "../../shared"; export function DashboardDetailsDialog({ companyId, diff --git a/modules/companies/src/web/dashboard/detail/ui/index.ts b/modules/companies/src/web/dashboard/detail/ui/index.ts new file mode 100644 index 0000000..aed829c --- /dev/null +++ b/modules/companies/src/web/dashboard/detail/ui/index.ts @@ -0,0 +1 @@ +export { DashboardDetailsDialog } from "./dashboard-details-dialog"; diff --git a/modules/companies/src/web/dashboard/index.ts b/modules/companies/src/web/dashboard/index.ts new file mode 100644 index 0000000..913899e --- /dev/null +++ b/modules/companies/src/web/dashboard/index.ts @@ -0,0 +1,9 @@ +export type { DashboardNavigation } from "./shared"; +export { + DashboardNavigationButton, + DashboardStateBadge, + DashboardTable, + dashboardKeys, + entryDestination, +} from "./shared"; +export { DashboardPage } from "./view"; diff --git a/modules/companies/src/web/components/dashboard-api.ts b/modules/companies/src/web/dashboard/shared/api/dashboard-api.ts similarity index 96% rename from modules/companies/src/web/components/dashboard-api.ts rename to modules/companies/src/web/dashboard/shared/api/dashboard-api.ts index 13e50b9..22070b5 100644 --- a/modules/companies/src/web/components/dashboard-api.ts +++ b/modules/companies/src/web/dashboard/shared/api/dashboard-api.ts @@ -1,10 +1,10 @@ -import type { DashboardDetailsQuery } from "../../common/dashboard"; +import type { DashboardDetailsQuery } from "../../../../common/dashboard"; import { DashboardAttentionSchema, DashboardCompaniesSchema, DashboardEntriesSchema, DashboardSummarySchema, -} from "../../common/dashboard"; +} from "../../../../common/dashboard"; export const dashboardKeys = { block: (block: string, companyId?: string | undefined, page = 1, kind = "") => [ diff --git a/modules/companies/src/web/dashboard/shared/api/index.ts b/modules/companies/src/web/dashboard/shared/api/index.ts new file mode 100644 index 0000000..51773aa --- /dev/null +++ b/modules/companies/src/web/dashboard/shared/api/index.ts @@ -0,0 +1,2 @@ +export type { DashboardNavigation } from "./dashboard-api"; +export { dashboardApi, dashboardKeys, entryDestination } from "./dashboard-api"; diff --git a/modules/companies/src/web/components/dashboard-kind-icons.ts b/modules/companies/src/web/dashboard/shared/helpers/dashboard-kind-icons.ts similarity index 100% rename from modules/companies/src/web/components/dashboard-kind-icons.ts rename to modules/companies/src/web/dashboard/shared/helpers/dashboard-kind-icons.ts diff --git a/modules/companies/src/web/dashboard/shared/helpers/index.ts b/modules/companies/src/web/dashboard/shared/helpers/index.ts new file mode 100644 index 0000000..aa9005f --- /dev/null +++ b/modules/companies/src/web/dashboard/shared/helpers/index.ts @@ -0,0 +1 @@ +export { KIND_ICONS } from "./dashboard-kind-icons"; diff --git a/modules/companies/src/web/dashboard/shared/index.ts b/modules/companies/src/web/dashboard/shared/index.ts new file mode 100644 index 0000000..d66467a --- /dev/null +++ b/modules/companies/src/web/dashboard/shared/index.ts @@ -0,0 +1,10 @@ +export type { DashboardNavigation } from "./api"; +export { dashboardApi, dashboardKeys, entryDestination } from "./api"; +export { KIND_ICONS } from "./helpers"; +export { + BlockState, + DashboardNavigationButton, + DashboardPanel, + DashboardStateBadge, + DashboardTable, +} from "./ui"; diff --git a/modules/companies/src/web/components/dashboard-block.tsx b/modules/companies/src/web/dashboard/shared/ui/dashboard-block.tsx similarity index 100% rename from modules/companies/src/web/components/dashboard-block.tsx rename to modules/companies/src/web/dashboard/shared/ui/dashboard-block.tsx diff --git a/modules/companies/src/web/components/dashboard-navigation-button.tsx b/modules/companies/src/web/dashboard/shared/ui/dashboard-navigation-button.tsx similarity index 100% rename from modules/companies/src/web/components/dashboard-navigation-button.tsx rename to modules/companies/src/web/dashboard/shared/ui/dashboard-navigation-button.tsx diff --git a/modules/companies/src/web/components/dashboard-panel.tsx b/modules/companies/src/web/dashboard/shared/ui/dashboard-panel.tsx similarity index 100% rename from modules/companies/src/web/components/dashboard-panel.tsx rename to modules/companies/src/web/dashboard/shared/ui/dashboard-panel.tsx diff --git a/modules/companies/src/web/components/dashboard-state-badge.tsx b/modules/companies/src/web/dashboard/shared/ui/dashboard-state-badge.tsx similarity index 100% rename from modules/companies/src/web/components/dashboard-state-badge.tsx rename to modules/companies/src/web/dashboard/shared/ui/dashboard-state-badge.tsx diff --git a/modules/companies/src/web/components/dashboard-table.tsx b/modules/companies/src/web/dashboard/shared/ui/dashboard-table.tsx similarity index 100% rename from modules/companies/src/web/components/dashboard-table.tsx rename to modules/companies/src/web/dashboard/shared/ui/dashboard-table.tsx diff --git a/modules/companies/src/web/dashboard/shared/ui/index.ts b/modules/companies/src/web/dashboard/shared/ui/index.ts new file mode 100644 index 0000000..6295ea0 --- /dev/null +++ b/modules/companies/src/web/dashboard/shared/ui/index.ts @@ -0,0 +1,5 @@ +export { BlockState } from "./dashboard-block"; +export { DashboardNavigationButton } from "./dashboard-navigation-button"; +export { DashboardPanel } from "./dashboard-panel"; +export { DashboardStateBadge } from "./dashboard-state-badge"; +export { DashboardTable } from "./dashboard-table"; diff --git a/modules/companies/src/web/dashboard/view/index.ts b/modules/companies/src/web/dashboard/view/index.ts new file mode 100644 index 0000000..991cf52 --- /dev/null +++ b/modules/companies/src/web/dashboard/view/index.ts @@ -0,0 +1 @@ +export { DashboardPage } from "./ui"; diff --git a/modules/companies/src/web/components/dashboard-activity-panel.tsx b/modules/companies/src/web/dashboard/view/ui/dashboard-activity-panel.tsx similarity index 85% rename from modules/companies/src/web/components/dashboard-activity-panel.tsx rename to modules/companies/src/web/dashboard/view/ui/dashboard-activity-panel.tsx index ebc6a2c..3f59a71 100644 --- a/modules/companies/src/web/components/dashboard-activity-panel.tsx +++ b/modules/companies/src/web/dashboard/view/ui/dashboard-activity-panel.tsx @@ -2,13 +2,17 @@ import { ClockIcon } from "@repo/shadcn-ui/lib/icons"; import { useQuery } from "@tanstack/react-query"; import { useTranslation } from "react-i18next"; -import { CompanyIdentity } from "./company-identity"; -import type { DashboardNavigation } from "./dashboard-api"; -import { dashboardApi, dashboardKeys, entryDestination } from "./dashboard-api"; -import { BlockState } from "./dashboard-block"; -import { KIND_ICONS } from "./dashboard-kind-icons"; -import { DashboardNavigationButton } from "./dashboard-navigation-button"; -import { DashboardPanel } from "./dashboard-panel"; +import { CompanyIdentity } from "../../../companies"; +import type { DashboardNavigation } from "../../shared"; +import { + BlockState, + DashboardNavigationButton, + DashboardPanel, + KIND_ICONS, + dashboardApi, + dashboardKeys, + entryDestination, +} from "../../shared"; export function DashboardActivityPanel({ companyId, onDetails, diff --git a/modules/companies/src/web/components/dashboard-attention-panel.tsx b/modules/companies/src/web/dashboard/view/ui/dashboard-attention-panel.tsx similarity index 91% rename from modules/companies/src/web/components/dashboard-attention-panel.tsx rename to modules/companies/src/web/dashboard/view/ui/dashboard-attention-panel.tsx index deab31e..b53e7fc 100644 --- a/modules/companies/src/web/components/dashboard-attention-panel.tsx +++ b/modules/companies/src/web/dashboard/view/ui/dashboard-attention-panel.tsx @@ -9,11 +9,8 @@ import { import { useQuery } from "@tanstack/react-query"; import { useTranslation } from "react-i18next"; -import type { DashboardIssue } from "../../common/dashboard"; - -import { dashboardApi, dashboardKeys } from "./dashboard-api"; -import { BlockState } from "./dashboard-block"; -import { DashboardPanel } from "./dashboard-panel"; +import type { DashboardIssue } from "../../../../common/dashboard"; +import { BlockState, DashboardPanel, dashboardApi, dashboardKeys } from "../../shared"; const ISSUE_ICONS = { certificate: FileKeyIcon, diff --git a/modules/companies/src/web/components/dashboard-companies-panel.tsx b/modules/companies/src/web/dashboard/view/ui/dashboard-companies-panel.tsx similarity index 90% rename from modules/companies/src/web/components/dashboard-companies-panel.tsx rename to modules/companies/src/web/dashboard/view/ui/dashboard-companies-panel.tsx index 1ad30f3..cdbb592 100644 --- a/modules/companies/src/web/components/dashboard-companies-panel.tsx +++ b/modules/companies/src/web/dashboard/view/ui/dashboard-companies-panel.tsx @@ -2,13 +2,16 @@ import { Building2Icon } from "@repo/shadcn-ui/lib/icons"; import { useQuery } from "@tanstack/react-query"; import { useTranslation } from "react-i18next"; -import { CompanyIdentity } from "./company-identity"; -import type { DashboardNavigation } from "./dashboard-api"; -import { dashboardApi, dashboardKeys } from "./dashboard-api"; -import { BlockState } from "./dashboard-block"; -import { DashboardNavigationButton } from "./dashboard-navigation-button"; -import { DashboardPanel } from "./dashboard-panel"; -import { DashboardTable } from "./dashboard-table"; +import { CompanyIdentity } from "../../../companies"; +import type { DashboardNavigation } from "../../shared"; +import { + BlockState, + DashboardNavigationButton, + DashboardPanel, + DashboardTable, + dashboardApi, + dashboardKeys, +} from "../../shared"; export function DashboardCompaniesPanel({ companyId, onDetails, diff --git a/modules/companies/src/web/components/dashboard-page.tsx b/modules/companies/src/web/dashboard/view/ui/dashboard-page.tsx similarity index 90% rename from modules/companies/src/web/components/dashboard-page.tsx rename to modules/companies/src/web/dashboard/view/ui/dashboard-page.tsx index ace8b27..4055525 100644 --- a/modules/companies/src/web/components/dashboard-page.tsx +++ b/modules/companies/src/web/dashboard/view/ui/dashboard-page.tsx @@ -5,18 +5,15 @@ import type { ComponentProps } from "react"; import { useState } from "react"; import { useTranslation } from "react-i18next"; -import { companyApi, companyKeys } from "../api/company-api"; +import { CompanySelect, companyApi, companyKeys } from "../../../companies"; +import { DashboardQuickCreate } from "../../create"; +import { DashboardDetailsDialog } from "../../detail"; +import type { DashboardNavigation } from "../../shared"; +import { DashboardPanel, KIND_ICONS, dashboardApi, dashboardKeys } from "../../shared"; -import { CompanySelect } from "./company-select"; import { DashboardActivityPanel } from "./dashboard-activity-panel"; -import type { DashboardNavigation } from "./dashboard-api"; -import { dashboardApi, dashboardKeys } from "./dashboard-api"; import { DashboardAttentionPanel } from "./dashboard-attention-panel"; import { DashboardCompaniesPanel } from "./dashboard-companies-panel"; -import { DashboardDetailsDialog } from "./dashboard-details-dialog"; -import { KIND_ICONS } from "./dashboard-kind-icons"; -import { DashboardPanel } from "./dashboard-panel"; -import { DashboardQuickCreate } from "./dashboard-quick-create"; import { DashboardStatistics } from "./dashboard-statistics"; import { DashboardWorkPanel } from "./dashboard-work-panel"; diff --git a/modules/companies/src/web/components/dashboard-statistics.tsx b/modules/companies/src/web/dashboard/view/ui/dashboard-statistics.tsx similarity index 94% rename from modules/companies/src/web/components/dashboard-statistics.tsx rename to modules/companies/src/web/dashboard/view/ui/dashboard-statistics.tsx index e2c8706..e1272dd 100644 --- a/modules/companies/src/web/components/dashboard-statistics.tsx +++ b/modules/companies/src/web/dashboard/view/ui/dashboard-statistics.tsx @@ -9,9 +9,8 @@ import { import type { UseQueryResult } from "@tanstack/react-query"; import { useTranslation } from "react-i18next"; -import type { DashboardSummaryDTO } from "../../common/dashboard"; - -import type { DashboardNavigation } from "./dashboard-api"; +import type { DashboardSummaryDTO } from "../../../../common/dashboard"; +import type { DashboardNavigation } from "../../shared"; export function DashboardStatistics({ scope, summary, diff --git a/modules/companies/src/web/components/dashboard-work-panel.tsx b/modules/companies/src/web/dashboard/view/ui/dashboard-work-panel.tsx similarity index 84% rename from modules/companies/src/web/components/dashboard-work-panel.tsx rename to modules/companies/src/web/dashboard/view/ui/dashboard-work-panel.tsx index 0faefa7..62215aa 100644 --- a/modules/companies/src/web/components/dashboard-work-panel.tsx +++ b/modules/companies/src/web/dashboard/view/ui/dashboard-work-panel.tsx @@ -2,15 +2,19 @@ import { TicketIcon } from "@repo/shadcn-ui/lib/icons"; import { useQuery } from "@tanstack/react-query"; import { useTranslation } from "react-i18next"; -import { CompanyIdentity } from "./company-identity"; -import type { DashboardNavigation } from "./dashboard-api"; -import { dashboardApi, dashboardKeys, entryDestination } from "./dashboard-api"; -import { BlockState } from "./dashboard-block"; -import { KIND_ICONS } from "./dashboard-kind-icons"; -import { DashboardNavigationButton } from "./dashboard-navigation-button"; -import { DashboardPanel } from "./dashboard-panel"; -import { DashboardStateBadge } from "./dashboard-state-badge"; -import { DashboardTable } from "./dashboard-table"; +import { CompanyIdentity } from "../../../companies"; +import type { DashboardNavigation } from "../../shared"; +import { + BlockState, + DashboardNavigationButton, + DashboardPanel, + DashboardStateBadge, + DashboardTable, + KIND_ICONS, + dashboardApi, + dashboardKeys, + entryDestination, +} from "../../shared"; export function DashboardWorkPanel({ companyId, onDetails, diff --git a/modules/companies/src/web/dashboard/view/ui/index.ts b/modules/companies/src/web/dashboard/view/ui/index.ts new file mode 100644 index 0000000..81edd61 --- /dev/null +++ b/modules/companies/src/web/dashboard/view/ui/index.ts @@ -0,0 +1 @@ +export { DashboardPage } from "./dashboard-page"; diff --git a/modules/companies/src/web/departments/index.ts b/modules/companies/src/web/departments/index.ts new file mode 100644 index 0000000..f2d399f --- /dev/null +++ b/modules/companies/src/web/departments/index.ts @@ -0,0 +1,2 @@ +export { DepartmentSection } from "./list"; +export { DepartmentEditorDialog } from "./shared"; diff --git a/modules/companies/src/web/departments/list/index.ts b/modules/companies/src/web/departments/list/index.ts new file mode 100644 index 0000000..72b7886 --- /dev/null +++ b/modules/companies/src/web/departments/list/index.ts @@ -0,0 +1 @@ +export { DepartmentSection } from "./ui"; diff --git a/modules/companies/src/web/components/department-section.tsx b/modules/companies/src/web/departments/list/ui/department-section.tsx similarity index 95% rename from modules/companies/src/web/components/department-section.tsx rename to modules/companies/src/web/departments/list/ui/department-section.tsx index a2c208e..be30c62 100644 --- a/modules/companies/src/web/components/department-section.tsx +++ b/modules/companies/src/web/departments/list/ui/department-section.tsx @@ -9,9 +9,8 @@ import { import { useState } from "react"; import { useTranslation } from "react-i18next"; -import type { CompanyDTO } from "../../common"; - -import { DepartmentEditorDialog } from "./department-editor-dialog"; +import type { CompanyDTO } from "../../../../common"; +import { DepartmentEditorDialog } from "../../shared"; export function DepartmentSection({ company, diff --git a/modules/companies/src/web/departments/list/ui/index.ts b/modules/companies/src/web/departments/list/ui/index.ts new file mode 100644 index 0000000..4763900 --- /dev/null +++ b/modules/companies/src/web/departments/list/ui/index.ts @@ -0,0 +1 @@ +export { DepartmentSection } from "./department-section"; diff --git a/modules/companies/src/web/departments/shared/index.ts b/modules/companies/src/web/departments/shared/index.ts new file mode 100644 index 0000000..f709449 --- /dev/null +++ b/modules/companies/src/web/departments/shared/index.ts @@ -0,0 +1 @@ +export { DepartmentEditorDialog } from "./ui"; diff --git a/modules/companies/src/web/components/department-editor-dialog.tsx b/modules/companies/src/web/departments/shared/ui/department-editor-dialog.tsx similarity index 100% rename from modules/companies/src/web/components/department-editor-dialog.tsx rename to modules/companies/src/web/departments/shared/ui/department-editor-dialog.tsx diff --git a/modules/companies/src/web/components/department-form.tsx b/modules/companies/src/web/departments/shared/ui/department-form.tsx similarity index 92% rename from modules/companies/src/web/components/department-form.tsx rename to modules/companies/src/web/departments/shared/ui/department-form.tsx index b39a389..16eb8f3 100644 --- a/modules/companies/src/web/components/department-form.tsx +++ b/modules/companies/src/web/departments/shared/ui/department-form.tsx @@ -9,12 +9,10 @@ import { useEffect, useId, useRef } from "react"; import { useForm } from "react-hook-form"; import { useTranslation } from "react-i18next"; -import type { DepartmentDTO, DepartmentRequestDTO } from "../../common"; -import { DepartmentRequestSchema } from "../../common"; -import { EntityHelp } from "../access/entity-help"; -import { companyApi, companyKeys } from "../api/company-api"; - -import { CompanyFeedback } from "./company-feedback"; +import type { DepartmentDTO, DepartmentRequestDTO } from "../../../../common"; +import { DepartmentRequestSchema } from "../../../../common"; +import { EntityHelp } from "../../../access/help"; +import { CompanyFeedback, companyApi, companyKeys } from "../../../companies/shared"; export function DepartmentForm({ companyId, diff --git a/modules/companies/src/web/departments/shared/ui/index.ts b/modules/companies/src/web/departments/shared/ui/index.ts new file mode 100644 index 0000000..50300c9 --- /dev/null +++ b/modules/companies/src/web/departments/shared/ui/index.ts @@ -0,0 +1 @@ +export { DepartmentEditorDialog } from "./department-editor-dialog"; diff --git a/modules/companies/src/web/folder-mappings/create/index.ts b/modules/companies/src/web/folder-mappings/create/index.ts new file mode 100644 index 0000000..5d3d716 --- /dev/null +++ b/modules/companies/src/web/folder-mappings/create/index.ts @@ -0,0 +1 @@ +export { FolderQuickEditor } from "./ui"; diff --git a/modules/companies/src/web/folders/folder-quick-editor.tsx b/modules/companies/src/web/folder-mappings/create/ui/folder-quick-editor.tsx similarity index 92% rename from modules/companies/src/web/folders/folder-quick-editor.tsx rename to modules/companies/src/web/folder-mappings/create/ui/folder-quick-editor.tsx index 816e3c0..445e3ef 100644 --- a/modules/companies/src/web/folders/folder-quick-editor.tsx +++ b/modules/companies/src/web/folder-mappings/create/ui/folder-quick-editor.tsx @@ -1,9 +1,9 @@ import { FormDialog } from "@repo/shadcn-ui/components/form-dialog"; import { useTranslation } from "react-i18next"; -import type { AccessResponseDTO, CompanyDTO, WorkProfileDTO } from "../../common"; -import { AccessForm } from "../access/access-form"; -import { WorkProfileForm } from "../profiles/work-profile-form"; +import type { AccessResponseDTO, CompanyDTO, WorkProfileDTO } from "../../../../common"; +import { AccessForm } from "../../../access"; +import { WorkProfileForm } from "../../../work-profiles/shared"; export function FolderQuickEditor({ kind, diff --git a/modules/companies/src/web/folder-mappings/create/ui/index.ts b/modules/companies/src/web/folder-mappings/create/ui/index.ts new file mode 100644 index 0000000..cd428c0 --- /dev/null +++ b/modules/companies/src/web/folder-mappings/create/ui/index.ts @@ -0,0 +1 @@ +export { FolderQuickEditor } from "./folder-quick-editor"; diff --git a/modules/companies/src/web/folder-mappings/history/index.ts b/modules/companies/src/web/folder-mappings/history/index.ts new file mode 100644 index 0000000..7467998 --- /dev/null +++ b/modules/companies/src/web/folder-mappings/history/index.ts @@ -0,0 +1 @@ +export { FolderMappingHistoryDialog } from "./ui"; diff --git a/modules/companies/src/web/folders/folder-mapping-history-dialog.tsx b/modules/companies/src/web/folder-mappings/history/ui/folder-mapping-history-dialog.tsx similarity index 94% rename from modules/companies/src/web/folders/folder-mapping-history-dialog.tsx rename to modules/companies/src/web/folder-mappings/history/ui/folder-mapping-history-dialog.tsx index 0ab908f..ac21980 100644 --- a/modules/companies/src/web/folders/folder-mapping-history-dialog.tsx +++ b/modules/companies/src/web/folder-mappings/history/ui/folder-mapping-history-dialog.tsx @@ -1,7 +1,7 @@ import { FormDialog } from "@repo/shadcn-ui/components/form-dialog"; import { useTranslation } from "react-i18next"; -import type { FolderMappingDTO } from "../../common/folder-mappings"; +import type { FolderMappingDTO } from "../../../../common/folder-mappings"; export function FolderMappingHistoryDialog({ mapping, diff --git a/modules/companies/src/web/folder-mappings/history/ui/index.ts b/modules/companies/src/web/folder-mappings/history/ui/index.ts new file mode 100644 index 0000000..85f44ce --- /dev/null +++ b/modules/companies/src/web/folder-mappings/history/ui/index.ts @@ -0,0 +1 @@ +export { FolderMappingHistoryDialog } from "./folder-mapping-history-dialog"; diff --git a/modules/companies/src/web/folder-mappings/index.ts b/modules/companies/src/web/folder-mappings/index.ts new file mode 100644 index 0000000..e1a82a5 --- /dev/null +++ b/modules/companies/src/web/folder-mappings/index.ts @@ -0,0 +1,2 @@ +export { FolderMappingsPage } from "./list"; +export { folderApi, folderKeys } from "./shared"; diff --git a/modules/companies/src/web/folder-mappings/list/index.ts b/modules/companies/src/web/folder-mappings/list/index.ts new file mode 100644 index 0000000..9c04962 --- /dev/null +++ b/modules/companies/src/web/folder-mappings/list/index.ts @@ -0,0 +1 @@ +export { FolderMappingsPage } from "./ui"; diff --git a/modules/companies/src/web/folders/folder-mappings-page.tsx b/modules/companies/src/web/folder-mappings/list/ui/folder-mappings-page.tsx similarity index 94% rename from modules/companies/src/web/folders/folder-mappings-page.tsx rename to modules/companies/src/web/folder-mappings/list/ui/folder-mappings-page.tsx index db132e0..1771f2e 100644 --- a/modules/companies/src/web/folders/folder-mappings-page.tsx +++ b/modules/companies/src/web/folder-mappings/list/ui/folder-mappings-page.tsx @@ -10,14 +10,11 @@ import { useQuery } from "@tanstack/react-query"; import { useState } from "react"; import { useTranslation } from "react-i18next"; -import type { AccessItemDTO, CompanyDTO } from "../../common"; -import { accessApi, accessKeys } from "../access/access-api"; -import { profileApi, profileKeys } from "../profiles/work-profile-api"; - -import { folderApi, folderKeys } from "./folder-api"; -import { FolderFeedback } from "./folder-feedback"; -import { FolderMappingEditorDialog } from "./folder-mapping-editor-dialog"; -import { FolderMappingHistoryDialog } from "./folder-mapping-history-dialog"; +import type { AccessItemDTO, CompanyDTO } from "../../../../common"; +import { accessApi, accessKeys } from "../../../access"; +import { profileApi, profileKeys } from "../../../work-profiles/shared"; +import { FolderMappingHistoryDialog } from "../../history"; +import { FolderFeedback, FolderMappingEditorDialog, folderApi, folderKeys } from "../../shared"; export function FolderMappingsPage({ company, diff --git a/modules/companies/src/web/folder-mappings/list/ui/index.ts b/modules/companies/src/web/folder-mappings/list/ui/index.ts new file mode 100644 index 0000000..c316625 --- /dev/null +++ b/modules/companies/src/web/folder-mappings/list/ui/index.ts @@ -0,0 +1 @@ +export { FolderMappingsPage } from "./folder-mappings-page"; diff --git a/modules/companies/src/web/folders/folder-api.ts b/modules/companies/src/web/folder-mappings/shared/api/folder-api.ts similarity index 91% rename from modules/companies/src/web/folders/folder-api.ts rename to modules/companies/src/web/folder-mappings/shared/api/folder-api.ts index 7f2c056..c8d6f64 100644 --- a/modules/companies/src/web/folders/folder-api.ts +++ b/modules/companies/src/web/folder-mappings/shared/api/folder-api.ts @@ -1,10 +1,10 @@ import { z } from "zod/v4"; -import type { FolderMappingInput } from "../../common/folder-mappings"; +import type { FolderMappingInput } from "../../../../common/folder-mappings"; import { FolderMappingResponseSchema, FolderMappingsResponseSchema, -} from "../../common/folder-mappings"; +} from "../../../../common/folder-mappings"; export class FolderApiError extends Error { constructor(public readonly code: string) { super(code); diff --git a/modules/companies/src/web/folder-mappings/shared/api/index.ts b/modules/companies/src/web/folder-mappings/shared/api/index.ts new file mode 100644 index 0000000..5d9b97e --- /dev/null +++ b/modules/companies/src/web/folder-mappings/shared/api/index.ts @@ -0,0 +1 @@ +export { FolderApiError, folderApi, folderKeys } from "./folder-api"; diff --git a/modules/companies/src/web/folder-mappings/shared/index.ts b/modules/companies/src/web/folder-mappings/shared/index.ts new file mode 100644 index 0000000..a8fb54d --- /dev/null +++ b/modules/companies/src/web/folder-mappings/shared/index.ts @@ -0,0 +1,2 @@ +export { folderApi, folderKeys } from "./api"; +export { FolderFeedback, FolderMappingEditorDialog } from "./ui"; diff --git a/modules/companies/src/web/folders/folder-feedback.tsx b/modules/companies/src/web/folder-mappings/shared/ui/folder-feedback.tsx similarity index 88% rename from modules/companies/src/web/folders/folder-feedback.tsx rename to modules/companies/src/web/folder-mappings/shared/ui/folder-feedback.tsx index 616c328..ba2c1a4 100644 --- a/modules/companies/src/web/folders/folder-feedback.tsx +++ b/modules/companies/src/web/folder-mappings/shared/ui/folder-feedback.tsx @@ -1,6 +1,6 @@ import { useTranslation } from "react-i18next"; -import { FolderApiError } from "./folder-api"; +import { FolderApiError } from "../api"; export function FolderFeedback({ error }: { error: unknown }) { const { t } = useTranslation("companies"); return error ? ( diff --git a/modules/companies/src/web/folders/folder-mapping-editor-dialog.tsx b/modules/companies/src/web/folder-mappings/shared/ui/folder-mapping-editor-dialog.tsx similarity index 95% rename from modules/companies/src/web/folders/folder-mapping-editor-dialog.tsx rename to modules/companies/src/web/folder-mappings/shared/ui/folder-mapping-editor-dialog.tsx index b442884..0e75d17 100644 --- a/modules/companies/src/web/folders/folder-mapping-editor-dialog.tsx +++ b/modules/companies/src/web/folder-mappings/shared/ui/folder-mapping-editor-dialog.tsx @@ -2,7 +2,7 @@ import { FormDialog } from "@repo/shadcn-ui/components/form-dialog"; import type { ComponentProps } from "react"; import { useTranslation } from "react-i18next"; -import type { CompanyDTO } from "../../common"; +import type { CompanyDTO } from "../../../../common"; import { FolderMappingForm } from "./folder-mapping-form"; diff --git a/modules/companies/src/web/folders/folder-mapping-form.tsx b/modules/companies/src/web/folder-mappings/shared/ui/folder-mapping-form.tsx similarity index 95% rename from modules/companies/src/web/folders/folder-mapping-form.tsx rename to modules/companies/src/web/folder-mappings/shared/ui/folder-mapping-form.tsx index 4ae8496..17e4ec1 100644 --- a/modules/companies/src/web/folders/folder-mapping-form.tsx +++ b/modules/companies/src/web/folder-mappings/shared/ui/folder-mapping-form.tsx @@ -11,16 +11,19 @@ import { useEffect, useId, useRef, useState } from "react"; import { useForm } from "react-hook-form"; import { useTranslation } from "react-i18next"; -import type { AccessItemDTO, AccessResponseDTO, CompanyDTO } from "../../common"; -import type { FolderMappingDTO, FolderMappingInput } from "../../common/folder-mappings"; -import { FOLDER_STATE_TRANSITIONS, FolderMappingInputSchema } from "../../common/folder-mappings"; -import { accessApi, accessKeys } from "../access/access-api"; -import { profileApi, profileKeys } from "../profiles/work-profile-api"; +import type { AccessItemDTO, AccessResponseDTO, CompanyDTO } from "../../../../common"; +import type { FolderMappingDTO, FolderMappingInput } from "../../../../common/folder-mappings"; +import { + FOLDER_STATE_TRANSITIONS, + FolderMappingInputSchema, +} from "../../../../common/folder-mappings"; +import { accessApi, accessKeys } from "../../../access"; +import { profileApi, profileKeys } from "../../../work-profiles/shared"; +import { FolderQuickEditor } from "../../create"; +import { folderApi, folderKeys } from "../api"; -import { folderApi, folderKeys } from "./folder-api"; import { FolderFeedback } from "./folder-feedback"; import { FolderMappingTargets } from "./folder-mapping-targets"; -import { FolderQuickEditor } from "./folder-quick-editor"; export function FolderMappingForm({ company, diff --git a/modules/companies/src/web/folders/folder-mapping-targets.tsx b/modules/companies/src/web/folder-mappings/shared/ui/folder-mapping-targets.tsx similarity index 90% rename from modules/companies/src/web/folders/folder-mapping-targets.tsx rename to modules/companies/src/web/folder-mappings/shared/ui/folder-mapping-targets.tsx index ea3ac6b..7de394a 100644 --- a/modules/companies/src/web/folders/folder-mapping-targets.tsx +++ b/modules/companies/src/web/folder-mappings/shared/ui/folder-mapping-targets.tsx @@ -3,10 +3,10 @@ import { SelectWithAction } from "@repo/shadcn-ui/components/select-with-action" import type { UseFormReturn } from "react-hook-form"; import { useTranslation } from "react-i18next"; -import type { AccessItemDTO, CompanyDTO } from "../../common"; -import type { FolderMappingInput } from "../../common/folder-mappings"; -import type { WorkProfileDTO } from "../../common/work-profiles"; -import { accessLabel } from "../access/access-labels"; +import type { AccessItemDTO, CompanyDTO } from "../../../../common"; +import type { FolderMappingInput } from "../../../../common/folder-mappings"; +import type { WorkProfileDTO } from "../../../../common/work-profiles"; +import { accessLabel } from "../../../access"; export function FolderMappingTargets({ prefix, diff --git a/modules/companies/src/web/folder-mappings/shared/ui/index.ts b/modules/companies/src/web/folder-mappings/shared/ui/index.ts new file mode 100644 index 0000000..ec776c6 --- /dev/null +++ b/modules/companies/src/web/folder-mappings/shared/ui/index.ts @@ -0,0 +1,2 @@ +export { FolderFeedback } from "./folder-feedback"; +export { FolderMappingEditorDialog } from "./folder-mapping-editor-dialog"; diff --git a/modules/companies/src/web/i18n.ts b/modules/companies/src/web/i18n.ts deleted file mode 100644 index 5c7f424..0000000 --- a/modules/companies/src/web/i18n.ts +++ /dev/null @@ -1,5 +0,0 @@ -import english from "../common/locales/en.json"; -import spanish from "../common/locales/es.json"; - -export const companiesEnglish = english.companies; -export const companiesSpanish = spanish.companies; diff --git a/modules/companies/src/web/index.ts b/modules/companies/src/web/index.ts index ee1ed93..682d82b 100644 --- a/modules/companies/src/web/index.ts +++ b/modules/companies/src/web/index.ts @@ -1,6 +1,4 @@ -export { AccessWorkspacePage } from "./access/access-workspace"; -export { accessEnglish, accessSpanish } from "./access/i18n"; -export { companyKeys } from "./api/company-api"; -export { CompaniesPage } from "./components/companies-page"; -export { CompaniesWorkspace } from "./components/companies-workspace"; -export { companiesEnglish, companiesSpanish } from "./i18n"; +export { AccessWorkspacePage, accessEnglish, accessSpanish } from "./access"; +export { CompaniesPage, companyKeys } from "./companies"; +export { companiesEnglish, companiesSpanish } from "./shared"; +export { CompaniesWorkspace } from "./workspace"; diff --git a/modules/companies/src/web/intervention-templates/create/index.ts b/modules/companies/src/web/intervention-templates/create/index.ts new file mode 100644 index 0000000..c5a4bfe --- /dev/null +++ b/modules/companies/src/web/intervention-templates/create/index.ts @@ -0,0 +1 @@ +export { InterventionTemplateCreateDialog } from "./ui"; diff --git a/modules/companies/src/web/intervention-templates/create/ui/index.ts b/modules/companies/src/web/intervention-templates/create/ui/index.ts new file mode 100644 index 0000000..9e1f8cc --- /dev/null +++ b/modules/companies/src/web/intervention-templates/create/ui/index.ts @@ -0,0 +1 @@ +export { InterventionTemplateCreateDialog } from "./intervention-template-create-dialog"; diff --git a/modules/companies/src/web/interventions/intervention-template-create-dialog.tsx b/modules/companies/src/web/intervention-templates/create/ui/intervention-template-create-dialog.tsx similarity index 90% rename from modules/companies/src/web/interventions/intervention-template-create-dialog.tsx rename to modules/companies/src/web/intervention-templates/create/ui/intervention-template-create-dialog.tsx index d36ee74..51b975a 100644 --- a/modules/companies/src/web/interventions/intervention-template-create-dialog.tsx +++ b/modules/companies/src/web/intervention-templates/create/ui/intervention-template-create-dialog.tsx @@ -1,7 +1,7 @@ import { FormDialog } from "@repo/shadcn-ui/components/form-dialog"; import { useTranslation } from "react-i18next"; -import { InterventionTemplateForm } from "../intervention-templates/template-form"; +import { InterventionTemplateForm } from "../../shared"; export function InterventionTemplateCreateDialog({ open, diff --git a/modules/companies/src/web/intervention-templates/detail/index.ts b/modules/companies/src/web/intervention-templates/detail/index.ts new file mode 100644 index 0000000..d7c537f --- /dev/null +++ b/modules/companies/src/web/intervention-templates/detail/index.ts @@ -0,0 +1 @@ +export { TemplateSteps } from "./ui"; diff --git a/modules/companies/src/web/intervention-templates/detail/ui/index.ts b/modules/companies/src/web/intervention-templates/detail/ui/index.ts new file mode 100644 index 0000000..4295e27 --- /dev/null +++ b/modules/companies/src/web/intervention-templates/detail/ui/index.ts @@ -0,0 +1 @@ +export { TemplateSteps } from "./template-detail"; diff --git a/modules/companies/src/web/intervention-templates/template-detail.tsx b/modules/companies/src/web/intervention-templates/detail/ui/template-detail.tsx similarity index 90% rename from modules/companies/src/web/intervention-templates/template-detail.tsx rename to modules/companies/src/web/intervention-templates/detail/ui/template-detail.tsx index 11b99ae..b1dceac 100644 --- a/modules/companies/src/web/intervention-templates/template-detail.tsx +++ b/modules/companies/src/web/intervention-templates/detail/ui/template-detail.tsx @@ -1,6 +1,6 @@ import { useTranslation } from "react-i18next"; -import type { InterventionTemplateInput } from "../../common/intervention-templates"; +import type { InterventionTemplateInput } from "../../../../common/intervention-templates"; export function TemplateSteps({ values }: { values: InterventionTemplateInput }) { const { t } = useTranslation("companies"); diff --git a/modules/companies/src/web/intervention-templates/history/index.ts b/modules/companies/src/web/intervention-templates/history/index.ts new file mode 100644 index 0000000..fe07fee --- /dev/null +++ b/modules/companies/src/web/intervention-templates/history/index.ts @@ -0,0 +1 @@ +export { TemplateHistory } from "./ui"; diff --git a/modules/companies/src/web/intervention-templates/history/ui/index.ts b/modules/companies/src/web/intervention-templates/history/ui/index.ts new file mode 100644 index 0000000..817ce76 --- /dev/null +++ b/modules/companies/src/web/intervention-templates/history/ui/index.ts @@ -0,0 +1 @@ +export { TemplateHistory } from "./template-history"; diff --git a/modules/companies/src/web/intervention-templates/template-history.tsx b/modules/companies/src/web/intervention-templates/history/ui/template-history.tsx similarity index 86% rename from modules/companies/src/web/intervention-templates/template-history.tsx rename to modules/companies/src/web/intervention-templates/history/ui/template-history.tsx index adc5f25..0612c2d 100644 --- a/modules/companies/src/web/intervention-templates/template-history.tsx +++ b/modules/companies/src/web/intervention-templates/history/ui/template-history.tsx @@ -1,8 +1,7 @@ import { useTranslation } from "react-i18next"; -import type { InterventionTemplateDTO } from "../../common/intervention-templates"; - -import { TemplateSteps } from "./template-detail"; +import type { InterventionTemplateDTO } from "../../../../common/intervention-templates"; +import { TemplateSteps } from "../../detail"; export function TemplateHistory({ template }: { template: InterventionTemplateDTO }) { const { t, i18n } = useTranslation("companies"); diff --git a/modules/companies/src/web/intervention-templates/index.ts b/modules/companies/src/web/intervention-templates/index.ts new file mode 100644 index 0000000..8d837a3 --- /dev/null +++ b/modules/companies/src/web/intervention-templates/index.ts @@ -0,0 +1,2 @@ +export { InterventionTemplateCreateDialog } from "./create"; +export { InterventionTemplatesPage } from "./list"; diff --git a/modules/companies/src/web/intervention-templates/list/index.ts b/modules/companies/src/web/intervention-templates/list/index.ts new file mode 100644 index 0000000..c923571 --- /dev/null +++ b/modules/companies/src/web/intervention-templates/list/index.ts @@ -0,0 +1 @@ +export { InterventionTemplatesPage } from "./ui"; diff --git a/modules/companies/src/web/intervention-templates/list/ui/index.ts b/modules/companies/src/web/intervention-templates/list/ui/index.ts new file mode 100644 index 0000000..c0f51f3 --- /dev/null +++ b/modules/companies/src/web/intervention-templates/list/ui/index.ts @@ -0,0 +1 @@ +export { InterventionTemplatesPage } from "./templates-page"; diff --git a/modules/companies/src/web/intervention-templates/templates-page.tsx b/modules/companies/src/web/intervention-templates/list/ui/templates-page.tsx similarity index 94% rename from modules/companies/src/web/intervention-templates/templates-page.tsx rename to modules/companies/src/web/intervention-templates/list/ui/templates-page.tsx index 6e8922c..377820c 100644 --- a/modules/companies/src/web/intervention-templates/templates-page.tsx +++ b/modules/companies/src/web/intervention-templates/list/ui/templates-page.tsx @@ -12,11 +12,14 @@ import { useQuery } from "@tanstack/react-query"; import { useId, useState } from "react"; import { useTranslation } from "react-i18next"; -import { InterventionTemplateEditorDialog } from "./intervention-template-editor-dialog"; -import { interventionTemplateApi, interventionTemplateKeys } from "./template-api"; -import { TemplateSteps } from "./template-detail"; -import { InterventionTemplateFeedback } from "./template-feedback"; -import { TemplateHistory } from "./template-history"; +import { TemplateSteps } from "../../detail"; +import { TemplateHistory } from "../../history"; +import { + InterventionTemplateEditorDialog, + InterventionTemplateFeedback, + interventionTemplateApi, + interventionTemplateKeys, +} from "../../shared"; export function InterventionTemplatesPage({ scope = "global", csrfToken, diff --git a/modules/companies/src/web/intervention-templates/shared/api/index.ts b/modules/companies/src/web/intervention-templates/shared/api/index.ts new file mode 100644 index 0000000..1443a9d --- /dev/null +++ b/modules/companies/src/web/intervention-templates/shared/api/index.ts @@ -0,0 +1,5 @@ +export { + InterventionTemplateApiError, + interventionTemplateApi, + interventionTemplateKeys, +} from "./template-api"; diff --git a/modules/companies/src/web/intervention-templates/template-api.ts b/modules/companies/src/web/intervention-templates/shared/api/template-api.ts similarity index 90% rename from modules/companies/src/web/intervention-templates/template-api.ts rename to modules/companies/src/web/intervention-templates/shared/api/template-api.ts index 539549d..e69e1f0 100644 --- a/modules/companies/src/web/intervention-templates/template-api.ts +++ b/modules/companies/src/web/intervention-templates/shared/api/template-api.ts @@ -1,10 +1,10 @@ import { z } from "zod/v4"; -import type { SaveInterventionTemplateInput } from "../../common/intervention-templates"; +import type { SaveInterventionTemplateInput } from "../../../../common/intervention-templates"; import { InterventionTemplateResponseSchema, InterventionTemplatesSchema, -} from "../../common/intervention-templates"; +} from "../../../../common/intervention-templates"; export const interventionTemplateKeys = { list: (scope: string) => ["intervention-templates", scope], }; diff --git a/modules/companies/src/web/intervention-templates/shared/index.ts b/modules/companies/src/web/intervention-templates/shared/index.ts new file mode 100644 index 0000000..fef725f --- /dev/null +++ b/modules/companies/src/web/intervention-templates/shared/index.ts @@ -0,0 +1,6 @@ +export { interventionTemplateApi, interventionTemplateKeys } from "./api"; +export { + InterventionTemplateEditorDialog, + InterventionTemplateFeedback, + InterventionTemplateForm, +} from "./ui"; diff --git a/modules/companies/src/web/intervention-templates/templates.test.tsx b/modules/companies/src/web/intervention-templates/shared/templates.test.tsx similarity index 92% rename from modules/companies/src/web/intervention-templates/templates.test.tsx rename to modules/companies/src/web/intervention-templates/shared/templates.test.tsx index 1388a49..8eef7ca 100644 --- a/modules/companies/src/web/intervention-templates/templates.test.tsx +++ b/modules/companies/src/web/intervention-templates/shared/templates.test.tsx @@ -8,12 +8,12 @@ import type { ReactNode } from "react"; import { renderToStaticMarkup } from "react-dom/server"; import { I18nextProvider } from "react-i18next"; -import type { InterventionTemplateDTO } from "../../common/intervention-templates"; -import { companiesEnglish, companiesSpanish } from "../i18n"; +import type { InterventionTemplateDTO } from "../../../common/intervention-templates"; +import { companiesEnglish, companiesSpanish } from "../../shared"; +import { InterventionTemplatesPage } from "../list"; -import { interventionTemplateKeys } from "./template-api"; -import { InterventionTemplateForm, copyTemplateValues } from "./template-form"; -import { InterventionTemplatesPage } from "./templates-page"; +import { interventionTemplateKeys } from "./api"; +import { InterventionTemplateForm, copyTemplateValues } from "./ui"; const companyId = UniqueID.generateNewID().toPrimitive(); function template(): InterventionTemplateDTO { diff --git a/modules/companies/src/web/intervention-templates/shared/ui/index.ts b/modules/companies/src/web/intervention-templates/shared/ui/index.ts new file mode 100644 index 0000000..94c5898 --- /dev/null +++ b/modules/companies/src/web/intervention-templates/shared/ui/index.ts @@ -0,0 +1,3 @@ +export { InterventionTemplateEditorDialog } from "./intervention-template-editor-dialog"; +export { InterventionTemplateFeedback } from "./template-feedback"; +export { InterventionTemplateForm, copyTemplateValues } from "./template-form"; diff --git a/modules/companies/src/web/intervention-templates/intervention-template-editor-dialog.tsx b/modules/companies/src/web/intervention-templates/shared/ui/intervention-template-editor-dialog.tsx similarity index 100% rename from modules/companies/src/web/intervention-templates/intervention-template-editor-dialog.tsx rename to modules/companies/src/web/intervention-templates/shared/ui/intervention-template-editor-dialog.tsx diff --git a/modules/companies/src/web/intervention-templates/template-feedback.tsx b/modules/companies/src/web/intervention-templates/shared/ui/template-feedback.tsx similarity index 90% rename from modules/companies/src/web/intervention-templates/template-feedback.tsx rename to modules/companies/src/web/intervention-templates/shared/ui/template-feedback.tsx index 26a6c95..a9c89cd 100644 --- a/modules/companies/src/web/intervention-templates/template-feedback.tsx +++ b/modules/companies/src/web/intervention-templates/shared/ui/template-feedback.tsx @@ -1,6 +1,6 @@ import { useTranslation } from "react-i18next"; -import { InterventionTemplateApiError } from "./template-api"; +import { InterventionTemplateApiError } from "../api"; export function InterventionTemplateFeedback({ error, diff --git a/modules/companies/src/web/intervention-templates/template-form.tsx b/modules/companies/src/web/intervention-templates/shared/ui/template-form.tsx similarity index 97% rename from modules/companies/src/web/intervention-templates/template-form.tsx rename to modules/companies/src/web/intervention-templates/shared/ui/template-form.tsx index 9ff1c8d..f79369c 100644 --- a/modules/companies/src/web/intervention-templates/template-form.tsx +++ b/modules/companies/src/web/intervention-templates/shared/ui/template-form.tsx @@ -14,10 +14,10 @@ import { useTranslation } from "react-i18next"; import type { InterventionTemplateDTO, InterventionTemplateInput, -} from "../../common/intervention-templates"; -import { InterventionTemplateInputSchema } from "../../common/intervention-templates"; +} from "../../../../common/intervention-templates"; +import { InterventionTemplateInputSchema } from "../../../../common/intervention-templates"; +import { InterventionTemplateApiError, interventionTemplateApi } from "../api"; -import { InterventionTemplateApiError, interventionTemplateApi } from "./template-api"; import { InterventionTemplateFeedback } from "./template-feedback"; import { InterventionTemplateHelp } from "./template-help"; import { TemplateStepFields } from "./template-step-fields"; diff --git a/modules/companies/src/web/intervention-templates/template-help.tsx b/modules/companies/src/web/intervention-templates/shared/ui/template-help.tsx similarity index 100% rename from modules/companies/src/web/intervention-templates/template-help.tsx rename to modules/companies/src/web/intervention-templates/shared/ui/template-help.tsx diff --git a/modules/companies/src/web/intervention-templates/template-step-fields.tsx b/modules/companies/src/web/intervention-templates/shared/ui/template-step-fields.tsx similarity index 96% rename from modules/companies/src/web/intervention-templates/template-step-fields.tsx rename to modules/companies/src/web/intervention-templates/shared/ui/template-step-fields.tsx index d26adba..628f35f 100644 --- a/modules/companies/src/web/intervention-templates/template-step-fields.tsx +++ b/modules/companies/src/web/intervention-templates/shared/ui/template-step-fields.tsx @@ -6,7 +6,7 @@ import { Textarea } from "@repo/shadcn-ui/components/textarea"; import type { UseFormReturn } from "react-hook-form"; import { useTranslation } from "react-i18next"; -import type { InterventionTemplateInput } from "../../common/intervention-templates"; +import type { InterventionTemplateInput } from "../../../../common/intervention-templates"; export function TemplateStepFields({ form, index, diff --git a/modules/companies/src/web/interventions/create/index.ts b/modules/companies/src/web/interventions/create/index.ts new file mode 100644 index 0000000..999d1a6 --- /dev/null +++ b/modules/companies/src/web/interventions/create/index.ts @@ -0,0 +1 @@ +export { TicketInterventionDialog } from "./ui"; diff --git a/modules/companies/src/web/interventions/create/ui/index.ts b/modules/companies/src/web/interventions/create/ui/index.ts new file mode 100644 index 0000000..f472e21 --- /dev/null +++ b/modules/companies/src/web/interventions/create/ui/index.ts @@ -0,0 +1 @@ +export { TicketInterventionDialog } from "./ticket-intervention-dialog"; diff --git a/modules/companies/src/web/tickets/ticket-intervention-dialog.tsx b/modules/companies/src/web/interventions/create/ui/ticket-intervention-dialog.tsx similarity index 91% rename from modules/companies/src/web/tickets/ticket-intervention-dialog.tsx rename to modules/companies/src/web/interventions/create/ui/ticket-intervention-dialog.tsx index fe54f5e..8a1d63f 100644 --- a/modules/companies/src/web/tickets/ticket-intervention-dialog.tsx +++ b/modules/companies/src/web/interventions/create/ui/ticket-intervention-dialog.tsx @@ -2,7 +2,7 @@ import { FormDialog } from "@repo/shadcn-ui/components/form-dialog"; import type { ComponentProps } from "react"; import { useTranslation } from "react-i18next"; -import { TicketInterventionForm } from "../interventions/ticket-intervention-form"; +import { TicketInterventionForm } from "./ticket-intervention-form"; export function TicketInterventionDialog({ interventionTicket, diff --git a/modules/companies/src/web/interventions/ticket-intervention-form.tsx b/modules/companies/src/web/interventions/create/ui/ticket-intervention-form.tsx similarity index 81% rename from modules/companies/src/web/interventions/ticket-intervention-form.tsx rename to modules/companies/src/web/interventions/create/ui/ticket-intervention-form.tsx index f2b301e..f7d180b 100644 --- a/modules/companies/src/web/interventions/ticket-intervention-form.tsx +++ b/modules/companies/src/web/interventions/create/ui/ticket-intervention-form.tsx @@ -2,11 +2,13 @@ import { Button } from "@repo/shadcn-ui/components/button"; import { useQuery } from "@tanstack/react-query"; import { useTranslation } from "react-i18next"; -import type { TicketDTO } from "../../common/tickets"; - -import { interventionApi, interventionKeys } from "./intervention-api"; -import { InterventionFeedback } from "./intervention-feedback"; -import { InterventionForm } from "./intervention-form"; +import type { TicketDTO } from "../../../../common/tickets"; +import { + InterventionFeedback, + InterventionForm, + interventionApi, + interventionKeys, +} from "../../shared"; export function TicketInterventionForm({ ticket, diff --git a/modules/companies/src/web/interventions/detail/index.ts b/modules/companies/src/web/interventions/detail/index.ts new file mode 100644 index 0000000..0a6f722 --- /dev/null +++ b/modules/companies/src/web/interventions/detail/index.ts @@ -0,0 +1 @@ +export { InterventionDetailDialog, stepCompletion } from "./ui"; diff --git a/modules/companies/src/web/interventions/detail/ui/index.ts b/modules/companies/src/web/interventions/detail/ui/index.ts new file mode 100644 index 0000000..2134769 --- /dev/null +++ b/modules/companies/src/web/interventions/detail/ui/index.ts @@ -0,0 +1,2 @@ +export { stepCompletion } from "./intervention-detail"; +export { InterventionDetailDialog } from "./intervention-detail-dialog"; diff --git a/modules/companies/src/web/interventions/intervention-detail-dialog.tsx b/modules/companies/src/web/interventions/detail/ui/intervention-detail-dialog.tsx similarity index 100% rename from modules/companies/src/web/interventions/intervention-detail-dialog.tsx rename to modules/companies/src/web/interventions/detail/ui/intervention-detail-dialog.tsx diff --git a/modules/companies/src/web/interventions/intervention-detail.tsx b/modules/companies/src/web/interventions/detail/ui/intervention-detail.tsx similarity index 97% rename from modules/companies/src/web/interventions/intervention-detail.tsx rename to modules/companies/src/web/interventions/detail/ui/intervention-detail.tsx index cb32552..f41d9b9 100644 --- a/modules/companies/src/web/interventions/intervention-detail.tsx +++ b/modules/companies/src/web/interventions/detail/ui/intervention-detail.tsx @@ -1,9 +1,9 @@ import { useQuery } from "@tanstack/react-query"; import { useTranslation } from "react-i18next"; -import type { InterventionDTO, InterventionListDTO } from "../../common/interventions"; +import type { InterventionDTO, InterventionListDTO } from "../../../../common/interventions"; +import { interventionApi, interventionKeys } from "../../shared"; -import { interventionApi, interventionKeys } from "./intervention-api"; import { InterventionSnapshot } from "./intervention-snapshot"; export function stepCompletion(intervention: InterventionDTO, stepId: string) { diff --git a/modules/companies/src/web/interventions/intervention-snapshot.tsx b/modules/companies/src/web/interventions/detail/ui/intervention-snapshot.tsx similarity index 95% rename from modules/companies/src/web/interventions/intervention-snapshot.tsx rename to modules/companies/src/web/interventions/detail/ui/intervention-snapshot.tsx index 4633296..75ec741 100644 --- a/modules/companies/src/web/interventions/intervention-snapshot.tsx +++ b/modules/companies/src/web/interventions/detail/ui/intervention-snapshot.tsx @@ -1,8 +1,8 @@ import { useTranslation } from "react-i18next"; -import type { InterventionInput, InterventionListDTO } from "../../common/interventions"; -import type { TicketLookupsDTO } from "../../common/tickets"; -import { ticketTargetOptions } from "../tickets/ticket-targets"; +import type { InterventionInput, InterventionListDTO } from "../../../../common/interventions"; +import type { TicketLookupsDTO } from "../../../../common/tickets"; +import { ticketTargetOptions } from "../../../tickets"; export function InterventionSnapshot({ values, diff --git a/modules/companies/src/web/interventions/index.ts b/modules/companies/src/web/interventions/index.ts new file mode 100644 index 0000000..b890477 --- /dev/null +++ b/modules/companies/src/web/interventions/index.ts @@ -0,0 +1,2 @@ +export { InterventionsPage } from "./list"; +export { InterventionForm, interventionApi, interventionKeys } from "./shared"; diff --git a/modules/companies/src/web/interventions/list/index.ts b/modules/companies/src/web/interventions/list/index.ts new file mode 100644 index 0000000..14f96b1 --- /dev/null +++ b/modules/companies/src/web/interventions/list/index.ts @@ -0,0 +1 @@ +export { InterventionsPage, filterInterventions } from "./ui"; diff --git a/modules/companies/src/web/interventions/list/ui/index.ts b/modules/companies/src/web/interventions/list/ui/index.ts new file mode 100644 index 0000000..e0d070f --- /dev/null +++ b/modules/companies/src/web/interventions/list/ui/index.ts @@ -0,0 +1 @@ +export { InterventionsPage, filterInterventions } from "./interventions-page"; diff --git a/modules/companies/src/web/interventions/interventions-page.tsx b/modules/companies/src/web/interventions/list/ui/interventions-page.tsx similarity index 95% rename from modules/companies/src/web/interventions/interventions-page.tsx rename to modules/companies/src/web/interventions/list/ui/interventions-page.tsx index 5db908f..34a4d03 100644 --- a/modules/companies/src/web/interventions/interventions-page.tsx +++ b/modules/companies/src/web/interventions/list/ui/interventions-page.tsx @@ -11,15 +11,16 @@ import { useQuery } from "@tanstack/react-query"; import { useState } from "react"; import { useTranslation } from "react-i18next"; -import type { InterventionDTO } from "../../common/interventions"; -import { InterventionStateSchema } from "../../common/interventions"; -import { CompanyIdentity } from "../components/company-identity"; -import { CompanySelect } from "../components/company-select"; - -import { interventionApi, interventionKeys } from "./intervention-api"; -import { InterventionDetailDialog } from "./intervention-detail-dialog"; -import { InterventionEditorDialog } from "./intervention-editor-dialog"; -import { InterventionFeedback } from "./intervention-feedback"; +import type { InterventionDTO } from "../../../../common/interventions"; +import { InterventionStateSchema } from "../../../../common/interventions"; +import { CompanyIdentity, CompanySelect } from "../../../companies/shared"; +import { InterventionDetailDialog } from "../../detail"; +import { + InterventionEditorDialog, + InterventionFeedback, + interventionApi, + interventionKeys, +} from "../../shared"; export type InterventionFilters = { search: string; company: string; diff --git a/modules/companies/src/web/interventions/ticket-interventions.tsx b/modules/companies/src/web/interventions/list/ui/ticket-interventions.tsx similarity index 89% rename from modules/companies/src/web/interventions/ticket-interventions.tsx rename to modules/companies/src/web/interventions/list/ui/ticket-interventions.tsx index c82967e..b359446 100644 --- a/modules/companies/src/web/interventions/ticket-interventions.tsx +++ b/modules/companies/src/web/interventions/list/ui/ticket-interventions.tsx @@ -1,8 +1,7 @@ import { useQuery } from "@tanstack/react-query"; import { useTranslation } from "react-i18next"; -import { interventionApi, interventionKeys } from "./intervention-api"; -import { InterventionFeedback } from "./intervention-feedback"; +import { InterventionFeedback, interventionApi, interventionKeys } from "../../shared"; export function TicketInterventions({ companyId, diff --git a/modules/companies/src/web/interventions/shared/api/index.ts b/modules/companies/src/web/interventions/shared/api/index.ts new file mode 100644 index 0000000..96311f4 --- /dev/null +++ b/modules/companies/src/web/interventions/shared/api/index.ts @@ -0,0 +1 @@ +export { InterventionApiError, interventionApi, interventionKeys } from "./intervention-api"; diff --git a/modules/companies/src/web/interventions/intervention-api.ts b/modules/companies/src/web/interventions/shared/api/intervention-api.ts similarity index 92% rename from modules/companies/src/web/interventions/intervention-api.ts rename to modules/companies/src/web/interventions/shared/api/intervention-api.ts index b9b8277..ce8bed5 100644 --- a/modules/companies/src/web/interventions/intervention-api.ts +++ b/modules/companies/src/web/interventions/shared/api/intervention-api.ts @@ -1,11 +1,11 @@ import { z } from "zod/v4"; -import type { SaveInterventionInput } from "../../common/interventions"; +import type { SaveInterventionInput } from "../../../../common/interventions"; import { InterventionListSchema, InterventionLookupsSchema, InterventionResponseSchema, -} from "../../common/interventions"; +} from "../../../../common/interventions"; export const interventionKeys = { list: (companyId?: string) => ["interventions", companyId ?? "global"], lookups: (companyId: string) => ["intervention-lookups", companyId], diff --git a/modules/companies/src/web/interventions/shared/index.ts b/modules/companies/src/web/interventions/shared/index.ts new file mode 100644 index 0000000..e939d3a --- /dev/null +++ b/modules/companies/src/web/interventions/shared/index.ts @@ -0,0 +1,2 @@ +export { interventionApi, interventionKeys } from "./api"; +export { InterventionEditorDialog, InterventionFeedback, InterventionForm } from "./ui"; diff --git a/modules/companies/src/web/interventions/interventions.test.tsx b/modules/companies/src/web/interventions/shared/interventions.test.tsx similarity index 93% rename from modules/companies/src/web/interventions/interventions.test.tsx rename to modules/companies/src/web/interventions/shared/interventions.test.tsx index f399a59..632e0d8 100644 --- a/modules/companies/src/web/interventions/interventions.test.tsx +++ b/modules/companies/src/web/interventions/shared/interventions.test.tsx @@ -8,13 +8,13 @@ import type { ReactNode } from "react"; import { renderToStaticMarkup } from "react-dom/server"; import { I18nextProvider } from "react-i18next"; -import type { InterventionDTO, InterventionListDTO } from "../../common/interventions"; -import { companiesEnglish, companiesSpanish } from "../i18n"; +import type { InterventionDTO, InterventionListDTO } from "../../../common/interventions"; +import { companiesEnglish, companiesSpanish } from "../../shared"; +import { stepCompletion } from "../detail"; +import { InterventionsPage, filterInterventions } from "../list"; -import { interventionKeys } from "./intervention-api"; -import { stepCompletion } from "./intervention-detail"; -import { InterventionForm, emptyIntervention } from "./intervention-form"; -import { InterventionsPage, filterInterventions } from "./interventions-page"; +import { interventionKeys } from "./api"; +import { InterventionForm, emptyIntervention } from "./ui"; const companyId = UniqueID.generateNewID().toPrimitive(); const data: InterventionListDTO = { diff --git a/modules/companies/src/web/interventions/shared/ui/index.ts b/modules/companies/src/web/interventions/shared/ui/index.ts new file mode 100644 index 0000000..c049fa7 --- /dev/null +++ b/modules/companies/src/web/interventions/shared/ui/index.ts @@ -0,0 +1,3 @@ +export { InterventionEditorDialog } from "./intervention-editor-dialog"; +export { InterventionFeedback } from "./intervention-feedback"; +export { InterventionForm, emptyIntervention } from "./intervention-form"; diff --git a/modules/companies/src/web/interventions/intervention-company-field.tsx b/modules/companies/src/web/interventions/shared/ui/intervention-company-field.tsx similarity index 88% rename from modules/companies/src/web/interventions/intervention-company-field.tsx rename to modules/companies/src/web/interventions/shared/ui/intervention-company-field.tsx index f5a9a7e..e806fc8 100644 --- a/modules/companies/src/web/interventions/intervention-company-field.tsx +++ b/modules/companies/src/web/interventions/shared/ui/intervention-company-field.tsx @@ -1,8 +1,8 @@ import { Label } from "@repo/shadcn-ui/components/label"; import { useTranslation } from "react-i18next"; -import type { InterventionListDTO } from "../../common/interventions"; -import { CompanySelect } from "../components/company-select"; +import type { InterventionListDTO } from "../../../../common/interventions"; +import { CompanySelect } from "../../../companies/shared"; export function InterventionCompanyField({ prefix, diff --git a/modules/companies/src/web/interventions/intervention-editor-dialog.tsx b/modules/companies/src/web/interventions/shared/ui/intervention-editor-dialog.tsx similarity index 100% rename from modules/companies/src/web/interventions/intervention-editor-dialog.tsx rename to modules/companies/src/web/interventions/shared/ui/intervention-editor-dialog.tsx diff --git a/modules/companies/src/web/interventions/intervention-feedback.tsx b/modules/companies/src/web/interventions/shared/ui/intervention-feedback.tsx similarity index 90% rename from modules/companies/src/web/interventions/intervention-feedback.tsx rename to modules/companies/src/web/interventions/shared/ui/intervention-feedback.tsx index a6c2127..a656a3c 100644 --- a/modules/companies/src/web/interventions/intervention-feedback.tsx +++ b/modules/companies/src/web/interventions/shared/ui/intervention-feedback.tsx @@ -1,6 +1,6 @@ import { useTranslation } from "react-i18next"; -import { InterventionApiError } from "./intervention-api"; +import { InterventionApiError } from "../api"; export function InterventionFeedback({ error, diff --git a/modules/companies/src/web/interventions/intervention-fields.tsx b/modules/companies/src/web/interventions/shared/ui/intervention-fields.tsx similarity index 95% rename from modules/companies/src/web/interventions/intervention-fields.tsx rename to modules/companies/src/web/interventions/shared/ui/intervention-fields.tsx index 0a940a6..bf3e3e7 100644 --- a/modules/companies/src/web/interventions/intervention-fields.tsx +++ b/modules/companies/src/web/interventions/shared/ui/intervention-fields.tsx @@ -5,8 +5,11 @@ import { Textarea } from "@repo/shadcn-ui/components/textarea"; import type { UseFormReturn } from "react-hook-form"; import { useTranslation } from "react-i18next"; -import type { InterventionInput } from "../../common/interventions"; -import { InterventionModalitySchema, InterventionStateSchema } from "../../common/interventions"; +import type { InterventionInput } from "../../../../common/interventions"; +import { + InterventionModalitySchema, + InterventionStateSchema, +} from "../../../../common/interventions"; export function InterventionWorkFields({ form, prefix, diff --git a/modules/companies/src/web/interventions/intervention-form.tsx b/modules/companies/src/web/interventions/shared/ui/intervention-form.tsx similarity index 95% rename from modules/companies/src/web/interventions/intervention-form.tsx rename to modules/companies/src/web/interventions/shared/ui/intervention-form.tsx index e7236c0..d809904 100644 --- a/modules/companies/src/web/interventions/intervention-form.tsx +++ b/modules/companies/src/web/interventions/shared/ui/intervention-form.tsx @@ -15,21 +15,20 @@ import type { InterventionInput, InterventionListDTO, SaveInterventionInput, -} from "../../common/interventions"; -import { InterventionInputSchema } from "../../common/interventions"; -import type { TicketDTO } from "../../common/tickets"; -import { TicketQuickForms } from "../tickets/ticket-quick-forms"; -import { TicketTargets } from "../tickets/ticket-targets"; +} from "../../../../common/interventions"; +import { InterventionInputSchema } from "../../../../common/interventions"; +import type { TicketDTO } from "../../../../common/tickets"; +import { InterventionTemplateCreateDialog } from "../../../intervention-templates"; +import { InterventionTicketCreateDialog, TicketQuickForms } from "../../../tickets/create"; +import { TicketTargets } from "../../../tickets/shared"; +import { InterventionApiError, interventionApi, interventionKeys } from "../api"; -import { InterventionApiError, interventionApi, interventionKeys } from "./intervention-api"; import { InterventionCompanyField } from "./intervention-company-field"; import { InterventionFeedback } from "./intervention-feedback"; import { InterventionWorkFields } from "./intervention-fields"; import { InterventionHelp } from "./intervention-help"; import { InterventionProcedureFields } from "./intervention-procedure-fields"; import { InterventionSteps } from "./intervention-steps"; -import { InterventionTemplateCreateDialog } from "./intervention-template-create-dialog"; -import { InterventionTicketCreateDialog } from "./intervention-ticket-create-dialog"; export function emptyIntervention(ticket?: TicketDTO): InterventionInput { return { diff --git a/modules/companies/src/web/interventions/intervention-help.tsx b/modules/companies/src/web/interventions/shared/ui/intervention-help.tsx similarity index 100% rename from modules/companies/src/web/interventions/intervention-help.tsx rename to modules/companies/src/web/interventions/shared/ui/intervention-help.tsx diff --git a/modules/companies/src/web/interventions/intervention-procedure-fields.tsx b/modules/companies/src/web/interventions/shared/ui/intervention-procedure-fields.tsx similarity index 98% rename from modules/companies/src/web/interventions/intervention-procedure-fields.tsx rename to modules/companies/src/web/interventions/shared/ui/intervention-procedure-fields.tsx index 9770c07..a4c9a54 100644 --- a/modules/companies/src/web/interventions/intervention-procedure-fields.tsx +++ b/modules/companies/src/web/interventions/shared/ui/intervention-procedure-fields.tsx @@ -7,7 +7,7 @@ import type { InterventionDTO, InterventionLookupsDTO, SaveInterventionInput, -} from "../../common/interventions"; +} from "../../../../common/interventions"; export function InterventionProcedureFields({ prefix, intervention, diff --git a/modules/companies/src/web/interventions/intervention-steps.tsx b/modules/companies/src/web/interventions/shared/ui/intervention-steps.tsx similarity index 97% rename from modules/companies/src/web/interventions/intervention-steps.tsx rename to modules/companies/src/web/interventions/shared/ui/intervention-steps.tsx index 2087028..db3f917 100644 --- a/modules/companies/src/web/interventions/intervention-steps.tsx +++ b/modules/companies/src/web/interventions/shared/ui/intervention-steps.tsx @@ -9,8 +9,8 @@ import type { UseFormReturn } from "react-hook-form"; import { useFieldArray } from "react-hook-form"; import { useTranslation } from "react-i18next"; -import type { InterventionInput } from "../../common/interventions"; -import { InterventionStepStateSchema } from "../../common/interventions"; +import type { InterventionInput } from "../../../../common/interventions"; +import { InterventionStepStateSchema } from "../../../../common/interventions"; export function InterventionSteps({ form, prefix, diff --git a/modules/companies/src/web/mail-configurations/create/index.ts b/modules/companies/src/web/mail-configurations/create/index.ts new file mode 100644 index 0000000..bfd611e --- /dev/null +++ b/modules/companies/src/web/mail-configurations/create/index.ts @@ -0,0 +1 @@ +export { MailQuickEditor } from "./ui"; diff --git a/modules/companies/src/web/mail-configurations/create/ui/index.ts b/modules/companies/src/web/mail-configurations/create/ui/index.ts new file mode 100644 index 0000000..124eddc --- /dev/null +++ b/modules/companies/src/web/mail-configurations/create/ui/index.ts @@ -0,0 +1 @@ +export { MailQuickEditor } from "./mail-quick-editor"; diff --git a/modules/companies/src/web/mail/mail-quick-editor.tsx b/modules/companies/src/web/mail-configurations/create/ui/mail-quick-editor.tsx similarity index 82% rename from modules/companies/src/web/mail/mail-quick-editor.tsx rename to modules/companies/src/web/mail-configurations/create/ui/mail-quick-editor.tsx index 10c9490..f3aab3d 100644 --- a/modules/companies/src/web/mail/mail-quick-editor.tsx +++ b/modules/companies/src/web/mail-configurations/create/ui/mail-quick-editor.tsx @@ -1,13 +1,12 @@ import { FormDialog } from "@repo/shadcn-ui/components/form-dialog"; import { useTranslation } from "react-i18next"; -import type { CompanyDTO } from "../../common"; -import type { MailboxDTO } from "../../common/mailboxes"; -import type { WorkProfileDTO } from "../../common/work-profiles"; -import { WorkProfileForm } from "../profiles/work-profile-form"; - -import { MailboxForm } from "./mailbox-form"; -import { MailboxUseForm } from "./mailbox-use-form"; +import type { CompanyDTO } from "../../../../common"; +import type { MailboxDTO } from "../../../../common/mailboxes"; +import type { WorkProfileDTO } from "../../../../common/work-profiles"; +import { MailboxUseForm } from "../../../mailbox-uses"; +import { MailboxForm } from "../../../mailboxes"; +import { WorkProfileForm } from "../../../work-profiles/shared"; export function MailQuickEditor({ kind, diff --git a/modules/companies/src/web/mail-configurations/history/index.ts b/modules/companies/src/web/mail-configurations/history/index.ts new file mode 100644 index 0000000..91c4cb0 --- /dev/null +++ b/modules/companies/src/web/mail-configurations/history/index.ts @@ -0,0 +1 @@ +export { MailConfigurationHistoryDialog } from "./ui"; diff --git a/modules/companies/src/web/mail-configurations/history/ui/index.ts b/modules/companies/src/web/mail-configurations/history/ui/index.ts new file mode 100644 index 0000000..c298d54 --- /dev/null +++ b/modules/companies/src/web/mail-configurations/history/ui/index.ts @@ -0,0 +1 @@ +export { MailConfigurationHistoryDialog } from "./mail-configuration-history-dialog"; diff --git a/modules/companies/src/web/mail/mail-configuration-history-dialog.tsx b/modules/companies/src/web/mail-configurations/history/ui/mail-configuration-history-dialog.tsx similarity index 94% rename from modules/companies/src/web/mail/mail-configuration-history-dialog.tsx rename to modules/companies/src/web/mail-configurations/history/ui/mail-configuration-history-dialog.tsx index 7f1423c..4b36dd8 100644 --- a/modules/companies/src/web/mail/mail-configuration-history-dialog.tsx +++ b/modules/companies/src/web/mail-configurations/history/ui/mail-configuration-history-dialog.tsx @@ -1,7 +1,7 @@ import { FormDialog } from "@repo/shadcn-ui/components/form-dialog"; import { useTranslation } from "react-i18next"; -import type { MailConfigurationDTO } from "../../common/mail-configurations"; +import type { MailConfigurationDTO } from "../../../../common/mail-configurations"; export function MailConfigurationHistoryDialog({ configuration, diff --git a/modules/companies/src/web/mail-configurations/index.ts b/modules/companies/src/web/mail-configurations/index.ts new file mode 100644 index 0000000..a7195b6 --- /dev/null +++ b/modules/companies/src/web/mail-configurations/index.ts @@ -0,0 +1,2 @@ +export { MailConfigurationsPage } from "./list"; +export { mailApi, mailKeys } from "./shared"; diff --git a/modules/companies/src/web/mail-configurations/list/index.ts b/modules/companies/src/web/mail-configurations/list/index.ts new file mode 100644 index 0000000..9126a84 --- /dev/null +++ b/modules/companies/src/web/mail-configurations/list/index.ts @@ -0,0 +1 @@ +export { MailConfigurationsPage } from "./ui"; diff --git a/modules/companies/src/web/mail-configurations/list/ui/index.ts b/modules/companies/src/web/mail-configurations/list/ui/index.ts new file mode 100644 index 0000000..0cae6d4 --- /dev/null +++ b/modules/companies/src/web/mail-configurations/list/ui/index.ts @@ -0,0 +1 @@ +export { MailConfigurationsPage } from "./mail-configurations-page"; diff --git a/modules/companies/src/web/mail/mail-configurations-page.tsx b/modules/companies/src/web/mail-configurations/list/ui/mail-configurations-page.tsx similarity index 93% rename from modules/companies/src/web/mail/mail-configurations-page.tsx rename to modules/companies/src/web/mail-configurations/list/ui/mail-configurations-page.tsx index e1c933c..0e5754c 100644 --- a/modules/companies/src/web/mail/mail-configurations-page.tsx +++ b/modules/companies/src/web/mail-configurations/list/ui/mail-configurations-page.tsx @@ -11,15 +11,12 @@ import { useQuery } from "@tanstack/react-query"; import { useState } from "react"; import { useTranslation } from "react-i18next"; -import type { CompanyDTO } from "../../common"; -import type { MailConfigurationDTO } from "../../common/mail-configurations"; -import { profileApi, profileKeys } from "../profiles/work-profile-api"; - -import { mailApi, mailKeys } from "./mail-api"; -import { MailConfigurationEditorDialog } from "./mail-configuration-editor-dialog"; -import { MailConfigurationHistoryDialog } from "./mail-configuration-history-dialog"; -import { MailFeedback } from "./mail-feedback"; -import { mailboxApi, mailboxKeys } from "./mailbox-api"; +import type { CompanyDTO } from "../../../../common"; +import type { MailConfigurationDTO } from "../../../../common/mail-configurations"; +import { mailboxApi, mailboxKeys } from "../../../mailboxes"; +import { profileApi, profileKeys } from "../../../work-profiles/shared"; +import { MailConfigurationHistoryDialog } from "../../history"; +import { MailConfigurationEditorDialog, MailFeedback, mailApi, mailKeys } from "../../shared"; export function MailConfigurationsPage({ company, csrfToken, diff --git a/modules/companies/src/web/mail-configurations/shared/api/index.ts b/modules/companies/src/web/mail-configurations/shared/api/index.ts new file mode 100644 index 0000000..5b4f5ce --- /dev/null +++ b/modules/companies/src/web/mail-configurations/shared/api/index.ts @@ -0,0 +1 @@ +export { MailApiError, mailApi, mailKeys } from "./mail-api"; diff --git a/modules/companies/src/web/mail/mail-api.ts b/modules/companies/src/web/mail-configurations/shared/api/mail-api.ts similarity index 90% rename from modules/companies/src/web/mail/mail-api.ts rename to modules/companies/src/web/mail-configurations/shared/api/mail-api.ts index 17586f3..195605c 100644 --- a/modules/companies/src/web/mail/mail-api.ts +++ b/modules/companies/src/web/mail-configurations/shared/api/mail-api.ts @@ -1,10 +1,10 @@ import { z } from "zod/v4"; -import type { MailConfigurationInput } from "../../common/mail-configurations"; +import type { MailConfigurationInput } from "../../../../common/mail-configurations"; import { MailConfigurationResponseSchema, MailConfigurationsResponseSchema, -} from "../../common/mail-configurations"; +} from "../../../../common/mail-configurations"; export const mailKeys = { company: (id: string) => ["mail-configurations", id] }; export class MailApiError extends Error { constructor(public readonly code: string) { diff --git a/modules/companies/src/web/mail-configurations/shared/index.ts b/modules/companies/src/web/mail-configurations/shared/index.ts new file mode 100644 index 0000000..84b6731 --- /dev/null +++ b/modules/companies/src/web/mail-configurations/shared/index.ts @@ -0,0 +1,2 @@ +export { mailApi, mailKeys } from "./api"; +export { MailConfigurationEditorDialog, MailFeedback } from "./ui"; diff --git a/modules/companies/src/web/mail/mail.test.tsx b/modules/companies/src/web/mail-configurations/shared/mail.test.tsx similarity index 91% rename from modules/companies/src/web/mail/mail.test.tsx rename to modules/companies/src/web/mail-configurations/shared/mail.test.tsx index 91d3b97..a6113a6 100644 --- a/modules/companies/src/web/mail/mail.test.tsx +++ b/modules/companies/src/web/mail-configurations/shared/mail.test.tsx @@ -14,16 +14,14 @@ import type { ReactNode } from "react"; import { renderToStaticMarkup } from "react-dom/server"; import { I18nextProvider } from "react-i18next"; -import { accessKeys } from "../access/access-api"; -import { companiesEnglish, companiesSpanish } from "../i18n"; -import { profileKeys } from "../profiles/work-profile-api"; +import { accessKeys } from "../../access"; +import { MailboxForm, MailboxRelations, mailboxKeys } from "../../mailboxes"; +import { companiesEnglish, companiesSpanish } from "../../shared"; +import { profileKeys } from "../../work-profiles"; +import { MailConfigurationsPage } from "../list"; -import { mailKeys } from "./mail-api"; -import { MailConfigurationForm } from "./mail-configuration-form"; -import { MailConfigurationsPage } from "./mail-configurations-page"; -import { mailboxKeys } from "./mailbox-api"; -import { MailboxForm } from "./mailbox-form"; -import { MailboxRelations } from "./mailbox-relations"; +import { mailKeys } from "./api"; +import { MailConfigurationForm } from "./ui"; const company = { id: "0199b200-0000-7000-8000-000000000001", diff --git a/modules/companies/src/web/mail-configurations/shared/ui/index.ts b/modules/companies/src/web/mail-configurations/shared/ui/index.ts new file mode 100644 index 0000000..b97232e --- /dev/null +++ b/modules/companies/src/web/mail-configurations/shared/ui/index.ts @@ -0,0 +1,3 @@ +export { MailConfigurationEditorDialog } from "./mail-configuration-editor-dialog"; +export { MailConfigurationForm } from "./mail-configuration-form"; +export { MailFeedback } from "./mail-feedback"; diff --git a/modules/companies/src/web/mail/mail-configuration-editor-dialog.tsx b/modules/companies/src/web/mail-configurations/shared/ui/mail-configuration-editor-dialog.tsx similarity index 95% rename from modules/companies/src/web/mail/mail-configuration-editor-dialog.tsx rename to modules/companies/src/web/mail-configurations/shared/ui/mail-configuration-editor-dialog.tsx index 8096ab5..a206662 100644 --- a/modules/companies/src/web/mail/mail-configuration-editor-dialog.tsx +++ b/modules/companies/src/web/mail-configurations/shared/ui/mail-configuration-editor-dialog.tsx @@ -2,7 +2,7 @@ import { FormDialog } from "@repo/shadcn-ui/components/form-dialog"; import type { ComponentProps } from "react"; import { useTranslation } from "react-i18next"; -import type { CompanyDTO } from "../../common"; +import type { CompanyDTO } from "../../../../common"; import { MailConfigurationForm } from "./mail-configuration-form"; diff --git a/modules/companies/src/web/mail/mail-configuration-form.tsx b/modules/companies/src/web/mail-configurations/shared/ui/mail-configuration-form.tsx similarity index 93% rename from modules/companies/src/web/mail/mail-configuration-form.tsx rename to modules/companies/src/web/mail-configurations/shared/ui/mail-configuration-form.tsx index 6ac871a..5c0c1ed 100644 --- a/modules/companies/src/web/mail/mail-configuration-form.tsx +++ b/modules/companies/src/web/mail-configurations/shared/ui/mail-configuration-form.tsx @@ -10,25 +10,25 @@ import { useEffect, useId, useRef, useState } from "react"; import { useForm } from "react-hook-form"; import { useTranslation } from "react-i18next"; -import type { CompanyDTO } from "../../common"; +import type { CompanyDTO } from "../../../../common"; import type { MailConfigurationDTO, MailConfigurationInput, -} from "../../common/mail-configurations"; +} from "../../../../common/mail-configurations"; import { MAIL_STATE_TRANSITIONS, MailConfigurationInputSchema, -} from "../../common/mail-configurations"; -import type { MailboxDTO, MailboxUseDTO } from "../../common/mailboxes"; -import type { WorkProfileDTO } from "../../common/work-profiles"; -import { profileApi, profileKeys } from "../profiles/work-profile-api"; +} from "../../../../common/mail-configurations"; +import type { MailboxDTO, MailboxUseDTO } from "../../../../common/mailboxes"; +import type { WorkProfileDTO } from "../../../../common/work-profiles"; +import { MailboxUsagePrompt } from "../../../mailbox-uses"; +import { mailboxApi, mailboxKeys } from "../../../mailboxes"; +import { profileApi, profileKeys } from "../../../work-profiles/shared"; +import { MailQuickEditor } from "../../create"; +import { mailApi, mailKeys } from "../api"; -import { mailApi, mailKeys } from "./mail-api"; import { MailConfigurationTargets } from "./mail-configuration-targets"; import { MailFeedback } from "./mail-feedback"; -import { MailQuickEditor } from "./mail-quick-editor"; -import { mailboxApi, mailboxKeys } from "./mailbox-api"; -import { MailboxUsagePrompt } from "./mailbox-usage-prompt"; export function MailConfigurationForm({ company, diff --git a/modules/companies/src/web/mail/mail-configuration-targets.tsx b/modules/companies/src/web/mail-configurations/shared/ui/mail-configuration-targets.tsx similarity index 95% rename from modules/companies/src/web/mail/mail-configuration-targets.tsx rename to modules/companies/src/web/mail-configurations/shared/ui/mail-configuration-targets.tsx index 2351856..d30c9fb 100644 --- a/modules/companies/src/web/mail/mail-configuration-targets.tsx +++ b/modules/companies/src/web/mail-configurations/shared/ui/mail-configuration-targets.tsx @@ -3,8 +3,8 @@ import { SelectWithAction } from "@repo/shadcn-ui/components/select-with-action" import type { UseFormReturn } from "react-hook-form"; import { useTranslation } from "react-i18next"; -import type { MailConfigurationInput } from "../../common/mail-configurations"; -import { MailConfigurationInputSchema } from "../../common/mail-configurations"; +import type { MailConfigurationInput } from "../../../../common/mail-configurations"; +import { MailConfigurationInputSchema } from "../../../../common/mail-configurations"; export function MailConfigurationTargets({ prefix, diff --git a/modules/companies/src/web/mail/mail-feedback.tsx b/modules/companies/src/web/mail-configurations/shared/ui/mail-feedback.tsx similarity index 88% rename from modules/companies/src/web/mail/mail-feedback.tsx rename to modules/companies/src/web/mail-configurations/shared/ui/mail-feedback.tsx index fe5a3e0..dde6cea 100644 --- a/modules/companies/src/web/mail/mail-feedback.tsx +++ b/modules/companies/src/web/mail-configurations/shared/ui/mail-feedback.tsx @@ -1,6 +1,6 @@ import { useTranslation } from "react-i18next"; -import { MailApiError } from "./mail-api"; +import { MailApiError } from "../api"; export function MailFeedback({ error }: { error: unknown }) { const { t } = useTranslation("companies"); return error ? ( diff --git a/modules/companies/src/web/mailbox-uses/create/index.ts b/modules/companies/src/web/mailbox-uses/create/index.ts new file mode 100644 index 0000000..eebaf17 --- /dev/null +++ b/modules/companies/src/web/mailbox-uses/create/index.ts @@ -0,0 +1 @@ +export { MailboxUsagePrompt } from "./ui"; diff --git a/modules/companies/src/web/mailbox-uses/create/ui/index.ts b/modules/companies/src/web/mailbox-uses/create/ui/index.ts new file mode 100644 index 0000000..ba9795d --- /dev/null +++ b/modules/companies/src/web/mailbox-uses/create/ui/index.ts @@ -0,0 +1 @@ +export { MailboxUsagePrompt } from "./mailbox-usage-prompt"; diff --git a/modules/companies/src/web/mail/mailbox-usage-prompt.tsx b/modules/companies/src/web/mailbox-uses/create/ui/mailbox-usage-prompt.tsx similarity index 84% rename from modules/companies/src/web/mail/mailbox-usage-prompt.tsx rename to modules/companies/src/web/mailbox-uses/create/ui/mailbox-usage-prompt.tsx index c569973..e6cc5c2 100644 --- a/modules/companies/src/web/mail/mailbox-usage-prompt.tsx +++ b/modules/companies/src/web/mailbox-uses/create/ui/mailbox-usage-prompt.tsx @@ -1,8 +1,8 @@ import { Button } from "@repo/shadcn-ui/components/button"; import { useTranslation } from "react-i18next"; -import type { MailboxDTO } from "../../common/mailboxes"; -import type { WorkProfileDTO } from "../../common/work-profiles"; +import type { MailboxDTO } from "../../../../common/mailboxes"; +import type { WorkProfileDTO } from "../../../../common/work-profiles"; export function MailboxUsagePrompt({ profile, diff --git a/modules/companies/src/web/mailbox-uses/index.ts b/modules/companies/src/web/mailbox-uses/index.ts new file mode 100644 index 0000000..57bbfc7 --- /dev/null +++ b/modules/companies/src/web/mailbox-uses/index.ts @@ -0,0 +1,2 @@ +export { MailboxUsagePrompt } from "./create"; +export { MailboxUseEditorDialog, MailboxUseForm } from "./shared"; diff --git a/modules/companies/src/web/mailbox-uses/shared/index.ts b/modules/companies/src/web/mailbox-uses/shared/index.ts new file mode 100644 index 0000000..ec1eb83 --- /dev/null +++ b/modules/companies/src/web/mailbox-uses/shared/index.ts @@ -0,0 +1 @@ +export { MailboxUseEditorDialog, MailboxUseForm } from "./ui"; diff --git a/modules/companies/src/web/mailbox-uses/shared/ui/index.ts b/modules/companies/src/web/mailbox-uses/shared/ui/index.ts new file mode 100644 index 0000000..28e23a1 --- /dev/null +++ b/modules/companies/src/web/mailbox-uses/shared/ui/index.ts @@ -0,0 +1,2 @@ +export { MailboxUseEditorDialog } from "./mailbox-use-editor-dialog"; +export { MailboxUseForm } from "./mailbox-use-form"; diff --git a/modules/companies/src/web/mail/mailbox-use-editor-dialog.tsx b/modules/companies/src/web/mailbox-uses/shared/ui/mailbox-use-editor-dialog.tsx similarity index 94% rename from modules/companies/src/web/mail/mailbox-use-editor-dialog.tsx rename to modules/companies/src/web/mailbox-uses/shared/ui/mailbox-use-editor-dialog.tsx index 3893f76..eae7387 100644 --- a/modules/companies/src/web/mail/mailbox-use-editor-dialog.tsx +++ b/modules/companies/src/web/mailbox-uses/shared/ui/mailbox-use-editor-dialog.tsx @@ -2,7 +2,7 @@ import { FormDialog } from "@repo/shadcn-ui/components/form-dialog"; import type { ComponentProps } from "react"; import { useTranslation } from "react-i18next"; -import type { CompanyDTO } from "../../common"; +import type { CompanyDTO } from "../../../../common"; import { MailboxUseForm } from "./mailbox-use-form"; diff --git a/modules/companies/src/web/mail/mailbox-use-form.tsx b/modules/companies/src/web/mailbox-uses/shared/ui/mailbox-use-form.tsx similarity index 92% rename from modules/companies/src/web/mail/mailbox-use-form.tsx rename to modules/companies/src/web/mailbox-uses/shared/ui/mailbox-use-form.tsx index 443cd4f..f8427d6 100644 --- a/modules/companies/src/web/mail/mailbox-use-form.tsx +++ b/modules/companies/src/web/mailbox-uses/shared/ui/mailbox-use-form.tsx @@ -10,15 +10,14 @@ import { useEffect, useId, useRef, useState } from "react"; import { useForm } from "react-hook-form"; import { useTranslation } from "react-i18next"; -import type { CompanyDTO } from "../../common"; -import type { MailboxUseDTO, MailboxUseInput } from "../../common/mailboxes"; -import { MailboxUseInputSchema } from "../../common/mailboxes"; -import { PersonEditorDialog } from "../components/person-editor-dialog"; - -import { mailKeys } from "./mail-api"; -import { MailFeedback } from "./mail-feedback"; -import { mailboxApi, mailboxKeys } from "./mailbox-api"; -import { MailboxCreateDialog } from "./mailbox-create-dialog"; +import type { CompanyDTO } from "../../../../common"; +import type { MailboxUseDTO, MailboxUseInput } from "../../../../common/mailboxes"; +import { MailboxUseInputSchema } from "../../../../common/mailboxes"; +import { mailKeys } from "../../../mail-configurations/shared/api"; +import { MailFeedback } from "../../../mail-configurations/shared/ui/mail-feedback"; +import { MailboxCreateDialog } from "../../../mailboxes/create"; +import { mailboxApi, mailboxKeys } from "../../../mailboxes/shared/api"; +import { PersonEditorDialog } from "../../../people"; export function MailboxUseForm({ company, diff --git a/modules/companies/src/web/mailboxes/create/index.ts b/modules/companies/src/web/mailboxes/create/index.ts new file mode 100644 index 0000000..df443a4 --- /dev/null +++ b/modules/companies/src/web/mailboxes/create/index.ts @@ -0,0 +1 @@ +export { MailboxCreateDialog } from "./ui"; diff --git a/modules/companies/src/web/mailboxes/create/ui/index.ts b/modules/companies/src/web/mailboxes/create/ui/index.ts new file mode 100644 index 0000000..0116f3f --- /dev/null +++ b/modules/companies/src/web/mailboxes/create/ui/index.ts @@ -0,0 +1 @@ +export { MailboxCreateDialog } from "./mailbox-create-dialog"; diff --git a/modules/companies/src/web/mail/mailbox-create-dialog.tsx b/modules/companies/src/web/mailboxes/create/ui/mailbox-create-dialog.tsx similarity index 86% rename from modules/companies/src/web/mail/mailbox-create-dialog.tsx rename to modules/companies/src/web/mailboxes/create/ui/mailbox-create-dialog.tsx index b81f2d3..e9b3994 100644 --- a/modules/companies/src/web/mail/mailbox-create-dialog.tsx +++ b/modules/companies/src/web/mailboxes/create/ui/mailbox-create-dialog.tsx @@ -1,9 +1,8 @@ import { FormDialog } from "@repo/shadcn-ui/components/form-dialog"; import { useTranslation } from "react-i18next"; -import type { CompanyDTO } from "../../common"; - -import { MailboxForm } from "./mailbox-form"; +import type { CompanyDTO } from "../../../../common"; +import { MailboxForm } from "../../shared/ui/mailbox-form"; export function MailboxCreateDialog({ company, diff --git a/modules/companies/src/web/mailboxes/index.ts b/modules/companies/src/web/mailboxes/index.ts new file mode 100644 index 0000000..42846dc --- /dev/null +++ b/modules/companies/src/web/mailboxes/index.ts @@ -0,0 +1 @@ +export { MailboxForm, MailboxRelations, mailboxApi, mailboxKeys } from "./shared"; diff --git a/modules/companies/src/web/mailboxes/shared/api/index.ts b/modules/companies/src/web/mailboxes/shared/api/index.ts new file mode 100644 index 0000000..71aa09c --- /dev/null +++ b/modules/companies/src/web/mailboxes/shared/api/index.ts @@ -0,0 +1 @@ +export { mailboxApi, mailboxKeys } from "./mailbox-api"; diff --git a/modules/companies/src/web/mail/mailbox-api.ts b/modules/companies/src/web/mailboxes/shared/api/mailbox-api.ts similarity index 81% rename from modules/companies/src/web/mail/mailbox-api.ts rename to modules/companies/src/web/mailboxes/shared/api/mailbox-api.ts index ca5c738..6b0000c 100644 --- a/modules/companies/src/web/mail/mailbox-api.ts +++ b/modules/companies/src/web/mailboxes/shared/api/mailbox-api.ts @@ -1,9 +1,8 @@ import { z } from "zod/v4"; -import type { MailboxInput, MailboxUseInput } from "../../common/mailboxes"; -import { MailboxesResponseSchema } from "../../common/mailboxes"; - -import { MailApiError } from "./mail-api"; +import type { MailboxInput, MailboxUseInput } from "../../../../common/mailboxes"; +import { MailboxesResponseSchema } from "../../../../common/mailboxes"; +import { MailApiError } from "../../../mail-configurations/shared/api"; export const mailboxKeys = { company: (id: string) => ["mailboxes", id] }; export const mailboxApi = { async request( diff --git a/modules/companies/src/web/mailboxes/shared/index.ts b/modules/companies/src/web/mailboxes/shared/index.ts new file mode 100644 index 0000000..5dddff3 --- /dev/null +++ b/modules/companies/src/web/mailboxes/shared/index.ts @@ -0,0 +1,2 @@ +export { mailboxApi, mailboxKeys } from "./api"; +export { MailboxForm, MailboxRelations } from "./ui"; diff --git a/modules/companies/src/web/mailboxes/shared/ui/index.ts b/modules/companies/src/web/mailboxes/shared/ui/index.ts new file mode 100644 index 0000000..268898b --- /dev/null +++ b/modules/companies/src/web/mailboxes/shared/ui/index.ts @@ -0,0 +1,2 @@ +export { MailboxForm } from "./mailbox-form"; +export { MailboxRelations } from "./mailbox-relations"; diff --git a/modules/companies/src/web/mail/mailbox-form.tsx b/modules/companies/src/web/mailboxes/shared/ui/mailbox-form.tsx similarity index 85% rename from modules/companies/src/web/mail/mailbox-form.tsx rename to modules/companies/src/web/mailboxes/shared/ui/mailbox-form.tsx index 410769d..9c9b281 100644 --- a/modules/companies/src/web/mail/mailbox-form.tsx +++ b/modules/companies/src/web/mailboxes/shared/ui/mailbox-form.tsx @@ -1,7 +1,7 @@ import { ResourceEditor } from "@metis/resources/client"; -import type { CompanyDTO } from "../../common"; -import type { MailboxDTO } from "../../common/mailboxes"; +import type { CompanyDTO } from "../../../../common"; +import type { MailboxDTO } from "../../../../common/mailboxes"; /** El alta rápida de correo utiliza la misma ficha y persistencia que Recursos. */ export function MailboxForm({ company, diff --git a/modules/companies/src/web/mail/mailbox-relations.tsx b/modules/companies/src/web/mailboxes/shared/ui/mailbox-relations.tsx similarity index 89% rename from modules/companies/src/web/mail/mailbox-relations.tsx rename to modules/companies/src/web/mailboxes/shared/ui/mailbox-relations.tsx index 33cc08f..cc13cea 100644 --- a/modules/companies/src/web/mail/mailbox-relations.tsx +++ b/modules/companies/src/web/mailboxes/shared/ui/mailbox-relations.tsx @@ -3,11 +3,10 @@ import { useQuery } from "@tanstack/react-query"; import { useState } from "react"; import { useTranslation } from "react-i18next"; -import type { CompanyDTO } from "../../common"; - -import { MailFeedback } from "./mail-feedback"; -import { mailboxApi, mailboxKeys } from "./mailbox-api"; -import { MailboxUseEditorDialog } from "./mailbox-use-editor-dialog"; +import type { CompanyDTO } from "../../../../common"; +import { MailFeedback } from "../../../mail-configurations/shared/ui/mail-feedback"; +import { MailboxUseEditorDialog } from "../../../mailbox-uses"; +import { mailboxApi, mailboxKeys } from "../api"; export function MailboxRelations({ company, csrfToken, diff --git a/modules/companies/src/web/people/detail/index.ts b/modules/companies/src/web/people/detail/index.ts new file mode 100644 index 0000000..1f71b7c --- /dev/null +++ b/modules/companies/src/web/people/detail/index.ts @@ -0,0 +1 @@ +export { PersonDetails } from "./ui"; diff --git a/modules/companies/src/web/people/detail/ui/index.ts b/modules/companies/src/web/people/detail/ui/index.ts new file mode 100644 index 0000000..9dd8d90 --- /dev/null +++ b/modules/companies/src/web/people/detail/ui/index.ts @@ -0,0 +1 @@ +export { PersonDetails } from "./person-details"; diff --git a/modules/companies/src/web/components/person-details.tsx b/modules/companies/src/web/people/detail/ui/person-details.tsx similarity index 96% rename from modules/companies/src/web/components/person-details.tsx rename to modules/companies/src/web/people/detail/ui/person-details.tsx index 417a96d..02a40ba 100644 --- a/modules/companies/src/web/components/person-details.tsx +++ b/modules/companies/src/web/people/detail/ui/person-details.tsx @@ -9,10 +9,8 @@ import { import { useState } from "react"; import { useTranslation } from "react-i18next"; -import type { CompanyDTO, PersonDTO } from "../../common"; - -import { AssignmentEditorDialog } from "./assignment-editor-dialog"; -import { AssignmentHistoryDialog } from "./assignment-history-dialog"; +import type { CompanyDTO, PersonDTO } from "../../../../common"; +import { AssignmentEditorDialog, AssignmentHistoryDialog } from "../../../assignments"; export function PersonDetails({ company, diff --git a/modules/companies/src/web/people/index.ts b/modules/companies/src/web/people/index.ts new file mode 100644 index 0000000..0d8a350 --- /dev/null +++ b/modules/companies/src/web/people/index.ts @@ -0,0 +1,2 @@ +export { PeopleSection } from "./list"; +export { PersonEditorDialog, PersonForm } from "./shared"; diff --git a/modules/companies/src/web/people/list/index.ts b/modules/companies/src/web/people/list/index.ts new file mode 100644 index 0000000..d89e4df --- /dev/null +++ b/modules/companies/src/web/people/list/index.ts @@ -0,0 +1 @@ +export { PeopleSection } from "./ui"; diff --git a/modules/companies/src/web/people/list/ui/index.ts b/modules/companies/src/web/people/list/ui/index.ts new file mode 100644 index 0000000..ab76341 --- /dev/null +++ b/modules/companies/src/web/people/list/ui/index.ts @@ -0,0 +1 @@ +export { PeopleSection } from "./people-section"; diff --git a/modules/companies/src/web/components/people-section.tsx b/modules/companies/src/web/people/list/ui/people-section.tsx similarity index 97% rename from modules/companies/src/web/components/people-section.tsx rename to modules/companies/src/web/people/list/ui/people-section.tsx index e3e0f1b..c27649d 100644 --- a/modules/companies/src/web/components/people-section.tsx +++ b/modules/companies/src/web/people/list/ui/people-section.tsx @@ -11,10 +11,9 @@ import { Label } from "@repo/shadcn-ui/components/label"; import { useId, useState } from "react"; import { useTranslation } from "react-i18next"; -import type { CompanyDTO } from "../../common"; - -import { PersonDetails } from "./person-details"; -import { PersonEditorDialog } from "./person-editor-dialog"; +import type { CompanyDTO } from "../../../../common"; +import { PersonDetails } from "../../detail"; +import { PersonEditorDialog } from "../../shared"; export function PeopleSection({ company, diff --git a/modules/companies/src/web/people/shared/index.ts b/modules/companies/src/web/people/shared/index.ts new file mode 100644 index 0000000..8169197 --- /dev/null +++ b/modules/companies/src/web/people/shared/index.ts @@ -0,0 +1 @@ +export { PersonEditorDialog, PersonForm } from "./ui"; diff --git a/modules/companies/src/web/people/shared/ui/index.ts b/modules/companies/src/web/people/shared/ui/index.ts new file mode 100644 index 0000000..478f8ff --- /dev/null +++ b/modules/companies/src/web/people/shared/ui/index.ts @@ -0,0 +1,2 @@ +export { PersonEditorDialog } from "./person-editor-dialog"; +export { PersonForm } from "./person-form"; diff --git a/modules/companies/src/web/components/person-editor-dialog.tsx b/modules/companies/src/web/people/shared/ui/person-editor-dialog.tsx similarity index 100% rename from modules/companies/src/web/components/person-editor-dialog.tsx rename to modules/companies/src/web/people/shared/ui/person-editor-dialog.tsx diff --git a/modules/companies/src/web/components/person-form.tsx b/modules/companies/src/web/people/shared/ui/person-form.tsx similarity index 91% rename from modules/companies/src/web/components/person-form.tsx rename to modules/companies/src/web/people/shared/ui/person-form.tsx index 3cd6846..1f383f8 100644 --- a/modules/companies/src/web/components/person-form.tsx +++ b/modules/companies/src/web/people/shared/ui/person-form.tsx @@ -10,15 +10,13 @@ import { useForm } from "react-hook-form"; import { useTranslation } from "react-i18next"; import { z } from "zod/v4"; -import type { PersonDTO } from "../../common"; -import { PersonRequestSchema } from "../../common"; -import { accessKeys } from "../access/access-api"; -import { EntityHelp } from "../access/entity-help"; -import { companyApi, companyKeys } from "../api/company-api"; -import { remoteKeys } from "../remote/remote-api"; -import { teleworkKeys } from "../telework/telework-api"; - -import { CompanyFeedback } from "./company-feedback"; +import type { PersonDTO } from "../../../../common"; +import { PersonRequestSchema } from "../../../../common"; +import { EntityHelp } from "../../../access/help"; +import { accessKeys } from "../../../access/shared/api"; +import { CompanyFeedback, companyApi, companyKeys } from "../../../companies/shared"; +import { remoteKeys } from "../../../remote-connections/shared/api"; +import { teleworkKeys } from "../../../telework-authorizations/shared/api"; const PersonFormSchema = PersonRequestSchema.extend({ position: z.string().max(100), diff --git a/modules/companies/src/web/printer-configurations/create/index.ts b/modules/companies/src/web/printer-configurations/create/index.ts new file mode 100644 index 0000000..741dd1c --- /dev/null +++ b/modules/companies/src/web/printer-configurations/create/index.ts @@ -0,0 +1 @@ +export { PrinterProfileCreateDialog } from "./ui"; diff --git a/modules/companies/src/web/printer-configurations/create/ui/index.ts b/modules/companies/src/web/printer-configurations/create/ui/index.ts new file mode 100644 index 0000000..220c926 --- /dev/null +++ b/modules/companies/src/web/printer-configurations/create/ui/index.ts @@ -0,0 +1 @@ +export { PrinterProfileCreateDialog } from "./printer-profile-create-dialog"; diff --git a/modules/companies/src/web/printers/printer-profile-create-dialog.tsx b/modules/companies/src/web/printer-configurations/create/ui/printer-profile-create-dialog.tsx similarity index 86% rename from modules/companies/src/web/printers/printer-profile-create-dialog.tsx rename to modules/companies/src/web/printer-configurations/create/ui/printer-profile-create-dialog.tsx index 8f8c245..6ddb758 100644 --- a/modules/companies/src/web/printers/printer-profile-create-dialog.tsx +++ b/modules/companies/src/web/printer-configurations/create/ui/printer-profile-create-dialog.tsx @@ -1,8 +1,8 @@ import { FormDialog } from "@repo/shadcn-ui/components/form-dialog"; import { useTranslation } from "react-i18next"; -import type { CompanyDTO } from "../../common"; -import { WorkProfileForm } from "../profiles/work-profile-form"; +import type { CompanyDTO } from "../../../../common"; +import { WorkProfileForm } from "../../../work-profiles/shared"; export function PrinterProfileCreateDialog({ company, diff --git a/modules/companies/src/web/printer-configurations/history/index.ts b/modules/companies/src/web/printer-configurations/history/index.ts new file mode 100644 index 0000000..d5e5fcd --- /dev/null +++ b/modules/companies/src/web/printer-configurations/history/index.ts @@ -0,0 +1 @@ +export { PrinterHistoryDialog } from "./ui"; diff --git a/modules/companies/src/web/printer-configurations/history/ui/index.ts b/modules/companies/src/web/printer-configurations/history/ui/index.ts new file mode 100644 index 0000000..2de8287 --- /dev/null +++ b/modules/companies/src/web/printer-configurations/history/ui/index.ts @@ -0,0 +1 @@ +export { PrinterHistoryDialog } from "./printer-history-dialog"; diff --git a/modules/companies/src/web/printers/printer-history-dialog.tsx b/modules/companies/src/web/printer-configurations/history/ui/printer-history-dialog.tsx similarity index 95% rename from modules/companies/src/web/printers/printer-history-dialog.tsx rename to modules/companies/src/web/printer-configurations/history/ui/printer-history-dialog.tsx index cb4fe03..b763768 100644 --- a/modules/companies/src/web/printers/printer-history-dialog.tsx +++ b/modules/companies/src/web/printer-configurations/history/ui/printer-history-dialog.tsx @@ -1,7 +1,7 @@ import { FormDialog } from "@repo/shadcn-ui/components/form-dialog"; import { useTranslation } from "react-i18next"; -import type { PrinterConfigurationDTO } from "../../common"; +import type { PrinterConfigurationDTO } from "../../../../common"; export function PrinterHistoryDialog({ configuration, diff --git a/modules/companies/src/web/printer-configurations/index.ts b/modules/companies/src/web/printer-configurations/index.ts new file mode 100644 index 0000000..b9ee508 --- /dev/null +++ b/modules/companies/src/web/printer-configurations/index.ts @@ -0,0 +1,2 @@ +export { PrinterConfigurationsPage } from "./list"; +export { printerApi, printerKeys } from "./shared"; diff --git a/modules/companies/src/web/printer-configurations/list/index.ts b/modules/companies/src/web/printer-configurations/list/index.ts new file mode 100644 index 0000000..3f11277 --- /dev/null +++ b/modules/companies/src/web/printer-configurations/list/index.ts @@ -0,0 +1 @@ +export { PrinterConfigurationsPage } from "./ui"; diff --git a/modules/companies/src/web/printer-configurations/list/ui/index.ts b/modules/companies/src/web/printer-configurations/list/ui/index.ts new file mode 100644 index 0000000..5afaf74 --- /dev/null +++ b/modules/companies/src/web/printer-configurations/list/ui/index.ts @@ -0,0 +1 @@ +export { PrinterConfigurationsPage } from "./printer-configurations-page"; diff --git a/modules/companies/src/web/printers/printer-configurations-page.tsx b/modules/companies/src/web/printer-configurations/list/ui/printer-configurations-page.tsx similarity index 94% rename from modules/companies/src/web/printers/printer-configurations-page.tsx rename to modules/companies/src/web/printer-configurations/list/ui/printer-configurations-page.tsx index 1bd8292..5566371 100644 --- a/modules/companies/src/web/printers/printer-configurations-page.tsx +++ b/modules/companies/src/web/printer-configurations/list/ui/printer-configurations-page.tsx @@ -11,13 +11,15 @@ import { useQuery } from "@tanstack/react-query"; import { useState } from "react"; import { useTranslation } from "react-i18next"; -import type { CompanyDTO } from "../../common"; -import { profileApi, profileKeys } from "../profiles/work-profile-api"; - -import { printerApi, printerKeys } from "./printer-api"; -import { PrinterConfigurationEditorDialog } from "./printer-configuration-editor-dialog"; -import { PrinterFeedback } from "./printer-feedback"; -import { PrinterHistoryDialog } from "./printer-history-dialog"; +import type { CompanyDTO } from "../../../../common"; +import { profileApi, profileKeys } from "../../../work-profiles/shared"; +import { PrinterHistoryDialog } from "../../history"; +import { + PrinterConfigurationEditorDialog, + PrinterFeedback, + printerApi, + printerKeys, +} from "../../shared"; export function PrinterConfigurationsPage({ company, diff --git a/modules/companies/src/web/printer-configurations/shared/api/index.ts b/modules/companies/src/web/printer-configurations/shared/api/index.ts new file mode 100644 index 0000000..c7cc9a9 --- /dev/null +++ b/modules/companies/src/web/printer-configurations/shared/api/index.ts @@ -0,0 +1 @@ +export { PrinterApiError, printerApi, printerKeys } from "./printer-api"; diff --git a/modules/companies/src/web/printers/printer-api.ts b/modules/companies/src/web/printer-configurations/shared/api/printer-api.ts similarity index 90% rename from modules/companies/src/web/printers/printer-api.ts rename to modules/companies/src/web/printer-configurations/shared/api/printer-api.ts index 8cdd3bd..f311b8a 100644 --- a/modules/companies/src/web/printers/printer-api.ts +++ b/modules/companies/src/web/printer-configurations/shared/api/printer-api.ts @@ -1,10 +1,10 @@ import { z } from "zod/v4"; -import type { PrinterConfigurationInput } from "../../common/printer-configurations"; +import type { PrinterConfigurationInput } from "../../../../common/printer-configurations"; import { PrinterConfigurationResponseSchema, PrinterConfigurationsResponseSchema, -} from "../../common/printer-configurations"; +} from "../../../../common/printer-configurations"; export const printerKeys = { company: (id: string) => ["printer-configurations", id] }; export class PrinterApiError extends Error { constructor(public readonly code: string) { diff --git a/modules/companies/src/web/printer-configurations/shared/index.ts b/modules/companies/src/web/printer-configurations/shared/index.ts new file mode 100644 index 0000000..4a0d6b0 --- /dev/null +++ b/modules/companies/src/web/printer-configurations/shared/index.ts @@ -0,0 +1,2 @@ +export { printerApi, printerKeys } from "./api"; +export { PrinterConfigurationEditorDialog, PrinterFeedback } from "./ui"; diff --git a/modules/companies/src/web/printers/printer.test.tsx b/modules/companies/src/web/printer-configurations/shared/printer.test.tsx similarity index 89% rename from modules/companies/src/web/printers/printer.test.tsx rename to modules/companies/src/web/printer-configurations/shared/printer.test.tsx index bfb937c..d156ab0 100644 --- a/modules/companies/src/web/printers/printer.test.tsx +++ b/modules/companies/src/web/printer-configurations/shared/printer.test.tsx @@ -8,12 +8,12 @@ import type { ReactNode } from "react"; import { renderToStaticMarkup } from "react-dom/server"; import { I18nextProvider } from "react-i18next"; -import { companiesEnglish, companiesSpanish } from "../i18n"; -import { profileKeys } from "../profiles/work-profile-api"; +import { companiesEnglish, companiesSpanish } from "../../shared"; +import { profileKeys } from "../../work-profiles"; +import { PrinterConfigurationsPage } from "../list"; -import { printerKeys } from "./printer-api"; -import { PrinterConfigurationForm } from "./printer-configuration-form"; -import { PrinterConfigurationsPage } from "./printer-configurations-page"; +import { printerKeys } from "./api"; +import { PrinterConfigurationForm } from "./ui"; const company = { id: "0199b200-0000-7000-8000-000000000001", diff --git a/modules/companies/src/web/printer-configurations/shared/ui/index.ts b/modules/companies/src/web/printer-configurations/shared/ui/index.ts new file mode 100644 index 0000000..a4f57e2 --- /dev/null +++ b/modules/companies/src/web/printer-configurations/shared/ui/index.ts @@ -0,0 +1,3 @@ +export { PrinterConfigurationEditorDialog } from "./printer-configuration-editor-dialog"; +export { PrinterConfigurationForm } from "./printer-configuration-form"; +export { PrinterFeedback } from "./printer-feedback"; diff --git a/modules/companies/src/web/printers/printer-configuration-editor-dialog.tsx b/modules/companies/src/web/printer-configurations/shared/ui/printer-configuration-editor-dialog.tsx similarity index 95% rename from modules/companies/src/web/printers/printer-configuration-editor-dialog.tsx rename to modules/companies/src/web/printer-configurations/shared/ui/printer-configuration-editor-dialog.tsx index c60dbea..1925b40 100644 --- a/modules/companies/src/web/printers/printer-configuration-editor-dialog.tsx +++ b/modules/companies/src/web/printer-configurations/shared/ui/printer-configuration-editor-dialog.tsx @@ -2,7 +2,7 @@ import { FormDialog } from "@repo/shadcn-ui/components/form-dialog"; import type { ComponentProps } from "react"; import { useTranslation } from "react-i18next"; -import type { CompanyDTO } from "../../common"; +import type { CompanyDTO } from "../../../../common"; import { PrinterConfigurationForm } from "./printer-configuration-form"; diff --git a/modules/companies/src/web/printers/printer-configuration-form.tsx b/modules/companies/src/web/printer-configurations/shared/ui/printer-configuration-form.tsx similarity index 95% rename from modules/companies/src/web/printers/printer-configuration-form.tsx rename to modules/companies/src/web/printer-configurations/shared/ui/printer-configuration-form.tsx index 75e0c6d..44923b5 100644 --- a/modules/companies/src/web/printers/printer-configuration-form.tsx +++ b/modules/companies/src/web/printer-configurations/shared/ui/printer-configuration-form.tsx @@ -12,21 +12,21 @@ import { useEffect, useId, useRef, useState } from "react"; import { useForm } from "react-hook-form"; import { useTranslation } from "react-i18next"; -import type { CompanyDTO, WorkProfileDTO } from "../../common"; +import type { CompanyDTO, WorkProfileDTO } from "../../../../common"; import type { PrinterConfigurationDTO, PrinterConfigurationInput, -} from "../../common/printer-configurations"; +} from "../../../../common/printer-configurations"; import { PRINTER_STATE_TRANSITIONS, PrinterConfigurationInputSchema, -} from "../../common/printer-configurations"; -import { ConfigurationQuickEditor } from "../components/configuration-quick-editor"; -import { profileApi, profileKeys } from "../profiles/work-profile-api"; +} from "../../../../common/printer-configurations"; +import { ConfigurationQuickEditor } from "../../../shared"; +import { profileApi, profileKeys } from "../../../work-profiles/shared"; +import { PrinterProfileCreateDialog } from "../../create"; +import { printerApi, printerKeys } from "../api"; -import { printerApi, printerKeys } from "./printer-api"; import { PrinterFeedback } from "./printer-feedback"; -import { PrinterProfileCreateDialog } from "./printer-profile-create-dialog"; export function PrinterConfigurationForm({ company, csrfToken, diff --git a/modules/companies/src/web/printers/printer-feedback.tsx b/modules/companies/src/web/printer-configurations/shared/ui/printer-feedback.tsx similarity index 88% rename from modules/companies/src/web/printers/printer-feedback.tsx rename to modules/companies/src/web/printer-configurations/shared/ui/printer-feedback.tsx index 36649cb..353804a 100644 --- a/modules/companies/src/web/printers/printer-feedback.tsx +++ b/modules/companies/src/web/printer-configurations/shared/ui/printer-feedback.tsx @@ -1,6 +1,6 @@ import { useTranslation } from "react-i18next"; -import { PrinterApiError } from "./printer-api"; +import { PrinterApiError } from "../api"; export function PrinterFeedback({ error }: { error: Error | null }) { const { t } = useTranslation("companies"); return error ? ( diff --git a/modules/companies/src/web/process-templates/index.ts b/modules/companies/src/web/process-templates/index.ts new file mode 100644 index 0000000..c35bc2c --- /dev/null +++ b/modules/companies/src/web/process-templates/index.ts @@ -0,0 +1,2 @@ +export { ProcessTemplatesPage } from "./list"; +export { ProcessTemplateForm } from "./shared"; diff --git a/modules/companies/src/web/process-templates/list/index.ts b/modules/companies/src/web/process-templates/list/index.ts new file mode 100644 index 0000000..c7ab1eb --- /dev/null +++ b/modules/companies/src/web/process-templates/list/index.ts @@ -0,0 +1 @@ +export { ProcessTemplatesPage } from "./ui"; diff --git a/modules/companies/src/web/process-templates/list/ui/index.ts b/modules/companies/src/web/process-templates/list/ui/index.ts new file mode 100644 index 0000000..7d254c5 --- /dev/null +++ b/modules/companies/src/web/process-templates/list/ui/index.ts @@ -0,0 +1 @@ +export { ProcessTemplatesPage } from "./process-templates-page"; diff --git a/modules/companies/src/web/processes/process-templates-page.tsx b/modules/companies/src/web/process-templates/list/ui/process-templates-page.tsx similarity index 96% rename from modules/companies/src/web/processes/process-templates-page.tsx rename to modules/companies/src/web/process-templates/list/ui/process-templates-page.tsx index 6ca00be..460edb1 100644 --- a/modules/companies/src/web/processes/process-templates-page.tsx +++ b/modules/companies/src/web/process-templates/list/ui/process-templates-page.tsx @@ -10,9 +10,8 @@ import { useQuery } from "@tanstack/react-query"; import { useState } from "react"; import { useTranslation } from "react-i18next"; -import { processApi, processKeys } from "./process-api"; -import { ProcessFeedback } from "./process-feedback"; -import { ProcessTemplateEditorDialog } from "./process-template-editor-dialog"; +import { ProcessFeedback, processApi, processKeys } from "../../../processes/shared"; +import { ProcessTemplateEditorDialog } from "../../shared"; export function ProcessTemplatesPage({ csrfToken }: { csrfToken: string }) { const { t, i18n } = useTranslation("companies"); const query = useQuery({ queryKey: processKeys.catalog(), queryFn: processApi.catalog }); diff --git a/modules/companies/src/web/process-templates/shared/index.ts b/modules/companies/src/web/process-templates/shared/index.ts new file mode 100644 index 0000000..36bd4f4 --- /dev/null +++ b/modules/companies/src/web/process-templates/shared/index.ts @@ -0,0 +1 @@ +export { ProcessTemplateEditorDialog, ProcessTemplateForm } from "./ui"; diff --git a/modules/companies/src/web/process-templates/shared/ui/index.ts b/modules/companies/src/web/process-templates/shared/ui/index.ts new file mode 100644 index 0000000..d0509ce --- /dev/null +++ b/modules/companies/src/web/process-templates/shared/ui/index.ts @@ -0,0 +1,2 @@ +export { ProcessTemplateEditorDialog } from "./process-template-editor-dialog"; +export { ProcessTemplateForm } from "./process-template-form"; diff --git a/modules/companies/src/web/processes/process-template-editor-dialog.tsx b/modules/companies/src/web/process-templates/shared/ui/process-template-editor-dialog.tsx similarity index 100% rename from modules/companies/src/web/processes/process-template-editor-dialog.tsx rename to modules/companies/src/web/process-templates/shared/ui/process-template-editor-dialog.tsx diff --git a/modules/companies/src/web/processes/process-template-form.tsx b/modules/companies/src/web/process-templates/shared/ui/process-template-form.tsx similarity index 95% rename from modules/companies/src/web/processes/process-template-form.tsx rename to modules/companies/src/web/process-templates/shared/ui/process-template-form.tsx index dadbcb2..993d9a1 100644 --- a/modules/companies/src/web/processes/process-template-form.tsx +++ b/modules/companies/src/web/process-templates/shared/ui/process-template-form.tsx @@ -12,12 +12,9 @@ import { useForm } from "react-hook-form"; import { useTranslation } from "react-i18next"; import { z } from "zod/v4"; -import type { ProcessTemplateDTO, ProcessTemplateInput } from "../../common/processes"; -import { ProcessTemplateInputSchema } from "../../common/processes"; - -import { processApi, processKeys } from "./process-api"; -import { ProcessFeedback } from "./process-feedback"; -import { ProcessHelp } from "./process-help"; +import type { ProcessTemplateDTO, ProcessTemplateInput } from "../../../../common/processes"; +import { ProcessTemplateInputSchema } from "../../../../common/processes"; +import { ProcessFeedback, ProcessHelp, processApi, processKeys } from "../../../processes/shared"; const FormSchema = z.strictObject({ name: ProcessTemplateInputSchema.shape.name, diff --git a/modules/companies/src/web/processes/create/index.ts b/modules/companies/src/web/processes/create/index.ts new file mode 100644 index 0000000..6dc7171 --- /dev/null +++ b/modules/companies/src/web/processes/create/index.ts @@ -0,0 +1 @@ +export { ProcessQuickCreateDialog } from "./ui"; diff --git a/modules/companies/src/web/processes/create/ui/index.ts b/modules/companies/src/web/processes/create/ui/index.ts new file mode 100644 index 0000000..8bed23c --- /dev/null +++ b/modules/companies/src/web/processes/create/ui/index.ts @@ -0,0 +1 @@ +export { ProcessQuickCreateDialog } from "./process-quick-create-dialog"; diff --git a/modules/companies/src/web/processes/process-quick-create-dialog.tsx b/modules/companies/src/web/processes/create/ui/process-quick-create-dialog.tsx similarity index 88% rename from modules/companies/src/web/processes/process-quick-create-dialog.tsx rename to modules/companies/src/web/processes/create/ui/process-quick-create-dialog.tsx index 5c3ff1e..8399d4e 100644 --- a/modules/companies/src/web/processes/process-quick-create-dialog.tsx +++ b/modules/companies/src/web/processes/create/ui/process-quick-create-dialog.tsx @@ -1,9 +1,8 @@ import { FormDialog } from "@repo/shadcn-ui/components/form-dialog"; import { useTranslation } from "react-i18next"; -import { PersonForm } from "../components/person-form"; - -import { ProcessTemplateForm } from "./process-template-form"; +import { PersonForm } from "../../../people"; +import { ProcessTemplateForm } from "../../../process-templates"; export function ProcessQuickCreateDialog({ quick, diff --git a/modules/companies/src/web/processes/detail/index.ts b/modules/companies/src/web/processes/detail/index.ts new file mode 100644 index 0000000..6b792ff --- /dev/null +++ b/modules/companies/src/web/processes/detail/index.ts @@ -0,0 +1 @@ +export { ProcessDetail } from "./ui"; diff --git a/modules/companies/src/web/processes/detail/ui/index.ts b/modules/companies/src/web/processes/detail/ui/index.ts new file mode 100644 index 0000000..c77d711 --- /dev/null +++ b/modules/companies/src/web/processes/detail/ui/index.ts @@ -0,0 +1 @@ +export { ProcessDetail } from "./process-detail"; diff --git a/modules/companies/src/web/processes/process-detail.tsx b/modules/companies/src/web/processes/detail/ui/process-detail.tsx similarity index 94% rename from modules/companies/src/web/processes/process-detail.tsx rename to modules/companies/src/web/processes/detail/ui/process-detail.tsx index 1febe98..24f6d94 100644 --- a/modules/companies/src/web/processes/process-detail.tsx +++ b/modules/companies/src/web/processes/detail/ui/process-detail.tsx @@ -4,12 +4,15 @@ import { useMutation, useQueryClient } from "@tanstack/react-query"; import { useState } from "react"; import { useTranslation } from "react-i18next"; -import type { PersonProcessDTO } from "../../common/processes"; - -import { processApi, processKeys } from "./process-api"; -import { ProcessEditDialog } from "./process-edit-dialog"; -import { ProcessFeedback } from "./process-feedback"; -import { processReferenceTitle, processTaskTitle } from "./process-labels"; +import type { PersonProcessDTO } from "../../../../common/processes"; +import { + ProcessFeedback, + processApi, + processKeys, + processReferenceTitle, + processTaskTitle, +} from "../../shared"; +import { ProcessEditDialog } from "../../update"; export function ProcessDetail({ process, person, diff --git a/modules/companies/src/web/processes/index.ts b/modules/companies/src/web/processes/index.ts new file mode 100644 index 0000000..0e4a78a --- /dev/null +++ b/modules/companies/src/web/processes/index.ts @@ -0,0 +1 @@ +export { ProcessesPage } from "./list"; diff --git a/modules/companies/src/web/processes/list/index.ts b/modules/companies/src/web/processes/list/index.ts new file mode 100644 index 0000000..022dc18 --- /dev/null +++ b/modules/companies/src/web/processes/list/index.ts @@ -0,0 +1 @@ +export { ProcessesPage } from "./ui"; diff --git a/modules/companies/src/web/processes/list/ui/index.ts b/modules/companies/src/web/processes/list/ui/index.ts new file mode 100644 index 0000000..88121e2 --- /dev/null +++ b/modules/companies/src/web/processes/list/ui/index.ts @@ -0,0 +1 @@ +export { ProcessesPage } from "./processes-page"; diff --git a/modules/companies/src/web/processes/processes-page.tsx b/modules/companies/src/web/processes/list/ui/processes-page.tsx similarity index 95% rename from modules/companies/src/web/processes/processes-page.tsx rename to modules/companies/src/web/processes/list/ui/processes-page.tsx index f168704..da70cd6 100644 --- a/modules/companies/src/web/processes/processes-page.tsx +++ b/modules/companies/src/web/processes/list/ui/processes-page.tsx @@ -10,13 +10,11 @@ import { useQuery } from "@tanstack/react-query"; import { useState } from "react"; import { useTranslation } from "react-i18next"; -import type { CompanyDTO } from "../../common"; - -import { processApi, processKeys } from "./process-api"; -import { ProcessDetail } from "./process-detail"; -import { ProcessFeedback } from "./process-feedback"; -import { ProcessStartDialog } from "./process-start-dialog"; -import { ProcessTemplatesPage } from "./process-templates-page"; +import type { CompanyDTO } from "../../../../common"; +import { ProcessTemplatesPage } from "../../../process-templates"; +import { ProcessDetail } from "../../detail"; +import { ProcessFeedback, processApi, processKeys } from "../../shared"; +import { ProcessStartDialog } from "../../start"; export function ProcessesPage({ company, csrfToken }: { company: CompanyDTO; csrfToken: string }) { const { t, i18n } = useTranslation("companies"); const [templates, setTemplates] = useState(false); diff --git a/modules/companies/src/web/processes/shared/api/index.ts b/modules/companies/src/web/processes/shared/api/index.ts new file mode 100644 index 0000000..8ce2928 --- /dev/null +++ b/modules/companies/src/web/processes/shared/api/index.ts @@ -0,0 +1 @@ +export { ProcessApiError, processApi, processKeys } from "./process-api"; diff --git a/modules/companies/src/web/processes/process-api.ts b/modules/companies/src/web/processes/shared/api/process-api.ts similarity index 96% rename from modules/companies/src/web/processes/process-api.ts rename to modules/companies/src/web/processes/shared/api/process-api.ts index 3d01120..9e54c53 100644 --- a/modules/companies/src/web/processes/process-api.ts +++ b/modules/companies/src/web/processes/shared/api/process-api.ts @@ -4,14 +4,14 @@ import type { ProcessTemplateInput, StartProcessInput, UpdateProcessInput, -} from "../../common/processes"; +} from "../../../../common/processes"; import { ProcessResponseSchema, ProcessReviewResponseSchema, ProcessTemplateResponseSchema, ProcessTemplatesResponseSchema, ProcessesResponseSchema, -} from "../../common/processes"; +} from "../../../../common/processes"; export const processKeys = { company: (id: string) => ["person-processes", id], catalog: () => ["process-templates"], diff --git a/modules/companies/src/web/processes/shared/helpers/index.ts b/modules/companies/src/web/processes/shared/helpers/index.ts new file mode 100644 index 0000000..9b8bf2d --- /dev/null +++ b/modules/companies/src/web/processes/shared/helpers/index.ts @@ -0,0 +1 @@ +export { processReferenceTitle, processTaskTitle } from "./process-labels"; diff --git a/modules/companies/src/web/processes/process-labels.ts b/modules/companies/src/web/processes/shared/helpers/process-labels.ts similarity index 94% rename from modules/companies/src/web/processes/process-labels.ts rename to modules/companies/src/web/processes/shared/helpers/process-labels.ts index ff511f9..c51a1d5 100644 --- a/modules/companies/src/web/processes/process-labels.ts +++ b/modules/companies/src/web/processes/shared/helpers/process-labels.ts @@ -1,6 +1,6 @@ import type { TFunction } from "i18next"; -import type { ProcessReferenceInput, ProcessTaskInput } from "../../common/processes"; +import type { ProcessReferenceInput, ProcessTaskInput } from "../../../../common/processes"; export function processReferenceTitle(ref: ProcessReferenceInput, t: TFunction) { const origin = ref.sourceKind ? t(`remote.${ref.sourceKind}`) : ""; return [t(`processes.reference.${ref.kind}`), ref.label, origin].filter(Boolean).join(" · "); diff --git a/modules/companies/src/web/processes/shared/index.ts b/modules/companies/src/web/processes/shared/index.ts new file mode 100644 index 0000000..0c9df32 --- /dev/null +++ b/modules/companies/src/web/processes/shared/index.ts @@ -0,0 +1,3 @@ +export { processApi, processKeys } from "./api"; +export { processReferenceTitle, processTaskTitle } from "./helpers"; +export { ProcessFeedback, ProcessHelp } from "./ui"; diff --git a/modules/companies/src/web/processes/processes.test.tsx b/modules/companies/src/web/processes/shared/processes.test.tsx similarity index 91% rename from modules/companies/src/web/processes/processes.test.tsx rename to modules/companies/src/web/processes/shared/processes.test.tsx index 9154873..cf13b7f 100644 --- a/modules/companies/src/web/processes/processes.test.tsx +++ b/modules/companies/src/web/processes/shared/processes.test.tsx @@ -7,16 +7,15 @@ import type { ReactNode } from "react"; import { renderToStaticMarkup } from "react-dom/server"; import { I18nextProvider } from "react-i18next"; -import { PersonProcessSchema } from "../../common/processes"; -import { companiesEnglish, companiesSpanish } from "../i18n"; +import { PersonProcessSchema } from "../../../common/processes"; +import { ProcessTemplateForm, ProcessTemplatesPage } from "../../process-templates"; +import { companiesEnglish, companiesSpanish } from "../../shared"; +import { ProcessDetail } from "../detail"; +import { ProcessesPage } from "../list"; +import { ProcessStartForm } from "../start"; +import { ProcessEditForm } from "../update"; -import { processKeys } from "./process-api"; -import { ProcessDetail } from "./process-detail"; -import { ProcessEditForm } from "./process-edit-form"; -import { ProcessStartForm } from "./process-start-form"; -import { ProcessTemplateForm } from "./process-template-form"; -import { ProcessTemplatesPage } from "./process-templates-page"; -import { ProcessesPage } from "./processes-page"; +import { processKeys } from "./api"; const company = { id: "0199b200-0000-7000-8000-000000000001", diff --git a/modules/companies/src/web/processes/shared/ui/index.ts b/modules/companies/src/web/processes/shared/ui/index.ts new file mode 100644 index 0000000..5e5ac5d --- /dev/null +++ b/modules/companies/src/web/processes/shared/ui/index.ts @@ -0,0 +1,2 @@ +export { ProcessFeedback } from "./process-feedback"; +export { ProcessHelp } from "./process-help"; diff --git a/modules/companies/src/web/processes/process-feedback.tsx b/modules/companies/src/web/processes/shared/ui/process-feedback.tsx similarity index 92% rename from modules/companies/src/web/processes/process-feedback.tsx rename to modules/companies/src/web/processes/shared/ui/process-feedback.tsx index 5263249..6f245aa 100644 --- a/modules/companies/src/web/processes/process-feedback.tsx +++ b/modules/companies/src/web/processes/shared/ui/process-feedback.tsx @@ -1,6 +1,6 @@ import { useTranslation } from "react-i18next"; -import { ProcessApiError } from "./process-api"; +import { ProcessApiError } from "../api"; export function ProcessFeedback({ error, invalid = false, diff --git a/modules/companies/src/web/processes/process-help.tsx b/modules/companies/src/web/processes/shared/ui/process-help.tsx similarity index 100% rename from modules/companies/src/web/processes/process-help.tsx rename to modules/companies/src/web/processes/shared/ui/process-help.tsx diff --git a/modules/companies/src/web/processes/start/index.ts b/modules/companies/src/web/processes/start/index.ts new file mode 100644 index 0000000..1d6a028 --- /dev/null +++ b/modules/companies/src/web/processes/start/index.ts @@ -0,0 +1 @@ +export { ProcessStartDialog, ProcessStartForm } from "./ui"; diff --git a/modules/companies/src/web/processes/start/ui/index.ts b/modules/companies/src/web/processes/start/ui/index.ts new file mode 100644 index 0000000..475be78 --- /dev/null +++ b/modules/companies/src/web/processes/start/ui/index.ts @@ -0,0 +1,2 @@ +export { ProcessStartDialog } from "./process-start-dialog"; +export { ProcessStartForm } from "./process-start-form"; diff --git a/modules/companies/src/web/processes/process-start-dialog.tsx b/modules/companies/src/web/processes/start/ui/process-start-dialog.tsx similarity index 93% rename from modules/companies/src/web/processes/process-start-dialog.tsx rename to modules/companies/src/web/processes/start/ui/process-start-dialog.tsx index 2d4f1c6..c24015c 100644 --- a/modules/companies/src/web/processes/process-start-dialog.tsx +++ b/modules/companies/src/web/processes/start/ui/process-start-dialog.tsx @@ -2,7 +2,7 @@ import { FormDialog } from "@repo/shadcn-ui/components/form-dialog"; import type { ComponentProps } from "react"; import { useTranslation } from "react-i18next"; -import type { CompanyDTO } from "../../common"; +import type { CompanyDTO } from "../../../../common"; import { ProcessStartForm } from "./process-start-form"; diff --git a/modules/companies/src/web/processes/process-start-form.tsx b/modules/companies/src/web/processes/start/ui/process-start-form.tsx similarity index 93% rename from modules/companies/src/web/processes/process-start-form.tsx rename to modules/companies/src/web/processes/start/ui/process-start-form.tsx index ebf7d97..f5bd31f 100644 --- a/modules/companies/src/web/processes/process-start-form.tsx +++ b/modules/companies/src/web/processes/start/ui/process-start-form.tsx @@ -10,14 +10,11 @@ import { useEffect, useId, useRef, useState } from "react"; import { useForm } from "react-hook-form"; import { useTranslation } from "react-i18next"; -import type { CompanyDTO } from "../../common"; -import type { StartProcessInput } from "../../common/processes"; -import { StartProcessInputSchema } from "../../common/processes"; - -import { processApi, processKeys } from "./process-api"; -import { ProcessFeedback } from "./process-feedback"; -import { ProcessHelp } from "./process-help"; -import { ProcessQuickCreateDialog } from "./process-quick-create-dialog"; +import type { CompanyDTO } from "../../../../common"; +import type { StartProcessInput } from "../../../../common/processes"; +import { StartProcessInputSchema } from "../../../../common/processes"; +import { ProcessQuickCreateDialog } from "../../create"; +import { ProcessFeedback, ProcessHelp, processApi, processKeys } from "../../shared"; export function ProcessStartForm({ company, csrfToken, diff --git a/modules/companies/src/web/processes/update/index.ts b/modules/companies/src/web/processes/update/index.ts new file mode 100644 index 0000000..6a59744 --- /dev/null +++ b/modules/companies/src/web/processes/update/index.ts @@ -0,0 +1 @@ +export { ProcessEditDialog, ProcessEditForm } from "./ui"; diff --git a/modules/companies/src/web/processes/update/ui/index.ts b/modules/companies/src/web/processes/update/ui/index.ts new file mode 100644 index 0000000..297564d --- /dev/null +++ b/modules/companies/src/web/processes/update/ui/index.ts @@ -0,0 +1,2 @@ +export { ProcessEditDialog } from "./process-edit-dialog"; +export { ProcessEditForm } from "./process-edit-form"; diff --git a/modules/companies/src/web/processes/process-edit-dialog.tsx b/modules/companies/src/web/processes/update/ui/process-edit-dialog.tsx similarity index 100% rename from modules/companies/src/web/processes/process-edit-dialog.tsx rename to modules/companies/src/web/processes/update/ui/process-edit-dialog.tsx diff --git a/modules/companies/src/web/processes/process-edit-form.tsx b/modules/companies/src/web/processes/update/ui/process-edit-form.tsx similarity index 94% rename from modules/companies/src/web/processes/process-edit-form.tsx rename to modules/companies/src/web/processes/update/ui/process-edit-form.tsx index 1113415..06dd958 100644 --- a/modules/companies/src/web/processes/process-edit-form.tsx +++ b/modules/companies/src/web/processes/update/ui/process-edit-form.tsx @@ -10,12 +10,10 @@ import { useEffect, useId, useRef } from "react"; import { useForm } from "react-hook-form"; import { useTranslation } from "react-i18next"; -import type { PersonProcessDTO, UpdateProcessInput } from "../../common/processes"; -import { UpdateProcessInputSchema } from "../../common/processes"; +import type { PersonProcessDTO, UpdateProcessInput } from "../../../../common/processes"; +import { UpdateProcessInputSchema } from "../../../../common/processes"; +import { ProcessFeedback, ProcessHelp, processApi, processKeys } from "../../shared"; -import { processApi, processKeys } from "./process-api"; -import { ProcessFeedback } from "./process-feedback"; -import { ProcessHelp } from "./process-help"; import { ProcessTaskField } from "./process-task-field"; export function ProcessEditForm({ process, diff --git a/modules/companies/src/web/processes/process-task-field.tsx b/modules/companies/src/web/processes/update/ui/process-task-field.tsx similarity index 93% rename from modules/companies/src/web/processes/process-task-field.tsx rename to modules/companies/src/web/processes/update/ui/process-task-field.tsx index 3d3ccf2..286d9bb 100644 --- a/modules/companies/src/web/processes/process-task-field.tsx +++ b/modules/companies/src/web/processes/update/ui/process-task-field.tsx @@ -5,10 +5,9 @@ import { useId } from "react"; import type { UseFormReturn } from "react-hook-form"; import { useTranslation } from "react-i18next"; -import type { PersonProcessDTO, UpdateProcessInput } from "../../common/processes"; -import { ProcessValuesSchema } from "../../common/processes"; - -import { processTaskTitle } from "./process-labels"; +import type { PersonProcessDTO, UpdateProcessInput } from "../../../../common/processes"; +import { ProcessValuesSchema } from "../../../../common/processes"; +import { processTaskTitle } from "../../shared"; export function ProcessTaskField({ index, task, diff --git a/modules/companies/src/web/remote-connections/create/index.ts b/modules/companies/src/web/remote-connections/create/index.ts new file mode 100644 index 0000000..264e64f --- /dev/null +++ b/modules/companies/src/web/remote-connections/create/index.ts @@ -0,0 +1,2 @@ +export type { RemoteQuickKind } from "./ui"; +export { RemoteQuickEditor } from "./ui"; diff --git a/modules/companies/src/web/remote-connections/create/ui/index.ts b/modules/companies/src/web/remote-connections/create/ui/index.ts new file mode 100644 index 0000000..a814a7a --- /dev/null +++ b/modules/companies/src/web/remote-connections/create/ui/index.ts @@ -0,0 +1,2 @@ +export type { RemoteQuickKind } from "./remote-quick-editor"; +export { RemoteQuickEditor } from "./remote-quick-editor"; diff --git a/modules/companies/src/web/remote/remote-quick-editor.tsx b/modules/companies/src/web/remote-connections/create/ui/remote-quick-editor.tsx similarity index 90% rename from modules/companies/src/web/remote/remote-quick-editor.tsx rename to modules/companies/src/web/remote-connections/create/ui/remote-quick-editor.tsx index 680a622..8f9a5c3 100644 --- a/modules/companies/src/web/remote/remote-quick-editor.tsx +++ b/modules/companies/src/web/remote-connections/create/ui/remote-quick-editor.tsx @@ -2,9 +2,9 @@ import { ResourceEditor } from "@metis/resources/client"; import { FormDialog } from "@repo/shadcn-ui/components/form-dialog"; import { useTranslation } from "react-i18next"; -import type { CompanyDTO } from "../../common"; -import { ConfigurationQuickEditor } from "../components/configuration-quick-editor"; -import { SiteForm } from "../components/site-form"; +import type { CompanyDTO } from "../../../../common"; +import { ConfigurationQuickEditor } from "../../../shared"; +import { SiteForm } from "../../../sites"; export type RemoteQuickKind = "person" | "source" | "target" | "resource" | "site"; export function RemoteQuickEditor({ diff --git a/modules/companies/src/web/remote-connections/detail/index.ts b/modules/companies/src/web/remote-connections/detail/index.ts new file mode 100644 index 0000000..e73f5ed --- /dev/null +++ b/modules/companies/src/web/remote-connections/detail/index.ts @@ -0,0 +1 @@ +export { RemoteSummary, remoteEndpoints } from "./ui"; diff --git a/modules/companies/src/web/remote-connections/detail/ui/index.ts b/modules/companies/src/web/remote-connections/detail/ui/index.ts new file mode 100644 index 0000000..9d2237a --- /dev/null +++ b/modules/companies/src/web/remote-connections/detail/ui/index.ts @@ -0,0 +1 @@ +export { RemoteSummary, remoteEndpoints } from "./remote-summary"; diff --git a/modules/companies/src/web/remote/remote-summary.tsx b/modules/companies/src/web/remote-connections/detail/ui/remote-summary.tsx similarity index 93% rename from modules/companies/src/web/remote/remote-summary.tsx rename to modules/companies/src/web/remote-connections/detail/ui/remote-summary.tsx index fcf66a9..390162e 100644 --- a/modules/companies/src/web/remote/remote-summary.tsx +++ b/modules/companies/src/web/remote-connections/detail/ui/remote-summary.tsx @@ -2,8 +2,11 @@ import type { AssetDTO } from "@metis/assets/common"; import type { ResourceDTO } from "@metis/resources/common"; import { useTranslation } from "react-i18next"; -import type { CompanyDTO } from "../../common"; -import type { RemoteConnectionDTO, RemoteConnectionInput } from "../../common/remote-connections"; +import type { CompanyDTO } from "../../../../common"; +import type { + RemoteConnectionDTO, + RemoteConnectionInput, +} from "../../../../common/remote-connections"; export function remoteEndpoints( values: RemoteConnectionInput, diff --git a/modules/companies/src/web/remote-connections/history/index.ts b/modules/companies/src/web/remote-connections/history/index.ts new file mode 100644 index 0000000..4d86a02 --- /dev/null +++ b/modules/companies/src/web/remote-connections/history/index.ts @@ -0,0 +1 @@ +export { RemoteConnectionHistoryDialog } from "./ui"; diff --git a/modules/companies/src/web/remote-connections/history/ui/index.ts b/modules/companies/src/web/remote-connections/history/ui/index.ts new file mode 100644 index 0000000..84b8d1d --- /dev/null +++ b/modules/companies/src/web/remote-connections/history/ui/index.ts @@ -0,0 +1 @@ +export { RemoteConnectionHistoryDialog } from "./remote-connection-history-dialog"; diff --git a/modules/companies/src/web/remote/remote-connection-history-dialog.tsx b/modules/companies/src/web/remote-connections/history/ui/remote-connection-history-dialog.tsx similarity index 90% rename from modules/companies/src/web/remote/remote-connection-history-dialog.tsx rename to modules/companies/src/web/remote-connections/history/ui/remote-connection-history-dialog.tsx index 3211312..9792ef9 100644 --- a/modules/companies/src/web/remote/remote-connection-history-dialog.tsx +++ b/modules/companies/src/web/remote-connections/history/ui/remote-connection-history-dialog.tsx @@ -1,10 +1,9 @@ import { FormDialog } from "@repo/shadcn-ui/components/form-dialog"; import { useTranslation } from "react-i18next"; -import type { CompanyDTO } from "../../common"; -import type { RemoteConnectionDTO } from "../../common/remote-connections"; - -import { remoteEndpoints } from "./remote-summary"; +import type { CompanyDTO } from "../../../../common"; +import type { RemoteConnectionDTO } from "../../../../common/remote-connections"; +import { remoteEndpoints } from "../../detail"; export function RemoteConnectionHistoryDialog({ connection, diff --git a/modules/companies/src/web/remote-connections/index.ts b/modules/companies/src/web/remote-connections/index.ts new file mode 100644 index 0000000..0961cb5 --- /dev/null +++ b/modules/companies/src/web/remote-connections/index.ts @@ -0,0 +1,3 @@ +export { RemoteSummary } from "./detail"; +export { RemoteConnectionsPage } from "./list"; +export { remoteApi, remoteKeys } from "./shared"; diff --git a/modules/companies/src/web/remote-connections/list/index.ts b/modules/companies/src/web/remote-connections/list/index.ts new file mode 100644 index 0000000..99585bb --- /dev/null +++ b/modules/companies/src/web/remote-connections/list/index.ts @@ -0,0 +1 @@ +export { RemoteConnectionsPage } from "./ui"; diff --git a/modules/companies/src/web/remote-connections/list/ui/index.ts b/modules/companies/src/web/remote-connections/list/ui/index.ts new file mode 100644 index 0000000..1072236 --- /dev/null +++ b/modules/companies/src/web/remote-connections/list/ui/index.ts @@ -0,0 +1 @@ +export { RemoteConnectionsPage } from "./remote-connections-page"; diff --git a/modules/companies/src/web/remote/remote-connections-page.tsx b/modules/companies/src/web/remote-connections/list/ui/remote-connections-page.tsx similarity index 94% rename from modules/companies/src/web/remote/remote-connections-page.tsx rename to modules/companies/src/web/remote-connections/list/ui/remote-connections-page.tsx index 5dd9135..e04320d 100644 --- a/modules/companies/src/web/remote/remote-connections-page.tsx +++ b/modules/companies/src/web/remote-connections/list/ui/remote-connections-page.tsx @@ -15,13 +15,10 @@ import { useQuery } from "@tanstack/react-query"; import { useState } from "react"; import { useTranslation } from "react-i18next"; -import type { CompanyDTO } from "../../common"; - -import { remoteApi, remoteKeys } from "./remote-api"; -import { RemoteConnectionEditorDialog } from "./remote-connection-editor-dialog"; -import { RemoteConnectionHistoryDialog } from "./remote-connection-history-dialog"; -import { RemoteFeedback } from "./remote-feedback"; -import { RemoteSummary, remoteEndpoints } from "./remote-summary"; +import type { CompanyDTO } from "../../../../common"; +import { RemoteSummary, remoteEndpoints } from "../../detail"; +import { RemoteConnectionHistoryDialog } from "../../history"; +import { RemoteConnectionEditorDialog, RemoteFeedback, remoteApi, remoteKeys } from "../../shared"; export function RemoteConnectionsPage({ company, diff --git a/modules/companies/src/web/remote-connections/shared/api/index.ts b/modules/companies/src/web/remote-connections/shared/api/index.ts new file mode 100644 index 0000000..63cc2ed --- /dev/null +++ b/modules/companies/src/web/remote-connections/shared/api/index.ts @@ -0,0 +1 @@ +export { RemoteApiError, remoteApi, remoteKeys } from "./remote-api"; diff --git a/modules/companies/src/web/remote/remote-api.ts b/modules/companies/src/web/remote-connections/shared/api/remote-api.ts similarity index 90% rename from modules/companies/src/web/remote/remote-api.ts rename to modules/companies/src/web/remote-connections/shared/api/remote-api.ts index 1345947..8d7b98d 100644 --- a/modules/companies/src/web/remote/remote-api.ts +++ b/modules/companies/src/web/remote-connections/shared/api/remote-api.ts @@ -1,10 +1,10 @@ import { z } from "zod/v4"; -import type { RemoteConnectionInput } from "../../common/remote-connections"; +import type { RemoteConnectionInput } from "../../../../common/remote-connections"; import { RemoteConnectionResponseSchema, RemoteConnectionsResponseSchema, -} from "../../common/remote-connections"; +} from "../../../../common/remote-connections"; export const remoteKeys = { company: (id: string) => ["remote-connections", id] }; export class RemoteApiError extends Error { constructor(public readonly code: string) { diff --git a/modules/companies/src/web/remote-connections/shared/index.ts b/modules/companies/src/web/remote-connections/shared/index.ts new file mode 100644 index 0000000..95b774b --- /dev/null +++ b/modules/companies/src/web/remote-connections/shared/index.ts @@ -0,0 +1,2 @@ +export { remoteApi, remoteKeys } from "./api"; +export { RemoteConnectionEditorDialog, RemoteFeedback } from "./ui"; diff --git a/modules/companies/src/web/remote/remote.test.tsx b/modules/companies/src/web/remote-connections/shared/remote.test.tsx similarity index 91% rename from modules/companies/src/web/remote/remote.test.tsx rename to modules/companies/src/web/remote-connections/shared/remote.test.tsx index 0695b22..cee6ed7 100644 --- a/modules/companies/src/web/remote/remote.test.tsx +++ b/modules/companies/src/web/remote-connections/shared/remote.test.tsx @@ -9,13 +9,13 @@ import type { ReactNode } from "react"; import { renderToStaticMarkup } from "react-dom/server"; import { I18nextProvider } from "react-i18next"; -import { RemoteConnectionSchema } from "../../common/remote-connections"; -import { companiesEnglish, companiesSpanish } from "../i18n"; +import { RemoteConnectionSchema } from "../../../common/remote-connections"; +import { companiesEnglish, companiesSpanish } from "../../shared"; +import { RemoteSummary } from "../detail"; +import { RemoteConnectionsPage } from "../list"; -import { remoteKeys } from "./remote-api"; -import { RemoteConnectionForm } from "./remote-connection-form"; -import { RemoteConnectionsPage } from "./remote-connections-page"; -import { RemoteSummary } from "./remote-summary"; +import { remoteKeys } from "./api"; +import { RemoteConnectionForm } from "./ui"; const company = { id: "0199b200-0000-7000-8000-000000000001", diff --git a/modules/companies/src/web/remote-connections/shared/ui/index.ts b/modules/companies/src/web/remote-connections/shared/ui/index.ts new file mode 100644 index 0000000..9289d96 --- /dev/null +++ b/modules/companies/src/web/remote-connections/shared/ui/index.ts @@ -0,0 +1,3 @@ +export { RemoteConnectionEditorDialog } from "./remote-connection-editor-dialog"; +export { RemoteConnectionForm } from "./remote-connection-form"; +export { RemoteFeedback } from "./remote-feedback"; diff --git a/modules/companies/src/web/remote/remote-connection-editor-dialog.tsx b/modules/companies/src/web/remote-connections/shared/ui/remote-connection-editor-dialog.tsx similarity index 95% rename from modules/companies/src/web/remote/remote-connection-editor-dialog.tsx rename to modules/companies/src/web/remote-connections/shared/ui/remote-connection-editor-dialog.tsx index 0e77972..b5ce462 100644 --- a/modules/companies/src/web/remote/remote-connection-editor-dialog.tsx +++ b/modules/companies/src/web/remote-connections/shared/ui/remote-connection-editor-dialog.tsx @@ -2,7 +2,7 @@ import { FormDialog } from "@repo/shadcn-ui/components/form-dialog"; import type { ComponentProps } from "react"; import { useTranslation } from "react-i18next"; -import type { CompanyDTO } from "../../common"; +import type { CompanyDTO } from "../../../../common"; import { RemoteConnectionForm } from "./remote-connection-form"; diff --git a/modules/companies/src/web/remote/remote-connection-form.tsx b/modules/companies/src/web/remote-connections/shared/ui/remote-connection-form.tsx similarity index 95% rename from modules/companies/src/web/remote/remote-connection-form.tsx rename to modules/companies/src/web/remote-connections/shared/ui/remote-connection-form.tsx index db9bb28..c15c710 100644 --- a/modules/companies/src/web/remote/remote-connection-form.tsx +++ b/modules/companies/src/web/remote-connections/shared/ui/remote-connection-form.tsx @@ -17,18 +17,21 @@ import { useEffect, useId, useRef, useState } from "react"; import { useForm } from "react-hook-form"; import { useTranslation } from "react-i18next"; -import type { CompanyDTO } from "../../common"; -import type { RemoteConnectionDTO, RemoteConnectionInput } from "../../common/remote-connections"; +import type { CompanyDTO } from "../../../../common"; +import type { + RemoteConnectionDTO, + RemoteConnectionInput, +} from "../../../../common/remote-connections"; import { REMOTE_STATE_TRANSITIONS, RemoteConnectionInputSchema, -} from "../../common/remote-connections"; +} from "../../../../common/remote-connections"; +import type { RemoteQuickKind } from "../../create"; +import { RemoteQuickEditor } from "../../create"; +import { remoteApi, remoteKeys } from "../api"; -import { remoteApi, remoteKeys } from "./remote-api"; import { RemoteEndpointFields } from "./remote-endpoint-fields"; import { RemoteFeedback } from "./remote-feedback"; -import type { RemoteQuickKind } from "./remote-quick-editor"; -import { RemoteQuickEditor } from "./remote-quick-editor"; const quickFields = { person: "personId", diff --git a/modules/companies/src/web/remote/remote-endpoint-fields.tsx b/modules/companies/src/web/remote-connections/shared/ui/remote-endpoint-fields.tsx similarity index 94% rename from modules/companies/src/web/remote/remote-endpoint-fields.tsx rename to modules/companies/src/web/remote-connections/shared/ui/remote-endpoint-fields.tsx index 4afb1f5..bb27e7d 100644 --- a/modules/companies/src/web/remote/remote-endpoint-fields.tsx +++ b/modules/companies/src/web/remote-connections/shared/ui/remote-endpoint-fields.tsx @@ -3,11 +3,10 @@ import { SelectWithAction } from "@repo/shadcn-ui/components/select-with-action" import type { UseFormReturn } from "react-hook-form"; import { useTranslation } from "react-i18next"; -import type { CompanyDTO } from "../../common"; -import type { RemoteConnectionInput } from "../../common/remote-connections"; -import { RemoteConnectionInputSchema } from "../../common/remote-connections"; - -import type { RemoteQuickKind } from "./remote-quick-editor"; +import type { CompanyDTO } from "../../../../common"; +import type { RemoteConnectionInput } from "../../../../common/remote-connections"; +import { RemoteConnectionInputSchema } from "../../../../common/remote-connections"; +import type { RemoteQuickKind } from "../../create"; type Option = { value: string; label: string }; const targetActions = { diff --git a/modules/companies/src/web/remote/remote-feedback.tsx b/modules/companies/src/web/remote-connections/shared/ui/remote-feedback.tsx similarity index 91% rename from modules/companies/src/web/remote/remote-feedback.tsx rename to modules/companies/src/web/remote-connections/shared/ui/remote-feedback.tsx index 73cd628..90b1080 100644 --- a/modules/companies/src/web/remote/remote-feedback.tsx +++ b/modules/companies/src/web/remote-connections/shared/ui/remote-feedback.tsx @@ -1,6 +1,6 @@ import { useTranslation } from "react-i18next"; -import { RemoteApiError } from "./remote-api"; +import { RemoteApiError } from "../api"; export function RemoteFeedback({ error }: { error: unknown }) { const { t } = useTranslation("companies"); if (!error) { diff --git a/modules/companies/src/web/shared/helpers/index.ts b/modules/companies/src/web/shared/helpers/index.ts new file mode 100644 index 0000000..251d39b --- /dev/null +++ b/modules/companies/src/web/shared/helpers/index.ts @@ -0,0 +1 @@ +export { getInitialsAvatarAppearance } from "./initials-avatar-appearance"; diff --git a/modules/companies/src/web/components/initials-avatar-appearance.ts b/modules/companies/src/web/shared/helpers/initials-avatar-appearance.ts similarity index 100% rename from modules/companies/src/web/components/initials-avatar-appearance.ts rename to modules/companies/src/web/shared/helpers/initials-avatar-appearance.ts diff --git a/modules/companies/src/web/shared/i18n.ts b/modules/companies/src/web/shared/i18n.ts new file mode 100644 index 0000000..1e72bc2 --- /dev/null +++ b/modules/companies/src/web/shared/i18n.ts @@ -0,0 +1,5 @@ +import english from "../../common/locales/en.json"; +import spanish from "../../common/locales/es.json"; + +export const companiesEnglish = english.companies; +export const companiesSpanish = spanish.companies; diff --git a/modules/companies/src/web/shared/index.ts b/modules/companies/src/web/shared/index.ts new file mode 100644 index 0000000..5755efa --- /dev/null +++ b/modules/companies/src/web/shared/index.ts @@ -0,0 +1,3 @@ +export { companiesEnglish, companiesSpanish } from "./i18n"; +export type { ConfigurationQuickKind } from "./ui"; +export { ConfigurationQuickEditor, InitialsAvatar } from "./ui"; diff --git a/modules/companies/src/web/components/initials-avatar.test.tsx b/modules/companies/src/web/shared/initials-avatar.test.tsx similarity index 94% rename from modules/companies/src/web/components/initials-avatar.test.tsx rename to modules/companies/src/web/shared/initials-avatar.test.tsx index 2d28f3b..150753f 100644 --- a/modules/companies/src/web/components/initials-avatar.test.tsx +++ b/modules/companies/src/web/shared/initials-avatar.test.tsx @@ -3,8 +3,8 @@ import { test } from "node:test"; import { renderToStaticMarkup } from "react-dom/server"; -import { InitialsAvatar } from "./initials-avatar"; -import { getInitialsAvatarAppearance } from "./initials-avatar-appearance"; +import { getInitialsAvatarAppearance } from "./helpers"; +import { InitialsAvatar } from "./ui"; test("iniciales y siglas soportan nombres vacíos, Unicode y separadores", () => { for (const [name, expected] of [ diff --git a/modules/companies/src/web/components/configuration-quick-editor.tsx b/modules/companies/src/web/shared/ui/configuration-quick-editor.tsx similarity index 93% rename from modules/companies/src/web/components/configuration-quick-editor.tsx rename to modules/companies/src/web/shared/ui/configuration-quick-editor.tsx index a544a67..3bb26c7 100644 --- a/modules/companies/src/web/components/configuration-quick-editor.tsx +++ b/modules/companies/src/web/shared/ui/configuration-quick-editor.tsx @@ -4,10 +4,10 @@ import { useQuery } from "@tanstack/react-query"; import { useEffect, useRef } from "react"; import { useTranslation } from "react-i18next"; -import type { AccessResponseDTO, CompanyDTO } from "../../common"; -import { AccessForm } from "../access/access-form"; -import { PersonForm } from "../components/person-form"; -import { MailFeedback } from "../mail/mail-feedback"; +import type { AccessResponseDTO, CompanyDTO } from "../../../common"; +import { AccessForm } from "../../access"; +import { MailFeedback } from "../../mail-configurations/shared/ui/mail-feedback"; +import { PersonForm } from "../../people"; export type ConfigurationQuickKind = "person" | "account" | "asset" | "authorization"; const titles = { diff --git a/modules/companies/src/web/shared/ui/index.ts b/modules/companies/src/web/shared/ui/index.ts new file mode 100644 index 0000000..601b03e --- /dev/null +++ b/modules/companies/src/web/shared/ui/index.ts @@ -0,0 +1,3 @@ +export type { ConfigurationQuickKind } from "./configuration-quick-editor"; +export { ConfigurationQuickEditor } from "./configuration-quick-editor"; +export { InitialsAvatar } from "./initials-avatar"; diff --git a/modules/companies/src/web/components/initials-avatar.tsx b/modules/companies/src/web/shared/ui/initials-avatar.tsx similarity index 90% rename from modules/companies/src/web/components/initials-avatar.tsx rename to modules/companies/src/web/shared/ui/initials-avatar.tsx index 44dd6b2..04270c1 100644 --- a/modules/companies/src/web/components/initials-avatar.tsx +++ b/modules/companies/src/web/shared/ui/initials-avatar.tsx @@ -1,7 +1,7 @@ import { cn } from "@repo/shadcn-ui/lib/utils"; import type { ComponentProps } from "react"; -import { getInitialsAvatarAppearance } from "./initials-avatar-appearance"; +import { getInitialsAvatarAppearance } from "../helpers"; export function InitialsAvatar({ name, diff --git a/modules/companies/src/web/sites/index.ts b/modules/companies/src/web/sites/index.ts new file mode 100644 index 0000000..f6fd2d4 --- /dev/null +++ b/modules/companies/src/web/sites/index.ts @@ -0,0 +1,2 @@ +export { SiteSection } from "./list"; +export { SiteForm } from "./shared"; diff --git a/modules/companies/src/web/sites/list/index.ts b/modules/companies/src/web/sites/list/index.ts new file mode 100644 index 0000000..b223791 --- /dev/null +++ b/modules/companies/src/web/sites/list/index.ts @@ -0,0 +1 @@ +export { SiteSection } from "./ui"; diff --git a/modules/companies/src/web/sites/list/ui/index.ts b/modules/companies/src/web/sites/list/ui/index.ts new file mode 100644 index 0000000..1c32342 --- /dev/null +++ b/modules/companies/src/web/sites/list/ui/index.ts @@ -0,0 +1 @@ +export { SiteSection } from "./site-section"; diff --git a/modules/companies/src/web/components/site-section.tsx b/modules/companies/src/web/sites/list/ui/site-section.tsx similarity index 95% rename from modules/companies/src/web/components/site-section.tsx rename to modules/companies/src/web/sites/list/ui/site-section.tsx index 35675ee..be587b8 100644 --- a/modules/companies/src/web/components/site-section.tsx +++ b/modules/companies/src/web/sites/list/ui/site-section.tsx @@ -8,9 +8,8 @@ import { import { useState } from "react"; import { useTranslation } from "react-i18next"; -import type { CompanyDTO } from "../../common"; - -import { SiteEditorDialog } from "./site-editor-dialog"; +import type { CompanyDTO } from "../../../../common"; +import { SiteEditorDialog } from "../../shared"; export function SiteSection({ company, csrfToken }: { company: CompanyDTO; csrfToken: string }) { const { t, i18n } = useTranslation("companies"); diff --git a/modules/companies/src/web/sites/shared/index.ts b/modules/companies/src/web/sites/shared/index.ts new file mode 100644 index 0000000..ff8c902 --- /dev/null +++ b/modules/companies/src/web/sites/shared/index.ts @@ -0,0 +1 @@ +export { SiteEditorDialog, SiteForm } from "./ui"; diff --git a/modules/companies/src/web/sites/shared/ui/index.ts b/modules/companies/src/web/sites/shared/ui/index.ts new file mode 100644 index 0000000..c718a4c --- /dev/null +++ b/modules/companies/src/web/sites/shared/ui/index.ts @@ -0,0 +1,2 @@ +export { SiteEditorDialog } from "./site-editor-dialog"; +export { SiteForm } from "./site-form"; diff --git a/modules/companies/src/web/components/site-editor-dialog.tsx b/modules/companies/src/web/sites/shared/ui/site-editor-dialog.tsx similarity index 100% rename from modules/companies/src/web/components/site-editor-dialog.tsx rename to modules/companies/src/web/sites/shared/ui/site-editor-dialog.tsx diff --git a/modules/companies/src/web/components/site-form.tsx b/modules/companies/src/web/sites/shared/ui/site-form.tsx similarity index 90% rename from modules/companies/src/web/components/site-form.tsx rename to modules/companies/src/web/sites/shared/ui/site-form.tsx index 08a0c5d..555de98 100644 --- a/modules/companies/src/web/components/site-form.tsx +++ b/modules/companies/src/web/sites/shared/ui/site-form.tsx @@ -9,12 +9,10 @@ import { useId } from "react"; import { useForm } from "react-hook-form"; import { useTranslation } from "react-i18next"; -import type { SiteDTO, SiteRequestDTO } from "../../common"; -import { SiteRequestSchema } from "../../common"; -import { EntityHelp } from "../access/entity-help"; -import { companyApi, companyKeys } from "../api/company-api"; - -import { CompanyFeedback } from "./company-feedback"; +import type { SiteDTO, SiteRequestDTO } from "../../../../common"; +import { SiteRequestSchema } from "../../../../common"; +import { EntityHelp } from "../../../access"; +import { CompanyFeedback, companyApi, companyKeys } from "../../../companies/shared"; export function SiteForm({ site, diff --git a/modules/companies/src/web/telework-authorizations/detail/index.ts b/modules/companies/src/web/telework-authorizations/detail/index.ts new file mode 100644 index 0000000..4b7c0d4 --- /dev/null +++ b/modules/companies/src/web/telework-authorizations/detail/index.ts @@ -0,0 +1 @@ +export { TeleworkAuthorizationSummary } from "./ui"; diff --git a/modules/companies/src/web/telework-authorizations/detail/ui/index.ts b/modules/companies/src/web/telework-authorizations/detail/ui/index.ts new file mode 100644 index 0000000..8a4cebf --- /dev/null +++ b/modules/companies/src/web/telework-authorizations/detail/ui/index.ts @@ -0,0 +1 @@ +export { TeleworkAuthorizationSummary } from "./telework-authorization-summary"; diff --git a/modules/companies/src/web/telework/telework-authorization-summary.tsx b/modules/companies/src/web/telework-authorizations/detail/ui/telework-authorization-summary.tsx similarity index 94% rename from modules/companies/src/web/telework/telework-authorization-summary.tsx rename to modules/companies/src/web/telework-authorizations/detail/ui/telework-authorization-summary.tsx index 590a59c..629487d 100644 --- a/modules/companies/src/web/telework/telework-authorization-summary.tsx +++ b/modules/companies/src/web/telework-authorizations/detail/ui/telework-authorization-summary.tsx @@ -1,6 +1,6 @@ import { useTranslation } from "react-i18next"; -import type { TeleworkAuthorizationDTO } from "../../common/telework-authorizations"; +import type { TeleworkAuthorizationDTO } from "../../../../common/telework-authorizations"; export function TeleworkAuthorizationSummary({ authorization, diff --git a/modules/companies/src/web/telework-authorizations/history/index.ts b/modules/companies/src/web/telework-authorizations/history/index.ts new file mode 100644 index 0000000..51ef27d --- /dev/null +++ b/modules/companies/src/web/telework-authorizations/history/index.ts @@ -0,0 +1 @@ +export { TeleworkAuthorizationHistoryDialog } from "./ui"; diff --git a/modules/companies/src/web/telework-authorizations/history/ui/index.ts b/modules/companies/src/web/telework-authorizations/history/ui/index.ts new file mode 100644 index 0000000..8a6de04 --- /dev/null +++ b/modules/companies/src/web/telework-authorizations/history/ui/index.ts @@ -0,0 +1 @@ +export { TeleworkAuthorizationHistoryDialog } from "./telework-authorization-history-dialog"; diff --git a/modules/companies/src/web/telework/telework-authorization-history-dialog.tsx b/modules/companies/src/web/telework-authorizations/history/ui/telework-authorization-history-dialog.tsx similarity index 94% rename from modules/companies/src/web/telework/telework-authorization-history-dialog.tsx rename to modules/companies/src/web/telework-authorizations/history/ui/telework-authorization-history-dialog.tsx index c5475b1..7902eae 100644 --- a/modules/companies/src/web/telework/telework-authorization-history-dialog.tsx +++ b/modules/companies/src/web/telework-authorizations/history/ui/telework-authorization-history-dialog.tsx @@ -1,7 +1,7 @@ import { FormDialog } from "@repo/shadcn-ui/components/form-dialog"; import { useTranslation } from "react-i18next"; -import type { TeleworkAuthorizationDTO } from "../../common/telework-authorizations"; +import type { TeleworkAuthorizationDTO } from "../../../../common/telework-authorizations"; export function TeleworkAuthorizationHistoryDialog({ authorization, diff --git a/modules/companies/src/web/telework-authorizations/index.ts b/modules/companies/src/web/telework-authorizations/index.ts new file mode 100644 index 0000000..ea40923 --- /dev/null +++ b/modules/companies/src/web/telework-authorizations/index.ts @@ -0,0 +1,3 @@ +export { TeleworkAuthorizationSummary } from "./detail"; +export { TeleworkAuthorizationsPage } from "./list"; +export { teleworkApi, teleworkKeys } from "./shared"; diff --git a/modules/companies/src/web/telework-authorizations/list/index.ts b/modules/companies/src/web/telework-authorizations/list/index.ts new file mode 100644 index 0000000..616e526 --- /dev/null +++ b/modules/companies/src/web/telework-authorizations/list/index.ts @@ -0,0 +1 @@ +export { TeleworkAuthorizationsPage } from "./ui"; diff --git a/modules/companies/src/web/telework-authorizations/list/ui/index.ts b/modules/companies/src/web/telework-authorizations/list/ui/index.ts new file mode 100644 index 0000000..9aaa34d --- /dev/null +++ b/modules/companies/src/web/telework-authorizations/list/ui/index.ts @@ -0,0 +1 @@ +export { TeleworkAuthorizationsPage } from "./telework-authorizations-page"; diff --git a/modules/companies/src/web/telework/telework-authorizations-page.tsx b/modules/companies/src/web/telework-authorizations/list/ui/telework-authorizations-page.tsx similarity index 92% rename from modules/companies/src/web/telework/telework-authorizations-page.tsx rename to modules/companies/src/web/telework-authorizations/list/ui/telework-authorizations-page.tsx index db89955..3a2d047 100644 --- a/modules/companies/src/web/telework/telework-authorizations-page.tsx +++ b/modules/companies/src/web/telework-authorizations/list/ui/telework-authorizations-page.tsx @@ -10,13 +10,15 @@ import { useQuery } from "@tanstack/react-query"; import { useState } from "react"; import { useTranslation } from "react-i18next"; -import type { CompanyDTO } from "../../common"; - -import { teleworkApi, teleworkKeys } from "./telework-api"; -import { TeleworkAuthorizationEditorDialog } from "./telework-authorization-editor-dialog"; -import { TeleworkAuthorizationHistoryDialog } from "./telework-authorization-history-dialog"; -import { TeleworkAuthorizationSummary } from "./telework-authorization-summary"; -import { TeleworkFeedback } from "./telework-feedback"; +import type { CompanyDTO } from "../../../../common"; +import { TeleworkAuthorizationSummary } from "../../detail"; +import { TeleworkAuthorizationHistoryDialog } from "../../history"; +import { + TeleworkAuthorizationEditorDialog, + TeleworkFeedback, + teleworkApi, + teleworkKeys, +} from "../../shared"; export function TeleworkAuthorizationsPage({ company, diff --git a/modules/companies/src/web/telework-authorizations/shared/api/index.ts b/modules/companies/src/web/telework-authorizations/shared/api/index.ts new file mode 100644 index 0000000..5fc7a2e --- /dev/null +++ b/modules/companies/src/web/telework-authorizations/shared/api/index.ts @@ -0,0 +1 @@ +export { TeleworkApiError, teleworkApi, teleworkKeys } from "./telework-api"; diff --git a/modules/companies/src/web/telework/telework-api.ts b/modules/companies/src/web/telework-authorizations/shared/api/telework-api.ts similarity index 90% rename from modules/companies/src/web/telework/telework-api.ts rename to modules/companies/src/web/telework-authorizations/shared/api/telework-api.ts index d8b97e7..7d586d2 100644 --- a/modules/companies/src/web/telework/telework-api.ts +++ b/modules/companies/src/web/telework-authorizations/shared/api/telework-api.ts @@ -1,10 +1,10 @@ import { z } from "zod/v4"; -import type { TeleworkAuthorizationInput } from "../../common/telework-authorizations"; +import type { TeleworkAuthorizationInput } from "../../../../common/telework-authorizations"; import { TeleworkAuthorizationResponseSchema, TeleworkAuthorizationsResponseSchema, -} from "../../common/telework-authorizations"; +} from "../../../../common/telework-authorizations"; export const teleworkKeys = { company: (id: string) => ["telework-authorizations", id] }; export class TeleworkApiError extends Error { constructor(public readonly code: string) { diff --git a/modules/companies/src/web/telework-authorizations/shared/index.ts b/modules/companies/src/web/telework-authorizations/shared/index.ts new file mode 100644 index 0000000..bf18bf4 --- /dev/null +++ b/modules/companies/src/web/telework-authorizations/shared/index.ts @@ -0,0 +1,2 @@ +export { teleworkApi, teleworkKeys } from "./api"; +export { TeleworkAuthorizationEditorDialog, TeleworkFeedback } from "./ui"; diff --git a/modules/companies/src/web/telework/telework.test.tsx b/modules/companies/src/web/telework-authorizations/shared/telework.test.tsx similarity index 90% rename from modules/companies/src/web/telework/telework.test.tsx rename to modules/companies/src/web/telework-authorizations/shared/telework.test.tsx index 51a18b2..d8a1355 100644 --- a/modules/companies/src/web/telework/telework.test.tsx +++ b/modules/companies/src/web/telework-authorizations/shared/telework.test.tsx @@ -7,13 +7,13 @@ import type { ReactNode } from "react"; import { renderToStaticMarkup } from "react-dom/server"; import { I18nextProvider } from "react-i18next"; -import { TeleworkAuthorizationSchema } from "../../common/telework-authorizations"; -import { companiesEnglish, companiesSpanish } from "../i18n"; +import { TeleworkAuthorizationSchema } from "../../../common/telework-authorizations"; +import { companiesEnglish, companiesSpanish } from "../../shared"; +import { TeleworkAuthorizationSummary } from "../detail"; +import { TeleworkAuthorizationsPage } from "../list"; -import { teleworkKeys } from "./telework-api"; -import { TeleworkAuthorizationForm } from "./telework-authorization-form"; -import { TeleworkAuthorizationSummary } from "./telework-authorization-summary"; -import { TeleworkAuthorizationsPage } from "./telework-authorizations-page"; +import { teleworkKeys } from "./api"; +import { TeleworkAuthorizationForm } from "./ui"; const company = { id: "0199b200-0000-7000-8000-000000000001", diff --git a/modules/companies/src/web/telework-authorizations/shared/ui/index.ts b/modules/companies/src/web/telework-authorizations/shared/ui/index.ts new file mode 100644 index 0000000..5045605 --- /dev/null +++ b/modules/companies/src/web/telework-authorizations/shared/ui/index.ts @@ -0,0 +1,3 @@ +export { TeleworkAuthorizationEditorDialog } from "./telework-authorization-editor-dialog"; +export { TeleworkAuthorizationForm } from "./telework-authorization-form"; +export { TeleworkFeedback } from "./telework-feedback"; diff --git a/modules/companies/src/web/telework/telework-authorization-editor-dialog.tsx b/modules/companies/src/web/telework-authorizations/shared/ui/telework-authorization-editor-dialog.tsx similarity index 95% rename from modules/companies/src/web/telework/telework-authorization-editor-dialog.tsx rename to modules/companies/src/web/telework-authorizations/shared/ui/telework-authorization-editor-dialog.tsx index 2b911d5..1410271 100644 --- a/modules/companies/src/web/telework/telework-authorization-editor-dialog.tsx +++ b/modules/companies/src/web/telework-authorizations/shared/ui/telework-authorization-editor-dialog.tsx @@ -2,7 +2,7 @@ import { FormDialog } from "@repo/shadcn-ui/components/form-dialog"; import type { ComponentProps } from "react"; import { useTranslation } from "react-i18next"; -import type { CompanyDTO } from "../../common"; +import type { CompanyDTO } from "../../../../common"; import { TeleworkAuthorizationForm } from "./telework-authorization-form"; diff --git a/modules/companies/src/web/telework/telework-authorization-form.tsx b/modules/companies/src/web/telework-authorizations/shared/ui/telework-authorization-form.tsx similarity index 94% rename from modules/companies/src/web/telework/telework-authorization-form.tsx rename to modules/companies/src/web/telework-authorizations/shared/ui/telework-authorization-form.tsx index 6e4d3b4..73e4934 100644 --- a/modules/companies/src/web/telework/telework-authorization-form.tsx +++ b/modules/companies/src/web/telework-authorizations/shared/ui/telework-authorization-form.tsx @@ -12,16 +12,16 @@ import { useEffect, useId, useRef, useState } from "react"; import { useForm } from "react-hook-form"; import { useTranslation } from "react-i18next"; -import type { CompanyDTO } from "../../common"; +import type { CompanyDTO } from "../../../../common"; import type { TeleworkAuthorizationDTO, TeleworkAuthorizationInput, -} from "../../common/telework-authorizations"; -import { TeleworkAuthorizationInputSchema } from "../../common/telework-authorizations"; -import { PersonEditorDialog } from "../components/person-editor-dialog"; -import { remoteKeys } from "../remote/remote-api"; +} from "../../../../common/telework-authorizations"; +import { TeleworkAuthorizationInputSchema } from "../../../../common/telework-authorizations"; +import { PersonEditorDialog } from "../../../people"; +import { remoteKeys } from "../../../remote-connections"; +import { teleworkApi, teleworkKeys } from "../api"; -import { teleworkApi, teleworkKeys } from "./telework-api"; import { TeleworkFeedback } from "./telework-feedback"; export function TeleworkAuthorizationForm({ diff --git a/modules/companies/src/web/telework/telework-feedback.tsx b/modules/companies/src/web/telework-authorizations/shared/ui/telework-feedback.tsx similarity index 90% rename from modules/companies/src/web/telework/telework-feedback.tsx rename to modules/companies/src/web/telework-authorizations/shared/ui/telework-feedback.tsx index bcc49bd..7b45a43 100644 --- a/modules/companies/src/web/telework/telework-feedback.tsx +++ b/modules/companies/src/web/telework-authorizations/shared/ui/telework-feedback.tsx @@ -1,6 +1,6 @@ import { useTranslation } from "react-i18next"; -import { TeleworkApiError } from "./telework-api"; +import { TeleworkApiError } from "../api"; export function TeleworkFeedback({ error }: { error: unknown }) { const { t } = useTranslation("companies"); if (!error) { diff --git a/modules/companies/src/web/tickets/create/index.ts b/modules/companies/src/web/tickets/create/index.ts new file mode 100644 index 0000000..094b8c3 --- /dev/null +++ b/modules/companies/src/web/tickets/create/index.ts @@ -0,0 +1 @@ +export { InterventionTicketCreateDialog, TicketQuickForms } from "./ui"; diff --git a/modules/companies/src/web/tickets/create/ui/index.ts b/modules/companies/src/web/tickets/create/ui/index.ts new file mode 100644 index 0000000..275444f --- /dev/null +++ b/modules/companies/src/web/tickets/create/ui/index.ts @@ -0,0 +1,2 @@ +export { InterventionTicketCreateDialog } from "./intervention-ticket-create-dialog"; +export { TicketQuickForms } from "./ticket-quick-forms"; diff --git a/modules/companies/src/web/interventions/intervention-ticket-create-dialog.tsx b/modules/companies/src/web/tickets/create/ui/intervention-ticket-create-dialog.tsx similarity index 95% rename from modules/companies/src/web/interventions/intervention-ticket-create-dialog.tsx rename to modules/companies/src/web/tickets/create/ui/intervention-ticket-create-dialog.tsx index 7f3119e..d038c0b 100644 --- a/modules/companies/src/web/interventions/intervention-ticket-create-dialog.tsx +++ b/modules/companies/src/web/tickets/create/ui/intervention-ticket-create-dialog.tsx @@ -2,7 +2,7 @@ import { FormDialog } from "@repo/shadcn-ui/components/form-dialog"; import type { ComponentProps } from "react"; import { useTranslation } from "react-i18next"; -import { TicketForm } from "../tickets/ticket-form"; +import { TicketForm } from "../../shared"; export function InterventionTicketCreateDialog({ open, diff --git a/modules/companies/src/web/tickets/ticket-quick-editor.tsx b/modules/companies/src/web/tickets/create/ui/ticket-quick-editor.tsx similarity index 91% rename from modules/companies/src/web/tickets/ticket-quick-editor.tsx rename to modules/companies/src/web/tickets/create/ui/ticket-quick-editor.tsx index bb566f0..1245544 100644 --- a/modules/companies/src/web/tickets/ticket-quick-editor.tsx +++ b/modules/companies/src/web/tickets/create/ui/ticket-quick-editor.tsx @@ -5,12 +5,11 @@ import { useQuery } from "@tanstack/react-query"; import { useState } from "react"; import { useTranslation } from "react-i18next"; -import type { TicketTargetInput } from "../../common/tickets"; -import { companyApi, companyKeys } from "../api/company-api"; -import { PersonForm } from "../components/person-form"; -import { SiteForm } from "../components/site-form"; - -import { TicketFeedback } from "./ticket-feedback"; +import type { TicketTargetInput } from "../../../../common/tickets"; +import { companyApi, companyKeys } from "../../../companies/shared"; +import { PersonForm } from "../../../people"; +import { SiteForm } from "../../../sites"; +import { TicketFeedback } from "../../shared/ui/ticket-feedback"; export function TicketQuickEditor({ companyId, kind, diff --git a/modules/companies/src/web/tickets/ticket-quick-forms.tsx b/modules/companies/src/web/tickets/create/ui/ticket-quick-forms.tsx similarity index 89% rename from modules/companies/src/web/tickets/ticket-quick-forms.tsx rename to modules/companies/src/web/tickets/create/ui/ticket-quick-forms.tsx index 8d719b3..84058c6 100644 --- a/modules/companies/src/web/tickets/ticket-quick-forms.tsx +++ b/modules/companies/src/web/tickets/create/ui/ticket-quick-forms.tsx @@ -1,8 +1,8 @@ import { FormDialog } from "@repo/shadcn-ui/components/form-dialog"; import { useTranslation } from "react-i18next"; -import { CompanyForm } from "../components/company-form"; -import { PersonForm } from "../components/person-form"; +import { CompanyForm } from "../../../companies/shared"; +import { PersonForm } from "../../../people"; export function TicketQuickForms({ kind, companyId, diff --git a/modules/companies/src/web/tickets/ticket-target-create-dialog.tsx b/modules/companies/src/web/tickets/create/ui/ticket-target-create-dialog.tsx similarity index 100% rename from modules/companies/src/web/tickets/ticket-target-create-dialog.tsx rename to modules/companies/src/web/tickets/create/ui/ticket-target-create-dialog.tsx diff --git a/modules/companies/src/web/tickets/detail/index.ts b/modules/companies/src/web/tickets/detail/index.ts new file mode 100644 index 0000000..2fe18d8 --- /dev/null +++ b/modules/companies/src/web/tickets/detail/index.ts @@ -0,0 +1 @@ +export { TicketDetailDialog } from "./ui"; diff --git a/modules/companies/src/web/tickets/detail/ui/index.ts b/modules/companies/src/web/tickets/detail/ui/index.ts new file mode 100644 index 0000000..1f013d1 --- /dev/null +++ b/modules/companies/src/web/tickets/detail/ui/index.ts @@ -0,0 +1 @@ +export { TicketDetailDialog } from "./ticket-detail-dialog"; diff --git a/modules/companies/src/web/tickets/ticket-detail-dialog.tsx b/modules/companies/src/web/tickets/detail/ui/ticket-detail-dialog.tsx similarity index 100% rename from modules/companies/src/web/tickets/ticket-detail-dialog.tsx rename to modules/companies/src/web/tickets/detail/ui/ticket-detail-dialog.tsx diff --git a/modules/companies/src/web/tickets/ticket-detail.tsx b/modules/companies/src/web/tickets/detail/ui/ticket-detail.tsx similarity index 93% rename from modules/companies/src/web/tickets/ticket-detail.tsx rename to modules/companies/src/web/tickets/detail/ui/ticket-detail.tsx index 0df97c6..f08380c 100644 --- a/modules/companies/src/web/tickets/ticket-detail.tsx +++ b/modules/companies/src/web/tickets/detail/ui/ticket-detail.tsx @@ -1,11 +1,9 @@ import { useQuery } from "@tanstack/react-query"; import { useTranslation } from "react-i18next"; -import type { TicketDTO, TicketListDTO } from "../../common/tickets"; -import { TicketInterventions } from "../interventions/ticket-interventions"; - -import { ticketApi, ticketKeys } from "./ticket-api"; -import { ticketTargetOptions } from "./ticket-targets"; +import type { TicketDTO, TicketListDTO } from "../../../../common/tickets"; +import { TicketInterventions } from "../../../interventions/list/ui/ticket-interventions"; +import { ticketApi, ticketKeys, ticketTargetOptions } from "../../shared"; export function TicketDetail({ ticket, data }: { ticket: TicketDTO; data: TicketListDTO }) { const { t, i18n } = useTranslation("companies"); const query = useQuery({ diff --git a/modules/companies/src/web/tickets/index.ts b/modules/companies/src/web/tickets/index.ts new file mode 100644 index 0000000..7b65d22 --- /dev/null +++ b/modules/companies/src/web/tickets/index.ts @@ -0,0 +1,2 @@ +export { TicketsPage } from "./list"; +export { TicketForm, ticketApi, ticketKeys, ticketTargetOptions } from "./shared"; diff --git a/modules/companies/src/web/tickets/list/index.ts b/modules/companies/src/web/tickets/list/index.ts new file mode 100644 index 0000000..d04159d --- /dev/null +++ b/modules/companies/src/web/tickets/list/index.ts @@ -0,0 +1 @@ +export { TicketsPage, filterTickets } from "./ui"; diff --git a/modules/companies/src/web/tickets/list/ui/index.ts b/modules/companies/src/web/tickets/list/ui/index.ts new file mode 100644 index 0000000..99ccaff --- /dev/null +++ b/modules/companies/src/web/tickets/list/ui/index.ts @@ -0,0 +1 @@ +export { TicketsPage, filterTickets } from "./tickets-page"; diff --git a/modules/companies/src/web/tickets/tickets-page.tsx b/modules/companies/src/web/tickets/list/ui/tickets-page.tsx similarity index 95% rename from modules/companies/src/web/tickets/tickets-page.tsx rename to modules/companies/src/web/tickets/list/ui/tickets-page.tsx index 3e7042a..5d93397 100644 --- a/modules/companies/src/web/tickets/tickets-page.tsx +++ b/modules/companies/src/web/tickets/list/ui/tickets-page.tsx @@ -11,16 +11,12 @@ import { useQuery } from "@tanstack/react-query"; import { useState } from "react"; import { useTranslation } from "react-i18next"; -import type { TicketDTO } from "../../common/tickets"; -import { TicketPrioritySchema, TicketStateSchema } from "../../common/tickets"; -import { CompanyIdentity } from "../components/company-identity"; -import { CompanySelect } from "../components/company-select"; - -import { ticketApi, ticketKeys } from "./ticket-api"; -import { TicketDetailDialog } from "./ticket-detail-dialog"; -import { TicketEditorDialog } from "./ticket-editor-dialog"; -import { TicketFeedback } from "./ticket-feedback"; -import { TicketInterventionDialog } from "./ticket-intervention-dialog"; +import type { TicketDTO } from "../../../../common/tickets"; +import { TicketPrioritySchema, TicketStateSchema } from "../../../../common/tickets"; +import { CompanyIdentity, CompanySelect } from "../../../companies/shared"; +import { TicketInterventionDialog } from "../../../interventions/create"; +import { TicketDetailDialog } from "../../detail"; +import { TicketEditorDialog, TicketFeedback, ticketApi, ticketKeys } from "../../shared"; export type TicketFilters = { search: string; company: string; diff --git a/modules/companies/src/web/tickets/shared/api/index.ts b/modules/companies/src/web/tickets/shared/api/index.ts new file mode 100644 index 0000000..eb07d07 --- /dev/null +++ b/modules/companies/src/web/tickets/shared/api/index.ts @@ -0,0 +1 @@ +export { TicketApiError, ticketApi, ticketKeys } from "./ticket-api"; diff --git a/modules/companies/src/web/tickets/ticket-api.ts b/modules/companies/src/web/tickets/shared/api/ticket-api.ts similarity index 88% rename from modules/companies/src/web/tickets/ticket-api.ts rename to modules/companies/src/web/tickets/shared/api/ticket-api.ts index 1a561db..44e2b27 100644 --- a/modules/companies/src/web/tickets/ticket-api.ts +++ b/modules/companies/src/web/tickets/shared/api/ticket-api.ts @@ -1,7 +1,11 @@ import { z } from "zod/v4"; -import type { SaveTicketInput } from "../../common/tickets"; -import { TicketListSchema, TicketLookupsSchema, TicketResponseSchema } from "../../common/tickets"; +import type { SaveTicketInput } from "../../../../common/tickets"; +import { + TicketListSchema, + TicketLookupsSchema, + TicketResponseSchema, +} from "../../../../common/tickets"; export const ticketKeys = { list: (companyId?: string) => ["tickets", companyId ?? "global"], lookups: (companyId: string) => ["ticket-lookups", companyId], diff --git a/modules/companies/src/web/tickets/shared/index.ts b/modules/companies/src/web/tickets/shared/index.ts new file mode 100644 index 0000000..a2e0ff1 --- /dev/null +++ b/modules/companies/src/web/tickets/shared/index.ts @@ -0,0 +1,8 @@ +export { ticketApi, ticketKeys } from "./api"; +export { + TicketEditorDialog, + TicketFeedback, + TicketForm, + TicketTargets, + ticketTargetOptions, +} from "./ui"; diff --git a/modules/companies/src/web/tickets/tickets.test.tsx b/modules/companies/src/web/tickets/shared/tickets.test.tsx similarity index 93% rename from modules/companies/src/web/tickets/tickets.test.tsx rename to modules/companies/src/web/tickets/shared/tickets.test.tsx index e2d4179..7af207c 100644 --- a/modules/companies/src/web/tickets/tickets.test.tsx +++ b/modules/companies/src/web/tickets/shared/tickets.test.tsx @@ -8,12 +8,12 @@ import type { ReactNode } from "react"; import { renderToStaticMarkup } from "react-dom/server"; import { I18nextProvider } from "react-i18next"; -import type { TicketDTO, TicketListDTO } from "../../common/tickets"; -import { companiesEnglish, companiesSpanish } from "../i18n"; +import type { TicketDTO, TicketListDTO } from "../../../common/tickets"; +import { companiesEnglish, companiesSpanish } from "../../shared"; +import { TicketsPage, filterTickets } from "../list"; -import { ticketKeys } from "./ticket-api"; -import { TicketForm } from "./ticket-form"; -import { TicketsPage, filterTickets } from "./tickets-page"; +import { ticketKeys } from "./api"; +import { TicketForm } from "./ui"; const companyId = UniqueID.generateNewID().toPrimitive(); const personId = UniqueID.generateNewID().toPrimitive(); diff --git a/modules/companies/src/web/tickets/shared/ui/index.ts b/modules/companies/src/web/tickets/shared/ui/index.ts new file mode 100644 index 0000000..b7dfb7d --- /dev/null +++ b/modules/companies/src/web/tickets/shared/ui/index.ts @@ -0,0 +1,4 @@ +export { TicketEditorDialog } from "./ticket-editor-dialog"; +export { TicketFeedback } from "./ticket-feedback"; +export { TicketForm } from "./ticket-form"; +export { TicketTargets, ticketTargetOptions } from "./ticket-targets"; diff --git a/modules/companies/src/web/tickets/ticket-classification-fields.tsx b/modules/companies/src/web/tickets/shared/ui/ticket-classification-fields.tsx similarity index 91% rename from modules/companies/src/web/tickets/ticket-classification-fields.tsx rename to modules/companies/src/web/tickets/shared/ui/ticket-classification-fields.tsx index 61fcf45..52141e9 100644 --- a/modules/companies/src/web/tickets/ticket-classification-fields.tsx +++ b/modules/companies/src/web/tickets/shared/ui/ticket-classification-fields.tsx @@ -3,8 +3,12 @@ import { SelectWithAction } from "@repo/shadcn-ui/components/select-with-action" import type { UseFormReturn } from "react-hook-form"; import { useTranslation } from "react-i18next"; -import type { TicketInput } from "../../common/tickets"; -import { TicketChannelSchema, TicketPrioritySchema, TicketStateSchema } from "../../common/tickets"; +import type { TicketInput } from "../../../../common/tickets"; +import { + TicketChannelSchema, + TicketPrioritySchema, + TicketStateSchema, +} from "../../../../common/tickets"; export function TicketClassificationFields({ form, prefix, diff --git a/modules/companies/src/web/tickets/ticket-editor-dialog.tsx b/modules/companies/src/web/tickets/shared/ui/ticket-editor-dialog.tsx similarity index 100% rename from modules/companies/src/web/tickets/ticket-editor-dialog.tsx rename to modules/companies/src/web/tickets/shared/ui/ticket-editor-dialog.tsx diff --git a/modules/companies/src/web/tickets/ticket-feedback.tsx b/modules/companies/src/web/tickets/shared/ui/ticket-feedback.tsx similarity index 91% rename from modules/companies/src/web/tickets/ticket-feedback.tsx rename to modules/companies/src/web/tickets/shared/ui/ticket-feedback.tsx index d9c794b..840675d 100644 --- a/modules/companies/src/web/tickets/ticket-feedback.tsx +++ b/modules/companies/src/web/tickets/shared/ui/ticket-feedback.tsx @@ -1,6 +1,6 @@ import { useTranslation } from "react-i18next"; -import { TicketApiError } from "./ticket-api"; +import { TicketApiError } from "../api"; export function TicketFeedback({ error, invalid = false }: { error: unknown; invalid?: boolean }) { const { t } = useTranslation("companies"); diff --git a/modules/companies/src/web/tickets/ticket-form.tsx b/modules/companies/src/web/tickets/shared/ui/ticket-form.tsx similarity index 96% rename from modules/companies/src/web/tickets/ticket-form.tsx rename to modules/companies/src/web/tickets/shared/ui/ticket-form.tsx index 7a40526..da89b0d 100644 --- a/modules/companies/src/web/tickets/ticket-form.tsx +++ b/modules/companies/src/web/tickets/shared/ui/ticket-form.tsx @@ -16,15 +16,15 @@ import type { TicketInput, TicketListDTO, TicketTargetInput, -} from "../../common/tickets"; -import { TicketInputSchema } from "../../common/tickets"; -import { CompanySelect } from "../components/company-select"; +} from "../../../../common/tickets"; +import { TicketInputSchema } from "../../../../common/tickets"; +import { CompanySelect } from "../../../companies/shared"; +import { TicketQuickForms } from "../../create/ui/ticket-quick-forms"; +import { ticketApi, ticketKeys } from "../api"; -import { ticketApi, ticketKeys } from "./ticket-api"; import { TicketClassificationFields } from "./ticket-classification-fields"; import { TicketFeedback } from "./ticket-feedback"; import { TicketHelp } from "./ticket-help"; -import { TicketQuickForms } from "./ticket-quick-forms"; import { TicketTargets } from "./ticket-targets"; export function TicketForm({ scope, diff --git a/modules/companies/src/web/tickets/ticket-help.tsx b/modules/companies/src/web/tickets/shared/ui/ticket-help.tsx similarity index 100% rename from modules/companies/src/web/tickets/ticket-help.tsx rename to modules/companies/src/web/tickets/shared/ui/ticket-help.tsx diff --git a/modules/companies/src/web/tickets/ticket-targets.tsx b/modules/companies/src/web/tickets/shared/ui/ticket-targets.tsx similarity index 96% rename from modules/companies/src/web/tickets/ticket-targets.tsx rename to modules/companies/src/web/tickets/shared/ui/ticket-targets.tsx index ca5b8d4..c5c6c5e 100644 --- a/modules/companies/src/web/tickets/ticket-targets.tsx +++ b/modules/companies/src/web/tickets/shared/ui/ticket-targets.tsx @@ -5,10 +5,9 @@ import { useQueryClient } from "@tanstack/react-query"; import { useId, useState } from "react"; import { useTranslation } from "react-i18next"; -import type { TicketLookupsDTO, TicketTargetInput } from "../../common/tickets"; - -import { ticketKeys } from "./ticket-api"; -import { TicketTargetCreateDialog } from "./ticket-target-create-dialog"; +import type { TicketLookupsDTO, TicketTargetInput } from "../../../../common/tickets"; +import { TicketTargetCreateDialog } from "../../create/ui/ticket-target-create-dialog"; +import { ticketKeys } from "../api"; export function ticketTargetOptions(lookups: TicketLookupsDTO, kind: TicketTargetInput["kind"]) { switch (kind) { case "person": diff --git a/modules/companies/src/web/work-environments/detail/hooks/index.ts b/modules/companies/src/web/work-environments/detail/hooks/index.ts new file mode 100644 index 0000000..ba65786 --- /dev/null +++ b/modules/companies/src/web/work-environments/detail/hooks/index.ts @@ -0,0 +1 @@ +export { useEnvironmentQueries } from "./use-environment-queries"; diff --git a/modules/companies/src/web/profiles/use-environment-queries.ts b/modules/companies/src/web/work-environments/detail/hooks/use-environment-queries.ts similarity index 81% rename from modules/companies/src/web/profiles/use-environment-queries.ts rename to modules/companies/src/web/work-environments/detail/hooks/use-environment-queries.ts index 1c6fa63..b11f0db 100644 --- a/modules/companies/src/web/profiles/use-environment-queries.ts +++ b/modules/companies/src/web/work-environments/detail/hooks/use-environment-queries.ts @@ -5,17 +5,16 @@ import { } from "@metis/resources/client"; import { useQuery } from "@tanstack/react-query"; -import { accessApi, accessKeys } from "../access/access-api"; -import { applicationApi, applicationKeys } from "../applications/application-api"; -import { certificateApi, certificateKeys } from "../certificates/certificate-api"; -import { folderApi, folderKeys } from "../folders/folder-api"; -import { mailApi, mailKeys } from "../mail/mail-api"; -import { printerApi, printerKeys } from "../printers/printer-api"; -import { remoteApi, remoteKeys } from "../remote/remote-api"; -import { teleworkApi, teleworkKeys } from "../telework/telework-api"; - -import type { EnvironmentSources } from "./work-environment.model"; -import { profileApi, profileKeys } from "./work-profile-api"; +import { accessApi, accessKeys } from "../../../access"; +import { applicationApi, applicationKeys } from "../../../application-configurations"; +import { certificateApi, certificateKeys } from "../../../certificate-configurations"; +import { folderApi, folderKeys } from "../../../folder-mappings"; +import { mailApi, mailKeys } from "../../../mail-configurations"; +import { printerApi, printerKeys } from "../../../printer-configurations"; +import { remoteApi, remoteKeys } from "../../../remote-connections"; +import { teleworkApi, teleworkKeys } from "../../../telework-authorizations"; +import { profileApi, profileKeys } from "../../../work-profiles/shared"; +import type { EnvironmentSources } from "../../shared"; export function useEnvironmentQueries(companyId: string) { const profiles = useQuery({ diff --git a/modules/companies/src/web/work-environments/detail/index.ts b/modules/companies/src/web/work-environments/detail/index.ts new file mode 100644 index 0000000..a6e83f3 --- /dev/null +++ b/modules/companies/src/web/work-environments/detail/index.ts @@ -0,0 +1 @@ +export { ProfileConfigurations, WorkEnvironmentPage } from "./ui"; diff --git a/modules/companies/src/web/profiles/environment-content.tsx b/modules/companies/src/web/work-environments/detail/ui/environment-content.tsx similarity index 94% rename from modules/companies/src/web/profiles/environment-content.tsx rename to modules/companies/src/web/work-environments/detail/ui/environment-content.tsx index 6a67a5e..66e4b95 100644 --- a/modules/companies/src/web/profiles/environment-content.tsx +++ b/modules/companies/src/web/work-environments/detail/ui/environment-content.tsx @@ -4,17 +4,17 @@ import { Card, CardContent } from "@repo/shadcn-ui/components/card"; import { useState } from "react"; import { useTranslation } from "react-i18next"; -import type { CompanyDTO, WorkProfileDTO } from "../../common"; -import type { RemoteConnectionDTO } from "../../common/remote-connections"; -import type { TeleworkAuthorizationDTO } from "../../common/telework-authorizations"; -import { accessLabel } from "../access/access-labels"; -import { RemoteSummary } from "../remote/remote-summary"; -import { TeleworkAuthorizationSummary } from "../telework/telework-authorization-summary"; +import type { CompanyDTO, WorkProfileDTO } from "../../../../common"; +import type { RemoteConnectionDTO } from "../../../../common/remote-connections"; +import type { TeleworkAuthorizationDTO } from "../../../../common/telework-authorizations"; +import { accessLabel } from "../../../access"; +import { RemoteSummary } from "../../../remote-connections"; +import { TeleworkAuthorizationSummary } from "../../../telework-authorizations"; +import type { EnvironmentSources, ProfileConfigurationKind } from "../../shared"; +import { buildEnvironment } from "../../shared"; import { EnvironmentSection } from "./environment-section"; import { HardwareCharacteristics } from "./hardware-characteristics"; -import type { EnvironmentSources, ProfileConfigurationKind } from "./work-environment.model"; -import { buildEnvironment } from "./work-environment.model"; export function EnvironmentContent({ connections, diff --git a/modules/companies/src/web/profiles/environment-section.tsx b/modules/companies/src/web/work-environments/detail/ui/environment-section.tsx similarity index 98% rename from modules/companies/src/web/profiles/environment-section.tsx rename to modules/companies/src/web/work-environments/detail/ui/environment-section.tsx index 0b01426..4f5ddca 100644 --- a/modules/companies/src/web/profiles/environment-section.tsx +++ b/modules/companies/src/web/work-environments/detail/ui/environment-section.tsx @@ -2,7 +2,7 @@ import { Button } from "@repo/shadcn-ui/components/button"; import { Card, CardContent } from "@repo/shadcn-ui/components/card"; import { useTranslation } from "react-i18next"; -import type { EnvironmentRow, ProfileConfigurationKind } from "./work-environment.model"; +import type { EnvironmentRow, ProfileConfigurationKind } from "../../shared"; export function EnvironmentSection({ attention, diff --git a/modules/companies/src/web/profiles/hardware-characteristics.tsx b/modules/companies/src/web/work-environments/detail/ui/hardware-characteristics.tsx similarity index 100% rename from modules/companies/src/web/profiles/hardware-characteristics.tsx rename to modules/companies/src/web/work-environments/detail/ui/hardware-characteristics.tsx diff --git a/modules/companies/src/web/work-environments/detail/ui/index.ts b/modules/companies/src/web/work-environments/detail/ui/index.ts new file mode 100644 index 0000000..1049a4a --- /dev/null +++ b/modules/companies/src/web/work-environments/detail/ui/index.ts @@ -0,0 +1,2 @@ +export { ProfileConfigurations } from "./profile-configurations"; +export { WorkEnvironmentPage } from "./work-environment-page"; diff --git a/modules/companies/src/web/profiles/profile-configurations.tsx b/modules/companies/src/web/work-environments/detail/ui/profile-configurations.tsx similarity index 74% rename from modules/companies/src/web/profiles/profile-configurations.tsx rename to modules/companies/src/web/work-environments/detail/ui/profile-configurations.tsx index af2f20a..90c1b33 100644 --- a/modules/companies/src/web/profiles/profile-configurations.tsx +++ b/modules/companies/src/web/work-environments/detail/ui/profile-configurations.tsx @@ -1,16 +1,16 @@ import { Button } from "@repo/shadcn-ui/components/button"; import { useTranslation } from "react-i18next"; -import type { CompanyDTO } from "../../common"; -import { ApplicationConfigurationsPage } from "../applications/application-configurations-page"; -import { CertificateConfigurationsPage } from "../certificates/certificate-configurations-page"; -import { FolderMappingsPage } from "../folders/folder-mappings-page"; -import { MailConfigurationsPage } from "../mail/mail-configurations-page"; -import { PrinterConfigurationsPage } from "../printers/printer-configurations-page"; -import { RemoteConnectionsPage } from "../remote/remote-connections-page"; -import { TeleworkAuthorizationsPage } from "../telework/telework-authorizations-page"; +import type { CompanyDTO } from "../../../../common"; +import { ApplicationConfigurationsPage } from "../../../application-configurations"; +import { CertificateConfigurationsPage } from "../../../certificate-configurations"; +import { FolderMappingsPage } from "../../../folder-mappings"; +import { MailConfigurationsPage } from "../../../mail-configurations"; +import { PrinterConfigurationsPage } from "../../../printer-configurations"; +import { RemoteConnectionsPage } from "../../../remote-connections"; +import { TeleworkAuthorizationsPage } from "../../../telework-authorizations"; +import type { ProfileSelection } from "../../../work-profiles/shared"; -import type { ProfileSelection } from "./profile-selection"; import { WorkEnvironmentPage } from "./work-environment-page"; export function ProfileConfigurations({ diff --git a/modules/companies/src/web/profiles/work-environment-page.tsx b/modules/companies/src/web/work-environments/detail/ui/work-environment-page.tsx similarity index 89% rename from modules/companies/src/web/profiles/work-environment-page.tsx rename to modules/companies/src/web/work-environments/detail/ui/work-environment-page.tsx index 96709ef..1436aaa 100644 --- a/modules/companies/src/web/profiles/work-environment-page.tsx +++ b/modules/companies/src/web/work-environments/detail/ui/work-environment-page.tsx @@ -1,11 +1,11 @@ import { Button } from "@repo/shadcn-ui/components/button"; import { useTranslation } from "react-i18next"; -import type { CompanyDTO } from "../../common"; +import type { CompanyDTO } from "../../../../common"; +import type { ProfileConfigurationKind } from "../../shared"; +import { useEnvironmentQueries } from "../hooks"; import { EnvironmentContent } from "./environment-content"; -import { useEnvironmentQueries } from "./use-environment-queries"; -import type { ProfileConfigurationKind } from "./work-environment.model"; export function WorkEnvironmentPage({ company, diff --git a/modules/companies/src/web/work-environments/index.ts b/modules/companies/src/web/work-environments/index.ts new file mode 100644 index 0000000..1ad8868 --- /dev/null +++ b/modules/companies/src/web/work-environments/index.ts @@ -0,0 +1 @@ +export { ProfileConfigurations } from "./detail"; diff --git a/modules/companies/src/web/work-environments/shared/helpers/index.ts b/modules/companies/src/web/work-environments/shared/helpers/index.ts new file mode 100644 index 0000000..8329e13 --- /dev/null +++ b/modules/companies/src/web/work-environments/shared/helpers/index.ts @@ -0,0 +1,6 @@ +export type { + EnvironmentRow, + EnvironmentSources, + ProfileConfigurationKind, +} from "./work-environment.model"; +export { buildEnvironment } from "./work-environment.model"; diff --git a/modules/companies/src/web/profiles/work-environment.model.ts b/modules/companies/src/web/work-environments/shared/helpers/work-environment.model.ts similarity index 99% rename from modules/companies/src/web/profiles/work-environment.model.ts rename to modules/companies/src/web/work-environments/shared/helpers/work-environment.model.ts index 75a0023..5404a3c 100644 --- a/modules/companies/src/web/profiles/work-environment.model.ts +++ b/modules/companies/src/web/work-environments/shared/helpers/work-environment.model.ts @@ -9,7 +9,7 @@ import type { MailConfigurationDTO, PrinterConfigurationDTO, WorkProfileDTO, -} from "../../common"; +} from "../../../../common"; export type ProfileConfigurationKind = | "mail" | "folders" diff --git a/modules/companies/src/web/work-environments/shared/index.ts b/modules/companies/src/web/work-environments/shared/index.ts new file mode 100644 index 0000000..33897b7 --- /dev/null +++ b/modules/companies/src/web/work-environments/shared/index.ts @@ -0,0 +1,2 @@ +export type { EnvironmentRow, EnvironmentSources, ProfileConfigurationKind } from "./helpers"; +export { buildEnvironment } from "./helpers"; diff --git a/modules/companies/src/web/profiles/work-environment.test.tsx b/modules/companies/src/web/work-environments/shared/work-environment.test.tsx similarity index 93% rename from modules/companies/src/web/profiles/work-environment.test.tsx rename to modules/companies/src/web/work-environments/shared/work-environment.test.tsx index 01297c7..3e6cea4 100644 --- a/modules/companies/src/web/profiles/work-environment.test.tsx +++ b/modules/companies/src/web/work-environments/shared/work-environment.test.tsx @@ -17,23 +17,23 @@ import { MailConfigurationSchema, PrinterConfigurationSchema, WorkProfileSchema, -} from "../../common"; -import { RemoteConnectionSchema } from "../../common/remote-connections"; -import { TeleworkAuthorizationSchema } from "../../common/telework-authorizations"; -import { accessKeys } from "../access/access-api"; -import { applicationKeys } from "../applications/application-api"; -import { certificateKeys } from "../certificates/certificate-api"; -import { folderKeys } from "../folders/folder-api"; -import { companiesEnglish, companiesSpanish } from "../i18n"; -import { mailKeys } from "../mail/mail-api"; -import { printerKeys } from "../printers/printer-api"; -import { remoteKeys } from "../remote/remote-api"; -import { teleworkKeys } from "../telework/telework-api"; +} from "../../../common"; +import { RemoteConnectionSchema } from "../../../common/remote-connections"; +import { TeleworkAuthorizationSchema } from "../../../common/telework-authorizations"; +import { accessKeys } from "../../access"; +import { applicationKeys } from "../../application-configurations"; +import { certificateKeys } from "../../certificate-configurations"; +import { folderKeys } from "../../folder-mappings"; +import { mailKeys } from "../../mail-configurations"; +import { printerKeys } from "../../printer-configurations"; +import { remoteKeys } from "../../remote-connections"; +import { companiesEnglish, companiesSpanish } from "../../shared"; +import { teleworkKeys } from "../../telework-authorizations"; +import { profileKeys } from "../../work-profiles"; +import { WorkEnvironmentPage } from "../detail"; -import type { EnvironmentSources } from "./work-environment.model"; -import { buildEnvironment } from "./work-environment.model"; -import { WorkEnvironmentPage } from "./work-environment-page"; -import { profileKeys } from "./work-profile-api"; +import type { EnvironmentSources } from "./helpers"; +import { buildEnvironment } from "./helpers"; const id = (n: number) => `0199b200-0000-7000-8000-${String(n).padStart(12, "0")}`; const company = { diff --git a/modules/companies/src/web/work-profiles/history/index.ts b/modules/companies/src/web/work-profiles/history/index.ts new file mode 100644 index 0000000..bfeda1b --- /dev/null +++ b/modules/companies/src/web/work-profiles/history/index.ts @@ -0,0 +1 @@ +export { WorkProfileHistoryDialog } from "./ui"; diff --git a/modules/companies/src/web/work-profiles/history/ui/index.ts b/modules/companies/src/web/work-profiles/history/ui/index.ts new file mode 100644 index 0000000..95420b6 --- /dev/null +++ b/modules/companies/src/web/work-profiles/history/ui/index.ts @@ -0,0 +1 @@ +export { WorkProfileHistoryDialog } from "./work-profile-history-dialog"; diff --git a/modules/companies/src/web/profiles/work-profile-history-dialog.tsx b/modules/companies/src/web/work-profiles/history/ui/work-profile-history-dialog.tsx similarity index 97% rename from modules/companies/src/web/profiles/work-profile-history-dialog.tsx rename to modules/companies/src/web/work-profiles/history/ui/work-profile-history-dialog.tsx index e21ce0f..d922089 100644 --- a/modules/companies/src/web/profiles/work-profile-history-dialog.tsx +++ b/modules/companies/src/web/work-profiles/history/ui/work-profile-history-dialog.tsx @@ -2,7 +2,7 @@ import type { WorkstationDTO } from "@metis/assets/common"; import { FormDialog } from "@repo/shadcn-ui/components/form-dialog"; import { useTranslation } from "react-i18next"; -import type { WorkProfileDTO } from "../../common/work-profiles"; +import type { WorkProfileDTO } from "../../../../common/work-profiles"; export function WorkProfileHistoryDialog({ profile, diff --git a/modules/companies/src/web/work-profiles/index.ts b/modules/companies/src/web/work-profiles/index.ts new file mode 100644 index 0000000..b6578b6 --- /dev/null +++ b/modules/companies/src/web/work-profiles/index.ts @@ -0,0 +1,2 @@ +export { WorkProfilesPage } from "./list"; +export { profileKeys } from "./shared"; diff --git a/modules/companies/src/web/work-profiles/list/index.ts b/modules/companies/src/web/work-profiles/list/index.ts new file mode 100644 index 0000000..227e9b1 --- /dev/null +++ b/modules/companies/src/web/work-profiles/list/index.ts @@ -0,0 +1 @@ +export { WorkProfilesPage } from "./ui"; diff --git a/modules/companies/src/web/work-profiles/list/ui/index.ts b/modules/companies/src/web/work-profiles/list/ui/index.ts new file mode 100644 index 0000000..2571fd1 --- /dev/null +++ b/modules/companies/src/web/work-profiles/list/ui/index.ts @@ -0,0 +1 @@ +export { WorkProfilesPage } from "./work-profiles-page"; diff --git a/modules/companies/src/web/profiles/work-profiles-page.tsx b/modules/companies/src/web/work-profiles/list/ui/work-profiles-page.tsx similarity index 94% rename from modules/companies/src/web/profiles/work-profiles-page.tsx rename to modules/companies/src/web/work-profiles/list/ui/work-profiles-page.tsx index 7f0dda3..19537d8 100644 --- a/modules/companies/src/web/profiles/work-profiles-page.tsx +++ b/modules/companies/src/web/work-profiles/list/ui/work-profiles-page.tsx @@ -11,16 +11,12 @@ import { useQuery } from "@tanstack/react-query"; import { useState } from "react"; import { useTranslation } from "react-i18next"; -import type { CompanyDTO } from "../../common"; -import { accessApi, accessKeys } from "../access/access-api"; -import { accessLabel } from "../access/access-labels"; - -import { ProfileConfigurations } from "./profile-configurations"; -import { ProfileFeedback } from "./profile-feedback"; -import type { ProfileSelection } from "./profile-selection"; -import { profileApi, profileKeys } from "./work-profile-api"; -import { WorkProfileEditorDialog } from "./work-profile-editor-dialog"; -import { WorkProfileHistoryDialog } from "./work-profile-history-dialog"; +import type { CompanyDTO } from "../../../../common"; +import { accessApi, accessKeys, accessLabel } from "../../../access"; +import { ProfileConfigurations } from "../../../work-environments"; +import { WorkProfileHistoryDialog } from "../../history"; +import type { ProfileSelection } from "../../shared"; +import { ProfileFeedback, WorkProfileEditorDialog, profileApi, profileKeys } from "../../shared"; export function WorkProfilesPage({ company, diff --git a/modules/companies/src/web/work-profiles/shared/api/index.ts b/modules/companies/src/web/work-profiles/shared/api/index.ts new file mode 100644 index 0000000..c6a110e --- /dev/null +++ b/modules/companies/src/web/work-profiles/shared/api/index.ts @@ -0,0 +1 @@ +export { WorkProfileApiError, profileApi, profileKeys } from "./work-profile-api"; diff --git a/modules/companies/src/web/profiles/work-profile-api.ts b/modules/companies/src/web/work-profiles/shared/api/work-profile-api.ts similarity index 86% rename from modules/companies/src/web/profiles/work-profile-api.ts rename to modules/companies/src/web/work-profiles/shared/api/work-profile-api.ts index fafa770..240a724 100644 --- a/modules/companies/src/web/profiles/work-profile-api.ts +++ b/modules/companies/src/web/work-profiles/shared/api/work-profile-api.ts @@ -1,7 +1,10 @@ import { z } from "zod/v4"; -import type { WorkProfileInput } from "../../common/work-profiles"; -import { WorkProfileResponseSchema, WorkProfilesResponseSchema } from "../../common/work-profiles"; +import type { WorkProfileInput } from "../../../../common/work-profiles"; +import { + WorkProfileResponseSchema, + WorkProfilesResponseSchema, +} from "../../../../common/work-profiles"; export const profileKeys = { company: (id: string) => ["work-profiles", id] }; export class WorkProfileApiError extends Error { constructor(public readonly code: string) { diff --git a/modules/companies/src/web/work-profiles/shared/index.ts b/modules/companies/src/web/work-profiles/shared/index.ts new file mode 100644 index 0000000..2a027bf --- /dev/null +++ b/modules/companies/src/web/work-profiles/shared/index.ts @@ -0,0 +1,3 @@ +export { profileApi, profileKeys } from "./api"; +export type { ProfileSelection } from "./types"; +export { ProfileFeedback, WorkProfileEditorDialog, WorkProfileForm } from "./ui"; diff --git a/modules/companies/src/web/profiles/profile.test.tsx b/modules/companies/src/web/work-profiles/shared/profile.test.tsx similarity index 90% rename from modules/companies/src/web/profiles/profile.test.tsx rename to modules/companies/src/web/work-profiles/shared/profile.test.tsx index 2842e18..af18891 100644 --- a/modules/companies/src/web/profiles/profile.test.tsx +++ b/modules/companies/src/web/work-profiles/shared/profile.test.tsx @@ -8,12 +8,12 @@ import type { ReactNode } from "react"; import { renderToStaticMarkup } from "react-dom/server"; import { I18nextProvider } from "react-i18next"; -import { accessKeys } from "../access/access-api"; -import { companiesEnglish, companiesSpanish } from "../i18n"; +import { accessKeys } from "../../access"; +import { companiesEnglish, companiesSpanish } from "../../shared"; +import { WorkProfilesPage } from "../list"; -import { profileKeys } from "./work-profile-api"; -import { WorkProfileForm } from "./work-profile-form"; -import { WorkProfilesPage } from "./work-profiles-page"; +import { profileKeys } from "./api"; +import { WorkProfileForm } from "./ui"; const company = { id: "0199b200-0000-7000-8000-000000000001", diff --git a/modules/companies/src/web/work-profiles/shared/types/index.ts b/modules/companies/src/web/work-profiles/shared/types/index.ts new file mode 100644 index 0000000..b401c5a --- /dev/null +++ b/modules/companies/src/web/work-profiles/shared/types/index.ts @@ -0,0 +1 @@ +export type { ProfileSelection } from "./profile-selection"; diff --git a/modules/companies/src/web/profiles/profile-selection.ts b/modules/companies/src/web/work-profiles/shared/types/profile-selection.ts similarity index 65% rename from modules/companies/src/web/profiles/profile-selection.ts rename to modules/companies/src/web/work-profiles/shared/types/profile-selection.ts index 8026ec6..79cfaf0 100644 --- a/modules/companies/src/web/profiles/profile-selection.ts +++ b/modules/companies/src/web/work-profiles/shared/types/profile-selection.ts @@ -1,4 +1,4 @@ -import type { ProfileConfigurationKind } from "./work-environment.model"; +import type { ProfileConfigurationKind } from "../../../work-environments/shared"; export type ProfileSelection = { kind: ProfileConfigurationKind | "environment" | "telework" | "remote"; diff --git a/modules/companies/src/web/work-profiles/shared/ui/index.ts b/modules/companies/src/web/work-profiles/shared/ui/index.ts new file mode 100644 index 0000000..d10d867 --- /dev/null +++ b/modules/companies/src/web/work-profiles/shared/ui/index.ts @@ -0,0 +1,3 @@ +export { ProfileFeedback } from "./profile-feedback"; +export { WorkProfileEditorDialog } from "./work-profile-editor-dialog"; +export { WorkProfileForm } from "./work-profile-form"; diff --git a/modules/companies/src/web/profiles/profile-feedback.tsx b/modules/companies/src/web/work-profiles/shared/ui/profile-feedback.tsx similarity index 86% rename from modules/companies/src/web/profiles/profile-feedback.tsx rename to modules/companies/src/web/work-profiles/shared/ui/profile-feedback.tsx index 6788eb7..73252f1 100644 --- a/modules/companies/src/web/profiles/profile-feedback.tsx +++ b/modules/companies/src/web/work-profiles/shared/ui/profile-feedback.tsx @@ -1,6 +1,6 @@ import { useTranslation } from "react-i18next"; -import { WorkProfileApiError } from "./work-profile-api"; +import { WorkProfileApiError } from "../api"; export function ProfileFeedback({ error }: { error: unknown }) { const { t } = useTranslation("companies"); return error ? ( diff --git a/modules/companies/src/web/profiles/work-profile-editor-dialog.tsx b/modules/companies/src/web/work-profiles/shared/ui/work-profile-editor-dialog.tsx similarity index 94% rename from modules/companies/src/web/profiles/work-profile-editor-dialog.tsx rename to modules/companies/src/web/work-profiles/shared/ui/work-profile-editor-dialog.tsx index ecb3e92..bc093c4 100644 --- a/modules/companies/src/web/profiles/work-profile-editor-dialog.tsx +++ b/modules/companies/src/web/work-profiles/shared/ui/work-profile-editor-dialog.tsx @@ -2,7 +2,7 @@ import { FormDialog } from "@repo/shadcn-ui/components/form-dialog"; import type { ComponentProps } from "react"; import { useTranslation } from "react-i18next"; -import type { CompanyDTO } from "../../common"; +import type { CompanyDTO } from "../../../../common"; import { WorkProfileForm } from "./work-profile-form"; diff --git a/modules/companies/src/web/profiles/work-profile-form.tsx b/modules/companies/src/web/work-profiles/shared/ui/work-profile-form.tsx similarity index 93% rename from modules/companies/src/web/profiles/work-profile-form.tsx rename to modules/companies/src/web/work-profiles/shared/ui/work-profile-form.tsx index 18d1d4d..d5b45e1 100644 --- a/modules/companies/src/web/profiles/work-profile-form.tsx +++ b/modules/companies/src/web/work-profiles/shared/ui/work-profile-form.tsx @@ -12,16 +12,15 @@ import { useEffect, useId, useRef, useState } from "react"; import { useForm } from "react-hook-form"; import { useTranslation } from "react-i18next"; -import type { CompanyDTO } from "../../common"; -import type { WorkProfileDTO, WorkProfileInput } from "../../common/work-profiles"; -import { WorkProfileInputSchema } from "../../common/work-profiles"; -import { accessApi, accessKeys } from "../access/access-api"; -import { accessLabel } from "../access/access-labels"; -import type { ConfigurationQuickKind } from "../components/configuration-quick-editor"; -import { ConfigurationQuickEditor } from "../components/configuration-quick-editor"; +import type { CompanyDTO } from "../../../../common"; +import type { WorkProfileDTO, WorkProfileInput } from "../../../../common/work-profiles"; +import { WorkProfileInputSchema } from "../../../../common/work-profiles"; +import { accessApi, accessKeys, accessLabel } from "../../../access"; +import type { ConfigurationQuickKind } from "../../../shared"; +import { ConfigurationQuickEditor } from "../../../shared"; +import { profileApi, profileKeys } from "../api"; import { ProfileFeedback } from "./profile-feedback"; -import { profileApi, profileKeys } from "./work-profile-api"; export function WorkProfileForm({ company, diff --git a/modules/companies/src/web/workspace/catalogs/index.ts b/modules/companies/src/web/workspace/catalogs/index.ts new file mode 100644 index 0000000..297aad4 --- /dev/null +++ b/modules/companies/src/web/workspace/catalogs/index.ts @@ -0,0 +1 @@ +export { GlobalCatalogContent } from "./ui"; diff --git a/modules/companies/src/web/components/global-catalog-content.tsx b/modules/companies/src/web/workspace/catalogs/ui/global-catalog-content.tsx similarity index 84% rename from modules/companies/src/web/components/global-catalog-content.tsx rename to modules/companies/src/web/workspace/catalogs/ui/global-catalog-content.tsx index 2d10608..9dfcec2 100644 --- a/modules/companies/src/web/components/global-catalog-content.tsx +++ b/modules/companies/src/web/workspace/catalogs/ui/global-catalog-content.tsx @@ -1,8 +1,8 @@ import { AssetCatalogPage, BrandCatalogPage } from "@metis/assets/client"; import { ResourceCatalogPage } from "@metis/resources/client"; -import { AccessWorkspacePage } from "../access/access-workspace"; -import { InterventionTemplatesPage } from "../intervention-templates/templates-page"; +import { AccessWorkspacePage } from "../../../access"; +import { InterventionTemplatesPage } from "../../../intervention-templates"; export function GlobalCatalogContent({ catalog, diff --git a/modules/companies/src/web/workspace/catalogs/ui/index.ts b/modules/companies/src/web/workspace/catalogs/ui/index.ts new file mode 100644 index 0000000..cc8b7ac --- /dev/null +++ b/modules/companies/src/web/workspace/catalogs/ui/index.ts @@ -0,0 +1 @@ +export { GlobalCatalogContent } from "./global-catalog-content"; diff --git a/modules/companies/src/web/workspace/index.ts b/modules/companies/src/web/workspace/index.ts new file mode 100644 index 0000000..1f8fdf6 --- /dev/null +++ b/modules/companies/src/web/workspace/index.ts @@ -0,0 +1 @@ +export { CompaniesWorkspace } from "./view"; diff --git a/modules/companies/src/web/workspace/settings/index.ts b/modules/companies/src/web/workspace/settings/index.ts new file mode 100644 index 0000000..9e6e08a --- /dev/null +++ b/modules/companies/src/web/workspace/settings/index.ts @@ -0,0 +1 @@ +export { WorkspaceSettingsDialog } from "./ui"; diff --git a/modules/companies/src/web/workspace/settings/ui/index.ts b/modules/companies/src/web/workspace/settings/ui/index.ts new file mode 100644 index 0000000..748bba8 --- /dev/null +++ b/modules/companies/src/web/workspace/settings/ui/index.ts @@ -0,0 +1 @@ +export { WorkspaceSettingsDialog } from "./workspace-settings-dialog"; diff --git a/modules/companies/src/web/components/workspace-settings-dialog.tsx b/modules/companies/src/web/workspace/settings/ui/workspace-settings-dialog.tsx similarity index 100% rename from modules/companies/src/web/components/workspace-settings-dialog.tsx rename to modules/companies/src/web/workspace/settings/ui/workspace-settings-dialog.tsx diff --git a/modules/companies/src/web/workspace/shared/index.ts b/modules/companies/src/web/workspace/shared/index.ts new file mode 100644 index 0000000..ae3f49a --- /dev/null +++ b/modules/companies/src/web/workspace/shared/index.ts @@ -0,0 +1,2 @@ +export type { WorkspaceLocation } from "./types"; +export { WorkspaceNavigationButton } from "./ui"; diff --git a/modules/companies/src/web/workspace/shared/types/index.ts b/modules/companies/src/web/workspace/shared/types/index.ts new file mode 100644 index 0000000..0ef7874 --- /dev/null +++ b/modules/companies/src/web/workspace/shared/types/index.ts @@ -0,0 +1 @@ +export type { WorkspaceLocation } from "./workspace-location"; diff --git a/modules/companies/src/web/components/workspace-location.ts b/modules/companies/src/web/workspace/shared/types/workspace-location.ts similarity index 60% rename from modules/companies/src/web/components/workspace-location.ts rename to modules/companies/src/web/workspace/shared/types/workspace-location.ts index be95438..498f786 100644 --- a/modules/companies/src/web/components/workspace-location.ts +++ b/modules/companies/src/web/workspace/shared/types/workspace-location.ts @@ -1,3 +1,3 @@ -import type { DashboardNavigation } from "./dashboard-api"; +import type { DashboardNavigation } from "../../../dashboard"; export type WorkspaceLocation = { area: "home" } | DashboardNavigation | { area: "catalogs" }; diff --git a/modules/companies/src/web/workspace/shared/ui/index.ts b/modules/companies/src/web/workspace/shared/ui/index.ts new file mode 100644 index 0000000..62583c2 --- /dev/null +++ b/modules/companies/src/web/workspace/shared/ui/index.ts @@ -0,0 +1 @@ +export { WorkspaceNavigationButton } from "./workspace-navigation-button"; diff --git a/modules/companies/src/web/components/workspace-navigation-button.tsx b/modules/companies/src/web/workspace/shared/ui/workspace-navigation-button.tsx similarity index 100% rename from modules/companies/src/web/components/workspace-navigation-button.tsx rename to modules/companies/src/web/workspace/shared/ui/workspace-navigation-button.tsx diff --git a/modules/companies/src/web/workspace/view/index.ts b/modules/companies/src/web/workspace/view/index.ts new file mode 100644 index 0000000..7160e01 --- /dev/null +++ b/modules/companies/src/web/workspace/view/index.ts @@ -0,0 +1 @@ +export { CompaniesWorkspace } from "./ui"; diff --git a/modules/companies/src/web/components/companies-workspace.tsx b/modules/companies/src/web/workspace/view/ui/companies-workspace.tsx similarity index 92% rename from modules/companies/src/web/components/companies-workspace.tsx rename to modules/companies/src/web/workspace/view/ui/companies-workspace.tsx index 601e15c..ee6ce9f 100644 --- a/modules/companies/src/web/components/companies-workspace.tsx +++ b/modules/companies/src/web/workspace/view/ui/companies-workspace.tsx @@ -4,14 +4,12 @@ import type { ReactNode } from "react"; import { useState } from "react"; import { useTranslation } from "react-i18next"; -import { companyApi, companyKeys } from "../api/company-api"; +import { CompanyDetail, CompanyFeedback, companyApi, companyKeys } from "../../../companies"; +import { WorkspaceSettingsDialog } from "../../settings"; +import type { WorkspaceLocation } from "../../shared"; -import { CompanyDetail } from "./company-detail"; -import { CompanyFeedback } from "./company-feedback"; import { WorkspaceContent } from "./workspace-content"; import { WorkspaceHeader } from "./workspace-header"; -import type { WorkspaceLocation } from "./workspace-location"; -import { WorkspaceSettingsDialog } from "./workspace-settings-dialog"; import { WorkspaceSidebar } from "./workspace-sidebar"; export function CompaniesWorkspace({ diff --git a/modules/companies/src/web/workspace/view/ui/index.ts b/modules/companies/src/web/workspace/view/ui/index.ts new file mode 100644 index 0000000..b1d2a0d --- /dev/null +++ b/modules/companies/src/web/workspace/view/ui/index.ts @@ -0,0 +1 @@ +export { CompaniesWorkspace } from "./companies-workspace"; diff --git a/modules/companies/src/web/components/workspace-content.tsx b/modules/companies/src/web/workspace/view/ui/workspace-content.tsx similarity index 82% rename from modules/companies/src/web/components/workspace-content.tsx rename to modules/companies/src/web/workspace/view/ui/workspace-content.tsx index 6af4826..5b7de55 100644 --- a/modules/companies/src/web/components/workspace-content.tsx +++ b/modules/companies/src/web/workspace/view/ui/workspace-content.tsx @@ -1,11 +1,10 @@ -import { InterventionsPage } from "../interventions/interventions-page"; -import { TicketsPage } from "../tickets/tickets-page"; - -import { CompaniesPage } from "./companies-page"; -import type { DashboardNavigation } from "./dashboard-api"; -import { DashboardPage } from "./dashboard-page"; -import { GlobalCatalogContent } from "./global-catalog-content"; -import type { WorkspaceLocation } from "./workspace-location"; +import { CompaniesPage } from "../../../companies"; +import type { DashboardNavigation } from "../../../dashboard"; +import { DashboardPage } from "../../../dashboard"; +import { InterventionsPage } from "../../../interventions"; +import { TicketsPage } from "../../../tickets"; +import { GlobalCatalogContent } from "../../catalogs"; +import type { WorkspaceLocation } from "../../shared"; export function WorkspaceContent({ area, diff --git a/modules/companies/src/web/components/workspace-header.tsx b/modules/companies/src/web/workspace/view/ui/workspace-header.tsx similarity index 97% rename from modules/companies/src/web/components/workspace-header.tsx rename to modules/companies/src/web/workspace/view/ui/workspace-header.tsx index eac83da..ad02afb 100644 --- a/modules/companies/src/web/components/workspace-header.tsx +++ b/modules/companies/src/web/workspace/view/ui/workspace-header.tsx @@ -5,9 +5,9 @@ import type { ReactNode } from "react"; import { useState } from "react"; import { useTranslation } from "react-i18next"; -import { CompanyIdentity } from "./company-identity"; -import { InitialsAvatar } from "./initials-avatar"; -import type { WorkspaceLocation } from "./workspace-location"; +import { CompanyIdentity } from "../../../companies"; +import { InitialsAvatar } from "../../../shared"; +import type { WorkspaceLocation } from "../../shared"; export function WorkspaceHeader({ companies, onNavigate, diff --git a/modules/companies/src/web/components/workspace-sidebar.tsx b/modules/companies/src/web/workspace/view/ui/workspace-sidebar.tsx similarity index 97% rename from modules/companies/src/web/components/workspace-sidebar.tsx rename to modules/companies/src/web/workspace/view/ui/workspace-sidebar.tsx index f1b34f1..ae036ba 100644 --- a/modules/companies/src/web/components/workspace-sidebar.tsx +++ b/modules/companies/src/web/workspace/view/ui/workspace-sidebar.tsx @@ -15,10 +15,11 @@ import type { ComponentProps } from "react"; import { useState } from "react"; import { useTranslation } from "react-i18next"; -import { CompanyAvatar } from "./company-avatar"; +import { CompanyAvatar } from "../../../companies"; +import type { WorkspaceLocation } from "../../shared"; +import { WorkspaceNavigationButton } from "../../shared"; + import type { WorkspaceContent } from "./workspace-content"; -import type { WorkspaceLocation } from "./workspace-location"; -import { WorkspaceNavigationButton } from "./workspace-navigation-button"; export function WorkspaceSidebar({ companies, current, diff --git a/modules/core/src/web/api/core.api.ts b/modules/core/src/web/health/check/api/core.api.ts similarity index 70% rename from modules/core/src/web/api/core.api.ts rename to modules/core/src/web/health/check/api/core.api.ts index 7a69c01..4ba1eed 100644 --- a/modules/core/src/web/api/core.api.ts +++ b/modules/core/src/web/health/check/api/core.api.ts @@ -1,5 +1,5 @@ -import type { GetHealthResponseDTO } from "../../common"; -import { GetHealthResponseSchema } from "../../common"; +import type { GetHealthResponseDTO } from "../../../../common"; +import { GetHealthResponseSchema } from "../../../../common"; export async function getHealth(signal: AbortSignal): Promise { const response = await fetch("/api/__health", { signal, cache: "no-store" }); diff --git a/modules/core/src/web/health/check/api/index.ts b/modules/core/src/web/health/check/api/index.ts new file mode 100644 index 0000000..967cbf9 --- /dev/null +++ b/modules/core/src/web/health/check/api/index.ts @@ -0,0 +1 @@ +export { getHealth } from "./core.api"; diff --git a/modules/core/src/web/health/check/index.ts b/modules/core/src/web/health/check/index.ts new file mode 100644 index 0000000..2c98726 --- /dev/null +++ b/modules/core/src/web/health/check/index.ts @@ -0,0 +1 @@ +export { getHealth } from "./api"; diff --git a/modules/core/src/web/health/index.ts b/modules/core/src/web/health/index.ts new file mode 100644 index 0000000..ebebbad --- /dev/null +++ b/modules/core/src/web/health/index.ts @@ -0,0 +1,2 @@ +export { getHealth } from "./check"; +export { coreQueryKeys } from "./shared"; diff --git a/modules/core/src/web/health/shared/index.ts b/modules/core/src/web/health/shared/index.ts new file mode 100644 index 0000000..385474f --- /dev/null +++ b/modules/core/src/web/health/shared/index.ts @@ -0,0 +1 @@ +export { coreQueryKeys } from "./queries"; diff --git a/modules/core/src/web/queries/core.query-keys.ts b/modules/core/src/web/health/shared/queries/core.query-keys.ts similarity index 100% rename from modules/core/src/web/queries/core.query-keys.ts rename to modules/core/src/web/health/shared/queries/core.query-keys.ts diff --git a/modules/core/src/web/health/shared/queries/index.ts b/modules/core/src/web/health/shared/queries/index.ts new file mode 100644 index 0000000..c1f3da5 --- /dev/null +++ b/modules/core/src/web/health/shared/queries/index.ts @@ -0,0 +1 @@ +export { coreQueryKeys } from "./core.query-keys"; diff --git a/modules/core/src/web/index.ts b/modules/core/src/web/index.ts index 766ac88..d295560 100644 --- a/modules/core/src/web/index.ts +++ b/modules/core/src/web/index.ts @@ -1,4 +1,4 @@ export { default as coreEnglish } from "../common/locales/en.json"; export { default as coreSpanish } from "../common/locales/es.json"; -export { HomePage } from "./pages/home-page"; +export { HomePage } from "./workspace"; diff --git a/modules/core/src/web/workspace/index.ts b/modules/core/src/web/workspace/index.ts new file mode 100644 index 0000000..d72e135 --- /dev/null +++ b/modules/core/src/web/workspace/index.ts @@ -0,0 +1 @@ +export { HomePage } from "./view"; diff --git a/modules/core/src/web/workspace/view/index.ts b/modules/core/src/web/workspace/view/index.ts new file mode 100644 index 0000000..4603f0a --- /dev/null +++ b/modules/core/src/web/workspace/view/index.ts @@ -0,0 +1 @@ +export { HomePage } from "./ui"; diff --git a/modules/core/src/web/pages/home-page.tsx b/modules/core/src/web/workspace/view/ui/home-page.tsx similarity index 95% rename from modules/core/src/web/pages/home-page.tsx rename to modules/core/src/web/workspace/view/ui/home-page.tsx index 0cb0a31..e256365 100644 --- a/modules/core/src/web/pages/home-page.tsx +++ b/modules/core/src/web/workspace/view/ui/home-page.tsx @@ -10,8 +10,7 @@ import { import { useQuery } from "@tanstack/react-query"; import { useTranslation } from "react-i18next"; -import { getHealth } from "../api/core.api"; -import { coreQueryKeys } from "../queries/core.query-keys"; +import { coreQueryKeys, getHealth } from "../../../health"; export function HomePage() { const { t } = useTranslation("core"); diff --git a/modules/core/src/web/workspace/view/ui/index.ts b/modules/core/src/web/workspace/view/ui/index.ts new file mode 100644 index 0000000..d43c295 --- /dev/null +++ b/modules/core/src/web/workspace/view/ui/index.ts @@ -0,0 +1 @@ +export { HomePage } from "./home-page"; diff --git a/modules/identity/src/web/i18n.ts b/modules/identity/src/web/i18n.ts deleted file mode 100644 index 897ed6e..0000000 --- a/modules/identity/src/web/i18n.ts +++ /dev/null @@ -1,2 +0,0 @@ -export { default as identityEnglish } from "../common/locales/en.json"; -export { default as identitySpanish } from "../common/locales/es.json"; diff --git a/modules/identity/src/web/index.ts b/modules/identity/src/web/index.ts index d0825de..71c4180 100644 --- a/modules/identity/src/web/index.ts +++ b/modules/identity/src/web/index.ts @@ -1,3 +1,2 @@ -export { identityApi, identityKeys } from "./api/identity-api"; -export { IdentityWorkspace } from "./components/identity-workspace"; -export { identityEnglish, identitySpanish } from "./i18n"; +export { identityApi, identityEnglish, identityKeys, identitySpanish } from "./shared"; +export { IdentityWorkspace } from "./workspace"; diff --git a/modules/identity/src/web/passwords/change/index.ts b/modules/identity/src/web/passwords/change/index.ts new file mode 100644 index 0000000..a1ce717 --- /dev/null +++ b/modules/identity/src/web/passwords/change/index.ts @@ -0,0 +1 @@ +export { AccountPasswordDialog } from "./ui"; diff --git a/modules/identity/src/web/components/account-password-dialog.tsx b/modules/identity/src/web/passwords/change/ui/account-password-dialog.tsx similarity index 92% rename from modules/identity/src/web/components/account-password-dialog.tsx rename to modules/identity/src/web/passwords/change/ui/account-password-dialog.tsx index 939f676..537bf2b 100644 --- a/modules/identity/src/web/components/account-password-dialog.tsx +++ b/modules/identity/src/web/passwords/change/ui/account-password-dialog.tsx @@ -1,7 +1,7 @@ import { FormDialog } from "@repo/shadcn-ui/components/form-dialog"; import { useTranslation } from "react-i18next"; -import { PasswordForm } from "./password-form"; +import { PasswordForm } from "../../shared"; export function AccountPasswordDialog({ open, diff --git a/modules/identity/src/web/passwords/change/ui/index.ts b/modules/identity/src/web/passwords/change/ui/index.ts new file mode 100644 index 0000000..3867371 --- /dev/null +++ b/modules/identity/src/web/passwords/change/ui/index.ts @@ -0,0 +1 @@ +export { AccountPasswordDialog } from "./account-password-dialog"; diff --git a/modules/identity/src/web/passwords/index.ts b/modules/identity/src/web/passwords/index.ts new file mode 100644 index 0000000..621aba2 --- /dev/null +++ b/modules/identity/src/web/passwords/index.ts @@ -0,0 +1,2 @@ +export { AccountPasswordDialog } from "./change"; +export { PasswordForm } from "./shared"; diff --git a/modules/identity/src/web/passwords/shared/index.ts b/modules/identity/src/web/passwords/shared/index.ts new file mode 100644 index 0000000..b28f7c3 --- /dev/null +++ b/modules/identity/src/web/passwords/shared/index.ts @@ -0,0 +1 @@ +export { PasswordForm } from "./ui"; diff --git a/modules/identity/src/web/passwords/shared/ui/index.ts b/modules/identity/src/web/passwords/shared/ui/index.ts new file mode 100644 index 0000000..9b00d2b --- /dev/null +++ b/modules/identity/src/web/passwords/shared/ui/index.ts @@ -0,0 +1 @@ +export { PasswordForm } from "./password-form"; diff --git a/modules/identity/src/web/components/password-form.tsx b/modules/identity/src/web/passwords/shared/ui/password-form.tsx similarity index 94% rename from modules/identity/src/web/components/password-form.tsx rename to modules/identity/src/web/passwords/shared/ui/password-form.tsx index 9b46583..e901ea4 100644 --- a/modules/identity/src/web/components/password-form.tsx +++ b/modules/identity/src/web/passwords/shared/ui/password-form.tsx @@ -9,11 +9,9 @@ import { useForm } from "react-hook-form"; import { useTranslation } from "react-i18next"; import { z } from "zod/v4"; -import type { ChangePasswordRequestDTO, UserDTO } from "../../common"; -import { ChangePasswordRequestSchema, ResetPasswordRequestSchema } from "../../common"; -import { identityApi, identityKeys } from "../api/identity-api"; - -import { FormFeedback } from "./form-feedback"; +import type { ChangePasswordRequestDTO, UserDTO } from "../../../../common"; +import { ChangePasswordRequestSchema, ResetPasswordRequestSchema } from "../../../../common"; +import { FormFeedback, identityApi, identityKeys } from "../../../shared"; export function PasswordForm({ target, diff --git a/modules/identity/src/web/sessions/index.ts b/modules/identity/src/web/sessions/index.ts new file mode 100644 index 0000000..deac105 --- /dev/null +++ b/modules/identity/src/web/sessions/index.ts @@ -0,0 +1 @@ +export { CredentialForm } from "./shared"; diff --git a/modules/identity/src/web/sessions/shared/index.ts b/modules/identity/src/web/sessions/shared/index.ts new file mode 100644 index 0000000..bbf0e6c --- /dev/null +++ b/modules/identity/src/web/sessions/shared/index.ts @@ -0,0 +1 @@ +export { CredentialForm } from "./ui"; diff --git a/modules/identity/src/web/components/credential-form.tsx b/modules/identity/src/web/sessions/shared/ui/credential-form.tsx similarity index 94% rename from modules/identity/src/web/components/credential-form.tsx rename to modules/identity/src/web/sessions/shared/ui/credential-form.tsx index 0960a03..6e0caab 100644 --- a/modules/identity/src/web/components/credential-form.tsx +++ b/modules/identity/src/web/sessions/shared/ui/credential-form.tsx @@ -7,11 +7,9 @@ import { useId } from "react"; import { useForm } from "react-hook-form"; import { useTranslation } from "react-i18next"; -import type { BootstrapAdminRequestDTO } from "../../common"; -import { BootstrapAdminRequestSchema, LoginRequestSchema } from "../../common"; -import { identityApi, identityKeys } from "../api/identity-api"; - -import { FormFeedback } from "./form-feedback"; +import type { BootstrapAdminRequestDTO } from "../../../../common"; +import { BootstrapAdminRequestSchema, LoginRequestSchema } from "../../../../common"; +import { FormFeedback, identityApi, identityKeys } from "../../../shared"; export function CredentialForm({ setup, csrfToken }: { setup: boolean; csrfToken: string }) { const { t } = useTranslation("identity"); diff --git a/modules/identity/src/web/sessions/shared/ui/index.ts b/modules/identity/src/web/sessions/shared/ui/index.ts new file mode 100644 index 0000000..5634007 --- /dev/null +++ b/modules/identity/src/web/sessions/shared/ui/index.ts @@ -0,0 +1 @@ +export { CredentialForm } from "./credential-form"; diff --git a/modules/identity/src/web/api/identity-api.ts b/modules/identity/src/web/shared/api/identity-api.ts similarity index 98% rename from modules/identity/src/web/api/identity-api.ts rename to modules/identity/src/web/shared/api/identity-api.ts index f290476..bd08f2a 100644 --- a/modules/identity/src/web/api/identity-api.ts +++ b/modules/identity/src/web/shared/api/identity-api.ts @@ -6,7 +6,7 @@ import { SessionResponseSchema, UserResponseSchema, UsersResponseSchema, -} from "../../common"; +} from "../../../common"; export const identityKeys = { session: ["identity", "session"], users: ["identity", "users"] }; export class IdentityApiError extends Error { diff --git a/modules/identity/src/web/shared/api/index.ts b/modules/identity/src/web/shared/api/index.ts new file mode 100644 index 0000000..7da326b --- /dev/null +++ b/modules/identity/src/web/shared/api/index.ts @@ -0,0 +1 @@ +export { IdentityApiError, identityApi, identityKeys } from "./identity-api"; diff --git a/modules/identity/src/web/shared/i18n.ts b/modules/identity/src/web/shared/i18n.ts new file mode 100644 index 0000000..7cd0f00 --- /dev/null +++ b/modules/identity/src/web/shared/i18n.ts @@ -0,0 +1,2 @@ +export { default as identityEnglish } from "../../common/locales/en.json"; +export { default as identitySpanish } from "../../common/locales/es.json"; diff --git a/modules/identity/src/web/shared/index.ts b/modules/identity/src/web/shared/index.ts new file mode 100644 index 0000000..3406df8 --- /dev/null +++ b/modules/identity/src/web/shared/index.ts @@ -0,0 +1,3 @@ +export { identityApi, identityKeys } from "./api"; +export { identityEnglish, identitySpanish } from "./i18n"; +export { FormFeedback } from "./ui"; diff --git a/modules/identity/src/web/components/form-feedback.tsx b/modules/identity/src/web/shared/ui/form-feedback.tsx similarity index 90% rename from modules/identity/src/web/components/form-feedback.tsx rename to modules/identity/src/web/shared/ui/form-feedback.tsx index 27b92d0..2f19f00 100644 --- a/modules/identity/src/web/components/form-feedback.tsx +++ b/modules/identity/src/web/shared/ui/form-feedback.tsx @@ -1,6 +1,6 @@ import { useTranslation } from "react-i18next"; -import { IdentityApiError } from "../api/identity-api"; +import { IdentityApiError } from "../api"; export function FormFeedback({ error, success = false, diff --git a/modules/identity/src/web/shared/ui/index.ts b/modules/identity/src/web/shared/ui/index.ts new file mode 100644 index 0000000..60c16ae --- /dev/null +++ b/modules/identity/src/web/shared/ui/index.ts @@ -0,0 +1 @@ +export { FormFeedback } from "./form-feedback"; diff --git a/modules/identity/src/web/users/index.ts b/modules/identity/src/web/users/index.ts new file mode 100644 index 0000000..e589691 --- /dev/null +++ b/modules/identity/src/web/users/index.ts @@ -0,0 +1 @@ +export { UserManagement, UserManagementDialog } from "./list"; diff --git a/modules/identity/src/web/users/list/index.ts b/modules/identity/src/web/users/list/index.ts new file mode 100644 index 0000000..33e54c3 --- /dev/null +++ b/modules/identity/src/web/users/list/index.ts @@ -0,0 +1 @@ +export { UserManagement, UserManagementDialog } from "./ui"; diff --git a/modules/identity/src/web/users/list/ui/index.ts b/modules/identity/src/web/users/list/ui/index.ts new file mode 100644 index 0000000..7a1fba2 --- /dev/null +++ b/modules/identity/src/web/users/list/ui/index.ts @@ -0,0 +1,2 @@ +export { UserManagement } from "./user-management"; +export { UserManagementDialog } from "./user-management-dialog"; diff --git a/modules/identity/src/web/components/user-management-dialog.tsx b/modules/identity/src/web/users/list/ui/user-management-dialog.tsx similarity index 100% rename from modules/identity/src/web/components/user-management-dialog.tsx rename to modules/identity/src/web/users/list/ui/user-management-dialog.tsx diff --git a/modules/identity/src/web/components/user-management.tsx b/modules/identity/src/web/users/list/ui/user-management.tsx similarity index 94% rename from modules/identity/src/web/components/user-management.tsx rename to modules/identity/src/web/users/list/ui/user-management.tsx index 477d665..e37b0b7 100644 --- a/modules/identity/src/web/components/user-management.tsx +++ b/modules/identity/src/web/users/list/ui/user-management.tsx @@ -10,11 +10,9 @@ import { useQuery } from "@tanstack/react-query"; import { useState } from "react"; import { useTranslation } from "react-i18next"; -import type { UserDTO } from "../../common"; -import { identityApi, identityKeys } from "../api/identity-api"; - -import { FormFeedback } from "./form-feedback"; -import { UserEditorDialog } from "./user-editor-dialog"; +import type { UserDTO } from "../../../../common"; +import { FormFeedback, identityApi, identityKeys } from "../../../shared"; +import { UserEditorDialog } from "../../shared"; export function UserManagement({ csrfToken }: { csrfToken: string }) { const { t, i18n } = useTranslation("identity"); diff --git a/modules/identity/src/web/users/shared/index.ts b/modules/identity/src/web/users/shared/index.ts new file mode 100644 index 0000000..a47010b --- /dev/null +++ b/modules/identity/src/web/users/shared/index.ts @@ -0,0 +1 @@ +export { UserEditorDialog } from "./ui"; diff --git a/modules/identity/src/web/users/shared/ui/index.ts b/modules/identity/src/web/users/shared/ui/index.ts new file mode 100644 index 0000000..8e1b154 --- /dev/null +++ b/modules/identity/src/web/users/shared/ui/index.ts @@ -0,0 +1 @@ +export { UserEditorDialog } from "./user-editor-dialog"; diff --git a/modules/identity/src/web/components/user-editor-dialog.tsx b/modules/identity/src/web/users/shared/ui/user-editor-dialog.tsx similarity index 92% rename from modules/identity/src/web/components/user-editor-dialog.tsx rename to modules/identity/src/web/users/shared/ui/user-editor-dialog.tsx index 69ab5e0..d458a8a 100644 --- a/modules/identity/src/web/components/user-editor-dialog.tsx +++ b/modules/identity/src/web/users/shared/ui/user-editor-dialog.tsx @@ -1,9 +1,9 @@ import { FormDialog } from "@repo/shadcn-ui/components/form-dialog"; import { useTranslation } from "react-i18next"; -import type { UserDTO } from "../../common"; +import type { UserDTO } from "../../../../common"; +import { PasswordForm } from "../../../passwords"; -import { PasswordForm } from "./password-form"; import { UserForm } from "./user-form"; export function UserEditorDialog( diff --git a/modules/identity/src/web/components/user-form.tsx b/modules/identity/src/web/users/shared/ui/user-form.tsx similarity index 96% rename from modules/identity/src/web/components/user-form.tsx rename to modules/identity/src/web/users/shared/ui/user-form.tsx index 9e73d27..e7123d4 100644 --- a/modules/identity/src/web/components/user-form.tsx +++ b/modules/identity/src/web/users/shared/ui/user-form.tsx @@ -10,11 +10,9 @@ import { useForm } from "react-hook-form"; import { useTranslation } from "react-i18next"; import { z } from "zod/v4"; -import type { UserDTO } from "../../common"; -import { CreateUserRequestSchema, UpdateUserRequestSchema } from "../../common"; -import { identityApi, identityKeys } from "../api/identity-api"; - -import { FormFeedback } from "./form-feedback"; +import type { UserDTO } from "../../../../common"; +import { CreateUserRequestSchema, UpdateUserRequestSchema } from "../../../../common"; +import { FormFeedback, identityApi, identityKeys } from "../../../shared"; const UserFormSchema = CreateUserRequestSchema.extend({ active: z.boolean() }); type UserFormValues = z.infer; diff --git a/modules/identity/src/web/workspace/index.ts b/modules/identity/src/web/workspace/index.ts new file mode 100644 index 0000000..e6945bd --- /dev/null +++ b/modules/identity/src/web/workspace/index.ts @@ -0,0 +1 @@ +export { IdentityWorkspace } from "./view"; diff --git a/modules/identity/src/web/workspace/shared/index.ts b/modules/identity/src/web/workspace/shared/index.ts new file mode 100644 index 0000000..4231802 --- /dev/null +++ b/modules/identity/src/web/workspace/shared/index.ts @@ -0,0 +1 @@ +export type { WorkspacePage, WorkspaceRenderer } from "./types"; diff --git a/modules/identity/src/web/workspace/shared/types/index.ts b/modules/identity/src/web/workspace/shared/types/index.ts new file mode 100644 index 0000000..e442c5e --- /dev/null +++ b/modules/identity/src/web/workspace/shared/types/index.ts @@ -0,0 +1 @@ +export type { WorkspacePage, WorkspaceRenderer } from "./workspace-page"; diff --git a/modules/identity/src/web/components/workspace-page.ts b/modules/identity/src/web/workspace/shared/types/workspace-page.ts similarity index 82% rename from modules/identity/src/web/components/workspace-page.ts rename to modules/identity/src/web/workspace/shared/types/workspace-page.ts index 60ad98f..3427f4c 100644 --- a/modules/identity/src/web/components/workspace-page.ts +++ b/modules/identity/src/web/workspace/shared/types/workspace-page.ts @@ -1,6 +1,6 @@ import type { ReactNode } from "react"; -import type { SessionResponseDTO } from "../../common"; +import type { SessionResponseDTO } from "../../../../common"; export type WorkspacePage = Readonly<{ id: string; diff --git a/modules/identity/src/web/workspace/view/index.ts b/modules/identity/src/web/workspace/view/index.ts new file mode 100644 index 0000000..8a16794 --- /dev/null +++ b/modules/identity/src/web/workspace/view/index.ts @@ -0,0 +1 @@ +export { IdentityWorkspace } from "./ui"; diff --git a/modules/identity/src/web/components/authenticated-workspace.tsx b/modules/identity/src/web/workspace/view/ui/authenticated-workspace.tsx similarity index 91% rename from modules/identity/src/web/components/authenticated-workspace.tsx rename to modules/identity/src/web/workspace/view/ui/authenticated-workspace.tsx index 088b38c..6d70ec6 100644 --- a/modules/identity/src/web/components/authenticated-workspace.tsx +++ b/modules/identity/src/web/workspace/view/ui/authenticated-workspace.tsx @@ -5,14 +5,13 @@ import type { ReactNode } from "react"; import { useState } from "react"; import { useTranslation } from "react-i18next"; -import type { SessionResponseDTO } from "../../common"; -import { identityApi, identityKeys } from "../api/identity-api"; +import type { SessionResponseDTO } from "../../../../common"; +import { PasswordForm } from "../../../passwords"; +import { FormFeedback, identityApi, identityKeys } from "../../../shared"; +import { UserManagement } from "../../../users"; +import type { WorkspacePage, WorkspaceRenderer } from "../../shared"; import { CustomWorkspace } from "./custom-workspace"; -import { FormFeedback } from "./form-feedback"; -import { PasswordForm } from "./password-form"; -import { UserManagement } from "./user-management"; -import type { WorkspacePage, WorkspaceRenderer } from "./workspace-page"; export function AuthenticatedWorkspace({ snapshot, diff --git a/modules/identity/src/web/components/custom-workspace.tsx b/modules/identity/src/web/workspace/view/ui/custom-workspace.tsx similarity index 85% rename from modules/identity/src/web/components/custom-workspace.tsx rename to modules/identity/src/web/workspace/view/ui/custom-workspace.tsx index 1f805a7..abac810 100644 --- a/modules/identity/src/web/components/custom-workspace.tsx +++ b/modules/identity/src/web/workspace/view/ui/custom-workspace.tsx @@ -1,12 +1,11 @@ import { Button } from "@repo/shadcn-ui/components/button"; import { useTranslation } from "react-i18next"; -import type { SessionResponseDTO } from "../../common"; - -import { AccountPasswordDialog } from "./account-password-dialog"; -import { FormFeedback } from "./form-feedback"; -import { UserManagementDialog } from "./user-management-dialog"; -import type { WorkspaceRenderer } from "./workspace-page"; +import type { SessionResponseDTO } from "../../../../common"; +import { AccountPasswordDialog } from "../../../passwords"; +import { FormFeedback } from "../../../shared"; +import { UserManagementDialog } from "../../../users"; +import type { WorkspaceRenderer } from "../../shared"; export function CustomWorkspace({ snapshot, diff --git a/modules/identity/src/web/components/identity-workspace.tsx b/modules/identity/src/web/workspace/view/ui/identity-workspace.tsx similarity index 90% rename from modules/identity/src/web/components/identity-workspace.tsx rename to modules/identity/src/web/workspace/view/ui/identity-workspace.tsx index 592e682..e4d855d 100644 --- a/modules/identity/src/web/components/identity-workspace.tsx +++ b/modules/identity/src/web/workspace/view/ui/identity-workspace.tsx @@ -10,12 +10,11 @@ import { useQuery } from "@tanstack/react-query"; import type { ReactNode } from "react"; import { useTranslation } from "react-i18next"; -import { identityApi, identityKeys } from "../api/identity-api"; +import { CredentialForm } from "../../../sessions"; +import { FormFeedback, identityApi, identityKeys } from "../../../shared"; +import type { WorkspacePage, WorkspaceRenderer } from "../../shared"; import { AuthenticatedWorkspace } from "./authenticated-workspace"; -import { CredentialForm } from "./credential-form"; -import { FormFeedback } from "./form-feedback"; -import type { WorkspacePage, WorkspaceRenderer } from "./workspace-page"; const EMPTY_PAGES: readonly WorkspacePage[] = []; diff --git a/modules/identity/src/web/workspace/view/ui/index.ts b/modules/identity/src/web/workspace/view/ui/index.ts new file mode 100644 index 0000000..98e160c --- /dev/null +++ b/modules/identity/src/web/workspace/view/ui/index.ts @@ -0,0 +1 @@ +export { IdentityWorkspace } from "./identity-workspace"; diff --git a/modules/resources/package.json b/modules/resources/package.json index 8cef76e..eecc4cb 100644 --- a/modules/resources/package.json +++ b/modules/resources/package.json @@ -11,7 +11,7 @@ }, "scripts": { "typecheck": "tsc -p tsconfig.json", - "test": "TSX_TSCONFIG_PATH=../../tsconfig.json node --import tsx --test src/api/domain/resource-catalog.test.ts src/api/domain/resource.test.ts src/web/catalog.test.tsx src/web/resources.test.tsx" + "test": "TSX_TSCONFIG_PATH=../../tsconfig.json node --import tsx --test src/api/domain/resource-catalog.test.ts src/api/domain/resource.test.ts src/web/catalog/shared/catalog.test.tsx src/web/resources/shared/resources.test.tsx" }, "dependencies": { "@repo/rdx-ddd": "workspace:*", diff --git a/modules/resources/src/web/catalog-fields/create/index.ts b/modules/resources/src/web/catalog-fields/create/index.ts new file mode 100644 index 0000000..a9f6306 --- /dev/null +++ b/modules/resources/src/web/catalog-fields/create/index.ts @@ -0,0 +1 @@ +export { CatalogFieldCreateDialog } from "./ui"; diff --git a/modules/resources/src/web/catalog-field-create-dialog.tsx b/modules/resources/src/web/catalog-fields/create/ui/catalog-field-create-dialog.tsx similarity index 93% rename from modules/resources/src/web/catalog-field-create-dialog.tsx rename to modules/resources/src/web/catalog-fields/create/ui/catalog-field-create-dialog.tsx index f899e56..8a8df30 100644 --- a/modules/resources/src/web/catalog-field-create-dialog.tsx +++ b/modules/resources/src/web/catalog-fields/create/ui/catalog-field-create-dialog.tsx @@ -1,7 +1,7 @@ import { FormDialog } from "@repo/shadcn-ui/components/form-dialog"; import { useTranslation } from "react-i18next"; -import { CatalogFieldForm } from "./catalog-form"; +import { CatalogFieldForm } from "../../shared"; export function CatalogFieldCreateDialog({ scope, diff --git a/modules/resources/src/web/catalog-fields/create/ui/index.ts b/modules/resources/src/web/catalog-fields/create/ui/index.ts new file mode 100644 index 0000000..ee5ccb5 --- /dev/null +++ b/modules/resources/src/web/catalog-fields/create/ui/index.ts @@ -0,0 +1 @@ +export { CatalogFieldCreateDialog } from "./catalog-field-create-dialog"; diff --git a/modules/resources/src/web/catalog-fields/index.ts b/modules/resources/src/web/catalog-fields/index.ts new file mode 100644 index 0000000..2339c38 --- /dev/null +++ b/modules/resources/src/web/catalog-fields/index.ts @@ -0,0 +1,2 @@ +export { CatalogFieldCreateDialog } from "./create"; +export { CatalogFieldForm } from "./shared"; diff --git a/modules/resources/src/web/catalog-fields/shared/index.ts b/modules/resources/src/web/catalog-fields/shared/index.ts new file mode 100644 index 0000000..a0f73fc --- /dev/null +++ b/modules/resources/src/web/catalog-fields/shared/index.ts @@ -0,0 +1 @@ +export { CatalogFieldForm } from "./ui"; diff --git a/modules/resources/src/web/catalog-form.tsx b/modules/resources/src/web/catalog-fields/shared/ui/catalog-form.tsx similarity index 90% rename from modules/resources/src/web/catalog-form.tsx rename to modules/resources/src/web/catalog-fields/shared/ui/catalog-form.tsx index 41d4ac7..c1801f8 100644 --- a/modules/resources/src/web/catalog-form.tsx +++ b/modules/resources/src/web/catalog-fields/shared/ui/catalog-form.tsx @@ -10,13 +10,12 @@ import { useForm } from "react-hook-form"; import { useTranslation } from "react-i18next"; import { z } from "zod/v4"; -import type { CatalogItemDTO } from "../common"; -import { FieldTypeSchema, ResourceDefinitionSchema } from "../common"; - -import { CatalogError } from "./catalog-error"; -import { CatalogHelp } from "./catalog-help"; -import type { CatalogSaved } from "./use-catalog-save"; -import { useCatalogSave } from "./use-catalog-save"; +import type { CatalogItemDTO } from "../../../../common"; +import { FieldTypeSchema, ResourceDefinitionSchema } from "../../../../common"; +import type { CatalogSaved } from "../../../catalog/shared/controllers"; +import { useCatalogSave } from "../../../catalog/shared/controllers"; +import { CatalogError } from "../../../catalog/shared/ui/catalog-error"; +import { CatalogHelp } from "../../../catalog/shared/ui/catalog-help"; const FieldFormSchema = ResourceDefinitionSchema.options[0].omit({ choices: true }).extend({ choicesText: z.string().max(10000), diff --git a/modules/resources/src/web/catalog-fields/shared/ui/index.ts b/modules/resources/src/web/catalog-fields/shared/ui/index.ts new file mode 100644 index 0000000..1a5343d --- /dev/null +++ b/modules/resources/src/web/catalog-fields/shared/ui/index.ts @@ -0,0 +1 @@ +export { CatalogFieldForm } from "./catalog-form"; diff --git a/modules/resources/src/web/catalog-templates/create/index.ts b/modules/resources/src/web/catalog-templates/create/index.ts new file mode 100644 index 0000000..d3cde63 --- /dev/null +++ b/modules/resources/src/web/catalog-templates/create/index.ts @@ -0,0 +1 @@ +export { CatalogTemplateCreateDialog } from "./ui"; diff --git a/modules/resources/src/web/catalog-template-create-dialog.tsx b/modules/resources/src/web/catalog-templates/create/ui/catalog-template-create-dialog.tsx similarity index 93% rename from modules/resources/src/web/catalog-template-create-dialog.tsx rename to modules/resources/src/web/catalog-templates/create/ui/catalog-template-create-dialog.tsx index bb2e38f..73c7205 100644 --- a/modules/resources/src/web/catalog-template-create-dialog.tsx +++ b/modules/resources/src/web/catalog-templates/create/ui/catalog-template-create-dialog.tsx @@ -2,7 +2,7 @@ import { FormDialog } from "@repo/shadcn-ui/components/form-dialog"; import type { ComponentProps } from "react"; import { useTranslation } from "react-i18next"; -import { CatalogTemplateForm } from "./catalog-template-form"; +import { CatalogTemplateForm } from "../../shared"; export function CatalogTemplateCreateDialog({ scope, diff --git a/modules/resources/src/web/catalog-templates/create/ui/index.ts b/modules/resources/src/web/catalog-templates/create/ui/index.ts new file mode 100644 index 0000000..bbbbe5f --- /dev/null +++ b/modules/resources/src/web/catalog-templates/create/ui/index.ts @@ -0,0 +1 @@ +export { CatalogTemplateCreateDialog } from "./catalog-template-create-dialog"; diff --git a/modules/resources/src/web/catalog-templates/index.ts b/modules/resources/src/web/catalog-templates/index.ts new file mode 100644 index 0000000..39c0ca8 --- /dev/null +++ b/modules/resources/src/web/catalog-templates/index.ts @@ -0,0 +1,2 @@ +export { CatalogTemplateCreateDialog } from "./create"; +export { CatalogTemplateForm } from "./shared"; diff --git a/modules/resources/src/web/catalog-templates/shared/index.ts b/modules/resources/src/web/catalog-templates/shared/index.ts new file mode 100644 index 0000000..9c4e0ca --- /dev/null +++ b/modules/resources/src/web/catalog-templates/shared/index.ts @@ -0,0 +1 @@ +export { CatalogTemplateForm } from "./ui"; diff --git a/modules/resources/src/web/catalog-template-form.tsx b/modules/resources/src/web/catalog-templates/shared/ui/catalog-template-form.tsx similarity index 94% rename from modules/resources/src/web/catalog-template-form.tsx rename to modules/resources/src/web/catalog-templates/shared/ui/catalog-template-form.tsx index 5976717..3c18558 100644 --- a/modules/resources/src/web/catalog-template-form.tsx +++ b/modules/resources/src/web/catalog-templates/shared/ui/catalog-template-form.tsx @@ -11,14 +11,13 @@ import { useForm } from "react-hook-form"; import { useTranslation } from "react-i18next"; import type { z } from "zod/v4"; -import type { CatalogItemDTO } from "../common"; -import { ResourceDefinitionSchema } from "../common"; - -import { CatalogError } from "./catalog-error"; -import { CatalogFieldCreateDialog } from "./catalog-field-create-dialog"; -import { CatalogHelp } from "./catalog-help"; -import type { CatalogSaved } from "./use-catalog-save"; -import { useCatalogSave } from "./use-catalog-save"; +import type { CatalogItemDTO } from "../../../../common"; +import { ResourceDefinitionSchema } from "../../../../common"; +import type { CatalogSaved } from "../../../catalog/shared/controllers"; +import { useCatalogSave } from "../../../catalog/shared/controllers"; +import { CatalogError } from "../../../catalog/shared/ui/catalog-error"; +import { CatalogHelp } from "../../../catalog/shared/ui/catalog-help"; +import { CatalogFieldCreateDialog } from "../../../catalog-fields"; const TemplateFormSchema = ResourceDefinitionSchema.options[1]; type TemplateFormValues = z.infer; diff --git a/modules/resources/src/web/catalog-templates/shared/ui/index.ts b/modules/resources/src/web/catalog-templates/shared/ui/index.ts new file mode 100644 index 0000000..16ff970 --- /dev/null +++ b/modules/resources/src/web/catalog-templates/shared/ui/index.ts @@ -0,0 +1 @@ +export { CatalogTemplateForm } from "./catalog-template-form"; diff --git a/modules/resources/src/web/catalog/detail/index.ts b/modules/resources/src/web/catalog/detail/index.ts new file mode 100644 index 0000000..a027060 --- /dev/null +++ b/modules/resources/src/web/catalog/detail/index.ts @@ -0,0 +1 @@ +export { CatalogDefinitionDialog } from "./ui"; diff --git a/modules/resources/src/web/catalog-definition-dialog.tsx b/modules/resources/src/web/catalog/detail/ui/catalog-definition-dialog.tsx similarity index 96% rename from modules/resources/src/web/catalog-definition-dialog.tsx rename to modules/resources/src/web/catalog/detail/ui/catalog-definition-dialog.tsx index 6a97c4b..9bf3dde 100644 --- a/modules/resources/src/web/catalog-definition-dialog.tsx +++ b/modules/resources/src/web/catalog/detail/ui/catalog-definition-dialog.tsx @@ -1,9 +1,8 @@ import { FormDialog } from "@repo/shadcn-ui/components/form-dialog"; import { useTranslation } from "react-i18next"; -import type { CatalogItemDTO } from "../common"; - -import { CatalogHelp } from "./catalog-help"; +import type { CatalogItemDTO } from "../../../../common"; +import { CatalogHelp } from "../../shared"; export function CatalogDefinitionDialog({ item, items, diff --git a/modules/resources/src/web/catalog/detail/ui/index.ts b/modules/resources/src/web/catalog/detail/ui/index.ts new file mode 100644 index 0000000..70ad731 --- /dev/null +++ b/modules/resources/src/web/catalog/detail/ui/index.ts @@ -0,0 +1 @@ +export { CatalogDefinitionDialog } from "./catalog-definition-dialog"; diff --git a/modules/resources/src/web/catalog/index.ts b/modules/resources/src/web/catalog/index.ts new file mode 100644 index 0000000..d9b9c94 --- /dev/null +++ b/modules/resources/src/web/catalog/index.ts @@ -0,0 +1,2 @@ +export { ResourceCatalogPage } from "./list"; +export { catalogApi, catalogKeys } from "./shared"; diff --git a/modules/resources/src/web/catalog/list/index.ts b/modules/resources/src/web/catalog/list/index.ts new file mode 100644 index 0000000..2608014 --- /dev/null +++ b/modules/resources/src/web/catalog/list/index.ts @@ -0,0 +1 @@ +export { ResourceCatalogPage } from "./ui"; diff --git a/modules/resources/src/web/catalog-cell.tsx b/modules/resources/src/web/catalog/list/ui/catalog-cell.tsx similarity index 95% rename from modules/resources/src/web/catalog-cell.tsx rename to modules/resources/src/web/catalog/list/ui/catalog-cell.tsx index 1084d56..f7aa429 100644 --- a/modules/resources/src/web/catalog-cell.tsx +++ b/modules/resources/src/web/catalog/list/ui/catalog-cell.tsx @@ -1,9 +1,9 @@ import { EntityRowActions, EntityStatus } from "@repo/shadcn-ui/components/entity-list"; import { useTranslation } from "react-i18next"; -import type { CatalogItemDTO } from "../common"; +import type { CatalogItemDTO } from "../../../../common"; +import { CatalogName } from "../../shared"; -import { CatalogName } from "./catalog-name"; import { CatalogRowActions } from "./catalog-row-actions"; export function CatalogCell({ diff --git a/modules/resources/src/web/catalog-page.tsx b/modules/resources/src/web/catalog/list/ui/catalog-page.tsx similarity index 95% rename from modules/resources/src/web/catalog-page.tsx rename to modules/resources/src/web/catalog/list/ui/catalog-page.tsx index a8adc29..a3fb59f 100644 --- a/modules/resources/src/web/catalog-page.tsx +++ b/modules/resources/src/web/catalog/list/ui/catalog-page.tsx @@ -4,14 +4,12 @@ import { useMutation, useQuery, useQueryClient } from "@tanstack/react-query"; import { useState } from "react"; 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 { 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 ResourceCatalogPage({ scope, csrfToken }: { scope: string; csrfToken: string }) { const { t, i18n } = useTranslation("resources"); diff --git a/modules/resources/src/web/catalog-row-actions.tsx b/modules/resources/src/web/catalog/list/ui/catalog-row-actions.tsx similarity index 94% rename from modules/resources/src/web/catalog-row-actions.tsx rename to modules/resources/src/web/catalog/list/ui/catalog-row-actions.tsx index cbb7aab..1ccf10b 100644 --- a/modules/resources/src/web/catalog-row-actions.tsx +++ b/modules/resources/src/web/catalog/list/ui/catalog-row-actions.tsx @@ -1,7 +1,7 @@ import { EntityAction } from "@repo/shadcn-ui/components/entity-list"; import { useTranslation } from "react-i18next"; -import type { CatalogItemDTO } from "../common"; +import type { CatalogItemDTO } from "../../../../common"; export function CatalogRowActions({ item, diff --git a/modules/resources/src/web/catalog/list/ui/index.ts b/modules/resources/src/web/catalog/list/ui/index.ts new file mode 100644 index 0000000..1aab2ac --- /dev/null +++ b/modules/resources/src/web/catalog/list/ui/index.ts @@ -0,0 +1 @@ +export { ResourceCatalogPage } from "./catalog-page"; diff --git a/modules/resources/src/web/catalog-api.ts b/modules/resources/src/web/catalog/shared/api/catalog-api.ts similarity index 94% rename from modules/resources/src/web/catalog-api.ts rename to modules/resources/src/web/catalog/shared/api/catalog-api.ts index edb3499..7094bcb 100644 --- a/modules/resources/src/web/catalog-api.ts +++ b/modules/resources/src/web/catalog/shared/api/catalog-api.ts @@ -1,7 +1,7 @@ import { z } from "zod/v4"; -import type { ResourceDefinitionSpec } from "../common"; -import { CatalogResponseSchema, SaveDefinitionResponseSchema } from "../common"; +import type { ResourceDefinitionSpec } from "../../../../common"; +import { CatalogResponseSchema, SaveDefinitionResponseSchema } from "../../../../common"; export const catalogKeys = { scope: (scope: string) => ["resource-catalog", scope] }; export class CatalogApiError extends Error { constructor(public readonly code: string) { diff --git a/modules/resources/src/web/catalog/shared/api/index.ts b/modules/resources/src/web/catalog/shared/api/index.ts new file mode 100644 index 0000000..8dddb63 --- /dev/null +++ b/modules/resources/src/web/catalog/shared/api/index.ts @@ -0,0 +1 @@ +export { CatalogApiError, catalogApi, catalogKeys } from "./catalog-api"; diff --git a/modules/resources/src/web/catalog.test.tsx b/modules/resources/src/web/catalog/shared/catalog.test.tsx similarity index 82% rename from modules/resources/src/web/catalog.test.tsx rename to modules/resources/src/web/catalog/shared/catalog.test.tsx index eba9448..86a3f6a 100644 --- a/modules/resources/src/web/catalog.test.tsx +++ b/modules/resources/src/web/catalog/shared/catalog.test.tsx @@ -8,15 +8,15 @@ import type { ReactNode } from "react"; import { renderToStaticMarkup } from "react-dom/server"; import { I18nextProvider } from "react-i18next"; -import { buildCatalogResponse } from "../api/application/resource-catalog-response.builder"; -import { ResourceCatalog } from "../api/domain/resource-catalog.aggregate"; -import { seedResourceCatalog } from "../api/domain/resource-catalog-seed"; +import { buildCatalogResponse } from "../../../api/application/resource-catalog-response.builder"; +import { ResourceCatalog } from "../../../api/domain/resource-catalog.aggregate"; +import { seedResourceCatalog } from "../../../api/domain/resource-catalog-seed"; +import { CatalogFieldForm } from "../../catalog-fields"; +import { CatalogTemplateForm } from "../../catalog-templates"; +import { resourcesEnglish, resourcesSpanish } from "../../shared"; +import { ResourceCatalogPage } from "../list"; -import { catalogKeys } from "./catalog-api"; -import { CatalogFieldForm } from "./catalog-form"; -import { ResourceCatalogPage } from "./catalog-page"; -import { CatalogTemplateForm } from "./catalog-template-form"; -import { resourcesEnglish, resourcesSpanish } from "./i18n"; +import { catalogKeys } from "./api"; async function render(language: string, children: ReactNode) { const i18n = createInstance(); diff --git a/modules/resources/src/web/catalog/shared/controllers/index.ts b/modules/resources/src/web/catalog/shared/controllers/index.ts new file mode 100644 index 0000000..2dca0db --- /dev/null +++ b/modules/resources/src/web/catalog/shared/controllers/index.ts @@ -0,0 +1,2 @@ +export type { CatalogSaved } from "./use-catalog-save"; +export { useCatalogSave } from "./use-catalog-save"; diff --git a/modules/resources/src/web/use-catalog-save.ts b/modules/resources/src/web/catalog/shared/controllers/use-catalog-save.ts similarity index 92% rename from modules/resources/src/web/use-catalog-save.ts rename to modules/resources/src/web/catalog/shared/controllers/use-catalog-save.ts index 74c5bc0..bfcd074 100644 --- a/modules/resources/src/web/use-catalog-save.ts +++ b/modules/resources/src/web/catalog/shared/controllers/use-catalog-save.ts @@ -1,9 +1,8 @@ import { useMutation, useQueryClient } from "@tanstack/react-query"; import { useEffect, useRef } from "react"; -import type { ResourceDefinitionSpec, SaveDefinitionResponseDTO } from "../common"; - -import { catalogApi, catalogKeys } from "./catalog-api"; +import type { ResourceDefinitionSpec, SaveDefinitionResponseDTO } from "../../../../common"; +import { catalogApi, catalogKeys } from "../api"; export type CatalogSaved = (id: string, data: SaveDefinitionResponseDTO) => void; diff --git a/modules/resources/src/web/catalog/shared/index.ts b/modules/resources/src/web/catalog/shared/index.ts new file mode 100644 index 0000000..5a63eb3 --- /dev/null +++ b/modules/resources/src/web/catalog/shared/index.ts @@ -0,0 +1,3 @@ +export { catalogApi, catalogKeys } from "./api"; +export type { CatalogEditor } from "./ui"; +export { CatalogEditorDialog, CatalogError, CatalogHelp, CatalogName } from "./ui"; diff --git a/modules/resources/src/web/catalog-editor-dialog.tsx b/modules/resources/src/web/catalog/shared/ui/catalog-editor-dialog.tsx similarity index 88% rename from modules/resources/src/web/catalog-editor-dialog.tsx rename to modules/resources/src/web/catalog/shared/ui/catalog-editor-dialog.tsx index e460ec4..61b00d0 100644 --- a/modules/resources/src/web/catalog-editor-dialog.tsx +++ b/modules/resources/src/web/catalog/shared/ui/catalog-editor-dialog.tsx @@ -1,10 +1,9 @@ import { FormDialog } from "@repo/shadcn-ui/components/form-dialog"; import { useTranslation } from "react-i18next"; -import type { CatalogItemDTO } from "../common"; - -import { CatalogFieldForm } from "./catalog-form"; -import { CatalogTemplateForm } from "./catalog-template-form"; +import type { CatalogItemDTO } from "../../../../common"; +import { CatalogFieldForm } from "../../../catalog-fields"; +import { CatalogTemplateForm } from "../../../catalog-templates"; export type CatalogEditor = { kind: "field" | "template"; diff --git a/modules/resources/src/web/catalog-error.tsx b/modules/resources/src/web/catalog/shared/ui/catalog-error.tsx similarity index 90% rename from modules/resources/src/web/catalog-error.tsx rename to modules/resources/src/web/catalog/shared/ui/catalog-error.tsx index 343890e..77383a6 100644 --- a/modules/resources/src/web/catalog-error.tsx +++ b/modules/resources/src/web/catalog/shared/ui/catalog-error.tsx @@ -1,6 +1,6 @@ import { useTranslation } from "react-i18next"; -import { CatalogApiError } from "./catalog-api"; +import { CatalogApiError } from "../api"; export function CatalogError({ error, diff --git a/modules/resources/src/web/catalog-help.tsx b/modules/resources/src/web/catalog/shared/ui/catalog-help.tsx similarity index 100% rename from modules/resources/src/web/catalog-help.tsx rename to modules/resources/src/web/catalog/shared/ui/catalog-help.tsx diff --git a/modules/resources/src/web/catalog-name.tsx b/modules/resources/src/web/catalog/shared/ui/catalog-name.tsx similarity index 94% rename from modules/resources/src/web/catalog-name.tsx rename to modules/resources/src/web/catalog/shared/ui/catalog-name.tsx index 5f2702d..639421a 100644 --- a/modules/resources/src/web/catalog-name.tsx +++ b/modules/resources/src/web/catalog/shared/ui/catalog-name.tsx @@ -1,6 +1,6 @@ import { useTranslation } from "react-i18next"; -import type { CatalogItemDTO } from "../common"; +import type { CatalogItemDTO } from "../../../../common"; export function CatalogName({ item, diff --git a/modules/resources/src/web/catalog/shared/ui/index.ts b/modules/resources/src/web/catalog/shared/ui/index.ts new file mode 100644 index 0000000..b30947d --- /dev/null +++ b/modules/resources/src/web/catalog/shared/ui/index.ts @@ -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"; diff --git a/modules/resources/src/web/i18n.ts b/modules/resources/src/web/i18n.ts deleted file mode 100644 index 5239ac4..0000000 --- a/modules/resources/src/web/i18n.ts +++ /dev/null @@ -1,2 +0,0 @@ -export { default as resourcesEnglish } from "../common/locales/en.json"; -export { default as resourcesSpanish } from "../common/locales/es.json"; diff --git a/modules/resources/src/web/index.ts b/modules/resources/src/web/index.ts index 12de695..48c00b0 100644 --- a/modules/resources/src/web/index.ts +++ b/modules/resources/src/web/index.ts @@ -1,6 +1,3 @@ -export { catalogApi, catalogKeys } from "./catalog-api"; -export { ResourceCatalogPage } from "./catalog-page"; -export { resourcesEnglish, resourcesSpanish } from "./i18n"; -export { inventoryApi, inventoryKeys } from "./inventory-api"; -export { ResourceEditor } from "./resource-editor"; -export { ResourcesPage } from "./resources-page"; +export { ResourceCatalogPage, catalogApi, catalogKeys } from "./catalog"; +export { ResourceEditor, ResourcesPage, inventoryApi, inventoryKeys } from "./resources"; +export { resourcesEnglish, resourcesSpanish } from "./shared"; diff --git a/modules/resources/src/web/resources/detail/index.ts b/modules/resources/src/web/resources/detail/index.ts new file mode 100644 index 0000000..6d30636 --- /dev/null +++ b/modules/resources/src/web/resources/detail/index.ts @@ -0,0 +1 @@ +export { ResourceDetailDialog } from "./ui"; diff --git a/modules/resources/src/web/resources/detail/ui/index.ts b/modules/resources/src/web/resources/detail/ui/index.ts new file mode 100644 index 0000000..1437e8f --- /dev/null +++ b/modules/resources/src/web/resources/detail/ui/index.ts @@ -0,0 +1 @@ +export { ResourceDetailDialog } from "./resource-detail-dialog"; diff --git a/modules/resources/src/web/integration-summary.tsx b/modules/resources/src/web/resources/detail/ui/integration-summary.tsx similarity index 93% rename from modules/resources/src/web/integration-summary.tsx rename to modules/resources/src/web/resources/detail/ui/integration-summary.tsx index 3f472b5..97e1d1d 100644 --- a/modules/resources/src/web/integration-summary.tsx +++ b/modules/resources/src/web/resources/detail/ui/integration-summary.tsx @@ -1,6 +1,6 @@ import { useTranslation } from "react-i18next"; -import type { ResourceInput, ResourceReferenceDTO } from "../common/inventory"; +import type { ResourceInput, ResourceReferenceDTO } from "../../../../common/inventory"; export function IntegrationSummary({ integration, diff --git a/modules/resources/src/web/resource-detail-dialog.tsx b/modules/resources/src/web/resources/detail/ui/resource-detail-dialog.tsx similarity index 100% rename from modules/resources/src/web/resource-detail-dialog.tsx rename to modules/resources/src/web/resources/detail/ui/resource-detail-dialog.tsx diff --git a/modules/resources/src/web/resource-detail.tsx b/modules/resources/src/web/resources/detail/ui/resource-detail.tsx similarity index 97% rename from modules/resources/src/web/resource-detail.tsx rename to modules/resources/src/web/resources/detail/ui/resource-detail.tsx index 8be7ec6..984ddba 100644 --- a/modules/resources/src/web/resource-detail.tsx +++ b/modules/resources/src/web/resources/detail/ui/resource-detail.tsx @@ -1,6 +1,6 @@ import { useTranslation } from "react-i18next"; -import type { ResourceDTO, ResourceReferenceDTO } from "../common/inventory"; +import type { ResourceDTO, ResourceReferenceDTO } from "../../../../common/inventory"; import { IntegrationSummary } from "./integration-summary"; diff --git a/modules/resources/src/web/resources/index.ts b/modules/resources/src/web/resources/index.ts new file mode 100644 index 0000000..4e68f19 --- /dev/null +++ b/modules/resources/src/web/resources/index.ts @@ -0,0 +1,2 @@ +export { ResourcesPage } from "./list"; +export { ResourceEditor, inventoryApi, inventoryKeys } from "./shared"; diff --git a/modules/resources/src/web/resources/list/index.ts b/modules/resources/src/web/resources/list/index.ts new file mode 100644 index 0000000..ceccc01 --- /dev/null +++ b/modules/resources/src/web/resources/list/index.ts @@ -0,0 +1 @@ +export { ResourcesPage } from "./ui"; diff --git a/modules/resources/src/web/resources/list/ui/index.ts b/modules/resources/src/web/resources/list/ui/index.ts new file mode 100644 index 0000000..8e42813 --- /dev/null +++ b/modules/resources/src/web/resources/list/ui/index.ts @@ -0,0 +1 @@ +export { ResourcesPage } from "./resources-page"; diff --git a/modules/resources/src/web/resources-page.tsx b/modules/resources/src/web/resources/list/ui/resources-page.tsx similarity index 93% rename from modules/resources/src/web/resources-page.tsx rename to modules/resources/src/web/resources/list/ui/resources-page.tsx index e56053b..83a7a52 100644 --- a/modules/resources/src/web/resources-page.tsx +++ b/modules/resources/src/web/resources/list/ui/resources-page.tsx @@ -11,13 +11,11 @@ import type { ReactNode } from "react"; import { useState } from "react"; import { useTranslation } from "react-i18next"; -import type { ResourceDTO } from "../common"; - -import { catalogApi, catalogKeys } from "./catalog-api"; -import { inventoryApi, inventoryKeys } from "./inventory-api"; -import { InventoryFeedback } from "./inventory-feedback"; -import { ResourceDetailDialog } from "./resource-detail-dialog"; -import { ResourceEditorDialog } from "./resource-editor-dialog"; +import type { ResourceDTO } from "../../../../common"; +import { catalogApi, catalogKeys } from "../../../catalog"; +import { InventoryFeedback } from "../../../shared"; +import { ResourceDetailDialog } from "../../detail"; +import { ResourceEditorDialog, inventoryApi, inventoryKeys } from "../../shared"; export function ResourcesPage({ companyId, diff --git a/modules/resources/src/web/resources/shared/api/index.ts b/modules/resources/src/web/resources/shared/api/index.ts new file mode 100644 index 0000000..32b8469 --- /dev/null +++ b/modules/resources/src/web/resources/shared/api/index.ts @@ -0,0 +1 @@ +export { InventoryApiError, inventoryApi, inventoryKeys } from "./inventory-api"; diff --git a/modules/resources/src/web/inventory-api.ts b/modules/resources/src/web/resources/shared/api/inventory-api.ts similarity index 93% rename from modules/resources/src/web/inventory-api.ts rename to modules/resources/src/web/resources/shared/api/inventory-api.ts index 6c1ab20..95f36b0 100644 --- a/modules/resources/src/web/inventory-api.ts +++ b/modules/resources/src/web/resources/shared/api/inventory-api.ts @@ -1,7 +1,7 @@ import { z } from "zod/v4"; -import type { ResourceInput } from "../common/inventory"; -import { InventoryResponseSchema, ResourceResponseSchema } from "../common/inventory"; +import type { ResourceInput } from "../../../../common/inventory"; +import { InventoryResponseSchema, ResourceResponseSchema } from "../../../../common/inventory"; export const inventoryKeys = { company: (id: string) => ["resource-inventory", id] }; export class InventoryApiError extends Error { constructor(public readonly code: string) { diff --git a/modules/resources/src/web/resources/shared/index.ts b/modules/resources/src/web/resources/shared/index.ts new file mode 100644 index 0000000..7b4fd02 --- /dev/null +++ b/modules/resources/src/web/resources/shared/index.ts @@ -0,0 +1,2 @@ +export { inventoryApi, inventoryKeys } from "./api"; +export { ResourceEditor, ResourceEditorDialog } from "./ui"; diff --git a/modules/resources/src/web/resources.test.tsx b/modules/resources/src/web/resources/shared/resources.test.tsx similarity index 89% rename from modules/resources/src/web/resources.test.tsx rename to modules/resources/src/web/resources/shared/resources.test.tsx index b71bfcc..e526886 100644 --- a/modules/resources/src/web/resources.test.tsx +++ b/modules/resources/src/web/resources/shared/resources.test.tsx @@ -9,15 +9,15 @@ import type { ReactNode } from "react"; import { renderToStaticMarkup } from "react-dom/server"; import { I18nextProvider } from "react-i18next"; -import { buildCatalogResponse } from "../api/application/resource-catalog-response.builder"; -import { ResourceCatalog } from "../api/domain/resource-catalog.aggregate"; -import { seedResourceCatalog } from "../api/domain/resource-catalog-seed"; +import { buildCatalogResponse } from "../../../api/application/resource-catalog-response.builder"; +import { ResourceCatalog } from "../../../api/domain/resource-catalog.aggregate"; +import { seedResourceCatalog } from "../../../api/domain/resource-catalog-seed"; +import { catalogKeys } from "../../catalog"; +import { resourcesEnglish, resourcesSpanish } from "../../shared"; +import { ResourcesPage } from "../list"; -import { catalogKeys } from "./catalog-api"; -import { resourcesEnglish, resourcesSpanish } from "./i18n"; -import { inventoryKeys } from "./inventory-api"; -import { ResourceForm } from "./resource-form"; -import { ResourcesPage } from "./resources-page"; +import { inventoryKeys } from "./api"; +import { ResourceForm } from "./ui"; const companyId = UniqueID.generateNewID().toPrimitive(); async function render(language: string, children: ReactNode) { diff --git a/modules/resources/src/web/resources/shared/ui/index.ts b/modules/resources/src/web/resources/shared/ui/index.ts new file mode 100644 index 0000000..1994f67 --- /dev/null +++ b/modules/resources/src/web/resources/shared/ui/index.ts @@ -0,0 +1,3 @@ +export { ResourceEditor } from "./resource-editor"; +export { ResourceEditorDialog } from "./resource-editor-dialog"; +export { ResourceForm } from "./resource-form"; diff --git a/modules/resources/src/web/resource-characteristic-control.tsx b/modules/resources/src/web/resources/shared/ui/resource-characteristic-control.tsx similarity index 96% rename from modules/resources/src/web/resource-characteristic-control.tsx rename to modules/resources/src/web/resources/shared/ui/resource-characteristic-control.tsx index 18b89ed..e63e80b 100644 --- a/modules/resources/src/web/resource-characteristic-control.tsx +++ b/modules/resources/src/web/resources/shared/ui/resource-characteristic-control.tsx @@ -3,7 +3,7 @@ import { Label } from "@repo/shadcn-ui/components/label"; import { SelectWithAction } from "@repo/shadcn-ui/components/select-with-action"; import { useTranslation } from "react-i18next"; -import type { ResourceCharacteristic, ResourceInput } from "../common/inventory"; +import type { ResourceCharacteristic, ResourceInput } from "../../../../common/inventory"; type CharacteristicValue = ResourceInput["characteristics"][string]; export function ResourceCharacteristicControl({ diff --git a/modules/resources/src/web/resource-editor-dialog.tsx b/modules/resources/src/web/resources/shared/ui/resource-editor-dialog.tsx similarity index 100% rename from modules/resources/src/web/resource-editor-dialog.tsx rename to modules/resources/src/web/resources/shared/ui/resource-editor-dialog.tsx diff --git a/modules/resources/src/web/resource-editor.tsx b/modules/resources/src/web/resources/shared/ui/resource-editor.tsx similarity index 92% rename from modules/resources/src/web/resource-editor.tsx rename to modules/resources/src/web/resources/shared/ui/resource-editor.tsx index 88c9531..b8b0fc0 100644 --- a/modules/resources/src/web/resource-editor.tsx +++ b/modules/resources/src/web/resources/shared/ui/resource-editor.tsx @@ -1,9 +1,10 @@ import { useQuery } from "@tanstack/react-query"; import { useTranslation } from "react-i18next"; -import { catalogApi, catalogKeys } from "./catalog-api"; -import { inventoryApi, inventoryKeys } from "./inventory-api"; -import { InventoryFeedback } from "./inventory-feedback"; +import { catalogApi, catalogKeys } from "../../../catalog"; +import { InventoryFeedback } from "../../../shared"; +import { inventoryApi, inventoryKeys } from "../api"; + import { ResourceForm } from "./resource-form"; export function ResourceEditor({ companyId, diff --git a/modules/resources/src/web/resource-form.tsx b/modules/resources/src/web/resources/shared/ui/resource-form.tsx similarity index 96% rename from modules/resources/src/web/resource-form.tsx rename to modules/resources/src/web/resources/shared/ui/resource-form.tsx index b765be4..f6278fa 100644 --- a/modules/resources/src/web/resource-form.tsx +++ b/modules/resources/src/web/resources/shared/ui/resource-form.tsx @@ -11,13 +11,13 @@ import { useEffect, useId, useRef, useState } from "react"; import { useForm } from "react-hook-form"; import { useTranslation } from "react-i18next"; -import type { CatalogItemDTO } from "../common"; -import type { ResourceDTO, ResourceInput } from "../common/inventory"; -import { ResourceInputSchema } from "../common/inventory"; +import type { CatalogItemDTO } from "../../../../common"; +import type { ResourceDTO, ResourceInput } from "../../../../common/inventory"; +import { ResourceInputSchema } from "../../../../common/inventory"; +import { CatalogTemplateCreateDialog } from "../../../catalog-templates"; +import { InventoryFeedback } from "../../../shared"; +import { inventoryApi, inventoryKeys } from "../api"; -import { CatalogTemplateCreateDialog } from "./catalog-template-create-dialog"; -import { inventoryApi, inventoryKeys } from "./inventory-api"; -import { InventoryFeedback } from "./inventory-feedback"; import { ResourceCharacteristicControl } from "./resource-characteristic-control"; import { ResourceIntegrationFields, mailboxIntegration } from "./resource-integration-fields"; diff --git a/modules/resources/src/web/resource-integration-fields.tsx b/modules/resources/src/web/resources/shared/ui/resource-integration-fields.tsx similarity index 99% rename from modules/resources/src/web/resource-integration-fields.tsx rename to modules/resources/src/web/resources/shared/ui/resource-integration-fields.tsx index 13bcaff..f28028d 100644 --- a/modules/resources/src/web/resource-integration-fields.tsx +++ b/modules/resources/src/web/resources/shared/ui/resource-integration-fields.tsx @@ -3,7 +3,7 @@ import { SelectWithAction } from "@repo/shadcn-ui/components/select-with-action" import { useId } from "react"; import { useTranslation } from "react-i18next"; -import type { CatalogItemDTO, ResourceInput, ResourceReferenceDTO } from "../common"; +import type { CatalogItemDTO, ResourceInput, ResourceReferenceDTO } from "../../../../common"; export function mailboxIntegration( items: readonly CatalogItemDTO[], diff --git a/modules/resources/src/web/shared/i18n.ts b/modules/resources/src/web/shared/i18n.ts new file mode 100644 index 0000000..165a52a --- /dev/null +++ b/modules/resources/src/web/shared/i18n.ts @@ -0,0 +1,2 @@ +export { default as resourcesEnglish } from "../../common/locales/en.json"; +export { default as resourcesSpanish } from "../../common/locales/es.json"; diff --git a/modules/resources/src/web/shared/index.ts b/modules/resources/src/web/shared/index.ts new file mode 100644 index 0000000..9b6d556 --- /dev/null +++ b/modules/resources/src/web/shared/index.ts @@ -0,0 +1,2 @@ +export { resourcesEnglish, resourcesSpanish } from "./i18n"; +export { InventoryFeedback } from "./ui"; diff --git a/modules/resources/src/web/shared/ui/index.ts b/modules/resources/src/web/shared/ui/index.ts new file mode 100644 index 0000000..b3c8dbc --- /dev/null +++ b/modules/resources/src/web/shared/ui/index.ts @@ -0,0 +1 @@ +export { InventoryFeedback } from "./inventory-feedback"; diff --git a/modules/resources/src/web/inventory-feedback.tsx b/modules/resources/src/web/shared/ui/inventory-feedback.tsx similarity index 85% rename from modules/resources/src/web/inventory-feedback.tsx rename to modules/resources/src/web/shared/ui/inventory-feedback.tsx index e70356d..665354a 100644 --- a/modules/resources/src/web/inventory-feedback.tsx +++ b/modules/resources/src/web/shared/ui/inventory-feedback.tsx @@ -1,6 +1,6 @@ import { useTranslation } from "react-i18next"; -import { InventoryApiError } from "./inventory-api"; +import { InventoryApiError } from "../../resources/shared/api"; export function InventoryFeedback({ error }: { error: Error | null }) { const { t } = useTranslation("resources");