UI/xmigrate-ui/src/pages/Home/Home.js
// Func:Changing the project state when clicking the sidebar by call back Funtion
Changing the project state when clicking the sidebar by call back Funtion
Changing the project state when clicking the sidebar by call back Funtion
async changeProject(project) {
    console.log("Changine Project",project);
    var dataGet ={
      project: project.name
    }
    let BlueprintDisabled ;
    this.setState({
      Loading:true
    });
    await GetServiceWithData(BLUEPRINT_URL, dataGet).then(
      (res) => {
        if(JSON.parse(res.data).length === 0){
          BlueprintDisabled = true;
        }
        else{
          BlueprintDisabled = false;
        }
      }
    );
    this.setState({
      CurrentPro: project,
      BlueprintDisabled : BlueprintDisabled,
      Loading:false
    });
    if(BlueprintDisabled && this.props.location.pathname ==='/home/blue-print'){
      this.props.history.push('/home/discover');
    }
  }
async changeProject ( project ) { console . log ( "Changine Project" , project ) ; var dataGet = { project : project . name } let BlueprintDisabled ; this . setState ( { Loading : true } ) ; await GetServiceWithData ( BLUEPRINT_URL , dataGet ) . then ( ( res ) => { if ( JSON . parse ( res . data ) . length === 0 ) { BlueprintDisabled = true ; } else { BlueprintDisabled = false ; } } ) ; this . setState ( { CurrentPro : project , BlueprintDisabled : BlueprintDisabled , Loading : false } ) ; if ( BlueprintDisabled && this . props . location . pathname === '/home/blue-print' ) { this . props . history . push ( '/home/discover' ) ; } }
Func:Changing the project state when clicking the sidebar by call back Funtion
Func : Changing the project state when clicking the sidebar by call back Funtion