Explorar o código

连接 sidebar 和 deploy

xy %!s(int64=7) %!d(string=hai) anos
pai
achega
9bbee258ea

+ 2 - 2
src/app/App.jsx

@@ -361,9 +361,9 @@ class GraphqlSidebar extends Component {
             <Query query={gql(CASE_SCHEMA_AND_PROJECT)} variables={{projectType:'graphql',user_id: this.state.userID}}>
                 {
                     ({loading, error, data}) => {
-                        // console.log('CASE_SCHEMA_AND_PROJECT data', data);
                         if (loading) return <Spin style={{marginLeft: 3}}/>;
                         if (error) return 'error!';
+                        // console.log('CASE_SCHEMA_AND_PROJECT data', data);
                         localStorage.setItem('ecommerce', data.caseSchema.find(obj => obj.schemaName === 'ecommerce').schemaData);
                         localStorage.setItem('subscribe', data.caseSchema.find(obj => obj.schemaName === 'subscribe').schemaData);
                         localStorage.setItem('bills', data.caseSchema.find(obj => obj.schemaName === 'bills').schemaData);
@@ -425,7 +425,7 @@ class GraphqlSidebar extends Component {
                                                     state: {
                                                         schemaName: project.projectName,
                                                         schemaID: project.schema_id.id,
-                                                        projectId: project.id
+                                                        projectID: project.id
                                                     }
                                                 }}>{project.projectName}</Link>
                                             </Menu.Item>)

+ 2 - 4
src/app/common/deploy/Deploy.jsx

@@ -29,9 +29,7 @@ class Deploy extends Component {
     constructor(props) {
         super(props);
         this.state = {
-            cloud: 'tencent',
-            projectIDOK: 'project_by_mxy_already_deploy',
-            projectIDNULL: 'project_by_mxy_not_deploy'
+            cloud: 'tencent'
         };
     }
 
@@ -43,7 +41,7 @@ class Deploy extends Component {
 
     render() {
         const contentListNoTitle = {
-            tencent: <TencentConfig userID={this.props.userID} projectID={this.state.projectIDNULL} trialcase={this.props.trialcase}/>,
+            tencent: <TencentConfig userID={this.props.userID} projectID={this.props.projectID} trialcase={this.props.trialcase}/>,
             aliyun: <AliConfig/>,
             amazon: <AmazonConfig/>,
         };

+ 1 - 0
src/app/common/deploy/tencent/TencentConfig.js

@@ -97,6 +97,7 @@ class TencentConfig extends Component {
                             deploy = data.project_by_id.deploy_id;
                             cloudID = data.project_by_id.cloud_id.id;
                         }
+                        console.log('object',data);
                         let defaultName = data.project_by_id.projectName;
                         return (
                             <div>

+ 2 - 1
src/app/graphqlService/TrialCase.jsx

@@ -52,6 +52,7 @@ class TrialCase extends Component {
     render() {
         let schemaID = this.props.history.location.state ? this.props.history.location.state.schemaID : "ecommerce_schemaID";
         let schemaName = this.props.history.location.state ? this.props.history.location.state.schemaName : "ecommerce";
+        let projectID = this.props.history.location.state ? this.props.history.location.state.projectID : "";
         let _this = this;
         return (
             <div>
@@ -80,7 +81,7 @@ class TrialCase extends Component {
                                     case 'schema':
                                         return <Schema trialcase={true} userID={this.state.userID} schemaName={schemaName} schemaID={schemaID} history={this.props.history} location={this.props.location}/>;
                                     case 'deploy':
-                                        return <Deploy trialcase={true} userID={this.state.userID} projectID={'need fill, test use state'}/>;
+                                        return <Deploy trialcase={true} userID={this.state.userID} projectID={projectID}/>;
                                     case 'manage':
                                         return <Manage/>;
                                     case 'graphiql':

+ 2 - 1
src/app/graphqlService/UserCreate.jsx

@@ -49,6 +49,7 @@ class UserCreate extends Component {
     render() {
         let schemaID = this.props.history.location.state ? this.props.history.location.state.schemaID : "ecommerce_schemaID";
         let schemaName = this.props.history.location.state ? this.props.history.location.state.schemaName : "ecommerce";
+        let projectID = this.props.history.location.state ? this.props.history.location.state.projectID : "";
         return (
             <div>
                 <Menu
@@ -75,7 +76,7 @@ class UserCreate extends Component {
                                     case 'schema':
                                         return <Schema trialcase={false} userID={this.state.userID} schemaName={schemaName} schemaID={schemaID} history={this.props.history} location={this.props.location}/>;
                                     case 'deploy':
-                                        return <Deploy trialcase={false} userID={this.state.userID} projectID={'need fill, test use state'}/>;
+                                        return <Deploy trialcase={false} userID={this.state.userID} projectID={projectID}/>;
                                     case 'manage':
                                         return <Manage/>;
                                     case 'graphiql':

+ 1 - 1
src/app/graphqlService/component/schema/Create.js

@@ -87,7 +87,7 @@ class Create extends Component {
             state: {
                 schemaName,
                 schemaID:schemaId,
-                projectId: projectId,
+                projectID: projectId,
                 create: true
             }
         });

+ 1 - 0
src/app/wechatService/WxTrialCase.js

@@ -26,6 +26,7 @@ class WxTrialCase extends Component {
     render() {
         let configID = this.props.history.location.state ? this.props.history.location.state.configID : "ecommerce_wxConfigID";
         let appName = this.props.history.location.state ? this.props.history.location.state.appName : "ecommerce";
+        let projectID = this.props.history.location.state ? this.props.history.location.state.projectID : "";
         return (
             <div>
                 <Menu

+ 1 - 0
src/app/wechatService/WxUserCreate.js

@@ -47,6 +47,7 @@ class WxUserCreate extends Component {
     render() {
         let configID = this.props.history.location.state ? this.props.history.location.state.configID : "ecommerce_wxConfigID";
         let appName = this.props.history.location.state ? this.props.history.location.state.appName : "ecommerce";
+        let projectID = this.props.history.location.state ? this.props.history.location.state.projectID : "";
         return (
             <div>
                 <Menu