dashboard: resolve employee names from directory/user, GE monogram photo fallback, kiosk sweep + label

- notifications shopfloor feed: resolve the employee name live when the stored
  value is a bare SSO (WJ notifications imported as SSOs, never converted), for
  both single and split-per-employee cards
- employee name resolver: after a directory miss, fall back to the shopdb User
  account (firstname/lastname, keyed by SSO username) so users from other
  locations still show a name
- shopfloor dashboard: employee photo falls back to the GE monogram (own asset,
  independent of the site_logo setting) with a loop-guarded onerror; recognition
  + recert tiles both covered
- shopfloor dashboard: 'All Business Units' filter label -> 'All Locations'
- geenforce display dispatcher: startup sweep also matches the imaging
  installers' 'GE Aerospace Dashboard/Lobby' shortcuts by name
This commit is contained in:
cproudlock
2026-07-28 18:21:47 -04:00
parent 3a8df166cf
commit 9a2d0ccebb
4 changed files with 63 additions and 25 deletions

View File

@@ -734,10 +734,13 @@ def get_shopfloor_notifications():
else:
result['employeesso'] = n.employeesso
# Stored name first (import/manual entry), else resolve live from
# the directory so shopdb-only imports still show names.
# the directory. Also resolve when the stored "name" is just the bare
# SSO: WJ notifications were imported with SSOs and never converted to
# names, so a digits-only stored name must still be looked up.
name = n.employeename
if not name and n.employeesso and ',' not in n.employeesso:
name = _employee_name(n.employeesso)
if (n.employeesso and ',' not in n.employeesso
and (not name or name.strip().isdigit())):
name = _employee_name(n.employeesso) or name
result['employeename'] = name
result['employeepicture'] = _employee_picture(n.employeesso) if show_photo else None
@@ -754,11 +757,18 @@ def get_shopfloor_notifications():
show_photo = bool(ntype and ntype.showemployeephoto)
ssos = [s.strip() for s in n.employeesso.split(',')]
names = n.employeename.split(', ') if n.employeename else []
def _name_for(i, sso):
stored = names[i].strip() if i < len(names) and names[i] else None
# A stored bare SSO (digits) is not a real name - look it up.
if stored and not stored.isdigit():
return stored
return _employee_name(sso) or stored or sso
return [
notification_to_shopfloor(n, {
'sso': sso,
'name': (names[i] if i < len(names) and names[i] else None)
or _employee_name(sso) or sso,
'name': _name_for(i, sso),
'picture': _employee_picture(sso) if show_photo else None,
})
for i, sso in enumerate(ssos)