Skip to content

Commit 124ebd2

Browse files
authored
Fixes #35491 - host details statuses clear button disabled (#9409)
1 parent 4ba2437 commit 124ebd2

File tree

2 files changed

+9
-2
lines changed

2 files changed

+9
-2
lines changed

webpack/assets/javascripts/react_app/components/HostDetails/Status/GlobalStatus.js

+3-1
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ import { HOST_STATUSES_KEY } from './Constants';
99
import { APIActions } from '../../../redux/API';
1010
import { selectAPIResponse } from '../../../redux/API/APISelectors';
1111

12-
const GlobalStatus = ({ hostName }) => {
12+
const GlobalStatus = ({ hostName, canForgetStatuses }) => {
1313
const [modalStatus, setModalStatus] = useState(false);
1414
const dispatch = useDispatch();
1515

@@ -41,13 +41,15 @@ const GlobalStatus = ({ hostName }) => {
4141
onClose={() => {
4242
setModalStatus(false);
4343
}}
44+
canForgetStatuses={canForgetStatuses}
4445
/>
4546
</>
4647
);
4748
};
4849

4950
GlobalStatus.propTypes = {
5051
hostName: PropTypes.string.isRequired,
52+
canForgetStatuses: PropTypes.bool.isRequired,
5153
};
5254

5355
export default GlobalStatus;

webpack/assets/javascripts/react_app/components/HostDetails/index.js

+6-1
Original file line numberDiff line numberDiff line change
@@ -142,7 +142,12 @@ const HostDetails = ({
142142
</div>
143143
<Split style={{ display: 'inline-flex' }} hasGutter>
144144
<SplitItem>
145-
<HostGlobalStatus hostName={id} />
145+
<HostGlobalStatus
146+
hostName={id}
147+
canForgetStatuses={
148+
!!response?.permissions?.forget_status_hosts
149+
}
150+
/>
146151
</SplitItem>
147152
<SplitItem>
148153
<Label

0 commit comments

Comments
 (0)