deploy fix
This commit is contained in:
@@ -1,5 +1,6 @@
|
|||||||
import { useMemo } from 'react';
|
import { useMemo } from 'react';
|
||||||
import { TrailMap, trailColour, type MapPin, type MapTrail } from '@/components/TrailMap';
|
import { TrailMap, trailColour, type MapPin, type MapTrail } from '@/components/TrailMap';
|
||||||
|
import type { TenantLocation } from '@/api/types';
|
||||||
import type { Stop } from './dispatchModel';
|
import type { Stop } from './dispatchModel';
|
||||||
import { routingApi } from '@/api/routing';
|
import { routingApi } from '@/api/routing';
|
||||||
import { mapStop, roundsOf, shopsOf, type Point } from './deliveryTrack';
|
import { mapStop, roundsOf, shopsOf, type Point } from './deliveryTrack';
|
||||||
|
|||||||
@@ -1,6 +1,5 @@
|
|||||||
import { useMemo, useState, type ReactNode } from 'react';
|
import { useMemo, useState, type ReactNode } from 'react';
|
||||||
import { Card } from '@astryxdesign/core/Card';
|
import { Card } from '@astryxdesign/core/Card';
|
||||||
import { HStack } from '@astryxdesign/core/HStack';
|
|
||||||
import { Text } from '@astryxdesign/core/Text';
|
import { Text } from '@astryxdesign/core/Text';
|
||||||
import { VStack } from '@astryxdesign/core/VStack';
|
import { VStack } from '@astryxdesign/core/VStack';
|
||||||
import {
|
import {
|
||||||
@@ -542,12 +541,12 @@ function getStableGroupColor(id: string, index: number, isUnassigned: boolean, m
|
|||||||
if (mode === 'stores') return '#f59e0b';
|
if (mode === 'stores') return '#f59e0b';
|
||||||
if (mode === 'customers') return '#8b5cf6';
|
if (mode === 'customers') return '#8b5cf6';
|
||||||
const s = String(id ?? '');
|
const s = String(id ?? '');
|
||||||
if (!s) return RIDER_COLORS[index % RIDER_COLORS.length];
|
if (!s) return RIDER_COLORS[index % RIDER_COLORS.length]!;
|
||||||
let h = 0;
|
let h = 0;
|
||||||
for (let i = 0; i < s.length; i++) {
|
for (let i = 0; i < s.length; i++) {
|
||||||
h = (h * 31 + s.charCodeAt(i)) >>> 0;
|
h = (h * 31 + s.charCodeAt(i)) >>> 0;
|
||||||
}
|
}
|
||||||
return RIDER_COLORS[h % RIDER_COLORS.length];
|
return RIDER_COLORS[h % RIDER_COLORS.length]!;
|
||||||
}
|
}
|
||||||
|
|
||||||
function EnhancedGroupList({
|
function EnhancedGroupList({
|
||||||
@@ -590,14 +589,13 @@ function EnhancedGroupList({
|
|||||||
const isDone = total > 0 && done >= total;
|
const isDone = total > 0 && done >= total;
|
||||||
const color = getStableGroupColor(group.id, i, isUnassigned, mode);
|
const color = getStableGroupColor(group.id, i, isUnassigned, mode);
|
||||||
|
|
||||||
// Subtitle / Trips / Zone
|
// Subtitle / Zone
|
||||||
let zoneSubtitle = '';
|
let zoneSubtitle = '';
|
||||||
if (mode === 'riders') {
|
if (mode === 'riders') {
|
||||||
const tripCount = new Set(
|
// No trip number reaches the console — a delivery row carries no such
|
||||||
group.stops.map((s) => (s.kind === 'delivery' ? (s.row.trip_number || 1) : 1))
|
// field — so a "N trips" count here would always read 1. The rider's
|
||||||
).size;
|
// contact is the one real detail this group has.
|
||||||
const loc = group.detail || 'Local';
|
zoneSubtitle = group.detail || 'No contact';
|
||||||
zoneSubtitle = `${loc} · ${tripCount} ${tripCount === 1 ? 'trip' : 'trips'}`;
|
|
||||||
} else if (mode === 'stores') {
|
} else if (mode === 'stores') {
|
||||||
zoneSubtitle = `${group.riders.size} ${group.riders.size === 1 ? 'rider' : 'riders'}`;
|
zoneSubtitle = `${group.riders.size} ${group.riders.size === 1 ? 'rider' : 'riders'}`;
|
||||||
} else {
|
} else {
|
||||||
|
|||||||
Reference in New Issue
Block a user