diff --git a/src/pages/workspace/tags/WorkspaceEditTagsPage.tsx b/src/pages/workspace/tags/WorkspaceEditTagsPage.tsx index 55df353912ad..972506e31be1 100644 --- a/src/pages/workspace/tags/WorkspaceEditTagsPage.tsx +++ b/src/pages/workspace/tags/WorkspaceEditTagsPage.tsx @@ -42,9 +42,12 @@ 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 (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'); + } return errors; }, - [translate], + [translate, policyTags, route.params.orderWeight], ); const updateTaglistName = useCallback(