feat(office): users admin UI, table rendering, and user save fixes
Add Users list/detail with ACL toggles and library people update/status APIs. Fix project table layout and ANSI-safe cell rendering, and decode array responses from people/status so saves no longer fail on JSON unmarshal. Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -46,6 +46,27 @@ func ProjectStatusLabel(raw map[string]any) string {
|
||||
return ProjectStatusFromAny(raw["status"]).Label()
|
||||
}
|
||||
|
||||
// ProjectStatusIcon returns the list-cell emoji for a project lifecycle state.
|
||||
func (s ProjectLifecycle) Icon() string {
|
||||
switch s {
|
||||
case ProjectLifecycleClosed:
|
||||
return "🔴"
|
||||
case ProjectLifecyclePaused:
|
||||
return "🟡"
|
||||
default:
|
||||
return "🟢"
|
||||
}
|
||||
}
|
||||
|
||||
// ProjectStatusCell returns emoji and label on one line for project table cells.
|
||||
func ProjectStatusCell(raw map[string]any) string {
|
||||
if raw == nil {
|
||||
return ProjectLifecycleOpen.Icon() + " Open"
|
||||
}
|
||||
s := ProjectStatusFromAny(raw["status"])
|
||||
return s.Icon() + " " + s.Label()
|
||||
}
|
||||
|
||||
// ProjectIsOpen is true when the project is not closed.
|
||||
func ProjectIsOpen(raw map[string]any) bool {
|
||||
if raw == nil {
|
||||
|
||||
Reference in New Issue
Block a user