Browse Source

开始即查询步骤

xy 7 years ago
parent
commit
ad4717937e
2 changed files with 364 additions and 299 deletions
  1. 358 299
      src/app/common/deploy/tencent/TencentConfig.js
  2. 6 0
      src/gql.js

+ 358 - 299
src/app/common/deploy/tencent/TencentConfig.js

@@ -7,11 +7,11 @@ import DeployCard from './DeployCard';
 import NotificationCard from './NotificationCard';
 
 import {SHOW_APIGWPATH, GET_PROJECT} from "../../../../gql";
-import {deployUrl} from "../../../../config";
+import {deployUrl, graphqlUrl} from "../../../../config";
 import {FormattedMessage} from 'react-intl';
 import gql from "graphql-tag";
 import {Query} from "react-apollo";
-
+import {request} from 'graphql-request'
 const Step = Steps.Step;
 
 class TencentConfig extends Component {
@@ -23,11 +23,65 @@ class TencentConfig extends Component {
             deployIdPassToPath: '',
             groupIdPassToPath: '',
             pathIdPassToConfig: '',
-            currentStep: 0,
+            currentStep: '',
+            stepAllShow: false,
             deploying: ''
         };
     }
 
+    componentWillMount() {
+        let projectID = this.props.projectID ? this.props.projectID : 'ecommerce_projectID';
+
+        request(graphqlUrl, GET_PROJECT, {id: projectID}).then(
+            data => {
+                let dataProject = data.project_by_id;
+                if (dataProject !== null) {
+                    switch(dataProject.projectStatus) {
+                        case 'deployed':
+                            this.setState({
+                                currentStep: 5,
+                                stepAllShow: true
+                            });
+                            break;
+                        case 'notificationed':
+                            this.setState({
+                                currentStep: 4
+                            });
+                            break;
+                        case 'pathed':
+                            this.setState({
+                                currentStep: 3
+                            });
+                            break;
+                        case 'grouped':
+                            this.setState({
+                                currentStep: 2
+                            });
+                            break;
+                        case 'functioned':
+                            this.setState({
+                                currentStep: 1
+                            });
+                            break;
+                        case 'created':
+                            this.setState({
+                                currentStep: 0
+                            });
+                            break;
+                        default:
+                            this.setState({
+                                currentStep: 0
+                            });
+                            break;
+                    }
+                    console.log(dataProject.projectStatus);
+                } else {
+                    console.log('peoject 没存 status');
+                }
+            }
+        )
+    }
+
     componentWillReceiveProps(next) {
         this.setState({
             couldDeploy: false,
@@ -35,7 +89,8 @@ class TencentConfig extends Component {
             deployIdPassToPath: '',
             groupIdPassToPath: '',
             currentStep: 0,
-            deploying: ''
+            deploying: '',
+            stepAllShow: false,
         });
     }
 
@@ -139,7 +194,7 @@ class TencentConfig extends Component {
 
                         let dataProject = data.project_by_id;
                         let {cloud_id, apiGWGroup_id, deploy_id, projectType, schema_id, wxConfig_id, projectName} = dataProject;
-                        console.log('dataProject', dataProject);
+                        // console.log('dataProject', dataProject);
 
                         let defaultName = projectName;
 
@@ -155,327 +210,331 @@ class TencentConfig extends Component {
                             group = apiGWGroup_id;
                             deploy = deploy_id;
                             cloudID = cloud_id.id;
+                        }
 
-                            return (
-                                <div>
-                                    {
-                                        projectType === 'graphql' ?
-                                            schema_id.schemaState === 'ok' ?
+                        return (
+                            <div>
+                                {
+                                    projectType === 'graphql' ?
+                                        schema_id.schemaState === 'ok' ?
+                                            ''
+                                            :
+                                            this.props.trialcase ?
                                                 ''
                                                 :
-                                                this.props.trialcase ?
+                                                <div style={{marginBottom: 10}}>
+                                                    <Alert message="数据表结构不符合规范,暂不能部署,请修改" type="warning"
+                                                           banner closable/>
+                                                </div>
+                                        :
+                                        ''
+                                }
+                                <div style={{padding: '30px'}}>
+                                    <Row gutter={16}>
+                                        <Col span={14}>
+
+                                            {
+                                                this.state.currentStep !== ''?
+                                                    <Steps current={this.state.currentStep} style={{marginBottom: 30}}>
+                                                        <Step title={this.stepStatus(0)} description="云函数配置"/>
+                                                        <Step title={this.stepStatus(1)} description="服务配置"/>
+                                                        <Step title={this.stepStatus(2)} description="API 配置"/>
+                                                        <Step title={this.stepStatus(3)} description="通知配置"/>
+                                                    </Steps>
+                                                    :
                                                     ''
+                                            }
+
+                                            {
+                                                this.state.currentStep === 0 || this.state.stepAllShow?
+                                                    <FormattedMessage id="fc Deploy">
+                                                        {
+                                                            msg =>
+                                                                <Card title={msg} style={{marginBottom: 10}}>
+                                                                    <DeployCard
+                                                                        deploy={deploy}
+                                                                        switchRegion={this.switchRegion}
+                                                                        region={this.state.region}
+                                                                        defalutName={defaultName}
+                                                                        userID={this.props.userID}
+                                                                        cloudID={cloudID}
+                                                                        trialcase={this.props.trialcase}
+                                                                        pass={this.pass}
+                                                                        stepByStep={this.stepByStep}
+                                                                        projectID={projectID}
+                                                                    />
+                                                                </Card>
+                                                        }
+                                                    </FormattedMessage>
                                                     :
-                                                    <div style={{marginBottom: 10}}>
-                                                        <Alert message="数据表结构不符合规范,暂不能部署,请修改" type="warning"
-                                                               banner closable/>
-                                                    </div>
-                                            :
-                                            ''
-                                    }
-                                    <div style={{padding: '30px'}}>
-                                        <Row gutter={16}>
-                                            <Col span={14}>
-                                                <FormattedMessage id="fc Deploy">
-                                                    {
-                                                        msg =>
-                                                            <Card title={msg} style={{marginBottom: 10}}>
-                                                                <DeployCard
-                                                                    deploy={deploy}
-                                                                    switchRegion={this.switchRegion}
-                                                                    region={this.state.region}
-                                                                    defalutName={defaultName}
-                                                                    userID={this.props.userID}
-                                                                    cloudID={cloudID}
-                                                                    trialcase={this.props.trialcase}
-                                                                    pass={this.pass}
-                                                                    projectID={projectID}
-                                                                    stepByStep={this.stepByStep}
-                                                                />
-                                                            </Card>
-                                                    }
-                                                </FormattedMessage>
-                                                <FormattedMessage id="API Group">
-                                                    {
-                                                        msg =>
-                                                            <Card title={msg} style={{marginBottom: 10}}>
-                                                                <APIGroupCard
-                                                                    group={group}
-                                                                    userID={this.props.userID}
-                                                                    switchRegion={this.switchRegion}
-                                                                    region={this.state.region}
-                                                                    cloudID={cloudID}
-                                                                    trialcase={this.props.trialcase}
-                                                                    pass={this.pass}
-                                                                    projectID={projectID}
-                                                                    stepByStep={this.stepByStep}
-                                                                />
-                                                            </Card>
-                                                    }
-                                                </FormattedMessage>
-                                                <Query query={gql(SHOW_APIGWPATH)}
-                                                       variables={{apiGWGroup_id: apiGWGroup_id ? apiGWGroup_id.id : ''}}>
-                                                    {
-                                                        ({loading, error, data}) => {
-                                                            if (loading) {
-                                                                return <Spin style={{marginLeft: 3}}/>
-                                                            }
-                                                            if (error) {
-                                                                return 'error!';
+                                                    ''
+                                            }
+
+                                            {
+                                                this.state.currentStep === 1 || this.state.stepAllShow?
+                                                    <FormattedMessage id="API Group">
+                                                        {
+                                                            msg =>
+                                                                <Card title={msg} style={{marginBottom: 10}}>
+                                                                    <APIGroupCard
+                                                                        group={group}
+                                                                        userID={this.props.userID}
+                                                                        switchRegion={this.switchRegion}
+                                                                        region={this.state.region}
+                                                                        cloudID={cloudID}
+                                                                        trialcase={this.props.trialcase}
+                                                                        pass={this.pass}
+                                                                        stepByStep={this.stepByStep}
+                                                                        projectID={projectID}
+                                                                    />
+                                                                </Card>
+                                                        }
+                                                    </FormattedMessage>
+                                                    :
+                                                    ''
+                                            }
+                                            {
+                                                this.state.currentStep === 2 || this.state.stepAllShow?
+                                                    <Query query={gql(SHOW_APIGWPATH)}
+                                                           variables={{apiGWGroup_id: apiGWGroup_id ? apiGWGroup_id.id : ''}}>
+                                                        {
+                                                            ({loading, error, data}) => {
+                                                                if (loading) {
+                                                                    return <Spin style={{marginLeft: 3}}/>
+                                                                }
+                                                                if (error) {
+                                                                    return 'error!';
+                                                                }
+                                                                if (data.apiGWPath_by_props.length > 0)
+                                                                    path = data.apiGWPath_by_props[0];
+                                                                return (
+                                                                    <FormattedMessage id="API Path">
+                                                                        {
+                                                                            msg =>
+                                                                                <Card title={msg}
+                                                                                      style={{marginBottom: 10}}>
+                                                                                    <APIPathCard
+                                                                                        path={path}
+                                                                                        defalutName={defaultName}
+                                                                                        userID={this.props.userID}
+                                                                                        trialcase={this.props.trialcase}
+                                                                                        deployID={deploy ? deploy.id : this.state.deployIdPassToPath}
+                                                                                        groupID={group ? group.id : this.state.groupIdPassToPath}
+                                                                                        pass={this.pass}
+                                                                                        stepByStep={this.stepByStep}
+                                                                                    />
+                                                                                </Card>
+                                                                        }
+                                                                    </FormattedMessage>
+                                                                )
                                                             }
-                                                            if (data.apiGWPath_by_props.length > 0)
-                                                                path = data.apiGWPath_by_props[0];
-                                                            return (
-                                                                <FormattedMessage id="API Path">
-                                                                    {
-                                                                        msg =>
-                                                                            <Card title={msg}
-                                                                                  style={{marginBottom: 10}}>
-                                                                                <APIPathCard
-                                                                                    path={path}
-                                                                                    defalutName={defaultName}
-                                                                                    userID={this.props.userID}
-                                                                                    trialcase={this.props.trialcase}
-                                                                                    deployID={deploy ? deploy.id : this.state.deployIdPassToPath}
-                                                                                    groupID={group ? group.id : this.state.groupIdPassToPath}
-                                                                                    pass={this.pass}
-                                                                                    stepByStep={this.stepByStep}
-                                                                                />
-                                                                            </Card>
-                                                                    }
-                                                                </FormattedMessage>
-                                                            )
                                                         }
-                                                    }
-                                                </Query>
-                                                <FormattedMessage id="Notification">
+                                                    </Query>
+                                                    :
+                                                    ''
+                                            }
+
+                                            {
+                                                this.state.currentStep === 3 || this.state.stepAllShow?
+                                                    <FormattedMessage id="Notification">
+                                                        {
+                                                            msg =>
+                                                                <Card title={msg}>
+                                                                    <NotificationCard
+                                                                        userID={this.props.userID}
+                                                                        defalutName={defaultName}
+                                                                        trialcase={this.props.trialcase}
+                                                                        stepByStep={this.stepByStep}
+                                                                        projectID={projectID}
+                                                                    />
+                                                                </Card>
+                                                        }
+                                                    </FormattedMessage>
+                                                    :
+                                                    ''
+                                            }
+
+                                        </Col>
+
+                                        {
+                                            this.state.currentStep === 4 || this.state.stepAllShow?
+                                                <Col offset={2} span={6}>
                                                     {
-                                                        msg =>
-                                                            <Card title={msg}>
-                                                                <NotificationCard
-                                                                    userID={this.props.userID}
-                                                                    defalutName={defaultName}
-                                                                    trialcase={this.props.trialcase}
-                                                                    projectID={projectID}
-                                                                    stepByStep={this.stepByStep}
-                                                                />
-                                                            </Card>
-                                                    }
-                                                </FormattedMessage>
-                                            </Col>
-                                            <Col offset={2} span={6}>
-                                                {
-                                                    this.props.trialcase ?
-                                                        ''
-                                                        :
-                                                        projectType === 'graphql' ?
-                                                            schema_id.schemaState === 'ok' ?
-                                                                <Button type='primary'
-                                                                        onClick={() => this.deployFC(schemaID, deploy ? deploy.id : this.state.deployIdPassToPath, this.state.pathIdPassToConfig, group ? group.id : this.state.groupIdPassToPath)}><FormattedMessage
-                                                                    id="deploy"/>!</Button>
-                                                                :
-                                                                <Button type='primary' disabled><FormattedMessage
-                                                                    id="deploy"/>!</Button>
+                                                        this.props.trialcase ?
+                                                            ''
                                                             :
-                                                            <Button type='primary' onClick={() => {
-                                                            }}><FormattedMessage id="deploy"/>!</Button>
 
-                                                }
-                                            </Col>
-                                        </Row>
-                                    </div>
-                                </div>
-                            )
+                                                            projectType === 'graphql' ?
 
-                        } else {
+                                                                schema_id.schemaState === 'ok' ?
 
-                            return (
-                                <div>
-                                    {
-                                        projectType === 'graphql' ?
-                                            schema_id.schemaState === 'ok' ?
-                                                ''
+                                                                        this.state.deploying === '' ?
+                                                                            <Button type='primary' onClick={() => this.deployFC(schemaID, deploy ? deploy.id : this.state.deployIdPassToPath, this.state.pathIdPassToConfig, group ? group.id : this.state.groupIdPassToPath)}><FormattedMessage id="deploy"/>!</Button>
+                                                                            :
+                                                                            ''
+                                                                    :
+                                                                    <Button type='primary'
+                                                                            disabled><FormattedMessage
+                                                                        id="deploy"/>!</Button>
+                                                                :
+                                                                <Button type='primary' onClick={() => {
+                                                                }}><FormattedMessage id="deploy"/>!</Button>
+
+                                                    }
+                                                    {
+                                                        this.state.deploying === 'deploying' ?
+                                                            <Spin size="large"/>
+                                                            :
+                                                            this.state.deploying === 'finished' ?
+                                                                <Progress type="circle" percent={100} />
+                                                                :
+                                                                this.state.deploying === 'error' ?
+                                                                    <Progress type="circle" percent={99} status="exception" />
+                                                                    :
+                                                                    ''
+
+                                                    }
+                                                </Col>
                                                 :
-                                                this.props.trialcase ?
-                                                    ''
-                                                    :
-                                                    <div style={{marginBottom: 10}}>
-                                                        <Alert message="数据表结构不符合规范,暂不能部署,请修改" type="warning"
-                                                               banner closable/>
-                                                    </div>
-                                            :
-                                            ''
-                                    }
-                                    <div style={{padding: '30px'}}>
-                                        <Row gutter={16}>
-                                            <Col span={14}>
-
-                                                <Steps current={this.state.currentStep} style={{marginBottom: 30}}>
-                                                    <Step title={this.stepStatus(0)} description="云函数配置"/>
-                                                    <Step title={this.stepStatus(1)} description="服务配置"/>
-                                                    <Step title={this.stepStatus(2)} description="API 配置"/>
-                                                    <Step title={this.stepStatus(3)} description="通知配置"/>
-                                                </Steps>
+                                                ''
+                                        }
 
+                                    </Row>
+                                </div>
+                            </div>
+                        );
+
+                        // no use, backup code
+                        return (
+                            <div>
+                                {
+                                    projectType === 'graphql' ?
+                                        schema_id.schemaState === 'ok' ?
+                                            ''
+                                            :
+                                            this.props.trialcase ?
+                                                ''
+                                                :
+                                                <div style={{marginBottom: 10}}>
+                                                    <Alert message="数据表结构不符合规范,暂不能部署,请修改" type="warning"
+                                                           banner closable/>
+                                                </div>
+                                        :
+                                        ''
+                                }
+                                <div style={{padding: '30px'}}>
+                                    <Row gutter={16}>
+                                        <Col span={14}>
+                                            <FormattedMessage id="fc Deploy">
                                                 {
-                                                    this.state.currentStep === 0 ?
-                                                        <FormattedMessage id="fc Deploy">
-                                                            {
-                                                                msg =>
-                                                                    <Card title={msg} style={{marginBottom: 10}}>
-                                                                        <DeployCard
-                                                                            deploy={deploy}
-                                                                            switchRegion={this.switchRegion}
-                                                                            region={this.state.region}
-                                                                            defalutName={defaultName}
-                                                                            userID={this.props.userID}
-                                                                            cloudID={cloudID}
-                                                                            trialcase={this.props.trialcase}
-                                                                            pass={this.pass}
-                                                                            stepByStep={this.stepByStep}
-                                                                            projectID={projectID}
-                                                                        />
-                                                                    </Card>
-                                                            }
-                                                        </FormattedMessage>
-                                                        :
-                                                        ''
+                                                    msg =>
+                                                        <Card title={msg} style={{marginBottom: 10}}>
+                                                            <DeployCard
+                                                                deploy={deploy}
+                                                                switchRegion={this.switchRegion}
+                                                                region={this.state.region}
+                                                                defalutName={defaultName}
+                                                                userID={this.props.userID}
+                                                                cloudID={cloudID}
+                                                                trialcase={this.props.trialcase}
+                                                                pass={this.pass}
+                                                                projectID={projectID}
+                                                                stepByStep={this.stepByStep}
+                                                            />
+                                                        </Card>
                                                 }
-
+                                            </FormattedMessage>
+                                            <FormattedMessage id="API Group">
                                                 {
-                                                    this.state.currentStep === 1 ?
-                                                        <FormattedMessage id="API Group">
-                                                            {
-                                                                msg =>
-                                                                    <Card title={msg} style={{marginBottom: 10}}>
-                                                                        <APIGroupCard
-                                                                            group={group}
-                                                                            userID={this.props.userID}
-                                                                            switchRegion={this.switchRegion}
-                                                                            region={this.state.region}
-                                                                            cloudID={cloudID}
-                                                                            trialcase={this.props.trialcase}
-                                                                            pass={this.pass}
-                                                                            stepByStep={this.stepByStep}
-                                                                            projectID={projectID}
-                                                                        />
-                                                                    </Card>
-                                                            }
-                                                        </FormattedMessage>
-                                                        :
-                                                        ''
+                                                    msg =>
+                                                        <Card title={msg} style={{marginBottom: 10}}>
+                                                            <APIGroupCard
+                                                                group={group}
+                                                                userID={this.props.userID}
+                                                                switchRegion={this.switchRegion}
+                                                                region={this.state.region}
+                                                                cloudID={cloudID}
+                                                                trialcase={this.props.trialcase}
+                                                                pass={this.pass}
+                                                                projectID={projectID}
+                                                                stepByStep={this.stepByStep}
+                                                            />
+                                                        </Card>
                                                 }
+                                            </FormattedMessage>
+                                            <Query query={gql(SHOW_APIGWPATH)}
+                                                   variables={{apiGWGroup_id: apiGWGroup_id ? apiGWGroup_id.id : ''}}>
                                                 {
-                                                    this.state.currentStep === 2 ?
-                                                        <Query query={gql(SHOW_APIGWPATH)}
-                                                               variables={{apiGWGroup_id: apiGWGroup_id ? apiGWGroup_id.id : ''}}>
-                                                            {
-                                                                ({loading, error, data}) => {
-                                                                    if (loading) {
-                                                                        return <Spin style={{marginLeft: 3}}/>
-                                                                    }
-                                                                    if (error) {
-                                                                        return 'error!';
-                                                                    }
-                                                                    if (data.apiGWPath_by_props.length > 0)
-                                                                        path = data.apiGWPath_by_props[0];
-                                                                    return (
-                                                                        <FormattedMessage id="API Path">
-                                                                            {
-                                                                                msg =>
-                                                                                    <Card title={msg}
-                                                                                          style={{marginBottom: 10}}>
-                                                                                        <APIPathCard
-                                                                                            path={path}
-                                                                                            defalutName={defaultName}
-                                                                                            userID={this.props.userID}
-                                                                                            trialcase={this.props.trialcase}
-                                                                                            deployID={deploy ? deploy.id : this.state.deployIdPassToPath}
-                                                                                            groupID={group ? group.id : this.state.groupIdPassToPath}
-                                                                                            pass={this.pass}
-                                                                                            stepByStep={this.stepByStep}
-                                                                                        />
-                                                                                    </Card>
-                                                                            }
-                                                                        </FormattedMessage>
-                                                                    )
+                                                    ({loading, error, data}) => {
+                                                        if (loading) {
+                                                            return <Spin style={{marginLeft: 3}}/>
+                                                        }
+                                                        if (error) {
+                                                            return 'error!';
+                                                        }
+                                                        if (data.apiGWPath_by_props.length > 0)
+                                                            path = data.apiGWPath_by_props[0];
+                                                        return (
+                                                            <FormattedMessage id="API Path">
+                                                                {
+                                                                    msg =>
+                                                                        <Card title={msg}
+                                                                              style={{marginBottom: 10}}>
+                                                                            <APIPathCard
+                                                                                path={path}
+                                                                                defalutName={defaultName}
+                                                                                userID={this.props.userID}
+                                                                                trialcase={this.props.trialcase}
+                                                                                deployID={deploy ? deploy.id : this.state.deployIdPassToPath}
+                                                                                groupID={group ? group.id : this.state.groupIdPassToPath}
+                                                                                pass={this.pass}
+                                                                                stepByStep={this.stepByStep}
+                                                                            />
+                                                                        </Card>
                                                                 }
-                                                            }
-                                                        </Query>
-                                                        :
-                                                        ''
+                                                            </FormattedMessage>
+                                                        )
+                                                    }
                                                 }
-
+                                            </Query>
+                                            <FormattedMessage id="Notification">
                                                 {
-                                                    this.state.currentStep === 3 ?
-                                                        <FormattedMessage id="Notification">
-                                                            {
-                                                                msg =>
-                                                                    <Card title={msg}>
-                                                                        <NotificationCard
-                                                                            userID={this.props.userID}
-                                                                            defalutName={defaultName}
-                                                                            trialcase={this.props.trialcase}
-                                                                            stepByStep={this.stepByStep}
-                                                                            projectID={projectID}
-                                                                        />
-                                                                    </Card>
-                                                            }
-                                                        </FormattedMessage>
-                                                        :
-                                                        ''
+                                                    msg =>
+                                                        <Card title={msg}>
+                                                            <NotificationCard
+                                                                userID={this.props.userID}
+                                                                defalutName={defaultName}
+                                                                trialcase={this.props.trialcase}
+                                                                projectID={projectID}
+                                                                stepByStep={this.stepByStep}
+                                                            />
+                                                        </Card>
                                                 }
-
-                                            </Col>
-
+                                            </FormattedMessage>
+                                        </Col>
+                                        <Col offset={2} span={6}>
                                             {
-                                                this.state.currentStep === 4 ?
-                                                    <Col offset={2} span={6}>
-                                                        {
-                                                            this.props.trialcase ?
-                                                                ''
-                                                                :
-
-                                                                projectType === 'graphql' ?
-
-                                                                    schema_id.schemaState === 'ok' ?
-
-                                                                            this.state.deploying === '' ?
-                                                                                <Button type='primary' onClick={() => this.deployFC(schemaID, deploy ? deploy.id : this.state.deployIdPassToPath, this.state.pathIdPassToConfig, group ? group.id : this.state.groupIdPassToPath)}><FormattedMessage id="deploy"/>!</Button>
-                                                                                :
-                                                                                ''
-                                                                        :
-                                                                        <Button type='primary'
-                                                                                disabled><FormattedMessage
-                                                                            id="deploy"/>!</Button>
-                                                                    :
-                                                                    <Button type='primary' onClick={() => {
-                                                                    }}><FormattedMessage id="deploy"/>!</Button>
-
-                                                        }
-                                                        {
-                                                            this.state.deploying === 'deploying' ?
-                                                                <Spin size="large"/>
-                                                                :
-                                                                this.state.deploying === 'finished' ?
-                                                                    <Progress type="circle" percent={100} />
-                                                                    :
-                                                                    this.state.deploying === 'error' ?
-                                                                        <Progress type="circle" percent={99} status="exception" />
-                                                                        :
-                                                                        ''
-
-                                                        }
-                                                    </Col>
-                                                    :
+                                                this.props.trialcase ?
                                                     ''
-                                            }
+                                                    :
+                                                    projectType === 'graphql' ?
+                                                        schema_id.schemaState === 'ok' ?
+                                                            <Button type='primary'
+                                                                    onClick={() => this.deployFC(schemaID, deploy ? deploy.id : this.state.deployIdPassToPath, this.state.pathIdPassToConfig, group ? group.id : this.state.groupIdPassToPath)}><FormattedMessage
+                                                                id="deploy"/>!</Button>
+                                                            :
+                                                            <Button type='primary' disabled><FormattedMessage
+                                                                id="deploy"/>!</Button>
+                                                        :
+                                                        <Button type='primary' onClick={() => {
+                                                        }}><FormattedMessage id="deploy"/>!</Button>
 
-                                        </Row>
-                                    </div>
+                                            }
+                                        </Col>
+                                    </Row>
                                 </div>
-                            )
-                        }
+                            </div>
+                        )
                     }
                 }
             </Query>

