diff --git a/SAS/TMSS/frontend/tmss_webapp/src/components/Spreadsheet/CustomDateComponent.js b/SAS/TMSS/frontend/tmss_webapp/src/components/Spreadsheet/CustomDateComponent.js index 08b61c59ac394dc734931cc7fbfb946299c3d097..b6245a82949edb52d30a257180cc4486c18c9b39 100644 --- a/SAS/TMSS/frontend/tmss_webapp/src/components/Spreadsheet/CustomDateComponent.js +++ b/SAS/TMSS/frontend/tmss_webapp/src/components/Spreadsheet/CustomDateComponent.js @@ -26,7 +26,7 @@ export default class CustomDateComponent extends Component { <input type="text" ref="eInput" data-input style={{ width: '100%',}} /> <a className="input-button" title="clear" data-clear> - <i className="fa fa-times"></i> + <i className="pi pi-times"></i> </a> </div> ); diff --git a/SAS/TMSS/frontend/tmss_webapp/src/components/ViewTable.js b/SAS/TMSS/frontend/tmss_webapp/src/components/ViewTable.js index bb292234b576bf03eee3e2c671403816134f091c..4d1a4d0d42876b524813a30c1e78e7e8ff7a098b 100644 --- a/SAS/TMSS/frontend/tmss_webapp/src/components/ViewTable.js +++ b/SAS/TMSS/frontend/tmss_webapp/src/components/ViewTable.js @@ -11,7 +11,7 @@ import { Calendar } from 'primereact/calendar'; import { Paginator } from 'primereact/paginator'; import { TriStateCheckbox } from 'primereact/tristatecheckbox'; import { Slider } from 'primereact/slider'; -import { Button } from "react-bootstrap"; +import { Button } from "primereact/button"; import { InputNumber } from "primereact/inputnumber"; import { MultiSelect } from 'primereact/multiselect'; import { RadioButton } from 'primereact/radiobutton'; @@ -133,7 +133,7 @@ function DefaultColumnFilter({ } }; return ( - <> + <div className="table-filter" onClick={e => { e.stopPropagation() }} style={{marginRight: '5px'}}> <input title={(tableToolTipsState[Header])?tableToolTipsState[Header]:"Enter few characters and press ‘Enter’ key to search"} @@ -153,7 +153,7 @@ function DefaultColumnFilter({ }} /> {value && - <i className="table-reset fa fa-times" style={{cursor: 'pointer'}} + <i className="table-reset pi pi-times" style={{cursor: 'pointer'}} title="Clear the filter" onClick={(e) => { setFilter(undefined); setValue(''); setFiltered(false); @@ -168,8 +168,8 @@ function DefaultColumnFilter({ }} /> } </div> - - </> + + ) } @@ -742,7 +742,7 @@ function DateRangeColumnFilter({ setFilter(undefined); setValue(''); callServerFilter(e.target.value, true); - } }} className="tb-cal-reset fa fa-times" />} + } }} className="tb-cal-reset pi pi-times" />} </div> ) } @@ -852,7 +852,7 @@ function FlatpickrRangeColumnFilter({ callServerFilter(value, true); } }} title="Clear date range" > - <i className="fa fa-times" style={{color:'white', marginTop:'5px'}} ></i> + <i className="pi pi-times" style={{color:'white'}} ></i> </button> </Flatpickr> </div> @@ -928,7 +928,7 @@ function CalendarColumnFilter({ setFilter(undefined); setValue(''); callServerFilter(e, true); - } }} className="tb-cal-reset fa fa-times" />} + } }} className="tb-cal-reset pi pi-times" />} </div> ) } @@ -1001,7 +1001,7 @@ function DateTimeColumnFilter({ if (storeFilter) { TableUtil.clearColumnFilter(currentTableName, Header); } - }} className="tb-cal-reset fa fa-times" />} + }} className="tb-cal-reset pi pi-times" />} </div> ) } 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 e604cad876d7f9b328283c0cc9098da754fd339e..3e6f9209caf8163aae1a9ca12a20ef28f7d72c11 100644 --- a/SAS/TMSS/frontend/tmss_webapp/src/layout/components/PageHeader.js +++ b/SAS/TMSS/frontend/tmss_webapp/src/layout/components/PageHeader.js @@ -38,7 +38,7 @@ const PageHeader = ({title, subTitle, actions, className, ...props}) => { PageHeader.propTypes= { title:PropTypes.string, subTitle:PropTypes.string, - actions:PropTypes.object, + actions:PropTypes.array, className:PropTypes.string, location:PropTypes.object } diff --git a/SAS/TMSS/frontend/tmss_webapp/src/layout/sass/_timeline.scss b/SAS/TMSS/frontend/tmss_webapp/src/layout/sass/_timeline.scss index 114f0f43715a828bd8bef12aafaf6db45234686b..86d3d5aebf85a90786df8b381cd2f3e27fc99b06 100644 --- a/SAS/TMSS/frontend/tmss_webapp/src/layout/sass/_timeline.scss +++ b/SAS/TMSS/frontend/tmss_webapp/src/layout/sass/_timeline.scss @@ -423,11 +423,8 @@ $vh: 1vh; .calendar-reset { position: relative; - width: 20px !important; height: 29px; - margin-left: 0px !important; - border-top-left-radius: 0px !important; - border-bottom-left-radius: 0px !important; + width: 36px !important; } .timeline-details-pane { 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 546b2ed95ac6d2ad4204e3ef74d54a01eb2b8fe8..4b61eb5ac8b4c745dc4d5d6d0fce72ce06cbdbca 100644 --- a/SAS/TMSS/frontend/tmss_webapp/src/routes/Cycle/view.js +++ b/SAS/TMSS/frontend/tmss_webapp/src/routes/Cycle/view.js @@ -91,23 +91,7 @@ export class CycleView extends Component { const {cycle} = this.state.userrole.userRolePermission; return ( <React.Fragment> - {/* <div className="p-grid"> - <div className="p-col-10 p-lg-10 p-md-10"> - <h2>Cycle - Details </h2> - </div> - { this.state.cycle && - <div className="p-col-2 p-lg-2 p-md-2"> - <Link to={{ pathname: `/cycle`}} title="Close View" style={{float: "right"}}> - <i className="fa fa-times" style={{marginTop: "10px", marginLeft: "5px"}}></i> - </Link> - <Link to={{ pathname: `/cycle/edit/${this.state.cycle.name}`, state: {id: this.state.cycle?this.state.cycle.name:''}}} title="Edit Cycle" - style={{float: "right"}}> - <i className="fa fa-edit" style={{marginTop: "10px"}}></i> - </Link> - </div> - } - </div> */ } - {cycle && cycle.list? + {cycle && cycle.list? <> <PageHeader location={this.props.location} title={'Cycle - Details'} actions={[ {icon:'fa-edit', diff --git a/SAS/TMSS/frontend/tmss_webapp/src/routes/Reservation/reservation.create.js b/SAS/TMSS/frontend/tmss_webapp/src/routes/Reservation/reservation.create.js index b31bddc5aaa8aa5e6018ceca4e9464f0e961bf9e..64a443d942187484d2ae06d70240302bd400ab9a 100644 --- a/SAS/TMSS/frontend/tmss_webapp/src/routes/Reservation/reservation.create.js +++ b/SAS/TMSS/frontend/tmss_webapp/src/routes/Reservation/reservation.create.js @@ -613,7 +613,7 @@ export class ReservationCreate extends Component { }} > <input type="text" data-input className={`p-inputtext p-component ${this.state.errors.start_time && this.state.touched.start_time ? 'input-error' : ''}`} /> <i className="fa fa-calendar" data-toggle style={{ position: "absolute", marginLeft: '-25px', marginTop: '5px', cursor: 'pointer' }} ></i> - <i className="fa fa-times" style={{ position: "absolute", marginLeft: '-50px', marginTop: '5px', cursor: 'pointer' }} + <i className="pi pi-times" style={{ position: "absolute", marginLeft: '-50px', marginTop: '5px', cursor: 'pointer' }} onClick={() => { this.setParams('start_time', ''); this.setReservationParams('start_time', '') }}></i> </Flatpickr> <label className={this.state.errors.start_time && this.state.touched.start_time ? "error" : "info"}> @@ -643,7 +643,7 @@ export class ReservationCreate extends Component { }} > <input type="text" data-input className={`p-inputtext p-component ${this.state.errors.stop_time && this.state.touched.stop_time ? 'input-error' : ''}`} /> <i className="fa fa-calendar" data-toggle style={{ position: "absolute", marginLeft: '-25px', marginTop: '5px', cursor: 'pointer' }} ></i> - <i className="fa fa-times" style={{ position: "absolute", marginLeft: '-50px', marginTop: '5px', cursor: 'pointer' }} + <i className="pi pi-times" style={{ position: "absolute", marginLeft: '-50px', marginTop: '5px', cursor: 'pointer' }} onClick={() => { this.setParams('stop_time', ''); this.setReservationParams('stop_time', '') }}></i> </Flatpickr> <label className={this.state.errors.stop_time && this.state.touched.stop_time ? "error" : "info"}> diff --git a/SAS/TMSS/frontend/tmss_webapp/src/routes/Reservation/reservation.edit.js b/SAS/TMSS/frontend/tmss_webapp/src/routes/Reservation/reservation.edit.js index d841239f7cdbc136f60a2631c1b7fc94c7968e40..78633d5548f2b924faf3f81da9082f754f597a3f 100644 --- a/SAS/TMSS/frontend/tmss_webapp/src/routes/Reservation/reservation.edit.js +++ b/SAS/TMSS/frontend/tmss_webapp/src/routes/Reservation/reservation.edit.js @@ -549,7 +549,7 @@ export class ReservationEdit extends Component { }} > <input type="text" data-input className={`p-inputtext p-component ${this.state.errors.start_time && this.state.touched.start_time ? 'input-error' : ''}`} /> <i className="fa fa-calendar" data-toggle style={{ position: "absolute", marginLeft: '-25px', marginTop: '5px', cursor: 'pointer' }} ></i> - <i className="fa fa-times" style={{ position: "absolute", marginLeft: '-50px', marginTop: '5px', cursor: 'pointer' }} + <i className="pi pi-times" style={{ position: "absolute", marginLeft: '-50px', marginTop: '5px', cursor: 'pointer' }} onClick={() => { this.setParams('start_time', ''); this.setReservationParams('start_time', '') }}></i> </Flatpickr> <label className={this.state.errors.start_time && this.state.touched.start_time ? "error" : "info"}> @@ -579,7 +579,7 @@ export class ReservationEdit extends Component { }} > <input type="text" data-input className={`p-inputtext p-component ${this.state.errors.stop_time && this.state.touched.stop_time ? 'input-error' : ''}`} /> <i className="fa fa-calendar" data-toggle style={{ position: "absolute", marginLeft: '-25px', marginTop: '5px', cursor: 'pointer' }} ></i> - <i className="fa fa-times" style={{ position: "absolute", marginLeft: '-50px', marginTop: '5px', cursor: 'pointer' }} + <i className="pi pi-times" style={{ position: "absolute", marginLeft: '-50px', marginTop: '5px', cursor: 'pointer' }} onClick={() => { this.setParams('stop_time', ''); this.setReservationParams('stop_time', '') }}></i> </Flatpickr> <label className={this.state.errors.stop_time && this.state.touched.stop_time ? "error" : "info"}> diff --git a/SAS/TMSS/frontend/tmss_webapp/src/routes/Reservation/reservation.list.js b/SAS/TMSS/frontend/tmss_webapp/src/routes/Reservation/reservation.list.js index 4d689a7ac6cf350c6eee36aadb678a771b06f750..6ab3642c1404051e0582f065348994725181fe41 100644 --- a/SAS/TMSS/frontend/tmss_webapp/src/routes/Reservation/reservation.list.js +++ b/SAS/TMSS/frontend/tmss_webapp/src/routes/Reservation/reservation.list.js @@ -865,7 +865,7 @@ export class ReservationList extends Component{ <button className="p-button p-component p-button-icon-only calendar-reset" onClick={this.resetStartDateTime} title="Clear date range" > - <i className="fa fa-times" style={{color:'white', marginTop:'-2.85px'}} ></i> + <i className="pi pi-times" style={{color:'white', marginTop:'-2.85px'}} ></i> </button> </Flatpickr> </span> @@ -899,7 +899,7 @@ export class ReservationList extends Component{ </button> <button className="p-button p-component p-button-icon-only calendar-reset" onClick={this.resetEndDateTime} title="Clear date range" > - <i className="fa fa-times" style={{color:'white', marginTop:'-2.85px'}} ></i> + <i className="pi pi-times" style={{color:'white', marginTop:'-2.85px'}} ></i> </button> </Flatpickr> </span> diff --git a/SAS/TMSS/frontend/tmss_webapp/src/routes/Reservation/reservation.summary.js b/SAS/TMSS/frontend/tmss_webapp/src/routes/Reservation/reservation.summary.js index caecf3059084aa9161a515e9b0c9535e83ae18ae..e8ec4b9b96f67bd981549025050c46d537f5d300 100644 --- a/SAS/TMSS/frontend/tmss_webapp/src/routes/Reservation/reservation.summary.js +++ b/SAS/TMSS/frontend/tmss_webapp/src/routes/Reservation/reservation.summary.js @@ -129,7 +129,7 @@ export class ReservationSummary extends Component { <h6 className="col-lg-10 col-sm-10">Reservation Details</h6> <Link onClick={this.redirectToReservDetails} title="View Full Details" ><i className="fa fa-eye"></i></Link> {/* <i className="fa fa-eye" style={{color: 'grey'}}></i> */} - <Link to={this.props.location?this.props.location.pathname:"/su/timelineview/week"} onClick={this.closeSUDets} title="Close Details"><i className="fa fa-times"></i></Link> + <Link to={this.props.location?this.props.location.pathname:"/su/timelineview/week"} onClick={this.closeSUDets} title="Close Details"><i className="pi pi-times"></i></Link> </div> <DetailsSummary fields={summaryFields}/> {/* Reservation parameters Display in table format */} diff --git a/SAS/TMSS/frontend/tmss_webapp/src/routes/Scheduling/summary.js b/SAS/TMSS/frontend/tmss_webapp/src/routes/Scheduling/summary.js index 98ad51e13231873df5041ce172a4f12c3ad8c9ae..4fd31e0eff859a72f2527e6fa794ce980cdb97fc 100644 --- a/SAS/TMSS/frontend/tmss_webapp/src/routes/Scheduling/summary.js +++ b/SAS/TMSS/frontend/tmss_webapp/src/routes/Scheduling/summary.js @@ -65,7 +65,7 @@ export class SchedulingUnitSummary extends Component { <Link onClick={this.confirmAutoDeletion} title={permissions.autodeletion ? this.state.schedulingUnit.output_pinned ? 'Unpin data after ingest' : 'Pin data after ingest' : `${this.access_denied_message} to do Pin/Unpin data after ingest`}> <i className="fa fa-thumbtack" style={{ fontSize: '16px', paddingRight: '3px' }}></i></Link> - <Link to={this.props.location ? this.props.location.pathname : "/su/timelineview/week"} onClick={this.closeSUDets} title="Close Details"><i className="fa fa-times"></i></Link> + <Link to={this.props.location ? this.props.location.pathname : "/su/timelineview/week"} onClick={this.closeSUDets} title="Close Details"><i className="pi pi-times"></i></Link> </div> } diff --git a/SAS/TMSS/frontend/tmss_webapp/src/routes/SystemEvent/affeted.tasks.selector.js b/SAS/TMSS/frontend/tmss_webapp/src/routes/SystemEvent/affeted.tasks.selector.js index de69ad08e2cef170bfda3eca4badcd5238e9e982..2693d74980597147a001bb8a8ceaceae0d793fd3 100644 --- a/SAS/TMSS/frontend/tmss_webapp/src/routes/SystemEvent/affeted.tasks.selector.js +++ b/SAS/TMSS/frontend/tmss_webapp/src/routes/SystemEvent/affeted.tasks.selector.js @@ -329,7 +329,7 @@ export class AffectedTasksSelector extends Component { onKeyDown={this.handleEvent} > <input type="text" data-input className={`p-inputtext p-component ${this.state.errors.start && this.state.touched.start ? 'input-error' : ''}`} /> <i className="fa fa-calendar" data-toggle style={{ position: "absolute", marginLeft: '-25px', marginTop: '5px', cursor: 'pointer' }} ></i> - <i className="fa fa-times" style={{ position: "absolute", marginLeft: '-50px', marginTop: '5px', cursor: 'pointer' }} + <i className="pi pi-times" style={{ position: "absolute", marginLeft: '-50px', marginTop: '5px', cursor: 'pointer' }} onClick={() => { this.setSearchParam('start', '');}}></i> </Flatpickr> {this.state.errors.start && this.state.touched.start && @@ -361,7 +361,7 @@ export class AffectedTasksSelector extends Component { onKeyDown={this.handleEvent} > <input type="text" data-input className={`p-inputtext p-component ${this.state.errors.stop && this.state.touched.stop ? 'input-error' : ''}`} /> <i className="fa fa-calendar" data-toggle style={{ position: "absolute", marginLeft: '-25px', marginTop: '5px', cursor: 'pointer' }} ></i> - <i className="fa fa-times" style={{ position: "absolute", marginLeft: '-50px', marginTop: '5px', cursor: 'pointer' }} + <i className="pi pi-times" style={{ position: "absolute", marginLeft: '-50px', marginTop: '5px', cursor: 'pointer' }} onClick={() => { this.setSearchParam('stop', '');}}></i> </Flatpickr> </div> diff --git a/SAS/TMSS/frontend/tmss_webapp/src/routes/SystemEvent/system.event.create.js b/SAS/TMSS/frontend/tmss_webapp/src/routes/SystemEvent/system.event.create.js index 8d32fa2768b4ed1a90d674519bd99a897a946c8a..dfdf9439dc2cbb8f2e45a27b01a81d56c0290009 100644 --- a/SAS/TMSS/frontend/tmss_webapp/src/routes/SystemEvent/system.event.create.js +++ b/SAS/TMSS/frontend/tmss_webapp/src/routes/SystemEvent/system.event.create.js @@ -834,8 +834,8 @@ export class SystemEventCreate extends Component { this.setSystemEventParams('start', value[0] ? value[0] : this.state.systemevent.start) }} > <input type="text" data-input className={`p-inputtext p-component ${this.state.errors.start && this.state.touched.start ? 'input-error' : ''}`} /> - <i className="fa fa-calendar" data-toggle style={{ position: "absolute", marginLeft: '-25px', marginTop: '5px', cursor: 'pointer' }} ></i> - <i className="fa fa-times" style={{ position: "absolute", marginLeft: '-50px', marginTop: '5px', cursor: 'pointer' }} + <i className="fa fa-calendar" data-toggle style={{ position: "absolute", marginLeft: '-25px', cursor: 'pointer' }} ></i> + <i className="pi pi-times" style={{ position: "absolute", marginLeft: '-50px', cursor: 'pointer' }} onClick={() => { this.setParams('start', ''); this.setSystemEventParams('start', '') }}></i> </Flatpickr> {this.state.errors.start && this.state.touched.start && @@ -866,8 +866,8 @@ export class SystemEventCreate extends Component { this.setSystemEventParams('stop', value[0] ? value[0] : this.state.systemevent.stop) }} > <input type="text" data-input className={`p-inputtext p-component ${this.state.errors.stop && this.state.touched.stop ? 'input-error' : ''}`} /> - <i className="fa fa-calendar" data-toggle style={{ position: "absolute", marginLeft: '-25px', marginTop: '5px', cursor: 'pointer' }} ></i> - <i className="fa fa-times" style={{ position: "absolute", marginLeft: '-50px', marginTop: '5px', cursor: 'pointer' }} + <i className="fa fa-calendar" data-toggle style={{ position: "absolute", marginLeft: '-25px', cursor: 'pointer' }} ></i> + <i className="pi pi-times" style={{ position: "absolute", marginLeft: '-50px', cursor: 'pointer' }} onClick={() => { this.setParams('stop', ''); this.setSystemEventParams('stop', '') }}></i> </Flatpickr> <label className={this.state.errors.stop && this.state.touched.stop ? "error" : "info"}> diff --git a/SAS/TMSS/frontend/tmss_webapp/src/routes/SystemEvent/system.event.edit.js b/SAS/TMSS/frontend/tmss_webapp/src/routes/SystemEvent/system.event.edit.js index 7fc03c9875c3460d09ca0e233216dc225bc3c200..98c9701c4e23847fa4175b11a893175df3f60939 100644 --- a/SAS/TMSS/frontend/tmss_webapp/src/routes/SystemEvent/system.event.edit.js +++ b/SAS/TMSS/frontend/tmss_webapp/src/routes/SystemEvent/system.event.edit.js @@ -700,7 +700,7 @@ export class SystemEventEdit extends Component { }} > <input type="text" data-input className={`p-inputtext p-component ${this.state.errors.start && this.state.touched.start ? 'input-error' : ''}`} /> <i className="fa fa-calendar" data-toggle style={{ position: "absolute", marginLeft: '-25px', marginTop: '5px', cursor: 'pointer' }} ></i> - <i className="fa fa-times" style={{ position: "absolute", marginLeft: '-50px', marginTop: '5px', cursor: 'pointer' }} + <i className="pi pi-times" style={{ position: "absolute", marginLeft: '-50px', marginTop: '5px', cursor: 'pointer' }} onClick={() => { this.setParams('start', ''); this.setSystemEventParams('start', '') }}></i> </Flatpickr> {this.state.errors.start && this.state.touched.start && @@ -729,7 +729,7 @@ export class SystemEventEdit extends Component { }} > <input type="text" data-input className={`p-inputtext p-component ${this.state.errors && this.state.errors.stop && this.state.touched && this.state.touched.stop ? 'input-error' : ''}`} /> <i className="fa fa-calendar" data-toggle style={{ position: "absolute", marginLeft: '-25px', marginTop: '5px', cursor: 'pointer' }} ></i> - <i className="fa fa-times" style={{ position: "absolute", marginLeft: '-50px', marginTop: '5px', cursor: 'pointer' }} + <i className="pi pi-times" style={{ position: "absolute", marginLeft: '-50px', marginTop: '5px', cursor: 'pointer' }} onClick={() => { this.setParams('stop', ''); this.setSystemEventParams('stop', '') }}></i> </Flatpickr> </div> diff --git a/SAS/TMSS/frontend/tmss_webapp/src/routes/SystemEvent/system.event.list.js b/SAS/TMSS/frontend/tmss_webapp/src/routes/SystemEvent/system.event.list.js index 436ef03b681273940ea9000251a4db2fe93a7d9b..240d1dbb920118cfca444aba2ee2b9ef23df5da6 100644 --- a/SAS/TMSS/frontend/tmss_webapp/src/routes/SystemEvent/system.event.list.js +++ b/SAS/TMSS/frontend/tmss_webapp/src/routes/SystemEvent/system.event.list.js @@ -14,10 +14,11 @@ import AuthStore from '../../authenticate/auth.store'; import AuthUtil from '../../utils/auth.util'; import AccessDenied from '../../layout/components/AccessDenied'; -export class SystemEventList extends Component{ + +export class SystemEventList extends Component { SYSTEM_EVENT_LIST_TABLE_NAME = 'system_event_list'; - lsKeySortColumn='systemeventSortData'; - constructor(props){ + lsKeySortColumn = 'systemeventSortData'; + constructor(props) { super(props); this.state = { paths: [{ @@ -25,65 +26,65 @@ export class SystemEventList extends Component{ }], systemEventList: null, defaultcolumns: [{ - id: {name:"System Event Id"}, + id: { name: "System Event Id" }, created_at: { name: "Created", filter: "flatpickrDateRange", - format:UIConstants.CALENDAR_DATETIME_FORMAT + format: UIConstants.CALENDAR_DATETIME_FORMAT }, - name: {name:"Name"}, - description: {name:"Description"}, + name: { name: "Name" }, + description: { name: "Description" }, start: { name: "Start Time", filter: "flatpickrDateRange", - format:UIConstants.CALENDAR_DATETIME_FORMAT + format: UIConstants.CALENDAR_DATETIME_FORMAT }, stop: { name: "End Time", filter: "flatpickrDateRange", - format:UIConstants.CALENDAR_DATETIME_FORMAT + format: UIConstants.CALENDAR_DATETIME_FORMAT }, duration: { name: "Duration" }, issue_type_value: { - name:"Issue Type", + name: "Issue Type", filter: "multiselect-filter" }, issue_subtype_value: { - name:"Issue Subtype", + name: "Issue Subtype", filter: "multiselect-filter" }, - severity_value: { + severity_value: { name: "Severity", filter: "multiselect-filter" }, created_by: { name: "Created By", }, - notes:{ + notes: { name: "Notes", }, status_value: { name: "Status", filter: "multiselect-filter" - }, - affected_hardware_doc_stations:{ - name:"Affected Hardware Stations", - filter:"multiselect" + }, + affected_hardware_doc_stations: { + name: "Affected Hardware Stations", + filter: "multiselect" }, affected_tasks_ids: { - name:"Affected Tasks", + name: "Affected Tasks", }, jira_url: { name: "Jira URL", }, actionpath: "actionpath" }], - optionalcolumns: [{}], + optionalcolumns: [{}], columnclassname: [{ - "System Event Id":"filter-input-50", - "Affected Hardware Template Id":"filter-input-50", + "System Event Id": "filter-input-50", + "Affected Hardware Template Id": "filter-input-50", }], isLoading: true, userrole: AuthStore.getState() @@ -91,15 +92,12 @@ export class SystemEventList extends Component{ this.defaultSortColumn = []; this.filterQry = ''; this.orderBy = ''; - this.limit = 10; - this.offset = 0; this.currentPageSize = 10; - this.systemEvents= []; + this.systemEvents = []; this.totalPage = 0; this.pageUpdated = true; this.seAffectedHardwareTemplateList = []; this.seAffectedHardwareTemplateNameList = []; - this.seAffectedTaskList = []; this.seIssueTypeList = []; this.seIssueSubTypeList = []; this.seSeverityList = []; @@ -110,65 +108,64 @@ export class SystemEventList extends Component{ this.fetchTableData = this.fetchTableData.bind(this); this.getFilterOptions = this.getFilterOptions.bind(this); this.createSEFilterBySUBTime = this.createSEFilterBySUBTime.bind(this); - this.closeList = this.closeList.bind(this); } - async componentDidMount() { + async componentDidMount() { this.setToggleBySorting(); this.getFilterColumns(); if (this.props.schedulingUnit) { this.props.schedulingUnit.task_blueprints_ids.forEach(id => { - const tmpVar = {name: id, value: id}; + const tmpVar = { name: id, value: id }; this.affectedTasksIds.push(tmpVar); }); let systemLists = await this.fetchTableData(); - if (systemLists && systemLists[0]?.length>0) { - this.setState({systemEventList: systemLists[0]}); + if (systemLists && systemLists[0]?.length > 0) { + this.setState({ systemEventList: systemLists[0] }); } - } + } } - toggleBySorting(sortData) { - UtilService.localStore({ type: 'set', key: this.lsKeySortColumn, value: [{...sortData}] }); + toggleBySorting(sortData) { + UtilService.localStore({ type: 'set', key: this.lsKeySortColumn, value: [{ ...sortData }] }); } - setToggleBySorting() { + setToggleBySorting() { let sortData = UtilService.localStore({ type: 'get', key: this.lsKeySortColumn }); - if(sortData){ - if(Object.prototype.toString.call(sortData) === '[object Array]'){ + if (sortData) { + if (Object.prototype.toString.call(sortData) === '[object Array]') { this.defaultSortColumn = sortData; } - else{ - this.defaultSortColumn = [{...sortData}]; + else { + this.defaultSortColumn = [{ ...sortData }]; } } this.defaultSortColumn = this.defaultSortColumn || []; - UtilService.localStore({ type: 'set', key: this.lsKeySortColumn, value: [...this.defaultSortColumn] }); + UtilService.localStore({ type: 'set', key: this.lsKeySortColumn, value: [...this.defaultSortColumn] }); } /** * Get server side filter column details form API */ - async getFilterColumns() { + async getFilterColumns() { const apiFilters = await SystemEventService.getSystemEventFilterDefinition(); this.columnMap = []; let tmpDefaulColumns = _.cloneDeep(this.state.defaultcolumns[0]); let tmpOptionalColumns = _.cloneDeep(this.state.optionalcolumns[0]); let tmpColumnOrders = _.cloneDeep(this.state.columnOrders); - - if(apiFilters) { + + if (apiFilters) { this.getDropDownOptionList(apiFilters); tmpDefaulColumns = this.getAPIFilter(apiFilters, tmpDefaulColumns); tmpOptionalColumns = this.getAPIFilter(apiFilters, tmpOptionalColumns); - await this.setState({tmpDefaulcolumns: [tmpDefaulColumns], tmpOptionalcolumns:[tmpOptionalColumns], tmpColumnOrders: tmpColumnOrders, columnMap: this.columnMap}) + await this.setState({ tmpDefaulcolumns: [tmpDefaulColumns], tmpOptionalcolumns: [tmpOptionalColumns], tmpColumnOrders: tmpColumnOrders, columnMap: this.columnMap }) } } - + /** * Get Status list frol filter * @param {Array} suFilters */ - getDropDownOptionList(apiFilters) { + getDropDownOptionList(apiFilters) { this.getOptionList('Affected Hardware Stations', apiFilters); const promises = [ SystemEventService.getSEAffectedHardwareTemplates(), @@ -176,7 +173,7 @@ export class SystemEventList extends Component{ SystemEventService.getSEIssueSubTypes(), SystemEventService.getSESeverity(), SystemEventService.getSEStatus(), - ]; + ]; Promise.all(promises).then(responses => { this.seAffectedHardwareTemplateList = responses[0]; this.getOptionList('Template Name', this.seAffectedHardwareTemplateList); @@ -185,68 +182,68 @@ export class SystemEventList extends Component{ this.getOptionList('Severity', responses[3]); this.getOptionList('Status', responses[4]); //this.getOptionList('Affected Hardware Stations', apiFilters); - this.setState({isLoading: false, systemEventList: []}); + this.setState({ isLoading: false, systemEventList: [] }); }); - } + } - getOptionList(type, listObj) { + getOptionList(type, listObj) { if (type === 'Template Name') { this.seAffectedHardwareTemplateNameList = []; listObj.forEach(obj => { - const tmpVar = {name: _.startCase(obj.name), value: obj.name}; + const tmpVar = { name: _.startCase(obj.name), value: obj.name }; this.seAffectedHardwareTemplateNameList.push(tmpVar); }); - } else if (type === 'Issue Type') { + } else if (type === 'Issue Type') { this.seIssueTypeList = this.getOptionsValues(listObj, this.seIssueTypeList); - } else if (type === 'Issue Subtype') { + } else if (type === 'Issue Subtype') { this.seIssueSubTypeList = this.getOptionsValues(listObj, this.seIssueSubTypeList); - } else if (type === 'Severity') { + } else if (type === 'Severity') { this.seSeverityList = this.getOptionsValues(listObj, this.seSeverityList); - } else if (type === 'Status') { + } else if (type === 'Status') { this.seStatusList = this.getOptionsValues(listObj, this.seStatusList); - } else if (type === 'Affected Hardware Stations') { + } else if (type === 'Affected Hardware Stations') { this.seHardwareStationsList = []; listObj.data.filters.affected_hardware_doc_stations_any.choices.forEach(obj => { - const tmpVar = {name: _.startCase(obj.value), value: obj.value}; - this.seHardwareStationsList.push(tmpVar); + const tmpVar = { name: _.startCase(obj.value), value: obj.value }; + this.seHardwareStationsList.push(tmpVar); }); } - } - - /** - * update the option list values - * @param {*} listObj - * @param {*} list - * @returns - */ - getOptionsValues(listObj, list) { + } + + /** + * update the option list values + * @param {*} listObj + * @param {*} list + * @returns + */ + getOptionsValues(listObj, list) { list = []; listObj.forEach(obj => { - const tmpVar = {name: _.startCase(obj.value), value: obj.value}; + const tmpVar = { name: _.startCase(obj.value), value: obj.value }; list.push(tmpVar); }); return list; - } + } - /** - * Get Option-list values for Select Dropdown filter in 'Viewtable' - * @param {String} id : Column id - * @returns - */ - getFilterOptions(id) { + /** + * Get Option-list values for Select Dropdown filter in 'Viewtable' + * @param {String} id : Column id + * @returns + */ + getFilterOptions(id) { let options = null; - if(id && id === 'Status') { + if (id && id === 'Status') { options = this.seStatusList; - } else if (id && id === 'Issue Type') { + } else if (id && id === 'Issue Type') { options = this.seIssueTypeList; - } else if (id === 'Issue Subtype') { + } else if (id === 'Issue Subtype') { options = this.seIssueSubTypeList; - } else if (id === 'Severity') { + } else if (id === 'Severity') { options = this.seSeverityList; - } else if (id === 'Template Name') { + } else if (id === 'Template Name') { options = this.seAffectedHardwareTemplateNameList; - } else if (id === 'Affected Hardware Stations') { - options = _.orderBy(this.seHardwareStationsList, ['name'], ['asc']); + } else if (id === 'Affected Hardware Stations') { + options = _.orderBy(this.seHardwareStationsList, ['name'], ['asc']); }/* else if (id === 'Affected Tasks') { if (this.props.schedulingUnit) { options = _.orderBy(this.affectedTasksIds, ['name'], ['asc']); @@ -261,91 +258,93 @@ export class SystemEventList extends Component{ * @param {*} columnDef * @returns */ - getAPIFilter(apiFilters, columnDef) { + getAPIFilter(apiFilters, columnDef) { const defaultColKeys = Object.keys(columnDef); defaultColKeys.forEach(key => { let tmpColMap = {}; let tempKey = key; tmpColMap['orgField'] = tempKey; tmpColMap['tmpField'] = tempKey; - if(columnDef[key]) { + if (columnDef[key]) { tmpColMap['displayName'] = columnDef[key]['name']; } this.columnMap.push(tmpColMap); //Set Enable/Disable the Filter & SortBy in each column - if(apiFilters.data.filters[tempKey]) { + if (apiFilters.data.filters[tempKey]) { columnDef[key]['disableSortBy'] = !_.includes(apiFilters.data.ordering, tempKey); columnDef[key]['disableFilters'] = false; - if( (tempKey !== 'start' && tempKey !== 'stop') && UIConstants.FILTER_MAP[apiFilters.data.filters[tempKey].type]) { + if ((tempKey !== 'start' && tempKey !== 'stop') && UIConstants.FILTER_MAP[apiFilters.data.filters[tempKey].type]) { columnDef[key]['filter'] = UIConstants.FILTER_MAP[apiFilters.data.filters[tempKey].type]; } - } else if (key === 'issue_subtype_value' && apiFilters.data.filters['issue_subtype']) { + } else if (key === 'issue_subtype_value' && apiFilters.data.filters['issue_subtype']) { columnDef[key]['disableSortBy'] = !_.includes(apiFilters.data.ordering, 'issue_subtype'); columnDef[key]['disableFilters'] = false; - } else if (key === 'issue_type_value' && apiFilters.data.filters['issue_type']) { + } else if (key === 'issue_type_value' && apiFilters.data.filters['issue_type']) { columnDef[key]['disableSortBy'] = !_.includes(apiFilters.data.ordering, 'issue_type'); columnDef[key]['disableFilters'] = false; - } else if (key === 'status_value' && apiFilters.data.filters['status']) { + } else if (key === 'status_value' && apiFilters.data.filters['status']) { columnDef[key]['disableSortBy'] = !_.includes(apiFilters.data.ordering, 'status'); columnDef[key]['disableFilters'] = false; - } else if (key === 'affected_hardware_template_id' && apiFilters.data.filters['affected_hardware_template']) { + } else if (key === 'affected_hardware_template_id' && apiFilters.data.filters['affected_hardware_template']) { columnDef[key]['disableSortBy'] = !_.includes(apiFilters.data.ordering, 'affected_hardware_template'); columnDef[key]['disableFilters'] = false; - } else if (key === 'severity_value' && apiFilters.data.filters['severity']) { + } else if (key === 'severity_value' && apiFilters.data.filters['severity']) { columnDef[key]['disableSortBy'] = !_.includes(apiFilters.data.ordering, 'severity'); columnDef[key]['disableFilters'] = false; - } else if (key === 'affected_tasks_ids' && apiFilters.data.filters['affected_tasks']) { + } else if (key === 'affected_tasks_ids' && apiFilters.data.filters['affected_tasks']) { columnDef[key]['disableSortBy'] = !_.includes(apiFilters.data.ordering, 'affected_tasks'); columnDef[key]['disableFilters'] = false; - } else if (key === 'affected_hardware_doc_stations' + } else if (key === 'affected_hardware_doc_stations' && (apiFilters.data.filters['affected_hardware_doc_stations_any'] || apiFilters.data.filters['affected_hardware_doc_stations_all'])) { columnDef[key]['disableSortBy'] = apiFilters.data.filters['affected_hardware_doc_stations_any'] - ?!_.includes(apiFilters.data.ordering, 'affected_hardware_doc_stations_any') - : apiFilters.data.filters['affected_hardware_doc_stations_all'] + ? !_.includes(apiFilters.data.ordering, 'affected_hardware_doc_stations_any') + : apiFilters.data.filters['affected_hardware_doc_stations_all'] ? !_.includes(apiFilters.data.ordering, 'affected_hardware_doc_stations_all') - :true; + : true; columnDef[key]['disableFilters'] = false; } }); return columnDef; } - + /** * Create default System Event (SE) filter for last 24 Hrs using SUB on sky time */ async createSEFilterBySUBTime() { - this.setState({defaultcolumns: [{ - id: {name:"System Event Id"}, - name: {name:"Name"}, - description: {name:"Description"}, - start: { - name: "Start Time", - filter: "flatpickrDateRange", - format:UIConstants.CALENDAR_DATETIME_FORMAT - }, - stop: { - name: "End Time", - filter: "flatpickrDateRange", - format:UIConstants.CALENDAR_DATETIME_FORMAT - }, - affected_tasks_ids: { - name:"Affected Tasks", - }, - created_at: { - name: "Created", - filter: "flatpickrDateRange", - format:UIConstants.CALENDAR_DATETIME_FORMAT - }, - actionpath: "actionpath" - }]}); + this.setState({ + defaultcolumns: [{ + id: { name: "System Event Id" }, + name: { name: "Name" }, + description: { name: "Description" }, + start: { + name: "Start Time", + filter: "flatpickrDateRange", + format: UIConstants.CALENDAR_DATETIME_FORMAT + }, + stop: { + name: "End Time", + filter: "flatpickrDateRange", + format: UIConstants.CALENDAR_DATETIME_FORMAT + }, + affected_tasks_ids: { + name: "Affected Tasks", + }, + created_at: { + name: "Created", + filter: "flatpickrDateRange", + format: UIConstants.CALENDAR_DATETIME_FORMAT + }, + actionpath: "actionpath" + }] + }); let filterQry = ''; if (this.props.schedulingUnit.on_sky_stop_time) { - filterQry = 'start_before='+ moment(this.props.schedulingUnit.on_sky_stop_time).format("YYYY-MM-DDTHH:mm:ss")+".000Z&"; + filterQry = 'start_before=' + moment(this.props.schedulingUnit.on_sky_stop_time).format("YYYY-MM-DDTHH:mm:ss") + ".000Z&"; } if (this.props.schedulingUnit.on_sky_start_time) { var stopTime = new Date(this.props.schedulingUnit.on_sky_start_time); - stopTime.setDate(stopTime.getDate()-1); - filterQry += 'stop_after='+ moment(stopTime).format("YYYY-MM-DDTHH:mm:ss")+".000Z"; + stopTime.setDate(stopTime.getDate() - 1); + filterQry += 'stop_after=' + moment(stopTime).format("YYYY-MM-DDTHH:mm:ss") + ".000Z"; } return filterQry; } @@ -355,134 +354,132 @@ export class SystemEventList extends Component{ * @param {Table State} Table props state * @returns */ - async fetchTableData(state) { + async fetchTableData(state) { this.filterQry = ''; this.orderBy = ''; this.pageUpdated = true; - this.setState({loadingStatus:true}); + this.setState({ loadingStatus: true }); this.currentPageSize = (state && state.pageSize) ? state.pageSize : this.currentPageSize; - let offset = (state && state.pageIndex) ? state.pageIndex*this.currentPageSize : 0; - const sortByValue = UtilService.localStore({ type: 'get', key: this.lsKeySortColumn}); - let filters = UtilService.localStore({ type: 'get', key: this.SYSTEM_EVENT_LIST_TABLE_NAME}); + let offset = (state && state.pageIndex) ? state.pageIndex * this.currentPageSize : 0; + const sortByValue = UtilService.localStore({ type: 'get', key: this.lsKeySortColumn }); + let filters = UtilService.localStore({ type: 'get', key: this.SYSTEM_EVENT_LIST_TABLE_NAME }); if (this.props.schedulingUnit) { - filters = []; - let affectedTasksList = _.find(filters, {id: 'Affected Tasks'}); + filters = []; + let affectedTasksList = _.find(filters, { id: 'Affected Tasks' }); if (!affectedTasksList || affectedTasksList.length === 0) { - filters.push({'id': 'Affected Tasks', 'value': this.props.schedulingUnit.task_blueprints_ids}) + filters.push({ 'id': 'Affected Tasks', 'value': this.props.schedulingUnit.task_blueprints_ids }) } } - if(filters.length > 0 ) { - for( const filter of filters) { - if (filter.id === 'Created') { - const values = filter.value; - if (values[0] && values[0] !== '') { - this.filterQry += 'created_at_after='+ moment(new Date(values[0])).format("YYYY-MM-DD HH:mm:SS&"); - } - if (values[1] && values[1] !== '') { - this.filterQry += 'created_at_before='+moment(new Date(values[1])).format("YYYY-MM-DD HH:mm:ss&"); - } - } else if (filter.id === 'Start Time') { - const values = filter.value; - if (values[0] && values[0] !== '') { - this.filterQry += 'start_after='+ moment(new Date(values[0])).format("YYYY-MM-DD HH:mm:SS&"); - } - if (values[1] && values[1] !== '') { - this.filterQry += 'start_before='+moment(new Date(values[1])).format("YYYY-MM-DD HH:mm:ss&"); - } - } else if (filter.id === 'End Time') { - const values = filter.value; - if (values[0] && values[0] !== '') { - this.filterQry += 'stop_after='+ moment(new Date(values[0])).format("YYYY-MM-DD 00:00:00&"); - } - if (values[1] && values[1] !== '') { - this.filterQry += 'stop_before='+moment(new Date(values[1])).format("YYYY-MM-DD 23:59:59&"); - } - } else if (filter.id === 'Affected Hardware Stations') { - const stationFilterType = _.find(filters, {id:'stationFilterType'}); - if(filter.value.length>0) { - const values = _.split(filter.value, ","); - for ( const value of values) { - if(stationFilterType && stationFilterType.value === 'All') { - this.filterQry += 'affected_hardware_doc_stations_all='+value+"&"; - } else { - this.filterQry += 'affected_hardware_doc_stations_any='+value+"&"; + if (filters.length > 0) { + for (const filter of filters) { + if (filter.id === 'Created') { + const values = filter.value; + if (values[0] && values[0] !== '') { + this.filterQry += 'created_at_after=' + moment(new Date(values[0])).format("YYYY-MM-DD HH:mm:SS&"); + } + if (values[1] && values[1] !== '') { + this.filterQry += 'created_at_before=' + moment(new Date(values[1])).format("YYYY-MM-DD HH:mm:ss&"); + } + } else if (filter.id === 'Start Time') { + const values = filter.value; + if (values[0] && values[0] !== '') { + this.filterQry += 'start_after=' + moment(new Date(values[0])).format("YYYY-MM-DD HH:mm:SS&"); + } + if (values[1] && values[1] !== '') { + this.filterQry += 'start_before=' + moment(new Date(values[1])).format("YYYY-MM-DD HH:mm:ss&"); + } + } else if (filter.id === 'End Time') { + const values = filter.value; + if (values[0] && values[0] !== '') { + this.filterQry += 'stop_after=' + moment(new Date(values[0])).format("YYYY-MM-DD 00:00:00&"); + } + if (values[1] && values[1] !== '') { + this.filterQry += 'stop_before=' + moment(new Date(values[1])).format("YYYY-MM-DD 23:59:59&"); + } + } else if (filter.id === 'Affected Hardware Stations') { + const stationFilterType = _.find(filters, { id: 'stationFilterType' }); + if (filter.value.length > 0) { + const values = _.split(filter.value, ","); + for (const value of values) { + if (stationFilterType && stationFilterType.value === 'All') { + this.filterQry += 'affected_hardware_doc_stations_all=' + value + "&"; + } else { + this.filterQry += 'affected_hardware_doc_stations_any=' + value + "&"; + } } } - } - } else if (filter.id === 'Status') { - const values = filter.value; - if (values[0] && values[0] !== '') { - for ( const value of values) { - this.filterQry += 'status='+value+'&'; + } else if (filter.id === 'Status') { + const values = filter.value; + if (values[0] && values[0] !== '') { + for (const value of values) { + this.filterQry += 'status=' + value + '&'; + } } - } - } else if (filter.id === 'Issue Type') { - const values = filter.value; - if (values[0] && values[0] !== '') { - for ( const value of values) { - this.filterQry += 'issue_type='+value+'&'; + } else if (filter.id === 'Issue Type') { + const values = filter.value; + if (values[0] && values[0] !== '') { + for (const value of values) { + this.filterQry += 'issue_type=' + value + '&'; + } } - } - } else if (filter.id === 'Issue Subtype') { - const values = filter.value; - if (values[0] && values[0] !== '') { - for ( const value of values) { - this.filterQry += 'issue_subtype='+value+'&'; + } else if (filter.id === 'Issue Subtype') { + const values = filter.value; + if (values[0] && values[0] !== '') { + for (const value of values) { + this.filterQry += 'issue_subtype=' + value + '&'; + } } - } - } else if (filter.id === 'Affected Hardware Template Id') { - if (filter.value && filter.value !== '') { - this.filterQry += 'affected_hardware_template='+filter.value+'&'; - } - } else if (filter.id === 'Severity') { - const values = filter.value; - if (values[0] && values[0] !== '') { - for ( const value of values) { - this.filterQry += 'severity='+value+'&'; + } else if (filter.id === 'Affected Hardware Template Id') { + if (filter.value && filter.value !== '') { + this.filterQry += 'affected_hardware_template=' + filter.value + '&'; + } + } else if (filter.id === 'Severity') { + const values = filter.value; + if (values[0] && values[0] !== '') { + for (const value of values) { + this.filterQry += 'severity=' + value + '&'; + } + } + } else if (filter.id === 'Affected Tasks') { + let values = []; + if (Array.isArray(filter.value)) { + values = filter.value; + } else { + values = UnitConverter.getSubbandOutput(filter.value); + } + for (const value of values) { + this.filterQry += 'affected_tasks=' + value + '&'; + } + } else if (filter.id === 'System Event Id') { + const values = UnitConverter.getSubbandOutput(filter.value); + if (values && values.length > 0) { + this.filterQry += 'id_min=' + values[0] + '&'; + this.filterQry += 'id_max=' + values[values.length - 1] + '&'; + } + } else { + let columnDetails = _.find(this.state.columnMap, { displayName: filter.id }); + if (columnDetails) { + this.filterQry += columnDetails.orgField + '=' + encodeURIComponent(filter.value) + '&' } } - } else if (filter.id === 'Affected Tasks') { - let values = []; - if (Array.isArray(filter.value)) { - values = filter.value; - } else { - values = UnitConverter.getSubbandOutput(filter.value); - } - for ( const value of values) { - this.filterQry += 'affected_tasks='+value+'&'; - } - } else if (filter.id === 'System Event Id') { - const values = UnitConverter.getSubbandOutput(filter.value); - if (values && values.length>0) { - this.filterQry += 'id_min='+values[0]+'&'; - this.filterQry += 'id_max='+values[values.length-1]+'&'; - } - } else { - let columnDetails = _.find(this.state.columnMap, {displayName:filter.id}); - if(columnDetails) { - this.filterQry += columnDetails.orgField +'='+ encodeURIComponent(filter.value) +'&' - } - } } } - - let sortBy = state && state.sortBy?state.sortBy[0]:(sortByValue)?sortByValue:null; + + let sortBy = state && state.sortBy ? state.sortBy[0] : (sortByValue) ? sortByValue : null; if (sortBy) { this.defaultSortColumn = sortBy; - //this.setState({defaultSortColumn: [sortBy]}); - UtilService.localStore({ type: 'set', key: this.lsKeySortColumn ,value:sortBy}); - let columnDetails = _.find(this.state.columnMap, {displayName:sortBy.id}); - if(columnDetails) { - this.orderBy = 'ordering='+((sortBy.desc)?'-':'')+columnDetails.orgField; + + UtilService.localStore({ type: 'set', key: this.lsKeySortColumn, value: sortBy }); + let columnDetails = _.find(this.state.columnMap, { displayName: sortBy.id }); + if (columnDetails) { + this.orderBy = 'ordering=' + ((sortBy.desc) ? '-' : '') + columnDetails.orgField; } } - this.filterQry = this.filterQry.substring(0,this.filterQry.length-1); - // this.currentPageSize = (state && state.pageSize) ? state.pageSize : this.currentPageSize; - // let offset = (state && state.pageIndex) ? state.pageIndex*this.currentPageSize : 0; + this.filterQry = this.filterQry.substring(0, this.filterQry.length - 1); await this.getSystemEventList(this.filterQry, this.orderBy, this.currentPageSize, offset); return [this.systemEvents, this.totalPage]; - } + } /** @@ -496,37 +493,36 @@ export class SystemEventList extends Component{ if (this.props.schedulingUnit) { limit = ''; } - const promises = [ + const promises = [ AuthUtil.getUserRolePermission(), SystemEventService.getSystemEventWithFilter(filterQry, orderBy, limit, offset), ]; - //this.systemEvents = []; await Promise.all(promises).then(responses => { let systemEvent = {}; - this.setState({userrole: responses[0]}); - this.totalPage = responses[1] && responses[1].data?responses[1].data.count:1; + this.setState({ userrole: responses[0] }); + this.totalPage = responses[1] && responses[1].data ? responses[1].data.count : 1; this.systemEvents = []; - if (responses[1] && responses[1].data) { - for( const response of responses[1].data.results){ + if (responses[1] && responses[1].data) { + for (const response of responses[1].data.results) { systemEvent = response; - if (response.affected_hardware_doc.stations ) { + if (response.affected_hardware_doc.stations) { systemEvent['affected_hardware_doc_stations'] = response.affected_hardware_doc.stations.join(', '); } else { systemEvent['affected_hardware_doc_stations'] = ''; } - systemEvent['duration'] = systemEvent.stop? UnitConverter.getSecsToDDHHmmss(moment(systemEvent.stop).diff(moment(systemEvent.start), 'seconds')): 'Unknown'; - if(systemEvent.stop === null || systemEvent.stop === ''){ + systemEvent['duration'] = systemEvent.stop ? UnitConverter.getSecsToDDHHmmss(moment(systemEvent.stop).diff(moment(systemEvent.start), 'seconds')) : 'Unknown'; + if (systemEvent.stop === null || systemEvent.stop === '') { systemEvent['stop'] = 'Unknown'; } else { systemEvent['stop'] = moment(systemEvent['stop']).format(UIConstants.CALENDAR_DATETIME_FORMAT); } - systemEvent['start']= moment(systemEvent['start']).format(UIConstants.CALENDAR_DATETIME_FORMAT); + systemEvent['start'] = moment(systemEvent['start']).format(UIConstants.CALENDAR_DATETIME_FORMAT); systemEvent['actionpath'] = `/systemevent/view/${systemEvent.id}`; systemEvent['tmp_affected_tasks_ids'] = systemEvent.affected_tasks_ids; systemEvent['affected_tasks_ids'] = this.getLinksList(systemEvent.affected_tasks_ids); - const template = _.find(this.seAffectedHardwareTemplateList, {id: systemEvent.affected_hardware_template_id}); - systemEvent['affected_hardware_template_name'] = (template)?_.startCase(template.name):''; - systemEvent['jira_url']= <a href={systemEvent.jira_url} target="_blank" rel="noreferrer">{systemEvent.jira_url}</a>; + const template = _.find(this.seAffectedHardwareTemplateList, { id: systemEvent.affected_hardware_template_id }); + systemEvent['affected_hardware_template_name'] = (template) ? _.startCase(template.name) : ''; + systemEvent['jira_url'] = <a href={systemEvent.jira_url} target="_blank" rel="noreferrer">{systemEvent.jira_url}</a>; this.systemEvents.push(systemEvent); } } @@ -536,7 +532,7 @@ export class SystemEventList extends Component{ systemEventList: this.systemEvents, }); - + }); } @@ -545,18 +541,25 @@ export class SystemEventList extends Component{ * @param {Array} linkedItems - list of ids * @param {String} type - blueprint or draft */ - getLinksList = (linkedItems, type) => { + getLinksList = (linkedItems, type) => { return ( <> - {linkedItems.length>0 && linkedItems.map((item) => ( - <Link style={{paddingRight: '3px'}} to={`/task/view/blueprint/${item}`} key={item}>{item}</Link> + {linkedItems.length > 0 && linkedItems.map((item) => ( + <Link style={{ paddingRight: '3px' }} to={`/task/view/blueprint/${item}`} key={item}>{item}</Link> ))} </> - ); + ); + } + + closeList = () => { + this.props.history.length > 1 ? this.props.history.goBack() : this.props.history.push(`/su/timelineview/week`); } - closeList(){ - this.props.history.length>1?this.props.history.goBack():this.props.history.push(`/su/timelineview/week`); + + + // GO to create a new system event page. + movetoEdit = () => { + this.props.history.push(`/systemevent/create`); } /** @@ -566,49 +569,62 @@ export class SystemEventList extends Component{ this.fetchTableData(); } + renderSystemEventList = () => { + if (this.state.systemEventList) { + return ( + <ViewTable + data={this.state.systemEventList} + defaultcolumns={this.state.tmpDefaulcolumns ? this.state.tmpDefaulcolumns : this.state.defaultcolumns} + optionalcolumns={this.state.tmpOptionalcolumns ? this.state.tmpOptionalcolumns : this.state.optionalcolumns} + columnclassname={this.state.columnclassname} + defaultSortColumn={this.defaultSortColumn} + showaction="true" + showActionInNewTab={this.props.schedulingUnit ? true : false} + paths={this.state.paths} + tablename={this.SYSTEM_EVENT_LIST_TABLE_NAME} + showCSV={this.props.schedulingUnit ? false : true} + allowRowSelection={false} + onRowSelection={''} + toggleBySorting={(sortData) => this.toggleBySorting(sortData)} + lsKeySortColumn={this.lsKeySortColumn} + pageUpdated={this.pageUpdated} + storeFilter={this.props.schedulingUnit ? false : true} + callBackFunction={this.props.schedulingUnit ? null : this.fetchTableData} + showFilterOption={this.getFilterOptions} + totalPage={this.totalPage} + showTopTotal={this.props.schedulingUnit ? false : true} + />); + } else { return <div>No System Event found </div> } + + } + render() { const permissions = this.state.userrole.userRolePermission.systemevent; - return( + return ( <React.Fragment> {!this.props.schedulingUnit && - <PageHeader location={this.props.location} title={'System Issues - List'} - actions={[{icon: 'fa-plus-square', - title:permissions.create?'Add System Event': "Don't have permission to add new System Event", - disabled: permissions.create? !permissions.create: true, - props : { pathname: `/systemevent/create`}}, - {icon: 'fa-window-close', title:'Click to close System Issues list', type: 'button', - actOn: 'click', props:{ callback: this.closeList }}]}/> - } - {this.state.isLoading? <AppLoader /> : (permissions.list) ? - <> - {this.state.systemEventList? - <> - <ViewTable - data={this.state.systemEventList} - defaultcolumns={this.state.tmpDefaulcolumns ? this.state.tmpDefaulcolumns : this.state.defaultcolumns} - optionalcolumns={this.state.tmpOptionalcolumns ? this.state.tmpOptionalcolumns : this.state.optionalcolumns} - columnclassname={this.state.columnclassname} - defaultSortColumn={this.defaultSortColumn} - showaction="true" - showActionInNewTab={this.props.schedulingUnit?true:false} - paths={this.state.paths} - tablename={this.SYSTEM_EVENT_LIST_TABLE_NAME} - showCSV={this.props.schedulingUnit?false:true} - allowRowSelection={false} - onRowSelection={''} - toggleBySorting={(sortData) => this.toggleBySorting(sortData)} - lsKeySortColumn={this.lsKeySortColumn} - pageUpdated={this.pageUpdated} - storeFilter={this.props.schedulingUnit?false:true} - callBackFunction={this.props.schedulingUnit?null:this.fetchTableData} - showFilterOption={this.getFilterOptions} - totalPage={this.totalPage} - showTopTotal={this.props.schedulingUnit?false:true} - /> - </>: <div>No System Event found </div>} - </> - : <AccessDenied/> + <PageHeader className="defaultpageHeader" location={this.props.location} title={'System Issues - List'} + actions={[ + + { + icon: 'pi-plus', title: permissions.create ? 'Add System Event' : "Don't have permission to add new System Event", + disabled: permissions.create ? !permissions.create : true, type: 'buttonv2', + actOn: 'click', props: { callback: this.movetoEdit } + }, + + { + icon: 'pi-times', title: 'Click to close System Issues list', type: 'buttonv2', + actOn: 'click', props: { callback: this.closeList } + } + ]} /> } + {this.state.isLoading ? ( + <AppLoader /> +) : permissions.list ? ( + this.renderSystemEventList() +) : ( + <AccessDenied /> +)} </React.Fragment> ); } diff --git a/SAS/TMSS/frontend/tmss_webapp/src/routes/Task/dataproduct.js b/SAS/TMSS/frontend/tmss_webapp/src/routes/Task/dataproduct.js index 29fd98482033c389ee2c8166d085d901a1e51498..345ec6595bc2fd091e7194d7978bc421bb9d7d0d 100644 --- a/SAS/TMSS/frontend/tmss_webapp/src/routes/Task/dataproduct.js +++ b/SAS/TMSS/frontend/tmss_webapp/src/routes/Task/dataproduct.js @@ -114,7 +114,7 @@ export class DataProduct extends Component{ {this.state.task && <Link to={{ pathname:`/task/view/blueprint/${this.state.taskId}`}} title="Close" style={{float:'right'}}> - <i className="fa fa-times" style={{marginTop: "10px", marginLeft: '5px'}}></i> + <i className="pi pi-times" style={{marginTop: "10px", marginLeft: '5px'}}></i> </Link> } </div> diff --git a/SAS/TMSS/frontend/tmss_webapp/src/routes/Task/summary.js b/SAS/TMSS/frontend/tmss_webapp/src/routes/Task/summary.js index f23e8bedebf9053fd51d9d6cbb1c21c76488fca7..dafab526755e471adc689a95d74389d22735f4a0 100644 --- a/SAS/TMSS/frontend/tmss_webapp/src/routes/Task/summary.js +++ b/SAS/TMSS/frontend/tmss_webapp/src/routes/Task/summary.js @@ -82,7 +82,7 @@ export class TaskSummary extends Component { <div className="timeline-details-header"> <h6 className="col-lg-10 col-sm-10">Task Details</h6> <Link onClick={this.redirectToTaskDetails} title="View Full Details"><i className="fa fa-eye"></i></Link> - <Link to={this.props.location?this.props.location.pathname:"/su/timelineview/week"} onClick={this.closeTaskDets} title="Close Details"><i className="fa fa-times"></i></Link> + <Link to={this.props.location?this.props.location.pathname:"/su/timelineview/week"} onClick={this.closeTaskDets} title="Close Details"><i className="pi pi-times"></i></Link> </div> <DetailsSummary fields={summaryFields}/> {taskDetails.status === 'unschedulable' && diff --git a/SAS/TMSS/frontend/tmss_webapp/src/routes/Workflow/task.assigner.js b/SAS/TMSS/frontend/tmss_webapp/src/routes/Workflow/task.assigner.js index 4516cb2f99fe3c1cfd61a7aa17055c2a1ec1f39f..c9e2600b5720bfc07fa4ef1cfd776fd4cd9ebd19 100644 --- a/SAS/TMSS/frontend/tmss_webapp/src/routes/Workflow/task.assigner.js +++ b/SAS/TMSS/frontend/tmss_webapp/src/routes/Workflow/task.assigner.js @@ -90,7 +90,7 @@ class TaskAssigner extends Component { className={allowSave?'':'disabled-link'}> <i className="fa fa-check"></i></Link> <Link to="#" onClick={() => {this.props.callback()}}> - <i className="fa fa-times"></i></Link> + <i className="pi pi-times"></i></Link> </div> </> );