Skip to content

Commit

Permalink
frontend: MainInfoSection: Correctly handle null backLink
Browse files Browse the repository at this point in the history
This fix explicitly handles the null case in getBackLink() to ensure
that no back button will be shown, as defined in MainInfoSectionProps.

Fixes: #2033

Signed-off-by: Evangelos Skopelitis <eskopelitis@microsoft.com>
  • Loading branch information
skoeva committed Jun 14, 2024
1 parent a11f9f0 commit b31b82c
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 54 deletions.
Original file line number Diff line number Diff line change
@@ -1,22 +1,5 @@
<div>
<button
class="MuiButtonBase-root MuiButton-root MuiButton-text MuiButton-textPrimary MuiButton-sizeSmall MuiButton-textSizeSmall MuiButton-colorPrimary MuiButton-root MuiButton-text MuiButton-textPrimary MuiButton-sizeSmall MuiButton-textSizeSmall MuiButton-colorPrimary css-w7fpvq-MuiButtonBase-root-MuiButton-root"
tabindex="0"
type="button"
>
<span
class="MuiButton-icon MuiButton-startIcon MuiButton-iconSizeSmall css-y6rp3m-MuiButton-startIcon"
/>
<p
class="MuiTypography-root MuiTypography-body1 css-1ezega9-MuiTypography-root"
style="padding-top: 3px;"
>
Back
</p>
<span
class="MuiTouchRipple-root css-8je8zh-MuiTouchRipple-root"
/>
</button>

<div
class="MuiBox-root css-j1fy4m"
>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,22 +1,5 @@
<div>
<button
class="MuiButtonBase-root MuiButton-root MuiButton-text MuiButton-textPrimary MuiButton-sizeSmall MuiButton-textSizeSmall MuiButton-colorPrimary MuiButton-root MuiButton-text MuiButton-textPrimary MuiButton-sizeSmall MuiButton-textSizeSmall MuiButton-colorPrimary css-w7fpvq-MuiButtonBase-root-MuiButton-root"
tabindex="0"
type="button"
>
<span
class="MuiButton-icon MuiButton-startIcon MuiButton-iconSizeSmall css-y6rp3m-MuiButton-startIcon"
/>
<p
class="MuiTypography-root MuiTypography-body1 css-1ezega9-MuiTypography-root"
style="padding-top: 3px;"
>
Back
</p>
<span
class="MuiTouchRipple-root css-8je8zh-MuiTouchRipple-root"
/>
</button>

<div
class="MuiBox-root css-j1fy4m"
>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,10 @@ export function MainInfoSection(props: MainInfoSectionProps) {
const header = typeof headerSection === 'function' ? headerSection(resource) : headerSection;

function getBackLink() {
if (backLink === null) {
return false;
}

if (!!backLink || backLink === '') {
return backLink;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,24 +8,7 @@
<div
class="MuiBox-root css-p0cik4"
>
<button
class="MuiButtonBase-root MuiButton-root MuiButton-text MuiButton-textPrimary MuiButton-sizeSmall MuiButton-textSizeSmall MuiButton-colorPrimary MuiButton-root MuiButton-text MuiButton-textPrimary MuiButton-sizeSmall MuiButton-textSizeSmall MuiButton-colorPrimary css-w7fpvq-MuiButtonBase-root-MuiButton-root"
tabindex="0"
type="button"
>
<span
class="MuiButton-icon MuiButton-startIcon MuiButton-iconSizeSmall css-y6rp3m-MuiButton-startIcon"
/>
<p
class="MuiTypography-root MuiTypography-body1 css-1ezega9-MuiTypography-root"
style="padding-top: 3px;"
>
Back
</p>
<span
class="MuiTouchRipple-root css-8je8zh-MuiTouchRipple-root"
/>
</button>

<div
class="MuiBox-root css-j1fy4m"
>
Expand Down

0 comments on commit b31b82c

Please sign in to comment.