Skip to content
Snippets Groups Projects
Commit 1c897d7a authored by Muthukrishnan's avatar Muthukrishnan
Browse files

TMSS-472 - implemented reservation create

implemented reservation create
parent f7a87395
Branches
Tags
1 merge request!312Resolve TMSS-472
......@@ -50,6 +50,11 @@ function Jeditor(props) {
let defKey = refUrl.substring(refUrl.lastIndexOf("/")+1);
schema.definitions[defKey] = (await $RefParser.resolve(refUrl)).get(newRef);
property["$ref"] = newRef;
if(schema.definitions[defKey].type && schema.definitions[defKey].type === 'array'){
let resolvedItems = await resolveSchema(schema.definitions[defKey].items);
schema.definitions = {...schema.definitions, ...resolvedItems.definitions};
delete resolvedItems['definitions'];
}
} else if(property["type"] === "array") { // reference in array items definition
let resolvedItems = await resolveSchema(property["items"]);
schema.definitions = {...schema.definitions, ...resolvedItems.definitions};
......
import {TimelineView} from './view';
import {WeekTimelineView} from './week.view';
import { ReservationCreate } from './reservation.create';
export {TimelineView, WeekTimelineView} ;
export {TimelineView, WeekTimelineView, ReservationCreate} ;
This diff is collapsed.
......@@ -326,7 +326,10 @@ export class TimelineView extends Component {
return (
<React.Fragment>
<PageHeader location={this.props.location} title={'Scheduling Units - Timeline View'}
actions={[{icon: 'fa-calendar-alt',title:'Week View', props : { pathname: `/su/timelineview/week`}}]}/>
actions={[
{icon: 'fa-plus-square',title:'Add Reservation', props : { pathname: `/su/timelineview/reservation/create`}},
{icon: 'fa-calendar-alt',title:'Week View', props : { pathname: `/su/timelineview/week`}},
]}/>
{ this.state.isLoading ? <AppLoader /> :
<div className="p-grid">
{/* SU List Panel */}
......
......@@ -312,7 +312,9 @@ export class WeekTimelineView extends Component {
return (
<React.Fragment>
<PageHeader location={this.props.location} title={'Scheduling Units - Week View'}
actions={[{icon: 'fa-clock',title:'View Timeline', props : { pathname: `/su/timelineview`}}]}/>
actions={[
{icon: 'fa-plus-square',title:'Add Reservation', props : { pathname: `/su/timelineview/reservation/create`}},
{icon: 'fa-clock',title:'View Timeline', props : { pathname: `/su/timelineview`}}]}/>
{ this.state.isLoading ? <AppLoader /> :
<>
{/* <div className="p-field p-grid">
......
......@@ -14,7 +14,7 @@ import ViewSchedulingUnit from './Scheduling/ViewSchedulingUnit'
import SchedulingUnitCreate from './Scheduling/create';
import EditSchedulingUnit from './Scheduling/edit';
import { CycleList, CycleCreate, CycleView, CycleEdit } from './Cycle';
import {TimelineView, WeekTimelineView} from './Timeline';
import {TimelineView, WeekTimelineView, ReservationCreate} from './Timeline';
import SchedulingSetCreate from './Scheduling/create.scheduleset';
import Workflow from './Workflow';
......@@ -159,7 +159,12 @@ export const routes = [
name: 'Workflow',
title: 'QA Reporting (TO)'
},
{
path: "/su/timelineview/reservation/create",
component: ReservationCreate,
name: 'Reservation Add',
title: 'Reservation - Add'
}
];
export const RoutedContent = () => {
......
const axios = require('axios');
//axios.defaults.baseURL = 'http://192.168.99.100:8008/api';
axios.defaults.headers.common['Authorization'] = 'Basic dGVzdDp0ZXN0';
const ReservationService = {
getReservation: async function () {
try {
const url = `/api/reservation_template`;
const response = await axios.get(url);
return response.data.results;
} catch (error) {
console.error(error);
}
},
saveReservation: async function (reservation) {
try {
const response = await axios.post(('/api/reservation/'), reservation);
return response.data;
} catch (error) {
console.error(error);
return null;
}
}
}
export default ReservationService;
import _ from 'lodash';
const UnitConverter = {
resourceUnitMap: {'time':{display: 'Hours', conversionFactor: 3600, mode:'decimal', minFractionDigits:0, maxFractionDigits: 2 },
'bytes': {display: 'TB', conversionFactor: (1024*1024*1024*1024), mode:'decimal', minFractionDigits:0, maxFractionDigits: 3},
......@@ -29,6 +31,13 @@ const UnitConverter = {
}
return seconds;
},
getHHmmssToSecs: function(seconds) {
if (seconds) {
const strSeconds = _.split(seconds, ":");
return strSeconds[0]*3600 + strSeconds[1]*60 + Number(strSeconds[2]);
}
return 0;
},
radiansToDegree: function(object) {
for(let type in object) {
if (type === 'transit_offset') {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment