Skip to content

Commit

Permalink
Merge pull request #48858 from Krishna2323/krishna2323/issue2/45016
Browse files Browse the repository at this point in the history
 fix: Custom tag name can be saves as "0".
  • Loading branch information
danieldoglas authored Sep 10, 2024
2 parents 45be2e9 + c5acec6 commit 7858277
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/pages/workspace/tags/WorkspaceEditTagsPage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,9 @@ function WorkspaceEditTagsPage({route, policyTags}: WorkspaceEditTagsPageProps)
if (!values[INPUT_IDS.POLICY_TAGS_NAME] && values[INPUT_IDS.POLICY_TAGS_NAME].trim() === '') {
errors[INPUT_IDS.POLICY_TAGS_NAME] = translate('common.error.fieldRequired');
}
if (values[INPUT_IDS.POLICY_TAGS_NAME]?.trim() === '0') {
errors[INPUT_IDS.POLICY_TAGS_NAME] = translate('workspace.tags.invalidTagNameError');
}
if (policyTags && Object.values(policyTags).find((tag) => tag.orderWeight !== route.params.orderWeight && tag.name === values[INPUT_IDS.POLICY_TAGS_NAME])) {
errors[INPUT_IDS.POLICY_TAGS_NAME] = translate('workspace.tags.existingTagError');
}
Expand Down

0 comments on commit 7858277

Please sign in to comment.