Skip to content

Commit 4895f37

Browse files
committed
Align the button and error-panel timing.
1 parent 082ab6e commit 4895f37

2 files changed

Lines changed: 20 additions & 0 deletions

File tree

ehr/resources/web/ehr/panel/DataEntryErrorPanel.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ Ext4.define('EHR.panel.DataEntryErrorPanel', {
1919
this.callParent(arguments);
2020

2121
this.mon(this.storeCollection, 'validation', this.updateErrorMessages, this, {buffer: 1000});
22+
this.mon(this.storeCollection, 'validationcomplete', this.updateErrorMessages, this, {buffer: 50});
2223
this.mon(this.storeCollection, 'commitcomplete', this.updateErrorMessages, this, {buffer: 200});
2324
this.mon(this.storeCollection, 'commitexception', this.updateErrorMessages, this, {buffer: 200});
2425
},

ehr/resources/web/ehr/panel/DataEntryPanel.js

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -124,6 +124,13 @@ Ext4.define('EHR.panel.DataEntryPanel', {
124124
onValidationComplete: function(){
125125
this.validationInProgress = false;
126126
this.setValidationIndicatorVisible(false);
127+
128+
var errorPanel = this.getErrorPanel();
129+
if (errorPanel){
130+
errorPanel.updateErrorMessages();
131+
}
132+
133+
this.onStoreCollectionValidation(this.storeCollection);
127134
},
128135

129136
onStoreCollectionValidation: function(sc){
@@ -133,6 +140,10 @@ Ext4.define('EHR.panel.DataEntryPanel', {
133140

134141
this.updateDirtyStateMessage();
135142

143+
if (this.storeCollection && this.storeCollection.validationRequestsInFlight > 0){
144+
return;
145+
}
146+
136147
var maxSeverity = sc.getMaxErrorSeverity();
137148

138149
if(EHR.debug && maxSeverity)
@@ -552,6 +563,14 @@ Ext4.define('EHR.panel.DataEntryPanel', {
552563
return this.dirtyStateArea;
553564
},
554565

566+
getErrorPanel: function(){
567+
if (!this.errorPanel || this.errorPanel.isDestroyed){
568+
this.errorPanel = this.down('#errorPanel');
569+
}
570+
571+
return this.errorPanel;
572+
},
573+
555574
getValidationIndicator: function(){
556575
if (!this.validationIndicator || this.validationIndicator.isDestroyed){
557576
this.validationIndicator = this.down('#validationIndicator');

0 commit comments

Comments
 (0)