Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: remove empty space for empty health section #3051

Merged
merged 2 commits into from
Jul 9, 2024
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
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
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
Loading