Skip to content
Snippets Groups Projects
Commit 15d3aaff authored by Muthukrishnanmatriot's avatar Muthukrishnanmatriot
Browse files

Updated the code for review comments

parent f2e5954a
No related branches found
No related tags found
1 merge request!415Resolve TMSS-678
{
// 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
......@@ -963,7 +963,7 @@ function ViewTable(props) {
},
disableFilters: true,
disableSortBy: true,
isVisible: defaultdataheader.includes(props.keyaccessor),
isVisible: true,
});
}
......
......@@ -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>
......
......@@ -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,
......
......@@ -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}
......
......@@ -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">
......
......@@ -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,
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment