Skip to content

Commit

Permalink
Merge pull request #4415 from mzedel/men-7261
Browse files Browse the repository at this point in the history
MEN-7261 - fix: cleaned up device deployment history to focus on the device instead of deployments
  • Loading branch information
mzedel authored May 21, 2024
2 parents c6de1ba + 77d0425 commit fab844b
Show file tree
Hide file tree
Showing 4 changed files with 118 additions and 142 deletions.
6 changes: 2 additions & 4 deletions src/js/actions/deploymentActions.js
Original file line number Diff line number Diff line change
Expand Up @@ -202,12 +202,11 @@ export const getDeploymentDevices =
};

const parseDeviceDeployment = ({
deployment: { id, artifact_name: release, groups = [], name, device: deploymentDevice, status: deploymentStatus },
deployment: { id, artifact_name: release, status: deploymentStatus },
device: { created, deleted, id: deviceId, finished, status, log }
}) => ({
id,
release,
target: groups.length === 1 && groups[0] ? groups[0] : deploymentDevice ? deploymentDevice : name,
created,
deleted,
deviceId,
Expand All @@ -219,8 +218,7 @@ const parseDeviceDeployment = ({
return states.includes(deploymentStatus) ? key : accu;
}
return accu;
}, ''),
deploymentStatus
}, '')
});

export const getDeviceDeployments =
Expand Down
8 changes: 2 additions & 6 deletions src/js/actions/deploymentActions.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -274,12 +274,10 @@ describe('deployment actions', () => {
{
id: defaultState.deployments.byId.d1.id,
release: defaultState.deployments.byId.d1.artifact_name,
target: defaultState.deployments.byId.d1.name,
created: '2019-01-01T12:35:00.000Z',
finished: '2019-01-01T12:40:00.000Z',
status: 'noartifact',
route: DeploymentConstants.DEPLOYMENT_ROUTES.active.key,
deploymentStatus: 'inprogress'
route: DeploymentConstants.DEPLOYMENT_ROUTES.active.key
}
]
}
Expand All @@ -302,12 +300,10 @@ describe('deployment actions', () => {
{
id: defaultState.deployments.byId.d1.id,
release: defaultState.deployments.byId.d1.artifact_name,
target: defaultState.deployments.byId.d1.name,
created: '2019-01-01T12:35:00.000Z',
finished: '2019-01-01T12:40:00.000Z',
status: 'noartifact',
route: DeploymentConstants.DEPLOYMENT_ROUTES.active.key,
deploymentStatus: 'inprogress'
route: DeploymentConstants.DEPLOYMENT_ROUTES.active.key
}
]
}
Expand Down
Loading

0 comments on commit fab844b

Please sign in to comment.