diff --git a/webpack/components/extensions/HostDetails/Tabs/PackagesTab/PackageInstallModal.js b/webpack/components/extensions/HostDetails/Tabs/PackagesTab/PackageInstallModal.js
index 6f137b4e1f3..a73f2e2786d 100644
--- a/webpack/components/extensions/HostDetails/Tabs/PackagesTab/PackageInstallModal.js
+++ b/webpack/components/extensions/HostDetails/Tabs/PackagesTab/PackageInstallModal.js
@@ -124,7 +124,7 @@ const PackageInstallModal = ({
const selectedPackageNames = () => selectedResults.map(({ name }) => name);
const installViaRex = () => {
- triggerPackageInstall(fetchBulkParams());
+ triggerPackageInstall(fetchBulkParams(), selectedPackageNames().join(', '));
selectNone();
closeModal();
};
diff --git a/webpack/components/extensions/HostDetails/Tabs/PackagesTab/PackagesTab.js b/webpack/components/extensions/HostDetails/Tabs/PackagesTab/PackagesTab.js
index 1baedc0d0f1..5d88f64c9d5 100644
--- a/webpack/components/extensions/HostDetails/Tabs/PackagesTab/PackagesTab.js
+++ b/webpack/components/extensions/HostDetails/Tabs/PackagesTab/PackagesTab.js
@@ -231,9 +231,10 @@ export const PackagesTab = () => {
isPolling: isRemoveInProgress,
} = useRexJobPolling(packageRemoveAction);
- const packageBulkRemoveAction = bulkParams => removePackages({
+ const packageBulkRemoveAction = (bulkParams, packageNames) => removePackages({
hostname,
search: bulkParams,
+ descriptionFormat: `Remove package(s) ${packageNames}`,
});
const {
@@ -253,10 +254,11 @@ export const PackagesTab = () => {
isPolling: isUpgradeInProgress,
} = useRexJobPolling(packageUpgradeAction, getHostDetails({ hostname }));
- const packageBulkUpgradeAction = bulkParams => updatePackages({
+ const packageBulkUpgradeAction = (bulkParams, descriptionFormat) => updatePackages({
hostname,
search: bulkParams,
versions: JSON.stringify(selectedNVRAVersions || []),
+ descriptionFormat,
});
const {
@@ -266,7 +268,7 @@ export const PackagesTab = () => {
} = useRexJobPolling(packageBulkUpgradeAction, getHostDetails({ hostname }));
const packageInstallAction
- = bulkParams => installPackageBySearch({ hostname, search: bulkParams });
+ = (bulkParams, packageNames) => installPackageBySearch({ hostname, search: bulkParams, descriptionFormat: `Install package(s) ${packageNames}` });
const {
triggerJobStart: triggerPackageInstall,
@@ -306,9 +308,10 @@ export const PackagesTab = () => {
const removePackagesViaRemoteExecution = () => {
const selected = fetchBulkParams();
+ const packageNames = selectedResults.map(({ name }) => name);
setIsBulkActionOpen(false);
selectNone();
- triggerBulkPackageRemove(selected);
+ triggerBulkPackageRemove(selected, packageNames.join(', '));
};
const removeBulk = () => removePackagesViaRemoteExecution();
@@ -321,9 +324,13 @@ export const PackagesTab = () => {
const upgradeBulkViaRemoteExecution = () => {
const selected = fetchBulkParams();
+ const packageNames = selectedResults.map(({ name }) => name);
+ const allRowsSelected = areAllRowsSelected();
+ let descriptionFormatText = allRowsSelected ? 'Upgrade all packages' : `Upgrade package(s) ${packageNames.join(', ')}`;
+ if (selectAllMode && !allRowsSelected) descriptionFormatText = 'Upgrade lots of packages'; // we don't know the package names in the exclusion set
setIsBulkActionOpen(false);
selectNone();
- triggerBulkPackageUpgrade(selected);
+ triggerBulkPackageUpgrade(selected, descriptionFormatText);
};
const upgradeBulk = () => upgradeBulkViaRemoteExecution();
@@ -462,7 +469,6 @@ export const PackagesTab = () => {
);
const resetFilters = () => setPackageStatusSelected(PACKAGE_STATUS);
-
return (
diff --git a/webpack/components/extensions/HostDetails/Tabs/RemoteExecutionActions.js b/webpack/components/extensions/HostDetails/Tabs/RemoteExecutionActions.js
index 36122a20e58..5e00cc0a5ad 100644
--- a/webpack/components/extensions/HostDetails/Tabs/RemoteExecutionActions.js
+++ b/webpack/components/extensions/HostDetails/Tabs/RemoteExecutionActions.js
@@ -9,10 +9,13 @@ import { PACKAGE_SEARCH_QUERY } from './PackagesTab/YumInstallablePackagesConsta
import { PACKAGES_SEARCH_QUERY, SELECTED_UPDATE_VERSIONS } from './PackagesTab/HostPackagesConstants';
// PARAM BUILDING
-const baseParams = ({ feature, hostname, inputs = {} }) => ({
+const baseParams = ({
+ feature, hostname, descriptionFormat, inputs = {},
+}) => ({
job_invocation: {
feature,
inputs,
+ descriptionFormat,
search_query: `name ^ (${hostname})`,
},
});
@@ -33,11 +36,12 @@ const katelloPackageInstallParams = ({ hostname, packageName }) =>
});
// used when we know package Id(s)
-const katelloPackageInstallBySearchParams = ({ hostname, search }) =>
+const katelloPackageInstallBySearchParams = ({ hostname, search, descriptionFormat }) =>
baseParams({
hostname,
inputs: { [PACKAGE_SEARCH_QUERY]: search },
feature: REX_FEATURES.KATELLO_PACKAGE_INSTALL_BY_SEARCH,
+ description_format: descriptionFormat,
});
const katelloPackageRemoveParams = ({ hostname, packageName }) =>
@@ -47,11 +51,12 @@ const katelloPackageRemoveParams = ({ hostname, packageName }) =>
feature: REX_FEATURES.KATELLO_PACKAGE_REMOVE,
});
-const katelloPackagesRemoveParams = ({ hostname, search }) =>
+const katelloPackagesRemoveParams = ({ hostname, search, descriptionFormat }) =>
baseParams({
hostname,
inputs: { [PACKAGES_SEARCH_QUERY]: search },
feature: REX_FEATURES.KATELLO_PACKAGES_REMOVE_BY_SEARCH,
+ description_format: descriptionFormat,
});
const katelloPackageUpdateParams = ({ hostname, packageName }) =>
@@ -61,11 +66,14 @@ const katelloPackageUpdateParams = ({ hostname, packageName }) =>
feature: REX_FEATURES.KATELLO_PACKAGE_UPDATE,
});
-const katelloPackagesUpdateParams = ({ hostname, search, versions }) => ({
+const katelloPackagesUpdateParams = ({
+ hostname, search, versions, descriptionFormat,
+}) => ({
job_invocation: {
feature: REX_FEATURES.KATELLO_PACKAGES_UPDATE_BY_SEARCH,
inputs: { [PACKAGES_SEARCH_QUERY]: search, [SELECTED_UPDATE_VERSIONS]: versions },
search_query: `name ^ (${hostname})`,
+ description_format: descriptionFormat,
},
});
@@ -134,11 +142,11 @@ export const installPackage = ({ hostname, packageName, handleSuccess }) => post
errorToast,
});
-export const installPackageBySearch = ({ hostname, search }) => post({
+export const installPackageBySearch = ({ hostname, search, descriptionFormat }) => post({
type: API_OPERATIONS.POST,
key: REX_JOB_INVOCATIONS_KEY,
url: foremanApi.getApiUrl('/job_invocations'),
- params: katelloPackageInstallBySearchParams({ hostname, search }),
+ params: katelloPackageInstallBySearchParams({ hostname, search, descriptionFormat }),
handleSuccess: showRexToast,
errorToast,
});
@@ -152,11 +160,11 @@ export const removePackage = ({ hostname, packageName }) => post({
errorToast,
});
-export const removePackages = ({ hostname, search }) => post({
+export const removePackages = ({ hostname, search, descriptionFormat }) => post({
type: API_OPERATIONS.POST,
key: REX_JOB_INVOCATIONS_KEY,
url: foremanApi.getApiUrl('/job_invocations'),
- params: katelloPackagesRemoveParams({ hostname, search }),
+ params: katelloPackagesRemoveParams({ hostname, search, descriptionFormat }),
handleSuccess: showRexToast,
errorToast,
});
@@ -170,11 +178,15 @@ export const updatePackage = ({ hostname, packageName }) => post({
errorToast,
});
-export const updatePackages = ({ hostname, search, versions }) => post({
+export const updatePackages = ({
+ hostname, search, versions, descriptionFormat,
+}) => post({
type: API_OPERATIONS.POST,
key: REX_JOB_INVOCATIONS_KEY,
url: foremanApi.getApiUrl('/job_invocations'),
- params: katelloPackagesUpdateParams({ hostname, search, versions }),
+ params: katelloPackagesUpdateParams({
+ hostname, search, versions, descriptionFormat,
+ }),
handleSuccess: showRexToast,
errorToast,
});
diff --git a/webpack/components/extensions/HostDetails/Tabs/__tests__/packagesTab.test.js b/webpack/components/extensions/HostDetails/Tabs/__tests__/packagesTab.test.js
index e3d42fad188..423c9621568 100644
--- a/webpack/components/extensions/HostDetails/Tabs/__tests__/packagesTab.test.js
+++ b/webpack/components/extensions/HostDetails/Tabs/__tests__/packagesTab.test.js
@@ -271,6 +271,7 @@ test('Can bulk upgrade via remote execution', async (done) => {
},
search_query: `name ^ (${hostname})`,
feature: REX_FEATURES.KATELLO_PACKAGES_UPDATE_BY_SEARCH,
+ description_format: 'Upgrade package(s) chrony, coreutils',
},
})
.reply(201);