Skip to content

Commit

Permalink
Also parse the image name
Browse files Browse the repository at this point in the history
  • Loading branch information
Tom-TBT committed Aug 30, 2024
1 parent 4efd27b commit 884565c
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 3 deletions.
4 changes: 4 additions & 0 deletions src/AutoTagForm.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
2 changes: 1 addition & 1 deletion src/AutoTagHeaderRow.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ export default class AutoTagHeaderRow extends React.Component {
<tr>
{cellNodesToken}
{cellNodesTag}
<th>Original Import Path</th>
<th>Original Import Path<br/>Image Name</th>
</tr>
</thead>
);
Expand Down
2 changes: 1 addition & 1 deletion src/AutoTagHeaderRowTokenCell.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ export default class AutoTagHeaderRowTokenCell extends React.Component {

return (
<th>
<div className={'token'}>{token.value}
<div className={'token'}>{token.value}<br/>
<input type="checkbox"
checked={this.isChecked()}
disabled={this.isDisabled()}
Expand Down
2 changes: 1 addition & 1 deletion src/AutoTagImageRow.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ export default class AutoTagImageRow extends React.Component {
<tr>
{cellNodesToken}
{cellNodesTag}
<td style={{whiteSpace: 'nowrap'}}>{image.clientPath}&nbsp;({image.id})</td>
<td style={{whiteSpace: 'nowrap'}}>{image.clientPath}<br/>{image.name}&nbsp;(id:{image.id})</td>
</tr>
);
}
Expand Down

0 comments on commit 884565c

Please sign in to comment.