Mitarbeiterliste: engerer Zellabstand bei den Langzeitabwesenden
Mit dem Filter Langzeitabwesenheit stehen neun Spalten statt acht; mit dem gewohnten Abstand reichte die Tabelle knapp ueber die Karte hinaus und bekam eine Bildlaufleiste. Dort jetzt px-3 statt px-4. Geprueft: lint, tsc, npm test, Waechter.
This commit is contained in:
@@ -111,6 +111,9 @@ export default async function EmployeesPage({ searchParams }: EmployeesPageProps
|
|||||||
const statuses = listenStatus(params.status);
|
const statuses = listenStatus(params.status);
|
||||||
const { feld: sortFeld, richtung: sortRichtung } = sortierungAus(params.sort, params.dir, statuses);
|
const { feld: sortFeld, richtung: sortRichtung } = sortierungAus(params.sort, params.dir, statuses);
|
||||||
const spalten = spaltenFuer(statuses);
|
const spalten = spaltenFuer(statuses);
|
||||||
|
// Bei den Langzeitabwesenden stehen neun Spalten statt acht; mit dem
|
||||||
|
// gewohnten Abstand reichte die Tabelle knapp über die Karte hinaus.
|
||||||
|
const zelle = spalten.length > 8 ? "px-3 py-2.5" : "px-4 py-2.5";
|
||||||
|
|
||||||
const { orgMaps, employees, count, placements, ueberPosition } = await withUser(await currentUserId(), async (tx) => {
|
const { orgMaps, employees, count, placements, ueberPosition } = await withUser(await currentUserId(), async (tx) => {
|
||||||
// Die Referenzdaten zuerst: der Bereichsfilter braucht den Teilbaum.
|
// Die Referenzdaten zuerst: der Bereichsfilter braucht den Teilbaum.
|
||||||
@@ -215,7 +218,7 @@ export default async function EmployeesPage({ searchParams }: EmployeesPageProps
|
|||||||
key={f.value}
|
key={f.value}
|
||||||
scope="col"
|
scope="col"
|
||||||
aria-sort={aktiv ? (sortRichtung === "asc" ? "ascending" : "descending") : "none"}
|
aria-sort={aktiv ? (sortRichtung === "asc" ? "ascending" : "descending") : "none"}
|
||||||
className="px-4 py-2.5"
|
className={zelle}
|
||||||
>
|
>
|
||||||
<Link
|
<Link
|
||||||
href={sortHref(params, f.value, sortFeld, sortRichtung)}
|
href={sortHref(params, f.value, sortFeld, sortRichtung)}
|
||||||
@@ -252,7 +255,7 @@ export default async function EmployeesPage({ searchParams }: EmployeesPageProps
|
|||||||
// border-subtle between rows: a full-strength border makes
|
// border-subtle between rows: a full-strength border makes
|
||||||
// an 800-row table read as a grid rather than a list.
|
// an 800-row table read as a grid rather than a list.
|
||||||
<tr key={e.id} className="border-b border-border-subtle transition-colors last:border-0 hover:bg-brand-50">
|
<tr key={e.id} className="border-b border-border-subtle transition-colors last:border-0 hover:bg-brand-50">
|
||||||
<td className="px-4 py-2.5">
|
<td className={zelle}>
|
||||||
<Link
|
<Link
|
||||||
href={`/employees/${e.id}`}
|
href={`/employees/${e.id}`}
|
||||||
className="flex items-center gap-3 rounded focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-brand-500"
|
className="flex items-center gap-3 rounded focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-brand-500"
|
||||||
@@ -276,7 +279,7 @@ export default async function EmployeesPage({ searchParams }: EmployeesPageProps
|
|||||||
{spalten.slice(1).map((s) => {
|
{spalten.slice(1).map((s) => {
|
||||||
// tabular-nums keeps the numeric columns aligned down the
|
// tabular-nums keeps the numeric columns aligned down the
|
||||||
// page instead of jittering per row.
|
// page instead of jittering per row.
|
||||||
const zahl = "px-4 py-2.5 tabular-nums text-ink-body";
|
const zahl = `${zelle} tabular-nums text-ink-body`;
|
||||||
switch (s.value) {
|
switch (s.value) {
|
||||||
case "persnr":
|
case "persnr":
|
||||||
return <td key={s.value} className={zahl}>{e.personnel_number}</td>;
|
return <td key={s.value} className={zahl}>{e.personnel_number}</td>;
|
||||||
@@ -288,30 +291,30 @@ export default async function EmployeesPage({ searchParams }: EmployeesPageProps
|
|||||||
// im `title` — eine Einheit wie „Shopleitung"
|
// im `title` — eine Einheit wie „Shopleitung"
|
||||||
// sagt allein nicht, welche gemeint ist.
|
// sagt allein nicht, welche gemeint ist.
|
||||||
return (
|
return (
|
||||||
<td key={s.value} className="px-4 py-2.5 text-ink-body" title={breadcrumbLabel(orgMaps, placement?.orgUnitId)}>
|
<td key={s.value} className={`${zelle} text-ink-body`} title={breadcrumbLabel(orgMaps, placement?.orgUnitId)}>
|
||||||
{unit?.name ?? "–"}
|
{unit?.name ?? "–"}
|
||||||
</td>
|
</td>
|
||||||
);
|
);
|
||||||
case "standort":
|
case "standort":
|
||||||
return <td key={s.value} className="px-4 py-2.5 text-ink-body">{location?.name ?? "–"}</td>;
|
return <td key={s.value} className={`${zelle} text-ink-body`}>{location?.name ?? "–"}</td>;
|
||||||
case "eintritt":
|
case "eintritt":
|
||||||
return <td key={s.value} className={zahl}>{fmtDate(e.entry_date)}</td>;
|
return <td key={s.value} className={zahl}>{fmtDate(e.entry_date)}</td>;
|
||||||
case "austritt":
|
case "austritt":
|
||||||
return <td key={s.value} className={zahl}>{e.exit_date ? fmtDate(e.exit_date) : "–"}</td>;
|
return <td key={s.value} className={zahl}>{e.exit_date ? fmtDate(e.exit_date) : "–"}</td>;
|
||||||
case "beschaeftigung":
|
case "beschaeftigung":
|
||||||
return (
|
return (
|
||||||
<td key={s.value} className="px-4 py-2.5 text-ink-body">
|
<td key={s.value} className={`${zelle} text-ink-body`}>
|
||||||
{e.employment_type} · <span className="tabular-nums">{e.weekly_hours}h</span>
|
{e.employment_type} · <span className="tabular-nums">{e.weekly_hours}h</span>
|
||||||
</td>
|
</td>
|
||||||
);
|
);
|
||||||
case "status":
|
case "status":
|
||||||
return (
|
return (
|
||||||
<td key={s.value} className="px-4 py-2.5">
|
<td key={s.value} className={zelle}>
|
||||||
<StatusChip employee={e} asOf={today} zweizeilig />
|
<StatusChip employee={e} asOf={today} zweizeilig />
|
||||||
</td>
|
</td>
|
||||||
);
|
);
|
||||||
case "abwesenheit":
|
case "abwesenheit":
|
||||||
return <td key={s.value} className="px-4 py-2.5 text-ink-body">{anzeige(e.absence_type) ?? "–"}</td>;
|
return <td key={s.value} className={`${zelle} text-ink-body`}>{anzeige(e.absence_type) ?? "–"}</td>;
|
||||||
case "abwesend_ab":
|
case "abwesend_ab":
|
||||||
return <td key={s.value} className={zahl}>{e.karenz_start_date ? fmtDate(e.karenz_start_date) : "–"}</td>;
|
return <td key={s.value} className={zahl}>{e.karenz_start_date ? fmtDate(e.karenz_start_date) : "–"}</td>;
|
||||||
case "rueckkehr":
|
case "rueckkehr":
|
||||||
|
|||||||
Reference in New Issue
Block a user