@@ -34,10 +34,12 @@ import classNames from 'classnames';
3434import { forwardRef } from 'react' ;
3535import { FormattedMessage , useIntl } from 'react-intl' ;
3636import { Image } from '~adapters/components/common/Image' ;
37- import { useCurrentUser } from '~sq-server-commons/context/current-user/CurrentUserContext' ;
37+ import { useCurrentUser } from '~adapters/helpers/users' ;
38+ import { useAvailableFeatures } from '~sq-server-commons/context/available-features/withAvailableFeatures' ;
3839import { getProjectSettingsUrl } from '~sq-server-commons/helpers/urls' ;
3940import { useProjectBindingQuery } from '~sq-server-commons/queries/devops-integration' ;
4041import { AlmKeys } from '~sq-server-commons/types/alm-settings' ;
42+ import { Feature } from '~sq-server-commons/types/features' ;
4143import { Component } from '~sq-server-commons/types/types' ;
4244import { isLoggedIn } from '~sq-server-commons/types/users' ;
4345import { PULL_REQUEST_DECORATION_BINDING_CATEGORY } from '../../../../apps/settings/constants' ;
@@ -69,6 +71,8 @@ export function ProjectBindingStatus({
6971} : Readonly < ProjectNavBindingStatusProps > ) {
7072 const { formatMessage } = useIntl ( ) ;
7173
74+ const { hasFeature } = useAvailableFeatures ( ) ;
75+
7276 const { currentUser } = useCurrentUser ( ) ;
7377
7478 const { data : projectBinding , isLoading : isLoadingProjectBinding } = useProjectBindingQuery (
@@ -83,6 +87,8 @@ export function ProjectBindingStatus({
8387 { dop : formatMessage ( { id : DOP_LABEL_IDS [ almKey ] } ) } ,
8488 ) ;
8589
90+ const hasBranchSupport = hasFeature ( Feature . BranchSupport ) ;
91+
8692 return (
8793 < Spinner isLoading = { isLoadingProjectBinding } >
8894 { almKey && (
@@ -96,11 +102,15 @@ export function ProjectBindingStatus({
96102 />
97103 ) }
98104
99- { ! almKey && ! isLoadingProjectBinding && ! component . configuration ?. showSettings && (
100- < UnboundBadge className = { className } isUserLoggedIn = { isLoggedIn ( currentUser ) } />
101- ) }
105+ { hasBranchSupport &&
106+ ! almKey &&
107+ ! isLoadingProjectBinding &&
108+ ! component . configuration ?. showSettings && (
109+ < UnboundBadge className = { className } isUserLoggedIn = { isLoggedIn ( currentUser ) } />
110+ ) }
102111
103- { ! almKey &&
112+ { hasBranchSupport &&
113+ ! almKey &&
104114 ! isLoadingProjectBinding &&
105115 isLoggedIn ( currentUser ) &&
106116 component . configuration ?. showSettings && (
0 commit comments