fix(plan): readable audit descriptions, project labels, dashboard invalidation, view-only & sticky-column UI
Work-plan fixes from this session: - Czech audit descriptions for plan entries/overrides (was empty '-') - server-embedded project label on grid cells (was '-' past the 100-project cap) - dashboard activity + audit-log cache invalidation on plan mutations - read-only cells: no '+' on empty, keep hover on cells with a record - view modal: Czech category + formatted dates - sticky date column made opaque (no bleed-through on horizontal scroll) Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -1,4 +1,8 @@
|
||||
import { ResolvedCell } from "../lib/queries/plan";
|
||||
import {
|
||||
ResolvedCell,
|
||||
planCategoryLabel,
|
||||
cellProjectLabel,
|
||||
} from "../lib/queries/plan";
|
||||
import type { Project } from "../lib/queries/projects";
|
||||
|
||||
interface Props {
|
||||
@@ -7,34 +11,24 @@ interface Props {
|
||||
readonly?: boolean;
|
||||
}
|
||||
|
||||
const CATEGORY_LABELS: Record<string, string> = {
|
||||
work: "Práce",
|
||||
preparation: "Příprava",
|
||||
travel: "Cesta / Montáž",
|
||||
leave: "Dovolená",
|
||||
sick: "Nemoc",
|
||||
training: "Školení",
|
||||
other: "Jiné",
|
||||
};
|
||||
|
||||
export default function PlanRangeChips({ cell, project, readonly }: Props) {
|
||||
void readonly;
|
||||
if (!cell) return null;
|
||||
const projectLabel = project
|
||||
// Prefer the server-embedded project label (always present). Fall back to
|
||||
// the looked-up `project` prop only if the cell predates the embed (stale
|
||||
// cache).
|
||||
const fallbackLabel = project
|
||||
? project.project_number
|
||||
? `${project.project_number} — ${project.name}`
|
||||
: project.name
|
||||
: null;
|
||||
const projectTitle = project
|
||||
? project.project_number
|
||||
? `${project.project_number} — ${project.name}`
|
||||
: project.name
|
||||
: undefined;
|
||||
const projectLabel = cellProjectLabel(cell) ?? fallbackLabel;
|
||||
const projectTitle = projectLabel ?? undefined;
|
||||
return (
|
||||
<div className="plan-chip-block">
|
||||
<div className="plan-chip-line">
|
||||
<span className={`plan-chip plan-chip--${cell.category}`}>
|
||||
{CATEGORY_LABELS[cell.category] ?? cell.category}
|
||||
{planCategoryLabel(cell.category)}
|
||||
</span>
|
||||
{projectLabel && (
|
||||
<span className="plan-chip-project" title={projectTitle}>
|
||||
|
||||
Reference in New Issue
Block a user