diff --git a/SAS/TMSS/frontend/tmss_webapp/.vscode/launch.json b/SAS/TMSS/frontend/tmss_webapp/.vscode/launch.json new file mode 100644 index 0000000000000000000000000000000000000000..562cc6407751b4c6d49918adf7d55ce016035527 --- /dev/null +++ b/SAS/TMSS/frontend/tmss_webapp/.vscode/launch.json @@ -0,0 +1,15 @@ +{ + // Use IntelliSense to learn about possible attributes. + // Hover to view descriptions of existing attributes. + // For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387 + "version": "0.2.0", + "configurations": [ + { + "type": "pwa-chrome", + "request": "launch", + "name": "Launch Chrome against localhost", + "url": "http://localhost:3000", + "webRoot": "${workspaceFolder}" + } + ] +} \ No newline at end of file diff --git a/SAS/TMSS/frontend/tmss_webapp/src/components/ViewTable.js b/SAS/TMSS/frontend/tmss_webapp/src/components/ViewTable.js index 12520b372ca74cf6ca3911d0e84aae2ecab50313..fd30367246054ff154717613237494e88d5af81a 100644 --- a/SAS/TMSS/frontend/tmss_webapp/src/components/ViewTable.js +++ b/SAS/TMSS/frontend/tmss_webapp/src/components/ViewTable.js @@ -963,7 +963,7 @@ function ViewTable(props) { }, disableFilters: true, disableSortBy: true, - isVisible: defaultdataheader.includes(props.keyaccessor), + isVisible: true, }); } diff --git a/SAS/TMSS/frontend/tmss_webapp/src/routes/Task/view.js b/SAS/TMSS/frontend/tmss_webapp/src/routes/Task/view.js index 8a5fe8ea36ca313089e04a5154f7d7899a37d83b..bde2f9d803f8bb2cc98f7fa7bb4a3bbe2aa11a1b 100644 --- a/SAS/TMSS/frontend/tmss_webapp/src/routes/Task/view.js +++ b/SAS/TMSS/frontend/tmss_webapp/src/routes/Task/view.js @@ -253,7 +253,7 @@ export class TaskView extends Component { } </div> </div> */} - <PageHeader location={this.props.location} title={'Task - View'} + <PageHeader location={this.props.location} title={'Task - Details'} actions={actions}/> { this.state.isLoading? <AppLoader /> : this.state.task && <React.Fragment> diff --git a/SAS/TMSS/frontend/tmss_webapp/src/routes/Timeline/reservation.create.js b/SAS/TMSS/frontend/tmss_webapp/src/routes/Timeline/reservation.create.js index c59daa3c9e916db4055e6c92e40ecdc81fd3d6ef..9e8b62e630b6223229acd244a09675681b6b49dc 100644 --- a/SAS/TMSS/frontend/tmss_webapp/src/routes/Timeline/reservation.create.js +++ b/SAS/TMSS/frontend/tmss_webapp/src/routes/Timeline/reservation.create.js @@ -3,20 +3,19 @@ import { Redirect } from 'react-router-dom'; import _ from 'lodash'; import moment from 'moment'; import { Growl } from 'primereact/components/growl/Growl'; -import AppLoader from '../../layout/components/AppLoader'; -import PageHeader from '../../layout/components/PageHeader'; -import UIConstants from '../../utils/ui.constants'; -import Flatpickr from "react-flatpickr"; -import { InputMask } from 'primereact/inputmask'; import { Dropdown } from 'primereact/dropdown'; import {InputText } from 'primereact/inputtext'; import { InputTextarea } from 'primereact/inputtextarea'; import { Button } from 'primereact/button'; import { Dialog } from 'primereact/components/dialog/Dialog'; +import Flatpickr from "react-flatpickr"; + +import AppLoader from '../../layout/components/AppLoader'; +import PageHeader from '../../layout/components/PageHeader'; +import UIConstants from '../../utils/ui.constants'; import { CustomDialog } from '../../layout/components/CustomDialog'; import ProjectService from '../../services/project.service'; import ReservationService from '../../services/reservation.service'; -import UnitService from '../../utils/unit.converter'; import Jeditor from '../../components/JSONEditor/JEditor'; import UtilService from '../../services/util.service'; @@ -317,6 +316,10 @@ export class ReservationCreate extends Component { let jeditor = null; if (schema) { + if (this.state.reservation.specifications_doc) { + delete this.state.reservation.specifications_doc.$id; + delete this.state.reservation.specifications_doc.$schema; + } jeditor = React.createElement(Jeditor, {title: "Reservation Parameters", schema: schema, initValue: this.state.paramsOutput, diff --git a/SAS/TMSS/frontend/tmss_webapp/src/routes/Timeline/reservation.edit.js b/SAS/TMSS/frontend/tmss_webapp/src/routes/Timeline/reservation.edit.js index bb668b5e2a3b4c78c01763863ce85012cd14bce4..9c0329023f5004e966fe24201f501cc6bfdd42b6 100644 --- a/SAS/TMSS/frontend/tmss_webapp/src/routes/Timeline/reservation.edit.js +++ b/SAS/TMSS/frontend/tmss_webapp/src/routes/Timeline/reservation.edit.js @@ -70,11 +70,13 @@ export class ReservationEdit extends Component { const promises = [ ProjectService.getProjectList(), ReservationService.getReservationTemplates(), + UtilService.getUTC() ]; let emptyProjects = [{url: null, name: "Select Project"}]; Promise.all(promises).then(responses => { this.projects = emptyProjects.concat(responses[0]); this.reservationTemplates = responses[1]; + let systemTime = moment.utc(responses[2]); let schema = { properties: {} }; @@ -84,6 +86,7 @@ export class ReservationEdit extends Component { this.setState({ paramsSchema: schema, isLoading: false, + systemTime: systemTime }); this.getReservationDetails(reserId); }); @@ -320,7 +323,7 @@ export class ReservationEdit extends Component { delete this.state.reservation.specifications_doc.$id; delete this.state.reservation.specifications_doc.$schema; } - jeditor = React.createElement(Jeditor, {title: "Specification", + jeditor = React.createElement(Jeditor, {title: "Reservation Parameters", schema: this.state.reservationTemplate.schema, initValue: this.state.reservation.specifications_doc, disabled: false, @@ -377,7 +380,9 @@ export class ReservationEdit extends Component { "time_24hr": true, "minuteIncrement": 1, "allowInput": true, - + "defaultDate": this.state.systemTime.format(UIConstants.CALENDAR_DEFAULTDATE_FORMAT), + "defaultHour": this.state.systemTime.hours(), + "defaultMinute": this.state.systemTime.minutes() }} title="Start of this reservation" value={this.state.reservation.start_time} @@ -403,8 +408,10 @@ export class ReservationEdit extends Component { "time_24hr": true, "minuteIncrement": 1, "allowInput": true, - "minDate": this.state.reservation.start_time?this.state.reservation.start_time.toDate:'', - + "minDate": this.state.reservation.stop_time?this.state.reservation.stop_time.toDate:'', + "defaultDate": this.state.systemTime.format(UIConstants.CALENDAR_DEFAULTDATE_FORMAT), + "defaultHour": this.state.systemTime.hours(), + "defaultMinute": this.state.systemTime.minutes() }} title="End of this reservation. If empty, then this reservation is indefinite." value={this.state.reservation.stop_time} diff --git a/SAS/TMSS/frontend/tmss_webapp/src/routes/Timeline/reservation.view.js b/SAS/TMSS/frontend/tmss_webapp/src/routes/Timeline/reservation.view.js index 8ad8e6f17c71f316d52f7528f85b77735420001e..1b7d7bfd83feaa50345d1c854b4ae566b75fef0b 100644 --- a/SAS/TMSS/frontend/tmss_webapp/src/routes/Timeline/reservation.view.js +++ b/SAS/TMSS/frontend/tmss_webapp/src/routes/Timeline/reservation.view.js @@ -50,7 +50,7 @@ export class ReservationView extends Component { /** - * To get the task details from the backend using the service + * To get the Reservation details from the backend using the service * @param {number} Reservation Id */ getReservationDetails(id) { @@ -91,7 +91,7 @@ export class ReservationView extends Component { } /** - * Prepare Task details to show on confirmation dialog + * Prepare Reservation details to show on confirmation dialog */ getDialogContent() { let reservation = this.state.reservation; @@ -145,7 +145,7 @@ export class ReservationView extends Component { delete this.state.reservation.specifications_doc.$id; delete this.state.reservation.specifications_doc.$schema; } - jeditor = React.createElement(Jeditor, {title: "Specification", + jeditor = React.createElement(Jeditor, {title: "Reservation Parameters", schema: this.state.reservationTemplate.schema, initValue: this.state.reservation.specifications_doc, disabled: true, @@ -153,14 +153,14 @@ export class ReservationView extends Component { } let actions = [ ]; - actions.push({ icon: 'fa-edit', title:'Click to Edit Task', props : { pathname:`/su/timelineview/reservation/edit/${this.state.reservation?this.state.reservation.id:null}`}}); - actions.push({ icon: 'fa fa-trash',title:'Delete Reservation', + actions.push({ icon: 'fa-edit', title:'Click to Edit Reservation', props : { pathname:`/su/timelineview/reservation/edit/${this.state.reservation?this.state.reservation.id:null}`}}); + actions.push({ icon: 'fa fa-trash',title:'Click to Delete Reservation', type: 'button', actOn: 'click', props:{ callback: this.showConfirmation}}); actions.push({ icon: 'fa-window-close', link: this.props.history.goBack, title:'Click to Close Reservation', props : { pathname:'/su/timelineview/reservation/list' }}); return ( <React.Fragment> - <PageHeader location={this.props.location} title={'Reservation - View'} actions={actions}/> + <PageHeader location={this.props.location} title={'Reservation – Details'} actions={actions}/> { this.state.isLoading? <AppLoader /> : this.state.reservation && <React.Fragment> <div className="main-content"> diff --git a/SAS/TMSS/frontend/tmss_webapp/src/routes/index.js b/SAS/TMSS/frontend/tmss_webapp/src/routes/index.js index ff63e5147e1042dfe689211027f97bd9058b4edc..51d16425402864b33f90b89e54845cb38f578780 100644 --- a/SAS/TMSS/frontend/tmss_webapp/src/routes/index.js +++ b/SAS/TMSS/frontend/tmss_webapp/src/routes/index.js @@ -53,8 +53,8 @@ export const routes = [ },{ path: "/task/view/:type/:id", component: TaskView, - name: 'Task Details', - title: 'Task Details' + name: 'Task View', + title: 'Task - View' },{ path: "/task/edit", component: TaskEdit,