diff --git a/SAS/TMSS/frontend/tmss_webapp/src/routes/Cycle/view.js b/SAS/TMSS/frontend/tmss_webapp/src/routes/Cycle/view.js index 897bf5e47226f49cf402df61df79e560118c218d..c12ac45604560dc2b88b7aeaf7f28aa54166dee4 100644 --- a/SAS/TMSS/frontend/tmss_webapp/src/routes/Cycle/view.js +++ b/SAS/TMSS/frontend/tmss_webapp/src/routes/Cycle/view.js @@ -138,10 +138,17 @@ export class CycleView extends Component { <div className="p-field p-grid resource-input-grid"> <ResourceDisplayList cycleQuota={this.state.cycleQuota} unitMap={this.resourceUnitMap} /> </div> - <div> - <ProjectList cycleid={this.state.cycle.name}/> + {/* Show Project list for this Cycle */} + <div className="p-fluid"> + <div className="p-field p-grid"> + <div className="col-lg-3 col-md-3 col-sm-12"> + <h5 data-testid="project-list">Project - List</h5> + </div> + <div className="col-lg-12 col-md-12 "> + <ProjectList cycle={this.state.cycle.name}/> + </div> + </div> </div> - </div> </React.Fragment> } diff --git a/SAS/TMSS/frontend/tmss_webapp/src/routes/Project/list.js b/SAS/TMSS/frontend/tmss_webapp/src/routes/Project/list.js index 57c100e74fb5428d64e81768632990bf027e5f07..54bb34377ab8c14b87ae04412c491555dd673907 100644 --- a/SAS/TMSS/frontend/tmss_webapp/src/routes/Project/list.js +++ b/SAS/TMSS/frontend/tmss_webapp/src/routes/Project/list.js @@ -1,7 +1,6 @@ import React, {Component} from 'react'; import ProjectService from '../../services/project.service'; import ViewTable from '../../components/ViewTable'; -// import { Link } from 'react-router-dom/cjs/react-router-dom.min'; import AppLoader from '../../layout/components/AppLoader'; import PageHeader from '../../layout/components/PageHeader'; import CycleService from '../../services/cycle.service'; @@ -11,9 +10,6 @@ export class ProjectList extends Component{ super(props) this.state = { projectlist: [], - paths: [{ - "View": "/project/view", - }], defaultcolumns: [ { "name":"Name / Project Code", "status":"Status" , @@ -56,21 +52,22 @@ export class ProjectList extends Component{ getProjectList(cycleid){ CycleService.getProjectsByCycle(cycleid) .then(async (projects) => { - console.log('projects',projects) await ProjectService.getUpdatedProjectQuota(projects) - .then( async projlist => { + .then( async projectlist => { this.setState({ - projectlist: projlist, + projectlist: projectlist, isprocessed: true, isLoading: false }) }) }); } + componentDidMount(){ - let cycleid = this.props.cycleid; - if(cycleid){ - this.getProjectList(cycleid); + // Show Project for the Cycle, This request will be coming from Cycle View. Otherwise it is consider as normal Project List. + let cycle = this.props.cycle; + if(cycle){ + this.getProjectList(cycle); }else{ // for Unit test, Table data this.unittestDataProvider(); @@ -86,7 +83,6 @@ export class ProjectList extends Component{ }) }); } - } render(){ @@ -102,10 +98,9 @@ export class ProjectList extends Component{ </Link> </div> </div> */} - { (this.props.cycleid) ? - <div className="p-field p-grid"> - <h5>Project - List</h5> - </div> + { (this.props.cycle) ? + <> + </> : <PageHeader location={this.props.location} title={'Project - List'} actions={[{icon: 'fa-plus-square',title:'Click to Add Project', props:{pathname: '/project/create' }}]}