Iconos y colores de canal
Una sola fuente de verdad: CONNECTION_CHANNELS en features/connections/connections.constants.ts.
interface ConnectionChannelOption {
type: ConnectionChannelType;
icon: string; // clase Font Awesome 4
color: string;
enabled: boolean; // si se puede crear desde el selector
}
type | Icono | Color | enabled |
|---|---|---|---|
web | fa fa-globe | #42a5f5 | true |
whatsapp-qr | fa fa-whatsapp | #25d366 | true |
whatsapp-cloud | fa fa-whatsapp | #128c7e | false |
facebook | fa fa-facebook | #1877f2 | false |
instagram | fa fa-instagram | #e1306c | true (cambio de la rama; en main era false) |
Los iconos son Font Awesome 4 (font-awesome ^4.7.0, cargado en angular.json > styles). CHANNEL_TYPE define las constantes de tipo con satisfies Record<string, ConnectionChannelType>.
Dónde se usan
| Lugar | Componente | Uso |
|---|---|---|
| Selector de canal | ConnectionChannelModalComponent | Chip con el icono (fondo color + '26'), degradado sutil de la tarjeta (${color}14) e insignia "Próximamente" si enabled es falso |
| Tarjeta de conexión | ConnectionsTableComponent | Icono con [style.color] y degradado de cabecera linear-gradient(175deg, ${color}40, transparent 65%) (headerGradient); color de reserva #6c757d |
| Filtro de conexiones | ConnectionsFilterComponent | Opciones de canal con nombre traducido (connections.channels.<type>) |
| Lista de chats | ChatListItemComponent | channelOption y channelTooltip: icono del canal junto al ticket |
| Encabezado de conversación | ChatConversationComponent | Lo mismo en conv-header__channel-icon, con title |
En el chat
Tanto ChatListItemComponent como ChatConversationComponent resuelven el canal con:
const channelType = this.conversation?.channelType;
if (!channelType) return null;
return CONNECTION_CHANNELS.find((c) => c.type === channelType) ?? null;
El tooltip es conversation.connectionName (o el channelType si no hay nombre). Cuando el ticket no tiene conexión no se dibuja icono: el código documenta que "origen desconocido no es origen web". channelType llega al ChatConversation desde ticket.connection.channelType (chat-list.component.ts).
Cómo añadir un canal
- Añadir el valor a
ConnectionChannelType(core/interfaces/api/connection.interface.ts) y aCHANNEL_TYPE. - Añadir la entrada en
CONNECTION_CHANNELSconenabled: falsehasta que exista el flujo de alta. - Añadir claves i18n
connections.channels.<type>yconnections.channels.<type>Descenes.jsonyen.json. - Si el canal tiene flujo propio, ramificar en
ConnectionsTableComponent.openChannelSelector()y en las acciones de la tarjeta.
:::note Facebook
El backend habilita Facebook en webhooks y envío, pero el frontend lo mantiene enabled: false porque no hay flujo de alta (OAuth) para Facebook en esta rama.
:::