Skip to content
Snippets Groups Projects
Commit d0e29549 authored by Nithya's avatar Nithya
Browse files
Changes updated based on review comments
parent 790c29b4
No related branches found
No related tags found
1 merge request!381Resolve TMSS-624
...@@ -236,4 +236,8 @@ div[data-schemapath='root.$schema'] { ...@@ -236,4 +236,8 @@ div[data-schemapath='root.$schema'] {
.numericAgGridField { .numericAgGridField {
outline: none !important; outline: none !important;
border: none !important; border: none !important;
}
.today-calendar-btn {
display: none;
} }
\ No newline at end of file
...@@ -37,8 +37,10 @@ export default class CustomDateComp extends Component { ...@@ -37,8 +37,10 @@ export default class CustomDateComp extends Component {
d dateFormat="dd-M-yy" d dateFormat="dd-M-yy"
value= {this.state.date} value= {this.state.date}
onChange= {e => {this.updateDateChanges(e)}} onChange= {e => {this.updateDateChanges(e)}}
onBlur= {e => {this.updateDateChanges(e)}} // onBlur= {e => {this.updateDateChanges(e)}}
//data-testid="start" //data-testid="start"
todayButtonClassName="today-calendar-btn"
showButtonBar
showTime= {true} showTime= {true}
showSeconds= {true} showSeconds= {true}
hourFormat= "24" hourFormat= "24"
...@@ -48,10 +50,8 @@ export default class CustomDateComp extends Component { ...@@ -48,10 +50,8 @@ export default class CustomDateComp extends Component {
} }
updateDateChanges(e){ updateDateChanges(e){
if(e.value){ this.setState({date : e.value || ''});
this.setState({date : e.value});
}
} }
ondatechange(e){ ondatechange(e){
......
...@@ -112,17 +112,18 @@ export default class NumericEditor extends Component { ...@@ -112,17 +112,18 @@ export default class NumericEditor extends Component {
event = event || window.event; event = event || window.event;
return typeof event.which === 'undefined' ? event.keyCode : event.which; return typeof event.which === 'undefined' ? event.keyCode : event.which;
} }
isCharNumeric(charStr) { isCharNumeric(charStr) {
return !!/\d/.test(charStr); return !!/^\d*\.?\d*$/.test(charStr);
} }
isKeyPressedNumeric(event) { isKeyPressedNumeric(event) {
const charCode = this.getCharCodeFromEvent(event); const charCode = this.getCharCodeFromEvent(event);
const charStr = event.key ? event.key : String.fromCharCode(charCode); const charStr = event.key ? event.key : String.fromCharCode(charCode);
return this.isCharNumeric(charStr); return `${event.target.value + charStr}`.split('.').length <= 2 && this.isCharNumeric(charStr);
} }
render() { render() {
return ( return (
<input <input
......
...@@ -455,7 +455,7 @@ export class SchedulingSetCreate extends Component { ...@@ -455,7 +455,7 @@ export class SchedulingSetCreate extends Component {
return { backgroundColor: ''}; return { backgroundColor: ''};
} }
}, }; }, };
cellProps['angle3'] = {isgroup: true, cellStyle: function(params) { if (params.value){ cellProps['angle3'] = {isgroup: true, cellEditor: 'numericEditor',cellStyle: function(params) { if (params.value){
if (!params.colDef.field.startsWith('gdef') && !Number(params.value)) { if (!params.colDef.field.startsWith('gdef') && !Number(params.value)) {
return { backgroundColor: BG_COLOR}; return { backgroundColor: BG_COLOR};
} }
...@@ -586,7 +586,7 @@ export class SchedulingSetCreate extends Component { ...@@ -586,7 +586,7 @@ export class SchedulingSetCreate extends Component {
} }
} }
}, }, }, },
{headerName: 'Offset Window From',field: 'offset_from', cellStyle: function(params) { {headerName: 'Offset Window From',field: 'offset_from', cellEditor: 'numericEditor',cellStyle: function(params) {
if (params.value){ if (params.value){
if (params.value === 'undefined' || params.value === ''){ if (params.value === 'undefined' || params.value === ''){
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment