diff --git a/SAS/TMSS/frontend/tmss_webapp/src/components/DynamicScheduler.js b/SAS/TMSS/frontend/tmss_webapp/src/components/DynamicScheduler.js index 94409e5159fb1b245334bea542e3ba51632a7181..4d4da2f771fbe598724159474ae5daa294256386 100644 --- a/SAS/TMSS/frontend/tmss_webapp/src/components/DynamicScheduler.js +++ b/SAS/TMSS/frontend/tmss_webapp/src/components/DynamicScheduler.js @@ -23,8 +23,8 @@ export default class DynamicScheduler extends Component { this.showConfirmDialog = this.showConfirmDialog.bind(this); } - async componentDidMount() { - await UtilService.getDynamicSchedulerStatus() + componentDidMount() { + UtilService.getDynamicSchedulerStatus() .then(response => { var status = false; if(response) { @@ -33,7 +33,7 @@ export default class DynamicScheduler extends Component { this.setState({dynamicScheduler: response, dsStatus: status}); }); - await UtilService.getFixedTimeSchedulerStatus() + UtilService.getFixedTimeSchedulerStatus() .then(response => { var status = false; if(response) { @@ -67,7 +67,7 @@ export default class DynamicScheduler extends Component { fixedScheduler.value = this.currentStatus; let response = await UtilService.updateFixedTimeSchedulerStatus(fixedScheduler); if(response) { - appGrowl.show({severity: 'success', summary: 'Success', detail: 'Fixed Scheduling is turned '+((this.currentStatus === true)?'On' : 'Off')+' successfully!'}); + appGrowl.show({severity: 'success', summary: 'Success', detail: 'Fixed Time Scheduling is turned '+((this.currentStatus === true)?'On' : 'Off')+' successfully!'}); } else { appGrowl.show({severity: 'error', summary: 'Error', detail: 'Fixed Scheduling is not updated successfully.'}); } @@ -100,28 +100,32 @@ export default class DynamicScheduler extends Component { render() { const {dynamicScheduler} = this.state.permissions.userRolePermission; - let tooltip = `Dynamic Scheduling is turned ${this.state.dsStatus?'On':'Off'}. `; - tooltip = `${tooltip} ${dynamicScheduler.setting?'Click':"Don't have permission"} to turn it ${this.state.dsStatus? "'Off'" : "'On'"}`; return ( <> <div className="p-field p-grid"> - <label htmlFor="autodeletion" style={{marginRight: '10px', marginLeft: '1em'}}>Dynamic Scheduling :</label> + <label className='col-lg-8 col-md-8 col-sm-12' htmlFor="autodeletion" style={{marginRight: '10px', marginLeft: '1em'}}>Dynamic Scheduling :</label> {/* <label htmlFor="onLabel" style={{ marginRight: '0.25em', color: 'black'}}>OFF</label> */} + <div className='col-lg-2 col-md-2 col-sm-12'> <InputSwitch disabled={dynamicScheduler.setting?!dynamicScheduler.setting:true} checked={this.state.dsStatus} onChange={(e) => this.showConfirmDialog(e, 'dynamic')} - tooltip={tooltip} + tooltip={`Dynamic Scheduling is turned ${this.state.dsStatus?'On':'Off'}. ${dynamicScheduler.setting?'Click':"Don't have permission"} to turn it ${this.state.dsStatus? "'Off'" : "'On'"}`} tooltipOptions={this.tooltipOptions}/> + </div> + </div> {/* <label htmlFor="onLabel" style={{marginLeft: '0.25em', color: 'black'}}>ON</label> */} - <label htmlFor="autodeletion" style={{marginRight: '10px', marginLeft: '1em'}}>Fixed Scheduling :</label> - {/* <label htmlFor="onLabel" style={{ marginRight: '0.25em', color: 'black'}}>OFF</label> */} - <InputSwitch disabled={dynamicScheduler.setting?!dynamicScheduler.setting:true} - checked={this.state.fsStatus} onChange={(e) => this.showConfirmDialog(e, 'fixed')} - tooltip={tooltip} - tooltipOptions={this.tooltipOptions}/> + <div className="p-field p-grid"> + <label className='col-lg-8 col-md-8 col-sm-12' htmlFor="autodeletion" style={{marginRight: '10px', marginLeft: '1em'}}>Fixed Scheduling :</label> + <div className='col-lg-2 col-md-2 col-sm-12'> + {/* <label htmlFor="onLabel" style={{ marginRight: '0.25em', color: 'black'}}>OFF</label> */} + <InputSwitch disabled={dynamicScheduler.setting?!dynamicScheduler.setting:true} + checked={this.state.fsStatus} onChange={(e) => this.showConfirmDialog(e, 'fixed')} + tooltip={`Fixed Time Scheduling is turned ${this.state.fsStatus?'On':'Off'}. ${dynamicScheduler.setting?'Click':"Don't have permission"} to turn it ${this.state.fsStatus? "'Off'" : "'On'"}`} + tooltipOptions={this.tooltipOptions}/> + </div> </div> - <CustomDialog type="confirmation" visible={this.state.showDialog} width={'35vw'} - header={'Confirmation'} message={`Do you want to turn ${this.currentStatus === true ? 'On' : 'Off'} ${this.state.scheduleType === 'dynamic'? 'Dynamic Scheduling' : 'Fixed Scheduling'}` } + <CustomDialog type="confirmation" visible={this.state.showDialog} width={'30vw'} + header={'Confirmation'} message={`Do you want to turn ${this.currentStatus === true ? 'On' : 'Off'} ${this.state.scheduleType === 'dynamic'? 'Dynamic Scheduling' : 'Fixed Time Scheduling'}` } content={''} showIcon={true} onClose={this.closeDialog} onCancel={this.closeDialog} onSubmit={this.updateDSStatus} /> diff --git a/SAS/TMSS/frontend/tmss_webapp/src/layout/components/PageHeader.js b/SAS/TMSS/frontend/tmss_webapp/src/layout/components/PageHeader.js index 4ff0de68c1a38abb07cac9d9d6d8c7f88e125a92..9be3b7b23b0980db8f8d705b1f6f12f00b258ba0 100644 --- a/SAS/TMSS/frontend/tmss_webapp/src/layout/components/PageHeader.js +++ b/SAS/TMSS/frontend/tmss_webapp/src/layout/components/PageHeader.js @@ -60,7 +60,7 @@ export default ({ title, subTitle, actions, ...props}) => { ); } else if (action.type === 'tag') { return ( - <span className={action.className}>{action.content}</span> + <span className={action.className} title={action.title || ''}>{action.content}</span> ); } diff --git a/SAS/TMSS/frontend/tmss_webapp/src/routes/Timeline/view.js b/SAS/TMSS/frontend/tmss_webapp/src/routes/Timeline/view.js index 77698b98ff8f557f68a9ca535817955b5702b932..96a90239aecb1efa4ac37949e26a60d3e22130c5 100644 --- a/SAS/TMSS/frontend/tmss_webapp/src/routes/Timeline/view.js +++ b/SAS/TMSS/frontend/tmss_webapp/src/routes/Timeline/view.js @@ -281,7 +281,6 @@ export class TimelineView extends Component { * @param {boolean} status */ async updateDSStatus(status, scheduleType) { - console.log(scheduleType) if(scheduleType === 'dynamic') { this.setState({dsStatus: status}); } @@ -1570,7 +1569,7 @@ export class TimelineView extends Component { title: this.state.fsStatus?'Fixed Scheduling is On':'Fixed Scheduling is Off', className:`tag p-chips-token-label su-${this.state.fsStatus? 'finished': 'error'}`, type: 'tag' }, - { icon: 'fa-cog', title: 'Dynamic Scheduling Settings', + { icon: 'fa-cog', title: 'Dynamic/Fixed Time Scheduling Settings', type: 'button', actOn: 'click', props: { callback: this.showDymanicSchedulerPopup }, }, { icon: 'fa-bars', title: '', type: 'button', actOn: 'mouseOver', props: { callback: this.showOptionMenu }, }, @@ -1899,7 +1898,7 @@ export class TimelineView extends Component { {this.state.showDialog && <div className="p-grid" data-testid="confirm_dialog"> <CustomDialog type="success" visible={this.state.showDialog} width="30vw" showIcon={false} - header="Dynamic Scheduling Settings" message={<DynamicScheduler callBack={this.updateDSStatus} />} + header="Dynamic/Fixed Time Scheduling Settings" message={<DynamicScheduler callBack={this.updateDSStatus} />} content={''} actions={ [ {id:"no", title: 'Close', callback: this.close} ]} diff --git a/SAS/TMSS/frontend/tmss_webapp/src/routes/Timeline/week.view.js b/SAS/TMSS/frontend/tmss_webapp/src/routes/Timeline/week.view.js index d0121844e907005410c93dea8cc5655052dd826c..3f61a00aa51b95cdc6560421b93a5b36b78470b9 100644 --- a/SAS/TMSS/frontend/tmss_webapp/src/routes/Timeline/week.view.js +++ b/SAS/TMSS/frontend/tmss_webapp/src/routes/Timeline/week.view.js @@ -146,8 +146,14 @@ export class WeekTimelineView extends Component { * * @param {boolean} status */ - async updateDSStatus(status) { - this.setState({dsStatus: status}); + async updateDSStatus(status, scheduleType) { + if(scheduleType === 'dynamic') { + this.setState({dsStatus: status}); + } + if(scheduleType === 'fixed') { + + this.setState({fsStatus: status}); + } } /* Cancel on Scheduling Constraint Popup onEdit */ @@ -1250,13 +1256,13 @@ export class WeekTimelineView extends Component { actions={[ { content: 'D', title: this.state.dsStatus?'Dynamic Scheduling is On':'Dynamic Scheduling is Off', - className:`tag-content p-chips-token-label su-${this.state.dsStatus? 'finished': 'error'}`, + className:`tag p-chips-token-label su-${this.state.dsStatus? 'finished': 'error'}`, type: 'tag' }, { content: 'F', title: this.state.fsStatus?'Fixed Scheduling is On':'Fixed Scheduling is Off', - className:`tag-content p-chips-token-label su-${this.state.fsStatus? 'finished': 'error'}`, + className:`tag p-chips-token-label su-${this.state.fsStatus? 'finished': 'error'}`, type: 'tag' }, - { icon: 'fa-cog', title: 'Dynamic Scheduling Settings', + { icon: 'fa-cog', title: 'Dynamic/Fixed Time Scheduling Settings', type: 'button', actOn: 'click', props: { callback: this.showDymanicSchedulerPopup }, }, { icon: 'fa-bars', title: '', type: 'button', actOn: 'mouseOver', props: { callback: this.showOptionMenu }, }, { icon: 'fa-clock', title: 'View Timeline', props: { pathname: `/su/timelineview` } }]} /> @@ -1474,7 +1480,7 @@ export class WeekTimelineView extends Component { {this.state.showDialog && <div className="p-grid" data-testid="confirm_dialog"> <CustomDialog type="success" visible={this.state.showDialog} width="30vw" showIcon={false} - header="Dynamic Scheduling Settings" message={<DynamicScheduler callBack={this.updateDSStatus} />} + header="Dynamic/Fixed Time Scheduling Settings" message={<DynamicScheduler callBack={this.updateDSStatus} />} content={''} actions={ [ {id:"no", title: 'Close', callback: this.close} ]}