Skip to content

Commit

Permalink
fix: remove empty space for empty health section (#3051)
Browse files Browse the repository at this point in the history
* fix: remove empty space for empyt health section

* fix: remove console errors
  • Loading branch information
chriskari authored Jul 9, 2024
1 parent b90cb56 commit 495392b
Show file tree
Hide file tree
Showing 5 changed files with 18 additions and 10 deletions.
2 changes: 1 addition & 1 deletion src/components/Extensibility/ExtensibilityDetails.js
Original file line number Diff line number Diff line change
Expand Up @@ -161,7 +161,7 @@ export const ExtensibilityDetailsCore = ({
: []
}
customHealthCards={
Array.isArray(health)
Array.isArray(health) && health?.length > 0
? [
(resource, i) => (
<Widget
Expand Down
8 changes: 6 additions & 2 deletions src/components/Extensibility/ExtensibilityInjections.js
Original file line number Diff line number Diff line change
Expand Up @@ -71,9 +71,13 @@ export const ExtensibilityInjectionCore = ({ resMetaData, root }) => {
const ExtensibilityInjections = ({ destination, slot, root }) => {
const injections = useGetInjections(destination, slot);
let itemList = [];
(injections || []).forEach(injection => {
(injections || []).forEach((injection, index) => {
itemList.push(
<ExtensibilityInjection resMetaData={injection} root={root} />,
<ExtensibilityInjection
resMetaData={injection}
root={root}
key={index}
/>,
);
});
return itemList;
Expand Down
2 changes: 1 addition & 1 deletion src/shared/ResourceForm/fields/MultiInput.js
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,7 @@ export function MultiInput({
tooltipContent={sectionTooltipContent || tooltipContent}
{...props}
>
<div className="form-field multi-input" justifyContent="Center">
<div className="form-field multi-input">
<ul className="bsl-col-md--12">
{internalValue.map((entry, index) => {
const fieldWidth =
Expand Down
8 changes: 4 additions & 4 deletions src/shared/components/ResourceDetails/ResourceDetails.js
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ ResourceDetails.propTypes = {
showYamlTab: PropTypes.bool,
layoutCloseCreateUrl: PropTypes.string,
layoutNumber: PropTypes.string,
customHealthCards: PropTypes.node,
customHealthCards: PropTypes.arrayOf(PropTypes.func),
showHealthCardsTitle: PropTypes.bool,
};

Expand Down Expand Up @@ -394,9 +394,9 @@ function Resource({
/>
);

const customOverviewCard = (customHealthCards || []).map(healthCard =>
healthCard(resource),
);
const customOverviewCard = (
customHealthCards || []
).map((healthCard, index) => healthCard(resource, index));

return (
<ResourceDetailContext.Provider value={true}>
Expand Down
8 changes: 6 additions & 2 deletions src/shared/components/UnsavedMessageBox/UnsavedMessageBox.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -58,8 +58,12 @@ export function UnsavedMessageBox({ isOpen }: UnsavedMessageBoxProps) {
onClose={handleClose}
titleText={t('common.headers.discard-changes')}
actions={[
<Button design="Emphasized">{t('common.buttons.discard')}</Button>,
<Button design="Transparent">{`${t('common.buttons.cancel')}`}</Button>,
<Button design="Emphasized" key="discard">
{t('common.buttons.discard')}
</Button>,
<Button design="Transparent" key="cancel">{`${t(
'common.buttons.cancel',
)}`}</Button>,
]}
>
{t('common.messages.discard-changes-warning')}
Expand Down

0 comments on commit 495392b

Please sign in to comment.