diff --git a/frontend/src/views/ShopfloorDashboard.vue b/frontend/src/views/ShopfloorDashboard.vue index f98521f..4ce6bc7 100644 --- a/frontend/src/views/ShopfloorDashboard.vue +++ b/frontend/src/views/ShopfloorDashboard.vue @@ -1,818 +1,872 @@ - - - - - + + + + + diff --git a/plugins/notifications/api/routes.py b/plugins/notifications/api/routes.py index 844652e..cf9275b 100644 --- a/plugins/notifications/api/routes.py +++ b/plugins/notifications/api/routes.py @@ -157,6 +157,13 @@ def _apply_display_fields(t, data): if ds not in _DISPLAY_STYLES: return "displaystyle must be one of: %s" % ", ".join(_DISPLAY_STYLES) t.displaystyle = ds + if 'boardcategory' in data: + category = (data.get('boardcategory') or '').strip() + if len(category) > 50: + return "boardcategory must be 50 characters or fewer" + # Blank stores as NULL: "no category" is the absence of one, not the + # empty-string category that every uncategorised type would share. + t.boardcategory = category or None if 'gracewindowminutes' in data: raw = data.get('gracewindowminutes') raw = 0 if raw in (None, '') else raw @@ -178,11 +185,11 @@ def _config_version(): reach pages that are already open.""" types = NotificationType.query.order_by(NotificationType.notificationtypeid).all() parts = [ - "%s|%s|%s|%d|%d|%s|%s|%s|%d|%d" % ( + "%s|%s|%s|%d|%d|%s|%s|%s|%d|%d|%s" % ( t.notificationtypeid, t.typecolor, t.displaystyle, int(bool(t.splitperemployee)), int(bool(t.showemployeephoto)), t.expirymode, t.expirydays, t.expiryhour, int(bool(t.isactive)), - int(t.gracewindowminutes or 0), + int(t.gracewindowminutes or 0), t.boardcategory or '', ) for t in types ] @@ -779,8 +786,11 @@ def get_shopfloor_notifications(): 'resolved': is_resolved, 'typename': ntype.typename if ntype else None, 'typecolor': ntype.typecolor if ntype else None, - # Per-type display behavior the dashboard groups/renders by. + # Per-type display behavior the dashboard groups/renders by. A + # boardcategory puts several types in one row under that name; + # blank gives the type a row of its own. 'displaystyle': (ntype.displaystyle or 'standard') if ntype else 'standard', + 'boardcategory': (ntype.boardcategory or '') if ntype else '', } # Employee info (photo only when the type wants it) diff --git a/plugins/notifications/frontend/views/NotificationTypesList.vue b/plugins/notifications/frontend/views/NotificationTypesList.vue index 1303047..40e717d 100644 --- a/plugins/notifications/frontend/views/NotificationTypesList.vue +++ b/plugins/notifications/frontend/views/NotificationTypesList.vue @@ -32,7 +32,10 @@ {{ t.typecolor }} - {{ t.displaystyle || 'standard' }} + + {{ t.displaystyle || 'standard' }} + {{ t.boardcategory }} + split photo @@ -87,6 +90,17 @@ + +