Tax category page follow-up cleanups

Abierto
#5,305 0 comentarios 0 reacciones 0 asignados Ver en GitHub

Los mantenedores suelen responder en 2 días

Nadie ha tomado este issue todavía.

Evaluación

Dificultad
4/5
Tiempo estimado
3-5 días
Aptitud para principiantes
55/100
Tipo de issue
Refactorización
Claridad
Bien especificado
Estado de actividad
Activo
Stack tecnológico
react, typescript
Área
frontend, testing

Línea de trabajo

The issue lists four independent cleanups under packages/client, with target files and a test file named for the BusinessScreen change. Start with one cleanup, read its listed call sites, and run the corresponding tests; for the screen change, update screens/businesses/__tests__/business-screen.test.tsx. Done means the selected cleanup is covered by passing tests, with behavior unchanged.

Escrito por el modelo de indexación a partir del texto del issue.

Descripción

Cleanups noticed during the tax category page work (docs/tax-category-page/). None change behaviour.

  1. Remove BusinessScreen's unreachable fallback. packages/client/src/components/screens/businesses/business.tsx keeps a paused urql useQuery plus a no-loader <Navigate> branch. The /businesses/:businessId route always runs businessLoader (it either returns data or throws), so that path never runs in the app. Drop it, as was done for TaxCategoryScreen, and simplify the refresh to useRevalidator. Update screens/businesses/__tests__/business-screen.test.tsx.

  2. Shared membership-role lookup. Several call sites look up the user's role in a business with memberships.find(m => m.businessId === id)?.role, each with its own rules about who may edit:

    • components/business/admin/securities-settings-section.tsx
    • components/business/admin/depreciation-settings-section.tsx
    • components/manual-automations/manual-automations-access.ts
    • components/tax-category/details-section.tsx

    Extract a pure getMembershipRole(userContext, businessId) helper. Keep each site's role set and scope rules where they are; only the lookup is shared.

  3. Shared renderWithRouter test helper. About 30 client test files repeat the same createRoot + act + MemoryRouter harness, for example the cell tests under charges/cells/__tests__, ledger-table/__tests__, transactions-table/cells/__tests__, documents-table/cells/__tests__, business-ledger/cells/__tests__ and charge-matches/cells/__tests__. A shared helper would shorten them; migrate a few as part of adding it.

  4. NamedFinancialEntityRef type alias. FinancialEntityRef & { name: string } (from packages/client/src/router/routes.ts) is repeated in:

    • business-ledger/cells/business-name-cell.tsx
    • business-ledger/cells/counter-account-cell.tsx
    • charge-matches/cells/business.tsx
    • charge-matches/index.tsx
    • charges/cells/counterparty.tsx
    • ledger-table/counterparty-cell.tsx
    • common/financial-entity-link.tsx

    Add one alias next to FinancialEntityRef.

These can land as separate small PRs.

Lenguaje dominante
TypeScript
Estrellas
30
Forks
10
Merge medio
2 d 12 h
PR fusionados (30 d)
276

Preparar el entorno

Este proyecto no incluye contenedor de desarrollo, Dockerfile ni guía de contribución, así que la configuración corre por tu cuenta: empieza por su README y consulta nuestra guía para la primera contribución para los pasos generales.

Primeros pasos

  1. Lee el issue completo y luego la guía de contribución del proyecto.
  2. Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
  3. Haz un fork del repositorio y trabaja en una rama.
  4. Abre un pull request que haga referencia al número del issue.

Más de Urigo/accounter-fullstack

Todos los issues de Urigo/accounter-fullstack

Issues similares

Más issues de TypeScript

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.