fix(jobnet-search): preserve full occupation identifiers in tables (#586)

* fix(jobnet-search): preserve full occupation identifiers in tables

The documented ESCO concept URI is 72 characters long, but the table renderer cut every identifier to 70, losing the last two UUID characters. Size the identifier column from its contents, retaining the existing minimum width and readable label alignment.

Exercise the actual documented occupations CLI with the README API response served over loopback. Table output must retain the same complete URI and UUID as JSON and plain output; no live portal requests.

* test(jobnet-search): cover Windows occupation fixture newlines
This commit is contained in:
Rudy Mizrahi Celekli authored and GitHub committed 2026-10-18 07:36:47 +02:00
1 parent 176b675080
commit 12b757189a
3 files changed
+82 -2

No files matched your search

@@ -64,9 +64,12 @@ export const occupations = defineCommand({
})
function outputTable(data: Occupation[]): void {
console.log("conceptUriDa preferredLabelDa")
// The full URI is an identifier: truncating it cuts the UUID used to build
// search filters. Widen the column instead of abbreviating its value.
const uriWidth = data.reduce((width, o) => Math.max(width, o.conceptUriDa.length), 70)
console.log(`${"conceptUriDa".padEnd(uriWidth)} preferredLabelDa`)
for (const o of data) {
const uri = o.conceptUriDa.substring(0, 70).padEnd(70)
const uri = o.conceptUriDa.padEnd(uriWidth)
const label = o.preferredLabelDa
console.log(`${uri} ${label}`)
}