Edit flow configured

This commit is contained in:
adilallo
2026-04-29 18:29:16 -06:00
parent 3a9727bceb
commit fc845d8308
39 changed files with 681 additions and 165 deletions
@@ -13,6 +13,12 @@ export type GovernanceTemplateCatalogEntry = {
backgroundColor: string;
/** Path under public/ for getAssetPath() — Figma Asset / Template Mark */
iconPath: string;
/**
* When true, the templates grid shows the “RECOMMENDED” tag (facet-based
* scores will set this in `ruleTemplateToGridEntry` when wired; catalog
* entries omit unless intentionally static).
*/
recommended?: boolean;
};
/** SVGs in `public/assets/template-mark/<slug>.svg` (kebab-case slug). */
+11 -2
View File
@@ -11,16 +11,24 @@ import {
export const TEMPLATE_GRID_FALLBACK_PRESENTATION = {
iconPath: governanceTemplateIconPath("consensus"),
backgroundColor: "bg-[var(--color-surface-invert-brand-teal)]",
recommended: false,
} as const;
export type TemplateGridCardEntry = GovernanceTemplateCatalogEntry;
function presentationForSlug(slug: string): Pick<
GovernanceTemplateCatalogEntry,
"iconPath" | "backgroundColor"
"iconPath" | "backgroundColor" | "recommended"
> {
const catalog = getGovernanceTemplateCatalogEntry(slug);
return catalog ?? TEMPLATE_GRID_FALLBACK_PRESENTATION;
if (catalog) {
return {
iconPath: catalog.iconPath,
backgroundColor: catalog.backgroundColor,
recommended: catalog.recommended === true,
};
}
return TEMPLATE_GRID_FALLBACK_PRESENTATION;
}
/**
@@ -35,6 +43,7 @@ export function ruleTemplateToGridEntry(template: RuleTemplateDto): TemplateGrid
description,
iconPath: pres.iconPath,
backgroundColor: pres.backgroundColor,
recommended: pres.recommended,
};
}