Skip to content

WasteSearchTable columns

Paulo Gomes da Cruz Junior edited this page Jun 16, 2026 · 3 revisions

WasteSearchTable — Column Definitions

WasteSearchTable/constants.tsx exports the column definitions array and helpers that drive the Waste Search results table.

Source References

  • Source: frontend/src/components/waste/WasteSearch/WasteSearchTable/constants.tsx
  • Tests: frontend/src/components/waste/WasteSearch/WasteSearchTable/constants.unit.test.tsx

Exported Symbols

headers

TableHeaderType<ReportingUnitSearchResultDto>[] — Column configuration array passed directly to the TableResource component.

Column key Header label Sortable Default visible Render component / notes
cutBlockId Block ID Yes Yes EmptyValueTag
licenseNumber Licence No. Yes No EmptyValueTag
cuttingPermit Cutting Permit Yes No EmptyValueTag
timberMark Timber Mark Yes No EmptyValueTag
ruNumber RU No. Yes Yes TooltipRedirectLinkTag — feature-flag conditional (see below)
client.code Client No. Yes Yes TooltipRoleBasedRedirectLinkTag — IDIR role-gated link to client details
client.description Client name No Yes Plain text
sampling Sampling option Yes Yes CodeDescriptionTag
sampling.code Sampling code Yes No Plain text
sampling.description Sampling name Yes No Plain text
multiMark Multi-mark (Y/N) No No YesNoTag
secondaryEntry Secondary entry (Y/N) No No YesNoTag
district District Yes Yes CodeDescriptionTag
district.code District code Yes No Plain text
district.description District name Yes No Plain text
status Status Yes Yes ColorTag (color driven by statusColorMap, showTooltip={false} — no tooltip on cells)
status.code Status code Yes No Plain text
status.description Status name Yes No Plain text
lastUpdated Last updated on Yes Yes DateTag with format="DD" — id: 'lastUpdated'
lastUpdated Timestamp Yes No DateTag with format="t" — id: 'lastUpdatedTimestamp'; two columns share this key, distinguished by id

statusColorMap

Record<string, CarbonColors> — Maps reporting-unit status codes to Carbon Design System tag colours.

Colour Status codes
red ERR, FREJ, OREJ, REJ
teal HLD, HWR, RBL
green APP, BIP, BIS, BPR, COM, REV, RTB, WRA
blue SUB
outline DFT, ISUB
gray DAC
cyan EXP

Status codes not present in this map render without a colour override.

Feature-Flag Conditional: ruNumber Column

The ruNumber column rendering depends on the reporting-unit-details-enabled feature flag:

Flag state Render output
true TooltipRedirectLinkTag with url=/reporting-units/{value}, sameTab, clearSearch — routes to the React RU details page
false / unset TooltipRedirectLinkTag with url={VITE_LEGACY_BASE_URL}/waste101ReportUnitDetailsAction.do?... — routes to the legacy system in a new tab

Known Constraints

  • statusColorMap is a private constant; extend it only when the backend introduces a new status code.
  • The status column renders ColorTag with showTooltip={false}. Tooltips are intentionally suppressed here even though ColorTag supports them by default — the description is already visible in the status.description sub-column.
  • The ruNumber legacy URL is constructed from env.VITE_LEGACY_BASE_URL — if the legacy URL pattern changes, update this file.
  • Test coverage must cover both branches of the reporting-unit-details-enabled flag on the ruNumber renderer.
  • The two lastUpdated rows (id: 'lastUpdated' and id: 'lastUpdatedTimestamp') share the same data key. Both are present so that DateTag can render date-only and full-timestamp views independently. The id field disambiguates them for column toggling.

See Also

Waste Plus Wiki

Home

Architecture

Codes

Decisions

Knowledge Base

Development

Changes

Clone this wiki locally