Add custom fields + warranty plugin, rework settings into two-pane shell
Feature work from the 2026-07 session: Settings IA - Replace the flat 27-card settings hub with a persistent two-pane shell (SettingsLayout.vue): grouped, searchable left rail + content pane. - Nest all settings/* routes under the shell via router post-processing; shared nav catalog in settingsNav.js. Group by asset class (PCs, Printers, Equipment, Network) so per-type settings stop scattering. Custom fields (core) - customfields + customfieldvalues tables (migration 7d14), CRUD API at /api/customfields, per-asset value get/save. - Settings management page + reusable CustomFieldsSection (detail) and CustomFieldsInputs (form) wired into all four asset types. Warranty (new plugin) - plugins/warranty: warranties + warrantyassets (migration 7d15), derived coverage status, provider abstraction (manual now; Dell/Lenovo/HP stubs). - API CRUD + per-asset panel + report buckets; WarrantyPanel on all four detail pages; Warranties management page; Warranty report + Reports card. - Seed warranty.* permissions. Printer drivers - printerdrivers table (migration 7d13) linked to printer models; drivers now surface on the matching printer's detail page. Other - PCDetail rebalanced (Network + Status + Warranty + custom fields on the right). - Rename PCs list "Features" column to "Remote Access"; fix badge hover underline. - Drop equipment islocationonly field. - Centralize asset-type label/route maps into utils/assetTypes.js. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -73,23 +73,41 @@ class NotificationsPlugin(BasePlugin):
|
||||
logger.info("Notifications plugin installed")
|
||||
|
||||
def _ensure_notification_types(self) -> None:
|
||||
"""Ensure default notification types exist."""
|
||||
"""Ensure default notification types exist.
|
||||
|
||||
For the special shopfloor types (recognition, training,
|
||||
recertification) the typecolor is a keyword the dashboard maps to a
|
||||
style and the feed uses to split multi-employee cards per employee;
|
||||
generic types use a hex color.
|
||||
"""
|
||||
# (typename, typedescription, typecolor, expirymode, expirydays,
|
||||
# expiryhour, splitperemployee, showemployeephoto, displaystyle)
|
||||
default_types = [
|
||||
('Awareness', 'General awareness notification', '#17a2b8', 'info-circle'),
|
||||
('Change', 'Planned change notification', '#ffc107', 'exchange-alt'),
|
||||
('Incident', 'Incident or outage notification', '#dc3545', 'exclamation-triangle'),
|
||||
('Maintenance', 'Scheduled maintenance notification', '#6c757d', 'wrench'),
|
||||
('General', 'General announcement', '#28a745', 'bullhorn'),
|
||||
('Awareness', 'General awareness notification', '#17a2b8', 'none', None, None, False, False, 'standard'),
|
||||
('Change', 'Planned change notification', '#ffc107', 'none', None, None, False, False, 'standard'),
|
||||
('Incident', 'Incident or outage notification', '#dc3545', 'none', None, None, False, False, 'standard'),
|
||||
('Maintenance', 'Scheduled maintenance notification', '#6c757d', 'none', None, None, False, False, 'standard'),
|
||||
('General', 'General announcement', '#28a745', 'none', None, None, False, False, 'standard'),
|
||||
('Recognition', 'Employee recognition (clears at 8 AM Eastern)', '#ffc107', 'dailytime', None, 8, True, True, 'carousel'),
|
||||
('Training', 'Training notice (one card per employee)', '#17a2b8', 'none', None, None, True, True, 'carousel'),
|
||||
('Recertification', 'Employees due to retake a training course (shows two weeks)', '#0d6efd', 'duration', 14, None, True, True, 'grid'),
|
||||
]
|
||||
|
||||
for typename, description, color, icon in default_types:
|
||||
for (typename, typedescription, typecolor, expirymode, expirydays,
|
||||
expiryhour, splitperemployee, showemployeephoto, displaystyle) in default_types:
|
||||
existing = NotificationType.query.filter_by(typename=typename).first()
|
||||
if not existing:
|
||||
t = NotificationType(
|
||||
typename=typename,
|
||||
description=description,
|
||||
color=color,
|
||||
icon=icon
|
||||
typedescription=typedescription,
|
||||
typecolor=typecolor,
|
||||
expirymode=expirymode,
|
||||
expirydays=expirydays,
|
||||
expiryhour=expiryhour,
|
||||
expiryminute=0,
|
||||
splitperemployee=splitperemployee,
|
||||
showemployeephoto=showemployeephoto,
|
||||
displaystyle=displaystyle
|
||||
)
|
||||
db.session.add(t)
|
||||
logger.debug(f"Created notification type: {typename}")
|
||||
|
||||
Reference in New Issue
Block a user