Skip to content

Commit

Permalink
Fix popover overflow (opendatahub-io#3395)
Browse files Browse the repository at this point in the history
* Fix popover overflow

Update to add headers

* Add popover clustom class
  • Loading branch information
ashley-o0o authored Oct 31, 2024
1 parent 591f87b commit 21907eb
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 0 deletions.
5 changes: 5 additions & 0 deletions frontend/src/app/App.scss
Original file line number Diff line number Diff line change
Expand Up @@ -89,3 +89,8 @@ body,
max-width: 100%;
}
}

.pf-v5-c-popover.odh-u-scrollable .pf-v5-c-popover__body {
max-height: 65vh;
overflow: auto;
}
Original file line number Diff line number Diff line change
Expand Up @@ -101,14 +101,32 @@ const InferenceServiceStatus: React.FC<InferenceServiceStatusProps> = ({
}
};

const headerContent = () => {
switch (state) {
case InferenceServiceModelState.LOADED:
return 'Available';
case InferenceServiceModelState.FAILED_TO_LOAD:
return 'Failed';
case InferenceServiceModelState.PENDING:
case InferenceServiceModelState.LOADING:
return 'In Progress';
case InferenceServiceModelState.UNKNOWN:
return 'Status Unknown';
default:
return 'Inference Service Status';
}
};

const bodyContent = modelStatus?.failedToSchedule
? 'Insufficient resources'
: getInferenceServiceStatusMessage(inferenceService);

return (
<Popover
data-testid="model-status-tooltip"
className="odh-u-scrollable"
position="top"
headerContent={headerContent()}
bodyContent={bodyContent}
isVisible={bodyContent ? undefined : false}
>
Expand Down

0 comments on commit 21907eb

Please sign in to comment.