Skip to content

Commit

Permalink
feat(THEEDGE-3359): Add federated module to show edge image informati…
Browse files Browse the repository at this point in the history
…on (#1909)

Implements https://issues.redhat.com/browse/THEEDGE-3359.

---------

Signed-off-by: Adelia Ferreira <[email protected]>
Co-authored-by: Georgy Karataev <[email protected]>
  • Loading branch information
adeliaferreira and gkarat authored Jul 7, 2023
1 parent 627eb61 commit 62b5a97
Show file tree
Hide file tree
Showing 2 changed files with 30 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import PropTypes from 'prop-types';
import { connect } from 'react-redux';
import { Grid, GridItem, Modal } from '@patternfly/react-core';
import { SortByDirection } from '@patternfly/react-table';
import AsyncComponent from '@redhat-cloud-services/frontend-components/AsyncComponent';

import { systemProfile } from '../../../store/actions';
import InfoTable from '../InfoTable';
Expand Down Expand Up @@ -167,6 +168,18 @@ class GeneralInformation extends Component {
/>
</GridItem>
)}

{this.props.showImageDetails && (
<GridItem>
<AsyncComponent
appName="edge"
module="./ImagesInformationCard"
deviceIdProps={
this.props.inventoryId || this.props.entity.id
}
/>
</GridItem>
)}
</Grid>
</GridItem>
{children}
Expand Down Expand Up @@ -235,6 +248,7 @@ GeneralInformation.propTypes = {
location: PropTypes.any,
inventoryId: PropTypes.string.isRequired,
systemProfilePrefetched: PropTypes.bool,
showImageDetails: PropTypes.bool,
};
GeneralInformation.defaultProps = {
entity: {},
Expand All @@ -247,6 +261,7 @@ GeneralInformation.defaultProps = {
DataCollectorsCardWrapper: DataCollectorsCard,
CollectionCardWrapper: false,
systemProfilePrefetched: false,
showImageDetails: false,
};

const mapStateToProps = ({ entityDetails: { entity } }) => ({
Expand Down
16 changes: 15 additions & 1 deletion src/components/SystemDetails/GeneralInfo.js
Original file line number Diff line number Diff line change
@@ -1,10 +1,24 @@
import React from 'react';

import GeneralInformation from '../GeneralInfo/GeneralInformation';
import useFeatureFlag from '../../Utilities/useFeatureFlag';
export { default as TextInputModal } from '../GeneralInfo/TextInputModal';

const GeneralInfoTab = (props) => {
return <GeneralInformation {...props} />;
const enableEdgeImageDetails = useFeatureFlag(
'edgeParity.inventory-system-detail'
);
const enableEdgeInventoryListDetails = useFeatureFlag(
'edgeParity.inventory-list'
);
return (
<GeneralInformation
{...props}
showImageDetails={
enableEdgeImageDetails && enableEdgeInventoryListDetails
}
/>
);
};

export default GeneralInfoTab;

0 comments on commit 62b5a97

Please sign in to comment.