diff --git a/frontend/web/components/modals/CreateFlag.js b/frontend/web/components/modals/CreateFlag.js index ea4ffbb4e1ca..6761fa413d13 100644 --- a/frontend/web/components/modals/CreateFlag.js +++ b/frontend/web/components/modals/CreateFlag.js @@ -652,7 +652,6 @@ const CreateFlag = class extends Component { tooltip={Constants.strings.TAGS_DESCRIPTION} component={ void projectId: string } const AddEditTags: FC = ({ - hideTagsByType = [], onChange, projectId, readOnly, @@ -36,11 +34,22 @@ const AddEditTags: FC = ({ const { data, isLoading: tagsLoading } = useGetTagsQuery({ projectId, }) + + const isFeatureHealthEnabled = Utils.getFlagsmithHasFeature('feature_health') + + const unhealthyTagId = useMemo(() => { + return data?.find((tag) => tag?.type === 'UNHEALTHY')?.id + }, [data]) + const projectTags = useMemo(() => { + if (!isFeatureHealthEnabled) { + return data + } + return data?.filter( - (projectTag) => !hideTagsByType.includes(projectTag.type), + (projectTag) => !['UNHEALTHY'].includes(projectTag.type), ) - }, [data, hideTagsByType]) + }, [data, isFeatureHealthEnabled]) const [filter, setFilter] = useState('') const [isOpen, setIsOpen] = useState(false) @@ -142,6 +151,7 @@ const AddEditTags: FC = ({ = ({ children, hideNames = true, + hideTags = [], inline, onAdd, projectId, value, }) => { - const { data: tags } = useGetTagsQuery({ projectId }) + const { data } = useGetTagsQuery({ projectId }) const Wrapper = inline ? Fragment : Row const permissionType = 'MANAGE_TAGS' + const tags = data?.filter((tag) => !hideTags?.includes(tag.id)) + const { permission: createEditTagPermission } = useHasPermission({ id: projectId, level: 'project',