Skip to content

Commit 2a65031

Browse files
committed
Drop unused consts and wrap component into FeatureDependent
1 parent bc89a28 commit 2a65031

File tree

2 files changed

+8
-11
lines changed

2 files changed

+8
-11
lines changed

src/component/bom.js

+8-8
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,6 @@ import ComplianceToolPopover from '../util/complianceToolsPopover'
7979
import {
8080
ARTEFACT_KIND,
8181
COMPLIANCE_TOOLS,
82-
DEPENDENT_COMPONENT,
8382
features,
8483
fetchBomPopulate,
8584
SUMMARY_CATEGORISATIONS,
@@ -1297,7 +1296,6 @@ const DependenciesTabHeader = React.memo(({
12971296
isComponentLoading,
12981297
componentRefs,
12991298
getSpecialComponentFeature,
1300-
componentType,
13011299
defaultSearchValue,
13021300
}) => {
13031301
const searchParamContext = React.useContext(SearchParamContext)
@@ -1328,15 +1326,18 @@ const DependenciesTabHeader = React.memo(({
13281326
</FeatureDependent>
13291327
</Grid>
13301328
<Grid item width='18%' alignItems='center' display='flex' flexDirection='column'>
1331-
{
1332-
(componentType !== DEPENDENT_COMPONENT) & !isComponentLoading
1333-
? <SpecialComponentStatus
1329+
<FeatureDependent
1330+
requiredFeatures={[features.SPECIAL_COMPONENTS]}
1331+
childrenIfFeatureLoading={<Skeleton width='100%'/>} // explicitly set width as parent container is a flexbox
1332+
>
1333+
{
1334+
isComponentLoading ? <Skeleton width='100%'/> : <SpecialComponentStatus
13341335
component={component}
13351336
componentRefs={componentRefs}
13361337
specialComponentFeature={getSpecialComponentFeature()}
13371338
/>
1338-
: <Skeleton width='100%'/> /* explicitly set width as parent container is a flexbox */
1339-
}
1339+
}
1340+
</FeatureDependent>
13401341
</Grid>
13411342
<Grid item width='17%' display='flex' justifyContent='right' flexDirection='column'>
13421343
<DownloadBom
@@ -1355,7 +1356,6 @@ DependenciesTabHeader.propTypes = {
13551356
isComponentLoading: PropTypes.bool.isRequired,
13561357
componentRefs: PropTypes.arrayOf(PropTypes.object),
13571358
getSpecialComponentFeature: PropTypes.func.isRequired,
1358-
componentType: PropTypes.string,
13591359
defaultSearchValue: PropTypes.string,
13601360
}
13611361

src/consts.js

-3
Original file line numberDiff line numberDiff line change
@@ -51,9 +51,6 @@ export const COMPONENT_PATH = '/component'
5151
export const SERVICES_PATH = '/services'
5252
export const MONITORING_PATH = '/monitoring'
5353

54-
export const DEPENDENT_COMPONENT = 'DEPENDENT_COMPONENT'
55-
export const CUSTOM_COMPONENT = 'CUSTOM_COMPONENT'
56-
5754
export const snackBarConfig = {
5855
variant: 'error',
5956
anchorOrigin: {

0 commit comments

Comments
 (0)