Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
33 changes: 32 additions & 1 deletion frontend/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

19 changes: 7 additions & 12 deletions frontend/web/components/feature-summary/FeatureTags.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -38,18 +38,13 @@ const FeatureTags: FC<FeatureTagsType> = ({ editFeature, projectFlag }) => {
}
const isFeatureHealthEnabled = Utils.getFlagsmithHasFeature('feature_health')

const isCodeReferencesEnabled = Utils.getFlagsmithHasFeature(
'git_code_references',
)

const hasScannedCodeReferences =
isCodeReferencesEnabled && projectFlag?.code_references_counts?.length > 0
const codeReferencesCounts = isCodeReferencesEnabled
? projectFlag?.code_references_counts?.reduce(
(acc, curr) => acc + curr.count,
0,
) || 0
: 0
projectFlag?.code_references_counts?.length > 0
const codeReferencesCounts =
projectFlag?.code_references_counts?.reduce(
(acc, curr) => acc + curr.count,
0,
) || 0

return (
<>
Expand All @@ -68,7 +63,7 @@ const FeatureTags: FC<FeatureTagsType> = ({ editFeature, projectFlag }) => {
count={projectFlag.num_identity_overrides}
showPlusIndicator={showPlusIndicator}
/>
{isCodeReferencesEnabled && hasScannedCodeReferences && (
{hasScannedCodeReferences && (
<Tooltip
title={
<div
Expand Down
21 changes: 8 additions & 13 deletions frontend/web/components/feature-summary/ProjectFeatureRow.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ import FeatureName from './FeatureName'
import FeatureDescription from './FeatureDescription'
import TagValues from 'components/tags/TagValues'
import VCSProviderTag from 'components/tags/VCSProviderTag'
import Utils from 'common/utils/utils'

export interface ProjectFeatureRowProps {
projectFlag: ProjectFlag
Expand All @@ -26,17 +25,13 @@ const ProjectFeatureRow: FC<ProjectFeatureRowProps> = ({
}) => {
const { description } = projectFlag

const isCodeReferencesEnabled = Utils.getFlagsmithHasFeature(
'git_code_references',
)
const hasScannedCodeReferences =
isCodeReferencesEnabled && projectFlag?.code_references_counts?.length > 0
const codeReferencesCounts = isCodeReferencesEnabled
? projectFlag?.code_references_counts?.reduce(
(acc, curr) => acc + curr.count,
0,
) || 0
: 0
projectFlag?.code_references_counts?.length > 0
const codeReferencesCounts =
projectFlag?.code_references_counts?.reduce(
(acc, curr) => acc + curr.count,
0,
) || 0

return (
<>
Expand Down Expand Up @@ -66,7 +61,7 @@ const ProjectFeatureRow: FC<ProjectFeatureRowProps> = ({
<div className='mx-0 flex-1 flex-column'>
<div className='d-flex align-items-center'>
<FeatureName name={projectFlag.name} />
{isCodeReferencesEnabled && hasScannedCodeReferences && (
{hasScannedCodeReferences && (
<Tooltip
title={
<VCSProviderTag
Expand Down Expand Up @@ -115,7 +110,7 @@ const ProjectFeatureRow: FC<ProjectFeatureRowProps> = ({
)}
<div className='flex-1 align-items-center flex-wrap'>
<FeatureName name={projectFlag.name} />
{isCodeReferencesEnabled && hasScannedCodeReferences && (
{hasScannedCodeReferences && (
<Tooltip
title={
<VCSProviderTag
Expand Down
6 changes: 1 addition & 5 deletions frontend/web/components/modals/create-feature/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -623,11 +623,7 @@ const Index = class extends Component {
const noPermissions = this.props.noPermissions
let regexValid = true

const isCodeReferencesEnabled = Utils.getFlagsmithHasFeature(
'git_code_references',
)
const hasCodeReferences =
isCodeReferencesEnabled || projectFlag?.code_references_counts?.length > 0
const hasCodeReferences = projectFlag?.code_references_counts?.length > 0

try {
if (!isEdit && projectFlag.name && regex) {
Expand Down
Loading