+ 6 - 0
src/gql.js

@@ -785,6 +785,7 @@ const GET_PROJECT = `
             query projectbyid($id: ID) {
                 project_by_id(id: $id) {
                     updatedAt
+                    projectStatus
                     database_id {
                         id
                     }
@@ -865,6 +866,7 @@ const GET_PROJECT = `
 const UPDATE_PROJECT_GROUP = `
             mutation updateproject($id: ID, $updatedAt: String, $apiGWGroup_id: ID) {
               update_project(id: $id updatedAt: $updatedAt apiGWGroup_id: $apiGWGroup_id) {
+                projectStatus
                 updatedAt
                 projectName
                 id
@@ -876,6 +878,7 @@ const UPDATE_PROJECT_GROUP = `
 const UPDATE_PROJECT_DEPLOY = `
             mutation updateproject($id: ID, $updatedAt: String, $deploy_id: ID) {
               update_project(id: $id updatedAt: $updatedAt deploy_id: $deploy_id) {
+                projectStatus
                 updatedAt
                 projectName
                 id
@@ -887,6 +890,7 @@ const UPDATE_PROJECT_DEPLOY = `
 const UPDATE_PROJECT_CLOUD = `
             mutation updateproject($id: ID, $updatedAt: String, $cloud_id: ID) {
               update_project(id: $id updatedAt: $updatedAt cloud_id: $cloud_id) {
+                projectStatus
                 updatedAt
                 projectName
                 id
@@ -898,6 +902,7 @@ const UPDATE_PROJECT_CLOUD = `
 const UPDATE_PROJECT_DATABASE = `
             mutation updateproject($id: ID, $updatedAt: String, $database_id: ID) {
               update_project(id: $id updatedAt: $updatedAt database_id: $database_id) {
+                projectStatus
                 updatedAt
                 projectName
                 id
@@ -909,6 +914,7 @@ const UPDATE_PROJECT_DATABASE = `
 const UPDATE_PROJECT_DEPLOY_AND_CLOUD = `
             mutation updateproject($id: ID, $updatedAt: String, $deploy_id: ID, $cloud_id: ID) {
               update_project(id: $id updatedAt: $updatedAt deploy_id: $deploy_id cloud_id: $cloud_id) {
+                projectStatus
                 updatedAt
                 projectName
                 id