|
|
@ -27,6 +27,7 @@ import {
|
|
|
|
Steps,
|
|
|
|
Steps,
|
|
|
|
Alert,
|
|
|
|
Alert,
|
|
|
|
Tabs,
|
|
|
|
Tabs,
|
|
|
|
|
|
|
|
Tooltip,
|
|
|
|
} from 'antd';
|
|
|
|
} from 'antd';
|
|
|
|
import axios from 'axios';
|
|
|
|
import axios from 'axios';
|
|
|
|
import ReactQuill from 'react-quill';
|
|
|
|
import ReactQuill from 'react-quill';
|
|
|
@ -198,6 +199,35 @@ class LifeCycle extends React.Component {
|
|
|
|
this.setState({ current });
|
|
|
|
this.setState({ current });
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/*
|
|
|
|
|
|
|
|
Function to check if the same app releases are in published
|
|
|
|
|
|
|
|
state or not and assigned a boolean value to disable
|
|
|
|
|
|
|
|
the publish button if an app release is already published
|
|
|
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
checkReleaseLifeCycleStatus = (proceedingStates, lifecycleState) => {
|
|
|
|
|
|
|
|
if (typeof this.props.appReleases !== 'undefined') {
|
|
|
|
|
|
|
|
const currentAppUUID = this.props.uuid;
|
|
|
|
|
|
|
|
let appReleases = this.props.appReleases.fullAppDetails;
|
|
|
|
|
|
|
|
let appRelease;
|
|
|
|
|
|
|
|
let isPublished;
|
|
|
|
|
|
|
|
for (let i = 0; i < appReleases.length; i++) {
|
|
|
|
|
|
|
|
appRelease = appReleases[i];
|
|
|
|
|
|
|
|
if (
|
|
|
|
|
|
|
|
currentAppUUID !== appRelease.uuid &&
|
|
|
|
|
|
|
|
appRelease.currentStatus === 'PUBLISHED' &&
|
|
|
|
|
|
|
|
proceedingStates.includes('PUBLISHED') &&
|
|
|
|
|
|
|
|
lifecycleState === 'PUBLISHED'
|
|
|
|
|
|
|
|
) {
|
|
|
|
|
|
|
|
isPublished = true;
|
|
|
|
|
|
|
|
return isPublished;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
isPublished = false;
|
|
|
|
|
|
|
|
return isPublished;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
return false;
|
|
|
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
render() {
|
|
|
|
render() {
|
|
|
|
const {
|
|
|
|
const {
|
|
|
|
currentStatus,
|
|
|
|
currentStatus,
|
|
|
@ -207,6 +237,7 @@ class LifeCycle extends React.Component {
|
|
|
|
lifeCycleStates,
|
|
|
|
lifeCycleStates,
|
|
|
|
} = this.state;
|
|
|
|
} = this.state;
|
|
|
|
const { lifecycle } = this.props;
|
|
|
|
const { lifecycle } = this.props;
|
|
|
|
|
|
|
|
const text = <span>Already an app is in publish state</span>;
|
|
|
|
let proceedingStates = [];
|
|
|
|
let proceedingStates = [];
|
|
|
|
if (
|
|
|
|
if (
|
|
|
|
lifecycle !== null &&
|
|
|
|
lifecycle !== null &&
|
|
|
@ -247,9 +278,24 @@ class LifeCycle extends React.Component {
|
|
|
|
<p>{step.text}</p>
|
|
|
|
<p>{step.text}</p>
|
|
|
|
{proceedingStates.map(lifecycleState => {
|
|
|
|
{proceedingStates.map(lifecycleState => {
|
|
|
|
return (
|
|
|
|
return (
|
|
|
|
|
|
|
|
// eslint-disable-next-line react/jsx-key
|
|
|
|
|
|
|
|
<Tooltip
|
|
|
|
|
|
|
|
title={
|
|
|
|
|
|
|
|
this.checkReleaseLifeCycleStatus(
|
|
|
|
|
|
|
|
proceedingStates,
|
|
|
|
|
|
|
|
lifecycleState,
|
|
|
|
|
|
|
|
) === true
|
|
|
|
|
|
|
|
? text
|
|
|
|
|
|
|
|
: ''
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
>
|
|
|
|
<Button
|
|
|
|
<Button
|
|
|
|
size={'small'}
|
|
|
|
size={'small'}
|
|
|
|
style={{ marginRight: 3 }}
|
|
|
|
style={{ marginRight: 3 }}
|
|
|
|
|
|
|
|
disabled={this.checkReleaseLifeCycleStatus(
|
|
|
|
|
|
|
|
proceedingStates,
|
|
|
|
|
|
|
|
lifecycleState,
|
|
|
|
|
|
|
|
)}
|
|
|
|
onClick={() =>
|
|
|
|
onClick={() =>
|
|
|
|
this.showReasonModal(lifecycleState)
|
|
|
|
this.showReasonModal(lifecycleState)
|
|
|
|
}
|
|
|
|
}
|
|
|
@ -258,6 +304,7 @@ class LifeCycle extends React.Component {
|
|
|
|
>
|
|
|
|
>
|
|
|
|
{lifecycleState}
|
|
|
|
{lifecycleState}
|
|
|
|
</Button>
|
|
|
|
</Button>
|
|
|
|
|
|
|
|
</Tooltip>
|
|
|
|
);
|
|
|
|
);
|
|
|
|
})}
|
|
|
|
})}
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|