feat: enhance category handling with new category chip logic and user-specific product categorization
Test Suite / test (24.15.0) (push) Has been cancelled
Test Suite / test (24.15.0) (push) Has been cancelled
This commit is contained in:
@@ -4,6 +4,26 @@ String? normalizedOptionalText(String? value) {
|
||||
return normalized;
|
||||
}
|
||||
|
||||
String l1CategoryChipLabel(String prefix, String l1Category) => '$prefix$l1Category';
|
||||
({String label, String tooltip}) categoryChipText({
|
||||
required String? categoryPath,
|
||||
required String fallbackL1,
|
||||
}) {
|
||||
final path = categoryPath?.trim();
|
||||
if (path == null || path.isEmpty) {
|
||||
return (label: fallbackL1, tooltip: fallbackL1);
|
||||
}
|
||||
|
||||
final parts = path
|
||||
.split('>')
|
||||
.map((part) => part.trim())
|
||||
.where((part) => part.isNotEmpty)
|
||||
.toList();
|
||||
|
||||
if (parts.isEmpty) {
|
||||
return (label: fallbackL1, tooltip: fallbackL1);
|
||||
}
|
||||
|
||||
return (label: parts.last, tooltip: parts.join(' > '));
|
||||
}
|
||||
|
||||
String locationLabel(String prefix, String location) => '$prefix$location';
|
||||
|
||||
Reference in New Issue
Block a user