🎨 style(modals): add 'ID:' prefix to the node id badge in EditNodeModal

🎨 style(PageComponent): add lowercase type prefix to the generated node id
The 'ID:' prefix was added to the node id badge in EditNodeModal to improve readability and semantics. In PageComponent, a lowercase prefix was added to the generated node id to improve consistency with the naming conventions.
This commit is contained in:
Gabriel Luiz Freitas Almeida 2023-06-14 15:47:05 -03:00
commit b16f04d543
2 changed files with 3 additions and 2 deletions

View file

@ -88,7 +88,7 @@ export default function EditNodeModal({ data }: { data: NodeDataType }) {
<DialogHeader>
<DialogTitle className="flex items-center">
<span className="pr-2">{data.type}</span>
<Badge variant="secondary">{data.id}</Badge>
<Badge variant="secondary">ID: {data.id}</Badge>
</DialogTitle>
<DialogDescription>
{EDIT_DIALOG_SUBTITLE}

View file

@ -215,7 +215,8 @@ export default function Page({ flow }: { flow: FlowType }) {
// Generate a unique node ID
let { type } = data;
let newId = getNodeId();
newId = `${type}_${newId}`;
// add lowercase to the type
newId = `${type.toLowerCase()}-${newId}`;
let newNode: NodeType;
if (data.type !== "groupNode") {