diff --git a/SAS/TMSS/frontend/tmss_webapp/src/components/ViewTable.js b/SAS/TMSS/frontend/tmss_webapp/src/components/ViewTable.js index dc2f2b7dbd0495ec23b3a30705f487c381a391af..4ca7cc8e96ec5eb644ece4f10c0fc1053fbf3092 100644 --- a/SAS/TMSS/frontend/tmss_webapp/src/components/ViewTable.js +++ b/SAS/TMSS/frontend/tmss_webapp/src/components/ViewTable.js @@ -1723,7 +1723,7 @@ function ViewTable(props) { Header: 'Action', id: 'Action', accessor: props.keyaccessor, - Cell: props => <button className='p-link' onClick={navigateTo(props)} ><i className="fa fa-eye" style={{ cursor: 'pointer' }}></i></button>, + Cell: props => <Link to={{pathname: props.cell.row.values['actionpath']}}className='p-link' onClick={(e) => navigateTo(e, props)} ><i className="fa fa-eye" style={{ cursor: 'pointer' }}></i></Link>, disableFilters: true, disableSortBy: true, //isVisible: defaultdataheader.includes(props.keyaccessor), diff --git a/SAS/TMSS/frontend/tmss_webapp/src/layout/components/AppMenu.js b/SAS/TMSS/frontend/tmss_webapp/src/layout/components/AppMenu.js index c207fc50489805bfeaa1456038b65609f39b523b..59ae81de1d231ccf7ed00b118af83f7a15deb562 100644 --- a/SAS/TMSS/frontend/tmss_webapp/src/layout/components/AppMenu.js +++ b/SAS/TMSS/frontend/tmss_webapp/src/layout/components/AppMenu.js @@ -29,6 +29,9 @@ class AppSubmenu extends Component { } onMenuItemClick(event, item, index) { + if(event.ctrlKey){ + return; + } event.preventDefault(); //avoid processing disabled items if(item.disabled) { @@ -98,7 +101,7 @@ class AppSubmenu extends Component { if (item.to) { return ( //<NavLink activeClassName="active-route" to={item.to} onClick={(e) => this.onMenuItemClick(e, item, i)} exact target={item.target}> - <a activeClassName="active-route" onClick={(e) => this.onMenuItemClick(e, item, i)} exact target={item.target}> + <a href={item.to} activeClassName="active-route" onClick={(e) => this.onMenuItemClick(e, item, i)} exact target={item.target}> {content} {/* </NavLink> */} </a> diff --git a/SAS/TMSS/frontend/tmss_webapp/src/routes/Scheduling/SchedulingUnitList.js b/SAS/TMSS/frontend/tmss_webapp/src/routes/Scheduling/SchedulingUnitList.js index b5bc772bd08007df994fb7efac1b5cbbfd433be5..539bf29204f4527fd6393dca9d88030de4a74beb 100644 --- a/SAS/TMSS/frontend/tmss_webapp/src/routes/Scheduling/SchedulingUnitList.js +++ b/SAS/TMSS/frontend/tmss_webapp/src/routes/Scheduling/SchedulingUnitList.js @@ -682,7 +682,8 @@ class SchedulingUnitList extends Component{ /** * Check and delete the selected Scheduling Unit(s) */ - checkAndDeleteSchedulingUnit() { + checkAndDeleteSchedulingUnit(e) { + e.preventDefault(); this.pageUpdated = false; this.suDraftsList = []; this.suBlueprintList = []; @@ -917,7 +918,8 @@ class SchedulingUnitList extends Component{ } //Confirmation to Copy Scheduling Unit - confirmCopyingSU() { + confirmCopyingSU(e) { + e.preventDefault(); if (this.selectedRows.length > 0) { let dialog = this.state.dialog; dialog.type = "confirmation"; @@ -1021,7 +1023,8 @@ class SchedulingUnitList extends Component{ * If no selected scheduling unit is cancellable, show info to select a cancellable scheduling unit. * */ - confirmCancelSchedulingUnit() { + confirmCancelSchedulingUnit(e) { + e.preventDefault(); this.pageUpdated = false; let selectedBlueprints = this.selectedRows.filter(schedulingUnit => { return schedulingUnit.type === 'Blueprint' && @@ -1190,7 +1193,8 @@ class SchedulingUnitList extends Component{ /** * Function to invoke form UI to create cleanup task */ - async cleanUpSUTask() { + async cleanUpSUTask(e) { + e.preventDefault(); this.pageUpdated = false; if (this.selectedRows.length > 0) { this.suBlueprintList = _.filter(this.selectedRows, (schedulingUnit) => { return schedulingUnit.type.toLowerCase() === "blueprint"}); @@ -1292,7 +1296,8 @@ class SchedulingUnitList extends Component{ /** * Function to call the SUBCreator component's function to check and create SUBs */ - checkAndCreateSUB() { + checkAndCreateSUB(e) { + e.preventDefault(); if (this.selectedRows.length > 0) { const suBlueprintList = _.filter(this.selectedRows, (schedulingUnit) => { return schedulingUnit.type.toLowerCase() === "blueprint"}); const suDraftsList = _.filter(this.selectedRows, (schedulingUnit) => { return schedulingUnit.type.toLowerCase() === "draft"}); @@ -1341,7 +1346,8 @@ class SchedulingUnitList extends Component{ /** * Confirm to Prevent/Allow Automatic Deletion for selected SU draft(s)/blueprint(s) */ - async confirmAutoDeletion() { + async confirmAutoDeletion(e) { + e.preventDefault(); if (this.selectedRows.length > 0) { let dialog = this.state.dialog; dialog.type = "confirmation"; @@ -1457,7 +1463,7 @@ class SchedulingUnitList extends Component{ <> {this.state.suType === 'Draft' && <> - <a href="#" style={{marginLeft: "5px"}} onClick={this.checkAndCreateSUB} + <a href="#" style={{marginLeft: "5px"}} onClick={(e)=> this.checkAndCreateSUB(e)} title={this.state.userrole && this.state.userrole.userRolePermission.scheduleunit && this.state.userrole.userRolePermission.scheduleunit.createsub ? "Create Blueprint(s)":`${this.access_denied_message} to create Blueprint(s)`} > <i class= {this.state.userrole && this.state.userrole.userRolePermission.scheduleunit && this.state.userrole.userRolePermission.scheduleunit.createsub ?"fa fa-stamp":"fa fa-disabled fa-stamp"} aria-hidden="true" ></i> @@ -1466,28 +1472,28 @@ class SchedulingUnitList extends Component{ } {this.state.suType === 'Blueprint' && <> - <a href="#" style={{marginLeft: "5px"}} onClick={this.cleanUpSUTask} + <a href="#" style={{marginLeft: "5px"}} onClick={(e) => this.cleanUpSUTask(e)} title={this.state.userrole && this.state.userrole.userRolePermission.task_blueprint && this.state.userrole.userRolePermission.task_blueprint.canceltask ? "Create Clean-up Task(s)":`${this.access_denied_message} to create Clean-up Task(s)`} > <i class={this.state.userrole && this.state.userrole.userRolePermission.task_blueprint && this.state.userrole.userRolePermission.task_blueprint.canceltask?"fa fa-recycle":"fa fa-disabled fa-recycle"} aria-hidden="true" ></i> </a> - <a href="#" style={{marginLeft: "5px"}} onClick={this.confirmCancelSchedulingUnit} + <a href="#" style={{marginLeft: "5px"}} onClick={(e) => this.confirmCancelSchedulingUnit(e)} title={this.state.userrole && this.state.userrole.userRolePermission.scheduleunit_blueprint && this.state.userrole.userRolePermission.scheduleunit_blueprint.edit ? "Cancel selected Scheduling Unit(s)":`${this.access_denied_message} to cancel Scheduling Unit(s)`} > <i class={this.state.userrole && this.state.userrole.userRolePermission.scheduleunit_blueprint && this.state.userrole.userRolePermission.scheduleunit_blueprint.edit?"fa fa-ban":"fa fa-disabled fa-ban"} aria-hidden="true" ></i> </a> </> } - <a href="#" style={{marginLeft: "5px"}} onClick={this.confirmAutoDeletion} + <a href="#" style={{marginLeft: "5px"}} onClick={(e) => this.confirmAutoDeletion(e)} title={this.state.userrole && this.state.userrole.userRolePermission.scheduleunit && this.state.userrole.userRolePermission.scheduleunit.autodeletion ? "Prevent/Allow Automatic Deletion":`${this.access_denied_message} to allow/prevent Automatic Deletion`} > <i class={this.state.userrole && this.state.userrole.userRolePermission.scheduleunit && this.state.userrole.userRolePermission.scheduleunit.autodeletion?"fa fa-thumbtack":"fa fa-disabled fa-thumbtack"} aria-hidden="true" ></i> </a> - <a href="#" style={{marginLeft: "5px"}} onClick={this.confirmCopyingSU} + <a href="#" style={{marginLeft: "5px"}} onClick={(e) => this.confirmCopyingSU(e)} title={this.state.userrole && this.state.userrole.userRolePermission.scheduleunit && this.state.userrole.userRolePermission.scheduleunit.copysu ? "Copy Scheduling Unit(s) Draft/Blueprint":`${this.access_denied_message} to copy Scheduling Unit(s)`} > <i class={this.state.userrole && this.state.userrole.userRolePermission.scheduleunit && this.state.userrole.userRolePermission.scheduleunit.copysu?"fa fa-copy":"fa fa-disabled fa-copy"} ></i> </a> - <a href="#" style={{marginLeft: "5px"}} onClick={this.checkAndDeleteSchedulingUnit} + <a href="#" style={{marginLeft: "5px"}} onClick={(e) => this.checkAndDeleteSchedulingUnit(e)} title={this.state.userrole && this.state.userrole.userRolePermission.scheduleunit && this.state.userrole.userRolePermission.scheduleunit.delete ? "Delete selected Scheduling Unit(s)":`${this.access_denied_message} to delete Scheduling Unit(s)`} > <i class={this.state.userrole && this.state.userrole.userRolePermission.scheduleunit && this.state.userrole.userRolePermission.scheduleunit.delete?"fa fa-trash":"fa fa-disabled fa fa-trash"} aria-hidden="true" ></i> diff --git a/SAS/TMSS/frontend/tmss_webapp/src/routes/Scheduling/ViewSchedulingUnit.js b/SAS/TMSS/frontend/tmss_webapp/src/routes/Scheduling/ViewSchedulingUnit.js index fab924a2355fb6d4e865b32471e91f288457d761..8a8531c866fc501158b5d19ea77ce81cc21251b8 100644 --- a/SAS/TMSS/frontend/tmss_webapp/src/routes/Scheduling/ViewSchedulingUnit.js +++ b/SAS/TMSS/frontend/tmss_webapp/src/routes/Scheduling/ViewSchedulingUnit.js @@ -1376,14 +1376,14 @@ class ViewSchedulingUnit extends Component { <> {this.props.match.params.type === 'draft' && <> - <a href="#" onClick={this.confirmCancelTasks} + <button className="p-link" href="#" onClick={this.confirmCancelTasks} title={userPermissions.task_draft.canceltask?"Cancel selected Task(s)": `${this.access_denied_message} to cancel Task(s)`}> <i class={userPermissions.task_draft.canceltask?"fa fa-ban":"fa fa-ban fa-disabled"} aria-hidden="true" ></i> - </a> - <a href="#" style={{ pointerEvents: this.props.disabled ? 'none' : 'auto' }}onClick={this.confirmDeleteTasks} + </button> + <button className="p-link" href="#" style={{ pointerEvents: this.props.disabled ? 'none' : 'auto' }}onClick={this.confirmDeleteTasks} title={userPermissions.task.delete?"Delete selected Task(s)": `${this.access_denied_message} to delete Task(s)`} > <i class={userPermissions.task.delete?"fa fa-trash":"fa fa-trash fa-disabled"} aria-hidden="true" ></i> - </a> + </button> </> } {this.props.match.params.type === 'blueprint' &&