2019-03-13 07:55:56 -04:00
|
|
|
/**
|
|
|
|
* @param {Object} environment
|
|
|
|
* @returns {Object}
|
|
|
|
*/
|
2021-01-05 13:10:25 -05:00
|
|
|
export const setDeployBoard = (oldEnvironmentState, environment) => {
|
|
|
|
let parsedEnvironment = environment;
|
|
|
|
if (environment.size === 1 && environment.rollout_status) {
|
|
|
|
parsedEnvironment = {
|
|
|
|
...environment,
|
|
|
|
hasDeployBoard: true,
|
|
|
|
isDeployBoardVisible:
|
|
|
|
oldEnvironmentState.isDeployBoardVisible === false
|
|
|
|
? oldEnvironmentState.isDeployBoardVisible
|
|
|
|
: true,
|
|
|
|
deployBoardData:
|
|
|
|
environment.rollout_status.status === 'found' ? environment.rollout_status : {},
|
|
|
|
isLoadingDeployBoard: environment.rollout_status.status === 'loading',
|
|
|
|
isEmptyDeployBoard: environment.rollout_status.status === 'not_found',
|
|
|
|
};
|
|
|
|
}
|
|
|
|
return parsedEnvironment;
|
|
|
|
};
|