Skip to content

Commit

Permalink
Merge pull request #4417 from mzedel/men-7228
Browse files Browse the repository at this point in the history
MEN-7228 - fix: deployment recreation release retrieval
  • Loading branch information
mzedel committed Jun 10, 2024
2 parents ba14c8b + 0173f1b commit 7bf5498
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 3 deletions.
3 changes: 2 additions & 1 deletion src/js/components/deployments/createdeployment.js
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ import DeltaIcon from '../../../assets/img/deltaicon.svg';
import { createDeployment, getDeploymentsConfig } from '../../actions/deploymentActions';
import { getGroupDevices } from '../../actions/deviceActions';
import { advanceOnboarding } from '../../actions/onboardingActions';
import { getReleases } from '../../actions/releaseActions';
import { getRelease, getReleases } from '../../actions/releaseActions';
import { ALL_DEVICES } from '../../constants/deviceConstants';
import { onboardingSteps } from '../../constants/onboardingConstants';
import { toggle, validatePhases } from '../../helpers';
Expand Down Expand Up @@ -149,6 +149,7 @@ export const CreateDeployment = props => {
const { devices = [], group, release } = deploymentObject;
if (release) {
dispatch(advanceOnboarding(onboardingSteps.SCHEDULING_ARTIFACT_SELECTION));
dispatch(getRelease(release.name));
}
dispatch(advanceOnboarding(onboardingSteps.SCHEDULING_GROUP_SELECTION));
let nextDeploymentObject = { deploymentDeviceCount: devices.length ? devices.length : 0 };
Expand Down
9 changes: 7 additions & 2 deletions src/js/components/deployments/deployments.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@ import { Link, useNavigate } from 'react-router-dom';

import { Button, Tab, Tabs } from '@mui/material';

import { isUUID } from 'validator';

import { setSnackbar } from '../../actions/appActions';
import { abortDeployment, setDeploymentsState } from '../../actions/deploymentActions';
import { getDynamicGroups, getGroups } from '../../actions/deviceActions';
Expand Down Expand Up @@ -129,14 +131,17 @@ export const Deployments = () => {

const retryDeployment = (deployment, deploymentDeviceIds) => {
const { artifact_name, name, update_control_map = {} } = deployment;
const release = releases[artifact_name];
const release = releases[artifact_name] || { name: artifact_name };
const enterpriseSettings = isEnterprise
? {
phases: [{ batch_size: 100, start_ts: undefined, delay: 0 }],
update_control_map: { states: update_control_map.states || {} }
}
: {};
const targetDevicesConfig = name === ALL_DEVICES || groupsById[name] ? { group: name } : { devices: [devicesById[name]] };
const targetDevicesConfig =
name === ALL_DEVICES || groupsById[name]
? { group: name }
: { devices: isUUID(name) ? [devicesById[name]] : deploymentDeviceIds.map(id => devicesById[id] ?? { id }) };
const deploymentObject = {
deploymentDeviceIds,
release,
Expand Down

0 comments on commit 7bf5498

Please sign in to comment.