use ids instead of alphabets (index)

This commit is contained in:
Carl-Gerhard Lindesvärd
2024-08-20 21:42:02 +02:00
parent a5b06c8af0
commit a6b3d341c1
9 changed files with 47 additions and 10 deletions

View File

@@ -11,6 +11,7 @@ import { useEventNames } from '@/hooks/useEventNames';
import { useDispatch, useSelector } from '@/redux';
import { GanttChart, GanttChartIcon, Users } from 'lucide-react';
import { alphabetIds } from '@openpanel/constants';
import type { IChartEvent } from '@openpanel/validation';
import {
@@ -57,11 +58,11 @@ export function ReportEvents() {
<div>
<h3 className="mb-2 font-medium">Events</h3>
<div className="flex flex-col gap-4">
{selectedEvents.map((event) => {
{selectedEvents.map((event, index) => {
return (
<div key={event.id} className="rounded-lg border bg-def-100">
<div className="flex items-center gap-2 p-2">
<ColorSquare>{event.id}</ColorSquare>
<ColorSquare>{alphabetIds[index]}</ColorSquare>
<Combobox
icon={GanttChartIcon}
className="flex-1"
@@ -84,7 +85,9 @@ export function ReportEvents() {
/>
<Input
placeholder={
event.name ? `${event.name} (${event.id})` : 'Display name'
event.name
? `${event.name} (${alphabetIds[index]})`
: 'Display name'
}
defaultValue={event.displayName}
onChange={(e) => {