Skip to content

Commit

Permalink
Refs #36789 - consume context from Foreman
Browse files Browse the repository at this point in the history
  so I can get rid of the stupid menu when you
  click it
  • Loading branch information
jeremylenz committed Oct 3, 2023
1 parent 717fc51 commit ee15098
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
6 changes: 4 additions & 2 deletions webpack/components/extensions/HostDetails/ActionsBar/index.js
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
import React from 'react';
import React, { useContext } from 'react';
import { useSelector, useDispatch } from 'react-redux';
import { DropdownItem, DropdownSeparator } from '@patternfly/react-core';
import { CubeIcon, UndoIcon, RedoIcon } from '@patternfly/react-icons';

import { translate as __ } from 'foremanReact/common/I18n';
import { HOST_DETAILS_KEY } from 'foremanReact/components/HostDetails/consts';
import { ForemanActionsBarContext } from 'foremanReact/components/HostDetails/ActionsBar';
import { foremanUrl } from 'foremanReact/common/helpers';

import { selectHostDetails } from '../HostDetailsSelectors';
Expand All @@ -15,6 +16,7 @@ const HostActionsBar = () => {
const hostDetails = useSelector(selectHostDetails);
const dispatch = useDispatch();
const hostname = hostDetails?.name;
const { onKebabToggle } = useContext(ForemanActionsBarContext);

const refreshHostDetails = () => dispatch({
type: 'API_GET',
Expand All @@ -29,8 +31,8 @@ const HostActionsBar = () => {
} = useRexJobPolling(() => runSubmanRepos(hostname, refreshHostDetails));

const handleRefreshApplicabilityClick = () => {
// setIsBulkActionOpen(false);
triggerRecalculate();
onKebabToggle();
};

return (
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ export const useRexJobPolling = (initialAction, successAction = null, failureAct
const tick = (resp) => {
const { data } = resp;
const { statusLabel, id, description } = propsToCamelCase(data);
setRexJobId(id);
if (!id) setRexJobId(id);
if (statusLabel && statusLabel !== 'running') {
stopRexJobPolling({ jobId: id, statusLabel });
if (statusLabel === 'succeeded') {
Expand Down

0 comments on commit ee15098

Please sign in to comment.