debian-mirror-gitlab/app/assets/javascripts/environments/stores/helpers.js

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

23 lines
772 B
JavaScript
Raw Normal View History

2019-07-07 11:18:12 +05:30
/**
* @param {Object} environment
* @returns {Object}
*/
2021-03-08 18:12:59 +05:30
export const setDeployBoard = (oldEnvironmentState, environment) => {
let parsedEnvironment = environment;
2021-06-08 01:23:25 +05:30
if (!environment.isFolder && environment.rollout_status) {
2021-03-08 18:12:59 +05:30
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;
};