From 884565c200939c1f4a3acfad087280c68518393c Mon Sep 17 00:00:00 2001 From: Tom-TBT Date: Fri, 30 Aug 2024 10:03:45 +0200 Subject: [PATCH] Also parse the image name --- src/AutoTagForm.jsx | 4 ++++ src/AutoTagHeaderRow.jsx | 2 +- src/AutoTagHeaderRowTokenCell.jsx | 2 +- src/AutoTagImageRow.jsx | 2 +- 4 files changed, 7 insertions(+), 3 deletions(-) diff --git a/src/AutoTagForm.jsx b/src/AutoTagForm.jsx index 0ec0274..1589be8 100644 --- a/src/AutoTagForm.jsx +++ b/src/AutoTagForm.jsx @@ -112,6 +112,10 @@ export default class AutoTagForm extends React.Component { tokens.forEach(value => imageTokens.add(this.addOrUpdateToken(image, tagValuesMap, tokenMap, value)) ); + tokens = image.name.split(/[\/\\_\.\s\[\]]+/); // Splitting on brackets too + tokens.forEach(value => + imageTokens.add(this.addOrUpdateToken(image, tagValuesMap, tokenMap, value)) + ); // Return the set of tokens that are present on this image return imageTokens; diff --git a/src/AutoTagHeaderRow.jsx b/src/AutoTagHeaderRow.jsx index 395f5da..ef4224b 100644 --- a/src/AutoTagHeaderRow.jsx +++ b/src/AutoTagHeaderRow.jsx @@ -37,7 +37,7 @@ export default class AutoTagHeaderRow extends React.Component { {cellNodesToken} {cellNodesTag} - Original Import Path + Original Import Path
Image Name ); diff --git a/src/AutoTagHeaderRowTokenCell.jsx b/src/AutoTagHeaderRowTokenCell.jsx index 92a9c1b..45e9ce3 100644 --- a/src/AutoTagHeaderRowTokenCell.jsx +++ b/src/AutoTagHeaderRowTokenCell.jsx @@ -93,7 +93,7 @@ export default class AutoTagHeaderRowTokenCell extends React.Component { return ( -
{token.value} +
{token.value}
{cellNodesToken} {cellNodesTag} - {image.clientPath} ({image.id}) + {image.clientPath}
{image.name} (id:{image.id}) ); }