|
|
@ -8,8 +8,6 @@ import {withConfigContext} from "../../../../context/ConfigContext";
|
|
|
|
|
|
|
|
|
|
|
|
const {Title} = Typography;
|
|
|
|
const {Title} = Typography;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
class Release extends React.Component {
|
|
|
|
class Release extends React.Component {
|
|
|
|
routes;
|
|
|
|
routes;
|
|
|
|
|
|
|
|
|
|
|
@ -38,13 +36,13 @@ class Release extends React.Component {
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
changeCurrentLifecycleStatus = (status) =>{
|
|
|
|
changeCurrentLifecycleStatus = (status) => {
|
|
|
|
this.setState({
|
|
|
|
this.setState({
|
|
|
|
currentLifecycleStatus: status
|
|
|
|
currentLifecycleStatus: status
|
|
|
|
});
|
|
|
|
});
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
updateRelease = (release) =>{
|
|
|
|
updateRelease = (release) => {
|
|
|
|
this.setState({
|
|
|
|
this.setState({
|
|
|
|
release
|
|
|
|
release
|
|
|
|
});
|
|
|
|
});
|
|
|
@ -55,12 +53,12 @@ class Release extends React.Component {
|
|
|
|
|
|
|
|
|
|
|
|
//send request to the invoker
|
|
|
|
//send request to the invoker
|
|
|
|
axios.get(
|
|
|
|
axios.get(
|
|
|
|
window.location.origin+ config.serverConfig.invoker.uri + config.serverConfig.invoker.publisher + "/applications/release/"+ uuid,
|
|
|
|
window.location.origin + config.serverConfig.invoker.uri + config.serverConfig.invoker.publisher + "/applications/release/" + uuid,
|
|
|
|
).then(res => {
|
|
|
|
).then(res => {
|
|
|
|
if (res.status === 200) {
|
|
|
|
if (res.status === 200) {
|
|
|
|
const app = res.data.data;
|
|
|
|
const app = res.data.data;
|
|
|
|
const release = (app !== null) ? app.applicationReleases[0] : null;
|
|
|
|
const release = (app !== null) ? app.applicationReleases[0] : null;
|
|
|
|
const currentLifecycleStatus = (release!==null) ? release.currentStatus : null;
|
|
|
|
const currentLifecycleStatus = (release !== null) ? release.currentStatus : null;
|
|
|
|
this.setState({
|
|
|
|
this.setState({
|
|
|
|
app: app,
|
|
|
|
app: app,
|
|
|
|
release: release,
|
|
|
|
release: release,
|
|
|
@ -74,7 +72,7 @@ class Release extends React.Component {
|
|
|
|
if (error.hasOwnProperty("response") && error.response.status === 401) {
|
|
|
|
if (error.hasOwnProperty("response") && error.response.status === 401) {
|
|
|
|
//todo display a popop with error
|
|
|
|
//todo display a popop with error
|
|
|
|
message.error('You are not logged in');
|
|
|
|
message.error('You are not logged in');
|
|
|
|
window.location.href = window.location.origin+ '/publisher/login';
|
|
|
|
window.location.href = window.location.origin + '/publisher/login';
|
|
|
|
} else {
|
|
|
|
} else {
|
|
|
|
notification["error"]({
|
|
|
|
notification["error"]({
|
|
|
|
message: "There was a problem",
|
|
|
|
message: "There was a problem",
|
|
|
@ -92,7 +90,7 @@ class Release extends React.Component {
|
|
|
|
getLifecycle = () => {
|
|
|
|
getLifecycle = () => {
|
|
|
|
const config = this.props.context;
|
|
|
|
const config = this.props.context;
|
|
|
|
axios.get(
|
|
|
|
axios.get(
|
|
|
|
window.location.origin+ config.serverConfig.invoker.uri + config.serverConfig.invoker.publisher + "/applications/lifecycle-config"
|
|
|
|
window.location.origin + config.serverConfig.invoker.uri + config.serverConfig.invoker.publisher + "/applications/lifecycle-config"
|
|
|
|
).then(res => {
|
|
|
|
).then(res => {
|
|
|
|
if (res.status === 200) {
|
|
|
|
if (res.status === 200) {
|
|
|
|
const lifecycle = res.data.data;
|
|
|
|
const lifecycle = res.data.data;
|
|
|
@ -103,7 +101,7 @@ class Release extends React.Component {
|
|
|
|
|
|
|
|
|
|
|
|
}).catch(function (error) {
|
|
|
|
}).catch(function (error) {
|
|
|
|
if (error.hasOwnProperty("response") && error.response.status === 401) {
|
|
|
|
if (error.hasOwnProperty("response") && error.response.status === 401) {
|
|
|
|
window.location.href = window.location.origin+ '/publisher/login';
|
|
|
|
window.location.href = window.location.origin + '/publisher/login';
|
|
|
|
} else {
|
|
|
|
} else {
|
|
|
|
notification["error"]({
|
|
|
|
notification["error"]({
|
|
|
|
message: "There was a problem",
|
|
|
|
message: "There was a problem",
|
|
|
@ -135,8 +133,9 @@ class Release extends React.Component {
|
|
|
|
<Card>
|
|
|
|
<Card>
|
|
|
|
<ReleaseView
|
|
|
|
<ReleaseView
|
|
|
|
app={app}
|
|
|
|
app={app}
|
|
|
|
|
|
|
|
release={release}
|
|
|
|
currentLifecycleStatus={currentLifecycleStatus}
|
|
|
|
currentLifecycleStatus={currentLifecycleStatus}
|
|
|
|
lifecycle ={lifecycle}
|
|
|
|
lifecycle={lifecycle}
|
|
|
|
updateRelease={this.updateRelease}
|
|
|
|
updateRelease={this.updateRelease}
|
|
|
|
/>
|
|
|
|
/>
|
|
|
|
</Card>
|
|
|
|
</Card>
|
|
|
@ -147,7 +146,7 @@ class Release extends React.Component {
|
|
|
|
uuid={release.uuid}
|
|
|
|
uuid={release.uuid}
|
|
|
|
currentStatus={release.currentStatus.toUpperCase()}
|
|
|
|
currentStatus={release.currentStatus.toUpperCase()}
|
|
|
|
changeCurrentLifecycleStatus={this.changeCurrentLifecycleStatus}
|
|
|
|
changeCurrentLifecycleStatus={this.changeCurrentLifecycleStatus}
|
|
|
|
lifecycle ={lifecycle}
|
|
|
|
lifecycle={lifecycle}
|
|
|
|
/>
|
|
|
|
/>
|
|
|
|
</Card>
|
|
|
|
</Card>
|
|
|
|
</Col>
|
|
|
|
</Col>
|
|
|
|